@threadlabs/looma 0.7.0 → 0.7.2

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.
@@ -1,14 +1,79 @@
1
1
  import { n as TABLE_CELL_BACKGROUND_PRESETS } from "./table-backgrounds.js";
2
2
  import { Extension, Mark, Node, callOrReturn, canInsertNode, combineTransactionSteps, escapeForRegEx, findChildren, findChildrenInRange, findParentNodeClosestToPos, getAttributes, getChangedRanges, getExtensionField, getMarksBetween, isNodeEmpty, isNodeSelection, markInputRule, markPasteRule, mergeAttributes, nodeInputRule, textInputRule, textblockTypeInputRule, wrappingInputRule } from "@tiptap/core";
3
3
  import { NodeSelection, Plugin, PluginKey, Selection, TextSelection } from "@tiptap/pm/state";
4
+ import { Decoration, DecorationSet } from "@tiptap/pm/view";
4
5
  import { history, redo, undo } from "@tiptap/pm/history";
5
6
  import { dropCursor } from "@tiptap/pm/dropcursor";
6
7
  import { gapCursor } from "@tiptap/pm/gapcursor";
7
- import { Decoration, DecorationSet } from "@tiptap/pm/view";
8
8
  import { common, createLowlight } from "lowlight";
9
9
  import { DOMParser, Node as Node$1 } from "@tiptap/pm/model";
10
10
  import MarkdownIt from "markdown-it";
11
11
  import { CellSelection, TableMap, addColumn, addColumnAfter, addColumnBefore, addRow, addRowAfter, addRowBefore, cellAround, columnResizing, deleteCellSelection, deleteColumn, deleteRow, deleteTable, fixTables, goToNextCell, mergeCells, setCellAttr, splitCell, tableEditing, toggleHeader, toggleHeaderCell } from "@tiptap/pm/tables";
12
+ //#region src/editor/extensions/active-block.ts
13
+ /**
14
+ * Marks the top-level block holding the caret so a stylesheet can show where
15
+ * editing is happening without drawing chrome inside the reading column.
16
+ *
17
+ * The decoration lands on the document's direct child, not on the textblock the
18
+ * caret sits in: a marker that tracked the caret's own line would move on every
19
+ * wrap and every arrow key, and one that tracked a nested list item would step
20
+ * in and out of the list's inset. The outermost block is the stable answer to
21
+ * "where am I", which is the question the marker exists to answer.
22
+ */
23
+ /** Class applied to the decorated block; `looma-editor.css` owns its appearance. */
24
+ var LOOMA_ACTIVE_BLOCK_CLASS = "looma-active-block";
25
+ /** Plugin state is the editor's focus, so the marker is absent while reading. */
26
+ var LoomaActiveBlockPluginKey = new PluginKey("loomaActiveBlock");
27
+ /**
28
+ * Decorates the outermost block containing the selection head while the editor
29
+ * has focus.
30
+ *
31
+ * @contract Adds `LOOMA_ACTIVE_BLOCK_CLASS` to at most one top-level block, and
32
+ * nothing at all when the editor is unfocused or not editable. The document is
33
+ * never modified.
34
+ * @invariant Focus is tracked in plugin state rather than read from the editor,
35
+ * so the decoration recomputes on focus and blur even when neither changes the
36
+ * selection.
37
+ * @ownership The consuming stylesheet owns every visual property; this extension
38
+ * owns only which block carries the class.
39
+ */
40
+ var LoomaActiveBlock = Extension.create({
41
+ name: "loomaActiveBlock",
42
+ addProseMirrorPlugins() {
43
+ return [new Plugin({
44
+ key: LoomaActiveBlockPluginKey,
45
+ state: {
46
+ init: () => false,
47
+ apply: (transaction, focused) => {
48
+ const next = transaction.getMeta(LoomaActiveBlockPluginKey);
49
+ return typeof next === "boolean" ? next : focused;
50
+ }
51
+ },
52
+ props: {
53
+ handleDOMEvents: {
54
+ focus: (view) => {
55
+ view.dispatch(view.state.tr.setMeta(LoomaActiveBlockPluginKey, true));
56
+ return false;
57
+ },
58
+ blur: (view) => {
59
+ view.dispatch(view.state.tr.setMeta(LoomaActiveBlockPluginKey, false));
60
+ return false;
61
+ }
62
+ },
63
+ decorations: (state) => {
64
+ if (!LoomaActiveBlockPluginKey.getState(state)) return null;
65
+ const { $head } = state.selection;
66
+ if ($head.depth === 0) return null;
67
+ const from = $head.before(1);
68
+ const block = state.doc.nodeAt(from);
69
+ if (!block) return null;
70
+ return DecorationSet.create(state.doc, [Decoration.node(from, from + block.nodeSize, { class: LOOMA_ACTIVE_BLOCK_CLASS })]);
71
+ }
72
+ }
73
+ })];
74
+ }
75
+ });
76
+ //#endregion
12
77
  //#region src/editor/extensions/callout.ts
