@voithos-labs/aragonite 0.10.2 → 0.10.4

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 (300) hide show
  1. package/README.md +6 -21
  2. package/THIRD-PARTY-NOTICES.md +25 -0
  3. package/dist/a11y-strings.d.ts +19 -0
  4. package/dist/a11y-strings.js +19 -0
  5. package/dist/action-contracts.d.ts +7 -1
  6. package/dist/ambient/ambient-dom.js +5 -1
  7. package/dist/block-component.d.ts +14 -0
  8. package/dist/components/BlockDragHandle.svelte +37 -24
  9. package/dist/components/BlockHost.svelte +18 -11
  10. package/dist/components/Editor.svelte +434 -198
  11. package/dist/components/Editor.svelte.d.ts +1 -1
  12. package/dist/components/SelectionOverlay.svelte +25 -17
  13. package/dist/components/SelectionOverlay.svelte.d.ts +1 -1
  14. package/dist/components/TailInsert.svelte +107 -0
  15. package/dist/components/TailInsert.svelte.d.ts +17 -0
  16. package/dist/components/block-content-selector.d.ts +6 -2
  17. package/dist/components/block-content-selector.js +6 -2
  18. package/dist/components/blocks/ThematicBreakBlock.svelte +19 -6
  19. package/dist/components/blocks/ThematicBreakBlock.svelte.d.ts +1 -0
  20. package/dist/components/blocks/code/CodeBlock.svelte +211 -30
  21. package/dist/components/blocks/code/CodeBlockRail.svelte +704 -0
  22. package/dist/components/blocks/code/CodeBlockRail.svelte.d.ts +26 -0
  23. package/dist/components/blocks/code/code-bootstrap.js +16 -0
  24. package/dist/components/blocks/code/code-context-actions.d.ts +1 -0
  25. package/dist/components/blocks/code/code-context-actions.js +24 -0
  26. package/dist/components/blocks/code/code-fence-exit.d.ts +15 -0
  27. package/dist/components/blocks/code/code-fence-exit.js +26 -0
  28. package/dist/components/blocks/code/code-languages.d.ts +6 -0
  29. package/dist/components/blocks/code/code-languages.js +22 -3
  30. package/dist/components/blocks/code/code-renderer.js +11 -0
  31. package/dist/components/blocks/directive/DirectiveContainerBlock.svelte +1 -1
  32. package/dist/components/blocks/editable-leaf.d.ts +37 -6
  33. package/dist/components/blocks/editable-leaf.js +248 -30
  34. package/dist/components/blocks/editable-surface.d.ts +9 -0
  35. package/dist/components/blocks/editable-surface.js +22 -3
  36. package/dist/components/blocks/list/ListBlock.svelte +1 -0
  37. package/dist/components/blocks/list/ListItemBlock.svelte +14 -5
  38. package/dist/components/blocks/list/ListItemBlock.svelte.d.ts +2 -0
  39. package/dist/components/blocks/list/task-checkbox.d.ts +2 -0
  40. package/dist/components/blocks/list/task-checkbox.js +11 -2
  41. package/dist/components/blocks/surface-wiring.svelte.d.ts +4 -0
  42. package/dist/components/blocks/surface-wiring.svelte.js +8 -1
  43. package/dist/components/blocks/table/TableActionMenu.svelte +210 -86
  44. package/dist/components/blocks/table/TableActionMenu.svelte.d.ts +5 -0
  45. package/dist/components/blocks/table/TableBlock.svelte +205 -186
  46. package/dist/components/blocks/table/TableBlock.svelte.d.ts +1 -0
  47. package/dist/components/blocks/table/TableCellBlock.svelte +87 -22
  48. package/dist/components/blocks/table/TableRowBlock.svelte +4 -18
  49. package/dist/components/blocks/table/TableRowBlock.svelte.d.ts +0 -5
  50. package/dist/components/blocks/table/cell-clipboard.d.ts +10 -0
  51. package/dist/components/blocks/table/cell-clipboard.js +34 -1
  52. package/dist/components/blocks/table/cell-keydown-plan.d.ts +1 -1
  53. package/dist/components/blocks/table/cell-keydown-plan.js +3 -1
  54. package/dist/components/blocks/table/table-cell-paste.js +2 -1
  55. package/dist/components/blocks/table/table-menu-model.d.ts +35 -8
  56. package/dist/components/blocks/table/table-menu-model.js +36 -17
  57. package/dist/components/blocks/text/TextEditableBlock.svelte +58 -11
  58. package/dist/components/blocks/text/click-snap-guard.d.ts +3 -0
  59. package/dist/components/blocks/text/click-snap-guard.js +8 -0
  60. package/dist/components/blocks/text/delimiter-autopair.d.ts +71 -0
  61. package/dist/components/blocks/text/delimiter-autopair.js +216 -0
  62. package/dist/components/blocks/text/edge-policy-dispatch.d.ts +4 -0
  63. package/dist/components/blocks/text/edge-policy-dispatch.js +89 -20
  64. package/dist/components/blocks/text/live-selection-edit.d.ts +5 -5
  65. package/dist/components/blocks/text/live-selection-edit.js +37 -7
  66. package/dist/components/blocks/text/text-clipboard.js +2 -2
  67. package/dist/components/blocks/text/text-keydown.d.ts +7 -1
  68. package/dist/components/blocks/text/text-keydown.js +11 -1
  69. package/dist/components/blocks/text/text-render.d.ts +1 -1
  70. package/dist/components/blocks/text/text-render.js +3 -1
  71. package/dist/components/blocks/text/widget-interaction.d.ts +3 -0
  72. package/dist/components/blocks/text/widget-interaction.js +181 -37
  73. package/dist/components/drag-handle.d.ts +41 -0
  74. package/dist/components/drag-handle.js +134 -0
  75. package/dist/components/editor-root-focus.d.ts +19 -0
  76. package/dist/components/editor-root-focus.js +67 -0
  77. package/dist/components/editor-root-geometry.d.ts +39 -0
  78. package/dist/components/editor-root-geometry.js +91 -0
  79. package/dist/components/editor-root-keydown.d.ts +1 -1
  80. package/dist/components/editor-root-keydown.js +12 -3
  81. package/dist/components/editor-root-listeners.d.ts +3 -6
  82. package/dist/components/editor-root-listeners.js +3 -24
  83. package/dist/components/editor-root-mode-flip.d.ts +36 -0
  84. package/dist/components/editor-root-mode-flip.js +92 -0
  85. package/dist/components/image/ImageOverlayHost.svelte +14 -6
  86. package/dist/components/image/ImageProperties.svelte +512 -70
  87. package/dist/components/image/ImageProperties.svelte.d.ts +6 -1
  88. package/dist/components/image/ImageResizeHandles.svelte +67 -34
  89. package/dist/components/image/image-crop.d.ts +39 -0
  90. package/dist/components/image/image-crop.js +74 -0
  91. package/dist/components/image/image-edit-commit.d.ts +1 -0
  92. package/dist/components/image/image-edit-commit.js +21 -5
  93. package/dist/components/image/image-source-bytes.js +10 -3
  94. package/dist/components/image/image-widget-editing.js +1 -0
  95. package/dist/components/image/widget-dom.js +5 -1
  96. package/dist/components/link-card/link-card-commit.js +1 -1
  97. package/dist/components/lrd-map-gate.js +1 -1
  98. package/dist/components/menu/BlockMenu.svelte +315 -0
  99. package/dist/components/menu/BlockMenu.svelte.d.ts +34 -0
  100. package/dist/components/menu/MenuIcon.svelte +153 -0
  101. package/dist/components/menu/MenuIcon.svelte.d.ts +51 -0
  102. package/dist/components/menu/SelectionToolbar.svelte +385 -0
  103. package/dist/components/menu/SelectionToolbar.svelte.d.ts +16 -0
  104. package/dist/components/menu/clipboard-actions.d.ts +12 -0
  105. package/dist/components/menu/clipboard-actions.js +42 -0
  106. package/dist/components/menu/default-context-actions.d.ts +15 -0
  107. package/dist/components/menu/default-context-actions.js +76 -0
  108. package/dist/components/menu/flyout-placement.d.ts +6 -0
  109. package/dist/components/menu/flyout-placement.js +25 -0
  110. package/dist/core/inline/format-toggle.d.ts +12 -4
  111. package/dist/core/inline/format-toggle.js +94 -40
  112. package/dist/core/inline/image-dimensions.d.ts +3 -0
  113. package/dist/core/inline/image-dimensions.js +46 -10
  114. package/dist/core/inline/inline-widgets.d.ts +19 -0
  115. package/dist/core/inline/inline-widgets.js +5 -0
  116. package/dist/core/inline/scan/brackets.js +1 -0
  117. package/dist/core/inline/scan/plugin-syntax.d.ts +8 -0
  118. package/dist/core/inline/scan/plugin-syntax.js +15 -1
  119. package/dist/core/inline/transparency.js +3 -3
  120. package/dist/core/inline-render.d.ts +6 -0
  121. package/dist/core/inline-render.js +32 -0
  122. package/dist/core/nodes.d.ts +14 -0
  123. package/dist/cursor/edge-affinity.js +2 -1
  124. package/dist/cursor/height-oracle.d.ts +2 -3
  125. package/dist/cursor/height-oracle.js +0 -1
  126. package/dist/cursor/overlay-remeasure.js +8 -0
  127. package/dist/cursor/reveal-source.js +7 -2
  128. package/dist/cursor/scroll-hold.d.ts +10 -0
  129. package/dist/cursor/scroll-hold.js +22 -0
  130. package/dist/cursor/scrollport.d.ts +9 -0
  131. package/dist/cursor/scrollport.js +30 -1
  132. package/dist/cursor/visual-lines.d.ts +5 -4
  133. package/dist/cursor/visual-lines.js +56 -11
  134. package/dist/cursor/widget-edge-snap.d.ts +28 -0
  135. package/dist/cursor/widget-edge-snap.js +38 -0
  136. package/dist/cursor/widget-offset.d.ts +9 -0
  137. package/dist/cursor/widget-offset.js +71 -4
  138. package/dist/debug/interaction-trace.d.ts +4 -0
  139. package/dist/debug/interaction-trace.js +15 -0
  140. package/dist/decorations/decoration-state.svelte.js +1 -1
  141. package/dist/decorations/reserved-attrs.js +1 -0
  142. package/dist/editor-actions/ancestry-folds.d.ts +2 -2
  143. package/dist/editor-actions/ancestry-folds.js +1 -1
  144. package/dist/editor-actions/block-edit-scope.js +1 -1
  145. package/dist/editor-actions/commit/text-batch.d.ts +3 -2
  146. package/dist/editor-actions/commit/text-batch.js +1 -1
  147. package/dist/editor-actions/commit/undo-controller.js +4 -2
  148. package/dist/editor-actions/container-edit.js +2 -1
  149. package/dist/editor-actions/enter-completion.d.ts +2 -0
  150. package/dist/editor-actions/enter-completion.js +23 -2
  151. package/dist/editor-actions/focus/focus-dispatch.js +7 -4
  152. package/dist/editor-actions/focus/focus-landing.d.ts +10 -1
  153. package/dist/editor-actions/focus/focus-landing.js +20 -6
  154. package/dist/editor-actions/inline-range-commit.js +1 -1
  155. package/dist/editor-actions/plugin/container.d.ts +7 -0
  156. package/dist/editor-actions/plugin/container.js +3 -1
  157. package/dist/editor-actions/reorder-action.js +19 -10
  158. package/dist/editor-actions/reorder-drag.js +29 -1
  159. package/dist/editor-actions/replacement-focus.d.ts +1 -1
  160. package/dist/editor-actions/replacement-focus.js +1 -1
  161. package/dist/editor-actions/search-replace.js +1 -1
  162. package/dist/editor-actions/table-context.d.ts +4 -1
  163. package/dist/editor-actions/table-context.js +57 -1
  164. package/dist/editor-events.d.ts +3 -0
  165. package/dist/editor-keys.d.ts +33 -0
  166. package/dist/editor-props.d.ts +24 -12
  167. package/dist/index.d.ts +1 -1
  168. package/dist/plugin.d.ts +7 -0
  169. package/dist/plugin.js +16 -0
  170. package/dist/plugins/latex/BlockMath.svelte +264 -29
  171. package/dist/plugins/latex/BlockMath.svelte.d.ts +2 -0
  172. package/dist/plugins/latex/index.d.ts +2 -1
  173. package/dist/plugins/latex/latex-kind.js +60 -10
  174. package/dist/plugins/latex/math-completion.js +4 -1
  175. package/dist/plugins/latex/math-layout.d.ts +15 -0
  176. package/dist/plugins/latex/math-layout.js +13 -0
  177. package/dist/plugins/latex/math-source.d.ts +19 -0
  178. package/dist/plugins/latex/math-source.js +103 -0
  179. package/dist/plugins/latex/register.d.ts +11 -2
  180. package/dist/plugins/latex/register.js +3 -1
  181. package/dist/plugins/latex/renderer.d.ts +3 -3
  182. package/dist/plugins/latex/renderer.js +13 -6
  183. package/dist/plugins/mermaid/MermaidBlock.svelte +19 -9
  184. package/dist/plugins/parrot/ParrotBlock.svelte +3 -1
  185. package/dist/reactivity/list-windowing.svelte.d.ts +8 -8
  186. package/dist/reactivity/list-windowing.svelte.js +75 -30
  187. package/dist/schema/block-completions.d.ts +8 -0
  188. package/dist/schema/block-completions.js +11 -0
  189. package/dist/schema/commands.d.ts +9 -5
  190. package/dist/schema/commands.js +12 -7
  191. package/dist/schema/context-actions.d.ts +31 -0
  192. package/dist/schema/context-actions.js +23 -0
  193. package/dist/schema/fenced-code-raw.js +31 -1
  194. package/dist/schema/operations.d.ts +8 -1
  195. package/dist/schema/reserved-chords.js +37 -4
  196. package/dist/schema/table-cell-raw.d.ts +1 -1
  197. package/dist/schema/table-cell-raw.js +1 -1
  198. package/dist/selection/block-hit-test.js +3 -2
  199. package/dist/selection/char-endpoint-snap.js +1 -1
  200. package/dist/selection/clipboard-text.js +6 -1
  201. package/dist/selection/covered-block.d.ts +10 -0
  202. package/dist/selection/covered-block.js +24 -0
  203. package/dist/selection/cross-block/dispatch.d.ts +3 -0
  204. package/dist/selection/cross-block/dispatch.js +13 -1
  205. package/dist/selection/cross-block/format-range.d.ts +1 -1
  206. package/dist/selection/cross-block/format-range.js +4 -15
  207. package/dist/selection/cross-block/format-toggle.js +1 -1
  208. package/dist/selection/cross-block/keydown.js +3 -29
  209. package/dist/selection/cross-block/ops.js +1 -1
  210. package/dist/selection/cross-block/paste.js +31 -35
  211. package/dist/selection/cross-block/type-replace.d.ts +3 -2
  212. package/dist/selection/cross-block/type-replace.js +52 -13
  213. package/dist/selection/dead-space-caret.d.ts +13 -0
  214. package/dist/selection/dead-space-caret.js +57 -1
  215. package/dist/selection/drag-pointer.d.ts +26 -2
  216. package/dist/selection/drag-pointer.js +103 -2
  217. package/dist/selection/gap-caret.js +1 -1
  218. package/dist/selection/keyboard-extend.d.ts +3 -2
  219. package/dist/selection/keyboard-extend.js +4 -3
  220. package/dist/selection/multi-click.d.ts +42 -0
  221. package/dist/selection/multi-click.js +203 -0
  222. package/dist/selection/native-bridge.d.ts +3 -0
  223. package/dist/selection/native-bridge.js +31 -2
  224. package/dist/selection/path-lookup.d.ts +10 -2
  225. package/dist/selection/path-lookup.js +11 -4
  226. package/dist/selection/pointer-gesture.d.ts +9 -0
  227. package/dist/selection/pointer-gesture.js +11 -0
  228. package/dist/selection/primitives.d.ts +7 -0
  229. package/dist/selection/primitives.js +19 -1
  230. package/dist/selection/range-delete-ceremony.js +4 -2
  231. package/dist/selection/range-delete-chrome.js +2 -1
  232. package/dist/selection/range-delete-table-coverage.js +2 -1
  233. package/dist/selection/range-delete-table.js +3 -2
  234. package/dist/selection/range-delete.d.ts +4 -0
  235. package/dist/selection/range-delete.js +31 -3
  236. package/dist/selection/selection-drop.d.ts +34 -0
  237. package/dist/selection/selection-drop.js +253 -0
  238. package/dist/selection/selection-restore.js +1 -1
  239. package/dist/selection/selection-state.svelte.d.ts +6 -0
  240. package/dist/selection/selection-state.svelte.js +36 -1
  241. package/dist/selection/table-endpoint-snap.js +1 -1
  242. package/dist/selection/table-rect-extend.js +1 -1
  243. package/dist/styles/editor-theme.css +75 -31
  244. package/dist/styles/editor.css +268 -18
  245. package/dist/testing/container-conformance.js +2 -2
  246. package/dist/testing/inline-conformance.js +2 -1
  247. package/dist/tree-operations/blockquote.js +1 -1
  248. package/dist/tree-operations/chain-rebuild.d.ts +63 -0
  249. package/dist/tree-operations/chain-rebuild.js +142 -0
  250. package/dist/tree-operations/children.d.ts +1 -1
  251. package/dist/tree-operations/children.js +1 -1
  252. package/dist/tree-operations/cleanup.js +1 -1
  253. package/dist/tree-operations/content-write.d.ts +50 -0
  254. package/dist/tree-operations/content-write.js +263 -0
  255. package/dist/tree-operations/index.d.ts +8 -3
  256. package/dist/tree-operations/index.js +6 -2
  257. package/dist/tree-operations/list/exit-replacement.js +1 -1
  258. package/dist/tree-operations/list/unwrap-merge.js +3 -3
  259. package/dist/tree-operations/node-ops.d.ts +17 -234
  260. package/dist/tree-operations/node-ops.js +47 -1113
  261. package/dist/tree-operations/node-primitives.d.ts +75 -0
  262. package/dist/tree-operations/node-primitives.js +117 -0
  263. package/dist/tree-operations/paste/apply.js +1 -1
  264. package/dist/tree-operations/paste/body-write.d.ts +1 -1
  265. package/dist/tree-operations/paste/body-write.js +2 -2
  266. package/dist/tree-operations/paste/container-match.js +4 -2
  267. package/dist/tree-operations/paste/dispatch.js +2 -1
  268. package/dist/tree-operations/paste/find-enclosing-list.js +1 -1
  269. package/dist/tree-operations/paste/focus-target.d.ts +1 -1
  270. package/dist/tree-operations/paste/list-absorb.js +1 -1
  271. package/dist/tree-operations/paste/list-break-out.js +1 -1
  272. package/dist/tree-operations/paste/parent-scope.js +1 -1
  273. package/dist/tree-operations/paste/paste-replacement.js +1 -1
  274. package/dist/tree-operations/paste/replace-block-at-parent.d.ts +3 -1
  275. package/dist/tree-operations/paste/replace-block-at-parent.js +5 -2
  276. package/dist/tree-operations/paste/replacement-parse.d.ts +17 -0
  277. package/dist/tree-operations/paste/replacement-parse.js +22 -0
  278. package/dist/tree-operations/path-mutate.d.ts +1 -1
  279. package/dist/tree-operations/path-mutate.js +2 -1
  280. package/dist/tree-operations/reorder-unit.js +1 -1
  281. package/dist/tree-operations/reorder.d.ts +5 -2
  282. package/dist/tree-operations/reorder.js +55 -2
  283. package/dist/tree-operations/settle.d.ts +105 -0
  284. package/dist/tree-operations/settle.js +660 -0
  285. package/dist/tree-operations/table-grid-clipboard.d.ts +21 -0
  286. package/dist/tree-operations/table-grid-clipboard.js +90 -0
  287. package/dist/tree-operations/unshare.d.ts +15 -77
  288. package/dist/tree-operations/unshare.js +15 -166
  289. package/docs/guide/consumer-guide.md +136 -104
  290. package/docs/guide/plugin-api.md +73 -29
  291. package/docs/guide/plugin-guide.md +55 -23
  292. package/package.json +9 -7
  293. package/dist/components/blocks/code/CodeLanguageChip.svelte +0 -127
  294. package/dist/components/blocks/code/CodeLanguageChip.svelte.d.ts +0 -14
  295. package/dist/components/blocks/table/TableGrip.svelte +0 -91
  296. package/dist/components/blocks/table/TableGrip.svelte.d.ts +0 -8
  297. package/dist/components/blocks/table/table-drop-target.d.ts +0 -1
  298. package/dist/components/blocks/table/table-drop-target.js +0 -16
  299. package/dist/components/blocks/table/table-reorder-drag.d.ts +0 -78
  300. package/dist/components/blocks/table/table-reorder-drag.js +0 -97
