@quillmark/svelte 0.5.0 → 0.5.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.
- package/README.md +2 -2
- package/THEMING.md +10 -11
- package/dist/core/theme.css +7 -10
- package/dist/preset/recipes.css +0 -4
- package/dist/preset/scale.css +6 -7
- package/dist/visual/DiagnosticList.svelte +6 -11
- package/dist/visual/Field.svelte +1 -1
- package/dist/visual/VisualEditorInner.svelte +3 -5
- package/dist/visual/diagnostics.d.ts +8 -19
- package/dist/visual/diagnostics.js +9 -27
- package/dist/visual/props.d.ts +1 -1
- package/dist/visual/strings.d.ts +6 -6
- package/dist/visual/structure.d.ts +1 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -152,7 +152,7 @@ The package ships English and a seam to replace it. `strings` is keyed and **par
|
|
|
152
152
|
addCard: '+ Ajouter une carte'
|
|
153
153
|
}}
|
|
154
154
|
formatDiagnostic={(d) =>
|
|
155
|
-
d.code === 'validation::
|
|
155
|
+
d.code === 'validation::type_mismatch' ? `${d.path} : type incorrect` : undefined}
|
|
156
156
|
/>
|
|
157
157
|
```
|
|
158
158
|
|
|
@@ -184,7 +184,7 @@ function recompileNow() {
|
|
|
184
184
|
}
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
-
`session.warnings` is a **getter on a handle Svelte does not track**: pull it per apply, or the editor shows the previous compile's
|
|
187
|
+
`session.warnings` is a **getter on a handle Svelte does not track**: pull it per apply, or the editor shows the previous compile's errors.
|
|
188
188
|
|
|
189
189
|
This shell layer is deliberately yours: the debounce value, what applies at once, and which surfaces refresh are host policy, so the package ships no scheduler over them. Three obligations ride with that: an edit of your own (an import, an undo, a direct `doc` write) recompiles by the same calls, since nothing polls the document; a compile owes the diagnostics re-read above, since nothing polls the session; and teardown clears the timer **before** freeing the handles, so a pending recompile never touches a freed session.
|
|
190
190
|
|
package/THEMING.md
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
There are three depths to that. An app mounting into an unstyled page stops at the first; an app with a plate of its own starts at the second:
|
|
6
6
|
|
|
7
|
-
| | You write
|
|
8
|
-
| ----------------- |
|
|
9
|
-
| **Drop it in** | nothing
|
|
10
|
-
| **Make it yours** |
|
|
11
|
-
| **Match ours** | one CSS import
|
|
7
|
+
| | You write | You get |
|
|
8
|
+
| ----------------- | ---------------------- | ------------------------------------------------------- |
|
|
9
|
+
| **Drop it in** | nothing | a mounted surface that looks right in a bare `<div>` |
|
|
10
|
+
| **Make it yours** | nine custom properties | the whole surface rescaled and recolored to your brand |
|
|
11
|
+
| **Match ours** | one CSS import | the page around the surface, drawn the way we draw ours |
|
|
12
12
|
|
|
13
13
|
## Drop it in
|
|
14
14
|
|
|
@@ -28,7 +28,7 @@ Nothing to import and nothing to set. The package pulls its own stylesheet, and
|
|
|
28
28
|
|
|
29
29
|
## Make it yours
|
|
30
30
|
|
|
31
|
-
The whole contract is **
|
|
31
|
+
The whole contract is **nine CSS custom properties**. They are dials, not a palette: each derives a closed private scale that every component reads, so one override rescales or recolors the whole surface. Set them on any ancestor of a mounted surface (the app, or one pane):
|
|
32
32
|
|
|
33
33
|
```css
|
|
34
34
|
.my-editor {
|
|
@@ -55,7 +55,6 @@ The poles take a colour, not `transparent` or `inherit`: the raised surfaces, th
|
|
|
55
55
|
| `--qm-fg` | `#1c1c1c` / `#d7dadc` | Base ink. Body text, labels, and borders step off it. |
|
|
56
56
|
| `--qm-accent` | `#71717a` / `#a1a1aa` | Focus rings, active marks, the preview's active field box. The surface spends no hue of its own, so this is the one it wears. |
|
|
57
57
|
| `--qm-danger` | `#9e1518` / `#f9786c` | Error diagnostics, the required marker, the delete glyph. |
|
|
58
|
-
| `--qm-warning` | `#926510` / `#fdc776` | Warning diagnostics. |
|
|
59
58
|
| `--qm-font` | `ui-sans-serif, system-ui, sans-serif` | The editor surface's font family. Controls and buttons take it too, in place of the UA face. |
|
|
60
59
|
| `--qm-font-mono` | `ui-monospace, monospace` | The monospace face: the JSON array control, the tips card. |
|
|
61
60
|
| `--qm-font-size` | `0.875rem` | Chrome text: every control's size, the anchor the ramp derives up (title) and down (label/meta) from, and the anchor a document body sits one small step over. |
|
|
@@ -106,9 +105,9 @@ Setting the poles yourself wins over the default in both schemes, so a fixed pal
|
|
|
106
105
|
}
|
|
107
106
|
```
|
|
108
107
|
|
|
109
|
-
That cuts both ways for the status
|
|
108
|
+
That cuts both ways for the status hue: `--qm-danger` defaults to a pair calibrated against the card at both poles, and one pinned value replaces both arms, so a red measured against white carries into the dark scheme unmeasured. Pin it under your own scheme rule (`.dark { --qm-danger: … }`) where the colour your app means by error is itself scheme-aware.
|
|
110
109
|
|
|
111
|
-
A palette **pinned against** your own scheme still wants a second line, for a smaller reason than it used to be: the planes read your card's lightness, so the surface itself lands right either way, but the poles' own defaults, the status
|
|
110
|
+
A palette **pinned against** your own scheme still wants a second line, for a smaller reason than it used to be: the planes read your card's lightness, so the surface itself lands right either way, but the poles' own defaults, the status hue and native chrome all still read `color-scheme`. Pin it with them (`.my-editor { color-scheme: dark }`). Skip that line and what the browser paints — the selection highlight, the scrollbar, the spinner — stays on whichever scheme the host inherits, and a status hue you left to us is measured against the wrong card.
|
|
112
111
|
|
|
113
112
|
Pinning **one mount** rather than a page is the `style` prop, which lands on the same root: `<Preview style="color-scheme: dark" />`. There is no `scheme` prop, and deliberately — an inline declaration of ours would be the one thing your own CSS could not beat.
|
|
114
113
|
|
|
@@ -131,7 +130,7 @@ import '@quillmark/svelte/preset';
|
|
|
131
130
|
|
|
132
131
|
This is the stylesheet our own apps import: the playground and studio draw with these rules and nothing else, so what you get is what we ship, not a reduction of it.
|
|
133
132
|
|
|
134
|
-
It carries a `--qmh-*` scale for the page, derived from the same
|
|
133
|
+
It carries a `--qmh-*` scale for the page, derived from the same nine dials and calibrated against the surfaces' own steps, so a plate of yours and a card of ours agree about which way "raised" goes. Turning a dial moves both.
|
|
135
134
|
|
|
136
135
|
| Class | What it is |
|
|
137
136
|
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
@@ -139,7 +138,7 @@ It carries a `--qmh-*` scale for the page, derived from the same ten dials and c
|
|
|
139
138
|
| `.qm-panel` | The plate your controls and readouts sit on: one rung off the page, a hairline, a corner. |
|
|
140
139
|
| `.qm-label` | A run of chrome type: a section label, the name over a value. |
|
|
141
140
|
| `.qm-readout` | A value read back out of the session, monospace and tabular. `<pre class="qm-readout">` is the block form. |
|
|
142
|
-
| `.qm-status` | A phase line. `.qm-status-error`
|
|
141
|
+
| `.qm-status` | A phase line. `.qm-status-error` is the one it fails to. |
|
|
143
142
|
| `.qm-control` | A boxed button or select, which is what a host's controls are and the package's are not. |
|
|
144
143
|
| `.qm-measure` | A reading column at the width a passage wants. |
|
|
145
144
|
|
package/dist/core/theme.css
CHANGED
|
@@ -89,18 +89,15 @@
|
|
|
89
89
|
/* Neutral: the surface spends no hue on a state it can draw in grey. The pair
|
|
90
90
|
clears WCAG 2.4.11's 3:1 against the card at both poles, at 4.8:1 and 5.8:1. */
|
|
91
91
|
--_qm-accent: var(--qm-accent, light-dark(#71717a, #a1a1aa));
|
|
92
|
-
/* The
|
|
93
|
-
|
|
94
|
-
white reads as a stain on a dark card.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
to carry a label at 4.5:1, so a filled chip needs no third figure. The
|
|
92
|
+
/* The one hue the surface spends, and it spends it on a state. Each pole is
|
|
93
|
+
its own figure rather than one ink shown twice: a hue calibrated against
|
|
94
|
+
white reads as a stain on a dark card. Both clear WCAG 1.4.3's 4.5:1 against
|
|
95
|
+
the card, which is the bar the label rung asks for and the one the glyphs
|
|
96
|
+
drawn in this hue clear on the way past 1.4.11's 3:1. Dark enough at its own
|
|
97
|
+
pole to carry a label at 4.5:1, so a filled chip needs no third figure. The
|
|
99
98
|
figures are the host scale's (`preset/scale.css`), so a page's status line
|
|
100
|
-
and a card's diagnostic carry one colour meaning error
|
|
101
|
-
warning. */
|
|
99
|
+
and a card's diagnostic carry one colour meaning error. */
|
|
102
100
|
--_qm-danger: var(--qm-danger, light-dark(#9e1518, #f9786c));
|
|
103
|
-
--_qm-warning: var(--qm-warning, light-dark(#926510, #fdc776));
|
|
104
101
|
--_qm-font: var(--qm-font, ui-sans-serif, system-ui, sans-serif);
|
|
105
102
|
--_qm-font-mono: var(--qm-font-mono, ui-monospace, monospace);
|
|
106
103
|
|
package/dist/preset/recipes.css
CHANGED
|
@@ -247,10 +247,6 @@ pre.qm-readout {
|
|
|
247
247
|
overflow-wrap: anywhere;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
.qm-status-warn {
|
|
251
|
-
color: var(--qmh-warn);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
250
|
/* ── Surfaces ──────────────────────────────────────────────────────────────── */
|
|
255
251
|
|
|
256
252
|
/* The instrument plate: what a host puts its controls and readouts on. The same plane a
|
package/dist/preset/scale.css
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
page around the surfaces out. `core/theme.css` is the same shape one level down
|
|
3
3
|
(dials in, `--_qm-*` out), and the two are calibrated against each other: the
|
|
4
4
|
figures here are the figures there (the ground step's ramp, 8% hover, 17%
|
|
5
|
-
border, 45% ink, the ring's width, the status
|
|
5
|
+
border, 45% ink, the ring's width, the status hue at both poles) and the
|
|
6
6
|
dial means the same plane in both, so a host plate and a card on it land on the same
|
|
7
7
|
tone at both poles and a host page meets an editor's own column exactly. The well
|
|
8
8
|
under the ground has no counterpart here: a host's own controls are boxed and carry a
|
|
@@ -45,13 +45,12 @@
|
|
|
45
45
|
the underline under a link. */
|
|
46
46
|
--qmh-border-strong: color-mix(in oklab, var(--qmh-surface), var(--qmh-ink) 40%);
|
|
47
47
|
|
|
48
|
-
/* The
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
/* The hue a host spends on a failure. The figures are the surfaces' own, so a
|
|
49
|
+
page's status line and a card's diagnostic carry one colour meaning error.
|
|
50
|
+
Each pole is its own figure: a hue calibrated against white reads as a stain
|
|
51
|
+
on a dark page. The dial sits in front of the pair, as every pole's does, so
|
|
52
|
+
a host that turns one owns both schemes. */
|
|
53
53
|
--qmh-alert: var(--qm-danger, light-dark(#9e1518, #f9786c));
|
|
54
|
-
--qmh-warn: var(--qm-warning, light-dark(#926510, #fdc776));
|
|
55
54
|
|
|
56
55
|
/* ── Rhythm ──────────────────────────────────────────────────────────────── */
|
|
57
56
|
/* One base and its multiples, the same four steps the surfaces derive. A host
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
Inline diagnostic display (VISUAL_EDITOR §Diagnostics),
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
Inline diagnostic display (VISUAL_EDITOR §Diagnostics). Errors only, non-gating:
|
|
3
|
+
purely additive, never disables the field it sits under. Shared by `Field.svelte`
|
|
4
|
+
(a scalar/prose field) and `Card.svelte` (the body leaf, which has no
|
|
5
|
+
`Field.svelte` wrapper), so a card's body diagnostics render the same way a
|
|
6
|
+
field's do.
|
|
7
7
|
-->
|
|
8
8
|
<script lang="ts">
|
|
9
9
|
import type { Diagnostic } from '@quillmark/wasm';
|
|
@@ -27,9 +27,7 @@
|
|
|
27
27
|
<!-- role=status: commit errors appear mid-typing; announce without stealing focus. -->
|
|
28
28
|
<div class="qm-diag-list" role="status">
|
|
29
29
|
{#each diagnostics as d, i (i)}
|
|
30
|
-
<span class="qm-diag-line"
|
|
31
|
-
>{diagnosticText(d, t.formatDiagnostic)}</span
|
|
32
|
-
>
|
|
30
|
+
<span class="qm-diag-line">{diagnosticText(d, t.formatDiagnostic)}</span>
|
|
33
31
|
{/each}
|
|
34
32
|
</div>
|
|
35
33
|
{/if}
|
|
@@ -42,9 +40,6 @@
|
|
|
42
40
|
}
|
|
43
41
|
.qm-diag-line {
|
|
44
42
|
font-size: var(--_qm-text-label);
|
|
45
|
-
color: var(--_qm-warning);
|
|
46
|
-
}
|
|
47
|
-
.qm-diag-line[data-severity='error'] {
|
|
48
43
|
color: var(--_qm-danger);
|
|
49
44
|
}
|
|
50
45
|
</style>
|
package/dist/visual/Field.svelte
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
`diagnostics` is the routed `Diagnostic[]` for this field (VisualEditor's
|
|
12
12
|
`diagByKey`, merging `quill.validate`, local commit errors, and the external
|
|
13
13
|
`diagnostics` prop (VISUAL_EDITOR §Diagnostics)) rendered via the shared
|
|
14
|
-
`DiagnosticList`,
|
|
14
|
+
`DiagnosticList`, non-gating.
|
|
15
15
|
-->
|
|
16
16
|
<script lang="ts">
|
|
17
17
|
import type { Document, Quill, Addr, Diagnostic, ResolvedField } from '@quillmark/wasm';
|
|
@@ -58,7 +58,6 @@
|
|
|
58
58
|
} from './structure.js';
|
|
59
59
|
import {
|
|
60
60
|
fieldKeyToString,
|
|
61
|
-
inlineShown,
|
|
62
61
|
resolveCardKey,
|
|
63
62
|
routeAndResolve,
|
|
64
63
|
mergeDiagnostics,
|
|
@@ -487,11 +486,10 @@
|
|
|
487
486
|
|
|
488
487
|
// All three producers. The two positional ones resolve their `.path` to the live
|
|
489
488
|
// stable-id keying; commit errors are id-keyed already. Nothing is dropped for
|
|
490
|
-
// being unwelcome — diagnostics never gate — but
|
|
491
|
-
//
|
|
492
|
-
// states that (`inlineShown`).
|
|
489
|
+
// being unwelcome — diagnostics never gate — but warnings do not draw: only
|
|
490
|
+
// errors reach a control (`routeAndResolve`).
|
|
493
491
|
const diagByKey = $derived.by(() => {
|
|
494
|
-
const fromValidate = routeAndResolve(validation
|
|
492
|
+
const fromValidate = routeAndResolve(validation, cardIds);
|
|
495
493
|
const fromExternal = routeAndResolve(diagnostics, cardIds);
|
|
496
494
|
return mergeDiagnostics(fromValidate, fromExternal, [...commitErrors.values()]);
|
|
497
495
|
});
|
|
@@ -27,32 +27,21 @@ export interface RoutedDiagnostic {
|
|
|
27
27
|
key: FieldKey;
|
|
28
28
|
diagnostic: Diagnostic;
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Whether a validation diagnostic is the surface's to show under a control
|
|
32
|
-
* (VISUAL_EDITOR §Diagnostics). Obligation is not: the label's `*` already states
|
|
33
|
-
* it, from the same schema, for the same cells, and it states it whether or not the
|
|
34
|
-
* cell has been answered — so the warning is a second copy of a mark on screen, once
|
|
35
|
-
* per obliged field, on every document nobody has finished. That is every obliged
|
|
36
|
-
* field of a fresh seed, which is what a consumer's first mount is.
|
|
37
|
-
*
|
|
38
|
-
* Withheld from the boundary's own validation lane only. A consumer's `diagnostics`
|
|
39
|
-
* prop passes whole: what a host hands the surface, the host asked to see. And
|
|
40
|
-
* nothing is suppressed at the source — `quill.validate(doc)` is the completeness
|
|
41
|
-
* read, unchanged and still the host's to make.
|
|
42
|
-
*/
|
|
43
|
-
export declare function inlineShown(d: Diagnostic): boolean;
|
|
44
30
|
/**
|
|
45
31
|
* Route a path-keyed producer's raw `Diagnostic[]` (validate / external) to the
|
|
46
32
|
* editor's stable-id keying: the one door producers #1/#3 take, `addrForFieldPath`
|
|
47
|
-
* and `resolveCardKey` in a single pass.
|
|
48
|
-
*
|
|
49
|
-
*
|
|
33
|
+
* and `resolveCardKey` in a single pass. Warnings do not draw (VISUAL_EDITOR
|
|
34
|
+
* §Diagnostics): obligation, completeness, a render note — none of them is a value
|
|
35
|
+
* the field cannot hold. An entry also drops rather than mis-routes when it carries
|
|
36
|
+
* no `path`, when the path names no single commit address (a nested / array-element
|
|
37
|
+
* one), or when its absolute card index is out of the live `cardIds`. Completeness
|
|
38
|
+
* stays a read the host makes on `quill.validate(doc)`.
|
|
50
39
|
*/
|
|
51
40
|
export declare function routeAndResolve(diagnostics: Diagnostic[] | undefined, cardIds: readonly string[]): RoutedDiagnostic[];
|
|
52
41
|
/**
|
|
53
42
|
* Merge N routed groups into `Map<fieldKeyToString(key), Diagnostic[]>`.
|
|
54
43
|
* Dedupes an identical `(severity, message)` pair landing on the same key from
|
|
55
|
-
* more than one group (e.g. the same
|
|
56
|
-
* an external feed)
|
|
44
|
+
* more than one group (e.g. the same error present in both `validate()` and
|
|
45
|
+
* an external feed). Producer order within a key.
|
|
57
46
|
*/
|
|
58
47
|
export declare function mergeDiagnostics(...groups: RoutedDiagnostic[][]): Map<string, Diagnostic[]>;
|
|
@@ -18,33 +18,20 @@ export function resolveCardKey(key, cardIds) {
|
|
|
18
18
|
const id = key.card >= 0 && key.card < cardIds.length ? cardIds[key.card] : undefined;
|
|
19
19
|
return id != null ? { card: id, field: key.field } : undefined;
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
22
|
-
* Whether a validation diagnostic is the surface's to show under a control
|
|
23
|
-
* (VISUAL_EDITOR §Diagnostics). Obligation is not: the label's `*` already states
|
|
24
|
-
* it, from the same schema, for the same cells, and it states it whether or not the
|
|
25
|
-
* cell has been answered — so the warning is a second copy of a mark on screen, once
|
|
26
|
-
* per obliged field, on every document nobody has finished. That is every obliged
|
|
27
|
-
* field of a fresh seed, which is what a consumer's first mount is.
|
|
28
|
-
*
|
|
29
|
-
* Withheld from the boundary's own validation lane only. A consumer's `diagnostics`
|
|
30
|
-
* prop passes whole: what a host hands the surface, the host asked to see. And
|
|
31
|
-
* nothing is suppressed at the source — `quill.validate(doc)` is the completeness
|
|
32
|
-
* read, unchanged and still the host's to make.
|
|
33
|
-
*/
|
|
34
|
-
export function inlineShown(d) {
|
|
35
|
-
return d.code !== 'validation::must_fill';
|
|
36
|
-
}
|
|
37
21
|
/**
|
|
38
22
|
* Route a path-keyed producer's raw `Diagnostic[]` (validate / external) to the
|
|
39
23
|
* editor's stable-id keying: the one door producers #1/#3 take, `addrForFieldPath`
|
|
40
|
-
* and `resolveCardKey` in a single pass.
|
|
41
|
-
*
|
|
42
|
-
*
|
|
24
|
+
* and `resolveCardKey` in a single pass. Warnings do not draw (VISUAL_EDITOR
|
|
25
|
+
* §Diagnostics): obligation, completeness, a render note — none of them is a value
|
|
26
|
+
* the field cannot hold. An entry also drops rather than mis-routes when it carries
|
|
27
|
+
* no `path`, when the path names no single commit address (a nested / array-element
|
|
28
|
+
* one), or when its absolute card index is out of the live `cardIds`. Completeness
|
|
29
|
+
* stays a read the host makes on `quill.validate(doc)`.
|
|
43
30
|
*/
|
|
44
31
|
export function routeAndResolve(diagnostics, cardIds) {
|
|
45
32
|
const out = [];
|
|
46
33
|
for (const d of diagnostics ?? []) {
|
|
47
|
-
if (!d.path)
|
|
34
|
+
if (d.severity !== 'error' || !d.path)
|
|
48
35
|
continue;
|
|
49
36
|
const key = addrForFieldPath(d.path);
|
|
50
37
|
const resolved = key && resolveCardKey(key, cardIds);
|
|
@@ -53,13 +40,11 @@ export function routeAndResolve(diagnostics, cardIds) {
|
|
|
53
40
|
}
|
|
54
41
|
return out;
|
|
55
42
|
}
|
|
56
|
-
/** Severity ordering: errors sort before warnings within a field's list (never dropped, just ranked: VISUAL_EDITOR §Diagnostics "nothing gates" extends to nothing hides). */
|
|
57
|
-
const SEVERITY_RANK = { error: 0, warning: 1 };
|
|
58
43
|
/**
|
|
59
44
|
* Merge N routed groups into `Map<fieldKeyToString(key), Diagnostic[]>`.
|
|
60
45
|
* Dedupes an identical `(severity, message)` pair landing on the same key from
|
|
61
|
-
* more than one group (e.g. the same
|
|
62
|
-
* an external feed)
|
|
46
|
+
* more than one group (e.g. the same error present in both `validate()` and
|
|
47
|
+
* an external feed). Producer order within a key.
|
|
63
48
|
*/
|
|
64
49
|
export function mergeDiagnostics(...groups) {
|
|
65
50
|
const byKey = new Map();
|
|
@@ -80,8 +65,5 @@ export function mergeDiagnostics(...groups) {
|
|
|
80
65
|
byKey.set(k, [diagnostic]);
|
|
81
66
|
}
|
|
82
67
|
}
|
|
83
|
-
for (const arr of byKey.values()) {
|
|
84
|
-
arr.sort((a, b) => SEVERITY_RANK[a.severity] - SEVERITY_RANK[b.severity]);
|
|
85
|
-
}
|
|
86
68
|
return byKey;
|
|
87
69
|
}
|
package/dist/visual/props.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export interface VisualEditorProps {
|
|
|
61
61
|
onError?: EditorErrorHandler;
|
|
62
62
|
/**
|
|
63
63
|
* External diagnostics, routed by `.path` and merged with `quill.validate`
|
|
64
|
-
* and local commit errors (VISUAL_EDITOR §Diagnostics).
|
|
64
|
+
* and local commit errors (VISUAL_EDITOR §Diagnostics). Warnings do not draw.
|
|
65
65
|
*/
|
|
66
66
|
diagnostics?: Diagnostic[];
|
|
67
67
|
/**
|
package/dist/visual/strings.d.ts
CHANGED
|
@@ -66,12 +66,12 @@ export interface VisualStrings extends TableChromeStrings, SlashStrings {
|
|
|
66
66
|
* interpolates, keyed by name. What it can re-word tracks what that type carries per
|
|
67
67
|
* lane (VISUAL_EDITOR §Diagnostics for why each lands where it does):
|
|
68
68
|
*
|
|
69
|
-
* - **`validation::enum_violation`, `type_mismatch`, `format_violation
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
69
|
+
* - **`validation::enum_violation`, `type_mismatch`, `format_violation`**: the
|
|
70
|
+
* constraint re-words from the quill's schema at `path`, the offending value from
|
|
71
|
+
* `args` (`value` / `sourceToken` / `actual`, the engine testifying to what it
|
|
72
|
+
* saw) and never from the document at `path`: validation runs post-coercion, so
|
|
73
|
+
* the validator read a value the document does not hold and a sentence built from
|
|
74
|
+
* `path` names a spelling the user never typed.
|
|
75
75
|
* - **`edit::field_coercion_failed`**: re-words from the app's own control state, the
|
|
76
76
|
* refused value being in neither document (unchanged on throw) nor schema.
|
|
77
77
|
* - **`parse::yaml_error_with_location`, `invalid_structure`**: does not re-word. No
|
|
@@ -21,8 +21,7 @@ export interface FieldModel {
|
|
|
21
21
|
* `default:`'s absence when the field declares none (DOCUMENT_MODEL). Drives a
|
|
22
22
|
* persistent label `*`; a field can carry both it and a ghosted `default:`,
|
|
23
23
|
* since the two axes are independent. Persistent (schema-derived, survives
|
|
24
|
-
* filling)
|
|
25
|
-
* Label chrome only; never gates.
|
|
24
|
+
* filling). Label chrome only; never gates.
|
|
26
25
|
*/
|
|
27
26
|
required: boolean;
|
|
28
27
|
/** Prose-leaf flags (only meaningful when `control === 'prose'` / array items). */
|