@threadlabs/looma 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -12
- package/components/shared/editor.js +69 -0
- package/components/shared/input-modality.js +20 -0
- package/components/shared/overlay.js +281 -0
- package/components/shared/trigger.js +17 -0
- package/components/ui-affordance-scope/ui-affordance-scope.html +22 -0
- package/components/ui-affordance-scope/ui-affordance-scope.js +76 -0
- package/components/ui-avatar/ui-avatar.html +59 -0
- package/components/ui-avatar/ui-avatar.js +47 -0
- package/components/ui-avatar-group/ui-avatar-group.html +62 -0
- package/components/ui-avatar-group/ui-avatar-group.js +27 -0
- package/components/ui-badge/ui-badge.html +94 -0
- package/components/ui-button/ui-button.html +198 -0
- package/components/ui-callout/ui-callout.html +104 -0
- package/components/ui-checkbox/ui-checkbox.html +107 -0
- package/components/ui-checkbox/ui-checkbox.js +24 -0
- package/components/ui-cluster/ui-cluster.html +49 -0
- package/components/ui-combobox/ui-combobox.html +377 -0
- package/components/ui-combobox/ui-combobox.js +432 -0
- package/components/ui-container/ui-container.html +39 -0
- package/components/ui-context-menu/ui-context-menu.html +75 -0
- package/components/ui-context-menu/ui-context-menu.js +143 -0
- package/components/ui-dialog/ui-dialog.html +178 -0
- package/components/ui-dialog/ui-dialog.js +105 -0
- package/components/ui-disclosure/ui-disclosure.html +109 -0
- package/components/ui-disclosure/ui-disclosure.js +28 -0
- package/components/ui-editable/ui-editable.html +163 -0
- package/components/ui-editable/ui-editable.js +113 -0
- package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.html +97 -0
- package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.js +71 -0
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +157 -0
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.js +50 -0
- package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +197 -0
- package/components/ui-editor-slash-menu/ui-editor-slash-menu.js +44 -0
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +164 -0
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.js +75 -0
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +422 -0
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.js +119 -0
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +271 -0
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.js +54 -0
- package/components/ui-editor-toolbar/ui-editor-toolbar.html +110 -0
- package/components/ui-floating-action-button/ui-floating-action-button.html +83 -0
- package/components/ui-form-field/ui-form-field.html +45 -0
- package/components/ui-form-field/ui-form-field.js +71 -0
- package/components/ui-grid/ui-grid.html +46 -0
- package/components/ui-icon/ui-icon.html +34 -0
- package/components/ui-icon/ui-icon.js +8 -0
- package/components/ui-icon-button/ui-icon-button.html +167 -0
- package/components/ui-icon-button/ui-icon-button.js +7 -0
- package/components/ui-input/ui-input.html +81 -0
- package/components/ui-input/ui-input.js +7 -0
- package/components/ui-menu/ui-menu.html +87 -0
- package/components/ui-menu/ui-menu.js +114 -0
- package/components/ui-menu-item/ui-menu-item.html +37 -0
- package/components/ui-popover/ui-popover.html +85 -0
- package/components/ui-popover/ui-popover.js +70 -0
- package/components/ui-radio/ui-radio.html +57 -0
- package/components/ui-radio/ui-radio.js +25 -0
- package/components/ui-radio-group/ui-radio-group.html +51 -0
- package/components/ui-radio-group/ui-radio-group.js +42 -0
- package/components/ui-reel/ui-reel.html +67 -0
- package/components/ui-search-result-row/ui-search-result-row.html +101 -0
- package/components/ui-search-shell/ui-search-shell.html +142 -0
- package/components/ui-search-shell/ui-search-shell.js +60 -0
- package/components/ui-select/ui-select.html +87 -0
- package/components/ui-select/ui-select.js +16 -0
- package/components/ui-separator/ui-separator.html +22 -0
- package/components/ui-sidebar/ui-sidebar.html +183 -0
- package/components/ui-sidebar/ui-sidebar.js +178 -0
- package/components/ui-stack/ui-stack.html +59 -0
- package/components/ui-switch/ui-switch.html +95 -0
- package/components/ui-switch/ui-switch.js +24 -0
- package/components/ui-switcher/ui-switcher.html +65 -0
- package/components/ui-tabs/ui-tabs.html +134 -0
- package/components/ui-tabs/ui-tabs.js +81 -0
- package/components/ui-textarea/ui-textarea.html +80 -0
- package/components/ui-textarea/ui-textarea.js +7 -0
- package/components/ui-toast-region/ui-toast-region.html +127 -0
- package/components/ui-toast-region/ui-toast-region.js +119 -0
- package/components/ui-tooltip/ui-tooltip.html +122 -0
- package/components/ui-tooltip/ui-tooltip.js +134 -0
- package/components/ui-top-bar/ui-top-bar.html +53 -0
- package/components/ui-tree/ui-tree.html +29 -0
- package/components/ui-tree/ui-tree.js +250 -0
- package/components/ui-tree-item/ui-tree-item.html +326 -0
- package/components/ui-tree-item/ui-tree-item.js +94 -0
- package/dist/index.d.ts +4 -414
- package/dist/index.js +55 -657
- package/editor/chunks/extensions.js +7267 -0
- package/editor/chunks/table-backgrounds.js +51 -0
- package/editor/chunks/ui.js +92 -0
- package/editor/extensions/callout.d.ts +20 -0
- package/editor/extensions/index.d.ts +12 -441
- package/editor/extensions/index.js +3 -64
- package/editor/extensions/list-behavior.d.ts +7 -0
- package/editor/extensions/mention.d.ts +35 -0
- package/editor/extensions/preset.d.ts +42 -0
- package/editor/extensions/slash-command.d.ts +80 -0
- package/editor/extensions/smart-paste.d.ts +13 -0
- package/editor/extensions/table-commands.d.ts +114 -0
- package/editor/extensions/table-formatting.d.ts +60 -0
- package/editor/icons.d.ts +55 -0
- package/editor/index.d.ts +8 -6
- package/editor/index.js +96 -71
- package/editor/insert-table-grid.d.ts +7 -0
- package/editor/mention-contract.d.ts +78 -0
- package/editor/mention-menu.d.ts +9 -0
- package/editor/slash-menu.d.ts +29 -0
- package/editor/table-backgrounds.d.ts +43 -0
- package/editor/table-context-menu.d.ts +12 -0
- package/editor/table-overlay.d.ts +79 -0
- package/editor/ui.d.ts +10 -50
- package/editor/ui.js +3 -14
- package/editor/viewport.d.ts +15 -0
- package/package.json +84 -80
- package/styles/ui-affordance-scope.css +19 -0
- package/styles/ui-avatar-group.css +56 -0
- package/styles/ui-avatar.css +47 -0
- package/styles/ui-badge.css +91 -0
- package/styles/ui-button.css +206 -0
- package/styles/ui-callout.css +76 -0
- package/styles/ui-checkbox.css +98 -0
- package/styles/ui-cluster.css +46 -0
- package/styles/ui-combobox.css +213 -0
- package/styles/ui-container.css +36 -0
- package/styles/ui-context-menu.css +68 -0
- package/styles/ui-dialog.css +160 -0
- package/styles/ui-disclosure.css +95 -0
- package/styles/ui-editable.css +139 -0
- package/styles/ui-editor-insert-table-grid.css +65 -0
- package/styles/ui-editor-mention-menu.css +121 -0
- package/styles/ui-editor-slash-menu.css +179 -0
- package/styles/ui-editor-table-context-menu.css +118 -0
- package/styles/ui-editor-table-overlay.css +318 -0
- package/styles/ui-editor-table-toolbar.css +191 -0
- package/styles/ui-editor-toolbar.css +115 -0
- package/styles/ui-floating-action-button.css +82 -0
- package/styles/ui-form-field.css +36 -0
- package/styles/ui-grid.css +43 -0
- package/styles/ui-icon-button.css +169 -0
- package/styles/ui-icon.css +23 -0
- package/styles/ui-input.css +82 -0
- package/styles/ui-menu-item.css +34 -0
- package/styles/ui-menu.css +80 -0
- package/styles/ui-popover.css +76 -0
- package/styles/ui-radio-group.css +38 -0
- package/styles/ui-radio.css +46 -0
- package/styles/ui-reel.css +63 -0
- package/styles/ui-search-result-row.css +92 -0
- package/styles/ui-search-shell.css +128 -0
- package/styles/ui-select.css +86 -0
- package/styles/ui-separator.css +16 -0
- package/styles/ui-sidebar.css +166 -0
- package/styles/ui-stack.css +55 -0
- package/styles/ui-switch.css +88 -0
- package/styles/ui-switcher.css +61 -0
- package/styles/ui-tabs.css +114 -0
- package/styles/ui-textarea.css +77 -0
- package/styles/ui-toast-region.css +103 -0
- package/styles/ui-tooltip.css +113 -0
- package/styles/ui-top-bar.css +51 -0
- package/styles/ui-tree-item.css +267 -0
- package/styles/ui-tree.css +16 -0
- package/vanilla/UiAffordanceScope.d.ts +14 -0
- package/vanilla/UiAffordanceScope.js +30 -0
- package/vanilla/UiAvatar.d.ts +17 -0
- package/vanilla/UiAvatar.js +41 -0
- package/vanilla/UiAvatarGroup.d.ts +15 -0
- package/vanilla/UiAvatarGroup.js +40 -0
- package/vanilla/UiBadge.d.ts +15 -0
- package/vanilla/UiBadge.js +30 -0
- package/vanilla/UiButton.d.ts +16 -0
- package/vanilla/UiButton.js +32 -0
- package/vanilla/UiCallout.d.ts +14 -0
- package/vanilla/UiCallout.js +124 -0
- package/vanilla/UiCheckbox.d.ts +19 -0
- package/vanilla/UiCheckbox.js +47 -0
- package/vanilla/UiCluster.d.ts +15 -0
- package/vanilla/UiCluster.js +30 -0
- package/vanilla/UiCombobox.d.ts +42 -0
- package/vanilla/UiCombobox.js +194 -0
- package/vanilla/UiContainer.d.ts +15 -0
- package/vanilla/UiContainer.js +30 -0
- package/vanilla/UiContextMenu.d.ts +18 -0
- package/vanilla/UiContextMenu.js +35 -0
- package/vanilla/UiDialog.d.ts +19 -0
- package/vanilla/UiDialog.js +53 -0
- package/vanilla/UiDisclosure.d.ts +18 -0
- package/vanilla/UiDisclosure.js +49 -0
- package/vanilla/UiEditable.d.ts +22 -0
- package/vanilla/UiEditable.js +59 -0
- package/vanilla/UiEditorInsertTableGrid.d.ts +18 -0
- package/vanilla/UiEditorInsertTableGrid.js +46 -0
- package/vanilla/UiEditorMentionMenu.d.ts +21 -0
- package/vanilla/UiEditorMentionMenu.js +63 -0
- package/vanilla/UiEditorSlashMenu.d.ts +20 -0
- package/vanilla/UiEditorSlashMenu.js +74 -0
- package/vanilla/UiEditorTableContextMenu.d.ts +17 -0
- package/vanilla/UiEditorTableContextMenu.js +69 -0
- package/vanilla/UiEditorTableOverlay.d.ts +16 -0
- package/vanilla/UiEditorTableOverlay.js +113 -0
- package/vanilla/UiEditorTableToolbar.d.ts +18 -0
- package/vanilla/UiEditorTableToolbar.js +121 -0
- package/vanilla/UiEditorToolbar.d.ts +14 -0
- package/vanilla/UiEditorToolbar.js +30 -0
- package/vanilla/UiFloatingActionButton.d.ts +16 -0
- package/vanilla/UiFloatingActionButton.js +35 -0
- package/vanilla/UiFormField.d.ts +16 -0
- package/vanilla/UiFormField.js +54 -0
- package/vanilla/UiGrid.d.ts +15 -0
- package/vanilla/UiGrid.js +30 -0
- package/vanilla/UiIcon.d.ts +14 -0
- package/vanilla/UiIcon.js +40 -0
- package/vanilla/UiIconButton.d.ts +19 -0
- package/vanilla/UiIconButton.js +37 -0
- package/vanilla/UiInput.d.ts +18 -0
- package/vanilla/UiInput.js +37 -0
- package/vanilla/UiMenu.d.ts +19 -0
- package/vanilla/UiMenu.js +35 -0
- package/vanilla/UiMenuItem.d.ts +15 -0
- package/vanilla/UiMenuItem.js +43 -0
- package/vanilla/UiPopover.d.ts +18 -0
- package/vanilla/UiPopover.js +33 -0
- package/vanilla/UiRadio.d.ts +19 -0
- package/vanilla/UiRadio.js +48 -0
- package/vanilla/UiRadioGroup.d.ts +21 -0
- package/vanilla/UiRadioGroup.js +35 -0
- package/vanilla/UiReel.d.ts +16 -0
- package/vanilla/UiReel.js +34 -0
- package/vanilla/UiSearchResultRow.d.ts +15 -0
- package/vanilla/UiSearchResultRow.js +82 -0
- package/vanilla/UiSearchShell.d.ts +18 -0
- package/vanilla/UiSearchShell.js +74 -0
- package/vanilla/UiSelect.d.ts +18 -0
- package/vanilla/UiSelect.js +42 -0
- package/vanilla/UiSeparator.d.ts +14 -0
- package/vanilla/UiSeparator.js +28 -0
- package/vanilla/UiSidebar.d.ts +24 -0
- package/vanilla/UiSidebar.js +47 -0
- package/vanilla/UiStack.d.ts +16 -0
- package/vanilla/UiStack.js +32 -0
- package/vanilla/UiSwitch.d.ts +18 -0
- package/vanilla/UiSwitch.js +46 -0
- package/vanilla/UiSwitcher.d.ts +16 -0
- package/vanilla/UiSwitcher.js +32 -0
- package/vanilla/UiTabs.d.ts +18 -0
- package/vanilla/UiTabs.js +47 -0
- package/vanilla/UiTextarea.d.ts +19 -0
- package/vanilla/UiTextarea.js +40 -0
- package/vanilla/UiToastRegion.d.ts +20 -0
- package/vanilla/UiToastRegion.js +58 -0
- package/vanilla/UiTooltip.d.ts +21 -0
- package/vanilla/UiTooltip.js +34 -0
- package/vanilla/UiTopBar.d.ts +13 -0
- package/vanilla/UiTopBar.js +59 -0
- package/vanilla/UiTree.d.ts +18 -0
- package/vanilla/UiTree.js +31 -0
- package/vanilla/UiTreeItem.d.ts +26 -0
- package/vanilla/UiTreeItem.js +164 -0
- package/vanilla/index.js +48 -0
- package/vue/UiAffordanceScope.d.ts +18 -0
- package/vue/UiAffordanceScope.js +2 -0
- package/vue/UiAffordanceScope.vue +118 -0
- package/vue/UiAvatar.d.ts +23 -0
- package/vue/UiAvatar.js +2 -0
- package/vue/UiAvatar.vue +152 -0
- package/vue/UiAvatarGroup.d.ts +20 -0
- package/vue/UiAvatarGroup.js +2 -0
- package/vue/UiAvatarGroup.vue +167 -0
- package/vue/UiBadge.d.ts +20 -0
- package/vue/UiBadge.js +2 -0
- package/vue/UiBadge.vue +123 -0
- package/vue/UiButton.d.ts +22 -0
- package/vue/UiButton.js +2 -0
- package/vue/UiButton.vue +229 -0
- package/vue/UiCallout.d.ts +18 -0
- package/vue/UiCallout.js +2 -0
- package/vue/UiCallout.vue +104 -0
- package/vue/UiCheckbox.d.ts +38 -0
- package/vue/UiCheckbox.js +2 -0
- package/vue/UiCheckbox.vue +216 -0
- package/vue/UiCluster.d.ts +17 -0
- package/vue/UiCluster.js +2 -0
- package/vue/UiCluster.vue +75 -0
- package/vue/UiCombobox.d.ts +255 -0
- package/vue/UiCombobox.js +2 -0
- package/vue/UiCombobox.vue +466 -0
- package/vue/UiContainer.d.ts +17 -0
- package/vue/UiContainer.js +2 -0
- package/vue/UiContainer.vue +65 -0
- package/vue/UiContextMenu.d.ts +50 -0
- package/vue/UiContextMenu.js +2 -0
- package/vue/UiContextMenu.vue +166 -0
- package/vue/UiDialog.d.ts +39 -0
- package/vue/UiDialog.js +2 -0
- package/vue/UiDialog.vue +273 -0
- package/vue/UiDisclosure.d.ts +44 -0
- package/vue/UiDisclosure.js +2 -0
- package/vue/UiDisclosure.vue +211 -0
- package/vue/UiEditable.d.ts +48 -0
- package/vue/UiEditable.js +2 -0
- package/vue/UiEditable.vue +267 -0
- package/vue/UiEditorInsertTableGrid.d.ts +26 -0
- package/vue/UiEditorInsertTableGrid.js +2 -0
- package/vue/UiEditorInsertTableGrid.vue +210 -0
- package/vue/UiEditorMentionMenu.d.ts +44 -0
- package/vue/UiEditorMentionMenu.js +2 -0
- package/vue/UiEditorMentionMenu.vue +284 -0
- package/vue/UiEditorSlashMenu.d.ts +41 -0
- package/vue/UiEditorSlashMenu.js +2 -0
- package/vue/UiEditorSlashMenu.vue +306 -0
- package/vue/UiEditorTableContextMenu.d.ts +19 -0
- package/vue/UiEditorTableContextMenu.js +2 -0
- package/vue/UiEditorTableContextMenu.vue +252 -0
- package/vue/UiEditorTableOverlay.d.ts +66 -0
- package/vue/UiEditorTableOverlay.js +2 -0
- package/vue/UiEditorTableOverlay.vue +455 -0
- package/vue/UiEditorTableToolbar.d.ts +21 -0
- package/vue/UiEditorTableToolbar.js +2 -0
- package/vue/UiEditorTableToolbar.vue +339 -0
- package/vue/UiEditorToolbar.d.ts +18 -0
- package/vue/UiEditorToolbar.js +2 -0
- package/vue/UiEditorToolbar.vue +138 -0
- package/vue/UiFloatingActionButton.d.ts +22 -0
- package/vue/UiFloatingActionButton.js +2 -0
- package/vue/UiFloatingActionButton.vue +116 -0
- package/vue/UiFormField.d.ts +28 -0
- package/vue/UiFormField.js +2 -0
- package/vue/UiFormField.vue +124 -0
- package/vue/UiGrid.d.ts +17 -0
- package/vue/UiGrid.js +2 -0
- package/vue/UiGrid.vue +72 -0
- package/vue/UiIcon.d.ts +8 -0
- package/vue/UiIcon.js +2 -0
- package/vue/UiIcon.vue +135 -0
- package/vue/UiIconButton.d.ts +27 -0
- package/vue/UiIconButton.js +2 -0
- package/vue/UiIconButton.vue +268 -0
- package/vue/UiInput.d.ts +20 -0
- package/vue/UiInput.js +2 -0
- package/vue/UiInput.vue +177 -0
- package/vue/UiMenu.d.ts +52 -0
- package/vue/UiMenu.js +2 -0
- package/vue/UiMenu.vue +194 -0
- package/vue/UiMenuItem.d.ts +20 -0
- package/vue/UiMenuItem.js +2 -0
- package/vue/UiMenuItem.vue +55 -0
- package/vue/UiPopover.d.ts +44 -0
- package/vue/UiPopover.js +2 -0
- package/vue/UiPopover.vue +188 -0
- package/vue/UiRadio.d.ts +38 -0
- package/vue/UiRadio.js +2 -0
- package/vue/UiRadio.vue +166 -0
- package/vue/UiRadioGroup.d.ts +50 -0
- package/vue/UiRadioGroup.js +2 -0
- package/vue/UiRadioGroup.vue +161 -0
- package/vue/UiReel.d.ts +18 -0
- package/vue/UiReel.js +2 -0
- package/vue/UiReel.vue +93 -0
- package/vue/UiSearchResultRow.d.ts +28 -0
- package/vue/UiSearchResultRow.js +2 -0
- package/vue/UiSearchResultRow.vue +124 -0
- package/vue/UiSearchShell.d.ts +42 -0
- package/vue/UiSearchShell.js +2 -0
- package/vue/UiSearchShell.vue +233 -0
- package/vue/UiSelect.d.ts +30 -0
- package/vue/UiSelect.js +2 -0
- package/vue/UiSelect.vue +183 -0
- package/vue/UiSeparator.d.ts +8 -0
- package/vue/UiSeparator.js +2 -0
- package/vue/UiSeparator.vue +38 -0
- package/vue/UiSidebar.d.ts +54 -0
- package/vue/UiSidebar.js +2 -0
- package/vue/UiSidebar.vue +288 -0
- package/vue/UiStack.d.ts +18 -0
- package/vue/UiStack.js +2 -0
- package/vue/UiStack.vue +85 -0
- package/vue/UiSwitch.d.ts +36 -0
- package/vue/UiSwitch.js +2 -0
- package/vue/UiSwitch.vue +203 -0
- package/vue/UiSwitcher.d.ts +18 -0
- package/vue/UiSwitcher.js +2 -0
- package/vue/UiSwitcher.vue +91 -0
- package/vue/UiTabs.d.ts +36 -0
- package/vue/UiTabs.js +2 -0
- package/vue/UiTabs.vue +269 -0
- package/vue/UiTextarea.d.ts +22 -0
- package/vue/UiTextarea.js +2 -0
- package/vue/UiTextarea.vue +177 -0
- package/vue/UiToastRegion.d.ts +48 -0
- package/vue/UiToastRegion.js +2 -0
- package/vue/UiToastRegion.vue +256 -0
- package/vue/UiTooltip.d.ts +50 -0
- package/vue/UiTooltip.js +2 -0
- package/vue/UiTooltip.vue +230 -0
- package/vue/UiTopBar.d.ts +19 -0
- package/vue/UiTopBar.js +2 -0
- package/vue/UiTopBar.vue +56 -0
- package/vue/UiTree.d.ts +62 -0
- package/vue/UiTree.js +2 -0
- package/vue/UiTree.vue +117 -0
- package/vue/UiTreeItem.d.ts +56 -0
- package/vue/UiTreeItem.js +2 -0
- package/vue/UiTreeItem.vue +418 -0
- package/vue/chunks/UiAffordanceScope.js +112 -0
- package/vue/chunks/UiAvatar.js +144 -0
- package/vue/chunks/UiAvatarGroup.js +142 -0
- package/vue/chunks/UiBadge.js +33 -0
- package/vue/chunks/UiButton.js +47 -0
- package/vue/chunks/UiCallout.js +117 -0
- package/vue/chunks/UiCheckbox.js +167 -0
- package/vue/chunks/UiCluster.js +33 -0
- package/vue/chunks/UiCombobox.js +684 -0
- package/vue/chunks/UiContainer.js +33 -0
- package/vue/chunks/UiContextMenu.js +153 -0
- package/vue/chunks/UiDialog.js +162 -0
- package/vue/chunks/UiDisclosure.js +185 -0
- package/vue/chunks/UiEditable.js +223 -0
- package/vue/chunks/UiEditorInsertTableGrid.js +221 -0
- package/vue/chunks/UiEditorMentionMenu.js +245 -0
- package/vue/chunks/UiEditorSlashMenu.js +210 -0
- package/vue/chunks/UiEditorTableContextMenu.js +201 -0
- package/vue/chunks/UiEditorTableOverlay.js +301 -0
- package/vue/chunks/UiEditorTableToolbar.js +299 -0
- package/vue/chunks/UiEditorToolbar.js +37 -0
- package/vue/chunks/UiFloatingActionButton.js +56 -0
- package/vue/chunks/UiFormField.js +113 -0
- package/vue/chunks/UiGrid.js +33 -0
- package/vue/chunks/UiIcon.js +170 -0
- package/vue/chunks/UiIconButton.js +141 -0
- package/vue/chunks/UiInput.js +136 -0
- package/vue/chunks/UiMenu.js +163 -0
- package/vue/chunks/UiMenuItem.js +37 -0
- package/vue/chunks/UiPopover.js +149 -0
- package/vue/chunks/UiRadio.js +164 -0
- package/vue/chunks/UiRadioGroup.js +160 -0
- package/vue/chunks/UiReel.js +42 -0
- package/vue/chunks/UiSearchResultRow.js +63 -0
- package/vue/chunks/UiSearchShell.js +152 -0
- package/vue/chunks/UiSelect.js +134 -0
- package/vue/chunks/UiSeparator.js +24 -0
- package/vue/chunks/UiSidebar.js +180 -0
- package/vue/chunks/UiStack.js +38 -0
- package/vue/chunks/UiSwitch.js +162 -0
- package/vue/chunks/UiSwitcher.js +38 -0
- package/vue/chunks/UiTabs.js +210 -0
- package/vue/chunks/UiTextarea.js +139 -0
- package/vue/chunks/UiToastRegion.js +227 -0
- package/vue/chunks/UiTooltip.js +163 -0
- package/vue/chunks/UiTopBar.js +25 -0
- package/vue/chunks/UiTree.js +140 -0
- package/vue/chunks/UiTreeItem.js +315 -0
- package/vue/chunks/_plugin-vue_export-helper.js +8 -0
- package/vue/components.css +4405 -0
- package/vue/editor/LoomaEditor.d.ts +171 -0
- package/vue/editor/image-delivery.d.ts +61 -0
- package/vue/editor/index.d.ts +4 -386
- package/vue/editor/index.js +995 -1134
- package/vue/editor/primitives.d.ts +23 -0
- package/vue/index.d.ts +48 -604
- package/vue/index.js +49 -86
- package/dist/chunk-MLKGABMK.js +0 -9
- package/dist/chunk-RWLYVQY6.js +0 -5719
- package/dist/chunk-XDNZIKNI.js +0 -2721
- package/dist/declarative-generated.cjs +0 -149
- package/dist/declarative-generated.d.cts +0 -16
- package/dist/declarative-generated.d.ts +0 -16
- package/dist/declarative-generated.js +0 -124
- package/dist/declarative.cjs +0 -2750
- package/dist/declarative.d.cts +0 -101
- package/dist/declarative.d.ts +0 -101
- package/dist/declarative.js +0 -15
- package/dist/index.cjs +0 -9077
- package/dist/index.d.cts +0 -414
- package/dist/loader.cjs +0 -8442
- package/dist/loader.d.cts +0 -4
- package/dist/loader.d.ts +0 -4
- package/dist/loader.js +0 -16
- package/editor/chunk-EUIH3TBV.js +0 -6826
- package/editor/chunk-JK53ENSG.js +0 -29
- package/editor/chunk-U36XNFJN.js +0 -2592
- package/editor/table-overlay-DZFGHQDt.d.ts +0 -138
- package/editor.css +0 -1592
- package/layout/index.cjs +0 -356
- package/layout/index.d.cts +0 -18
- package/layout/index.d.ts +0 -18
- package/layout/index.js +0 -341
- package/layout.css +0 -191
- package/react/index.d.ts +0 -1276
- package/react/index.js +0 -1526
- package/styles.css +0 -940
- package/svelte/index.d.ts +0 -204
- package/svelte/index.js +0 -1892
- package/vue/chunk-OX3EACZ7.js +0 -4369
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//#region src/editor/table-backgrounds.ts
|
|
2
|
+
/** Canonical persisted colors shared by editor commands and table UI swatches. */
|
|
3
|
+
var TABLE_CELL_BACKGROUND_PRESETS = {
|
|
4
|
+
none: null,
|
|
5
|
+
gray: "#f3f4f6",
|
|
6
|
+
yellow: "#fef3c7",
|
|
7
|
+
blue: "#dbeafe",
|
|
8
|
+
green: "#dcfce7",
|
|
9
|
+
red: "#fee2e2"
|
|
10
|
+
};
|
|
11
|
+
/** Ordered menu choices coupling each UI intent to its persisted color value. */
|
|
12
|
+
var TABLE_CELL_BACKGROUND_OPTIONS = [
|
|
13
|
+
{
|
|
14
|
+
action: "background-none",
|
|
15
|
+
label: "Default",
|
|
16
|
+
value: TABLE_CELL_BACKGROUND_PRESETS.none,
|
|
17
|
+
swatch: null
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
action: "background-gray",
|
|
21
|
+
label: "Gray",
|
|
22
|
+
value: TABLE_CELL_BACKGROUND_PRESETS.gray,
|
|
23
|
+
swatch: TABLE_CELL_BACKGROUND_PRESETS.gray
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
action: "background-yellow",
|
|
27
|
+
label: "Yellow",
|
|
28
|
+
value: TABLE_CELL_BACKGROUND_PRESETS.yellow,
|
|
29
|
+
swatch: TABLE_CELL_BACKGROUND_PRESETS.yellow
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
action: "background-blue",
|
|
33
|
+
label: "Blue",
|
|
34
|
+
value: TABLE_CELL_BACKGROUND_PRESETS.blue,
|
|
35
|
+
swatch: TABLE_CELL_BACKGROUND_PRESETS.blue
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
action: "background-green",
|
|
39
|
+
label: "Green",
|
|
40
|
+
value: TABLE_CELL_BACKGROUND_PRESETS.green,
|
|
41
|
+
swatch: TABLE_CELL_BACKGROUND_PRESETS.green
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
action: "background-red",
|
|
45
|
+
label: "Red",
|
|
46
|
+
value: TABLE_CELL_BACKGROUND_PRESETS.red,
|
|
47
|
+
swatch: TABLE_CELL_BACKGROUND_PRESETS.red
|
|
48
|
+
}
|
|
49
|
+
];
|
|
50
|
+
//#endregion
|
|
51
|
+
export { TABLE_CELL_BACKGROUND_PRESETS as n, TABLE_CELL_BACKGROUND_OPTIONS as t };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
//#region src/editor/table-overlay.ts
|
|
2
|
+
function mapTableCells(table) {
|
|
3
|
+
const rows = Array.from(table.rows);
|
|
4
|
+
const grid = [];
|
|
5
|
+
const coordinates = /* @__PURE__ */ new Map();
|
|
6
|
+
rows.forEach((row, rowIndex) => {
|
|
7
|
+
grid[rowIndex] ??= [];
|
|
8
|
+
let columnIndex = 0;
|
|
9
|
+
for (const cell of Array.from(row.cells)) {
|
|
10
|
+
while (grid[rowIndex]?.[columnIndex]) columnIndex += 1;
|
|
11
|
+
coordinates.set(cell, {
|
|
12
|
+
rowIndex,
|
|
13
|
+
columnIndex
|
|
14
|
+
});
|
|
15
|
+
const rowSpan = cell.rowSpan === 0 ? rows.length - rowIndex : Math.max(1, cell.rowSpan);
|
|
16
|
+
const columnSpan = Math.max(1, cell.colSpan);
|
|
17
|
+
for (let rowOffset = 0; rowOffset < rowSpan; rowOffset += 1) {
|
|
18
|
+
const gridRow = grid[rowIndex + rowOffset] ??= [];
|
|
19
|
+
for (let columnOffset = 0; columnOffset < columnSpan; columnOffset += 1) gridRow[columnIndex + columnOffset] = cell;
|
|
20
|
+
}
|
|
21
|
+
columnIndex += columnSpan;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
grid,
|
|
26
|
+
coordinates
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Resolves a logical grid coordinate to its owning DOM cell.
|
|
31
|
+
* A spanning cell can therefore be returned for more than one coordinate; this
|
|
32
|
+
* is intentional and prevents overlay actions from inventing nonexistent cells.
|
|
33
|
+
*
|
|
34
|
+
* @contract Coordinates outside the expanded table grid return null; coordinates
|
|
35
|
+
* covered by a span resolve to the single DOM cell that owns them.
|
|
36
|
+
*/
|
|
37
|
+
function resolveTableCellAt(table, rowIndex, columnIndex) {
|
|
38
|
+
return mapTableCells(table).grid[rowIndex]?.[columnIndex] ?? null;
|
|
39
|
+
}
|
|
40
|
+
function uniqueSorted(values) {
|
|
41
|
+
return values.sort((left, right) => left - right).filter((value, index, all) => index === 0 || Math.abs(value - (all[index - 1] ?? value)) >= .5).map((value) => Math.round(value * 100) / 100);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Measures rendered boundaries rather than assuming a uniform table grid.
|
|
45
|
+
* Returned offsets are table-relative and rounded to hundredths of a CSS pixel
|
|
46
|
+
* to suppress observer churn without losing subpixel layout fidelity.
|
|
47
|
+
*
|
|
48
|
+
* @contract Active and hovered rectangles are returned only for cells contained
|
|
49
|
+
* by the supplied table; detached or foreign cells are represented as null.
|
|
50
|
+
*/
|
|
51
|
+
function measureTableOverlayGeometry(table, activeCell, hoveredCell = null) {
|
|
52
|
+
const tableRect = table.getBoundingClientRect();
|
|
53
|
+
const rows = Array.from(table.rows);
|
|
54
|
+
const cells = rows.flatMap((row) => Array.from(row.cells));
|
|
55
|
+
const { coordinates } = mapTableCells(table);
|
|
56
|
+
const rowBoundaries = uniqueSorted(rows.flatMap((row) => {
|
|
57
|
+
const rect = row.getBoundingClientRect();
|
|
58
|
+
return [rect.top - tableRect.top, rect.bottom - tableRect.top];
|
|
59
|
+
}));
|
|
60
|
+
const columnBoundaries = uniqueSorted(cells.flatMap((cell) => {
|
|
61
|
+
const rect = cell.getBoundingClientRect();
|
|
62
|
+
return [rect.left - tableRect.left, rect.right - tableRect.left];
|
|
63
|
+
}));
|
|
64
|
+
if (!activeCell || !table.contains(activeCell)) return {
|
|
65
|
+
rowBoundaries,
|
|
66
|
+
columnBoundaries,
|
|
67
|
+
activeCell: null,
|
|
68
|
+
hoveredCell: measureCellRect(table, hoveredCell, coordinates)
|
|
69
|
+
};
|
|
70
|
+
return {
|
|
71
|
+
rowBoundaries,
|
|
72
|
+
columnBoundaries,
|
|
73
|
+
activeCell: measureCellRect(table, activeCell, coordinates),
|
|
74
|
+
hoveredCell: measureCellRect(table, hoveredCell, coordinates)
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function measureCellRect(table, cell, coordinates) {
|
|
78
|
+
if (!cell || !table.contains(cell)) return null;
|
|
79
|
+
const tableRect = table.getBoundingClientRect();
|
|
80
|
+
const cellRect = cell.getBoundingClientRect();
|
|
81
|
+
const coordinate = coordinates.get(cell);
|
|
82
|
+
return {
|
|
83
|
+
left: Math.round((cellRect.left - tableRect.left) * 100) / 100,
|
|
84
|
+
top: Math.round((cellRect.top - tableRect.top) * 100) / 100,
|
|
85
|
+
width: Math.round(cellRect.width * 100) / 100,
|
|
86
|
+
height: Math.round(cellRect.height * 100) / 100,
|
|
87
|
+
rowIndex: coordinate?.rowIndex ?? 0,
|
|
88
|
+
columnIndex: coordinate?.columnIndex ?? 0
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { resolveTableCellAt as n, measureTableOverlayGeometry as t };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
/** Canonical tone values that may be persisted in a Looma callout node. */
|
|
3
|
+
export declare const LOOMA_CALLOUT_TONES: readonly ["info", "note", "warning"];
|
|
4
|
+
/** A serialized callout tone; unsupported input is normalized to `note`. */
|
|
5
|
+
export type LoomaCalloutTone = (typeof LOOMA_CALLOUT_TONES)[number];
|
|
6
|
+
declare module "@tiptap/core" {
|
|
7
|
+
interface Commands<ReturnType> {
|
|
8
|
+
loomaCallout: {
|
|
9
|
+
/** Wrap the current block in a semantic Looma callout, or retone its existing callout. */
|
|
10
|
+
setLoomaCallout: (tone?: LoomaCalloutTone) => ReturnType;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A durable, themeable block container for informational editor content.
|
|
16
|
+
*
|
|
17
|
+
* @invariant Parsed and rendered `data-tone` values always belong to
|
|
18
|
+
* `LOOMA_CALLOUT_TONES`; missing or unknown values round-trip as `note`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const LoomaCallout: Node<any, any>;
|
|
@@ -1,444 +1,15 @@
|
|
|
1
|
-
import { Node, AnyExtension, Extension, Editor, Range } from '@tiptap/core';
|
|
2
|
-
import { d as TableContextMenuActionEventDetail, g as TableOverlayActionEventDetail } from '../table-overlay-DZFGHQDt.js';
|
|
3
|
-
export { a as TABLE_CELL_BACKGROUND_PRESETS } from '../table-overlay-DZFGHQDt.js';
|
|
4
|
-
import { PluginKey } from '@tiptap/pm/state';
|
|
5
|
-
import { LoomaIconName } from '@threadlabs/looma/core';
|
|
6
|
-
|
|
7
|
-
/** Canonical tone values that may be persisted in a Looma callout node. */
|
|
8
|
-
declare const LOOMA_CALLOUT_TONES: readonly ["info", "note", "warning"];
|
|
9
|
-
/** A serialized callout tone; unsupported input is normalized to `note`. */
|
|
10
|
-
type LoomaCalloutTone = (typeof LOOMA_CALLOUT_TONES)[number];
|
|
11
|
-
declare module "@tiptap/core" {
|
|
12
|
-
interface Commands<ReturnType> {
|
|
13
|
-
loomaCallout: {
|
|
14
|
-
/** Wrap the current block in a semantic Looma callout, or retone its existing callout. */
|
|
15
|
-
setLoomaCallout: (tone?: LoomaCalloutTone) => ReturnType;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
1
|
/**
|
|
20
|
-
*
|
|
2
|
+
* Tiptap-facing schema, behavior, and command policy.
|
|
21
3
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
4
|
+
* Importing this subpath does not register Looma UI elements. Commands accept
|
|
5
|
+
* framework-neutral intent details from `@threadlabs/looma-editor/ui`, but the
|
|
6
|
+
* application owns wiring and editor-instance lifetime. Tiptap remains a peer
|
|
7
|
+
* dependency so Looma and the host execute against the same editor runtime.
|
|
24
8
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Deliberate policy knobs in Looma's default extension set.
|
|
34
|
-
* Consumers needing different schemas should compose an explicit Tiptap list
|
|
35
|
-
* rather than relying on undocumented mutation of the returned extensions.
|
|
36
|
-
*/
|
|
37
|
-
interface DefaultEditorExtensionsOptions {
|
|
38
|
-
/** Placeholder shown only for empty paragraphs, not every empty node type. */
|
|
39
|
-
placeholder?: string;
|
|
40
|
-
/** Passed to Tiptap Link; defaults false to keep editing clicks in the editor. */
|
|
41
|
-
linkOpenOnClick?: boolean;
|
|
42
|
-
/** Passed to Tiptap Image; block images are the default document policy. */
|
|
43
|
-
imageInline?: boolean;
|
|
44
|
-
/** Custom mention extension, the Looma default, or false to omit mentions. */
|
|
45
|
-
mention?: AnyExtension | false;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Complete Looma table schema as one Tiptap extension.
|
|
49
|
-
* Use this in presets that want table, row, header, and cell nodes to remain an
|
|
50
|
-
* atomic policy choice; use `getLoomaTableExtensions` only when ordering or
|
|
51
|
-
* per-extension composition must be explicit.
|
|
52
|
-
*
|
|
53
|
-
* @invariant Installs exactly one compatible table, row, header, and cell node
|
|
54
|
-
* set so a preset cannot accidentally split Looma's persisted table schema.
|
|
55
|
-
*/
|
|
56
|
-
declare const LoomaTableKit: AnyExtension;
|
|
57
|
-
/** Returns a fresh ordered list of the same schema extensions as `LoomaTableKit`. */
|
|
58
|
-
declare function getLoomaTableExtensions(): AnyExtension[];
|
|
59
|
-
/**
|
|
60
|
-
* Builds Looma's complete, ordered Tiptap extension policy.
|
|
61
|
-
*
|
|
62
|
-
* A fresh array is returned for each editor. Document nodes precede marks and
|
|
63
|
-
* behavior extensions; Looma's table/list policies are installed once; mention
|
|
64
|
-
* can be replaced without coupling UI chrome to an application directory.
|
|
65
|
-
* Use with `new Editor({ extensions: getDefaultEditorExtensions(), ... })` or a
|
|
66
|
-
* framework's Tiptap editor hook.
|
|
67
|
-
*/
|
|
68
|
-
declare function getDefaultEditorExtensions(options?: DefaultEditorExtensionsOptions): AnyExtension[];
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Interprets document markup copied from source-oriented tools before Tiptap's
|
|
72
|
-
* generic VS Code handler can turn it into a literal code block.
|
|
73
|
-
*
|
|
74
|
-
* Source-editor metadata remains authoritative for non-document languages.
|
|
75
|
-
* Explicit code-block context is never reinterpreted.
|
|
76
|
-
*
|
|
77
|
-
* @contract Recognized document markup is sanitized and dispatched as one paste
|
|
78
|
-
* transaction; every unrecognized or code-oriented payload returns control to
|
|
79
|
-
* Tiptap's remaining paste handlers without changing the document.
|
|
80
|
-
*/
|
|
81
|
-
declare const LoomaSmartPaste: Extension<any, any>;
|
|
82
|
-
|
|
83
|
-
/** Persistable horizontal alignments accepted by Looma table cells. */
|
|
84
|
-
type TableCellAlignment = "left" | "center" | "right";
|
|
85
|
-
/** CSS color stored in document attrs; null removes authored cell background. */
|
|
86
|
-
type TableCellBackground = string | null;
|
|
87
|
-
/**
|
|
88
|
-
* Looma's table behavior policy: resizable columns, stable minimum cell width,
|
|
89
|
-
* and no independently resizable trailing column. The narrow handle is also a
|
|
90
|
-
* Tiptap coordinate probe, so changing it affects selection as well as visuals.
|
|
91
|
-
*
|
|
92
|
-
* @invariant The 3px handle, 112px cell minimum, and fixed trailing edge are a
|
|
93
|
-
* coordinated selection-and-resize policy and must be changed together.
|
|
94
|
-
*/
|
|
95
|
-
declare const LoomaTable: AnyExtension;
|
|
96
|
-
/**
|
|
97
|
-
* Header node that round-trips Looma alignment and background attributes.
|
|
98
|
-
*
|
|
99
|
-
* @contract Inherits the base header schema while normalizing authored styles
|
|
100
|
-
* into the same persisted attributes used by body cells.
|
|
101
|
-
*/
|
|
102
|
-
declare const LoomaTableHeader: AnyExtension;
|
|
103
|
-
/**
|
|
104
|
-
* Body-cell node with the same persisted formatting contract as headers.
|
|
105
|
-
*
|
|
106
|
-
* @contract Inherits the base cell schema and shares header parsing/rendering so
|
|
107
|
-
* moving content between header and body cells does not change formatting data.
|
|
108
|
-
*/
|
|
109
|
-
declare const LoomaTableCell: AnyExtension;
|
|
110
|
-
/**
|
|
111
|
-
* Reads formatting from the nearest cell/header ancestor of the selection.
|
|
112
|
-
* Left is the canonical default and is not serialized as an inline style.
|
|
113
|
-
*
|
|
114
|
-
* @contract Returns `left` outside a table cell and for missing, invalid, or
|
|
115
|
-
* explicitly default alignment attributes.
|
|
116
|
-
*/
|
|
117
|
-
declare function getActiveTableCellAlignment(editor: Editor): TableCellAlignment;
|
|
118
|
-
/**
|
|
119
|
-
* Returns the nearest cell/header background, normalized so blank means absent.
|
|
120
|
-
*
|
|
121
|
-
* @contract Returns null outside a table cell and for non-string or whitespace-
|
|
122
|
-
* only attributes, matching the value used to clear persisted background CSS.
|
|
123
|
-
*/
|
|
124
|
-
declare function getActiveTableCellBackground(editor: Editor): TableCellBackground;
|
|
125
|
-
/**
|
|
126
|
-
* Updates the active header or body cell and returns false outside a table cell.
|
|
127
|
-
* Setting left stores null, keeping the document free of redundant default CSS.
|
|
128
|
-
*
|
|
129
|
-
* @contract Focuses and updates only the active header or body cell; unsupported
|
|
130
|
-
* selections return false without creating a transaction.
|
|
131
|
-
*/
|
|
132
|
-
declare function setActiveTableCellAlignment(editor: Editor, alignment: TableCellAlignment): boolean;
|
|
133
|
-
/**
|
|
134
|
-
* Updates the active header or body cell; blank strings normalize to null so
|
|
135
|
-
* clearing formatting removes persisted inline style instead of storing noise.
|
|
136
|
-
*
|
|
137
|
-
* @contract Focuses and updates only the active header or body cell; unsupported
|
|
138
|
-
* selections return false and blank values remove the persisted attribute.
|
|
139
|
-
*/
|
|
140
|
-
declare function setActiveTableCellBackground(editor: Editor, backgroundColor: TableCellBackground): boolean;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Table overlay action handler — maps boundaryIndex to Tiptap table commands.
|
|
144
|
-
* Use with the table overlay's `action` event: call this from the adapter's handler.
|
|
145
|
-
*/
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Bounded initial shape for table insertion.
|
|
149
|
-
* Rows and columns are clamped to 1–10 by `insertTableAtRange` so slash-command
|
|
150
|
-
* or custom UI input cannot create an accidentally unbounded transaction.
|
|
151
|
-
*/
|
|
152
|
-
interface InsertTableAtRangeOptions {
|
|
153
|
-
rows?: number;
|
|
154
|
-
cols?: number;
|
|
155
|
-
withHeaderRow?: boolean;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Command availability calculated from the current ProseMirror selection.
|
|
159
|
-
* Keeping capabilities beside UI state prevents toolbars from duplicating
|
|
160
|
-
* Tiptap's schema/selection rules or optimistically enabling invalid actions.
|
|
161
|
-
*/
|
|
162
|
-
interface TableActionCapabilities {
|
|
163
|
-
canAddRowBefore: boolean;
|
|
164
|
-
canAddRowAfter: boolean;
|
|
165
|
-
canAddColumnBefore: boolean;
|
|
166
|
-
canAddColumnAfter: boolean;
|
|
167
|
-
canDeleteRow: boolean;
|
|
168
|
-
canDeleteColumn: boolean;
|
|
169
|
-
canDeleteTable: boolean;
|
|
170
|
-
canMergeCells: boolean;
|
|
171
|
-
canSplitCell: boolean;
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* One replaceable snapshot for editor-owned table chrome.
|
|
175
|
-
* Consumers should discard prior capabilities whenever `active` becomes false;
|
|
176
|
-
* they describe the current ProseMirror transaction state, not table schema in
|
|
177
|
-
* general.
|
|
178
|
-
*/
|
|
179
|
-
interface ActiveTableUiState {
|
|
180
|
-
active: boolean;
|
|
181
|
-
showToolbar: boolean;
|
|
182
|
-
cellAlignment: TableCellAlignment;
|
|
183
|
-
cellBackground: TableCellBackground;
|
|
184
|
-
capabilities: TableActionCapabilities;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Text formatting belongs to actual text selections, not table CellSelections.
|
|
188
|
-
*
|
|
189
|
-
* @contract Returns true only for an editable editor with a non-collapsed
|
|
190
|
-
* `TextSelection`; node and cell selections never activate formatting chrome.
|
|
191
|
-
*/
|
|
192
|
-
declare function shouldShowTextFormattingToolbar(editor: Editor, from?: number, to?: number): boolean;
|
|
193
|
-
/**
|
|
194
|
-
* Returns the complete interaction state for the table containing the selection.
|
|
195
|
-
* Inactive defaults are concrete so UI can replace its previous snapshot and
|
|
196
|
-
* cannot accidentally retain enabled controls from a table that lost selection.
|
|
197
|
-
*
|
|
198
|
-
* @contract Capabilities are recalculated from `editor.can()` at call time; an
|
|
199
|
-
* inactive snapshot disables every action and resets authored cell formatting.
|
|
200
|
-
*/
|
|
201
|
-
declare function getActiveTableUiState(editor: Editor): ActiveTableUiState;
|
|
202
|
-
/**
|
|
203
|
-
* Executes a toolbar/context-menu action using Looma's table behavior policy.
|
|
204
|
-
* The boolean is Tiptap's command result, so callers can distinguish a handled
|
|
205
|
-
* action from one rejected by the current schema or selection.
|
|
206
|
-
*
|
|
207
|
-
* @contract The event action becomes one focused Tiptap transaction; UI callers
|
|
208
|
-
* never need to reproduce selection repair or cell-format policy.
|
|
209
|
-
* @failure Returns false when the current selection cannot support the action.
|
|
210
|
-
*/
|
|
211
|
-
declare function handleTableAction(editor: Editor, detail: TableContextMenuActionEventDetail): boolean;
|
|
212
|
-
/**
|
|
213
|
-
* Deletes a slash-command range (or other inline trigger text) and inserts a table.
|
|
214
|
-
* Use this when apps want a stable default `/table` behavior without owning
|
|
215
|
-
* table policy. Deletion and insertion share one focused command chain, so the
|
|
216
|
-
* trigger text cannot remain behind if insertion succeeds.
|
|
217
|
-
*
|
|
218
|
-
* @contract Rows and columns are clamped to 1–10, then range deletion and table
|
|
219
|
-
* insertion succeed or fail together through a single Tiptap command chain.
|
|
220
|
-
*/
|
|
221
|
-
declare function insertTableAtRange(editor: Editor, range: Range, options?: InsertTableAtRangeOptions): boolean;
|
|
222
|
-
/**
|
|
223
|
-
* Reconciles rendered column widths back into table-cell `colwidth` attributes.
|
|
224
|
-
*
|
|
225
|
-
* Browser layout is the source of truth at the end of a pointer resize, but
|
|
226
|
-
* ProseMirror must persist integer widths in the document. The algorithm keeps
|
|
227
|
-
* proportions, enforces a minimum, and distributes rounding error so the final
|
|
228
|
-
* sum still equals the rendered table width. Spanning cells are updated once at
|
|
229
|
-
* their top-left map coordinate rather than once per covered grid position.
|
|
230
|
-
*
|
|
231
|
-
* @invariant Every persisted width is an integer at least `minWidth`, and each
|
|
232
|
-
* spanning cell receives one width per logical column from its top-left origin.
|
|
233
|
-
* @failure Returns false without an active table or measurable columns and does
|
|
234
|
-
* not dispatch when persisted widths already match the rendered geometry.
|
|
235
|
-
*/
|
|
236
|
-
declare function normalizeActiveTableColumnWidths(editor: Editor, tableElement: HTMLTableElement, minWidth?: number): boolean;
|
|
237
|
-
/**
|
|
238
|
-
* Handles a geometry-derived table-overlay intent without exposing ProseMirror
|
|
239
|
-
* positions to UI components.
|
|
240
|
-
*
|
|
241
|
-
* Boundary indices address the visual grid edges measured by the overlay. The
|
|
242
|
-
* helper maps them into the current table transaction, rejects indices that do
|
|
243
|
-
* not represent a legal insertion edge, dispatches once, and restores editor
|
|
244
|
-
* focus. `open-cell-menu` returns handled without editing because menu ownership
|
|
245
|
-
* remains with the application/adapter.
|
|
246
|
-
*
|
|
247
|
-
* @contract A valid structural intent dispatches at most one transaction;
|
|
248
|
-
* `open-cell-menu` acknowledges UI ownership without mutating the document.
|
|
249
|
-
* @failure Missing tables, malformed payloads, and out-of-range boundaries
|
|
250
|
-
* return false before dispatching a transaction.
|
|
251
|
-
*/
|
|
252
|
-
declare function handleTableOverlayAction(editor: Editor, detail: TableOverlayActionEventDetail): boolean;
|
|
253
|
-
|
|
254
|
-
/** Default visible candidate budget when an application does not set a limit. */
|
|
255
|
-
declare const DEFAULT_MENTION_RESULT_LIMIT = 8;
|
|
256
|
-
/** Hard candidate ceiling shared by providers, keyboard state, and menu rendering. */
|
|
257
|
-
declare const MAX_MENTION_RESULT_LIMIT = 20;
|
|
258
|
-
/**
|
|
259
|
-
* Application-owned identity and display data for one mention candidate.
|
|
260
|
-
* Looma persists `id` and `label` in the editor document; `detail` and
|
|
261
|
-
* `initials` are presentation hints and are not part of mention identity.
|
|
262
|
-
*/
|
|
263
|
-
interface LoomaMentionItem {
|
|
264
|
-
id: string;
|
|
265
|
-
label: string;
|
|
266
|
-
detail?: string;
|
|
267
|
-
initials?: string;
|
|
268
|
-
}
|
|
269
|
-
/** Bounded result budget passed to a directory provider for the current query. */
|
|
270
|
-
interface LoomaMentionProviderContext {
|
|
271
|
-
limit: number;
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Resolves candidates for the current query.
|
|
275
|
-
*
|
|
276
|
-
* Providers may perform asynchronous directory lookup, but should return no
|
|
277
|
-
* more than `context.limit`. The extension also clamps and filters results so a
|
|
278
|
-
* provider cannot accidentally create an unbounded suggestion surface.
|
|
279
|
-
*
|
|
280
|
-
* @ownership The application owns directory access and returned item data;
|
|
281
|
-
* Looma owns filtering, clamping, and the suggestion state that consumes it.
|
|
282
|
-
*/
|
|
283
|
-
type LoomaMentionProvider = (query: string, context: LoomaMentionProviderContext) => readonly LoomaMentionItem[] | Promise<readonly LoomaMentionItem[]>;
|
|
284
|
-
/**
|
|
285
|
-
* Complete render state handed from the headless Tiptap extension to UI chrome.
|
|
286
|
-
*
|
|
287
|
-
* The snapshot owns selection commands only while `active` is true. Consumers
|
|
288
|
-
* should replace, not merge, snapshots: callbacks and rectangles are tied to a
|
|
289
|
-
* particular suggestion range and become stale as soon as the query changes.
|
|
290
|
-
*
|
|
291
|
-
* @lifecycle `highlight` and `select` are valid only while this snapshot remains
|
|
292
|
-
* active; the next query update or exit invalidates both callbacks.
|
|
293
|
-
*/
|
|
294
|
-
interface LoomaMentionMenuSnapshot {
|
|
295
|
-
active: boolean;
|
|
296
|
-
items: LoomaMentionItem[];
|
|
297
|
-
selectedIndex: number;
|
|
298
|
-
query: string;
|
|
299
|
-
rect: DOMRect | null;
|
|
300
|
-
loading: boolean;
|
|
301
|
-
highlight: ((index: number) => void) | null;
|
|
302
|
-
select: ((index: number) => void) | null;
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Mention policy supplied by the application.
|
|
306
|
-
*
|
|
307
|
-
* Looma owns suggestion mechanics and accessibility state; the application
|
|
308
|
-
* owns the directory and may render the snapshot with Looma's menu or custom
|
|
309
|
-
* UI. `menuId` must match that UI's listbox id so `aria-controls` and
|
|
310
|
-
* `aria-activedescendant` reference real elements.
|
|
311
|
-
*
|
|
312
|
-
* @ownership The application owns provider work and rendering callbacks; Looma
|
|
313
|
-
* owns transient selection state and restores every borrowed editor ARIA value.
|
|
314
|
-
*/
|
|
315
|
-
interface LoomaMentionOptions {
|
|
316
|
-
items?: readonly LoomaMentionItem[] | LoomaMentionProvider;
|
|
317
|
-
limit?: number;
|
|
318
|
-
menuId?: string;
|
|
319
|
-
onStateChange?: (state: LoomaMentionMenuSnapshot) => void;
|
|
320
|
-
}
|
|
321
|
-
/** Clamps public/provider limits so keyboard navigation remains predictably bounded. */
|
|
322
|
-
declare function normalizeMentionResultLimit(limit?: number): number;
|
|
323
|
-
/**
|
|
324
|
-
* Applies Looma's local fallback matching to static or provider results.
|
|
325
|
-
* Matching is intentionally limited to display text; stable ids and arbitrary
|
|
326
|
-
* metadata must not become discoverable search fields by accident.
|
|
327
|
-
*
|
|
328
|
-
* @contract Preserves source order, does not mutate the input, and returns no
|
|
329
|
-
* more than the normalized public result limit.
|
|
330
|
-
*/
|
|
331
|
-
declare function filterLoomaMentionItems(items: readonly LoomaMentionItem[], query: string, limit?: number): LoomaMentionItem[];
|
|
332
|
-
|
|
333
|
-
interface MentionPluginState {
|
|
334
|
-
active?: boolean;
|
|
335
|
-
query?: string | null;
|
|
336
|
-
range?: {
|
|
337
|
-
from: number;
|
|
338
|
-
to: number;
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Stable key for reading Looma's active mention query and source range.
|
|
343
|
-
* Consumers should treat the keyed value as transient suggestion state rather
|
|
344
|
-
* than document data.
|
|
345
|
-
*/
|
|
346
|
-
declare const LoomaMentionSuggestionPluginKey: PluginKey<MentionPluginState>;
|
|
347
|
-
/**
|
|
348
|
-
* Creates a domain-neutral Tiptap mention node and suggestion lifecycle.
|
|
349
|
-
*
|
|
350
|
-
* Applications provide either a small static list or a bounded async directory
|
|
351
|
-
* provider. Looma owns keyboard selection plus the temporary combobox ARIA
|
|
352
|
-
* attributes on the editor. Every attribute is snapshotted and restored so
|
|
353
|
-
* installing this extension cannot erase accessibility state owned by another
|
|
354
|
-
* extension or by the host application.
|
|
355
|
-
*
|
|
356
|
-
* @ownership The application owns the item provider and rendered menu. The
|
|
357
|
-
* extension owns suggestion state and only borrows editor ARIA attributes.
|
|
358
|
-
* @lifecycle Each suggestion update replaces the published snapshot; exit
|
|
359
|
-
* restores borrowed attributes and invalidates callbacks from the prior range.
|
|
360
|
-
* @failure Provider rejection degrades to an empty result set so Tiptap's
|
|
361
|
-
* suggestion lifecycle cannot become an unhandled promise rejection.
|
|
362
|
-
*/
|
|
363
|
-
declare function createLoomaMentionExtension(options?: LoomaMentionOptions): AnyExtension;
|
|
364
|
-
|
|
365
|
-
/** Editor state a slash command may replace and then act upon. */
|
|
366
|
-
interface LoomaSlashCommandContext {
|
|
367
|
-
editor: Editor;
|
|
368
|
-
range: Range;
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* Ephemeral render model published to any slash-menu UI.
|
|
372
|
-
* Replace snapshots rather than merging them: the `select` callback closes over
|
|
373
|
-
* a particular Tiptap range and becomes invalid when the suggestion updates.
|
|
374
|
-
*
|
|
375
|
-
* @lifecycle `select` is valid only until the next snapshot or suggestion exit;
|
|
376
|
-
* retaining it can apply a command to a stale source range.
|
|
377
|
-
*/
|
|
378
|
-
interface LoomaSlashMenuSnapshot {
|
|
379
|
-
active: boolean;
|
|
380
|
-
items: LoomaSlashCommand[];
|
|
381
|
-
selectedIndex: number;
|
|
382
|
-
query: string;
|
|
383
|
-
rect: DOMRect | null;
|
|
384
|
-
select: ((index: number) => void) | null;
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* Application-owned command inventory and integration callbacks.
|
|
388
|
-
* Replacing `commands` changes search and execution together; the extension
|
|
389
|
-
* never merges domain commands into defaults implicitly. Asset selection stays
|
|
390
|
-
* callback-driven because uploads and persistence are outside editor ownership.
|
|
391
|
-
*
|
|
392
|
-
* @ownership The application owns command objects and callback side effects;
|
|
393
|
-
* the extension only searches the inventory and publishes replacement snapshots.
|
|
394
|
-
*/
|
|
395
|
-
interface LoomaSlashCommandOptions {
|
|
396
|
-
commands: LoomaSlashCommand[];
|
|
397
|
-
onStateChange?: (state: LoomaSlashMenuSnapshot) => void;
|
|
398
|
-
onOpenImagePicker?: () => void;
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* Builds Looma's default command policy as fresh objects for one editor.
|
|
402
|
-
* The image command delegates asset selection because Looma does not own upload,
|
|
403
|
-
* persistence, or media-library concerns.
|
|
404
|
-
*
|
|
405
|
-
* @ownership Returned command objects belong to the caller and are recreated
|
|
406
|
-
* per call so one editor cannot mutate another editor's command inventory.
|
|
407
|
-
*/
|
|
408
|
-
declare function getDefaultSlashCommands(onOpenImagePicker?: () => void): LoomaSlashCommand[];
|
|
409
|
-
/**
|
|
410
|
-
* One application-extensible command.
|
|
411
|
-
*
|
|
412
|
-
* Commands own their editor mutation, including removal of `context.range`.
|
|
413
|
-
* Keeping that policy in the command lets custom items behave exactly like
|
|
414
|
-
* built-ins without coupling the headless suggestion lifecycle to Tiptap nodes.
|
|
415
|
-
*/
|
|
416
|
-
interface LoomaSlashCommand {
|
|
417
|
-
title: string;
|
|
418
|
-
description: string;
|
|
419
|
-
icon: LoomaIconName;
|
|
420
|
-
keywords: string[];
|
|
421
|
-
command: (context: LoomaSlashCommandContext) => void;
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Framework-neutral slash-command extension used by the turnkey editor.
|
|
425
|
-
* Consumers embedding Looma into their own Tiptap instance can configure the
|
|
426
|
-
* same behavior and render any menu they choose from `onStateChange`.
|
|
427
|
-
*
|
|
428
|
-
* @ownership The extension owns query and keyboard-selection state; the caller
|
|
429
|
-
* owns the command inventory and every menu snapshot after publication.
|
|
430
|
-
* @lifecycle Snapshot callbacks are valid only for the suggestion range that
|
|
431
|
-
* produced them and are replaced on every update or exit.
|
|
432
|
-
*/
|
|
433
|
-
declare const LoomaSlashCommand: Extension<LoomaSlashCommandOptions, any>;
|
|
434
|
-
/**
|
|
435
|
-
* Creates an independently configured extension instance.
|
|
436
|
-
* Prefer this factory when callbacks or commands are editor-specific; the
|
|
437
|
-
* exported base extension remains a convenient zero-configuration preset.
|
|
438
|
-
*
|
|
439
|
-
* @ownership The caller owns supplied commands and callbacks. The returned
|
|
440
|
-
* extension captures them for one configuration without mutating the inventory.
|
|
441
|
-
*/
|
|
442
|
-
declare function createLoomaSlashCommandExtension(options?: Partial<LoomaSlashCommandOptions>): Extension<LoomaSlashCommandOptions, any>;
|
|
443
|
-
|
|
444
|
-
export { type ActiveTableUiState, DEFAULT_MENTION_RESULT_LIMIT, type DefaultEditorExtensionsOptions, type InsertTableAtRangeOptions, LOOMA_CALLOUT_TONES, LoomaCallout, type LoomaCalloutTone, type LoomaMentionItem, type LoomaMentionMenuSnapshot, type LoomaMentionOptions, type LoomaMentionProvider, type LoomaMentionProviderContext, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, type LoomaSlashCommandContext, LoomaSlashCommand as LoomaSlashCommandItem, type LoomaSlashCommandOptions, type LoomaSlashMenuSnapshot, LoomaSmartPaste, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, type TableActionCapabilities, type TableCellAlignment, type TableCellBackground, createLoomaMentionExtension, createLoomaSlashCommandExtension, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, normalizeMentionResultLimit, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar };
|
|
9
|
+
export { LoomaCallout, LOOMA_CALLOUT_TONES, type LoomaCalloutTone, } from "./callout.js";
|
|
10
|
+
export { getDefaultEditorExtensions, getLoomaTableExtensions, LoomaTableKit, type DefaultEditorExtensionsOptions, } from "./preset.js";
|
|
11
|
+
export { LoomaSmartPaste } from "./smart-paste.js";
|
|
12
|
+
export { getActiveTableUiState, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, shouldShowTextFormattingToolbar, type ActiveTableUiState, type InsertTableAtRangeOptions, type TableActionCapabilities, } from "./table-commands.js";
|
|
13
|
+
export { LoomaTable, getActiveTableCellAlignment, getActiveTableCellBackground, LoomaTableCell, LoomaTableHeader, setActiveTableCellAlignment, setActiveTableCellBackground, TABLE_CELL_BACKGROUND_PRESETS, type TableCellAlignment, type TableCellBackground, } from "./table-formatting.js";
|
|
14
|
+
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";
|
|
15
|
+
export { createLoomaSlashCommandExtension, getDefaultSlashCommands, LoomaSlashCommand, type LoomaSlashCommand as LoomaSlashCommandItem, type LoomaSlashCommandContext, type LoomaSlashCommandOptions, type LoomaSlashMenuSnapshot, } from "./slash-command.js";
|