@threadlabs/looma 0.23.21 → 0.23.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/components/shared/overlay.js +1 -1
  2. package/components/ui-image/ui-image.html +177 -0
  3. package/components/ui-image/ui-image.js +107 -0
  4. package/components/ui-menu/ui-menu.js +1 -1
  5. package/components/ui-popover/ui-popover.js +4 -1
  6. package/components/ui-separator/ui-separator.html +18 -0
  7. package/dist/index.js +24 -23
  8. package/editor/chunks/extensions.js +633 -20
  9. package/editor/extensions/block-selection.d.ts +6 -0
  10. package/editor/extensions/expand.d.ts +31 -0
  11. package/editor/extensions/image.d.ts +12 -0
  12. package/editor/extensions/index.d.ts +4 -1
  13. package/editor/extensions/index.js +2 -2
  14. package/editor/extensions/preset.d.ts +8 -0
  15. package/editor/extensions/slash-command.d.ts +31 -3
  16. package/editor/extensions/table-of-contents.d.ts +58 -0
  17. package/editor/index.js +2 -2
  18. package/package.json +1 -1
  19. package/styles/ui-image.css +153 -0
  20. package/styles/ui-separator.css +16 -0
  21. package/vanilla/UiImage.d.ts +21 -0
  22. package/vanilla/UiImage.js +84 -0
  23. package/vanilla/UiSeparator.d.ts +2 -0
  24. package/vanilla/UiSeparator.js +10 -2
  25. package/vanilla/index.js +1 -0
  26. package/vue/UiImage.d.ts +100 -0
  27. package/vue/UiImage.js +2 -0
  28. package/vue/UiImage.vue +463 -0
  29. package/vue/UiSeparator.d.ts +18 -0
  30. package/vue/UiSeparator.vue +66 -1
  31. package/vue/UiSidebar.d.ts +1 -1
  32. package/vue/chunks/UiImage.js +313 -0
  33. package/vue/chunks/UiSeparator.js +79 -22
  34. package/vue/components.css +169 -9
  35. package/vue/editor/LoomaEditor.d.ts +19 -2
  36. package/vue/editor/divider.d.ts +6 -0
  37. package/vue/editor/expand.d.ts +7 -0
  38. package/vue/editor/image-controls.d.ts +19 -0
  39. package/vue/editor/image-delivery.d.ts +2 -2
  40. package/vue/editor/image.d.ts +7 -0
  41. package/vue/editor/index.d.ts +1 -1
  42. package/vue/editor/index.js +1188 -52
  43. package/vue/editor/table-of-contents.d.ts +7 -0
  44. package/vue/index.d.ts +1 -0
  45. package/vue/index.js +2 -1
@@ -0,0 +1,6 @@
1
+ import { Extension } from "@tiptap/core";
2
+ /** Selects atomic visual blocks by pointer and keeps text Tab input in the document.
3
+ * @contract List and table keymaps run first; Shift-Tab outside a list remains
4
+ * browser navigation so keyboard users can leave the editing surface.
5
+ */
6
+ export declare const LoomaBlockSelection: Extension<any, any>;
@@ -0,0 +1,31 @@
1
+ import { Node, type Editor, type NodeViewRenderer } from "@tiptap/core";
2
+ /** Saved presentation; a reader's temporary toggle never changes these values. */
3
+ export interface LoomaExpandAttributes {
4
+ summary: string;
5
+ open: boolean;
6
+ }
7
+ interface ExpandOptions {
8
+ nodeView: NodeViewRenderer | null;
9
+ }
10
+ /**
11
+ * Reveals collapsed ancestors before a host navigates to a document position.
12
+ * @contract Navigation changes presentation only, including in read-only mode.
13
+ */
14
+ export declare function revealLoomaExpandAt(editor: Editor, position: number): Promise<void>;
15
+ declare module "@tiptap/core" {
16
+ interface Commands<ReturnType> {
17
+ loomaExpand: {
18
+ /** Insert an independent section and place the caret in its body. */
19
+ insertLoomaExpand: (attributes?: Partial<LoomaExpandAttributes>) => ReturnType;
20
+ /** Leave an enclosing section by creating an ordinary paragraph after it. */
21
+ exitLoomaExpand: () => ReturnType;
22
+ };
23
+ }
24
+ }
25
+ /**
26
+ * A block container whose summary and initial expansion survive serialization.
27
+ * @ownership The document owns attributes/body; node views own reader toggles.
28
+ * @lifecycle Default views unregister their editor subscriptions on destroy.
29
+ */
30
+ export declare const LoomaExpand: Node<ExpandOptions, any>;
31
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type AnyExtension } from "@tiptap/core";
2
+ /** Durable image placement; wrapping applies to block images in reading content. */
3
+ export type LoomaImagePlacement = "block" | "center" | "wrap-left" | "wrap-right";
4
+ /** Accepts only positive, integral CSS-pixel dimensions. */
5
+ export declare function normalizeImageDimension(value: unknown): number | undefined;
6
+ /** Unknown legacy values retain ordinary block placement. */
7
+ export declare function normalizeImagePlacement(value: unknown): LoomaImagePlacement;
8
+ /** Portable image attributes shared by every editor adapter.
9
+ * @contract Keeps Tiptap's existing `image` name and insertion command. Delivery
10
+ * attributes stay transient; dimensions and placement survive HTML and JSON.
11
+ */
12
+ export declare const LoomaImage: AnyExtension;
@@ -9,10 +9,13 @@
9
9
  export { LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, LOOMA_ACTIVE_BLOCK_CLASS, LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, LoomaActiveBlock, LoomaActiveBlockPluginKey, } from "./active-block.js";
