@quillmark/svelte 0.39.1 → 0.41.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 +1 -1
- package/dist/core/codec/field.js +2 -3
- package/dist/core/codec/lists.d.ts +2 -2
- package/dist/core/codec/lists.js +32 -3
- package/dist/core/codec/shortcuts.d.ts +9 -6
- package/dist/core/codec/shortcuts.js +17 -9
- package/dist/core/codec/table-view.js +3 -3
- package/dist/core/codec/tasks.d.ts +2 -2
- package/dist/core/codec/tasks.js +3 -3
- package/dist/core/frame.d.ts +3 -0
- package/dist/core/frame.js +3 -2
- package/dist/visual/ArrayField.svelte +6 -4
- package/dist/visual/Card.svelte +1 -1
- package/dist/visual/ReviewCard.svelte +86 -14
- package/dist/visual/ReviewCard.svelte.d.ts +6 -0
- package/dist/visual/VisualEditorInner.svelte +238 -75
- package/dist/visual/hears.d.ts +14 -0
- package/dist/visual/hears.js +58 -0
- package/dist/visual/index.d.ts +2 -0
- package/dist/visual/index.js +1 -0
- package/dist/visual/proposals.js +1 -1
- package/dist/visual/review.svelte.d.ts +2 -0
- package/dist/visual/review.svelte.js +9 -2
- package/dist/visual/structure.d.ts +2 -2
- package/dist/visual/undo.svelte.js +6 -3
- package/package.json +2 -2
|
@@ -274,6 +274,7 @@ export function createReview(source) {
|
|
|
274
274
|
};
|
|
275
275
|
});
|
|
276
276
|
let current = $state();
|
|
277
|
+
let landed = $state(0);
|
|
277
278
|
const lit = $derived(current !== undefined && byId.has(current) ? current : undefined);
|
|
278
279
|
const name = (id) => {
|
|
279
280
|
current = id;
|
|
@@ -397,8 +398,13 @@ export function createReview(source) {
|
|
|
397
398
|
drawn.delete(key);
|
|
398
399
|
},
|
|
399
400
|
point(id) {
|
|
400
|
-
if (id
|
|
401
|
-
|
|
401
|
+
if (id === undefined)
|
|
402
|
+
return;
|
|
403
|
+
name(id);
|
|
404
|
+
landed++;
|
|
405
|
+
},
|
|
406
|
+
get landed() {
|
|
407
|
+
return landed;
|
|
402
408
|
},
|
|
403
409
|
act(id, action) {
|
|
404
410
|
const item = byId.get(id);
|
|
@@ -518,6 +524,7 @@ const NO_REVIEW = {
|
|
|
518
524
|
keyOf: () => undefined,
|
|
519
525
|
drew() { },
|
|
520
526
|
point() { },
|
|
527
|
+
landed: 0,
|
|
521
528
|
act: () => false,
|
|
522
529
|
answer: () => [],
|
|
523
530
|
settled() { },
|
|
@@ -42,7 +42,7 @@ export interface CardModel {
|
|
|
42
42
|
kind: string;
|
|
43
43
|
/**
|
|
44
44
|
* The card's `kind` has no projectable schema: a foreign kind under
|
|
45
|
-
* a schema that declares others, or a card under a schema
|
|
45
|
+
* a schema that declares others, or a card under a schema declaring no card kind at
|
|
46
46
|
* all. Such a card renders a recovery shell (humanized title + retype + delete)
|
|
47
47
|
* instead of a field list, so its content is never dropped or trapped: retyping
|
|
48
48
|
* to a declared kind re-projects it, delete removes it. Always `false` for `main`.
|
|
@@ -113,7 +113,7 @@ export interface BodyPlaceholderContext {
|
|
|
113
113
|
cardId: string;
|
|
114
114
|
/** The card's kind; `'main'` for the main card. */
|
|
115
115
|
kind: string;
|
|
116
|
-
/** The main card:
|
|
116
|
+
/** The main card: the one `schema.main` describes. */
|
|
117
117
|
isMain: boolean;
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
// editor included, so the answers' step is the key's from anywhere on the page but a text
|
|
33
33
|
// control outside the editor, which keeps its own.
|
|
34
34
|
import { getContext, setContext } from 'svelte';
|
|
35
|
+
import { reviewKeysHeard, textBox } from './hears.js';
|
|
35
36
|
/** How long an offer stands, in ms. Long enough to read the toast and reach its button;
|
|
36
37
|
* short enough that the toast is gone before the user has moved on to something else. */
|
|
37
38
|
export const OFFER_MS = 6000;
|
|
38
|
-
const EDITABLE = 'input, textarea, select, [contenteditable="true"]';
|
|
39
39
|
/** The editor whose offer is the page's latest: the body belongs to no surface, so of two
|
|
40
40
|
* editors with an offer standing, the key at the body is the one that offered last's. */
|
|
41
41
|
let latest;
|
|
@@ -121,8 +121,11 @@ export function createStructuralUndo() {
|
|
|
121
121
|
if (target === handed)
|
|
122
122
|
return true;
|
|
123
123
|
if (root?.contains(target))
|
|
124
|
-
return !!last?.standing || !target
|
|
125
|
-
return (!!last?.answer &&
|
|
124
|
+
return !!last?.standing || !textBox(target);
|
|
125
|
+
return (!!last?.answer &&
|
|
126
|
+
last.offer === live() &&
|
|
127
|
+
latest === self &&
|
|
128
|
+
reviewKeysHeard(target, root, 'undo'));
|
|
126
129
|
},
|
|
127
130
|
pause() {
|
|
128
131
|
if (!current || paused)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quillmark/svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "Editor, live-preview and source surfaces over a Quillmark WASM session.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"check": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@quillmark/wasm": ">=0.
|
|
72
|
+
"@quillmark/wasm": ">=0.140.0-0",
|
|
73
73
|
"svelte": "^5.33.0"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|