@@ -0,0 +1,704 @@
1
+ <script lang="ts">
2
+ import { tick } from 'svelte';
3
+ import {
4
+ CODE_COPY_LABEL,
5
+ CODE_COPIED_LABEL,
6
+ CODE_LANGUAGE_FIELD,
7
+ CODE_MENU_LABEL,
8
+ CODE_RAIL_LABEL,
9
+ CODE_RUN_LABEL,
10
+ codeLanguageLabel
11
+ } from '../../../a11y-strings';
12
+ import type { CodeMenuItem } from '../../../editor-keys';
13
+ import { getLanguageAliases, getLanguageGrammar, listLanguages } from './code-languages';
14
+
15
+ // The chrome for the modes that paint no fence: the language door plus whatever action
16
+ // affordances the host has earned by installing a hook. Drafts live here and only a
17
+ // commit reaches the tree.
18
+ let {
19
+ info,
20
+ editable,
21
+ autoOpen = false,
22
+ onCommit,
23
+ onCancel,
24
+ onRun,
25
+ onCopy,
26
+ menuItems
27
+ }: {
28
+ /** The opener's full info string; the button shows its first token. */
29
+ info: string;
30
+ /** False in reading mode, which writes no bytes — the chip is then a label. */
31
+ editable: boolean;
32
+ /** Open the language field as soon as the rail mounts: a fence the user just created
33
+ * has no language yet, and asking is the whole reason the chip exists. */
34
+ autoOpen?: boolean;
35
+ /** Only Enter or a list pick calls this, and it owns the caret's landing afterwards. */
36
+ onCommit: (info: string) => void;
37
+ /** Nothing written. Escape asks for the caret back; a blur must not yank it from
38
+ * wherever the user just clicked, so it does not. */
39
+ onCancel: (returnCaret: boolean) => void;
40
+ /** Absent when the host installed no execution hook — no run affordance renders. */
41
+ onRun?: () => void;
42
+ /** Copies the fence body; resolves once the clipboard write settles. */
43
+ onCopy: () => Promise<boolean>;
44
+ /** Consulted on each open, so items read live state. Empty renders no affordance. */
45
+ menuItems?: () => readonly CodeMenuItem[];
46
+ } = $props();
47
+
48
+ const language = $derived(info.split(/\s+/)[0] || 'text');
49
+
50
+ let editing = $state(false);
51
+ let draft = $state('');
52
+ // Filtering waits for a keystroke: the field opens empty, and until then the whole list
53
+ // shows with the block's own language leading it, which is what a bare Enter re-commits.
54
+ let filtering = $state(false);
55
+ let activeIndex = $state(0);
56
+ /** The user moved the highlight, so the row it sits on outranks whatever they typed. */
57
+ let highlightMoved = false;
58
+ let copied = $state(false);
59
+ let menuOpen = $state(false);
60
+ let openMenuItems = $state<readonly CodeMenuItem[]>([]);
61
+
62
+ let railEl: HTMLElement | undefined = $state();
63
+ let chipEl: HTMLElement | undefined = $state();
64
+ let inputEl: HTMLInputElement | undefined = $state();
65
+ let listEl: HTMLElement | undefined = $state();
66
+ let pickerEl: HTMLElement | undefined = $state();
67
+ let menuEl: HTMLElement | undefined = $state();
68
+ let menuButtonEl: HTMLElement | undefined = $state();
69
+
70
+ // The picker offers what the renderer can actually tokenize, filtered as the draft is
71
+ // typed. `text` is always offered: it is how a user CLEARS a language, and no grammar
72
+ // registers under that name.
73
+ const suggestions = $derived.by(() => {
74
+ const all = ['text', ...listLanguages().filter((name) => name !== 'text')];
75
+ const needle = filtering ? draft.trim().toLowerCase() : '';
76
+ if (needle.length > 0) {
77
+ // An alias is a search key, never a row of its own: `rs` finds `rust`, and the list
78
+ // still carries one entry per language.
79
+ const spellings = (name: string) => [name, ...getLanguageAliases(name)];
80
+ const starts = all.filter((name) => spellings(name).some((s) => s.startsWith(needle)));
81
+ const seated = new Set(starts);
82
+ const contains = all.filter(
83
+ (name) => !seated.has(name) && spellings(name).some((s) => s.includes(needle))
84
+ );
85
+ return [...starts, ...contains];
86
+ }
87
+ // Unfiltered, the block's own language leads, in the spelling the fence uses — so the
88
+ // row that matters is where the eye already is, and its canonical twin is not below it.
89
+ const current = language;
90
+ const rest = all.filter((name) => name !== current && !isCurrentLanguage(name));
91
+ return [current, ...rest];
92
+ });
93
+
94
+ /** One language in two spellings is still the block's own, so the mark comparing them asks
95
+ * the registry rather than the text. */
96
+ function isCurrentLanguage(name: string): boolean {
97
+ const canonical = (spelling: string) =>
98
+ getLanguageGrammar(spelling)?.name ?? spelling.toLowerCase();
99
+ return canonical(name) === canonical(language);
100
+ }
101
+
102
+ // The highlight cannot outrun a filter that shortened the list under it.
103
+ $effect(() => {
104
+ if (activeIndex >= suggestions.length) activeIndex = 0;
105
+ });
106
+
107
+ // Mount-time open for a freshly minted fence. Guarded on `editable` like every other
108
+ // write door, and fired once: re-arming it would reopen the field after every commit.
109
+ let autoOpened = false;
110
+ $effect(() => {
111
+ if (!autoOpen || autoOpened || !editable) return;
112
+ autoOpened = true;
113
+ open();
114
+ });
115
+
116
+ export function open(): void {
117
+ if (!editable) return;
118
+ draft = '';
119
+ filtering = false;
120
+ highlightMoved = false;
121
+ menuOpen = false;
122
+ editing = true;
123
+ // Row 0 is the block's own language (see `suggestions`), so the highlight starts where
124
+ // a bare Enter would re-commit what is already set.
125
+ activeIndex = 0;
126
+ // A provisional placement at the trigger, BEFORE the popout renders. Without it the
127
+ // popout mounts parked at the viewport's top-left corner while it waits to be measured,
128
+ // and focusing the field inside it drags the page up there — which is the scroll
129
+ // jumping to the top on creating a code block. The measure below refines it.
130
+ const anchor = chipEl?.getBoundingClientRect();
131
+ if (anchor) {
132
+ listAt = {
133
+ x: Math.max(EDGE_MARGIN, anchor.right - 200),
134
+ y: anchor.bottom + ANCHOR_GAP,
135
+ maxHeight: MAX_POPOUT_HEIGHT
136
+ };
137
+ }
138
+ void tick().then(() => {
139
+ // `preventScroll`: the rail is already on screen, and a scroll here would land as a
140
+ // genuine scroll event on the reposition path below.
141
+ inputEl?.focus({ preventScroll: true });
142
+ });
143
+ }
144
+
145
+ function close(): void {
146
+ editing = false;
147
+ }
148
+
149
+ function commit(value: string): void {
150
+ close();
151
+ // `text` is the picker's spelling of "no language", and the info string's is empty.
152
+ onCommit(value.trim() === 'text' ? '' : value);
153
+ }
154
+
155
+ function onFieldKeyDown(e: KeyboardEvent): void {
156
+ // The field owns its keys while open: no Escape of this state may reach whatever else
157
+ // listens for one. A composing Enter/Escape is the IME's, never the field's.
158
+ e.stopPropagation();
159
+ if (e.isComposing) return;
160
+ if (e.key === 'Enter') {
161
+ e.preventDefault();
162
+ // A spelling the registry resolves is a name, not a query: it commits as typed, so
163
+ // `js` survives a picker whose rows are canonical. A moved highlight takes the row.
164
+ const typed = draft.trim();
165
+ const namesLanguage = !highlightMoved && typed !== '' && getLanguageGrammar(typed) !== null;
166
+ commit(
167
+ namesLanguage ? typed : (suggestions[activeIndex] ?? (typed === '' ? language : typed))
168
+ );
169
+ } else if (e.key === 'Escape') {
170
+ e.preventDefault();
171
+ close();
172
+ onCancel(true);
173
+ } else if (e.key === 'ArrowDown') {
174
+ e.preventDefault();
175
+ highlightMoved = true;
176
+ activeIndex = suggestions.length === 0 ? 0 : (activeIndex + 1) % suggestions.length;
177
+ scrollActiveIntoView();
178
+ } else if (e.key === 'ArrowUp') {
179
+ e.preventDefault();
180
+ highlightMoved = true;
181
+ activeIndex =
182
+ suggestions.length === 0 ? 0 : (activeIndex - 1 + suggestions.length) % suggestions.length;
183
+ scrollActiveIntoView();
184
+ }
185
+ }
186
+
187
+ // Only for keyboard travel: the highlight must stay on screen as it moves. Opening does
188
+ // NOT call this — the menu opens at row 0, which is already in view.
189
+ function scrollActiveIntoView(): void {
190
+ void tick().then(() => {
191
+ listEl?.querySelector('[data-active="true"]')?.scrollIntoView({ block: 'nearest' });
192
+ });
193
+ }
194
+
195
+ function onFieldBlur(e: FocusEvent): void {
196
+ if (!editing) return;
197
+ // A pointer moving from the field to its own list is not a dismissal; the list's
198
+ // mousedown handler commits, and this must not tear the field down before it does.
199
+ const next = e.relatedTarget;
200
+ if (next instanceof Node && (railEl?.contains(next) || pickerEl?.contains(next))) return;
201
+ close();
202
+ onCancel(false);
203
+ }
204
+
205
+ async function runCopy(): Promise<void> {
206
+ copied = await onCopy();
207
+ }
208
+
209
+ // The confirmation lives exactly as long as the rail's own reveal: the pointer leaving
210
+ // the block (or focus leaving the rail) hides the rail, and the next reveal is a fresh
211
+ // gesture that should offer to copy again rather than still be reporting the last one.
212
+ // A wall-clock revert would be sequencing on a timer, which G4.4 rules out.
213
+ function clearCopied(): void {
214
+ copied = false;
215
+ }
216
+
217
+ function toggleMenu(): void {
218
+ if (menuOpen) {
219
+ menuOpen = false;
220
+ return;
221
+ }
222
+ close();
223
+ openMenuItems = menuItems?.() ?? [];
224
+ menuOpen = openMenuItems.length > 0;
225
+ }
226
+
227
+ function activateMenuItem(item: CodeMenuItem): void {
228
+ if (item.disabled) return;
229
+ menuOpen = false;
230
+ item.run();
231
+ }
232
+
233
+ // Escape rides the BUTTONS, not their container: the rail is a labelled `group`, and a
234
+ // non-interactive role may not carry key handlers. Focus sits on the ⋮ button while the
235
+ // menu is open, and on an item once the user tabs in — both are covered here.
236
+ function onMenuKeyDown(e: KeyboardEvent): void {
237
+ if (e.key !== 'Escape' || !menuOpen) return;
238
+ e.stopPropagation();
239
+ e.preventDefault();
240
+ menuOpen = false;
241
+ menuButtonEl?.focus();
242
+ }
243
+
244
+ // The menu outlives the click that opened it, so it closes on the next press anywhere
245
+ // else. Scoped by containment, not target identity: a press on a disabled item is
246
+ // still inside.
247
+ function onRailFocusOut(e: FocusEvent): void {
248
+ const next = e.relatedTarget;
249
+ if (next instanceof Node && (railEl?.contains(next) || menuEl?.contains(next))) return;
250
+ menuOpen = false;
251
+ clearCopied();
252
+ }
253
+
254
+ // ── Popout placement ──────────────────────────────────────────────────────
255
+ // Both popouts are `position: fixed`, like the table's action menu: an absolutely
256
+ // positioned one inside the block host would extend the editor's own scrollable area
257
+ // when it overhangs the last block, which is the surface growing under the reader.
258
+ // Fixed takes them out of flow entirely, so opening one can resize nothing.
259
+
260
+ interface Placement {
261
+ x: number;
262
+ y: number;
263
+ /** Space the popout may occupy on the side it was placed, so a long list scrolls
264
+ * inside the gap instead of growing past the viewport edge. */
265
+ maxHeight: number;
266
+ }
267
+ let listAt = $state<Placement | null>(null);
268
+ let menuAt = $state<Placement | null>(null);
269
+
270
+ const EDGE_MARGIN = 8;
271
+ const ANCHOR_GAP = 6;
272
+ /** A menu is a menu, not a column of the viewport: past this it scrolls. The room actually
273
+ * available still wins when it is smaller. */
274
+ const MAX_POPOUT_HEIGHT = 320;
275
+
276
+ /**
277
+ * Place a popout beside its trigger WITHOUT ever covering it. Below is preferred; above is
278
+ * taken when below cannot hold it and above can; whichever side wins caps the popout's
279
+ * height to the room actually there. A plain viewport clamp — what this used to do — slides
280
+ * the box up over the button that opened it, which is exactly what must not happen.
281
+ */
282
+ function placeAgainst(anchor: HTMLElement | undefined, popout: HTMLElement): Placement {
283
+ const a = (anchor ?? popout).getBoundingClientRect();
284
+ const size = popout.getBoundingClientRect();
285
+ // ALWAYS downward. Flipping above when the room below ran short made the menu appear
286
+ // on whichever side the block happened to sit, so the same gesture opened in two
287
+ // directions; a menu that is always under its trigger is the predictable one. When the
288
+ // room is short the popout scrolls inside what is there instead of moving.
289
+ const roomBelow = window.innerHeight - a.bottom - ANCHOR_GAP - EDGE_MARGIN;
290
+ const maxHeight = Math.min(MAX_POPOUT_HEIGHT, Math.max(120, roomBelow));
291
+ const y = a.bottom + ANCHOR_GAP;
292
+ // Right-aligned to the trigger, then held inside the viewport horizontally only.
293
+ const maxX = Math.max(EDGE_MARGIN, window.innerWidth - size.width - EDGE_MARGIN);
294
+ const x = Math.min(Math.max(EDGE_MARGIN, a.right - size.width), maxX);
295
+ return { x, y, maxHeight };
296
+ }
297
+
298
+ $effect(() => {
299
+ if (!editing || !pickerEl) {
300
+ listAt = null;
301
+ return;
302
+ }
303
+ listAt = placeAgainst(chipEl, pickerEl);
304
+ });
305
+
306
+ $effect(() => {
307
+ if (!menuOpen || !menuEl) {
308
+ menuAt = null;
309
+ return;
310
+ }
311
+ menuAt = placeAgainst(menuButtonEl, menuEl);
312
+ });
313
+
314
+ // A fixed popout does not move with the rail it hangs off, so it is re-placed against
315
+ // its anchor whenever the page scrolls or resizes. Re-placing, not dismissing: a
316
+ // dismissal both threw away a menu the user had just opened and raced the scroll that
317
+ // focusing the field used to cause, closing the picker in the same tick it opened.
318
+ $effect(() => {
319
+ if (!editing && !menuOpen) return;
320
+ const reposition = (): void => {
321
+ if (editing && pickerEl) listAt = placeAgainst(chipEl, pickerEl);
322
+ if (menuOpen && menuEl) menuAt = placeAgainst(menuButtonEl, menuEl);
323
+ };
324
+ window.addEventListener('scroll', reposition, { capture: true, passive: true });
325
+ window.addEventListener('resize', reposition, { passive: true });
326
+ return () => {
327
+ window.removeEventListener('scroll', reposition, { capture: true });
328
+ window.removeEventListener('resize', reposition);
329
+ };
330
+ });
331
+
332
+ const popoutStyle = (at: Placement | null): string =>
333
+ at
334
+ ? `left:${at.x}px;top:${at.y}px;max-height:${at.maxHeight}px`
335
+ : 'left:0;top:0;visibility:hidden';
336
+
337
+ // Presence of a hook is the whole gate — see `EditorPolicies.onRunCode`.
338
+ const showRun = $derived(editable && onRun !== undefined);
339
+ const showMenu = $derived(menuItems !== undefined);
340
+ </script>
341
+
342
+ <!-- Lucide (ISC) path data, inlined rather than depended on: the editor ships two runtime
343
+ dependencies and an icon package would be a third. Sized 14 / stroke 1.75 to match the
344
+ host app's menus. See THIRD-PARTY-NOTICES.md. -->
345
+ {#snippet icon(paths: string)}
346
+ <svg
347
+ viewBox="0 0 24 24"
348
+ width="14"
349
+ height="14"
350
+ fill="none"
351
+ stroke="currentColor"
352
+ stroke-width="1.75"
353
+ stroke-linecap="round"
354
+ stroke-linejoin="round"
355
+ aria-hidden="true"
356
+ >
357
+ <!-- eslint-disable-next-line svelte/no-at-html-tags -- static lucide path markup from this module's own constants -->
358
+ {@html paths}
359
+ </svg>
360
+ {/snippet}
361
+
362
+ <!-- `group`, not `toolbar`: these controls belong together, but a toolbar promises
363
+ arrow-key navigation between them, which this does not implement. -->
364
+ <div
365
+ bind:this={railEl}
366
+ class="code-rail"
367
+ class:code-rail-open={editing || menuOpen}
368
+ role="group"
369
+ aria-label={CODE_RAIL_LABEL}
370
+ onfocusout={onRailFocusOut}
371
+ >
372
+ <span bind:this={chipEl} class="code-lang-chip">
373
+ <button
374
+ type="button"
375
+ class="code-lang-button"
376
+ class:open={editing}
377
+ aria-haspopup="listbox"
378
+ aria-expanded={editing}
379
+ aria-label={codeLanguageLabel(language)}
380
+ onclick={() => (editing ? close() : open())}
381
+ >{language}{@render icon('<path d="m6 9 6 6 6-6"/>')}</button
382
+ >
383
+ </span>
384
+
385
+ {#if showRun}
386
+ <button type="button" class="code-rail-action" aria-label={CODE_RUN_LABEL} onclick={onRun}>
387
+ {@render icon(
388
+ '<path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"/>'
389
+ )}
390
+ </button>
391
+ {/if}
392
+
393
+ <button
394
+ type="button"
395
+ class="code-rail-action"
396
+ aria-label={copied ? CODE_COPIED_LABEL : CODE_COPY_LABEL}
397
+ onclick={runCopy}
398
+ onpointerleave={clearCopied}
399
+ >
400
+ {#if copied}
401
+ {@render icon('<path d="M20 6 9 17l-5-5"/>')}
402
+ {:else}
403
+ {@render icon(
404
+ '<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>'
405
+ )}
406
+ {/if}
407
+ </button>
408
+
409
+ {#if showMenu}
410
+ <button
411
+ bind:this={menuButtonEl}
412
+ type="button"
413
+ class="code-rail-action"
414
+ aria-label={CODE_MENU_LABEL}
415
+ aria-haspopup="menu"
416
+ aria-expanded={menuOpen}
417
+ onclick={toggleMenu}
418
+ onkeydown={onMenuKeyDown}
419
+ >
420
+ {@render icon(
421
+ '<circle cx="12" cy="12" r="1"/><circle cx="12" cy="5" r="1"/><circle cx="12" cy="19" r="1"/>'
422
+ )}
423
+ </button>
424
+ {/if}
425
+ </div>
426
+
427
+ {#if editing}
428
+ <div
429
+ bind:this={pickerEl}
430
+ class="md-menu code-rail-popout code-lang-picker"
431
+ style={popoutStyle(listAt)}
432
+ >
433
+ <div class="code-lang-search">
434
+ {@render icon('<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>')}
435
+ <input
436
+ bind:this={inputEl}
437
+ bind:value={draft}
438
+ type="text"
439
+ spellcheck="false"
440
+ autocomplete="off"
441
+ role="combobox"
442
+ aria-expanded="true"
443
+ aria-controls="code-lang-list"
444
+ aria-label={CODE_LANGUAGE_FIELD}
445
+ placeholder="Search for a language…"
446
+ oninput={() => {
447
+ filtering = true;
448
+ highlightMoved = false;
449
+ activeIndex = 0;
450
+ }}
451
+ onkeydown={onFieldKeyDown}
452
+ onfocusout={onFieldBlur}
453
+ />
454
+ </div>
455
+ {#if suggestions.length > 0}
456
+ <ul bind:this={listEl} id="code-lang-list" class="code-lang-list" role="listbox">
457
+ {#each suggestions as name, i (name)}
458
+ <li role="none">
459
+ <button
460
+ type="button"
461
+ role="option"
462
+ aria-selected={isCurrentLanguage(name)}
463
+ data-active={i === activeIndex}
464
+ tabindex="-1"
465
+ onmouseenter={() => {
466
+ highlightMoved = true;
467
+ activeIndex = i;
468
+ }}
469
+ onmousedown={(e) => {
470
+ // mousedown, not click: the field's blur would otherwise cancel the edit
471
+ // before a click ever landed.
472
+ e.preventDefault();
473
+ commit(name);
474
+ }}
475
+ >
476
+ <span class="code-lang-name">{name}</span>
477
+ {#if isCurrentLanguage(name)}
478
+ <span class="code-lang-check">
479
+ {@render icon('<path d="M20 6 9 17l-5-5"/>')}
480
+ </span>
481
+ {/if}
482
+ </button>
483
+ </li>
484
+ {/each}
485
+ </ul>
486
+ {:else}
487
+ <p class="code-lang-empty">No language matches</p>
488
+ {/if}
489
+ </div>
490
+ {/if}
491
+
492
+ {#if menuOpen}
493
+ <ul
494
+ bind:this={menuEl}
495
+ class="md-menu code-rail-popout code-rail-menu"
496
+ role="menu"
497
+ aria-label={CODE_MENU_LABEL}
498
+ style={popoutStyle(menuAt)}
499
+ >
500
+ {#each openMenuItems as item (item.id)}
501
+ <li role="none">
502
+ <button
503
+ type="button"
504
+ role="menuitem"
505
+ disabled={item.disabled}
506
+ onclick={() => activateMenuItem(item)}
507
+ onkeydown={onMenuKeyDown}>{item.label}</button
508
+ >
509
+ </li>
510
+ {/each}
511
+ </ul>
512
+ {/if}
513
+
514
+ <style>
515
+ /* Bare controls over the code box's top-right — no container of their own, so the code
516
+ they sit above reads through between them. Positioned against the block host, whose
517
+ box the code box fills below the host's 6px stand-off (editor.css, fencedCode), and out
518
+ of the code box's own scroller so a horizontal scroll leaves them where they are. */
519
+ .code-rail {
520
+ position: absolute;
521
+ top: 12px;
522
+ right: 8px;
523
+ z-index: 1;
524
+ display: flex;
525
+ align-items: center;
526
+ gap: 2px;
527
+ font-size: 13px;
528
+ line-height: 1;
529
+ opacity: 0;
530
+ pointer-events: none;
531
+ transition: opacity 120ms ease-out;
532
+ }
533
+
534
+ /* Block hover or block focus, and nothing else — plus the two states that outlive both,
535
+ since a popout must not vanish from under the pointer that opened it. Child and sibling
536
+ combinators, so an outer container's hover never reveals a nested block's rail. */
537
+ :global(.block-host:hover) > .code-rail,
538
+ :global(.code-block:focus) ~ .code-rail,
539
+ .code-rail:focus-within,
540
+ .code-rail-open {
541
+ opacity: 1;
542
+ pointer-events: auto;
543
+ }
544
+
545
+ @media (prefers-reduced-motion: reduce) {
546
+ .code-rail {
547
+ transition: none;
548
+ }
549
+ }
550
+
551
+ .code-lang-chip {
552
+ display: flex;
553
+ align-items: center;
554
+ }
555
+
556
+ button {
557
+ display: flex;
558
+ align-items: center;
559
+ justify-content: center;
560
+ gap: 3px;
561
+ border: none;
562
+ border-radius: 5px;
563
+ background: transparent;
564
+ color: var(--color-ui-muted, #999999);
565
+ font: inherit;
566
+ cursor: pointer;
567
+ }
568
+
569
+ .code-lang-button {
570
+ padding: 4px 6px;
571
+ }
572
+
573
+ /* An open picker keeps its trigger lit, so the two read as one control. */
574
+ .code-lang-button.open {
575
+ background: var(--color-ui-faint, rgba(255, 255, 255, 0.07));
576
+ color: var(--color-text-secondary, #cfcfca);
577
+ }
578
+
579
+ .code-rail-action {
580
+ width: 24px;
581
+ height: 24px;
582
+ padding: 0;
583
+ }
584
+
585
+ button:hover:not(:disabled) {
586
+ background: var(--color-ui-faint, rgba(255, 255, 255, 0.07));
587
+ color: var(--color-text-secondary, #d6d9e0);
588
+ }
589
+
590
+ button:focus-visible {
591
+ outline: 1px solid var(--color-accent, #567b67);
592
+ outline-offset: -1px;
593
+ }
594
+
595
+ /* The host app's menu surface, so a code block's menus read as the app's own. */
596
+ /* Surface, hairline, shadow, face and colour come from the shared `.md-menu` (editor.css);
597
+ this adds only the picker's own layout. */
598
+ .code-rail-popout {
599
+ display: flex;
600
+ flex-direction: column;
601
+ min-width: 200px;
602
+ margin: 0;
603
+ list-style: none;
604
+ overflow: hidden;
605
+ }
606
+
607
+ /* Search sits INSIDE the menu rather than swapping the rail's chip for a field: the chip
608
+ is a fixed box that never changes width, so opening the picker moves nothing. */
609
+ .code-lang-search {
610
+ display: flex;
611
+ align-items: center;
612
+ gap: 8px;
613
+ flex: 0 0 auto;
614
+ margin: -4px -4px 4px;
615
+ padding: 8px 12px;
616
+ border-bottom: 1px solid var(--menu-search-divider, rgba(255, 255, 255, 0.08));
617
+ color: var(--color-ui-muted, #8f8f89);
618
+ }
619
+
620
+ .code-lang-search input {
621
+ flex: 1;
622
+ min-width: 0;
623
+ padding: 0;
624
+ border: 0;
625
+ background: transparent;
626
+ color: var(--color-text-primary, #e8e8e5);
627
+ font: inherit;
628
+ font-size: 13px;
629
+ outline: none;
630
+ }
631
+
632
+ .code-lang-search input::placeholder {
633
+ color: var(--color-ui-dulled, #a3a39d);
634
+ }
635
+
636
+ .code-lang-list {
637
+ flex: 1 1 auto;
638
+ margin: 0;
639
+ padding: 0;
640
+ list-style: none;
641
+ overflow-y: auto;
642
+ overscroll-behavior: contain;
643
+ }
644
+
645
+ /* A hairline thumb, as the host app's list menus use — the platform's default bar is
646
+ wider than the rows it sits beside. */
647
+ .code-lang-list::-webkit-scrollbar {
648
+ width: 1px;
649
+ }
650
+ .code-lang-list::-webkit-scrollbar-track {
651
+ background: transparent;
652
+ }
653
+ .code-lang-list::-webkit-scrollbar-thumb {
654
+ background: var(--menu-scrollbar-thumb, rgba(255, 255, 255, 0.18));
655
+ }
656
+ .code-lang-list {
657
+ scrollbar-width: thin;
658
+ scrollbar-color: var(--menu-scrollbar-thumb, rgba(255, 255, 255, 0.18)) transparent;
659
+ }
660
+
661
+ .code-rail-popout button {
662
+ gap: 9px;
663
+ width: 100%;
664
+ justify-content: flex-start;
665
+ padding: 7px 10px;
666
+ border-radius: 5px;
667
+ color: inherit;
668
+ font: inherit;
669
+ text-align: left;
670
+ white-space: nowrap;
671
+ }
672
+
673
+ .code-lang-name {
674
+ flex: 1;
675
+ min-width: 0;
676
+ overflow: hidden;
677
+ text-overflow: ellipsis;
678
+ }
679
+
680
+ /* The check marks what is set, inline on its own row, in the text colour: the host app
681
+ colours no text with its accent, and its menus are what these copy. */
682
+ .code-lang-check {
683
+ display: inline-flex;
684
+ flex-shrink: 0;
685
+ color: var(--color-text-primary, #e8e8e5);
686
+ }
687
+
688
+ .code-rail-popout button:hover:not(:disabled),
689
+ .code-lang-list button[data-active='true'] {
690
+ background: var(--menu-item-hover, rgba(255, 255, 255, 0.07));
691
+ color: inherit;
692
+ }
693
+
694
+ .code-rail-popout button:disabled {
695
+ opacity: 0.4;
696
+ cursor: default;
697
+ }
698
+
699
+ .code-lang-empty {
700
+ margin: 0;
701
+ padding: 7px 10px;
702
+ color: var(--color-ui-dulled, #a3a39d);
703
+ }
704
+ </style>