@quillmark/svelte 0.29.2 → 0.30.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 +2 -1
- package/THEMING.md +8 -6
- package/dist/core/address.d.ts +3 -3
- package/dist/core/address.js +1 -1
- package/dist/core/bloom.d.ts +3 -2
- package/dist/core/bloom.js +6 -7
- package/dist/core/codec/decode.d.ts +1 -3
- package/dist/core/codec/decode.js +145 -206
- package/dist/core/codec/encode.d.ts +13 -35
- package/dist/core/codec/encode.js +127 -408
- package/dist/core/codec/field.d.ts +9 -9
- package/dist/core/codec/field.js +87 -80
- package/dist/core/codec/index.d.ts +2 -5
- package/dist/core/codec/index.js +4 -4
- package/dist/core/codec/inputrules.d.ts +0 -3
- package/dist/core/codec/inputrules.js +1 -1
- package/dist/core/codec/islands.d.ts +13 -19
- package/dist/core/codec/islands.js +55 -50
- package/dist/core/codec/list-move.d.ts +0 -3
- package/dist/core/codec/list-move.js +2 -2
- package/dist/core/codec/list-node.d.ts +2 -0
- package/dist/core/codec/list-node.js +1 -0
- package/dist/core/codec/list-paste.js +1 -1
- package/dist/core/codec/markdown-paste.d.ts +0 -9
- package/dist/core/codec/markdown-paste.js +1 -1
- package/dist/core/codec/marks.d.ts +12 -18
- package/dist/core/codec/marks.js +16 -26
- package/dist/core/codec/nesting.d.ts +0 -4
- package/dist/core/codec/nesting.js +1 -1
- package/dist/core/codec/positions.d.ts +14 -7
- package/dist/core/codec/positions.js +43 -50
- package/dist/core/codec/prose.css +1 -1
- package/dist/core/codec/reveal.d.ts +14 -0
- package/dist/core/codec/reveal.js +40 -0
- package/dist/core/codec/schema.d.ts +1 -1
- package/dist/core/codec/schema.js +26 -8
- package/dist/core/codec/slash.js +0 -0
- package/dist/core/codec/table-copy.d.ts +3 -3
- package/dist/core/codec/table-copy.js +6 -4
- package/dist/core/codec/table-paste.js +13 -9
- package/dist/core/codec/table-view.js +22 -15
- package/dist/core/codec/table.d.ts +77 -49
- package/dist/core/codec/table.js +158 -49
- package/dist/core/codec/touching.d.ts +0 -2
- package/dist/core/codec/touching.js +1 -11
- package/dist/preview/Preview.svelte +20 -1
- package/dist/preview/Preview.svelte.d.ts +1 -0
- package/dist/preview/controller.d.ts +5 -0
- package/dist/preview/controller.js +6 -0
- package/dist/preview/viewport.js +19 -1
- package/dist/preview/wash.d.ts +9 -0
- package/dist/preview/wash.js +38 -0
- package/dist/visual/ArrayField.svelte +18 -115
- package/dist/visual/FormatPopover.svelte +1 -1
- package/dist/visual/MatrixField.svelte +15 -19
- package/dist/visual/ObjectField.svelte +10 -13
- package/dist/visual/ProseValue.svelte +8 -8
- package/dist/visual/VisualEditorInner.svelte +17 -11
- package/dist/visual/guidance.d.ts +0 -12
- package/dist/visual/guidance.js +2 -2
- package/dist/visual/leaves.d.ts +1 -1
- package/dist/visual/leaves.js +1 -1
- package/dist/visual/props.d.ts +2 -2
- package/dist/visual/rowdrag.svelte.d.ts +21 -0
- package/dist/visual/rowdrag.svelte.js +118 -0
- package/dist/visual/structure.d.ts +6 -6
- package/dist/visual/structure.js +18 -21
- package/package.json +2 -2
- package/dist/visual/checklists.d.ts +0 -3
- package/dist/visual/checklists.js +0 -7
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import type { Node as PMNode } from 'prosemirror-model';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Change, Content, ContentAnchor, ContentBlock, ContentContainer, ContentIsland, ContentMark } from '@quillmark/wasm';
|
|
3
3
|
export type PosRun = {
|
|
4
4
|
kind: 'text';
|
|
5
5
|
pmStart: number;
|
|
6
|
-
|
|
6
|
+
at: number;
|
|
7
7
|
s: string;
|
|
8
8
|
} | {
|
|
9
9
|
kind: 'nl';
|
|
10
10
|
pmStart: number;
|
|
11
11
|
pmEnd: number;
|
|
12
|
-
|
|
12
|
+
at: number;
|
|
13
13
|
} | {
|
|
14
14
|
kind: 'atom';
|
|
15
15
|
pmStart: number;
|
|
16
|
-
|
|
16
|
+
at: number;
|
|
17
17
|
};
|
|
18
18
|
export interface Scan {
|
|
19
19
|
text: string;
|
|
20
|
-
|
|
20
|
+
blocks: ContentBlock[];
|
|
21
|
+
containers: ContentContainer[];
|
|
21
22
|
marks: ContentMark[];
|
|
22
23
|
islands: ContentIsland[];
|
|
23
24
|
runs: PosRun[];
|
|
24
|
-
/** Total USV length of `text`. */
|
|
25
|
-
usvEnd: number;
|
|
26
25
|
}
|
|
27
26
|
/**
|
|
28
27
|
* Walk a PM document once, producing the content projection and the position-map runs; sharing the
|
|
@@ -30,35 +29,14 @@ export interface Scan {
|
|
|
30
29
|
*/
|
|
31
30
|
export declare function scanDoc(doc: PMNode): Scan;
|
|
32
31
|
/**
|
|
33
|
-
* The content projection a scan carries, for a caller holding a `Scan` that would
|
|
34
|
-
* again.
|
|
32
|
+
* The content projection a scan carries, with `anchors`, for a caller holding a `Scan` that would
|
|
33
|
+
* otherwise walk again. An empty part is left out, as a read leaves it.
|
|
35
34
|
*/
|
|
36
|
-
export declare function scanContent(s: Scan): Content;
|
|
35
|
+
export declare function scanContent(s: Scan, anchors?: ContentAnchor[]): Content;
|
|
37
36
|
/** `pmToContent`: the pure inverse of decode (drops the position runs). */
|
|
38
|
-
export declare function pmToContent(doc: PMNode): Content;
|
|
39
|
-
interface LowerOpts {
|
|
40
|
-
/** Anchor decoration positions after the edit, in final (new) USV coords. The
|
|
41
|
-
* pre-edit set is `oldRt`'s own, so only the projection's is passed in. */
|
|
42
|
-
newAnchors?: {
|
|
43
|
-
id: string;
|
|
44
|
-
pos: number;
|
|
45
|
-
}[];
|
|
46
|
-
}
|
|
37
|
+
export declare function pmToContent(doc: PMNode, anchors?: ContentAnchor[]): Content;
|
|
47
38
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* splice rides along because `diffText` allocates a code-point array per side. `contentEdit` is its
|
|
51
|
-
* only constructor, which keeps a `delta` agreeing with the contents it was diffed from; `lower`
|
|
52
|
-
* moves a slot inside the splice to the island channel, so this `delta` is the raw splice.
|
|
39
|
+
* The change taking `oldRt` to `newRt`, or `null` where the two are one value: the store's own
|
|
40
|
+
* `diff`, so what lands is the projection, ids and anchors and all.
|
|
53
41
|
*/
|
|
54
|
-
export
|
|
55
|
-
readonly oldRt: Content;
|
|
56
|
-
readonly newRt: Content;
|
|
57
|
-
/** The minimal single splice, or absent when the text is unchanged. */
|
|
58
|
-
readonly delta?: Delta;
|
|
59
|
-
}
|
|
60
|
-
/** The edit `oldRt` → `newRt`: diffs the text once. */
|
|
61
|
-
export declare function contentEdit(oldRt: Content, newRt: Content): ContentEdit;
|
|
62
|
-
/** Lower an edit to a `ChangeBundle`: the old→new content diff, as ops. */
|
|
63
|
-
export declare function lower(edit: ContentEdit, opts?: LowerOpts): ChangeBundle;
|
|
64
|
-
export {};
|
|
42
|
+
export declare function lower(oldRt: Content, newRt: Content): Change | null;
|