foldkit-mixins-richtext 0.5.5 → 0.5.7

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.
package/dist/index.d.mts CHANGED
@@ -7,7 +7,6 @@ import "foldkit-media";
7
7
  import "foldkit/mount";
8
8
  import { SourceSession } from "foldkit-richtext-markdown";
9
9
  import { Html, HtmlBuilder, KeyboardModifiers } from "foldkit/html";
10
- //#region src/style.d.ts
11
10
  /** The elements the picker publishes: its wrapper, its row, and one button per style. */
12
11
  export declare const BlockStyleSlots: Slots.Contract<{
13
12
  readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
@@ -53,8 +52,6 @@ interface BlockStyleMenuInput<Message> extends BlockStyleInput<Message> {
53
52
  * is where a caller also closes the menu. The trigger is disabled without a text selection.
54
53
  */
55
54
  export declare const blockStyleMenu: <Message>() => SlotView.SlotView<typeof BlockStyleMenuSlots, BlockStyleMenuInput<Message>, Message>;
56
- //#endregion
57
- //#region src/find.d.ts
58
55
  /** The elements the bar publishes: its wrapper, its two fields, the count, and its buttons. */
59
56
  export declare const FindReplaceSlots: Slots.Contract<{
60
57
  readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
@@ -92,8 +89,6 @@ export declare const stepMatch: (current: number, count: number, step: 1 | -1) =
92
89
  * all every one; both are disabled with no match. Each button carries `data-find`.
93
90
  */
94
91
  export declare const findReplace: <Message>() => SlotView.SlotView<typeof FindReplaceSlots, FindReplaceInput<Message>, Message>;
95
- //#endregion
96
- //#region src/table.d.ts
97
92
  /** The elements the toolbar publishes: its wrapper, its row, and one button per change. */
98
93
  export declare const TableToolbarSlots: Slots.Contract<{
99
94
  readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
@@ -113,8 +108,6 @@ interface TableToolbarInput<Message> {
113
108
  * the header button is pressed while the table's first row is its header.
114
109
  */
115
110
  export declare const tableToolbar: <Message>() => SlotView.SlotView<typeof TableToolbarSlots, TableToolbarInput<Message>, Message>;
116
- //#endregion
117
- //#region src/code.d.ts
118
111
  /** The elements the toolbar publishes: its wrapper, the language picker, and the Copy button. */
119
112
  export declare const CodeToolbarSlots: Slots.Contract<{
120
113
  readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
@@ -143,8 +136,6 @@ interface CodeToolbarInput<Message> {
143
136
  * drawn for a block that is not there.
144
137
  */
145
138
  export declare const codeToolbar: <Message>() => SlotView.SlotView<typeof CodeToolbarSlots, CodeToolbarInput<Message>, Message>;
146
- //#endregion
147
- //#region src/handle.d.ts
148
139
  /** The elements the handle publishes: its wrapper, the grip it is dragged by, and its two moves. */
149
140
  export declare const BlockHandleSlots: Slots.Contract<{
150
141
  readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
@@ -168,8 +159,6 @@ interface BlockHandleInput<Message> {
168
159
  * disabled at its end of the container, and both when the block is not there.
169
160
  */
170
161
  export declare const blockHandle: <Message>() => SlotView.SlotView<typeof BlockHandleSlots, BlockHandleInput<Message>, Message>;
171
- //#endregion
172
- //#region src/slash.d.ts
173
162
  /**
174
163
  * The entries this package offers: the editor's catalogue, each Message passed through
175
164
  * `wrap` — the seam the toolbar takes too, because the caller usually dispatches a
@@ -188,8 +177,6 @@ export declare const slashEntries: <Message>(wrap: (message: EditorEvent) => Mes
188
177
  * see.
189
178
  */
190
179
  export declare const slashMove: <Message>(entries: ReadonlyArray<SlashEntry$1<Message>>, textBefore: string, index: number, key: string, modifiers: KeyboardModifiers) => number | undefined;
191
- //#endregion
192
- //#region src/palette.d.ts
193
180
  /** The elements the palette publishes: its wrapper, the search field, the list, and its options. */
194
181
  export declare const CommandPaletteSlots: Slots.Contract<{
195
182
  readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
@@ -218,8 +205,6 @@ interface CommandPaletteInput<Message> {
218
205
  * never leaves Enter choosing nothing.
219
206
  */
220
207
  export declare const commandPalette: <Message>() => SlotView.SlotView<typeof CommandPaletteSlots, CommandPaletteInput<Message>, Message>;
221
- //#endregion
222
- //#region src/status.d.ts
223
208
  /** The elements the status line publishes: its wrapper, the counts, and one item per problem. */
224
209
  export declare const EditorStatusSlots: Slots.Contract<{
225
210
  readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
@@ -237,8 +222,6 @@ interface EditorStatusInput {
237
222
  * one, as data attributes, so a Style can mark a kind and a Behavior can find the block.
238
223
  */
239
224
  export declare const editorStatus: <Message>() => SlotView.SlotView<typeof EditorStatusSlots, EditorStatusInput, Message>;
240
- //#endregion
241
- //#region src/source.d.ts
242
225
  /** The elements the editor publishes: its wrapper, the text, the warnings, and the way back. */
243
226
  export declare const SourceEditorSlots: Slots.Contract<{
244
227
  readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
@@ -279,8 +262,6 @@ interface SourcePreviewInput {
279
262
  * dispatches nothing, and it shares the editor's parse of the draft.
280
263
  */
281
264
  export declare const sourcePreview: <Message>() => SlotView.SlotView<typeof SourcePreviewSlots, SourcePreviewInput, Message>;
282
- //#endregion
283
- //#region src/link.d.ts
284
265
  /** The elements the editor publishes: its wrapper, the address field, and its two buttons. */
285
266
  export declare const LinkEditorSlots: Slots.Contract<{
286
267
  readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
@@ -320,8 +301,6 @@ export declare const linkEdit: (document: RichText.Document, selection: RichText
320
301
  * The remove button is drawn only inside a link. Escape in the field sends `closed`.
321
302
  */
322
303
  export declare const linkEditor: <Message>() => SlotView.SlotView<typeof LinkEditorSlots, LinkEditorInput<Message>, Message>;
323
- //#endregion
324
- //#region src/menu.d.ts
325
304
  /**
326
305
  * The elements the menu publishes: its wrapper, its list, a heading over each group, one item per
327
306
  * match with its icon, label and description, and what shows when nothing matches.
@@ -345,11 +324,7 @@ interface SlashMenuInput<Message> {
345
324
  readonly index: number;
346
325
  }
347
326
  export declare const slashMenuView: <Message>() => SlotView.SlotView<typeof SlashMenuSlots, SlashMenuInput<Message>, Message>;
348
- //#endregion
349
- //#region src/iconData.d.ts
350
327
  type IconName = 'paragraph' | 'heading-1' | 'heading-2' | 'heading-3' | 'quote' | 'bulleted-list' | 'numbered-list' | 'checklist' | 'code-block' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'highlight' | 'kbd' | 'link' | 'comment' | 'table' | 'image' | 'video' | 'audio' | 'file' | 'callout' | 'toggle' | 'divider' | 'footnote' | 'undo' | 'redo' | 'search' | 'replace' | 'match-case' | 'download' | 'copy' | 'trash' | 'plus' | 'more' | 'grip' | 'close' | 'check' | 'chevron-down' | 'chevron-up' | 'chevron-right' | 'back' | 'contents' | 'reset';
351
- //#endregion
352
- //#region src/icons.d.ts
353
328
  /** The names of the drawings in the set. */
354
329
  type RichTextIconName = IconName;
355
330
  /** Whether a name, such as a slash entry's id, has a drawing in the set. */
@@ -363,8 +338,6 @@ export declare const richTextIcon: <Message>(h: HtmlBuilder<Message>, name: Rich
363
338
  * rendering's adornment: a stylesheet masks it over the text's color.
364
339
  */
365
340
  export declare const richTextIconUrl: (name: RichTextIconName) => string;
366
- //#endregion
367
- //#region src/contents.d.ts
368
341
  /**
369
342
  * The elements the contents publish: the `nav`, its list, and one entry per heading. An entry
370
343
  * carries its depth as `--fk-toc-level` (1 for the shallowest level the document uses) and
@@ -384,8 +357,6 @@ interface TableOfContentsInput<Message> {
384
357
  }
385
358
  /** The contents as a slot view; nothing is drawn for a document with no headings. */
386
359
  export declare const tableOfContents: <Message>() => SlotView.SlotView<typeof TableOfContentsSlots, TableOfContentsInput<Message>, Message>;
387
- //#endregion
388
- //#region src/footnote.d.ts
389
360
  /** The elements the preview publishes: its card, the label field, the note's text, and the button. */
390
361
  export declare const FootnotePreviewSlots: Slots.Contract<{
391
362
  readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
@@ -408,8 +379,6 @@ interface FootnotePreviewInput<Message> {
408
379
  * at all, Go to note is disabled.
409
380
  */
410
381
  export declare const footnotePreview: <Message>() => SlotView.SlotView<typeof FootnotePreviewSlots, FootnotePreviewInput<Message>, Message>;
411
- //#endregion
412
- //#region src/index.d.ts
413
382
  /** The elements the toolbar publishes: its wrapper, its row, and one button per mark. */
414
383
  export declare const MarkToolbarSlots: Slots.Contract<{
415
384
  readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
@@ -434,6 +403,5 @@ export interface MarkToolbarInput<Message> {
434
403
  * a Behavior can single one out.
435
404
  */
436
405
  export declare const markToolbar: <Message>() => SlotView.SlotView<typeof MarkToolbarSlots, MarkToolbarInput<Message>, Message>;
437
- //#endregion
438
406
  export { type BlockHandleInput, type BlockStyleInput, type BlockStyleMenuInput, type CodeLanguage, type CodeToolbarInput, type CommandPaletteInput, type EditorStatusInput, type FindReplaceInput, type FootnotePreviewInput, type LinkEditorInput, type RichTextIconName, type SlashEntry, type SlashMenu, type SlashMenuInput, type SourceEditorInput, type SourcePreviewInput, type TableOfContentsInput, type TableToolbarInput, matchingEntries, slashMenu, slashQuery };
439
407
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":["SlashEntry"],"sources":["../src/style.ts","../src/find.ts","../src/table.ts","../src/code.ts","../src/handle.ts","../src/slash.ts","../src/palette.ts","../src/status.ts","../src/source.ts","../src/link.ts","../src/menu.ts","../src/iconData.ts","../src/icons.ts","../src/contents.ts","../src/footnote.ts","../src/index.ts"],"mappings":";;;;;;;;;;;qBAyBa,iBAAe,MAAA;;;;;UAMX,gBAAgB;WACtB,UAAU,SAAS;WACnB,WAAW,SAAS;;WAEpB,OAAO,SAAS,gBAAgB;;;;;;;;qBAS9B,cAAe,cAAY,SAAS,gBACxC,iBACP,gBAAgB,UAChB;;;;;qBAmCW,qBAAmB,MAAA;;;;;;;;;UAUf,oBAAoB,iBAAiB,gBAAgB;;WAE3D;;WAEA,SAAS;;;;;;;;qBASP,iBAAkB,cAAY,SAAS,gBAC3C,qBACP,oBAAoB,UACpB;;;;qBC9FW,kBAAgB,MAAA;;;;;;UAOZ,iBAAiB;WACvB,UAAU,SAAS;WACnB;WACA;;WAEA;WACA;WACA,UAAU,kBAAkB;WAC5B,qBAAqB,wBAAwB;;;;;WAK7C,UAA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EpB,SAAS,YAAY,SAAS,WAAW;;WAEzC,OAAO,SAAS,gBAAgB;;;;;;;;qBAS9B,kBAAmB,cAAY,SAAS,gBAC5C,sBACP,qBAAqB,UACrB;;;;qBCtBW,kBAAgB,MAAA;;;;;iBAMZ,iBAAiB;;WAEvB,OAAO;;WAEP,QAAQ;;;;;;WAMR,UAAU,iBAAiB;;;;;;;qBAQzB,cAAe,cAAY,SAAS,gBACxC,kBACP,iBAAiB,UACjB"}
1
+ {"version":3,"file":"index.d.mts","names":["SlashEntry"],"sources":["../src/style.ts","../src/find.ts","../src/table.ts","../src/code.ts","../src/handle.ts","../src/slash.ts","../src/palette.ts","../src/status.ts","../src/source.ts","../src/link.ts","../src/menu.ts","../src/iconData.ts","../src/icons.ts","../src/contents.ts","../src/footnote.ts","../src/index.ts"],"mappings":";;;;;;;;;;qBAyBa,iBAAe,MAAA;;;;;UAMX,gBAAgB;WACtB,UAAU,SAAS;WACnB,WAAW,SAAS;;WAEpB,OAAO,SAAS,gBAAgB;;;;;;;;qBAS9B,cAAe,cAAY,SAAS,gBACxC,iBACP,gBAAgB,UAChB;;;;;qBAmCW,qBAAmB,MAAA;;;;;;;;;UAUf,oBAAoB,iBAAiB,gBAAgB;;WAE3D;;WAEA,SAAS;;;;;;;;qBASP,iBAAkB,cAAY,SAAS,gBAC3C,qBACP,oBAAoB,UACpB;;qBC9FW,kBAAgB,MAAA;;;;;;UAOZ,iBAAiB;WACvB,UAAU,SAAS;WACnB;WACA;;WAEA;WACA;WACA,UAAU,kBAAkB;WAC5B,qBAAqB,wBAAwB;;;;;WAK7C,UAAU,iBAAiB;WAC3B,aAAa;WACb,QAAQ;;WAER,OAAO,SAAS,gBAAgB;;;;;;qBAO9B,YAAS,iBAAmB,eAAe;;;;;;qBAQ3C,cAAe,cAAY,SAAS,gBACxC,kBACP,iBAAiB,UACjB;;qBC5CW,mBAAiB,MAAA;;;;;UAMb,kBAAkB;WACxB,UAAU,SAAS;WACnB,WAAW,SAAS;;WAE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AAiB,UACjB"}
package/dist/index.mjs CHANGED
@@ -8,7 +8,7 @@ import * as Mount from "foldkit/mount";
8
8
  import { RovingTabindex } from "foldkit-primitives/interaction";
9
9
  import { renderDocument } from "foldkit-richtext-dom/view";
10
10
  import { closeSource } from "foldkit-richtext-markdown";
11
- //#region src/iconData.ts
11
+ // src/iconData.ts
12
12
  const icons = {
13
13
  paragraph: {
14
14
  viewBox: "0 0 24 24",
@@ -1043,8 +1043,7 @@ const icons = {
1043
1043
  }]
1044
1044
  }
1045
1045
  };
1046
- //#endregion
1047
- //#region src/icons.ts
1046
+ // src/icons.ts
1048
1047
  /**
1049
1048
  * The rich text chrome's icons: line drawings on a 24-unit grid, stroked in the text's color, so
1050
1049
  * every toolbar, menu and card draws from one set. Decorative: each is hidden from assistive
@@ -1073,8 +1072,7 @@ const richTextIcon = (h, name, { size = 16 } = {}) => Icon.draw(icons[name], h,
1073
1072
  * rendering's adornment: a stylesheet masks it over the text's color.
1074
1073
  */
1075
1074
  const richTextIconUrl = (name) => Icon.maskUrl(icons[name]);
1076
- //#endregion
1077
- //#region src/style.ts
1075
+ // src/style.ts
1078
1076
  /**
1079
1077
  * The block style picker (§124 §11, §134): a button per text style the caret's block can take —
1080
1078
  * a paragraph, or a heading — drawn through slots like the mark toolbar.
@@ -1165,8 +1163,7 @@ const blockStyleMenu = () => SlotView.forMessages().define(BlockStyleMenuSlots,
1165
1163
  h.span(slots.check.attrs(), style === chosen ? [richTextIcon(h, "check")] : [])
1166
1164
  ])))] : []]);
1167
1165
  });
1168
- //#endregion
1169
- //#region src/find.ts
1166
+ // src/find.ts
1170
1167
  /**
1171
1168
  * The find and replace bar, drawn through slots. Like the rest of the chrome it holds no state:
1172
1169
  * the query, the replacement, which match is current and whether case counts are the caller's,
@@ -1249,8 +1246,7 @@ const findReplace = () => SlotView.forMessages().define(FindReplaceSlots, (input
1249
1246
  button("close", "Close", input.closed, { icon: "close" })
1250
1247
  ]);
1251
1248
  });
1252
- //#endregion
1253
- //#region src/table.ts
1249
+ // src/table.ts
1254
1250
  /** The elements the toolbar publishes: its wrapper, its row, and one button per change. */
1255
1251
  const TableToolbarSlots = Slots.define({
1256
1252
  root: Slot.make({ capability: Capability.Container }),
@@ -1325,8 +1321,7 @@ const tableToolbar = () => SlotView.forMessages().define(TableToolbarSlots, (inp
1325
1321
  count: changes.length
1326
1322
  }), [label])))]);
1327
1323
  });
1328
- //#endregion
1329
- //#region src/code.ts
1324
+ // src/code.ts
1330
1325
  /** The elements the toolbar publishes: its wrapper, the language picker, and the Copy button. */
1331
1326
  const CodeToolbarSlots = Slots.define({
1332
1327
  root: Slot.make({ capability: Capability.Container }),
@@ -1359,8 +1354,7 @@ const codeToolbar = () => SlotView.forMessages().define(CodeToolbarSlots, (input
1359
1354
  h.OnClick(input.copied)
1360
1355
  ]), ["Copy"])]);
1361
1356
  });
1362
- //#endregion
1363
- //#region src/handle.ts
1357
+ // src/handle.ts
1364
1358
  /** The elements the handle publishes: its wrapper, the grip it is dragged by, and its two moves. */
1365
1359
  const BlockHandleSlots = Slots.define({
1366
1360
  root: Slot.make({ capability: Capability.Container }),
@@ -1410,8 +1404,7 @@ const blockHandle = () => SlotView.forMessages().define(BlockHandleSlots, (input
1410
1404
  ]), ["↓"])
1411
1405
  ]);
1412
1406
  });
1413
- //#endregion
1414
- //#region src/slash.ts
1407
+ // src/slash.ts
1415
1408
  /**
1416
1409
  * The entries this package offers: the editor's catalogue, each Message passed through
1417
1410
  * `wrap` — the seam the toolbar takes too, because the caller usually dispatches a
@@ -1442,8 +1435,7 @@ const slashMove = (entries, textBefore, index, key, modifiers) => {
1442
1435
  loop: true
1443
1436
  });
1444
1437
  };
1445
- //#endregion
1446
- //#region src/palette.ts
1438
+ // src/palette.ts
1447
1439
  /**
1448
1440
  * The command palette (§124 §11, §68, §142): the slash menu's catalogue, searched from a field of
1449
1441
  * its own rather than typed into the document, drawn through slots like the rest of the chrome.
@@ -1508,8 +1500,7 @@ const commandPalette = () => SlotView.forMessages().define(CommandPaletteSlots,
1508
1500
  count: matches.length
1509
1501
  }), [entry.label])))]);
1510
1502
  });
1511
- //#endregion
1512
- //#region src/status.ts
1503
+ // src/status.ts
1513
1504
  /** The elements the status line publishes: its wrapper, the counts, and one item per problem. */
1514
1505
  const EditorStatusSlots = Slots.define({
1515
1506
  root: Slot.make({ capability: Capability.Container }),
@@ -1539,8 +1530,7 @@ const editorStatus = () => SlotView.forMessages().define(EditorStatusSlots, (inp
1539
1530
  count: problems.length
1540
1531
  }), [problem.message])))]);
1541
1532
  });
1542
- //#endregion
1543
- //#region src/source.ts
1533
+ // src/source.ts
1544
1534
  /**
1545
1535
  * The Markdown source editor (§8, §137): the text of a source session, what switching back
1546
1536
  * would lose, and the way back — drawn through slots like the rest of the chrome.
@@ -1658,8 +1648,7 @@ const SourcePreviewSlots = Slots.define({ root: Slot.make({ capability: Capabili
1658
1648
  * dispatches nothing, and it shares the editor's parse of the draft.
1659
1649
  */
1660
1650
  const sourcePreview = () => SlotView.forMessages().define(SourcePreviewSlots, (input, slots, h) => h.div(slots.root.attrs([h.DataAttribute("source", "preview"), h.AriaLabel("Preview")]), [renderDocument(closedFor(input.session, input.document).document, input.rendering ?? RichText.noRendering)]));
1661
- //#endregion
1662
- //#region src/link.ts
1651
+ // src/link.ts
1663
1652
  /**
1664
1653
  * The link editor (§124 §11, §132): an address field and the two things it can do, drawn
1665
1654
  * through slots like the toolbar and the slash menu.
@@ -1729,8 +1718,7 @@ const linkEditor = () => SlotView.forMessages().define(LinkEditorSlots, (input,
1729
1718
  ]), ["Remove"])]
1730
1719
  ]);
1731
1720
  });
1732
- //#endregion
1733
- //#region src/menu.ts
1721
+ // src/menu.ts
1734
1722
  /**
1735
1723
  * The elements the menu publishes: its wrapper, its list, a heading over each group, one item per
1736
1724
  * match with its icon, label and description, and what shows when nothing matches.
@@ -1768,8 +1756,7 @@ const slashMenuView = () => SlotView.forMessages().define(SlashMenuSlots, (input
1768
1756
  const rows = matches.flatMap((entry, index) => headed && entry.group !== void 0 && entry.group !== matches[index - 1]?.group ? [h.div(slots.heading.attrs([h.Role("presentation")]), [entry.group]), item(entry, index)] : [item(entry, index)]);
1769
1757
  return h.div(slots.root.attrs(), [matches.length === 0 ? h.p(slots.empty.attrs(), ["No matches"]) : h.div(slots.list.attrs([h.Role("menu"), h.AriaLabel("Insert")]), rows)]);
1770
1758
  });
1771
- //#endregion
1772
- //#region src/contents.ts
1759
+ // src/contents.ts
1773
1760
  /**
1774
1761
  * The elements the contents publish: the `nav`, its list, and one entry per heading. An entry
1775
1762
  * carries its depth as `--fk-toc-level` (1 for the shallowest level the document uses) and
@@ -1793,8 +1780,7 @@ const tableOfContents = () => SlotView.forMessages().define(TableOfContentsSlots
1793
1780
  h.OnClick(input.chosen(entry.node))
1794
1781
  ]), [entry.text])])))]);
1795
1782
  });
1796
- //#endregion
1797
- //#region src/footnote.ts
1783
+ // src/footnote.ts
1798
1784
  /** The elements the preview publishes: its card, the label field, the note's text, and the button. */
1799
1785
  const FootnotePreviewSlots = Slots.define({
1800
1786
  root: Slot.make({ capability: Capability.Container }),
@@ -1831,8 +1817,7 @@ const footnotePreview = () => SlotView.forMessages().define(FootnotePreviewSlots
1831
1817
  ]), ["Go to note"])
1832
1818
  ]);
1833
1819
  });
1834
- //#endregion
1835
- //#region src/index.ts
1820
+ // src/index.ts
1836
1821
  /**
1837
1822
  * `foldkit-mixins-richtext` — the editor's chrome, drawn through slots (§35, §120).
1838
1823
  *
@@ -1868,7 +1853,6 @@ const markToolbar = () => SlotView.forMessages().define(MarkToolbarSlots, (input
1868
1853
  count: marks.length
1869
1854
  }), [mark])))]);
1870
1855
  });
1871
- //#endregion
1872
1856
  export { BlockHandleSlots, BlockStyleMenuSlots, BlockStyleSlots, CodeToolbarSlots, CommandPaletteSlots, EditorStatusSlots, FindReplaceSlots, FootnotePreviewSlots, LinkEditorSlots, MarkToolbarSlots, SlashMenuSlots, SourceEditorSlots, SourcePreviewSlots, TableOfContentsSlots, TableToolbarSlots, blockHandle, blockStyleMenu, blockStyles, codeToolbar, commandPalette, editorStatus, findReplace, footnotePreview, isRichTextIcon, linkEdit, linkEditor, markToolbar, matchingEntries, richTextIcon, richTextIconUrl, slashEntries, slashMenu, slashMenuView, slashMove, slashQuery, sourceEditor, sourcePreview, stepMatch, tableOfContents, tableToolbar };
1873
1857
 
1874
1858
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["slashEntries","EditorMessage","EditorMessage","EditorMessage","EditorMessage","editorEntries","slashMenu","EditorMessage","EditorMessage"],"sources":["../src/iconData.ts","../src/icons.ts","../src/style.ts","../src/find.ts","../src/table.ts","../src/code.ts","../src/handle.ts","../src/slash.ts","../src/palette.ts","../src/status.ts","../src/source.ts","../src/link.ts","../src/menu.ts","../src/contents.ts","../src/footnote.ts","../src/index.ts"],"sourcesContent":["// Written by `pnpm icons` from icons.json. Do not edit.\n// Lucide (ISC, Lucide Contributors): @iconify-json/lucide 1.2.147, https://github.com/lucide-icons/lucide/blob/main/LICENSE\nimport type { IconData } from 'foldkit-media'\n\nexport type IconName =\n | 'paragraph'\n | 'heading-1'\n | 'heading-2'\n | 'heading-3'\n | 'quote'\n | 'bulleted-list'\n | 'numbered-list'\n | 'checklist'\n | 'code-block'\n | 'bold'\n | 'italic'\n | 'underline'\n | 'strikethrough'\n | 'code'\n | 'highlight'\n | 'kbd'\n | 'link'\n | 'comment'\n | 'table'\n | 'image'\n | 'video'\n | 'audio'\n | 'file'\n | 'callout'\n | 'toggle'\n | 'divider'\n | 'footnote'\n | 'undo'\n | 'redo'\n | 'search'\n | 'replace'\n | 'match-case'\n | 'download'\n | 'copy'\n | 'trash'\n | 'plus'\n | 'more'\n | 'grip'\n | 'close'\n | 'check'\n | 'chevron-down'\n | 'chevron-up'\n | 'chevron-right'\n | 'back'\n | 'contents'\n | 'reset'\n\nexport const icons: { readonly [Name in IconName]: IconData } = {\n paragraph: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M13 4v16m4-16v16m2-16H9.5a4.5 4.5 0 0 0 0 9H13',\n },\n children: [],\n },\n ],\n },\n 'heading-1': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M4 12h8m-8 6V6m8 12V6m5 6l3-2v8',\n },\n children: [],\n },\n ],\n },\n 'heading-2': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M4 12h8m-8 6V6m8 12V6m9 12h-4c0-4 4-3 4-6c0-1.5-2-2.5-4-1',\n },\n children: [],\n },\n ],\n },\n 'heading-3': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M4 12h8m-8 6V6m8 12V6m5.5 4.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2m-2 3.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2',\n },\n children: [],\n },\n ],\n },\n quote: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M17 5H3m18 7H8m13 7H8m-5-7v7',\n },\n children: [],\n },\n ],\n },\n 'bulleted-list': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M3 5h.01M3 12h.01M3 19h.01M8 5h13M8 12h13M8 19h13',\n },\n children: [],\n },\n ],\n },\n 'numbered-list': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M11 5h10m-10 7h10m-10 7h10M4 4h1v5M4 9h2m.5 11H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02',\n },\n children: [],\n },\n ],\n },\n checklist: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M13 5h8m-8 7h8m-8 7h8M3 17l2 2l4-4M3 7l2 2l4-4',\n },\n children: [],\n },\n ],\n },\n 'code-block': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'path', attributes: { d: 'm10 9l-3 3l3 3m4 0l3-3l-3-3' }, children: [] },\n {\n tag: 'rect',\n attributes: { width: '18', height: '18', x: '3', y: '3', rx: '2' },\n children: [],\n },\n ],\n },\n ],\n },\n bold: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8',\n },\n children: [],\n },\n ],\n },\n italic: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M19 4h-9m4 16H5M15 4L9 20',\n },\n children: [],\n },\n ],\n },\n underline: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M6 4v6a6 6 0 0 0 12 0V4M4 20h16',\n },\n children: [],\n },\n ],\n },\n strikethrough: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M16 4H9a3 3 0 0 0-2.83 4M14 12a4 4 0 0 1 0 8H6m-2-8h16',\n },\n children: [],\n },\n ],\n },\n code: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'm16 18l6-6l-6-6M8 6l-6 6l6 6',\n },\n children: [],\n },\n ],\n },\n highlight: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'path', attributes: { d: 'm9 11l-6 6v3h9l3-3' }, children: [] },\n {\n tag: 'path',\n attributes: { d: 'm22 12l-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4' },\n children: [],\n },\n ],\n },\n ],\n },\n kbd: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: {\n d: 'M10 8h.01M12 12h.01M14 8h.01M16 12h.01M18 8h.01M6 8h.01M7 16h10m-9-4h.01',\n },\n children: [],\n },\n {\n tag: 'rect',\n attributes: { width: '20', height: '16', x: '2', y: '4', rx: '2' },\n children: [],\n },\n ],\n },\n ],\n },\n link: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: { d: 'M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71' },\n children: [],\n },\n {\n tag: 'path',\n attributes: { d: 'M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71' },\n children: [],\n },\n ],\n },\n ],\n },\n comment: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z',\n },\n children: [],\n },\n ],\n },\n table: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'path', attributes: { d: 'M12 3v18' }, children: [] },\n {\n tag: 'rect',\n attributes: { width: '18', height: '18', x: '3', y: '3', rx: '2' },\n children: [],\n },\n { tag: 'path', attributes: { d: 'M3 9h18M3 15h18' }, children: [] },\n ],\n },\n ],\n },\n image: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'rect',\n attributes: { width: '18', height: '18', x: '3', y: '3', rx: '2', ry: '2' },\n children: [],\n },\n { tag: 'circle', attributes: { cx: '9', cy: '9', r: '2' }, children: [] },\n {\n tag: 'path',\n attributes: { d: 'm21 15l-3.086-3.086a2 2 0 0 0-2.828 0L6 21' },\n children: [],\n },\n ],\n },\n ],\n },\n video: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: {\n d: 'm16 13l5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5',\n },\n children: [],\n },\n {\n tag: 'rect',\n attributes: { width: '14', height: '12', x: '2', y: '6', rx: '2' },\n children: [],\n },\n ],\n },\n ],\n },\n audio: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'path', attributes: { d: 'M9 18V5l12-2v13' }, children: [] },\n { tag: 'circle', attributes: { cx: '6', cy: '18', r: '3' }, children: [] },\n { tag: 'circle', attributes: { cx: '18', cy: '16', r: '3' }, children: [] },\n ],\n },\n ],\n },\n file: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'm16 6l-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551',\n },\n children: [],\n },\n ],\n },\n callout: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M15 14c.2-1 .7-1.7 1.5-2.5c1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5c.7.7 1.3 1.5 1.5 2.5m0 4h6m-5 4h4',\n },\n children: [],\n },\n ],\n },\n toggle: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M10 5h11m-11 7h11m-11 7h11M3 10l3-3l-3-3m0 16l3-3l-3-3',\n },\n children: [],\n },\n ],\n },\n divider: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M5 12h14',\n },\n children: [],\n },\n ],\n },\n footnote: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'm4 19l8-8m0 8l-8-8m16 1h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06',\n },\n children: [],\n },\n ],\n },\n undo: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'path', attributes: { d: 'M3 7v6h6' }, children: [] },\n {\n tag: 'path',\n attributes: { d: 'M21 17a9 9 0 0 0-9-9a9 9 0 0 0-6 2.3L3 13' },\n children: [],\n },\n ],\n },\n ],\n },\n redo: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'path', attributes: { d: 'M21 7v6h-6' }, children: [] },\n {\n tag: 'path',\n attributes: { d: 'M3 17a9 9 0 0 1 9-9a9 9 0 0 1 6 2.3l3 2.7' },\n children: [],\n },\n ],\n },\n ],\n },\n search: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'path', attributes: { d: 'm21 21l-4.34-4.34' }, children: [] },\n { tag: 'circle', attributes: { cx: '11', cy: '11', r: '8' }, children: [] },\n ],\n },\n ],\n },\n replace: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: {\n d: 'M14 4a1 1 0 0 1 1-1m0 7a1 1 0 0 1-1-1m7-5a1 1 0 0 0-1-1m1 6a1 1 0 0 1-1 1M3 7l3 3l3-3',\n },\n children: [],\n },\n { tag: 'path', attributes: { d: 'M6 10V5a2 2 0 0 1 2-2h2' }, children: [] },\n {\n tag: 'rect',\n attributes: { width: '7', height: '7', x: '3', y: '14', rx: '1' },\n children: [],\n },\n ],\n },\n ],\n },\n 'match-case': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: { d: 'm2 16l4.039-9.69a.5.5 0 0 1 .923 0L11 16m11-7v7M3.304 13h6.392' },\n children: [],\n },\n { tag: 'circle', attributes: { cx: '18.5', cy: '12.5', r: '3.5' }, children: [] },\n ],\n },\n ],\n },\n download: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: { d: 'M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' },\n children: [],\n },\n { tag: 'path', attributes: { d: 'm7 10l5 5l5-5' }, children: [] },\n ],\n },\n ],\n },\n copy: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'rect',\n attributes: { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2' },\n children: [],\n },\n {\n tag: 'path',\n attributes: { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2' },\n children: [],\n },\n ],\n },\n ],\n },\n trash: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2',\n },\n children: [],\n },\n ],\n },\n plus: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M5 12h14m-7-7v14',\n },\n children: [],\n },\n ],\n },\n more: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'circle', attributes: { cx: '12', cy: '12', r: '1' }, children: [] },\n { tag: 'circle', attributes: { cx: '19', cy: '12', r: '1' }, children: [] },\n { tag: 'circle', attributes: { cx: '5', cy: '12', r: '1' }, children: [] },\n ],\n },\n ],\n },\n grip: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'circle', attributes: { cx: '9', cy: '12', r: '1' }, children: [] },\n { tag: 'circle', attributes: { cx: '9', cy: '5', r: '1' }, children: [] },\n { tag: 'circle', attributes: { cx: '9', cy: '19', r: '1' }, children: [] },\n { tag: 'circle', attributes: { cx: '15', cy: '12', r: '1' }, children: [] },\n { tag: 'circle', attributes: { cx: '15', cy: '5', r: '1' }, children: [] },\n { tag: 'circle', attributes: { cx: '15', cy: '19', r: '1' }, children: [] },\n ],\n },\n ],\n },\n close: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M18 6L6 18M6 6l12 12',\n },\n children: [],\n },\n ],\n },\n check: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M20 6L9 17l-5-5',\n },\n children: [],\n },\n ],\n },\n 'chevron-down': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'm6 9l6 6l6-6',\n },\n children: [],\n },\n ],\n },\n 'chevron-up': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'm18 15l-6-6l-6 6',\n },\n children: [],\n },\n ],\n },\n 'chevron-right': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'm9 18l6-6l-6-6',\n },\n children: [],\n },\n ],\n },\n back: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'm12 19l-7-7l7-7m7 7H5',\n },\n children: [],\n },\n ],\n },\n contents: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: { d: 'M8 5h13m-8 7h8m-8 7h8M3 10a2 2 0 0 0 2 2h3' },\n children: [],\n },\n { tag: 'path', attributes: { d: 'M3 5v12a2 2 0 0 0 2 2h3' }, children: [] },\n ],\n },\n ],\n },\n reset: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: { d: 'M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8' },\n children: [],\n },\n { tag: 'path', attributes: { d: 'M3 3v5h5' }, children: [] },\n ],\n },\n ],\n },\n}\n","/**\n * The rich text chrome's icons: line drawings on a 24-unit grid, stroked in the text's color, so\n * every toolbar, menu and card draws from one set. Decorative: each is hidden from assistive\n * technology, and the control it sits in carries the name that is read.\n *\n * The drawings are Lucide's (https://lucide.dev), generated into `iconData.ts` by `pnpm icons`\n * from `icons.json`, under its ISC license:\n *\n * ISC License. Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of\n * Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.\n * Permission to use, copy, modify, and/or distribute this software for any purpose with or\n * without fee is hereby granted, provided that the above copyright notice and this permission\n * notice appear in all copies. THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL\n * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR\n * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\n * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN\n * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\nimport { Icon } from 'foldkit-media'\nimport type { Html, HtmlBuilder } from 'foldkit/html'\nimport { icons, type IconName } from './iconData.js'\n\n/** The names of the drawings in the set. */\nexport type RichTextIconName = IconName\n\n/** Whether a name, such as a slash entry's id, has a drawing in the set. */\nexport const isRichTextIcon = (name: string): name is RichTextIconName => Object.hasOwn(icons, name)\n\n/** An icon as inline SVG, `size` CSS pixels square, in the text's color. */\nexport const richTextIcon = <Message>(\n h: HtmlBuilder<Message>,\n name: RichTextIconName,\n { size = 16 }: { readonly size?: number } = {},\n): Html => Icon.draw(icons[name], h, { size: `${size}px` })\n\n/**\n * An icon as a CSS `url(…)`, for markup that cannot hold an element of its own, such as a\n * rendering's adornment: a stylesheet masks it over the text's color.\n */\nexport const richTextIconUrl = (name: RichTextIconName): string => Icon.maskUrl(icons[name])\n","/**\n * The block style picker (§124 §11, §134): a button per text style the caret's block can take —\n * a paragraph, or a heading — drawn through slots like the mark toolbar.\n *\n * The styles are the slash menu's retype entries, so the two offer the same list under the\n * same labels. Which one is pressed is a read of the document (`RichText.textBlockAt`); what a\n * button sends is its entry's `RetypedBlock`, wrapped for the caller. Lists and quotes are not\n * styles here: leaving one is a lift, not a retype, so a picker that listed them would send a\n * Message that does not undo what it shows. A code block is not a style either, but a retype\n * leaves one (given a vocabulary that says it holds text), so the buttons stay live inside it.\n */\nimport { Equal } from 'effect'\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { slashEntries, type EditorEvent, type SlashEntry } from 'foldkit-richtext-dom/editor'\nimport { isRichTextIcon, richTextIcon } from './icons.js'\n\ntype Retype = Extract<EditorEvent, { readonly _tag: 'RetypedBlock' }>\n\nconst styles = slashEntries.filter(\n (entry): entry is SlashEntry<Retype> => entry.message._tag === 'RetypedBlock',\n)\n\n/** The elements the picker publishes: its wrapper, its row, and one button per style. */\nexport const BlockStyleSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n toolbar: Slot.make({ capability: Capability.Collection }),\n button: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface BlockStyleInput<Message> {\n readonly document: RichText.Document\n readonly selection: RichText.Selection | null\n /** An editor Message as this caller's, usually its `edited(...)` wrapper. */\n readonly wrap: (message: EditorEvent) => Message\n}\n\n/**\n * The block style picker as a slot view. The button for the style the selection's block has\n * is pressed; none is in a code block, or at a heading level the list does not offer. Every\n * button is disabled without a text selection — a node selection, or none — because a retype\n * there is refused.\n */\nexport const blockStyles = <Message>(): SlotView.SlotView<\n typeof BlockStyleSlots,\n BlockStyleInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(BlockStyleSlots, (input, slots, h): Html => {\n const current = RichText.textBlockAt(input.document, input.selection)\n const live = input.selection?.type === 'Range'\n return h.div(slots.root.attrs(), [\n h.div(\n slots.toolbar.attrs([h.Role('toolbar'), h.AriaLabel('Text style')]),\n styles.map((style, index) =>\n h.button(\n slots.button.attrs(\n [\n h.Type('button'),\n h.DataAttribute('style', style.id),\n h.AriaPressed(\n current !== undefined && Equal.equals(style.message.block, current)\n ? 'true'\n : 'false',\n ),\n h.Disabled(!live),\n ...(live ? [h.OnClick(input.wrap(style.message))] : []),\n ],\n { index, id: style.id, count: styles.length },\n ),\n [style.label],\n ),\n ),\n ),\n ])\n })\n\n/**\n * The elements the style menu publishes: its wrapper, the trigger that names the current style,\n * the menu, and one item per style with its icon, label and the check on the current one.\n */\nexport const BlockStyleMenuSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n trigger: Slot.make({ capability: Capability.Interactive }),\n menu: Slot.make({ capability: Capability.Collection }),\n item: Slot.make({ capability: Capability.Interactive }),\n icon: Slot.make({ capability: Capability.Container }),\n label: Slot.make({ capability: Capability.Container }),\n check: Slot.make({ capability: Capability.Container }),\n})\n\nexport interface BlockStyleMenuInput<Message> extends BlockStyleInput<Message> {\n /** Whether the menu is open: the caller's, as every menu's is. */\n readonly open: boolean\n /** The trigger's Message, which opens the menu or closes it. */\n readonly toggled: Message\n}\n\n/**\n * The same styles as `blockStyles`, in the space of one button: the trigger names the style the\n * selection's block has (\"Text style\" where none applies, as in a code block) and opens a menu of\n * every style, the current one checked. Choosing one sends its `RetypedBlock` through `wrap`, which\n * is where a caller also closes the menu. The trigger is disabled without a text selection.\n */\nexport const blockStyleMenu = <Message>(): SlotView.SlotView<\n typeof BlockStyleMenuSlots,\n BlockStyleMenuInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(BlockStyleMenuSlots, (input, slots, h): Html => {\n const current = RichText.textBlockAt(input.document, input.selection)\n const live = input.selection?.type === 'Range'\n const chosen = styles.find(\n style => current !== undefined && Equal.equals(style.message.block, current),\n )\n const icon = (name: string | undefined) =>\n name !== undefined && isRichTextIcon(name)\n ? [h.span(slots.icon.attrs(), [richTextIcon(h, name)])]\n : []\n return h.div(slots.root.attrs(), [\n h.button(\n slots.trigger.attrs([\n h.Type('button'),\n h.AriaHasPopup('menu'),\n h.AriaExpanded(input.open && live),\n h.AriaLabel(`Text style: ${chosen?.label ?? 'none'}`),\n h.Disabled(!live),\n ...(live ? [h.OnClick(input.toggled)] : []),\n ]),\n [\n ...icon(chosen?.icon),\n h.span(slots.label.attrs(), [chosen?.label ?? 'Text style']),\n richTextIcon(h, 'chevron-down', { size: 14 }),\n ],\n ),\n ...(input.open && live\n ? [\n h.div(\n slots.menu.attrs([h.Role('menu'), h.AriaLabel('Text style')]),\n styles.map((style, index) =>\n h.button(\n slots.item.attrs(\n [\n h.Type('button'),\n h.Role('menuitemradio'),\n h.AriaChecked(style === chosen),\n h.DataAttribute('style', style.id),\n h.OnClick(input.wrap(style.message)),\n ],\n { index, id: style.id, count: styles.length },\n ),\n [\n ...icon(style.icon),\n h.span(slots.label.attrs(), [style.label]),\n h.span(slots.check.attrs(), style === chosen ? [richTextIcon(h, 'check')] : []),\n ],\n ),\n ),\n ),\n ]\n : []),\n ])\n })\n","/**\n * The find and replace bar, drawn through slots. Like the rest of the chrome it holds no state:\n * the query, the replacement, which match is current and whether case counts are the caller's,\n * the matches are a read of the document (`RichText.findMatches`), and replacing is the editor's\n * own `ReplacedText`, so a replacement is an edit with an undo step like any other.\n */\nimport { Option } from 'effect'\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { Message as EditorMessage, type EditorEvent } from 'foldkit-richtext-dom/editor'\nimport { richTextIcon, type RichTextIconName } from './icons.js'\n\n/** The elements the bar publishes: its wrapper, its two fields, the count, and its buttons. */\nexport const FindReplaceSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n field: Slot.make({ capability: Capability.TextInput }),\n count: Slot.make({ capability: Capability.Container }),\n button: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface FindReplaceInput<Message> {\n readonly document: RichText.Document\n readonly query: string\n readonly replacement: string\n /** The match the bar is on, by its index in `RichText.findMatches`. */\n readonly current: number\n readonly caseSensitive: boolean\n readonly queried: (query: string) => Message\n readonly replacementDrafted: (replacement: string) => Message\n /**\n * Go to the next match (1) or the previous one (-1). The caller moves its current match with\n * `stepMatch` against its Model as it is then, since keys can come faster than the bar is drawn.\n */\n readonly stepped: (step: 1 | -1) => Message\n readonly caseToggled: Message\n readonly closed: Message\n /** An editor Message as this caller's, usually its `edited(...)` wrapper. */\n readonly wrap: (message: EditorEvent) => Message\n}\n\n/**\n * The index a step from `current` lands on among `count` matches, wrapping at either end, so\n * Enter keeps cycling through them as a browser's find does.\n */\nexport const stepMatch = (current: number, count: number, step: 1 | -1): number =>\n count === 0 ? 0 : (((current + step) % count) + count) % count\n\n/**\n * The bar as a slot view. Enter in the find field goes to the next match and Shift+Enter to the\n * previous one; Escape in either field closes it. Replace replaces the current match and Replace\n * all every one; both are disabled with no match. Each button carries `data-find`.\n */\nexport const findReplace = <Message>(): SlotView.SlotView<\n typeof FindReplaceSlots,\n FindReplaceInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(FindReplaceSlots, (input, slots, h): Html => {\n const count = RichText.findMatches(input.document, input.query, input).length\n const current = Math.min(input.current, Math.max(0, count - 1))\n const replaced = (at: number | undefined) =>\n input.wrap(\n EditorMessage.ReplacedText({\n query: input.query,\n replacement: input.replacement,\n caseSensitive: input.caseSensitive,\n ...(at === undefined ? {} : { at }),\n }),\n )\n const button = (\n id: string,\n label: string,\n message: Message,\n {\n disabled = false,\n pressed,\n icon,\n }: {\n readonly disabled?: boolean\n readonly pressed?: boolean\n /** Drawn in place of the label, which then names the button and is its tooltip. */\n readonly icon?: RichTextIconName\n } = {},\n ) =>\n h.button(\n slots.button.attrs([\n h.Type('button'),\n h.DataAttribute('find', id),\n h.AriaLabel(label),\n ...(icon === undefined ? [] : [h.Title(label)]),\n ...(pressed === undefined ? [] : [h.AriaPressed(pressed ? 'true' : 'false')]),\n h.Disabled(disabled),\n ...(disabled ? [] : [h.OnClick(message)]),\n ]),\n [icon === undefined ? label : richTextIcon(h, icon)],\n )\n return h.div(slots.root.attrs([h.Role('search'), h.AriaLabel('Find and replace')]), [\n h.input(\n slots.field.attrs([\n h.Type('search'),\n h.DataAttribute('find', 'query'),\n h.AriaLabel('Find'),\n h.Placeholder('Find'),\n h.Value(input.query),\n h.OnInput(input.queried),\n h.OnKeyDownPreventDefault((key, modifiers) => {\n if (key === 'Escape') return Option.some(input.closed)\n if (key !== 'Enter' || count === 0) return Option.none()\n return Option.some(input.stepped(modifiers.shiftKey ? -1 : 1))\n }),\n ]),\n ),\n h.span(slots.count.attrs([h.AriaLive('polite')]), [\n input.query === '' ? '' : count === 0 ? 'No matches' : `${current + 1} of ${count}`,\n ]),\n button('previous', 'Previous match', input.stepped(-1), {\n disabled: count === 0,\n icon: 'chevron-up',\n }),\n button('next', 'Next match', input.stepped(1), {\n disabled: count === 0,\n icon: 'chevron-down',\n }),\n button('case', 'Match case', input.caseToggled, {\n pressed: input.caseSensitive,\n icon: 'match-case',\n }),\n h.input(\n slots.field.attrs([\n h.Type('text'),\n h.DataAttribute('find', 'replacement'),\n h.AriaLabel('Replace with'),\n h.Placeholder('Replace with'),\n h.Value(input.replacement),\n h.OnInput(input.replacementDrafted),\n h.OnKeyDownPreventDefault(key =>\n key === 'Escape' ? Option.some(input.closed) : Option.none(),\n ),\n ]),\n ),\n button('replace', 'Replace', replaced(current), { disabled: count === 0 }),\n button('replace-all', 'Replace all', replaced(undefined), { disabled: count === 0 }),\n button('close', 'Close', input.closed, { icon: 'close' }),\n ])\n })\n","/**\n * The table toolbar: rows and columns added and removed around the caret's cell, the header row\n * switched, and the table deleted, drawn through slots like the rest of the chrome. It holds no\n * state: where the caret is in which table is a read of the document (`RichText.tableAt`), and\n * what it sends is the editor's own Messages, wrapped for the caller.\n */\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { Message as EditorMessage, type EditorEvent } from 'foldkit-richtext-dom/editor'\n\n/** The elements the toolbar publishes: its wrapper, its row, and one button per change. */\nexport const TableToolbarSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n toolbar: Slot.make({ capability: Capability.Collection }),\n button: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface TableToolbarInput<Message> {\n readonly document: RichText.Document\n readonly selection: RichText.Selection | null\n /** An editor Message as this caller's, usually its `edited(...)` wrapper. */\n readonly wrap: (message: EditorEvent) => Message\n}\n\n/**\n * The table toolbar as a slot view. Every button is disabled outside a table, so a caller can\n * draw it always or only while `RichText.tableAt` finds the caret in one. Each button carries its\n * change as `data-table` and as the slot item's `id`, so a Style or Behavior can single one out;\n * the header button is pressed while the table's first row is its header.\n */\nexport const tableToolbar = <Message>(): SlotView.SlotView<\n typeof TableToolbarSlots,\n TableToolbarInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(TableToolbarSlots, (input, slots, h): Html => {\n const at = RichText.tableAt(input.document, input.selection)\n const first = at?.rows[0]\n const header = first?.props.header === true\n const changes: ReadonlyArray<\n readonly [id: string, label: string, message: EditorEvent | undefined, pressed?: boolean]\n > = [\n ['row-above', 'Row above', EditorMessage.InsertedRow({ where: 'before' })],\n ['row-below', 'Row below', EditorMessage.InsertedRow({ where: 'after' })],\n ['column-left', 'Column left', EditorMessage.InsertedColumn({ where: 'before' })],\n ['column-right', 'Column right', EditorMessage.InsertedColumn({ where: 'after' })],\n ['delete-row', 'Delete row', EditorMessage.DeletedRow()],\n ['delete-column', 'Delete column', EditorMessage.DeletedColumn()],\n [\n 'header',\n 'Header row',\n first === undefined\n ? undefined\n : EditorMessage.ChangedProps({ node: first.id, props: { header: !header } }),\n header,\n ],\n [\n 'delete-table',\n 'Delete table',\n at === undefined ? undefined : EditorMessage.DeletedBlock({ node: at.table.id }),\n ],\n ]\n return h.div(slots.root.attrs(), [\n h.div(\n slots.toolbar.attrs([h.Role('toolbar'), h.AriaLabel('Table')]),\n changes.map(([id, label, message, pressed], index) =>\n h.button(\n slots.button.attrs(\n [\n h.Type('button'),\n h.DataAttribute('table', id),\n ...(pressed === undefined ? [] : [h.AriaPressed(pressed ? 'true' : 'false')]),\n h.Disabled(at === undefined || message === undefined),\n ...(at === undefined || message === undefined\n ? []\n : [h.OnClick(input.wrap(message))]),\n ],\n { index, id, count: changes.length },\n ),\n [label],\n ),\n ),\n ),\n ])\n })\n","/**\n * The code block toolbar: the block's language, chosen from the caller's list, and a Copy\n * button, drawn through slots. The language is the block's `language` prop, set through the\n * editor's `ChangedProps`, so it is saved and undone with the text; copying is the caller's\n * own Message, since writing to the clipboard is a Command the editor does not own.\n */\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { Message as EditorMessage, type EditorEvent } from 'foldkit-richtext-dom/editor'\n\n/** The elements the toolbar publishes: its wrapper, the language picker, and the Copy button. */\nexport const CodeToolbarSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n language: Slot.make({ capability: Capability.Interactive }),\n copy: Slot.make({ capability: Capability.Interactive }),\n})\n\n/** A language the picker offers: the `language` prop's value, and what the picker shows. */\nexport interface CodeLanguage {\n readonly id: string\n readonly label: string\n}\n\nexport interface CodeToolbarInput<Message> {\n readonly document: RichText.Document\n /** The code block the toolbar is for. */\n readonly node: RichText.NodeId\n /** What the picker offers, in order; `''` is code with no language. */\n readonly languages: ReadonlyArray<CodeLanguage>\n /** An editor Message as this caller's, usually its `edited(...)` wrapper. */\n readonly wrap: (message: EditorEvent) => Message\n /** What Copy sends: the caller copies the block's text (`RichText.toText([block])`). */\n readonly copied: Message\n}\n\n/**\n * The code block toolbar as a slot view. The picker shows the block's language, and a language\n * the list does not name is offered as itself, so choosing nothing never changes it. Nothing is\n * drawn for a block that is not there.\n */\nexport const codeToolbar = <Message>(): SlotView.SlotView<\n typeof CodeToolbarSlots,\n CodeToolbarInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(CodeToolbarSlots, (input, slots, h): Html => {\n const block = RichText.locateBlock(input.document, input.node)?.block\n const current = block?.type === 'Node' ? block.props.language : undefined\n const language = typeof current === 'string' ? current : ''\n const languages = input.languages.some(each => each.id === language)\n ? input.languages\n : [...input.languages, { id: language, label: language }]\n return h.div(slots.root.attrs([h.Role('toolbar'), h.AriaLabel('Code')]), [\n h.select(\n slots.language.attrs([\n h.AriaLabel('Language'),\n h.Value(language),\n h.OnChange(chosen =>\n input.wrap(\n EditorMessage.ChangedProps({ node: input.node, props: { language: chosen } }),\n ),\n ),\n ]),\n languages.map(each =>\n h.option([h.Value(each.id), h.Selected(each.id === language)], [each.label]),\n ),\n ),\n h.button(\n slots.copy.attrs([\n h.Type('button'),\n h.DataAttribute('code', 'copy'),\n h.OnClick(input.copied),\n ]),\n ['Copy'],\n ),\n ])\n })\n","/**\n * The block handle (§124 §11, §144): the moves one block can make as a whole, drawn through slots\n * like the rest of the chrome.\n *\n * It holds no state. Which block it stands for is the caller's, usually one of\n * `RichText.blocksAt(document, selection)`: the outermost to move a whole list, an item to\n * reorder a list. Its siblings are a read of the document, and what it sends is the editor's\n * `MovedBlock`, wrapped for the caller.\n */\nimport type { Html } from 'foldkit/html'\nimport * as Mount from 'foldkit/mount'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { Message as EditorMessage, type EditorEvent } from 'foldkit-richtext-dom/editor'\nimport { blockDrag } from 'foldkit-richtext-dom/toolbar'\n\n/** The elements the handle publishes: its wrapper, the grip it is dragged by, and its two moves. */\nexport const BlockHandleSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n grip: Slot.make({ capability: Capability.Interactive }),\n up: Slot.make({ capability: Capability.Interactive }),\n down: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface BlockHandleInput<Message> {\n readonly document: RichText.Document\n /** The editor host's id, whose blocks a drag measures. */\n readonly hostId: string\n /** The block the handle stands for. */\n readonly node: RichText.NodeId\n /** An editor Message as this caller's, usually its `edited(...)` wrapper. */\n readonly wrap: (message: EditorEvent) => Message\n}\n\n/** The drag Mount lifted into the caller's Messages, as the grip carries it. */\nexport const dragMount = <Message>(\n hostId: string,\n node: RichText.NodeId,\n wrap: (message: EditorEvent) => Message,\n): Mount.MountAction<Message> => Mount.mapMessage(blockDrag({ hostId, node }), wrap)\n\n/**\n * The handle as a slot view. The grip drags the block wherever `RichText.moveTargets` allows\n * (`blockDrag`), and is keyed by the block, since a Mount reads its args once. Up moves the\n * block before its previous sibling and down after its next one, within its container; each is\n * disabled at its end of the container, and both when the block is not there.\n */\nexport const blockHandle = <Message>(): SlotView.SlotView<\n typeof BlockHandleSlots,\n BlockHandleInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(BlockHandleSlots, (input, slots, h): Html => {\n const { previous, next } = RichText.siblingsOf(input.document, input.node)\n const move = (to: RichText.Beside) =>\n input.wrap(EditorMessage.MovedBlock({ node: input.node, to }))\n return h.div(slots.root.attrs([h.Role('group'), h.AriaLabel('Block')]), [\n h.button(\n slots.grip.attrs([\n h.Key(input.node),\n h.Type('button'),\n h.DataAttribute('handle', 'grip'),\n h.AriaLabel('Drag to move'),\n // A drag is the pointer's alone, so the grip would be a stop in the tab order that\n // does nothing; the keyboard has up and down, which stay within the container.\n h.Tabindex(-1),\n h.OnMount(dragMount(input.hostId, input.node, input.wrap)),\n ]),\n ['⠿'],\n ),\n h.button(\n slots.up.attrs([\n h.Type('button'),\n h.DataAttribute('handle', 'up'),\n h.AriaLabel('Move up'),\n h.Disabled(previous === undefined),\n ...(previous === undefined ? [] : [h.OnClick(move({ before: previous.id }))]),\n ]),\n ['↑'],\n ),\n h.button(\n slots.down.attrs([\n h.Type('button'),\n h.DataAttribute('handle', 'down'),\n h.AriaLabel('Move down'),\n h.Disabled(next === undefined),\n ...(next === undefined ? [] : [h.OnClick(move({ after: next.id }))]),\n ]),\n ['↓'],\n ),\n ])\n })\n","/**\n * The slash menu's keys and catalogue (§119, §123): the movement rule over\n * `foldkit-primitives`' `RovingTabindex.move`, and the editor's catalogue with each\n * entry's Message wrapped for this caller.\n *\n * The query, the matching, and the menu itself are the editor's\n * (`foldkit-richtext-dom/editor`) and re-exported here, so an application that imports\n * the chrome gets one vocabulary. `slashMove` is what the caller's keys call to compute\n * an index; the menu's view is `menu.ts`.\n */\nimport type { KeyboardModifiers } from 'foldkit/html'\nimport { RovingTabindex } from 'foldkit-primitives/interaction'\nimport {\n slashEntries as editorEntries,\n slashMenu,\n type EditorEvent,\n type SlashEntry,\n} from 'foldkit-richtext-dom/editor'\n\nexport {\n matchingEntries,\n slashMenu,\n slashQuery,\n type SlashEntry,\n type SlashMenu,\n} from 'foldkit-richtext-dom/editor'\n\n/**\n * The entries this package offers: the editor's catalogue, each Message passed through\n * `wrap` — the seam the toolbar takes too, because the caller usually dispatches a\n * wrapper like `edited(...)`, which is a function.\n */\nexport const slashEntries = <Message>(\n wrap: (message: EditorEvent) => Message,\n): ReadonlyArray<SlashEntry<Message>> =>\n editorEntries.map(entry => ({ ...entry, message: wrap(entry.message) }))\n\n/**\n * The index an arrow — or Home, or End — moves the highlight to among the current\n * matches, or `undefined` when the key moves nothing. The rule is `foldkit-primitives`'\n * `RovingTabindex.move`, so the menu and any other list agree on ArrowUp/ArrowDown,\n * Home/End, wrapping, and on a modified key moving nothing; the menu adds only \"over the\n * entries the query currently matches\".\n *\n * It moves from what `slashMenu` highlights rather than from the caller's remembered\n * index, so a query that narrowed past it is not moved from a position the user cannot\n * see.\n */\nexport const slashMove = <Message>(\n entries: ReadonlyArray<SlashEntry<Message>>,\n textBefore: string,\n index: number,\n key: string,\n modifiers: KeyboardModifiers,\n): number | undefined => {\n const menu = slashMenu(entries, textBefore, index)\n if (menu === undefined || menu.matches.length === 0) return undefined\n const from = menu.highlighted === undefined ? -1 : menu.matches.indexOf(menu.highlighted)\n return RovingTabindex.move([...menu.matches.keys()], from, key, modifiers, {\n orientation: 'vertical',\n // A vertical menu never reads left or right, so the direction is not its business.\n direction: 'ltr',\n loop: true,\n })\n}\n","/**\n * The command palette (§124 §11, §68, §142): the slash menu's catalogue, searched from a field of\n * its own rather than typed into the document, drawn through slots like the rest of the chrome.\n *\n * It holds no state. Whether it is open, the query, and the highlighted index are the\n * caller's, as `{ query, index } | null` in its Model; the view filters with the slash menu's\n * `matchingEntries` and sends what the caller should store next. Choosing an entry sends the\n * entry's own Message, so a caller that closes the palette on a choice wraps its entries to\n * say so (`slashEntries(event => Message.Chose({ event }))`) — the palette cannot know which\n * of the caller's Messages it is.\n */\nimport { Option } from 'effect'\nimport type { Html, KeyboardModifiers } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport { RovingTabindex } from 'foldkit-primitives/interaction'\nimport { matchingEntries, type SlashEntry } from './slash.js'\n\n/** The elements the palette publishes: its wrapper, the search field, the list, and its options. */\nexport const CommandPaletteSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n input: Slot.make({ capability: Capability.TextInput }),\n list: Slot.make({ capability: Capability.Collection }),\n option: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface CommandPaletteInput<Message> {\n /** The element id the list and its options are named from; unique on the page. */\n readonly id: string\n /** `slashEntries(wrap)`, and whatever the application adds. */\n readonly entries: ReadonlyArray<SlashEntry<Message>>\n readonly query: string\n /** What the palette last highlighted among the matches. */\n readonly index: number\n /** What the field sends as the query changes or an arrow moves: the next query and index. */\n readonly changed: (query: string, index: number) => Message\n /** What Escape sends. */\n readonly closed: Message\n}\n\n/**\n * The palette as a slot view: a combobox field over a listbox of the matches. ArrowUp and\n * ArrowDown move the highlight, wrapping; Home and End stay the field's. Enter sends the\n * highlighted entry, and does nothing when no entry matches. A stale index — one the matches\n * do not hold — highlights the first match, as the slash menu does, so a query that narrows\n * never leaves Enter choosing nothing.\n */\nexport const commandPalette = <Message>(): SlotView.SlotView<\n typeof CommandPaletteSlots,\n CommandPaletteInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(CommandPaletteSlots, (input, slots, h): Html => {\n const matches = matchingEntries(input.entries, input.query)\n const current = matches[input.index] === undefined ? 0 : input.index\n const highlighted = matches[current]\n const list = `${input.id}-list`\n // Options have a prefix of their own, so an entry named `list` cannot take the list's id.\n const optionId = (entry: SlashEntry<Message>) => `${input.id}-option-${entry.id}`\n const keyed = (key: string, modifiers: KeyboardModifiers) => {\n if (key === 'Escape') return Option.some(input.closed)\n if (key === 'Enter') return Option.fromUndefinedOr(highlighted?.message)\n if (key !== 'ArrowUp' && key !== 'ArrowDown') return Option.none()\n const next = RovingTabindex.move([...matches.keys()], current, key, modifiers, {\n orientation: 'vertical',\n direction: 'ltr',\n loop: true,\n })\n return next === undefined ? Option.none() : Option.some(input.changed(input.query, next))\n }\n return h.div(slots.root.attrs([h.Role('dialog'), h.AriaLabel('Commands')]), [\n h.input(\n slots.input.attrs([\n h.Type('text'),\n h.Role('combobox'),\n h.AriaLabel('Search commands'),\n h.AriaExpanded(true),\n h.AriaControls(list),\n ...(highlighted === undefined ? [] : [h.AriaActiveDescendant(optionId(highlighted))]),\n h.Value(input.query),\n h.OnInput(query => input.changed(query, 0)),\n h.OnKeyDownPreventDefault(keyed),\n ]),\n ),\n h.ul(\n slots.list.attrs([h.Id(list), h.Role('listbox')]),\n matches.map((entry, index) =>\n h.li(\n slots.option.attrs(\n [\n h.Id(optionId(entry)),\n h.Role('option'),\n h.DataAttribute('entry', entry.id),\n h.AriaSelected(index === current),\n h.OnClick(entry.message),\n ],\n { index, id: entry.id, count: matches.length },\n ),\n [entry.label],\n ),\n ),\n ),\n ])\n })\n","/**\n * The editor's status line (§124 §11, §141): how long the document is, and what the application\n * found wrong with it, drawn through slots like the rest of the chrome.\n *\n * It sends nothing. The counts are `RichText.count`; the problems are whatever the caller\n * passes, usually `RichText.validate` against its Kit, which this view does not run, because\n * which Kit a document answers to is the application's.\n */\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\n\n/** The elements the status line publishes: its wrapper, the counts, and one item per problem. */\nexport const EditorStatusSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n counts: Slot.make({ capability: Capability.Base }),\n problems: Slot.make({ capability: Capability.Collection }),\n problem: Slot.make({ capability: Capability.Base }),\n})\n\nexport interface EditorStatusInput {\n readonly document: RichText.Document\n /** What the application found wrong with the document. None is shown when absent. */\n readonly diagnostics?: ReadonlyArray<RichText.Diagnostic> | undefined\n}\n\n// A caret move redraws the status without changing the document, so counts are kept per\n// document value; each edit makes a new one, and a dropped one is collected with its entry.\nconst counted = new WeakMap<RichText.Document, ReturnType<typeof RichText.count>>()\nconst countOf = (document: RichText.Document) => {\n const kept = counted.get(document)\n if (kept !== undefined) return kept\n const counts = RichText.count(document)\n counted.set(document, counts)\n return counts\n}\n\nconst plural = (count: number, one: string, many: string) => `${count} ${count === 1 ? one : many}`\n\n/**\n * The status line as a slot view. Each problem carries its code, and its node when it has\n * one, as data attributes, so a Style can mark a kind and a Behavior can find the block.\n */\nexport const editorStatus = <Message>(): SlotView.SlotView<\n typeof EditorStatusSlots,\n EditorStatusInput,\n Message\n> =>\n SlotView.forMessages<Message>().define(EditorStatusSlots, (input, slots, h): Html => {\n const { words, characters } = countOf(input.document)\n const problems = input.diagnostics ?? []\n return h.div(slots.root.attrs(), [\n h.p(slots.counts.attrs([h.DataAttribute('status', 'counts')]), [\n `${plural(words, 'word', 'words')} · ${plural(characters, 'character', 'characters')}`,\n ]),\n h.ul(\n slots.problems.attrs([h.DataAttribute('status', 'problems')]),\n problems.map((problem, index) =>\n h.li(\n slots.problem.attrs(\n [\n h.DataAttribute('code', problem.code),\n ...(problem.node === undefined ? [] : [h.DataAttribute('node', problem.node)]),\n ],\n {\n index,\n id: `${problem.code}:${problem.node ?? ''}:${index}`,\n count: problems.length,\n },\n ),\n [problem.message],\n ),\n ),\n ),\n ])\n })\n","/**\n * The Markdown source editor (§8, §137): the text of a source session, what switching back\n * would lose, and the way back — drawn through slots like the rest of the chrome.\n *\n * Source mode is the application's `SourceSession | null`: a session is open while it is set,\n * and the rich editor stands still meanwhile. This view edits the session's draft and reads\n * `closeSource` for its warnings, which is a pure read, so the list is exactly what closing\n * now would report. What leaving does — commit at once, or confirm first when there are\n * warnings — is the application's `update`.\n */\nimport { Effect, Queue, Schema, Stream } from 'effect'\nimport type { Html } from 'foldkit/html'\nimport * as Mount from 'foldkit/mount'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { renderDocument } from 'foldkit-richtext-dom/view'\nimport {\n closeSource,\n type ClosedSource,\n type MarkdownDiagnostic,\n type SourceSession,\n} from 'foldkit-richtext-markdown'\n\n/** The elements the editor publishes: its wrapper, the text, the warnings, and the way back. */\nexport const SourceEditorSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n text: Slot.make({ capability: Capability.TextInput }),\n warnings: Slot.make({ capability: Capability.Collection }),\n warning: Slot.make({ capability: Capability.Base }),\n done: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface SourceEditorInput<Message> {\n readonly session: SourceSession\n /** The document the session was opened on, which the application still holds. */\n readonly document: RichText.Document\n /** What the text area sends as the Markdown changes: the next draft. */\n readonly drafted: (draft: string) => Message\n /** What the text area sends as its caret moves: the session's next `caret` (§147). */\n readonly moved: (caret: number) => Message\n /** What the way back sends. */\n readonly done: Message\n}\n\n/**\n * Puts a text area's caret at `caret` and focuses it, then reports each place the caret moves\n * to, as the offset of its selection's focus, until released.\n */\nexport const followCaret = (\n field: HTMLTextAreaElement,\n caret: number,\n report: (caret: number) => void,\n): (() => void) => {\n field.focus()\n field.setSelectionRange(caret, caret)\n let last = caret\n const moved = () => {\n const at = field.selectionDirection === 'backward' ? field.selectionStart : field.selectionEnd\n if (at === last) return\n last = at\n report(at)\n }\n // A caret moves by typing, by keys, by the pointer, and by selecting; browsers that fire\n // `selectionchange` on the field itself cover all of these, and the rest are for the others.\n const events = ['selectionchange', 'select', 'input', 'keyup', 'mouseup'] as const\n for (const event of events) field.addEventListener(event, moved)\n return () => {\n for (const event of events) field.removeEventListener(event, moved)\n }\n}\n\nconst CaretMoved = Schema.TaggedStruct('CaretMoved', { caret: Schema.Number })\n\n/** `followCaret` as a Mount; its element is the source editor's text area. */\nconst sourceCaret = Mount.defineStream('RichTextSourceCaret', {\n args: { caret: Schema.Number },\n messages: [CaretMoved],\n execute: ({ element, caret }) =>\n Stream.callback<typeof CaretMoved.Type>(queue =>\n Effect.acquireRelease(\n Effect.sync(() =>\n element instanceof HTMLTextAreaElement\n ? followCaret(element, caret, at =>\n Queue.offerUnsafe(queue, CaretMoved.make({ caret: at })),\n )\n : () => {},\n ),\n release => Effect.sync(release),\n ),\n ),\n})\n\n/** The caret Mount lifted into the caller's Messages, as the text area carries it. */\nexport const caretMount = <Message>(\n caret: number,\n moved: (caret: number) => Message,\n): Mount.MountAction<Message> =>\n Mount.mapMessage(sourceCaret({ caret }), message => moved(message.caret))\n\n/** A warning as a sentence; its code and detail also ride on the element for a Style. */\nconst describe = (diagnostic: MarkdownDiagnostic): string =>\n diagnostic.code === 'UnsupportedMark'\n ? `${diagnostic.detail} formatting has no Markdown and will be lost`\n : diagnostic.code === 'UnsafeUrl'\n ? `An unsafe ${diagnostic.detail} address will be dropped`\n : `${diagnostic.detail} has no Markdown form here and will be lost`\n\n// A preview mints identities nobody keeps; they only have to be distinct within one parse.\nconst previewIds = () => {\n let next = 0\n return { mint: () => `preview-${next++}` }\n}\n\n/**\n * What closing the session now would give, as the view shows it: the warnings and the preview's\n * document. An unedited draft gives back the caller's document and warns of nothing, which is\n * `closeSource`'s rule, so it is answered without the parse `closeSource` spends placing the\n * caret. An edited draft's answer is parsed once per draft and kept: the cache is keyed by the\n * session's `unprintable` array, which stays the same object while the draft and caret are\n * replaced, so moving the caret does not parse again, and a closed session's entry is collected\n * with it.\n */\nconst parsed = new WeakMap<object, { readonly draft: string; readonly closed: ClosedSource }>()\nconst closedFor = (\n session: SourceSession,\n document: RichText.Document,\n): Pick<ClosedSource, 'document' | 'diagnostics'> => {\n if (session.draft === session.printed) return { document, diagnostics: [] }\n const kept = parsed.get(session.unprintable)\n if (kept?.draft === session.draft) return kept.closed\n const closed = closeSource(session, document, previewIds())\n parsed.set(session.unprintable, { draft: session.draft, closed })\n return closed\n}\n\n/**\n * The source editor as a slot view: a text area holding the draft, then — once the draft is\n * edited — one warning per thing switching back would lose or refuse, then the way back.\n */\nexport const sourceEditor = <Message>(): SlotView.SlotView<\n typeof SourceEditorSlots,\n SourceEditorInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(SourceEditorSlots, (input, slots, h): Html => {\n const warnings = closedFor(input.session, input.document).diagnostics\n return h.div(slots.root.attrs(), [\n h.textarea(\n // A slot's attributes are typed for every element, and Foldkit's textarea excludes\n // `InnerHTML`; the Form and Builder families narrow the same way (none is set here).\n slots.text.attrs([\n h.AriaLabel('Markdown source'),\n h.DataAttribute('source', 'text'),\n h.Value(input.session.draft),\n h.OnInput(input.drafted),\n // Read once, when the text area is drawn: the session's caret as it opened.\n h.OnMount(caretMount(input.session.caret, input.moved)),\n ]) as Parameters<typeof h.textarea>[0],\n ),\n h.ul(\n slots.warnings.attrs([h.DataAttribute('source', 'warnings')]),\n warnings.map((warning, index) =>\n h.li(\n slots.warning.attrs(\n [h.DataAttribute('code', warning.code), h.DataAttribute('detail', warning.detail)],\n { index, id: `${warning.code}:${warning.detail}:${index}`, count: warnings.length },\n ),\n [describe(warning)],\n ),\n ),\n ),\n h.button(\n slots.done.attrs([\n h.Type('button'),\n h.DataAttribute('source', 'done'),\n h.OnClick(input.done),\n ]),\n ['Rich text'],\n ),\n ])\n })\n\n/** The preview publishes one element: the rendered draft. */\nexport const SourcePreviewSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n})\n\nexport interface SourcePreviewInput {\n readonly session: SourceSession\n readonly document: RichText.Document\n /** How declared kinds and marks render, as in the rich editor. Defaults to `noRendering`. */\n readonly rendering?: RichText.Rendering | undefined\n}\n\n/**\n * The draft as the document it would become, for split mode: drawn beside `sourceEditor`, it\n * shows what switching back would commit. It is the read-only renderer's output, so it\n * dispatches nothing, and it shares the editor's parse of the draft.\n */\nexport const sourcePreview = <Message>(): SlotView.SlotView<\n typeof SourcePreviewSlots,\n SourcePreviewInput,\n Message\n> =>\n SlotView.forMessages<Message>().define(SourcePreviewSlots, (input, slots, h): Html =>\n h.div(slots.root.attrs([h.DataAttribute('source', 'preview'), h.AriaLabel('Preview')]), [\n renderDocument(\n closedFor(input.session, input.document).document,\n input.rendering ?? RichText.noRendering,\n ),\n ]),\n )\n","/**\n * The link editor (§124 §11, §132): an address field and the two things it can do, drawn\n * through slots like the toolbar and the slash menu.\n *\n * It holds no state. The link it edits is a read of the document (`RichText.linkAt`), the\n * address being typed is the caller's `draft`, and what it sends is an editor Message\n * wrapped for the caller — `AppliedMark` to link the selection or change the link around\n * the caret, `ClearedMark` to remove it — so the editor Bundle makes each one transition.\n * Where it appears, and when, is the caller's: only the caller knows where the caret is.\n */\nimport { Option } from 'effect'\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { Message as EditorMessage, type EditorEvent } from 'foldkit-richtext-dom/editor'\n\n/** The elements the editor publishes: its wrapper, the address field, and its two buttons. */\nexport const LinkEditorSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n input: Slot.make({ capability: Capability.TextInput }),\n apply: Slot.make({ capability: Capability.Interactive }),\n remove: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface LinkEditorInput<Message> {\n readonly document: RichText.Document\n readonly selection: RichText.Selection | null\n /** The address as typed so far; `RichText.linkAt(...)?.href` is what to start it from. */\n readonly draft: string\n /** What the field sends as the address changes. */\n readonly drafted: (href: string) => Message\n /** An editor Message as this caller's, usually its `edited(...)` wrapper. */\n readonly wrap: (message: EditorEvent) => Message\n /** What Escape in the field sends: usually closing the editor. Without it, Escape does nothing. */\n readonly closed?: Message | undefined\n /**\n * What Enter in the field sends, for the caller's `update` to apply `linkEdit` to its own\n * draft. Without it, Enter sends the edit the view last drew, which is a frame behind keys\n * typed fast: Enter right after the last character would apply the draft before it.\n */\n readonly submitted?: Message | undefined\n}\n\n/**\n * The edit applying a draft makes: the selection linked, or the link around the caret changed, to\n * `RichText.safeUrl(draft)`. None when the policy refuses the address, or when there is neither\n * a range nor a caret inside a link to put it on. The view's button sends it; a caller handling\n * `submitted` sends it from its own draft.\n */\nexport const linkEdit = (\n document: RichText.Document,\n selection: RichText.Selection | null,\n draft: string,\n): Option.Option<EditorEvent> => {\n const href = RichText.safeUrl(draft)\n if (href === undefined) return Option.none()\n if (RichText.linkAt(document, selection) === undefined && !RichText.coversText(selection)) {\n return Option.none()\n }\n return Option.some(EditorMessage.AppliedMark({ mark: { name: 'Link', props: { href } } }))\n}\n\n/**\n * The link editor as a slot view. Applying needs an address the URL policy accepts\n * (`RichText.safeUrl`), which is what it sends, and something to link: a range, or a caret\n * inside a link. Otherwise the apply button is disabled and Enter in the field does nothing.\n * The remove button is drawn only inside a link. Escape in the field sends `closed`.\n */\nexport const linkEditor = <Message>(): SlotView.SlotView<\n typeof LinkEditorSlots,\n LinkEditorInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(LinkEditorSlots, (input, slots, h): Html => {\n const link = RichText.linkAt(input.document, input.selection)\n const apply = Option.getOrUndefined(\n Option.map(linkEdit(input.document, input.selection, input.draft), input.wrap),\n )\n return h.div(slots.root.attrs([h.Role('group'), h.AriaLabel('Link')]), [\n h.input(\n slots.input.attrs([\n h.Type('url'),\n h.DataAttribute('link', 'address'),\n h.AriaLabel('Link address'),\n h.Placeholder('Paste or type a link'),\n h.Value(input.draft),\n h.OnInput(input.drafted),\n h.OnKeyDownPreventDefault(key => {\n if (key === 'Escape' && input.closed !== undefined) return Option.some(input.closed)\n if (key !== 'Enter') return Option.none()\n if (input.submitted !== undefined) return Option.some(input.submitted)\n return apply === undefined ? Option.none() : Option.some(apply)\n }),\n ]),\n ),\n h.button(\n slots.apply.attrs([\n h.Type('button'),\n h.DataAttribute('link', 'apply'),\n h.Disabled(apply === undefined),\n ...(apply === undefined ? [] : [h.OnClick(apply)]),\n ]),\n [link === undefined ? 'Apply' : 'Update'],\n ),\n ...(link === undefined\n ? []\n : [\n h.button(\n slots.remove.attrs([\n h.Type('button'),\n h.DataAttribute('link', 'remove'),\n h.OnClick(input.wrap(EditorMessage.ClearedMark({ mark: 'Link' }))),\n ]),\n ['Remove'],\n ),\n ]),\n ])\n })\n","/**\n * The slash menu's view (§119, §123): what a caret in a query shows. It is a\n * `SlotView`, so every element it makes is a slot an application styles or extends,\n * exactly as the mark toolbar's are.\n *\n * The list is a value, not state. `slashMenu` decides what matches and what is\n * highlighted, `slashMove` moves the highlight from the caller's keys, and this renders\n * the answer — so the view keeps no Model of its own and the two places that must agree,\n * the render and the `update` that resolves Enter, read the same functions.\n *\n * Outside a query the view renders an empty list; the caller places it only when\n * `slashMenu` says there is a menu, because only the caller knows where the caret is.\n */\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport { isRichTextIcon, richTextIcon } from './icons.js'\nimport { slashMenu, type SlashEntry } from './slash.js'\n\n/**\n * The elements the menu publishes: its wrapper, its list, a heading over each group, one item per\n * match with its icon, label and description, and what shows when nothing matches.\n */\nexport const SlashMenuSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n list: Slot.make({ capability: Capability.Collection }),\n heading: Slot.make({ capability: Capability.Container }),\n item: Slot.make({ capability: Capability.Interactive }),\n icon: Slot.make({ capability: Capability.Container }),\n label: Slot.make({ capability: Capability.Container }),\n description: Slot.make({ capability: Capability.Container }),\n empty: Slot.make({ capability: Capability.Container }),\n})\n\nexport interface SlashMenuInput<Message> {\n /** `slashEntries` for this package's catalogue, or an application's own. */\n readonly entries: ReadonlyArray<SlashEntry<Message>>\n /** The caret's block text before it: `RichText.textBefore(document, position)`. */\n readonly textBefore: string\n /** What the menu last highlighted; `slashMove` is what moves it. */\n readonly index: number\n}\n\nexport const slashMenuView = <Message>(): SlotView.SlotView<\n typeof SlashMenuSlots,\n SlashMenuInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(SlashMenuSlots, (input, slots, h): Html => {\n const menu = slashMenu(input.entries, input.textBefore, input.index)\n const matches = menu?.matches ?? []\n const highlighted = matches.findIndex(entry => entry === menu?.highlighted)\n // Groups head the whole catalogue; a query lists the best matches first, ungrouped.\n const headed = menu?.query === ''\n const item = (entry: SlashEntry<Message>, index: number): Html =>\n h.button(\n slots.item.attrs(\n [\n h.Type('button'),\n h.Role('menuitem'),\n h.DataAttribute('entry', entry.id),\n h.AriaCurrent(index === highlighted ? 'true' : 'false'),\n h.OnClick(entry.message),\n ],\n { index, id: entry.id, count: matches.length },\n ),\n [\n ...(entry.icon !== undefined && isRichTextIcon(entry.icon)\n ? [h.span(slots.icon.attrs(), [richTextIcon(h, entry.icon)])]\n : []),\n h.span(slots.label.attrs(), [entry.label]),\n ...(entry.description === undefined\n ? []\n : [h.span(slots.description.attrs(), [entry.description])]),\n ],\n )\n const rows = matches.flatMap((entry, index) =>\n headed && entry.group !== undefined && entry.group !== matches[index - 1]?.group\n ? [h.div(slots.heading.attrs([h.Role('presentation')]), [entry.group]), item(entry, index)]\n : [item(entry, index)],\n )\n return h.div(slots.root.attrs(), [\n matches.length === 0\n ? h.p(slots.empty.attrs(), ['No matches'])\n : h.div(slots.list.attrs([h.Role('menu'), h.AriaLabel('Insert')]), rows),\n ])\n })\n","/**\n * The table of contents: the document's headings as links, drawn through slots. It is a read of\n * the document (`RichText.outlineOf`) and holds no state; choosing a heading is the caller's\n * Message, since moving the caret there and scrolling to it are the caller's to do.\n */\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\n\n/**\n * The elements the contents publish: the `nav`, its list, and one entry per heading. An entry\n * carries its depth as `--fk-toc-level` (1 for the shallowest level the document uses) and\n * `aria-current=\"location\"` for the section the selection is in.\n */\nexport const TableOfContentsSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n list: Slot.make({ capability: Capability.Container }),\n entry: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface TableOfContentsInput<Message> {\n readonly document: RichText.Document\n /** Where the caret is, whose section is marked current. */\n readonly selection: RichText.Selection | null\n /** A heading was chosen. */\n readonly chosen: (node: RichText.NodeId) => Message\n}\n\n/** The contents as a slot view; nothing is drawn for a document with no headings. */\nexport const tableOfContents = <Message>(): SlotView.SlotView<\n typeof TableOfContentsSlots,\n TableOfContentsInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(TableOfContentsSlots, (input, slots, h): Html => {\n const entries = RichText.outlineOf(input.document)\n if (entries.length === 0) return h.empty\n const top = Math.min(...entries.map(entry => entry.level))\n const current = RichText.sectionAt(input.document, input.selection)\n return h.nav(slots.root.attrs([h.AriaLabel('Contents')]), [\n h.ul(\n slots.list.attrs(),\n entries.map(entry =>\n h.li(\n [h.Key(entry.node)],\n [\n h.button(\n slots.entry.attrs([\n h.Type('button'),\n h.Style({ '--fk-toc-level': String(entry.level - top + 1) }),\n ...(entry.node === current ? [h.AriaCurrent('location')] : []),\n h.OnClick(input.chosen(entry.node)),\n ]),\n [entry.text],\n ),\n ],\n ),\n ),\n ),\n ])\n })\n","/**\n * The footnote preview: the note a reference at the caret points to, a way to go to it, and its\n * label to rename, drawn through slots. It holds no state: which footnote is a read of the\n * document (`RichText.footnoteAt`), renaming is the editor's own `RenamedFootnote`, and going to\n * the note is the caller's Message, since moving the focus there is a Command the caller runs.\n */\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { Message as EditorMessage, type EditorEvent } from 'foldkit-richtext-dom/editor'\n\n/** The elements the preview publishes: its card, the label field, the note's text, and the button. */\nexport const FootnotePreviewSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n label: Slot.make({ capability: Capability.TextInput }),\n text: Slot.make({ capability: Capability.Container }),\n button: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface FootnotePreviewInput<Message> {\n readonly document: RichText.Document\n readonly selection: RichText.Selection | null\n /** Go to the note: the caller puts the caret at the definition's start (`focus`). */\n readonly opened: (definition: RichText.NodeId) => Message\n /** An editor Message as this caller's, usually its `edited(...)` wrapper. */\n readonly wrap: (message: EditorEvent) => Message\n}\n\n/**\n * The preview as a slot view, drawn while the caret is in a footnote reference and nothing\n * otherwise. The label field renames the footnote when it changes (`RenamedFootnote`, which the\n * editor refuses for a label in use). A note with no text reads \"No note yet\"; with no definition\n * at all, Go to note is disabled.\n */\nexport const footnotePreview = <Message>(): SlotView.SlotView<\n typeof FootnotePreviewSlots,\n FootnotePreviewInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(FootnotePreviewSlots, (input, slots, h): Html => {\n const label = RichText.footnoteAt(input.document, input.selection)\n if (label === undefined) return h.empty\n const note = RichText.footnotesOf(input.document).find(each => each.label === label)\n const definition = note?.definition\n return h.div(slots.root.attrs([h.Role('group'), h.AriaLabel(`Footnote ${label}`)]), [\n h.input(\n slots.label.attrs([\n h.Type('text'),\n h.AriaLabel('Footnote label'),\n h.Value(label),\n h.OnChange(to => input.wrap(EditorMessage.RenamedFootnote({ from: label, to }))),\n ]),\n ),\n h.p(slots.text.attrs(), [note === undefined || note.text === '' ? 'No note yet' : note.text]),\n h.button(\n slots.button.attrs([\n h.Type('button'),\n h.Disabled(definition === undefined),\n ...(definition === undefined ? [] : [h.OnClick(input.opened(definition))]),\n ]),\n ['Go to note'],\n ),\n ])\n })\n","/**\n * `foldkit-mixins-richtext` — the editor's chrome, drawn through slots (§35, §120).\n *\n * The editor's Bundle renders one host element and nothing else (§29); the marks\n * toolbar beside it is the application's chrome. This package draws that chrome as\n * a SlotView, so every element it makes is a slot an application styles or extends\n * the way it does any other view. It cannot wrap `marksToolbar`: a slot's\n * contributions resolve at the element the view creates (§120). The two share\n * `markActive` instead.\n */\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { markActive, type ToolbarState } from 'foldkit-richtext-dom/toolbar'\n\n/** The elements the toolbar publishes: its wrapper, its row, and one button per mark. */\nexport const MarkToolbarSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n toolbar: Slot.make({ capability: Capability.Collection }),\n button: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface MarkToolbarInput<Message> {\n /** What the editor projects: `document`, `selection`, and the caret's format. */\n readonly state: ToolbarState\n /** The marks to offer, by name. Defaults to the three `foldkit-richtext` ships. */\n readonly marks?: ReadonlyArray<string> | undefined\n /**\n * A mark to the Message that toggles it for this caller. The editor's\n * `Message.ToggledMark` is data, but a caller usually dispatches its wrapper\n * (`edited(...)`), which is a function — and a plain SlotView holds one.\n */\n readonly toggled: (mark: string) => Message\n}\n\n/**\n * The mark toolbar as a slot view. A Style or Behavior attaches to\n * `MarkToolbarSlots`; each button renders with its mark as the slot item's `id`, so\n * a Behavior can single one out.\n */\nexport const markToolbar = <Message>(): SlotView.SlotView<\n typeof MarkToolbarSlots,\n MarkToolbarInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(MarkToolbarSlots, (input, slots, h) => {\n const marks = input.marks ?? RichText.shippedMarks.map(definition => definition.name)\n return h.div(slots.root.attrs(), [\n h.div(\n slots.toolbar.attrs([h.Role('toolbar')]),\n marks.map((mark, index) =>\n h.button(\n slots.button.attrs(\n [\n h.Type('button'),\n h.DataAttribute('mark', mark),\n h.AriaLabel(mark),\n h.AriaPressed(markActive(input.state, mark) ? 'true' : 'false'),\n h.OnClick(input.toggled(mark)),\n ],\n { index, id: mark, count: marks.length },\n ),\n [mark],\n ),\n ),\n ),\n ])\n })\n\n/** The block style picker's view and its slots (§134). */\nexport {\n BlockStyleMenuSlots,\n BlockStyleSlots,\n blockStyleMenu,\n blockStyles,\n type BlockStyleInput,\n type BlockStyleMenuInput,\n} from './style.js'\n\n/** The find and replace bar's view and its slots. */\nexport { FindReplaceSlots, findReplace, stepMatch, type FindReplaceInput } from './find.js'\n\n/** The table toolbar's view and its slots: rows and columns around the caret's cell. */\nexport { TableToolbarSlots, tableToolbar, type TableToolbarInput } from './table.js'\n\n/** The code block toolbar's view and its slots: its language and Copy. */\nexport { CodeToolbarSlots, codeToolbar, type CodeLanguage, type CodeToolbarInput } from './code.js'\n\n/** The block handle's view and its slots (§144). */\nexport { BlockHandleSlots, blockHandle, type BlockHandleInput } from './handle.js'\n\n/** The command palette's view and its slots (§142). */\nexport { CommandPaletteSlots, commandPalette, type CommandPaletteInput } from './palette.js'\n\n/** The status line's view and its slots (§141). */\nexport { EditorStatusSlots, editorStatus, type EditorStatusInput } from './status.js'\n\n/** The Markdown source editor's view and its slots (§137). */\nexport {\n SourceEditorSlots,\n SourcePreviewSlots,\n sourceEditor,\n sourcePreview,\n type SourceEditorInput,\n type SourcePreviewInput,\n} from './source.js'\n\n/** The link editor's view and its slots (§132). */\nexport { LinkEditorSlots, linkEdit, linkEditor, type LinkEditorInput } from './link.js'\n\n/** The menu's view and its slots (§123), beside the vocabulary it renders. */\nexport { SlashMenuSlots, slashMenuView, type SlashMenuInput } from './menu.js'\n\n/**\n * The slash menu's vocabulary (§123) travels with the chrome it belongs to, so an\n * application importing the family gets the entries and the query rule too.\n */\nexport {\n matchingEntries,\n slashEntries,\n slashMenu,\n slashMove,\n slashQuery,\n type SlashEntry,\n type SlashMenu,\n} from './slash.js'\n/** The chrome's icons, after Lucide: as inline SVG, or as a CSS `url(…)` to mask. */\nexport { isRichTextIcon, richTextIcon, richTextIconUrl, type RichTextIconName } from './icons.js'\n/** The table of contents, from the document's headings, and its slots. */\nexport { TableOfContentsSlots, tableOfContents, type TableOfContentsInput } from './contents.js'\n/** The footnote preview at a reference, and its slots. */\nexport { FootnotePreviewSlots, footnotePreview, type FootnotePreviewInput } from './footnote.js'\n"],"mappings":";;;;;;;;;;;AAoDA,MAAa,QAAmD;CAC9D,WAAW;EACT,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,aAAa;EACX,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,aAAa;EACX,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,aAAa;EACX,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,OAAO;EACL,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,iBAAiB;EACf,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,iBAAiB;EACf,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,WAAW;EACT,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,cAAc;EACZ,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,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OAAO;EAC9D,EAAE,QAAQ,MAAM,QAAQ,IAAI,CAAC;CAC/B,GACA;EAAE;EAAO,IAAI;EAAM,OAAO,MAAM;CAAO,CACzC,GACA,CAAC,IAAI,CACP,CACF,CACF,CACF,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":["slashEntries","EditorMessage","EditorMessage","EditorMessage","EditorMessage","editorEntries","slashMenu","EditorMessage","EditorMessage"],"sources":["../src/iconData.ts","../src/icons.ts","../src/style.ts","../src/find.ts","../src/table.ts","../src/code.ts","../src/handle.ts","../src/slash.ts","../src/palette.ts","../src/status.ts","../src/source.ts","../src/link.ts","../src/menu.ts","../src/contents.ts","../src/footnote.ts","../src/index.ts"],"sourcesContent":["// Written by `pnpm icons` from icons.json. Do not edit.\n// Lucide (ISC, Lucide Contributors): @iconify-json/lucide 1.2.147, https://github.com/lucide-icons/lucide/blob/main/LICENSE\nimport type { IconData } from 'foldkit-media'\n\nexport type IconName =\n | 'paragraph'\n | 'heading-1'\n | 'heading-2'\n | 'heading-3'\n | 'quote'\n | 'bulleted-list'\n | 'numbered-list'\n | 'checklist'\n | 'code-block'\n | 'bold'\n | 'italic'\n | 'underline'\n | 'strikethrough'\n | 'code'\n | 'highlight'\n | 'kbd'\n | 'link'\n | 'comment'\n | 'table'\n | 'image'\n | 'video'\n | 'audio'\n | 'file'\n | 'callout'\n | 'toggle'\n | 'divider'\n | 'footnote'\n | 'undo'\n | 'redo'\n | 'search'\n | 'replace'\n | 'match-case'\n | 'download'\n | 'copy'\n | 'trash'\n | 'plus'\n | 'more'\n | 'grip'\n | 'close'\n | 'check'\n | 'chevron-down'\n | 'chevron-up'\n | 'chevron-right'\n | 'back'\n | 'contents'\n | 'reset'\n\nexport const icons: { readonly [Name in IconName]: IconData } = {\n paragraph: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M13 4v16m4-16v16m2-16H9.5a4.5 4.5 0 0 0 0 9H13',\n },\n children: [],\n },\n ],\n },\n 'heading-1': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M4 12h8m-8 6V6m8 12V6m5 6l3-2v8',\n },\n children: [],\n },\n ],\n },\n 'heading-2': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M4 12h8m-8 6V6m8 12V6m9 12h-4c0-4 4-3 4-6c0-1.5-2-2.5-4-1',\n },\n children: [],\n },\n ],\n },\n 'heading-3': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M4 12h8m-8 6V6m8 12V6m5.5 4.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2m-2 3.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2',\n },\n children: [],\n },\n ],\n },\n quote: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M17 5H3m18 7H8m13 7H8m-5-7v7',\n },\n children: [],\n },\n ],\n },\n 'bulleted-list': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M3 5h.01M3 12h.01M3 19h.01M8 5h13M8 12h13M8 19h13',\n },\n children: [],\n },\n ],\n },\n 'numbered-list': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M11 5h10m-10 7h10m-10 7h10M4 4h1v5M4 9h2m.5 11H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02',\n },\n children: [],\n },\n ],\n },\n checklist: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M13 5h8m-8 7h8m-8 7h8M3 17l2 2l4-4M3 7l2 2l4-4',\n },\n children: [],\n },\n ],\n },\n 'code-block': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'path', attributes: { d: 'm10 9l-3 3l3 3m4 0l3-3l-3-3' }, children: [] },\n {\n tag: 'rect',\n attributes: { width: '18', height: '18', x: '3', y: '3', rx: '2' },\n children: [],\n },\n ],\n },\n ],\n },\n bold: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8',\n },\n children: [],\n },\n ],\n },\n italic: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M19 4h-9m4 16H5M15 4L9 20',\n },\n children: [],\n },\n ],\n },\n underline: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M6 4v6a6 6 0 0 0 12 0V4M4 20h16',\n },\n children: [],\n },\n ],\n },\n strikethrough: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M16 4H9a3 3 0 0 0-2.83 4M14 12a4 4 0 0 1 0 8H6m-2-8h16',\n },\n children: [],\n },\n ],\n },\n code: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'm16 18l6-6l-6-6M8 6l-6 6l6 6',\n },\n children: [],\n },\n ],\n },\n highlight: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'path', attributes: { d: 'm9 11l-6 6v3h9l3-3' }, children: [] },\n {\n tag: 'path',\n attributes: { d: 'm22 12l-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4' },\n children: [],\n },\n ],\n },\n ],\n },\n kbd: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: {\n d: 'M10 8h.01M12 12h.01M14 8h.01M16 12h.01M18 8h.01M6 8h.01M7 16h10m-9-4h.01',\n },\n children: [],\n },\n {\n tag: 'rect',\n attributes: { width: '20', height: '16', x: '2', y: '4', rx: '2' },\n children: [],\n },\n ],\n },\n ],\n },\n link: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: { d: 'M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71' },\n children: [],\n },\n {\n tag: 'path',\n attributes: { d: 'M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71' },\n children: [],\n },\n ],\n },\n ],\n },\n comment: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z',\n },\n children: [],\n },\n ],\n },\n table: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'path', attributes: { d: 'M12 3v18' }, children: [] },\n {\n tag: 'rect',\n attributes: { width: '18', height: '18', x: '3', y: '3', rx: '2' },\n children: [],\n },\n { tag: 'path', attributes: { d: 'M3 9h18M3 15h18' }, children: [] },\n ],\n },\n ],\n },\n image: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'rect',\n attributes: { width: '18', height: '18', x: '3', y: '3', rx: '2', ry: '2' },\n children: [],\n },\n { tag: 'circle', attributes: { cx: '9', cy: '9', r: '2' }, children: [] },\n {\n tag: 'path',\n attributes: { d: 'm21 15l-3.086-3.086a2 2 0 0 0-2.828 0L6 21' },\n children: [],\n },\n ],\n },\n ],\n },\n video: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: {\n d: 'm16 13l5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5',\n },\n children: [],\n },\n {\n tag: 'rect',\n attributes: { width: '14', height: '12', x: '2', y: '6', rx: '2' },\n children: [],\n },\n ],\n },\n ],\n },\n audio: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'path', attributes: { d: 'M9 18V5l12-2v13' }, children: [] },\n { tag: 'circle', attributes: { cx: '6', cy: '18', r: '3' }, children: [] },\n { tag: 'circle', attributes: { cx: '18', cy: '16', r: '3' }, children: [] },\n ],\n },\n ],\n },\n file: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'm16 6l-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551',\n },\n children: [],\n },\n ],\n },\n callout: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M15 14c.2-1 .7-1.7 1.5-2.5c1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5c.7.7 1.3 1.5 1.5 2.5m0 4h6m-5 4h4',\n },\n children: [],\n },\n ],\n },\n toggle: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M10 5h11m-11 7h11m-11 7h11M3 10l3-3l-3-3m0 16l3-3l-3-3',\n },\n children: [],\n },\n ],\n },\n divider: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M5 12h14',\n },\n children: [],\n },\n ],\n },\n footnote: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'm4 19l8-8m0 8l-8-8m16 1h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06',\n },\n children: [],\n },\n ],\n },\n undo: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'path', attributes: { d: 'M3 7v6h6' }, children: [] },\n {\n tag: 'path',\n attributes: { d: 'M21 17a9 9 0 0 0-9-9a9 9 0 0 0-6 2.3L3 13' },\n children: [],\n },\n ],\n },\n ],\n },\n redo: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'path', attributes: { d: 'M21 7v6h-6' }, children: [] },\n {\n tag: 'path',\n attributes: { d: 'M3 17a9 9 0 0 1 9-9a9 9 0 0 1 6 2.3l3 2.7' },\n children: [],\n },\n ],\n },\n ],\n },\n search: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'path', attributes: { d: 'm21 21l-4.34-4.34' }, children: [] },\n { tag: 'circle', attributes: { cx: '11', cy: '11', r: '8' }, children: [] },\n ],\n },\n ],\n },\n replace: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: {\n d: 'M14 4a1 1 0 0 1 1-1m0 7a1 1 0 0 1-1-1m7-5a1 1 0 0 0-1-1m1 6a1 1 0 0 1-1 1M3 7l3 3l3-3',\n },\n children: [],\n },\n { tag: 'path', attributes: { d: 'M6 10V5a2 2 0 0 1 2-2h2' }, children: [] },\n {\n tag: 'rect',\n attributes: { width: '7', height: '7', x: '3', y: '14', rx: '1' },\n children: [],\n },\n ],\n },\n ],\n },\n 'match-case': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: { d: 'm2 16l4.039-9.69a.5.5 0 0 1 .923 0L11 16m11-7v7M3.304 13h6.392' },\n children: [],\n },\n { tag: 'circle', attributes: { cx: '18.5', cy: '12.5', r: '3.5' }, children: [] },\n ],\n },\n ],\n },\n download: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: { d: 'M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' },\n children: [],\n },\n { tag: 'path', attributes: { d: 'm7 10l5 5l5-5' }, children: [] },\n ],\n },\n ],\n },\n copy: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'rect',\n attributes: { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2' },\n children: [],\n },\n {\n tag: 'path',\n attributes: { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2' },\n children: [],\n },\n ],\n },\n ],\n },\n trash: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2',\n },\n children: [],\n },\n ],\n },\n plus: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M5 12h14m-7-7v14',\n },\n children: [],\n },\n ],\n },\n more: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'circle', attributes: { cx: '12', cy: '12', r: '1' }, children: [] },\n { tag: 'circle', attributes: { cx: '19', cy: '12', r: '1' }, children: [] },\n { tag: 'circle', attributes: { cx: '5', cy: '12', r: '1' }, children: [] },\n ],\n },\n ],\n },\n grip: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n { tag: 'circle', attributes: { cx: '9', cy: '12', r: '1' }, children: [] },\n { tag: 'circle', attributes: { cx: '9', cy: '5', r: '1' }, children: [] },\n { tag: 'circle', attributes: { cx: '9', cy: '19', r: '1' }, children: [] },\n { tag: 'circle', attributes: { cx: '15', cy: '12', r: '1' }, children: [] },\n { tag: 'circle', attributes: { cx: '15', cy: '5', r: '1' }, children: [] },\n { tag: 'circle', attributes: { cx: '15', cy: '19', r: '1' }, children: [] },\n ],\n },\n ],\n },\n close: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M18 6L6 18M6 6l12 12',\n },\n children: [],\n },\n ],\n },\n check: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'M20 6L9 17l-5-5',\n },\n children: [],\n },\n ],\n },\n 'chevron-down': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'm6 9l6 6l6-6',\n },\n children: [],\n },\n ],\n },\n 'chevron-up': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'm18 15l-6-6l-6 6',\n },\n children: [],\n },\n ],\n },\n 'chevron-right': {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'm9 18l6-6l-6-6',\n },\n children: [],\n },\n ],\n },\n back: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'path',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n d: 'm12 19l-7-7l7-7m7 7H5',\n },\n children: [],\n },\n ],\n },\n contents: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: { d: 'M8 5h13m-8 7h8m-8 7h8M3 10a2 2 0 0 0 2 2h3' },\n children: [],\n },\n { tag: 'path', attributes: { d: 'M3 5v12a2 2 0 0 0 2 2h3' }, children: [] },\n ],\n },\n ],\n },\n reset: {\n viewBox: '0 0 24 24',\n attributes: {},\n nodes: [\n {\n tag: 'g',\n attributes: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': '2',\n },\n children: [\n {\n tag: 'path',\n attributes: { d: 'M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8' },\n children: [],\n },\n { tag: 'path', attributes: { d: 'M3 3v5h5' }, children: [] },\n ],\n },\n ],\n },\n}\n","/**\n * The rich text chrome's icons: line drawings on a 24-unit grid, stroked in the text's color, so\n * every toolbar, menu and card draws from one set. Decorative: each is hidden from assistive\n * technology, and the control it sits in carries the name that is read.\n *\n * The drawings are Lucide's (https://lucide.dev), generated into `iconData.ts` by `pnpm icons`\n * from `icons.json`, under its ISC license:\n *\n * ISC License. Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of\n * Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.\n * Permission to use, copy, modify, and/or distribute this software for any purpose with or\n * without fee is hereby granted, provided that the above copyright notice and this permission\n * notice appear in all copies. THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL\n * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR\n * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\n * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN\n * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\nimport { Icon } from 'foldkit-media'\nimport type { Html, HtmlBuilder } from 'foldkit/html'\nimport { icons, type IconName } from './iconData.js'\n\n/** The names of the drawings in the set. */\nexport type RichTextIconName = IconName\n\n/** Whether a name, such as a slash entry's id, has a drawing in the set. */\nexport const isRichTextIcon = (name: string): name is RichTextIconName => Object.hasOwn(icons, name)\n\n/** An icon as inline SVG, `size` CSS pixels square, in the text's color. */\nexport const richTextIcon = <Message>(\n h: HtmlBuilder<Message>,\n name: RichTextIconName,\n { size = 16 }: { readonly size?: number } = {},\n): Html => Icon.draw(icons[name], h, { size: `${size}px` })\n\n/**\n * An icon as a CSS `url(…)`, for markup that cannot hold an element of its own, such as a\n * rendering's adornment: a stylesheet masks it over the text's color.\n */\nexport const richTextIconUrl = (name: RichTextIconName): string => Icon.maskUrl(icons[name])\n","/**\n * The block style picker (§124 §11, §134): a button per text style the caret's block can take —\n * a paragraph, or a heading — drawn through slots like the mark toolbar.\n *\n * The styles are the slash menu's retype entries, so the two offer the same list under the\n * same labels. Which one is pressed is a read of the document (`RichText.textBlockAt`); what a\n * button sends is its entry's `RetypedBlock`, wrapped for the caller. Lists and quotes are not\n * styles here: leaving one is a lift, not a retype, so a picker that listed them would send a\n * Message that does not undo what it shows. A code block is not a style either, but a retype\n * leaves one (given a vocabulary that says it holds text), so the buttons stay live inside it.\n */\nimport { Equal } from 'effect'\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { slashEntries, type EditorEvent, type SlashEntry } from 'foldkit-richtext-dom/editor'\nimport { isRichTextIcon, richTextIcon } from './icons.js'\n\ntype Retype = Extract<EditorEvent, { readonly _tag: 'RetypedBlock' }>\n\nconst styles = slashEntries.filter(\n (entry): entry is SlashEntry<Retype> => entry.message._tag === 'RetypedBlock',\n)\n\n/** The elements the picker publishes: its wrapper, its row, and one button per style. */\nexport const BlockStyleSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n toolbar: Slot.make({ capability: Capability.Collection }),\n button: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface BlockStyleInput<Message> {\n readonly document: RichText.Document\n readonly selection: RichText.Selection | null\n /** An editor Message as this caller's, usually its `edited(...)` wrapper. */\n readonly wrap: (message: EditorEvent) => Message\n}\n\n/**\n * The block style picker as a slot view. The button for the style the selection's block has\n * is pressed; none is in a code block, or at a heading level the list does not offer. Every\n * button is disabled without a text selection — a node selection, or none — because a retype\n * there is refused.\n */\nexport const blockStyles = <Message>(): SlotView.SlotView<\n typeof BlockStyleSlots,\n BlockStyleInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(BlockStyleSlots, (input, slots, h): Html => {\n const current = RichText.textBlockAt(input.document, input.selection)\n const live = input.selection?.type === 'Range'\n return h.div(slots.root.attrs(), [\n h.div(\n slots.toolbar.attrs([h.Role('toolbar'), h.AriaLabel('Text style')]),\n styles.map((style, index) =>\n h.button(\n slots.button.attrs(\n [\n h.Type('button'),\n h.DataAttribute('style', style.id),\n h.AriaPressed(\n current !== undefined && Equal.equals(style.message.block, current)\n ? 'true'\n : 'false',\n ),\n h.Disabled(!live),\n ...(live ? [h.OnClick(input.wrap(style.message))] : []),\n ],\n { index, id: style.id, count: styles.length },\n ),\n [style.label],\n ),\n ),\n ),\n ])\n })\n\n/**\n * The elements the style menu publishes: its wrapper, the trigger that names the current style,\n * the menu, and one item per style with its icon, label and the check on the current one.\n */\nexport const BlockStyleMenuSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n trigger: Slot.make({ capability: Capability.Interactive }),\n menu: Slot.make({ capability: Capability.Collection }),\n item: Slot.make({ capability: Capability.Interactive }),\n icon: Slot.make({ capability: Capability.Container }),\n label: Slot.make({ capability: Capability.Container }),\n check: Slot.make({ capability: Capability.Container }),\n})\n\nexport interface BlockStyleMenuInput<Message> extends BlockStyleInput<Message> {\n /** Whether the menu is open: the caller's, as every menu's is. */\n readonly open: boolean\n /** The trigger's Message, which opens the menu or closes it. */\n readonly toggled: Message\n}\n\n/**\n * The same styles as `blockStyles`, in the space of one button: the trigger names the style the\n * selection's block has (\"Text style\" where none applies, as in a code block) and opens a menu of\n * every style, the current one checked. Choosing one sends its `RetypedBlock` through `wrap`, which\n * is where a caller also closes the menu. The trigger is disabled without a text selection.\n */\nexport const blockStyleMenu = <Message>(): SlotView.SlotView<\n typeof BlockStyleMenuSlots,\n BlockStyleMenuInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(BlockStyleMenuSlots, (input, slots, h): Html => {\n const current = RichText.textBlockAt(input.document, input.selection)\n const live = input.selection?.type === 'Range'\n const chosen = styles.find(\n style => current !== undefined && Equal.equals(style.message.block, current),\n )\n const icon = (name: string | undefined) =>\n name !== undefined && isRichTextIcon(name)\n ? [h.span(slots.icon.attrs(), [richTextIcon(h, name)])]\n : []\n return h.div(slots.root.attrs(), [\n h.button(\n slots.trigger.attrs([\n h.Type('button'),\n h.AriaHasPopup('menu'),\n h.AriaExpanded(input.open && live),\n h.AriaLabel(`Text style: ${chosen?.label ?? 'none'}`),\n h.Disabled(!live),\n ...(live ? [h.OnClick(input.toggled)] : []),\n ]),\n [\n ...icon(chosen?.icon),\n h.span(slots.label.attrs(), [chosen?.label ?? 'Text style']),\n richTextIcon(h, 'chevron-down', { size: 14 }),\n ],\n ),\n ...(input.open && live\n ? [\n h.div(\n slots.menu.attrs([h.Role('menu'), h.AriaLabel('Text style')]),\n styles.map((style, index) =>\n h.button(\n slots.item.attrs(\n [\n h.Type('button'),\n h.Role('menuitemradio'),\n h.AriaChecked(style === chosen),\n h.DataAttribute('style', style.id),\n h.OnClick(input.wrap(style.message)),\n ],\n { index, id: style.id, count: styles.length },\n ),\n [\n ...icon(style.icon),\n h.span(slots.label.attrs(), [style.label]),\n h.span(slots.check.attrs(), style === chosen ? [richTextIcon(h, 'check')] : []),\n ],\n ),\n ),\n ),\n ]\n : []),\n ])\n })\n","/**\n * The find and replace bar, drawn through slots. Like the rest of the chrome it holds no state:\n * the query, the replacement, which match is current and whether case counts are the caller's,\n * the matches are a read of the document (`RichText.findMatches`), and replacing is the editor's\n * own `ReplacedText`, so a replacement is an edit with an undo step like any other.\n */\nimport { Option } from 'effect'\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { Message as EditorMessage, type EditorEvent } from 'foldkit-richtext-dom/editor'\nimport { richTextIcon, type RichTextIconName } from './icons.js'\n\n/** The elements the bar publishes: its wrapper, its two fields, the count, and its buttons. */\nexport const FindReplaceSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n field: Slot.make({ capability: Capability.TextInput }),\n count: Slot.make({ capability: Capability.Container }),\n button: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface FindReplaceInput<Message> {\n readonly document: RichText.Document\n readonly query: string\n readonly replacement: string\n /** The match the bar is on, by its index in `RichText.findMatches`. */\n readonly current: number\n readonly caseSensitive: boolean\n readonly queried: (query: string) => Message\n readonly replacementDrafted: (replacement: string) => Message\n /**\n * Go to the next match (1) or the previous one (-1). The caller moves its current match with\n * `stepMatch` against its Model as it is then, since keys can come faster than the bar is drawn.\n */\n readonly stepped: (step: 1 | -1) => Message\n readonly caseToggled: Message\n readonly closed: Message\n /** An editor Message as this caller's, usually its `edited(...)` wrapper. */\n readonly wrap: (message: EditorEvent) => Message\n}\n\n/**\n * The index a step from `current` lands on among `count` matches, wrapping at either end, so\n * Enter keeps cycling through them as a browser's find does.\n */\nexport const stepMatch = (current: number, count: number, step: 1 | -1): number =>\n count === 0 ? 0 : (((current + step) % count) + count) % count\n\n/**\n * The bar as a slot view. Enter in the find field goes to the next match and Shift+Enter to the\n * previous one; Escape in either field closes it. Replace replaces the current match and Replace\n * all every one; both are disabled with no match. Each button carries `data-find`.\n */\nexport const findReplace = <Message>(): SlotView.SlotView<\n typeof FindReplaceSlots,\n FindReplaceInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(FindReplaceSlots, (input, slots, h): Html => {\n const count = RichText.findMatches(input.document, input.query, input).length\n const current = Math.min(input.current, Math.max(0, count - 1))\n const replaced = (at: number | undefined) =>\n input.wrap(\n EditorMessage.ReplacedText({\n query: input.query,\n replacement: input.replacement,\n caseSensitive: input.caseSensitive,\n ...(at === undefined ? {} : { at }),\n }),\n )\n const button = (\n id: string,\n label: string,\n message: Message,\n {\n disabled = false,\n pressed,\n icon,\n }: {\n readonly disabled?: boolean\n readonly pressed?: boolean\n /** Drawn in place of the label, which then names the button and is its tooltip. */\n readonly icon?: RichTextIconName\n } = {},\n ) =>\n h.button(\n slots.button.attrs([\n h.Type('button'),\n h.DataAttribute('find', id),\n h.AriaLabel(label),\n ...(icon === undefined ? [] : [h.Title(label)]),\n ...(pressed === undefined ? [] : [h.AriaPressed(pressed ? 'true' : 'false')]),\n h.Disabled(disabled),\n ...(disabled ? [] : [h.OnClick(message)]),\n ]),\n [icon === undefined ? label : richTextIcon(h, icon)],\n )\n return h.div(slots.root.attrs([h.Role('search'), h.AriaLabel('Find and replace')]), [\n h.input(\n slots.field.attrs([\n h.Type('search'),\n h.DataAttribute('find', 'query'),\n h.AriaLabel('Find'),\n h.Placeholder('Find'),\n h.Value(input.query),\n h.OnInput(input.queried),\n h.OnKeyDownPreventDefault((key, modifiers) => {\n if (key === 'Escape') return Option.some(input.closed)\n if (key !== 'Enter' || count === 0) return Option.none()\n return Option.some(input.stepped(modifiers.shiftKey ? -1 : 1))\n }),\n ]),\n ),\n h.span(slots.count.attrs([h.AriaLive('polite')]), [\n input.query === '' ? '' : count === 0 ? 'No matches' : `${current + 1} of ${count}`,\n ]),\n button('previous', 'Previous match', input.stepped(-1), {\n disabled: count === 0,\n icon: 'chevron-up',\n }),\n button('next', 'Next match', input.stepped(1), {\n disabled: count === 0,\n icon: 'chevron-down',\n }),\n button('case', 'Match case', input.caseToggled, {\n pressed: input.caseSensitive,\n icon: 'match-case',\n }),\n h.input(\n slots.field.attrs([\n h.Type('text'),\n h.DataAttribute('find', 'replacement'),\n h.AriaLabel('Replace with'),\n h.Placeholder('Replace with'),\n h.Value(input.replacement),\n h.OnInput(input.replacementDrafted),\n h.OnKeyDownPreventDefault(key =>\n key === 'Escape' ? Option.some(input.closed) : Option.none(),\n ),\n ]),\n ),\n button('replace', 'Replace', replaced(current), { disabled: count === 0 }),\n button('replace-all', 'Replace all', replaced(undefined), { disabled: count === 0 }),\n button('close', 'Close', input.closed, { icon: 'close' }),\n ])\n })\n","/**\n * The table toolbar: rows and columns added and removed around the caret's cell, the header row\n * switched, and the table deleted, drawn through slots like the rest of the chrome. It holds no\n * state: where the caret is in which table is a read of the document (`RichText.tableAt`), and\n * what it sends is the editor's own Messages, wrapped for the caller.\n */\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { Message as EditorMessage, type EditorEvent } from 'foldkit-richtext-dom/editor'\n\n/** The elements the toolbar publishes: its wrapper, its row, and one button per change. */\nexport const TableToolbarSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n toolbar: Slot.make({ capability: Capability.Collection }),\n button: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface TableToolbarInput<Message> {\n readonly document: RichText.Document\n readonly selection: RichText.Selection | null\n /** An editor Message as this caller's, usually its `edited(...)` wrapper. */\n readonly wrap: (message: EditorEvent) => Message\n}\n\n/**\n * The table toolbar as a slot view. Every button is disabled outside a table, so a caller can\n * draw it always or only while `RichText.tableAt` finds the caret in one. Each button carries its\n * change as `data-table` and as the slot item's `id`, so a Style or Behavior can single one out;\n * the header button is pressed while the table's first row is its header.\n */\nexport const tableToolbar = <Message>(): SlotView.SlotView<\n typeof TableToolbarSlots,\n TableToolbarInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(TableToolbarSlots, (input, slots, h): Html => {\n const at = RichText.tableAt(input.document, input.selection)\n const first = at?.rows[0]\n const header = first?.props.header === true\n const changes: ReadonlyArray<\n readonly [id: string, label: string, message: EditorEvent | undefined, pressed?: boolean]\n > = [\n ['row-above', 'Row above', EditorMessage.InsertedRow({ where: 'before' })],\n ['row-below', 'Row below', EditorMessage.InsertedRow({ where: 'after' })],\n ['column-left', 'Column left', EditorMessage.InsertedColumn({ where: 'before' })],\n ['column-right', 'Column right', EditorMessage.InsertedColumn({ where: 'after' })],\n ['delete-row', 'Delete row', EditorMessage.DeletedRow()],\n ['delete-column', 'Delete column', EditorMessage.DeletedColumn()],\n [\n 'header',\n 'Header row',\n first === undefined\n ? undefined\n : EditorMessage.ChangedProps({ node: first.id, props: { header: !header } }),\n header,\n ],\n [\n 'delete-table',\n 'Delete table',\n at === undefined ? undefined : EditorMessage.DeletedBlock({ node: at.table.id }),\n ],\n ]\n return h.div(slots.root.attrs(), [\n h.div(\n slots.toolbar.attrs([h.Role('toolbar'), h.AriaLabel('Table')]),\n changes.map(([id, label, message, pressed], index) =>\n h.button(\n slots.button.attrs(\n [\n h.Type('button'),\n h.DataAttribute('table', id),\n ...(pressed === undefined ? [] : [h.AriaPressed(pressed ? 'true' : 'false')]),\n h.Disabled(at === undefined || message === undefined),\n ...(at === undefined || message === undefined\n ? []\n : [h.OnClick(input.wrap(message))]),\n ],\n { index, id, count: changes.length },\n ),\n [label],\n ),\n ),\n ),\n ])\n })\n","/**\n * The code block toolbar: the block's language, chosen from the caller's list, and a Copy\n * button, drawn through slots. The language is the block's `language` prop, set through the\n * editor's `ChangedProps`, so it is saved and undone with the text; copying is the caller's\n * own Message, since writing to the clipboard is a Command the editor does not own.\n */\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { Message as EditorMessage, type EditorEvent } from 'foldkit-richtext-dom/editor'\n\n/** The elements the toolbar publishes: its wrapper, the language picker, and the Copy button. */\nexport const CodeToolbarSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n language: Slot.make({ capability: Capability.Interactive }),\n copy: Slot.make({ capability: Capability.Interactive }),\n})\n\n/** A language the picker offers: the `language` prop's value, and what the picker shows. */\nexport interface CodeLanguage {\n readonly id: string\n readonly label: string\n}\n\nexport interface CodeToolbarInput<Message> {\n readonly document: RichText.Document\n /** The code block the toolbar is for. */\n readonly node: RichText.NodeId\n /** What the picker offers, in order; `''` is code with no language. */\n readonly languages: ReadonlyArray<CodeLanguage>\n /** An editor Message as this caller's, usually its `edited(...)` wrapper. */\n readonly wrap: (message: EditorEvent) => Message\n /** What Copy sends: the caller copies the block's text (`RichText.toText([block])`). */\n readonly copied: Message\n}\n\n/**\n * The code block toolbar as a slot view. The picker shows the block's language, and a language\n * the list does not name is offered as itself, so choosing nothing never changes it. Nothing is\n * drawn for a block that is not there.\n */\nexport const codeToolbar = <Message>(): SlotView.SlotView<\n typeof CodeToolbarSlots,\n CodeToolbarInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(CodeToolbarSlots, (input, slots, h): Html => {\n const block = RichText.locateBlock(input.document, input.node)?.block\n const current = block?.type === 'Node' ? block.props.language : undefined\n const language = typeof current === 'string' ? current : ''\n const languages = input.languages.some(each => each.id === language)\n ? input.languages\n : [...input.languages, { id: language, label: language }]\n return h.div(slots.root.attrs([h.Role('toolbar'), h.AriaLabel('Code')]), [\n h.select(\n slots.language.attrs([\n h.AriaLabel('Language'),\n h.Value(language),\n h.OnChange(chosen =>\n input.wrap(\n EditorMessage.ChangedProps({ node: input.node, props: { language: chosen } }),\n ),\n ),\n ]),\n languages.map(each =>\n h.option([h.Value(each.id), h.Selected(each.id === language)], [each.label]),\n ),\n ),\n h.button(\n slots.copy.attrs([\n h.Type('button'),\n h.DataAttribute('code', 'copy'),\n h.OnClick(input.copied),\n ]),\n ['Copy'],\n ),\n ])\n })\n","/**\n * The block handle (§124 §11, §144): the moves one block can make as a whole, drawn through slots\n * like the rest of the chrome.\n *\n * It holds no state. Which block it stands for is the caller's, usually one of\n * `RichText.blocksAt(document, selection)`: the outermost to move a whole list, an item to\n * reorder a list. Its siblings are a read of the document, and what it sends is the editor's\n * `MovedBlock`, wrapped for the caller.\n */\nimport type { Html } from 'foldkit/html'\nimport * as Mount from 'foldkit/mount'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { Message as EditorMessage, type EditorEvent } from 'foldkit-richtext-dom/editor'\nimport { blockDrag } from 'foldkit-richtext-dom/toolbar'\n\n/** The elements the handle publishes: its wrapper, the grip it is dragged by, and its two moves. */\nexport const BlockHandleSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n grip: Slot.make({ capability: Capability.Interactive }),\n up: Slot.make({ capability: Capability.Interactive }),\n down: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface BlockHandleInput<Message> {\n readonly document: RichText.Document\n /** The editor host's id, whose blocks a drag measures. */\n readonly hostId: string\n /** The block the handle stands for. */\n readonly node: RichText.NodeId\n /** An editor Message as this caller's, usually its `edited(...)` wrapper. */\n readonly wrap: (message: EditorEvent) => Message\n}\n\n/** The drag Mount lifted into the caller's Messages, as the grip carries it. */\nexport const dragMount = <Message>(\n hostId: string,\n node: RichText.NodeId,\n wrap: (message: EditorEvent) => Message,\n): Mount.MountAction<Message> => Mount.mapMessage(blockDrag({ hostId, node }), wrap)\n\n/**\n * The handle as a slot view. The grip drags the block wherever `RichText.moveTargets` allows\n * (`blockDrag`), and is keyed by the block, since a Mount reads its args once. Up moves the\n * block before its previous sibling and down after its next one, within its container; each is\n * disabled at its end of the container, and both when the block is not there.\n */\nexport const blockHandle = <Message>(): SlotView.SlotView<\n typeof BlockHandleSlots,\n BlockHandleInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(BlockHandleSlots, (input, slots, h): Html => {\n const { previous, next } = RichText.siblingsOf(input.document, input.node)\n const move = (to: RichText.Beside) =>\n input.wrap(EditorMessage.MovedBlock({ node: input.node, to }))\n return h.div(slots.root.attrs([h.Role('group'), h.AriaLabel('Block')]), [\n h.button(\n slots.grip.attrs([\n h.Key(input.node),\n h.Type('button'),\n h.DataAttribute('handle', 'grip'),\n h.AriaLabel('Drag to move'),\n // A drag is the pointer's alone, so the grip would be a stop in the tab order that\n // does nothing; the keyboard has up and down, which stay within the container.\n h.Tabindex(-1),\n h.OnMount(dragMount(input.hostId, input.node, input.wrap)),\n ]),\n ['⠿'],\n ),\n h.button(\n slots.up.attrs([\n h.Type('button'),\n h.DataAttribute('handle', 'up'),\n h.AriaLabel('Move up'),\n h.Disabled(previous === undefined),\n ...(previous === undefined ? [] : [h.OnClick(move({ before: previous.id }))]),\n ]),\n ['↑'],\n ),\n h.button(\n slots.down.attrs([\n h.Type('button'),\n h.DataAttribute('handle', 'down'),\n h.AriaLabel('Move down'),\n h.Disabled(next === undefined),\n ...(next === undefined ? [] : [h.OnClick(move({ after: next.id }))]),\n ]),\n ['↓'],\n ),\n ])\n })\n","/**\n * The slash menu's keys and catalogue (§119, §123): the movement rule over\n * `foldkit-primitives`' `RovingTabindex.move`, and the editor's catalogue with each\n * entry's Message wrapped for this caller.\n *\n * The query, the matching, and the menu itself are the editor's\n * (`foldkit-richtext-dom/editor`) and re-exported here, so an application that imports\n * the chrome gets one vocabulary. `slashMove` is what the caller's keys call to compute\n * an index; the menu's view is `menu.ts`.\n */\nimport type { KeyboardModifiers } from 'foldkit/html'\nimport { RovingTabindex } from 'foldkit-primitives/interaction'\nimport {\n slashEntries as editorEntries,\n slashMenu,\n type EditorEvent,\n type SlashEntry,\n} from 'foldkit-richtext-dom/editor'\n\nexport {\n matchingEntries,\n slashMenu,\n slashQuery,\n type SlashEntry,\n type SlashMenu,\n} from 'foldkit-richtext-dom/editor'\n\n/**\n * The entries this package offers: the editor's catalogue, each Message passed through\n * `wrap` — the seam the toolbar takes too, because the caller usually dispatches a\n * wrapper like `edited(...)`, which is a function.\n */\nexport const slashEntries = <Message>(\n wrap: (message: EditorEvent) => Message,\n): ReadonlyArray<SlashEntry<Message>> =>\n editorEntries.map(entry => ({ ...entry, message: wrap(entry.message) }))\n\n/**\n * The index an arrow — or Home, or End — moves the highlight to among the current\n * matches, or `undefined` when the key moves nothing. The rule is `foldkit-primitives`'\n * `RovingTabindex.move`, so the menu and any other list agree on ArrowUp/ArrowDown,\n * Home/End, wrapping, and on a modified key moving nothing; the menu adds only \"over the\n * entries the query currently matches\".\n *\n * It moves from what `slashMenu` highlights rather than from the caller's remembered\n * index, so a query that narrowed past it is not moved from a position the user cannot\n * see.\n */\nexport const slashMove = <Message>(\n entries: ReadonlyArray<SlashEntry<Message>>,\n textBefore: string,\n index: number,\n key: string,\n modifiers: KeyboardModifiers,\n): number | undefined => {\n const menu = slashMenu(entries, textBefore, index)\n if (menu === undefined || menu.matches.length === 0) return undefined\n const from = menu.highlighted === undefined ? -1 : menu.matches.indexOf(menu.highlighted)\n return RovingTabindex.move([...menu.matches.keys()], from, key, modifiers, {\n orientation: 'vertical',\n // A vertical menu never reads left or right, so the direction is not its business.\n direction: 'ltr',\n loop: true,\n })\n}\n","/**\n * The command palette (§124 §11, §68, §142): the slash menu's catalogue, searched from a field of\n * its own rather than typed into the document, drawn through slots like the rest of the chrome.\n *\n * It holds no state. Whether it is open, the query, and the highlighted index are the\n * caller's, as `{ query, index } | null` in its Model; the view filters with the slash menu's\n * `matchingEntries` and sends what the caller should store next. Choosing an entry sends the\n * entry's own Message, so a caller that closes the palette on a choice wraps its entries to\n * say so (`slashEntries(event => Message.Chose({ event }))`) — the palette cannot know which\n * of the caller's Messages it is.\n */\nimport { Option } from 'effect'\nimport type { Html, KeyboardModifiers } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport { RovingTabindex } from 'foldkit-primitives/interaction'\nimport { matchingEntries, type SlashEntry } from './slash.js'\n\n/** The elements the palette publishes: its wrapper, the search field, the list, and its options. */\nexport const CommandPaletteSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n input: Slot.make({ capability: Capability.TextInput }),\n list: Slot.make({ capability: Capability.Collection }),\n option: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface CommandPaletteInput<Message> {\n /** The element id the list and its options are named from; unique on the page. */\n readonly id: string\n /** `slashEntries(wrap)`, and whatever the application adds. */\n readonly entries: ReadonlyArray<SlashEntry<Message>>\n readonly query: string\n /** What the palette last highlighted among the matches. */\n readonly index: number\n /** What the field sends as the query changes or an arrow moves: the next query and index. */\n readonly changed: (query: string, index: number) => Message\n /** What Escape sends. */\n readonly closed: Message\n}\n\n/**\n * The palette as a slot view: a combobox field over a listbox of the matches. ArrowUp and\n * ArrowDown move the highlight, wrapping; Home and End stay the field's. Enter sends the\n * highlighted entry, and does nothing when no entry matches. A stale index — one the matches\n * do not hold — highlights the first match, as the slash menu does, so a query that narrows\n * never leaves Enter choosing nothing.\n */\nexport const commandPalette = <Message>(): SlotView.SlotView<\n typeof CommandPaletteSlots,\n CommandPaletteInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(CommandPaletteSlots, (input, slots, h): Html => {\n const matches = matchingEntries(input.entries, input.query)\n const current = matches[input.index] === undefined ? 0 : input.index\n const highlighted = matches[current]\n const list = `${input.id}-list`\n // Options have a prefix of their own, so an entry named `list` cannot take the list's id.\n const optionId = (entry: SlashEntry<Message>) => `${input.id}-option-${entry.id}`\n const keyed = (key: string, modifiers: KeyboardModifiers) => {\n if (key === 'Escape') return Option.some(input.closed)\n if (key === 'Enter') return Option.fromUndefinedOr(highlighted?.message)\n if (key !== 'ArrowUp' && key !== 'ArrowDown') return Option.none()\n const next = RovingTabindex.move([...matches.keys()], current, key, modifiers, {\n orientation: 'vertical',\n direction: 'ltr',\n loop: true,\n })\n return next === undefined ? Option.none() : Option.some(input.changed(input.query, next))\n }\n return h.div(slots.root.attrs([h.Role('dialog'), h.AriaLabel('Commands')]), [\n h.input(\n slots.input.attrs([\n h.Type('text'),\n h.Role('combobox'),\n h.AriaLabel('Search commands'),\n h.AriaExpanded(true),\n h.AriaControls(list),\n ...(highlighted === undefined ? [] : [h.AriaActiveDescendant(optionId(highlighted))]),\n h.Value(input.query),\n h.OnInput(query => input.changed(query, 0)),\n h.OnKeyDownPreventDefault(keyed),\n ]),\n ),\n h.ul(\n slots.list.attrs([h.Id(list), h.Role('listbox')]),\n matches.map((entry, index) =>\n h.li(\n slots.option.attrs(\n [\n h.Id(optionId(entry)),\n h.Role('option'),\n h.DataAttribute('entry', entry.id),\n h.AriaSelected(index === current),\n h.OnClick(entry.message),\n ],\n { index, id: entry.id, count: matches.length },\n ),\n [entry.label],\n ),\n ),\n ),\n ])\n })\n","/**\n * The editor's status line (§124 §11, §141): how long the document is, and what the application\n * found wrong with it, drawn through slots like the rest of the chrome.\n *\n * It sends nothing. The counts are `RichText.count`; the problems are whatever the caller\n * passes, usually `RichText.validate` against its Kit, which this view does not run, because\n * which Kit a document answers to is the application's.\n */\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\n\n/** The elements the status line publishes: its wrapper, the counts, and one item per problem. */\nexport const EditorStatusSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n counts: Slot.make({ capability: Capability.Base }),\n problems: Slot.make({ capability: Capability.Collection }),\n problem: Slot.make({ capability: Capability.Base }),\n})\n\nexport interface EditorStatusInput {\n readonly document: RichText.Document\n /** What the application found wrong with the document. None is shown when absent. */\n readonly diagnostics?: ReadonlyArray<RichText.Diagnostic> | undefined\n}\n\n// A caret move redraws the status without changing the document, so counts are kept per\n// document value; each edit makes a new one, and a dropped one is collected with its entry.\nconst counted = new WeakMap<RichText.Document, ReturnType<typeof RichText.count>>()\nconst countOf = (document: RichText.Document) => {\n const kept = counted.get(document)\n if (kept !== undefined) return kept\n const counts = RichText.count(document)\n counted.set(document, counts)\n return counts\n}\n\nconst plural = (count: number, one: string, many: string) => `${count} ${count === 1 ? one : many}`\n\n/**\n * The status line as a slot view. Each problem carries its code, and its node when it has\n * one, as data attributes, so a Style can mark a kind and a Behavior can find the block.\n */\nexport const editorStatus = <Message>(): SlotView.SlotView<\n typeof EditorStatusSlots,\n EditorStatusInput,\n Message\n> =>\n SlotView.forMessages<Message>().define(EditorStatusSlots, (input, slots, h): Html => {\n const { words, characters } = countOf(input.document)\n const problems = input.diagnostics ?? []\n return h.div(slots.root.attrs(), [\n h.p(slots.counts.attrs([h.DataAttribute('status', 'counts')]), [\n `${plural(words, 'word', 'words')} · ${plural(characters, 'character', 'characters')}`,\n ]),\n h.ul(\n slots.problems.attrs([h.DataAttribute('status', 'problems')]),\n problems.map((problem, index) =>\n h.li(\n slots.problem.attrs(\n [\n h.DataAttribute('code', problem.code),\n ...(problem.node === undefined ? [] : [h.DataAttribute('node', problem.node)]),\n ],\n {\n index,\n id: `${problem.code}:${problem.node ?? ''}:${index}`,\n count: problems.length,\n },\n ),\n [problem.message],\n ),\n ),\n ),\n ])\n })\n","/**\n * The Markdown source editor (§8, §137): the text of a source session, what switching back\n * would lose, and the way back — drawn through slots like the rest of the chrome.\n *\n * Source mode is the application's `SourceSession | null`: a session is open while it is set,\n * and the rich editor stands still meanwhile. This view edits the session's draft and reads\n * `closeSource` for its warnings, which is a pure read, so the list is exactly what closing\n * now would report. What leaving does — commit at once, or confirm first when there are\n * warnings — is the application's `update`.\n */\nimport { Effect, Queue, Schema, Stream } from 'effect'\nimport type { Html } from 'foldkit/html'\nimport * as Mount from 'foldkit/mount'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { renderDocument } from 'foldkit-richtext-dom/view'\nimport {\n closeSource,\n type ClosedSource,\n type MarkdownDiagnostic,\n type SourceSession,\n} from 'foldkit-richtext-markdown'\n\n/** The elements the editor publishes: its wrapper, the text, the warnings, and the way back. */\nexport const SourceEditorSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n text: Slot.make({ capability: Capability.TextInput }),\n warnings: Slot.make({ capability: Capability.Collection }),\n warning: Slot.make({ capability: Capability.Base }),\n done: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface SourceEditorInput<Message> {\n readonly session: SourceSession\n /** The document the session was opened on, which the application still holds. */\n readonly document: RichText.Document\n /** What the text area sends as the Markdown changes: the next draft. */\n readonly drafted: (draft: string) => Message\n /** What the text area sends as its caret moves: the session's next `caret` (§147). */\n readonly moved: (caret: number) => Message\n /** What the way back sends. */\n readonly done: Message\n}\n\n/**\n * Puts a text area's caret at `caret` and focuses it, then reports each place the caret moves\n * to, as the offset of its selection's focus, until released.\n */\nexport const followCaret = (\n field: HTMLTextAreaElement,\n caret: number,\n report: (caret: number) => void,\n): (() => void) => {\n field.focus()\n field.setSelectionRange(caret, caret)\n let last = caret\n const moved = () => {\n const at = field.selectionDirection === 'backward' ? field.selectionStart : field.selectionEnd\n if (at === last) return\n last = at\n report(at)\n }\n // A caret moves by typing, by keys, by the pointer, and by selecting; browsers that fire\n // `selectionchange` on the field itself cover all of these, and the rest are for the others.\n const events = ['selectionchange', 'select', 'input', 'keyup', 'mouseup'] as const\n for (const event of events) field.addEventListener(event, moved)\n return () => {\n for (const event of events) field.removeEventListener(event, moved)\n }\n}\n\nconst CaretMoved = Schema.TaggedStruct('CaretMoved', { caret: Schema.Number })\n\n/** `followCaret` as a Mount; its element is the source editor's text area. */\nconst sourceCaret = Mount.defineStream('RichTextSourceCaret', {\n args: { caret: Schema.Number },\n messages: [CaretMoved],\n execute: ({ element, caret }) =>\n Stream.callback<typeof CaretMoved.Type>(queue =>\n Effect.acquireRelease(\n Effect.sync(() =>\n element instanceof HTMLTextAreaElement\n ? followCaret(element, caret, at =>\n Queue.offerUnsafe(queue, CaretMoved.make({ caret: at })),\n )\n : () => {},\n ),\n release => Effect.sync(release),\n ),\n ),\n})\n\n/** The caret Mount lifted into the caller's Messages, as the text area carries it. */\nexport const caretMount = <Message>(\n caret: number,\n moved: (caret: number) => Message,\n): Mount.MountAction<Message> =>\n Mount.mapMessage(sourceCaret({ caret }), message => moved(message.caret))\n\n/** A warning as a sentence; its code and detail also ride on the element for a Style. */\nconst describe = (diagnostic: MarkdownDiagnostic): string =>\n diagnostic.code === 'UnsupportedMark'\n ? `${diagnostic.detail} formatting has no Markdown and will be lost`\n : diagnostic.code === 'UnsafeUrl'\n ? `An unsafe ${diagnostic.detail} address will be dropped`\n : `${diagnostic.detail} has no Markdown form here and will be lost`\n\n// A preview mints identities nobody keeps; they only have to be distinct within one parse.\nconst previewIds = () => {\n let next = 0\n return { mint: () => `preview-${next++}` }\n}\n\n/**\n * What closing the session now would give, as the view shows it: the warnings and the preview's\n * document. An unedited draft gives back the caller's document and warns of nothing, which is\n * `closeSource`'s rule, so it is answered without the parse `closeSource` spends placing the\n * caret. An edited draft's answer is parsed once per draft and kept: the cache is keyed by the\n * session's `unprintable` array, which stays the same object while the draft and caret are\n * replaced, so moving the caret does not parse again, and a closed session's entry is collected\n * with it.\n */\nconst parsed = new WeakMap<object, { readonly draft: string; readonly closed: ClosedSource }>()\nconst closedFor = (\n session: SourceSession,\n document: RichText.Document,\n): Pick<ClosedSource, 'document' | 'diagnostics'> => {\n if (session.draft === session.printed) return { document, diagnostics: [] }\n const kept = parsed.get(session.unprintable)\n if (kept?.draft === session.draft) return kept.closed\n const closed = closeSource(session, document, previewIds())\n parsed.set(session.unprintable, { draft: session.draft, closed })\n return closed\n}\n\n/**\n * The source editor as a slot view: a text area holding the draft, then — once the draft is\n * edited — one warning per thing switching back would lose or refuse, then the way back.\n */\nexport const sourceEditor = <Message>(): SlotView.SlotView<\n typeof SourceEditorSlots,\n SourceEditorInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(SourceEditorSlots, (input, slots, h): Html => {\n const warnings = closedFor(input.session, input.document).diagnostics\n return h.div(slots.root.attrs(), [\n h.textarea(\n // A slot's attributes are typed for every element, and Foldkit's textarea excludes\n // `InnerHTML`; the Form and Builder families narrow the same way (none is set here).\n slots.text.attrs([\n h.AriaLabel('Markdown source'),\n h.DataAttribute('source', 'text'),\n h.Value(input.session.draft),\n h.OnInput(input.drafted),\n // Read once, when the text area is drawn: the session's caret as it opened.\n h.OnMount(caretMount(input.session.caret, input.moved)),\n ]) as Parameters<typeof h.textarea>[0],\n ),\n h.ul(\n slots.warnings.attrs([h.DataAttribute('source', 'warnings')]),\n warnings.map((warning, index) =>\n h.li(\n slots.warning.attrs(\n [h.DataAttribute('code', warning.code), h.DataAttribute('detail', warning.detail)],\n { index, id: `${warning.code}:${warning.detail}:${index}`, count: warnings.length },\n ),\n [describe(warning)],\n ),\n ),\n ),\n h.button(\n slots.done.attrs([\n h.Type('button'),\n h.DataAttribute('source', 'done'),\n h.OnClick(input.done),\n ]),\n ['Rich text'],\n ),\n ])\n })\n\n/** The preview publishes one element: the rendered draft. */\nexport const SourcePreviewSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n})\n\nexport interface SourcePreviewInput {\n readonly session: SourceSession\n readonly document: RichText.Document\n /** How declared kinds and marks render, as in the rich editor. Defaults to `noRendering`. */\n readonly rendering?: RichText.Rendering | undefined\n}\n\n/**\n * The draft as the document it would become, for split mode: drawn beside `sourceEditor`, it\n * shows what switching back would commit. It is the read-only renderer's output, so it\n * dispatches nothing, and it shares the editor's parse of the draft.\n */\nexport const sourcePreview = <Message>(): SlotView.SlotView<\n typeof SourcePreviewSlots,\n SourcePreviewInput,\n Message\n> =>\n SlotView.forMessages<Message>().define(SourcePreviewSlots, (input, slots, h): Html =>\n h.div(slots.root.attrs([h.DataAttribute('source', 'preview'), h.AriaLabel('Preview')]), [\n renderDocument(\n closedFor(input.session, input.document).document,\n input.rendering ?? RichText.noRendering,\n ),\n ]),\n )\n","/**\n * The link editor (§124 §11, §132): an address field and the two things it can do, drawn\n * through slots like the toolbar and the slash menu.\n *\n * It holds no state. The link it edits is a read of the document (`RichText.linkAt`), the\n * address being typed is the caller's `draft`, and what it sends is an editor Message\n * wrapped for the caller — `AppliedMark` to link the selection or change the link around\n * the caret, `ClearedMark` to remove it — so the editor Bundle makes each one transition.\n * Where it appears, and when, is the caller's: only the caller knows where the caret is.\n */\nimport { Option } from 'effect'\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { Message as EditorMessage, type EditorEvent } from 'foldkit-richtext-dom/editor'\n\n/** The elements the editor publishes: its wrapper, the address field, and its two buttons. */\nexport const LinkEditorSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n input: Slot.make({ capability: Capability.TextInput }),\n apply: Slot.make({ capability: Capability.Interactive }),\n remove: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface LinkEditorInput<Message> {\n readonly document: RichText.Document\n readonly selection: RichText.Selection | null\n /** The address as typed so far; `RichText.linkAt(...)?.href` is what to start it from. */\n readonly draft: string\n /** What the field sends as the address changes. */\n readonly drafted: (href: string) => Message\n /** An editor Message as this caller's, usually its `edited(...)` wrapper. */\n readonly wrap: (message: EditorEvent) => Message\n /** What Escape in the field sends: usually closing the editor. Without it, Escape does nothing. */\n readonly closed?: Message | undefined\n /**\n * What Enter in the field sends, for the caller's `update` to apply `linkEdit` to its own\n * draft. Without it, Enter sends the edit the view last drew, which is a frame behind keys\n * typed fast: Enter right after the last character would apply the draft before it.\n */\n readonly submitted?: Message | undefined\n}\n\n/**\n * The edit applying a draft makes: the selection linked, or the link around the caret changed, to\n * `RichText.safeUrl(draft)`. None when the policy refuses the address, or when there is neither\n * a range nor a caret inside a link to put it on. The view's button sends it; a caller handling\n * `submitted` sends it from its own draft.\n */\nexport const linkEdit = (\n document: RichText.Document,\n selection: RichText.Selection | null,\n draft: string,\n): Option.Option<EditorEvent> => {\n const href = RichText.safeUrl(draft)\n if (href === undefined) return Option.none()\n if (RichText.linkAt(document, selection) === undefined && !RichText.coversText(selection)) {\n return Option.none()\n }\n return Option.some(EditorMessage.AppliedMark({ mark: { name: 'Link', props: { href } } }))\n}\n\n/**\n * The link editor as a slot view. Applying needs an address the URL policy accepts\n * (`RichText.safeUrl`), which is what it sends, and something to link: a range, or a caret\n * inside a link. Otherwise the apply button is disabled and Enter in the field does nothing.\n * The remove button is drawn only inside a link. Escape in the field sends `closed`.\n */\nexport const linkEditor = <Message>(): SlotView.SlotView<\n typeof LinkEditorSlots,\n LinkEditorInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(LinkEditorSlots, (input, slots, h): Html => {\n const link = RichText.linkAt(input.document, input.selection)\n const apply = Option.getOrUndefined(\n Option.map(linkEdit(input.document, input.selection, input.draft), input.wrap),\n )\n return h.div(slots.root.attrs([h.Role('group'), h.AriaLabel('Link')]), [\n h.input(\n slots.input.attrs([\n h.Type('url'),\n h.DataAttribute('link', 'address'),\n h.AriaLabel('Link address'),\n h.Placeholder('Paste or type a link'),\n h.Value(input.draft),\n h.OnInput(input.drafted),\n h.OnKeyDownPreventDefault(key => {\n if (key === 'Escape' && input.closed !== undefined) return Option.some(input.closed)\n if (key !== 'Enter') return Option.none()\n if (input.submitted !== undefined) return Option.some(input.submitted)\n return apply === undefined ? Option.none() : Option.some(apply)\n }),\n ]),\n ),\n h.button(\n slots.apply.attrs([\n h.Type('button'),\n h.DataAttribute('link', 'apply'),\n h.Disabled(apply === undefined),\n ...(apply === undefined ? [] : [h.OnClick(apply)]),\n ]),\n [link === undefined ? 'Apply' : 'Update'],\n ),\n ...(link === undefined\n ? []\n : [\n h.button(\n slots.remove.attrs([\n h.Type('button'),\n h.DataAttribute('link', 'remove'),\n h.OnClick(input.wrap(EditorMessage.ClearedMark({ mark: 'Link' }))),\n ]),\n ['Remove'],\n ),\n ]),\n ])\n })\n","/**\n * The slash menu's view (§119, §123): what a caret in a query shows. It is a\n * `SlotView`, so every element it makes is a slot an application styles or extends,\n * exactly as the mark toolbar's are.\n *\n * The list is a value, not state. `slashMenu` decides what matches and what is\n * highlighted, `slashMove` moves the highlight from the caller's keys, and this renders\n * the answer — so the view keeps no Model of its own and the two places that must agree,\n * the render and the `update` that resolves Enter, read the same functions.\n *\n * Outside a query the view renders an empty list; the caller places it only when\n * `slashMenu` says there is a menu, because only the caller knows where the caret is.\n */\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport { isRichTextIcon, richTextIcon } from './icons.js'\nimport { slashMenu, type SlashEntry } from './slash.js'\n\n/**\n * The elements the menu publishes: its wrapper, its list, a heading over each group, one item per\n * match with its icon, label and description, and what shows when nothing matches.\n */\nexport const SlashMenuSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n list: Slot.make({ capability: Capability.Collection }),\n heading: Slot.make({ capability: Capability.Container }),\n item: Slot.make({ capability: Capability.Interactive }),\n icon: Slot.make({ capability: Capability.Container }),\n label: Slot.make({ capability: Capability.Container }),\n description: Slot.make({ capability: Capability.Container }),\n empty: Slot.make({ capability: Capability.Container }),\n})\n\nexport interface SlashMenuInput<Message> {\n /** `slashEntries` for this package's catalogue, or an application's own. */\n readonly entries: ReadonlyArray<SlashEntry<Message>>\n /** The caret's block text before it: `RichText.textBefore(document, position)`. */\n readonly textBefore: string\n /** What the menu last highlighted; `slashMove` is what moves it. */\n readonly index: number\n}\n\nexport const slashMenuView = <Message>(): SlotView.SlotView<\n typeof SlashMenuSlots,\n SlashMenuInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(SlashMenuSlots, (input, slots, h): Html => {\n const menu = slashMenu(input.entries, input.textBefore, input.index)\n const matches = menu?.matches ?? []\n const highlighted = matches.findIndex(entry => entry === menu?.highlighted)\n // Groups head the whole catalogue; a query lists the best matches first, ungrouped.\n const headed = menu?.query === ''\n const item = (entry: SlashEntry<Message>, index: number): Html =>\n h.button(\n slots.item.attrs(\n [\n h.Type('button'),\n h.Role('menuitem'),\n h.DataAttribute('entry', entry.id),\n h.AriaCurrent(index === highlighted ? 'true' : 'false'),\n h.OnClick(entry.message),\n ],\n { index, id: entry.id, count: matches.length },\n ),\n [\n ...(entry.icon !== undefined && isRichTextIcon(entry.icon)\n ? [h.span(slots.icon.attrs(), [richTextIcon(h, entry.icon)])]\n : []),\n h.span(slots.label.attrs(), [entry.label]),\n ...(entry.description === undefined\n ? []\n : [h.span(slots.description.attrs(), [entry.description])]),\n ],\n )\n const rows = matches.flatMap((entry, index) =>\n headed && entry.group !== undefined && entry.group !== matches[index - 1]?.group\n ? [h.div(slots.heading.attrs([h.Role('presentation')]), [entry.group]), item(entry, index)]\n : [item(entry, index)],\n )\n return h.div(slots.root.attrs(), [\n matches.length === 0\n ? h.p(slots.empty.attrs(), ['No matches'])\n : h.div(slots.list.attrs([h.Role('menu'), h.AriaLabel('Insert')]), rows),\n ])\n })\n","/**\n * The table of contents: the document's headings as links, drawn through slots. It is a read of\n * the document (`RichText.outlineOf`) and holds no state; choosing a heading is the caller's\n * Message, since moving the caret there and scrolling to it are the caller's to do.\n */\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\n\n/**\n * The elements the contents publish: the `nav`, its list, and one entry per heading. An entry\n * carries its depth as `--fk-toc-level` (1 for the shallowest level the document uses) and\n * `aria-current=\"location\"` for the section the selection is in.\n */\nexport const TableOfContentsSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n list: Slot.make({ capability: Capability.Container }),\n entry: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface TableOfContentsInput<Message> {\n readonly document: RichText.Document\n /** Where the caret is, whose section is marked current. */\n readonly selection: RichText.Selection | null\n /** A heading was chosen. */\n readonly chosen: (node: RichText.NodeId) => Message\n}\n\n/** The contents as a slot view; nothing is drawn for a document with no headings. */\nexport const tableOfContents = <Message>(): SlotView.SlotView<\n typeof TableOfContentsSlots,\n TableOfContentsInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(TableOfContentsSlots, (input, slots, h): Html => {\n const entries = RichText.outlineOf(input.document)\n if (entries.length === 0) return h.empty\n const top = Math.min(...entries.map(entry => entry.level))\n const current = RichText.sectionAt(input.document, input.selection)\n return h.nav(slots.root.attrs([h.AriaLabel('Contents')]), [\n h.ul(\n slots.list.attrs(),\n entries.map(entry =>\n h.li(\n [h.Key(entry.node)],\n [\n h.button(\n slots.entry.attrs([\n h.Type('button'),\n h.Style({ '--fk-toc-level': String(entry.level - top + 1) }),\n ...(entry.node === current ? [h.AriaCurrent('location')] : []),\n h.OnClick(input.chosen(entry.node)),\n ]),\n [entry.text],\n ),\n ],\n ),\n ),\n ),\n ])\n })\n","/**\n * The footnote preview: the note a reference at the caret points to, a way to go to it, and its\n * label to rename, drawn through slots. It holds no state: which footnote is a read of the\n * document (`RichText.footnoteAt`), renaming is the editor's own `RenamedFootnote`, and going to\n * the note is the caller's Message, since moving the focus there is a Command the caller runs.\n */\nimport type { Html } from 'foldkit/html'\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { Message as EditorMessage, type EditorEvent } from 'foldkit-richtext-dom/editor'\n\n/** The elements the preview publishes: its card, the label field, the note's text, and the button. */\nexport const FootnotePreviewSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n label: Slot.make({ capability: Capability.TextInput }),\n text: Slot.make({ capability: Capability.Container }),\n button: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface FootnotePreviewInput<Message> {\n readonly document: RichText.Document\n readonly selection: RichText.Selection | null\n /** Go to the note: the caller puts the caret at the definition's start (`focus`). */\n readonly opened: (definition: RichText.NodeId) => Message\n /** An editor Message as this caller's, usually its `edited(...)` wrapper. */\n readonly wrap: (message: EditorEvent) => Message\n}\n\n/**\n * The preview as a slot view, drawn while the caret is in a footnote reference and nothing\n * otherwise. The label field renames the footnote when it changes (`RenamedFootnote`, which the\n * editor refuses for a label in use). A note with no text reads \"No note yet\"; with no definition\n * at all, Go to note is disabled.\n */\nexport const footnotePreview = <Message>(): SlotView.SlotView<\n typeof FootnotePreviewSlots,\n FootnotePreviewInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(FootnotePreviewSlots, (input, slots, h): Html => {\n const label = RichText.footnoteAt(input.document, input.selection)\n if (label === undefined) return h.empty\n const note = RichText.footnotesOf(input.document).find(each => each.label === label)\n const definition = note?.definition\n return h.div(slots.root.attrs([h.Role('group'), h.AriaLabel(`Footnote ${label}`)]), [\n h.input(\n slots.label.attrs([\n h.Type('text'),\n h.AriaLabel('Footnote label'),\n h.Value(label),\n h.OnChange(to => input.wrap(EditorMessage.RenamedFootnote({ from: label, to }))),\n ]),\n ),\n h.p(slots.text.attrs(), [note === undefined || note.text === '' ? 'No note yet' : note.text]),\n h.button(\n slots.button.attrs([\n h.Type('button'),\n h.Disabled(definition === undefined),\n ...(definition === undefined ? [] : [h.OnClick(input.opened(definition))]),\n ]),\n ['Go to note'],\n ),\n ])\n })\n","/**\n * `foldkit-mixins-richtext` — the editor's chrome, drawn through slots (§35, §120).\n *\n * The editor's Bundle renders one host element and nothing else (§29); the marks\n * toolbar beside it is the application's chrome. This package draws that chrome as\n * a SlotView, so every element it makes is a slot an application styles or extends\n * the way it does any other view. It cannot wrap `marksToolbar`: a slot's\n * contributions resolve at the element the view creates (§120). The two share\n * `markActive` instead.\n */\nimport { Capability, Slot, Slots, SlotView } from 'foldkit-mixins'\nimport * as RichText from 'foldkit-richtext'\nimport { markActive, type ToolbarState } from 'foldkit-richtext-dom/toolbar'\n\n/** The elements the toolbar publishes: its wrapper, its row, and one button per mark. */\nexport const MarkToolbarSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n toolbar: Slot.make({ capability: Capability.Collection }),\n button: Slot.make({ capability: Capability.Interactive }),\n})\n\nexport interface MarkToolbarInput<Message> {\n /** What the editor projects: `document`, `selection`, and the caret's format. */\n readonly state: ToolbarState\n /** The marks to offer, by name. Defaults to the three `foldkit-richtext` ships. */\n readonly marks?: ReadonlyArray<string> | undefined\n /**\n * A mark to the Message that toggles it for this caller. The editor's\n * `Message.ToggledMark` is data, but a caller usually dispatches its wrapper\n * (`edited(...)`), which is a function — and a plain SlotView holds one.\n */\n readonly toggled: (mark: string) => Message\n}\n\n/**\n * The mark toolbar as a slot view. A Style or Behavior attaches to\n * `MarkToolbarSlots`; each button renders with its mark as the slot item's `id`, so\n * a Behavior can single one out.\n */\nexport const markToolbar = <Message>(): SlotView.SlotView<\n typeof MarkToolbarSlots,\n MarkToolbarInput<Message>,\n Message\n> =>\n SlotView.forMessages<Message>().define(MarkToolbarSlots, (input, slots, h) => {\n const marks = input.marks ?? RichText.shippedMarks.map(definition => definition.name)\n return h.div(slots.root.attrs(), [\n h.div(\n slots.toolbar.attrs([h.Role('toolbar')]),\n marks.map((mark, index) =>\n h.button(\n slots.button.attrs(\n [\n h.Type('button'),\n h.DataAttribute('mark', mark),\n h.AriaLabel(mark),\n h.AriaPressed(markActive(input.state, mark) ? 'true' : 'false'),\n h.OnClick(input.toggled(mark)),\n ],\n { index, id: mark, count: marks.length },\n ),\n [mark],\n ),\n ),\n ),\n ])\n })\n\n/** The block style picker's view and its slots (§134). */\nexport {\n BlockStyleMenuSlots,\n BlockStyleSlots,\n blockStyleMenu,\n blockStyles,\n type BlockStyleInput,\n type BlockStyleMenuInput,\n} from './style.js'\n\n/** The find and replace bar's view and its slots. */\nexport { FindReplaceSlots, findReplace, stepMatch, type FindReplaceInput } from './find.js'\n\n/** The table toolbar's view and its slots: rows and columns around the caret's cell. */\nexport { TableToolbarSlots, tableToolbar, type TableToolbarInput } from './table.js'\n\n/** The code block toolbar's view and its slots: its language and Copy. */\nexport { CodeToolbarSlots, codeToolbar, type CodeLanguage, type CodeToolbarInput } from './code.js'\n\n/** The block handle's view and its slots (§144). */\nexport { BlockHandleSlots, blockHandle, type BlockHandleInput } from './handle.js'\n\n/** The command palette's view and its slots (§142). */\nexport { CommandPaletteSlots, commandPalette, type CommandPaletteInput } from './palette.js'\n\n/** The status line's view and its slots (§141). */\nexport { EditorStatusSlots, editorStatus, type EditorStatusInput } from './status.js'\n\n/** The Markdown source editor's view and its slots (§137). */\nexport {\n SourceEditorSlots,\n SourcePreviewSlots,\n sourceEditor,\n sourcePreview,\n type SourceEditorInput,\n type SourcePreviewInput,\n} from './source.js'\n\n/** The link editor's view and its slots (§132). */\nexport { LinkEditorSlots, linkEdit, linkEditor, type LinkEditorInput } from './link.js'\n\n/** The menu's view and its slots (§123), beside the vocabulary it renders. */\nexport { SlashMenuSlots, slashMenuView, type SlashMenuInput } from './menu.js'\n\n/**\n * The slash menu's vocabulary (§123) travels with the chrome it belongs to, so an\n * application importing the family gets the entries and the query rule too.\n */\nexport {\n matchingEntries,\n slashEntries,\n slashMenu,\n slashMove,\n slashQuery,\n type SlashEntry,\n type SlashMenu,\n} from './slash.js'\n/** The chrome's icons, after Lucide: as inline SVG, or as a CSS `url(…)` to mask. */\nexport { isRichTextIcon, richTextIcon, richTextIconUrl, type RichTextIconName } from './icons.js'\n/** The table of contents, from the document's headings, and its slots. */\nexport { TableOfContentsSlots, tableOfContents, type TableOfContentsInput } from './contents.js'\n/** The footnote preview at a reference, and its slots. */\nexport { FootnotePreviewSlots, footnotePreview, type FootnotePreviewInput } from './footnote.js'\n"],"mappings":";;;;;;;;;;;AAoDA,MAAa,QAAmD;CAC9D,WAAW;EACT,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,aAAa;EACX,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,aAAa;EACX,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,aAAa;EACX,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,OAAO;EACL,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,iBAAiB;EACf,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,iBAAiB;EACf,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,WAAW;EACT,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,GAAG;GACL;GACA,UAAU,CAAC;EACb,CACF;CACF;CACA,cAAc;EACZ,SAAS;EACT,YAAY,CAAC;EACb,OAAO,CACL;GACE,KAAK;GACL,YAAY;IACV,MAAM;IACN,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;GAClB;GACA,UAAU,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CACzC,GACA,CAAC,IAAI,CACP,CACF,CACF,CACF,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foldkit-mixins-richtext",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "The rich-text editor's chrome, drawn through Mixins slots.",
5
5
  "keywords": [
6
6
  "foldkit",
@@ -39,12 +39,12 @@
39
39
  "LICENSE"
40
40
  ],
41
41
  "dependencies": {
42
- "foldkit-media": "0.2.0",
43
- "foldkit-primitives": "0.15.3",
44
- "foldkit-richtext": "0.5.1",
45
- "foldkit-richtext-markdown": "0.3.2",
46
- "foldkit-richtext-dom": "0.6.4",
47
- "foldkit-mixins": "0.19.1"
42
+ "foldkit-media": "0.3.1",
43
+ "foldkit-mixins": "0.20.0",
44
+ "foldkit-primitives": "0.15.4",
45
+ "foldkit-richtext": "0.5.3",
46
+ "foldkit-richtext-markdown": "0.3.4",
47
+ "foldkit-richtext-dom": "0.6.6"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "effect": "^4.0.0",