@quillmark/svelte 0.29.1 → 0.29.2
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
CHANGED
|
@@ -144,7 +144,7 @@ Hand it a different `doc` and the editor **re-keys itself**: every leaf remounts
|
|
|
144
144
|
<button onclick={() => editor?.focusField('main.subject')}>Jump to subject</button>
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
`insertCard` hands back the new card's `cardId`; `removeCard`, `moveCard` and `setKind` take one. `focusField` reaches any mounted field: a prose leaf takes its view's focus, a form control the same handoff a click on its label takes, and either way the group holding it is revealed first. A card key or a path the surface does not hold is a no-op that reports `target-unknown` through `onError` at `dev` severity.
|
|
147
|
+
`insertCard` hands back the new card's `cardId`; `removeCard`, `moveCard` and `setKind` take one. `focusField` reaches any mounted field: a prose leaf takes its view's focus, a form control the same handoff a click on its label takes, and either way the group holding it is revealed first. `washField` plays the same arrival wash over a field and nothing else, for a change the host wrote: focus, scroll and closed groups stay as they are, and a field in a closed group washes nothing. A card key or a path the surface does not hold is a no-op that reports `target-unknown` through `onError` at `dev` severity.
|
|
148
148
|
|
|
149
149
|
### Wording
|
|
150
150
|
|
|
@@ -75,6 +75,10 @@
|
|
|
75
75
|
export async function focusField(field: DocPath): Promise<void> {
|
|
76
76
|
await inner?.focusField(field);
|
|
77
77
|
}
|
|
78
|
+
/** Wash the field at `field` where it is on show, without focusing or revealing it. */
|
|
79
|
+
export function washField(field: DocPath): void {
|
|
80
|
+
inner?.washField(field);
|
|
81
|
+
}
|
|
78
82
|
/** Seed a card of `kind` at `at` (default: the end); the new card's session key. */
|
|
79
83
|
export function insertCard(kind: string, at?: number): CardId | undefined {
|
|
80
84
|
return inner?.insertCard(kind, at);
|
|
@@ -5,6 +5,7 @@ import type { VisualEditorProps } from './props.js';
|
|
|
5
5
|
declare const VisualEditor: import("svelte").Component<VisualEditorProps, {
|
|
6
6
|
setCaret: (at: Landing) => Promise<void>;
|
|
7
7
|
focusField: (field: DocPath) => Promise<void>;
|
|
8
|
+
washField: (field: DocPath) => void;
|
|
8
9
|
insertCard: (kind: string, at?: number) => CardId | undefined;
|
|
9
10
|
removeCard: (cardId: CardId) => void;
|
|
10
11
|
moveCard: (cardId: CardId, dir: -1 | 1) => void;
|
|
@@ -836,6 +836,18 @@
|
|
|
836
836
|
const box = await land(found, undefined);
|
|
837
837
|
if (span.alive) bloom(box);
|
|
838
838
|
}
|
|
839
|
+
/** Play the arrival wash over the field at `field` and touch nothing else: no focus,
|
|
840
|
+
* no reveal, no scroll. A field in a closed panel is skipped, its box clipped to
|
|
841
|
+
* nothing; a nested address washes its field's box, a row being something only a
|
|
842
|
+
* landing opens. */
|
|
843
|
+
export function washField(field: DocPath): void {
|
|
844
|
+
if (!span.alive) return;
|
|
845
|
+
const target = leafTargetFor(field);
|
|
846
|
+
const control = target && leaves.control(target.key);
|
|
847
|
+
if (!control) return missed(`no mounted field at ${field}`, field);
|
|
848
|
+
for (let n: HTMLElement | null = control.el; n; n = n.parentElement) if (n.inert) return;
|
|
849
|
+
bloom(control.el);
|
|
850
|
+
}
|
|
839
851
|
/** Seed a card of `kind` and insert it at `at` (default: the end). Returns the new
|
|
840
852
|
* card's session key, or `undefined` when the quill seeds no card of that kind. */
|
|
841
853
|
export function insertCard(kind: string, at: number = cardIds.length): CardId | undefined {
|
|
@@ -7,6 +7,7 @@ declare const VisualEditorInner: import("svelte").Component<VisualEditorProps, {
|
|
|
7
7
|
setCaret: (at: Landing) => Promise<void>;
|
|
8
8
|
getActiveLeaf: () => ActiveProse | undefined;
|
|
9
9
|
focusField: (field: DocPath) => Promise<void>;
|
|
10
|
+
washField: (field: DocPath) => void;
|
|
10
11
|
insertCard: (kind: string, at?: number) => CardId | undefined;
|
|
11
12
|
removeCard: (cardId: CardId) => void;
|
|
12
13
|
moveCard: (cardId: CardId, dir: -1 | 1) => void;
|