@quillmark/svelte 0.7.3 → 0.9.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/dist/core/codec/blocks.d.ts +5 -1
- package/dist/core/codec/blocks.js +121 -0
- package/dist/core/codec/breaks.d.ts +10 -0
- package/dist/core/codec/breaks.js +37 -0
- package/dist/core/codec/code.d.ts +3 -1
- package/dist/core/codec/code.js +62 -4
- package/dist/core/codec/decode.js +11 -10
- package/dist/core/codec/encode.js +84 -16
- package/dist/core/codec/field.d.ts +5 -4
- package/dist/core/codec/field.js +11 -8
- package/dist/core/codec/islands.d.ts +24 -4
- package/dist/core/codec/islands.js +140 -15
- package/dist/core/codec/keymap.js +2 -1
- package/dist/core/codec/lists.d.ts +5 -1
- package/dist/core/codec/lists.js +77 -14
- package/dist/core/codec/prose.css +6 -12
- package/dist/core/codec/schema.js +150 -9
- package/dist/core/codec/table-view.js +2 -2
- package/dist/core/theme.css +16 -16
- package/dist/visual/ArrayField.svelte +14 -22
- package/dist/visual/BooleanField.svelte +6 -1
- package/dist/visual/Card.svelte +114 -61
- package/dist/visual/CardControls.svelte +31 -26
- package/dist/visual/EnumField.svelte +17 -2
- package/dist/visual/ObjectField.svelte +1 -1
- package/dist/visual/controls.css +63 -28
- package/dist/visual/ext.d.ts +2 -3
- package/dist/visual/ext.js +2 -3
- package/dist/visual/icons/Icon.svelte +2 -3
- package/dist/visual/icons/Icon.svelte.d.ts +2 -3
- package/dist/visual/strings.d.ts +1 -1
- package/package.json +2 -2
package/dist/visual/controls.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* The control recipes more than one component draws: the focus ring, the box a
|
|
2
|
-
typed value sits in,
|
|
3
|
-
component because Svelte scopes a `<style>` block to the component
|
|
4
|
-
markup: a component that carries a shared class without also carrying
|
|
5
|
-
ships unstyled, and nothing raises it.
|
|
2
|
+
typed value sits in, the unboxed glyph, the add strip, and the chip. They live here
|
|
3
|
+
rather than per component because Svelte scopes a `<style>` block to the component
|
|
4
|
+
that owns the markup: a component that carries a shared class without also carrying
|
|
5
|
+
its rule ships unstyled, and nothing raises it.
|
|
6
6
|
|
|
7
7
|
Not in `core/theme.css`: that file is the derivation (public dials in, the
|
|
8
8
|
private `--_qm-*` scale out) and it mints values. This file mints none; every
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
Every selector here is `:where()`-wrapped, so a recipe computes at specificity zero.
|
|
13
13
|
That is the point twice over: a consumer's stylesheet beats the chrome without
|
|
14
14
|
`!important`, and a component's own scoped block overrides its shared base —
|
|
15
|
-
`.qm-card-delete` recolours a `.qm-
|
|
15
|
+
`.qm-card-delete` recolours a `.qm-chip` under the pointer, `.qm-json` adds the monospace face over
|
|
16
16
|
`.qm-input` — with no specificity fight. Unlayered with it, so a host's own layered
|
|
17
17
|
reset never reaches these rules whatever order the sheets load in (`core/theme.css`). */
|
|
18
18
|
|
|
@@ -116,12 +116,11 @@
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
/* The second recipe, and it is not the box above: a field is a box because you
|
|
119
|
-
type into it
|
|
120
|
-
no
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
would flatten that distinction rather than share a recipe.
|
|
119
|
+
type into it. A button rests with no fill; the surface arrives on hover, off the
|
|
120
|
+
rung the enum listbox already highlights with. Deliberately no `color`: the
|
|
121
|
+
callers disagree on purpose (the array remove takes danger under the pointer, the
|
|
122
|
+
tips foot inherits, a chip takes the label tone), and a base colour here would flatten
|
|
123
|
+
that distinction rather than share a recipe.
|
|
125
124
|
|
|
126
125
|
`--_qm-tap-min` is WCAG 2.5.8's floor, read rather than re-expressed per
|
|
127
126
|
control: `min-*` is outside every `check:style` axis, so a second expression of
|
|
@@ -132,9 +131,9 @@
|
|
|
132
131
|
the floor means the same height whatever element carries it; and a caller that
|
|
133
132
|
stretches one of these to its row gets a width the padding sits inside.
|
|
134
133
|
|
|
135
|
-
|
|
136
|
-
glyph
|
|
137
|
-
|
|
134
|
+
Every button family is named here rather than opting in through a marker: a
|
|
135
|
+
glyph, an add strip and a chip are not sometimes flat, so a class they could be
|
|
136
|
+
built without is a class one of them will eventually miss.
|
|
138
137
|
|
|
139
138
|
The type half is the shared rule above, which both families are named in; what
|
|
140
139
|
diverges is the leading. Where the box's height is a line box, a button's is
|
|
@@ -147,7 +146,8 @@
|
|
|
147
146
|
own block: the tips foot takes the label rung, which is that surface's decision,
|
|
148
147
|
not the family's. */
|
|
149
148
|
:where(.qm-icon-btn),
|
|
150
|
-
:where(.qm-add-affordance)
|
|
149
|
+
:where(.qm-add-affordance),
|
|
150
|
+
:where(.qm-chip) {
|
|
151
151
|
line-height: 1;
|
|
152
152
|
box-sizing: border-box;
|
|
153
153
|
min-width: var(--_qm-tap-min);
|
|
@@ -159,17 +159,19 @@
|
|
|
159
159
|
transition: background-color var(--_qm-duration-fast) var(--_qm-ease-reverse);
|
|
160
160
|
}
|
|
161
161
|
:where(.qm-icon-btn:hover:not(:disabled)),
|
|
162
|
-
:where(.qm-add-affordance:hover:not(:disabled))
|
|
162
|
+
:where(.qm-add-affordance:hover:not(:disabled)),
|
|
163
|
+
:where(.qm-chip:hover:not(:disabled)) {
|
|
163
164
|
background: var(--_qm-surface-hover);
|
|
164
165
|
}
|
|
165
166
|
:where(.qm-icon-btn:disabled),
|
|
166
|
-
:where(.qm-add-affordance:disabled)
|
|
167
|
+
:where(.qm-add-affordance:disabled),
|
|
168
|
+
:where(.qm-chip:disabled) {
|
|
167
169
|
opacity: var(--_qm-opacity-idle);
|
|
168
170
|
cursor: default;
|
|
169
171
|
}
|
|
170
172
|
|
|
171
|
-
/* A glyph
|
|
172
|
-
marker, the tips card's foot. */
|
|
173
|
+
/* A glyph riding another plane: the array remove (a slab of the well), the field
|
|
174
|
+
label's guidance marker, the tips card's foot. A named pressable is a chip. */
|
|
173
175
|
:where(.qm-icon-btn) {
|
|
174
176
|
display: inline-flex;
|
|
175
177
|
align-items: center;
|
|
@@ -178,21 +180,54 @@
|
|
|
178
180
|
padding: var(--_qm-space-half) var(--_qm-space);
|
|
179
181
|
}
|
|
180
182
|
|
|
181
|
-
/* An add
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
/* An add strip: the between-card trigger. A pill rather than the inner radius,
|
|
184
|
+
because it fills on hover instead of tinting ink: it rests unfilled on
|
|
185
|
+
`--_qm-opacity-idle`, so a hover shifting ink alone would have little to shift.
|
|
186
|
+
The recede ladder itself stays with the caller: it is driven by the strip's own
|
|
187
|
+
hover/focus state. The array's add is a chip. */
|
|
186
188
|
:where(.qm-add-affordance) {
|
|
187
189
|
border-radius: var(--_qm-radius-pill);
|
|
188
|
-
color: var(--_qm-ink-label);
|
|
189
190
|
transition:
|
|
190
191
|
opacity var(--_qm-duration-fast) var(--_qm-ease-reverse),
|
|
191
192
|
background-color var(--_qm-duration-fast) var(--_qm-ease-reverse);
|
|
192
193
|
}
|
|
193
|
-
|
|
194
|
+
|
|
195
|
+
/* A well spans and sinks. A chip hugs, and like every button it rests unfilled:
|
|
196
|
+
the fill arrives on hover. Named (a label) or unnamed (the glyph is the name) —
|
|
197
|
+
the array's add and the card header's reorder/delete. The card's own radius: a
|
|
198
|
+
chip sits on the card, where a well takes the inner because it is cut into it. A
|
|
199
|
+
glyph riding another plane stays `.qm-icon-btn`; a gap that is the insertion
|
|
200
|
+
stays `.qm-add-affordance`.
|
|
201
|
+
|
|
202
|
+
Ink is the label rung at rest and the body rung under the pointer, the same
|
|
203
|
+
ladder the add strip takes: a chip that sat at `--_qm-ink` read as a written
|
|
204
|
+
value. */
|
|
205
|
+
:where(.qm-chip) {
|
|
206
|
+
font: inherit;
|
|
207
|
+
font-size: var(--_qm-text-label);
|
|
208
|
+
display: inline-flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
justify-content: center;
|
|
211
|
+
gap: var(--_qm-space);
|
|
212
|
+
padding: var(--_qm-space) var(--_qm-space-2);
|
|
213
|
+
border-radius: var(--_qm-radius);
|
|
214
|
+
transition:
|
|
215
|
+
background-color var(--_qm-duration-fast) var(--_qm-ease-reverse),
|
|
216
|
+
color var(--_qm-duration-fast) var(--_qm-ease-reverse);
|
|
217
|
+
}
|
|
218
|
+
:where(.qm-add-affordance),
|
|
219
|
+
:where(.qm-chip) {
|
|
220
|
+
color: var(--_qm-ink-label);
|
|
221
|
+
}
|
|
222
|
+
:where(.qm-add-affordance:hover),
|
|
223
|
+
:where(.qm-chip:hover) {
|
|
194
224
|
color: var(--_qm-ink);
|
|
195
225
|
}
|
|
226
|
+
:where(.qm-chip svg) {
|
|
227
|
+
flex-shrink: 0;
|
|
228
|
+
width: var(--_qm-glyph-control);
|
|
229
|
+
height: var(--_qm-glyph-control);
|
|
230
|
+
}
|
|
196
231
|
|
|
197
232
|
/* The press floor, for a trigger standing in a line of text or a band of gutter
|
|
198
233
|
rather than in a row of its own, whose drawn box is therefore smaller than the target
|
|
@@ -203,8 +238,8 @@
|
|
|
203
238
|
construction: a pseudo-element has no node.
|
|
204
239
|
|
|
205
240
|
The family's floor comes off in the same rule, carrying this class being what giving
|
|
206
|
-
it up means. It sits after
|
|
207
|
-
decides. */
|
|
241
|
+
it up means. It sits after the unboxed recipes for that: same specificity, so source
|
|
242
|
+
order decides. */
|
|
208
243
|
:where(.qm-tap-floor) {
|
|
209
244
|
position: relative;
|
|
210
245
|
min-width: 0;
|
package/dist/visual/ext.d.ts
CHANGED
|
@@ -19,9 +19,8 @@ import type { Document, CardAddr } from '@quillmark/wasm';
|
|
|
19
19
|
* **A namespace emptied of keys is removed, not stored empty.** That is
|
|
20
20
|
* `removeExtNamespace`'s one correct use: it takes the whole namespace, and there is
|
|
21
21
|
* nothing left in this one to lose. `$ext` goes with it when `editor` was the last
|
|
22
|
-
* namespace
|
|
23
|
-
*
|
|
24
|
-
* fails the next parse. A patch dropping keys the namespace does not have writes
|
|
22
|
+
* namespace, so a document nothing has renamed or hinted carries no editor slot
|
|
23
|
+
* rather than an empty one. A patch dropping keys the namespace does not have writes
|
|
25
24
|
* nothing, so dismissing tips on a document that carries none is not a mutation.
|
|
26
25
|
*/
|
|
27
26
|
export declare function patchEditorExt(doc: Document, addr: CardAddr, patch: Record<string, unknown>): void;
|
package/dist/visual/ext.js
CHANGED
|
@@ -18,9 +18,8 @@
|
|
|
18
18
|
* **A namespace emptied of keys is removed, not stored empty.** That is
|
|
19
19
|
* `removeExtNamespace`'s one correct use: it takes the whole namespace, and there is
|
|
20
20
|
* nothing left in this one to lose. `$ext` goes with it when `editor` was the last
|
|
21
|
-
* namespace
|
|
22
|
-
*
|
|
23
|
-
* fails the next parse. A patch dropping keys the namespace does not have writes
|
|
21
|
+
* namespace, so a document nothing has renamed or hinted carries no editor slot
|
|
22
|
+
* rather than an empty one. A patch dropping keys the namespace does not have writes
|
|
24
23
|
* nothing, so dismissing tips on a document that carries none is not a mutation.
|
|
25
24
|
*/
|
|
26
25
|
export function patchEditorExt(doc, addr, patch) {
|
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
interface Props extends Omit<SVGAttributes<SVGSVGElement>, 'name'> {
|
|
11
11
|
name: IconName;
|
|
12
|
-
/** The frame's edge, in px.
|
|
13
|
-
*
|
|
14
|
-
* right hang is measured against the same number. */
|
|
12
|
+
/** The frame's edge, in px. A chip sizes the glyph from `--_qm-glyph-control`
|
|
13
|
+
* in CSS, which beats this attribute; callers that are not chips pass a size. */
|
|
15
14
|
size?: number;
|
|
16
15
|
}
|
|
17
16
|
let { name, size = 24, ...rest }: Props = $props();
|
|
@@ -2,9 +2,8 @@ import { type IconName } from './nodes.js';
|
|
|
2
2
|
import type { SVGAttributes } from 'svelte/elements';
|
|
3
3
|
interface Props extends Omit<SVGAttributes<SVGSVGElement>, 'name'> {
|
|
4
4
|
name: IconName;
|
|
5
|
-
/** The frame's edge, in px.
|
|
6
|
-
*
|
|
7
|
-
* right hang is measured against the same number. */
|
|
5
|
+
/** The frame's edge, in px. A chip sizes the glyph from `--_qm-glyph-control`
|
|
6
|
+
* in CSS, which beats this attribute; callers that are not chips pass a size. */
|
|
8
7
|
size?: number;
|
|
9
8
|
}
|
|
10
9
|
declare const Icon: import("svelte").Component<Props, {}, "">;
|
package/dist/visual/strings.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface VisualStrings extends TableChromeStrings, SlashStrings {
|
|
|
15
15
|
/** The card-title input's accessible name. */
|
|
16
16
|
cardTitle: string;
|
|
17
17
|
/** The trailing strip's visible words, which are also every strip's accessible
|
|
18
|
-
* name; the
|
|
18
|
+
* name; the plus rides the wording. One string over
|
|
19
19
|
* one kind and many: the trigger seeds A card, and which kind is the menu's word
|
|
20
20
|
* to say or the schema's to have already settled. */
|
|
21
21
|
addCard: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quillmark/svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Editor, live-preview and source surfaces over a Quillmark WASM session.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"check": "svelte-check --tsconfig ./tsconfig.json"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@quillmark/wasm": ">=0.
|
|
69
|
+
"@quillmark/wasm": ">=0.109.0-0",
|
|
70
70
|
"svelte": "^5.0.0"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|