@threadlabs/looma 0.43.2 → 0.44.1

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.
Files changed (47) hide show
  1. package/components/ui-callout/ui-callout.html +4 -4
  2. package/components/ui-dialog/ui-dialog.html +0 -4
  3. package/components/ui-editor-footnote-editor/ui-editor-footnote-editor.html +4 -50
  4. package/components/ui-editor-footnote-editor/ui-editor-footnote-editor.js +10 -31
  5. package/dist/index.js +1 -1
  6. package/docs/README.md +55 -17
  7. package/docs/card.html +1 -1
  8. package/docs/catalog-view.js +11 -5
  9. package/docs/catalog-view.mjs +4 -3
  10. package/docs/catalog.json +73 -109
  11. package/docs/catalog.mjs +1 -1
  12. package/docs/customizer-render.mjs +9 -8
  13. package/docs/customizer.js +8 -8
  14. package/docs/documentation.css +2 -2
  15. package/docs/examples/ui-editor-footnote-editor/examples/01-note.behavior.js +9 -0
  16. package/docs/fonts.mjs +1 -1
  17. package/docs/index.mjs +1 -1
  18. package/docs/render.mjs +17 -6
  19. package/docs/site.mjs +14 -5
  20. package/docs/theme.mjs +96 -16
  21. package/editor/chunks/extensions.js +10 -0
  22. package/editor/extensions/footnote.d.ts +1 -0
  23. package/editor/footnote-editing.d.ts +16 -27
  24. package/package.json +4 -3
  25. package/styles/ui-callout.css +4 -4
  26. package/styles/ui-dialog.css +0 -8
  27. package/theme-dark.css +9 -9
  28. package/theme-high-contrast.css +4 -0
  29. package/theme-light.css +6 -6
  30. package/tokens.css +20 -18
  31. package/vanilla/UiEditorFootnoteEditor.d.ts +0 -5
  32. package/vanilla/UiEditorFootnoteEditor.js +20 -68
  33. package/vue/UiCallout.vue +4 -4
  34. package/vue/UiDialog.vue +0 -7
  35. package/vue/UiEditorFootnoteEditor.d.ts +11 -29
  36. package/vue/UiEditorFootnoteEditor.vue +21 -173
  37. package/vue/chunks/UiCallout.js +1 -1
  38. package/vue/chunks/UiDialog.js +1 -1
  39. package/vue/chunks/UiEditorFootnoteEditor.js +34 -226
  40. package/vue/chunks/UiEditorImageToolbar.js +1 -1
  41. package/vue/chunks/UiEditorLinkForm.js +1 -1
  42. package/vue/chunks/compact.js +565 -0
  43. package/vue/components.css +320 -327
  44. package/vue/editor/LoomaEditor.d.ts +2 -2
  45. package/vue/editor/compact/index.js +1 -562
  46. package/vue/editor/index.js +173 -80
  47. package/vue/index.js +2 -2
@@ -1,46 +1,35 @@
1
- import type { Editor } from "@tiptap/core";
2
- /** The footnote editor's state: the edited reference's label and its note's text. */
1
+ import type { AnyExtension, Editor, JSONContent } from "@tiptap/core";
2
+ /** The floating editor's structured note content; numbering belongs to the document. */
3
3
  export interface LoomaFootnoteEditingState {
4
4
  readonly open: boolean;
5
- readonly label: string;
6
- /** The note's text, its blocks on separate lines. */
7
- readonly note: string;
8
- /** Whether `note` can be edited as text: the note is one paragraph of unformatted text. */
9
- readonly editable: boolean;
10
- /** Why the last label offered was not used, or empty. */
11
- readonly error: string;
5
+ readonly note: JSONContent;
12
6
  }
13
7
  export declare const LOOMA_FOOTNOTE_EDITING_IDLE: LoomaFootnoteEditingState;
14
8
  /**
15
- * The footnote editor as a state machine: it opens on one reference, writes the note's text as the
16
- * author types it, and renames the footnote everywhere when a new label is committed.
17
- *
18
- * @ownership The host owns presentation: the popover, its anchor, and focus. This owns which footnote
19
- * is edited and the document changes it makes.
20
- * @failure A change after the footnote was deleted closes the editor and writes nothing. A label with
21
- * a space or `]`, or one another footnote uses, is not applied; `error` says why.
9
+ * Edits one note without exposing its internal Markdown identity to the writer.
10
+ * @ownership The host owns action bar, popover, anchor and focus; this owns document updates.
11
+ * @failure Deleting the reference closes the editor. Invalid structured content never replaces a note.
22
12
  */
23
13
  export interface LoomaFootnoteEditing {
24
14
  readonly state: LoomaFootnoteEditingState;
25
- /** The edited reference's element, for anchoring the editor, or null while it is closed. */
15
+ /** The reference used to anchor the floating actions or editor. */
26
16
  readonly element: HTMLElement | null;
27
- /** Calls `listener` after every state change; returns the unsubscribe function. */
28
17
  subscribe(listener: () => void): () => void;
29
- /**
30
- * Opens on the reference at `position`.
31
- * @failure Returns false, and stays as it was, when the editor is read-only or no reference is there.
32
- */
18
+ /** Opens on an editable footnote reference; returns false when the reference or note is absent. */
33
19
  open(position: number): boolean;
34
- /** Replaces the note's text; ignored unless `state.editable`. */
35
- setNote(note: string): void;
36
- rename(label: string): void;
37
- /** Closes the editor and moves the caret to the end of the note. */
20
+ /** Replaces note content using the parent schema, preserving blocks, marks and attributes. */
21
+ setNote(note: JSONContent): void;
22
+ /** Closes the floating surface and moves the document caret to the note. */
38
23
  goToNote(): void;
39
24
  close(): void;
40
25
  }
