@threadlabs/looma 0.43.1 → 0.44.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-callout/ui-callout.html +4 -4
- package/components/ui-dialog/ui-dialog.html +0 -4
- package/components/ui-editor-footnote-editor/ui-editor-footnote-editor.html +4 -50
- package/components/ui-editor-footnote-editor/ui-editor-footnote-editor.js +10 -31
- package/components/ui-site-header/ui-site-header.html +1 -1
- package/dist/index.js +1 -1
- package/docs/README.md +19 -3
- package/docs/card.html +1 -1
- package/docs/catalog-view.js +11 -5
- package/docs/catalog-view.mjs +4 -3
- package/docs/catalog.json +76 -112
- package/docs/catalog.mjs +1 -1
- package/docs/customizer-render.mjs +9 -8
- package/docs/customizer.js +8 -8
- package/docs/documentation.css +2 -2
- package/docs/examples/ui-editor-footnote-editor/examples/01-note.behavior.js +9 -0
- package/docs/fonts.mjs +1 -1
- package/docs/index.mjs +1 -1
- package/docs/render.mjs +1 -1
- package/docs/site.mjs +14 -5
- package/docs/theme.mjs +96 -16
- package/editor/chunks/extensions.js +10 -0
- package/editor/extensions/footnote.d.ts +1 -0
- package/editor/footnote-editing.d.ts +16 -27
- package/package.json +2 -2
- package/styles/ui-callout.css +4 -4
- package/styles/ui-dialog.css +0 -8
- package/styles/ui-site-header.css +1 -1
- package/theme-dark.css +9 -9
- package/theme-high-contrast.css +4 -0
- package/theme-light.css +6 -6
- package/tokens.css +20 -18
- package/vanilla/UiEditorFootnoteEditor.d.ts +0 -5
- package/vanilla/UiEditorFootnoteEditor.js +20 -68
- package/vue/UiCallout.vue +4 -4
- package/vue/UiDialog.vue +0 -7
- package/vue/UiEditorFootnoteEditor.d.ts +11 -29
- package/vue/UiEditorFootnoteEditor.vue +21 -173
- package/vue/UiSiteHeader.vue +1 -1
- package/vue/chunks/UiCallout.js +1 -1
- package/vue/chunks/UiDialog.js +1 -1
- package/vue/chunks/UiEditorFootnoteEditor.js +34 -226
- package/vue/chunks/UiEditorImageToolbar.js +1 -1
- package/vue/chunks/UiEditorLinkForm.js +1 -1
- package/vue/chunks/UiSiteHeader.js +1 -1
- package/vue/chunks/compact.js +565 -0
- package/vue/components.css +321 -328
- package/vue/editor/LoomaEditor.d.ts +2 -2
- package/vue/editor/compact/index.js +1 -562
- package/vue/editor/index.js +173 -80
- package/vue/index.js +2 -2
|
@@ -142,10 +142,10 @@
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
:host([tone="tip"]) {
|
|
145
|
-
--_callout-border: var(--ui-
|
|
146
|
-
--_callout-surface: var(--ui-
|
|
147
|
-
--_callout-tone-text: var(--ui-
|
|
148
|
-
--_callout-icon: var(--ui-
|
|
145
|
+
--_callout-border: var(--ui-info-soft-border);
|
|
146
|
+
--_callout-surface: var(--ui-info-soft);
|
|
147
|
+
--_callout-tone-text: var(--ui-info-subtle-text);
|
|
148
|
+
--_callout-icon: var(--ui-info-subtle-text);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
:host([tone="important"]) {
|
|
@@ -72,10 +72,8 @@
|
|
|
72
72
|
visibility: hidden;
|
|
73
73
|
pointer-events: none;
|
|
74
74
|
opacity: 0;
|
|
75
|
-
transform: scale(0.96);
|
|
76
75
|
transition:
|
|
77
76
|
opacity var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease),
|
|
78
|
-
transform var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease),
|
|
79
77
|
visibility var(--ui-dialog-duration, var(--ui-motion-base)),
|
|
80
78
|
display var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease) allow-discrete,
|
|
81
79
|
overlay var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease) allow-discrete;
|
|
@@ -145,7 +143,6 @@
|
|
|
145
143
|
visibility: visible;
|
|
146
144
|
pointer-events: auto;
|
|
147
145
|
opacity: 1;
|
|
148
|
-
transform: scale(1);
|
|
149
146
|
animation: ui-dialog-enter var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease);
|
|
150
147
|
}
|
|
151
148
|
|
|
@@ -231,7 +228,6 @@
|
|
|
231
228
|
@keyframes ui-dialog-enter {
|
|
232
229
|
from {
|
|
233
230
|
opacity: 0;
|
|
234
|
-
transform: scale(0.96);
|
|
235
231
|
}
|
|
236
232
|
}
|
|
237
233
|
|
|
@@ -1,57 +1,11 @@
|
|
|
1
|
-
<link rel="component" href="../ui-stack/ui-stack.html">
|
|
2
|
-
<link rel="component" href="../ui-form-field/ui-form-field.html">
|
|
3
|
-
<link rel="component" href="../ui-input-group/ui-input-group.html">
|
|
4
|
-
<link rel="component" href="../ui-input/ui-input.html">
|
|
5
1
|
<link rel="component" href="../ui-textarea/ui-textarea.html">
|
|
6
|
-
<link rel="component" href="../ui-button/ui-button.html">
|
|
7
2
|
<template component="ui-editor-footnote-editor" module="./ui-editor-footnote-editor.js">
|
|
8
3
|
<defs>
|
|
9
|
-
<prop name="
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
>Whether the note's text can be edited here. A note with formatting or more than one block shows its text read-only; Go to note edits it in the
|
|
13
|
-
document.</prop>
|
|
14
|
-
<prop name="error" type="string" default="">Why the label field's label was not used. While set, the field is invalid and shows it.</prop>
|
|
15
|
-
<state name="base" type="string" value="ui-editor-footnote-editor"></state>
|
|
16
|
-
<event name="text" type="object">
|
|
17
|
-
<prop name="text" required type="string"></prop>
|
|
18
|
-
The note's text changed.
|
|
19
|
-
</event>
|
|
20
|
-
<event name="label" type="object">
|
|
21
|
-
<prop name="label" required type="string"></prop>
|
|
22
|
-
A new label was committed: the label field changed and lost focus, or Enter was pressed in it.
|
|
23
|
-
</event>
|
|
24
|
-
<event name="go" type="object">Go to note was pressed.</event>
|
|
25
|
-
<event name="done" type="object">Enter or Escape was pressed in a field, to close the editor and return to the reference.</event>
|
|
4
|
+
<prop name="note" type="string" default="">Content for the default plain-text field. Supply rich editing content through the default slot.</prop>
|
|
5
|
+
<event name="text" type="object"><prop name="text" required type="string"></prop>The default text field changed.</event>
|
|
6
|
+
<event name="done" type="object">An unhandled Escape closes the editor and returns to the reference.</event>
|
|
26
7
|
</defs>
|
|
27
8
|
<div role="dialog" aria-label="Edit footnote">
|
|
28
|
-
<ui-
|
|
29
|
-
<ui-form-field from:invalid="$error != ''">
|
|
30
|
-
<label slot="label" from:for="concat($base, '-label')">Label</label>
|
|
31
|
-
<ui-input-group>
|
|
32
|
-
<span slot="prefix">[^</span>
|
|
33
|
-
<ui-input data-footnote-label from:id="concat($base, '-label')" size="sm" autocomplete="off" from:value="$label"></ui-input>
|
|
34
|
-
<span slot="suffix">]</span>
|
|
35
|
-
</ui-input-group>
|
|
36
|
-
<span slot="error">{$error}</span>
|
|
37
|
-
</ui-form-field>
|
|
38
|
-
<ui-form-field>
|
|
39
|
-
<label slot="label" from:for="concat($base, '-note')">Note</label>
|
|
40
|
-
<ui-input-group multiline>
|
|
41
|
-
<ui-textarea
|
|
42
|
-
data-footnote-note
|
|
43
|
-
from:id="concat($base, '-note')"
|
|
44
|
-
size="sm"
|
|
45
|
-
rows="2"
|
|
46
|
-
autosize
|
|
47
|
-
placeholder="Write the note"
|
|
48
|
-
from:readonly="not $editable"
|
|
49
|
-
from:value="$note"
|
|
50
|
-
></ui-textarea>
|
|
51
|
-
<ui-button slot="action" size="sm" data-footnote-go>Go to note</ui-button>
|
|
52
|
-
</ui-input-group>
|
|
53
|
-
<span $if="not $editable" slot="help">This note has formatting, so it is edited in the document.</span>
|
|
54
|
-
</ui-form-field>
|
|
55
|
-
</ui-stack>
|
|
9
|
+
<slot><ui-textarea data-footnote-note aria-label="Footnote" rows="3" autosize placeholder="Write the note" from:value="$note"></ui-textarea></slot>
|
|
56
10
|
</div>
|
|
57
11
|
</template>
|
|
@@ -1,38 +1,17 @@
|
|
|
1
|
-
// Gives each editor its own field ids, reports the note's text as it changes and a label when it is
|
|
2
|
-
// committed, Go to note when pressed, and Enter or Escape in a field as done.
|
|
3
1
|
export function connect(host) {
|
|
4
2
|
const element = host.element;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const match = event.target.closest?.(selector);
|
|
8
|
-
return match && element.contains(match) ? match : null;
|
|
3
|
+
const onInput = event => {
|
|
4
|
+
if (event.target.matches?.('[data-footnote-note]')) host.dispatch('text', { text: event.target.value });
|
|
9
5
|
};
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
6
|
+
const onKeyDown = event => {
|
|
7
|
+
if (event.key !== 'Escape' || event.defaultPrevented) return;
|
|
8
|
+
event.preventDefault(); event.stopPropagation();
|
|
9
|
+
host.dispatch('done', {});
|
|
12
10
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
const onClick = (event) => {
|
|
17
|
-
if (within(event, "[data-footnote-go]")) host.dispatch("go", {});
|
|
18
|
-
};
|
|
19
|
-
// The editor handles Enter and Escape itself, so the overlay around it does not also act on them.
|
|
20
|
-
const onKeyDown = (event) => {
|
|
21
|
-
const label = within(event, "[data-footnote-label]");
|
|
22
|
-
if ((event.key !== "Enter" && event.key !== "Escape") || !(label || within(event, "[data-footnote-note]"))) return;
|
|
23
|
-
event.preventDefault();
|
|
24
|
-
event.stopPropagation();
|
|
25
|
-
if (label && event.key === "Enter") host.dispatch("label", { label: event.target.value.trim() });
|
|
26
|
-
host.dispatch("done", {});
|
|
27
|
-
};
|
|
28
|
-
element.addEventListener("input", onInput);
|
|
29
|
-
element.addEventListener("change", onChange);
|
|
30
|
-
element.addEventListener("click", onClick);
|
|
31
|
-
element.addEventListener("keydown", onKeyDown);
|
|
11
|
+
element.addEventListener('input', onInput);
|
|
12
|
+
element.addEventListener('keydown', onKeyDown);
|
|
32
13
|
return () => {
|
|
33
|
-
element.removeEventListener(
|
|
34
|
-
element.removeEventListener(
|
|
35
|
-
element.removeEventListener("click", onClick);
|
|
36
|
-
element.removeEventListener("keydown", onKeyDown);
|
|
14
|
+
element.removeEventListener('input', onInput);
|
|
15
|
+
element.removeEventListener('keydown', onKeyDown);
|
|
37
16
|
};
|
|
38
17
|
}
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
text-decoration: none;
|
|
92
92
|
}
|
|
93
93
|
.navigation > :slotted(a):is(:hover, [aria-current="page"], [aria-current="true"]) {
|
|
94
|
-
color: var(--ui-
|
|
94
|
+
color: var(--ui-link-color);
|
|
95
95
|
}
|
|
96
96
|
.brand > :slotted(a):focus-visible, .navigation > :slotted(a):focus-visible {
|
|
97
97
|
outline: var(--ui-focus-width) solid var(--ui-focus-ring);
|