@threadlabs/looma 0.53.2 → 0.53.3

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.
@@ -40,6 +40,19 @@ See the [proposal and syntax](https://nextwebwg.org/expressive-markdown/) and
40
40
 
41
41
  ## Conversion behavior
42
42
 
43
+ Leading-pipe line blocks load as `loomaLineBlock` text blocks. Their explicit
44
+ line breaks, inline formatting and line-block identity survive editing, HTML
45
+ and Markdown export. Repeated identical emphasis becomes one editor mark.
46
+ List items that begin with a quote or another block receive the empty leading
47
+ paragraph required by editor list commands, retaining their authored blocks.
48
+
49
+ HTML disclosures whose opening, Markdown body and closing tags are separate
50
+ CommonMark blocks load as one editable section. Nested sections retain their
51
+ boundaries. An unchanged section keeps its original HTML source when writing
52
+ with `original`; editing its body writes the current section while preserving
53
+ adjacent authored blocks. An unclosed section contains the rest of its enclosing
54
+ content, following HTML, and an empty section receives an editable paragraph.
55
+
43
56
  Ordinary punctuation stays readable: ranges such as `[-1, 1]`, `array[index]`,
44
57
  `user_id` and `a@word` do not need backslashes. The shared writer escapes text
45
58
  only when its context would interpret it as syntax. Mentions start at the
package/docs/catalog.json CHANGED
@@ -780,7 +780,7 @@
780
780
  ],
781
781
  "schemaVersion": 1,
782
782
  "package": "@threadlabs/looma",