10
10
  export { LoomaCallout, LOOMA_CALLOUT_TONES, type LoomaCalloutTone, } from "./callout.js";
11
11
  export { LoomaChip, LOOMA_CHIP_COLORS, normalizeLoomaChipColor, type LoomaChipColor } from "./chip.js";
12
+ export { LoomaExpand, revealLoomaExpandAt, type LoomaExpandAttributes } from "./expand.js";
13
+ export { LoomaTableOfContents, getTableOfContentsEntries, normalizeTableOfContentsConfig, type LoomaTableOfContentsConfig, type LoomaTableOfContentsEntry, type LoomaTableOfContentsFormat, } from "./table-of-contents.js";
12
14
  export { getDefaultEditorExtensions, getLoomaTableExtensions, LoomaTableKit, type DefaultEditorExtensionsOptions, type LoomaCodeLanguages, } from "./preset.js";
13
15
  export { LoomaSmartPaste } from "./smart-paste.js";
14
16
  export { getActiveTableUiState, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, shouldShowTextFormattingToolbar, type ActiveTableUiState, type InsertTableAtRangeOptions, type TableActionCapabilities, } from "./table-commands.js";
15
17
  export { LoomaTable, getActiveTableCellAlignment, getActiveTableCellBackground, LoomaTableCell, LoomaTableHeader, setActiveTableCellAlignment, setActiveTableCellBackground, TABLE_CELL_BACKGROUND_PRESETS, type TableCellAlignment, type TableCellBackground, } from "./table-formatting.js";
16
18
  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";
17
- export { createLoomaSlashCommandExtension, getDefaultSlashCommands, LoomaSlashCommand, type LoomaSlashCommand as LoomaSlashCommandItem, type LoomaSlashCommandContext, type LoomaSlashCommandOptions, type LoomaSlashMenuSnapshot, } from "./slash-command.js";
19
+ export { createLoomaSlashCommandExtension, getDefaultSlashCommands, filterLoomaSlashCommands, LoomaSlashCommand, type LoomaSlashCommand as LoomaSlashCommandItem, type LoomaSlashCommandContext, type LoomaSlashCommandOptions, type LoomaSlashMenuSnapshot, } from "./slash-command.js";
18
20
  export { siteRelativeHref, createSiteRelativeLinks } from "./relative-links.js";
21
+ export { LoomaImage, normalizeImageDimension, normalizeImagePlacement, type LoomaImagePlacement } from "./image.js";
@@ -1,3 +1,3 @@
1
1
  import { n as TABLE_CELL_BACKGROUND_PRESETS } from "../chunks/table-backgrounds.js";
2
- import { A as LoomaChip, C as LoomaMentionSuggestionPluginKey, D as filterLoomaMentionItems, E as MAX_MENTION_RESULT_LIMIT, F as LOOMA_ACTIVE_BLOCK_CLASS, I as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, L as LoomaActiveBlock, M as LOOMA_CALLOUT_TONES, N as LoomaCallout, O as normalizeMentionResultLimit, P as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, R as LoomaActiveBlockPluginKey, S as siteRelativeHref, T as DEFAULT_MENTION_RESULT_LIMIT, _ 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 normalizeLoomaChipColor, k as LOOMA_CHIP_COLORS, 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 createLoomaMentionExtension, x as createSiteRelativeLinks, y as setActiveTableCellBackground } from "../chunks/extensions.js";
3
- 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, LoomaActiveBlock, LoomaActiveBlockPluginKey, LoomaCallout, LoomaChip, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, LoomaSmartPaste, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, createSiteRelativeLinks, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, normalizeLoomaChipColor, normalizeMentionResultLimit, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar, siteRelativeHref };
2
+ import { A as LoomaImage, B as normalizeLoomaChipColor, C as siteRelativeHref, D as MAX_MENTION_RESULT_LIMIT, E as DEFAULT_MENTION_RESULT_LIMIT, F as normalizeTableOfContentsConfig, G as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, H as LoomaCallout, I as LoomaExpand, K as LoomaActiveBlock, L as revealLoomaExpandAt, M as normalizeImagePlacement, N as LoomaTableOfContents, O as filterLoomaMentionItems, P as getTableOfContentsEntries, R as LOOMA_CHIP_COLORS, S as createSiteRelativeLinks, T as createLoomaMentionExtension, U as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, V as LOOMA_CALLOUT_TONES, W as LOOMA_ACTIVE_BLOCK_CLASS, _ as getActiveTableCellAlignment, a as getActiveTableUiState, b as setActiveTableCellBackground, c as insertTableAtRange, d as LoomaTableKit, 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 LoomaActiveBlockPluginKey, r as filterLoomaSlashCommands, s as handleTableOverlayAction, t as LoomaSlashCommand, u as shouldShowTextFormattingToolbar, v as getActiveTableCellBackground, w as LoomaMentionSuggestionPluginKey, x as LoomaSmartPaste, y as setActiveTableCellAlignment, z as LoomaChip } from "../chunks/extensions.js";
3
+ 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, LoomaActiveBlock, LoomaActiveBlockPluginKey, LoomaCallout, LoomaChip, LoomaExpand, LoomaImage, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, LoomaSmartPaste, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, LoomaTableOfContents, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, createSiteRelativeLinks, filterLoomaMentionItems, filterLoomaSlashCommands, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, getTableOfContentsEntries, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, normalizeImageDimension, normalizeImagePlacement, normalizeLoomaChipColor, normalizeMentionResultLimit, normalizeTableOfContentsConfig, revealLoomaExpandAt, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar, siteRelativeHref };
@@ -20,6 +20,10 @@ export interface DefaultEditorExtensionsOptions {
20
20
  linkBaseUrl?: string;
21
21
  /** Passed to Tiptap Image; block images are the default document policy. */
22
22
  imageInline?: boolean;
23
+ /** Optional image selection and sizing UI; durable formatting stays in the shared schema. */
24
+ imageNodeView?: NodeViewRenderer;
25
+ /** Optional selected-state UI for document dividers. */
26
+ dividerNodeView?: NodeViewRenderer;
23
27
  /** Custom mention extension, the Looma default, or false to omit mentions. */
24
28
  mention?: AnyExtension | false;
25
29
  /**
@@ -35,6 +39,10 @@ export interface DefaultEditorExtensionsOptions {
35
39
  codeLowlight?: ReturnType<typeof createLowlight>;
36
40
  /** Optional presentation for a code block; the Vue editor supplies its language control. */
37
41
  codeBlockNodeView?: NodeViewRenderer;
42
+ /** Optional TOC settings UI; schema, entries, and heading anchors remain shared. */
43
+ tableOfContentsNodeView?: NodeViewRenderer;
44
+ /** Optional section settings; the shared schema owns summary and body content. */
45
+ expandNodeView?: NodeViewRenderer;
38
46
  }
