@threadlabs/looma 0.45.2 → 0.46.1

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.
@@ -23,7 +23,7 @@ declare module "@tiptap/core" {
23
23
  loomaFootnotes: {
24
24
  /**
25
25
  * Inserts a reference at the selection. A new label (the next free number when none is given)
26
- * also gets an empty note, and the caret moves into it.
26
+ * also gets an empty note at the end of the document, and the caret moves into it.
27
27
  */
28
28
  insertLoomaFootnote: (label?: string) => ReturnType;
29
29
  /** Gives a footnote's note and every reference to it a new, unused label. */
@@ -37,16 +37,11 @@ declare module "@tiptap/core" {
37
37
  }
38
38
  }
39
39
  /**
40
- * The document's notes, saved as `<section data-footnotes>` with its `<ol>`.
41
- * @invariant It holds only footnotes and stays the document's last block, one section in number order.
42
- * @ownership It owns footnote numbering and the back-links in serialized HTML for the whole editor.
43
- */
44
- export declare const LoomaFootnotes: Node<any, {
45
- known: Map<string, ProseMirrorNode>;
46
- }>;
47
- /**
48
- * One note, `[^label]: …`, saved as `<li id="fn:label">`.
49
- * @invariant It exists only inside `LoomaFootnotes`. `count` is how many references point to it. Its
50
- * back-links are presentation: the editor reads past them and writes them only into saved HTML.
40
+ * One note, `[^label]: …`, where its definition is written. Saved HTML collects the notes into
41
+ * one `<section data-footnotes>` whose `<li id="fn:label">` items read back as notes.
42
+ * @invariant `number` is its place in the numbering, or null when nothing refers to it; `count` is
43
+ * how many references point to it. Its back-links are presentation: the editor reads past them and
44
+ * writes them only into saved HTML.
45
+ * @ownership It owns footnote numbering and the notes section in serialized HTML for the whole editor.
51
46
  */
52
47
  export declare const LoomaFootnote: Node<any, any>;
@@ -11,13 +11,13 @@ export { LoomaCallout, LOOMA_CALLOUT_TONES, type LoomaCalloutTone, } from "./cal
11
11
  export { LoomaChip, LOOMA_CHIP_COLORS, normalizeLoomaChipColor, type LoomaChipColor } from "./chip.js";
12
12
  export { LoomaExpand, revealLoomaExpandAt, type LoomaExpandAttributes } from "./expand.js";
13
13
  export { LoomaFigcaption, LoomaFigure } from "./figure.js";
14
- export { findLoomaFootnote, LOOMA_FOOTNOTE_LABEL, LoomaFootnote, LoomaFootnoteReference, LoomaFootnotes } from "./footnote.js";
14
+ export { findLoomaFootnote, LOOMA_FOOTNOTE_LABEL, LoomaFootnote, LoomaFootnoteReference } from "./footnote.js";
15
+ export { LoomaLinkDefinition } from "./link-definition.js";
15
16
  export { LoomaTab, LoomaTabs } from "./tabs.js";
16
17
  export { LoomaTableOfContents, getTableOfContentsEntries, normalizeTableOfContentsConfig, type LoomaTableOfContentsConfig, type LoomaTableOfContentsEntry, type LoomaTableOfContentsFormat, } from "./table-of-contents.js";
17
18
  export { getDefaultEditorExtensions, getLoomaTableExtensions, LoomaTableKit, type DefaultEditorExtensionsOptions, type LoomaCodeLanguages, } from "./preset.js";
18
19
  export { LoomaSmartPaste } from "./smart-paste.js";
19
20
  export { LoomaReference, LoomaReferencePresentation, setReferenceDisplay, getReferenceDisplay, referenceDisplay, type LoomaReferenceDisplay, type LoomaReferenceMap } from "../reference-display.js";
20
- export { loomaMarkdownFromDoc, loomaMarkdownToHtml } from "./markdown.js";
21
21
  export { getActiveTableUiState, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, shouldShowTextFormattingToolbar, type ActiveTableUiState, type InsertTableAtRangeOptions, type TableActionCapabilities, } from "./table-commands.js";
22
22
  export { LoomaTable, getActiveTableCellAlignment, getActiveTableCellBackground, LoomaTableCell, LoomaTableHeader, setActiveTableCellAlignment, setActiveTableCellBackground, TABLE_CELL_BACKGROUND_PRESETS, type TableCellAlignment, type TableCellBackground, } from "./table-formatting.js";
23
23
  export { createLoomaMentionExtension, DEFAULT_MENTION_RESULT_LIMIT, filterLoomaMentionItems, LoomaMentionSuggestionPluginKey, MAX_MENTION_RESULT_LIMIT, normalizeMentionResultLimit, type LoomaMentionItem, type LoomaMentionMenuSnapshot, type LoomaMentionOptions, type LoomaMentionProvider, type LoomaMentionProviderContext, } from "./mention.js";
@@ -1,4 +1,4 @@
1
1
  import { n as TABLE_CELL_BACKGROUND_PRESETS } from "../chunks/table-backgrounds.js";
2
- import { $ as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, A as filterLoomaMentionItems, B as LOOMA_FOOTNOTE_LABEL, C as loomaMarkdownToHtml, D as createLoomaMentionExtension, E as LoomaMentionSuggestionPluginKey, F as LoomaTableOfContents, G as LoomaFigcaption, H as LoomaFootnoteReference, I as getTableOfContentsEntries, J as revealLoomaExpandAt, K as LoomaFigure, L as normalizeTableOfContentsConfig, M as LoomaImage, N as normalizeImageDimension, O as DEFAULT_MENTION_RESULT_LIMIT, P as normalizeImagePlacement, Q as LoomaCallout, R as LoomaTab, S as loomaMarkdownFromDoc, T as siteRelativeHref, U as LoomaFootnotes, V as LoomaFootnote, W as findLoomaFootnote, X as LoomaChip, Y as LOOMA_CHIP_COLORS, Z as normalizeLoomaChipColor, _ as getActiveTableCellAlignment, a as getActiveTableUiState, b as setActiveTableCellBackground, c as insertTableAtRange, d as LoomaTableKit, et as LOOMA_ACTIVE_BLOCK_CLASS, f as getDefaultEditorExtensions, g as LoomaTableHeader, h as LoomaTableCell, i as getDefaultSlashCommands, j as normalizeMentionResultLimit, k as MAX_MENTION_RESULT_LIMIT, l as normalizeActiveTableColumnWidths, m as LoomaTable, n as createLoomaSlashCommandExtension, nt as LoomaActiveBlock, o as handleTableAction, p as getLoomaTableExtensions, q as LoomaExpand, r as filterLoomaSlashCommands, rt as LoomaActiveBlockPluginKey, s as handleTableOverlayAction, t as LoomaSlashCommand, tt as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, u as shouldShowTextFormattingToolbar, v as getActiveTableCellBackground, w as createSiteRelativeLinks, x as LoomaSmartPaste, y as setActiveTableCellAlignment, z as LoomaTabs } from "../chunks/extensions.js";
3
- import { a as setReferenceDisplay, i as referenceDisplay, n as LoomaReferencePresentation, o as LOOMA_CALLOUT_TONES, r as getReferenceDisplay, t as LoomaReference } from "../chunks/reference-display.js";
4
- export { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, LOOMA_ACTIVE_BLOCK_CLASS, LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, LOOMA_CALLOUT_TONES, LOOMA_CHIP_COLORS, LOOMA_FOOTNOTE_LABEL, LoomaActiveBlock, LoomaActiveBlockPluginKey, LoomaCallout, LoomaChip, LoomaExpand, LoomaFigcaption, LoomaFigure, LoomaFootnote, LoomaFootnoteReference, LoomaFootnotes, LoomaImage, LoomaMentionSuggestionPluginKey, LoomaReference, LoomaReferencePresentation, LoomaSlashCommand, LoomaSmartPaste, LoomaTab, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, LoomaTableOfContents, LoomaTabs, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, createSiteRelativeLinks, filterLoomaMentionItems, filterLoomaSlashCommands, findLoomaFootnote, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, getReferenceDisplay, getTableOfContentsEntries, handleTableAction, handleTableOverlayAction, insertTableAtRange, loomaMarkdownFromDoc, loomaMarkdownToHtml, normalizeActiveTableColumnWidths, normalizeImageDimension, normalizeImagePlacement, normalizeLoomaChipColor, normalizeMentionResultLimit, normalizeTableOfContentsConfig, referenceDisplay, revealLoomaExpandAt, setActiveTableCellAlignment, setActiveTableCellBackground, setReferenceDisplay, shouldShowTextFormattingToolbar, siteRelativeHref };
2
+ import { $ as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, A as LoomaImage, B as LoomaFootnote, C as siteRelativeHref, D as MAX_MENTION_RESULT_LIMIT, E as DEFAULT_MENTION_RESULT_LIMIT, F as normalizeTableOfContentsConfig, G as LoomaExpand, H as findLoomaFootnote, I as LoomaTab, J as LoomaChip, K as revealLoomaExpandAt, L as LoomaTabs, M as normalizeImagePlacement, N as LoomaTableOfContents, O as filterLoomaMentionItems, P as getTableOfContentsEntries, Q as LOOMA_ACTIVE_BLOCK_CLASS, R as LoomaLinkDefinition, S as createSiteRelativeLinks, T as createLoomaMentionExtension, U as LoomaFigcaption, V as LoomaFootnoteReference, W as LoomaFigure, X as LoomaCallout, Y as normalizeLoomaChipColor, Z as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, _ as getActiveTableCellAlignment, a as getActiveTableUiState, b as setActiveTableCellBackground, c as insertTableAtRange, d as LoomaTableKit, et as LoomaActiveBlock, f as getDefaultEditorExtensions, g as LoomaTableHeader, h as LoomaTableCell, i as getDefaultSlashCommands, j as normalizeImageDimension, k as normalizeMentionResultLimit, l as normalizeActiveTableColumnWidths, m as LoomaTable, n as createLoomaSlashCommandExtension, o as handleTableAction, p as getLoomaTableExtensions, q as LOOMA_CHIP_COLORS, r as filterLoomaSlashCommands, s as handleTableOverlayAction, t as LoomaSlashCommand, tt as LoomaActiveBlockPluginKey, u as shouldShowTextFormattingToolbar, v as getActiveTableCellBackground, w as LoomaMentionSuggestionPluginKey, x as LoomaSmartPaste, y as setActiveTableCellAlignment, z as LOOMA_FOOTNOTE_LABEL } from "../chunks/extensions.js";
3
+ import { c as LoomaReferencePresentation, d as setReferenceDisplay, f as LOOMA_CALLOUT_TONES, l as getReferenceDisplay, s as LoomaReference, u as referenceDisplay } from "../chunks/expressmark.js";
4
+ export { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, LOOMA_ACTIVE_BLOCK_CLASS, LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, LOOMA_CALLOUT_TONES, LOOMA_CHIP_COLORS, LOOMA_FOOTNOTE_LABEL, LoomaActiveBlock, LoomaActiveBlockPluginKey, LoomaCallout, LoomaChip, LoomaExpand, LoomaFigcaption, LoomaFigure, LoomaFootnote, LoomaFootnoteReference, LoomaImage, LoomaLinkDefinition, LoomaMentionSuggestionPluginKey, LoomaReference, LoomaReferencePresentation, LoomaSlashCommand, LoomaSmartPaste, LoomaTab, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, LoomaTableOfContents, LoomaTabs, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, createSiteRelativeLinks, filterLoomaMentionItems, filterLoomaSlashCommands, findLoomaFootnote, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, getReferenceDisplay, getTableOfContentsEntries, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, normalizeImageDimension, normalizeImagePlacement, normalizeLoomaChipColor, normalizeMentionResultLimit, normalizeTableOfContentsConfig, referenceDisplay, revealLoomaExpandAt, setActiveTableCellAlignment, setActiveTableCellBackground, setReferenceDisplay, shouldShowTextFormattingToolbar, siteRelativeHref };
@@ -0,0 +1,10 @@
1
+ import { Node } from "@tiptap/core";
2
+ /**
3
+ * A link reference definition, `[label]: url "title"`, where it is written. A link that uses one
4
+ * keeps its label as `reference` and its spelling (`full`, `collapsed` or `shortcut`) as
5
+ * `referenceType`, and is written as a reference while the definition still gives its destination
6
+ * and title.
7
+ * @invariant It renders nothing in the editor, as in Markdown; saved HTML keeps it as a hidden
8
+ * element so the document reads back whole.
9
+ */
10
+ export declare const LoomaLinkDefinition: Node<any, any>;
package/editor/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { n as TABLE_CELL_BACKGROUND_PRESETS, t as TABLE_CELL_BACKGROUND_OPTIONS } from "./chunks/table-backgrounds.js";
2
2
  import { n as resolveTableCellAt, t as measureTableOverlayGeometry } from "./chunks/ui.js";
3
- import { $ as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, A as filterLoomaMentionItems, B as LOOMA_FOOTNOTE_LABEL, C as loomaMarkdownToHtml, D as createLoomaMentionExtension, E as LoomaMentionSuggestionPluginKey, F as LoomaTableOfContents, G as LoomaFigcaption, H as LoomaFootnoteReference, I as getTableOfContentsEntries, J as revealLoomaExpandAt, K as LoomaFigure, L as normalizeTableOfContentsConfig, M as LoomaImage, N as normalizeImageDimension, O as DEFAULT_MENTION_RESULT_LIMIT, P as normalizeImagePlacement, Q as LoomaCallout, R as LoomaTab, S as loomaMarkdownFromDoc, T as siteRelativeHref, U as LoomaFootnotes, V as LoomaFootnote, W as findLoomaFootnote, X as LoomaChip, Y as LOOMA_CHIP_COLORS, Z as normalizeLoomaChipColor, _ as getActiveTableCellAlignment, a as getActiveTableUiState, b as setActiveTableCellBackground, c as insertTableAtRange, d as LoomaTableKit, et as LOOMA_ACTIVE_BLOCK_CLASS, f as getDefaultEditorExtensions, g as LoomaTableHeader, h as LoomaTableCell, i as getDefaultSlashCommands, j as normalizeMentionResultLimit, k as MAX_MENTION_RESULT_LIMIT, l as normalizeActiveTableColumnWidths, m as LoomaTable, n as createLoomaSlashCommandExtension, nt as LoomaActiveBlock, o as handleTableAction, p as getLoomaTableExtensions, q as LoomaExpand, r as filterLoomaSlashCommands, rt as LoomaActiveBlockPluginKey, s as handleTableOverlayAction, t as LoomaSlashCommand, tt as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, u as shouldShowTextFormattingToolbar, v as getActiveTableCellBackground, w as createSiteRelativeLinks, x as LoomaSmartPaste, y as setActiveTableCellAlignment, z as LoomaTabs } from "./chunks/extensions.js";
4
- import { a as setReferenceDisplay, i as referenceDisplay, n as LoomaReferencePresentation, o as LOOMA_CALLOUT_TONES, r as getReferenceDisplay, t as LoomaReference } from "./chunks/reference-display.js";
3
+ import { $ as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, A as LoomaImage, B as LoomaFootnote, C as siteRelativeHref, D as MAX_MENTION_RESULT_LIMIT, E as DEFAULT_MENTION_RESULT_LIMIT, F as normalizeTableOfContentsConfig, G as LoomaExpand, H as findLoomaFootnote, I as LoomaTab, J as LoomaChip, K as revealLoomaExpandAt, L as LoomaTabs, M as normalizeImagePlacement, N as LoomaTableOfContents, O as filterLoomaMentionItems, P as getTableOfContentsEntries, Q as LOOMA_ACTIVE_BLOCK_CLASS, R as LoomaLinkDefinition, S as createSiteRelativeLinks, T as createLoomaMentionExtension, U as LoomaFigcaption, V as LoomaFootnoteReference, W as LoomaFigure, X as LoomaCallout, Y as normalizeLoomaChipColor, Z as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, _ as getActiveTableCellAlignment, a as getActiveTableUiState, b as setActiveTableCellBackground, c as insertTableAtRange, d as LoomaTableKit, et as LoomaActiveBlock, f as getDefaultEditorExtensions, g as LoomaTableHeader, h as LoomaTableCell, i as getDefaultSlashCommands, j as normalizeImageDimension, k as normalizeMentionResultLimit, l as normalizeActiveTableColumnWidths, m as LoomaTable, n as createLoomaSlashCommandExtension, o as handleTableAction, p as getLoomaTableExtensions, q as LOOMA_CHIP_COLORS, r as filterLoomaSlashCommands, s as handleTableOverlayAction, t as LoomaSlashCommand, tt as LoomaActiveBlockPluginKey, u as shouldShowTextFormattingToolbar, v as getActiveTableCellBackground, w as LoomaMentionSuggestionPluginKey, x as LoomaSmartPaste, y as setActiveTableCellAlignment, z as LOOMA_FOOTNOTE_LABEL } from "./chunks/extensions.js";
4
+ import { c as LoomaReferencePresentation, d as setReferenceDisplay, f as LOOMA_CALLOUT_TONES, l as getReferenceDisplay, s as LoomaReference, u as referenceDisplay } from "./chunks/expressmark.js";
5
5
  import { AlignCenter, AlignLeft, AlignRight, ArrowLeft, Bell, Bold, BookUser, Braces, Calculator, Check, ChevronDown, ChevronLeft, ChevronRight, CircleCheck, CircleDot, CircleQuestionMark, CircleX, CodeXml, Columns3, Compass, CreditCard, Ellipsis, Eraser, ExternalLink, FileText, Folder, GripHorizontal, GripVertical, Heading1, Heading2, Heading3, Highlighter, History, Image, Info, Italic, LayoutDashboard, Lightbulb, Link, List, ListOrdered, ListTodo, LoaderCircle, Menu, Merge, MessageSquareWarning, Minus, Monitor, Moon, NotebookPen, PaintBucket, PanelBottom, PanelLeft, PanelRight, PanelTop, Paperclip, Pencil, Pilcrow, Plus, Quote, Receipt, Redo2, Rows3, Search, Settings, Slash, Split, Strikethrough, Sun, Superscript, Table2, Tag, Trash2, TriangleAlert, Truck, Underline, Undo2, Unlink, UserRound, Users, X } from "lucide";
6
6
  //#region src/editor/icons.ts
7
7
  /** The opinionated Lucide set used by Looma's shipped interaction surfaces. */
@@ -131,4 +131,4 @@ function getVisualViewportRect(owner = window) {
131
131
  };
132
132
  }
