@quillmark/svelte 0.7.1 → 0.7.3
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/dist/visual/Card.svelte
CHANGED
|
@@ -562,9 +562,9 @@
|
|
|
562
562
|
observer to loop and no re-packing to restructure the DOM under a prose leaf.
|
|
563
563
|
|
|
564
564
|
It steps 1 → 2 → 4, skipping 3: each rung is the width at which a track still clears
|
|
565
|
-
the comfortable field minimum, and an even capacity is what lets
|
|
566
|
-
on a track boundary. A field ends on
|
|
567
|
-
`n * 220px + gaps`. */
|
|
565
|
+
the comfortable field minimum, and an even capacity is what lets the half a subform
|
|
566
|
+
of one takes (`--cols-half`, `ObjectField`) land on a track boundary. A field ends on
|
|
567
|
+
its track's own edge, so a rung is `n * 220px + gaps`. */
|
|
568
568
|
.qm-fields {
|
|
569
569
|
--cols: 1;
|
|
570
570
|
--cols-half: 1;
|
package/dist/visual/Field.svelte
CHANGED
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
const reportFocus = $derived(field.control === 'prose' ? undefined : () => onFocus?.(addr));
|
|
211
211
|
</script>
|
|
212
212
|
|
|
213
|
-
<div class="qm-field" class:cell={span === 'cell'}
|
|
213
|
+
<div class="qm-field" class:cell={span === 'cell'}>
|
|
214
214
|
{#if field.control !== 'array'}
|
|
215
215
|
<FieldLabel
|
|
216
216
|
label={field.label}
|
|
@@ -367,9 +367,9 @@
|
|
|
367
367
|
beside them, whose boxes end where their ink does. What a third track buys is the
|
|
368
368
|
diagnostics of one row starting at one y; the alignment a row is read by is the
|
|
369
369
|
controls', and the label track holds that. A diagnostic grows its row instead. */
|
|
370
|
-
.qm-field.cell
|
|
371
|
-
.qm-field.lone {
|
|
370
|
+
.qm-field.cell {
|
|
372
371
|
display: grid;
|
|
372
|
+
grid-column: span 1;
|
|
373
373
|
grid-row: span 2;
|
|
374
374
|
grid-template-rows: subgrid;
|
|
375
375
|
row-gap: var(--_qm-space);
|
|
@@ -384,9 +384,6 @@
|
|
|
384
384
|
gap: var(--_qm-space);
|
|
385
385
|
min-width: 0;
|
|
386
386
|
}
|
|
387
|
-
.qm-field.cell {
|
|
388
|
-
grid-column: span 1;
|
|
389
|
-
}
|
|
390
387
|
/* Positioned for the arrival wash a landing inserts (`core/bloom.ts`), the way
|
|
391
388
|
`.qm-prose` is: an inset child over the control, since an `<input>` takes none.
|
|
392
389
|
The radius is the control's own, so the wash's corners are the box's rather than
|
|
@@ -396,9 +393,4 @@
|
|
|
396
393
|
position: relative;
|
|
397
394
|
border-radius: var(--_qm-radius-inner);
|
|
398
395
|
}
|
|
399
|
-
/* A run of one takes half the capacity from column 1: `--cols-half` is the section's
|
|
400
|
-
capacity halved, so the edge lands on a track boundary at every capacity. */
|
|
401
|
-
.qm-field.lone {
|
|
402
|
-
grid-column: span var(--cols-half);
|
|
403
|
-
}
|
|
404
396
|
</style>
|
|
@@ -279,8 +279,10 @@
|
|
|
279
279
|
align-items: start;
|
|
280
280
|
min-width: 0;
|
|
281
281
|
}
|
|
282
|
-
/* A subform of one takes half the capacity
|
|
283
|
-
|
|
282
|
+
/* A subform of one takes half the capacity: at full capacity a single track reads as
|
|
283
|
+
truncated, and there are no sibling properties for it to line up with. A stranded
|
|
284
|
+
field takes the whole row instead (`placeFields`): the width it would leave empty is
|
|
285
|
+
the card's, where this one sits inside a figure the nesting has already narrowed. */
|
|
284
286
|
.qm-object-prop:only-child {
|
|
285
287
|
grid-column: span var(--cols-half);
|
|
286
288
|
}
|
package/dist/visual/ext.d.ts
CHANGED
|
@@ -15,5 +15,13 @@ import type { Document, CardAddr } from '@quillmark/wasm';
|
|
|
15
15
|
* The drop is an explicit `delete`, not a stored `undefined`: whether a JS
|
|
16
16
|
* `undefined` survives the wasm-bindgen crossing is not a property worth depending
|
|
17
17
|
* on.
|
|
18
|
+
*
|
|
19
|
+
* **A namespace emptied of keys is removed, not stored empty.** That is
|
|
20
|
+
* `removeExtNamespace`'s one correct use: it takes the whole namespace, and there is
|
|
21
|
+
* nothing left in this one to lose. `$ext` goes with it when `editor` was the last
|
|
22
|
+
* namespace. A stored `{}` survives the model but not the emit, where an empty
|
|
23
|
+
* mapping omits its own key and leaves a bare `$ext:` that reads back as null and
|
|
24
|
+
* fails the next parse. A patch dropping keys the namespace does not have writes
|
|
25
|
+
* nothing, so dismissing tips on a document that carries none is not a mutation.
|
|
18
26
|
*/
|
|
19
27
|
export declare function patchEditorExt(doc: Document, addr: CardAddr, patch: Record<string, unknown>): void;
|
package/dist/visual/ext.js
CHANGED
|
@@ -14,16 +14,28 @@
|
|
|
14
14
|
* The drop is an explicit `delete`, not a stored `undefined`: whether a JS
|
|
15
15
|
* `undefined` survives the wasm-bindgen crossing is not a property worth depending
|
|
16
16
|
* on.
|
|
17
|
+
*
|
|
18
|
+
* **A namespace emptied of keys is removed, not stored empty.** That is
|
|
19
|
+
* `removeExtNamespace`'s one correct use: it takes the whole namespace, and there is
|
|
20
|
+
* nothing left in this one to lose. `$ext` goes with it when `editor` was the last
|
|
21
|
+
* namespace. A stored `{}` survives the model but not the emit, where an empty
|
|
22
|
+
* mapping omits its own key and leaves a bare `$ext:` that reads back as null and
|
|
23
|
+
* fails the next parse. A patch dropping keys the namespace does not have writes
|
|
24
|
+
* nothing, so dismissing tips on a document that carries none is not a mutation.
|
|
17
25
|
*/
|
|
18
26
|
export function patchEditorExt(doc, addr, patch) {
|
|
19
27
|
// `getExtNamespace` reads just this namespace rather than serializing the whole
|
|
20
28
|
// card to fish out one `$ext` slot.
|
|
21
|
-
const
|
|
29
|
+
const current = doc.getExtNamespace(addr, 'editor');
|
|
30
|
+
const next = { ...(current ?? {}) };
|
|
22
31
|
for (const [key, value] of Object.entries(patch)) {
|
|
23
32
|
if (value === undefined)
|
|
24
33
|
delete next[key];
|
|
25
34
|
else
|
|
26
35
|
next[key] = value;
|
|
27
36
|
}
|
|
28
|
-
|
|
37
|
+
if (Object.keys(next).length > 0)
|
|
38
|
+
doc.storeExtNamespace(addr, 'editor', next);
|
|
39
|
+
else if (current)
|
|
40
|
+
doc.removeExtNamespace(addr, 'editor');
|
|
29
41
|
}
|
|
@@ -216,7 +216,7 @@ export declare function groupSections(fields: FieldModel[], order: string[], lab
|
|
|
216
216
|
*/
|
|
217
217
|
export declare function initialExpandedGroup(sections: GroupSection[]): string | null;
|
|
218
218
|
/** How wide a field sits in its section grid. */
|
|
219
|
-
export type FieldSpan = 'cell' | '
|
|
219
|
+
export type FieldSpan = 'cell' | 'full';
|
|
220
220
|
export interface PlacedField {
|
|
221
221
|
field: FieldModel;
|
|
222
222
|
span: FieldSpan;
|
|
@@ -225,8 +225,10 @@ export interface PlacedField {
|
|
|
225
225
|
* Assign each field its span in the section grid. Consecutive packable fields are
|
|
226
226
|
* `cell`s the grid auto-places: capacity and wrapping are the container query's
|
|
227
227
|
* business, so a trailing orphan keeps its column width rather than growing to fill.
|
|
228
|
-
* A
|
|
229
|
-
*
|
|
228
|
+
* A run of one is stranded — nothing packed beside it, and no row above to align to —
|
|
229
|
+
* so it is `full` like the shapes that declined: a lone narrow track reads as truncated
|
|
230
|
+
* against the width it leaves empty, and sharing was the whole of what asked for it.
|
|
231
|
+
* Everything else is `full`.
|
|
230
232
|
*
|
|
231
233
|
* Pure, and stays pure: no width, no measurement, nothing to re-derive on resize.
|
|
232
234
|
*/
|
package/dist/visual/structure.js
CHANGED
|
@@ -218,7 +218,9 @@ export function initialExpandedGroup(sections) {
|
|
|
218
218
|
*
|
|
219
219
|
* A variant declines for the same reason one step further in: its height is the live
|
|
220
220
|
* world's cell count, so it is set by a pick rather than only by the document, and a
|
|
221
|
-
* packed neighbour would reflow every time the discriminant moves.
|
|
221
|
+
* packed neighbour would reflow every time the discriminant moves. The hint reaches
|
|
222
|
+
* nothing inside one either: a world's cells are the object subform's own grid, which
|
|
223
|
+
* reads no `ui` of its own, so `ui.compact` is inert everywhere a variant carries it.
|
|
222
224
|
*
|
|
223
225
|
* An array declines whatever its items are: one-line elements make a one-line step,
|
|
224
226
|
* but nothing holds two arrays to the same number of them, so the shorter of a packed
|
|
@@ -236,8 +238,10 @@ function packable(f) {
|
|
|
236
238
|
* Assign each field its span in the section grid. Consecutive packable fields are
|
|
237
239
|
* `cell`s the grid auto-places: capacity and wrapping are the container query's
|
|
238
240
|
* business, so a trailing orphan keeps its column width rather than growing to fill.
|
|
239
|
-
* A
|
|
240
|
-
*
|
|
241
|
+
* A run of one is stranded — nothing packed beside it, and no row above to align to —
|
|
242
|
+
* so it is `full` like the shapes that declined: a lone narrow track reads as truncated
|
|
243
|
+
* against the width it leaves empty, and sharing was the whole of what asked for it.
|
|
244
|
+
* Everything else is `full`.
|
|
241
245
|
*
|
|
242
246
|
* Pure, and stays pure: no width, no measurement, nothing to re-derive on resize.
|
|
243
247
|
*/
|
|
@@ -248,7 +252,7 @@ export function placeFields(fields) {
|
|
|
248
252
|
// field already placed.
|
|
249
253
|
const flush = () => {
|
|
250
254
|
if (run === 1)
|
|
251
|
-
out[out.length - 1].span = '
|
|
255
|
+
out[out.length - 1].span = 'full';
|
|
252
256
|
run = 0;
|
|
253
257
|
};
|
|
254
258
|
for (const f of fields) {
|