@threadlabs/looma 0.28.19 → 0.28.21
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 +9 -10
- package/components/ui-editor-image-toolbar/ui-editor-image-toolbar.js +6 -8
- package/components/ui-editor-link-form/ui-editor-link-form.html +2 -3
- package/dist/index.js +10 -8
- package/editor/chunks/extensions.js +199 -142
- package/editor/extensions/task-item.d.ts +7 -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 +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 -1
- package/vanilla/UiCombobox.js +1 -1
- 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/UiEditorBlockActions.d.ts +1 -1
- package/vanilla/UiEditorBlockActions.js +1 -1
- package/vanilla/UiEditorChipEditor.d.ts +1 -1
- package/vanilla/UiEditorChipEditor.js +1 -1
- package/vanilla/UiEditorCodeLanguage.d.ts +1 -1
- package/vanilla/UiEditorCodeLanguage.js +2 -2
- package/vanilla/UiEditorImageToolbar.d.ts +1 -1
- package/vanilla/UiEditorImageToolbar.js +4 -2
- package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
- package/vanilla/UiEditorInsertTableGrid.js +1 -1
- package/vanilla/UiEditorLinkCard.d.ts +1 -1
- package/vanilla/UiEditorLinkCard.js +1 -1
- package/vanilla/UiEditorLinkForm.d.ts +1 -1
- package/vanilla/UiEditorLinkForm.js +2 -2
- 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/UiEditorSurface.d.ts +1 -1
- package/vanilla/UiEditorSurface.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 +1 -1
- package/vanilla/UiInput.js +1 -1
- 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/UiSwatch.d.ts +1 -1
- package/vanilla/UiSwatch.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 +1 -1
- package/vanilla/UiToastRegion.js +1 -1
- 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 +1 -1
- package/vue/UiAvatar.vue +1 -1
- package/vue/UiAvatarGroup.vue +1 -1
- 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.vue +1 -1
- package/vue/UiCluster.vue +1 -1
- package/vue/UiCombobox.vue +1 -1
- 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 +1 -1
- package/vue/UiDisclosure.vue +1 -1
- package/vue/UiEditable.vue +1 -1
- package/vue/UiEditorBlockActions.vue +1 -1
- package/vue/UiEditorChipEditor.vue +1 -1
- package/vue/UiEditorCodeLanguage.d.ts +2 -2
- package/vue/UiEditorCodeLanguage.vue +4 -5
- package/vue/UiEditorImageToolbar.vue +13 -10
- package/vue/UiEditorInsertTableGrid.vue +1 -1
- package/vue/UiEditorLinkCard.vue +1 -1
- package/vue/UiEditorLinkForm.d.ts +2 -2
- package/vue/UiEditorLinkForm.vue +4 -5
- package/vue/UiEditorMentionMenu.vue +1 -1
- package/vue/UiEditorMentionMenuItem.vue +1 -1
- package/vue/UiEditorSlashMenu.vue +1 -1
- package/vue/UiEditorSlashMenuGroup.vue +1 -1
- package/vue/UiEditorSlashMenuItem.vue +1 -1
- package/vue/UiEditorSurface.vue +1 -1
- package/vue/UiEditorTableContextMenu.vue +1 -1
- package/vue/UiEditorTableOverlay.vue +1 -1
- package/vue/UiEditorTableToolbar.vue +1 -1
- package/vue/UiEditorToolbar.vue +1 -1
- 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 +1 -1
- package/vue/UiInput.vue +1 -1
- package/vue/UiInputGroup.vue +1 -1
- package/vue/UiList.vue +1 -1
- package/vue/UiListItem.vue +1 -1
- package/vue/UiListbox.vue +1 -1
- package/vue/UiMenu.vue +1 -1
- package/vue/UiMenuGroup.vue +1 -1
- package/vue/UiMenuItem.vue +1 -1
- package/vue/UiMeter.vue +1 -1
- package/vue/UiNavItem.vue +1 -1
- package/vue/UiPageHeader.vue +1 -1
- package/vue/UiPopover.vue +1 -1
- package/vue/UiRadio.vue +1 -1
- package/vue/UiRadioGroup.vue +1 -1
- package/vue/UiReel.vue +1 -1
- package/vue/UiScrollArea.vue +1 -1
- package/vue/UiSearchResultRow.vue +1 -1
- package/vue/UiSearchShell.vue +1 -1
- package/vue/UiSection.vue +1 -1
- 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 +1 -1
- package/vue/UiSwatch.vue +1 -1
- package/vue/UiSwitch.vue +1 -1
- package/vue/UiSwitcher.vue +1 -1
- package/vue/UiTable.vue +1 -1
- package/vue/UiTabs.vue +1 -1
- package/vue/UiText.vue +1 -1
- package/vue/UiTextarea.vue +1 -1
- package/vue/UiToast.vue +1 -1
- package/vue/UiToastRegion.vue +1 -1
- package/vue/UiTooltip.vue +1 -1
- package/vue/UiTopBar.vue +1 -1
- package/vue/UiTree.vue +1 -1
- package/vue/UiTreeItem.vue +1 -1
- package/vue/chunks/UiActionBar.js +1 -1
- package/vue/chunks/UiAffordanceScope.js +1 -1
- package/vue/chunks/UiAvatar.js +1 -1
- package/vue/chunks/UiAvatarGroup.js +1 -1
- package/vue/chunks/UiBadge.js +1 -1
- package/vue/chunks/UiBreadcrumbItem.js +1 -1
- package/vue/chunks/UiBreadcrumbs.js +1 -1
- package/vue/chunks/UiButton.js +1 -1
- package/vue/chunks/UiCallout.js +1 -1
- package/vue/chunks/UiCard.js +1 -1
- package/vue/chunks/UiCheckbox.js +1 -1
- package/vue/chunks/UiCluster.js +1 -1
- package/vue/chunks/UiCombobox.js +1 -1
- 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 +1 -1
- package/vue/chunks/UiDisclosure.js +1 -1
- package/vue/chunks/UiEditable.js +1 -1
- package/vue/chunks/UiEditorCodeLanguage.js +3 -4
- package/vue/chunks/UiEditorImageToolbar.js +19 -11
- package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
- package/vue/chunks/UiEditorLinkForm.js +3 -4
- package/vue/chunks/UiEditorMentionMenu.js +1 -1
- package/vue/chunks/UiEditorMentionMenuItem.js +1 -1
- package/vue/chunks/UiEditorSlashMenu.js +1 -1
- package/vue/chunks/UiEditorSlashMenuGroup.js +1 -1
- package/vue/chunks/UiEditorSlashMenuItem.js +1 -1
- package/vue/chunks/UiEditorSurface.js +1 -1
- package/vue/chunks/UiEditorTableContextMenu.js +1 -1
- package/vue/chunks/UiEditorTableOverlay.js +1 -1
- package/vue/chunks/UiEditorTableToolbar.js +1 -1
- package/vue/chunks/UiEditorToolbar.js +1 -1
- package/vue/chunks/UiFloatingActionButton.js +1 -1
- package/vue/chunks/UiFormField.js +1 -1
- package/vue/chunks/UiGrid.js +1 -1
- package/vue/chunks/UiIcon.js +1 -1
- package/vue/chunks/UiIconButton.js +1 -1
- package/vue/chunks/UiImage.js +1 -1
- package/vue/chunks/UiInput.js +1 -1
- package/vue/chunks/UiInputGroup.js +1 -1
- package/vue/chunks/UiList.js +1 -1
- package/vue/chunks/UiListItem.js +1 -1
- package/vue/chunks/UiListbox.js +1 -1
- package/vue/chunks/UiMenu.js +1 -1
- package/vue/chunks/UiMenuGroup.js +1 -1
- package/vue/chunks/UiMenuItem.js +1 -1
- package/vue/chunks/UiMeter.js +1 -1
- package/vue/chunks/UiNavItem.js +1 -1
- package/vue/chunks/UiPageHeader.js +1 -1
- package/vue/chunks/UiPopover.js +1 -1
- package/vue/chunks/UiRadio.js +1 -1
- 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 +1 -1
- package/vue/chunks/UiSearchShell.js +1 -1
- package/vue/chunks/UiSection.js +1 -1
- 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 +1 -1
- package/vue/chunks/UiSwatch.js +1 -1
- package/vue/chunks/UiSwitch.js +1 -1
- package/vue/chunks/UiSwitcher.js +1 -1
- package/vue/chunks/UiTable.js +1 -1
- package/vue/chunks/UiTabs.js +1 -1
- 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 +1 -1
- package/vue/chunks/UiTooltip.js +1 -1
- package/vue/chunks/UiTopBar.js +1 -1
- package/vue/chunks/UiTree.js +1 -1
- package/vue/chunks/UiTreeItem.js +1 -1
- package/vue/chunks/_plugin-vue_export-helper.js +63 -5
- package/vue/components.css +20 -20
- package/vue/host.ts +109 -4
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.53 for Vue 3.5. Do not edit.
|
|
2
2
|
import {
|
|
3
3
|
computed,
|
|
4
4
|
createTextVNode,
|
|
@@ -202,6 +202,58 @@ function controllerNamespaces(options: ControllerNamespaces, source: string): {
|
|
|
202
202
|
return { state, data }
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
const requestStateKey = Symbol.for('@nextwebwg/html-next.runtime.v1')
|
|
206
|
+
type DocumentRecord = {
|
|
207
|
+
requests?: { readonly g: WeakMap<Node, Promise<void>> }
|
|
208
|
+
relay?: (from: Node, name: string) => void
|
|
209
|
+
}
|
|
210
|
+
const documentRecord = (root: Element): DocumentRecord =>
|
|
211
|
+
(root.ownerDocument as unknown as Record<symbol, DocumentRecord>)[requestStateKey] ??= {}
|
|
212
|
+
|
|
213
|
+
/** Requests from inside root wait until its controller has run; the returned release ends the wait. */
|
|
214
|
+
function holdController(root: Element): () => void {
|
|
215
|
+
const { g: gates } = documentRecord(root).requests ??= { g: new WeakMap() }
|
|
216
|
+
let release!: () => void
|
|
217
|
+
const gate = new Promise<void>((resolve) => {
|
|
218
|
+
release = resolve
|
|
219
|
+
})
|
|
220
|
+
gates.set(root, gate)
|
|
221
|
+
return () => {
|
|
222
|
+
if (gates.get(root) === gate) gates.delete(root)
|
|
223
|
+
release()
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/** A responder registered on root relays to the requests inside it that went unanswered, once a page asks. */
|
|
228
|
+
function relayResponders(root: Element, name: string): void {
|
|
229
|
+
documentRecord(root).relay?.(root, name)
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/** For a component that asks: a responder announcement reaches its controller only as the relay to its root, which does not bubble. */
|
|
233
|
+
function hostListener(type: string, callback: (event: Event) => unknown): (event: Event) => void {
|
|
234
|
+
return (event) => {
|
|
235
|
+
if (type !== 'responder' || !event.bubbles) callback(event)
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/** The connection signal requests use: it aborts when the component disconnects. */
|
|
240
|
+
function requestConnection(): {
|
|
241
|
+
readonly signal: (connected: boolean) => AbortSignal
|
|
242
|
+
readonly end: () => void
|
|
243
|
+
} {
|
|
244
|
+
let current: AbortController | undefined
|
|
245
|
+
return {
|
|
246
|
+
signal: (connected) =>
|
|
247
|
+
connected
|
|
248
|
+
? (current ??= new AbortController()).signal
|
|
249
|
+
: AbortSignal.abort(new DOMException('The component is not connected.', 'AbortError')),
|
|
250
|
+
end: () => {
|
|
251
|
+
current?.abort()
|
|
252
|
+
current = undefined
|
|
253
|
+
},
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
205
257
|
export function dispatchToTargets(recorded: unknown, send: (target: Element) => void): void {
|
|
206
258
|
const refs = recorded instanceof Set
|
|
207
259
|
? [...recorded]
|
|
@@ -484,6 +536,16 @@ export interface ComponentHostOptions {
|
|
|
484
536
|
/** Values inherited through declared context, which a controller reads. */
|
|
485
537
|
readonly context?: Readonly<Record<string, Readable<unknown>>>
|
|
486
538
|
readonly acceptsState?: (name: string, keys: readonly string[], value: unknown) => boolean
|
|
539
|
+
/** Asks one of the component's declared requests. */
|
|
540
|
+
request?(
|
|
541
|
+
root: Element,
|
|
542
|
+
connection: AbortSignal,
|
|
543
|
+
name: string,
|
|
544
|
+
detail?: unknown,
|
|
545
|
+
options?: unknown,
|
|
546
|
+
): Promise<unknown>
|
|
547
|
+
/** Each declared request's responder, from its function prop or event form, read when the request arrives. */
|
|
548
|
+
readonly responders?: Readonly<Record<string, () => ((event: Event) => void) | undefined>>
|
|
487
549
|
}
|
|
488
550
|
|
|
489
551
|
/** Vue does not promise a `v-for` ref array in source order, and the host does. */
|
|
@@ -582,6 +644,8 @@ export function useComponentHost(
|
|
|
582
644
|
else if (entry.type !== 'disconnect') {
|
|
583
645
|
entry.target = root.value ?? undefined
|
|
584
646
|
entry.target?.addEventListener(entry.type, entry.callback as EventListener)
|
|
647
|
+
// A responder registered after a request went unanswered tells the asker to ask again.
|
|
648
|
+
if (entry.target !== undefined) relayResponders(entry.target, entry.type)
|
|
585
649
|
}
|
|
586
650
|
}
|
|
587
651
|
const deactivate = (entry: Subscription, disconnecting: boolean): void => {
|
|
@@ -637,7 +701,12 @@ export function useComponentHost(
|
|
|
637
701
|
...(options.acceptsState === undefined ? {} : { acceptsState: options.acceptsState }),
|
|
638
702
|
}, options.controllerSource?.definition ?? '<component>'),
|
|
639
703
|
on(type: string, callback: (event: Event) => void | (() => void)): () => void {
|
|
640
|
-
const entry: Subscription = {
|
|
704
|
+
const entry: Subscription = {
|
|
705
|
+
type,
|
|
706
|
+
callback: type === 'connect' || type === 'disconnect' || options.request === undefined
|
|
707
|
+
? callback
|
|
708
|
+
: hostListener(type, callback),
|
|
709
|
+
}
|
|
641
710
|
subscriptions.add(entry)
|
|
642
711
|
if (connected.value) activate(entry)
|
|
643
712
|
return () => {
|
|
@@ -703,6 +772,31 @@ export function useComponentHost(
|
|
|
703
772
|
return dispose
|
|
704
773
|
},
|
|
705
774
|
dispatch,
|
|
775
|
+
// A component that declares requests also has host.request.
|
|
776
|
+
...(options.request === undefined ? {} : {
|
|
777
|
+
request: (name: string, detail?: unknown, requestOptions?: unknown): Promise<unknown> =>
|
|
778
|
+
options.request!(
|
|
779
|
+
root.value as Element,
|
|
780
|
+
requests.signal(connected.value),
|
|
781
|
+
name,
|
|
782
|
+
detail,
|
|
783
|
+
requestOptions,
|
|
784
|
+
),
|
|
785
|
+
}),
|
|
786
|
+
}
|
|
787
|
+
const requests = requestConnection()
|
|
788
|
+
// Each request's responder listens on the root from its first connection, before the controller runs.
|
|
789
|
+
const responders = Object.entries(options.responders ?? {})
|
|
790
|
+
for (const [name, read] of responders) host.on(name, (event) => read()?.(event))
|
|
791
|
+
// A function prop or event form set later relays for its request, as a late host.on does.
|
|
792
|
+
if (responders.length > 0) {
|
|
793
|
+
watch(() => responders.map(([, read]) => read() !== undefined), (now, before) => {
|
|
794
|
+
const element = root.value
|
|
795
|
+
if (element === null || !connected.value) return
|
|
796
|
+
now.forEach((set, index) => {
|
|
797
|
+
if (set && !before[index]) relayResponders(element, responders[index]![0])
|
|
798
|
+
})
|
|
799
|
+
})
|
|
706
800
|
}
|
|
707
801
|
|
|
708
802
|
let cleanup: void | (() => void)
|
|
@@ -711,10 +805,13 @@ export function useComponentHost(
|
|
|
711
805
|
let connection = 0
|
|
712
806
|
let initialized = false
|
|
713
807
|
let unmounted = false
|
|
808
|
+
let releaseController: (() => void) | undefined
|
|
714
809
|
const disconnect = (): void => {
|
|
715
810
|
if (!connected.value) return
|
|
716
811
|
connected.value = false
|
|
717
812
|
connection += 1
|
|
813
|
+
requests.end()
|
|
814
|
+
releaseController?.()
|
|
718
815
|
for (const pause of pauses.values()) pause()
|
|
719
816
|
for (const entry of subscriptions) deactivate(entry, true)
|
|
720
817
|
cleanup?.()
|
|
@@ -741,17 +838,25 @@ export function useComponentHost(
|
|
|
741
838
|
for (const entry of subscriptions) activate(entry)
|
|
742
839
|
if (initialized) return
|
|
743
840
|
const current = ++connection
|
|
841
|
+
// Requests from inside this root wait until the controller has run, or failed to load.
|
|
842
|
+
const release = releaseController = holdController(root.value!)
|
|
744
843
|
started = loadControllerModule().then(async (loaded) => {
|
|
745
844
|
if (!connected.value || current !== connection || initialized) return loaded
|
|
746
845
|
initialized = true
|
|
747
|
-
|
|
846
|
+
let invoked: unknown
|
|
847
|
+
try {
|
|
848
|
+
invoked = loaded.default(host as never)
|
|
849
|
+
} finally {
|
|
850
|
+
release()
|
|
851
|
+
}
|
|
852
|
+
const result = await invoked
|
|
748
853
|
if (typeof result === 'function') {
|
|
749
854
|
if (!connected.value || current !== connection) result()
|
|
750
855
|
else cleanup = result as () => void
|
|
751
856
|
}
|
|
752
857
|
return loaded
|
|
753
858
|
})
|
|
754
|
-
void started.catch(report)
|
|
859
|
+
void started.catch(report).finally(release)
|
|
755
860
|
}
|
|
756
861
|
onMounted(() => {
|
|
757
862
|
if (root.value === null) return
|