783
- "version": "0.53.2",
783
+ "version": "0.53.3",
784
784
  "groups": [
785
785
  {
786
786
  "id": "layout",
@@ -334,6 +334,7 @@ var plainTitle = (node, path) => {
334
334
  var AST_FIELDS = {
335
335
  text: [],
336
336
  paragraph: [],
337
+ lineBlock: [],
337
338
  heading: ["level"],
338
339
  break: [],
339
340
  softBreak: [],
@@ -679,6 +680,7 @@ function toBareNode(node, path, context) {
679
680
  value: node.text ?? ""
680
681
  };
681
682
  case "paragraph": return plain("paragraph");
683
+ case "loomaLineBlock": return plain("lineBlock");
682
684
  case "heading": return plain("heading", ["level", "id"], {
683
685
  level: Number(attrs.level ?? 1),
684
686
  ...context.headingIds.has(node) ? { id: context.headingIds.get(node) } : context.custom.has(node) ? { id: string(attrs.id) } : {}
@@ -1030,6 +1032,47 @@ function editorDocumentToExpressmark(document, options = {}) {
1030
1032
  })
1031
1033
  };
1032
1034
  }
1035
+ function blockGroups(nodes) {
1036
+ let cursor = 0;
1037
+ const read = (inside = false) => {
1038
+ const groups = [];
1039
+ while (cursor < nodes.length) {
1040
+ const start = cursor;
1041
+ const node = nodes[cursor++];
1042
+ const fragment = node.type === "html" && node.display === "block" ? node.value?.trim() : void 0;
1043
+ if (fragment && /^<\/?details\b/i.test(fragment)) {
1044
+ for (const key of Object.keys(node)) if (![
1045
+ "type",
1046
+ "display",
1047
+ "value",
1048
+ "source",
1049
+ "position"
1050
+ ].includes(key)) fail(`document.body[${start}]`, `HTML fragment field ${key}`);
1051
+ }
1052
+ if (inside && fragment && /^<\/details\s*>$/i.test(fragment)) return groups;
1053
+ if (fragment && /^<details\b/i.test(fragment) && !/<\/details\s*>/i.test(fragment)) {
1054
+ const shell = parse(`${fragment}</details>`, { syntax: "compatible" }).body;
1055
+ if (shell.length === 1 && shell[0].type === "container" && shell[0].subType === "details") {
1056
+ const children = read(true);
1057
+ groups.push({
1058
+ node: {
1059
+ ...shell[0],
1060
+ body: [...shell[0].body ?? [], ...children.map((group) => group.node)]
1061
+ },
1062
+ source: nodes.slice(start, cursor)
1063
+ });
1064
+ continue;
1065
+ }
1066
+ }
1067
+ groups.push({
1068
+ node,
1069
+ source: [node]
1070
+ });
1071
+ }
1072
+ return groups;
1073
+ };
1074
+ return read();
1075
+ }
1033
1076
  function fromNode(node, path, context, marks = []) {
1034
1077
  const attrs = node.attributes ?? {};
1035
1078
  const allowed = /* @__PURE__ */ new Set([
@@ -1053,7 +1096,7 @@ function fromNode(node, path, context, marks = []) {
1053
1096
  for (const key of Object.keys(attrs)) if (!keys.includes(key)) fail(path, `attribute ${key}`);
1054
1097
  if (node.id && node.type !== "heading") fail(path, `ID on ${node.type}`);
1055
1098
  };
1056
- const children = () => content(node).flatMap((child, index) => fromNode(child, `${path}.body[${index}]`, context));
1099
+ const children = () => blockGroups(content(node)).flatMap((group, index) => fromNode(group.node, `${path}.body[${index}]`, context));
1057
1100
  const inline = () => content(node).flatMap((child, index) => fromNode(child, `${path}.children[${index}]`, context, marks));
1058
1101
  const wrap = (type, attributes) => [{
1059
1102
  type,
@@ -1103,7 +1146,9 @@ function fromNode(node, path, context, marks = []) {
1103
1146
  ...typeof node.title === "string" ? { title: node.title } : {}
1104
1147
  };
1105
1148
  else if (Object.keys(attrs).length) mark.attrs = { ...attrs };
1106
- return content(node).flatMap((child, index) => fromNode(child, `${path}.children[${index}]`, context, [...marks, mark]));
1149
+ const existing = marks.find((candidate) => candidate.type === mark.type);
1150
+ if (existing && JSON.stringify(existing.attrs) !== JSON.stringify(mark.attrs)) fail(path, "conflicting nested mark attributes");
1151
+ return content(node).flatMap((child, index) => fromNode(child, `${path}.children[${index}]`, context, existing ? marks : [...marks, mark]));
1107
1152
  }
1108
1153
  switch (node.type) {
1109
1154
  case "text":
@@ -1133,6 +1178,9 @@ function fromNode(node, path, context, marks = []) {
1133
1178
  },
1134
1179
  ...content(node).length ? { content: inline() } : {}
1135
1180
  }];
1181
+ case "lineBlock":
1182
+ check();
1183
+ return wrap("loomaLineBlock");
1136
1184
  case "break":
1137
1185
  check();
1138
1186
  return [{
@@ -1159,9 +1207,16 @@ function fromNode(node, path, context, marks = []) {
1159
1207
  ...node.ordered ? { attrs: { start: node.start ?? 1 } } : {},
1160
1208
  content: children()
1161
1209
  }];
1162
- case "listItem":
1210
+ case "listItem": {
1163
1211
  check();
1164
- return wrap(node.checked !== void 0 ? "taskItem" : "listItem", node.checked !== void 0 ? { checked: node.checked } : void 0);
1212
+ const body = children();
1213
+ if (body[0]?.type !== "paragraph") body.unshift({ type: "paragraph" });
1214
+ return [{
1215
+ type: node.checked !== void 0 ? "taskItem" : "listItem",
1216
+ ...node.checked !== void 0 ? { attrs: { checked: node.checked } } : {},
1217
+ content: body
1218
+ }];
1219
+ }
1165
1220
  case "code": {
1166
1221
  check(Object.keys(attrs));
1167
1222
  const meta = (stringify({
@@ -1277,10 +1332,15 @@ function fromNode(node, path, context, marks = []) {
1277
1332
  if (node.subType === "details") {
1278
1333
  check(["open"]);
1279
1334
  if (attrs.open !== void 0 && typeof attrs.open !== "boolean") fail(path, "nonboolean disclosure flag");
1280
- return wrap("loomaExpand", {
1281
- summary: label || "Details",
1282
- open: attrs.open === true
1283
- });
1335
+ const body = children();
1336
+ return [{
1337
+ type: "loomaExpand",
1338
+ attrs: {
1339
+ summary: label || "Details",
1340
+ open: attrs.open === true
1341
+ },
1342
+ content: body.length ? body : [{ type: "paragraph" }]
1343
+ }];
1284
1344
  }
1285
1345
  if (tone) {
1286
1346
  check();
@@ -1452,8 +1512,9 @@ function readBlocks(document) {
1452
1512
  if (node.type === "definition" && !definitions.has(referenceKey(node.label ?? ""))) definitions.set(referenceKey(node.label ?? ""), node);
1453
1513
  for (const child of node.body ?? node.children ?? []) collect(child);
1454
1514
  };
1455
- collect(document);
1456
- const blocks = document.body.map((node, index) => fromNode(node, `document.body[${index}]`, { definitions }));
1515
+ const groups = blockGroups(document.body);
1516
+ for (const group of groups) collect(group.node);
1517
+ const blocks = groups.map((group, index) => fromNode(group.node, `document.body[${index}]`, { definitions }));
1457
1518
  const headings = headingsOf({
1458
1519
  type: "doc",
1459
1520
  content: blocks.flat()
@@ -1461,7 +1522,10 @@ function readBlocks(document) {
1461
1522
  assignLoomaHeadingIds(headings).forEach((id, index) => {
1462
1523
  headings[index].node.attrs.id ??= id;
1463
1524
  });
1464
- return blocks;
1525
+ return {
1526
+ blocks,
1527
+ groups
1528
+ };
1465
1529
  }
1466
1530
  /**
1467
1531
  * Maps supported Expressive Markdown content into the Looma editor's saved JSON shape.
@@ -1496,7 +1560,7 @@ function expressmarkToEditorDocument(document) {
1496
1560
  visit(document);
1497
1561
  return {
1498
1562
  type: "doc",
1499
- content: readBlocks(document).flat()
1563
+ content: readBlocks(document).blocks.flat()
1500
1564
  };
1501
1565
  }
1502
1566
  function respell(node, original) {
@@ -1514,7 +1578,7 @@ function respell(node, original) {
1514
1578
  return result;
1515
1579
  }
1516
1580
  function keepAuthored(source, edited, options) {
1517
- const read = readBlocks(source);
1581
+ const { blocks: read, groups } = readBlocks(source);
1518
1582
  const own = editorDocumentToExpressmark({
1519
1583
  type: "doc",
1520
1584
  content: read.flat()
@@ -1530,14 +1594,14 @@ function keepAuthored(source, edited, options) {
1530
1594
  for (let index = 0; index < current.length;) {
1531
1595
  const found = keys.findIndex((key, block) => block > used && key.length > 0 && key.every((value, at) => current[index + at] === value));
1532
1596
  if (found >= 0) {
1533
- const original = source.body[found];
1597
+ const original = groups[found].node;
1534
1598
  if (options.tableOfContents === "entries" && findNode(original, (node) => node.type === "heading" || node.type === "leaf" && node.subType === "toc")) body.push(...edited.body.slice(index, index + keys[found].length).map((node) => respell(node, original)));
1535
- else body.push(original);
1599
+ else body.push(...groups[found].source);
1536
1600
  index += keys[found].length;
1537
1601
  used = found;
1538
1602
  continue;
1539
1603
  }
1540
- const replaced = source.body[used + 1];
1604
+ const replaced = groups[used + 1]?.node;
1541
1605
  body.push(replaced ? respell(edited.body[index], replaced) : edited.body[index]);
1542
1606
  index++;
1543
1607
  }
@@ -1003,6 +1003,24 @@ var LoomaLinkDefinition = Node$1.create({
1003
1003
  }
1004
1004
  });
1005
1005
  //#endregion
1006
+ //#region src/editor/extensions/line-block.ts
1007
+ /** A paragraph-like block whose authored line boundaries remain significant on export. */
1008
+ var LoomaLineBlock = Node$1.create({
1009
+ name: "loomaLineBlock",
1010
+ group: "block",
1011
+ content: "inline*",
1012
+ parseHTML() {
1013
+ return [{ tag: "div[data-type=\"line-block\"]" }];
1014
+ },
1015
+ renderHTML({ HTMLAttributes }) {
1016
+ return [
1017
+ "div",
1018
+ mergeAttributes(HTMLAttributes, { "data-type": "line-block" }),
1019
+ 0
1020
+ ];
1021
+ }
1022
+ });
1023
+ //#endregion
1006
1024
  //#region src/editor/extensions/tabs.ts
1007
1025
  /**
1008
1026
  * Tabs or a code group, kept whole so Looma Markdown's `::: tabs` and `::: code-group` survive
@@ -10299,6 +10317,7 @@ function getDefaultEditorExtensions(options = {}) {
10299
10317
  return [
10300
10318
  Document,
10301
10319
  Paragraph,
10320
+ LoomaLineBlock,
10302
10321
  Text$1,
10303
10322
  LoomaReference,
10304
10323
  LoomaReferencePresentation.configure({
@@ -11393,4 +11412,4 @@ function createLoomaSlashCommandExtension(options = {}) {
11393
11412
  });
11394
11413
  }
11395
11414
  //#endregion
11396
- export { LoomaExpand as $, createLoomaMentionExtension as A, navigateTableOfContents as B, getActiveTableCellBackground as C, createSiteRelativeLinks as D, LoomaSmartPaste as E, LoomaImage as F, LoomaLinkDefinition as G, tableOfContentsTree as H, normalizeImageDimension as I, LoomaFootnote as J, LOOMA_FOOTNOTE_INSERTED as K, normalizeImagePlacement as L, MAX_MENTION_RESULT_LIMIT as M, filterLoomaMentionItems as N, siteRelativeHref as O, normalizeMentionResultLimit as P, LoomaFigure as Q, LoomaTableOfContents as R, getActiveTableCellAlignment as S, setActiveTableCellBackground as T, LoomaTab as U, normalizeTableOfContentsConfig as V, LoomaTabs as W, findLoomaFootnote as X, LoomaFootnoteReference as Y, LoomaFigcaption as Z, getDefaultEditorExtensions as _, NO_TABLE_CAPABILITIES as a, LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS as at, LoomaTableCell as b, handleTableAction as c, LoomaActiveBlock as ct, normalizeActiveTableColumnWidths as d, revealLoomaExpandAt as et, shouldShowTextFormattingToolbar as f, LoomaTableKit as g, selectedTableElement as h, getDefaultSlashCommands as i, LoomaCallout as it, DEFAULT_MENTION_RESULT_LIMIT as j, LoomaMentionSuggestionPluginKey as k, handleTableOverlayAction as l, LoomaActiveBlockPluginKey as lt, selectedTableCellElement as m, createLoomaSlashCommandExtension as n, LoomaChip as nt, focusTableOverlayTarget as o, LOOMA_ACTIVE_BLOCK_CLASS as ot, menuAnchorRect as p, LOOMA_FOOTNOTE_LABEL as q, filterLoomaSlashCommands as r, normalizeLoomaChipColor as rt, getActiveTableUiState as s, LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS as st, LoomaSlashCommand as t, LOOMA_CHIP_COLORS as tt, insertTableAtRange as u, getLoomaTableExtensions as v, setActiveTableCellAlignment as w, LoomaTableHeader as x, LoomaTable as y, getTableOfContentsEntries as z };
11415
+ export { LoomaFigure as $, createLoomaMentionExtension as A, navigateTableOfContents as B, getActiveTableCellBackground as C, createSiteRelativeLinks as D, LoomaSmartPaste as E, LoomaImage as F, LoomaLineBlock as G, tableOfContentsTree as H, normalizeImageDimension as I, LOOMA_FOOTNOTE_LABEL as J, LoomaLinkDefinition as K, normalizeImagePlacement as L, MAX_MENTION_RESULT_LIMIT as M, filterLoomaMentionItems as N, siteRelativeHref as O, normalizeMentionResultLimit as P, LoomaFigcaption as Q, LoomaTableOfContents as R, getActiveTableCellAlignment as S, setActiveTableCellBackground as T, LoomaTab as U, normalizeTableOfContentsConfig as V, LoomaTabs as W, LoomaFootnoteReference as X, LoomaFootnote as Y, findLoomaFootnote as Z, getDefaultEditorExtensions as _, NO_TABLE_CAPABILITIES as a, LoomaCallout as at, LoomaTableCell as b, handleTableAction as c, LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS as ct, normalizeActiveTableColumnWidths as d, LoomaExpand as et, shouldShowTextFormattingToolbar as f, LoomaTableKit as g, selectedTableElement as h, getDefaultSlashCommands as i, normalizeLoomaChipColor as it, DEFAULT_MENTION_RESULT_LIMIT as j, LoomaMentionSuggestionPluginKey as k, handleTableOverlayAction as l, LoomaActiveBlock as lt, selectedTableCellElement as m, createLoomaSlashCommandExtension as n, LOOMA_CHIP_COLORS as nt, focusTableOverlayTarget as o, LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS as ot, menuAnchorRect as p, LOOMA_FOOTNOTE_INSERTED as q, filterLoomaSlashCommands as r, LoomaChip as rt, getActiveTableUiState as s, LOOMA_ACTIVE_BLOCK_CLASS as st, LoomaSlashCommand as t, revealLoomaExpandAt as tt, insertTableAtRange as u, LoomaActiveBlockPluginKey as ut, getLoomaTableExtensions as v, setActiveTableCellAlignment as w, LoomaTableHeader as x, LoomaTable as y, getTableOfContentsEntries as z };
@@ -13,6 +13,7 @@ export { LoomaExpand, revealLoomaExpandAt, type LoomaExpandAttributes } from "./
13
13
  export { LoomaFigcaption, LoomaFigure } from "./figure.js";
14
14
  export { findLoomaFootnote, LOOMA_FOOTNOTE_LABEL, LoomaFootnote, LoomaFootnoteReference } from "./footnote.js";
15
15
  export { LoomaLinkDefinition } from "./link-definition.js";
16
+ export { LoomaLineBlock } from "./line-block.js";
16
17
  export { LoomaTab, LoomaTabs } from "./tabs.js";
17
18
  export { LoomaTableOfContents, getTableOfContentsEntries, normalizeTableOfContentsConfig, type LoomaTableOfContentsConfig, type LoomaTableOfContentsEntry, type LoomaTableOfContentsFormat, } from "./table-of-contents.js";
18
19
  export { getDefaultEditorExtensions, getLoomaTableExtensions, LoomaTableKit, type DefaultEditorExtensionsOptions, type LoomaCodeLanguages, } from "./preset.js";
@@ -1,4 +1,4 @@
1
1
  import { i as TABLE_CELL_BACKGROUND_PRESETS } from "../chunks/table-overlay.js";
2
- import { $ as LoomaExpand, A as createLoomaMentionExtension, C as getActiveTableCellBackground, D as createSiteRelativeLinks, E as LoomaSmartPaste, F as LoomaImage, G as LoomaLinkDefinition, I as normalizeImageDimension, J as LoomaFootnote, L as normalizeImagePlacement, M as MAX_MENTION_RESULT_LIMIT, N as filterLoomaMentionItems, O as siteRelativeHref, P as normalizeMentionResultLimit, Q as LoomaFigure, R as LoomaTableOfContents, S as getActiveTableCellAlignment, T as setActiveTableCellBackground, U as LoomaTab, V as normalizeTableOfContentsConfig, W as LoomaTabs, X as findLoomaFootnote, Y as LoomaFootnoteReference, Z as LoomaFigcaption, _ as getDefaultEditorExtensions, at as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, b as LoomaTableCell, c as handleTableAction, ct as LoomaActiveBlock, d as normalizeActiveTableColumnWidths, et as revealLoomaExpandAt, f as shouldShowTextFormattingToolbar, g as LoomaTableKit, i as getDefaultSlashCommands, it as LoomaCallout, j as DEFAULT_MENTION_RESULT_LIMIT, k as LoomaMentionSuggestionPluginKey, l as handleTableOverlayAction, lt as LoomaActiveBlockPluginKey, n as createLoomaSlashCommandExtension, nt as LoomaChip, ot as LOOMA_ACTIVE_BLOCK_CLASS, q as LOOMA_FOOTNOTE_LABEL, r as filterLoomaSlashCommands, rt as normalizeLoomaChipColor, s as getActiveTableUiState, st as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, t as LoomaSlashCommand, tt as LOOMA_CHIP_COLORS, u as insertTableAtRange, v as getLoomaTableExtensions, w as setActiveTableCellAlignment, x as LoomaTableHeader, y as LoomaTable, z as getTableOfContentsEntries } from "../chunks/extensions.js";
2
+ import { $ as LoomaFigure, A as createLoomaMentionExtension, C as getActiveTableCellBackground, D as createSiteRelativeLinks, E as LoomaSmartPaste, F as LoomaImage, G as LoomaLineBlock, I as normalizeImageDimension, J as LOOMA_FOOTNOTE_LABEL, K as LoomaLinkDefinition, L as normalizeImagePlacement, M as MAX_MENTION_RESULT_LIMIT, N as filterLoomaMentionItems, O as siteRelativeHref, P as normalizeMentionResultLimit, Q as LoomaFigcaption, R as LoomaTableOfContents, S as getActiveTableCellAlignment, T as setActiveTableCellBackground, U as LoomaTab, V as normalizeTableOfContentsConfig, W as LoomaTabs, X as LoomaFootnoteReference, Y as LoomaFootnote, Z as findLoomaFootnote, _ as getDefaultEditorExtensions, at as LoomaCallout, b as LoomaTableCell, c as handleTableAction, ct as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, d as normalizeActiveTableColumnWidths, et as LoomaExpand, f as shouldShowTextFormattingToolbar, g as LoomaTableKit, i as getDefaultSlashCommands, it as normalizeLoomaChipColor, j as DEFAULT_MENTION_RESULT_LIMIT, k as LoomaMentionSuggestionPluginKey, l as handleTableOverlayAction, lt as LoomaActiveBlock, n as createLoomaSlashCommandExtension, nt as LOOMA_CHIP_COLORS, ot as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, r as filterLoomaSlashCommands, rt as LoomaChip, s as getActiveTableUiState, st as LOOMA_ACTIVE_BLOCK_CLASS, t as LoomaSlashCommand, tt as revealLoomaExpandAt, u as insertTableAtRange, ut as LoomaActiveBlockPluginKey, v as getLoomaTableExtensions, w as setActiveTableCellAlignment, x as LoomaTableHeader, y as LoomaTable, z as getTableOfContentsEntries } from "../chunks/extensions.js";
3
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 };
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, LoomaLineBlock, 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,3 @@
1
+ import { Node } from "@tiptap/core";
2
+ /** A paragraph-like block whose authored line boundaries remain significant on export. */
3
+ export declare const LoomaLineBlock: Node<any, any>;
package/editor/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { i as TABLE_CELL_BACKGROUND_PRESETS, n as resolveTableCellAt, r as TABLE_CELL_BACKGROUND_OPTIONS, t as measureTableOverlayGeometry } from "./chunks/table-overlay.js";
2
2
  import "./ui.js";
3
- import { $ as LoomaExpand, A as createLoomaMentionExtension, B as navigateTableOfContents, C as getActiveTableCellBackground, D as createSiteRelativeLinks, E as LoomaSmartPaste, F as LoomaImage, G as LoomaLinkDefinition, H as tableOfContentsTree, I as normalizeImageDimension, J as LoomaFootnote, K as LOOMA_FOOTNOTE_INSERTED, L as normalizeImagePlacement, M as MAX_MENTION_RESULT_LIMIT, N as filterLoomaMentionItems, O as siteRelativeHref, P as normalizeMentionResultLimit, Q as LoomaFigure, R as LoomaTableOfContents, S as getActiveTableCellAlignment, T as setActiveTableCellBackground, U as LoomaTab, V as normalizeTableOfContentsConfig, W as LoomaTabs, X as findLoomaFootnote, Y as LoomaFootnoteReference, Z as LoomaFigcaption, _ as getDefaultEditorExtensions, a as NO_TABLE_CAPABILITIES, at as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, b as LoomaTableCell, c as handleTableAction, ct as LoomaActiveBlock, d as normalizeActiveTableColumnWidths, et as revealLoomaExpandAt, f as shouldShowTextFormattingToolbar, g as LoomaTableKit, h as selectedTableElement, i as getDefaultSlashCommands, it as LoomaCallout, j as DEFAULT_MENTION_RESULT_LIMIT, k as LoomaMentionSuggestionPluginKey, l as handleTableOverlayAction, lt as LoomaActiveBlockPluginKey, m as selectedTableCellElement, n as createLoomaSlashCommandExtension, nt as LoomaChip, o as focusTableOverlayTarget, ot as LOOMA_ACTIVE_BLOCK_CLASS, p as menuAnchorRect, q as LOOMA_FOOTNOTE_LABEL, r as filterLoomaSlashCommands, rt as normalizeLoomaChipColor, s as getActiveTableUiState, st as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, t as LoomaSlashCommand, tt as LOOMA_CHIP_COLORS, u as insertTableAtRange, v as getLoomaTableExtensions, w as setActiveTableCellAlignment, x as LoomaTableHeader, y as LoomaTable, z as getTableOfContentsEntries } from "./chunks/extensions.js";
3
+ import { $ as LoomaFigure, A as createLoomaMentionExtension, B as navigateTableOfContents, C as getActiveTableCellBackground, D as createSiteRelativeLinks, E as LoomaSmartPaste, F as LoomaImage, G as LoomaLineBlock, H as tableOfContentsTree, I as normalizeImageDimension, J as LOOMA_FOOTNOTE_LABEL, K as LoomaLinkDefinition, L as normalizeImagePlacement, M as MAX_MENTION_RESULT_LIMIT, N as filterLoomaMentionItems, O as siteRelativeHref, P as normalizeMentionResultLimit, Q as LoomaFigcaption, R as LoomaTableOfContents, S as getActiveTableCellAlignment, T as setActiveTableCellBackground, U as LoomaTab, V as normalizeTableOfContentsConfig, W as LoomaTabs, X as LoomaFootnoteReference, Y as LoomaFootnote, Z as findLoomaFootnote, _ as getDefaultEditorExtensions, a as NO_TABLE_CAPABILITIES, at as LoomaCallout, b as LoomaTableCell, c as handleTableAction, ct as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, d as normalizeActiveTableColumnWidths, et as LoomaExpand, f as shouldShowTextFormattingToolbar, g as LoomaTableKit, h as selectedTableElement, i as getDefaultSlashCommands, it as normalizeLoomaChipColor, j as DEFAULT_MENTION_RESULT_LIMIT, k as LoomaMentionSuggestionPluginKey, l as handleTableOverlayAction, lt as LoomaActiveBlock, m as selectedTableCellElement, n as createLoomaSlashCommandExtension, nt as LOOMA_CHIP_COLORS, o as focusTableOverlayTarget, ot as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, p as menuAnchorRect, q as LOOMA_FOOTNOTE_INSERTED, r as filterLoomaSlashCommands, rt as LoomaChip, s as getActiveTableUiState, st as LOOMA_ACTIVE_BLOCK_CLASS, t as LoomaSlashCommand, tt as revealLoomaExpandAt, u as insertTableAtRange, ut as LoomaActiveBlockPluginKey, v as getLoomaTableExtensions, w as setActiveTableCellAlignment, x as LoomaTableHeader, y as LoomaTable, z as getTableOfContentsEntries } from "./chunks/extensions.js";
4
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 { n as validLinkHref } from "./chunks/content.js";
6
6
  import { n as selectionSnapshot, t as createEditorSession } from "./chunks/session.js";
@@ -16876,4 +16876,4 @@ function createToolbarTooltip(onChange, delay = () => 400) {
16876
16876
  };
16877
16877
  }
16878
16878
  //#endregion
16879
- 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, createDocumentEditorSession, createLoomaMentionExtension, createLoomaSlashCommandExtension, createSiteRelativeLinks, createToolbarTooltip, 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 };
16879
+ 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, LoomaLineBlock, 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, createDocumentEditorSession, createLoomaMentionExtension, createLoomaSlashCommandExtension, createSiteRelativeLinks, createToolbarTooltip, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.53.2",
3
+ "version": "0.53.3",
4
4
  "type": "module",
5
5
  "description": "HTML Next UI components, native DOM support and design tokens.",
6
6
  "license": "MIT",