133
133
  //#endregion
134
- export { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, LOOMA_ACTIVE_BLOCK_CLASS, LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, LOOMA_CALLOUT_TONES, LOOMA_CHIP_COLORS, LOOMA_FOOTNOTE_LABEL, LOOMA_ICONS, LoomaActiveBlock, LoomaActiveBlockPluginKey, LoomaCallout, LoomaChip, LoomaExpand, LoomaFigcaption, LoomaFigure, LoomaFootnote, LoomaFootnoteReference, LoomaFootnotes, LoomaImage, LoomaMentionSuggestionPluginKey, LoomaReference, LoomaReferencePresentation, LoomaSlashCommand, LoomaSmartPaste, LoomaTab, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, LoomaTableOfContents, LoomaTabs, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_OPTIONS, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, createSiteRelativeLinks, filterLoomaMentionItems, filterLoomaSlashCommands, findLoomaFootnote, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, getReferenceDisplay, getTableOfContentsEntries, getVisualViewportRect, handleTableAction, handleTableOverlayAction, insertTableAtRange, loomaIconMarkup, loomaMarkdownFromDoc, loomaMarkdownToHtml, measureTableOverlayGeometry, normalizeActiveTableColumnWidths, normalizeImageDimension, normalizeImagePlacement, normalizeLoomaChipColor, normalizeMentionResultLimit, normalizeTableOfContentsConfig, referenceDisplay, resolveTableCellAt, revealLoomaExpandAt, setActiveTableCellAlignment, setActiveTableCellBackground, setReferenceDisplay, shouldShowTextFormattingToolbar, siteRelativeHref };
134
+ export { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, LOOMA_ACTIVE_BLOCK_CLASS, LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, LOOMA_CALLOUT_TONES, LOOMA_CHIP_COLORS, LOOMA_FOOTNOTE_LABEL, LOOMA_ICONS, LoomaActiveBlock, LoomaActiveBlockPluginKey, LoomaCallout, LoomaChip, LoomaExpand, LoomaFigcaption, LoomaFigure, LoomaFootnote, LoomaFootnoteReference, LoomaImage, LoomaLinkDefinition, LoomaMentionSuggestionPluginKey, LoomaReference, LoomaReferencePresentation, LoomaSlashCommand, LoomaSmartPaste, LoomaTab, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, LoomaTableOfContents, LoomaTabs, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_OPTIONS, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, createSiteRelativeLinks, filterLoomaMentionItems, filterLoomaSlashCommands, findLoomaFootnote, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, getReferenceDisplay, getTableOfContentsEntries, getVisualViewportRect, handleTableAction, handleTableOverlayAction, insertTableAtRange, loomaIconMarkup, measureTableOverlayGeometry, normalizeActiveTableColumnWidths, normalizeImageDimension, normalizeImagePlacement, normalizeLoomaChipColor, normalizeMentionResultLimit, normalizeTableOfContentsConfig, referenceDisplay, resolveTableCellAt, revealLoomaExpandAt, setActiveTableCellAlignment, setActiveTableCellBackground, setReferenceDisplay, shouldShowTextFormattingToolbar, siteRelativeHref };
@@ -9,7 +9,7 @@ export interface LoomaMarkdownFixture {
9
9
  feature: string;
10
10
  name: string;
11
11
  markdown: string;
12
- /** The canonical HTML: what LoomaEditor saves and the markdown-it plugin renders. */
12
+ /** The canonical HTML: what LoomaEditor saves for the document. */
13
13
  html: string;
14
14
  /** What a writer produces from the document; the input itself when the case has no `case.canonical.md`. */
15
15
  canonical: string;
@@ -1,21 +1,24 @@
1
1
  //#endregion
2
2
  //#region src/markdown/fixtures.ts
3
3
  var files = /* #__PURE__ */ Object.assign({
4
- "../../markdown-fixtures/autolinks/bare.canonical.md": "Read <https://example.com/docs> and [www.example.com](http://www.example.com), or <https://example.com/start>.\n",
4
+ "../../markdown-fixtures/autolinks/bare.canonical.md": "Read [https://example.com/docs](https://example.com/docs) and [www.example.com](http://www.example.com), or [https://example.com/start](https://example.com/start).\n",
5
5
  "../../markdown-fixtures/autolinks/bare.html": "<p>Read <a href=\"https://example.com/docs\">https://example.com/docs</a> and <a href=\"http://www.example.com\">www.example.com</a>, or <a href=\"https://example.com/start\">https://example.com/start</a>.</p>\n",
6
6
  "../../markdown-fixtures/autolinks/bare.md": "Read https://example.com/docs and www.example.com, or <https://example.com/start>.\n",
7
7
  "../../markdown-fixtures/callouts/alert.canonical.md": "::: warning\nDeletes data.\n:::\n",
8
8
  "../../markdown-fixtures/callouts/alert.html": "<ui-callout tone=\"warning\">\n<p>Deletes data.</p>\n</ui-callout>\n",
9
9
  "../../markdown-fixtures/callouts/alert.md": "> [!WARNING]\n> Deletes data.\n",
10
- "../../markdown-fixtures/callouts/caution-alias.canonical.md": "::: danger Stop\nThis cannot be undone.\n:::\n",
10
+ "../../markdown-fixtures/callouts/caution-alias.canonical.md": "::: danger [Stop]\nThis cannot be undone.\n:::\n",
11
11
  "../../markdown-fixtures/callouts/caution-alias.html": "<ui-callout tone=\"danger\" heading=\"Stop\">\n<p>This cannot be undone.</p>\n</ui-callout>\n",
12
12
  "../../markdown-fixtures/callouts/caution-alias.md": "::: CAUTION Stop\nThis cannot be undone.\n:::\n",
13
13
  "../../markdown-fixtures/callouts/open-in-title.html": "<ui-callout tone=\"tip\" heading=\"Keep {open}\">\n<p>A callout title keeps its braces.</p>\n</ui-callout>\n",
14
- "../../markdown-fixtures/callouts/open-in-title.md": "::: tip Keep {open}\nA callout title keeps its braces.\n:::\n",
14
+ "../../markdown-fixtures/callouts/open-in-title.md": "::: tip [Keep {open}]\nA callout title keeps its braces.\n:::\n",
15
+ "../../markdown-fixtures/callouts/titled.canonical.md": "::: tip [Before you start]\nInstall **first**.\n:::\n",
15
16
  "../../markdown-fixtures/callouts/titled.html": "<ui-callout tone=\"tip\" heading=\"Before you start\">\n<p>Install <strong>first</strong>.</p>\n</ui-callout>\n",
16
17
  "../../markdown-fixtures/callouts/titled.md": "::: tip Before you start\nInstall **first**.\n:::\n",
18
+ "../../markdown-fixtures/chips/escaped-label.canonical.md": ":chip[Draft \\] v2]{tone=\"red\"}\n",
17
19
  "../../markdown-fixtures/chips/escaped-label.html": "<p><span data-looma-chip data-label=\"Draft ] v2\" data-color=\"red\">Draft ] v2</span></p>\n",
18
20
  "../../markdown-fixtures/chips/escaped-label.md": ":chip[Draft \\] v2]{tone=red}\n",
21
+ "../../markdown-fixtures/chips/tones.canonical.md": "Status :chip[Ready]{tone=\"green\"} and :chip[Draft].\n",
19
22
  "../../markdown-fixtures/chips/tones.html": "<p>Status <span data-looma-chip data-label=\"Ready\" data-color=\"green\">Ready</span> and <span data-looma-chip data-label=\"Draft\" data-color=\"neutral\">Draft</span>.</p>\n",
20
23
  "../../markdown-fixtures/chips/tones.md": "Status :chip[Ready]{tone=green} and :chip[Draft].\n",
21
24
  "../../markdown-fixtures/code-blocks/fences.canonical.md": "```ts\nconst answer = 42;\n```\n\n```\nplain text\n```\n\n```\nindented\n```\n",
@@ -29,36 +32,34 @@ var files = /* #__PURE__ */ Object.assign({
29
32
  "../../markdown-fixtures/code-meta/notation-escaped.md": "```md\nconst port = 8080; // [\\!code highlight]\nconst host = \"localhost\"; // [\\\\!code highlight:2]\n```\n",
30
33
  "../../markdown-fixtures/code-meta/notation.html": "<pre><code class=\"language-ts\">const port = 8080;</code></pre>\n",
31
34
  "../../markdown-fixtures/code-meta/notation.md": "```ts\nconst port = 8080; // [!code highlight]\n```\n",
35
+ "../../markdown-fixtures/code-meta/title-lines.canonical.md": "```ts {highlight=\"1,3-4\" show-line-numbers title=\"config.ts\"}\nexport default {\n name: \"docs\",\n base: \"/docs/\",\n};\n```\n",
32
36
  "../../markdown-fixtures/code-meta/title-lines.html": "<pre><code class=\"language-ts\" data-meta=\"title=&quot;config.ts&quot; {1,3-4} :line-numbers\">export default {\n name: &quot;docs&quot;,\n base: &quot;/docs/&quot;,\n};</code></pre>\n",
33
37
  "../../markdown-fixtures/code-meta/title-lines.md": "```ts title=\"config.ts\" {1,3-4} :line-numbers\nexport default {\n name: \"docs\",\n base: \"/docs/\",\n};\n```\n",
34
38
  "../../markdown-fixtures/containers/escaped-marker.html": "<p>::: tip is text here</p>\n",
35
39
  "../../markdown-fixtures/containers/escaped-marker.md": "\\::: tip is text here\n",
36
40
  "../../markdown-fixtures/containers/fence-inside.html": "<ui-callout tone=\"tip\">\n<pre><code class=\"language-md\">:::</code></pre>\n</ui-callout>\n",
37
41
  "../../markdown-fixtures/containers/fence-inside.md": "::: tip\n```md\n:::\n```\n:::\n",
38
- "../../markdown-fixtures/containers/nesting.canonical.md": ":::: details More\n::: warning\nNested.\n:::\n::::\n",
42
+ "../../markdown-fixtures/containers/nesting.canonical.md": ":::: details [More]\n::: warning\nNested.\n:::\n::::\n",
39
43
  "../../markdown-fixtures/containers/nesting.html": "<details><summary>More</summary>\n<ui-callout tone=\"warning\">\n<p>Nested.</p>\n</ui-callout>\n</details>\n",
40
- "../../markdown-fixtures/containers/nesting.md": "::: details More\n::: warning\nNested.\n:::\n:::\n",
44
+ "../../markdown-fixtures/containers/nesting.md": ":::: details More\n::: warning\nNested.\n:::\n::::\n",
41
45
  "../../markdown-fixtures/containers/unclosed.canonical.md": "::: note\nNo closing line.\n:::\n",
42
46
  "../../markdown-fixtures/containers/unclosed.html": "<ui-callout tone=\"note\">\n<p>No closing line.</p>\n</ui-callout>\n",
43
47
  "../../markdown-fixtures/containers/unclosed.md": "::: note\nNo closing line.\n",
44
- "../../markdown-fixtures/containers/unknown-name.canonical.md": "::: aside Text :::\n",
45
- "../../markdown-fixtures/containers/unknown-name.html": "<p>::: aside\nText\n:::</p>\n",
46
- "../../markdown-fixtures/containers/unknown-name.md": "::: aside\nText\n:::\n",
47
- "../../markdown-fixtures/details/default-summary.canonical.md": "::: details Details\nHidden until opened.\n:::\n",
48
+ "../../markdown-fixtures/details/default-summary.canonical.md": "::: details [Details]\nHidden until opened.\n:::\n",
48
49
  "../../markdown-fixtures/details/default-summary.html": "<details><summary>Details</summary>\n<p>Hidden until opened.</p>\n</details>\n",
49
50
  "../../markdown-fixtures/details/default-summary.md": "::: details\nHidden until opened.\n:::\n",
51
+ "../../markdown-fixtures/details/open.canonical.md": "::: details [Show the full log] {open}\nThe build finished in 42 seconds.\n:::\n",
50
52
  "../../markdown-fixtures/details/open.html": "<details open><summary>Show the full log</summary>\n<p>The build finished in 42 seconds.</p>\n</details>\n",
51
53
  "../../markdown-fixtures/details/open.md": "::: details Show the full log {open}\nThe build finished in 42 seconds.\n:::\n",
54
+ "../../markdown-fixtures/figures/caption.canonical.md": "::: figure [The build, from *source* to release]\n![The build pipeline](./pipeline.svg)\n:::\n",
52
55
  "../../markdown-fixtures/figures/caption.html": "<figure>\n<img src=\"./pipeline.svg\" alt=\"The build pipeline\">\n<figcaption>The build, from <em>source</em> to release</figcaption>\n</figure>\n",
53
56
  "../../markdown-fixtures/figures/caption.md": "::: figure The build, from *source* to release\n![The build pipeline](./pipeline.svg)\n:::\n",
54
57
  "../../markdown-fixtures/footnotes/basic.html": "<p>Markdown renders tables<sup><a href=\"#fn:tables\" id=\"fnref:tables\" data-footnote-ref=\"\" aria-describedby=\"footnote:label\">1</a></sup> and task lists<sup><a href=\"#fn:1\" id=\"fnref:1\" data-footnote-ref=\"\" aria-describedby=\"footnote:label\">2</a></sup>.</p>\n<section data-footnotes=\"\" class=\"footnotes\">\n<h2 id=\"footnote:label\" class=\"sr-only\">Footnotes</h2>\n<ol>\n<li id=\"fn:tables\">\n<p>GitHub Flavored Markdown tables. <a href=\"#fnref:tables\" data-footnote-backref=\"\" aria-label=\"Back to reference 1\">↩</a></p>\n</li>\n<li id=\"fn:1\">\n<p>Each item has a checkbox. <a href=\"#fnref:1\" data-footnote-backref=\"\" aria-label=\"Back to reference 2\">↩</a></p>\n</li>\n</ol>\n</section>\n",
55
58
  "../../markdown-fixtures/footnotes/basic.md": "Markdown renders tables[^tables] and task lists[^1].\n\n[^tables]: GitHub Flavored Markdown tables.\n\n[^1]: Each item has a checkbox.\n",
56
- "../../markdown-fixtures/footnotes/blocks.canonical.md": "The build writes a log[^log].\n\n[^log]: The log holds every step.\n\n ```sh\n pnpm build --verbose\n ```\n\n It is kept for a week.\n",
57
59
  "../../markdown-fixtures/footnotes/blocks.html": "<p>The build writes a log<sup><a href=\"#fn:log\" id=\"fnref:log\" data-footnote-ref=\"\" aria-describedby=\"footnote:label\">1</a></sup>.</p>\n<section data-footnotes=\"\" class=\"footnotes\">\n<h2 id=\"footnote:label\" class=\"sr-only\">Footnotes</h2>\n<ol>\n<li id=\"fn:log\">\n<p>The log holds every step.</p>\n<pre><code class=\"language-sh\">pnpm build --verbose</code></pre>\n<p>It is kept for a week. <a href=\"#fnref:log\" data-footnote-backref=\"\" aria-label=\"Back to reference 1\">↩</a></p>\n</li>\n</ol>\n</section>\n",
58
60
  "../../markdown-fixtures/footnotes/blocks.md": "[^log]: The log holds every step.\n\n ```sh\n pnpm build --verbose\n ```\n\n It is kept for a week.\n\nThe build writes a log[^log].\n",
59
61
  "../../markdown-fixtures/footnotes/repeated.html": "<p>The build<sup><a href=\"#fn:build\" id=\"fnref:build\" data-footnote-ref=\"\" aria-describedby=\"footnote:label\">1</a></sup> runs in CI, and every build<sup><a href=\"#fn:build\" id=\"fnref:build:2\" data-footnote-ref=\"\" aria-describedby=\"footnote:label\">1</a></sup> uploads its report<sup><a href=\"#fn:report\" id=\"fnref:report\" data-footnote-ref=\"\" aria-describedby=\"footnote:label\">2</a></sup>.</p>\n<section data-footnotes=\"\" class=\"footnotes\">\n<h2 id=\"footnote:label\" class=\"sr-only\">Footnotes</h2>\n<ol>\n<li id=\"fn:build\">\n<p>A clean install, then the tests. <a href=\"#fnref:build\" data-footnote-backref=\"\" aria-label=\"Back to reference 1\">↩</a> <a href=\"#fnref:build:2\" data-footnote-backref=\"\" aria-label=\"Back to reference 1-2\">↩<sup>2</sup></a></p>\n</li>\n<li id=\"fn:report\">\n<p>The coverage summary. <a href=\"#fnref:report\" data-footnote-backref=\"\" aria-label=\"Back to reference 2\">↩</a></p>\n</li>\n</ol>\n</section>\n",
60
62
  "../../markdown-fixtures/footnotes/repeated.md": "The build[^build] runs in CI, and every build[^build] uploads its report[^report].\n\n[^build]: A clean install, then the tests.\n\n[^report]: The coverage summary.\n",
61
- "../../markdown-fixtures/footnotes/unreferenced.canonical.md": "A note with no definition\\[^missing\\] stays text, and a definition nobody refers to renders nothing.\n",
62
63
  "../../markdown-fixtures/footnotes/unreferenced.html": "<p>A note with no definition[^missing] stays text, and a definition nobody refers to renders nothing.</p>\n",
63
64
  "../../markdown-fixtures/footnotes/unreferenced.md": "A note with no definition[^missing] stays text, and a definition nobody refers to renders nothing.\n\n[^unused]: Unused.\n",
64
65
  "../../markdown-fixtures/front-matter/list-only.canonical.md": "# Notes\n",
@@ -89,6 +90,7 @@ var files = /* #__PURE__ */ Object.assign({
89
90
  "../../markdown-fixtures/heading-ids/literal-braces.md": "## Price \\{#usd}\n",
90
91
  "../../markdown-fixtures/headings/levels.html": "<h1 id=\"one\">One</h1>\n<h2 id=\"two\">Two</h2>\n<h3 id=\"three\">Three</h3>\n<h4 id=\"four\">Four</h4>\n<h5 id=\"five\">Five</h5>\n<h6 id=\"six\">Six</h6>\n",
91
92
  "../../markdown-fixtures/headings/levels.md": "# One\n\n## Two\n\n### Three\n\n#### Four\n\n##### Five\n\n###### Six\n",
93
+ "../../markdown-fixtures/image-attributes/placed.canonical.md": "![Pipeline](./pipeline.svg){width=\"640\" height=\"360\" placement=\"wrap-left\" responsive}\n",
92
94
  "../../markdown-fixtures/image-attributes/placed.html": "<img src=\"./pipeline.svg\" alt=\"Pipeline\" width=\"640\" height=\"360\" data-placement=\"wrap-left\" data-looma-responsive>\n",
93
95
  "../../markdown-fixtures/image-attributes/placed.md": "![Pipeline](./pipeline.svg){width=640 height=360 placement=wrap-left responsive}\n",
94
96
  "../../markdown-fixtures/images/block.html": "<img src=\"./pipeline.svg\" alt=\"The build pipeline\" title=\"Build pipeline\">\n",
@@ -97,29 +99,33 @@ var files = /* #__PURE__ */ Object.assign({
97
99
  "../../markdown-fixtures/lists/blocks.md": "- One\n - Nested\n- Two\n\n3. Three\n4. Four\n\n> Quoted\n\n---\n",
98
100
  "../../markdown-fixtures/mentions/person.html": "<p>Thanks, <span data-type=\"mention\" class=\"looma-mention\" data-id=\"u1\" data-label=\"Ada Lovelace\">@Ada Lovelace</span>.</p>\n",
99
101
  "../../markdown-fixtures/mentions/person.md": "Thanks, @[Ada Lovelace]#u1.\n",
102
+ "../../markdown-fixtures/tables/gfm.canonical.md": "::: table {align=\"-,end,center\"}\n\n- Package: looma\n Version: 0.28\n Notes: Components\n\n:::\n",
100
103
  "../../markdown-fixtures/tables/gfm.html": "<table>\n<thead>\n<tr>\n<th>Package</th>\n<th style=\"text-align:right\">Version</th>\n<th style=\"text-align:center\">Notes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>looma</td>\n<td style=\"text-align:right\">0.28</td>\n<td style=\"text-align:center\">Components</td>\n</tr>\n</tbody>\n</table>\n",
101
104
  "../../markdown-fixtures/tables/gfm.md": "| Package | Version | Notes |\n| --- | ---: | :---: |\n| looma | 0.28 | Components |\n",
105
+ "../../markdown-fixtures/tables/left-aligned.canonical.md": "::: table {align=\"start,-\"}\n\n- Name: a | b\n Notes: `x | y`\n\n:::\n",
102
106
  "../../markdown-fixtures/tables/left-aligned.html": "<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Name</th>\n<th>Notes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">a | b</td>\n<td><code>x | y</code></td>\n</tr>\n</tbody>\n</table>\n",
103
107
  "../../markdown-fixtures/tables/left-aligned.md": "| Name | Notes |\n| :--- | --- |\n| a \\| b | `x \\| y` |\n",
104
- "../../markdown-fixtures/tables/rich.canonical.md": "<table><tbody><tr><th><p>Status</p></th><th><p>Owner</p></th></tr><tr><td style=\"background-color: rgb(220, 252, 231);\"><p>Done</p><ul><li><p>Shipped</p></li></ul></td><td style=\"text-align: center;\"><p>Ada</p></td></tr></tbody></table>\n",
108
+ "../../markdown-fixtures/tables/rich.canonical.md": "<table><tr><th>Status</th><th>Owner</th></tr><tr><td data-background-color=\"#dcfce7\" data-attributes=\"{&quot;backgroundColor&quot;:&quot;#dcfce7&quot;}\"><p>Done</p><ul><li><p>Shipped</p></li></ul></td><td data-text-align=\"center\" data-attributes=\"{&quot;textAlign&quot;:&quot;center&quot;}\">Ada</td></tr></table>\n",
105
109
  "../../markdown-fixtures/tables/rich.html": "<table><tbody><tr><th><p>Status</p></th><th><p>Owner</p></th></tr><tr><td style=\"background-color: #dcfce7\"><p>Done</p><ul><li><p>Shipped</p></li></ul></td><td colspan=\"1\" rowspan=\"1\" style=\"text-align: center\"><p>Ada</p></td></tr></tbody></table>\n",
106
- "../../markdown-fixtures/tables/rich.md": "<table><tbody><tr><th><p>Status</p></th><th><p>Owner</p></th></tr><tr><td style=\"background-color: #dcfce7\"><p>Done</p><ul><li><p>Shipped</p></li></ul></td><td colspan=\"1\" rowspan=\"1\" style=\"text-align: center\"><p>Ada</p></td></tr></tbody></table>\n",
110
+ "../../markdown-fixtures/tables/rich.md": "<table><tr><th><p>Status</p></th><th><p>Owner</p></th></tr><tr><td style=\"background-color:#dcfce7\" data-attributes=\"{&quot;style&quot;:&quot;background-color:#dcfce7&quot;}\"><p>Done</p><ul><li><p>Shipped</p></li></ul></td><td style=\"text-align:center\" colspan=\"1\" rowspan=\"1\" data-attributes=\"{&quot;style&quot;:&quot;text-align:center&quot;}\"><p>Ada</p></td></tr></table>\n",
111
+ "../../markdown-fixtures/tabs/code-group.canonical.md": "::: code-group\n```js {title=\"looma.config.js\"}\nexport default { theme: \"light\" };\n```\n\n```ts\nexport default { theme: \"light\" } satisfies Config;\n```\n:::\n",
107
112
  "../../markdown-fixtures/tabs/code-group.html": "<ui-tabs class=\"code-group\" group=\"code-group\">\n<section aria-label=\"looma.config.js\">\n<pre><code class=\"language-js\" data-meta=\"title=&quot;looma.config.js&quot;\">export default { theme: &quot;light&quot; };</code></pre>\n</section>\n<section aria-label=\"ts\">\n<pre><code class=\"language-ts\">export default { theme: &quot;light&quot; } satisfies Config;</code></pre>\n</section>\n</ui-tabs>\n",
108
113
  "../../markdown-fixtures/tabs/code-group.md": "::: code-group\n```js title=\"looma.config.js\"\nexport default { theme: \"light\" };\n```\n```ts\nexport default { theme: \"light\" } satisfies Config;\n```\n:::\n",
114
+ "../../markdown-fixtures/tabs/labelled.canonical.md": ":::: tabs {group=\"install\"}\n::: tab [npm]\n```sh\nnpm install @threadlabs/looma\n```\n:::\n\n::: tab [pnpm]\n```sh\npnpm add @threadlabs/looma\n```\n:::\n::::\n",
109
115
  "../../markdown-fixtures/tabs/labelled.html": "<ui-tabs group=\"install\">\n<section aria-label=\"npm\">\n<pre><code class=\"language-sh\">npm install @threadlabs/looma</code></pre>\n</section>\n<section aria-label=\"pnpm\">\n<pre><code class=\"language-sh\">pnpm add @threadlabs/looma</code></pre>\n</section>\n</ui-tabs>\n",
110
- "../../markdown-fixtures/tabs/labelled.md": "::: tabs install\n== npm\n```sh\nnpm install @threadlabs/looma\n```\n== pnpm\n```sh\npnpm add @threadlabs/looma\n```\n:::\n",
116
+ "../../markdown-fixtures/tabs/labelled.md": ":::: tabs {group=install}\n::: tab [npm]\n```sh\nnpm install @threadlabs/looma\n```\n:::\n\n::: tab [pnpm]\n```sh\npnpm add @threadlabs/looma\n```\n:::\n::::\n",
111
117
  "../../markdown-fixtures/task-lists/checked.html": "<ul data-type=\"taskList\">\n<li data-type=\"taskItem\" data-checked=\"true\"><label><input type=\"checkbox\" disabled checked> Read the changelog</label></li>\n<li data-type=\"taskItem\" data-checked=\"false\"><label><input type=\"checkbox\" disabled> Run the migration</label></li>\n</ul>\n",
112
118
  "../../markdown-fixtures/task-lists/checked.md": "- [x] Read the changelog\n- [ ] Run the migration\n",
113
119
  "../../markdown-fixtures/task-lists/loose.canonical.md": "- [x] Read the changelog\n\n Then tell the team.\n- [ ] Run the migration\n",
114
120
  "../../markdown-fixtures/task-lists/loose.html": "<ul data-type=\"taskList\">\n<li data-type=\"taskItem\" data-checked=\"true\">\n<p><label><input type=\"checkbox\" disabled checked> Read the changelog</label></p>\n<p>Then tell the team.</p>\n</li>\n<li data-type=\"taskItem\" data-checked=\"false\">\n<p><label><input type=\"checkbox\" disabled> Run the migration</label></p>\n</li>\n</ul>\n",
115
121
  "../../markdown-fixtures/task-lists/loose.md": "- [x] Read the changelog\n\n Then tell the team.\n\n- [ ] Run the migration\n",
116
- "../../markdown-fixtures/task-lists/mixed.canonical.md": "- \\[x\\] Done\n- Not a task\n",
117
- "../../markdown-fixtures/task-lists/mixed.html": "<ul>\n<li>[x] Done</li>\n<li>Not a task</li>\n</ul>\n",
122
+ "../../markdown-fixtures/task-lists/mixed.html": "<ul data-type=\"taskList\">\n<li data-type=\"taskItem\" data-checked=\"true\"><label><input type=\"checkbox\" checked=\"checked\" aria-label=\"Done\"><span></span></label><div><p>Done</p></div></li>\n<li><p>Not a task</p></li>\n</ul>\n",
118
123
  "../../markdown-fixtures/task-lists/mixed.md": "- [x] Done\n- Not a task\n",
119
124
  "../../markdown-fixtures/text/marks.html": "<p><strong>bold</strong> <em>italic</em> <s>struck</s> <code>code</code> <u>underlined</u> <mark>highlighted</mark></p>\n<p><a href=\"https://example.com/looma\">Looma</a> ends a line<br>\nhere.</p>\n",
120
125
  "../../markdown-fixtures/text/marks.md": "**bold** *italic* ~~struck~~ `code` <u>underlined</u> <mark>highlighted</mark>\n\n[Looma](https://example.com/looma) ends a line\\\nhere.\n",
121
126
  "../../markdown-fixtures/toc/default.html": "<nav data-looma-toc data-format=\"plain\" data-depth=\"3\" aria-label=\"Table of contents\"><strong>Table of contents</strong><div role=\"list\"><div role=\"listitem\"><a href=\"#guide\">Guide</a><div role=\"list\"><div role=\"listitem\"><a href=\"#install\">Install</a></div></div></div></div></nav>\n<h1 id=\"guide\">Guide</h1>\n<h2 id=\"install\">Install</h2>\n",
122
127
  "../../markdown-fixtures/toc/default.md": "::toc\n\n# Guide\n\n## Install\n",
128
+ "../../markdown-fixtures/toc/numbered.canonical.md": "::toc {depth=\"2\" format=\"numbered\"}\n\n## Install\n\n### Options\n\n## Use\n",
123
129
  "../../markdown-fixtures/toc/numbered.html": "<nav data-looma-toc data-format=\"numbered\" data-depth=\"2\" aria-label=\"Table of contents\"><strong>Table of contents</strong><ol role=\"list\"><li role=\"listitem\"><a href=\"#install\">Install</a></li><li role=\"listitem\"><a href=\"#use\">Use</a></li></ol></nav>\n<h2 id=\"install\">Install</h2>\n<h3 id=\"options\">Options</h3>\n<h2 id=\"use\">Use</h2>\n",
124
130
  "../../markdown-fixtures/toc/numbered.md": "::toc{depth=2 format=numbered}\n\n## Install\n\n### Options\n\n## Use\n"
125
131
  });
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * Looma Markdown's vocabulary and pure rules, shared by every reader and writer.
3
3
  *
4
- * Nothing here touches the DOM or a Markdown parser, so it is safe to import during SSR. The
5
- * markdown-it plugin is `@threadlabs/looma/markdown/markdown-it`; conformance fixtures are
6
- * `@threadlabs/looma/markdown/fixtures`.
4
+ * Nothing here touches the DOM or a Markdown parser, so it is safe to import during SSR. Expressmark
5
+ * reads and writes the Markdown; conformance fixtures are `@threadlabs/looma/markdown/fixtures`.
7
6
  */
8
7
  /** The meanings Callout and Badge share. Callout adds `note`, `tip` and `important`; Badge adds `accent`. */
9
8
  export declare const LOOMA_MEANING_TONES: readonly ["neutral", "info", "success", "warning", "danger"];
package/markdown/index.js CHANGED
@@ -2,9 +2,8 @@
2
2
  /**
3
3
  * Looma Markdown's vocabulary and pure rules, shared by every reader and writer.
4
4
  *
5
- * Nothing here touches the DOM or a Markdown parser, so it is safe to import during SSR. The
6
- * markdown-it plugin is `@threadlabs/looma/markdown/markdown-it`; conformance fixtures are
7
- * `@threadlabs/looma/markdown/fixtures`.
5
+ * Nothing here touches the DOM or a Markdown parser, so it is safe to import during SSR. Expressmark
6
+ * reads and writes the Markdown; conformance fixtures are `@threadlabs/looma/markdown/fixtures`.
8
7
  */
9
8
  /** The meanings Callout and Badge share. Callout adds `note`, `tip` and `important`; Badge adds `accent`. */
10
9
  var LOOMA_MEANING_TONES = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.45.2",
3
+ "version": "0.46.1",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -55,11 +55,6 @@
55
55
  "import": "./markdown/index.js",
56
56
  "default": "./markdown/index.js"
57
57
  },
58
- "./markdown/markdown-it": {
59
- "types": "./markdown/markdown-it.d.ts",
60
- "import": "./markdown/markdown-it.js",
61
- "default": "./markdown/markdown-it.js"
62
- },
63
58
  "./markdown/fixtures": {
64
59
  "types": "./markdown/fixtures.d.ts",
65
60
  "import": "./markdown/fixtures.js",
@@ -117,9 +112,8 @@
117
112
  "dompurify": "3.4.15",
118
113
  "highlight.js": "11.11.2",
119
114
  "lowlight": "^3.3.0",
120
- "markdown-it": "14.3.1",
121
115
  "lucide": "~0.554.0",
122
- "expressmark": ">=0.2.2 <1",
116
+ "expressmark": ">=0.4.0 <1",
123
117
  "parse5": "^8.0.1"
124
118
  },
125
119
  "peerDependencies": {
@@ -199,7 +193,6 @@
199
193
  "@tiptap/pm": "^2.11.5",
200
194
  "@tiptap/suggestion": "^2.11.5",
201
195
  "@tiptap/vue-3": "^2.11.5",
202
- "@types/markdown-it": "14.2.0",
203
196
  "@vitest/browser": "~3.2.6",
204
197
  "axe-core": "^4.10.3",
205
198
  "jsdom": "^27.0.0"
@@ -32,13 +32,14 @@
32
32
  box-sizing: border-box !important;
33
33
  margin: 0 !important;
34
34
  padding-block-start: var(--ui-space-4) !important;
35
+ padding-inline: calc(var(--ui-space-5) - var(--ui-space-2)) !important;
35
36
  }
36
37
 
37
38
  .legend {
38
39
  max-inline-size: 100%;
39
40
  box-sizing: border-box !important;
40
41
  padding-inline: var(--ui-space-2) !important;
41
- margin-inline-start: calc(-1 * var(--ui-space-2)) !important;
42
+ margin: 0 !important;
42
43
  overflow-wrap: anywhere;
43
44
  }
44
45
 
@@ -46,8 +47,16 @@
46
47
  transform: translateY(-1px);
47
48
  }
48
49
 
49
- :scope:where([data-component~="ui-section"])[data-ui-section-state~="variant=fieldset"] .head {
50
- margin-block-end: var(--ui-space-4) !important;
50
+ .content {
51
+ display: flex !important;
52
+ flex-direction: column !important;
53
+ gap: var(--ui-space-4) !important;
54
+ padding-inline: var(--ui-space-2) !important;
55
+ min-inline-size: 0;
56
+ }
57
+
58
+ :scope:where([data-component~="ui-section"])[data-ui-section-state~="variant=fieldset"] .body {
59
+ display: contents !important;
51
60
  }
52
61
 
53
62
  :scope:where([data-component~="ui-section"])[data-ui-section-state~="variant=fieldset"] .head:has(.description:empty):has(.actions:empty) {
@@ -83,8 +83,8 @@
83
83
  column-gap: var(--ui-space-4) !important;
84
84
  }
85
85
  }
86
- /* The same navigation remains inline before upgrade and on desktop. No links are cloned or moved. */
87
- .navigation-panel {
86
+ /* One live navigation stays inline until its native mobile dialog opens. */
87
+ .inline-navigation {
88
88
  position: static;
89
89
  display: flex !important;
90
90
  align-items: baseline !important;
@@ -96,6 +96,7 @@
96
96
  background: transparent;
97
97
  color: inherit;
98
98
  }
99
+ :scope:where([data-component~="ui-site-header"])[data-ui-site-header-state~="drawer"] .inline-navigation,
99
100
  .navigation-panel:not([open]), .menu, .panel-heading {
100
101
  display: none !important;
101
102
  }
@@ -112,6 +113,26 @@
112
113
  justify-items: center !important;
113
114
  flex: none;
114
115
  }
116
+ /* Authored native sidebar triggers remain usable before JavaScript upgrades the header. */
117
+ @media (width < 40rem) {
118
+ :scope:where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=sm"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .identity { flex-wrap: nowrap !important; align-items: center !important; }
119
+ :scope:where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=sm"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .brand { flex: 1 1 0; }
120
+ :scope:where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=sm"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .menu { display: grid !important; grid-template-columns: minmax(max-content, var(--ui-control-min-block-size)) !important; justify-items: center !important; flex: none; }
121
+ :scope:where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=sm"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .inline-navigation { display: none !important; }
122
+ }
123
+ @media (width < 48rem) {
124
+ :scope:where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=md"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .identity { flex-wrap: nowrap !important; align-items: center !important; }
125
+ :scope:where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=md"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .brand { flex: 1 1 0; }
126
+ :scope:where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=md"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .menu { display: grid !important; grid-template-columns: minmax(max-content, var(--ui-control-min-block-size)) !important; justify-items: center !important; flex: none; }
127
+ :scope:where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=md"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .inline-navigation { display: none !important; }
128
+ }
129
+ @media (width < 64rem) {
130
+ :scope:where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=lg"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .identity { flex-wrap: nowrap !important; align-items: center !important; }
131
+ :scope:where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=lg"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .brand { flex: 1 1 0; }
132
+ :scope:where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=lg"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .menu { display: grid !important; grid-template-columns: minmax(max-content, var(--ui-control-min-block-size)) !important; justify-items: center !important; flex: none; }
133
+ :scope:where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=lg"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .inline-navigation { display: none !important; }
134
+ }
135
+
115
136
  .automatic-menu {
116
137
  display: grid !important;
117
138
  justify-items: center !important;
@@ -248,7 +269,14 @@
248
269
  }
249
270
  @media (min-width: 64rem) {
250
271
  }
251
- /* The same navigation remains inline before upgrade and on desktop. No links are cloned or moved. */
272
+ /* One live navigation stays inline until its native mobile dialog opens. */
273
+ /* Authored native sidebar triggers remain usable before JavaScript upgrades the header. */
274
+ @media (width < 40rem) {
275
+ }
276
+ @media (width < 48rem) {
277
+ }
278
+ @media (width < 64rem) {
279
+ }
252
280
  @starting-style {
253
281
  }
254
282
  @media (prefers-reduced-motion: reduce) {
@@ -331,8 +359,8 @@
331
359
  column-gap: var(--ui-space-4) !important;
332
360
  }
333
361
  }
334
- /* The same navigation remains inline before upgrade and on desktop. No links are cloned or moved. */
335
- .navigation-panel:where(:scope, :scope *) {
362
+ /* One live navigation stays inline until its native mobile dialog opens. */
363
+ .inline-navigation:where(:scope, :scope *) {
336
364
  position: static;
337
365
  display: flex !important;
338
366
  align-items: baseline !important;
@@ -344,7 +372,7 @@
344
372
  background: transparent;
345
373
  color: inherit;
346
374
  }
347
- .navigation-panel:not([open]):where(:scope, :scope *), .menu:where(:scope, :scope *), .panel-heading:where(:scope, :scope *) {
375
+ :where([data-component~="ui-site-header"])[data-ui-site-header-state~="drawer"] .inline-navigation:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-site-header"]))), .navigation-panel:not([open]):where(:scope, :scope *), .menu:where(:scope, :scope *), .panel-heading:where(:scope, :scope *) {
348
376
  display: none !important;
349
377
  }
350
378
  :where([data-component~="ui-site-header"])[data-ui-site-header-state~="drawer"] .identity:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-site-header"]))) {
@@ -360,6 +388,26 @@
360
388
  justify-items: center !important;
361
389
  flex: none;
362
390
  }
391
+ /* Authored native sidebar triggers remain usable before JavaScript upgrades the header. */
392
+ @media (width < 40rem) {
393
+ :where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=sm"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .identity:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-site-header"]))) { flex-wrap: nowrap !important; align-items: center !important; }
394
+ :where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=sm"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .brand:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-site-header"]))) { flex: 1 1 0; }
395
+ :where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=sm"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .menu:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-site-header"]))) { display: grid !important; grid-template-columns: minmax(max-content, var(--ui-control-min-block-size)) !important; justify-items: center !important; flex: none; }
396
+ :where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=sm"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .inline-navigation:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-site-header"]))) { display: none !important; }
397
+ }
398
+ @media (width < 48rem) {
399
+ :where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=md"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .identity:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-site-header"]))) { flex-wrap: nowrap !important; align-items: center !important; }
400
+ :where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=md"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .brand:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-site-header"]))) { flex: 1 1 0; }
401
+ :where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=md"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .menu:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-site-header"]))) { display: grid !important; grid-template-columns: minmax(max-content, var(--ui-control-min-block-size)) !important; justify-items: center !important; flex: none; }
402
+ :where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=md"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .inline-navigation:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-site-header"]))) { display: none !important; }
403
+ }
404
+ @media (width < 64rem) {
405
+ :where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=lg"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .identity:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-site-header"]))) { flex-wrap: nowrap !important; align-items: center !important; }
406
+ :where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=lg"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .brand:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-site-header"]))) { flex: 1 1 0; }
407
+ :where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=lg"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .menu:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-site-header"]))) { display: grid !important; grid-template-columns: minmax(max-content, var(--ui-control-min-block-size)) !important; justify-items: center !important; flex: none; }
408
+ :where([data-component~="ui-site-header"])[data-ui-site-header-state~="breakpoint=lg"]:not([data-ui-site-header-state~="enhanced"]):has(.custom-menu:not(:empty)) .inline-navigation:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-site-header"]))) { display: none !important; }
409
+ }
410
+
363
411
  .automatic-menu:where(:scope, :scope *) {
364
412
  display: grid !important;
365
413
  justify-items: center !important;
@@ -2,7 +2,7 @@
2
2
  import { attachGeneratedController, buildTemplate, toAttribute, toText, truthy, writeAttribute, dispose, formatOf, keywordFormat, hostState, acceptProps, manageProps, generatedInputs, project, fillSlot, armElement, replaceRoot, checkFormat, checkString, defineComponent } from "@nextwebwg/html-next/generated-runtime";
3
3
  import "../styles/ui-section.css";
4
4
 
5
- const T0 = ["",[],"\n ",["legend",["class","legend"],["h2",["class","heading"],0]],"\n ",["span",["class","head"],"\n ",["span",["class","copy"],["span",["class","description"],4]],"\n ",["span",["class","actions"],4],"\n "],"\n ",["span",["class","body"],4],"\n "];
5
+ const T0 = ["",[],"\n ",["legend",["class","legend"],["h2",["class","heading"],0]],"\n ",["span",["class","content"],"\n ",["span",["class","head"],"\n ",["span",["class","copy"],["span",["class","description"],4]],"\n ",["span",["class","actions"],4],"\n "],"\n ",["span",["class","body"],4],"\n "],"\n "];
6
6
  const T1 = ["",[]];
7
7
  const T2 = ["",[]];
8
8
  const T3 = ["",[]];
@@ -92,10 +92,11 @@ export function createUiSection(options = {}, html) {
92
92
  const t1 = t0.firstChild.firstChild;
93
93
  const t2 = t0.nextSibling.nextSibling;
94
94
  const t3 = t2.firstChild.nextSibling;
95
- const t4 = t3.firstChild.firstChild;
96
- const t5 = t3.nextSibling.nextSibling.firstChild;
97
- const t6 = t2.nextSibling.nextSibling.firstChild;
98
- const r = { n, a0: t0, a1: t1, v0: null, v1: "", v2: undefined, a2: t4, e0: t4.nextSibling, b0: undefined, f0: undefined, a3: t5, e1: t5.nextSibling, b1: undefined, f1: undefined, a4: t6, e2: t6.nextSibling, b2: undefined, f2: undefined };
95
+ const t4 = t3.firstChild.nextSibling;
96
+ const t5 = t4.firstChild.firstChild;
97
+ const t6 = t4.nextSibling.nextSibling.firstChild;
98
+ const t7 = t3.nextSibling.nextSibling.firstChild;
99
+ const r = { n, a0: t0, a1: t1, v0: null, v1: "", v2: undefined, a2: t5, e0: t5.nextSibling, b0: undefined, f0: undefined, a3: t6, e1: t6.nextSibling, b1: undefined, f1: undefined, a4: t7, e2: t7.nextSibling, b2: undefined, f2: undefined };
99
100
  p0(r, -1, d);
100
101
  return r;
101
102
  };