41
26
  export interface LoomaFootnoteEditingOptions {
42
27
  editor: Editor;
43
- /** Read on each opening, so a host can change it while the editor runs. */
44
28
  isEditable: () => boolean;
45
29
  }
30
+ /**
31
+ * Reuses the parent content schema in a short-form field, including global attributes.
32
+ * Document-wide normalizers and node-view callbacks stay with the parent editor.
33
+ */
34
+ export declare function footnoteContentExtensions(editor: Editor): AnyExtension[];
46
35
  export declare function createFootnoteEditing(options: LoomaFootnoteEditingOptions): LoomaFootnoteEditing;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.43.2",
3
+ "version": "0.44.1",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -119,7 +119,8 @@
119
119
  "lowlight": "^3.3.0",
120
120
  "markdown-it": "14.3.1",
121
121
  "lucide": "~0.554.0",
122
- "expressmark": ">=0.2.0 <1"
122
+ "expressmark": ">=0.2.2 <1",
123
+ "parse5": "^8.0.1"
123
124
  },
124
125
  "peerDependencies": {
125
126
  "@nextwebwg/html-next": "1.0.0-alpha.69",
@@ -127,7 +128,7 @@
127
128
  "@tiptap/pm": ">=2 <3",
128
129
  "@tiptap/vue-3": ">=2 <3",
129
130
  "vue": "^3.5.43",
130
- "markupress": ">=0.10.2 <1",
131
+ "markupress": ">=0.12.0 <1",
131
132
  "@threadlabs/markupkit": ">=0.2.0 <1",
132
133
  "vite": ">=7.2.7 <9"
133
134
  },
@@ -83,10 +83,10 @@
83
83
  }
84
84
 
85
85
  :scope:where([data-component~="ui-callout"])[data-ui-callout-state~="tone=tip"] {
86
- --_callout-border: var(--ui-success-soft-border);
87
- --_callout-surface: var(--ui-success-soft);
88
- --_callout-tone-text: var(--ui-success-subtle-text);
89
- --_callout-icon: var(--ui-success-subtle-text);
86
+ --_callout-border: var(--ui-info-soft-border);
87
+ --_callout-surface: var(--ui-info-soft);
88
+ --_callout-tone-text: var(--ui-info-subtle-text);
89
+ --_callout-icon: var(--ui-info-subtle-text);
90
90
  }
91
91
 
92
92
  :scope:where([data-component~="ui-callout"])[data-ui-callout-state~="tone=important"] {
@@ -32,10 +32,8 @@
32
32
  visibility: hidden;
33
33
  pointer-events: none;
34
34
  opacity: 0;
35
- transform: scale(0.96);
36
35
  transition:
37
36
  opacity var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease),
38
- transform var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease),
39
37
  visibility var(--ui-dialog-duration, var(--ui-motion-base)),
40
38
  display var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease) allow-discrete,
41
39
  overlay var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease) allow-discrete;
@@ -105,7 +103,6 @@
105
103
  visibility: visible;
106
104
  pointer-events: auto;
107
105
  opacity: 1;
108
- transform: scale(1);
109
106
  animation: ui-dialog-enter var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease);
110
107
  }
111
108
 
@@ -191,7 +188,6 @@
191
188
  @keyframes ui-dialog-enter {
192
189
  from {
193
190
  opacity: 0;
194
- transform: scale(0.96);
195
191
  }
196
192
  }
197
193
 
@@ -265,10 +261,8 @@
265
261
  visibility: hidden;
266
262
  pointer-events: none;
267
263
  opacity: 0;
268
- transform: scale(0.96);
269
264
  transition:
270
265
  opacity var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease),
271
- transform var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease),
272
266
  visibility var(--ui-dialog-duration, var(--ui-motion-base)),
273
267
  display var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease) allow-discrete,
274
268
  overlay var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease) allow-discrete;
@@ -338,7 +332,6 @@
338
332
  visibility: visible;
339
333
  pointer-events: auto;
340
334
  opacity: 1;
341
- transform: scale(1);
342
335
  animation: ui-dialog-enter var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease);
343
336
  }
344
337
 
@@ -424,7 +417,6 @@
424
417
  @keyframes ui-dialog-enter {
425
418
  from {
426
419
  opacity: 0;
427
- transform: scale(0.96);
428
420
  }
429
421
  }
430
422
 
