@quillmark/svelte 0.1.1 → 0.2.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 +15 -11
- package/THEMING.md +42 -23
- package/dist/core/address.d.ts +39 -4
- package/dist/core/address.js +47 -19
- package/dist/core/codec/encode.js +4 -1
- package/dist/core/codec/field.d.ts +1 -1
- package/dist/core/codec/prose.css +41 -18
- package/dist/core/codec/table.js +3 -1
- package/dist/core/errors.d.ts +15 -5
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +5 -4
- package/dist/core/lifecycle.d.ts +21 -5
- package/dist/core/lifecycle.js +34 -8
- package/dist/core/rebind.svelte.d.ts +16 -2
- package/dist/core/rebind.svelte.js +26 -8
- package/dist/core/theme.css +43 -18
- package/dist/preset/recipes.css +55 -8
- package/dist/preset/scale.css +5 -4
- package/dist/preview/Preview.svelte +10 -9
- package/dist/preview/Preview.svelte.d.ts +5 -5
- package/dist/preview/bridge.d.ts +6 -4
- package/dist/preview/bridge.js +17 -7
- package/dist/preview/controller.d.ts +13 -6
- package/dist/preview/controller.js +5 -2
- package/dist/preview/geometry.d.ts +16 -1
- package/dist/preview/geometry.js +20 -0
- package/dist/preview/index.d.ts +1 -0
- package/dist/preview/index.js +7 -0
- package/dist/preview/overlay.d.ts +2 -1
- package/dist/preview/overlay.js +24 -9
- package/dist/preview/paint.js +4 -0
- package/dist/visual/ArrayField.svelte +26 -20
- package/dist/visual/ArrayField.svelte.d.ts +4 -3
- package/dist/visual/Card.svelte +21 -19
- package/dist/visual/Card.svelte.d.ts +8 -3
- package/dist/visual/DiagnosticList.svelte +1 -1
- package/dist/visual/EnumField.svelte +34 -14
- package/dist/visual/EnumField.svelte.d.ts +4 -3
- package/dist/visual/Field.svelte +87 -25
- package/dist/visual/Field.svelte.d.ts +11 -7
- package/dist/visual/FieldHint.svelte +59 -10
- package/dist/visual/FormatPopover.svelte +3 -1
- package/dist/visual/ObjectField.svelte +21 -2
- package/dist/visual/ObjectField.svelte.d.ts +3 -1
- package/dist/visual/ProseArrayElement.svelte +1 -6
- package/dist/visual/ProseArrayElement.svelte.d.ts +0 -1
- package/dist/visual/ProseField.svelte +20 -12
- package/dist/visual/ProseField.svelte.d.ts +5 -3
- package/dist/visual/TipsCard.svelte +1 -1
- package/dist/visual/VisualEditor.svelte +12 -13
- package/dist/visual/VisualEditor.svelte.d.ts +2 -3
- package/dist/visual/VisualEditorInner.svelte +140 -66
- package/dist/visual/VisualEditorInner.svelte.d.ts +2 -3
- package/dist/visual/controls.css +14 -11
- package/dist/visual/diagnostics.d.ts +12 -20
- package/dist/visual/diagnostics.js +6 -18
- package/dist/visual/index.d.ts +1 -0
- package/dist/visual/index.js +7 -0
- package/dist/visual/leaves.d.ts +47 -0
- package/dist/visual/leaves.js +31 -0
- package/dist/visual/props.d.ts +27 -6
- package/dist/visual/tips.d.ts +3 -1
- package/dist/visual/tips.js +5 -2
- package/package.json +2 -2
package/dist/visual/props.d.ts
CHANGED
|
@@ -5,6 +5,13 @@ import type { ActiveLeaf, EditorChange } from './signals.js';
|
|
|
5
5
|
import type { FormatDiagnostic, VisualStringsInput } from './strings.js';
|
|
6
6
|
export interface VisualEditorProps {
|
|
7
7
|
doc: Document;
|
|
8
|
+
/**
|
|
9
|
+
* The schema this document is edited against. BORROWED for the surface's lifetime,
|
|
10
|
+
* whoever handed it over: a quill from `@quillmark/quiver`'s `getQuill` is the
|
|
11
|
+
* quiver's, shared with every other caller for that ref, and freeing it hands the
|
|
12
|
+
* next caller a freed handle. A host wanting one of its own mints it from
|
|
13
|
+
* `.toTree()`. The editor frees nothing it is passed.
|
|
14
|
+
*/
|
|
8
15
|
quill: Quill;
|
|
9
16
|
/**
|
|
10
17
|
* The active leaf: its canonical `DocPath` and the session key of the card holding
|
|
@@ -30,8 +37,13 @@ export interface VisualEditorProps {
|
|
|
30
37
|
/**
|
|
31
38
|
* EVERY edit that lands on the document: a prose commit, a scalar/array/object
|
|
32
39
|
* write, a card operation. The signal a host recompiles off; `source` is what
|
|
33
|
-
* moved
|
|
34
|
-
*
|
|
40
|
+
* moved.
|
|
41
|
+
*
|
|
42
|
+
* **The lane split is the default, not a tuning exercise.** `'structure'` arrives
|
|
43
|
+
* once per gesture and recompiles at once; `'prose'` and `'field'` arrive per
|
|
44
|
+
* keystroke and wait for the burst to settle. Recompiling structure on the debounce
|
|
45
|
+
* makes a card insert look dropped, and recompiling prose at once compiles the
|
|
46
|
+
* document on every character.
|
|
35
47
|
*/
|
|
36
48
|
onChange?: (change: EditorChange) => void;
|
|
37
49
|
/**
|
|
@@ -49,12 +61,21 @@ export interface VisualEditorProps {
|
|
|
49
61
|
diagnostics?: Diagnostic[];
|
|
50
62
|
/**
|
|
51
63
|
* Consumer policy hook: given a field `addr` and an enum option,
|
|
52
|
-
* return `false` to mark that option unavailable
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
64
|
+
* return `false` to mark that option unavailable; `enumDisallowed` decides how
|
|
65
|
+
* the control then draws it. The stored payload is untouched either way: the
|
|
66
|
+
* schema is unchanged, this is runtime policy. Absent → every schema option is
|
|
67
|
+
* offered. It reaches a field's own enum control; an enum inside an object
|
|
68
|
+
* subform has no `Addr` to pass and is offered whole.
|
|
56
69
|
*/
|
|
57
70
|
enumOptionAllowed?: (addr: Addr, value: string) => boolean;
|
|
71
|
+
/**
|
|
72
|
+
* How an `enumOptionAllowed: false` option draws: `'disable'` (the default) greys
|
|
73
|
+
* it in place, `'hide'` leaves it out of the list. One policy for the surface, not
|
|
74
|
+
* a per-option verdict, and the SELECTED value is drawn under either (disabled
|
|
75
|
+
* when refused), so the control always shows what the document says
|
|
76
|
+
* (VISUAL_EDITOR §"Enum policy").
|
|
77
|
+
*/
|
|
78
|
+
enumDisallowed?: 'hide' | 'disable';
|
|
58
79
|
/**
|
|
59
80
|
* Every word the surface says, keyed and partial: unset keys take the package's
|
|
60
81
|
* English. Several are ACCESSIBLE NAMES rather than decoration, so this is what
|
package/dist/visual/tips.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export declare function tipsChannel(raw: unknown): string[];
|
|
|
19
19
|
*
|
|
20
20
|
* Raw HTML does not survive the round-trip, so this is not the injection seam an
|
|
21
21
|
* `{@html}` of the same string would be. A throw degrades to the literal text:
|
|
22
|
-
* chrome never breaks the editor.
|
|
22
|
+
* chrome never breaks the editor. The gate is read OUTSIDE that catch — an
|
|
23
|
+
* uninitialized core is not a tip that failed to render, and would otherwise be
|
|
24
|
+
* reported as one.
|
|
23
25
|
*/
|
|
24
26
|
export declare function renderTip(markdown: string, onError?: EditorErrorHandler): Node;
|
package/dist/visual/tips.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
//
|
|
6
6
|
// The channel narrowing the derive reads and the render the card paints. The write
|
|
7
7
|
// is `patchEditorExt` (ext.ts), the one door into the namespace.
|
|
8
|
-
import {
|
|
8
|
+
import { core } from '../core/lifecycle.js';
|
|
9
9
|
import { reportError, errorMessage } from '../core/errors.js';
|
|
10
10
|
import { renderContent, inlineSchema } from '../core/codec/index.js';
|
|
11
11
|
/**
|
|
@@ -32,9 +32,12 @@ export function tipsChannel(raw) {
|
|
|
32
32
|
*
|
|
33
33
|
* Raw HTML does not survive the round-trip, so this is not the injection seam an
|
|
34
34
|
* `{@html}` of the same string would be. A throw degrades to the literal text:
|
|
35
|
-
* chrome never breaks the editor.
|
|
35
|
+
* chrome never breaks the editor. The gate is read OUTSIDE that catch — an
|
|
36
|
+
* uninitialized core is not a tip that failed to render, and would otherwise be
|
|
37
|
+
* reported as one.
|
|
36
38
|
*/
|
|
37
39
|
export function renderTip(markdown, onError) {
|
|
40
|
+
const { importMarkdown } = core();
|
|
38
41
|
try {
|
|
39
42
|
return renderContent(importMarkdown(markdown), inlineSchema);
|
|
40
43
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quillmark/svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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.103.0-0",
|
|
70
70
|
"svelte": "^5.0.0"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|