@threadlabs/looma 0.29.0 → 0.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ui-editor-code-language/ui-editor-code-language.html +1 -1
- package/components/ui-editor-image-toolbar/ui-editor-image-toolbar.html +1 -2
- package/components/ui-editor-link-form/ui-editor-link-form.html +2 -3
- package/components/ui-tooltip/ui-tooltip.html +5 -2
- package/dist/index.js +1 -1
- package/editor/chip-editing.d.ts +39 -0
- package/package.json +3 -3
- package/styles/ui-action-bar.css +1 -1
- package/styles/ui-affordance-scope.css +1 -1
- package/styles/ui-avatar-group.css +1 -1
- package/styles/ui-avatar.css +1 -1
- package/styles/ui-badge.css +1 -1
- package/styles/ui-breadcrumb-item.css +1 -1
- package/styles/ui-breadcrumbs.css +1 -1
- package/styles/ui-button.css +1 -1
- package/styles/ui-callout.css +1 -1
- package/styles/ui-card.css +1 -1
- package/styles/ui-checkbox.css +1 -1
- package/styles/ui-cluster.css +1 -1
- package/styles/ui-combobox.css +1 -1
- package/styles/ui-container.css +1 -1
- package/styles/ui-context-menu.css +1 -1
- package/styles/ui-cover.css +1 -1
- package/styles/ui-description-item.css +1 -1
- package/styles/ui-description-list.css +1 -1
- package/styles/ui-dialog.css +1 -1
- package/styles/ui-disclosure.css +1 -1
- package/styles/ui-editable.css +1 -1
- package/styles/ui-editor-block-actions.css +1 -1
- package/styles/ui-editor-chip-editor.css +1 -1
- package/styles/ui-editor-code-language.css +1 -1
- package/styles/ui-editor-image-toolbar.css +1 -1
- package/styles/ui-editor-insert-table-grid.css +1 -1
- package/styles/ui-editor-link-card.css +1 -1
- package/styles/ui-editor-link-form.css +1 -1
- package/styles/ui-editor-mention-menu-item.css +1 -1
- package/styles/ui-editor-mention-menu.css +1 -1
- package/styles/ui-editor-slash-menu-group.css +1 -1
- package/styles/ui-editor-slash-menu-item.css +1 -1
- package/styles/ui-editor-slash-menu.css +1 -1
- package/styles/ui-editor-surface.css +1 -1
- package/styles/ui-editor-table-context-menu.css +1 -1
- package/styles/ui-editor-table-overlay.css +1 -1
- package/styles/ui-editor-table-toolbar.css +1 -1
- package/styles/ui-editor-toolbar.css +1 -1
- package/styles/ui-floating-action-button.css +1 -1
- package/styles/ui-form-field.css +1 -1
- package/styles/ui-grid.css +1 -1
- package/styles/ui-icon-button.css +1 -1
- package/styles/ui-icon.css +1 -1
- package/styles/ui-image.css +1 -1
- package/styles/ui-input-group.css +1 -1
- package/styles/ui-input.css +1 -1
- package/styles/ui-list-item.css +1 -1
- package/styles/ui-list.css +1 -1
- package/styles/ui-listbox.css +1 -1
- package/styles/ui-menu-group.css +1 -1
- package/styles/ui-menu-item.css +1 -1
- package/styles/ui-menu.css +1 -1
- package/styles/ui-meter.css +1 -1
- package/styles/ui-nav-item.css +1 -1
- package/styles/ui-page-header.css +1 -1
- package/styles/ui-popover.css +1 -1
- package/styles/ui-radio-group.css +1 -1
- package/styles/ui-radio.css +1 -1
- package/styles/ui-reel.css +1 -1
- package/styles/ui-scroll-area.css +1 -1
- package/styles/ui-search-result-row.css +1 -1
- package/styles/ui-search-shell.css +1 -1
- package/styles/ui-section.css +1 -1
- package/styles/ui-select.css +1 -1
- package/styles/ui-separator.css +1 -1
- package/styles/ui-sidebar.css +1 -1
- package/styles/ui-spinner.css +1 -1
- package/styles/ui-stack.css +1 -1
- package/styles/ui-status-message.css +1 -1
- package/styles/ui-swatch.css +1 -1
- package/styles/ui-switch.css +1 -1
- package/styles/ui-switcher.css +1 -1
- package/styles/ui-table.css +1 -1
- package/styles/ui-tabs.css +1 -1
- package/styles/ui-text.css +1 -1
- package/styles/ui-textarea.css +1 -1
- package/styles/ui-toast-region.css +1 -1
- package/styles/ui-toast.css +1 -1
- package/styles/ui-tooltip.css +7 -2
- package/styles/ui-top-bar.css +1 -1
- package/styles/ui-tree-item.css +1 -1
- package/styles/ui-tree.css +1 -1
- package/vanilla/UiActionBar.d.ts +1 -1
- package/vanilla/UiActionBar.js +6 -6
- package/vanilla/UiAffordanceScope.d.ts +1 -1
- package/vanilla/UiAffordanceScope.js +1 -1
- package/vanilla/UiAvatar.d.ts +1 -1
- package/vanilla/UiAvatar.js +7 -7
- package/vanilla/UiAvatarGroup.d.ts +1 -1
- package/vanilla/UiAvatarGroup.js +4 -4
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +4 -4
- package/vanilla/UiBreadcrumbItem.d.ts +1 -1
- package/vanilla/UiBreadcrumbItem.js +3 -3
- package/vanilla/UiBreadcrumbs.d.ts +1 -1
- package/vanilla/UiBreadcrumbs.js +1 -1
- package/vanilla/UiButton.d.ts +1 -1
- package/vanilla/UiButton.js +17 -17
- package/vanilla/UiCallout.d.ts +1 -1
- package/vanilla/UiCallout.js +13 -13
- package/vanilla/UiCard.d.ts +1 -1
- package/vanilla/UiCard.js +1 -1
- package/vanilla/UiCheckbox.d.ts +1 -1
- package/vanilla/UiCheckbox.js +6 -6
- package/vanilla/UiCluster.d.ts +1 -1
- package/vanilla/UiCluster.js +1 -1
- package/vanilla/UiCombobox.d.ts +1 -1
- package/vanilla/UiCombobox.js +48 -48
- package/vanilla/UiContainer.d.ts +1 -1
- package/vanilla/UiContainer.js +1 -1
- package/vanilla/UiContextMenu.d.ts +1 -1
- package/vanilla/UiContextMenu.js +1 -1
- package/vanilla/UiCover.d.ts +1 -1
- package/vanilla/UiCover.js +1 -1
- package/vanilla/UiDescriptionItem.d.ts +1 -1
- package/vanilla/UiDescriptionItem.js +4 -4
- package/vanilla/UiDescriptionList.d.ts +1 -1
- package/vanilla/UiDescriptionList.js +1 -1
- package/vanilla/UiDialog.d.ts +1 -1
- package/vanilla/UiDialog.js +7 -7
- package/vanilla/UiDisclosure.d.ts +1 -1
- package/vanilla/UiDisclosure.js +8 -8
- package/vanilla/UiEditable.d.ts +1 -1
- package/vanilla/UiEditable.js +11 -11
- package/vanilla/UiEditorBlockActions.d.ts +1 -1
- package/vanilla/UiEditorBlockActions.js +3 -3
- package/vanilla/UiEditorChipEditor.d.ts +1 -1
- package/vanilla/UiEditorChipEditor.js +4 -4
- package/vanilla/UiEditorCodeLanguage.d.ts +1 -1
- package/vanilla/UiEditorCodeLanguage.js +7 -12
- package/vanilla/UiEditorImageToolbar.d.ts +1 -1
- package/vanilla/UiEditorImageToolbar.js +90 -95
- package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
- package/vanilla/UiEditorInsertTableGrid.js +7 -7
- package/vanilla/UiEditorLinkCard.d.ts +1 -1
- package/vanilla/UiEditorLinkCard.js +13 -13
- package/vanilla/UiEditorLinkForm.d.ts +1 -1
- package/vanilla/UiEditorLinkForm.js +32 -44
- package/vanilla/UiEditorMentionMenu.d.ts +1 -1
- package/vanilla/UiEditorMentionMenu.js +12 -12
- package/vanilla/UiEditorMentionMenuItem.d.ts +1 -1
- package/vanilla/UiEditorMentionMenuItem.js +4 -4
- package/vanilla/UiEditorSlashMenu.d.ts +1 -1
- package/vanilla/UiEditorSlashMenu.js +11 -11
- package/vanilla/UiEditorSlashMenuGroup.d.ts +1 -1
- package/vanilla/UiEditorSlashMenuGroup.js +5 -5
- package/vanilla/UiEditorSlashMenuItem.d.ts +1 -1
- package/vanilla/UiEditorSlashMenuItem.js +4 -4
- package/vanilla/UiEditorSurface.d.ts +1 -1
- package/vanilla/UiEditorSurface.js +1 -1
- package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
- package/vanilla/UiEditorTableContextMenu.js +16 -16
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +18 -18
- package/vanilla/UiEditorTableToolbar.d.ts +1 -1
- package/vanilla/UiEditorTableToolbar.js +33 -33
- package/vanilla/UiEditorToolbar.d.ts +1 -1
- package/vanilla/UiEditorToolbar.js +1 -1
- package/vanilla/UiFloatingActionButton.d.ts +1 -1
- package/vanilla/UiFloatingActionButton.js +1 -1
- package/vanilla/UiFormField.d.ts +1 -1
- package/vanilla/UiFormField.js +8 -8
- package/vanilla/UiGrid.d.ts +1 -1
- package/vanilla/UiGrid.js +1 -1
- package/vanilla/UiIcon.d.ts +1 -1
- package/vanilla/UiIcon.js +4 -4
- package/vanilla/UiIconButton.d.ts +1 -1
- package/vanilla/UiIconButton.js +4 -4
- package/vanilla/UiImage.d.ts +1 -1
- package/vanilla/UiImage.js +6 -6
- package/vanilla/UiInput.d.ts +1 -1
- package/vanilla/UiInput.js +1 -1
- package/vanilla/UiInputGroup.d.ts +1 -1
- package/vanilla/UiInputGroup.js +6 -6
- package/vanilla/UiList.d.ts +1 -1
- package/vanilla/UiList.js +1 -1
- package/vanilla/UiListItem.d.ts +1 -1
- package/vanilla/UiListItem.js +7 -7
- package/vanilla/UiListbox.d.ts +1 -1
- package/vanilla/UiListbox.js +12 -12
- package/vanilla/UiMenu.d.ts +1 -1
- package/vanilla/UiMenu.js +1 -1
- package/vanilla/UiMenuGroup.d.ts +1 -1
- package/vanilla/UiMenuGroup.js +4 -4
- package/vanilla/UiMenuItem.d.ts +1 -1
- package/vanilla/UiMenuItem.js +11 -11
- package/vanilla/UiMeter.d.ts +1 -1
- package/vanilla/UiMeter.js +8 -8
- package/vanilla/UiNavItem.d.ts +1 -1
- package/vanilla/UiNavItem.js +13 -13
- package/vanilla/UiPageHeader.d.ts +1 -1
- package/vanilla/UiPageHeader.js +8 -8
- package/vanilla/UiPopover.d.ts +1 -1
- package/vanilla/UiPopover.js +1 -1
- package/vanilla/UiRadio.d.ts +1 -1
- package/vanilla/UiRadio.js +6 -6
- package/vanilla/UiRadioGroup.d.ts +1 -1
- package/vanilla/UiRadioGroup.js +4 -4
- package/vanilla/UiReel.d.ts +1 -1
- package/vanilla/UiReel.js +1 -1
- package/vanilla/UiScrollArea.d.ts +1 -1
- package/vanilla/UiScrollArea.js +1 -1
- package/vanilla/UiSearchResultRow.d.ts +1 -1
- package/vanilla/UiSearchResultRow.js +8 -8
- package/vanilla/UiSearchShell.d.ts +1 -1
- package/vanilla/UiSearchShell.js +8 -8
- package/vanilla/UiSection.d.ts +1 -1
- package/vanilla/UiSection.js +8 -8
- package/vanilla/UiSelect.d.ts +1 -1
- package/vanilla/UiSelect.js +1 -1
- package/vanilla/UiSeparator.d.ts +1 -1
- package/vanilla/UiSeparator.js +1 -1
- package/vanilla/UiSidebar.d.ts +1 -1
- package/vanilla/UiSidebar.js +4 -4
- package/vanilla/UiSpinner.d.ts +1 -1
- package/vanilla/UiSpinner.js +2 -2
- package/vanilla/UiStack.d.ts +1 -1
- package/vanilla/UiStack.js +1 -1
- package/vanilla/UiStatusMessage.d.ts +1 -1
- package/vanilla/UiStatusMessage.js +7 -7
- package/vanilla/UiSwatch.d.ts +1 -1
- package/vanilla/UiSwatch.js +1 -1
- package/vanilla/UiSwitch.d.ts +1 -1
- package/vanilla/UiSwitch.js +6 -6
- package/vanilla/UiSwitcher.d.ts +1 -1
- package/vanilla/UiSwitcher.js +1 -1
- package/vanilla/UiTable.d.ts +1 -1
- package/vanilla/UiTable.js +1 -1
- package/vanilla/UiTabs.d.ts +1 -1
- package/vanilla/UiTabs.js +7 -7
- package/vanilla/UiText.d.ts +1 -1
- package/vanilla/UiText.js +1 -1
- package/vanilla/UiTextarea.d.ts +1 -1
- package/vanilla/UiTextarea.js +1 -1
- package/vanilla/UiToast.d.ts +1 -1
- package/vanilla/UiToast.js +5 -5
- package/vanilla/UiToastRegion.d.ts +1 -1
- package/vanilla/UiToastRegion.js +8 -8
- package/vanilla/UiTooltip.d.ts +1 -1
- package/vanilla/UiTooltip.js +9 -8
- package/vanilla/UiTopBar.d.ts +1 -1
- package/vanilla/UiTopBar.js +6 -6
- package/vanilla/UiTree.d.ts +1 -1
- package/vanilla/UiTree.js +1 -1
- package/vanilla/UiTreeItem.d.ts +1 -1
- package/vanilla/UiTreeItem.js +13 -13
- package/vue/UiActionBar.vue +8 -5
- package/vue/UiAffordanceScope.vue +1 -1
- package/vue/UiAvatar.vue +10 -11
- package/vue/UiAvatarGroup.vue +2 -3
- package/vue/UiBadge.vue +5 -3
- package/vue/UiBreadcrumbItem.vue +2 -3
- package/vue/UiBreadcrumbs.vue +1 -1
- package/vue/UiButton.vue +15 -13
- package/vue/UiCallout.vue +8 -15
- package/vue/UiCard.vue +1 -1
- package/vue/UiCheckbox.vue +5 -4
- package/vue/UiCluster.vue +1 -1
- package/vue/UiCombobox.vue +25 -27
- package/vue/UiContainer.vue +1 -1
- package/vue/UiContextMenu.vue +1 -1
- package/vue/UiCover.vue +1 -1
- package/vue/UiDescriptionItem.vue +1 -1
- package/vue/UiDescriptionList.vue +1 -1
- package/vue/UiDialog.vue +4 -3
- package/vue/UiDisclosure.vue +9 -8
- package/vue/UiEditable.vue +13 -9
- package/vue/UiEditorBlockActions.vue +5 -4
- package/vue/UiEditorChipEditor.vue +7 -9
- package/vue/UiEditorCodeLanguage.vue +2 -2
- package/vue/UiEditorImageToolbar.vue +25 -32
- package/vue/UiEditorInsertTableGrid.vue +1 -1
- package/vue/UiEditorLinkCard.vue +17 -20
- package/vue/UiEditorLinkForm.vue +21 -23
- package/vue/UiEditorMentionMenu.vue +9 -7
- package/vue/UiEditorMentionMenuItem.vue +5 -6
- package/vue/UiEditorSlashMenu.vue +3 -5
- package/vue/UiEditorSlashMenuGroup.vue +1 -1
- package/vue/UiEditorSlashMenuItem.vue +5 -6
- package/vue/UiEditorSurface.vue +1 -1
- package/vue/UiEditorTableContextMenu.vue +4 -7
- package/vue/UiEditorTableOverlay.vue +26 -18
- package/vue/UiEditorTableToolbar.vue +23 -21
- package/vue/UiEditorToolbar.vue +1 -1
- package/vue/UiFloatingActionButton.vue +1 -1
- package/vue/UiFormField.vue +4 -3
- package/vue/UiGrid.vue +1 -1
- package/vue/UiIcon.vue +1 -1
- package/vue/UiIconButton.vue +4 -3
- package/vue/UiImage.vue +4 -7
- package/vue/UiInput.vue +1 -1
- package/vue/UiInputGroup.vue +7 -5
- package/vue/UiList.vue +1 -1
- package/vue/UiListItem.vue +10 -7
- package/vue/UiListbox.vue +3 -5
- package/vue/UiMenu.vue +1 -1
- package/vue/UiMenuGroup.vue +2 -3
- package/vue/UiMenuItem.vue +15 -10
- package/vue/UiMeter.vue +4 -5
- package/vue/UiNavItem.vue +19 -13
- package/vue/UiPageHeader.vue +8 -7
- package/vue/UiPopover.vue +1 -1
- package/vue/UiRadio.vue +10 -6
- package/vue/UiRadioGroup.vue +1 -1
- package/vue/UiReel.vue +1 -1
- package/vue/UiScrollArea.vue +1 -1
- package/vue/UiSearchResultRow.vue +11 -8
- package/vue/UiSearchShell.vue +1 -1
- package/vue/UiSection.vue +7 -4
- package/vue/UiSelect.vue +1 -1
- package/vue/UiSeparator.vue +1 -1
- package/vue/UiSidebar.vue +1 -1
- package/vue/UiSpinner.vue +1 -1
- package/vue/UiStack.vue +1 -1
- package/vue/UiStatusMessage.vue +10 -6
- package/vue/UiSwatch.vue +1 -1
- package/vue/UiSwitch.vue +10 -6
- package/vue/UiSwitcher.vue +1 -1
- package/vue/UiTable.vue +1 -1
- package/vue/UiTabs.vue +3 -3
- package/vue/UiText.vue +1 -1
- package/vue/UiTextarea.vue +1 -1
- package/vue/UiToast.vue +1 -1
- package/vue/UiToastRegion.vue +7 -5
- package/vue/UiTooltip.vue +10 -5
- package/vue/UiTopBar.vue +1 -1
- package/vue/UiTree.vue +1 -1
- package/vue/UiTreeItem.vue +14 -13
- package/vue/chunks/UiActionBar.js +4 -2
- package/vue/chunks/UiAffordanceScope.js +1 -1
- package/vue/chunks/UiAvatar.js +18 -12
- package/vue/chunks/UiAvatarGroup.js +15 -11
- package/vue/chunks/UiBadge.js +7 -3
- package/vue/chunks/UiBreadcrumbItem.js +10 -6
- package/vue/chunks/UiBreadcrumbs.js +1 -1
- package/vue/chunks/UiButton.js +10 -2
- package/vue/chunks/UiCallout.js +13 -3
- package/vue/chunks/UiCard.js +1 -1
- package/vue/chunks/UiCheckbox.js +35 -27
- package/vue/chunks/UiCluster.js +1 -1
- package/vue/chunks/UiCombobox.js +108 -74
- package/vue/chunks/UiContainer.js +1 -1
- package/vue/chunks/UiContextMenu.js +1 -1
- package/vue/chunks/UiCover.js +1 -1
- package/vue/chunks/UiDescriptionItem.js +1 -1
- package/vue/chunks/UiDescriptionList.js +1 -1
- package/vue/chunks/UiDialog.js +14 -10
- package/vue/chunks/UiDisclosure.js +3 -1
- package/vue/chunks/UiEditable.js +36 -24
- package/vue/chunks/UiEditorBlockActions.js +3 -1
- package/vue/chunks/UiEditorChipEditor.js +31 -22
- package/vue/chunks/UiEditorCodeLanguage.js +1 -1
- package/vue/chunks/UiEditorImageToolbar.js +45 -27
- package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
- package/vue/chunks/UiEditorLinkCard.js +58 -42
- package/vue/chunks/UiEditorLinkForm.js +110 -90
- package/vue/chunks/UiEditorMentionMenu.js +23 -14
- package/vue/chunks/UiEditorMentionMenuItem.js +6 -2
- package/vue/chunks/UiEditorSlashMenu.js +24 -16
- package/vue/chunks/UiEditorSlashMenuGroup.js +1 -1
- package/vue/chunks/UiEditorSlashMenuItem.js +10 -6
- package/vue/chunks/UiEditorSurface.js +1 -1
- package/vue/chunks/UiEditorTableContextMenu.js +65 -53
- package/vue/chunks/UiEditorTableOverlay.js +60 -40
- package/vue/chunks/UiEditorTableToolbar.js +100 -74
- package/vue/chunks/UiEditorToolbar.js +1 -1
- package/vue/chunks/UiFloatingActionButton.js +1 -1
- package/vue/chunks/UiFormField.js +7 -3
- package/vue/chunks/UiGrid.js +1 -1
- package/vue/chunks/UiIcon.js +1 -1
- package/vue/chunks/UiIconButton.js +11 -7
- package/vue/chunks/UiImage.js +5 -2
- package/vue/chunks/UiInput.js +1 -1
- package/vue/chunks/UiInputGroup.js +5 -2
- package/vue/chunks/UiList.js +1 -1
- package/vue/chunks/UiListItem.js +9 -3
- package/vue/chunks/UiListbox.js +17 -11
- package/vue/chunks/UiMenu.js +1 -1
- package/vue/chunks/UiMenuGroup.js +7 -3
- package/vue/chunks/UiMenuItem.js +7 -2
- package/vue/chunks/UiMeter.js +28 -16
- package/vue/chunks/UiNavItem.js +20 -6
- package/vue/chunks/UiPageHeader.js +4 -2
- package/vue/chunks/UiPopover.js +1 -1
- package/vue/chunks/UiRadio.js +32 -24
- package/vue/chunks/UiRadioGroup.js +1 -1
- package/vue/chunks/UiReel.js +1 -1
- package/vue/chunks/UiScrollArea.js +1 -1
- package/vue/chunks/UiSearchResultRow.js +6 -2
- package/vue/chunks/UiSearchShell.js +1 -1
- package/vue/chunks/UiSection.js +15 -7
- package/vue/chunks/UiSelect.js +1 -1
- package/vue/chunks/UiSeparator.js +1 -1
- package/vue/chunks/UiSidebar.js +1 -1
- package/vue/chunks/UiSpinner.js +1 -1
- package/vue/chunks/UiStack.js +1 -1
- package/vue/chunks/UiStatusMessage.js +13 -7
- package/vue/chunks/UiSwatch.js +1 -1
- package/vue/chunks/UiSwitch.js +33 -25
- package/vue/chunks/UiSwitcher.js +1 -1
- package/vue/chunks/UiTable.js +1 -1
- package/vue/chunks/UiTabs.js +21 -17
- package/vue/chunks/UiText.js +1 -1
- package/vue/chunks/UiTextarea.js +1 -1
- package/vue/chunks/UiToast.js +1 -1
- package/vue/chunks/UiToastRegion.js +39 -31
- package/vue/chunks/UiTooltip.js +11 -3
- package/vue/chunks/UiTopBar.js +1 -1
- package/vue/chunks/UiTree.js +1 -1
- package/vue/chunks/UiTreeItem.js +25 -15
- package/vue/chunks/_plugin-vue_export-helper.js +1 -0
- package/vue/components.css +25 -21
- package/vue/editor/LoomaEditor.d.ts +2 -2
- package/vue/editor/compact/index.d.ts +2 -2
- package/vue/editor/index.js +241 -77
- package/vue/host.ts +4 -1
package/vue/editor/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, createApp, defineComponent, h, nextTick, onBeforeUnmount, onMounted, onUpdated, reactive, ref, shallowRef, useId, watch } from "vue";
|
|
2
|
-
import { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_ICONS, createLoomaMentionExtension, createLoomaSlashCommandExtension, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getTableOfContentsEntries, getVisualViewportRect, handleTableAction, handleTableOverlayAction, measureTableOverlayGeometry, normalizeActiveTableColumnWidths,
|
|
2
|
+
import { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_ICONS, createLoomaMentionExtension, createLoomaSlashCommandExtension, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getTableOfContentsEntries, getVisualViewportRect, handleTableAction, handleTableOverlayAction, measureTableOverlayGeometry, normalizeActiveTableColumnWidths, normalizeTableOfContentsConfig } from "@threadlabs/looma/editor";
|
|
3
3
|
import { Button, Callout, Card, Checkbox, Cluster, Disclosure, EditorBlockActions, EditorChipEditor, EditorCodeLanguage, EditorImageToolbar, EditorInsertTableGrid, EditorLinkCard, EditorLinkForm, EditorMentionMenu, EditorMentionMenuItem, EditorSlashMenu, EditorSlashMenuGroup, EditorSlashMenuItem, EditorSurface, EditorTableContextMenu, EditorTableOverlay, EditorTableToolbar, EditorToolbar, FormField, Icon, IconButton, Image, Input, List, Menu, MenuItem, Popover, Separator, Stack, StatusMessage, Text, Tooltip } from "@threadlabs/looma/vue";
|
|
4
4
|
import { Editor, Extension, Node as Node$1, getText, getTextSerializersFromSchema, isNodeSelection, mergeAttributes, nodeInputRule, posToDOMRect } from "@tiptap/core";
|
|
5
5
|
import { Editor as Editor$1 } from "@tiptap/vue-3";
|
|
@@ -1224,7 +1224,7 @@ function createImageUploads(options) {
|
|
|
1224
1224
|
};
|
|
1225
1225
|
}
|
|
1226
1226
|
//#endregion
|
|
1227
|
-
//#region ../../node_modules/.pnpm/@nextwebwg+html-next@1.0.0-alpha.
|
|
1227
|
+
//#region ../../node_modules/.pnpm/@nextwebwg+html-next@1.0.0-alpha.54/node_modules/@nextwebwg/html-next/dist/requests.js
|
|
1228
1228
|
/**
|
|
1229
1229
|
* Requests: behavior a component asks its consumer for, answered through a native event's
|
|
1230
1230
|
* `respondWith` (https://nextwebwg.org/declarative-components/javascript#requests).
|
|
@@ -1536,6 +1536,221 @@ function validLinkHref(value) {
|
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
1538
1538
|
//#endregion
|
|
1539
|
+
//#region src/markdown/index.ts
|
|
1540
|
+
/**
|
|
1541
|
+
* Callout tones a document stores, in the order the editor offers them. The Callout component also
|
|
1542
|
+
* takes `neutral` and `success`, which Markdown and the editor store as `note`.
|
|
1543
|
+
*/
|
|
1544
|
+
var LOOMA_CALLOUT_TONES = [
|
|
1545
|
+
"note",
|
|
1546
|
+
"tip",
|
|
1547
|
+
"info",
|
|
1548
|
+
"important",
|
|
1549
|
+
"warning",
|
|
1550
|
+
"danger"
|
|
1551
|
+
];
|
|
1552
|
+
/** The hues chips and swatches take as their tone, written `:chip[Label]{tone=green}`. */
|
|
1553
|
+
var LOOMA_CHIP_TONES = [
|
|
1554
|
+
"neutral",
|
|
1555
|
+
"blue",
|
|
1556
|
+
"green",
|
|
1557
|
+
"yellow",
|
|
1558
|
+
"red",
|
|
1559
|
+
"purple"
|
|
1560
|
+
];
|
|
1561
|
+
/**
|
|
1562
|
+
* Keeps a chip tone within the palette.
|
|
1563
|
+
* @failure Unknown values become `neutral`.
|
|
1564
|
+
*/
|
|
1565
|
+
function normalizeLoomaChipTone(value) {
|
|
1566
|
+
return LOOMA_CHIP_TONES.includes(value) ? value : "neutral";
|
|
1567
|
+
}
|
|
1568
|
+
[...LOOMA_CALLOUT_TONES];
|
|
1569
|
+
/**
|
|
1570
|
+
* The anchor a heading's text derives: NFC, lowercase, keeping letters, numbers and combining
|
|
1571
|
+
* marks, with every other run of characters one hyphen.
|
|
1572
|
+
* @failure Text with no letters or numbers, such as only emoji, derives `heading`.
|
|
1573
|
+
*/
|
|
1574
|
+
function loomaHeadingSlug(text) {
|
|
1575
|
+
return text.normalize("NFC").toLowerCase().replace(/[^\p{L}\p{N}\p{M}]+/gu, "-").replace(/^-+|-+$/g, "") || "heading";
|
|
1576
|
+
}
|
|
1577
|
+
/**
|
|
1578
|
+
* Gives every heading of a document its anchor, in document order.
|
|
1579
|
+
* @contract A custom ID is kept unless an earlier heading already has it. Any other heading takes
|
|
1580
|
+
* its slug, or the slug's first free suffix (`-1`, `-2`…), never one a later custom ID reserves.
|
|
1581
|
+
*/
|
|
1582
|
+
function assignLoomaHeadingIds(headings) {
|
|
1583
|
+
const reserved = new Set(headings.map(({ id }) => id).filter((id) => Boolean(id)));
|
|
1584
|
+
const used = /* @__PURE__ */ new Set();
|
|
1585
|
+
return headings.map(({ text, id: custom }) => {
|
|
1586
|
+
let id = custom || loomaHeadingSlug(text);
|
|
1587
|
+
if (custom ? used.has(id) : used.has(id) || reserved.has(id)) {
|
|
1588
|
+
const stem = id;
|
|
1589
|
+
let suffix = 1;
|
|
1590
|
+
while (used.has(`${stem}-${suffix}`) || reserved.has(`${stem}-${suffix}`)) suffix++;
|
|
1591
|
+
id = `${stem}-${suffix}`;
|
|
1592
|
+
}
|
|
1593
|
+
used.add(id);
|
|
1594
|
+
return id;
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
//#endregion
|
|
1598
|
+
//#region src/editor/extensions/chip.ts
|
|
1599
|
+
var CHIP_PLACEHOLDER = "Set a label";
|
|
1600
|
+
/** Keep imported or programmatic colors within the supported palette. */
|
|
1601
|
+
function normalizeLoomaChipColor(value) {
|
|
1602
|
+
return normalizeLoomaChipTone(value);
|
|
1603
|
+
}
|
|
1604
|
+
Node$1.create({
|
|
1605
|
+
name: "loomaChip",
|
|
1606
|
+
group: "inline",
|
|
1607
|
+
inline: true,
|
|
1608
|
+
atom: true,
|
|
1609
|
+
selectable: true,
|
|
1610
|
+
addAttributes() {
|
|
1611
|
+
return {
|
|
1612
|
+
label: {
|
|
1613
|
+
default: "",
|
|
1614
|
+
parseHTML: (element) => element.getAttribute("data-label") ?? (element.hasAttribute("data-placeholder") ? "" : element.textContent ?? "")
|
|
1615
|
+
},
|
|
1616
|
+
color: {
|
|
1617
|
+
default: "neutral",
|
|
1618
|
+
parseHTML: (element) => normalizeLoomaChipColor(element.getAttribute("data-color"))
|
|
1619
|
+
}
|
|
1620
|
+
};
|
|
1621
|
+
},
|
|
1622
|
+
parseHTML() {
|
|
1623
|
+
return [{ tag: "span[data-looma-chip]" }];
|
|
1624
|
+
},
|
|
1625
|
+
renderHTML({ node }) {
|
|
1626
|
+
const label = String(node.attrs.label ?? "");
|
|
1627
|
+
return [
|
|
1628
|
+
"span",
|
|
1629
|
+
{
|
|
1630
|
+
"data-looma-chip": "",
|
|
1631
|
+
"data-label": label,
|
|
1632
|
+
"data-color": normalizeLoomaChipColor(node.attrs.color),
|
|
1633
|
+
...label ? {} : { "data-placeholder": "" }
|
|
1634
|
+
},
|
|
1635
|
+
label || CHIP_PLACEHOLDER
|
|
1636
|
+
];
|
|
1637
|
+
},
|
|
1638
|
+
renderText({ node }) {
|
|
1639
|
+
return String(node.attrs.label ?? "");
|
|
1640
|
+
},
|
|
1641
|
+
addNodeView() {
|
|
1642
|
+
return ({ node, editor }) => {
|
|
1643
|
+
const dom = document.createElement("span");
|
|
1644
|
+
dom.dataset.loomaChip = "";
|
|
1645
|
+
dom.contentEditable = "false";
|
|
1646
|
+
dom.setAttribute("role", "button");
|
|
1647
|
+
dom.setAttribute("aria-disabled", String(!editor.isEditable));
|
|
1648
|
+
dom.tabIndex = 0;
|
|
1649
|
+
const update = (next) => {
|
|
1650
|
+
if (next.type !== node.type) return false;
|
|
1651
|
+
const label = String(next.attrs.label ?? "");
|
|
1652
|
+
if (dom.dataset.label !== label) {
|
|
1653
|
+
dom.dataset.label = label;
|
|
1654
|
+
dom.textContent = label || CHIP_PLACEHOLDER;
|
|
1655
|
+
dom.setAttribute("aria-label", label ? `Edit chip: ${label}` : "Set chip label");
|
|
1656
|
+
if (label) delete dom.dataset.placeholder;
|
|
1657
|
+
else dom.dataset.placeholder = "";
|
|
1658
|
+
}
|
|
1659
|
+
const color = normalizeLoomaChipColor(next.attrs.color);
|
|
1660
|
+
if (dom.dataset.color !== color) dom.dataset.color = color;
|
|
1661
|
+
return true;
|
|
1662
|
+
};
|
|
1663
|
+
update(node);
|
|
1664
|
+
return {
|
|
1665
|
+
dom,
|
|
1666
|
+
update,
|
|
1667
|
+
stopEvent: (event) => event.type === "click" || event.type === "keydown"
|
|
1668
|
+
};
|
|
1669
|
+
};
|
|
1670
|
+
},
|
|
1671
|
+
addCommands() {
|
|
1672
|
+
return { insertLoomaChip: (attributes = {}) => ({ commands, state }) => {
|
|
1673
|
+
const selection = state.selection;
|
|
1674
|
+
const label = attributes.label ?? state.doc.textBetween(selection.from, selection.to);
|
|
1675
|
+
return commands.insertContent({
|
|
1676
|
+
type: this.name,
|
|
1677
|
+
attrs: {
|
|
1678
|
+
label,
|
|
1679
|
+
color: normalizeLoomaChipColor(attributes.color)
|
|
1680
|
+
}
|
|
1681
|
+
});
|
|
1682
|
+
} };
|
|
1683
|
+
}
|
|
1684
|
+
});
|
|
1685
|
+
//#endregion
|
|
1686
|
+
//#region src/editor/chip-editing.ts
|
|
1687
|
+
var LOOMA_CHIP_EDITING_IDLE = Object.freeze({
|
|
1688
|
+
open: false,
|
|
1689
|
+
label: "",
|
|
1690
|
+
color: "neutral"
|
|
1691
|
+
});
|
|
1692
|
+
function createChipEditing(options) {
|
|
1693
|
+
const { editor } = options;
|
|
1694
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
1695
|
+
let state = LOOMA_CHIP_EDITING_IDLE;
|
|
1696
|
+
let element = null;
|
|
1697
|
+
const set = (next) => {
|
|
1698
|
+
state = next;
|
|
1699
|
+
listeners.forEach((listener) => listener());
|
|
1700
|
+
};
|
|
1701
|
+
const close = () => {
|
|
1702
|
+
element = null;
|
|
1703
|
+
if (state.open) set({
|
|
1704
|
+
...state,
|
|
1705
|
+
open: false
|
|
1706
|
+
});
|
|
1707
|
+
};
|
|
1708
|
+
const change = (changes) => {
|
|
1709
|
+
if (!element || editor.isDestroyed || !element.isConnected) return close();
|
|
1710
|
+
const position = editor.view.posAtDOM(element, 0);
|
|
1711
|
+
const node = editor.state.doc.nodeAt(position);
|
|
1712
|
+
if (node?.type.name !== "loomaChip") return close();
|
|
1713
|
+
set({
|
|
1714
|
+
...state,
|
|
1715
|
+
...changes
|
|
1716
|
+
});
|
|
1717
|
+
editor.view.dispatch(editor.state.tr.setNodeMarkup(position, void 0, {
|
|
1718
|
+
...node.attrs,
|
|
1719
|
+
...changes
|
|
1720
|
+
}));
|
|
1721
|
+
};
|
|
1722
|
+
return {
|
|
1723
|
+
get state() {
|
|
1724
|
+
return state;
|
|
1725
|
+
},
|
|
1726
|
+
get element() {
|
|
1727
|
+
return element;
|
|
1728
|
+
},
|
|
1729
|
+
subscribe(listener) {
|
|
1730
|
+
listeners.add(listener);
|
|
1731
|
+
return () => {
|
|
1732
|
+
listeners.delete(listener);
|
|
1733
|
+
};
|
|
1734
|
+
},
|
|
1735
|
+
open(position) {
|
|
1736
|
+
if (!options.isEditable() || editor.isDestroyed) return false;
|
|
1737
|
+
const node = editor.state.doc.nodeAt(position);
|
|
1738
|
+
const dom = editor.view.nodeDOM(position);
|
|
1739
|
+
if (node?.type.name !== "loomaChip" || !(dom instanceof HTMLElement)) return false;
|
|
1740
|
+
element = dom;
|
|
1741
|
+
set({
|
|
1742
|
+
open: true,
|
|
1743
|
+
label: String(node.attrs.label ?? ""),
|
|
1744
|
+
color: normalizeLoomaChipColor(node.attrs.color)
|
|
1745
|
+
});
|
|
1746
|
+
return true;
|
|
1747
|
+
},
|
|
1748
|
+
setLabel: (label) => change({ label }),
|
|
1749
|
+
setColor: (color) => change({ color }),
|
|
1750
|
+
close
|
|
1751
|
+
};
|
|
1752
|
+
}
|
|
1753
|
+
//#endregion
|
|
1539
1754
|
//#region src/editor/extensions/relative-links.ts
|
|
1540
1755
|
/** Keep other origins and non-web schemes intact; same-origin links retain path, query, and fragment. */
|
|
1541
1756
|
function siteRelativeHref(href, baseUrl) {
|
|
@@ -2056,34 +2271,6 @@ function formatEditorShortcut(keys, apple) {
|
|
|
2056
2271
|
].filter(Boolean).join("+");
|
|
2057
2272
|
}
|
|
2058
2273
|
var isApplePlatform = () => typeof navigator !== "undefined" && /mac|iphone|ipad|ipod/i.test(navigator.userAgentData?.platform || navigator.platform || navigator.userAgent);
|
|
2059
|
-
/**
|
|
2060
|
-
* The anchor a heading's text derives: NFC, lowercase, keeping letters, numbers and combining
|
|
2061
|
-
* marks, with every other run of characters one hyphen.
|
|
2062
|
-
* @failure Text with no letters or numbers, such as only emoji, derives `heading`.
|
|
2063
|
-
*/
|
|
2064
|
-
function loomaHeadingSlug(text) {
|
|
2065
|
-
return text.normalize("NFC").toLowerCase().replace(/[^\p{L}\p{N}\p{M}]+/gu, "-").replace(/^-+|-+$/g, "") || "heading";
|
|
2066
|
-
}
|
|
2067
|
-
/**
|
|
2068
|
-
* Gives every heading of a document its anchor, in document order.
|
|
2069
|
-
* @contract A custom ID is kept unless an earlier heading already has it. Any other heading takes
|
|
2070
|
-
* its slug, or the slug's first free suffix (`-1`, `-2`…), never one a later custom ID reserves.
|
|
2071
|
-
*/
|
|
2072
|
-
function assignLoomaHeadingIds(headings) {
|
|
2073
|
-
const reserved = new Set(headings.map(({ id }) => id).filter((id) => Boolean(id)));
|
|
2074
|
-
const used = /* @__PURE__ */ new Set();
|
|
2075
|
-
return headings.map(({ text, id: custom }) => {
|
|
2076
|
-
let id = custom || loomaHeadingSlug(text);
|
|
2077
|
-
if (custom ? used.has(id) : used.has(id) || reserved.has(id)) {
|
|
2078
|
-
const stem = id;
|
|
2079
|
-
let suffix = 1;
|
|
2080
|
-
while (used.has(`${stem}-${suffix}`) || reserved.has(`${stem}-${suffix}`)) suffix++;
|
|
2081
|
-
id = `${stem}-${suffix}`;
|
|
2082
|
-
}
|
|
2083
|
-
used.add(id);
|
|
2084
|
-
return id;
|
|
2085
|
-
});
|
|
2086
|
-
}
|
|
2087
2274
|
//#endregion
|
|
2088
2275
|
//#region src/editor/extensions/expand.ts
|
|
2089
2276
|
/**
|
|
@@ -3215,9 +3402,8 @@ var LoomaEditor = defineComponent({
|
|
|
3215
3402
|
chipEditorRoot.value = element instanceof HTMLElement ? element : null;
|
|
3216
3403
|
};
|
|
3217
3404
|
const chipInput = () => chipEditorRoot.value?.querySelector("[data-chip-label]");
|
|
3218
|
-
|
|
3219
|
-
const
|
|
3220
|
-
const chipColor = ref("neutral");
|
|
3405
|
+
let chipEditing;
|
|
3406
|
+
const chipState = shallowRef(LOOMA_CHIP_EDITING_IDLE);
|
|
3221
3407
|
const toolbarScope = `looma-editor-tool-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;
|
|
3222
3408
|
const tooltipFor = ref("");
|
|
3223
3409
|
const tooltipLabel = ref("");
|
|
@@ -3320,39 +3506,16 @@ var LoomaEditor = defineComponent({
|
|
|
3320
3506
|
menuStyle: {},
|
|
3321
3507
|
capabilities: { ...EMPTY_CAPABILITIES }
|
|
3322
3508
|
});
|
|
3323
|
-
const openChipEditor = (
|
|
3324
|
-
if (!
|
|
3325
|
-
const node = instance.state.doc.nodeAt(position);
|
|
3326
|
-
const element = instance.view.nodeDOM(position);
|
|
3327
|
-
if (node?.type.name !== "loomaChip" || !(element instanceof HTMLElement)) return;
|
|
3509
|
+
const openChipEditor = (_instance, position) => {
|
|
3510
|
+
if (!chipEditing?.open(position)) return;
|
|
3328
3511
|
root.value?.querySelector(`#${chipAnchorId}`)?.removeAttribute("id");
|
|
3329
|
-
element.id = chipAnchorId;
|
|
3330
|
-
chipLabel.value = String(node.attrs.label ?? "");
|
|
3331
|
-
chipColor.value = normalizeLoomaChipColor(node.attrs.color);
|
|
3332
|
-
chipOpen.value = true;
|
|
3512
|
+
chipEditing.element.id = chipAnchorId;
|
|
3333
3513
|
nextTick(() => chipInput()?.focus());
|
|
3334
3514
|
};
|
|
3335
|
-
const changeChip = (changes) => {
|
|
3336
|
-
const instance = editor.value;
|
|
3337
|
-
const element = root.value?.querySelector(`#${chipAnchorId}`);
|
|
3338
|
-
if (!instance || !element) {
|
|
3339
|
-
chipOpen.value = false;
|
|
3340
|
-
return;
|
|
3341
|
-
}
|
|
3342
|
-
const position = instance.view.posAtDOM(element, 0);
|
|
3343
|
-
const node = instance.state.doc.nodeAt(position);
|
|
3344
|
-
if (node?.type.name !== "loomaChip") {
|
|
3345
|
-
chipOpen.value = false;
|
|
3346
|
-
return;
|
|
3347
|
-
}
|
|
3348
|
-
instance.view.dispatch(instance.state.tr.setNodeMarkup(position, void 0, {
|
|
3349
|
-
...node.attrs,
|
|
3350
|
-
...changes
|
|
3351
|
-
}));
|
|
3352
|
-
};
|
|
3353
3515
|
const closeChip = (focusChip = false) => {
|
|
3354
|
-
|
|
3355
|
-
|
|
3516
|
+
const element = chipEditing?.element;
|
|
3517
|
+
chipEditing?.close();
|
|
3518
|
+
if (focusChip) element?.focus();
|
|
3356
3519
|
};
|
|
3357
3520
|
const found = reactive(/* @__PURE__ */ new Set());
|
|
3358
3521
|
const answers = (name) => {
|
|
@@ -3565,6 +3728,14 @@ var LoomaEditor = defineComponent({
|
|
|
3565
3728
|
linkState.value = engine.state;
|
|
3566
3729
|
});
|
|
3567
3730
|
linkEditing = engine;
|
|
3731
|
+
const chips = createChipEditing({
|
|
3732
|
+
editor: session.editor,
|
|
3733
|
+
isEditable: () => props.editable
|
|
3734
|
+
});
|
|
3735
|
+
chips.subscribe(() => {
|
|
3736
|
+
chipState.value = chips.state;
|
|
3737
|
+
});
|
|
3738
|
+
chipEditing = chips;
|
|
3568
3739
|
const imageUploads = createImageUploads({
|
|
3569
3740
|
editor: session.editor,
|
|
3570
3741
|
upload: () => async (file, init) => {
|
|
@@ -3597,6 +3768,7 @@ var LoomaEditor = defineComponent({
|
|
|
3597
3768
|
const previous = session;
|
|
3598
3769
|
const content = edited ? previous.editor.getJSON() : props.modelValue;
|
|
3599
3770
|
linkEditing?.destroy();
|
|
3771
|
+
chipEditing?.close();
|
|
3600
3772
|
formatting?.destroy();
|
|
3601
3773
|
uploads?.cancel();
|
|
3602
3774
|
previous.destroy();
|
|
@@ -3721,7 +3893,7 @@ var LoomaEditor = defineComponent({
|
|
|
3721
3893
|
root.value?.querySelectorAll("[data-looma-chip]").forEach((chip) => {
|
|
3722
3894
|
chip.setAttribute("aria-disabled", String(!editable));
|
|
3723
3895
|
});
|
|
3724
|
-
if (!editable)
|
|
3896
|
+
if (!editable) chipEditing?.close();
|
|
3725
3897
|
});
|
|
3726
3898
|
watch([
|
|
3727
3899
|
() => linkState.value.surface === "popover",
|
|
@@ -4691,24 +4863,16 @@ var LoomaEditor = defineComponent({
|
|
|
4691
4863
|
}, [loomaIcon("image"), h("span", "Drop image to upload")]) : null,
|
|
4692
4864
|
h(Popover, {
|
|
4693
4865
|
class: "looma-editor__chip-popover",
|
|
4694
|
-
open:
|
|
4866
|
+
open: chipState.value.open,
|
|
4695
4867
|
for: chipAnchorId,
|
|
4696
4868
|
placement: "bottom-start",
|
|
4697
|
-
onClose: () =>
|
|
4698
|
-
chipOpen.value = false;
|
|
4699
|
-
}
|
|
4869
|
+
onClose: () => chipEditing?.close()
|
|
4700
4870
|
}, () => h(EditorChipEditor, {
|
|
4701
4871
|
ref: setChipEditorRoot,
|
|
4702
|
-
label:
|
|
4703
|
-
color:
|
|
4704
|
-
onLabel: (event) =>
|
|
4705
|
-
|
|
4706
|
-
changeChip({ label: chipLabel.value });
|
|
4707
|
-
},
|
|
4708
|
-
onColor: (event) => {
|
|
4709
|
-
chipColor.value = event.detail.color;
|
|
4710
|
-
changeChip({ color: event.detail.color });
|
|
4711
|
-
},
|
|
4872
|
+
label: chipState.value.label,
|
|
4873
|
+
color: chipState.value.color,
|
|
4874
|
+
onLabel: (event) => chipEditing?.setLabel(event.detail.label),
|
|
4875
|
+
onColor: (event) => chipEditing?.setColor(event.detail.color),
|
|
4712
4876
|
onDone: () => closeChip(true)
|
|
4713
4877
|
})),
|
|
4714
4878
|
h(Popover, {
|
package/vue/host.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated by HTML Next 1.0.0-alpha.
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.54 for Vue 3.5. Do not edit.
|
|
2
2
|
import {
|
|
3
3
|
computed,
|
|
4
4
|
createTextVNode,
|
|
@@ -535,6 +535,8 @@ export interface ComponentHostOptions {
|
|
|
535
535
|
readonly data?: Readonly<Record<string, Readable<unknown>>>
|
|
536
536
|
/** Values inherited through declared context, which a controller reads. */
|
|
537
537
|
readonly context?: Readonly<Record<string, Readable<unknown>>>
|
|
538
|
+
/** Each named declared script, which a controller reads as `host.scripts`. */
|
|
539
|
+
readonly scripts?: Readonly<Record<string, unknown>>
|
|
538
540
|
readonly acceptsState?: (name: string, keys: readonly string[], value: unknown) => boolean
|
|
539
541
|
/** Asks one of the component's declared requests. */
|
|
540
542
|
request?(
|
|
@@ -700,6 +702,7 @@ export function useComponentHost(
|
|
|
700
702
|
),
|
|
701
703
|
...(options.acceptsState === undefined ? {} : { acceptsState: options.acceptsState }),
|
|
702
704
|
}, options.controllerSource?.definition ?? '<component>'),
|
|
705
|
+
scripts: options.scripts ?? Object.freeze({}),
|
|
703
706
|
on(type: string, callback: (event: Event) => void | (() => void)): () => void {
|
|
704
707
|
const entry: Subscription = {
|
|
705
708
|
type,
|