package/theme-dark.css CHANGED
@@ -2,7 +2,7 @@
2
2
  @media (prefers-color-scheme: dark) {
3
3
  :root:not([data-theme], [data-contrast="high"]) {
4
4
  color-scheme: dark;
5
- /* The same eleven seeds the light theme sets. Every neutral, tint, hover, and disabled
5
+ /* The same color seeds the light theme sets. Every neutral, tint, hover, and disabled
6
6
  colour is mixed from these, and the mixes read the scheme from them: toward this ink
7
7
  brightens here, where it darkened there. */
8
8
  --ui-surface: #1a1a1a;
@@ -13,10 +13,10 @@
13
13
  --ui-on-danger: #1a1a1a;
14
14
 
15
15
  --ui-accent: #a99bf5;
16
- --ui-danger: #ff6b6b;
17
- --ui-success: #33cc66;
18
- --ui-warning: #ffaa22;
19
- --ui-info: #4d9fff;
16
+ --ui-danger: #ffa191;
17
+ --ui-success: #84d393;
18
+ --ui-warning: #f0af63;
19
+ --ui-info: #92c0ff;
20
20
 
21
21
  /* Depth reads differently on a dark surface: deeper shadows, a lit top edge. */
22
22
  --ui-shadow-sm: 0 1px 3px rgb(0 0 0 / 0.45), 0 1px 2px rgb(0 0 0 / 0.3);
@@ -42,10 +42,10 @@
42
42
  --ui-on-danger: #1a1a1a;
43
43
 
44
44
  --ui-accent: #a99bf5;
45
- --ui-danger: #ff6b6b;
46
- --ui-success: #33cc66;
47
- --ui-warning: #ffaa22;
48
- --ui-info: #4d9fff;
45
+ --ui-danger: #ffa191;
46
+ --ui-success: #84d393;
47
+ --ui-warning: #f0af63;
48
+ --ui-info: #92c0ff;
49
49
 
50
50
  /* Depth reads differently on a dark surface: deeper shadows, a lit top edge. */
51
51
  --ui-shadow-sm: 0 1px 3px rgb(0 0 0 / 0.45), 0 1px 2px rgb(0 0 0 / 0.3);
@@ -13,6 +13,8 @@
13
13
  --ui-danger: #8b0000;
14
14
  --ui-success: #006400;
15
15
  --ui-warning: #7a3d00;
16
+ --ui-warning-hover: color-mix(in oklab, var(--ui-warning) 86%, var(--ui-text));
17
+ --ui-warning-active: color-mix(in oklab, var(--ui-warning) 74%, var(--ui-text));
16
18
  --ui-info: #00008b;
17
19
 
18
20
  /* The deliberate divergence, and the whole point of this theme: a mixed border is a grey
@@ -42,6 +44,8 @@
42
44
  --ui-danger: #8b0000;
43
45
  --ui-success: #006400;
44
46
  --ui-warning: #7a3d00;
47
+ --ui-warning-hover: color-mix(in oklab, var(--ui-warning) 86%, var(--ui-text));
48
+ --ui-warning-active: color-mix(in oklab, var(--ui-warning) 74%, var(--ui-text));
45
49
  --ui-info: #00008b;
46
50
 
47
51
  /* The deliberate divergence, and the whole point of this theme: a mixed border is a grey
package/theme-light.css CHANGED
@@ -4,7 +4,7 @@
4
4
  color-scheme: light;
5
5
  --ui-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c5c58' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
6
6
  /* The seeds, and only the seeds. Neutrals, hovers, tints, and disabled colours are mixed from
7
- these in tokens.css, so a product themes Looma by changing these eleven values. */
7
+ these in tokens.css, so a product themes Looma by changing these color values. */
8
8
  --ui-surface: #ffffff;
9
9
  --ui-surface-raised: #ffffff;
10
10
  --ui-surface-sunken: #f0f0ec;
@@ -13,10 +13,10 @@
13
13
  --ui-on-danger: #ffffff;
14
14
 
15
15
  --ui-accent: #5b55d6;
16
- --ui-danger: #c92d1e;
17
- --ui-success: #007a33;
18
- /* Rich amber, with enough depth for white text on solid warning surfaces. */
19
- --ui-warning: #ba5b0b;
20
- --ui-info: #0066cc;
16
+ --ui-danger: #b14d3f;
17
+ --ui-success: #147937;
18
+ /* Amber stays distinct from red; contextual text uses its readable tonal role. */
19
+ --ui-warning: #b27522;
20
+ --ui-info: #2e69b5;
21
21
  }
22
22
  }
package/tokens.css CHANGED
@@ -11,10 +11,10 @@
11
11
  the two surfaces either side of it, and the ink. Everything else — hovers, tints, borders,
12
12
  muted text, disabled — is mixed from them further down, so a theme sets these and stops. */
13
13
  --ui-accent: #5b55d6;
14
- --ui-danger: #c92d1e;
15
- --ui-success: #007a33;
16
- --ui-warning: #ba5b0b;
17
- --ui-info: #0066cc;
14
+ --ui-danger: #b14d3f;
15
+ --ui-success: #147937;
16
+ --ui-warning: #b27522;
17
+ --ui-info: #2e69b5;
18
18
  --ui-on-accent: #ffffff;
19
19
  --ui-on-danger: #ffffff;
20
20
  --ui-surface: #ffffff;
@@ -192,9 +192,9 @@
192
192
  --ui-danger-hover: color-mix(in oklab, var(--ui-danger) 86%, var(--ui-text));
193
193
  --ui-danger-active: color-mix(in oklab, var(--ui-danger) 74%, var(--ui-text));
194
194
  --ui-success-active: color-mix(in oklab, var(--ui-success) 74%, var(--ui-text));
