{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-code-editor",
  "type": "registry:block",
  "title": "Code editor",
  "description": "Editing a script on a raised page: files beside the editor with line numbers and colouring, a test run with its output and problems, and saving or restoring a version.",
  "dependencies": [
    "@remixicon/react@^4.9.0"
  ],
  "registryDependencies": [
    "https://wideset.co/r/app-shell.json",
    "https://wideset.co/r/avatar.json",
    "https://wideset.co/r/block-styles.json",
    "https://wideset.co/r/breadcrumbs.json",
    "https://wideset.co/r/button.json",
    "https://wideset.co/r/divider.json",
    "https://wideset.co/r/dropdown-menu.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/list-item.json",
    "https://wideset.co/r/modal.json",
    "https://wideset.co/r/sidebar.json",
    "https://wideset.co/r/tabs.json",
    "https://wideset.co/r/text-input.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/code-editor/brand-mark.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/brand-mark.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nconst TILE =\n  'M0 16C0 8.45753 0 4.68629 2.34315 2.34315C4.68629 0 8.45753 0 16 0C23.5425 0 27.3137 0 29.6569 2.34315C32 4.68629 32 8.45753 32 16C32 23.5425 32 27.3137 29.6569 29.6569C27.3137 32 23.5425 32 16 32C8.45753 32 4.68629 32 2.34315 29.6569C0 27.3137 0 23.5425 0 16Z';\n\n/**\n * Orbit's mark: a planet and its ring on the inverse tile, so it inverts in dark mode. It takes\n * the size of its place (32px in a sidebar, 36px in a larger switcher). Decorative beside the\n * product's name; give it a `label` when it stands alone.\n */\nexport function BrandMark({ className, label }: { className?: string; label?: string }) {\n  return (\n    <svg\n      viewBox=\"0 0 32 32\"\n      role={label ? 'img' : undefined}\n      aria-label={label}\n      aria-hidden={label ? undefined : true}\n      className={cn('size-ws-14 shrink-0', className)}\n    >\n      <path d={TILE} className=\"fill-(--ws-static-fill-inverse-background)\" />\n      <ellipse\n        cx=\"16\"\n        cy=\"16\"\n        rx=\"10.5\"\n        ry=\"4\"\n        transform=\"rotate(-28 16 16)\"\n        strokeWidth=\"1.75\"\n        className=\"fill-none stroke-(--ws-static-text-inverse-strong)\"\n      />\n      <circle cx=\"16\" cy=\"16\" r=\"4.75\" className=\"fill-(--ws-static-text-inverse-strong)\" />\n    </svg>\n  );\n}\n"
    },
    {
      "path": "src/blocks/code-editor/code-editor.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/code-editor.tsx",
      "content": "'use client';\n\n// TODO(custom): a code editor (line numbers, colouring, current line, problem marks) as a textarea over a coloured copy; Wideset has no code editor.\nimport { cn } from '@/lib/wideset/utils';\nimport { type KeyboardEvent, useEffect, useId, useLayoutEffect, useRef, useState } from 'react';\n\nimport type { ScriptFile } from './data';\nimport { type Token, tokenize, type TokenKind } from './highlight';\nimport type { Problem } from './lint';\n\nconst INDENT = '  ';\n\n/** The textarea and its coloured copy share every metric, so the caret sits on the letters. */\nconst CODE = 'typography-body-md tracking-ws-normal whitespace-pre font-ws-mono';\nconst PAD = 'py-ws-5 pl-ws-7 pr-ws-9';\n\n/**\n * Two colours and a grey: keywords one, literals (strings and numbers) the other, comments the\n * quiet grey; plain code keeps the text colour. The two are text tokens that read in both\n * themes. The decorative set has none: its text (`*-on-subtle`) is near black in light, its\n * strong fills too dark on the dark editor.\n */\nconst COLOUR: Record<TokenKind, string> = {\n  keyword: 'text-ws-semantic-info',\n  string: 'text-ws-semantic-positive',\n  number: 'text-ws-semantic-positive',\n  comment: 'text-ws-static-subtle',\n  plain: 'text-ws-static-strong',\n};\n\nconst MARK: Record<Problem['severity'], string> = {\n  error: 'underline decoration-wavy decoration-ws-semantic-negative',\n  warning: 'underline decoration-wavy decoration-ws-semantic-notice',\n};\n\n/** Where the caret should land: a problem's line and column (1-based); `key` re-runs it. */\nexport type Reveal = { line: number; column: number; key: number };\n\ntype Piece = { from: number; to: number; kind: TokenKind; mark?: Problem['severity'] };\n\n/** A line cut at every token and problem edge, so a mark can cover part of a token. */\nfunction pieces(line: string, tokens: Token[], problems: Problem[]): Piece[] {\n  const marks = problems.map((problem) => ({\n    from: problem.column - 1,\n    to: problem.column - 1 + problem.length,\n    severity: problem.severity,\n  }));\n  const cuts = [\n    ...new Set([\n      0,\n      line.length,\n      ...tokens.map((t) => t.start),\n      ...marks.flatMap((m) => [m.from, m.to]),\n    ]),\n  ]\n    .filter((at) => at >= 0 && at <= line.length)\n    .sort((a, b) => a - b);\n  const reversedTokens = [...tokens].reverse();\n  return cuts.slice(0, -1).map((from, index) => ({\n    from,\n    to: cuts[index + 1],\n    kind: reversedTokens.find((token) => token.start <= from)?.kind ?? 'plain',\n    mark: marks.find((mark) => mark.from <= from && from < mark.to)?.severity,\n  }));\n}\n\ntype CodeEditorProps = {\n  file: ScriptFile;\n  value: string;\n  onChange: (value: string) => void;\n  /** This file's problems, marked under the code. */\n  problems: Problem[];\n  reveal?: Reveal;\n};\n\n/**\n * The editor: a plain textarea, its text transparent, over a coloured copy of the same text, so\n * typing, selecting, copying and the screen reader all work as in any field while the copy shows\n * the colours, the current line and wavy marks under problems. The line numbers follow the text.\n * Tab indents (Shift+Tab outdents) and Enter keeps the indent; Escape, then Tab, leaves the field.\n */\nexport function CodeEditor({ file, value, onChange, problems, reveal }: CodeEditorProps) {\n  const area = useRef<HTMLTextAreaElement>(null);\n  const copy = useRef<HTMLPreElement>(null);\n  const pending = useRef<[number, number] | null>(null);\n  const escaped = useRef(false);\n  const hintId = useId();\n  const [caretLine, setCaretLine] = useState(0);\n  const lines = value.split('\\n');\n\n  // After an edit made here, the caret goes where the edit left it.\n  useLayoutEffect(() => {\n    if (!pending.current || !area.current) return;\n    area.current.setSelectionRange(...pending.current);\n    pending.current = null;\n  });\n\n  // A problem clicked in the panel puts the caret on it and brings its line into view.\n  useEffect(() => {\n    const field = area.current;\n    if (!reveal || !field) return;\n    const before = field.value.split('\\n').slice(0, reveal.line - 1);\n    const offset = before.reduce((sum, line) => sum + line.length + 1, 0) + reveal.column - 1;\n    field.focus();\n    field.setSelectionRange(offset, offset);\n    setCaretLine(reveal.line - 1);\n    copy.current?.children[reveal.line - 1]?.scrollIntoView?.({ block: 'center' });\n  }, [reveal]);\n\n  const followCaret = () => {\n    const field = area.current;\n    if (field) setCaretLine(field.value.slice(0, field.selectionStart).split('\\n').length - 1);\n  };\n\n  // ponytail: edits made here (Tab, Enter) skip the browser's undo stack; keep a history of\n  // values if Ctrl+Z over them matters.\n  const edit = (next: string, start: number, end = start) => {\n    pending.current = [start, end];\n    onChange(next);\n  };\n\n  const onKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n    const { selectionStart: from, selectionEnd: to, value: text } = event.currentTarget;\n    const leaving = escaped.current;\n    escaped.current = event.key === 'Escape';\n    const plain = !event.altKey && !event.ctrlKey && !event.metaKey;\n    const lineStart = text.lastIndexOf('\\n', from - 1) + 1;\n\n    if (event.key === 'Enter' && plain && !event.shiftKey) {\n      event.preventDefault();\n      let indent = /^ */.exec(text.slice(lineStart, from))![0];\n      if (/[{([]\\s*$/.test(text.slice(lineStart, from))) indent += INDENT;\n      edit(`${text.slice(0, from)}\\n${indent}${text.slice(to)}`, from + 1 + indent.length);\n      return;\n    }\n\n    if (event.key !== 'Tab' || leaving || !plain) return;\n    event.preventDefault();\n    if (from === to && !event.shiftKey) {\n      edit(text.slice(0, from) + INDENT + text.slice(to), from + INDENT.length);\n      return;\n    }\n    // A selection, or Shift+Tab: every line it touches moves by one step.\n    const block = text.slice(lineStart, to).split('\\n');\n    const moved = block.map((line) =>\n      event.shiftKey ? line.replace(/^ {1,2}/, '') : INDENT + line,\n    );\n    const start = Math.max(lineStart, from + moved[0].length - block[0].length);\n    const end = to + moved.join('\\n').length - block.join('\\n').length;\n    edit(\n      text.slice(0, lineStart) + moved.join('\\n') + text.slice(to),\n      start,\n      from === to ? start : end,\n    );\n  };\n\n  return (\n    <div className=\"ws-scrollbar min-h-0 flex-1 overflow-auto\">\n      <div className=\"flex min-h-full w-max min-w-full\">\n        {/* Numbers stay put while long lines scroll sideways. */}\n        <div\n          aria-hidden=\"true\"\n          className={cn(\n            CODE,\n            'bg-ws-static-foreground py-ws-5 pl-ws-9 pr-ws-3 z-ws-base left-ws-0 sticky text-right tabular-nums select-none',\n          )}\n        >\n          {lines.map((_, index) => (\n            <div\n              key={index}\n              className={index === caretLine ? 'text-ws-static-strong' : 'text-ws-static-subtle'}\n            >\n              {index + 1}\n            </div>\n          ))}\n        </div>\n\n        <div className=\"relative min-w-0 flex-1\">\n          <pre ref={copy} aria-hidden=\"true\" className={cn(CODE, 'py-ws-5')}>\n            {lines.map((line, index) => {\n              const here = problems.filter((problem) => problem.line === index + 1);\n              const tokens: Token[] =\n                file.language === 'js' ? tokenize(line) : [{ kind: 'plain', start: 0, text: line }];\n              return (\n                <div\n                  key={index}\n                  className={cn(\n                    'pl-ws-7 pr-ws-9',\n                    index === caretLine && 'bg-ws-static-alpha-subtle',\n                  )}\n                >\n                  {line === ''\n                    ? ' '\n                    : pieces(line, tokens, here).map((piece) => (\n                        <span\n                          key={piece.from}\n                          className={cn(COLOUR[piece.kind], piece.mark && MARK[piece.mark])}\n                        >\n                          {line.slice(piece.from, piece.to)}\n                        </span>\n                      ))}\n                </div>\n              );\n            })}\n          </pre>\n          <textarea\n            ref={area}\n            value={value}\n            wrap=\"off\"\n            spellCheck={false}\n            autoCapitalize=\"off\"\n            autoComplete=\"off\"\n            autoCorrect=\"off\"\n            aria-label={`Code of ${file.name}`}\n            aria-describedby={hintId}\n            onChange={(event) => onChange(event.target.value)}\n            onKeyDown={onKeyDown}\n            onSelect={followCaret}\n            className={cn(\n              CODE,\n              PAD,\n              'inset-ws-0 absolute resize-none overflow-hidden border-0 bg-transparent text-transparent caret-(--ws-static-text-strong) outline-hidden',\n            )}\n          />\n          <p id={hintId} className=\"sr-only\">\n            Tab indents and Shift+Tab outdents. Press Escape, then Tab, to leave the editor.\n          </p>\n        </div>\n      </div>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/code-editor/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/data.ts",
      "content": "import {\n  type RemixiconComponentType,\n  RiBankCardLine,\n  RiContactsBook3Line,\n  RiFlowChart,\n  RiHandCoinLine,\n  RiHome5Line,\n  RiInbox2Line,\n  RiKey2Line,\n  RiLineChartLine,\n  RiPieChart2Line,\n  RiPlugLine,\n  RiQuestionLine,\n  RiSettings3Line,\n  RiTeamLine,\n} from '@remixicon/react';\nimport type { AvatarColor } from '@/components/ui/wideset/avatar/Avatar.colors';\n\n/*\n  The Lead scoring automation's code step: score-lead.js scores each new lead from 0 to 100, and\n  Orbit routes a lead that scores 70 or more to sales. Version 4 was saved by Maya at 10:12 today;\n  it is 10:14 now. The sample lead is Halcyon Freight, which this version scores 77.\n*/\n\n/** The product is Orbit; the workspace is Lumen Studio. */\nexport const product = { name: 'Orbit' };\nexport const workspace = { name: 'Lumen Studio', initials: 'LS' };\nexport const account = { name: 'Maya Okafor', email: 'maya@lumenstudio.co', initials: 'MO' };\n\nexport type NavLink = {\n  id: string;\n  label: string;\n  icon: RemixiconComponentType;\n  /** The icon while the page is open (a line icon swaps for its fill). */\n  activeIcon?: RemixiconComponentType;\n};\n\nexport const mainLinks: NavLink[] = [\n  { id: 'home', label: 'Home', icon: RiHome5Line },\n  { id: 'inbox', label: 'Inbox', icon: RiInbox2Line },\n  { id: 'customers', label: 'Customers', icon: RiContactsBook3Line },\n  { id: 'deals', label: 'Deals', icon: RiHandCoinLine },\n  { id: 'revenue', label: 'Revenue', icon: RiLineChartLine },\n  { id: 'reports', label: 'Reports', icon: RiPieChart2Line },\n  { id: 'automations', label: 'Automations', icon: RiFlowChart },\n];\n\nexport const settingsLinks: NavLink[] = [\n  { id: 'general', label: 'General', icon: RiSettings3Line },\n  { id: 'members', label: 'Members', icon: RiTeamLine },\n  { id: 'billing', label: 'Billing', icon: RiBankCardLine },\n  { id: 'integrations', label: 'Integrations', icon: RiPlugLine },\n  { id: 'api-keys', label: 'API keys', icon: RiKey2Line },\n];\n\nexport const helpLink: NavLink = { id: 'help', label: 'Help and support', icon: RiQuestionLine };\n\n/** \"Now\" for every time on the page, so the screen reads the same on any day. */\nexport const NOW = '2026-11-10T10:14:00Z';\n\nexport type Person = { name: string; initials: string; color?: AvatarColor };\n\nexport const PEOPLE = {\n  maya: { name: account.name, initials: account.initials, color: 'orange' },\n  jonas: { name: 'Jonas Weber', initials: 'JW' },\n  priya: { name: 'Priya Raman', initials: 'PR' },\n} satisfies Record<string, Person>;\n\nexport type PersonId = keyof typeof PEOPLE;\n\nexport type FileId = 'score-lead' | 'helpers' | 'readme';\n\nexport type ScriptFile = {\n  id: FileId;\n  name: string;\n  /** Its folder inside the step, if any. */\n  folder?: string;\n  /** JavaScript is coloured and checked; Markdown is plain text. */\n  language: 'js' | 'md';\n};\n\nexport const FILES: ScriptFile[] = [\n  { id: 'score-lead', name: 'score-lead.js', language: 'js' },\n  { id: 'helpers', name: 'helpers.js', folder: 'lib', language: 'js' },\n  { id: 'readme', name: 'README.md', language: 'md' },\n];\n\nexport const fileById = (id: FileId) => FILES.find((file) => file.id === id)!;\n\nexport type Sources = Record<FileId, string>;\n\nconst SCORE_LEAD = `// Scores a new lead from 0 to 100. Orbit runs this step in\n// Lead scoring and sends leads that score 70 or more to sales.\nimport { clamp, daysSince } from './lib/helpers.js';\n\nconst TARGET_INDUSTRIES = ['Logistics', 'Healthcare', 'Energy'];\n\nexport default function scoreLead(lead, { log }) {\n  let score = 0;\n  const region = lead.country === 'US' ? 'na' : 'intl';\n\n  if (lead.employees >= 200) score += 25;\n  else if (lead.employees >= 50) score += 15;\n\n  if (TARGET_INDUSTRIES.includes(lead.industry)) score += 20;\n  if (lead.source === 'Referral') score += 30;\n\n  // Visits show intent; a lead gone quiet cools off.\n  score += Math.min(lead.visits * 2, 20);\n  if (daysSince(lead.lastSeen) > 30) score -= 10;\n\n  log(\\`Scored \\${lead.company}: \\${score}\\`);\n  return clamp(score, 0, 100);\n}\n`;\n\nconst HELPERS = `// Small helpers shared by the steps in Lead scoring.\nconst DAY = 24 * 60 * 60 * 1000;\n\n/** Keeps a number between two bounds. */\nexport function clamp(value, min, max) {\n  return Math.min(Math.max(value, min), max);\n}\n\n/** Whole days between an ISO date and now. */\nexport function daysSince(iso) {\n  return Math.floor((Date.now() - Date.parse(iso)) / DAY);\n}\n`;\n\nconst README = `# Lead scoring\n\nScores every new lead from 0 to 100 when it enters Orbit.\nLeads that score 70 or more go to the sales queue; the rest\nstay in nurture.\n\n## Files\n\n- score-lead.js: the step Orbit runs for each lead.\n- lib/helpers.js: helpers shared by the steps.\n\n## Testing\n\nRun test scores the sample lead, Halcyon Freight.\nChange the sample in the workflow's test data.\n`;\n\nexport type Version = {\n  number: number;\n  /** ISO date and time it was saved. */\n  savedAt: string;\n  by: PersonId;\n  /** Set when the version is an older one brought back. */\n  restoredFrom?: number;\n  sources: Sources;\n};\n\nconst v4: Sources = { 'score-lead': SCORE_LEAD, helpers: HELPERS, readme: README };\nconst v3: Sources = { ...v4, 'score-lead': SCORE_LEAD.replace('score += 30', 'score += 25') };\nconst v2: Sources = {\n  ...v3,\n  'score-lead': v3['score-lead'].replace('  if (daysSince(lead.lastSeen) > 30) score -= 10;\\n', ''),\n};\nconst v1: Sources = {\n  ...v2,\n  'score-lead': v2['score-lead'].replace(\"'Logistics', 'Healthcare', 'Energy'\", \"'Logistics'\"),\n};\n\n/** Newest first, as the history menu lists them. */\nexport const VERSIONS: Version[] = [\n  { number: 4, savedAt: '2026-11-10T10:12:00Z', by: 'maya', sources: v4 },\n  { number: 3, savedAt: '2026-11-09T16:40:00Z', by: 'jonas', sources: v3 },\n  { number: 2, savedAt: '2026-11-06T11:05:00Z', by: 'priya', sources: v2 },\n  { number: 1, savedAt: '2026-11-02T09:30:00Z', by: 'maya', sources: v1 },\n];\n\n/** The record Run test scores: one of the workspace's real leads, as Orbit passes it in. */\nexport const SAMPLE_LEAD = {\n  company: 'Halcyon Freight',\n  employees: 120,\n  industry: 'Logistics',\n  country: 'US',\n  source: 'Referral',\n  visits: 6,\n  lastSeen: '2026-11-08',\n};\n"
    },
    {
      "path": "src/blocks/code-editor/file-tree.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/file-tree.tsx",
      "content": "'use client';\n\n// TODO(custom): the step's files as a tree with a search over it (folders that fold, the open file selected, unsaved marked); Wideset has no tree view.\nimport {\n  RiArrowDownSLine,\n  RiArrowRightSLine,\n  RiFolderLine,\n  RiFolderOpenLine,\n  RiJavascriptLine,\n  RiMarkdownLine,\n  RiSearchLine,\n} from '@remixicon/react';\nimport { cn } from '@/lib/wideset/utils';\nimport { TextInput } from '@/components/ui/wideset/text-input/TextInput';\nimport { type ReactNode, useState } from 'react';\n\nimport { type FileId, FILES, type ScriptFile } from './data';\n\nconst ROOT = 'lead-scoring';\nconst ROW =\n  'gap-ws-3 px-ws-5 h-ws-14 rounded-ws-control-lg typography-label-sm flex w-full items-center text-left focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default';\n/** A level in: the guide line sits under the chevron above, the rows start under its icon. */\nconst NESTED = 'ml-ws-9 pl-ws-3 border-ws-static-subtle border-l';\nconst ICON = 'size-ws-9 text-ws-static-subtle shrink-0';\n\n/** Folders first, then files, each by name, as an editor's explorer lists them. */\nconst byName = (a: string, b: string) => a.localeCompare(b, 'en-US', { sensitivity: 'base' });\n\ntype FileTreeProps = {\n  /** The file in the editor. */\n  active: FileId;\n  /** Files whose text differs from the saved version. */\n  unsaved: FileId[];\n  onOpen: (id: FileId) => void;\n};\n\n/**\n * The step's files, in their own pane of the editor box: a search on top, on the line of the\n * editor's tabs, and the tree under it. Folders fold with a chevron; a file is a button that opens\n * it in the editor, with its kind as a quiet icon. The open file takes the selected treatment (the\n * brand tint); a file with unsaved changes carries a dot, as its tab does. Typing narrows the tree\n * to the files whose path matches, with their folders open.\n */\nexport function FileTree({ active, unsaved, onOpen }: FileTreeProps) {\n  const [query, setQuery] = useState('');\n  const [closed, setClosed] = useState<string[]>([]);\n\n  const needle = query.trim().toLowerCase();\n  const shown = FILES.filter((file) =>\n    [file.folder, file.name].join('/').toLowerCase().includes(needle),\n  );\n  const folders = [...new Set(shown.flatMap((file) => file.folder ?? []))].sort(byName);\n  const rootFiles = shown.filter((file) => !file.folder).sort((a, b) => byName(a.name, b.name));\n  // A search opens every folder it found something in.\n  const isOpen = (path: string) => needle !== '' || !closed.includes(path);\n  const toggle = (path: string) =>\n    setClosed(closed.includes(path) ? closed.filter((p) => p !== path) : [...closed, path]);\n\n  const fileRow = (file: ScriptFile) => {\n    const Icon = file.language === 'js' ? RiJavascriptLine : RiMarkdownLine;\n    return (\n      <li key={file.id}>\n        <button\n          type=\"button\"\n          aria-current={file.id === active ? 'true' : undefined}\n          onClick={() => onOpen(file.id)}\n          className={cn(\n            ROW,\n            'text-ws-static-strong hover:bg-ws-dynamic-tertiary-alpha-strong-default aria-[current=true]:bg-ws-dynamic-primary-alpha-strong-default',\n          )}\n        >\n          {/* No chevron on a file: the space keeps its icon in line with a folder's. */}\n          <span aria-hidden=\"true\" className=\"size-ws-9 shrink-0\" />\n          <Icon aria-hidden=\"true\" className={ICON} />\n          <span className=\"ml-ws-2 min-w-0 flex-1 truncate\">{file.name}</span>\n          {unsaved.includes(file.id) && (\n            <span className=\"bg-ws-static-inverse-background size-ws-4 rounded-ws-control-full shrink-0\">\n              <span className=\"sr-only\">Unsaved changes</span>\n            </span>\n          )}\n        </button>\n      </li>\n    );\n  };\n\n  const folderRow = (name: string, path: string, children: ReactNode) => {\n    const open = isOpen(path);\n    const Chevron = open ? RiArrowDownSLine : RiArrowRightSLine;\n    const Icon = open ? RiFolderOpenLine : RiFolderLine;\n    return (\n      <li key={path}>\n        <button\n          type=\"button\"\n          aria-expanded={open}\n          onClick={() => toggle(path)}\n          className={cn(\n            ROW,\n            'text-ws-static-base hover:bg-ws-dynamic-tertiary-alpha-strong-default',\n          )}\n        >\n          <Chevron aria-hidden=\"true\" className={ICON} />\n          <Icon aria-hidden=\"true\" className={ICON} />\n          <span className=\"ml-ws-2 min-w-0 flex-1 truncate\">{name}</span>\n        </button>\n        {open && <ul className={NESTED}>{children}</ul>}\n      </li>\n    );\n  };\n\n  return (\n    <nav\n      aria-label=\"Files\"\n      className=\"border-ws-static-base flex min-h-0 flex-col border-b md:border-r md:border-b-0\"\n    >\n      {/* As tall as the tab row beside it, so the two lines under them meet. The field has no box\n          of its own: the band is its box, as the tab row is the tabs'. A bordered field would sit\n          4px from the band's lines and 8px from its sides, a box crammed into a box. */}\n      <div className=\"h-ws-16 px-ws-5 border-ws-static-subtle flex shrink-0 items-center border-b\">\n        <TextInput\n          size=\"sm\"\n          preset=\"ghost\"\n          className=\"w-full\"\n          value={query}\n          onChange={(event) => setQuery(event.target.value)}\n        >\n          <TextInput.Prefix inner>\n            <TextInput.Icon icon={RiSearchLine} />\n          </TextInput.Prefix>\n          <TextInput.Input type=\"search\" placeholder=\"Search files\" aria-label=\"Search files\" />\n          <TextInput.Suffix inner>\n            <TextInput.ClearButton aria-label=\"Clear search\" />\n          </TextInput.Suffix>\n        </TextInput>\n      </div>\n\n      <div className=\"p-ws-5 ws-scrollbar min-h-0 flex-1 overflow-y-auto\">\n        {shown.length > 0 ? (\n          <ul>\n            {folderRow(ROOT, ROOT, [\n              ...folders.map((folder) =>\n                folderRow(\n                  folder,\n                  `${ROOT}/${folder}`,\n                  shown\n                    .filter((file) => file.folder === folder)\n                    .sort((a, b) => byName(a.name, b.name))\n                    .map(fileRow),\n                ),\n              ),\n              ...rootFiles.map(fileRow),\n            ])}\n          </ul>\n        ) : (\n          <p role=\"status\" className=\"typography-body-sm text-ws-static-subtle px-ws-5 py-ws-4\">\n            No files match “{query.trim()}”\n          </p>\n        )}\n      </div>\n    </nav>\n  );\n}\n"
    },
    {
      "path": "src/blocks/code-editor/format.ts",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/format.ts",
      "content": "import { NOW } from './data';\n\n// One locale for the whole screen; swap it for the user's.\nconst LOCALE = 'en-US';\nconst MINUTE = 60 * 1000;\nconst DAY = 24 * 60 * MINUTE;\n\nconst time = new Intl.DateTimeFormat(LOCALE, { timeStyle: 'short', timeZone: 'UTC' });\nconst day = new Intl.DateTimeFormat(LOCALE, { month: 'short', day: 'numeric', timeZone: 'UTC' });\nconst clock = new Intl.DateTimeFormat(LOCALE, {\n  hour: '2-digit',\n  minute: '2-digit',\n  second: '2-digit',\n  fractionalSecondDigits: 3,\n  hourCycle: 'h23',\n  timeZone: 'UTC',\n});\nconst ago = new Intl.RelativeTimeFormat(LOCALE, { numeric: 'auto' });\n\nconst daysAgo = (iso: string) =>\n  Math.round((Date.parse(NOW.slice(0, 10)) - Date.parse(iso.slice(0, 10))) / DAY);\n\n/** \"Today, 10:12 AM\", \"Yesterday, 4:40 PM\", \"Nov 6, 11:05 AM\": when a version was saved. */\nexport const formatSavedAt = (iso: string) => {\n  const days = daysAgo(iso);\n  const at = time.format(new Date(iso));\n  if (days === 0) return `Today, ${at}`;\n  if (days === 1) return `Yesterday, ${at}`;\n  return `${day.format(new Date(iso))}, ${at}`;\n};\n\n/** \"today at 10:12 AM\", \"yesterday at 4:40 PM\", \"on Nov 6 at 11:05 AM\": the same, in a sentence. */\nexport const formatWhen = (iso: string) => {\n  const days = daysAgo(iso);\n  const at = time.format(new Date(iso));\n  if (days === 0) return `today at ${at}`;\n  if (days === 1) return `yesterday at ${at}`;\n  return `on ${day.format(new Date(iso))} at ${at}`;\n};\n\n/** \"Saved just now\", \"Saved 2 minutes ago\": the header's save state. */\nexport const formatSaved = (iso: string) => {\n  const minutes = Math.round((Date.parse(NOW) - Date.parse(iso)) / MINUTE);\n  return minutes < 1 ? 'Saved just now' : `Saved ${ago.format(-minutes, 'minute')}`;\n};\n\n/** 10:14:06.204: a log line's moment, to the millisecond. */\nexport const formatClock = (date: Date) => clock.format(date);\n"
    },
    {
      "path": "src/blocks/code-editor/highlight.ts",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/highlight.ts",
      "content": "// TODO(custom): a small JavaScript tokenizer for the editor's colouring and checks; Wideset has no code editor.\n\nexport type TokenKind = 'comment' | 'string' | 'number' | 'keyword' | 'plain';\n\n/** A run of one line's text, from `start`, and what it is. */\nexport type Token = { kind: TokenKind; start: number; text: string };\n\n/*\n  One alternation, tried left to right at each place: a comment wins over everything inside it,\n  then a string (its closing quote optional, so an unclosed one still reads as a string), a\n  number, a keyword. What matches none of them is plain code.\n*/\nconst TOKEN =\n  /(\\/\\/.*|\\/\\*.*?\\*\\/)|('(?:\\\\.|[^'\\\\])*'?|\"(?:\\\\.|[^\"\\\\])*\"?|`(?:\\\\.|[^`\\\\])*`?)|(\\b\\d+(?:\\.\\d+)?\\b)|(\\b(?:async|await|break|case|catch|const|default|else|export|false|for|from|function|if|import|in|let|new|null|of|return|switch|throw|true|try|undefined|var|while)\\b)/g;\n\nconst KIND: TokenKind[] = ['comment', 'string', 'number', 'keyword'];\n\n/**\n * One line of JavaScript as runs of comment, string, number, keyword and plain code. Line by\n * line, so the editor redraws only text and the checks can point at a line and column.\n */\nexport function tokenize(line: string): Token[] {\n  // ponytail: a block comment or template string spanning lines colours as code after its first\n  // line; a real lexer if scripts grow past a page.\n  const tokens: Token[] = [];\n  let at = 0;\n  for (const match of line.matchAll(TOKEN)) {\n    const start = match.index;\n    if (start > at) tokens.push({ kind: 'plain', start: at, text: line.slice(at, start) });\n    tokens.push({ kind: KIND[match.slice(1).findIndex(Boolean)], start, text: match[0] });\n    at = start + match[0].length;\n  }\n  if (at < line.length) tokens.push({ kind: 'plain', start: at, text: line.slice(at) });\n  return tokens;\n}\n"
    },
    {
      "path": "src/blocks/code-editor/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/index.tsx",
      "content": "'use client';\n\nimport '@/styles/wideset-blocks.css';\n\nimport { RiSideBarLine } from '@remixicon/react';\nimport { AppShell } from '@/components/ui/wideset/app-shell/AppShell';\nimport { Breadcrumbs } from '@/components/ui/wideset/breadcrumbs/Breadcrumbs';\nimport { cn } from '@/lib/wideset/utils';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { Tabs } from '@/components/ui/wideset/tabs/Tabs';\nimport { useEffect, useId, useMemo, useRef, useState } from 'react';\n\nimport { CodeEditor, type Reveal } from './code-editor';\nimport { fileById, type FileId, FILES, NOW, type Sources, type Version, VERSIONS } from './data';\nimport { FileTree } from './file-tree';\nimport { formatSaved } from './format';\nimport { lint, type Problem } from './lint';\nimport { OutputPanel, type OutputTab } from './output-panel';\nimport { PageHeader } from './page-header';\nimport type { FileProblem } from './problem-list';\nimport { RestoreDialog } from './restore-dialog';\nimport { CodeEditorSidebar } from './sidebar';\nimport { runTest, type TestRun } from './test-run';\n\n/** One column of the page: the header and the body share its edges. */\nconst COLUMN = 'px-ws-14 mx-auto w-full max-w-[80rem]';\n/** How long the test runner takes to answer. */\nconst RUN_DELAY = 900;\n\n/**\n * The page inside the card. It holds the saved versions and the text being edited, so the save\n * state, the tabs' unsaved dots, the problems and a test run all read from one place.\n */\nfunction EditorPage() {\n  const [versions, setVersions] = useState(VERSIONS);\n  const [drafts, setDrafts] = useState<Sources>(VERSIONS[0].sources);\n  const [open, setOpen] = useState<FileId[]>(['score-lead', 'helpers']);\n  const [active, setActive] = useState<FileId>('score-lead');\n  const [tab, setTab] = useState<OutputTab>('output');\n  const [run, setRun] = useState<TestRun>();\n  const [running, setRunning] = useState(false);\n  const [reveal, setReveal] = useState<Reveal & { file: FileId }>();\n  const [restoring, setRestoring] = useState<Version>();\n\n  const [current] = versions;\n  const unsaved = FILES.filter((file) => drafts[file.id] !== current.sources[file.id]).map(\n    (file) => file.id,\n  );\n  const dirty = unsaved.length > 0;\n\n  const problems = useMemo(\n    () =>\n      Object.fromEntries(\n        FILES.map((file) => [file.id, file.language === 'js' ? lint(drafts[file.id]) : []]),\n      ) as Record<FileId, Problem[]>,\n    [drafts],\n  );\n  const allProblems: FileProblem[] = FILES.flatMap((file) =>\n    problems[file.id].map((problem) => ({ file, problem })),\n  ).sort((a, b) => Number(b.problem.severity === 'error') - Number(a.problem.severity === 'error'));\n\n  const openFile = (id: FileId) => {\n    if (!open.includes(id)) setOpen([...open, id]);\n    setActive(id);\n  };\n\n  const save = () => {\n    if (!dirty) return;\n    setVersions([\n      { number: current.number + 1, savedAt: NOW, by: 'maya', sources: drafts },\n      ...versions,\n    ]);\n  };\n\n  // Ctrl+S / Cmd+S saves, and never opens the browser's own save dialog on this page.\n  useEffect(() => {\n    const onKeyDown = (event: KeyboardEvent) => {\n      if (!(event.ctrlKey || event.metaKey) || event.key.toLowerCase() !== 's') return;\n      event.preventDefault();\n      save();\n    };\n    window.addEventListener('keydown', onKeyDown);\n    return () => window.removeEventListener('keydown', onKeyDown);\n  });\n\n  // Cleared on unmount, so the stand-in request never lands on a closed screen.\n  const timer = useRef<number>(undefined);\n  useEffect(() => () => window.clearTimeout(timer.current), []);\n\n  const startRun = () => {\n    setTab('output');\n    setRunning(true);\n    timer.current = window.setTimeout(() => {\n      setRun(runTest(problems));\n      setRunning(false);\n    }, RUN_DELAY);\n  };\n\n  const restore = (version: Version) => {\n    setVersions([\n      {\n        number: current.number + 1,\n        savedAt: NOW,\n        by: 'maya',\n        restoredFrom: version.number,\n        sources: version.sources,\n      },\n      ...versions,\n    ]);\n    setDrafts(version.sources);\n  };\n\n  return (\n    <div className={cn(COLUMN, 'gap-ws-12 pt-ws-14 pb-ws-16 flex h-full min-h-[40rem] flex-col')}>\n      <PageHeader\n        state={dirty ? 'Unsaved changes' : formatSaved(current.savedAt)}\n        dirty={dirty}\n        running={running}\n        versions={versions}\n        onPickVersion={setRestoring}\n        onRun={startRun}\n        onSave={save}\n        quiet={restoring !== undefined}\n      />\n\n      {/* The files, the editor and its output are one tool: one bordered box, split by lines. */}\n      <div className=\"border-ws-static-base rounded-ws-container-md grid min-h-0 flex-1 grid-cols-1 overflow-hidden border md:grid-cols-[15rem_minmax(0,1fr)] md:grid-rows-[minmax(0,1fr)]\">\n        <FileTree active={active} unsaved={unsaved} onOpen={openFile} />\n\n        <section aria-label=\"Editor\" className=\"flex min-h-0 min-w-0 flex-col\">\n          <Tabs\n            value={active}\n            onValueChange={(value) => setActive(value as FileId)}\n            className=\"min-h-0 flex-1\"\n          >\n            <Tabs.List aria-label=\"Open files\" className=\"px-ws-9\">\n              {open.map((id) => (\n                <Tabs.Item key={id} value={id}>\n                  <Tabs.Label>{fileById(id).name}</Tabs.Label>\n                  {unsaved.includes(id) && (\n                    <span className=\"bg-ws-static-inverse-background size-ws-4 rounded-ws-control-full\">\n                      <span className=\"sr-only\">, unsaved changes</span>\n                    </span>\n                  )}\n                </Tabs.Item>\n              ))}\n            </Tabs.List>\n            {open.map((id) => (\n              <Tabs.Content key={id} value={id} className=\"flex min-h-0 flex-1 flex-col\">\n                <CodeEditor\n                  file={fileById(id)}\n                  value={drafts[id]}\n                  onChange={(value) => setDrafts({ ...drafts, [id]: value })}\n                  problems={problems[id]}\n                  reveal={reveal?.file === id ? reveal : undefined}\n                />\n              </Tabs.Content>\n            ))}\n          </Tabs>\n\n          <OutputPanel\n            tab={tab}\n            onTabChange={setTab}\n            run={run}\n            running={running}\n            problems={allProblems}\n            onReveal={({ file, problem }) => {\n              openFile(file.id);\n              setReveal({\n                file: file.id,\n                line: problem.line,\n                column: problem.column,\n                key: (reveal?.key ?? 0) + 1,\n              });\n            }}\n          />\n        </section>\n      </div>\n\n      <RestoreDialog\n        version={restoring}\n        current={current.number}\n        unsaved={dirty}\n        onOpenChange={(next) => !next && setRestoring(undefined)}\n        onConfirm={restore}\n      />\n    </div>\n  );\n}\n\n/**\n * Code editor (Inset direction): a script that runs in an Orbit workflow, edited on the raised\n * page beside the workspace sidebar. The header names the script and holds its save state,\n * versions, Run test and Save (the one filled button); under it one bordered box holds the step's\n * files (a search over a tree) beside the editor, and the editor over its output and problems.\n */\nexport default function CodeEditorBlock() {\n  const sidebarId = useId();\n  const [collapsed, setCollapsed] = useState(false);\n\n  return (\n    <AppShell className=\"ws-block-utility\" direction=\"inset\">\n      <CodeEditorSidebar id={sidebarId} collapsed={collapsed} onCollapsedChange={setCollapsed} />\n      <AppShell.Main>\n        <div className=\"h-ws-18 border-ws-static-base flex shrink-0 items-center border-b\">\n          {/* The bar belongs to the surround: it runs edge to edge. The sidebar's toggle is pulled\n              left so its glyph, not its box, sits 20px from the edge; the crumbs follow it. */}\n          <div className=\"gap-ws-5 px-ws-11 flex w-full items-center\">\n            <IconButton\n              icon={RiSideBarLine}\n              variant=\"secondary\"\n              preset=\"ghost\"\n              size=\"sm\"\n              iconClassName=\"text-ws-static-subtle size-ws-9\"\n              aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n              aria-expanded={!collapsed}\n              aria-controls={sidebarId}\n              onClick={() => setCollapsed(!collapsed)}\n              className=\"-ml-ws-5\"\n            />\n            <Breadcrumbs separator=\"arrow\">\n              <Breadcrumbs.Item asChild>\n                <a href=\"#automations\">Automations</a>\n              </Breadcrumbs.Item>\n              <Breadcrumbs.Item asChild>\n                <a href=\"#lead-scoring\">Lead scoring</a>\n              </Breadcrumbs.Item>\n              <Breadcrumbs.Item>score-lead.js</Breadcrumbs.Item>\n            </Breadcrumbs>\n          </div>\n        </div>\n\n        {/* The page scrolls inside the card when the window is short; at full size the editor\n            takes the height and scrolls inside itself. */}\n        <div className=\"ws-scrollbar min-h-0 flex-1 overflow-y-auto\">\n          <EditorPage />\n        </div>\n      </AppShell.Main>\n    </AppShell>\n  );\n}\n"
    },
    {
      "path": "src/blocks/code-editor/lint.ts",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/lint.ts",
      "content": "// TODO(custom): the editor's checks (a syntax error, an unused name); a stand-in for the linter a real editor runs.\nimport { tokenize } from './highlight';\n\nexport type Problem = {\n  severity: 'error' | 'warning';\n  message: string;\n  /** The rule's name, as a linter prints it. */\n  rule: string;\n  /** 1-based, as editors count. */\n  line: number;\n  column: number;\n  /** How many characters the mark under the code covers. */\n  length: number;\n};\n\nconst PAIRS: Record<string, string> = { ')': '(', ']': '[', '}': '{' };\n\n/**\n * Checks one JavaScript file the way a linter in an editor would, and reports what it finds,\n * errors first: the first syntax error (an unclosed string or bracket, or a stray closing one),\n * since a parser stops there, then every `const` or `let` that is never used again.\n */\nexport function lint(source: string): Problem[] {\n  const lines = source.split('\\n');\n  // Each line with comments and strings blanked out, so only code is checked and columns hold.\n  const code = lines.map((line) =>\n    tokenize(line)\n      .map((token) =>\n        token.kind === 'comment' || token.kind === 'string'\n          ? ' '.repeat(token.text.length)\n          : token.text,\n      )\n      .join(''),\n  );\n\n  const syntax = (): Problem | undefined => {\n    const open: { char: string; line: number; column: number }[] = [];\n    for (const [index, line] of lines.entries()) {\n      const unclosed = tokenize(line).find(\n        (token) =>\n          token.kind === 'string' && (token.text.length < 2 || token.text.at(-1) !== token.text[0]),\n      );\n      if (unclosed) {\n        return {\n          severity: 'error',\n          message: 'Unterminated string constant.',\n          rule: 'syntax',\n          line: index + 1,\n          column: unclosed.start + 1,\n          length: unclosed.text.length,\n        };\n      }\n      for (const [column, char] of [...code[index]].entries()) {\n        if ('([{'.includes(char)) open.push({ char, line: index + 1, column: column + 1 });\n        if (!PAIRS[char]) continue;\n        if (open.at(-1)?.char === PAIRS[char]) {\n          open.pop();\n          continue;\n        }\n        return {\n          severity: 'error',\n          message: `Unexpected token '${char}'.`,\n          rule: 'syntax',\n          line: index + 1,\n          column: column + 1,\n          length: 1,\n        };\n      }\n    }\n    const last = open.at(-1);\n    if (!last) return undefined;\n    return {\n      severity: 'error',\n      message: `'${last.char}' is never closed.`,\n      rule: 'syntax',\n      ...last,\n      length: 1,\n    };\n  };\n\n  const unused: Problem[] = [];\n  const all = code.join('\\n');\n  for (const [index, line] of code.entries()) {\n    for (const match of line.matchAll(/\\b(?:const|let)\\s+([A-Za-z_]\\w*)\\s*=/g)) {\n      const name = match[1];\n      // A use is the name on its own, not a property of something else (`lead.region`).\n      const uses = all.match(new RegExp(String.raw`(?<![\\w.])${name}(?!\\w)`, 'g'));\n      if ((uses?.length ?? 0) > 1) continue;\n      unused.push({\n        severity: 'warning',\n        message: `'${name}' is assigned a value but never used.`,\n        rule: 'no-unused-vars',\n        line: index + 1,\n        column: match.index + match[0].lastIndexOf(name) + 1,\n        length: name.length,\n      });\n    }\n  }\n\n  const error = syntax();\n  return error ? [error, ...unused] : unused;\n}\n"
    },
    {
      "path": "src/blocks/code-editor/output-panel.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/output-panel.tsx",
      "content": "'use client';\n\nimport { RiCheckboxCircleFill, RiCloseCircleFill } from '@remixicon/react';\nimport { cn } from '@/lib/wideset/utils';\nimport { Tabs } from '@/components/ui/wideset/tabs/Tabs';\n\nimport { type FileProblem, ProblemList } from './problem-list';\nimport { TestOutput } from './test-output';\nimport type { TestRun } from './test-run';\n\nexport type OutputTab = 'output' | 'problems';\n\ntype OutputPanelProps = {\n  tab: OutputTab;\n  onTabChange: (tab: OutputTab) => void;\n  run?: TestRun;\n  running: boolean;\n  problems: FileProblem[];\n  onReveal: (item: FileProblem) => void;\n};\n\n/** The last run's verdict, in its judgement's colour, announced when it changes. */\nfunction RunStatus({ run, running }: { run?: TestRun; running: boolean }) {\n  const passed = run?.status === 'passed';\n  const Icon = passed ? RiCheckboxCircleFill : RiCloseCircleFill;\n  return (\n    <p\n      aria-live=\"polite\"\n      className=\"typography-label-sm text-ws-static-base gap-ws-3 flex items-center\"\n    >\n      {run && !running && (\n        <>\n          <Icon\n            aria-hidden=\"true\"\n            className={cn(\n              'size-ws-9 shrink-0',\n              passed ? 'text-ws-semantic-positive' : 'text-ws-semantic-negative',\n            )}\n          />\n          {run.status === 'passed'\n            ? `Test passed in ${run.ms} ms`\n            : 'Test failed on a syntax error'}\n        </>\n      )}\n    </p>\n  );\n}\n\n/**\n * The panel under the editor, split from it by a line: a test run's output and the code's\n * problems, as two tabs without counts (the wavy marks in the code already say where to look).\n * The last run's verdict sits at the end of the tab row, so it shows from either tab. It is as\n * tall as what it has to say, up to 15rem, where its content scrolls: before a run it is one\n * line and the editor keeps the room; a run's output opens it.\n */\nexport function OutputPanel({\n  tab,\n  onTabChange,\n  run,\n  running,\n  problems,\n  onReveal,\n}: OutputPanelProps) {\n  return (\n    <Tabs\n      value={tab}\n      onValueChange={(value) => onTabChange(value as OutputTab)}\n      divider={false}\n      className=\"border-ws-static-base max-h-[15rem] shrink-0 border-t\"\n    >\n      {/* The tabs share their row with the verdict, so the row draws the line, not the list. */}\n      <div className=\"border-ws-static-subtle px-ws-9 gap-ws-9 flex items-center justify-between border-b\">\n        <Tabs.List aria-label=\"Test output and problems\">\n          <Tabs.Item value=\"output\">\n            <Tabs.Label>Output</Tabs.Label>\n          </Tabs.Item>\n          <Tabs.Item value=\"problems\">\n            <Tabs.Label>Problems</Tabs.Label>\n          </Tabs.Item>\n        </Tabs.List>\n        <RunStatus run={run} running={running} />\n      </div>\n      <Tabs.Content value=\"output\" className=\"ws-scrollbar min-h-0 flex-1 overflow-y-auto\">\n        <div className=\"px-ws-9 py-ws-7\">\n          <TestOutput run={run} running={running} />\n        </div>\n      </Tabs.Content>\n      <Tabs.Content value=\"problems\" className=\"ws-scrollbar min-h-0 flex-1 overflow-y-auto\">\n        <div className=\"px-ws-9 py-ws-5\">\n          <ProblemList problems={problems} onReveal={onReveal} />\n        </div>\n      </Tabs.Content>\n    </Tabs>\n  );\n}\n"
    },
    {
      "path": "src/blocks/code-editor/page-header.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/page-header.tsx",
      "content": "'use client';\n\n// TODO(custom): page header (title, a line of description, the save state and actions on the right); no PageHeader in Wideset.\nimport { RiPlayLine } from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\n\nimport type { Version } from './data';\nimport { VersionMenu } from './version-menu';\n\ntype PageHeaderProps = {\n  /** \"Saved 2 minutes ago\" or \"Unsaved changes\". */\n  state: string;\n  dirty: boolean;\n  running: boolean;\n  versions: Version[];\n  onPickVersion: (version: Version) => void;\n  onRun: () => void;\n  onSave: () => void;\n  quiet?: boolean;\n};\n\n/**\n * The script's name and what it does, then, on the right, whether it is saved, its versions, Run\n * test and Save. Save is the screen's one filled button and is enabled only with changes to save;\n * Ctrl+S or Cmd+S does the same. The save state is announced as it changes. While the restore\n * dialog holds the filled button, Save steps back to a bordered one (`quiet`), so the screen keeps\n * one.\n */\nexport function PageHeader({\n  state,\n  dirty,\n  running,\n  versions,\n  onPickVersion,\n  onRun,\n  onSave,\n  quiet,\n}: PageHeaderProps) {\n  return (\n    <header className=\"gap-ws-12 flex flex-wrap items-center justify-between\">\n      <div className=\"gap-ws-2 flex min-w-0 flex-col\">\n        <h1 className=\"typography-title-md text-ws-static-strong\">score-lead.js</h1>\n        <p className=\"typography-body-md text-ws-static-subtle\">\n          The code step in Lead scoring: it scores each new lead from 0 to 100.\n        </p>\n      </div>\n      <div className=\"gap-ws-5 flex items-center\">\n        <p\n          aria-live=\"polite\"\n          className=\"typography-label-sm text-ws-static-subtle mr-ws-3 tabular-nums\"\n        >\n          {state}\n        </p>\n        <VersionMenu versions={versions} onPick={onPickVersion} />\n        <Button variant=\"secondary\" preset=\"border\" size=\"sm\" disabled={running} onClick={onRun}>\n          <Button.Icon icon={RiPlayLine} />\n          {running ? 'Running test…' : 'Run test'}\n        </Button>\n        <Button\n          size=\"sm\"\n          variant={quiet ? 'secondary' : 'primary'}\n          preset={quiet ? 'border' : 'filled'}\n          disabled={!dirty}\n          aria-keyshortcuts=\"Control+S Meta+S\"\n          onClick={onSave}\n        >\n          Save\n        </Button>\n      </div>\n    </header>\n  );\n}\n"
    },
    {
      "path": "src/blocks/code-editor/people.assets.ts",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/people.assets.ts",
      "content": "// Portraits of the sample people as small JPEG data URLs (a block ships only .ts and .tsx).\n// Exported from the Wideset Core Figma file by people.cjs: do not edit by hand.\n\n/** A person’s photo by name. People who are not here show their initials. */\nexport const PHOTOS: Record<string, string | undefined> = {\n  'Maya Okafor':\n    'data:image/jpeg;base64,/9j/4AAQSkZ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3WJ66KBIKGe6yOPt61urRmOK/M0WWKo5WHqYolslyLeJZbGNxG0HqB3/zTZQKSQoEEdQa2KGW48dDLYwhAwBUTNtrEnO5I3eo6036fVOihbe/mKdiqzEoMCVCipGVZ3mAVN5cR7c1HEEHB4NWCOrjKmaSCPMkLfbsLStw7lK6VOpaCUnjpTRJS06Gx/tvJwP7VdP4+1SBO2Ups9CKos5OTOqMHRsWfQ1nbbHlp4xjmsbqC7IS2Oxyad42rKfpWCZPHkMvoKHmwpJ4PGQfcVh/01bVjCWEAeiDj9KztnBPvTpODQatX9QzCtjp6TiYIWnrdDVuSyCf7yT+lS+8JGEgAU0QOay1JEVOlGJF3ZzlzmelJ3ck14DaQoDFZB0xWMnhSvsKlIw2AjoOairpZkSG1uIGHEjIx3qWzhzHZCayK/Dj1qSMVORAe5//Z',\n};\n"
    },
    {
      "path": "src/blocks/code-editor/person-avatar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/person-avatar.tsx",
      "content": "'use client';\n\nimport type { AvatarColor } from '@/components/ui/wideset/avatar/Avatar.colors';\nimport type { AvatarProps } from '@/components/ui/wideset/avatar/Avatar.types';\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\n\nimport { PHOTOS } from './people.assets';\n\ntype PersonAvatarProps = Pick<\n  AvatarProps,\n  'size' | 'status' | 'className' | 'title' | 'aria-hidden'\n> & {\n  /** The person's full name: the key their photo is stored under. */\n  name: string;\n  initials: string;\n  /** The colour of the initials. A photo takes none. */\n  color?: AvatarColor;\n  /** Empty beside the person's name (the default); their name when the avatar stands alone. */\n  alt?: string;\n};\n\n/**\n * A person's avatar: their photo when there is one, their initials otherwise, which is also what\n * shows if the photo fails to load. The one place the block makes that choice, so a list that\n * mixes photos and initials is still drawn the same way everywhere.\n */\nexport function PersonAvatar({ name, initials, color, alt = '', ...avatar }: PersonAvatarProps) {\n  const photo = PHOTOS[name];\n  return photo ? (\n    <Avatar src={photo} alt={alt} initials={initials} {...avatar} />\n  ) : (\n    <Avatar initials={initials} color={color} {...avatar} />\n  );\n}\n"
    },
    {
      "path": "src/blocks/code-editor/problem-list.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/problem-list.tsx",
      "content": "'use client';\n\n// TODO(custom): the linter's findings as rows that jump to the code; Wideset has no problems or diagnostics list.\nimport { RiCloseCircleFill, RiErrorWarningFill } from '@remixicon/react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { ScriptFile } from './data';\nimport type { Problem } from './lint';\n\nexport type FileProblem = { file: ScriptFile; problem: Problem };\n\n/**\n * Every problem in the step's code, errors first: the judgement's mark (an error in the negative\n * colour, a warning in the notice colour), the message, then where it is and the rule. A row is\n * one target: it opens the file and puts the caret on the problem.\n */\nexport function ProblemList({\n  problems,\n  onReveal,\n}: {\n  problems: FileProblem[];\n  onReveal: (item: FileProblem) => void;\n}) {\n  if (problems.length === 0) {\n    return <p className=\"typography-body-md text-ws-static-subtle\">No problems in the code.</p>;\n  }\n\n  return (\n    <ul className=\"-mx-ws-5 flex flex-col\">\n      {problems.map((item) => {\n        const { file, problem } = item;\n        const error = problem.severity === 'error';\n        const Icon = error ? RiCloseCircleFill : RiErrorWarningFill;\n        return (\n          <li key={`${file.id}:${problem.line}:${problem.column}:${problem.rule}`}>\n            <button\n              type=\"button\"\n              onClick={() => onReveal(item)}\n              className=\"gap-ws-5 px-ws-5 py-ws-4 rounded-ws-control-lg hover:bg-ws-dynamic-tertiary-alpha-strong-default focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex w-full items-center text-left\"\n            >\n              <Icon\n                aria-label={error ? 'Error' : 'Warning'}\n                className={cn(\n                  'size-ws-9 shrink-0',\n                  error ? 'text-ws-semantic-negative' : 'text-ws-semantic-notice',\n                )}\n              />\n              <span className=\"typography-label-sm text-ws-static-strong min-w-0 truncate\">\n                {problem.message}\n              </span>\n              <span className=\"typography-label-sm text-ws-static-subtle shrink-0 tabular-nums\">\n                {file.name}, line {problem.line}, column {problem.column} · {problem.rule}\n              </span>\n            </button>\n          </li>\n        );\n      })}\n    </ul>\n  );\n}\n"
    },
    {
      "path": "src/blocks/code-editor/restore-dialog.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/restore-dialog.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { Modal } from '@/components/ui/wideset/modal/Modal';\n\nimport { PEOPLE, type Version } from './data';\nimport { formatWhen } from './format';\n\ntype RestoreDialogProps = {\n  /** The older version to bring back; the dialog is open while there is one. */\n  version?: Version;\n  current: number;\n  /** Unsaved edits in the editor, which restoring replaces. */\n  unsaved: boolean;\n  onOpenChange: (open: boolean) => void;\n  onConfirm: (version: Version) => void;\n};\n\n/**\n * Asks before an older version comes back: whose version it is and when it was saved, that it\n * becomes a new version so the current one stays in the history, and, only when there are any,\n * that unsaved edits are lost. Nothing is deleted, so the button is the plain primary.\n */\nexport function RestoreDialog({\n  version,\n  current,\n  unsaved,\n  onOpenChange,\n  onConfirm,\n}: RestoreDialogProps) {\n  return (\n    <Modal open={version !== undefined} onOpenChange={onOpenChange}>\n      {version && (\n        <Modal.Content className=\"ws-block-utility\">\n          <Modal.Header>\n            <Modal.Title>Restore version {version.number}?</Modal.Title>\n            <Modal.Description>\n              {`The script goes back to how ${PEOPLE[version.by].name} saved it ${formatWhen(version.savedAt)}.`}\n            </Modal.Description>\n          </Modal.Header>\n          <Modal.Body>\n            {`It is saved as a new version, so version ${current} stays in the history and you can come back to it.`}\n            {unsaved && ' Your unsaved changes will be lost.'}\n          </Modal.Body>\n          <Modal.Footer>\n            <Modal.Close asChild>\n              <Button variant=\"secondary\" preset=\"border\">\n                Cancel\n              </Button>\n            </Modal.Close>\n            <Button\n              onClick={() => {\n                onOpenChange(false);\n                onConfirm(version);\n              }}\n            >\n              Restore version\n            </Button>\n          </Modal.Footer>\n        </Modal.Content>\n      )}\n    </Modal>\n  );\n}\n"
    },
    {
      "path": "src/blocks/code-editor/sidebar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/sidebar.tsx",
      "content": "'use client';\n\n// TODO(custom): workspace switcher and account menu are composed by hand.\nimport {\n  RiAddLine,\n  RiArrowDownSLine,\n  RiLogoutBoxRLine,\n  RiSearchLine,\n  RiSettingsLine,\n} from '@remixicon/react';\nimport { Divider } from '@/components/ui/wideset/divider/Divider';\nimport { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { ListItem } from '@/components/ui/wideset/list-item/ListItem';\nimport { Sidebar } from '@/components/ui/wideset/sidebar/Sidebar';\nimport { type SidebarProps } from '@/components/ui/wideset/sidebar/Sidebar.types';\nimport { TextInput } from '@/components/ui/wideset/text-input/TextInput';\nimport { useState } from 'react';\n\nimport { BrandMark } from './brand-mark';\nimport {\n  account,\n  helpLink,\n  mainLinks,\n  type NavLink,\n  product,\n  settingsLinks,\n  workspace,\n} from './data';\nimport { PersonAvatar } from './person-avatar';\n\n/**\n * The workspace sidebar: switcher, search, the app's pages, settings and the signed-in account.\n * Its toggle sits in the page bar, so the screen holds `collapsed` and passes it down; collapsed,\n * it keeps the mark, the page icons and the avatar.\n */\nexport function CodeEditorSidebar(\n  props: Pick<SidebarProps, 'id' | 'collapsed' | 'onCollapsedChange'>,\n) {\n  const [active, setActive] = useState('automations');\n\n  const link = ({ id, label, icon, activeIcon }: NavLink) => (\n    <Sidebar.Item\n      key={id}\n      href={`#${id}`}\n      icon={active === id ? (activeIcon ?? icon) : icon}\n      label={label}\n      active={active === id}\n      onClick={() => setActive(id)}\n    />\n  );\n\n  const nav = (\n    <nav aria-label=\"Workspace\" className=\"gap-ws-9 flex flex-col\">\n      <div className=\"flex flex-col\">{mainLinks.map(link)}</div>\n      <Divider weight=\"thin\" />\n      <div role=\"group\" aria-labelledby=\"sidebar-settings\" className=\"gap-ws-2 flex flex-col\">\n        <Sidebar.SectionHeader id=\"sidebar-settings\">Settings</Sidebar.SectionHeader>\n        {settingsLinks.map(link)}\n      </div>\n    </nav>\n  );\n\n  return (\n    <Sidebar {...props}>\n      <Sidebar.Header>\n        <Sidebar.Expanded>\n          <div className=\"gap-ws-9 flex flex-col\">\n            <div className=\"gap-ws-7 pt-ws-3 pb-ws-7 flex items-center\">\n              <BrandMark className=\"size-ws-15\" />\n              <div className=\"flex min-w-0 flex-1 flex-col\">\n                <span className=\"typography-label-strong-sm text-ws-static-strong truncate\">\n                  {workspace.name}\n                </span>\n                <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n                  {product.name}\n                </span>\n              </div>\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <IconButton\n                    icon={RiArrowDownSLine}\n                    variant=\"secondary\"\n                    preset=\"ghost\"\n                    size=\"xs\"\n                    aria-label=\"Switch workspace\"\n                    className=\"mr-ws-3\"\n                  />\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content className=\"ws-block-utility\" align=\"end\">\n                  <DropdownMenu.Item data-state=\"checked\">\n                    <ListItem.Content>\n                      <ListItem.Label>{workspace.name}</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                  <DropdownMenu.Separator />\n                  <DropdownMenu.Item>\n                    <ListItem.Prefix>\n                      <RiAddLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>New workspace</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </div>\n            <TextInput size=\"sm\">\n              <TextInput.Prefix inner>\n                <TextInput.Icon icon={RiSearchLine} />\n              </TextInput.Prefix>\n              <TextInput.Input type=\"search\" placeholder=\"Search\" aria-label=\"Search\" />\n            </TextInput>\n          </div>\n        </Sidebar.Expanded>\n        <Sidebar.Collapsed>\n          <div className=\"pt-ws-3 pb-ws-7 flex justify-center\">\n            <BrandMark className=\"size-ws-15\" />\n          </div>\n        </Sidebar.Collapsed>\n      </Sidebar.Header>\n\n      {/* A section draws only the slot for the state it is in, so the pages go in both. */}\n      <Sidebar.Section scrollable>{nav}</Sidebar.Section>\n\n      <Sidebar.Footer>\n        <div className=\"gap-ws-9 flex flex-col\">\n          <div className=\"flex flex-col\">{link(helpLink)}</div>\n          {/* On the grey ground the line keeps the nav's inset: run edge to edge, it would stop\n              short of the page and read as broken. */}\n          <div className=\"border-ws-static-base pt-ws-5 border-t\">\n            <Sidebar.Expanded>\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <button\n                    type=\"button\"\n                    className=\"gap-ws-5 px-ws-5 py-ws-3 rounded-ws-control-lg hover:bg-ws-dynamic-tertiary-alpha-strong-default focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex w-full items-center text-left\"\n                  >\n                    <PersonAvatar name={account.name} initials={account.initials} color=\"orange\" />\n                    <span className=\"flex min-w-0 flex-1 flex-col\">\n                      <span className=\"typography-label-strong-sm text-ws-static-base truncate\">\n                        {account.name}\n                      </span>\n                      <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n                        {account.email}\n                      </span>\n                    </span>\n                    <RiArrowDownSLine\n                      aria-hidden=\"true\"\n                      className=\"size-ws-9 text-ws-static-strong\"\n                    />\n                  </button>\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content side=\"top\" align=\"start\" className=\"ws-block-utility w-[14rem]\">\n                  <DropdownMenu.Item>\n                    <ListItem.Prefix>\n                      <RiSettingsLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>Account settings</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                  <DropdownMenu.Separator />\n                  <DropdownMenu.Item variant=\"danger\">\n                    <ListItem.Prefix>\n                      <RiLogoutBoxRLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>Log out</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </Sidebar.Expanded>\n            <Sidebar.Collapsed>\n              <div className=\"flex justify-center\">\n                <PersonAvatar\n                  name={account.name}\n                  initials={account.initials}\n                  color=\"orange\"\n                  alt={account.name}\n                  title={account.name}\n                />\n              </div>\n            </Sidebar.Collapsed>\n          </div>\n        </div>\n      </Sidebar.Footer>\n    </Sidebar>\n  );\n}\n"
    },
    {
      "path": "src/blocks/code-editor/test-output.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/test-output.tsx",
      "content": "'use client';\n\n// TODO(custom): a test run's result (the input record, the returned score, the log); Wideset has no console or run-output part.\nimport { cn } from '@/lib/wideset/utils';\n\nimport { SAMPLE_LEAD } from './data';\nimport { formatClock } from './format';\nimport type { TestRun } from './test-run';\n\nconst MONO = 'typography-body-sm tracking-ws-normal font-ws-mono';\nconst HEADING = 'typography-caption-strong-md text-ws-static-subtle';\n\n/**\n * What Run test produced, read left to right: the record that went in, what came back (the\n * score, the one large figure) and what the script logged on the way. A failed run returns\n * nothing and its log ends on the error, in the negative colour. Before the first run it says\n * what Run test will do. Whether the run passed sits in the panel's tab row.\n */\nexport function TestOutput({ run, running }: { run?: TestRun; running: boolean }) {\n  if (running || !run) {\n    return (\n      <p className=\"typography-body-md text-ws-static-subtle\">\n        {running\n          ? `Running the test with ${SAMPLE_LEAD.company}…`\n          : `Run test scores the sample lead, ${SAMPLE_LEAD.company}, with the code in the editor, saved or not.`}\n      </p>\n    );\n  }\n\n  return (\n    <div className=\"gap-ws-16 grid grid-cols-[minmax(0,16rem)_minmax(0,6rem)_minmax(0,1fr)]\">\n      <section aria-label=\"Input\" className=\"gap-ws-3 flex flex-col\">\n        <h3 className={HEADING}>Input</h3>\n        <pre className={cn(MONO, 'text-ws-static-base whitespace-pre-wrap')}>\n          {JSON.stringify(SAMPLE_LEAD, null, 2)}\n        </pre>\n      </section>\n\n      <section aria-label=\"Returned\" className=\"gap-ws-2 flex flex-col\">\n        <h3 className={HEADING}>Returned</h3>\n        {run.status === 'passed' ? (\n          <p className=\"typography-title-sm text-ws-static-strong tabular-nums\">{run.score}</p>\n        ) : (\n          <p className=\"typography-body-md text-ws-static-subtle\">Nothing</p>\n        )}\n      </section>\n\n      <section aria-label=\"Log\" className=\"gap-ws-3 flex flex-col\">\n        <h3 className={HEADING}>Log</h3>\n        <ol className={cn(MONO, 'flex flex-col')}>\n          {run.log.map((line) => (\n            <li key={line.text} className=\"gap-ws-7 flex\">\n              <time\n                dateTime={line.at.toISOString()}\n                className=\"text-ws-static-subtle shrink-0 tabular-nums\"\n              >\n                {formatClock(line.at)}\n              </time>\n              <span\n                className={\n                  line.level === 'error' ? 'text-ws-semantic-negative' : 'text-ws-static-base'\n                }\n              >\n                {line.text}\n              </span>\n            </li>\n          ))}\n        </ol>\n      </section>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/code-editor/test-run.ts",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/test-run.ts",
      "content": "import { fileById, type FileId, NOW, SAMPLE_LEAD } from './data';\nimport type { Problem } from './lint';\n\n/** The page's clock starts at NOW when it loads, so log times read as today's. */\nconst LOADED = Date.now();\n\nexport type LogLine = { at: Date; text: string; level: 'info' | 'error' };\n\n/** What one Run test produced: the score it returned, or why it could not run. */\nexport type TestRun =\n  | { status: 'passed'; ranAt: Date; ms: number; score: number; log: LogLine[] }\n  | { status: 'failed'; ranAt: Date; log: LogLine[] };\n\n/**\n * A test run as the workflow's runner would report it. Orbit runs the code on its servers; here\n * a syntax error stops the run, as it would there, and otherwise the script scores the sample.\n */\nexport function runTest(problems: Record<FileId, Problem[]>): TestRun {\n  // ponytail: the score is this version's answer for the sample, not the edited code's; run the\n  // code in a sandboxed worker when the block needs to execute what was typed.\n  const ranAt = new Date(Date.parse(NOW) + Date.now() - LOADED);\n  const later = (ms: number) => new Date(ranAt.getTime() + ms);\n  const start: LogLine = { at: ranAt, level: 'info', text: `Test run with ${SAMPLE_LEAD.company}` };\n\n  for (const [id, list] of Object.entries(problems) as [FileId, Problem[]][]) {\n    const error = list.find((problem) => problem.severity === 'error');\n    if (!error) continue;\n    return {\n      status: 'failed',\n      ranAt,\n      log: [\n        start,\n        {\n          at: later(3),\n          level: 'error',\n          text: `SyntaxError: ${error.message} (${fileById(id).name}, line ${error.line})`,\n        },\n      ],\n    };\n  }\n\n  return {\n    status: 'passed',\n    ranAt,\n    ms: 7,\n    score: 77,\n    log: [\n      start,\n      { at: later(5), level: 'info', text: `Scored ${SAMPLE_LEAD.company}: 77` },\n      { at: later(7), level: 'info', text: 'Returned 77 in 7 ms' },\n    ],\n  };\n}\n"
    },
    {
      "path": "src/blocks/code-editor/version-menu.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/code-editor/version-menu.tsx",
      "content": "'use client';\n\nimport { RiArrowDownSLine, RiHistoryLine } from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';\nimport { ListItem } from '@/components/ui/wideset/list-item/ListItem';\n\nimport { PEOPLE, type Version } from './data';\nimport { formatSavedAt } from './format';\n\ntype VersionMenuProps = {\n  /** Newest first; the first is the one the script runs. */\n  versions: Version[];\n  /** Picking an older version asks first, so the menu only names it. */\n  onPick: (version: Version) => void;\n};\n\n/**\n * The script's saved versions behind a button that names the current one. Each entry says when\n * and by whom it was saved (and what it restored); the current one is checked. Picking another\n * does not restore it yet: the page asks first.\n */\nexport function VersionMenu({ versions, onPick }: VersionMenuProps) {\n  const [current] = versions;\n\n  return (\n    <DropdownMenu>\n      <DropdownMenu.Trigger asChild>\n        <Button\n          variant=\"secondary\"\n          preset=\"ghost\"\n          size=\"sm\"\n          aria-label={`Version history, version ${current.number}`}\n        >\n          <Button.Icon icon={RiHistoryLine} />\n          {`Version ${current.number}`}\n          <Button.Icon icon={RiArrowDownSLine} />\n        </Button>\n      </DropdownMenu.Trigger>\n      <DropdownMenu.Content align=\"end\" className=\"ws-block-utility w-[18rem]\">\n        <DropdownMenu.Label>Version history</DropdownMenu.Label>\n        {versions.map((version) => (\n          <DropdownMenu.Item\n            key={version.number}\n            data-state={version === current ? 'checked' : 'unchecked'}\n            onSelect={() => version !== current && onPick(version)}\n          >\n            <ListItem.Content>\n              <ListItem.Label>\n                {version.restoredFrom\n                  ? `Version ${version.number}, restored from ${version.restoredFrom}`\n                  : `Version ${version.number}`}\n              </ListItem.Label>\n              <ListItem.Description>\n                {formatSavedAt(version.savedAt)} · {PEOPLE[version.by].name}\n              </ListItem.Description>\n            </ListItem.Content>\n          </DropdownMenu.Item>\n        ))}\n      </DropdownMenu.Content>\n    </DropdownMenu>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
