@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.
Files changed (70) hide show
  1. package/README.md +2 -1
  2. package/THEMING.md +8 -6
  3. package/dist/core/address.d.ts +3 -3
  4. package/dist/core/address.js +1 -1
  5. package/dist/core/bloom.d.ts +3 -2
  6. package/dist/core/bloom.js +6 -7
  7. package/dist/core/codec/decode.d.ts +1 -3
  8. package/dist/core/codec/decode.js +145 -206
  9. package/dist/core/codec/encode.d.ts +13 -35
  10. package/dist/core/codec/encode.js +127 -408
  11. package/dist/core/codec/field.d.ts +9 -9
  12. package/dist/core/codec/field.js +87 -80
  13. package/dist/core/codec/index.d.ts +2 -5
  14. package/dist/core/codec/index.js +4 -4
  15. package/dist/core/codec/inputrules.d.ts +0 -3
  16. package/dist/core/codec/inputrules.js +1 -1
  17. package/dist/core/codec/islands.d.ts +13 -19
  18. package/dist/core/codec/islands.js +55 -50
  19. package/dist/core/codec/list-move.d.ts +0 -3
  20. package/dist/core/codec/list-move.js +2 -2
  21. package/dist/core/codec/list-node.d.ts +2 -0
  22. package/dist/core/codec/list-node.js +1 -0
  23. package/dist/core/codec/list-paste.js +1 -1
  24. package/dist/core/codec/markdown-paste.d.ts +0 -9
  25. package/dist/core/codec/markdown-paste.js +1 -1
  26. package/dist/core/codec/marks.d.ts +12 -18
  27. package/dist/core/codec/marks.js +16 -26
  28. package/dist/core/codec/nesting.d.ts +0 -4
  29. package/dist/core/codec/nesting.js +1 -1
  30. package/dist/core/codec/positions.d.ts +14 -7
  31. package/dist/core/codec/positions.js +43 -50
  32. package/dist/core/codec/prose.css +1 -1
  33. package/dist/core/codec/reveal.d.ts +14 -0
  34. package/dist/core/codec/reveal.js +40 -0
  35. package/dist/core/codec/schema.d.ts +1 -1
  36. package/dist/core/codec/schema.js +26 -8
  37. package/dist/core/codec/slash.js +0 -0
  38. package/dist/core/codec/table-copy.d.ts +3 -3
  39. package/dist/core/codec/table-copy.js +6 -4
  40. package/dist/core/codec/table-paste.js +13 -9
  41. package/dist/core/codec/table-view.js +22 -15
  42. package/dist/core/codec/table.d.ts +77 -49
  43. package/dist/core/codec/table.js +158 -49
  44. package/dist/core/codec/touching.d.ts +0 -2
  45. package/dist/core/codec/touching.js +1 -11
  46. package/dist/preview/Preview.svelte +20 -1
  47. package/dist/preview/Preview.svelte.d.ts +1 -0
  48. package/dist/preview/controller.d.ts +5 -0
  49. package/dist/preview/controller.js +6 -0
  50. package/dist/preview/viewport.js +19 -1
  51. package/dist/preview/wash.d.ts +9 -0
  52. package/dist/preview/wash.js +38 -0
  53. package/dist/visual/ArrayField.svelte +18 -115
  54. package/dist/visual/FormatPopover.svelte +1 -1
  55. package/dist/visual/MatrixField.svelte +15 -19
  56. package/dist/visual/ObjectField.svelte +10 -13
  57. package/dist/visual/ProseValue.svelte +8 -8
  58. package/dist/visual/VisualEditorInner.svelte +17 -11
  59. package/dist/visual/guidance.d.ts +0 -12
  60. package/dist/visual/guidance.js +2 -2
  61. package/dist/visual/leaves.d.ts +1 -1
  62. package/dist/visual/leaves.js +1 -1
  63. package/dist/visual/props.d.ts +2 -2
  64. package/dist/visual/rowdrag.svelte.d.ts +21 -0
  65. package/dist/visual/rowdrag.svelte.js +118 -0
  66. package/dist/visual/structure.d.ts +6 -6
  67. package/dist/visual/structure.js +18 -21
  68. package/package.json +2 -2
  69. package/dist/visual/checklists.d.ts +0 -3
  70. package/dist/visual/checklists.js +0 -7
@@ -1,28 +1,27 @@
1
1
  import type { Node as PMNode } from 'prosemirror-model';
2
- import type { ChangeBundle, Delta, Content, ContentIsland, ContentLine, ContentMark } from '@quillmark/wasm';
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
- usvStart: number;
6
+ at: number;
7
7
  s: string;
8
8
  } | {
9
9
  kind: 'nl';
10
10
  pmStart: number;
11
11
  pmEnd: number;
12
- usvStart: number;
12
+ at: number;
13
13
  } | {
14
14
  kind: 'atom';
15
15
  pmStart: number;
16
- usvStart: number;
16
+ at: number;
17
17
  };
18
18
  export interface Scan {
19
19
  text: string;
20
- lines: ContentLine[];
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 otherwise walk
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
- * One old→new content edit with the text splice it implies. Both sides are content, never a PM doc:
49
- * a doc-taking overload would re-walk the tree per keystroke for a projection the caller holds. The
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 interface ContentEdit {
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;