195
- --ui-warning-active: color-mix(in oklab, var(--ui-warning) 74%, var(--ui-text));
195
+ --ui-warning-active: color-mix(in oklab, var(--ui-warning) 74%, #ffffff);
196
196
  --ui-info-active: color-mix(in oklab, var(--ui-info) 74%, var(--ui-text));
197
- --ui-warning-hover: color-mix(in oklab, var(--ui-warning) 86%, var(--ui-text));
197
+ --ui-warning-hover: color-mix(in oklab, var(--ui-warning) 86%, #ffffff);
198
198
  --ui-info-hover: color-mix(in oklab, var(--ui-info) 86%, var(--ui-text));
199
199
 
200
200
  /* Disabled is one decision, not a per-component one: the sunken surface and a pale ink, at
@@ -226,7 +226,7 @@
226
226
  --ui-accent-secondary-hover: color-mix(in oklab, var(--ui-accent-secondary) 86%, var(--ui-text));
227
227
  --ui-accent-secondary-active: color-mix(in oklab, var(--ui-accent-secondary) 74%, var(--ui-text));
228
228
  --ui-accent-secondary-subtle-text: light-dark(oklch(from var(--ui-accent-secondary) min(l, 0.50) min(c, 0.18) h), oklch(from var(--ui-accent-secondary) max(l, 0.80) min(c, 0.16) h));
229
- --ui-accent-secondary-soft: light-dark(oklch(from var(--ui-accent-secondary) 96% min(c, calc(0.02 + 0.03 * max(0, cos(calc((h - 140) * 1deg))))) h), oklch(from var(--ui-accent-secondary) clamp(0.34, l, 0.38) min(c, 0.035) h));
229
+ --ui-accent-secondary-soft: light-dark(oklch(from var(--ui-accent-secondary) 96% min(c, 0.02) h), oklch(from var(--ui-accent-secondary) calc(clamp(0.34, l, 0.38) + 0.04 * pow(max(0, calc(1 - max(calc(h - 70), calc(70 - h)) / 35)), 2)) min(c, calc(0.035 + 0.015 * pow(max(0, calc(1 - max(calc(h - 70), calc(70 - h)) / 35)), 2))) h));
230
230
  --ui-accent-secondary-soft-border: color-mix(in srgb, var(--ui-accent-secondary-soft) 75%, var(--ui-accent-secondary-subtle-text));
231
231
  --ui-accent-secondary-solid: var(--ui-accent-secondary);
232
232
  --ui-accent-secondary-strong-surface: var(--ui-accent-secondary);
@@ -239,7 +239,7 @@
239
239
  --ui-accent-tertiary-hover: color-mix(in oklab, var(--ui-accent-tertiary) 86%, var(--ui-text));
240
240
  --ui-accent-tertiary-active: color-mix(in oklab, var(--ui-accent-tertiary) 74%, var(--ui-text));
241
241
  --ui-accent-tertiary-subtle-text: light-dark(oklch(from var(--ui-accent-tertiary) min(l, 0.50) min(c, 0.18) h), oklch(from var(--ui-accent-tertiary) max(l, 0.80) min(c, 0.16) h));
242
- --ui-accent-tertiary-soft: light-dark(oklch(from var(--ui-accent-tertiary) 96% min(c, calc(0.02 + 0.03 * max(0, cos(calc((h - 140) * 1deg))))) h), oklch(from var(--ui-accent-tertiary) clamp(0.34, l, 0.38) min(c, 0.035) h));
242
+ --ui-accent-tertiary-soft: light-dark(oklch(from var(--ui-accent-tertiary) 96% min(c, 0.02) h), oklch(from var(--ui-accent-tertiary) calc(clamp(0.34, l, 0.38) + 0.04 * pow(max(0, calc(1 - max(calc(h - 70), calc(70 - h)) / 35)), 2)) min(c, calc(0.035 + 0.015 * pow(max(0, calc(1 - max(calc(h - 70), calc(70 - h)) / 35)), 2))) h));
243
243
  --ui-accent-tertiary-soft-border: color-mix(in srgb, var(--ui-accent-tertiary-soft) 75%, var(--ui-accent-tertiary-subtle-text));
244
244
  --ui-accent-tertiary-solid: var(--ui-accent-tertiary);
245
245
  --ui-accent-tertiary-strong-surface: var(--ui-accent-tertiary);
@@ -267,38 +267,40 @@
267
267
  --ui-nav-compact-min-block-size: var(--ui-control-size-sm);
268
268
  --ui-nav-hover-surface: var(--ui-surface-hover);
269
269
 
270
- --ui-accent-soft: light-dark(oklch(from var(--ui-accent) 96% min(c, calc(0.02 + 0.03 * max(0, cos(calc((h - 140) * 1deg))))) h), oklch(from var(--ui-accent) clamp(0.34, l, 0.38) min(c, 0.035) h));
270
+ --ui-accent-soft: light-dark(oklch(from var(--ui-accent) 96% min(c, 0.02) h), oklch(from var(--ui-accent) calc(clamp(0.34, l, 0.38) + 0.04 * pow(max(0, calc(1 - max(calc(h - 70), calc(70 - h)) / 35)), 2)) min(c, calc(0.035 + 0.015 * pow(max(0, calc(1 - max(calc(h - 70), calc(70 - h)) / 35)), 2))) h));
271
271
  --ui-accent-soft-border: color-mix(in srgb, var(--ui-accent-soft) 75%, var(--ui-accent-subtle-text));
272
272
  --ui-accent-contrast: var(--ui-on-accent);
273
273
  --ui-accent-strong-surface: var(--ui-accent);
274
274
  --ui-accent-on-strong: var(--ui-on-accent);
275
275
  --ui-accent-subtle-text: light-dark(oklch(from var(--ui-accent) min(l, 0.50) min(c, 0.18) h), oklch(from var(--ui-accent) max(l, 0.80) min(c, 0.16) h));
276
276
  --ui-danger-solid: var(--ui-danger);
277
- --ui-danger-soft: light-dark(oklch(from var(--ui-danger) 96% min(c, calc(0.02 + 0.03 * max(0, cos(calc((h - 140) * 1deg))))) h), oklch(from var(--ui-danger) clamp(0.34, l, 0.38) min(c, 0.035) h));
277
+ --ui-danger-soft: light-dark(oklch(from var(--ui-danger) 96% min(c, 0.02) h), oklch(from var(--ui-danger) calc(clamp(0.34, l, 0.38) + 0.04 * pow(max(0, calc(1 - max(calc(h - 70), calc(70 - h)) / 35)), 2)) min(c, calc(0.035 + 0.015 * pow(max(0, calc(1 - max(calc(h - 70), calc(70 - h)) / 35)), 2))) h));
278
278
  --ui-danger-soft-border: color-mix(in srgb, var(--ui-danger-soft) 75%, var(--ui-danger-subtle-text));
279
279
  --ui-danger-strong-surface: var(--ui-danger);
280
280
  --ui-danger-on-strong: var(--ui-on-danger);
281
- --ui-danger-subtle-text: light-dark(oklch(from var(--ui-danger) min(l, 0.50) min(c, 0.18) h), oklch(from var(--ui-danger) max(l, 0.80) min(c, 0.16) h));
281
+ --ui-danger-subtle-text: light-dark(oklch(from var(--ui-danger) min(l, 0.50) min(c, 0.12) h), oklch(from var(--ui-danger) max(l, 0.80) min(c, 0.12) h));
282
282
  --ui-success-solid: var(--ui-success);
283
283
  --ui-success-hover: color-mix(in srgb, var(--ui-success) 85%, var(--ui-text));
284
- --ui-success-soft: light-dark(oklch(from var(--ui-success) 96% min(c, calc(0.02 + 0.03 * max(0, cos(calc((h - 140) * 1deg))))) h), oklch(from var(--ui-success) clamp(0.34, l, 0.38) min(c, 0.035) h));
284
+ --ui-success-soft: light-dark(oklch(from var(--ui-success) 96% min(c, 0.02) h), oklch(from var(--ui-success) calc(clamp(0.34, l, 0.38) + 0.04 * pow(max(0, calc(1 - max(calc(h - 70), calc(70 - h)) / 35)), 2)) min(c, calc(0.035 + 0.015 * pow(max(0, calc(1 - max(calc(h - 70), calc(70 - h)) / 35)), 2))) h));
285
285
  --ui-success-soft-border: color-mix(in srgb, var(--ui-success-soft) 75%, var(--ui-success-subtle-text));
286
286
  --ui-success-strong-surface: var(--ui-success);
287
287
  --ui-success-on-strong: var(--ui-on-accent);
288
- --ui-success-subtle-text: light-dark(oklch(from var(--ui-success) min(l, 0.50) min(c, 0.18) h), oklch(from var(--ui-success) max(l, 0.80) min(c, 0.16) h));
288
+ --ui-success-subtle-text: light-dark(oklch(from var(--ui-success) min(l, 0.50) min(c, 0.12) h), oklch(from var(--ui-success) max(l, 0.80) min(c, 0.12) h));
289
289
  --ui-warning-solid: var(--ui-warning);
290
- --ui-warning-soft: light-dark(oklch(from var(--ui-warning) 96% min(c, calc(0.02 + 0.03 * max(0, cos(calc((h - 140) * 1deg))))) h), oklch(from var(--ui-warning) clamp(0.34, l, 0.38) min(c, 0.035) h));
290
+ --ui-warning-soft: light-dark(oklch(from var(--ui-warning) 96% min(c, 0.02) h), oklch(from var(--ui-warning) calc(clamp(0.34, l, 0.38) + 0.04 * pow(max(0, calc(1 - max(calc(h - 70), calc(70 - h)) / 35)), 2)) min(c, calc(0.035 + 0.015 * pow(max(0, calc(1 - max(calc(h - 70), calc(70 - h)) / 35)), 2))) h));
291
291
  --ui-warning-soft-border: color-mix(in srgb, var(--ui-warning-soft) 75%, var(--ui-warning-subtle-text));
292
292
  --ui-warning-strong-surface: var(--ui-warning);
293
- --ui-warning-on-strong: var(--ui-on-accent);
293
+ /* Amber needs dark ink; the deeper high-contrast seed selects light ink. */
294
+ --ui-on-warning: oklch(from var(--ui-warning) clamp(0, calc((.58 - l) * 1000), 1) 0 h);
295
+ --ui-warning-on-strong: var(--ui-on-warning);
294
296
  /* Amber is the lightest intent: it takes more ink than the others to read at 4.5:1, even from a bright seed. */
295
- --ui-warning-subtle-text: light-dark(oklch(from var(--ui-warning) min(l, 0.50) min(c, 0.18) h), oklch(from var(--ui-warning) max(l, 0.80) min(c, 0.16) h));
297
+ --ui-warning-subtle-text: light-dark(oklch(from var(--ui-warning) min(l, 0.50) min(c, 0.12) h), oklch(from var(--ui-warning) max(l, 0.80) min(c, 0.12) h));
296
298
  --ui-info-solid: var(--ui-info);
297
- --ui-info-soft: light-dark(oklch(from var(--ui-info) 96% min(c, calc(0.02 + 0.03 * max(0, cos(calc((h - 140) * 1deg))))) h), oklch(from var(--ui-info) clamp(0.34, l, 0.38) min(c, 0.035) h));
299
+ --ui-info-soft: light-dark(oklch(from var(--ui-info) 96% min(c, 0.02) h), oklch(from var(--ui-info) calc(clamp(0.34, l, 0.38) + 0.04 * pow(max(0, calc(1 - max(calc(h - 70), calc(70 - h)) / 35)), 2)) min(c, calc(0.035 + 0.015 * pow(max(0, calc(1 - max(calc(h - 70), calc(70 - h)) / 35)), 2))) h));
298
300
  --ui-info-soft-border: color-mix(in srgb, var(--ui-info-soft) 75%, var(--ui-info-subtle-text));
299
301
  --ui-info-strong-surface: var(--ui-info);
300
302
  --ui-info-on-strong: var(--ui-on-accent);
301
- --ui-info-subtle-text: light-dark(oklch(from var(--ui-info) min(l, 0.50) min(c, 0.18) h), oklch(from var(--ui-info) max(l, 0.80) min(c, 0.16) h));
303
+ --ui-info-subtle-text: light-dark(oklch(from var(--ui-info) min(l, 0.50) min(c, 0.12) h), oklch(from var(--ui-info) max(l, 0.80) min(c, 0.12) h));
302
304
 
303
305
  /* Interaction roles: what a control paints, whatever its intent. */
304
306
  --ui-action-primary-surface: var(--ui-accent);
@@ -1,8 +1,6 @@
1
1
  // Generated by HTML Next 1.0.0-alpha.69 for Vanilla DOM. Do not edit.
2
2
  export interface UiEditorFootnoteEditorEventMap {
3
3
  text: CustomEvent<{ readonly text: string }>;
4
- label: CustomEvent<{ readonly label: string }>;
5
- go: CustomEvent<Readonly<Record<string, unknown>>>;
6
4
  done: CustomEvent<Readonly<Record<string, unknown>>>;
7
5
  }
8
6
  export interface UiEditorFootnoteEditorElement extends HTMLDivElement {
@@ -14,9 +12,6 @@ export interface UiEditorFootnoteEditorElement extends HTMLDivElement {
14
12
  removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
15
13
  }
16
14
  export interface UiEditorFootnoteEditorProps {
17
- editable?: boolean | null;
18
- error?: string | null;
19
- label?: string | null;
20
15
  note?: string | null;
21
16
  attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
22
17
  children?: readonly (string | Node)[];
@@ -1,13 +1,13 @@
1
1
  // Generated by HTML Next 1.0.0-alpha.69 for Vanilla DOM. Do not edit.
2
- import { attachGeneratedController, buildTemplate, clearRegion, NONCONFORMING, textCall, toAttribute, toText, truthy, writeAttribute, dispatchDeclared, detailCheck, acceptProps, manageProps, generatedInputs, checkBoolean, checkObject, checkRecord, checkString, checkUnknown, defineComponent, activateModule } from "@nextwebwg/html-next/generated-runtime";
2
+ import { attachGeneratedController, buildTemplate, toAttribute, writeAttribute, dispatchDeclared, detailCheck, dispose, acceptProps, manageProps, generatedInputs, project, fillSlot, checkObject, checkRecord, checkString, checkUnknown, defineComponent, activateModule } from "@nextwebwg/html-next/generated-runtime";
3
3
  import * as controller from "../components/ui-editor-footnote-editor/ui-editor-footnote-editor.js";
4
4
  import "../styles/ui-editor-footnote-editor.css";
5
5
 
6
- const T0 = ["",[],"\n ",["ui-stack",["gap","s"],["ui-form-field",[],["label",["slot","label"],"Label"],["ui-input-group",[],["span",["slot","prefix"],"[^"],["ui-input",["data-footnote-label","","size","sm","autocomplete","off"]],["span",["slot","suffix"],"]"]],["span",["slot","error"],0]],"\n ",["ui-form-field",[],["label",["slot","label"],"Note"],["ui-input-group",["multiline",""],["ui-textarea",["data-footnote-note","","size","sm","rows","2","autosize","","placeholder","Write the note"]],["ui-button",["slot","action","size","sm","data-footnote-go",""],"Go to note"]],1]],"\n "];
7
- const T1 = ["span",["slot","help"],"This note has formatting, so it is edited in the document."];
6
+ const T0 = ["",[],"\n ",4,"\n "];
7
+ const T1 = ["",[],["ui-textarea",["data-footnote-note","","aria-label","Footnote","rows","3","autosize","","placeholder","Write the note"]]];
8
8
  let P0, P1;
9
- const S = { n: ["base"], t: ["s"], f: import.meta.url, g: "ui-editor-footnote-editor", d: { "text": [detailCheck(checkObject([["text", checkString, false]], false)), true, true, false], "label": [detailCheck(checkObject([["label", checkString, false]], false)), true, true, false], "go": [detailCheck(checkRecord(checkUnknown)), true, true, false], "done": [detailCheck(checkRecord(checkUnknown)), true, true, false] }, x: dispatchDeclared, a: (host, I) => C(host, I), b: generatedInputs, i: ["ui-editor-footnote-editor"] };
10
- const D = { g: "ui-editor-footnote-editor", props: { "editable": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "error": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "label": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "note": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" } } };
9
+ const S = { n: [], t: [], f: import.meta.url, g: "ui-editor-footnote-editor", d: { "text": [detailCheck(checkObject([["text", checkString, false]], false)), true, true, false], "done": [detailCheck(checkRecord(checkUnknown)), true, true, false] }, x: dispatchDeclared, a: (host, I) => C(host, I), b: generatedInputs };
10
+ const D = { g: "ui-editor-footnote-editor", props: { "note": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" } } };
11
11
  const C = (host) => activateModule(controller, host);
12
12
 
13
13
  export function createUiEditorFootnoteEditor(options = {}, html) {
@@ -21,81 +21,33 @@ export function createUiEditorFootnoteEditor(options = {}, html) {
21
21
  if (!element.hasAttribute("aria-label")) element.setAttribute("aria-label", "Edit footnote");
22
22
  element.setAttribute("data-component", "ui-editor-footnote-editor");
23
23
  element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
24
- const v = ["ui-editor-footnote-editor", null, null, null, null];
24
+ const v = [null];
25
25
  const B = acceptProps(element, D, S.n, v, componentProps, [], html);
26
26
  const m1 = (d) => {
27
27
  const n = (P1 ??= buildTemplate(T1)).cloneNode(true);
28
- const r = { n };
28
+ const t0 = n.firstChild;
29
+ const r = { n, a0: t0, v0: null };
29
30
  p1(r, -1, d);
30
31
  return r;
31
32
  };
32
33
  const p1 = (r, c, d) => {
33
- };
34
- const p0 = (r, c, d) => {
35
- if (c & 4) {
36
- const x0 = (v[2] !== "");
37
- const s0 = toAttribute(x0, "invalid");
38
- if (s0 !== r.v0) writeAttribute(r.a0, "invalid", r.v0 = s0);
39
- const x1 = v[2];
40
- const s4 = toText(x1);
41
- if (s4 !== r.v4) r.a3.data = r.v4 = s4;
42
- }
43
34
  if (c & 1) {
44
- const x2 = textCall("concat", [v[0], "-label"]);
45
- if (x2 !== NONCONFORMING) {
46
- const s1 = toAttribute(x2, "for");
47
- if (s1 !== r.v1) writeAttribute(r.a1, "for", r.v1 = s1);
48
- }
49
- if (x2 !== NONCONFORMING) {
50
- const s2 = toAttribute(x2, "id");
51
- if (s2 !== r.v2) writeAttribute(r.a2, "id", r.v2 = s2);
52
- }
53
- const x3 = textCall("concat", [v[0], "-note"]);
54
- if (x3 !== NONCONFORMING) {
55
- const s5 = toAttribute(x3, "for");
56
- if (s5 !== r.v5) writeAttribute(r.a4, "for", r.v5 = s5);
57
- }
58
- if (x3 !== NONCONFORMING) {
59
- const s6 = toAttribute(x3, "id");
60
- if (s6 !== r.v6) writeAttribute(r.a5, "id", r.v6 = s6);
61
- }
62
- }
63
- if (c & 8) {
64
- const x4 = v[3];
65
- const s3 = toAttribute(x4, "value");
66
- if (s3 !== r.v3) writeAttribute(r.a2, "value", r.v3 = s3);
35
+ const x0 = v[0];
36
+ const s0 = toAttribute(x0, "value");
37
+ if (s0 !== r.v0) writeAttribute(r.a0, "value", r.v0 = s0);
67
38
  }
68
- if (c & 2) {
69
- const x5 = !truthy(v[1]);
70
- const s7 = toAttribute(x5, "readonly");
71
- if (s7 !== r.v7) writeAttribute(r.a5, "readonly", r.v7 = s7);
72
- }
73
- if (c & 16) {
74
- const x6 = v[4];
75
- const s8 = toAttribute(x6, "value");
76
- if (s8 !== r.v8) writeAttribute(r.a5, "value", r.v8 = s8);
77
- }
78
- if (c & 2 && !(!truthy(v[1])) !== !r.b0) {
79
- if (r.b0) { r.b0 = undefined; clearRegion(r.a6, r.e0); }
80
- else { r.b0 = m1(d); r.e0.before(r.b0.n); }
81
- } else if (r.b0 !== undefined) p1(r.b0, c, d);
39
+ };
40
+ const p0 = (r, c, d) => {
41
+ if (r.f0 === undefined) { r.f0 = 1; const at = fillSlot(r.a0, r.e0, "", J, true, undefined, d);
42
+ if (Array.isArray(at)) (r.z ??= []).push(() => { at[0].l.delete(at[1]); dispose(at[1]); }); else if (at !== undefined) { r.b0 = m1(d); at.before(r.b0.n); } }
43
+ else if (r.b0 !== undefined) p1(r.b0, c, d);
82
44
  };
83
45
  const t0 = element.firstChild.nextSibling;
84
- const t1 = t0.firstChild;
85
- const t2 = t1.firstChild;
86
- const t3 = t2.nextSibling;
87
- const t4 = t3.firstChild.nextSibling;
88
- const t5 = t3.nextSibling.firstChild;
89
- const t6 = t1.nextSibling.nextSibling;
90
- const t7 = t6.firstChild;
91
- const t8 = t7.nextSibling;
92
- const t9 = t8.firstChild;
93
- const t10 = t8.nextSibling;
94
- const R = { a0: t1, a1: t2, a2: t4, a3: t5, a4: t7, a5: t9, v0: null, v1: null, v2: null, v3: null, v4: "", v5: null, v6: null, v7: null, v8: null, a6: t10, e0: t10.nextSibling, b0: undefined };
46
+ const R = { a0: t0, e0: t0.nextSibling, b0: undefined, f0: undefined };
95
47
  const I = { B };
96
- I.R = new Set();
97
- attachGeneratedController(element, S, v, (c, d) => { ((c, d) => p0(R, c, d))(c, d); for (const f of I.R) f(c, d); }, undefined, undefined, I);
48
+ const J = project(I, children, slots);
49
+ attachGeneratedController(element, S, v, ((c, d) => p0(R, c, d)), undefined, undefined, I);
98
50
  manageProps(I);
99
51
  return element;
100
52
  }
101
- defineComponent("ui-editor-footnote-editor", createUiEditorFootnoteEditor, ["editable","error","label","note"]);
53
+ defineComponent("ui-editor-footnote-editor", createUiEditorFootnoteEditor, ["note"]);
package/vue/UiCallout.vue CHANGED
@@ -371,10 +371,10 @@ const hostState = computed(() =>
371
371
  }
372
372
 
373
373
  :global(:scope[data-ui-callout-state~="tone=tip"]:where([data-hn-ui-callout])) {
374
- --_callout-border: var(--ui-success-soft-border);
375
- --_callout-surface: var(--ui-success-soft);
376
- --_callout-tone-text: var(--ui-success-subtle-text);
377
- --_callout-icon: var(--ui-success-subtle-text);
374
+ --_callout-border: var(--ui-info-soft-border);
375
+ --_callout-surface: var(--ui-info-soft);
376
+ --_callout-tone-text: var(--ui-info-subtle-text);
377
+ --_callout-icon: var(--ui-info-subtle-text);
378
378
  }
379
379
 
380
380
  :global(:scope[data-ui-callout-state~="tone=important"]:where([data-hn-ui-callout])) {
package/vue/UiDialog.vue CHANGED
@@ -353,7 +353,6 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
353
353
  @keyframes ui-dialog-enter {
354
354
  from {
355
355
  opacity: 0;
356
- transform: scale(0.96);
357
356
  }
358
357
  }
359
358
 
@@ -393,10 +392,8 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
393
392
  visibility: hidden;
394
393
  pointer-events: none;
395
394
  opacity: 0;
396
- transform: scale(0.96);
397
395
  transition:
398
396
  opacity var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease),
399
- transform var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease),
400
397
  visibility var(--ui-dialog-duration, var(--ui-motion-base)),
401
398
  display var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease) allow-discrete,
402
399
  overlay var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease) allow-discrete;
@@ -484,7 +481,6 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
484
481
  visibility: visible;
485
482
  pointer-events: auto;
486
483
  opacity: 1;
487
- transform: scale(1);
488
484
  animation: ui-dialog-enter var(--ui-dialog-duration, var(--ui-motion-base))
489
485
  var(--ui-motion-ease);
490
486
  }
@@ -616,10 +612,8 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
616
612
  visibility: hidden;
617
613
  pointer-events: none;
618
614
  opacity: 0;
619
- transform: scale(0.96);
620
615
  transition:
621
616
  opacity var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease),
622
- transform var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease),
623
617
  visibility var(--ui-dialog-duration, var(--ui-motion-base)),
624
618
  display var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease) allow-discrete,
625
619
  overlay var(--ui-dialog-duration, var(--ui-motion-base)) var(--ui-motion-ease) allow-discrete;
@@ -707,7 +701,6 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
707
701
  visibility: visible;
708
702
  pointer-events: auto;
709
703
  opacity: 1;
710
- transform: scale(1);
711
704
  animation: ui-dialog-enter var(--ui-dialog-duration, var(--ui-motion-base))
712
705
  var(--ui-motion-ease);
713
706
  }
@@ -1,15 +1,10 @@
1
1
  import type { PropType } from 'vue';
2
2
  import { type InputBindings } from './props.js';
3
- declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
- editable: {
5
- type: PropType<boolean | null>;
6
- };
7
- error: {
8
- type: PropType<string | null>;
9
- };
10
- label: {
11
- type: PropType<string | null>;
12
- };
3
+ declare var __VLS_1: {};
4
+ type __VLS_Slots = {} & {
5
+ default?: (props: typeof __VLS_1) => any;
6
+ };
7
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
13
8
  note: {
14
9
  type: PropType<string | null>;
15
10
  };
@@ -18,24 +13,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
18
13
  };