39
47
  /**
40
48
  * Complete Looma table schema as one Tiptap extension.
@@ -13,11 +13,17 @@ export interface LoomaSlashCommandContext {
13
13
  * built-ins without coupling the headless suggestion lifecycle to Tiptap nodes.
14
14
  */
15
15
  export interface LoomaSlashCommand {
16
+ /** Stable identity, especially when two commands share a visible title. */
17
+ id?: string;
18
+ /** Optional visible category; absent categories render as ordinary rows. */
19
+ group?: string;
16
20
  title: string;
17
21
  description: string;
18
22
  icon: LoomaIconName;
19
23
  keywords: string[];
20
24
  command: (context: LoomaSlashCommandContext) => void;
25
+ /** Pure capability/context check. An unavailable command is omitted. */
26
+ isAvailable?: (context: LoomaSlashCommandContext) => boolean;
21
27
  }
22
28
  /**
23
29
  * Ephemeral render model published to any slash-menu UI.
@@ -34,6 +40,8 @@ export interface LoomaSlashMenuSnapshot {
34
40
  query: string;
35
41
  rect: DOMRect | null;
36
42
  select: ((index: number) => void) | null;
43
+ /** Keeps editor keyboard selection synchronized with a UI's hovered row. */
44
+ highlight?: ((index: number) => void) | null;
37
45
  }
38
46
  /**
39
47
  * Application-owned command inventory and integration callbacks.
@@ -51,16 +59,32 @@ export interface LoomaSlashCommandOptions {
51
59
  onOpenChipEditor?: (editor: Editor, position: number) => void;
52
60
  onOpenLinkEditor?: () => void;
53
61
  }
62
+ declare module "@tiptap/core" {
63
+ interface Commands<ReturnType> {
64
+ loomaSlashCommand: {
65
+ /** Dismiss current suggestions without removing the writer's query. */
66
+ dismissLoomaSlashMenu: () => ReturnType;
67
+ };
68
+ }
69
+ }
54
70
  /**
55
71
  * Builds Looma's default command policy as fresh objects for one editor.
56
72
  * Image and link commands delegate their picker because Looma does not own
57
73
  * upload, persistence, or destination search. Link appears only when a picker
58
- * callback is supplied, so a headless default inventory has no dead action.
74
+ * callback is supplied. Image follows the same rule, so a headless inventory
75
+ * has no dead picker actions.
59
76
  *
60
77
  * @ownership Returned command objects belong to the caller and are recreated
61
78
  * per call so one editor cannot mutate another editor's command inventory.
62
79
  */
63
80
  export declare function getDefaultSlashCommands(onOpenImagePicker?: () => void, onOpenChipEditor?: (editor: Editor, position: number) => void, onOpenLinkEditor?: () => void): LoomaSlashCommand[];
81
+ /**
82
+ * Ranks exact names/aliases before partial matches, then matching categories.
83
+ * Other ties retain inventory order.
84
+ * @contract Capability checks run against the current range; a failing host
85
+ * predicate omits that command rather than exposing an action that may destroy text.
86
+ */
87
+ export declare function filterLoomaSlashCommands(commands: LoomaSlashCommand[], query: string, context?: LoomaSlashCommandContext): LoomaSlashCommand[];
64
88
  /**
65
89
  * Framework-neutral slash-command extension used by the turnkey editor.
66
90
  * Consumers embedding Looma into their own Tiptap instance can configure the
@@ -71,7 +95,9 @@ export declare function getDefaultSlashCommands(onOpenImagePicker?: () => void,
71
95
  * @lifecycle Snapshot callbacks are valid only for the suggestion range that
72
96
  * produced them and are replaced on every update or exit.
73
97
  */
74
- export declare const LoomaSlashCommand: Extension<LoomaSlashCommandOptions, any>;
98
+ export declare const LoomaSlashCommand: Extension<LoomaSlashCommandOptions, {
99
+ dismiss: () => void;
100
+ }>;
75
101
  /**
76
102
  * Creates an independently configured extension instance.
77
103
  * Prefer this factory when callbacks or commands are editor-specific; the
@@ -80,4 +106,6 @@ export declare const LoomaSlashCommand: Extension<LoomaSlashCommandOptions, any>
80
106
  * @ownership The caller owns supplied commands and callbacks. The returned
81
107
  * extension captures them for one configuration without mutating the inventory.
82
108
  */