13
78
  /** Canonical tone values that may be persisted in a Looma callout node. */
14
79
  var LOOMA_CALLOUT_TONES = [
@@ -6631,7 +6696,8 @@ function getDefaultEditorExtensions(options = {}) {
6631
6696
  }),
6632
6697
  ...mention ? [mention] : [],
6633
6698
  LoomaTableKit,
6634
- LoomaListBehavior
6699
+ LoomaListBehavior,
6700
+ LoomaActiveBlock
6635
6701
  ];
6636
6702
  }
6637
6703
  //#endregion
@@ -7264,4 +7330,4 @@ function createLoomaSlashCommandExtension(options = {}) {
7264
7330
  });
7265
7331
  }
7266
7332
  //#endregion
7267
- export { DEFAULT_MENTION_RESULT_LIMIT as C, LOOMA_CALLOUT_TONES as D, normalizeMentionResultLimit as E, LoomaCallout as O, createLoomaMentionExtension as S, filterLoomaMentionItems as T, getActiveTableCellBackground as _, handleTableAction as a, LoomaSmartPaste as b, normalizeActiveTableColumnWidths as c, getDefaultEditorExtensions as d, getLoomaTableExtensions as f, getActiveTableCellAlignment as g, LoomaTableHeader as h, getActiveTableUiState as i, shouldShowTextFormattingToolbar as l, LoomaTableCell as m, createLoomaSlashCommandExtension as n, handleTableOverlayAction as o, LoomaTable as p, getDefaultSlashCommands as r, insertTableAtRange as s, LoomaSlashCommand as t, LoomaTableKit as u, setActiveTableCellAlignment as v, MAX_MENTION_RESULT_LIMIT as w, LoomaMentionSuggestionPluginKey as x, setActiveTableCellBackground as y };
7333
+ export { LoomaActiveBlock as A, DEFAULT_MENTION_RESULT_LIMIT as C, LOOMA_CALLOUT_TONES as D, normalizeMentionResultLimit as E, LoomaCallout as O, createLoomaMentionExtension as S, filterLoomaMentionItems as T, getActiveTableCellBackground as _, handleTableAction as a, LoomaSmartPaste as b, normalizeActiveTableColumnWidths as c, getDefaultEditorExtensions as d, getLoomaTableExtensions as f, getActiveTableCellAlignment as g, LoomaTableHeader as h, getActiveTableUiState as i, LoomaActiveBlockPluginKey as j, LOOMA_ACTIVE_BLOCK_CLASS as k, shouldShowTextFormattingToolbar as l, LoomaTableCell as m, createLoomaSlashCommandExtension as n, handleTableOverlayAction as o, LoomaTable as p, getDefaultSlashCommands as r, insertTableAtRange as s, LoomaSlashCommand as t, LoomaTableKit as u, setActiveTableCellAlignment as v, MAX_MENTION_RESULT_LIMIT as w, LoomaMentionSuggestionPluginKey as x, setActiveTableCellBackground as y };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Marks the top-level block holding the caret so a stylesheet can show where
3
+ * editing is happening without drawing chrome inside the reading column.
4
+ *
5
+ * The decoration lands on the document's direct child, not on the textblock the
6
+ * caret sits in: a marker that tracked the caret's own line would move on every
7
+ * wrap and every arrow key, and one that tracked a nested list item would step
8
+ * in and out of the list's inset. The outermost block is the stable answer to
9
+ * "where am I", which is the question the marker exists to answer.
10
+ */
11
+ import { Extension } from "@tiptap/core";
12
+ import { PluginKey } from "@tiptap/pm/state";
13
+ /** Class applied to the decorated block; `looma-editor.css` owns its appearance. */
14
+ export declare const LOOMA_ACTIVE_BLOCK_CLASS = "looma-active-block";
15
+ /** Plugin state is the editor's focus, so the marker is absent while reading. */
16
+ export declare const LoomaActiveBlockPluginKey: PluginKey<boolean>;
17
+ /**
18
+ * Decorates the outermost block containing the selection head while the editor
19
+ * has focus.
20
+ *
21
+ * @contract Adds `LOOMA_ACTIVE_BLOCK_CLASS` to at most one top-level block, and
22
+ * nothing at all when the editor is unfocused or not editable. The document is
23
+ * never modified.
24
+ * @invariant Focus is tracked in plugin state rather than read from the editor,
25
+ * so the decoration recomputes on focus and blur even when neither changes the
26
+ * selection.
27
+ * @ownership The consuming stylesheet owns every visual property; this extension
28
+ * owns only which block carries the class.
29
+ */
30
+ export declare const LoomaActiveBlock: Extension<any, any>;
@@ -6,6 +6,7 @@
6
6
  * application owns wiring and editor-instance lifetime. Tiptap remains a peer