19
14
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
15
  done: (event: CustomEvent<Readonly<Record<string, unknown>>>) => any;
21
- label: (event: CustomEvent<{
22
- readonly label: string;
23
- }>) => any;
24
16
  text: (event: CustomEvent<{
25
17
  readonly text: string;
26
18
  }>) => any;
27
- "update:label": (value: string) => any;
28
- go: (event: CustomEvent<Readonly<Record<string, unknown>>>) => any;
29
19
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
- editable: {
31
- type: PropType<boolean | null>;
32
- };
33
- error: {
34
- type: PropType<string | null>;
35
- };
36
- label: {
37
- type: PropType<string | null>;
38
- };
39
20
  note: {
40
21
  type: PropType<string | null>;
41
22
  };
@@ -44,14 +25,15 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
44
25
  };
45
26
  }>> & Readonly<{
46
27
  onDone?: ((event: CustomEvent<Readonly<Record<string, unknown>>>) => any) | undefined;
47
- onLabel?: ((event: CustomEvent<{
48
- readonly label: string;
49
- }>) => any) | undefined;
50
28
  onText?: ((event: CustomEvent<{
51
29
  readonly text: string;
52
30
  }>) => any) | undefined;
53
- "onUpdate:label"?: ((value: string) => any) | undefined;
54
- onGo?: ((event: CustomEvent<Readonly<Record<string, unknown>>>) => any) | undefined;
55
31
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
32
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
56
33
  declare const _default: typeof __VLS_export;
57
34
  export default _default;
35
+ type __VLS_WithSlots<T, S> = T & {
36
+ new (): {
37
+ $slots: S;
38
+ };
39
+ };