@agent-native/core 0.76.10 → 0.76.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +13 -0
  3. package/corpus/core/docs/content/locales/ar-SA/actions.md +7 -7
  4. package/corpus/core/docs/content/locales/ar-SA/template-plan.md +6 -4
  5. package/corpus/core/docs/content/locales/de-DE/actions.md +9 -9
  6. package/corpus/core/docs/content/locales/de-DE/template-plan.md +6 -4
  7. package/corpus/core/docs/content/locales/es-ES/actions.md +9 -9
  8. package/corpus/core/docs/content/locales/es-ES/template-plan.md +6 -4
  9. package/corpus/core/docs/content/locales/fr-FR/actions.md +9 -9
  10. package/corpus/core/docs/content/locales/fr-FR/template-plan.md +6 -4
  11. package/corpus/core/docs/content/locales/hi-IN/actions.md +9 -9
  12. package/corpus/core/docs/content/locales/hi-IN/template-plan.md +4 -4
  13. package/corpus/core/docs/content/locales/ja-JP/actions.md +9 -9
  14. package/corpus/core/docs/content/locales/ja-JP/template-plan.md +4 -4
  15. package/corpus/core/docs/content/locales/ko-KR/actions.md +9 -9
  16. package/corpus/core/docs/content/locales/ko-KR/template-plan.md +4 -4
  17. package/corpus/core/docs/content/locales/pt-BR/actions.md +9 -9
  18. package/corpus/core/docs/content/locales/pt-BR/template-plan.md +6 -4
  19. package/corpus/core/docs/content/locales/zh-CN/actions.md +9 -9
  20. package/corpus/core/docs/content/locales/zh-CN/template-plan.md +4 -4
  21. package/corpus/core/package.json +1 -1
  22. package/corpus/core/src/client/ErrorBoundary.tsx +151 -10
  23. package/corpus/core/src/client/FeedbackButton.tsx +162 -18
  24. package/corpus/core/src/client/blocks/library/AnnotatedCodeBlock.tsx +11 -2
  25. package/corpus/core/src/client/blocks/library/ApiEndpointBlock.tsx +46 -19
  26. package/corpus/core/src/client/blocks/library/MermaidBlock.tsx +7 -5
  27. package/corpus/core/src/client/blocks/library/block-copy.ts +367 -0
  28. package/corpus/core/src/client/blocks/library/diagram.tsx +8 -6
  29. package/corpus/core/src/client/blocks/library/wireframe.tsx +7 -2
  30. package/corpus/core/src/client/i18n.tsx +4 -0
  31. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +51 -31
  32. package/corpus/templates/analytics/app/components/layout/DashboardHeader.tsx +26 -16
  33. package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -2
  34. package/corpus/templates/analytics/app/components/layout/HeaderActions.tsx +8 -1
  35. package/corpus/templates/analytics/app/components/layout/Layout.tsx +2 -5
  36. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +172 -107
  37. package/corpus/templates/analytics/app/i18n-data.ts +1076 -5
  38. package/corpus/templates/analytics/app/pages/Settings.tsx +2 -2
  39. package/corpus/templates/analytics/changelog/2026-06-24-analytics-navigation-command-palette-and-settings-now-honor-.md +6 -0
  40. package/corpus/templates/assets/app/components/layout/Header.tsx +0 -2
  41. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +0 -2
  42. package/corpus/templates/calendar/app/pages/CalendarView.tsx +0 -2
  43. package/corpus/templates/chat/app/components/layout/Header.tsx +1 -6
  44. package/corpus/templates/clips/app/components/layout/Header.tsx +1 -6
  45. package/corpus/templates/clips/app/hooks/use-library.ts +2 -0
  46. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +3 -1
  47. package/corpus/templates/clips/changelog/2026-06-24-archive-and-spaces-navigation-is-more-resilient-when-sidebar.md +6 -0
  48. package/corpus/templates/content/app/components/layout/Header.tsx +0 -2
  49. package/corpus/templates/design/app/components/layout/Header.tsx +1 -6
  50. package/corpus/templates/forms/app/components/layout/Header.tsx +1 -6
  51. package/corpus/templates/macros/app/components/layout/Header.tsx +1 -6
  52. package/corpus/templates/mail/app/components/email/CodeBlockLangPicker.tsx +4 -2
  53. package/corpus/templates/mail/app/components/email/ComposeBubbleToolbar.tsx +18 -12
  54. package/corpus/templates/mail/app/components/email/ComposeEditor.tsx +9 -5
  55. package/corpus/templates/mail/app/components/email/ComposeModal.tsx +36 -19
  56. package/corpus/templates/mail/app/components/email/EmailList.tsx +59 -55
  57. package/corpus/templates/mail/app/components/email/EmailListItem.tsx +7 -3
  58. package/corpus/templates/mail/app/components/email/EmailThread.tsx +25 -16
  59. package/corpus/templates/mail/app/components/email/InlineReplyComposer.tsx +25 -19
  60. package/corpus/templates/mail/app/components/email/IntegrationsSidebar.tsx +32 -17
  61. package/corpus/templates/mail/app/components/email/RecipientInput.tsx +26 -10
  62. package/corpus/templates/mail/app/components/email/SendLaterButton.tsx +5 -3
  63. package/corpus/templates/mail/app/components/email/SnoozeModal.tsx +4 -2
  64. package/corpus/templates/mail/app/components/email/SnoozePopover.tsx +9 -5
  65. package/corpus/templates/mail/app/components/email/extensions/ComposeImageBlock.tsx +4 -2
  66. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +168 -86
  67. package/corpus/templates/mail/app/components/layout/SearchBar.tsx +4 -2
  68. package/corpus/templates/mail/app/i18n/ar-SA.ts +212 -0
  69. package/corpus/templates/mail/app/i18n/de-DE.ts +212 -0
  70. package/corpus/templates/mail/app/i18n/en-US.ts +212 -0
  71. package/corpus/templates/mail/app/i18n/es-ES.ts +212 -0
  72. package/corpus/templates/mail/app/i18n/fr-FR.ts +212 -0
  73. package/corpus/templates/mail/app/i18n/hi-IN.ts +212 -0
  74. package/corpus/templates/mail/app/i18n/ja-JP.ts +212 -0
  75. package/corpus/templates/mail/app/i18n/ko-KR.ts +212 -0
  76. package/corpus/templates/mail/app/i18n/pt-BR.ts +212 -0
  77. package/corpus/templates/mail/app/i18n/zh-CN.ts +211 -0
  78. package/corpus/templates/mail/app/root.tsx +90 -6
  79. package/corpus/templates/mail/changelog/2026-06-24-interface-language-support-now-covers-more-mail-controls-and.md +6 -0
  80. package/corpus/templates/plan/app/components/layout/Header.tsx +1 -6
  81. package/corpus/templates/slides/app/components/layout/Header.tsx +1 -6
  82. package/corpus/templates/videos/app/components/layout/Header.tsx +1 -6
  83. package/dist/client/ErrorBoundary.d.ts.map +1 -1
  84. package/dist/client/ErrorBoundary.js +128 -7
  85. package/dist/client/ErrorBoundary.js.map +1 -1
  86. package/dist/client/FeedbackButton.d.ts.map +1 -1
  87. package/dist/client/FeedbackButton.js +142 -14
  88. package/dist/client/FeedbackButton.js.map +1 -1
  89. package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts.map +1 -1
  90. package/dist/client/blocks/library/AnnotatedCodeBlock.js +6 -2
  91. package/dist/client/blocks/library/AnnotatedCodeBlock.js.map +1 -1
  92. package/dist/client/blocks/library/ApiEndpointBlock.d.ts.map +1 -1
  93. package/dist/client/blocks/library/ApiEndpointBlock.js +14 -6
  94. package/dist/client/blocks/library/ApiEndpointBlock.js.map +1 -1
  95. package/dist/client/blocks/library/MermaidBlock.d.ts.map +1 -1
  96. package/dist/client/blocks/library/MermaidBlock.js +6 -4
  97. package/dist/client/blocks/library/MermaidBlock.js.map +1 -1
  98. package/dist/client/blocks/library/block-copy.d.ts +33 -0
  99. package/dist/client/blocks/library/block-copy.d.ts.map +1 -0
  100. package/dist/client/blocks/library/block-copy.js +329 -0
  101. package/dist/client/blocks/library/block-copy.js.map +1 -0
  102. package/dist/client/blocks/library/diagram.d.ts.map +1 -1
  103. package/dist/client/blocks/library/diagram.js +7 -5
  104. package/dist/client/blocks/library/diagram.js.map +1 -1
  105. package/dist/client/blocks/library/wireframe.d.ts.map +1 -1
  106. package/dist/client/blocks/library/wireframe.js +4 -2
  107. package/dist/client/blocks/library/wireframe.js.map +1 -1
  108. package/dist/client/i18n.d.ts +1 -0
  109. package/dist/client/i18n.d.ts.map +1 -1
  110. package/dist/client/i18n.js +3 -0
  111. package/dist/client/i18n.js.map +1 -1
  112. package/docs/content/locales/ar-SA/actions.md +7 -7
  113. package/docs/content/locales/ar-SA/template-plan.md +6 -4
  114. package/docs/content/locales/de-DE/actions.md +9 -9
  115. package/docs/content/locales/de-DE/template-plan.md +6 -4
  116. package/docs/content/locales/es-ES/actions.md +9 -9
  117. package/docs/content/locales/es-ES/template-plan.md +6 -4
  118. package/docs/content/locales/fr-FR/actions.md +9 -9
  119. package/docs/content/locales/fr-FR/template-plan.md +6 -4
  120. package/docs/content/locales/hi-IN/actions.md +9 -9
  121. package/docs/content/locales/hi-IN/template-plan.md +4 -4
  122. package/docs/content/locales/ja-JP/actions.md +9 -9
  123. package/docs/content/locales/ja-JP/template-plan.md +4 -4
  124. package/docs/content/locales/ko-KR/actions.md +9 -9
  125. package/docs/content/locales/ko-KR/template-plan.md +4 -4
  126. package/docs/content/locales/pt-BR/actions.md +9 -9
  127. package/docs/content/locales/pt-BR/template-plan.md +6 -4
  128. package/docs/content/locales/zh-CN/actions.md +9 -9
  129. package/docs/content/locales/zh-CN/template-plan.md +4 -4
  130. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AnnotatedCodeBlock.js","sourceRoot":"","sources":["../../../../src/client/blocks/library/AnnotatedCodeBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAM/D,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,4BAA4B,EAC5B,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iCAAiC,EACjC,kBAAkB,GAEnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,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AAS,IAAC,SAAS,EAAC,QAAQ,GAAG,GACzB,CACV,IACG,EACN,KAAC,WAAW,kBACE,cAAc,KAAK,GAAG,CAAC,OAAO,EAC1C,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE,UAAU,CAAC,IAAI,EACtB,WAAW,EAAC,mCAA8B,EAC1C,QAAQ,EAAE,CAAC,QAAQ,EACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAClB,gBAAgB,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,GAEvD,KA7CG,KAAK,CA8CN,CACP,CAAC,IACE,IACF,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import { useMemo, useRef, useState } from \"react\";\nimport { IconCode, IconPlus, IconTrash } from \"@tabler/icons-react\";\nimport { cn } from \"../../utils.js\";\nimport { ltrCodeBlockProps } from \"../code-block-direction.js\";\nimport type { BlockEditProps, BlockReadProps } from \"../types.js\";\nimport type {\n AnnotatedCodeAnnotation,\n AnnotatedCodeData,\n} from \"./annotated-code.config.js\";\nimport {\n highlightCode,\n inferLanguageFromFilename,\n normalizeCodeLanguage,\n} from \"./code-highlight.js\";\nimport {\n AnnotationHiddenStack,\n AnnotationHoverCard,\n AnnotationInlineOverlayStack,\n AnnotationGutterMarker,\n anchorFromElements,\n buildLineMarkerMap,\n hasRailAnnotations,\n resolveAnnotations,\n useAnnotationMarginNotesAvailable,\n useAnnotationHover,\n type ResolvedAnnotation,\n} from \"./annotation-rail.js\";\nimport { CodeFilenameLabel } from \"./code-filename-label.js\";\nimport { DevInput, DevLabel, DevTextarea } from \"./dev-doc-ui.js\";\n\n/**\n * \"Explain this code\" walkthrough block: a standard syntax-highlighted code\n * surface on the left with line-anchored annotation cards on the right (the\n * Stripe-docs / Sourcegraph layout). Each annotated line range gets a subtle\n * highlight band + an accent rail down the gutter; its card shows the `lines`\n * range, optional `label`, and the always-visible markdown `note` (via\n * `ctx.renderMarkdown`). Hovering a card highlights its lines and vice-versa.\n *\n * Syntax highlighting reuses the shared `highlightCode` lowlight helper (the same\n * colorful palette as the `code-tabs` block) per line, so it matches the app's\n * standard code styling and supports per-line bands without an async loader. The\n * surface uses the plan `--plan-code*`/`--plan-*` tokens and Tailwind `dark:`\n * pairs, so it reads correctly in BOTH light and dark mode. Code lines render as\n * `<span>`s (never one `<pre>` per line) so they don't pick up document\n * code/pre chrome. Lives in core so any app can register the dev-doc block.\n * Each annotated range also gets a numbered marker in the left gutter on the\n * first line, matching the diff block's annotation affordance without adding a\n * persistent note column.\n *\n * Editing is panel-driven (config-style, like the diff/HTML blocks): a monospace\n * code Textarea, filename/language Inputs, and add/remove-able annotation rows.\n */\n\n/* ── Collapse helpers ──────────────────────────────────────────────────────── */\n\n/**\n * Minimum total line count before collapse is considered. Short files render\n * fully expanded regardless of annotation coverage.\n */\nconst COLLAPSE_MIN_TOTAL_LINES = 40;\n\n/**\n * Number of unannotated lines in a run that triggers collapse. Runs at or\n * below this threshold always stay expanded (no expander button).\n */\nconst COLLAPSE_THRESHOLD = 16;\n\n/**\n * Context lines kept visible at each edge of a collapsed run (8 lines of\n * breathing room so the collapsed region is clearly framed).\n */\nconst COLLAPSE_CONTEXT_EDGE = 8;\n\ntype CollapsedSegment = {\n kind: \"collapsed\";\n startLine: number;\n endLine: number;\n};\ntype VisibleSegment = { kind: \"visible\"; startLine: number; endLine: number };\ntype LineSegment = VisibleSegment | CollapsedSegment;\n\n/**\n * Partition line numbers [1..lineCount] into visible and collapsed segments.\n * Annotated lines (and COLLAPSE_CONTEXT_EDGE lines on either side of them) are\n * always visible. Runs of unannotated lines longer than COLLAPSE_THRESHOLD are\n * collapsed. The file header (first COLLAPSE_CONTEXT_EDGE lines) is always\n * visible so context is preserved.\n */\nfunction buildLineSegments(\n lineCount: number,\n lineMarkers: Map<number, Array<{ index: number }>>,\n): LineSegment[] {\n if (lineCount <= COLLAPSE_MIN_TOTAL_LINES) {\n return [{ kind: \"visible\", startLine: 1, endLine: lineCount }];\n }\n\n // Build a boolean array: true if the line must stay visible.\n const mustShow = new Array<boolean>(lineCount + 1).fill(false);\n // File header always visible.\n for (let i = 1; i <= Math.min(COLLAPSE_CONTEXT_EDGE, lineCount); i += 1) {\n mustShow[i] = true;\n }\n // Annotated lines and their context edges.\n for (const lineNo of lineMarkers.keys()) {\n for (\n let i = Math.max(1, lineNo - COLLAPSE_CONTEXT_EDGE);\n i <= Math.min(lineCount, lineNo + COLLAPSE_CONTEXT_EDGE);\n i += 1\n ) {\n mustShow[i] = true;\n }\n }\n\n // Compute initial segments.\n const raw: LineSegment[] = [];\n let segStart = 1;\n let visible = mustShow[1] ?? false;\n for (let i = 2; i <= lineCount; i += 1) {\n const nextVisible = mustShow[i] ?? false;\n if (nextVisible !== visible) {\n raw.push(\n visible\n ? { kind: \"visible\", startLine: segStart, endLine: i - 1 }\n : { kind: \"collapsed\", startLine: segStart, endLine: i - 1 },\n );\n segStart = i;\n visible = nextVisible;\n }\n }\n raw.push(\n visible\n ? { kind: \"visible\", startLine: segStart, endLine: lineCount }\n : { kind: \"collapsed\", startLine: segStart, endLine: lineCount },\n );\n\n // Don't collapse short hidden runs — expand them in-place.\n return raw.map((seg) => {\n if (\n seg.kind === \"collapsed\" &&\n seg.endLine - seg.startLine + 1 <= COLLAPSE_THRESHOLD\n ) {\n return {\n kind: \"visible\",\n startLine: seg.startLine,\n endLine: seg.endLine,\n };\n }\n return seg;\n });\n}\n\n/* ── Read ──────────────────────────────────────────────────────────────────── */\n\nfunction AnnotatedCodeRead({\n data,\n blockId,\n title,\n summary,\n ctx,\n}: BlockReadProps<AnnotatedCodeData>) {\n // On-hover popover (anchored to the right of the code) replaces the old\n // persistent rail: nothing is visible when idle. `codeRef` measures the code\n // block's right edge; `hover` carries the active index + captured geometry.\n const hover = useAnnotationHover();\n const { activeIndex } = hover;\n const codeRef = useRef<HTMLDivElement | null>(null);\n const lineRefs = useRef(new Map<number, HTMLDivElement>());\n\n const setLineRef = (lineNo: number, node: HTMLDivElement | null) => {\n if (node) lineRefs.current.set(lineNo, node);\n else lineRefs.current.delete(lineNo);\n };\n\n const lines = useMemo(\n () => data.code.replace(/\\n$/, \"\").split(\"\\n\"),\n [data.code],\n );\n const lineCount = lines.length;\n\n const language = useMemo(\n () =>\n normalizeCodeLanguage(data.language) ??\n inferLanguageFromFilename(data.filename),\n [data.language, data.filename],\n );\n\n // Highlight each line once; empty lines keep their height with a NBSP.\n const highlightedLines = useMemo(\n () =>\n lines.map((text) => (text.length ? highlightCode(text, language) : \" \")),\n [lines, language],\n );\n\n const resolved = useMemo(\n () => resolveAnnotations(data.annotations, () => lineCount),\n [data.annotations, lineCount],\n );\n\n // line number (1-based) → resolved annotations covering it.\n const lineMarkers = useMemo(() => buildLineMarkerMap(resolved), [resolved]);\n\n const hasAnnotations = hasRailAnnotations(resolved);\n const showAnnotationOverlays = Boolean(ctx.showCodeAnnotationOverlays);\n const annotationLayout = ctx.codeAnnotationLayout;\n const annotationHoverSide = annotationLayout?.hoverSide ?? \"right\";\n const annotationHoverFallbackSide =\n annotationLayout?.hoverFallbackSide ?? \"right\";\n const annotationMarginSide = annotationLayout?.marginSide ?? \"auto\";\n const defaultVisibleAnnotations =\n annotationLayout?.defaultVisibleAnnotations ??\n (annotationLayout?.showByDefaultWhenRoom ? \"all\" : undefined);\n const showMarginAnnotations = useAnnotationMarginNotesAvailable({\n containerRef: codeRef,\n enabled: Boolean(\n hasAnnotations && !showAnnotationOverlays && defaultVisibleAnnotations,\n ),\n side: annotationMarginSide,\n preferredSide: annotationHoverSide,\n });\n const showPersistentAnnotations =\n showAnnotationOverlays || showMarginAnnotations;\n const persistentAnnotationIndexes = useMemo(() => {\n if (!showMarginAnnotations || !defaultVisibleAnnotations) {\n return new Set<number>();\n }\n const visible = resolved.filter((item) => item.range);\n if (defaultVisibleAnnotations === \"first\") {\n const first = visible[0];\n return first ? new Set([first.index]) : new Set<number>();\n }\n return new Set(visible.map((item) => item.index));\n }, [defaultVisibleAnnotations, resolved, showMarginAnnotations]);\n const captureOverlayAnnotationIndex = useMemo(\n () => resolved.find((item) => item.range)?.index ?? null,\n [resolved],\n );\n const langChip = data.language?.trim();\n const hasFilename = Boolean(data.filename?.trim());\n const showLangChip = Boolean(langChip && !hasFilename);\n\n // The resolved annotation whose card is currently shown on hover.\n const activeItem =\n useMemo<ResolvedAnnotation<AnnotatedCodeAnnotation> | null>(\n () =>\n activeIndex == null\n ? null\n : (resolved.find((item) => item.index === activeIndex) ?? null),\n [activeIndex, resolved],\n );\n const activeItemIsPersistentlyVisible = Boolean(\n activeItem &&\n !showAnnotationOverlays &&\n persistentAnnotationIndexes.has(activeItem.index),\n );\n\n // Line-collapse state: a set of collapsed segment start lines that have been\n // expanded by the reader. Starts empty (all segments in their default state).\n const [expandedCollapsed, setExpandedCollapsed] = useState<Set<number>>(\n () => new Set(),\n );\n\n const segments = useMemo(\n () => buildLineSegments(lineCount, lineMarkers),\n [lineCount, lineMarkers],\n );\n\n const renderLine = (lineNo: number) => {\n const markers = lineMarkers.get(lineNo);\n const isAnnotated = !!markers?.length;\n const isActive =\n activeIndex != null && !!markers?.some((m) => m.index === activeIndex);\n const overlayItems =\n showPersistentAnnotations && markers\n ? markers.filter(\n (item) =>\n item.range?.start === lineNo &&\n (showAnnotationOverlays\n ? item.index === captureOverlayAnnotationIndex\n : persistentAnnotationIndexes.has(item.index)),\n )\n : [];\n const rowHasPersistentAnnotation = Boolean(\n markers?.some((item) => persistentAnnotationIndexes.has(item.index)),\n );\n const rangeStartMarkers =\n markers?.filter((item) => item.range?.start === lineNo) ?? [];\n const showMarkerColumn = hasAnnotations;\n\n const buildAnchorForItem = (\n item: ResolvedAnnotation<AnnotatedCodeAnnotation>,\n fallbackRow: HTMLElement,\n ) => {\n const anchorLine = item.range?.start ?? lineNo;\n const anchorRow = lineRefs.current.get(anchorLine) ?? fallbackRow;\n return anchorFromElements(codeRef.current, anchorRow);\n };\n\n const openAnnotation = (\n item: ResolvedAnnotation<AnnotatedCodeAnnotation>,\n row: HTMLElement,\n ) => {\n const anchor = buildAnchorForItem(item, row);\n if (anchor) hover.open(item.index, anchor);\n };\n\n return (\n <div\n key={lineNo}\n ref={(node) => setLineRef(lineNo, node)}\n data-code-line={lineNo}\n data-annot-row={isAnnotated ? markers?.[0].index : undefined}\n tabIndex={isAnnotated ? 0 : undefined}\n role={isAnnotated ? \"button\" : undefined}\n aria-expanded={isAnnotated ? isActive : undefined}\n aria-label={isAnnotated ? `Line ${lineNo} annotation` : undefined}\n className={cn(\n \"relative flex w-full\",\n isAnnotated && \"cursor-pointer\",\n isActive\n ? \"bg-amber-400/[0.12] dark:bg-amber-300/[0.10]\"\n : rowHasPersistentAnnotation\n ? \"bg-amber-300/[0.14] dark:bg-amber-300/[0.10]\"\n : isAnnotated && showAnnotationOverlays\n ? \"bg-amber-300/[0.14] dark:bg-amber-300/[0.10]\"\n : isAnnotated\n ? \"bg-amber-400/[0.045] dark:bg-amber-300/[0.045]\"\n : null,\n )}\n onMouseEnter={\n isAnnotated && markers\n ? (event) => {\n openAnnotation(markers[0], event.currentTarget);\n }\n : undefined\n }\n onMouseLeave={isAnnotated ? () => hover.scheduleClose() : undefined}\n onClick={\n isAnnotated && markers\n ? (event) => {\n openAnnotation(markers[0], event.currentTarget);\n }\n : undefined\n }\n onKeyDown={\n isAnnotated && markers\n ? (event) => {\n if (event.key !== \"Enter\" && event.key !== \" \") return;\n event.preventDefault();\n openAnnotation(markers[0], event.currentTarget);\n }\n : undefined\n }\n onFocus={\n isAnnotated && markers\n ? (event) => {\n openAnnotation(markers[0], event.currentTarget);\n }\n : undefined\n }\n onBlur={isAnnotated ? () => hover.scheduleClose() : undefined}\n >\n <span\n aria-hidden\n className={cn(\n \"w-[3px] shrink-0 self-stretch\",\n isAnnotated\n ? isActive\n ? \"bg-amber-500/80 dark:bg-amber-400/70\"\n : showAnnotationOverlays\n ? \"bg-amber-500/55 dark:bg-amber-300/45\"\n : \"bg-amber-400/30 dark:bg-amber-300/25\"\n : null,\n )}\n />\n <span className=\"w-11 shrink-0 select-none px-3 text-right text-[11px] tabular-nums text-plan-muted/60\">\n {lineNo}\n </span>\n {showMarkerColumn && (\n <span\n aria-hidden\n className=\"flex w-6 shrink-0 select-none items-center justify-center gap-1 py-0\"\n data-annotated-code-marker-stack={\n rangeStartMarkers.length > 0 ? \"\" : undefined\n }\n >\n {rangeStartMarkers.map((item) => (\n <span\n key={item.index}\n data-annotated-code-marker={item.marker}\n onMouseEnter={(event) => {\n event.stopPropagation();\n const row =\n event.currentTarget.closest<HTMLElement>(\n \"[data-code-line]\",\n ) ?? event.currentTarget;\n openAnnotation(item, row);\n }}\n onClick={(event) => {\n event.stopPropagation();\n const row =\n event.currentTarget.closest<HTMLElement>(\n \"[data-code-line]\",\n ) ?? event.currentTarget;\n openAnnotation(item, row);\n }}\n className=\"inline-flex cursor-pointer outline-none transition-transform hover:scale-110\"\n >\n <AnnotationGutterMarker\n marker={item.marker}\n active={\n activeIndex === item.index ||\n persistentAnnotationIndexes.has(item.index)\n }\n />\n </span>\n ))}\n </span>\n )}\n <span className=\"flex-1 whitespace-pre pr-4 text-plan-code-text\">\n {highlightedLines[lineNo - 1]}\n </span>\n {overlayItems.length > 0 && (\n <AnnotationInlineOverlayStack\n items={overlayItems}\n ctx={ctx}\n showMarker\n containerRef={codeRef}\n mode={showAnnotationOverlays ? \"capture\" : \"margin\"}\n side={showAnnotationOverlays ? \"right\" : annotationMarginSide}\n preferredSide={annotationHoverSide}\n />\n )}\n </div>\n );\n };\n\n const codeSurface = (\n <div\n ref={codeRef}\n className=\"overflow-hidden rounded-xl border border-plan-line bg-plan-code\"\n >\n {(hasFilename || showLangChip) && (\n <div className=\"flex items-center gap-2 border-b border-plan-line bg-plan-block/50 px-3.5 py-2\">\n <IconCode className=\"size-3.5 shrink-0 text-plan-muted\" />\n <CodeFilenameLabel\n filename={data.filename}\n className=\"text-[13px] font-medium\"\n directoryClassName=\"text-plan-muted\"\n basenameClassName=\"text-plan-code-text\"\n />\n {showLangChip && (\n <span className=\"shrink-0 rounded border border-plan-line px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wide text-plan-muted\">\n {langChip}\n </span>\n )}\n </div>\n )}\n <div className=\"overflow-x-auto py-1.5\" data-code-surface>\n <div className=\"min-w-full font-mono [font-size:var(--plan-doc-code-size)] leading-[22px]\">\n {segments.map((seg) => {\n if (seg.kind === \"visible\") {\n const lineNos = Array.from(\n { length: seg.endLine - seg.startLine + 1 },\n (_, i) => seg.startLine + i,\n );\n return lineNos.map(renderLine);\n }\n // Collapsed segment — show an expander row.\n const isExpanded = expandedCollapsed.has(seg.startLine);\n const hiddenCount = seg.endLine - seg.startLine + 1;\n if (isExpanded) {\n const lineNos = Array.from(\n { length: hiddenCount },\n (_, i) => seg.startLine + i,\n );\n return lineNos.map(renderLine);\n }\n return (\n <button\n key={`collapse-${seg.startLine}`}\n type=\"button\"\n data-plan-interactive\n onClick={() =>\n setExpandedCollapsed((prev) => {\n const next = new Set(prev);\n next.add(seg.startLine);\n return next;\n })\n }\n className=\"flex w-full cursor-pointer items-center gap-2 border-y border-plan-line/50 bg-plan-block/20 px-3 py-0.5 text-left hover:bg-plan-block/40\"\n >\n <span aria-hidden className=\"w-[3px] shrink-0 self-stretch\" />\n <span className=\"w-8 shrink-0 select-none text-right text-[11px] tabular-nums text-plan-muted/40\">\n ···\n </span>\n <span className=\"flex-1 text-[11px] text-plan-muted/70\">\n {hiddenCount} lines — click to expand\n </span>\n </button>\n );\n })}\n </div>\n </div>\n </div>\n );\n\n return (\n <section\n {...ltrCodeBlockProps}\n className=\"plan-block relative\"\n data-block-id={blockId}\n >\n {title && <div className=\"plan-block-label\">{title}</div>}\n {/* The code keeps its full width — no persistent annotation column. Notes\n live in a visually-hidden stack (a11y + tests) and surface ONE at a\n time as an on-hover popover anchored to the right of the code. */}\n {codeSurface}\n {hasAnnotations && (\n <AnnotationHiddenStack items={resolved} ctx={ctx} showMarker />\n )}\n {hasAnnotations &&\n !showAnnotationOverlays &&\n !activeItemIsPersistentlyVisible &&\n activeItem &&\n hover.anchor && (\n <AnnotationHoverCard\n item={activeItem}\n anchor={hover.anchor}\n ctx={ctx}\n showMarker\n preferredSide={annotationHoverSide}\n hoverFallbackSide={annotationHoverFallbackSide}\n onMouseEnter={hover.cancelClose}\n onMouseLeave={hover.scheduleClose}\n onClose={hover.closeForScroll}\n onInteractOutside={hover.close}\n />\n )}\n {summary && <p className=\"mt-5 text-plan-muted\">{summary}</p>}\n </section>\n );\n}\n\n/* ── Edit (panel) ──────────────────────────────────────────────────────────── */\n\nconst codeAreaClass =\n \"min-h-[160px] font-mono [font-size:var(--plan-code-size)] leading-5\";\n\nfunction AnnotatedCodeEdit({\n data,\n onChange,\n editable,\n}: BlockEditProps<AnnotatedCodeData>) {\n const annotations = data.annotations ?? [];\n const patch = (next: Partial<AnnotatedCodeData>) =>\n onChange({ ...data, ...next });\n\n const updateAnnotation = (\n index: number,\n next: Partial<AnnotatedCodeAnnotation>,\n ) =>\n patch({\n annotations: annotations.map((annotation, i) =>\n i === index ? { ...annotation, ...next } : annotation,\n ),\n });\n\n const removeAnnotation = (index: number) =>\n patch({ annotations: annotations.filter((_, i) => i !== index) });\n\n const addAnnotation = () => {\n if (annotations.length >= 80) return; // schema max\n patch({\n annotations: [...annotations, { lines: \"1\", label: \"\", note: \"\" }],\n });\n };\n\n return (\n <div className=\"flex flex-col gap-3\" data-plan-interactive>\n <div className=\"grid gap-3 sm:grid-cols-2\">\n <div className=\"flex flex-col gap-1.5\">\n <DevLabel htmlFor=\"annotated-code-filename\" className=\"text-xs\">\n Filename\n </DevLabel>\n <DevInput\n id=\"annotated-code-filename\"\n value={data.filename ?? \"\"}\n placeholder=\"src/server/auth.ts\"\n disabled={!editable}\n onChange={(event) =>\n patch({ filename: event.target.value || undefined })\n }\n />\n </div>\n <div className=\"flex flex-col gap-1.5\">\n <DevLabel htmlFor=\"annotated-code-language\" className=\"text-xs\">\n Language\n </DevLabel>\n <DevInput\n id=\"annotated-code-language\"\n value={data.language ?? \"\"}\n placeholder=\"ts\"\n disabled={!editable}\n onChange={(event) =>\n patch({ language: event.target.value || undefined })\n }\n />\n </div>\n </div>\n\n <div className=\"flex flex-col gap-1.5\">\n <DevLabel htmlFor=\"annotated-code-code\" className=\"text-xs\">\n Code\n </DevLabel>\n <DevTextarea\n id=\"annotated-code-code\"\n spellCheck={false}\n className={codeAreaClass}\n value={data.code}\n disabled={!editable}\n onChange={(event) => patch({ code: event.target.value })}\n />\n </div>\n\n <div className=\"flex flex-col gap-2\">\n <div className=\"flex items-center justify-between\">\n <DevLabel className=\"text-xs\">Annotations</DevLabel>\n {editable && annotations.length < 80 && (\n <button\n type=\"button\"\n data-plan-interactive\n onClick={addAnnotation}\n className=\"flex cursor-pointer items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-plan-muted transition-colors hover:bg-plan-block/60 hover:text-plan-text\"\n >\n <IconPlus className=\"size-3.5\" />\n Add annotation\n </button>\n )}\n </div>\n {annotations.length === 0 && (\n <p className=\"text-xs text-plan-muted\">\n No annotations yet. Add one to anchor a note to a line range.\n </p>\n )}\n {annotations.map((annotation, index) => (\n <div\n key={index}\n className=\"flex flex-col gap-2 rounded-md border border-plan-line bg-plan-block/30 p-2\"\n >\n <div className=\"grid gap-2 sm:grid-cols-[120px_minmax(0,1fr)_auto]\">\n <DevInput\n aria-label={`Annotation ${index + 1} lines`}\n value={annotation.lines}\n placeholder=\"3-5\"\n disabled={!editable}\n onChange={(event) =>\n updateAnnotation(index, { lines: event.target.value })\n }\n />\n <DevInput\n aria-label={`Annotation ${index + 1} label`}\n value={annotation.label ?? \"\"}\n placeholder=\"Label (optional)\"\n disabled={!editable}\n onChange={(event) =>\n updateAnnotation(index, {\n label: event.target.value || undefined,\n })\n }\n />\n {editable && (\n <button\n type=\"button\"\n data-plan-interactive\n aria-label={`Remove annotation ${index + 1}`}\n onClick={() => removeAnnotation(index)}\n className=\"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-md text-plan-muted transition-colors hover:bg-muted hover:text-foreground\"\n >\n <IconTrash className=\"size-4\" />\n </button>\n )}\n </div>\n <DevTextarea\n aria-label={`Annotation ${index + 1} note`}\n className=\"min-h-[60px] text-sm\"\n value={annotation.note}\n placeholder=\"Explain what these lines do…\"\n disabled={!editable}\n onChange={(event) =>\n updateAnnotation(index, { note: event.target.value })\n }\n />\n </div>\n ))}\n </div>\n </div>\n );\n}\n\nexport { AnnotatedCodeRead, AnnotatedCodeEdit };\n"]}
