@threadlabs/looma 0.23.20 → 0.23.22
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/shared/overlay.js +1 -1
- package/components/ui-combobox/ui-combobox.html +7 -8
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +2 -2
- package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +1 -1
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +3 -3
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +2 -2
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +4 -4
- package/components/ui-image/ui-image.html +177 -0
- package/components/ui-image/ui-image.js +107 -0
- package/components/ui-listbox/ui-listbox.html +1 -1
- package/components/ui-menu/ui-menu.js +1 -1
- package/components/ui-popover/ui-popover.js +4 -1
- package/components/ui-separator/ui-separator.html +18 -0
- package/components/ui-toast-region/ui-toast-region.html +1 -1
- package/dist/index.js +24 -23
- package/editor/chunks/extensions.js +633 -20
- package/editor/extensions/block-selection.d.ts +6 -0
- package/editor/extensions/expand.d.ts +31 -0
- package/editor/extensions/image.d.ts +12 -0
- package/editor/extensions/index.d.ts +4 -1
- package/editor/extensions/index.js +2 -2
- package/editor/extensions/preset.d.ts +8 -0
- package/editor/extensions/slash-command.d.ts +31 -3
- package/editor/extensions/table-of-contents.d.ts +58 -0
- package/editor/index.js +2 -2
- package/package.json +2 -2
- 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-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 +153 -0
- 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 +17 -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-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 +181 -167
- 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 +19 -13
- package/vanilla/UiEditorMentionMenuItem.d.ts +1 -1
- package/vanilla/UiEditorMentionMenuItem.js +1 -1
- package/vanilla/UiEditorSlashMenu.d.ts +1 -1
- package/vanilla/UiEditorSlashMenu.js +17 -13
- 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 +26 -20
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +69 -65
- package/vanilla/UiEditorTableToolbar.d.ts +1 -1
- package/vanilla/UiEditorTableToolbar.js +72 -64
- 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 +21 -0
- package/vanilla/UiImage.js +84 -0
- 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 +33 -31
- 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 +3 -1
- package/vanilla/UiSeparator.js +11 -3
- 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 +1 -1
- package/vanilla/UiToastRegion.js +13 -11
- 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/vanilla/index.js +1 -0
- package/vue/UiActionBar.vue +1 -1
- package/vue/UiAffordanceScope.vue +1 -1
- package/vue/UiAvatar.vue +1 -1
- package/vue/UiAvatarGroup.vue +2 -2
- 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/UiEditorInsertTableGrid.vue +1 -1
- 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/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.d.ts +100 -0
- package/vue/UiImage.js +2 -0
- package/vue/UiImage.vue +463 -0
- 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.d.ts +18 -0
- package/vue/UiSeparator.vue +67 -2
- package/vue/UiSidebar.d.ts +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/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 +2 -2
- 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/UiEditorInsertTableGrid.js +1 -1
- 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/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 +313 -0
- 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 +79 -22
- 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/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/components.css +1469 -1309
- package/vue/editor/LoomaEditor.d.ts +19 -2
- package/vue/editor/divider.d.ts +6 -0
- package/vue/editor/expand.d.ts +7 -0
- package/vue/editor/image-controls.d.ts +19 -0
- package/vue/editor/image-delivery.d.ts +2 -2
- package/vue/editor/image.d.ts +7 -0
- package/vue/editor/index.d.ts +1 -1
- package/vue/editor/index.js +1188 -52
- package/vue/editor/table-of-contents.d.ts +7 -0
- package/vue/host.ts +1 -1
- package/vue/index.d.ts +1 -0
- package/vue/index.js +2 -1
|
@@ -31,7 +31,7 @@ function requestClose(document, reason, trigger) {
|
|
|
31
31
|
function ensureListeners(document, state) {
|
|
32
32
|
if (state.listening) return;
|
|
33
33
|
state.onKeydown = (event) => {
|
|
34
|
-
if (event.key === "Escape"
|
|
34
|
+
if (event.key === "Escape" && !event.defaultPrevented && requestClose(document, "escape", "keyboard")) event.preventDefault();
|
|
35
35
|
};
|
|
36
36
|
state.onPointerdown = (event) => {
|
|
37
37
|
const top = state.records.at(-1);
|
|
@@ -388,7 +388,7 @@
|
|
|
388
388
|
from:disabled="disabled or readonly or item.disabled"
|
|
389
389
|
from:aria-label="concat(item.label, ', press Delete or Backspace to remove')"
|
|
390
390
|
>
|
|
391
|
-
<slot from:name="concat('item-', item.id)"><ui-badge
|
|
391
|
+
<slot from:name="concat('item-', item.id)"><ui-badge>{$item.label}</ui-badge></slot>
|
|
392
392
|
</button>
|
|
393
393
|
</template>
|
|
394
394
|
<input
|
|
@@ -467,7 +467,7 @@
|
|
|
467
467
|
<div class="popup" $ref="popup" from:hidden="not expanded">
|
|
468
468
|
<div role="listbox" $ref="listbox" from:id="concat(uid, '-listbox')" from:aria-label="concat(label, ' suggestions')" from:aria-busy="loading">
|
|
469
469
|
<div $each="group of groups" $key="group.name" from:role="group.role" from:aria-label="group.label">
|
|
470
|
-
<div $if="group.name" class="group"
|
|
470
|
+
<div $if="group.name" class="group">{$group.name}</div>
|
|
471
471
|
<div
|
|
472
472
|
$each="row of group.rows"
|
|
473
473
|
$key="row.id"
|
|
@@ -486,15 +486,14 @@
|
|
|
486
486
|
<slot from:name="concat('option-', row.id)">
|
|
487
487
|
<span $if="row.detail" class="detail">
|
|
488
488
|
<span class="line">
|
|
489
|
-
<span class="primary" from:id="concat(uid, '-option-', row.index, '-label')"
|
|
489
|
+
<span class="primary" from:id="concat(uid, '-option-', row.index, '-label')">{$row.label}</span>
|
|
490
490
|
<ui-badge $if="row.tag" from:tone="row.tag.tone" style:--ui-badge-color="row.tag.color"><span
|
|
491
491
|
from:id="concat(uid, '-option-', row.index, '-tag')"
|
|
492
|
-
|
|
493
|
-
></span></ui-badge>
|
|
492
|
+
>{$row.tag.label}</span></ui-badge>
|
|
494
493
|
</span>
|
|
495
|
-
<span $if="row.description" class="description" from:id="concat(uid, '-option-', row.index, '-description')"
|
|
494
|
+
<span $if="row.description" class="description" from:id="concat(uid, '-option-', row.index, '-description')">{$row.description}</span>
|
|
496
495
|
</span>
|
|
497
|
-
<span $if="not row.detail" class="primary"
|
|
496
|
+
<span $if="not row.detail" class="primary">{$row.label}</span>
|
|
498
497
|
</slot>
|
|
499
498
|
</div>
|
|
500
499
|
</div>
|
|
@@ -517,7 +516,7 @@
|
|
|
517
516
|
<slot name="footer"></slot>
|
|
518
517
|
</div>
|
|
519
518
|
<div class="message" from:id="concat(uid, '-validation')" from:hidden="not validation.issues.length">
|
|
520
|
-
<div $each="issue of validation.issues"
|
|
519
|
+
<div $each="issue of validation.issues">{$issue.message}</div>
|
|
521
520
|
</div>
|
|
522
521
|
<div class="sr-only" role="status" aria-live="polite" aria-atomic="true">{$statusText}</div>
|
|
523
522
|
<div class="authored-options" $ref="options" hidden aria-hidden="true"><slot></slot></div>
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
from:data-index="index"
|
|
37
37
|
from:data-value="row.id"
|
|
38
38
|
>
|
|
39
|
-
<span class="avatar" aria-hidden="true"
|
|
40
|
-
<span class="body"><span class="label"
|
|
39
|
+
<span class="avatar" aria-hidden="true">{$row.initials}</span>
|
|
40
|
+
<span class="body"><span class="label">{$row.label}</span><span $if="row.detail" class="detail">{$row.detail}</span></span>
|
|
41
41
|
</li>
|
|
42
42
|
<slot></slot>
|
|
43
43
|
</ul>
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
from:data-value="item.value"
|
|
36
36
|
>
|
|
37
37
|
<span class="icon" aria-hidden="true"><ui-icon from:name="item.icon"></ui-icon></span>
|
|
38
|
-
<span class="body"><span class="title"
|
|
38
|
+
<span class="body"><span class="title">{$item.title}</span><span class="description">{$item.description}</span></span>
|
|
39
39
|
</li>
|
|
40
40
|
<slot></slot>
|
|
41
41
|
</ul>
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
from:data-action="swatch.action"
|
|
57
57
|
>
|
|
58
58
|
<span class="swatch" class:default="not swatch.color" style:--_swatch="swatch.color"></span>
|
|
59
|
-
<span class="swatch-label"
|
|
59
|
+
<span class="swatch-label">{$swatch.label}</span>
|
|
60
60
|
</button>
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
63
63
|
<template $each="section of sections" $key="section.heading">
|
|
64
64
|
<div class="sep"></div>
|
|
65
65
|
<div class="section" role="none">
|
|
66
|
-
<div class="heading" role="presentation"
|
|
66
|
+
<div class="heading" role="presentation">{$section.heading}</div>
|
|
67
67
|
<button
|
|
68
68
|
$each="item of section.items"
|
|
69
69
|
$key="item.action"
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
from:data-action="item.action"
|
|
75
75
|
>
|
|
76
76
|
<ui-icon from:name="item.icon"></ui-icon>
|
|
77
|
-
<span
|
|
77
|
+
<span>{$item.label}</span>
|
|
78
78
|
</button>
|
|
79
79
|
</div>
|
|
80
80
|
</template>
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
from:aria-label="control.label"
|
|
128
128
|
>
|
|
129
129
|
<ui-icon name="plus"></ui-icon>
|
|
130
|
-
<span class="tooltip" role="tooltip"
|
|
130
|
+
<span class="tooltip" role="tooltip">{$control.label}</span>
|
|
131
131
|
</button>
|
|
132
132
|
</div>
|
|
133
133
|
</div>
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
from:aria-label="control.label"
|
|
152
152
|
>
|
|
153
153
|
<ui-icon name="plus"></ui-icon>
|
|
154
|
-
<span class="tooltip" role="tooltip"
|
|
154
|
+
<span class="tooltip" role="tooltip">{$control.label}</span>
|
|
155
155
|
</button>
|
|
156
156
|
</div>
|
|
157
157
|
</div>
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
<div $if="structure" class="group" role="group" aria-label="Table structure">
|
|
72
72
|
<button $each="item of structure" $key="item.action" type="button" from:data-action="item.action">
|
|
73
73
|
<ui-icon from:name="item.icon"></ui-icon>
|
|
74
|
-
<span
|
|
74
|
+
<span>{$item.label}</span>
|
|
75
75
|
</button>
|
|
76
76
|
</div>
|
|
77
77
|
<div $if="(alignments or structure) and hasOverflow" class="sep" aria-hidden="true"></div>
|
|
@@ -96,12 +96,12 @@
|
|
|
96
96
|
from:data-action="swatch.action"
|
|
97
97
|
>
|
|
98
98
|
<span class="swatch" class:default="not swatch.color" style:--_swatch="swatch.color"></span>
|
|
99
|
-
<span
|
|
99
|
+
<span>{$swatch.label}</span>
|
|
100
100
|
</button>
|
|
101
101
|
</div>
|
|
102
102
|
</div>
|
|
103
103
|
<div $each="section of sections" $key="section.heading" class="menu-section divided" role="none">
|
|
104
|
-
<div class="menu-heading" role="presentation"
|
|
104
|
+
<div class="menu-heading" role="presentation">{$section.heading}</div>
|
|
105
105
|
<button
|
|
106
106
|
$each="item of section.items"
|
|
107
107
|
$key="item.action"
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
from:data-action="item.action"
|
|
113
113
|
>
|
|
114
114
|
<ui-icon from:name="item.icon"></ui-icon>
|
|
115
|
-
<span
|
|
115
|
+
<span>{$item.label}</span>
|
|
116
116
|
</button>
|
|
117
117
|
</div>
|
|
118
118
|
</div>
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<template component="ui-image" controller="./ui-image.js">
|
|
2
|
+
<defs>
|
|
3
|
+
<prop name="src" type="string" default="">The image source, used by the default media.</prop>
|
|
4
|
+
<prop name="alt" type="string" default="">A text alternative for the image.</prop>
|
|
5
|
+
<prop name="width" type="integer" nullable
|
|
6
|
+
>Image width in CSS pixels; omitted uses intrinsic size in block/center placement or responsive sizing when wrapping.</prop>
|
|
7
|
+
<prop name="height" type="integer" nullable>Image height in CSS pixels; resizing preserves the intrinsic aspect ratio.</prop>
|
|
8
|
+
<prop name="placement" type="keyword" values="block, center, wrap-left, wrap-right" default="block"
|
|
9
|
+
>Block keeps text below; center centers the image; wrap-left and wrap-right let following text flow beside it.</prop>
|
|
10
|
+
<prop name="selected" type="boolean" default="false">Outlines the media as the current selection.</prop>
|
|
11
|
+
<prop name="resizable" type="boolean" default="false"
|
|
12
|
+
>Shows four corner handles while selected. Drag to resize, or focus a handle and use arrow keys; Shift uses a larger increment.</prop>
|
|
13
|
+
<event name="resize" type="object">
|
|
14
|
+
<prop name="width" type="integer" required></prop>
|
|
15
|
+
<prop name="height" type="integer" required></prop>
|
|
16
|
+
<prop name="phase" type="keyword" values="preview, commit, cancel" required></prop>
|
|
17
|
+
<prop name="trigger" type="keyword" values="pointer, keyboard" required></prop>
|
|
18
|
+
Reports resize intent. Preview is transient; the consumer persists a commit. Escape and pointer cancellation restore the original size.
|
|
19
|
+
</event>
|
|
20
|
+
</defs>
|
|
21
|
+
<figure>
|
|
22
|
+
<div class="frame" $ref="frame">
|
|
23
|
+
<slot name="media"><img from:src="src" from:alt="alt" from:width="width" from:height="height"></slot>
|
|
24
|
+
<div class="handles" from:hidden="not (selected and resizable)">
|
|
25
|
+
<button type="button" class="handle" data-corner="top-left" aria-label="Resize image from top left"></button>
|
|
26
|
+
<button type="button" class="handle" data-corner="top-right" aria-label="Resize image from top right"></button>
|
|
27
|
+
<button type="button" class="handle" data-corner="bottom-left" aria-label="Resize image from bottom left"></button>
|
|
28
|
+
<button type="button" class="handle" data-corner="bottom-right" aria-label="Resize image from bottom right"></button>
|
|
29
|
+
</div>
|
|
30
|
+
<slot name="controls"></slot>
|
|
31
|
+
</div>
|
|
32
|
+
</figure>
|
|
33
|
+
<style>
|
|
34
|
+
:host {
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: flex-start;
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
max-inline-size: 100%;
|
|
39
|
+
min-inline-size: 0;
|
|
40
|
+
margin: 0;
|
|
41
|
+
padding: var(--ui-space-3) 0;
|
|
42
|
+
}
|
|
43
|
+
:host-state([placement="center"]) {
|
|
44
|
+
justify-content: center;
|
|
45
|
+
}
|
|
46
|
+
:host-state([placement="wrap-left"]) {
|
|
47
|
+
float: left;
|
|
48
|
+
padding-inline-end: var(--ui-space-4);
|
|
49
|
+
}
|
|
50
|
+
:host-state([placement="wrap-right"]) {
|
|
51
|
+
float: right;
|
|
52
|
+
padding-inline-start: var(--ui-space-4);
|
|
53
|
+
}
|
|
54
|
+
:host:is(:host-state([placement="wrap-left"]), :host-state([placement="wrap-right"])) {
|
|
55
|
+
inline-size: calc(var(--_ui-image-width, calc(100% / 3)) + var(--ui-space-4));
|
|
56
|
+
}
|
|
57
|
+
:host:is(:host-state([placement="wrap-left"]), :host-state([placement="wrap-right"])) .frame {
|
|
58
|
+
inline-size: 100%;
|
|
59
|
+
}
|
|
60
|
+
:host:is(:host-state([placement="wrap-left"]), :host-state([placement="wrap-right"])) .frame img,
|
|
61
|
+
:host:is(:host-state([placement="wrap-left"]), :host-state([placement="wrap-right"])) .frame :slotted(img) {
|
|
62
|
+
inline-size: 100%;
|
|
63
|
+
}
|
|
64
|
+
.frame {
|
|
65
|
+
position: relative;
|
|
66
|
+
flex: 0 1 auto;
|
|
67
|
+
inline-size: var(--_ui-image-width, fit-content);
|
|
68
|
+
max-inline-size: 100%;
|
|
69
|
+
min-inline-size: 0;
|
|
70
|
+
align-self: flex-start;
|
|
71
|
+
border-radius: var(--ui-radius-md);
|
|
72
|
+
}
|
|
73
|
+
.frame img, .frame :slotted(img) {
|
|
74
|
+
display: block;
|
|
75
|
+
max-inline-size: 100%;
|
|
76
|
+
block-size: auto;
|
|
77
|
+
margin: 0;
|
|
78
|
+
border-radius: inherit;
|
|
79
|
+
}
|
|
80
|
+
:host[data-resizing] .frame img, :host[data-resizing] .frame :slotted(img) {
|
|
81
|
+
inline-size: 100%;
|
|
82
|
+
}
|
|
83
|
+
:host-state([selected]) .frame {
|
|
84
|
+
outline: var(--ui-focus-width) solid var(--ui-focus-ring);
|
|
85
|
+
outline-offset: var(--ui-border-width);
|
|
86
|
+
}
|
|
87
|
+
.handle {
|
|
88
|
+
position: absolute;
|
|
89
|
+
z-index: 1;
|
|
90
|
+
inline-size: 24px;
|
|
91
|
+
block-size: 24px;
|
|
92
|
+
padding: 0;
|
|
93
|
+
border: 0;
|
|
94
|
+
background: transparent;
|
|
95
|
+
touch-action: none;
|
|
96
|
+
}
|
|
97
|
+
.handle::after {
|
|
98
|
+
content: "";
|
|
99
|
+
position: absolute;
|
|
100
|
+
inset: 8px;
|
|
101
|
+
background: var(--ui-surface);
|
|
102
|
+
border: var(--ui-border-width) solid var(--ui-focus-ring);
|
|
103
|
+
border-radius: var(--ui-radius-sm);
|
|
104
|
+
}
|
|
105
|
+
.handle:focus-visible {
|
|
106
|
+
outline: var(--ui-focus-width) solid var(--ui-focus-ring);
|
|
107
|
+
border-radius: var(--ui-radius-sm);
|
|
108
|
+
}
|
|
109
|
+
.handle[data-corner="top-left"] {
|
|
110
|
+
top: -12px;
|
|
111
|
+
left: -12px;
|
|
112
|
+
cursor: nwse-resize;
|
|
113
|
+
}
|
|
114
|
+
.handle[data-corner="top-right"] {
|
|
115
|
+
top: -12px;
|
|
116
|
+
right: -12px;
|
|
117
|
+
cursor: nesw-resize;
|
|
118
|
+
}
|
|
119
|
+
.handle[data-corner="bottom-left"] {
|
|
120
|
+
bottom: -12px;
|
|
121
|
+
left: -12px;
|
|
122
|
+
cursor: nesw-resize;
|
|
123
|
+
}
|
|
124
|
+
.handle[data-corner="bottom-right"] {
|
|
125
|
+
bottom: -12px;
|
|
126
|
+
right: -12px;
|
|
127
|
+
cursor: nwse-resize;
|
|
128
|
+
}
|
|
129
|
+
.handles[hidden], :host[hidden] {
|
|
130
|
+
display: none;
|
|
131
|
+
}
|
|
132
|
+
@media (max-width: 767px) {
|
|
133
|
+
:host:is(:host-state([placement="wrap-left"]), :host-state([placement="wrap-right"])) {
|
|
134
|
+
float: none;
|
|
135
|
+
inline-size: 100%;
|
|
136
|
+
padding-inline: 0;
|
|
137
|
+
}
|
|
138
|
+
:host:is(:host-state([placement="wrap-left"]), :host-state([placement="wrap-right"])) .handles {
|
|
139
|
+
display: none;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
@media (pointer: coarse) {
|
|
143
|
+
.handle {
|
|
144
|
+
inline-size: 44px;
|
|
145
|
+
block-size: 44px;
|
|
146
|
+
}
|
|
147
|
+
.handle::after {
|
|
148
|
+
inset: 18px;
|
|
149
|
+
}
|
|
150
|
+
.handle[data-corner="top-left"] {
|
|
151
|
+
top: -22px;
|
|
152
|
+
left: -22px;
|
|
153
|
+
}
|
|
154
|
+
.handle[data-corner="top-right"] {
|
|
155
|
+
top: -22px;
|
|
156
|
+
right: -22px;
|
|
157
|
+
}
|
|
158
|
+
.handle[data-corner="bottom-left"] {
|
|
159
|
+
bottom: -22px;
|
|
160
|
+
left: -22px;
|
|
161
|
+
}
|
|
162
|
+
.handle[data-corner="bottom-right"] {
|
|
163
|
+
bottom: -22px;
|
|
164
|
+
right: -22px;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
@media (forced-colors: active) {
|
|
168
|
+
:host-state([selected]) .frame, .handle:focus-visible {
|
|
169
|
+
outline-color: Highlight;
|
|
170
|
+
}
|
|
171
|
+
.handle::after {
|
|
172
|
+
border-color: Highlight;
|
|
173
|
+
background: Canvas;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
</style>
|
|
177
|
+
</template>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/** Owns transient resize geometry; consumers own persistence and selection.
|
|
2
|
+
* @lifecycle Pointer capture ends on release, Escape, cancellation, or teardown.
|
|
3
|
+
* Only release commits a drag, so consumers can make it one undo operation.
|
|
4
|
+
*/
|
|
5
|
+
export default function controller(host) {
|
|
6
|
+
const root = host.element;
|
|
7
|
+
const frame = host.refs.frame;
|
|
8
|
+
const document = root.ownerDocument;
|
|
9
|
+
let drag = null;
|
|
10
|
+
const image = () => frame.querySelector("img");
|
|
11
|
+
const enabled = () => host.props.selected.value && host.props.resizable.value;
|
|
12
|
+
const measure = () => {
|
|
13
|
+
const media = image();
|
|
14
|
+
const rect = media.getBoundingClientRect();
|
|
15
|
+
return { width: rect.width, height: rect.height, ratio: (media.naturalHeight || rect.height || 1) / (media.naturalWidth || rect.width || 1) };
|
|
16
|
+
};
|
|
17
|
+
const dimensions = (width, ratio) => {
|
|
18
|
+
// The containing document bounds the media even when this figure floats.
|
|
19
|
+
const container = root.parentElement;
|
|
20
|
+
const style = document.defaultView.getComputedStyle(container);
|
|
21
|
+
const available = container.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);
|
|
22
|
+
const gap = parseFloat(document.defaultView.getComputedStyle(root).paddingLeft) + parseFloat(document.defaultView.getComputedStyle(root).paddingRight);
|
|
23
|
+
const maximum = Math.max(1, available - gap);
|
|
24
|
+
const next = Math.round(Math.min(maximum, Math.max(Math.min(32, maximum), width)));
|
|
25
|
+
return { width: next, height: Math.max(1, Math.round(next * ratio)) };
|
|
26
|
+
};
|
|
27
|
+
const restore = () => {
|
|
28
|
+
root.removeAttribute("data-resizing");
|
|
29
|
+
const width = host.props.width.value;
|
|
30
|
+
if (width > 0) root.style.setProperty("--_ui-image-width", `${width}px`);
|
|
31
|
+
else root.style.removeProperty("--_ui-image-width");
|
|
32
|
+
};
|
|
33
|
+
const dispatch = (size, phase, trigger) => host.dispatch("resize", { ...size, phase, trigger });
|
|
34
|
+
const finish = (phase) => {
|
|
35
|
+
if (!drag) return;
|
|
36
|
+
const current = drag;
|
|
37
|
+
drag = null;
|
|
38
|
+
document.removeEventListener("keydown", onEscape, true);
|
|
39
|
+
if (current.handle.hasPointerCapture(current.pointer)) current.handle.releasePointerCapture(current.pointer);
|
|
40
|
+
if (phase === "commit" && !current.moved) phase = "cancel";
|
|
41
|
+
restore();
|
|
42
|
+
dispatch(phase === "commit" ? current.size : { width: Math.round(current.width), height: Math.round(current.height) }, phase, "pointer");
|
|
43
|
+
};
|
|
44
|
+
const onDown = (event) => {
|
|
45
|
+
const handle = event.target.closest("[data-corner]");
|
|
46
|
+
if (!enabled() || !handle || !root.contains(handle) || event.button !== 0 || drag) return;
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
const measured = measure();
|
|
49
|
+
drag = { ...measured, x: event.clientX, y: event.clientY, handle, pointer: event.pointerId, size: dimensions(measured.width, measured.ratio) };
|
|
50
|
+
handle.setPointerCapture(event.pointerId);
|
|
51
|
+
document.addEventListener("keydown", onEscape, true);
|
|
52
|
+
root.setAttribute("data-resizing", "");
|
|
53
|
+
};
|
|
54
|
+
const onMove = (event) => {
|
|
55
|
+
if (!drag || drag.pointer !== event.pointerId) return;
|
|
56
|
+
const corner = drag.handle.dataset.corner;
|
|
57
|
+
const dx = (event.clientX - drag.x) * (corner.endsWith("left") ? -1 : 1);
|
|
58
|
+
const dy = (event.clientY - drag.y) * (corner.startsWith("top") ? -1 : 1);
|
|
59
|
+
// Project onto the aspect-ratio diagonal: either axis can drive a corner.
|
|
60
|
+
const delta = (dx + drag.ratio * dy) / (1 + drag.ratio * drag.ratio);
|
|
61
|
+
drag.size = dimensions(drag.width + delta, drag.ratio);
|
|
62
|
+
drag.moved = drag.size.width !== Math.round(drag.width);
|
|
63
|
+
root.style.setProperty("--_ui-image-width", `${drag.size.width}px`);
|
|
64
|
+
dispatch(drag.size, "preview", "pointer");
|
|
65
|
+
};
|
|
66
|
+
const onUp = event => { if (drag?.pointer === event.pointerId) finish("commit"); };
|
|
67
|
+
const onCancel = event => { if (drag?.pointer === event.pointerId) finish("cancel"); };
|
|
68
|
+
const onEscape = (event) => {
|
|
69
|
+
if (event.key !== "Escape" || !drag) return;
|
|
70
|
+
event.preventDefault(); event.stopPropagation(); finish("cancel");
|
|
71
|
+
};
|
|
72
|
+
const onKey = (event) => {
|
|
73
|
+
const handle = event.target.closest?.("[data-corner]");
|
|
74
|
+
if (!enabled() || !handle || !root.contains(handle) || !["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(event.key)) return;
|
|
75
|
+
event.preventDefault(); event.stopPropagation();
|
|
76
|
+
const measured = measure();
|
|
77
|
+
const horizontal = event.key === "ArrowLeft" || event.key === "ArrowRight";
|
|
78
|
+
const backwards = event.key === "ArrowLeft" || event.key === "ArrowUp";
|
|
79
|
+
const reverse = horizontal ? handle.dataset.corner.endsWith("left") : handle.dataset.corner.startsWith("top");
|
|
80
|
+
const amount = (backwards !== reverse ? -1 : 1) * (event.shiftKey ? 32 : 8);
|
|
81
|
+
dispatch(dimensions(measured.width + amount / (horizontal ? 1 : measured.ratio), measured.ratio), "commit", "keyboard");
|
|
82
|
+
};
|
|
83
|
+
const stop = host.effect(() => {
|
|
84
|
+
// Read all external geometry before deciding whether to abandon a preview.
|
|
85
|
+
host.props.width.value; host.props.height.value; host.props.placement.value;
|
|
86
|
+
if (drag) finish("cancel");
|
|
87
|
+
restore();
|
|
88
|
+
enabled();
|
|
89
|
+
});
|
|
90
|
+
root.addEventListener("pointerdown", onDown);
|
|
91
|
+
root.addEventListener("pointermove", onMove);
|
|
92
|
+
root.addEventListener("pointerup", onUp);
|
|
93
|
+
root.addEventListener("pointercancel", onCancel);
|
|
94
|
+
root.addEventListener("lostpointercapture", onCancel);
|
|
95
|
+
root.addEventListener("keydown", onKey);
|
|
96
|
+
return () => {
|
|
97
|
+
stop();
|
|
98
|
+
if (drag) { const active = drag; drag = null; if (active.handle.hasPointerCapture(active.pointer)) active.handle.releasePointerCapture(active.pointer); }
|
|
99
|
+
root.removeEventListener("pointerdown", onDown);
|
|
100
|
+
root.removeEventListener("pointermove", onMove);
|
|
101
|
+
root.removeEventListener("pointerup", onUp);
|
|
102
|
+
root.removeEventListener("pointercancel", onCancel);
|
|
103
|
+
root.removeEventListener("lostpointercapture", onCancel);
|
|
104
|
+
root.removeEventListener("keydown", onKey);
|
|
105
|
+
document.removeEventListener("keydown", onEscape, true);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
@@ -104,7 +104,7 @@ export default function controller(host) {
|
|
|
104
104
|
const onClick = (event) => select(menuItemFrom(event.target), triggerFor(event));
|
|
105
105
|
const onKeydown = (event) => {
|
|
106
106
|
if (event.key === "Escape") {
|
|
107
|
-
if (host.props.inline.value) return;
|
|
107
|
+
if (host.props.inline.value || event.defaultPrevented) return;
|
|
108
108
|
event.preventDefault();
|
|
109
109
|
requestTopOverlayClose(document, "escape", "keyboard");
|
|
110
110
|
return;
|
|
@@ -81,7 +81,10 @@ export default function controller(host) {
|
|
|
81
81
|
lastOpen = open;
|
|
82
82
|
};
|
|
83
83
|
const onKeydown = (event) => {
|
|
84
|
-
if (event.key === "Escape"
|
|
84
|
+
if (event.key === "Escape" && !event.defaultPrevented) {
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
requestTopOverlayClose(document, "escape", "keyboard");
|
|
87
|
+
}
|
|
85
88
|
};
|
|
86
89
|
element.addEventListener("keydown", onKeydown);
|
|
87
90
|
const stop = host.effect(apply);
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="orientation" type="keyword" values="horizontal, vertical" default="horizontal"
|
|
4
4
|
>Whether the separator divides stacked content (horizontal) or inline content (vertical).</prop>
|
|
5
|
+
<prop name="selectable" type="boolean" default="false">Gives a document divider a pointer-sized hit area. The editor owns selection and deletion.</prop>
|
|
6
|
+
<prop name="selected" type="boolean" default="false">Shows the selected document divider. Selection does not change separator semantics.</prop>
|
|
5
7
|
</defs>
|
|
6
8
|
<hr from:aria-orientation="orientation">
|
|
7
9
|
<style>
|
|
@@ -25,5 +27,21 @@
|
|
|
25
27
|
border-block-start: 0;
|
|
26
28
|
border-inline-start: var(--ui-border-width) solid var(--ui-separator-color, var(--ui-border-divider));
|
|
27
29
|
}
|
|
30
|
+
|
|
31
|
+
:host-state([selectable]) {
|
|
32
|
+
min-block-size: var(--ui-control-size-sm);
|
|
33
|
+
border: 0;
|
|
34
|
+
background: linear-gradient(var(--ui-separator-color, var(--ui-border-divider)), var(--ui-separator-color, var(--ui-border-divider))) center / 100%
|
|
35
|
+
var(--ui-border-width) no-repeat;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
:host-state([selectable]):hover {
|
|
39
|
+
background-color: var(--ui-surface-hover);
|
|
40
|
+
}
|
|
41
|
+
:host-state([selected]) {
|
|
42
|
+
outline: var(--ui-focus-width) solid var(--ui-focus-ring);
|
|
43
|
+
outline-offset: var(--ui-focus-width);
|
|
44
|
+
border-radius: var(--ui-radius-sm);
|
|
45
|
+
}
|
|
28
46
|
</style>
|
|
29
47
|
</template>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
from:role="toast.role"
|
|
38
38
|
from:data-tone="toast.tone"
|
|
39
39
|
>
|
|
40
|
-
<span class="message"
|
|
40
|
+
<span class="message">{$toast.message}</span>
|
|
41
41
|
<span class="dismiss" from:data-toast="toast.id">
|
|
42
42
|
<ui-icon-button size="sm" variant="ghost" from:round="true" from:label="concat('Dismiss ', toast.message)">
|
|
43
43
|
<ui-icon name="x"></ui-icon>
|