@quillmark/svelte 0.30.0 → 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/README.md +2 -2
- package/dist/core/codec/decode.d.ts +3 -2
- package/dist/core/codec/decode.js +15 -11
- package/dist/core/codec/field.d.ts +2 -1
- package/dist/core/codec/field.js +119 -30
- package/dist/core/codec/positions.d.ts +12 -1
- package/dist/core/codec/prose.css +0 -8
- package/dist/core/codec/schema.d.ts +2 -2
- package/dist/core/codec/schema.js +3 -3
- package/dist/core/codec/slash.d.ts +4 -2
- package/dist/core/codec/slash.js +11 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/theme.css +14 -6
- package/dist/visual/ArrayField.svelte +167 -82
- package/dist/visual/BooleanField.svelte +2 -2
- package/dist/visual/Card.svelte +65 -44
- package/dist/visual/DateField.svelte +16 -1
- package/dist/visual/DiagnosticList.svelte +34 -2
- package/dist/visual/EnumField.svelte +58 -44
- package/dist/visual/Field.svelte +13 -3
- package/dist/visual/Field.svelte.d.ts +3 -1
- package/dist/visual/FieldHint.svelte +10 -3
- package/dist/visual/MatrixAdd.svelte +3 -18
- package/dist/visual/MatrixField.svelte +20 -12
- package/dist/visual/ObjectField.svelte +164 -145
- package/dist/visual/ProseField.svelte +6 -1
- package/dist/visual/SlashMenu.svelte +24 -12
- package/dist/visual/SlashMenu.svelte.d.ts +2 -0
- package/dist/visual/VisualEditor.svelte +1 -1
- package/dist/visual/VisualEditor.svelte.d.ts +1 -1
- package/dist/visual/VisualEditorInner.svelte +144 -9
- package/dist/visual/VisualEditorInner.svelte.d.ts +1 -1
- package/dist/visual/controls.css +42 -4
- package/dist/visual/strings.d.ts +27 -10
- package/dist/visual/strings.js +40 -6
- package/dist/visual/structure.d.ts +17 -9
- package/dist/visual/structure.js +19 -16
- package/dist/visual/undo.svelte.d.ts +36 -0
- package/dist/visual/undo.svelte.js +119 -0
- package/package.json +2 -2
- package/dist/visual/hold.d.ts +0 -17
- package/dist/visual/hold.js +0 -39
|
@@ -11,11 +11,15 @@
|
|
|
11
11
|
draws the count beside it: a disabled button takes no focus, so a `title` reaches
|
|
12
12
|
neither a screen reader nor a touch user, and the count is the carrier.
|
|
13
13
|
|
|
14
|
-
An `object` element collapses: the row is its own summary — a box
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
An `object` element collapses: the row is its own summary — a box titled `Item` and
|
|
15
|
+
its 1-based number, whatever the record holds — and opens onto {@link ObjectField}.
|
|
16
|
+
Open, the summary keeps its words, its chevron and its remove where they stood, and
|
|
17
|
+
lets its box go: a line at the tap rung over the subform, so the one thing a press
|
|
18
|
+
on it moves is the chevron. Each row opens and closes on its own: a
|
|
19
|
+
press on a summary toggles that row, and opening one leaves every other where it
|
|
20
|
+
stands, so a landing never folds the row the author was in. A list of one record
|
|
21
|
+
draws it open, on mount and whenever a remove leaves one: its summary would only be
|
|
22
|
+
a press in front of the one record there is. Opening is part of a landing rather than something the user does first:
|
|
19
23
|
`focusPath` opens the row it is aimed at before it focuses, and hands the rest of the
|
|
20
24
|
walk to that row's subform, which is how a row two closed boxes down is reached.
|
|
21
25
|
|
|
@@ -47,6 +51,14 @@
|
|
|
47
51
|
its id for life and no prose leaf inside it remounts; the open row stays open across
|
|
48
52
|
its own move, and `animate:reorder` holds the moving row as it holds a card.
|
|
49
53
|
|
|
54
|
+
An empty list of lines (any element but an `object`) draws a standing row to type
|
|
55
|
+
into, so a list's first line takes no press of the add chip first. The row is not an
|
|
56
|
+
element and draws as one that is not there yet: a row's own box, ghosted and empty,
|
|
57
|
+
with no remove. Nothing commits until it holds something, so the field
|
|
58
|
+
stays where it was, absent or `[]`, and Enter and Backspace have nothing to act on.
|
|
59
|
+
Its first non-empty edit or paste commits it as the list's first element, keeping its
|
|
60
|
+
id, so the caret stays in the leaf it is typing into.
|
|
61
|
+
|
|
50
62
|
An unset array whose `default:` holds elements draws them as its rows, at the default
|
|
51
63
|
rung (`data-default` on the rows' box), since they are what prints. The rows are the
|
|
52
64
|
declared literal rather than resolve's form, which completes a record against `items`:
|
|
@@ -57,11 +69,13 @@
|
|
|
57
69
|
<script lang="ts">
|
|
58
70
|
import { SvelteSet } from 'svelte/reactivity';
|
|
59
71
|
import { wording } from './strings.js';
|
|
72
|
+
import { structuralUndo } from './undo.svelte.js';
|
|
60
73
|
|
|
61
74
|
// The surface's words, ambient from the editor root; the package's English
|
|
62
75
|
// off-tree, so this component renders standalone too.
|
|
63
76
|
const t = wording();
|
|
64
|
-
|
|
77
|
+
const undo = structuralUndo();
|
|
78
|
+
import { onDestroy, tick, untrack } from 'svelte';
|
|
65
79
|
import type { Content, PathStep, QuillFieldSchema } from '@quillmark/wasm';
|
|
66
80
|
import { emptyContent } from '../core/codec/index.js';
|
|
67
81
|
import { createLifespan } from '../core/teardown.js';
|
|
@@ -72,7 +86,6 @@
|
|
|
72
86
|
declaredContent,
|
|
73
87
|
fieldTitle,
|
|
74
88
|
literalText,
|
|
75
|
-
rowSummary,
|
|
76
89
|
schemaAt,
|
|
77
90
|
textCap,
|
|
78
91
|
type ArrayLayout
|
|
@@ -90,7 +103,7 @@
|
|
|
90
103
|
import DiagnosticList from './DiagnosticList.svelte';
|
|
91
104
|
import './controls.css';
|
|
92
105
|
|
|
93
|
-
/** The disclosure glyph, at the size
|
|
106
|
+
/** The disclosure glyph, at the size a panel header's own chevron takes: one
|
|
94
107
|
* disclosure figure per surface, so it is one glyph at one size. */
|
|
95
108
|
const CHEVRON = 16;
|
|
96
109
|
|
|
@@ -186,6 +199,15 @@
|
|
|
186
199
|
const seq = new IdSeq();
|
|
187
200
|
// svelte-ignore state_referenced_locally
|
|
188
201
|
let ids = $state<string[]>(seq.take(rowsOf(value).length));
|
|
202
|
+
// The standing row's id, taken at its first commit and replaced: the row it
|
|
203
|
+
// becomes keeps the id, so its leaf never remounts under the keystroke.
|
|
204
|
+
let standingId = $state(seq.next());
|
|
205
|
+
const standing = $derived(
|
|
206
|
+
!table && control !== 'object' && arr.length === 0 && (max == null || max > 0)
|
|
207
|
+
);
|
|
208
|
+
/** Whether the standing row is drawn: a gesture lands on it, which holds no element yet. */
|
|
209
|
+
const onStanding = $derived(standing && ids.length === 0);
|
|
210
|
+
const rowIds = $derived(onStanding ? [standingId] : ids);
|
|
189
211
|
// Length reconcile (defend against an out-of-band length change);
|
|
190
212
|
// order is maintained by the mutators, not here.
|
|
191
213
|
$effect(() => {
|
|
@@ -243,15 +265,22 @@
|
|
|
243
265
|
// An open row's subform, on the row's id: the landing below walks into it.
|
|
244
266
|
const objEls: Record<string, Subform | undefined> = $state({});
|
|
245
267
|
|
|
246
|
-
/** A
|
|
247
|
-
function
|
|
248
|
-
return
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
268
|
+
/** A row's accessible name: `label` + the title it draws. */
|
|
269
|
+
function elementName(k: number): string {
|
|
270
|
+
return label != null ? t.strings.elementUntitled(label, k + 1) : t.strings.elementItem(k + 1);
|
|
271
|
+
}
|
|
272
|
+
// A list of one record opens it. Keyed on the count moving, so a press that closes
|
|
273
|
+
// the one row holds until the count moves again; `pre`, so a mount draws it open.
|
|
274
|
+
let seenCount = -1;
|
|
275
|
+
$effect.pre(() => {
|
|
276
|
+
const n = ids.length;
|
|
277
|
+
if (n === seenCount) return;
|
|
278
|
+
seenCount = n;
|
|
279
|
+
if (n === 1 && control === 'object' && !table) {
|
|
280
|
+
const only = ids[0];
|
|
281
|
+
untrack(() => open.add(only));
|
|
282
|
+
}
|
|
283
|
+
});
|
|
255
284
|
function toggleRow(id: string): void {
|
|
256
285
|
if (open.has(id)) open.delete(id);
|
|
257
286
|
else open.add(id);
|
|
@@ -282,7 +311,33 @@
|
|
|
282
311
|
return '';
|
|
283
312
|
}
|
|
284
313
|
|
|
314
|
+
/** The standing row becomes the list's first element, keeping its id. */
|
|
315
|
+
function claimStanding(): void {
|
|
316
|
+
ids = [standingId];
|
|
317
|
+
standingId = seq.next();
|
|
318
|
+
}
|
|
319
|
+
/** An empty list's landing: the standing row where one is drawn, else the add chip. */
|
|
320
|
+
function focusEmpty(): void {
|
|
321
|
+
(onStanding ? els[standingId] : addEl)?.focus();
|
|
322
|
+
}
|
|
323
|
+
/** Splice `value` in at `at` under a fresh id and commit it. Every reshape withdraws
|
|
324
|
+
* the editor's standing undo offer: a restore reinserts at the index its removal left,
|
|
325
|
+
* which a reshape moves (`undo.svelte.ts`). */
|
|
326
|
+
function insertAt(at: number, value: unknown): string {
|
|
327
|
+
undo.withdraw();
|
|
328
|
+
const id = seq.next();
|
|
329
|
+
ids = [...ids.slice(0, at), id, ...ids.slice(at)];
|
|
330
|
+
const next = arr.slice();
|
|
331
|
+
next.splice(at, 0, value);
|
|
332
|
+
onCommit(next);
|
|
333
|
+
return id;
|
|
334
|
+
}
|
|
335
|
+
|
|
285
336
|
function commitElement(k: number, next: unknown): void {
|
|
337
|
+
if (onStanding) {
|
|
338
|
+
if (next === undefined || cellBlank(next)) return;
|
|
339
|
+
claimStanding();
|
|
340
|
+
}
|
|
286
341
|
const copy = arr.slice();
|
|
287
342
|
// A cleared element control commits `undefined` (the unset rung), but an
|
|
288
343
|
// array slot is positional: an array defaults as a whole (`[]`), no
|
|
@@ -296,12 +351,7 @@
|
|
|
296
351
|
* no-op at the cap: no editor gesture commits an element past `max:`. */
|
|
297
352
|
function insertAfter(k: number, column?: string): void {
|
|
298
353
|
if (atCap) return;
|
|
299
|
-
const id =
|
|
300
|
-
const at = k + 1;
|
|
301
|
-
ids = [...ids.slice(0, at), id, ...ids.slice(at)];
|
|
302
|
-
const next = arr.slice();
|
|
303
|
-
next.splice(at, 0, emptyElement());
|
|
304
|
-
onCommit(next);
|
|
354
|
+
const id = insertAt(k + 1, emptyElement());
|
|
305
355
|
// A row added is a row to fill in, so an object element arrives open: landing on
|
|
306
356
|
// a collapsed empty summary would make adding one a two-press gesture.
|
|
307
357
|
if (control === 'object' && !table) open.add(id);
|
|
@@ -311,6 +361,8 @@
|
|
|
311
361
|
* several lines into a row, each line past the first a row as Enter would open it.
|
|
312
362
|
* The caret ends where the paste does, at the end of the last. */
|
|
313
363
|
function spill(k: number, row: Content, below: Content[]): void {
|
|
364
|
+
if (onStanding) claimStanding();
|
|
365
|
+
undo.withdraw();
|
|
314
366
|
const at = k + 1;
|
|
315
367
|
const fresh = seq.take(below.length);
|
|
316
368
|
ids = [...ids.slice(0, at), ...fresh, ...ids.slice(at)];
|
|
@@ -333,14 +385,35 @@
|
|
|
333
385
|
* the control the gesture came from: `column`, so Backspace keeps its column as
|
|
334
386
|
* Enter does, or the remove where `fromRemove` says one was pressed, which is
|
|
335
387
|
* pinned and so keeps the clip where the pointer left it, where the first cell
|
|
336
|
-
* would scroll the box back to its start on every press.
|
|
337
|
-
|
|
388
|
+
* would scroll the box back to its start on every press. A removal the user asked for
|
|
389
|
+
* by name, the remove's press or its key, is offered back on the editor's toast
|
|
390
|
+
* (`undo.svelte.ts`); Backspace on an empty element takes nothing worth offering. */
|
|
391
|
+
function remove(k: number, column?: string, fromRemove = false, offer = false): void {
|
|
338
392
|
const dropped = ids[k];
|
|
393
|
+
const value = arr[k];
|
|
394
|
+
const name = rowName(k) ?? t.strings.elementItem(k + 1);
|
|
339
395
|
const next = ids.filter((_, i) => i !== k);
|
|
340
396
|
ids = next;
|
|
341
397
|
drop(dropped);
|
|
342
398
|
onCommit(arr.filter((_, i) => i !== k));
|
|
343
|
-
|
|
399
|
+
if (offer) undo.offer(t.strings.undoRemoved(name), () => restore(k, value));
|
|
400
|
+
else undo.withdraw();
|
|
401
|
+
void focusAfterFlush(next[Math.max(k - 1, 0)], column, fromRemove).then(() => {
|
|
402
|
+
if (offer) undo.hand(document.activeElement);
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
/** A removal's undo: `value` back at `k`, under a fresh id, focused where a landing on
|
|
406
|
+
* it would focus. A no-op once this field is gone, the row with it. */
|
|
407
|
+
function restore(k: number, value: unknown): void {
|
|
408
|
+
if (!span.alive) return;
|
|
409
|
+
void focusAfterFlush(insertAt(Math.min(k, ids.length), value));
|
|
410
|
+
}
|
|
411
|
+
/** A collapsed record's remove key, on its summary: the remove is out of the tab order,
|
|
412
|
+
* and the summary is a button, where the key edits nothing. */
|
|
413
|
+
function onSummaryKey(e: KeyboardEvent, k: number): void {
|
|
414
|
+
if (e.key !== 'Backspace' || !(e.metaKey || e.ctrlKey) || e.shiftKey || e.altKey) return;
|
|
415
|
+
e.preventDefault();
|
|
416
|
+
remove(k, undefined, false, true);
|
|
344
417
|
}
|
|
345
418
|
/**
|
|
346
419
|
* Move element `k` to slot `to`: one splice of the ids and of the values together, so
|
|
@@ -351,6 +424,7 @@
|
|
|
351
424
|
function move(k: number, to: number): void {
|
|
352
425
|
if (to === k || to < 0 || to >= ids.length) return;
|
|
353
426
|
const pressed = document.activeElement;
|
|
427
|
+
undo.withdraw();
|
|
354
428
|
arm.arm();
|
|
355
429
|
const nextIds = ids.slice();
|
|
356
430
|
const [id] = nextIds.splice(k, 1);
|
|
@@ -371,7 +445,7 @@
|
|
|
371
445
|
* wants anyway. Reached by a label click and by the editor's landing verbs, which
|
|
372
446
|
* ask one function so they cannot disagree (`Field`, `leaves.ts`). */
|
|
373
447
|
export function focus(): void {
|
|
374
|
-
if (ids.length === 0) return
|
|
448
|
+
if (ids.length === 0) return focusEmpty();
|
|
375
449
|
if (table) return void cellEls[ids[0]]?.focus();
|
|
376
450
|
if (control === 'object') return focusObjectRow(ids[0]);
|
|
377
451
|
els[ids[0]]?.focus();
|
|
@@ -454,7 +528,7 @@
|
|
|
454
528
|
fromRemove = false
|
|
455
529
|
): Promise<void> {
|
|
456
530
|
if (!(await span.resumes(tick()))) return;
|
|
457
|
-
if (id === undefined) return
|
|
531
|
+
if (id === undefined) return focusEmpty();
|
|
458
532
|
if (table) {
|
|
459
533
|
// Without the focus scroll: the remove is pinned, so it is in view where it
|
|
460
534
|
// stands, and the scroll the browser would make is to its unpinned place at
|
|
@@ -517,6 +591,11 @@
|
|
|
517
591
|
*/
|
|
518
592
|
function onElementKey(e: KeyboardEvent, k: number, column?: string): void {
|
|
519
593
|
if (e.isComposing) return;
|
|
594
|
+
if (onStanding) {
|
|
595
|
+
// No element to insert after or remove: a line is typed first.
|
|
596
|
+
if (e.key === 'Enter' || e.key === 'Backspace') e.preventDefault();
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
520
599
|
if (e.key === 'Enter') {
|
|
521
600
|
e.preventDefault();
|
|
522
601
|
insertAfter(k, column);
|
|
@@ -660,7 +739,7 @@
|
|
|
660
739
|
onCellKey={(e, column) => onElementKey(e, k, column)}
|
|
661
740
|
diagnostics={routed.below.get(k)}
|
|
662
741
|
/>
|
|
663
|
-
{@render removeButton(k)}
|
|
742
|
+
{@render removeButton(k, true)}
|
|
664
743
|
</div>
|
|
665
744
|
{/each}
|
|
666
745
|
</div>
|
|
@@ -696,18 +775,16 @@
|
|
|
696
775
|
type="button"
|
|
697
776
|
class="qm-control-box qm-focus-ring qm-element-summary"
|
|
698
777
|
aria-expanded={open.has(id)}
|
|
699
|
-
aria-
|
|
778
|
+
aria-label={elementName(k)}
|
|
779
|
+
aria-keyshortcuts="Alt+ArrowUp Alt+ArrowDown Meta+Backspace Control+Backspace"
|
|
700
780
|
onclick={() => toggleRow(id)}
|
|
781
|
+
onkeydown={(e) => onSummaryKey(e, k)}
|
|
701
782
|
>
|
|
702
783
|
<!-- Leading, and it rotates: trailing is the figure for pushing a new
|
|
703
784
|
screen, where this unfolds in place. Same glyph, same rotation and
|
|
704
|
-
same rung as
|
|
785
|
+
same rung as a panel header's, so the surface has one disclosure. -->
|
|
705
786
|
<Icon name="chevron-right" class="qm-el-chevron" size={CHEVRON} />
|
|
706
|
-
{
|
|
707
|
-
<span class="qm-element-title">{elementTitle(k)}</span>
|
|
708
|
-
{:else}
|
|
709
|
-
<span class="qm-element-title untitled">{untitled(k)}</span>
|
|
710
|
-
{/if}
|
|
787
|
+
<span class="qm-element-title">{t.strings.elementItem(k + 1)}</span>
|
|
711
788
|
</button>
|
|
712
789
|
<div class="qm-row-actions">
|
|
713
790
|
{@render removeButton(k)}
|
|
@@ -734,12 +811,16 @@
|
|
|
734
811
|
</div>
|
|
735
812
|
{:else}
|
|
736
813
|
<div
|
|
737
|
-
class={['qm-array-rows qm-wash', { empty:
|
|
814
|
+
class={['qm-array-rows qm-wash', { empty: rowIds.length === 0 }]}
|
|
738
815
|
data-default={defaulted ? '' : undefined}
|
|
739
816
|
bind:this={rowsEl}
|
|
740
817
|
>
|
|
741
|
-
{#each
|
|
742
|
-
<div
|
|
818
|
+
{#each rowIds as id, k (id)}
|
|
819
|
+
<div
|
|
820
|
+
class={['qm-array-row qm-wash', { standing: id === standingId }]}
|
|
821
|
+
data-qm-index={k}
|
|
822
|
+
bind:this={rowEls[id]}
|
|
823
|
+
>
|
|
743
824
|
{#if control === 'prose'}
|
|
744
825
|
<ProseValue
|
|
745
826
|
bind:this={els[id]}
|
|
@@ -750,7 +831,7 @@
|
|
|
750
831
|
label={rowName(k)}
|
|
751
832
|
onChange={(rt) => commitElement(k, rt)}
|
|
752
833
|
lines={{
|
|
753
|
-
room: () => (max == null ? Infinity : max - arr.length),
|
|
834
|
+
room: () => (max == null ? Infinity : max - Math.max(arr.length, 1)),
|
|
754
835
|
onLines: (rt, below) => spill(k, rt, below)
|
|
755
836
|
}}
|
|
756
837
|
onKey={(e) => onElementKey(e, k)}
|
|
@@ -764,9 +845,11 @@
|
|
|
764
845
|
onKey={(e) => onElementKey(e, k)}
|
|
765
846
|
/>
|
|
766
847
|
{/if}
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
848
|
+
{#if id !== standingId}
|
|
849
|
+
<div class="qm-row-actions">
|
|
850
|
+
{@render removeButton(k)}
|
|
851
|
+
</div>
|
|
852
|
+
{/if}
|
|
770
853
|
<DiagnosticList diagnostics={routed.below.get(k)?.map((d) => d.diagnostic)} />
|
|
771
854
|
</div>
|
|
772
855
|
{/each}
|
|
@@ -776,14 +859,17 @@
|
|
|
776
859
|
</div>
|
|
777
860
|
|
|
778
861
|
<!-- The remove, one button wherever a row ends: a scalar row's slab, a record row's
|
|
779
|
-
slab after its reorder pair, a table row's last track.
|
|
780
|
-
|
|
862
|
+
slab after its reorder pair, a table row's last track. Out of the tab order where the
|
|
863
|
+
row has a key that removes it: Backspace on an emptied line, ⌘/Ctrl+Backspace on a
|
|
864
|
+
record's summary. A table's filled row has none, so its remove stays a stop. -->
|
|
865
|
+
{#snippet removeButton(k: number, stop = false)}
|
|
781
866
|
<button
|
|
782
867
|
type="button"
|
|
783
868
|
class="qm-icon-btn qm-row-btn qm-remove qm-focus-ring"
|
|
784
869
|
title={t.strings.arrayRemove}
|
|
785
870
|
aria-label={rowAction(t.strings.arrayRemove, k)}
|
|
786
|
-
|
|
871
|
+
tabindex={stop ? undefined : -1}
|
|
872
|
+
onclick={() => remove(k, undefined, true, true)}><Icon name="minus" /></button
|
|
787
873
|
>
|
|
788
874
|
{/snippet}
|
|
789
875
|
|
|
@@ -854,10 +940,18 @@
|
|
|
854
940
|
the default rung (theme.css), a checked switch's track included, and the first
|
|
855
941
|
gesture, writing them, takes it off. */
|
|
856
942
|
.qm-array-rows[data-default] :global(:is(.qm-input, .ProseMirror, .qm-date)),
|
|
857
|
-
.qm-array-rows[data-default] :global(.qm-select:not([data-ghosted]))
|
|
858
|
-
.qm-array-rows[data-default] .qm-element-title:not(.untitled) {
|
|
943
|
+
.qm-array-rows[data-default] :global(.qm-select:not([data-ghosted])) {
|
|
859
944
|
color: var(--_qm-ink-default);
|
|
860
945
|
}
|
|
946
|
+
/* A row that is not an element yet: the box a row draws, at the muted rung until it
|
|
947
|
+
holds the caret, and its first keystroke makes it one. */
|
|
948
|
+
.qm-array-row.standing > :global(:is(.qm-input, .qm-control-box)) {
|
|
949
|
+
opacity: var(--_qm-opacity-muted);
|
|
950
|
+
transition: opacity var(--_qm-duration-fast) var(--_qm-ease-reverse);
|
|
951
|
+
}
|
|
952
|
+
.qm-array-row.standing:focus-within > :global(:is(.qm-input, .qm-control-box)) {
|
|
953
|
+
opacity: 1;
|
|
954
|
+
}
|
|
861
955
|
.qm-array-rows[data-default] :global(.qm-toggle[data-state='checked']) {
|
|
862
956
|
background: var(--_qm-accent-default);
|
|
863
957
|
}
|
|
@@ -902,7 +996,7 @@
|
|
|
902
996
|
inset-inline-end: 0;
|
|
903
997
|
display: flex;
|
|
904
998
|
color: var(--_qm-ink-label);
|
|
905
|
-
opacity: var(--_qm-opacity-
|
|
999
|
+
opacity: var(--_qm-opacity-rest);
|
|
906
1000
|
transition: opacity var(--_qm-duration-fast) var(--_qm-ease-reverse);
|
|
907
1001
|
}
|
|
908
1002
|
.qm-row-btn {
|
|
@@ -1024,12 +1118,17 @@
|
|
|
1024
1118
|
display: grid;
|
|
1025
1119
|
grid-template-columns: minmax(0, 1fr);
|
|
1026
1120
|
}
|
|
1027
|
-
/* A
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1121
|
+
/* A record's summary is a heading's line, open or closed, at the tap rung: a record is
|
|
1122
|
+
a thing you open, where a box with a fill and an edge is a thing you type into, which
|
|
1123
|
+
is what every well beside it is. Only the chevron turns between the two states, so
|
|
1124
|
+
the words, the chevron and the slab stay where the pointer left them. It carries
|
|
1125
|
+
`.qm-control-box` for the recipe's inline inset and type, so its words stand on the
|
|
1126
|
+
column the wells' text does, and gives up the box's fill, edge and block padding. */
|
|
1032
1127
|
.qm-element-summary {
|
|
1128
|
+
min-height: var(--_qm-tap-min);
|
|
1129
|
+
padding-block: 0;
|
|
1130
|
+
background: transparent;
|
|
1131
|
+
box-shadow: none;
|
|
1033
1132
|
display: flex;
|
|
1034
1133
|
align-items: center;
|
|
1035
1134
|
gap: var(--_qm-space);
|
|
@@ -1037,9 +1136,10 @@
|
|
|
1037
1136
|
box-sizing: border-box;
|
|
1038
1137
|
text-align: start;
|
|
1039
1138
|
cursor: pointer;
|
|
1139
|
+
transition: background-color var(--_qm-duration-fast) var(--_qm-ease-reverse);
|
|
1040
1140
|
}
|
|
1041
1141
|
/* No hover fill: a well does not fill under the pointer anywhere on this surface.
|
|
1042
|
-
The chevron's ink is the cue, which is the
|
|
1142
|
+
The chevron's ink is the cue, which is the panel header's own ladder. An open
|
|
1043
1143
|
row's rule reaches its own head and stops: a row's subform holds rows of this same
|
|
1044
1144
|
shape under this same scope, so a descendant's would turn every collapsed chevron
|
|
1045
1145
|
inside an open row to the open face. */
|
|
@@ -1047,7 +1147,7 @@
|
|
|
1047
1147
|
flex-shrink: 0;
|
|
1048
1148
|
display: block;
|
|
1049
1149
|
stroke-width: var(--_qm-glyph-stroke);
|
|
1050
|
-
color: var(--_qm-ink
|
|
1150
|
+
color: var(--_qm-ink);
|
|
1051
1151
|
transform: rotate(0deg);
|
|
1052
1152
|
transform-origin: center;
|
|
1053
1153
|
transition:
|
|
@@ -1057,24 +1157,17 @@
|
|
|
1057
1157
|
.qm-element-summary :global(.qm-el-chevron > *) {
|
|
1058
1158
|
vector-effect: non-scaling-stroke;
|
|
1059
1159
|
}
|
|
1060
|
-
.qm-element-summary:hover :global(.qm-el-chevron),
|
|
1061
|
-
.qm-element.open > .qm-element-head :global(.qm-el-chevron) {
|
|
1062
|
-
color: var(--_qm-ink);
|
|
1063
|
-
}
|
|
1064
1160
|
.qm-element.open > .qm-element-head :global(.qm-el-chevron) {
|
|
1065
1161
|
transform: rotate(90deg);
|
|
1066
1162
|
}
|
|
1067
|
-
/* The title is the
|
|
1068
|
-
|
|
1069
|
-
in it yet and says so the way every other empty rung does. */
|
|
1163
|
+
/* The title is the row's name, at the ink as a card's is, on one line however long
|
|
1164
|
+
the label runs. */
|
|
1070
1165
|
.qm-element-title {
|
|
1071
1166
|
overflow: hidden;
|
|
1072
1167
|
text-overflow: ellipsis;
|
|
1073
1168
|
white-space: nowrap;
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
color: var(--_qm-ink-label);
|
|
1077
|
-
font-style: italic;
|
|
1169
|
+
color: var(--_qm-ink);
|
|
1170
|
+
font-variant-numeric: tabular-nums;
|
|
1078
1171
|
}
|
|
1079
1172
|
/* ── A table ────────────────────────────────────────────────────────────────
|
|
1080
1173
|
Every row of it is open, so it stands where an open row's subform stands: a rung
|
|
@@ -1225,33 +1318,25 @@
|
|
|
1225
1318
|
the two read as one register. Inner radius: the chip family is the card's, and this
|
|
1226
1319
|
box is a line of type. The chip's tap floor is given back (`.qm-tap-floor`),
|
|
1227
1320
|
and the padding with it, so the drawn box is the line and the target is the floor.
|
|
1228
|
-
It
|
|
1229
|
-
|
|
1321
|
+
It is words, so it rests at the label ink in full, where the glyph controls beside a
|
|
1322
|
+
row rest at the rest rung: a text control's floor is WCAG 1.4.3's 4.5:1, which the
|
|
1323
|
+
rest rung over the label ink does not clear. At the cap it rests at the family's
|
|
1324
|
+
disabled rung and the count beside it says why. */
|
|
1230
1325
|
.qm-add-el {
|
|
1231
1326
|
padding: 0 var(--_qm-space);
|
|
1232
1327
|
font-weight: var(--_qm-weight-mid);
|
|
1233
1328
|
line-height: var(--_qm-leading-tight);
|
|
1234
1329
|
border-radius: var(--_qm-radius-inner);
|
|
1235
|
-
opacity: var(--_qm-opacity-idle);
|
|
1236
1330
|
transition:
|
|
1237
1331
|
opacity var(--_qm-duration-fast) var(--_qm-ease-reverse),
|
|
1238
1332
|
background-color var(--_qm-duration-fast) var(--_qm-ease-reverse),
|
|
1239
1333
|
color var(--_qm-duration-fast) var(--_qm-ease-reverse);
|
|
1240
1334
|
}
|
|
1241
|
-
.qm-add-el:
|
|
1242
|
-
|
|
1243
|
-
opacity: 1;
|
|
1244
|
-
}
|
|
1245
|
-
.qm-array.empty .qm-add-el {
|
|
1246
|
-
opacity: 1;
|
|
1335
|
+
.qm-add-el:disabled {
|
|
1336
|
+
opacity: var(--_qm-opacity-idle);
|
|
1247
1337
|
}
|
|
1248
|
-
/* No hover to come up on: the
|
|
1249
|
-
them. */
|
|
1338
|
+
/* No hover to come up on: the handle stands with the controls, already at rest. */
|
|
1250
1339
|
@media (hover: none) {
|
|
1251
|
-
.qm-add-el,
|
|
1252
|
-
.qm-row-actions {
|
|
1253
|
-
opacity: var(--_qm-opacity-muted);
|
|
1254
|
-
}
|
|
1255
1340
|
.qm-row-handle {
|
|
1256
1341
|
opacity: 1;
|
|
1257
1342
|
}
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
is a thumb's width at every setting of `--qm-space`, where a track sized apart from
|
|
85
85
|
its inset ran the checked thumb into the end cap as the inset grew. */
|
|
86
86
|
.qm-toggle-wrap {
|
|
87
|
-
--thumb: 0.
|
|
87
|
+
--thumb: 0.875rem;
|
|
88
88
|
display: flex;
|
|
89
89
|
align-items: center;
|
|
90
90
|
min-height: var(--_qm-box-line);
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
`--_qm-accent` checked. The card's own tone over the band is a step of about
|
|
126
126
|
1.3:1 in light and 1.5:1 in dark, a state indicator under WCAG 1.4.11's 3:1; the
|
|
127
127
|
label rung clears it at both, at 4.6:1 and 3.3:1. No edge of its own: a hairline
|
|
128
|
-
around a
|
|
128
|
+
around a 14px pill is a second box inside the track's. */
|
|
129
129
|
.qm-toggle-wrap :global(.qm-toggle-thumb) {
|
|
130
130
|
width: var(--thumb);
|
|
131
131
|
height: var(--thumb);
|