1
+ {"version":3,"file":"AnnotatedCodeBlock.js","sourceRoot":"","sources":["../../../../src/client/blocks/library/AnnotatedCodeBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAM/D,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,4BAA4B,EAC5B,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iCAAiC,EACjC,kBAAkB,GAEnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,kFAAkF;AAElF;;;GAG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AG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,EACtC,SAAS,EAAC,mJAAmJ,YAE7J,KAAC,SAAS,IAAC,SAAS,EAAC,QAAQ,GAAG,GACzB,CACV,IACG,EACN,KAAC,WAAW,kBACE,cAAc,KAAK,GAAG,CAAC,OAAO,EAC1C,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE,UAAU,CAAC,IAAI,EACtB,WAAW,EAAC,mCAA8B,EAC1C,QAAQ,EAAE,CAAC,QAAQ,EACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAClB,gBAAgB,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,GAEvD,KA7CG,KAAK,CA8CN,CACP,CAAC,IACE,IACF,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import { useMemo, useRef, useState } from \"react\";\nimport { IconCode, IconPlus, IconTrash } from \"@tabler/icons-react\";\nimport { cn } from \"../../utils.js\";\nimport { ltrCodeBlockProps } from \"../code-block-direction.js\";\nimport type { BlockEditProps, BlockReadProps } from \"../types.js\";\nimport type {\n AnnotatedCodeAnnotation,\n AnnotatedCodeData,\n} from \"./annotated-code.config.js\";\nimport {\n highlightCode,\n inferLanguageFromFilename,\n normalizeCodeLanguage,\n} from \"./code-highlight.js\";\nimport {\n AnnotationHiddenStack,\n AnnotationHoverCard,\n AnnotationInlineOverlayStack,\n AnnotationGutterMarker,\n anchorFromElements,\n buildLineMarkerMap,\n hasRailAnnotations,\n resolveAnnotations,\n useAnnotationMarginNotesAvailable,\n useAnnotationHover,\n type ResolvedAnnotation,\n} from \"./annotation-rail.js\";\nimport { CodeFilenameLabel } from \"./code-filename-label.js\";\nimport { DevInput, DevLabel, DevTextarea } from \"./dev-doc-ui.js\";\nimport { useBlockCopy } from \"./block-copy.js\";\n\n/**\n * \"Explain this code\" walkthrough block: a standard syntax-highlighted code\n * surface on the left with line-anchored annotation cards on the right (the\n * Stripe-docs / Sourcegraph layout). Each annotated line range gets a subtle\n * highlight band + an accent rail down the gutter; its card shows the `lines`\n * range, optional `label`, and the always-visible markdown `note` (via\n * `ctx.renderMarkdown`). Hovering a card highlights its lines and vice-versa.\n *\n * Syntax highlighting reuses the shared `highlightCode` lowlight helper (the same\n * colorful palette as the `code-tabs` block) per line, so it matches the app's\n * standard code styling and supports per-line bands without an async loader. The\n * surface uses the plan `--plan-code*`/`--plan-*` tokens and Tailwind `dark:`\n * pairs, so it reads correctly in BOTH light and dark mode. Code lines render as\n * `<span>`s (never one `<pre>` per line) so they don't pick up document\n * code/pre chrome. Lives in core so any app can register the dev-doc block.\n * Each annotated range also gets a numbered marker in the left gutter on the\n * first line, matching the diff block's annotation affordance without adding a\n * persistent note column.\n *\n * Editing is panel-driven (config-style, like the diff/HTML blocks): a monospace\n * code Textarea, filename/language Inputs, and add/remove-able annotation rows.\n */\n\n/* ── Collapse helpers ──────────────────────────────────────────────────────── */\n\n/**\n * Minimum total line count before collapse is considered. Short files render\n * fully expanded regardless of annotation coverage.\n */\nconst COLLAPSE_MIN_TOTAL_LINES = 40;\n\n/**\n * Number of unannotated lines in a run that triggers collapse. Runs at or\n * below this threshold always stay expanded (no expander button).\n */\nconst COLLAPSE_THRESHOLD = 16;\n\n/**\n * Context lines kept visible at each edge of a collapsed run (8 lines of\n * breathing room so the collapsed region is clearly framed).\n */\nconst COLLAPSE_CONTEXT_EDGE = 8;\n\ntype CollapsedSegment = {\n kind: \"collapsed\";\n startLine: number;\n endLine: number;\n};\ntype VisibleSegment = { kind: \"visible\"; startLine: number; endLine: number };\ntype LineSegment = VisibleSegment | CollapsedSegment;\n\n/**\n * Partition line numbers [1..lineCount] into visible and collapsed segments.\n * Annotated lines (and COLLAPSE_CONTEXT_EDGE lines on either side of them) are\n * always visible. Runs of unannotated lines longer than COLLAPSE_THRESHOLD are\n * collapsed. The file header (first COLLAPSE_CONTEXT_EDGE lines) is always\n * visible so context is preserved.\n */\nfunction buildLineSegments(\n lineCount: number,\n lineMarkers: Map<number, Array<{ index: number }>>,\n): LineSegment[] {\n if (lineCount <= COLLAPSE_MIN_TOTAL_LINES) {\n return [{ kind: \"visible\", startLine: 1, endLine: lineCount }];\n }\n\n // Build a boolean array: true if the line must stay visible.\n const mustShow = new Array<boolean>(lineCount + 1).fill(false);\n // File header always visible.\n for (let i = 1; i <= Math.min(COLLAPSE_CONTEXT_EDGE, lineCount); i += 1) {\n mustShow[i] = true;\n }\n // Annotated lines and their context edges.\n for (const lineNo of lineMarkers.keys()) {\n for (\n let i = Math.max(1, lineNo - COLLAPSE_CONTEXT_EDGE);\n i <= Math.min(lineCount, lineNo + COLLAPSE_CONTEXT_EDGE);\n i += 1\n ) {\n mustShow[i] = true;\n }\n }\n\n // Compute initial segments.\n const raw: LineSegment[] = [];\n let segStart = 1;\n let visible = mustShow[1] ?? false;\n for (let i = 2; i <= lineCount; i += 1) {\n const nextVisible = mustShow[i] ?? false;\n if (nextVisible !== visible) {\n raw.push(\n visible\n ? { kind: \"visible\", startLine: segStart, endLine: i - 1 }\n : { kind: \"collapsed\", startLine: segStart, endLine: i - 1 },\n );\n segStart = i;\n visible = nextVisible;\n }\n }\n raw.push(\n visible\n ? { kind: \"visible\", startLine: segStart, endLine: lineCount }\n : { kind: \"collapsed\", startLine: segStart, endLine: lineCount },\n );\n\n // Don't collapse short hidden runs — expand them in-place.\n return raw.map((seg) => {\n if (\n seg.kind === \"collapsed\" &&\n seg.endLine - seg.startLine + 1 <= COLLAPSE_THRESHOLD\n ) {\n return {\n kind: \"visible\",\n startLine: seg.startLine,\n endLine: seg.endLine,\n };\n }\n return seg;\n });\n}\n\n/* ── Read ──────────────────────────────────────────────────────────────────── */\n\nfunction AnnotatedCodeRead({\n data,\n blockId,\n title,\n summary,\n ctx,\n}: BlockReadProps<AnnotatedCodeData>) {\n const copy = useBlockCopy();\n // On-hover popover (anchored to the right of the code) replaces the old\n // persistent rail: nothing is visible when idle. `codeRef` measures the code\n // block's right edge; `hover` carries the active index + captured geometry.\n const hover = useAnnotationHover();\n const { activeIndex } = hover;\n const codeRef = useRef<HTMLDivElement | null>(null);\n const lineRefs = useRef(new Map<number, HTMLDivElement>());\n\n const setLineRef = (lineNo: number, node: HTMLDivElement | null) => {\n if (node) lineRefs.current.set(lineNo, node);\n else lineRefs.current.delete(lineNo);\n };\n\n const lines = useMemo(\n () => data.code.replace(/\\n$/, \"\").split(\"\\n\"),\n [data.code],\n );\n const lineCount = lines.length;\n\n const language = useMemo(\n () =>\n normalizeCodeLanguage(data.language) ??\n inferLanguageFromFilename(data.filename),\n [data.language, data.filename],\n );\n\n // Highlight each line once; empty lines keep their height with a NBSP.\n const highlightedLines = useMemo(\n () =>\n lines.map((text) => (text.length ? highlightCode(text, language) : \" \")),\n [lines, language],\n );\n\n const resolved = useMemo(\n () => resolveAnnotations(data.annotations, () => lineCount),\n [data.annotations, lineCount],\n );\n\n // line number (1-based) → resolved annotations covering it.\n const lineMarkers = useMemo(() => buildLineMarkerMap(resolved), [resolved]);\n\n const hasAnnotations = hasRailAnnotations(resolved);\n const showAnnotationOverlays = Boolean(ctx.showCodeAnnotationOverlays);\n const annotationLayout = ctx.codeAnnotationLayout;\n const annotationHoverSide = annotationLayout?.hoverSide ?? \"right\";\n const annotationHoverFallbackSide =\n annotationLayout?.hoverFallbackSide ?? \"right\";\n const annotationMarginSide = annotationLayout?.marginSide ?? \"auto\";\n const defaultVisibleAnnotations =\n annotationLayout?.defaultVisibleAnnotations ??\n (annotationLayout?.showByDefaultWhenRoom ? \"all\" : undefined);\n const showMarginAnnotations = useAnnotationMarginNotesAvailable({\n containerRef: codeRef,\n enabled: Boolean(\n hasAnnotations && !showAnnotationOverlays && defaultVisibleAnnotations,\n ),\n side: annotationMarginSide,\n preferredSide: annotationHoverSide,\n });\n const showPersistentAnnotations =\n showAnnotationOverlays || showMarginAnnotations;\n const persistentAnnotationIndexes = useMemo(() => {\n if (!showMarginAnnotations || !defaultVisibleAnnotations) {\n return new Set<number>();\n }\n const visible = resolved.filter((item) => item.range);\n if (defaultVisibleAnnotations === \"first\") {\n const first = visible[0];\n return first ? new Set([first.index]) : new Set<number>();\n }\n return new Set(visible.map((item) => item.index));\n }, [defaultVisibleAnnotations, resolved, showMarginAnnotations]);\n const captureOverlayAnnotationIndex = useMemo(\n () => resolved.find((item) => item.range)?.index ?? null,\n [resolved],\n );\n const langChip = data.language?.trim();\n const hasFilename = Boolean(data.filename?.trim());\n const showLangChip = Boolean(langChip && !hasFilename);\n\n // The resolved annotation whose card is currently shown on hover.\n const activeItem =\n useMemo<ResolvedAnnotation<AnnotatedCodeAnnotation> | null>(\n () =>\n activeIndex == null\n ? null\n : (resolved.find((item) => item.index === activeIndex) ?? null),\n [activeIndex, resolved],\n );\n const activeItemIsPersistentlyVisible = Boolean(\n activeItem &&\n !showAnnotationOverlays &&\n persistentAnnotationIndexes.has(activeItem.index),\n );\n\n // Line-collapse state: a set of collapsed segment start lines that have been\n // expanded by the reader. Starts empty (all segments in their default state).\n const [expandedCollapsed, setExpandedCollapsed] = useState<Set<number>>(\n () => new Set(),\n );\n\n const segments = useMemo(\n () => buildLineSegments(lineCount, lineMarkers),\n [lineCount, lineMarkers],\n );\n\n const renderLine = (lineNo: number) => {\n const markers = lineMarkers.get(lineNo);\n const isAnnotated = !!markers?.length;\n const isActive =\n activeIndex != null && !!markers?.some((m) => m.index === activeIndex);\n const overlayItems =\n showPersistentAnnotations && markers\n ? markers.filter(\n (item) =>\n item.range?.start === lineNo &&\n (showAnnotationOverlays\n ? item.index === captureOverlayAnnotationIndex\n : persistentAnnotationIndexes.has(item.index)),\n )\n : [];\n const rowHasPersistentAnnotation = Boolean(\n markers?.some((item) => persistentAnnotationIndexes.has(item.index)),\n );\n const rangeStartMarkers =\n markers?.filter((item) => item.range?.start === lineNo) ?? [];\n const showMarkerColumn = hasAnnotations;\n\n const buildAnchorForItem = (\n item: ResolvedAnnotation<AnnotatedCodeAnnotation>,\n fallbackRow: HTMLElement,\n ) => {\n const anchorLine = item.range?.start ?? lineNo;\n const anchorRow = lineRefs.current.get(anchorLine) ?? fallbackRow;\n return anchorFromElements(codeRef.current, anchorRow);\n };\n\n const openAnnotation = (\n item: ResolvedAnnotation<AnnotatedCodeAnnotation>,\n row: HTMLElement,\n ) => {\n const anchor = buildAnchorForItem(item, row);\n if (anchor) hover.open(item.index, anchor);\n };\n\n return (\n <div\n key={lineNo}\n ref={(node) => setLineRef(lineNo, node)}\n data-code-line={lineNo}\n data-annot-row={isAnnotated ? markers?.[0].index : undefined}\n tabIndex={isAnnotated ? 0 : undefined}\n role={isAnnotated ? \"button\" : undefined}\n aria-expanded={isAnnotated ? isActive : undefined}\n aria-label={\n isAnnotated\n ? copy.lineAnnotation.replace(\"{{line}}\", String(lineNo))\n : undefined\n }\n className={cn(\n \"relative flex w-full\",\n isAnnotated && \"cursor-pointer\",\n isActive\n ? \"bg-amber-400/[0.12] dark:bg-amber-300/[0.10]\"\n : rowHasPersistentAnnotation\n ? \"bg-amber-300/[0.14] dark:bg-amber-300/[0.10]\"\n : isAnnotated && showAnnotationOverlays\n ? \"bg-amber-300/[0.14] dark:bg-amber-300/[0.10]\"\n : isAnnotated\n ? \"bg-amber-400/[0.045] dark:bg-amber-300/[0.045]\"\n : null,\n )}\n onMouseEnter={\n isAnnotated && markers\n ? (event) => {\n openAnnotation(markers[0], event.currentTarget);\n }\n : undefined\n }\n onMouseLeave={isAnnotated ? () => hover.scheduleClose() : undefined}\n onClick={\n isAnnotated && markers\n ? (event) => {\n openAnnotation(markers[0], event.currentTarget);\n }\n : undefined\n }\n onKeyDown={\n isAnnotated && markers\n ? (event) => {\n if (event.key !== \"Enter\" && event.key !== \" \") return;\n event.preventDefault();\n openAnnotation(markers[0], event.currentTarget);\n }\n : undefined\n }\n onFocus={\n isAnnotated && markers\n ? (event) => {\n openAnnotation(markers[0], event.currentTarget);\n }\n : undefined\n }\n onBlur={isAnnotated ? () => hover.scheduleClose() : undefined}\n >\n <span\n aria-hidden\n className={cn(\n \"w-[3px] shrink-0 self-stretch\",\n isAnnotated\n ? isActive\n ? \"bg-amber-500/80 dark:bg-amber-400/70\"\n : showAnnotationOverlays\n ? \"bg-amber-500/55 dark:bg-amber-300/45\"\n : \"bg-amber-400/30 dark:bg-amber-300/25\"\n : null,\n )}\n />\n <span className=\"w-11 shrink-0 select-none px-3 text-right text-[11px] tabular-nums text-plan-muted/60\">\n {lineNo}\n </span>\n {showMarkerColumn && (\n <span\n aria-hidden\n className=\"flex w-6 shrink-0 select-none items-center justify-center gap-1 py-0\"\n data-annotated-code-marker-stack={\n rangeStartMarkers.length > 0 ? \"\" : undefined\n }\n >\n {rangeStartMarkers.map((item) => (\n <span\n key={item.index}\n data-annotated-code-marker={item.marker}\n onMouseEnter={(event) => {\n event.stopPropagation();\n const row =\n event.currentTarget.closest<HTMLElement>(\n \"[data-code-line]\",\n ) ?? event.currentTarget;\n openAnnotation(item, row);\n }}\n onClick={(event) => {\n event.stopPropagation();\n const row =\n event.currentTarget.closest<HTMLElement>(\n \"[data-code-line]\",\n ) ?? event.currentTarget;\n openAnnotation(item, row);\n }}\n className=\"inline-flex cursor-pointer outline-none transition-transform hover:scale-110\"\n >\n <AnnotationGutterMarker\n marker={item.marker}\n active={\n activeIndex === item.index ||\n persistentAnnotationIndexes.has(item.index)\n }\n />\n </span>\n ))}\n </span>\n )}\n <span className=\"flex-1 whitespace-pre pr-4 text-plan-code-text\">\n {highlightedLines[lineNo - 1]}\n </span>\n {overlayItems.length > 0 && (\n <AnnotationInlineOverlayStack\n items={overlayItems}\n ctx={ctx}\n showMarker\n containerRef={codeRef}\n mode={showAnnotationOverlays ? \"capture\" : \"margin\"}\n side={showAnnotationOverlays ? \"right\" : annotationMarginSide}\n preferredSide={annotationHoverSide}\n />\n )}\n </div>\n );\n };\n\n const codeSurface = (\n <div\n ref={codeRef}\n className=\"overflow-hidden rounded-xl border border-plan-line bg-plan-code\"\n >\n {(hasFilename || showLangChip) && (\n <div className=\"flex items-center gap-2 border-b border-plan-line bg-plan-block/50 px-3.5 py-2\">\n <IconCode className=\"size-3.5 shrink-0 text-plan-muted\" />\n <CodeFilenameLabel\n filename={data.filename}\n className=\"text-[13px] font-medium\"\n directoryClassName=\"text-plan-muted\"\n basenameClassName=\"text-plan-code-text\"\n />\n {showLangChip && (\n <span className=\"shrink-0 rounded border border-plan-line px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wide text-plan-muted\">\n {langChip}\n </span>\n )}\n </div>\n )}\n <div className=\"overflow-x-auto py-1.5\" data-code-surface>\n <div className=\"min-w-full font-mono [font-size:var(--plan-doc-code-size)] leading-[22px]\">\n {segments.map((seg) => {\n if (seg.kind === \"visible\") {\n const lineNos = Array.from(\n { length: seg.endLine - seg.startLine + 1 },\n (_, i) => seg.startLine + i,\n );\n return lineNos.map(renderLine);\n }\n // Collapsed segment — show an expander row.\n const isExpanded = expandedCollapsed.has(seg.startLine);\n const hiddenCount = seg.endLine - seg.startLine + 1;\n if (isExpanded) {\n const lineNos = Array.from(\n { length: hiddenCount },\n (_, i) => seg.startLine + i,\n );\n return lineNos.map(renderLine);\n }\n return (\n <button\n key={`collapse-${seg.startLine}`}\n type=\"button\"\n data-plan-interactive\n onClick={() =>\n setExpandedCollapsed((prev) => {\n const next = new Set(prev);\n next.add(seg.startLine);\n return next;\n })\n }\n className=\"flex w-full cursor-pointer items-center gap-2 border-y border-plan-line/50 bg-plan-block/20 px-3 py-0.5 text-left hover:bg-plan-block/40\"\n >\n <span aria-hidden className=\"w-[3px] shrink-0 self-stretch\" />\n <span className=\"w-8 shrink-0 select-none text-right text-[11px] tabular-nums text-plan-muted/40\">\n ···\n </span>\n <span className=\"flex-1 text-[11px] text-plan-muted/70\">\n {copy.hiddenLinesExpand.replace(\n \"{{count}}\",\n String(hiddenCount),\n )}\n </span>\n </button>\n );\n })}\n </div>\n </div>\n </div>\n );\n\n return (\n <section\n {...ltrCodeBlockProps}\n className=\"plan-block relative\"\n data-block-id={blockId}\n >\n {title && <div className=\"plan-block-label\">{title}</div>}\n {/* The code keeps its full width — no persistent annotation column. Notes\n live in a visually-hidden stack (a11y + tests) and surface ONE at a\n time as an on-hover popover anchored to the right of the code. */}\n {codeSurface}\n {hasAnnotations && (\n <AnnotationHiddenStack items={resolved} ctx={ctx} showMarker />\n )}\n {hasAnnotations &&\n !showAnnotationOverlays &&\n !activeItemIsPersistentlyVisible &&\n activeItem &&\n hover.anchor && (\n <AnnotationHoverCard\n item={activeItem}\n anchor={hover.anchor}\n ctx={ctx}\n showMarker\n preferredSide={annotationHoverSide}\n hoverFallbackSide={annotationHoverFallbackSide}\n onMouseEnter={hover.cancelClose}\n onMouseLeave={hover.scheduleClose}\n onClose={hover.closeForScroll}\n onInteractOutside={hover.close}\n />\n )}\n {summary && <p className=\"mt-5 text-plan-muted\">{summary}</p>}\n </section>\n );\n}\n\n/* ── Edit (panel) ──────────────────────────────────────────────────────────── */\n\nconst codeAreaClass =\n \"min-h-[160px] font-mono [font-size:var(--plan-code-size)] leading-5\";\n\nfunction AnnotatedCodeEdit({\n data,\n onChange,\n editable,\n}: BlockEditProps<AnnotatedCodeData>) {\n const annotations = data.annotations ?? [];\n const patch = (next: Partial<AnnotatedCodeData>) =>\n onChange({ ...data, ...next });\n\n const updateAnnotation = (\n index: number,\n next: Partial<AnnotatedCodeAnnotation>,\n ) =>\n patch({\n annotations: annotations.map((annotation, i) =>\n i === index ? { ...annotation, ...next } : annotation,\n ),\n });\n\n const removeAnnotation = (index: number) =>\n patch({ annotations: annotations.filter((_, i) => i !== index) });\n\n const addAnnotation = () => {\n if (annotations.length >= 80) return; // schema max\n patch({\n annotations: [...annotations, { lines: \"1\", label: \"\", note: \"\" }],\n });\n };\n\n return (\n <div className=\"flex flex-col gap-3\" data-plan-interactive>\n <div className=\"grid gap-3 sm:grid-cols-2\">\n <div className=\"flex flex-col gap-1.5\">\n <DevLabel htmlFor=\"annotated-code-filename\" className=\"text-xs\">\n Filename\n </DevLabel>\n <DevInput\n id=\"annotated-code-filename\"\n value={data.filename ?? \"\"}\n placeholder=\"src/server/auth.ts\"\n disabled={!editable}\n onChange={(event) =>\n patch({ filename: event.target.value || undefined })\n }\n />\n </div>\n <div className=\"flex flex-col gap-1.5\">\n <DevLabel htmlFor=\"annotated-code-language\" className=\"text-xs\">\n Language\n </DevLabel>\n <DevInput\n id=\"annotated-code-language\"\n value={data.language ?? \"\"}\n placeholder=\"ts\"\n disabled={!editable}\n onChange={(event) =>\n patch({ language: event.target.value || undefined })\n }\n />\n </div>\n </div>\n\n <div className=\"flex flex-col gap-1.5\">\n <DevLabel htmlFor=\"annotated-code-code\" className=\"text-xs\">\n Code\n </DevLabel>\n <DevTextarea\n id=\"annotated-code-code\"\n spellCheck={false}\n className={codeAreaClass}\n value={data.code}\n disabled={!editable}\n onChange={(event) => patch({ code: event.target.value })}\n />\n </div>\n\n <div className=\"flex flex-col gap-2\">\n <div className=\"flex items-center justify-between\">\n <DevLabel className=\"text-xs\">Annotations</DevLabel>\n {editable && annotations.length < 80 && (\n <button\n type=\"button\"\n data-plan-interactive\n onClick={addAnnotation}\n className=\"flex cursor-pointer items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-plan-muted transition-colors hover:bg-plan-block/60 hover:text-plan-text\"\n >\n <IconPlus className=\"size-3.5\" />\n Add annotation\n </button>\n )}\n </div>\n {annotations.length === 0 && (\n <p className=\"text-xs text-plan-muted\">\n No annotations yet. Add one to anchor a note to a line range.\n </p>\n )}\n {annotations.map((annotation, index) => (\n <div\n key={index}\n className=\"flex flex-col gap-2 rounded-md border border-plan-line bg-plan-block/30 p-2\"\n >\n <div className=\"grid gap-2 sm:grid-cols-[120px_minmax(0,1fr)_auto]\">\n <DevInput\n aria-label={`Annotation ${index + 1} lines`}\n value={annotation.lines}\n placeholder=\"3-5\"\n disabled={!editable}\n onChange={(event) =>\n updateAnnotation(index, { lines: event.target.value })\n }\n />\n <DevInput\n aria-label={`Annotation ${index + 1} label`}\n value={annotation.label ?? \"\"}\n placeholder=\"Label (optional)\"\n disabled={!editable}\n onChange={(event) =>\n updateAnnotation(index, {\n label: event.target.value || undefined,\n })\n }\n />\n {editable && (\n <button\n type=\"button\"\n data-plan-interactive\n aria-label={`Remove annotation ${index + 1}`}\n onClick={() => removeAnnotation(index)}\n className=\"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-md text-plan-muted transition-colors hover:bg-muted hover:text-foreground\"\n >\n <IconTrash className=\"size-4\" />\n </button>\n )}\n </div>\n <DevTextarea\n aria-label={`Annotation ${index + 1} note`}\n className=\"min-h-[60px] text-sm\"\n value={annotation.note}\n placeholder=\"Explain what these lines do…\"\n disabled={!editable}\n onChange={(event) =>\n updateAnnotation(index, { note: event.target.value })\n }\n />\n </div>\n ))}\n </div>\n </div>\n );\n}\n\nexport { AnnotatedCodeRead, AnnotatedCodeEdit };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiEndpointBlock.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/ApiEndpointBlock.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAEV,eAAe,EAKhB,MAAM,0BAA0B,CAAC;AAkXlC;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,OAAO,EACP,KAAK,EACL,OAAO,EACP,GAAG,GACJ,EAAE,cAAc,CAAC,eAAe,CAAC,2CAmSjC;AAkBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,QAAQ,EACR,QAAQ,GACT,EAAE,cAAc,CAAC,eAAe,CAAC,2CAiXjC"}
1
+ {"version":3,"file":"ApiEndpointBlock.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/ApiEndpointBlock.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAEV,eAAe,EAKhB,MAAM,0BAA0B,CAAC;AAqXlC;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,OAAO,EACP,KAAK,EACL,OAAO,EACP,GAAG,GACJ,EAAE,cAAc,CAAC,eAAe,CAAC,2CA2TjC;AAkBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,QAAQ,EACR,QAAQ,GACT,EAAE,cAAc,CAAC,eAAe,CAAC,2CAiXjC"}
@@ -4,6 +4,7 @@ import { IconArrowNarrowRight, IconChevronRight, IconLock, IconPlus, IconTrash,
4
4
  import { cn } from "../../utils.js";
5
5
  import { ltrCodeBlockProps } from "../code-block-direction.js";
6
6
  import { API_ENDPOINT_CHANGES, API_ENDPOINT_METHODS, API_PARAM_LOCATIONS, } from "./api-endpoint.config.js";
7
+ import { useBlockCopy } from "./block-copy.js";
7
8
  import { JsonExplorerSurface } from "./JsonExplorerBlock.js";
8
9
  import { DevBadge, DevInput, DevSwitch, DevTextarea, DevSelect, } from "./dev-doc-ui.js";
9
10
  /**
@@ -85,11 +86,11 @@ const CHANGE_INK = {
85
86
  * pill (`variant="label"`) for the endpoint header where there is room. Matches
86
87
  * the file-tree change badge so the recap reads consistently.
87
88
  */
88
- function ChangeChip({ change, variant = "glyph", className, }) {
89
+ function ChangeChip({ change, label = CHANGE_LABEL[change], variant = "glyph", className, }) {
89
90
  if (variant === "label") {
90
- return (_jsx("span", { title: CHANGE_LABEL[change], className: cn("shrink-0 rounded px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wide", CHANGE_BADGE[change], className), children: CHANGE_LABEL[change] }));
91
+ return (_jsx("span", { title: label, className: cn("shrink-0 rounded px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wide", CHANGE_BADGE[change], className), children: label }));
91
92
  }
92
- return (_jsx("span", { title: CHANGE_LABEL[change], "aria-label": CHANGE_LABEL[change], className: cn("flex size-4 shrink-0 items-center justify-center rounded text-[10px] font-bold leading-none", CHANGE_BADGE[change], className), children: CHANGE_GLYPH[change] }));
93
+ return (_jsx("span", { title: label, "aria-label": label, className: cn("flex size-4 shrink-0 items-center justify-center rounded text-[10px] font-bold leading-none", CHANGE_BADGE[change], className), children: CHANGE_GLYPH[change] }));
93
94
  }
94
95
  /**
95
96
  * Before → after for a modified param: the prior `was` value struck through, a
@@ -256,6 +257,13 @@ function ApiExample({ example, contentType, className, }) {
256
257
  */
257
258
  export function ApiEndpointRead({ data, blockId, title, summary, ctx, }) {
258
259
  const [open, setOpen] = useState(false);
260
+ const copy = useBlockCopy();
261
+ const changeLabel = {
262
+ added: copy.added,
263
+ modified: copy.modified,
264
+ removed: copy.removed,
265
+ renamed: copy.renamed,
266
+ };
259
267
  const params = data.params ?? [];
260
268
  const responses = data.responses ?? [];
261
269
  const hasRequest = Boolean(data.request?.example || data.request?.contentType);
@@ -268,7 +276,7 @@ export function ApiEndpointRead({ data, blockId, title, summary, ctx, }) {
268
276
  // `change` ink composes with `deprecated`: a deprecated route
269
277
  // still mutes/strikes its path; a changed route tints it (a
270
278
  // removed route also strikes via CHANGE_INK).
271
- data.change ? CHANGE_INK[data.change] : "text-plan-text", data.deprecated && "text-plan-muted line-through"), children: data.path }), data.change && _jsx(ChangeChip, { change: data.change, variant: "label" }), data.deprecated && (_jsx(DevBadge, { className: "shrink-0 border-amber-500/40 text-amber-600 dark:text-amber-300", children: "Deprecated" })), (data.summary || summary) && (_jsx("span", { className: "ml-1 min-w-0 flex-1 truncate text-sm text-plan-muted", children: data.summary || summary })), data.auth && (_jsx(IconLock, { className: "size-3.5 shrink-0 text-plan-muted", "aria-label": "Requires authentication" }))] }), open && hasBody && (_jsxs("div", { className: "px-4 pb-4 pt-1", children: [data.auth && (_jsxs("div", { className: "mb-4 flex items-center gap-2 text-xs text-plan-muted", children: [_jsx(IconLock, { className: "size-3.5 shrink-0" }), _jsxs("span", { children: [_jsx("span", { className: "font-medium text-plan-text", children: "Auth:" }), " ", data.auth] })] })), data.description?.trim() && (_jsx("div", { className: "an-api-endpoint-desc", children: ctx.renderMarkdown?.(data.description) })), params.length > 0 && (_jsxs("div", { className: "mt-5", children: [_jsx("div", { className: "text-xs font-semibold uppercase tracking-wide text-plan-muted", children: "Parameters" }), _jsx("div", { className: "mt-2 overflow-hidden rounded-lg border border-plan-line", children: _jsxs("table", { className: "w-full border-collapse text-sm", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-accent/30 text-left text-xs uppercase tracking-wide text-plan-muted", children: [_jsx("th", { className: "px-3 py-2 font-medium", children: "Name" }), _jsx("th", { className: "px-3 py-2 font-medium", children: "In" }), _jsx("th", { className: "px-3 py-2 font-medium", children: "Type" }), _jsx("th", { className: "px-3 py-2 font-medium", children: "Required" }), _jsx("th", { className: "px-3 py-2 font-medium", children: "Description" })] }) }), _jsx("tbody", { children: params.map((param, index) => {
279
+ data.change ? CHANGE_INK[data.change] : "text-plan-text", data.deprecated && "text-plan-muted line-through"), children: data.path }), data.change && (_jsx(ChangeChip, { change: data.change, label: changeLabel[data.change], variant: "label" })), data.deprecated && (_jsx(DevBadge, { className: "shrink-0 border-amber-500/40 text-amber-600 dark:text-amber-300", children: copy.deprecated })), (data.summary || summary) && (_jsx("span", { className: "ml-1 min-w-0 flex-1 truncate text-sm text-plan-muted", children: data.summary || summary })), data.auth && (_jsx(IconLock, { className: "size-3.5 shrink-0 text-plan-muted", "aria-label": copy.requiresAuthentication }))] }), open && hasBody && (_jsxs("div", { className: "px-4 pb-4 pt-1", children: [data.auth && (_jsxs("div", { className: "mb-4 flex items-center gap-2 text-xs text-plan-muted", children: [_jsx(IconLock, { className: "size-3.5 shrink-0" }), _jsxs("span", { children: [_jsxs("span", { className: "font-medium text-plan-text", children: [copy.auth, ":"] }), " ", data.auth] })] })), data.description?.trim() && (_jsx("div", { className: "an-api-endpoint-desc", children: ctx.renderMarkdown?.(data.description) })), params.length > 0 && (_jsxs("div", { className: "mt-5", children: [_jsx("div", { className: "text-xs font-semibold uppercase tracking-wide text-plan-muted", children: copy.parameters }), _jsx("div", { className: "mt-2 overflow-hidden rounded-lg border border-plan-line", children: _jsxs("table", { className: "w-full border-collapse text-sm", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-accent/30 text-left text-xs uppercase tracking-wide text-plan-muted", children: [_jsx("th", { className: "px-3 py-2 font-medium", children: copy.name }), _jsx("th", { className: "px-3 py-2 font-medium", children: copy.in }), _jsx("th", { className: "px-3 py-2 font-medium", children: copy.type }), _jsx("th", { className: "px-3 py-2 font-medium", children: copy.requiredColumn }), _jsx("th", { className: "px-3 py-2 font-medium", children: copy.description })] }) }), _jsx("tbody", { children: params.map((param, index) => {
272
280
  const change = param.change;
273
281
  // A `modified` `was` describes either the required flag
274
282
  // or the prior type; route it to the right column.
@@ -284,8 +292,8 @@ export function ApiEndpointRead({ data, blockId, title, summary, ctx, }) {
284
292
  : undefined;
285
293
  return (_jsxs("tr", { className: "border-t border-plan-line align-top", children: [_jsx("td", { className: "px-3 py-2 font-mono text-xs font-semibold", children: _jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: cn(change
286
294
  ? CHANGE_INK[change]
287
- : "text-plan-text"), children: param.name }), change && _jsx(ChangeChip, { change: change })] }) }), _jsx("td", { className: "px-3 py-2", children: _jsx("span", { className: cn("rounded px-1.5 py-0.5 font-mono text-[11px] font-semibold", PARAM_IN_BADGE[param.in]), children: param.in }) }), _jsx("td", { className: "px-3 py-2 font-mono text-xs text-plan-muted", children: _jsx(WasArrowCurrent, { was: wasForType, current: _jsx("span", { className: cn(wasForType && "text-plan-text"), children: param.type || "—" }) }) }), _jsx("td", { className: "px-3 py-2 text-xs", children: _jsx(WasArrowCurrent, { was: wasForRequired, current: param.required ? (_jsx("span", { className: "font-medium text-red-600 dark:text-red-300", children: "required" })) : (_jsx("span", { className: "text-plan-muted", children: "optional" })) }) }), _jsx("td", { className: "px-3 py-2 text-xs text-plan-muted", children: param.description || "—" })] }, `${param.name}-${index}`));
288
- }) })] }) })] })), hasRequest && (_jsxs("div", { className: "mt-5", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-xs font-semibold uppercase tracking-wide text-plan-muted", children: "Request body" }), data.request?.contentType && (_jsx("span", { className: "rounded bg-accent/40 px-1.5 py-0.5 font-mono text-[11px] text-plan-muted", children: data.request.contentType }))] }), data.request?.example && (_jsx(ApiExample, { example: data.request.example, contentType: data.request.contentType, className: "mt-2 an-api-endpoint-example" }))] })), responses.length > 0 && (_jsxs("div", { className: "mt-5", children: [_jsx("div", { className: "text-xs font-semibold uppercase tracking-wide text-plan-muted", children: "Responses" }), _jsx("div", { className: "mt-2 flex flex-col gap-3", children: responses.map((response, index) => (_jsxs("div", { className: "rounded-lg border border-plan-line", children: [_jsxs("div", { className: "flex items-center gap-2 px-3 py-2", children: [_jsx("span", { className: cn("rounded px-2 py-0.5 font-mono text-xs font-bold", statusPillClass(response.status)), children: response.status }), response.description && (_jsx("span", { className: cn("text-sm", response.change
295
+ : "text-plan-text"), children: param.name }), change && (_jsx(ChangeChip, { change: change, label: changeLabel[change] }))] }) }), _jsx("td", { className: "px-3 py-2", children: _jsx("span", { className: cn("rounded px-1.5 py-0.5 font-mono text-[11px] font-semibold", PARAM_IN_BADGE[param.in]), children: param.in }) }), _jsx("td", { className: "px-3 py-2 font-mono text-xs text-plan-muted", children: _jsx(WasArrowCurrent, { was: wasForType, current: _jsx("span", { className: cn(wasForType && "text-plan-text"), children: param.type || "—" }) }) }), _jsx("td", { className: "px-3 py-2 text-xs", children: _jsx(WasArrowCurrent, { was: wasForRequired, current: param.required ? (_jsx("span", { className: "font-medium text-red-600 dark:text-red-300", children: copy.required })) : (_jsx("span", { className: "text-plan-muted", children: copy.optional })) }) }), _jsx("td", { className: "px-3 py-2 text-xs text-plan-muted", children: param.description || "—" })] }, `${param.name}-${index}`));
296
+ }) })] }) })] })), hasRequest && (_jsxs("div", { className: "mt-5", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-xs font-semibold uppercase tracking-wide text-plan-muted", children: copy.requestBody }), data.request?.contentType && (_jsx("span", { className: "rounded bg-accent/40 px-1.5 py-0.5 font-mono text-[11px] text-plan-muted", children: data.request.contentType }))] }), data.request?.example && (_jsx(ApiExample, { example: data.request.example, contentType: data.request.contentType, className: "mt-2 an-api-endpoint-example" }))] })), responses.length > 0 && (_jsxs("div", { className: "mt-5", children: [_jsx("div", { className: "text-xs font-semibold uppercase tracking-wide text-plan-muted", children: copy.responses }), _jsx("div", { className: "mt-2 flex flex-col gap-3", children: responses.map((response, index) => (_jsxs("div", { className: "rounded-lg border border-plan-line", children: [_jsxs("div", { className: "flex items-center gap-2 px-3 py-2", children: [_jsx("span", { className: cn("rounded px-2 py-0.5 font-mono text-xs font-bold", statusPillClass(response.status)), children: response.status }), response.description && (_jsx("span", { className: cn("text-sm", response.change
289
297
  ? CHANGE_INK[response.change]
290
298
  : "text-plan-muted"), children: response.description })), response.change && (_jsx(ChangeChip, { change: response.change, variant: "label", className: "ml-auto" }))] }), response.example && (_jsx("div", { className: "px-3 pb-3 pt-0 an-api-endpoint-example", children: _jsx(ApiExample, { example: response.example, className: "mt-0" }) }))] }, `${response.status}-${index}`))) })] }))] }))] })] }));
291
299
  }