@threadlabs/looma 0.49.0 → 0.49.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/components/ui-cycle-button/ui-cycle-button.html +5 -3
- package/components/ui-cycle-button/ui-cycle-button.js +3 -2
- package/components/ui-editor/ui-editor.html +24 -9
- package/components/ui-search-result-row/ui-search-result-row.html +1 -1
- package/dist/index.js +1 -1
- package/docs/catalog.json +88 -11
- package/package.json +1 -1
- package/styles/ui-search-result-row.css +1 -1
- package/vanilla/UiCycleButton.d.ts +2 -0
- package/vanilla/UiCycleButton.js +26 -21
- package/vanilla/UiEditor.d.ts +9 -9
- package/vanilla/UiEditor.js +3 -3
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ is needed. `breakpoint="sm"` and `breakpoint="md"` switch at 40rem and 48rem.
|
|
|
94
94
|
</ui-site-header>
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
In Vue, use `
|
|
97
|
+
In Vue, use `UiSiteHeader` with `#brand`, `#navigation`, and optional `#actions`.
|
|
98
98
|
Router links keep their original handlers and state. Localize `label`, `menuLabel`,
|
|
99
99
|
and `closeLabel` as needed. Without JavaScript, navigation stays available inline.
|
|
100
100
|
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
>Ordered states with a value, readable label and Looma icon name. Activation advances to the next state and wraps.</prop>
|
|
7
7
|
<prop name="index" type="number" default="0">Initial or externally selected zero-based state. The first state is the default.</prop>
|
|
8
8
|
<prop name="label" type="string" default="State">What the button changes, such as Appearance. The selected state is included in its accessible name.</prop>
|
|
9
|
+
<prop name="description" type="string" default="Activate to choose the next state.">Accessible instruction for cycling; accepts localized reader text.</prop>
|
|
10
|
+
<prop name="emptyLabel" type="string" default="No choices">Selected-state label while no choices are available.</prop>
|
|
9
11
|
<prop name="size" type="keyword" values="sm, md, lg" default="md">Uses IconButton's compact visible sizes and adjustable invisible touch area.</prop>
|
|
10
12
|
<prop name="variant" type="keyword" values="ghost, outline, solid" default="outline">Uses IconButton's standard emphasis.</prop>
|
|
11
13
|
<prop name="disabled" type="boolean" default="false">Prevents cycling while keeping the selected state visible.</prop>
|
|
@@ -14,13 +16,13 @@
|
|
|
14
16
|
<event name="change" type="object"><prop name="value" type="string" required></prop><prop name="index" type="number" required></prop></event>
|
|
15
17
|
</defs>
|
|
16
18
|
<span><ui-icon-button
|
|
17
|
-
from:label="concat($label, ': ', default($selected.label,
|
|
18
|
-
from:title="concat($label, ': ', default($selected.label,
|
|
19
|
+
from:label="concat($label, ': ', default($selected.label, $emptyLabel))"
|
|
20
|
+
from:title="concat($label, ': ', default($selected.label, $emptyLabel))"
|
|
19
21
|
from:size="$size"
|
|
20
22
|
from:variant="$variant"
|
|
21
23
|
from:disabled="$disabled or $items.length < 2"
|
|
22
24
|
tone="neutral"
|
|
23
|
-
aria-description="
|
|
25
|
+
from:aria-description="$description"
|
|
24
26
|
>
|
|
25
27
|
<ui-icon from:name="default($selected.icon, '')"></ui-icon>
|
|
26
28
|
</ui-icon-button></span>
|
|
@@ -5,11 +5,12 @@ export function connect(host) {
|
|
|
5
5
|
const signature = JSON.stringify([host.props.items.value, host.props.index.value]);
|
|
6
6
|
if (signature === external) return;
|
|
7
7
|
external = signature;
|
|
8
|
+
const items = host.props.items.value ?? [];
|
|
8
9
|
const index = Math.trunc(Number(host.props.index.value));
|
|
9
|
-
host.state.current = Number.isFinite(index) && index >= 0 && index <
|
|
10
|
+
host.state.current = Number.isFinite(index) && index >= 0 && index < items.length ? index : 0;
|
|
10
11
|
});
|
|
11
12
|
const cycle = () => {
|
|
12
|
-
const items = host.props.items.value;
|
|
13
|
+
const items = host.props.items.value ?? [];
|
|
13
14
|
if (host.props.disabled.value || items.length < 2) return;
|
|
14
15
|
host.state.current = (host.state.current + 1) % items.length;
|
|
15
16
|
host.dispatch('change', { value: items[host.state.current].value, index: host.state.current });
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
>Choose the padding and minimum height of read-only documents.</prop>
|
|
42
42
|
<prop name="placeholder" type="string" default="Type “/” for commands, or start writing…">The empty document's writing prompt.</prop>
|
|
43
43
|
<prop name="label" type="string" default="Document">Accessible name of the textbox.</prop>
|
|
44
|
-
<prop name="mentionItems" type="list(object({ id: string, label: string, detail?: string, initials?: string
|
|
44
|
+
<prop name="mentionItems" type="list(object({ id: string, label: string, detail?: string, initials?: string }))" default="[]"
|
|
45
45
|
>Default mention choices when nobody answers mention-query.</prop>
|
|
46
46
|
<prop name="mentionLimit" type="integer" default="8">Maximum number of mention suggestions.</prop>
|
|
47
47
|
<prop name="linkBaseUrl" type="string" default="">Origin used for newly inserted relative links.</prop>
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
<prop name="toolbarMode" type="keyword" values="bubble, sticky, popover, contextual" default="bubble">Where formatting controls appear.</prop>
|
|
50
50
|
<prop name="compactToolbar" type="boolean" default="false">Keep frequent inline controls visible and put the full inventory behind Format.</prop>
|
|
51
51
|
<prop name="selectionActions" type="list(object({ id: string, label: string }))" default="[]">Application actions available for a selected passage.</prop>
|
|
52
|
-
<prop name="rangeActions" type="list(object({ id: string, label: string,
|
|
52
|
+
<prop name="rangeActions" type="list(object({ id: string, label: string, from: integer, to: integer }))" default="[]"
|
|
53
53
|
>Application caret actions with host-owned durable ranges.</prop>
|
|
54
54
|
<prop name="toolbarTriggerId" type="string" default="">External trigger for popover mode.</prop>
|
|
55
55
|
<prop name="toolbarOpen" type="boolean" default="false">Controlled popover toolbar visibility.</prop>
|
|
@@ -58,19 +58,34 @@
|
|
|
58
58
|
<event name="change" type="object"><prop name="content" type="object({ type: string, ... })" required></prop>The edited document changed.</event>
|
|
59
59
|
<event name="toolbar-open" type="object({ ... })">The popover toolbar opened.</event>
|
|
60
60
|
<event name="toolbar-close" type="object({ ... })">The popover toolbar closed.</event>
|
|
61
|
-
<event name="selection-action" type="object({
|
|
62
|
-
|
|
61
|
+
<event name="selection-action" type="object({ id: string, from: integer, to: integer, text: string, before: string, after: string })"
|
|
62
|
+
>An application passage action was chosen.</event>
|
|
63
|
+
<event name="range-action" type="object({ id: string, ranges: list(object({ from: integer, to: integer })) })"
|
|
64
|
+
>An application caret action was chosen.</event>
|
|
63
65
|
<event name="upload-error" type="object"><prop name="error" type="unknown" required></prop><prop name="file" type="unknown" required></prop>An upload
|
|
64
66
|
failed; authored content is retained.</event>
|
|
65
|
-
<event name="image-activate" type="object
|
|
66
|
-
|
|
67
|
+
<event name="image-activate" type="object" open><prop name="src" type="string" required></prop><prop
|
|
68
|
+
name="trigger"
|
|
69
|
+
type="keyword"
|
|
70
|
+
values="pointer, keyboard"
|
|
71
|
+
required
|
|
72
|
+
></prop>An image was activated.</event>
|
|
73
|
+
<event name="image-rendition-error" type="object" open><prop name="src" type="string" required></prop><prop
|
|
74
|
+
name="trigger"
|
|
75
|
+
type="keyword"
|
|
76
|
+
values="programmatic"
|
|
77
|
+
required
|
|
78
|
+
></prop>A transient image rendition failed.</event>
|
|
67
79
|
<request name="extensions" returns="list(unknown)">Additional Tiptap extensions.</request>
|
|
68
80
|
<request name="slash-commands" type="object({ defaults: list(unknown) })" returns="list(unknown)">Customize the default slash commands.</request>
|
|
69
|
-
<request
|
|
81
|
+
<request
|
|
82
|
+
name="mention-query"
|
|
83
|
+
type="object({ query: string, limit: integer })"
|
|
84
|
+
returns="list(object({ id: string, label: string, detail?: string, initials?: string }))"
|
|
70
85
|
>Find authorized mention choices.</request>
|
|
71
|
-
<request name="link-search" type="object({ query: string })" returns="list(object({ id: string, label: string, href: string,
|
|
86
|
+
<request name="link-search" type="object({ query: string })" returns="list(object({ id: string, label: string, href: string, detail?: string }))"
|
|
72
87
|
>Find authorized link destinations.</request>
|
|
73
|
-
<request name="link-resolve" type="object({ href: string })" returns="object({ id: string, label: string, href: string,
|
|
88
|
+
<request name="link-resolve" type="object({ href: string })" returns="object({ id: string, label: string, href: string, detail?: string })"
|
|
74
89
|
>Resolve a saved link's display record.</request>
|
|
75
90
|
<request name="image-upload" type="object"><prop name="file" type="unknown" required></prop><returns type="object({ src: string, ... })"></returns>Retain an
|
|
76
91
|
image before insertion.</request>
|