83
- export declare function createLoomaSlashCommandExtension(options?: Partial<LoomaSlashCommandOptions>): Extension<LoomaSlashCommandOptions, any>;
109
+ export declare function createLoomaSlashCommandExtension(options?: Partial<LoomaSlashCommandOptions>): Extension<LoomaSlashCommandOptions, {
110
+ dismiss: () => void;
111
+ }>;
@@ -0,0 +1,58 @@
1
+ import { Node, type NodeViewRenderer } from "@tiptap/core";
2
+ import { type Node as ProseMirrorNode } from "@tiptap/pm/model";
3
+ /** Formatting affects presentation only; heading order remains document order. */
4
+ export type LoomaTableOfContentsFormat = "plain" | "bulleted" | "numbered";
5
+ /** Persisted TOC choices; entries themselves are always derived from headings. */
6
+ export interface LoomaTableOfContentsConfig {
7
+ format: LoomaTableOfContentsFormat;
8
+ depth: 1 | 2 | 3;
9
+ }
10
+ /**
11
+ * One current heading for navigation or host projections.
12
+ * @lifecycle Positions belong to the supplied document; recompute after edits.
13
+ * IDs stay with headings across renames and moves once a TOC assigns anchors.
14
+ */
15
+ export interface LoomaTableOfContentsEntry {
16
+ id: string;
17
+ text: string;
18
+ level: number;
19
+ depth: number;
20
+ position: number;
21
+ }
22
+ /** Normalize loaded configuration without persisting unsupported presentation values. */
23
+ export declare function normalizeTableOfContentsConfig(attributes: Record<string, unknown>): LoomaTableOfContentsConfig;
24
+ /**
25
+ * Derives nonempty headings throughout the document, independent of TOC placement.
26
+ * @contract Depth is a maximum heading level. Relative nesting follows existing
27
+ * ancestors rather than inserting artificial entries for skipped levels.
28
+ */
29
+ export declare function getTableOfContentsEntries(doc: ProseMirrorNode, depth?: number): LoomaTableOfContentsEntry[];
30
+ interface Branch {
31
+ entry: LoomaTableOfContentsEntry;
32
+ children: Branch[];
33
+ }
34
+ /** Shared nesting for semantic HTML and the adapter's component composition. */
35
+ export declare function tableOfContentsTree(entries: LoomaTableOfContentsEntry[]): Branch[];
36
+ /**
37
+ * Scrolls within this editor so multiple documents cannot cross-navigate by ID.
38
+ * @contract Reader navigation does not edit content or invoke link-editing UI.
39
+ */
40
+ export declare function navigateTableOfContents(editor: import("@tiptap/core").Editor, id: string): Promise<void>;
41
+ interface TableOfContentsOptions {
42
+ nodeView: NodeViewRenderer | null;
43
+ }
44
+ declare module "@tiptap/core" {
45
+ interface Commands<ReturnType> {
46
+ loomaTableOfContents: {
47
+ /** Insert configuration; headings and links are derived from the document. */
48
+ insertLoomaTableOfContents: (config?: Partial<LoomaTableOfContentsConfig>) => ReturnType;
49
+ };
50
+ }
51
+ }
52
+ /**
53
+ * Automatic whole-document navigation with durable configuration only.
54
+ * @ownership The schema owns configuration/anchors; node views derive entries.
55
+ * @lifecycle Headless views subscribe to transactions and unsubscribe on destroy.
56
+ */
57
+ export declare const LoomaTableOfContents: Node<TableOfContentsOptions, any>;
58
+ export {};
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 { A as LoomaChip, C as LoomaMentionSuggestionPluginKey, D as filterLoomaMentionItems, E as MAX_MENTION_RESULT_LIMIT, F as LOOMA_ACTIVE_BLOCK_CLASS, I as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, L as LoomaActiveBlock, M as LOOMA_CALLOUT_TONES, N as LoomaCallout, O as normalizeMentionResultLimit, P as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, R as LoomaActiveBlockPluginKey, S as siteRelativeHref, T as DEFAULT_MENTION_RESULT_LIMIT, _ 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 normalizeLoomaChipColor, k as LOOMA_CHIP_COLORS, 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 createLoomaMentionExtension, x as createSiteRelativeLinks, y as setActiveTableCellBackground } from "./chunks/extensions.js";
3
+ import { A as LoomaImage, B as normalizeLoomaChipColor, C as siteRelativeHref, D as MAX_MENTION_RESULT_LIMIT, E as DEFAULT_MENTION_RESULT_LIMIT, F as normalizeTableOfContentsConfig, G as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, H as LoomaCallout, I as LoomaExpand, K as LoomaActiveBlock, L as revealLoomaExpandAt, M as normalizeImagePlacement, N as LoomaTableOfContents, O as filterLoomaMentionItems, P as getTableOfContentsEntries, R as LOOMA_CHIP_COLORS, S as createSiteRelativeLinks, T as createLoomaMentionExtension, U as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, V as LOOMA_CALLOUT_TONES, W as LOOMA_ACTIVE_BLOCK_CLASS, _ as getActiveTableCellAlignment, a as getActiveTableUiState, b as setActiveTableCellBackground, c as insertTableAtRange, d as LoomaTableKit, 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 LoomaActiveBlockPluginKey, r as filterLoomaSlashCommands, s as handleTableOverlayAction, t as LoomaSlashCommand, u as shouldShowTextFormattingToolbar, v as getActiveTableCellBackground, w as LoomaMentionSuggestionPluginKey, x as LoomaSmartPaste, y as setActiveTableCellAlignment, z as LoomaChip } from "./chunks/extensions.js";
4
4
  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, Link, List, ListOrdered, ListTodo, LoaderCircle, Merge, Minus, NotebookPen, PaintBucket, PanelBottom, PanelLeft, PanelRight, PanelTop, Pencil, Pilcrow, Plus, Quote, Receipt, Redo2, Rows3, Search, Settings, Split, Strikethrough, Table2, Tag, Trash2, TriangleAlert, Truck, Underline, Undo2, Unlink, UserRound, Users, X } from "lucide";