7
7
  * dependency so Looma and the host execute against the same editor runtime.
8
8
  */
9
+ export { LOOMA_ACTIVE_BLOCK_CLASS, LoomaActiveBlock, LoomaActiveBlockPluginKey, } from "./active-block.js";
9
10
  export { LoomaCallout, LOOMA_CALLOUT_TONES, type LoomaCalloutTone, } from "./callout.js";
10
11
  export { getDefaultEditorExtensions, getLoomaTableExtensions, LoomaTableKit, type DefaultEditorExtensionsOptions, } from "./preset.js";
11
12
  export { LoomaSmartPaste } from "./smart-paste.js";
@@ -1,3 +1,3 @@
1
1
  import { n as TABLE_CELL_BACKGROUND_PRESETS } from "../chunks/table-backgrounds.js";
2
- import { C as DEFAULT_MENTION_RESULT_LIMIT, D as LOOMA_CALLOUT_TONES, E as normalizeMentionResultLimit, O as LoomaCallout, S as createLoomaMentionExtension, T as filterLoomaMentionItems, _ as getActiveTableCellBackground, a as handleTableAction, b as LoomaSmartPaste, c as normalizeActiveTableColumnWidths, d as getDefaultEditorExtensions, f as getLoomaTableExtensions, g as getActiveTableCellAlignment, h as LoomaTableHeader, i as getActiveTableUiState, l as shouldShowTextFormattingToolbar, m as LoomaTableCell, n as createLoomaSlashCommandExtension, o as handleTableOverlayAction, p as LoomaTable, r as getDefaultSlashCommands, s as insertTableAtRange, t as LoomaSlashCommand, u as LoomaTableKit, v as setActiveTableCellAlignment, w as MAX_MENTION_RESULT_LIMIT, x as LoomaMentionSuggestionPluginKey, y as setActiveTableCellBackground } from "../chunks/extensions.js";
3
- export { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_CALLOUT_TONES, LoomaCallout, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, LoomaSmartPaste, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, normalizeMentionResultLimit, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar };
2
+ import { A as LoomaActiveBlock, C as DEFAULT_MENTION_RESULT_LIMIT, D as LOOMA_CALLOUT_TONES, E as normalizeMentionResultLimit, O as LoomaCallout, S as createLoomaMentionExtension, T as filterLoomaMentionItems, _ as getActiveTableCellBackground, a as handleTableAction, b as LoomaSmartPaste, c as normalizeActiveTableColumnWidths, d as getDefaultEditorExtensions, f as getLoomaTableExtensions, g as getActiveTableCellAlignment, h as LoomaTableHeader, i as getActiveTableUiState, j as LoomaActiveBlockPluginKey, k as LOOMA_ACTIVE_BLOCK_CLASS, l as shouldShowTextFormattingToolbar, m as LoomaTableCell, n as createLoomaSlashCommandExtension, o as handleTableOverlayAction, p as LoomaTable, r as getDefaultSlashCommands, s as insertTableAtRange, t as LoomaSlashCommand, u as LoomaTableKit, v as setActiveTableCellAlignment, w as MAX_MENTION_RESULT_LIMIT, x as LoomaMentionSuggestionPluginKey, y as setActiveTableCellBackground } from "../chunks/extensions.js";
3
+ export { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_ACTIVE_BLOCK_CLASS, LOOMA_CALLOUT_TONES, LoomaActiveBlock, LoomaActiveBlockPluginKey, LoomaCallout, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, LoomaSmartPaste, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, normalizeMentionResultLimit, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar };
package/editor/index.js CHANGED
@@ -1,6 +1,6 @@
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 { C as DEFAULT_MENTION_RESULT_LIMIT, D as LOOMA_CALLOUT_TONES, E as normalizeMentionResultLimit, O as LoomaCallout, S as createLoomaMentionExtension, T as filterLoomaMentionItems, _ as getActiveTableCellBackground, a as handleTableAction, b as LoomaSmartPaste, c as normalizeActiveTableColumnWidths, d as getDefaultEditorExtensions, f as getLoomaTableExtensions, g as getActiveTableCellAlignment, h as LoomaTableHeader, i as getActiveTableUiState, l as shouldShowTextFormattingToolbar, m as LoomaTableCell, n as createLoomaSlashCommandExtension, o as handleTableOverlayAction, p as LoomaTable, r as getDefaultSlashCommands, s as insertTableAtRange, t as LoomaSlashCommand, u as LoomaTableKit, v as setActiveTableCellAlignment, w as MAX_MENTION_RESULT_LIMIT, x as LoomaMentionSuggestionPluginKey, y as setActiveTableCellBackground } from "./chunks/extensions.js";
3
+ import { A as LoomaActiveBlock, C as DEFAULT_MENTION_RESULT_LIMIT, D as LOOMA_CALLOUT_TONES, E as normalizeMentionResultLimit, O as LoomaCallout, S as createLoomaMentionExtension, T as filterLoomaMentionItems, _ as getActiveTableCellBackground, a as handleTableAction, b as LoomaSmartPaste, c as normalizeActiveTableColumnWidths, d as getDefaultEditorExtensions, f as getLoomaTableExtensions, g as getActiveTableCellAlignment, h as LoomaTableHeader, i as getActiveTableUiState, j as LoomaActiveBlockPluginKey, k as LOOMA_ACTIVE_BLOCK_CLASS, l as shouldShowTextFormattingToolbar, m as LoomaTableCell, n as createLoomaSlashCommandExtension, o as handleTableOverlayAction, p as LoomaTable, r as getDefaultSlashCommands, s as insertTableAtRange, t as LoomaSlashCommand, u as LoomaTableKit, v as setActiveTableCellAlignment, w as MAX_MENTION_RESULT_LIMIT, x as LoomaMentionSuggestionPluginKey, y as setActiveTableCellBackground } from "./chunks/extensions.js";
4
4
  import { AlignCenter, AlignLeft, AlignRight, Bold, Braces, ChevronDown, ChevronLeft, CircleCheck, CircleX, CodeXml, Columns3, Ellipsis, Eraser, GripHorizontal, GripVertical, Heading1, Heading2, Heading3, Highlighter, Image, Info, Italic, List, ListOrdered, ListTodo, Merge, Minus, NotebookPen, PaintBucket, PanelBottom, PanelLeft, PanelRight, PanelTop, Pilcrow, Plus, Quote, Redo2, Rows3, Split, Strikethrough, Table2, Trash2, TriangleAlert, Underline, Undo2 } from "lucide";
