@quillmark/svelte 0.30.0 → 0.32.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 +5 -5
- package/dist/core/address.d.ts +1 -1
- package/dist/core/address.js +1 -1
- package/dist/core/codec/atoms.js +1 -1
- package/dist/core/codec/breaks.js +3 -2
- package/dist/core/codec/decode.d.ts +4 -3
- package/dist/core/codec/decode.js +17 -13
- package/dist/core/codec/field.d.ts +5 -4
- package/dist/core/codec/field.js +139 -49
- package/dist/core/codec/index.d.ts +2 -0
- package/dist/core/codec/index.js +5 -1
- package/dist/core/codec/inputrules.js +3 -3
- package/dist/core/codec/islands.d.ts +1 -1
- package/dist/core/codec/islands.js +3 -3
- package/dist/core/codec/keymap.d.ts +1 -1
- package/dist/core/codec/keymap.js +3 -2
- package/dist/core/codec/list-move.js +2 -1
- package/dist/core/codec/list-paste.js +1 -1
- package/dist/core/codec/lists.d.ts +1 -1
- package/dist/core/codec/lists.js +7 -6
- package/dist/core/codec/markdown-paste.js +2 -2
- package/dist/core/codec/positions.d.ts +12 -1
- package/dist/core/codec/prose.css +3 -11
- package/dist/core/codec/schema.d.ts +3 -3
- package/dist/core/codec/schema.js +6 -6
- package/dist/core/codec/shortcuts.d.ts +91 -0
- package/dist/core/codec/shortcuts.js +135 -0
- package/dist/core/codec/slash.d.ts +4 -2
- package/dist/core/codec/slash.js +11 -1
- package/dist/core/codec/table-paste.js +1 -1
- package/dist/core/codec/table-view.d.ts +1 -1
- package/dist/core/codec/table-view.js +27 -37
- package/dist/core/codec/tasks.js +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/theme.css +16 -8
- package/dist/preset/scale.css +1 -1
- package/dist/preview/Preview.svelte +2 -3
- package/dist/preview/bridge.js +2 -2
- package/dist/preview/geometry.d.ts +2 -2
- package/dist/preview/geometry.js +2 -2
- package/dist/preview/paint.js +1 -1
- package/dist/visual/ArrayField.svelte +172 -87
- package/dist/visual/BooleanField.svelte +3 -3
- package/dist/visual/Card.svelte +68 -47
- package/dist/visual/CardControls.svelte +1 -1
- package/dist/visual/DateField.svelte +17 -2
- package/dist/visual/DiagnosticList.svelte +35 -3
- package/dist/visual/EnumField.svelte +59 -45
- package/dist/visual/Field.svelte +16 -6
- package/dist/visual/Field.svelte.d.ts +3 -1
- package/dist/visual/FieldHint.svelte +10 -3
- package/dist/visual/FormatPopover.svelte +9 -3
- package/dist/visual/MatrixAdd.svelte +4 -19
- package/dist/visual/MatrixField.svelte +21 -13
- package/dist/visual/NumberField.svelte +2 -3
- package/dist/visual/ObjectField.svelte +166 -147
- package/dist/visual/ProseField.svelte +8 -3
- package/dist/visual/SlashMenu.svelte +24 -12
- package/dist/visual/SlashMenu.svelte.d.ts +2 -0
- package/dist/visual/TextField.svelte +1 -1
- package/dist/visual/VariantField.svelte +1 -1
- package/dist/visual/VisualEditor.svelte +1 -1
- package/dist/visual/VisualEditor.svelte.d.ts +1 -1
- package/dist/visual/VisualEditorInner.svelte +159 -24
- package/dist/visual/VisualEditorInner.svelte.d.ts +1 -1
- package/dist/visual/controls.css +43 -5
- package/dist/visual/diagnostics.d.ts +2 -2
- package/dist/visual/diagnostics.js +2 -2
- package/dist/visual/index.d.ts +2 -0
- package/dist/visual/index.js +3 -0
- package/dist/visual/leaves.js +1 -1
- package/dist/visual/props.d.ts +2 -2
- package/dist/visual/strings.d.ts +33 -15
- package/dist/visual/strings.js +42 -7
- package/dist/visual/structure.d.ts +27 -18
- package/dist/visual/structure.js +32 -28
- package/dist/visual/tips.js +1 -1
- 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
package/dist/core/theme.css
CHANGED
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
|
|
109
109
|
Planes are the half that does not read the ink pole, because what makes a
|
|
110
110
|
card read as a card is that it is the brighter plane, in both schemes
|
|
111
|
-
alike (
|
|
111
|
+
alike (INVARIANTS §Styling). A plane stepped toward the ink is right in
|
|
112
112
|
dark and inverted in light, where it darkens the card below the page it
|
|
113
113
|
floats on. So `sunken` and `well` step toward shadow and `raised` toward
|
|
114
114
|
light, and the base plane — a card, the preview's paper — is the pole
|
|
@@ -141,6 +141,11 @@
|
|
|
141
141
|
--_qm-surface: var(--_qm-bg);
|
|
142
142
|
--_qm-surface-well: oklab(from var(--_qm-bg) calc(l - (0.04 + 0.0202 * (1 - l))) a b);
|
|
143
143
|
--_qm-surface-sunken: var(--_qm-surface-well);
|
|
144
|
+
/* The well's own edge, drawn inside it: the fill alone stands about 1.1:1 off the
|
|
145
|
+
card, too faint to find a field by. A step toward the ink laid over the well,
|
|
146
|
+
translucent as `hover` is, so it darkens a light well and lightens a dark one by
|
|
147
|
+
the same measure. */
|
|
148
|
+
--_qm-well-edge: color-mix(in oklab, var(--_qm-fg) 10%, transparent);
|
|
144
149
|
/* `raised` is the same ramp spelled as a mix, its step 0.08 × (1 − l): the light
|
|
145
150
|
arm is zero, a white card having nowhere further to go, so a floating surface
|
|
146
151
|
separates on its hairline and `--_qm-lift` there and the step joins them in
|
|
@@ -215,7 +220,7 @@
|
|
|
215
220
|
|
|
216
221
|
/* The tips card'S hue: the surface's one exit from the greyscale that is not
|
|
217
222
|
a status, and what the amber and the typewriter face say together is
|
|
218
|
-
draft (
|
|
223
|
+
draft (INVARIANTS §"Card operations"). A literal rather than a dial
|
|
219
224
|
because there is nothing left to turn: the rungs under it mix over
|
|
220
225
|
the surface and the ink a consumer already tuned, so the card follows a
|
|
221
226
|
brand untold. The mixes are faint on purpose: a warmth, not a badge.
|
|
@@ -244,9 +249,9 @@
|
|
|
244
249
|
/* ── Ratios and effects ──────────────────────────────────────────────────
|
|
245
250
|
No palette fixes these, so they are their own rungs. */
|
|
246
251
|
--_qm-blur: 8px;
|
|
247
|
-
/* The popover's
|
|
248
|
-
|
|
249
|
-
--_qm-surface-popover: color-mix(in oklab, var(--_qm-surface-raised)
|
|
252
|
+
/* The popover's surface: the raised rung all but opaque, so the blur softens what
|
|
253
|
+
is behind it and a line of text under a toolbar never reads through it. */
|
|
254
|
+
--_qm-surface-popover: color-mix(in oklab, var(--_qm-surface-raised) 96%, transparent);
|
|
250
255
|
/* What a surface with no plane under it lifts on. A tone rung cannot carry that at
|
|
251
256
|
both poles: `raised` is a no-op against a white card (§Colour), so in light the
|
|
252
257
|
hairline is otherwise the whole separation over the body prose these float on.
|
|
@@ -256,10 +261,13 @@
|
|
|
256
261
|
the cue means one thing whichever way the scale runs. Spent only on what floats,
|
|
257
262
|
and the one shadow any surface casts, which is review's to hold. */
|
|
258
263
|
--_qm-lift: 0 0 12px color-mix(in oklab, #000 16%, transparent);
|
|
259
|
-
/* The recede ladder: a
|
|
260
|
-
|
|
261
|
-
correctly given the element's own colour is a rung.
|
|
264
|
+
/* The recede ladder: a disabled affordance, a muted one, and a live one at rest
|
|
265
|
+
that comes up under the pointer. Opacity recedes toward whatever is behind, so
|
|
266
|
+
these invert correctly given the element's own colour is a rung. `rest` keeps a
|
|
267
|
+
label-ink control over 3:1 on the card and the well (WCAG 1.4.11), where `idle`
|
|
268
|
+
is a disabled control's, which owes no contrast. */
|
|
262
269
|
--_qm-opacity-idle: 0.35;
|
|
270
|
+
--_qm-opacity-rest: 0.75;
|
|
263
271
|
--_qm-opacity-muted: 0.5;
|
|
264
272
|
|
|
265
273
|
/* ── Focus ───────────────────────────────────────────────────────────────
|
package/dist/preset/scale.css
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
the page sinks from it by the same ramp. That is what puts a host page and
|
|
32
32
|
an editor's own column on one tone rather than a plane apart. Planes step by
|
|
33
33
|
light and everything else by ink, which is the package's own split
|
|
34
|
-
(
|
|
34
|
+
(INVARIANTS §Styling); the figures are its figures. */
|
|
35
35
|
--qmh-surface: var(--qm-bg, light-dark(#fff, #272729));
|
|
36
36
|
--qmh-page: oklab(from var(--qmh-surface) calc(l - (0.04 + 0.0202 * (1 - l))) a b);
|
|
37
37
|
--qmh-ink: var(--qm-fg, light-dark(#1c1c1c, #d7dadc));
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
`touch-action` leaves a pinch to the viewport, which zooms the pages rather than
|
|
110
110
|
the host's page.
|
|
111
111
|
|
|
112
|
-
`:global(:where(…))` puts this promised class at zero rank (
|
|
112
|
+
`:global(:where(…))` puts this promised class at zero rank (INVARIANTS §Styling). */
|
|
113
113
|
:global(:where(.qm-preview)) {
|
|
114
114
|
box-sizing: border-box;
|
|
115
115
|
position: relative;
|
|
@@ -157,8 +157,7 @@
|
|
|
157
157
|
margin-top: auto;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
/* Floats over the desk, so it lifts the way a floating surface does (
|
|
161
|
-
§Styling), and says only the zoom: the label never changes. Tabular figures and a
|
|
160
|
+
/* Floats over the desk, so it lifts the way a floating surface does (INVARIANTS §Styling), and says only the zoom: the label never changes. Tabular figures and a
|
|
162
161
|
floor as wide as `100%`, so a third digit never shifts its edge. It arrives at once and leaves on the reveal, so a glance at
|
|
163
162
|
it after a gesture still finds it. */
|
|
164
163
|
:global(:where(.qm-preview-zoom)) {
|
package/dist/preview/bridge.js
CHANGED
|
@@ -10,7 +10,7 @@ function hasBox(port) {
|
|
|
10
10
|
const MIN_CLEARANCE = 8;
|
|
11
11
|
/**
|
|
12
12
|
* What a click may miss a field's ink by and still land on it, in CSS px of the page as drawn
|
|
13
|
-
* (
|
|
13
|
+
* (INVARIANTS §"Click bridge").
|
|
14
14
|
*/
|
|
15
15
|
const CLICK_SLACK_PX = 2;
|
|
16
16
|
/**
|
|
@@ -29,7 +29,7 @@ export function clearOfTheFold(target, port) {
|
|
|
29
29
|
export function createBridge(session, container, slots, onPick, held = {}) {
|
|
30
30
|
const unlisten = [];
|
|
31
31
|
// Two rungs: `positionAt` over span-tracked content, then `fieldAt` over every tracked
|
|
32
|
-
// placement (
|
|
32
|
+
// placement (INVARIANTS §"Click bridge"). The second carries no `pos`: a fabricated `0` would
|
|
33
33
|
// be an invented offset.
|
|
34
34
|
if (onPick) {
|
|
35
35
|
for (const { page, el } of slots) {
|
|
@@ -14,8 +14,8 @@ export interface PdfPoint {
|
|
|
14
14
|
y: number;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* An address's boxes: `fieldBoxes`'s union, else every `regions()` rect at or under it
|
|
18
|
-
*
|
|
17
|
+
* An address's boxes: `fieldBoxes`'s union, else every `regions()` rect at or under it.
|
|
18
|
+
* `fieldBoxes` answers `[]` for a scalar reference
|
|
19
19
|
* the plate places without tracking its content and for an array itself; the fallback
|
|
20
20
|
* takes the address and its descendants, matched at a path boundary (`.` or `[`):
|
|
21
21
|
* `main.keywords` matches `main.keywords[0]`, not `main.keywords_note`.
|
package/dist/preview/geometry.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* An address's boxes: `fieldBoxes`'s union, else every `regions()` rect at or under it
|
|
3
|
-
*
|
|
2
|
+
* An address's boxes: `fieldBoxes`'s union, else every `regions()` rect at or under it.
|
|
3
|
+
* `fieldBoxes` answers `[]` for a scalar reference
|
|
4
4
|
* the plate places without tracking its content and for an array itself; the fallback
|
|
5
5
|
* takes the address and its descendants, matched at a path boundary (`.` or `[`):
|
|
6
6
|
* `main.keywords` matches `main.keywords[0]`, not `main.keywords_note`.
|
package/dist/preview/paint.js
CHANGED
|
@@ -37,7 +37,7 @@ onPaintError) {
|
|
|
37
37
|
function makeSlot(page) {
|
|
38
38
|
const size = session.pageSize(page);
|
|
39
39
|
// The paper edge is where `--_qm-surface` meets the container's `--_qm-surface-sunken`; no
|
|
40
|
-
// stroke is drawn (
|
|
40
|
+
// stroke is drawn (INVARIANTS §Styling).
|
|
41
41
|
const el = document.createElement('div');
|
|
42
42
|
// Not `.qm-page`: that is the preset's page baseline, whose `color-scheme` a slot must not
|
|
43
43
|
// take inside a mounted root (`core/theme.css`).
|