5
5
  //#region src/editor/icons.ts
6
6
  /** The opinionated Lucide set used by Looma's shipped interaction surfaces. */
@@ -121,4 +121,4 @@ function getVisualViewportRect(owner = window) {
121
121
  };
122
122
  }
123
123
  //#endregion
124
- 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_ICONS, LoomaActiveBlock, LoomaActiveBlockPluginKey, LoomaCallout, LoomaChip, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, LoomaSmartPaste, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_OPTIONS, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, createSiteRelativeLinks, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, getVisualViewportRect, handleTableAction, handleTableOverlayAction, insertTableAtRange, loomaIconMarkup, measureTableOverlayGeometry, normalizeActiveTableColumnWidths, normalizeLoomaChipColor, normalizeMentionResultLimit, resolveTableCellAt, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar, siteRelativeHref };
124
+ 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_ICONS, LoomaActiveBlock, LoomaActiveBlockPluginKey, LoomaCallout, LoomaChip, LoomaExpand, LoomaImage, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, LoomaSmartPaste, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, LoomaTableOfContents, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_OPTIONS, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, createSiteRelativeLinks, filterLoomaMentionItems, filterLoomaSlashCommands, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, getTableOfContentsEntries, getVisualViewportRect, handleTableAction, handleTableOverlayAction, insertTableAtRange, loomaIconMarkup, measureTableOverlayGeometry, normalizeActiveTableColumnWidths, normalizeImageDimension, normalizeImagePlacement, normalizeLoomaChipColor, normalizeMentionResultLimit, normalizeTableOfContentsConfig, resolveTableCellAt, revealLoomaExpandAt, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar, siteRelativeHref };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.23.21",
3
+ "version": "0.23.22",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -0,0 +1,153 @@
1
+ /* Generated by HTML Next 1.0.0-alpha.26. Do not edit. */
2
+ @scope ([data-component~="ui-image"]) to ([data-component], [data-slotted]) {
3
+ :scope {
4
+ display: flex;
5
+ justify-content: flex-start;
6
+ box-sizing: border-box;
7
+ max-inline-size: 100%;
8
+ min-inline-size: 0;
9
+ margin: 0;
10
+ padding: var(--ui-space-3) 0;
11
+ }
12
+ :scope[data-ui-image-state~="placement=center"] {
13
+ justify-content: center;
14
+ }
15
+ :scope[data-ui-image-state~="placement=wrap-left"] {
16
+ float: left;
17
+ padding-inline-end: var(--ui-space-4);
18
+ }
19
+ :scope[data-ui-image-state~="placement=wrap-right"] {
20
+ float: right;
21
+ padding-inline-start: var(--ui-space-4);
22
+ }
23
+ :scope:is(:scope[data-ui-image-state~="placement=wrap-left"], :scope[data-ui-image-state~="placement=wrap-right"]) {
24
+ inline-size: calc(var(--_ui-image-width, calc(100% / 3)) + var(--ui-space-4));
25
+ }
26
+ :scope:is(:scope[data-ui-image-state~="placement=wrap-left"], :scope[data-ui-image-state~="placement=wrap-right"]) .frame {
27
+ inline-size: 100%;
28
+ }
29
+ .frame {
30
+ position: relative;
31
+ flex: 0 1 auto;
32
+ inline-size: var(--_ui-image-width, fit-content);
33
+ max-inline-size: 100%;
34
+ min-inline-size: 0;
35
+ align-self: flex-start;
36
+ border-radius: var(--ui-radius-md);
37
+ }
38
+ :scope[data-ui-image-state~="selected"] .frame {
39
+ outline: var(--ui-focus-width) solid var(--ui-focus-ring);
40
+ outline-offset: var(--ui-border-width);
41
+ }
42
+ .handle {
43
+ position: absolute;
44
+ z-index: 1;
45
+ inline-size: 24px;
46
+ block-size: 24px;
47
+ padding: 0;
48
+ border: 0;
49
+ background: transparent;
50
+ touch-action: none;
51
+ }
52
+ .handle::after {
53
+ content: "";
54
+ position: absolute;
55
+ inset: 8px;
56
+ background: var(--ui-surface);
57
+ border: var(--ui-border-width) solid var(--ui-focus-ring);
58
+ border-radius: var(--ui-radius-sm);
59
+ }
60
+ .handle:focus-visible {
61
+ outline: var(--ui-focus-width) solid var(--ui-focus-ring);
62
+ border-radius: var(--ui-radius-sm);
63
+ }
64
+ .handle[data-corner="top-left"] {
65
+ top: -12px;
66
+ left: -12px;
67
+ cursor: nwse-resize;
68
+ }
69
+ .handle[data-corner="top-right"] {
70
+ top: -12px;
71
+ right: -12px;
72
+ cursor: nesw-resize;
73
+ }
74
+ .handle[data-corner="bottom-left"] {
75
+ bottom: -12px;
76
+ left: -12px;
77
+ cursor: nesw-resize;
78
+ }
79
+ .handle[data-corner="bottom-right"] {
80
+ bottom: -12px;
81
+ right: -12px;
82
+ cursor: nwse-resize;
83
+ }
84
+ .handles[hidden], :scope[hidden] {
85
+ display: none;
86
+ }
87
+ @media (max-width: 767px) {
88
+ :scope:is(:scope[data-ui-image-state~="placement=wrap-left"], :scope[data-ui-image-state~="placement=wrap-right"]) {
89
+ float: none;
90
+ inline-size: 100%;
91
+ padding-inline: 0;
92
+ }
93
+ :scope:is(:scope[data-ui-image-state~="placement=wrap-left"], :scope[data-ui-image-state~="placement=wrap-right"]) .handles {
94
+ display: none;
95
+ }
96
+ }
97
+ @media (pointer: coarse) {
98
+ .handle {
99
+ inline-size: 44px;
100
+ block-size: 44px;
101
+ }
102
+ .handle::after {
103
+ inset: 18px;
104
+ }
105
+ .handle[data-corner="top-left"] {
106
+ top: -22px;
107
+ left: -22px;
108
+ }
109
+ .handle[data-corner="top-right"] {
110
+ top: -22px;
111
+ right: -22px;
112
+ }
113
+ .handle[data-corner="bottom-left"] {
114
+ bottom: -22px;
115
+ left: -22px;
116
+ }
117
+ .handle[data-corner="bottom-right"] {
118
+ bottom: -22px;
119
+ right: -22px;
120
+ }
121
+ }
122
+ @media (forced-colors: active) {
123
+ :scope[data-ui-image-state~="selected"] .frame, .handle:focus-visible {
124
+ outline-color: Highlight;
125
+ }
126
+ .handle::after {
127
+ border-color: Highlight;
128
+ background: Canvas;
129
+ }
130
+ }
131
+ }
132
+ @scope ([data-component~="ui-image"]) to ([data-component]) {
133
+ :scope:is(:scope[data-ui-image-state~="placement=wrap-left"], :scope[data-ui-image-state~="placement=wrap-right"]) .frame img,
134
+ :scope:is(:scope[data-ui-image-state~="placement=wrap-left"], :scope[data-ui-image-state~="placement=wrap-right"]) .frame :where([data-slotted], [data-slotted] *):is(img) {
135
+ inline-size: 100%;
136
+ }
137
+ .frame img, .frame :where([data-slotted], [data-slotted] *):is(img) {
138
+ display: block;
139
+ max-inline-size: 100%;
140
+ block-size: auto;
141
+ margin: 0;
142
+ border-radius: inherit;
143
+ }
144
+ :scope[data-resizing] .frame img, :scope[data-resizing] .frame :where([data-slotted], [data-slotted] *):is(img) {
145
+ inline-size: 100%;
146
+ }
147
+ @media (max-width: 767px) {
148
+ }
149
+ @media (pointer: coarse) {
150
+ }
151
+ @media (forced-colors: active) {
152
+ }
153
+ }
@@ -20,6 +20,22 @@
20
20
  border-block-start: 0;
