@threadlabs/looma 0.30.9 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ui-affordance-scope/ui-affordance-scope.html +1 -1
- package/components/ui-affordance-scope/ui-affordance-scope.js +1 -6
- package/components/ui-avatar/ui-avatar.html +1 -1
- package/components/ui-avatar/ui-avatar.js +1 -6
- package/components/ui-avatar-group/ui-avatar-group.html +1 -1
- package/components/ui-avatar-group/ui-avatar-group.js +1 -6
- package/components/ui-button/ui-button.html +1 -1
- package/components/ui-button/ui-button.js +1 -6
- package/components/ui-checkbox/ui-checkbox.html +1 -1
- package/components/ui-checkbox/ui-checkbox.js +1 -6
- package/components/ui-combobox/ui-combobox.html +1 -1
- package/components/ui-combobox/ui-combobox.js +1 -6
- package/components/ui-context-menu/ui-context-menu.html +1 -1
- package/components/ui-context-menu/ui-context-menu.js +1 -6
- package/components/ui-dialog/ui-dialog.html +1 -1
- package/components/ui-dialog/ui-dialog.js +1 -6
- package/components/ui-disclosure/ui-disclosure.html +1 -1
- package/components/ui-disclosure/ui-disclosure.js +1 -6
- package/components/ui-editable/ui-editable.html +1 -1
- package/components/ui-editable/ui-editable.js +1 -6
- package/components/ui-editor-block-actions/ui-editor-block-actions.html +1 -1
- package/components/ui-editor-block-actions/ui-editor-block-actions.js +1 -6
- package/components/ui-editor-chip-editor/ui-editor-chip-editor.html +1 -1
- package/components/ui-editor-chip-editor/ui-editor-chip-editor.js +1 -6
- package/components/ui-editor-code-language/ui-editor-code-language.html +1 -1
- package/components/ui-editor-code-language/ui-editor-code-language.js +1 -6
- package/components/ui-editor-image-toolbar/ui-editor-image-toolbar.html +1 -1
- package/components/ui-editor-image-toolbar/ui-editor-image-toolbar.js +1 -6
- package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.html +1 -1
- package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.js +1 -6
- package/components/ui-editor-link-card/ui-editor-link-card.html +1 -1
- package/components/ui-editor-link-card/ui-editor-link-card.js +1 -6
- package/components/ui-editor-link-form/ui-editor-link-form.html +1 -1
- package/components/ui-editor-link-form/ui-editor-link-form.js +1 -6
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +1 -1
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.js +1 -6
- package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +1 -1
- package/components/ui-editor-slash-menu/ui-editor-slash-menu.js +1 -6
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +1 -1
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.js +1 -6
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +1 -1
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.js +1 -6
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +1 -1
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.js +1 -6
- package/components/ui-editor-toolbar/ui-editor-toolbar.html +1 -1
- package/components/ui-editor-toolbar/ui-editor-toolbar.js +1 -6
- package/components/ui-form-field/ui-form-field.html +1 -1
- package/components/ui-form-field/ui-form-field.js +1 -6
- package/components/ui-icon-button/ui-icon-button.html +1 -1
- package/components/ui-icon-button/ui-icon-button.js +1 -6
- package/components/ui-image/ui-image.html +1 -1
- package/components/ui-image/ui-image.js +1 -6
- package/components/ui-input/ui-input.html +1 -1
- package/components/ui-input/ui-input.js +1 -6
- package/components/ui-input-group/ui-input-group.html +1 -1
- package/components/ui-input-group/ui-input-group.js +1 -6
- package/components/ui-listbox/ui-listbox.html +1 -1
- package/components/ui-listbox/ui-listbox.js +1 -6
- package/components/ui-menu/ui-menu.html +1 -1
- package/components/ui-menu/ui-menu.js +1 -6
- package/components/ui-menu-item/ui-menu-item.html +1 -1
- package/components/ui-menu-item/ui-menu-item.js +1 -6
- package/components/ui-popover/ui-popover.html +1 -1
- package/components/ui-popover/ui-popover.js +1 -6
- package/components/ui-radio/ui-radio.html +1 -1
- package/components/ui-radio/ui-radio.js +1 -6
- package/components/ui-radio-group/ui-radio-group.html +1 -1
- package/components/ui-radio-group/ui-radio-group.js +1 -6
- package/components/ui-scroll-area/ui-scroll-area.html +1 -1
- package/components/ui-scroll-area/ui-scroll-area.js +1 -6
- package/components/ui-search-shell/ui-search-shell.html +1 -1
- package/components/ui-search-shell/ui-search-shell.js +1 -6
- package/components/ui-select/ui-select.html +1 -1
- package/components/ui-select/ui-select.js +1 -6
- package/components/ui-sidebar/ui-sidebar.html +1 -1
- package/components/ui-sidebar/ui-sidebar.js +1 -6
- package/components/ui-switch/ui-switch.html +1 -1
- package/components/ui-switch/ui-switch.js +1 -6
- package/components/ui-switcher/ui-switcher.html +1 -1
- package/components/ui-switcher/ui-switcher.js +1 -6
- package/components/ui-table/ui-table.html +1 -1
- package/components/ui-table/ui-table.js +1 -6
- package/components/ui-tabs/ui-tabs.html +1 -1
- package/components/ui-tabs/ui-tabs.js +1 -6
- package/components/ui-textarea/ui-textarea.html +1 -1
- package/components/ui-textarea/ui-textarea.js +1 -6
- package/components/ui-toast/ui-toast.html +1 -1
- package/components/ui-toast/ui-toast.js +1 -6
- package/components/ui-toast-region/ui-toast-region.html +1 -1
- package/components/ui-toast-region/ui-toast-region.js +1 -6
- package/components/ui-tooltip/ui-tooltip.html +1 -1
- package/components/ui-tooltip/ui-tooltip.js +1 -6
- package/components/ui-tree/ui-tree.html +1 -1
- package/components/ui-tree/ui-tree.js +1 -6
- package/components/ui-tree-item/ui-tree-item.html +1 -1
- package/components/ui-tree-item/ui-tree-item.js +1 -6
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/vanilla/UiAffordanceScope.js +4 -4
- package/vanilla/UiAvatar.js +4 -4
- package/vanilla/UiAvatarGroup.js +4 -4
- package/vanilla/UiButton.js +4 -4
- package/vanilla/UiCheckbox.js +4 -4
- package/vanilla/UiCombobox.js +4 -4
- package/vanilla/UiContextMenu.js +4 -4
- package/vanilla/UiDialog.js +4 -4
- package/vanilla/UiDisclosure.js +4 -4
- package/vanilla/UiEditable.js +4 -4
- package/vanilla/UiEditorBlockActions.js +4 -4
- package/vanilla/UiEditorChipEditor.js +4 -4
- package/vanilla/UiEditorCodeLanguage.js +4 -4
- package/vanilla/UiEditorImageToolbar.js +4 -4
- package/vanilla/UiEditorInsertTableGrid.js +4 -4
- package/vanilla/UiEditorLinkCard.js +4 -4
- package/vanilla/UiEditorLinkForm.js +4 -4
- package/vanilla/UiEditorMentionMenu.js +4 -4
- package/vanilla/UiEditorSlashMenu.js +4 -4
- package/vanilla/UiEditorTableContextMenu.js +4 -4
- package/vanilla/UiEditorTableOverlay.js +4 -4
- package/vanilla/UiEditorTableToolbar.js +4 -4
- package/vanilla/UiEditorToolbar.js +4 -4
- package/vanilla/UiFormField.js +4 -4
- package/vanilla/UiIconButton.js +4 -4
- package/vanilla/UiImage.js +4 -4
- package/vanilla/UiInput.js +4 -4
- package/vanilla/UiInputGroup.js +4 -4
- package/vanilla/UiListbox.js +4 -4
- package/vanilla/UiMenu.js +4 -4
- package/vanilla/UiMenuItem.js +4 -4
- package/vanilla/UiPopover.js +4 -4
- package/vanilla/UiRadio.js +4 -4
- package/vanilla/UiRadioGroup.js +4 -4
- package/vanilla/UiScrollArea.js +4 -4
- package/vanilla/UiSearchShell.js +4 -4
- package/vanilla/UiSelect.js +4 -4
- package/vanilla/UiSidebar.js +4 -4
- package/vanilla/UiSwitch.js +4 -4
- package/vanilla/UiSwitcher.js +4 -4
- package/vanilla/UiTable.js +4 -4
- package/vanilla/UiTabs.js +4 -4
- package/vanilla/UiTextarea.js +4 -4
- package/vanilla/UiToast.js +4 -4
- package/vanilla/UiToastRegion.js +4 -4
- package/vanilla/UiTooltip.js +4 -4
- package/vanilla/UiTree.js +4 -4
- package/vanilla/UiTreeItem.js +4 -4
- package/vue/UiAffordanceScope.vue +1 -0
- package/vue/UiAvatar.vue +1 -0
- package/vue/UiAvatarGroup.vue +1 -0
- package/vue/UiButton.vue +1 -0
- package/vue/UiCheckbox.vue +1 -0
- package/vue/UiCombobox.vue +1 -0
- package/vue/UiContextMenu.vue +1 -0
- package/vue/UiDialog.vue +1 -0
- package/vue/UiDisclosure.vue +1 -0
- package/vue/UiEditable.vue +1 -0
- package/vue/UiEditorBlockActions.vue +1 -0
- package/vue/UiEditorChipEditor.vue +1 -0
- package/vue/UiEditorCodeLanguage.vue +1 -0
- package/vue/UiEditorImageToolbar.vue +1 -0
- package/vue/UiEditorInsertTableGrid.vue +1 -0
- package/vue/UiEditorLinkCard.vue +1 -0
- package/vue/UiEditorLinkForm.vue +1 -0
- package/vue/UiEditorMentionMenu.vue +1 -0
- package/vue/UiEditorSlashMenu.vue +1 -0
- package/vue/UiEditorTableContextMenu.vue +1 -0
- package/vue/UiEditorTableOverlay.vue +1 -0
- package/vue/UiEditorTableToolbar.vue +1 -0
- package/vue/UiEditorToolbar.vue +1 -0
- package/vue/UiFormField.vue +1 -0
- package/vue/UiIconButton.vue +1 -0
- package/vue/UiImage.vue +1 -0
- package/vue/UiInput.vue +1 -0
- package/vue/UiInputGroup.vue +1 -0
- package/vue/UiListbox.vue +1 -0
- package/vue/UiMenu.vue +1 -0
- package/vue/UiMenuItem.vue +1 -0
- package/vue/UiPopover.vue +1 -0
- package/vue/UiRadio.vue +1 -0
- package/vue/UiRadioGroup.vue +1 -0
- package/vue/UiScrollArea.vue +1 -0
- package/vue/UiSearchShell.vue +1 -0
- package/vue/UiSelect.vue +1 -0
- package/vue/UiSidebar.vue +1 -0
- package/vue/UiSwitch.vue +1 -0
- package/vue/UiSwitcher.vue +1 -0
- package/vue/UiTable.vue +1 -0
- package/vue/UiTabs.vue +1 -0
- package/vue/UiTextarea.vue +1 -0
- package/vue/UiToast.vue +1 -0
- package/vue/UiToastRegion.vue +1 -0
- package/vue/UiTooltip.vue +1 -0
- package/vue/UiTree.vue +1 -0
- package/vue/UiTreeItem.vue +1 -0
- package/vue/chunks/UiAffordanceScope.js +2 -1
- package/vue/chunks/UiAvatar.js +2 -1
- package/vue/chunks/UiAvatarGroup.js +2 -1
- package/vue/chunks/UiButton.js +2 -1
- package/vue/chunks/UiCheckbox.js +2 -1
- package/vue/chunks/UiCombobox.js +2 -1
- package/vue/chunks/UiContextMenu.js +2 -1
- package/vue/chunks/UiDialog.js +2 -1
- package/vue/chunks/UiDisclosure.js +2 -1
- package/vue/chunks/UiEditable.js +2 -1
- package/vue/chunks/UiEditorBlockActions.js +1 -0
- package/vue/chunks/UiEditorChipEditor.js +1 -0
- package/vue/chunks/UiEditorCodeLanguage.js +1 -0
- package/vue/chunks/UiEditorImageToolbar.js +1 -0
- package/vue/chunks/UiEditorInsertTableGrid.js +2 -1
- package/vue/chunks/UiEditorLinkCard.js +1 -0
- package/vue/chunks/UiEditorLinkForm.js +1 -0
- package/vue/chunks/UiEditorMentionMenu.js +2 -1
- package/vue/chunks/UiEditorSlashMenu.js +2 -1
- package/vue/chunks/UiEditorTableContextMenu.js +2 -1
- package/vue/chunks/UiEditorTableOverlay.js +2 -1
- package/vue/chunks/UiEditorTableToolbar.js +2 -1
- package/vue/chunks/UiEditorToolbar.js +2 -1
- package/vue/chunks/UiFormField.js +2 -1
- package/vue/chunks/UiIconButton.js +2 -1
- package/vue/chunks/UiImage.js +2 -1
- package/vue/chunks/UiInput.js +2 -1
- package/vue/chunks/UiInputGroup.js +2 -1
- package/vue/chunks/UiListbox.js +2 -1
- package/vue/chunks/UiMenu.js +2 -1
- package/vue/chunks/UiMenuItem.js +2 -1
- package/vue/chunks/UiPopover.js +2 -1
- package/vue/chunks/UiRadio.js +2 -1
- package/vue/chunks/UiRadioGroup.js +2 -1
- package/vue/chunks/UiScrollArea.js +2 -1
- package/vue/chunks/UiSearchShell.js +2 -1
- package/vue/chunks/UiSelect.js +2 -1
- package/vue/chunks/UiSidebar.js +2 -1
- package/vue/chunks/UiSwitch.js +2 -1
- package/vue/chunks/UiSwitcher.js +2 -1
- package/vue/chunks/UiTable.js +2 -1
- package/vue/chunks/UiTabs.js +2 -1
- package/vue/chunks/UiTextarea.js +2 -1
- package/vue/chunks/UiToast.js +2 -1
- package/vue/chunks/UiToastRegion.js +2 -1
- package/vue/chunks/UiTooltip.js +2 -1
- package/vue/chunks/UiTree.js +2 -1
- package/vue/chunks/UiTreeItem.js +2 -1
- package/vue/components.css +16 -16
- package/vue/editor/index.js +61 -73
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template component="ui-affordance-scope"
|
|
1
|
+
<template component="ui-affordance-scope" module="./ui-affordance-scope.js">
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="nearRadius" type="number" default="16">How close, in pixels, the pointer must come to reveal an affordance.</prop>
|
|
4
4
|
<prop name="guide" type="keyword" values="dot, none" default="dot"
|
|
@@ -6,7 +6,7 @@ function distance(point, rect) {
|
|
|
6
6
|
return Math.hypot(dx, dy);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
function connect(host) {
|
|
9
|
+
export function connect(host) {
|
|
10
10
|
const element = host.element;
|
|
11
11
|
const owner = element.ownerDocument.defaultView;
|
|
12
12
|
let anchors = [];
|
|
@@ -70,8 +70,3 @@ function connect(host) {
|
|
|
70
70
|
clear();
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
75
|
-
export default function controller(host) {
|
|
76
|
-
host.on("connect", () => connect(host));
|
|
77
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<link rel="component" href="../ui-icon/ui-icon.html">
|
|
2
|
-
<template component="ui-avatar"
|
|
2
|
+
<template component="ui-avatar" module="./ui-avatar.js">
|
|
3
3
|
<defs>
|
|
4
4
|
<prop name="src" type="string"
|
|
5
5
|
>The image to show, cropped to fill the circle. Until it loads, or if it fails, the avatar shows initials instead. An img element authored inside the avatar
|
|
@@ -6,7 +6,7 @@ function toInitials(value) {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
// Shows an authored <img>, else the `src` image, else initials, and tracks whether the image loaded.
|
|
9
|
-
function connect(host) {
|
|
9
|
+
export function connect(host) {
|
|
10
10
|
const element = host.element;
|
|
11
11
|
const managed = host.refs.image;
|
|
12
12
|
let active;
|
|
@@ -51,8 +51,3 @@ function connect(host) {
|
|
|
51
51
|
active?.removeEventListener("error", onError);
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
56
|
-
export default function controller(host) {
|
|
57
|
-
host.on("connect", () => connect(host));
|
|
58
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template component="ui-avatar-group"
|
|
1
|
+
<template component="ui-avatar-group" module="./ui-avatar-group.js">
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="max" type="number" default="5"
|
|
4
4
|
>How many avatars to show. The rest are hidden and counted in a +N badge after the last visible one. Fractions round down, and 0 hides every avatar behind
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Hides avatars beyond `max`, counts them into the "+N" badge, and overlaps the rest. Projected
|
|
2
2
|
// avatars are component roots, which this component's styles do not reach, so the overlap is inline.
|
|
3
|
-
function connect(host) {
|
|
3
|
+
export function connect(host) {
|
|
4
4
|
const element = host.element;
|
|
5
5
|
const update = () => {
|
|
6
6
|
const max = Number(host.props.max.value);
|
|
@@ -31,8 +31,3 @@ function connect(host) {
|
|
|
31
31
|
observer.disconnect();
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
36
|
-
export default function controller(host) {
|
|
37
|
-
host.on("connect", () => connect(host));
|
|
38
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<link rel="component" href="../ui-spinner/ui-spinner.html">
|
|
2
2
|
<link rel="component" href="../ui-icon/ui-icon.html">
|
|
3
|
-
<template component="ui-button"
|
|
3
|
+
<template component="ui-button" module="./ui-button.js">
|
|
4
4
|
<defs>
|
|
5
5
|
<prop name="variant" type="keyword" values="outline, solid, danger, ghost, link, card, field" default="outline"
|
|
6
6
|
>Emphasis: how loudly the button asks. solid fills with its tone, outline draws its tone at the edge over a wash of it, ghost carries only text until it is
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Loading actions retain focus but cannot activate, navigate, submit, or notify click consumers.
|
|
2
|
-
function connect(host) {
|
|
2
|
+
export function connect(host) {
|
|
3
3
|
const onClick = (event) => {
|
|
4
4
|
if (!host.props.loading.value && !host.props.pending.value) return;
|
|
5
5
|
event.preventDefault();
|
|
@@ -8,8 +8,3 @@ function connect(host) {
|
|
|
8
8
|
host.element.addEventListener("click", onClick, true);
|
|
9
9
|
return () => host.element.removeEventListener("click", onClick, true);
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
13
|
-
export default function controller(host) {
|
|
14
|
-
host.on("connect", () => connect(host));
|
|
15
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template component="ui-checkbox"
|
|
1
|
+
<template component="ui-checkbox" module="./ui-checkbox.js">
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="label" type="string" default="">An accessible name for a checkbox without a visible label slot. It names the native input.</prop>
|
|
4
4
|
<prop name="checked" type="boolean" default="false"
|
|
@@ -5,7 +5,7 @@ import { trackTrigger } from "../shared/trigger.js";
|
|
|
5
5
|
// `checked` sets the control initially and whenever it changes; the user's changes update the state.
|
|
6
6
|
// A form reset returns the control to `checked`. Vue writes the checked attribute on every render, so
|
|
7
7
|
// the native default alone cannot hold it there.
|
|
8
|
-
function connect(host) {
|
|
8
|
+
export function connect(host) {
|
|
9
9
|
const input = host.refs.input;
|
|
10
10
|
describeInput(input, host.refs.description);
|
|
11
11
|
const [trigger, stopTracking] = trackTrigger(host);
|
|
@@ -33,8 +33,3 @@ function connect(host) {
|
|
|
33
33
|
input.removeEventListener("change", onChange);
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
38
|
-
export default function controller(host) {
|
|
39
|
-
host.on("connect", () => connect(host));
|
|
40
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<link rel="component" href="../ui-badge/ui-badge.html">
|
|
2
2
|
<link rel="component" href="../ui-tooltip/ui-tooltip.html">
|
|
3
|
-
<template component="ui-combobox"
|
|
3
|
+
<template component="ui-combobox" module="./ui-combobox.js">
|
|
4
4
|
<defs>
|
|
5
5
|
<prop name="label" type="string" default=""
|
|
6
6
|
>The field's label, tied to its input and shown above it; required adds an asterisk. It also names the suggestion list. Pair it with
|
|
@@ -21,7 +21,7 @@ function authoredOptions(container) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
function connect(host) {
|
|
24
|
+
export function connect(host) {
|
|
25
25
|
const element = host.element;
|
|
26
26
|
const document = element.ownerDocument;
|
|
27
27
|
const uid = `ui-combobox-${++comboboxes}`;
|
|
@@ -580,8 +580,3 @@ function connect(host) {
|
|
|
580
580
|
surface.destroy();
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
|
-
|
|
584
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
585
|
-
export default function controller(host) {
|
|
586
|
-
host.on("connect", () => connect(host));
|
|
587
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template component="ui-context-menu"
|
|
1
|
+
<template component="ui-context-menu" module="./ui-context-menu.js">
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="open" type="boolean" default="false">Whether the context menu is open initially or when set externally.</prop>
|
|
4
4
|
<prop name="for" type="string" default="">ID of the element whose context click (right-click, long-press, Shift+F10, or the Menu key) opens the menu.</prop>
|
|
@@ -5,7 +5,7 @@ function disabled(item) {
|
|
|
5
5
|
return item.getAttribute("aria-disabled") === "true" || item.hasAttribute("disabled") || item.getAttribute("disabled") === "true";
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
function connect(host) {
|
|
8
|
+
export function connect(host) {
|
|
9
9
|
const element = host.element;
|
|
10
10
|
const document = element.ownerDocument;
|
|
11
11
|
const menuSurface = host.refs.menu;
|
|
@@ -157,8 +157,3 @@ function connect(host) {
|
|
|
157
157
|
closeOverlay(document, overlayId);
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
|
|
161
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
162
|
-
export default function controller(host) {
|
|
163
|
-
host.on("connect", () => connect(host));
|
|
164
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<link rel="component" href="../ui-scroll-area/ui-scroll-area.html">
|
|
2
|
-
<template component="ui-dialog"
|
|
2
|
+
<template component="ui-dialog" module="./ui-dialog.js">
|
|
3
3
|
<defs>
|
|
4
4
|
<prop name="open" type="boolean" default="false">Whether the dialog is open initially or when set externally.</prop>
|
|
5
5
|
<prop name="modal" type="boolean" default="false"
|
|
@@ -54,7 +54,7 @@ function observeContentHeight(dialog, refs) {
|
|
|
54
54
|
return { reset, destroy() { reset(); observer.disconnect(); motion.removeEventListener("change", onMotionChange); } };
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
function connect(host) {
|
|
57
|
+
export function connect(host) {
|
|
58
58
|
const element = host.element;
|
|
59
59
|
const document = element.ownerDocument;
|
|
60
60
|
const dialog = element.localName === "dialog" ? element : element.querySelector("dialog");
|
|
@@ -186,8 +186,3 @@ function connect(host) {
|
|
|
186
186
|
closeOverlay(document, overlayId);
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
|
-
|
|
190
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
191
|
-
export default function controller(host) {
|
|
192
|
-
host.on("connect", () => connect(host));
|
|
193
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template component="ui-disclosure"
|
|
1
|
+
<template component="ui-disclosure" module="./ui-disclosure.js">
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="density" type="keyword" values="comfortable, compact" default="comfortable"
|
|
4
4
|
>Compact trades padding and type size for rows that fit more on screen.</prop>
|
|
@@ -34,7 +34,7 @@ function leaveGroup(document, name, member) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// `open` sets the disclosure initially and whenever it changes; the trigger toggles the state.
|
|
37
|
-
function connect(host) {
|
|
37
|
+
export function connect(host) {
|
|
38
38
|
const document = host.element.ownerDocument;
|
|
39
39
|
const [trigger, stopTracking] = trackTrigger(host);
|
|
40
40
|
host.state.contentId = `ui-disclosure-${++disclosures}`;
|
|
@@ -119,8 +119,3 @@ function connect(host) {
|
|
|
119
119
|
host.refs.panel.removeEventListener("beforematch", onBeforematch);
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
|
|
123
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
124
|
-
export default function controller(host) {
|
|
125
|
-
host.on("connect", () => connect(host));
|
|
126
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template component="ui-editable"
|
|
1
|
+
<template component="ui-editable" module="./ui-editable.js">
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="value" type="string" default=""
|
|
4
4
|
>The displayed value, and the text the editor starts from. It is not a form field: nothing is submitted with a form, so a form that needs the value copies
|
|
@@ -3,7 +3,7 @@ function triggerFor(event) {
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
/** Owns the display/edit transition so authors only provide value and label. */
|
|
6
|
-
function connect(host) {
|
|
6
|
+
export function connect(host) {
|
|
7
7
|
const element = host.element;
|
|
8
8
|
const document = element.ownerDocument;
|
|
9
9
|
const { preview, input } = host.refs;
|
|
@@ -119,8 +119,3 @@ function connect(host) {
|
|
|
119
119
|
document.removeEventListener("pointerdown", onDocumentPointerdown, true);
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
|
|
123
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
124
|
-
export default function controller(host) {
|
|
125
|
-
host.on("connect", () => connect(host));
|
|
126
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<link rel="component" href="../ui-menu/ui-menu.html">
|
|
2
2
|
<link rel="component" href="../ui-menu-item/ui-menu-item.html">
|
|
3
|
-
<template component="ui-editor-block-actions"
|
|
3
|
+
<template component="ui-editor-block-actions" module="./ui-editor-block-actions.js">
|
|
4
4
|
<defs>
|
|
5
5
|
<prop name="for" type="string" default="">The id of the button that opens the menu and anchors it.</prop>
|
|
6
6
|
<prop name="placement" type="keyword" values="bottom-start, top-start" default="bottom-start"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Reports the menu's choice as a block action.
|
|
2
|
-
function connect(host) {
|
|
2
|
+
export function connect(host) {
|
|
3
3
|
const element = host.element;
|
|
4
4
|
const onSelect = (event) => {
|
|
5
5
|
if (event.target !== element && element.contains(event.target)) host.dispatch("action", { action: event.detail.value });
|
|
@@ -7,8 +7,3 @@ function connect(host) {
|
|
|
7
7
|
element.addEventListener("select", onSelect);
|
|
8
8
|
return () => element.removeEventListener("select", onSelect);
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
12
|
-
export default function controller(host) {
|
|
13
|
-
host.on("connect", () => connect(host));
|
|
14
|
-
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<link rel="component" href="../ui-input/ui-input.html">
|
|
3
3
|
<link rel="component" href="../ui-radio-group/ui-radio-group.html">
|
|
4
4
|
<link rel="component" href="../ui-swatch/ui-swatch.html">
|
|
5
|
-
<template component="ui-editor-chip-editor"
|
|
5
|
+
<template component="ui-editor-chip-editor" module="./ui-editor-chip-editor.js">
|
|
6
6
|
<defs>
|
|
7
7
|
<prop name="label" type="string" default="">The chip's text, shown in the field as the reader edits it.</prop>
|
|
8
8
|
<prop name="color" type="keyword" values="neutral, blue, green, yellow, red, purple" default="neutral">The chip's colour, checked among the swatches.</prop>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Reports the chip's text and colour as they change, and Enter or Escape in the text field as done.
|
|
2
2
|
// A colour chosen with the pointer returns focus to the text; the arrow keys stay among the swatches.
|
|
3
|
-
function connect(host) {
|
|
3
|
+
export function connect(host) {
|
|
4
4
|
const element = host.element;
|
|
5
5
|
const text = () => element.querySelector("[data-chip-label]");
|
|
6
6
|
const onInput = (event) => {
|
|
@@ -26,8 +26,3 @@ function connect(host) {
|
|
|
26
26
|
element.removeEventListener("keydown", onKeyDown);
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
31
|
-
export default function controller(host) {
|
|
32
|
-
host.on("connect", () => connect(host));
|
|
33
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<link rel="component" href="../ui-combobox/ui-combobox.html">
|
|
2
|
-
<template component="ui-editor-code-language"
|
|
2
|
+
<template component="ui-editor-code-language" module="./ui-editor-code-language.js">
|
|
3
3
|
<defs>
|
|
4
4
|
<prop name="value" type="string" default="auto">The code block's language, or auto to detect it.</prop>
|
|
5
5
|
<prop name="languages" type="list(object({ value: string, label: string }))"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Reports a chosen language; typing a filter is not a choice.
|
|
2
|
-
function connect(host) {
|
|
2
|
+
export function connect(host) {
|
|
3
3
|
const element = host.element;
|
|
4
4
|
const onValueChange = (event) => {
|
|
5
5
|
if (event.target !== element && event.detail?.kind === "selection" && event.detail.value) host.dispatch("language", { value: event.detail.value });
|
|
@@ -7,8 +7,3 @@ function connect(host) {
|
|
|
7
7
|
element.addEventListener("value-change", onValueChange);
|
|
8
8
|
return () => element.removeEventListener("value-change", onValueChange);
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
12
|
-
export default function controller(host) {
|
|
13
|
-
host.on("connect", () => connect(host));
|
|
14
|
-
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<link rel="component" href="../ui-input/ui-input.html">
|
|
10
10
|
<link rel="component" href="../ui-cluster/ui-cluster.html">
|
|
11
11
|
<link rel="component" href="../ui-button/ui-button.html">
|
|
12
|
-
<template component="ui-editor-image-toolbar"
|
|
12
|
+
<template component="ui-editor-image-toolbar" module="./ui-editor-image-toolbar.js">
|
|
13
13
|
<defs>
|
|
14
14
|
<prop name="placement" type="keyword" values="block, center, wrap-left, wrap-right" default="block"
|
|
15
15
|
>How the selected image sits in the text; its command shows as pressed.</prop>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Gives each toolbar its own ids for its tooltips and description popover, reports placement,
|
|
2
2
|
// description, and delete requests, and keeps the description draft tied to the image it opened for.
|
|
3
|
-
function connect(host) {
|
|
3
|
+
export function connect(host) {
|
|
4
4
|
const element = host.element;
|
|
5
5
|
if (host.state.base === "ui-editor-image-toolbar") host.state.base = `ui-editor-image-toolbar-${Math.random().toString(36).slice(2, 11)}`;
|
|
6
6
|
let target = null;
|
|
@@ -48,8 +48,3 @@ function connect(host) {
|
|
|
48
48
|
element.removeEventListener("submit", onSubmit);
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
53
|
-
export default function controller(host) {
|
|
54
|
-
host.on("connect", () => connect(host));
|
|
55
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template component="ui-editor-insert-table-grid"
|
|
1
|
+
<template component="ui-editor-insert-table-grid" module="./ui-editor-insert-table-grid.js">
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="open" type="boolean" default="false">Whether the grid is shown.</prop>
|
|
4
4
|
<prop name="maxRows" type="integer" default="8">The most rows the grid offers (at most 10).</prop>
|
|
@@ -4,7 +4,7 @@ function bounded(value, fallback) {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
// Lays out the grid cells and inserts the chosen size by pointer or keyboard.
|
|
7
|
-
function connect(host) {
|
|
7
|
+
export function connect(host) {
|
|
8
8
|
const element = host.element;
|
|
9
9
|
let selected = { rows: 3, cols: 3 };
|
|
10
10
|
let preview = null;
|
|
@@ -103,8 +103,3 @@ function connect(host) {
|
|
|
103
103
|
host.refs.header.removeEventListener("change", onChange);
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
108
|
-
export default function controller(host) {
|
|
109
|
-
host.on("connect", () => connect(host));
|
|
110
|
-
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<link rel="component" href="../ui-button/ui-button.html">
|
|
7
7
|
<link rel="component" href="../ui-icon-button/ui-icon-button.html">
|
|
8
8
|
<link rel="component" href="../ui-tooltip/ui-tooltip.html">
|
|
9
|
-
<template component="ui-editor-link-card"
|
|
9
|
+
<template component="ui-editor-link-card" module="./ui-editor-link-card.js">
|
|
10
10
|
<defs>
|
|
11
11
|
<prop name="href" type="string" default="">The link's destination, shown when there is no label.</prop>
|
|
12
12
|
<prop name="openHref" type="string" default=""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Gives each card its own tooltip ids and reports edit and remove requests without taking focus
|
|
2
2
|
// from the editor.
|
|
3
|
-
function connect(host) {
|
|
3
|
+
export function connect(host) {
|
|
4
4
|
const element = host.element;
|
|
5
5
|
if (host.state.base === "ui-editor-link-card") host.state.base = `ui-editor-link-card-${Math.random().toString(36).slice(2, 11)}`;
|
|
6
6
|
const action = (event) => {
|
|
@@ -20,8 +20,3 @@ function connect(host) {
|
|
|
20
20
|
element.removeEventListener("click", onClick);
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
25
|
-
export default function controller(host) {
|
|
26
|
-
host.on("connect", () => connect(host));
|
|
27
|
-
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="component" href="../ui-scroll-area/ui-scroll-area.html">
|
|
9
9
|
<link rel="component" href="../ui-search-result-row/ui-search-result-row.html">
|
|
10
10
|
<link rel="component" href="../ui-checkbox/ui-checkbox.html">
|
|
11
|
-
<template component="ui-editor-link-form"
|
|
11
|
+
<template component="ui-editor-link-form" module="./ui-editor-link-form.js">
|
|
12
12
|
<defs>
|
|
13
13
|
<prop name="existing" type="boolean" default="false">Whether the link already exists, so the heading reads Edit link rather than Add link.</prop>
|
|
14
14
|
<prop name="searchable" type="boolean" default="false"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Gives each form its own field ids, reports field changes and choices, saves on Enter in a field,
|
|
2
2
|
// closes on Escape, and moves between the search field and its results with the arrow keys.
|
|
3
|
-
function connect(host) {
|
|
3
|
+
export function connect(host) {
|
|
4
4
|
const element = host.element;
|
|
5
5
|
if (host.state.base === "ui-editor-link-form") host.state.base = `ui-editor-link-form-${Math.random().toString(36).slice(2, 11)}`;
|
|
6
6
|
const within = (event, selector) => {
|
|
@@ -64,8 +64,3 @@ function connect(host) {
|
|
|
64
64
|
element.removeEventListener("submit", onSubmit);
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
69
|
-
export default function controller(host) {
|
|
70
|
-
host.on("connect", () => connect(host));
|
|
71
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<link rel="component" href="../ui-editor-mention-menu-item/ui-editor-mention-menu-item.html">
|
|
2
|
-
<template component="ui-editor-mention-menu"
|
|
2
|
+
<template component="ui-editor-mention-menu" module="./ui-editor-mention-menu.js">
|
|
3
3
|
<defs>
|
|
4
4
|
<prop name="open" type="boolean" default="false">Whether the menu is open.</prop>
|
|
5
5
|
<prop name="query" type="string" default="">The text typed after the @.</prop>
|
|
@@ -2,7 +2,7 @@ import { createViewportSurface } from "../shared/overlay.js";
|
|
|
2
2
|
import { normalizeAnchor, positionMenu } from "../shared/editor.js";
|
|
3
3
|
|
|
4
4
|
// Places the menu at the @ and derives its rows; the template renders them.
|
|
5
|
-
function connect(host) {
|
|
5
|
+
export function connect(host) {
|
|
6
6
|
const element = host.element;
|
|
7
7
|
const authoredLabel = element.hasAttribute("aria-label") || element.hasAttribute("aria-labelledby");
|
|
8
8
|
const place = () => {
|
|
@@ -66,8 +66,3 @@ function connect(host) {
|
|
|
66
66
|
element.removeEventListener("mouseover", onMouseover);
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
71
|
-
export default function controller(host) {
|
|
72
|
-
host.on("connect", () => connect(host));
|
|
73
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<link rel="component" href="../ui-icon/ui-icon.html">
|
|
2
2
|
<link rel="component" href="../ui-editor-slash-menu-item/ui-editor-slash-menu-item.html">
|
|
3
3
|
<link rel="component" href="../ui-editor-slash-menu-group/ui-editor-slash-menu-group.html">
|
|
4
|
-
<template component="ui-editor-slash-menu"
|
|
4
|
+
<template component="ui-editor-slash-menu" module="./ui-editor-slash-menu.js">
|
|
5
5
|
<defs>
|
|
6
6
|
<prop name="open" type="boolean" default="false">Whether the menu is open.</prop>
|
|
7
7
|
<prop name="query" type="string" default="">The text typed after the slash.</prop>
|
|
@@ -2,7 +2,7 @@ import { createViewportSurface } from "../shared/overlay.js";
|
|
|
2
2
|
import { normalizeAnchor, positionMenu } from "../shared/editor.js";
|
|
3
3
|
|
|
4
4
|
// Places the menu at the slash and tracks the highlighted item; the template renders the items.
|
|
5
|
-
function connect(host) {
|
|
5
|
+
export function connect(host) {
|
|
6
6
|
const element = host.element;
|
|
7
7
|
const authoredLabel = element.hasAttribute("aria-label") || element.hasAttribute("aria-labelledby");
|
|
8
8
|
const place = () => {
|
|
@@ -72,8 +72,3 @@ function connect(host) {
|
|
|
72
72
|
element.removeEventListener("mouseover", onMouseover);
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
77
|
-
export default function controller(host) {
|
|
78
|
-
host.on("connect", () => connect(host));
|
|
79
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<link rel="component" href="../ui-icon/ui-icon.html">
|
|
2
|
-
<template component="ui-editor-table-context-menu"
|
|
2
|
+
<template component="ui-editor-table-context-menu" module="./ui-editor-table-context-menu.js">
|
|
3
3
|
<defs>
|
|
4
4
|
<prop name="open" type="boolean" default="false">Shows the menu at the position owned by the editor integration.</prop>
|
|
5
5
|
<prop name="scope" type="keyword" values="cell, row, column" default="cell">Keeps structure actions relevant to a cell, row handle, or column handle.</prop>
|
|
@@ -28,7 +28,7 @@ const sections = [
|
|
|
28
28
|
|
|
29
29
|
// Shows the menu at the place it is written, keeping one in a floating box inside the viewport, and lists
|
|
30
30
|
// the actions the selection permits.
|
|
31
|
-
function connect(host) {
|
|
31
|
+
export function connect(host) {
|
|
32
32
|
const element = host.element;
|
|
33
33
|
let place = null;
|
|
34
34
|
const nudge = () => {
|
|
@@ -109,8 +109,3 @@ function connect(host) {
|
|
|
109
109
|
element.removeEventListener("click", onClick);
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
114
|
-
export default function controller(host) {
|
|
115
|
-
host.on("connect", () => connect(host));
|
|
116
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<link rel="component" href="../ui-icon/ui-icon.html">
|
|
2
|
-
<template component="ui-editor-table-overlay"
|
|
2
|
+
<template component="ui-editor-table-overlay" module="./ui-editor-table-overlay.js">
|
|
3
3
|
<defs>
|
|
4
4
|
<prop name="open" type="boolean" default="false">Shows the controls after the editor has supplied current geometry.</prop>
|
|
5
5
|
<prop
|
|
@@ -47,7 +47,7 @@ function createProximity(scope, selector = ".handle[data-ui-affordance]", radius
|
|
|
47
47
|
} };
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
function connect(host) {
|
|
50
|
+
export function connect(host) {
|
|
51
51
|
const element = host.element;
|
|
52
52
|
const proximity = createProximity(element);
|
|
53
53
|
let drag = null;
|
|
@@ -173,8 +173,3 @@ function connect(host) {
|
|
|
173
173
|
element.removeEventListener("focusout", leave);
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
|
|
177
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
178
|
-
export default function controller(host) {
|
|
179
|
-
host.on("connect", () => connect(host));
|
|
180
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<link rel="component" href="../ui-icon/ui-icon.html">
|
|
2
|
-
<template component="ui-editor-table-toolbar"
|
|
2
|
+
<template component="ui-editor-table-toolbar" module="./ui-editor-table-toolbar.js">
|
|
3
3
|
<defs>
|
|
4
4
|
<prop name="open" type="boolean" default="false">Shows the toolbar while a table selection is active.</prop>
|
|
5
5
|
<prop name="cellAlignment" type="keyword" values="left, center, right" default="left"
|
|
@@ -8,7 +8,7 @@ const overflowSections = [
|
|
|
8
8
|
];
|
|
9
9
|
|
|
10
10
|
// Lists the actions the table selection permits; the overflow menu opens and closes here.
|
|
11
|
-
function connect(host) {
|
|
11
|
+
export function connect(host) {
|
|
12
12
|
const element = host.element;
|
|
13
13
|
let alive = true;
|
|
14
14
|
let menu = null;
|
|
@@ -93,8 +93,3 @@ function connect(host) {
|
|
|
93
93
|
element.removeEventListener("click", onClick);
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
98
|
-
export default function controller(host) {
|
|
99
|
-
host.on("connect", () => connect(host));
|
|
100
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template component="ui-editor-toolbar"
|
|
1
|
+
<template component="ui-editor-toolbar" module="./ui-editor-toolbar.js">
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="floating" type="boolean" default="false">Shows the toolbar as a floating bar beside the selection rather than pinned to the editor.</prop>
|
|
4
4
|
</defs>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const selector = 'button, a[href], [role="button"], select, input:not([type="hidden"])';
|
|
2
2
|
|
|
3
3
|
/** Keep one Tab stop in the toolbar; arrow keys move among its enabled authored controls. */
|
|
4
|
-
function connect(host) {
|
|
4
|
+
export function connect(host) {
|
|
5
5
|
const strip = host.refs.strip;
|
|
6
6
|
let current = null;
|
|
7
7
|
const controls = () => Array.from(strip.querySelectorAll(selector)).filter((element) =>
|
|
@@ -44,8 +44,3 @@ function connect(host) {
|
|
|
44
44
|
strip.removeEventListener("keydown", onKeydown);
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
/** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
|
|
49
|
-
export default function controller(host) {
|
|
50
|
-
host.on("connect", () => connect(host));
|
|
51
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template component="ui-form-field"
|
|
1
|
+
<template component="ui-form-field" module="./ui-form-field.js">
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="invalid" type="boolean" default="false"
|
|
4
4
|
>Marks the field's control invalid by setting aria-invalid on it. Only while invalid, the error slot appears and becomes part of the control's
|