@threadlabs/looma 0.24.0 → 0.25.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 +1 -1
- package/components/shared/overlay.js +10 -2
- package/components/ui-affordance-scope/ui-affordance-scope.html +1 -1
- package/components/ui-affordance-scope/ui-affordance-scope.js +6 -1
- package/components/ui-avatar/ui-avatar.html +4 -4
- package/components/ui-avatar/ui-avatar.js +6 -1
- package/components/ui-avatar-group/ui-avatar-group.html +2 -2
- package/components/ui-avatar-group/ui-avatar-group.js +6 -1
- package/components/ui-badge/ui-badge.html +30 -30
- package/components/ui-breadcrumb-item/ui-breadcrumb-item.html +1 -1
- package/components/ui-button/ui-button.html +33 -33
- package/components/ui-button/ui-button.js +6 -1
- package/components/ui-callout/ui-callout.html +4 -4
- package/components/ui-card/ui-card.html +9 -9
- package/components/ui-checkbox/ui-checkbox.html +11 -11
- package/components/ui-checkbox/ui-checkbox.js +6 -1
- package/components/ui-cluster/ui-cluster.html +12 -12
- package/components/ui-combobox/ui-combobox.html +15 -17
- package/components/ui-combobox/ui-combobox.js +13 -15
- package/components/ui-container/ui-container.html +5 -5
- package/components/ui-context-menu/ui-context-menu.js +6 -1
- package/components/ui-cover/ui-cover.html +1 -1
- package/components/ui-description-list/ui-description-list.html +10 -10
- package/components/ui-dialog/ui-dialog.html +4 -4
- package/components/ui-dialog/ui-dialog.js +6 -1
- package/components/ui-disclosure/ui-disclosure.html +13 -13
- package/components/ui-disclosure/ui-disclosure.js +6 -1
- package/components/ui-editable/ui-editable.html +1 -1
- package/components/ui-editable/ui-editable.js +6 -1
- package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.js +6 -1
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.js +6 -1
- package/components/ui-editor-slash-menu/ui-editor-slash-menu.js +6 -1
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.js +6 -1
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.js +6 -1
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.js +6 -1
- package/components/ui-editor-toolbar/ui-editor-toolbar.html +4 -4
- package/components/ui-editor-toolbar/ui-editor-toolbar.js +6 -1
- package/components/ui-floating-action-button/ui-floating-action-button.html +1 -1
- package/components/ui-form-field/ui-form-field.html +1 -1
- package/components/ui-form-field/ui-form-field.js +6 -1
- package/components/ui-grid/ui-grid.html +7 -7
- package/components/ui-icon-button/ui-icon-button.html +26 -26
- package/components/ui-icon-button/ui-icon-button.js +6 -1
- package/components/ui-image/ui-image.html +11 -11
- package/components/ui-image/ui-image.js +6 -1
- package/components/ui-input/ui-input.html +9 -7
- package/components/ui-input/ui-input.js +6 -1
- package/components/ui-input-group/ui-input-group.html +3 -3
- package/components/ui-input-group/ui-input-group.js +6 -1
- package/components/ui-list/ui-list.html +6 -6
- package/components/ui-list-item/ui-list-item.html +8 -8
- package/components/ui-listbox/ui-listbox.js +6 -1
- package/components/ui-menu/ui-menu.html +3 -3
- package/components/ui-menu/ui-menu.js +6 -1
- package/components/ui-menu-item/ui-menu-item.html +3 -3
- package/components/ui-menu-item/ui-menu-item.js +6 -1
- package/components/ui-meter/ui-meter.html +7 -7
- package/components/ui-nav-item/ui-nav-item.html +6 -6
- package/components/ui-page-header/ui-page-header.html +2 -2
- package/components/ui-popover/ui-popover.html +3 -3
- package/components/ui-popover/ui-popover.js +6 -1
- package/components/ui-radio/ui-radio.html +10 -10
- package/components/ui-radio/ui-radio.js +6 -1
- package/components/ui-radio-group/ui-radio-group.html +2 -2
- package/components/ui-radio-group/ui-radio-group.js +6 -1
- package/components/ui-reel/ui-reel.html +11 -11
- package/components/ui-scroll-area/ui-scroll-area.html +4 -4
- package/components/ui-scroll-area/ui-scroll-area.js +6 -1
- package/components/ui-search-result-row/ui-search-result-row.html +5 -5
- package/components/ui-search-shell/ui-search-shell.js +6 -1
- package/components/ui-section/ui-section.html +4 -4
- package/components/ui-select/ui-select.html +3 -3
- package/components/ui-select/ui-select.js +6 -1
- package/components/ui-separator/ui-separator.html +4 -4
- package/components/ui-sidebar/ui-sidebar.html +6 -6
- package/components/ui-sidebar/ui-sidebar.js +6 -1
- package/components/ui-spinner/ui-spinner.html +1 -1
- package/components/ui-stack/ui-stack.html +12 -12
- package/components/ui-status-message/ui-status-message.html +4 -4
- package/components/ui-switch/ui-switch.html +11 -11
- package/components/ui-switch/ui-switch.js +6 -1
- package/components/ui-switcher/ui-switcher.html +11 -11
- package/components/ui-switcher/ui-switcher.js +6 -1
- package/components/ui-table/ui-table.html +2 -2
- package/components/ui-table/ui-table.js +6 -1
- package/components/ui-tabs/ui-tabs.html +8 -8
- package/components/ui-tabs/ui-tabs.js +6 -1
- package/components/ui-text/ui-text.html +20 -20
- package/components/ui-textarea/ui-textarea.html +4 -4
- package/components/ui-textarea/ui-textarea.js +6 -1
- package/components/ui-toast/ui-toast.html +4 -4
- package/components/ui-toast/ui-toast.js +6 -1
- package/components/ui-toast-region/ui-toast-region.html +16 -11
- package/components/ui-toast-region/ui-toast-region.js +12 -9
- package/components/ui-tooltip/ui-tooltip.html +1 -1
- package/components/ui-tooltip/ui-tooltip.js +6 -1
- package/components/ui-tree/ui-tree.html +2 -2
- package/components/ui-tree/ui-tree.js +6 -1
- package/components/ui-tree-item/ui-tree-item.html +4 -4
- package/components/ui-tree-item/ui-tree-item.js +6 -1
- package/dist/index.js +10 -4
- 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 +2 -2
- package/styles/ui-editable.css +1 -1
- package/styles/ui-editor-insert-table-grid.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-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 +2 -2
- 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-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 +1 -1
- 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 +1 -1
- package/vanilla/UiAffordanceScope.d.ts +1 -1
- package/vanilla/UiAffordanceScope.js +1 -1
- package/vanilla/UiAvatar.d.ts +1 -1
- package/vanilla/UiAvatar.js +1 -1
- package/vanilla/UiAvatarGroup.d.ts +1 -1
- package/vanilla/UiAvatarGroup.js +1 -1
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +1 -1
- package/vanilla/UiBreadcrumbItem.d.ts +1 -1
- package/vanilla/UiBreadcrumbItem.js +1 -1
- package/vanilla/UiBreadcrumbs.d.ts +1 -1
- package/vanilla/UiBreadcrumbs.js +1 -1
- package/vanilla/UiButton.d.ts +1 -1
- package/vanilla/UiButton.js +1 -1
- package/vanilla/UiCallout.d.ts +1 -1
- package/vanilla/UiCallout.js +1 -1
- package/vanilla/UiCard.d.ts +1 -1
- package/vanilla/UiCard.js +1 -1
- package/vanilla/UiCheckbox.d.ts +1 -1
- package/vanilla/UiCheckbox.js +1 -1
- package/vanilla/UiCluster.d.ts +1 -1
- package/vanilla/UiCluster.js +1 -1
- package/vanilla/UiCombobox.d.ts +1 -3
- package/vanilla/UiCombobox.js +2 -2
- 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 +1 -1
- package/vanilla/UiDescriptionList.d.ts +1 -1
- package/vanilla/UiDescriptionList.js +1 -1
- package/vanilla/UiDialog.d.ts +1 -1
- package/vanilla/UiDialog.js +1 -1
- package/vanilla/UiDisclosure.d.ts +1 -1
- package/vanilla/UiDisclosure.js +1 -1
- package/vanilla/UiEditable.d.ts +1 -1
- package/vanilla/UiEditable.js +1 -1
- package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
- package/vanilla/UiEditorInsertTableGrid.js +1 -1
- package/vanilla/UiEditorMentionMenu.d.ts +1 -1
- package/vanilla/UiEditorMentionMenu.js +1 -1
- package/vanilla/UiEditorMentionMenuItem.d.ts +1 -1
- package/vanilla/UiEditorMentionMenuItem.js +1 -1
- package/vanilla/UiEditorSlashMenu.d.ts +1 -1
- package/vanilla/UiEditorSlashMenu.js +1 -1
- package/vanilla/UiEditorSlashMenuGroup.d.ts +1 -1
- package/vanilla/UiEditorSlashMenuGroup.js +1 -1
- package/vanilla/UiEditorSlashMenuItem.d.ts +1 -1
- package/vanilla/UiEditorSlashMenuItem.js +1 -1
- package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
- package/vanilla/UiEditorTableContextMenu.js +1 -1
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +1 -1
- package/vanilla/UiEditorTableToolbar.d.ts +1 -1
- package/vanilla/UiEditorTableToolbar.js +1 -1
- 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 +1 -1
- package/vanilla/UiGrid.d.ts +1 -1
- package/vanilla/UiGrid.js +1 -1
- package/vanilla/UiIcon.d.ts +1 -1
- package/vanilla/UiIcon.js +1 -1
- package/vanilla/UiIconButton.d.ts +1 -1
- package/vanilla/UiIconButton.js +1 -1
- package/vanilla/UiImage.d.ts +1 -1
- package/vanilla/UiImage.js +1 -1
- package/vanilla/UiInput.d.ts +4 -4
- package/vanilla/UiInput.js +2 -2
- package/vanilla/UiInputGroup.d.ts +1 -1
- package/vanilla/UiInputGroup.js +1 -1
- package/vanilla/UiList.d.ts +1 -1
- package/vanilla/UiList.js +1 -1
- package/vanilla/UiListItem.d.ts +1 -1
- package/vanilla/UiListItem.js +1 -1
- package/vanilla/UiListbox.d.ts +1 -1
- package/vanilla/UiListbox.js +1 -1
- package/vanilla/UiMenu.d.ts +1 -1
- package/vanilla/UiMenu.js +1 -1
- package/vanilla/UiMenuGroup.d.ts +1 -1
- package/vanilla/UiMenuGroup.js +1 -1
- package/vanilla/UiMenuItem.d.ts +1 -1
- package/vanilla/UiMenuItem.js +1 -1
- package/vanilla/UiMeter.d.ts +1 -1
- package/vanilla/UiMeter.js +1 -1
- package/vanilla/UiNavItem.d.ts +1 -1
- package/vanilla/UiNavItem.js +1 -1
- package/vanilla/UiPageHeader.d.ts +1 -1
- package/vanilla/UiPageHeader.js +1 -1
- package/vanilla/UiPopover.d.ts +1 -1
- package/vanilla/UiPopover.js +1 -1
- package/vanilla/UiRadio.d.ts +1 -1
- package/vanilla/UiRadio.js +1 -1
- package/vanilla/UiRadioGroup.d.ts +1 -1
- package/vanilla/UiRadioGroup.js +1 -1
- 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 +1 -1
- package/vanilla/UiSearchShell.d.ts +1 -1
- package/vanilla/UiSearchShell.js +1 -1
- package/vanilla/UiSection.d.ts +1 -1
- package/vanilla/UiSection.js +1 -1
- 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 +1 -1
- package/vanilla/UiSpinner.d.ts +1 -1
- package/vanilla/UiSpinner.js +1 -1
- package/vanilla/UiStack.d.ts +1 -1
- package/vanilla/UiStack.js +1 -1
- package/vanilla/UiStatusMessage.d.ts +1 -1
- package/vanilla/UiStatusMessage.js +1 -1
- package/vanilla/UiSwitch.d.ts +1 -1
- package/vanilla/UiSwitch.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/vanilla/UiToastRegion.d.ts +2 -2
- package/vanilla/UiToastRegion.js +2 -2
- package/vanilla/UiTooltip.d.ts +1 -1
- package/vanilla/UiTooltip.js +1 -1
- package/vanilla/UiTopBar.d.ts +1 -1
- package/vanilla/UiTopBar.js +1 -1
- package/vanilla/UiTree.d.ts +1 -1
- package/vanilla/UiTree.js +1 -1
- package/vanilla/UiTreeItem.d.ts +1 -1
- package/vanilla/UiTreeItem.js +1 -1
- package/vue/UiActionBar.vue +1 -1
- package/vue/UiAffordanceScope.vue +8 -1
- package/vue/UiAvatar.d.ts +6 -9
- package/vue/UiAvatar.vue +71 -20
- package/vue/UiAvatarGroup.d.ts +7 -10
- package/vue/UiAvatarGroup.vue +45 -12
- package/vue/UiBadge.vue +1 -1
- package/vue/UiBreadcrumbItem.vue +1 -1
- package/vue/UiBreadcrumbs.vue +1 -1
- package/vue/UiButton.vue +1 -1
- package/vue/UiCallout.vue +1 -1
- package/vue/UiCard.vue +1 -1
- package/vue/UiCheckbox.d.ts +8 -11
- package/vue/UiCheckbox.vue +34 -11
- package/vue/UiCluster.vue +1 -1
- package/vue/UiCombobox.d.ts +60 -66
- package/vue/UiCombobox.vue +476 -124
- package/vue/UiContainer.vue +1 -1
- package/vue/UiContextMenu.vue +18 -9
- package/vue/UiCover.vue +1 -1
- package/vue/UiDescriptionItem.vue +1 -1
- package/vue/UiDescriptionList.vue +1 -1
- package/vue/UiDialog.d.ts +8 -11
- package/vue/UiDialog.vue +39 -12
- package/vue/UiDisclosure.d.ts +12 -15
- package/vue/UiDisclosure.vue +70 -24
- package/vue/UiEditable.d.ts +3 -3
- package/vue/UiEditable.vue +60 -21
- package/vue/UiEditorInsertTableGrid.d.ts +2 -2
- package/vue/UiEditorInsertTableGrid.vue +75 -14
- package/vue/UiEditorMentionMenu.d.ts +10 -13
- package/vue/UiEditorMentionMenu.vue +50 -7
- package/vue/UiEditorMentionMenuItem.vue +1 -1
- package/vue/UiEditorSlashMenu.d.ts +12 -15
- package/vue/UiEditorSlashMenu.vue +48 -7
- package/vue/UiEditorSlashMenuGroup.vue +1 -1
- package/vue/UiEditorSlashMenuItem.vue +1 -1
- package/vue/UiEditorTableContextMenu.vue +73 -4
- package/vue/UiEditorTableOverlay.d.ts +2 -2
- package/vue/UiEditorTableOverlay.vue +202 -38
- package/vue/UiEditorTableToolbar.d.ts +2 -2
- package/vue/UiEditorTableToolbar.vue +128 -7
- package/vue/UiEditorToolbar.vue +3 -3
- package/vue/UiFloatingActionButton.vue +1 -1
- package/vue/UiFormField.vue +1 -1
- package/vue/UiGrid.vue +1 -1
- package/vue/UiIcon.vue +1 -1
- package/vue/UiIconButton.vue +1 -1
- package/vue/UiImage.vue +7 -6
- package/vue/UiInput.d.ts +5 -5
- package/vue/UiInput.vue +15 -3
- package/vue/UiInputGroup.vue +1 -1
- package/vue/UiList.vue +1 -1
- package/vue/UiListItem.vue +1 -1
- package/vue/UiListbox.d.ts +6 -9
- package/vue/UiListbox.vue +70 -19
- package/vue/UiMenu.vue +20 -10
- package/vue/UiMenuGroup.vue +1 -1
- package/vue/UiMenuItem.d.ts +13 -16
- package/vue/UiMenuItem.vue +30 -7
- package/vue/UiMeter.vue +1 -1
- package/vue/UiNavItem.vue +1 -1
- package/vue/UiPageHeader.vue +1 -1
- package/vue/UiPopover.vue +12 -4
- package/vue/UiRadio.d.ts +8 -11
- package/vue/UiRadio.vue +34 -11
- package/vue/UiRadioGroup.vue +16 -7
- package/vue/UiReel.vue +1 -1
- package/vue/UiScrollArea.vue +3 -3
- package/vue/UiSearchResultRow.vue +1 -1
- package/vue/UiSearchShell.vue +14 -6
- package/vue/UiSection.vue +1 -1
- package/vue/UiSelect.vue +3 -2
- package/vue/UiSeparator.vue +1 -1
- package/vue/UiSidebar.d.ts +7 -10
- package/vue/UiSidebar.vue +44 -12
- package/vue/UiSpinner.vue +1 -1
- package/vue/UiStack.vue +1 -1
- package/vue/UiStatusMessage.vue +1 -1
- package/vue/UiSwitch.d.ts +8 -11
- package/vue/UiSwitch.vue +34 -11
- package/vue/UiSwitcher.vue +8 -1
- package/vue/UiTable.vue +1 -1
- package/vue/UiTabs.vue +30 -8
- package/vue/UiText.vue +1 -1
- package/vue/UiTextarea.vue +2 -2
- package/vue/UiToast.vue +7 -6
- package/vue/UiToastRegion.d.ts +15 -3
- package/vue/UiToastRegion.vue +90 -45
- package/vue/UiTooltip.d.ts +9 -12
- package/vue/UiTooltip.vue +30 -7
- package/vue/UiTopBar.vue +1 -1
- package/vue/UiTree.vue +17 -13
- package/vue/UiTreeItem.d.ts +15 -18
- package/vue/UiTreeItem.vue +79 -30
- package/vue/chunks/UiActionBar.js +1 -1
- package/vue/chunks/UiAffordanceScope.js +6 -2
- package/vue/chunks/UiAvatar.js +37 -10
- package/vue/chunks/UiAvatarGroup.js +26 -7
- package/vue/chunks/UiBadge.js +2 -2
- package/vue/chunks/UiBreadcrumbItem.js +2 -2
- package/vue/chunks/UiBreadcrumbs.js +2 -2
- package/vue/chunks/UiButton.js +2 -2
- package/vue/chunks/UiCallout.js +2 -2
- package/vue/chunks/UiCard.js +2 -2
- package/vue/chunks/UiCheckbox.js +25 -12
- package/vue/chunks/UiCluster.js +2 -2
- package/vue/chunks/UiCombobox.js +628 -117
- package/vue/chunks/UiContainer.js +2 -2
- package/vue/chunks/UiContextMenu.js +14 -10
- package/vue/chunks/UiCover.js +2 -2
- package/vue/chunks/UiDescriptionItem.js +2 -2
- package/vue/chunks/UiDescriptionList.js +2 -2
- package/vue/chunks/UiDialog.js +29 -11
- package/vue/chunks/UiDisclosure.js +44 -14
- package/vue/chunks/UiEditable.js +33 -9
- package/vue/chunks/UiEditorInsertTableGrid.js +98 -14
- package/vue/chunks/UiEditorMentionMenu.js +76 -9
- package/vue/chunks/UiEditorMentionMenuItem.js +2 -2
- package/vue/chunks/UiEditorSlashMenu.js +70 -11
- package/vue/chunks/UiEditorSlashMenuGroup.js +2 -2
- package/vue/chunks/UiEditorSlashMenuItem.js +2 -2
- package/vue/chunks/UiEditorTableContextMenu.js +120 -2
- package/vue/chunks/UiEditorTableOverlay.js +306 -12
- package/vue/chunks/UiEditorTableToolbar.js +215 -3
- package/vue/chunks/UiEditorToolbar.js +8 -8
- package/vue/chunks/UiFloatingActionButton.js +2 -2
- package/vue/chunks/UiFormField.js +2 -2
- package/vue/chunks/UiGrid.js +2 -2
- package/vue/chunks/UiIcon.js +2 -2
- package/vue/chunks/UiIconButton.js +2 -2
- package/vue/chunks/UiImage.js +12 -12
- package/vue/chunks/UiInput.js +34 -4
- package/vue/chunks/UiInputGroup.js +2 -2
- package/vue/chunks/UiList.js +2 -2
- package/vue/chunks/UiListItem.js +2 -2
- package/vue/chunks/UiListbox.js +96 -12
- package/vue/chunks/UiMenu.js +6 -2
- package/vue/chunks/UiMenuGroup.js +2 -2
- package/vue/chunks/UiMenuItem.js +15 -3
- package/vue/chunks/UiMeter.js +2 -2
- package/vue/chunks/UiNavItem.js +2 -2
- package/vue/chunks/UiPageHeader.js +2 -2
- package/vue/chunks/UiPopover.js +6 -2
- package/vue/chunks/UiRadio.js +25 -12
- package/vue/chunks/UiRadioGroup.js +6 -2
- package/vue/chunks/UiReel.js +2 -2
- package/vue/chunks/UiScrollArea.js +8 -8
- package/vue/chunks/UiSearchResultRow.js +2 -2
- package/vue/chunks/UiSearchShell.js +9 -4
- package/vue/chunks/UiSection.js +2 -2
- package/vue/chunks/UiSelect.js +5 -3
- package/vue/chunks/UiSeparator.js +2 -2
- package/vue/chunks/UiSidebar.js +28 -5
- package/vue/chunks/UiSpinner.js +2 -2
- package/vue/chunks/UiStack.js +2 -2
- package/vue/chunks/UiStatusMessage.js +2 -2
- package/vue/chunks/UiSwitch.js +25 -12
- package/vue/chunks/UiSwitcher.js +6 -2
- package/vue/chunks/UiTable.js +2 -2
- package/vue/chunks/UiTabs.js +39 -10
- package/vue/chunks/UiText.js +2 -2
- package/vue/chunks/UiTextarea.js +3 -2
- package/vue/chunks/UiToast.js +8 -8
- package/vue/chunks/UiToastRegion.js +86 -20
- package/vue/chunks/UiTooltip.js +15 -3
- package/vue/chunks/UiTopBar.js +1 -1
- package/vue/chunks/UiTree.js +2 -2
- package/vue/chunks/UiTreeItem.js +84 -51
- package/vue/chunks/control.js +9 -2
- package/vue/chunks/host.js +203 -29
- package/vue/chunks/props.js +43 -7
- package/vue/components.css +1345 -1345
- package/vue/editor/index.js +12 -5
- package/vue/host.ts +286 -42
package/vue/editor/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Extension, Node as Node$1, getText, getTextSerializersFromSchema, merge
|
|
|
5
5
|
import { BubbleMenu, EditorContent, useEditor } from "@tiptap/vue-3";
|
|
6
6
|
import { closeHistory } from "@tiptap/pm/history";
|
|
7
7
|
import { createLowlight } from "lowlight";
|
|
8
|
-
import { NodeSelection, Plugin, PluginKey, TextSelection } from "@tiptap/pm/state";
|
|
8
|
+
import { AllSelection, NodeSelection, Plugin, PluginKey, TextSelection } from "@tiptap/pm/state";
|
|
9
9
|
import { Decoration, DecorationSet } from "@tiptap/pm/view";
|
|
10
10
|
import { DOMParser, DOMSerializer, Fragment as Fragment$1 } from "@tiptap/pm/model";
|
|
11
11
|
export * from "@threadlabs/looma/editor";
|
|
@@ -1801,6 +1801,7 @@ var LoomaEditor = defineComponent({
|
|
|
1801
1801
|
let heldPressTimer;
|
|
1802
1802
|
let heldPress = null;
|
|
1803
1803
|
const floatingFormattingMode = () => props.toolbarMode !== "sticky" && !(props.toolbarMode === "popover" && props.toolbarOpen) && !mobile.value;
|
|
1804
|
+
const formattingPickerOpen = () => linkOpen.value || tablePickerOpen.value;
|
|
1804
1805
|
const cancelHeldPress = () => {
|
|
1805
1806
|
clearTimeout(heldPressTimer);
|
|
1806
1807
|
heldPressTimer = void 0;
|
|
@@ -1808,7 +1809,7 @@ var LoomaEditor = defineComponent({
|
|
|
1808
1809
|
};
|
|
1809
1810
|
const formattingSelectionActive = (instance) => {
|
|
1810
1811
|
const selection = instance.state.selection;
|
|
1811
|
-
return selection instanceof TextSelection && !dismissedFormattingSelection?.eq(selection) && (!selection.empty || Boolean(heldFormattingSelection?.eq(selection)));
|
|
1812
|
+
return (selection instanceof TextSelection || selection instanceof AllSelection && Boolean(instance.state.doc.textContent)) && !dismissedFormattingSelection?.eq(selection) && (!selection.empty || Boolean(heldFormattingSelection?.eq(selection)));
|
|
1812
1813
|
};
|
|
1813
1814
|
const editorStateVersion = ref(0);
|
|
1814
1815
|
const mobileToolbarMode = ref("formatting");
|
|
@@ -2473,6 +2474,11 @@ var LoomaEditor = defineComponent({
|
|
|
2473
2474
|
});
|
|
2474
2475
|
if (!editable) chipOpen.value = false;
|
|
2475
2476
|
});
|
|
2477
|
+
watch([linkOpen, tablePickerOpen], ([link, table]) => {
|
|
2478
|
+
if (link || table || !floatingFormattingMode() || editor.value?.isFocused || formattingPopup?.popper.contains(document.activeElement)) return;
|
|
2479
|
+
heldFormattingSelection = null;
|
|
2480
|
+
formattingPopup?.hide();
|
|
2481
|
+
});
|
|
2476
2482
|
watch(() => props.label, (label) => {
|
|
2477
2483
|
editor.value?.setOptions({ editorProps: { attributes: {
|
|
2478
2484
|
role: "textbox",
|
|
@@ -2667,7 +2673,7 @@ var LoomaEditor = defineComponent({
|
|
|
2667
2673
|
updateCodeUi();
|
|
2668
2674
|
setTimeout(() => {
|
|
2669
2675
|
if (!tableInteractionActive && !editor.value?.isFocused) editorFocused.value = false;
|
|
2670
|
-
if (!editor.value?.isFocused && !formattingPopup?.popper.contains(document.activeElement)) heldFormattingSelection = null;
|
|
2676
|
+
if (!editor.value?.isFocused && !formattingPickerOpen() && !formattingPopup?.popper.contains(document.activeElement)) heldFormattingSelection = null;
|
|
2671
2677
|
}, 0);
|
|
2672
2678
|
};
|
|
2673
2679
|
const bindEditorUi = (instance) => {
|
|
@@ -2741,7 +2747,7 @@ var LoomaEditor = defineComponent({
|
|
|
2741
2747
|
cancelHeldPress();
|
|
2742
2748
|
if (event.key !== "Escape" || !floatingFormattingMode() || !(event.target instanceof Node) || !(root.value?.contains(event.target) || formattingPopup?.popper.contains(event.target))) return;
|
|
2743
2749
|
const selection = editor.value?.state.selection;
|
|
2744
|
-
dismissedFormattingSelection = selection instanceof TextSelection ? selection : null;
|
|
2750
|
+
dismissedFormattingSelection = selection instanceof TextSelection || selection instanceof AllSelection ? selection : null;
|
|
2745
2751
|
heldFormattingSelection = null;
|
|
2746
2752
|
formattingPopup?.hide();
|
|
2747
2753
|
hideTool();
|
|
@@ -3208,7 +3214,7 @@ var LoomaEditor = defineComponent({
|
|
|
3208
3214
|
editor: instance,
|
|
3209
3215
|
pluginKey: "looma-text-formatting-menu",
|
|
3210
3216
|
updateDelay: 0,
|
|
3211
|
-
shouldShow: ({ editor: menuEditor }) => (props.toolbarMode !== "popover" || !props.toolbarOpen) && !slash.active && !mention.active && (menuEditor.isFocused || linkContextEditing.value) && formattingSelectionActive(menuEditor),
|
|
3217
|
+
shouldShow: ({ editor: menuEditor }) => (props.toolbarMode !== "popover" || !props.toolbarOpen) && !slash.active && !mention.active && (menuEditor.isFocused || linkContextEditing.value || formattingPickerOpen()) && formattingSelectionActive(menuEditor),
|
|
3212
3218
|
tippyOptions: {
|
|
3213
3219
|
onCreate: (popup) => {
|
|
3214
3220
|
formattingPopup = popup;
|
|
@@ -3218,6 +3224,7 @@ var LoomaEditor = defineComponent({
|
|
|
3218
3224
|
},
|
|
3219
3225
|
appendTo: () => root.value?.closest("dialog[open], [popover]") ?? document.body,
|
|
3220
3226
|
onShow: () => announceOverlayOpen(root.value?.ownerDocument ?? document, root.value),
|
|
3227
|
+
onHide: () => instance.isEditable && floatingFormattingMode() && formattingPickerOpen() && formattingSelectionActive(instance) ? false : void 0,
|
|
3221
3228
|
duration: 100,
|
|
3222
3229
|
maxWidth: "none",
|
|
3223
3230
|
placement: "top",
|
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.29 for Vue 3.5. Do not edit.
|
|
2
2
|
import {
|
|
3
3
|
computed,
|
|
4
4
|
Fragment,
|
|
@@ -13,6 +13,182 @@ import {
|
|
|
13
13
|
watchEffect,
|
|
14
14
|
} from 'vue'
|
|
15
15
|
|
|
16
|
+
interface ControllerStateAccess {
|
|
17
|
+
readonly get: () => unknown
|
|
18
|
+
readonly set: (value: unknown) => void
|
|
19
|
+
}
|
|
20
|
+
interface ControllerNamespaces {
|
|
21
|
+
readonly state: Readonly<Record<string, ControllerStateAccess>>
|
|
22
|
+
readonly computed: Readonly<Record<string, () => unknown>>
|
|
23
|
+
readonly data?: Readonly<Record<string, () => unknown>>
|
|
24
|
+
readonly acceptsState?: (name: string, keys: readonly string[], value: unknown) => boolean
|
|
25
|
+
readonly changed?: (name: string) => void
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function controllerNamespaces(options: ControllerNamespaces, source: string): {
|
|
29
|
+
state: Record<string, unknown>
|
|
30
|
+
data: Readonly<Record<string, unknown>>
|
|
31
|
+
} {
|
|
32
|
+
const reported = new Set<string>()
|
|
33
|
+
const nested = new WeakMap<object, Map<string, object>>()
|
|
34
|
+
const eventType = typeof Event === 'undefined'
|
|
35
|
+
? undefined
|
|
36
|
+
: Object.getOwnPropertyDescriptor(Event.prototype, 'type')!.get!
|
|
37
|
+
const eventBrands = new WeakMap<object, boolean>()
|
|
38
|
+
const nativeEvent = (value: object): boolean => {
|
|
39
|
+
if (!('type' in value) || eventType === undefined) return false
|
|
40
|
+
const known = eventBrands.get(value)
|
|
41
|
+
if (known !== undefined) return known
|
|
42
|
+
let accepted = false
|
|
43
|
+
try {
|
|
44
|
+
eventType.call(value)
|
|
45
|
+
accepted = true
|
|
46
|
+
} catch {}
|
|
47
|
+
eventBrands.set(value, accepted)
|
|
48
|
+
return accepted
|
|
49
|
+
}
|
|
50
|
+
const warn = (path: string, readonly: boolean): void => {
|
|
51
|
+
if (reported.has(path)) return
|
|
52
|
+
reported.add(path)
|
|
53
|
+
console.warn(
|
|
54
|
+
source + ': HR007: Destination ' + path
|
|
55
|
+
+ (readonly ? ' is read-only.' : ' does not satisfy its declared type.'),
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
const write = (
|
|
59
|
+
name: string,
|
|
60
|
+
keys: readonly string[],
|
|
61
|
+
value: unknown,
|
|
62
|
+
readonly: boolean,
|
|
63
|
+
apply: () => void,
|
|
64
|
+
): boolean => {
|
|
65
|
+
if (readonly || options.acceptsState?.(name, keys, value) === false) {
|
|
66
|
+
warn([name, ...keys].join('.'), readonly)
|
|
67
|
+
} else apply()
|
|
68
|
+
return true
|
|
69
|
+
}
|
|
70
|
+
const wrap = (
|
|
71
|
+
value: unknown,
|
|
72
|
+
name: string,
|
|
73
|
+
keys: readonly string[],
|
|
74
|
+
readonly: boolean,
|
|
75
|
+
): unknown => {
|
|
76
|
+
if (value === null || typeof value !== 'object' || nativeEvent(value)) return value
|
|
77
|
+
const path = [name, ...keys].join('.')
|
|
78
|
+
let paths = nested.get(value)
|
|
79
|
+
if (paths === undefined) nested.set(value, paths = new Map())
|
|
80
|
+
const known = paths.get(path)
|
|
81
|
+
if (known !== undefined) return known
|
|
82
|
+
// A readonly facade avoids Proxy invariants on frozen source properties.
|
|
83
|
+
const surface = readonly
|
|
84
|
+
? (Array.isArray(value) ? [] : Object.create(Object.getPrototypeOf(value)))
|
|
85
|
+
: value
|
|
86
|
+
if (readonly && Array.isArray(value)) surface.length = value.length
|
|
87
|
+
const proxy = new Proxy(surface, {
|
|
88
|
+
get: (_target, key) => wrap(Reflect.get(value, key), name, [...keys, String(key)], readonly),
|
|
89
|
+
set: (_target, key, next) =>
|
|
90
|
+
write(name, [...keys, String(key)], next, readonly, () => {
|
|
91
|
+
const previous = Reflect.get(value, key)
|
|
92
|
+
if (Reflect.set(value, key, next) && !Object.is(previous, next)) options.changed?.(name)
|
|
93
|
+
}),
|
|
94
|
+
has: (_target, key) => Reflect.has(value, key),
|
|
95
|
+
ownKeys: () => Reflect.ownKeys(value),
|
|
96
|
+
getOwnPropertyDescriptor: (_target, key) => {
|
|
97
|
+
if (readonly && Array.isArray(value) && key === 'length') {
|
|
98
|
+
surface.length = value.length
|
|
99
|
+
return Reflect.getOwnPropertyDescriptor(surface, key)
|
|
100
|
+
}
|
|
101
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(value, key)
|
|
102
|
+
return descriptor === undefined
|
|
103
|
+
? undefined
|
|
104
|
+
: readonly
|
|
105
|
+
? { ...descriptor, configurable: true }
|
|
106
|
+
: descriptor
|
|
107
|
+
},
|
|
108
|
+
deleteProperty: (_target, key) =>
|
|
109
|
+
write(name, [...keys, String(key)], undefined, readonly, () => {
|
|
110
|
+
if (Reflect.has(value, key) && Reflect.deleteProperty(value, key)) options.changed?.(name)
|
|
111
|
+
}),
|
|
112
|
+
defineProperty: (_target, key, descriptor) => {
|
|
113
|
+
if (
|
|
114
|
+
readonly || !('value' in descriptor)
|
|
115
|
+
|| options.acceptsState?.(name, [...keys, String(key)], descriptor.value) === false
|
|
116
|
+
) {
|
|
117
|
+
warn([name, ...keys, String(key)].join('.'), readonly)
|
|
118
|
+
return false
|
|
119
|
+
}
|
|
120
|
+
const changed = Reflect.defineProperty(value, key, descriptor)
|
|
121
|
+
if (changed) options.changed?.(name)
|
|
122
|
+
return changed
|
|
123
|
+
},
|
|
124
|
+
})
|
|
125
|
+
paths.set(path, proxy)
|
|
126
|
+
return proxy
|
|
127
|
+
}
|
|
128
|
+
const state = new Proxy({} as Record<string, unknown>, {
|
|
129
|
+
get: (_target, name) => {
|
|
130
|
+
if (typeof name !== 'string') return undefined
|
|
131
|
+
if (Object.hasOwn(options.state, name)) {
|
|
132
|
+
return wrap(options.state[name]!.get(), name, [], false)
|
|
133
|
+
}
|
|
134
|
+
if (Object.hasOwn(options.computed, name)) {
|
|
135
|
+
return wrap(options.computed[name]!(), name, [], true)
|
|
136
|
+
}
|
|
137
|
+
return undefined
|
|
138
|
+
},
|
|
139
|
+
set: (_target, name, value) =>
|
|
140
|
+
write(
|
|
141
|
+
String(name),
|
|
142
|
+
[],
|
|
143
|
+
value,
|
|
144
|
+
typeof name !== 'string' || !Object.hasOwn(options.state, name),
|
|
145
|
+
() => options.state[String(name)]!.set(value),
|
|
146
|
+
),
|
|
147
|
+
deleteProperty: (_target, name) => {
|
|
148
|
+
warn(String(name), true)
|
|
149
|
+
return true
|
|
150
|
+
},
|
|
151
|
+
defineProperty: (_target, name) => {
|
|
152
|
+
warn(String(name), true)
|
|
153
|
+
return false
|
|
154
|
+
},
|
|
155
|
+
has: (_target, name) =>
|
|
156
|
+
typeof name === 'string'
|
|
157
|
+
&& (Object.hasOwn(options.state, name) || Object.hasOwn(options.computed, name)),
|
|
158
|
+
})
|
|
159
|
+
const data = new Proxy({} as Record<string, unknown>, {
|
|
160
|
+
get: (_target, name) =>
|
|
161
|
+
typeof name === 'string' && Object.hasOwn(options.data ?? {}, name)
|
|
162
|
+
? wrap(options.data![name]!(), 'data.' + name, [], true)
|
|
163
|
+
: undefined,
|
|
164
|
+
set: (_target, name, value) => write('data.' + String(name), [], value, true, () => {}),
|
|
165
|
+
deleteProperty: (_target, name) => {
|
|
166
|
+
warn('data.' + String(name), true)
|
|
167
|
+
return true
|
|
168
|
+
},
|
|
169
|
+
defineProperty: (_target, name) => {
|
|
170
|
+
warn('data.' + String(name), true)
|
|
171
|
+
return false
|
|
172
|
+
},
|
|
173
|
+
has: (_target, name) => typeof name === 'string' && Object.hasOwn(options.data ?? {}, name),
|
|
174
|
+
})
|
|
175
|
+
return { state, data }
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function dispatchToTargets(recorded: unknown, send: (target: Element) => void): void {
|
|
179
|
+
const refs = recorded instanceof Set
|
|
180
|
+
? [...recorded]
|
|
181
|
+
: Array.isArray(recorded)
|
|
182
|
+
? [...recorded]
|
|
183
|
+
: [recorded]
|
|
184
|
+
const targets = refs.map((ref: any) => ref?.nodeType === 1 ? ref : ref?.$el)
|
|
185
|
+
.filter((element): element is Element => element?.nodeType === 1 && element.isConnected)
|
|
186
|
+
.sort((a, b) => a === b ? 0 : a.compareDocumentPosition(b) & 4 ? -1 : 1)
|
|
187
|
+
for (const target of targets) {
|
|
188
|
+
if (target.isConnected) send(target)
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
16
192
|
interface DataReadOptions {
|
|
17
193
|
readonly source: string
|
|
18
194
|
readonly definition: string
|
|
@@ -218,6 +394,7 @@ export interface ComponentHostOptions {
|
|
|
218
394
|
readonly data?: Readonly<Record<string, Readable<unknown>>>
|
|
219
395
|
/** Values inherited through declared context, which a controller reads. */
|
|
220
396
|
readonly context?: Readonly<Record<string, Readable<unknown>>>
|
|
397
|
+
readonly acceptsState?: (name: string, keys: readonly string[], value: unknown) => boolean
|
|
221
398
|
}
|
|
222
399
|
|
|
223
400
|
/** Vue does not promise a `v-for` ref array in source order, and the host does. */
|
|
@@ -300,16 +477,32 @@ export function useComponentHost(
|
|
|
300
477
|
throw controllerDiagnostic('HJ001', error)
|
|
301
478
|
})
|
|
302
479
|
const stops: Array<() => void> = []
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
:
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
480
|
+
const connected = shallowRef(false)
|
|
481
|
+
const pauses = new Map<() => void, () => void>()
|
|
482
|
+
const subscriptions = new Set<
|
|
483
|
+
{
|
|
484
|
+
type: string
|
|
485
|
+
callback: (event: Event) => void | (() => void)
|
|
486
|
+
target?: Element
|
|
487
|
+
cleanup?: void | (() => void)
|
|
488
|
+
}
|
|
489
|
+
>()
|
|
490
|
+
type Subscription = typeof subscriptions extends Set<infer S> ? S : never
|
|
491
|
+
const activate = (entry: Subscription): void => {
|
|
492
|
+
if (entry.type === 'connect') entry.cleanup = entry.callback(new Event('connect'))
|
|
493
|
+
else if (entry.type !== 'disconnect') {
|
|
494
|
+
entry.target = root.value ?? undefined
|
|
495
|
+
entry.target?.addEventListener(entry.type, entry.callback as EventListener)
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
const deactivate = (entry: Subscription, disconnecting: boolean): void => {
|
|
499
|
+
entry.target?.removeEventListener(entry.type, entry.callback as EventListener)
|
|
500
|
+
entry.target = undefined
|
|
501
|
+
const cleanup = entry.cleanup
|
|
502
|
+
entry.cleanup = undefined
|
|
503
|
+
cleanup?.()
|
|
504
|
+
if (disconnecting && entry.type === 'disconnect') entry.callback(new Event('disconnect'))
|
|
505
|
+
}
|
|
313
506
|
const propHandles = Object.create(null) as Record<string, unknown>
|
|
314
507
|
for (const name of propNames) {
|
|
315
508
|
const validity = () => options.propValidity?.(name)
|
|
@@ -333,20 +526,33 @@ export function useComponentHost(
|
|
|
333
526
|
get root(): Element {
|
|
334
527
|
return root.value as Element
|
|
335
528
|
},
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
529
|
+
...controllerNamespaces({
|
|
530
|
+
state: Object.fromEntries(
|
|
531
|
+
Object.entries(state).map(([name, value]) => [name, {
|
|
532
|
+
get: () => value.value,
|
|
533
|
+
set: (next: unknown) => {
|
|
534
|
+
value.value = next
|
|
535
|
+
},
|
|
536
|
+
}]),
|
|
537
|
+
),
|
|
538
|
+
computed: Object.fromEntries(
|
|
539
|
+
[...Object.entries(computedValues), ...Object.entries(context)].map((
|
|
540
|
+
[name, value],
|
|
541
|
+
) => [name, () => value.value]),
|
|
542
|
+
),
|
|
543
|
+
data: Object.fromEntries(
|
|
544
|
+
Object.entries(data).map(([name, value]) => [name, () => value.value]),
|
|
545
|
+
),
|
|
546
|
+
acceptsState: options.acceptsState,
|
|
547
|
+
}, options.controllerSource?.definition ?? '<component>'),
|
|
548
|
+
on(type: string, callback: (event: Event) => void | (() => void)): () => void {
|
|
549
|
+
const entry: Subscription = { type, callback }
|
|
550
|
+
subscriptions.add(entry)
|
|
551
|
+
if (connected.value) activate(entry)
|
|
552
|
+
return () => {
|
|
553
|
+
if (subscriptions.delete(entry)) deactivate(entry, false)
|
|
554
|
+
}
|
|
555
|
+
},
|
|
350
556
|
props: Object.freeze(propHandles),
|
|
351
557
|
refs: Object.defineProperties(
|
|
352
558
|
{},
|
|
@@ -383,12 +589,24 @@ export function useComponentHost(
|
|
|
383
589
|
return { get: (): T => value.value }
|
|
384
590
|
},
|
|
385
591
|
effect(run: () => void | (() => void)): () => void {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
592
|
+
let cleanup: void | (() => void)
|
|
593
|
+
const pause = (): void => {
|
|
594
|
+
const previous = cleanup
|
|
595
|
+
cleanup = undefined
|
|
596
|
+
previous?.()
|
|
597
|
+
}
|
|
598
|
+
const stop = watchEffect(() => {
|
|
599
|
+
pause()
|
|
600
|
+
if (connected.value) cleanup = run()
|
|
389
601
|
}, { flush: 'post' })
|
|
390
|
-
|
|
391
|
-
|
|
602
|
+
const dispose = (): void => {
|
|
603
|
+
stop()
|
|
604
|
+
pause()
|
|
605
|
+
pauses.delete(dispose)
|
|
606
|
+
}
|
|
607
|
+
pauses.set(dispose, pause)
|
|
608
|
+
stops.push(dispose)
|
|
609
|
+
return dispose
|
|
392
610
|
},
|
|
393
611
|
dispatch,
|
|
394
612
|
}
|
|
@@ -397,13 +615,14 @@ export function useComponentHost(
|
|
|
397
615
|
let started: Promise<ControllerModule> | undefined
|
|
398
616
|
let stopObserving: (() => void) | undefined
|
|
399
617
|
let connection = 0
|
|
400
|
-
let
|
|
618
|
+
let initialized = false
|
|
401
619
|
let unmounted = false
|
|
402
620
|
const disconnect = (): void => {
|
|
403
|
-
if (!connected) return
|
|
404
|
-
connected = false
|
|
621
|
+
if (!connected.value) return
|
|
622
|
+
connected.value = false
|
|
405
623
|
connection += 1
|
|
406
|
-
for (const
|
|
624
|
+
for (const pause of pauses.values()) pause()
|
|
625
|
+
for (const entry of subscriptions) deactivate(entry, true)
|
|
407
626
|
cleanup?.()
|
|
408
627
|
cleanup = undefined
|
|
409
628
|
}
|
|
@@ -413,14 +632,27 @@ export function useComponentHost(
|
|
|
413
632
|
disconnect()
|
|
414
633
|
return
|
|
415
634
|
}
|
|
416
|
-
if (connected)
|
|
417
|
-
|
|
635
|
+
if (connected.value) {
|
|
636
|
+
for (const entry of subscriptions) {
|
|
637
|
+
if (
|
|
638
|
+
entry.type !== 'connect' && entry.type !== 'disconnect' && entry.target !== root.value
|
|
639
|
+
) {
|
|
640
|
+
deactivate(entry, false)
|
|
641
|
+
activate(entry)
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
return
|
|
645
|
+
}
|
|
646
|
+
connected.value = true
|
|
647
|
+
for (const entry of subscriptions) activate(entry)
|
|
648
|
+
if (initialized) return
|
|
418
649
|
const current = ++connection
|
|
419
650
|
started = loadControllerModule().then(async (loaded) => {
|
|
420
|
-
if (!connected || current !== connection) return loaded
|
|
651
|
+
if (!connected.value || current !== connection || initialized) return loaded
|
|
652
|
+
initialized = true
|
|
421
653
|
const result = await loaded.default(host as never)
|
|
422
654
|
if (typeof result === 'function') {
|
|
423
|
-
if (!connected || current !== connection) result()
|
|
655
|
+
if (!connected.value || current !== connection) result()
|
|
424
656
|
else cleanup = result as () => void
|
|
425
657
|
}
|
|
426
658
|
return loaded
|
|
@@ -443,9 +675,10 @@ export function useComponentHost(
|
|
|
443
675
|
unmounted = true
|
|
444
676
|
stopObserving?.()
|
|
445
677
|
disconnect()
|
|
678
|
+
for (const stop of stops.splice(0)) stop()
|
|
679
|
+
subscriptions.clear()
|
|
446
680
|
})
|
|
447
|
-
|
|
448
|
-
return { host, ready: (): Promise<ControllerModule> | undefined => started }
|
|
681
|
+
return host
|
|
449
682
|
}
|
|
450
683
|
|
|
451
684
|
export interface DispatchOptions {
|
|
@@ -514,13 +747,13 @@ export function createDispatch(
|
|
|
514
747
|
root: Readable<HTMLElement | null>,
|
|
515
748
|
emit?: (name: string, detail: unknown) => void,
|
|
516
749
|
options: DispatchOptions = {},
|
|
517
|
-
): (name: string, detail?: unknown) => boolean {
|
|
750
|
+
): (name: string, detail?: unknown, targets?: unknown) => boolean {
|
|
518
751
|
const { declared = {}, checks = {}, modeled = [] } = options
|
|
519
752
|
// One change can be reported by more than one event — a choice is both a select and a change —
|
|
520
753
|
// and each carries the new value. The prop updates once per change: a value already reported in
|
|
521
754
|
// this turn of the event loop is not reported again.
|
|
522
755
|
const reported = new Map<string, unknown>()
|
|
523
|
-
return (name, detail) => {
|
|
756
|
+
return (name, detail, targets) => {
|
|
524
757
|
const check = checks[name]
|
|
525
758
|
if (detail !== undefined && check !== undefined && !check(detail)) {
|
|
526
759
|
throw new HtmlDiagnosticError(
|
|
@@ -528,6 +761,17 @@ export function createDispatch(
|
|
|
528
761
|
`Event \`${name}\` detail does not satisfy its declared type.`,
|
|
529
762
|
)
|
|
530
763
|
}
|
|
764
|
+
if (targets !== undefined) {
|
|
765
|
+
let accepted = true
|
|
766
|
+
dispatchToTargets(targets, target => {
|
|
767
|
+
if (
|
|
768
|
+
!target.dispatchEvent(
|
|
769
|
+
new CustomEvent(name, { bubbles: true, composed: true, ...declared[name], detail }),
|
|
770
|
+
)
|
|
771
|
+
) accepted = false
|
|
772
|
+
})
|
|
773
|
+
return accepted
|
|
774
|
+
}
|
|
531
775
|
if (detail !== null && typeof detail === 'object') {
|
|
532
776
|
for (const prop of modeled) {
|
|
533
777
|
if (!(prop in detail)) continue
|