5
5
  //#region src/editor/icons.ts
6
6
  /** The opinionated Lucide set used by Looma's shipped interaction surfaces. */
@@ -94,4 +94,4 @@ function getVisualViewportRect(owner = window) {
94
94
  };
95
95
  }
96
96
  //#endregion
97
- export { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_CALLOUT_TONES, LOOMA_ICONS, LoomaCallout, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, LoomaSmartPaste, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_OPTIONS, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, getVisualViewportRect, handleTableAction, handleTableOverlayAction, insertTableAtRange, loomaIconMarkup, measureTableOverlayGeometry, normalizeActiveTableColumnWidths, normalizeMentionResultLimit, resolveTableCellAt, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar };
97
+ export { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_ACTIVE_BLOCK_CLASS, LOOMA_CALLOUT_TONES, LOOMA_ICONS, LoomaActiveBlock, LoomaActiveBlockPluginKey, LoomaCallout, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, LoomaSmartPaste, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_OPTIONS, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, getVisualViewportRect, handleTableAction, handleTableOverlayAction, insertTableAtRange, loomaIconMarkup, measureTableOverlayGeometry, normalizeActiveTableColumnWidths, normalizeMentionResultLimit, resolveTableCellAt, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -1,6 +1,8 @@
1
1
  /* Generated by HTML Next 1.0.0-alpha.3. Do not edit. */
2
2
  @scope ([data-component~="ui-editor-table-context-menu"]) to ([data-component], [data-slotted]) {
3
3
  :scope {
4
+ /* The max-width is a promise about the menu's footprint, so it counts padding and border. */
5
+ box-sizing: border-box;
4
6
  min-width: 14rem;
5
7
  max-width: min(17rem, calc(100vw - 24px));
6
8
  max-height: min(28rem, calc(100vh - 24px));
@@ -160,6 +160,8 @@ useComponentHost(controllerModule.default, {
160
160
 
161
161
  <style scoped>
162
162
  [data-component~="ui-editor-table-context-menu"] {
163
+ /* The max-width is a promise about the menu's footprint, so it counts padding and border. */
164
+ box-sizing: border-box;
163
165
  min-width: 14rem;
164
166
  max-width: min(17rem, calc(100vw - 24px));
165
167
  max-height: min(28rem, calc(100vh - 24px));
@@ -93,6 +93,6 @@ var UiEditorTableContextMenu_default = /*#__PURE__*/ _plugin_vue_export_helper_d
93
93
  }), 128))], 16, _hoisted_1);
