@threadlabs/looma 0.30.2 → 0.30.4
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-combobox/ui-combobox.html +10 -10
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +2 -4
- package/components/ui-image/ui-image.html +2 -2
- package/components/ui-listbox/ui-listbox.html +1 -1
- package/components/ui-tree-item/ui-tree-item.html +4 -2
- package/dist/index.js +5 -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 +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 +4 -4
- package/vanilla/UiAvatar.d.ts +1 -1
- package/vanilla/UiAvatar.js +4 -4
- 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 +3 -3
- package/vanilla/UiButton.d.ts +1 -1
- package/vanilla/UiButton.js +6 -6
- package/vanilla/UiCallout.d.ts +1 -1
- package/vanilla/UiCallout.js +4 -4
- package/vanilla/UiCard.d.ts +1 -1
- package/vanilla/UiCard.js +6 -6
- package/vanilla/UiCheckbox.d.ts +1 -1
- package/vanilla/UiCheckbox.js +4 -4
- package/vanilla/UiCluster.d.ts +1 -1
- package/vanilla/UiCluster.js +4 -4
- package/vanilla/UiCombobox.d.ts +12 -12
- package/vanilla/UiCombobox.js +12 -10
- package/vanilla/UiContainer.d.ts +1 -1
- package/vanilla/UiContainer.js +4 -4
- package/vanilla/UiContextMenu.d.ts +2 -2
- package/vanilla/UiContextMenu.js +3 -3
- package/vanilla/UiCover.d.ts +1 -1
- package/vanilla/UiCover.js +4 -4
- package/vanilla/UiDescriptionItem.d.ts +1 -1
- package/vanilla/UiDescriptionItem.js +3 -3
- package/vanilla/UiDescriptionList.d.ts +1 -1
- package/vanilla/UiDescriptionList.js +4 -4
- package/vanilla/UiDialog.d.ts +1 -1
- package/vanilla/UiDialog.js +4 -4
- package/vanilla/UiDisclosure.d.ts +1 -1
- package/vanilla/UiDisclosure.js +4 -4
- package/vanilla/UiEditable.d.ts +1 -1
- package/vanilla/UiEditable.js +3 -3
- package/vanilla/UiEditorBlockActions.d.ts +1 -1
- package/vanilla/UiEditorBlockActions.js +4 -4
- package/vanilla/UiEditorChipEditor.d.ts +1 -1
- package/vanilla/UiEditorChipEditor.js +4 -4
- package/vanilla/UiEditorCodeLanguage.d.ts +1 -1
- package/vanilla/UiEditorCodeLanguage.js +3 -3
- package/vanilla/UiEditorImageToolbar.d.ts +1 -1
- package/vanilla/UiEditorImageToolbar.js +4 -4
- package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
- package/vanilla/UiEditorInsertTableGrid.js +3 -3
- package/vanilla/UiEditorLinkCard.d.ts +1 -1
- package/vanilla/UiEditorLinkCard.js +8 -6
- package/vanilla/UiEditorLinkForm.d.ts +2 -2
- package/vanilla/UiEditorLinkForm.js +9 -7
- package/vanilla/UiEditorMentionMenu.d.ts +3 -3
- package/vanilla/UiEditorMentionMenu.js +3 -3
- package/vanilla/UiEditorMentionMenuItem.d.ts +1 -1
- package/vanilla/UiEditorMentionMenuItem.js +3 -3
- package/vanilla/UiEditorSlashMenu.d.ts +3 -3
- package/vanilla/UiEditorSlashMenu.js +3 -3
- package/vanilla/UiEditorSlashMenuGroup.d.ts +1 -1
- package/vanilla/UiEditorSlashMenuGroup.js +3 -3
- package/vanilla/UiEditorSlashMenuItem.d.ts +1 -1
- package/vanilla/UiEditorSlashMenuItem.js +3 -3
- package/vanilla/UiEditorSurface.d.ts +1 -1
- package/vanilla/UiEditorSurface.js +4 -4
- package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
- package/vanilla/UiEditorTableContextMenu.js +4 -4
- package/vanilla/UiEditorTableOverlay.d.ts +2 -2
- package/vanilla/UiEditorTableOverlay.js +4 -4
- package/vanilla/UiEditorTableToolbar.d.ts +1 -1
- package/vanilla/UiEditorTableToolbar.js +4 -4
- package/vanilla/UiEditorToolbar.d.ts +1 -1
- package/vanilla/UiEditorToolbar.js +3 -3
- package/vanilla/UiFloatingActionButton.d.ts +1 -1
- package/vanilla/UiFloatingActionButton.js +3 -3
- package/vanilla/UiFormField.d.ts +1 -1
- package/vanilla/UiFormField.js +3 -3
- package/vanilla/UiGrid.d.ts +1 -1
- package/vanilla/UiGrid.js +4 -4
- package/vanilla/UiIcon.d.ts +1 -1
- package/vanilla/UiIcon.js +9 -7
- package/vanilla/UiIconButton.d.ts +1 -1
- package/vanilla/UiIconButton.js +4 -4
- package/vanilla/UiImage.d.ts +1 -1
- package/vanilla/UiImage.js +4 -4
- package/vanilla/UiInput.d.ts +1 -1
- package/vanilla/UiInput.js +4 -4
- package/vanilla/UiInputGroup.d.ts +1 -1
- package/vanilla/UiInputGroup.js +4 -4
- package/vanilla/UiList.d.ts +1 -1
- package/vanilla/UiList.js +6 -6
- package/vanilla/UiListItem.d.ts +1 -1
- package/vanilla/UiListItem.js +4 -4
- package/vanilla/UiListbox.d.ts +2 -2
- package/vanilla/UiListbox.js +3 -3
- package/vanilla/UiMenu.d.ts +2 -2
- package/vanilla/UiMenu.js +4 -4
- package/vanilla/UiMenuGroup.d.ts +1 -1
- package/vanilla/UiMenuGroup.js +3 -3
- package/vanilla/UiMenuItem.d.ts +1 -1
- package/vanilla/UiMenuItem.js +6 -6
- package/vanilla/UiMeter.d.ts +1 -1
- package/vanilla/UiMeter.js +9 -7
- package/vanilla/UiNavItem.d.ts +1 -1
- package/vanilla/UiNavItem.js +6 -6
- package/vanilla/UiPageHeader.d.ts +1 -1
- package/vanilla/UiPageHeader.js +4 -4
- package/vanilla/UiPopover.d.ts +1 -1
- package/vanilla/UiPopover.js +4 -4
- package/vanilla/UiRadio.d.ts +1 -1
- package/vanilla/UiRadio.js +4 -4
- package/vanilla/UiRadioGroup.d.ts +1 -1
- package/vanilla/UiRadioGroup.js +4 -4
- package/vanilla/UiReel.d.ts +1 -1
- package/vanilla/UiReel.js +4 -4
- package/vanilla/UiScrollArea.d.ts +1 -1
- package/vanilla/UiScrollArea.js +4 -4
- package/vanilla/UiSearchResultRow.d.ts +1 -1
- package/vanilla/UiSearchResultRow.js +4 -4
- package/vanilla/UiSearchShell.d.ts +1 -1
- package/vanilla/UiSearchShell.js +3 -3
- package/vanilla/UiSection.d.ts +1 -1
- package/vanilla/UiSection.js +4 -4
- package/vanilla/UiSelect.d.ts +1 -1
- package/vanilla/UiSelect.js +4 -4
- package/vanilla/UiSeparator.d.ts +1 -1
- package/vanilla/UiSeparator.js +4 -4
- package/vanilla/UiSidebar.d.ts +1 -1
- package/vanilla/UiSidebar.js +4 -4
- package/vanilla/UiSpinner.d.ts +1 -1
- package/vanilla/UiSpinner.js +4 -4
- package/vanilla/UiStack.d.ts +1 -1
- package/vanilla/UiStack.js +4 -4
- package/vanilla/UiStatusMessage.d.ts +1 -1
- package/vanilla/UiStatusMessage.js +4 -4
- package/vanilla/UiSwatch.d.ts +1 -1
- package/vanilla/UiSwatch.js +9 -7
- package/vanilla/UiSwitch.d.ts +1 -1
- package/vanilla/UiSwitch.js +4 -4
- package/vanilla/UiSwitcher.d.ts +1 -1
- package/vanilla/UiSwitcher.js +4 -4
- package/vanilla/UiTable.d.ts +1 -1
- package/vanilla/UiTable.js +4 -4
- package/vanilla/UiTabs.d.ts +1 -1
- package/vanilla/UiTabs.js +4 -4
- package/vanilla/UiText.d.ts +1 -1
- package/vanilla/UiText.js +6 -6
- package/vanilla/UiTextarea.d.ts +1 -1
- package/vanilla/UiTextarea.js +4 -4
- package/vanilla/UiToast.d.ts +1 -1
- package/vanilla/UiToast.js +4 -4
- package/vanilla/UiToastRegion.d.ts +2 -2
- package/vanilla/UiToastRegion.js +4 -4
- package/vanilla/UiTooltip.d.ts +1 -1
- package/vanilla/UiTooltip.js +4 -4
- package/vanilla/UiTopBar.d.ts +1 -1
- package/vanilla/UiTopBar.js +1 -1
- package/vanilla/UiTree.d.ts +1 -1
- package/vanilla/UiTree.js +4 -4
- package/vanilla/UiTreeItem.d.ts +1 -1
- package/vanilla/UiTreeItem.js +35 -23
- package/vue/UiActionBar.vue +1 -1
- package/vue/UiAffordanceScope.d.ts +8 -8
- package/vue/UiAffordanceScope.vue +57 -20
- package/vue/UiAvatar.d.ts +9 -27
- package/vue/UiAvatar.vue +100 -68
- package/vue/UiAvatarGroup.d.ts +9 -18
- package/vue/UiAvatarGroup.vue +73 -44
- package/vue/UiBadge.d.ts +9 -15
- package/vue/UiBadge.vue +67 -39
- package/vue/UiBreadcrumbItem.d.ts +8 -5
- package/vue/UiBreadcrumbItem.vue +45 -12
- package/vue/UiBreadcrumbs.d.ts +8 -5
- package/vue/UiBreadcrumbs.vue +45 -12
- package/vue/UiButton.d.ts +9 -45
- package/vue/UiButton.vue +148 -119
- package/vue/UiCallout.d.ts +8 -8
- package/vue/UiCallout.vue +68 -25
- package/vue/UiCard.d.ts +8 -17
- package/vue/UiCard.vue +77 -53
- package/vue/UiCheckbox.d.ts +8 -29
- package/vue/UiCheckbox.vue +118 -76
- package/vue/UiCluster.d.ts +9 -24
- package/vue/UiCluster.vue +91 -66
- package/vue/UiCombobox.d.ts +135 -219
- package/vue/UiCombobox.vue +528 -496
- package/vue/UiContainer.d.ts +8 -11
- package/vue/UiContainer.vue +61 -28
- package/vue/UiContextMenu.d.ts +10 -10
- package/vue/UiContextMenu.vue +55 -22
- package/vue/UiCover.d.ts +8 -5
- package/vue/UiCover.vue +45 -12
- package/vue/UiDescriptionItem.d.ts +8 -5
- package/vue/UiDescriptionItem.vue +40 -12
- package/vue/UiDescriptionList.d.ts +8 -11
- package/vue/UiDescriptionList.vue +61 -34
- package/vue/UiDialog.d.ts +8 -26
- package/vue/UiDialog.vue +99 -74
- package/vue/UiDisclosure.d.ts +8 -29
- package/vue/UiDisclosure.vue +118 -79
- package/vue/UiEditable.d.ts +8 -35
- package/vue/UiEditable.vue +136 -92
- package/vue/UiEditorBlockActions.d.ts +8 -8
- package/vue/UiEditorBlockActions.vue +58 -23
- package/vue/UiEditorChipEditor.d.ts +8 -8
- package/vue/UiEditorChipEditor.vue +65 -20
- package/vue/UiEditorCodeLanguage.d.ts +8 -11
- package/vue/UiEditorCodeLanguage.vue +74 -31
- package/vue/UiEditorImageToolbar.d.ts +8 -11
- package/vue/UiEditorImageToolbar.vue +175 -144
- package/vue/UiEditorInsertTableGrid.d.ts +8 -14
- package/vue/UiEditorInsertTableGrid.vue +73 -36
- package/vue/UiEditorLinkCard.d.ts +8 -17
- package/vue/UiEditorLinkCard.vue +157 -90
- package/vue/UiEditorLinkForm.d.ts +10 -44
- package/vue/UiEditorLinkForm.vue +336 -228
- package/vue/UiEditorMentionMenu.d.ts +28 -60
- package/vue/UiEditorMentionMenu.vue +166 -121
- package/vue/UiEditorMentionMenuItem.d.ts +8 -11
- package/vue/UiEditorMentionMenuItem.vue +61 -28
- package/vue/UiEditorSlashMenu.d.ts +26 -52
- package/vue/UiEditorSlashMenu.vue +141 -104
- package/vue/UiEditorSlashMenuGroup.d.ts +8 -5
- package/vue/UiEditorSlashMenuGroup.vue +40 -12
- package/vue/UiEditorSlashMenuItem.d.ts +8 -17
- package/vue/UiEditorSlashMenuItem.vue +90 -48
- package/vue/UiEditorSurface.d.ts +8 -5
- package/vue/UiEditorSurface.vue +45 -15
- package/vue/UiEditorTableContextMenu.d.ts +8 -20
- package/vue/UiEditorTableContextMenu.vue +151 -113
- package/vue/UiEditorTableOverlay.d.ts +10 -29
- package/vue/UiEditorTableOverlay.vue +180 -153
- package/vue/UiEditorTableToolbar.d.ts +8 -20
- package/vue/UiEditorTableToolbar.vue +158 -116
- package/vue/UiEditorToolbar.d.ts +8 -5
- package/vue/UiEditorToolbar.vue +48 -12
- package/vue/UiFloatingActionButton.d.ts +8 -11
- package/vue/UiFloatingActionButton.vue +60 -28
- package/vue/UiFormField.d.ts +8 -11
- package/vue/UiFormField.vue +63 -28
- package/vue/UiGrid.d.ts +8 -11
- package/vue/UiGrid.vue +56 -28
- package/vue/UiIcon.d.ts +8 -8
- package/vue/UiIcon.vue +444 -395
- package/vue/UiIconButton.d.ts +9 -39
- package/vue/UiIconButton.vue +138 -103
- package/vue/UiImage.d.ts +8 -23
- package/vue/UiImage.vue +80 -60
- package/vue/UiInput.d.ts +4 -7
- package/vue/UiInput.vue +169 -149
- package/vue/UiInputGroup.d.ts +8 -17
- package/vue/UiInputGroup.vue +81 -47
- package/vue/UiList.d.ts +9 -15
- package/vue/UiList.vue +67 -39
- package/vue/UiListItem.d.ts +8 -20
- package/vue/UiListItem.vue +87 -52
- package/vue/UiListbox.d.ts +10 -28
- package/vue/UiListbox.vue +111 -71
- package/vue/UiMenu.d.ts +10 -25
- package/vue/UiMenu.vue +96 -65
- package/vue/UiMenuGroup.d.ts +8 -5
- package/vue/UiMenuGroup.vue +40 -12
- package/vue/UiMenuItem.d.ts +8 -20
- package/vue/UiMenuItem.vue +91 -55
- package/vue/UiMeter.d.ts +9 -33
- package/vue/UiMeter.vue +203 -148
- package/vue/UiNavItem.d.ts +9 -24
- package/vue/UiNavItem.vue +78 -63
- package/vue/UiPageHeader.d.ts +8 -5
- package/vue/UiPageHeader.vue +45 -12
- package/vue/UiPopover.d.ts +8 -14
- package/vue/UiPopover.vue +90 -58
- package/vue/UiRadio.d.ts +8 -20
- package/vue/UiRadio.vue +91 -52
- package/vue/UiRadioGroup.d.ts +8 -26
- package/vue/UiRadioGroup.vue +109 -74
- package/vue/UiReel.d.ts +8 -11
- package/vue/UiReel.vue +56 -28
- package/vue/UiScrollArea.d.ts +9 -18
- package/vue/UiScrollArea.vue +81 -53
- package/vue/UiSearchResultRow.d.ts +8 -11
- package/vue/UiSearchResultRow.vue +60 -31
- package/vue/UiSearchShell.d.ts +8 -14
- package/vue/UiSearchShell.vue +73 -36
- package/vue/UiSection.d.ts +8 -11
- package/vue/UiSection.vue +60 -31
- package/vue/UiSelect.d.ts +8 -17
- package/vue/UiSelect.vue +83 -51
- package/vue/UiSeparator.d.ts +9 -15
- package/vue/UiSeparator.vue +69 -39
- package/vue/UiSidebar.d.ts +8 -29
- package/vue/UiSidebar.vue +118 -76
- package/vue/UiSpinner.d.ts +8 -8
- package/vue/UiSpinner.vue +51 -20
- package/vue/UiStack.d.ts +9 -18
- package/vue/UiStack.vue +73 -53
- package/vue/UiStatusMessage.d.ts +8 -11
- package/vue/UiStatusMessage.vue +60 -33
- package/vue/UiSwatch.d.ts +8 -5
- package/vue/UiSwatch.vue +64 -22
- package/vue/UiSwitch.d.ts +8 -20
- package/vue/UiSwitch.vue +91 -52
- package/vue/UiSwitcher.d.ts +9 -15
- package/vue/UiSwitcher.vue +64 -39
- package/vue/UiTable.d.ts +8 -8
- package/vue/UiTable.vue +56 -23
- package/vue/UiTabs.d.ts +8 -23
- package/vue/UiTabs.vue +100 -66
- package/vue/UiText.d.ts +9 -36
- package/vue/UiText.vue +152 -109
- package/vue/UiTextarea.d.ts +8 -29
- package/vue/UiTextarea.vue +118 -83
- package/vue/UiToast.d.ts +8 -8
- package/vue/UiToast.vue +55 -20
- package/vue/UiToastRegion.d.ts +14 -14
- package/vue/UiToastRegion.vue +66 -28
- package/vue/UiTooltip.d.ts +8 -23
- package/vue/UiTooltip.vue +117 -82
- package/vue/UiTopBar.vue +1 -1
- package/vue/UiTree.d.ts +8 -23
- package/vue/UiTree.vue +99 -69
- package/vue/UiTreeItem.d.ts +8 -47
- package/vue/UiTreeItem.vue +178 -127
- package/vue/chunks/UiActionBar.js +1 -1
- package/vue/chunks/UiAffordanceScope.js +35 -22
- package/vue/chunks/UiAvatar.js +81 -70
- package/vue/chunks/UiAvatarGroup.js +58 -46
- package/vue/chunks/UiBadge.js +46 -38
- package/vue/chunks/UiBreadcrumbItem.js +22 -11
- package/vue/chunks/UiBreadcrumbs.js +22 -11
- package/vue/chunks/UiButton.js +115 -118
- package/vue/chunks/UiCallout.js +32 -22
- package/vue/chunks/UiCard.js +53 -46
- package/vue/chunks/UiCheckbox.js +84 -78
- package/vue/chunks/UiCluster.js +63 -62
- package/vue/chunks/UiCombobox.js +359 -382
- package/vue/chunks/UiContainer.js +35 -30
- package/vue/chunks/UiContextMenu.js +36 -23
- package/vue/chunks/UiCover.js +22 -11
- package/vue/chunks/UiDescriptionItem.js +22 -11
- package/vue/chunks/UiDescriptionList.js +38 -30
- package/vue/chunks/UiDialog.js +78 -70
- package/vue/chunks/UiDisclosure.js +87 -78
- package/vue/chunks/UiEditable.js +102 -94
- package/vue/chunks/UiEditorBlockActions.js +49 -23
- package/vue/chunks/UiEditorChipEditor.js +48 -25
- package/vue/chunks/UiEditorCodeLanguage.js +58 -41
- package/vue/chunks/UiEditorImageToolbar.js +153 -148
- package/vue/chunks/UiEditorInsertTableGrid.js +55 -38
- package/vue/chunks/UiEditorLinkCard.js +104 -82
- package/vue/chunks/UiEditorLinkForm.js +282 -258
- package/vue/chunks/UiEditorMentionMenu.js +156 -145
- package/vue/chunks/UiEditorMentionMenuItem.js +39 -30
- package/vue/chunks/UiEditorSlashMenu.js +141 -130
- package/vue/chunks/UiEditorSlashMenuGroup.js +22 -11
- package/vue/chunks/UiEditorSlashMenuItem.js +62 -47
- package/vue/chunks/UiEditorSurface.js +22 -11
- package/vue/chunks/UiEditorTableContextMenu.js +98 -87
- package/vue/chunks/UiEditorTableOverlay.js +286 -308
- package/vue/chunks/UiEditorTableToolbar.js +102 -87
- package/vue/chunks/UiEditorToolbar.js +24 -11
- package/vue/chunks/UiFloatingActionButton.js +39 -30
- package/vue/chunks/UiFormField.js +41 -30
- package/vue/chunks/UiGrid.js +35 -30
- package/vue/chunks/UiIcon.js +38 -25
- package/vue/chunks/UiIconButton.js +102 -102
- package/vue/chunks/UiImage.js +67 -62
- package/vue/chunks/UiInput.js +275 -274
- package/vue/chunks/UiInputGroup.js +55 -46
- package/vue/chunks/UiList.js +46 -38
- package/vue/chunks/UiListItem.js +60 -54
- package/vue/chunks/UiListbox.js +83 -72
- package/vue/chunks/UiMenu.js +71 -63
- package/vue/chunks/UiMenuGroup.js +22 -11
- package/vue/chunks/UiMenuItem.js +63 -54
- package/vue/chunks/UiMeter.js +125 -120
- package/vue/chunks/UiNavItem.js +64 -62
- package/vue/chunks/UiPageHeader.js +22 -11
- package/vue/chunks/UiPopover.js +49 -38
- package/vue/chunks/UiRadio.js +63 -54
- package/vue/chunks/UiRadioGroup.js +77 -70
- package/vue/chunks/UiReel.js +35 -30
- package/vue/chunks/UiScrollArea.js +55 -46
- package/vue/chunks/UiSearchResultRow.js +39 -30
- package/vue/chunks/UiSearchShell.js +49 -38
- package/vue/chunks/UiSection.js +39 -30
- package/vue/chunks/UiSelect.js +57 -48
- package/vue/chunks/UiSeparator.js +46 -38
- package/vue/chunks/UiSidebar.js +88 -78
- package/vue/chunks/UiSpinner.js +32 -22
- package/vue/chunks/UiStack.js +47 -46
- package/vue/chunks/UiStatusMessage.js +39 -30
- package/vue/chunks/UiSwatch.js +28 -14
- package/vue/chunks/UiSwitch.js +63 -54
- package/vue/chunks/UiSwitcher.js +44 -38
- package/vue/chunks/UiTable.js +34 -22
- package/vue/chunks/UiTabs.js +73 -62
- package/vue/chunks/UiText.js +95 -94
- package/vue/chunks/UiTextarea.js +84 -80
- package/vue/chunks/UiToast.js +34 -22
- package/vue/chunks/UiToastRegion.js +36 -23
- package/vue/chunks/UiTooltip.js +70 -62
- package/vue/chunks/UiTopBar.js +1 -1
- package/vue/chunks/UiTree.js +69 -62
- package/vue/chunks/UiTreeItem.js +154 -151
- package/vue/chunks/_plugin-vue_export-helper.js +185 -36
- package/vue/chunks/control.js +6 -1
- package/vue/chunks/props.js +435 -11
- package/vue/components.css +39 -39
- package/vue/editor/index.js +129 -291
- package/vue/host.ts +320 -14
- package/vue/props.d.ts +272 -0
package/vue/host.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
// Generated by HTML Next 1.0.0-alpha.
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.64 for Vue 3.5. Do not edit.
|
|
2
2
|
import {
|
|
3
3
|
computed,
|
|
4
4
|
createTextVNode,
|
|
5
|
+
customRef,
|
|
5
6
|
defineComponent,
|
|
6
7
|
Fragment,
|
|
7
8
|
getCurrentInstance,
|
|
@@ -11,12 +12,174 @@ import {
|
|
|
11
12
|
onBeforeUpdate,
|
|
12
13
|
onMounted,
|
|
13
14
|
onUpdated,
|
|
15
|
+
ref,
|
|
14
16
|
shallowRef,
|
|
15
17
|
useSlots,
|
|
16
18
|
watch,
|
|
17
19
|
watchEffect,
|
|
18
20
|
} from 'vue'
|
|
19
|
-
import type { PropType, VNode } from 'vue'
|
|
21
|
+
import type { PropType, Ref, VNode } from 'vue'
|
|
22
|
+
/** The public failure a template may read; stacks and producer capabilities stay with their owner. */
|
|
23
|
+
interface InputFailure {
|
|
24
|
+
readonly name: string
|
|
25
|
+
readonly message: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Availability is independent of the declared value's type, truthiness and input ownership. */
|
|
29
|
+
interface InputStatus {
|
|
30
|
+
readonly ready: boolean
|
|
31
|
+
readonly pending: boolean
|
|
32
|
+
readonly error: InputFailure | null
|
|
33
|
+
readonly stale: boolean
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const READY_INPUT: InputStatus = { ready: true, pending: false, error: null, stale: false }
|
|
37
|
+
|
|
38
|
+
/** Browser activation shared by live, native-compiled and framework component hosts. */
|
|
39
|
+
export interface ConnectionContext {
|
|
40
|
+
readonly signal: AbortSignal
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type Connect<H> = (
|
|
44
|
+
host: H,
|
|
45
|
+
context: ConnectionContext,
|
|
46
|
+
) => void | (() => void) | Promise<void | (() => void)>
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Each call owns a fresh native cancellation signal. The facade also owns subscriptions created
|
|
50
|
+
* through host.on/effect after an await: retaining a stale host cannot start a new subscription.
|
|
51
|
+
* It shares the instance's state, props, refs and other capabilities rather than copying them.
|
|
52
|
+
*/
|
|
53
|
+
export function activateModule<H extends object>(
|
|
54
|
+
module: { readonly connect?: Connect<H> | undefined },
|
|
55
|
+
host: H,
|
|
56
|
+
report: (error: unknown) => void = error => {
|
|
57
|
+
queueMicrotask(() => {
|
|
58
|
+
throw error
|
|
59
|
+
})
|
|
60
|
+
},
|
|
61
|
+
): () => void {
|
|
62
|
+
const controller = new AbortController()
|
|
63
|
+
const owned = new Set<() => void>()
|
|
64
|
+
let cleanup: (() => void) | undefined
|
|
65
|
+
const dispose = (stop: () => void): void => {
|
|
66
|
+
try {
|
|
67
|
+
stop()
|
|
68
|
+
} catch (error) {
|
|
69
|
+
report(error)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const scoped = Object.create(host) as H
|
|
73
|
+
const stop = (): void => {
|
|
74
|
+
if (controller.signal.aborted) return
|
|
75
|
+
controller.abort()
|
|
76
|
+
for (const release of owned) release()
|
|
77
|
+
const release = cleanup
|
|
78
|
+
cleanup = undefined
|
|
79
|
+
if (release !== undefined) dispose(release)
|
|
80
|
+
}
|
|
81
|
+
const failed = (error: unknown): void => {
|
|
82
|
+
const cancelled = controller.signal.aborted
|
|
83
|
+
&& (error as { name?: string } | null)?.name === 'AbortError'
|
|
84
|
+
stop()
|
|
85
|
+
if (!cancelled) report(error)
|
|
86
|
+
}
|
|
87
|
+
const own = (stop: () => void): () => void => {
|
|
88
|
+
let stopped = false
|
|
89
|
+
const release = (): void => {
|
|
90
|
+
if (stopped) return
|
|
91
|
+
stopped = true
|
|
92
|
+
owned.delete(release)
|
|
93
|
+
dispose(stop)
|
|
94
|
+
}
|
|
95
|
+
if (controller.signal.aborted) release()
|
|
96
|
+
else owned.add(release)
|
|
97
|
+
return release
|
|
98
|
+
}
|
|
99
|
+
for (const name of ['on', 'effect', 'computed'] as const) {
|
|
100
|
+
const method: unknown = Reflect.get(host, name)
|
|
101
|
+
if (typeof method !== 'function') continue
|
|
102
|
+
Object.defineProperty(scoped, name, {
|
|
103
|
+
value: (...args: unknown[]) => {
|
|
104
|
+
if (controller.signal.aborted) {
|
|
105
|
+
if (name === 'computed') {
|
|
106
|
+
return {
|
|
107
|
+
get: () => {
|
|
108
|
+
throw controller.signal.reason
|
|
109
|
+
},
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return () => {}
|
|
113
|
+
}
|
|
114
|
+
const result: unknown = Reflect.apply(method, host, args)
|
|
115
|
+
const stop = name === 'computed'
|
|
116
|
+
? (result as { stop?: () => void }).stop?.bind(result)
|
|
117
|
+
: result as () => void
|
|
118
|
+
if (stop === undefined) return result
|
|
119
|
+
const release = own(stop)
|
|
120
|
+
return name === 'computed' ? result : release
|
|
121
|
+
},
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
// A connection owns its input subscriptions and source capabilities. Disposal releases
|
|
125
|
+
// eligibility for a later activation without disposing the instance's input port or values.
|
|
126
|
+
const inputKey = Symbol.for('@nextwebwg/html-next.inputs.v1')
|
|
127
|
+
const inputs: unknown = Reflect.get(host, inputKey)
|
|
128
|
+
if (inputs !== undefined) {
|
|
129
|
+
const port = Object.create(inputs as object) as {
|
|
130
|
+
watch(run: () => void | (() => void)): () => void
|
|
131
|
+
}
|
|
132
|
+
Object.defineProperty(port, 'watch', {
|
|
133
|
+
value: (run: () => void | (() => void)) =>
|
|
134
|
+
controller.signal.aborted ? () => {} : own((inputs as typeof port).watch(run)),
|
|
135
|
+
})
|
|
136
|
+
const source: unknown = Reflect.get(inputs as object, 'source')
|
|
137
|
+
if (typeof source === 'function') {
|
|
138
|
+
Object.defineProperty(port, 'source', {
|
|
139
|
+
value: (...args: unknown[]) => {
|
|
140
|
+
if (controller.signal.aborted) throw controller.signal.reason
|
|
141
|
+
const result = Reflect.apply(source, inputs, args) as { dispose(): void }
|
|
142
|
+
const capability = Object.create(result) as typeof result
|
|
143
|
+
Object.defineProperty(capability, 'dispose', { value: own(() => result.dispose()) })
|
|
144
|
+
return capability
|
|
145
|
+
},
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
Object.defineProperty(scoped, inputKey, { value: port })
|
|
149
|
+
}
|
|
150
|
+
const accept = (result: void | (() => void)): void => {
|
|
151
|
+
if (result === undefined) return
|
|
152
|
+
if (typeof result !== 'function') {
|
|
153
|
+
failed(new TypeError('A component connect export must return cleanup or undefined.'))
|
|
154
|
+
return
|
|
155
|
+
}
|
|
156
|
+
if (controller.signal.aborted) dispose(result)
|
|
157
|
+
else cleanup = result
|
|
158
|
+
}
|
|
159
|
+
try {
|
|
160
|
+
const result = module.connect?.(scoped, { signal: controller.signal })
|
|
161
|
+
if (result !== undefined && typeof result !== 'function') {
|
|
162
|
+
void Promise.resolve(result).then(accept, failed)
|
|
163
|
+
} else accept(result)
|
|
164
|
+
} catch (error) {
|
|
165
|
+
failed(error)
|
|
166
|
+
}
|
|
167
|
+
return stop
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** A fresh copy of a state's declared value at `keys`, or null where it has none. */
|
|
171
|
+
function initialAt(initial: unknown, keys: readonly PropertyKey[]): unknown {
|
|
172
|
+
let value = initial
|
|
173
|
+
for (const key of keys) {
|
|
174
|
+
if (value === null || typeof value !== 'object' || !Object.hasOwn(value, key)) return null
|
|
175
|
+
value = (value as Record<PropertyKey, unknown>)[key]
|
|
176
|
+
}
|
|
177
|
+
return value === undefined
|
|
178
|
+
? null
|
|
179
|
+
: value !== null && typeof value === 'object'
|
|
180
|
+
? structuredClone(value)
|
|
181
|
+
: value
|
|
182
|
+
}
|
|
20
183
|
|
|
21
184
|
interface ControllerStateAccess {
|
|
22
185
|
readonly get: () => unknown
|
|
@@ -27,6 +190,8 @@ interface ControllerNamespaces {
|
|
|
27
190
|
readonly computed: Readonly<Record<string, () => unknown>>
|
|
28
191
|
readonly data?: Readonly<Record<string, () => unknown>>
|
|
29
192
|
readonly acceptsState?: (name: string, keys: readonly string[], value: unknown) => boolean
|
|
193
|
+
/** Each state's declared `value`, which a null write and `host.reset` restore; a state without one has none. */
|
|
194
|
+
readonly initials?: Readonly<Record<string, unknown>>
|
|
30
195
|
/** A read below a state root, by its path from the root. */
|
|
31
196
|
readonly read?: (name: string, keys: readonly string[]) => void
|
|
32
197
|
/** A write below a state root changed the value at this path from the root. */
|
|
@@ -36,6 +201,7 @@ interface ControllerNamespaces {
|
|
|
36
201
|
function controllerNamespaces(options: ControllerNamespaces, source: string): {
|
|
37
202
|
state: Record<string, unknown>
|
|
38
203
|
data: Readonly<Record<string, unknown>>
|
|
204
|
+
reset: (name?: string) => void
|
|
39
205
|
} {
|
|
40
206
|
const reported = new Set<string>()
|
|
41
207
|
const nested = new WeakMap<object, Map<string, object>>()
|
|
@@ -102,7 +268,9 @@ function controllerNamespaces(options: ControllerNamespaces, source: string): {
|
|
|
102
268
|
return wrap(Reflect.get(value, key), name, [...keys, String(key)], readonly)
|
|
103
269
|
},
|
|
104
270
|
set: (_target, key, written) => {
|
|
271
|
+
// A null or undefined field goes back to its value in the state's declared value.
|
|
105
272
|
const next = unwrap(written)
|
|
273
|
+
?? initialAt(options.initials?.[name] ?? null, [...keys, String(key)])
|
|
106
274
|
return write(name, [...keys, String(key)], next, readonly, () => {
|
|
107
275
|
const previous = Reflect.get(value, key)
|
|
108
276
|
const length = Array.isArray(value) ? value.length : undefined
|
|
@@ -169,7 +337,10 @@ function controllerNamespaces(options: ControllerNamespaces, source: string): {
|
|
|
169
337
|
[],
|
|
170
338
|
unwrap(value),
|
|
171
339
|
typeof name !== 'string' || !Object.hasOwn(options.state, name),
|
|
172
|
-
() =>
|
|
340
|
+
() =>
|
|
341
|
+
options.state[String(name)]!.set(
|
|
342
|
+
unwrap(value) ?? initialAt(options.initials?.[String(name)] ?? null, []),
|
|
343
|
+
),
|
|
173
344
|
),
|
|
174
345
|
deleteProperty: (_target, name) => {
|
|
175
346
|
warn(String(name), true)
|
|
@@ -199,7 +370,16 @@ function controllerNamespaces(options: ControllerNamespaces, source: string): {
|
|
|
199
370
|
},
|
|
200
371
|
has: (_target, name) => typeof name === 'string' && Object.hasOwn(options.data ?? {}, name),
|
|
201
372
|
})
|
|
202
|
-
|
|
373
|
+
// Returns one state, or every state, to its declared value: a fresh copy, or null without one.
|
|
374
|
+
const reset = (name?: string): void => {
|
|
375
|
+
if (name !== undefined && !Object.hasOwn(options.state, name)) {
|
|
376
|
+
throw new TypeError('`' + String(name) + '` is not a state of ' + source + '.')
|
|
377
|
+
}
|
|
378
|
+
for (const each of name === undefined ? Object.keys(options.state) : [name]) {
|
|
379
|
+
options.state[each]!.set(initialAt(options.initials?.[each] ?? null, []))
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return { state, data, reset }
|
|
203
383
|
}
|
|
204
384
|
|
|
205
385
|
const requestStateKey = Symbol.for('@nextwebwg/html-next.runtime.v1')
|
|
@@ -537,11 +717,27 @@ export function preserveRootFocus(componentRoot: Readable<Element | null>): void
|
|
|
537
717
|
}
|
|
538
718
|
|
|
539
719
|
export interface ComponentHostOptions {
|
|
720
|
+
readonly inputs?: {
|
|
721
|
+
port(reactions: {
|
|
722
|
+
readonly declarations?: Readonly<
|
|
723
|
+
Record<string, { readonly read: () => unknown; readonly status: () => InputStatus }>
|
|
724
|
+
>
|
|
725
|
+
track(name: string, kind: 'value' | 'status' | 'supplied'): void
|
|
726
|
+
watch(run: () => void | (() => void)): () => void
|
|
727
|
+
untracked<T>(run: () => T): T
|
|
728
|
+
}): unknown
|
|
729
|
+
}
|
|
730
|
+
readonly availability?: Readonly<Record<string, () => InputStatus>>
|
|
731
|
+
readonly inputTracking?: {
|
|
732
|
+
track(name: string, kind: 'value' | 'status' | 'supplied'): void
|
|
733
|
+
untracked<T>(run: () => T): T
|
|
734
|
+
}
|
|
540
735
|
/** The component's root element. */
|
|
541
736
|
readonly root: Readable<HTMLElement | null>
|
|
542
737
|
/** Dispatches a declared component event. */
|
|
543
738
|
readonly dispatch: (name: string, detail?: unknown) => boolean
|
|
544
739
|
/** The authored controller edge, retained for the live loader's module diagnostic. */
|
|
740
|
+
readonly module?: boolean
|
|
545
741
|
readonly controllerSource?: { readonly specifier: string; readonly definition: string }
|
|
546
742
|
/** Accepted component props, which a controller reads through `host.props`. */
|
|
547
743
|
readonly props?: Readable<Readonly<Record<string, unknown>>>
|
|
@@ -562,6 +758,7 @@ export interface ComponentHostOptions {
|
|
|
562
758
|
/** Each named declared script, which a controller reads as `host.scripts`. */
|
|
563
759
|
readonly scripts?: Readonly<Record<string, unknown>>
|
|
564
760
|
readonly acceptsState?: (name: string, keys: readonly string[], value: unknown) => boolean
|
|
761
|
+
readonly initials?: Readonly<Record<string, unknown>>
|
|
565
762
|
/** Asks one of the component's declared requests; its `has` builds `host.hasResponder`. */
|
|
566
763
|
readonly request?:
|
|
567
764
|
& ((
|
|
@@ -630,7 +827,9 @@ export function useComponentHost(
|
|
|
630
827
|
const url = new URL(edge?.specifier ?? '', source ?? document.baseURI).href
|
|
631
828
|
const tick = String.fromCharCode(96)
|
|
632
829
|
const message = code === 'HJ002'
|
|
633
|
-
?
|
|
830
|
+
? options.module
|
|
831
|
+
? 'Component module ' + tick + url + tick + ' export connect must be a function.'
|
|
832
|
+
: 'Controller module ' + tick + url + tick + ' must default-export a function.'
|
|
634
833
|
: 'Controller module ' + tick + url + tick + ' failed to load: '
|
|
635
834
|
+ (reason instanceof Error ? reason.message : String(reason)) + '.'
|
|
636
835
|
return Object.assign(
|
|
@@ -641,14 +840,24 @@ export function useComponentHost(
|
|
|
641
840
|
},
|
|
642
841
|
)
|
|
643
842
|
}
|
|
644
|
-
type ControllerModule = Record<string, unknown> & {
|
|
843
|
+
type ControllerModule = Record<string, unknown> & {
|
|
844
|
+
readonly default: (host: unknown) => unknown
|
|
845
|
+
readonly connect?: Connect<object>
|
|
846
|
+
}
|
|
645
847
|
let controllerModule: Promise<ControllerModule> | undefined
|
|
646
848
|
const loadControllerModule = (): Promise<ControllerModule> =>
|
|
647
849
|
controllerModule ??= Promise.resolve()
|
|
648
850
|
.then(controllerLoader)
|
|
649
851
|
.then((candidate) => {
|
|
650
|
-
const loaded = candidate as
|
|
651
|
-
|
|
852
|
+
const loaded = candidate as
|
|
853
|
+
| { readonly default?: unknown; readonly connect?: unknown }
|
|
854
|
+
| null
|
|
855
|
+
if (
|
|
856
|
+
options.module
|
|
857
|
+
? loaded === null || typeof loaded !== 'object'
|
|
858
|
+
|| loaded.connect !== undefined && typeof loaded.connect !== 'function'
|
|
859
|
+
: typeof loaded?.default !== 'function'
|
|
860
|
+
) throw controllerDiagnostic('HJ002')
|
|
652
861
|
return candidate as ControllerModule
|
|
653
862
|
})
|
|
654
863
|
.catch((error: unknown) => {
|
|
@@ -717,6 +926,21 @@ export function useComponentHost(
|
|
|
717
926
|
// root, so cleanup that runs after that still reads the root that disconnected.
|
|
718
927
|
let lastRoot: Element | null = null
|
|
719
928
|
const host = {
|
|
929
|
+
get [Symbol.for('@nextwebwg/html-next.inputs.v1')](): unknown {
|
|
930
|
+
return options.inputs?.port({
|
|
931
|
+
declarations: Object.fromEntries(
|
|
932
|
+
[...Object.keys(state), ...Object.keys(computedValues), ...Object.keys(context)].map(
|
|
933
|
+
name => [name, {
|
|
934
|
+
read: () => host.state[name],
|
|
935
|
+
status: () => options.availability?.[name]?.() ?? READY_INPUT,
|
|
936
|
+
}]
|
|
937
|
+
),
|
|
938
|
+
),
|
|
939
|
+
track: (name, kind) => options.inputTracking!.track(name, kind),
|
|
940
|
+
watch: run => host.effect(run),
|
|
941
|
+
untracked: run => options.inputTracking!.untracked(run),
|
|
942
|
+
})
|
|
943
|
+
},
|
|
720
944
|
get element(): Element {
|
|
721
945
|
return (root.value ?? lastRoot) as Element
|
|
722
946
|
},
|
|
@@ -741,6 +965,7 @@ export function useComponentHost(
|
|
|
741
965
|
Object.entries(data).map(([name, value]) => [name, () => value.value]),
|
|
742
966
|
),
|
|
743
967
|
...(options.acceptsState === undefined ? {} : { acceptsState: options.acceptsState }),
|
|
968
|
+
...(options.initials === undefined ? {} : { initials: options.initials }),
|
|
744
969
|
}, options.controllerSource?.definition ?? '<component>'),
|
|
745
970
|
scripts: options.scripts ?? Object.freeze({}),
|
|
746
971
|
on(type: string, callback: (event: Event) => void | (() => void)): () => void {
|
|
@@ -799,6 +1024,8 @@ export function useComponentHost(
|
|
|
799
1024
|
stop()
|
|
800
1025
|
pause()
|
|
801
1026
|
pauses.delete(dispose)
|
|
1027
|
+
const index = stops.indexOf(dispose)
|
|
1028
|
+
if (index >= 0) stops.splice(index, 1)
|
|
802
1029
|
}
|
|
803
1030
|
pauses.set(dispose, pause)
|
|
804
1031
|
stops.push(dispose)
|
|
@@ -896,13 +1123,23 @@ export function useComponentHost(
|
|
|
896
1123
|
}
|
|
897
1124
|
connected.value = true
|
|
898
1125
|
for (const entry of subscriptions) activate(entry)
|
|
899
|
-
if (initialized) return
|
|
1126
|
+
if (initialized && !options.module) return
|
|
900
1127
|
const current = ++connection
|
|
901
1128
|
// Requests from inside this root wait until the controller has run, or failed to load.
|
|
902
1129
|
const release = releaseController = holdController(root.value!)
|
|
903
1130
|
started = loadControllerModule().then(async (loaded) => {
|
|
904
|
-
if (!connected.value || current !== connection || initialized)
|
|
1131
|
+
if (!connected.value || current !== connection || initialized && !options.module) {
|
|
1132
|
+
return loaded
|
|
1133
|
+
}
|
|
905
1134
|
initialized = true
|
|
1135
|
+
if (options.module) {
|
|
1136
|
+
try {
|
|
1137
|
+
cleanup = activateModule(loaded, host, report)
|
|
1138
|
+
} finally {
|
|
1139
|
+
release()
|
|
1140
|
+
}
|
|
1141
|
+
return loaded
|
|
1142
|
+
}
|
|
906
1143
|
let invoked: unknown
|
|
907
1144
|
try {
|
|
908
1145
|
invoked = loaded.default(host as never)
|
|
@@ -1116,6 +1353,75 @@ export function cycleCheckedComputed<T>(evaluate: () => T) {
|
|
|
1116
1353
|
})
|
|
1117
1354
|
}
|
|
1118
1355
|
|
|
1356
|
+
/** A Vue state cell owns its first usable seed or an earlier accepted edit, including equal writes. */
|
|
1357
|
+
export function initializedState<T>(
|
|
1358
|
+
evaluate: () => { value: unknown; status: InputStatus },
|
|
1359
|
+
accepts: (value: unknown) => boolean,
|
|
1360
|
+
copy: <V>(value: V) => V,
|
|
1361
|
+
warn: () => void,
|
|
1362
|
+
): Ref<T | null | undefined> & { status(): InputStatus; start(): void } {
|
|
1363
|
+
const cell = ref<T>() as Ref<T | null | undefined>
|
|
1364
|
+
let seed: ReturnType<typeof cycleCheckedComputed<ReturnType<typeof evaluate>>> | undefined =
|
|
1365
|
+
cycleCheckedComputed(evaluate)
|
|
1366
|
+
let initialized = false
|
|
1367
|
+
let stop: (() => void) | undefined
|
|
1368
|
+
let notify = () => {}
|
|
1369
|
+
const claim = (): void => {
|
|
1370
|
+
if (initialized) return
|
|
1371
|
+
initialized = true
|
|
1372
|
+
seed = undefined
|
|
1373
|
+
// A claim can happen inside the seed watcher's read; release after Vue finishes tracking it.
|
|
1374
|
+
if (stop !== undefined) queueMicrotask(stop)
|
|
1375
|
+
}
|
|
1376
|
+
const initialize = (): void => {
|
|
1377
|
+
if (initialized) return
|
|
1378
|
+
const next = seed!.value
|
|
1379
|
+
if (!next.status.ready || next.status.stale || next.value === undefined) return
|
|
1380
|
+
if (!accepts(next.value)) {
|
|
1381
|
+
warn()
|
|
1382
|
+
return
|
|
1383
|
+
}
|
|
1384
|
+
claim()
|
|
1385
|
+
cell.value = copy(next.value) as T
|
|
1386
|
+
notify()
|
|
1387
|
+
}
|
|
1388
|
+
const state = customRef<T | null | undefined>((track, trigger) => {
|
|
1389
|
+
notify = trigger
|
|
1390
|
+
return {
|
|
1391
|
+
get() {
|
|
1392
|
+
track()
|
|
1393
|
+
initialize()
|
|
1394
|
+
return cell.value
|
|
1395
|
+
},
|
|
1396
|
+
set(value) {
|
|
1397
|
+
if (value != null && !accepts(value)) {
|
|
1398
|
+
warn()
|
|
1399
|
+
return
|
|
1400
|
+
}
|
|
1401
|
+
const first = !initialized
|
|
1402
|
+
claim()
|
|
1403
|
+
cell.value = value ?? null
|
|
1404
|
+
if (first) trigger()
|
|
1405
|
+
},
|
|
1406
|
+
}
|
|
1407
|
+
})
|
|
1408
|
+
return Object.assign(state, {
|
|
1409
|
+
status(): InputStatus {
|
|
1410
|
+
void state.value
|
|
1411
|
+
return initialized
|
|
1412
|
+
? cell.value === undefined ? { ...READY_INPUT, ready: false } : READY_INPUT
|
|
1413
|
+
: { ...seed!.value.status, ready: false, stale: false }
|
|
1414
|
+
},
|
|
1415
|
+
start() {
|
|
1416
|
+
if (initialized) return
|
|
1417
|
+
stop = watchEffect(() => {
|
|
1418
|
+
void state.value
|
|
1419
|
+
})
|
|
1420
|
+
if (initialized) stop()
|
|
1421
|
+
},
|
|
1422
|
+
})
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1119
1425
|
/**
|
|
1120
1426
|
* A declared prop's reflected root attribute: the authored literal until the consumer passes the
|
|
1121
1427
|
* prop, then its value as text, absent for null.
|
|
@@ -1236,7 +1542,7 @@ export function warnUnless(accepted: boolean, location: string, message: string)
|
|
|
1236
1542
|
|
|
1237
1543
|
/**
|
|
1238
1544
|
* A handler's checked write to a ref or through a setter. An invalid result, such as a number that
|
|
1239
|
-
* is not finite, writes nothing. A value neither absent nor of the destination's type warns once for
|
|
1545
|
+
* is not finite, writes nothing. A value neither null, absent nor of the destination's type warns once for
|
|
1240
1546
|
* its authored write (the state `path` in `file`'s `handler`), as the live runtime does, and
|
|
1241
1547
|
* leaves the destination as it was.
|
|
1242
1548
|
*/
|
|
@@ -1252,14 +1558,14 @@ export function write(
|
|
|
1252
1558
|
value === Symbol.for('html-next.invalid-result')
|
|
1253
1559
|
|| (typeof value === 'number' && !Number.isFinite(value))
|
|
1254
1560
|
) return
|
|
1255
|
-
if (check !== undefined && value
|
|
1561
|
+
if (check !== undefined && value != null && !check(value)) {
|
|
1256
1562
|
warnUnless(
|
|
1257
1563
|
false,
|
|
1258
1564
|
`${file}#${handler}:${path}`,
|
|
1259
1565
|
`${file}: HR007: State \`${path}\` does not satisfy its declared type.`,
|
|
1260
1566
|
)
|
|
1261
|
-
} else if (typeof to === 'function') to(value)
|
|
1262
|
-
else to.value = value
|
|
1567
|
+
} else if (typeof to === 'function') to(value ?? null)
|
|
1568
|
+
else to.value = value ?? null
|
|
1263
1569
|
}
|
|
1264
1570
|
|
|
1265
1571
|
export const isString = (value: unknown): value is string => typeof value === 'string'
|