@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.
@@ -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 !== undefined)
401
- name(id);
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 with no `card_kinds` at
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: whose `kind` is not a `card_kinds` key. */
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.closest(EDITABLE);
125
- return (!!last?.answer && last.offer === live() && latest === self && !target.closest(EDITABLE));
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.39.1",
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.138.0-0",
72
+ "@quillmark/wasm": ">=0.140.0-0",
73
73
  "svelte": "^5.33.0"
74
74
  },
75
75
  "dependencies": {