21
21
  border-inline-start: var(--ui-border-width) solid var(--ui-separator-color, var(--ui-border-divider));
22
22
  }
23
+
24
+ :scope[data-ui-separator-state~="selectable"] {
25
+ min-block-size: var(--ui-control-size-sm);
26
+ border: 0;
27
+ background: linear-gradient(var(--ui-separator-color, var(--ui-border-divider)), var(--ui-separator-color, var(--ui-border-divider))) center / 100%
28
+ var(--ui-border-width) no-repeat;
29
+ cursor: pointer;
30
+ }
31
+ :scope[data-ui-separator-state~="selectable"]:hover {
32
+ background-color: var(--ui-surface-hover);
33
+ }
34
+ :scope[data-ui-separator-state~="selected"] {
35
+ outline: var(--ui-focus-width) solid var(--ui-focus-ring);
36
+ outline-offset: var(--ui-focus-width);
37
+ border-radius: var(--ui-radius-sm);
38
+ }
23
39
  }
24
40
  @scope ([data-component~="ui-separator"]) to ([data-component]) {
25
41
  /* This component's hooks style the element they are set on, and never a nested one. */
@@ -0,0 +1,21 @@
1
+ // Generated by HTML Next 1.0.0-alpha.26 for Vanilla DOM. Do not edit.
2
+ export interface UiImageEventMap {
3
+ resize: CustomEvent<{ readonly width: number; readonly height: number; readonly phase: "preview" | "commit" | "cancel"; readonly trigger: "pointer" | "keyboard" }>;
4
+ }
5
+ export interface UiImageElement extends HTMLElement {
6
+ addEventListener<K extends keyof UiImageEventMap>(type: K, listener: (this: UiImageElement, event: UiImageEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
7
+ removeEventListener<K extends keyof UiImageEventMap>(type: K, listener: (this: UiImageElement, event: UiImageEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
8
+ }
9
+ export interface UiImageProps {
10
+ alt?: string | null;
11
+ height?: number | null;
12
+ placement?: "block" | "center" | "wrap-left" | "wrap-right" | null;
13
+ resizable?: boolean | null;
14
+ selected?: boolean | null;
15
+ src?: string | null;
16
+ width?: number | null;
17
+ attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
18
+ children?: readonly (string | Node)[];
19
+ slots?: Readonly<Record<string, readonly (string | Node)[]>>;
20
+ }
21
+ export declare function createUiImage(props?: UiImageProps): UiImageElement;
@@ -0,0 +1,84 @@
1
+ // Generated by HTML Next 1.0.0-alpha.26 for Vanilla DOM. Do not edit.
2
+ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
3
+ import * as controller from "../components/ui-image/ui-image.js";
4
+ import "../styles/ui-image.css";
5
+
6
+ const definition = {...{"contract":{"tag":"ui-image","props":{"alt":{"type":"string","required":false,"target":{"attribute":"alt"},"default":""},"height":{"type":{"kind":"terminal","name":"integer"},"required":false,"target":{"attribute":"height"}},"placement":{"type":{"kind":"terminal","name":"keyword"},"values":["block","center","wrap-left","wrap-right"],"required":false,"target":{"attribute":"placement"},"default":"block"},"resizable":{"type":"boolean","required":false,"target":{"attribute":"resizable"},"default":false},"selected":{"type":"boolean","required":false,"target":{"attribute":"selected"},"default":false},"src":{"type":"string","required":false,"target":{"attribute":"src"},"default":""},"width":{"type":{"kind":"terminal","name":"integer"},"required":false,"target":{"attribute":"width"}}}},"template":{"kind":"element","name":"figure","attributes":[],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"frame"}],"children":[{"kind":"slot","fallback":[{"kind":"element","name":"img","attributes":[{"kind":"attribute","name":"src","expression":"src","expressionPlan":{"source":"src","ast":{"kind":"id","name":"src"},"dependencies":["src"]}},{"kind":"attribute","name":"alt","expression":"alt","expressionPlan":{"source":"alt","ast":{"kind":"id","name":"alt"},"dependencies":["alt"]}},{"kind":"attribute","name":"width","expression":"width","expressionPlan":{"source":"width","ast":{"kind":"id","name":"width"},"dependencies":["width"]}},{"kind":"attribute","name":"height","expression":"height","expressionPlan":{"source":"height","ast":{"kind":"id","name":"height"},"dependencies":["height"]}}],"children":[]}],"name":"media"},{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"handles"},{"kind":"attribute","name":"hidden","expression":"not (selected and resizable)","expressionPlan":{"source":"not (selected and resizable)","ast":{"kind":"unary","op":"not","operand":{"kind":"binary","op":"and","left":{"kind":"id","name":"selected"},"right":{"kind":"id","name":"resizable"}}},"dependencies":["resizable","selected"]}}],"children":[{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"type","value":"button"},{"kind":"literal","name":"class","value":"handle"},{"kind":"literal","name":"data-corner","value":"top-left"},{"kind":"literal","name":"aria-label","value":"Resize image from top left"}],"children":[]},{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"type","value":"button"},{"kind":"literal","name":"class","value":"handle"},{"kind":"literal","name":"data-corner","value":"top-right"},{"kind":"literal","name":"aria-label","value":"Resize image from top right"}],"children":[]},{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"type","value":"button"},{"kind":"literal","name":"class","value":"handle"},{"kind":"literal","name":"data-corner","value":"bottom-left"},{"kind":"literal","name":"aria-label","value":"Resize image from bottom left"}],"children":[]},{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"type","value":"button"},{"kind":"literal","name":"class","value":"handle"},{"kind":"literal","name":"data-corner","value":"bottom-right"},{"kind":"literal","name":"aria-label","value":"Resize image from bottom right"}],"children":[]}]},{"kind":"slot","fallback":[],"name":"controls"}],"ref":"frame"}]},"declarations":[{"kind":"event","name":"resize","type":"object","shape":{"kind":"object","fields":[{"name":"width","type":{"kind":"terminal","name":"integer"},"optional":false},{"name":"height","type":{"kind":"terminal","name":"integer"},"optional":false},{"name":"phase","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["preview","commit","cancel"]},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["pointer","keyboard"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"figure","choices":["figure"]}},source:{file:import.meta.url},css:""};
7
+
8
+ export function createUiImage(options = {}) {
9
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
10
+ const projected = [];
11
+ const element = document.createElement("figure");
12
+ for (const [name, value] of Object.entries(attributes)) {
13
+ if (value === null || value === undefined || value === false) continue;
14
+ element.setAttribute(name, value === true ? "" : String(value));
15
+ }
16
+ element.setAttribute("data-component", "ui-image");
17
+ const element0 = document.createElement("div");
18
+ element0.setAttribute("class", "frame");
19
+ if (slots["media"] ?? [].length > 0) {
20
+ for (const child of slots["media"] ?? []) {
21
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
22
+ if (node.nodeType === 1) node.setAttribute("data-slotted", "");
23
+ projected.push([node, "media"]);
24
+ element0.append(node);
25
+ }
26
+ } else {
27
+ const element1 = document.createElement("img");
28
+ const value0 = componentProps["src"] === undefined ? "" : componentProps["src"];
29
+ if (value0 === null || value0 === undefined) element1.removeAttribute("src");
30
+ else element1.setAttribute("src", String(value0));
31
+ const value1 = componentProps["alt"] === undefined ? "" : componentProps["alt"];
32
+ if (value1 === null || value1 === undefined) element1.removeAttribute("alt");
33
+ else element1.setAttribute("alt", String(value1));
34
+ const value2 = componentProps["width"] === undefined ? null : componentProps["width"];
35
+ if (value2 === null || value2 === undefined) element1.removeAttribute("width");
36
+ else element1.setAttribute("width", String(value2));
37
+ const value3 = componentProps["height"] === undefined ? null : componentProps["height"];
38
+ if (value3 === null || value3 === undefined) element1.removeAttribute("height");
39
+ else element1.setAttribute("height", String(value3));
40
+ element0.append(element1);
41
+ }
42
+ const element2 = document.createElement("div");
43
+ element2.setAttribute("class", "handles");
44
+ const element3 = document.createElement("button");
45
+ element3.setAttribute("type", "button");
46
+ element3.setAttribute("class", "handle");
47
+ element3.setAttribute("data-corner", "top-left");
48
+ element3.setAttribute("aria-label", "Resize image from top left");
49
+ element2.append(element3);
50
+ const element4 = document.createElement("button");
51
+ element4.setAttribute("type", "button");
52
+ element4.setAttribute("class", "handle");
53
+ element4.setAttribute("data-corner", "top-right");
54
+ element4.setAttribute("aria-label", "Resize image from top right");
55
+ element2.append(element4);
56
+ const element5 = document.createElement("button");
57
+ element5.setAttribute("type", "button");
58
+ element5.setAttribute("class", "handle");
59
+ element5.setAttribute("data-corner", "bottom-left");
60
+ element5.setAttribute("aria-label", "Resize image from bottom left");
61
+ element2.append(element5);
62
+ const element6 = document.createElement("button");
63
+ element6.setAttribute("type", "button");
64
+ element6.setAttribute("class", "handle");
65
+ element6.setAttribute("data-corner", "bottom-right");
66
+ element6.setAttribute("aria-label", "Resize image from bottom right");
67
+ element2.append(element6);
68
+ element0.append(element2);
69
+ if (slots["controls"] ?? [].length > 0) {
70
+ for (const child of slots["controls"] ?? []) {
71
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
72
+ if (node.nodeType === 1) node.setAttribute("data-slotted", "");
73
+ projected.push([node, "controls"]);
74
+ element0.append(node);
75
+ }
76
+ } else {
77
+ }
78
+ element.append(element0);
79
+ manageComponentLifecycle(element, definition, { props: componentProps, projected,
80
+ controller,
81
+ });
82
+ return element;
83
+ }
84
+
@@ -7,6 +7,8 @@ export interface UiSeparatorElement extends HTMLHRElement {
7
7
  }
8
8
  export interface UiSeparatorProps {
9
9
  orientation?: "horizontal" | "vertical" | null;
10
+ selectable?: boolean | null;
11
+ selected?: boolean | null;
10
12
  attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
11
13
  children?: readonly (string | Node)[];
12
14
  slots?: Readonly<Record<string, readonly (string | Node)[]>>;
@@ -1,11 +1,13 @@
1
1
  // Generated by HTML Next 1.0.0-alpha.26 for Vanilla DOM. Do not edit.
2
- import { manageGeneratedProp } from "@nextwebwg/html-next/generated-runtime";
2
+ import { manageGeneratedProps } from "@nextwebwg/html-next/generated-runtime";
3
3
  import "../styles/ui-separator.css";
4
4
 
5
5
  export function createUiSeparator(options = {}) {
6
6
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
7
7
  const projected = [];
8
8
  const prop0 = componentProps["orientation"] === undefined ? "horizontal" : componentProps["orientation"];
9
+ const prop1 = componentProps["selectable"] === undefined ? false : componentProps["selectable"];
10
+ const prop2 = componentProps["selected"] === undefined ? false : componentProps["selected"];
9
11
  const element = document.createElement("hr");
10
12
  for (const [name, value] of Object.entries(attributes)) {
11
13
  if (value === null || value === undefined || value === false) continue;
@@ -15,9 +17,15 @@ export function createUiSeparator(options = {}) {
15
17
  if (value0 === null || value0 === undefined) element.removeAttribute("aria-orientation");
16
18
  else element.setAttribute("aria-orientation", String(value0));
17
19
  element.setAttribute("data-component", "ui-separator");
18
- manageGeneratedProp(element, { name: "orientation", attribute: "data-orientation", value: componentProps["orientation"], default: "horizontal", type: ["horizontal","vertical"], required: false }, (value) => {
20
+ manageGeneratedProps(element, [
21
+ { name: "orientation", attribute: "data-orientation", value: componentProps["orientation"], default: "horizontal", type: ["horizontal","vertical"], required: false },
22
+ { name: "selectable", attribute: "data-selectable", value: componentProps["selectable"], default: false, type: "boolean", required: false },
23
+ { name: "selected", attribute: "data-selected", value: componentProps["selected"], default: false, type: "boolean", required: false },
24
+ ], (name, value) => {
25
+ if (name === "orientation") {
19
26
  if (value === null || value === undefined) element.removeAttribute("aria-orientation");
20
27
  else element.setAttribute("aria-orientation", String(value));
28
+ }
21
29
  });
22
30
  return element;
23
31
  }
package/vanilla/index.js CHANGED
@@ -34,6 +34,7 @@ export * from "./UiFormField.js";
34
34
  export * from "./UiGrid.js";
35
35
  export * from "./UiIcon.js";
36
36
  export * from "./UiIconButton.js";
37
+ export * from "./UiImage.js";
37
38
  export * from "./UiInput.js";
38
39
  export * from "./UiInputGroup.js";
39
40
  export * from "./UiList.js";