94
94
  };
95
95
  }
96
- }), [["__scopeId", "data-v-a938b94a"]]);
96
+ }), [["__scopeId", "data-v-ae062630"]]);
97
97
  //#endregion
98
98
  export { UiEditorTableContextMenu_default as t };
@@ -1780,7 +1780,9 @@ svg[data-v-7b1048a0] {
1780
1780
  display: none;
1781
1781
  }
1782
1782
 
1783
- [data-component~="ui-editor-table-context-menu"][data-v-a938b94a] {
1783
+ [data-component~="ui-editor-table-context-menu"][data-v-ae062630] {
1784
+ /* The max-width is a promise about the menu's footprint, so it counts padding and border. */
1785
+ box-sizing: border-box;
1784
1786
  min-width: 14rem;
1785
1787
  max-width: min(17rem, calc(100vw - 24px));
1786
1788
  max-height: min(28rem, calc(100vh - 24px));
@@ -1796,12 +1798,12 @@ svg[data-v-7b1048a0] {
1796
1798
  overscroll-behavior: contain;
1797
1799
  scrollbar-width: thin;
1798
1800
  }
1799
- .section[data-v-a938b94a] {
1801
+ .section[data-v-ae062630] {
1800
1802
  display: flex;
1801
1803
  flex-direction: column;
1802
1804
  gap: 3px;
1803
1805
  }
1804
- [data-component~="ui-editor-table-context-menu"] button[data-v-a938b94a] {
1806
+ [data-component~="ui-editor-table-context-menu"] button[data-v-ae062630] {
1805
1807
  display: flex;
1806
1808
  align-items: center;
1807
1809
  gap: var(--ui-space-2);
@@ -1816,30 +1818,30 @@ svg[data-v-7b1048a0] {
1816
1818
  cursor: pointer;
1817
1819
  color: var(--ui-text);
1818
1820
  }
1819
- [data-component~="ui-editor-table-context-menu"] button[data-v-a938b94a] {
1821
+ [data-component~="ui-editor-table-context-menu"] button[data-v-ae062630] {
1820
1822
  --ui-icon-size: 1rem;
1821
1823
  --ui-icon-stroke-width: var(--ui-editor-toolbar-icon-stroke-width, 1.75);
1822
1824
  }
1823
- [data-component~="ui-editor-table-context-menu"] button[data-v-a938b94a]:hover:not(:disabled) {
1825
+ [data-component~="ui-editor-table-context-menu"] button[data-v-ae062630]:hover:not(:disabled) {
1824
1826
  background: var(--ui-surface-hover);
1825
1827
  }
1826
- [data-component~="ui-editor-table-context-menu"] button.selected[data-v-a938b94a] {
1828
+ [data-component~="ui-editor-table-context-menu"] button.selected[data-v-ae062630] {
1827
1829
  background: var(--ui-accent-subtle, rgb(59 130 246 / 0.1));
1828
1830
  }
1829
- [data-component~="ui-editor-table-context-menu"] button.danger[data-v-a938b94a] {
1831
+ [data-component~="ui-editor-table-context-menu"] button.danger[data-v-ae062630] {
1830
1832
  color: var(--ui-danger);
1831
1833
  }
1832
- .swatches[data-v-a938b94a] {
1834
+ .swatches[data-v-ae062630] {
1833
1835
  display: grid;
1834
1836
  grid-template-columns: repeat(3, minmax(0, 1fr));
1835
1837
  gap: 3px;
1836
1838
  }
1837
- .swatch-button[data-v-a938b94a] {
1839
+ .swatch-button[data-v-ae062630] {
1838
1840
  display: inline-flex;
1839
1841
  align-items: center;
1840
1842
  gap: var(--ui-space-2);
1841
1843
  }
1842
- .swatch[data-v-a938b94a] {
1844
+ .swatch[data-v-ae062630] {
1843
1845
  display: inline-flex;
1844
1846
  width: 1rem;
1845
1847
  height: 1rem;
@@ -1849,7 +1851,7 @@ svg[data-v-7b1048a0] {
1849
1851
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.35);
1850
1852
  flex-shrink: 0;
1851
1853
  }
1852
- .swatch.default[data-v-a938b94a] {
1854
+ .swatch.default[data-v-ae062630] {
1853
1855
  position: relative;
1854
1856
  background:
1855
1857
  linear-gradient(
@@ -1861,11 +1863,11 @@ svg[data-v-7b1048a0] {
1861
1863
  ),
1862
1864
  var(--ui-surface);
1863
1865
  }
1864
- .swatch-label[data-v-a938b94a] {
1866
+ .swatch-label[data-v-ae062630] {
1865
1867
  min-width: 0;
1866
1868
  white-space: nowrap;
1867
1869
  }
1868
- .heading[data-v-a938b94a] {
1870
+ .heading[data-v-ae062630] {
1869
1871
  padding: var(--ui-space-1) var(--ui-space-2);
1870
1872
  font-size: 0.6875rem;
1871
1873
  font-weight: 700;
@@ -1873,12 +1875,12 @@ svg[data-v-7b1048a0] {
1873
1875
  text-transform: uppercase;
1874
1876
  color: var(--ui-text-muted);
1875
1877
  }
1876
- .sep[data-v-a938b94a] {
1878
+ .sep[data-v-ae062630] {
1877
1879
  height: 1px;
1878
1880
  background: var(--ui-border);
1879
1881
  margin: var(--ui-space-1) 0;
1880
1882
  }
1881
- [data-component~="ui-editor-table-context-menu"][hidden][data-v-a938b94a] {
1883
+ [data-component~="ui-editor-table-context-menu"][hidden][data-v-ae062630] {
1882
1884
  display: none;
1883
1885
  }
1884
1886
 
@@ -4370,6 +4372,28 @@ html[data-ui-input-modality="touch"] [data-component~="ui-tree-item"] .drag-hand
4370
4372
  }
4371
4373
  }
4372
4374
 
4375
+ /*
4376
+ * Marker for the block being edited, drawn in the gutter beside the text rather
4377
+ * than around it: a border or fill on the reading column reads as a form field.
4378
+ * The bar sits outside the content box, so a consumer that zeroes
4379
+ * --ui-editor-content-padding-inline must leave room on its own wrapper.
4380
+ */
4381
+ .looma-editor .ProseMirror > .looma-active-block {
4382
+ position: relative;
4383
+ }
4384
+
4385
+ .looma-editor .ProseMirror > .looma-active-block::before {
4386
+ position: absolute;
4387
+ z-index: 1;
4388
+ inset-block: 0;
4389
+ inset-inline-start: calc(-1 * var(--ui-editor-active-block-offset, var(--ui-space-3)));
4390
+ inline-size: var(--ui-editor-active-block-width, 2px);
4391
+ border-radius: var(--ui-radius-round);
4392
+ background: var(--ui-editor-active-block-color, var(--ui-border-strong));
4393
+ content: "";
4394
+ pointer-events: none;
4395
+ }
4396
+
4373
4397
  .looma-editor .ProseMirror p {
4374
4398
  margin: 0 0 var(--ui-editor-paragraph-gap, var(--ui-space-3));
4375
4399
  }
@@ -868,10 +868,7 @@ var LoomaEditor = defineComponent({
868
868
  onFocusin: () => showTool(tablePickerAnchorId, "Insert table", true),
869
869
  onFocusout: hideTool,
870
870
  variant: tablePickerOpen.value ? "solid" : "ghost",
871
- "aria-expanded": tablePickerOpen.value ? "true" : "false",
872
- onClick: () => {
873
- tablePickerOpen.value = !tablePickerOpen.value;
874
- }
871
+ "aria-expanded": tablePickerOpen.value ? "true" : "false"
875
872
  }, () => loomaIcon("table")),
876
873
  commandButton(uploading.value ? "Uploading image" : "Insert image", "image", false, uploading.value || !props.uploadImage, () => fileInput.value?.click()),
877
874
  h("span", {
@@ -1022,6 +1019,9 @@ var LoomaEditor = defineComponent({
1022
1019
  open: tablePickerOpen.value,
1023
1020
  for: tablePickerAnchorId,
1024
1021
  placement: mobile.value ? "top-start" : "bottom-start",
1022
+ onOpen: () => {
1023
+ tablePickerOpen.value = true;
1024
+ },
1025
1025
  onClose: () => {
1026
1026
  tablePickerOpen.value = false;
1027
1027
  }