@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.
Files changed (82) hide show
  1. package/README.md +5 -5
  2. package/dist/core/address.d.ts +1 -1
  3. package/dist/core/address.js +1 -1
  4. package/dist/core/codec/atoms.js +1 -1
  5. package/dist/core/codec/breaks.js +3 -2
  6. package/dist/core/codec/decode.d.ts +4 -3
  7. package/dist/core/codec/decode.js +17 -13
  8. package/dist/core/codec/field.d.ts +5 -4
  9. package/dist/core/codec/field.js +139 -49
  10. package/dist/core/codec/index.d.ts +2 -0
  11. package/dist/core/codec/index.js +5 -1
  12. package/dist/core/codec/inputrules.js +3 -3
  13. package/dist/core/codec/islands.d.ts +1 -1
  14. package/dist/core/codec/islands.js +3 -3
  15. package/dist/core/codec/keymap.d.ts +1 -1
  16. package/dist/core/codec/keymap.js +3 -2
  17. package/dist/core/codec/list-move.js +2 -1
  18. package/dist/core/codec/list-paste.js +1 -1
  19. package/dist/core/codec/lists.d.ts +1 -1
  20. package/dist/core/codec/lists.js +7 -6
  21. package/dist/core/codec/markdown-paste.js +2 -2
  22. package/dist/core/codec/positions.d.ts +12 -1
  23. package/dist/core/codec/prose.css +3 -11
  24. package/dist/core/codec/schema.d.ts +3 -3
  25. package/dist/core/codec/schema.js +6 -6
  26. package/dist/core/codec/shortcuts.d.ts +91 -0
  27. package/dist/core/codec/shortcuts.js +135 -0
  28. package/dist/core/codec/slash.d.ts +4 -2
  29. package/dist/core/codec/slash.js +11 -1
  30. package/dist/core/codec/table-paste.js +1 -1
  31. package/dist/core/codec/table-view.d.ts +1 -1
  32. package/dist/core/codec/table-view.js +27 -37
  33. package/dist/core/codec/tasks.js +1 -1
  34. package/dist/core/index.d.ts +1 -0
  35. package/dist/core/theme.css +16 -8
  36. package/dist/preset/scale.css +1 -1
  37. package/dist/preview/Preview.svelte +2 -3
  38. package/dist/preview/bridge.js +2 -2
  39. package/dist/preview/geometry.d.ts +2 -2
  40. package/dist/preview/geometry.js +2 -2
  41. package/dist/preview/paint.js +1 -1
  42. package/dist/visual/ArrayField.svelte +172 -87
  43. package/dist/visual/BooleanField.svelte +3 -3
  44. package/dist/visual/Card.svelte +68 -47
  45. package/dist/visual/CardControls.svelte +1 -1
  46. package/dist/visual/DateField.svelte +17 -2
  47. package/dist/visual/DiagnosticList.svelte +35 -3
  48. package/dist/visual/EnumField.svelte +59 -45
  49. package/dist/visual/Field.svelte +16 -6
  50. package/dist/visual/Field.svelte.d.ts +3 -1
  51. package/dist/visual/FieldHint.svelte +10 -3
  52. package/dist/visual/FormatPopover.svelte +9 -3
  53. package/dist/visual/MatrixAdd.svelte +4 -19
  54. package/dist/visual/MatrixField.svelte +21 -13
  55. package/dist/visual/NumberField.svelte +2 -3
  56. package/dist/visual/ObjectField.svelte +166 -147
  57. package/dist/visual/ProseField.svelte +8 -3
  58. package/dist/visual/SlashMenu.svelte +24 -12
  59. package/dist/visual/SlashMenu.svelte.d.ts +2 -0
  60. package/dist/visual/TextField.svelte +1 -1
  61. package/dist/visual/VariantField.svelte +1 -1
  62. package/dist/visual/VisualEditor.svelte +1 -1
  63. package/dist/visual/VisualEditor.svelte.d.ts +1 -1
  64. package/dist/visual/VisualEditorInner.svelte +159 -24
  65. package/dist/visual/VisualEditorInner.svelte.d.ts +1 -1
  66. package/dist/visual/controls.css +43 -5
  67. package/dist/visual/diagnostics.d.ts +2 -2
  68. package/dist/visual/diagnostics.js +2 -2
  69. package/dist/visual/index.d.ts +2 -0
  70. package/dist/visual/index.js +3 -0
  71. package/dist/visual/leaves.js +1 -1
  72. package/dist/visual/props.d.ts +2 -2
  73. package/dist/visual/strings.d.ts +33 -15
  74. package/dist/visual/strings.js +42 -7
  75. package/dist/visual/structure.d.ts +27 -18
  76. package/dist/visual/structure.js +32 -28
  77. package/dist/visual/tips.js +1 -1
  78. package/dist/visual/undo.svelte.d.ts +36 -0
  79. package/dist/visual/undo.svelte.js +119 -0
  80. package/package.json +2 -2
  81. package/dist/visual/hold.d.ts +0 -17
  82. package/dist/visual/hold.js +0 -39
@@ -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 (ARCHITECTURE §Styling). A plane stepped toward the ink is right in
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 (VISUAL_EDITOR §"Card operations"). A literal rather than a dial
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 translucency: the raised surface mixed toward transparent, so
248
- the page reads faintly through the pill. */
249
- --_qm-surface-popover: color-mix(in oklab, var(--_qm-surface-raised) 82%, transparent);
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 hover-revealed or disabled affordance at rest, and a
260
- muted one. Opacity recedes toward whatever is behind, so these invert
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 ───────────────────────────────────────────────────────────────
@@ -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
- (ARCHITECTURE §Styling); the figures are its figures. */
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 (ARCHITECTURE §Styling). */
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 (ARCHITECTURE
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)) {
@@ -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
- * (PREVIEW.md §"Click bridge").
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 (PREVIEW.md §"Click bridge"). The second carries no `pos`: a fabricated `0` would
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
- * (PREVIEW.md §"Two responsibilities"). `fieldBoxes` answers `[]` for a scalar reference
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`.
@@ -1,6 +1,6 @@
1
1
  /**
2
- * An address's boxes: `fieldBoxes`'s union, else every `regions()` rect at or under it
3
- * (PREVIEW.md §"Two responsibilities"). `fieldBoxes` answers `[]` for a scalar reference
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`.
@@ -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 (ARCHITECTURE §Styling).
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`).