plitejs 0.0.1 → 54.0.0-beta.3

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 (61) hide show
  1. package/LICENSE +4 -1
  2. package/README.md +83 -0
  3. package/dist/annotation-store-metrics-Ccjkef45.js +12 -0
  4. package/dist/annotations/index.d.ts +2 -0
  5. package/dist/annotations/index.js +2 -0
  6. package/dist/authored/index.d.ts +596 -0
  7. package/dist/authored/index.js +18558 -0
  8. package/dist/authored-veto-DSnQcHGR.js +6 -0
  9. package/dist/browser-protocol-pvt4HFF7.js +5 -0
  10. package/dist/comparison-plan-CEQL0ooW.js +1338 -0
  11. package/dist/comparison-types-Dt-unJZY.d.ts +179 -0
  12. package/dist/create-editor-CkHtPWXV.js +1107 -0
  13. package/dist/diff/index.d.ts +32 -0
  14. package/dist/diff/index.js +1748 -0
  15. package/dist/dom/index.d.ts +2 -0
  16. package/dist/dom/index.js +2 -0
  17. package/dist/dom-Cgfscvnm.js +9220 -0
  18. package/dist/editor-owner-IUmkTeXz.js +171 -0
  19. package/dist/editor-view-lifetime-GJKa_QGh.js +23 -0
  20. package/dist/history/index.d.ts +170 -0
  21. package/dist/history/index.js +6718 -0
  22. package/dist/hyperscript/index.d.ts +2 -0
  23. package/dist/hyperscript/index.js +2 -0
  24. package/dist/hyperscript-FPuoArEi.js +299 -0
  25. package/dist/index-BpQx2UG4.d.ts +1093 -0
  26. package/dist/index-Cw-oC2ps.d.ts +190 -0
  27. package/dist/index-DPWyk3lG.d.ts +65 -0
  28. package/dist/index-DpltOCot.d.ts +9753 -0
  29. package/dist/index-HPYawTae.d.ts +119 -0
  30. package/dist/index-K0Za9YXc.d.ts +1246 -0
  31. package/dist/index.d.ts +2 -0
  32. package/dist/index.js +5 -0
  33. package/dist/internal/index.d.ts +2 -0
  34. package/dist/internal/index.js +156 -0
  35. package/dist/mapped-view-store-ld-6uxEU.js +120 -0
  36. package/dist/native-grouping-input-DMNcsIaW.js +8 -0
  37. package/dist/pagination/index.d.ts +169 -0
  38. package/dist/pagination/index.js +2 -0
  39. package/dist/pagination/react.d.ts +33 -0
  40. package/dist/pagination/react.js +1509 -0
  41. package/dist/pagination-D_A8iPJP.js +1021 -0
  42. package/dist/plugin-DWzkJbnJ.js +50999 -0
  43. package/dist/range-geometry-BLAHRE11.d.ts +38 -0
  44. package/dist/range-geometry-BjeLHOnl.js +486 -0
  45. package/dist/react/index.d.ts +5 -0
  46. package/dist/react/index.js +7 -0
  47. package/dist/react/virtualized.d.ts +13 -0
  48. package/dist/react/virtualized.js +209 -0
  49. package/dist/react-DZ15gmz2.js +1018 -0
  50. package/dist/retraction-BMem8Rfk.js +109 -0
  51. package/dist/src-cT1OTKP_.js +1386 -0
  52. package/dist/store-Cz2mXyDe.js +704 -0
  53. package/dist/testing/index.d.ts +183 -0
  54. package/dist/testing/index.js +96 -0
  55. package/dist/use-editor-dom-scope-BbMDSCpW.js +28354 -0
  56. package/dist/yjs/index.d.ts +2 -0
  57. package/dist/yjs/index.js +2 -0
  58. package/dist/yjs/react/index.d.ts +26 -0
  59. package/dist/yjs/react/index.js +85 -0
  60. package/dist/yjs-DOK-m7kl.js +13413 -0
  61. package/package.json +191 -43
@@ -0,0 +1,179 @@
1
+ import { Lm as DocumentChange, bf as Value, lo as EditorSchemaIdentity, nl as EditorDocumentValue } from "./index-DpltOCot.js";
2
+ //#region src/diff/lib/comparison-types.d.ts
3
+ /** A comparison-local interval in the canonical document token coordinate. */
4
+ type ComparisonSpan = Readonly<{
5
+ from: number;
6
+ /** `null` addresses the primary document. */
7
+ root: string | null;
8
+ to: number;
9
+ }>;
10
+ type ComparisonSnapshot<V extends Value = Value> = Readonly<{
11
+ document: Pick<EditorDocumentValue<V>, 'children' | 'roots'>;
12
+ /** Exact non-content input envelope used only for stale-import detection. */
13
+ envelopeFingerprint: string | null;
14
+ fingerprint: string;
15
+ projection: 'accepted' | 'proposed';
16
+ schema: EditorSchemaIdentity;
17
+ }>;
18
+ type ComparisonDiagnostic = Readonly<{
19
+ code: 'ambiguous' | 'coarse-replacement' | 'expired-lineage' | 'identity-hint-rejected' | 'incompatible-schema' | 'invalid-resolution' | 'unsupported-structure' | 'work-limit';
20
+ message: string;
21
+ severity: 'info' | 'warning';
22
+ spans?: readonly ComparisonSpan[];
23
+ }>;
24
+ type ComparisonEvidence = Readonly<{
25
+ kind: 'inferred';
26
+ basis: 'exact' | 'replacement' | 'structure' | 'unique-content';
27
+ }> | Readonly<{
28
+ kind: 'recorded';
29
+ operationIds: readonly string[];
30
+ }>;
31
+ /** One primary or explanatory relationship between endpoint content spans. */
32
+ type ComparisonCorrespondence = Readonly<{
33
+ after: readonly ComparisonSpan[];
34
+ before: readonly ComparisonSpan[];
35
+ evidence: ComparisonEvidence;
36
+ id: string;
37
+ /** Copies explain origin without inheriting source identity or provenance. */
38
+ kind: 'copy' | 'primary';
39
+ }>;
40
+ type ComparisonEffectBase = Readonly<{
41
+ after: readonly ComparisonSpan[];
42
+ before: readonly ComparisonSpan[];
43
+ id: string;
44
+ }>;
45
+ type ComparisonEffect = ComparisonEffectBase & (Readonly<{
46
+ kind: 'structure';
47
+ }> | Readonly<{
48
+ /** The inserted content's text, with a line break between blocks. */
49
+ afterText: string;
50
+ kind: 'insert';
51
+ }> | Readonly<{
52
+ /** The deleted content's text, with a line break between blocks. */
53
+ beforeText: string;
54
+ kind: 'delete';
55
+ }> | Readonly<{
56
+ afterText: string;
57
+ beforeText: string;
58
+ kind: 'text';
59
+ }> | Readonly<{
60
+ afterProperties: ReadonlyArray<Readonly<Record<string, unknown>>>;
61
+ beforeProperties: ReadonlyArray<Readonly<Record<string, unknown>>>;
62
+ kind: 'property';
63
+ }> | Readonly<{
64
+ kind: 'placement';
65
+ sourcePath: readonly number[];
66
+ sourceRoot: string | null;
67
+ targetPath: readonly number[];
68
+ targetRoot: string | null;
69
+ }> | Readonly<{
70
+ kind: 'split';
71
+ parts: number;
72
+ }> | Readonly<{
73
+ kind: 'join';
74
+ parts: number;
75
+ }> | Readonly<{
76
+ afterType: string | null;
77
+ beforeType: string | null;
78
+ kind: 'node-type';
79
+ }> | Readonly<{
80
+ action: 'add' | 'remove';
81
+ kind: 'wrapper';
82
+ type: string | null;
83
+ }> | Readonly<{
84
+ kind: 'root-create' | 'root-delete';
85
+ root: string;
86
+ }>);
87
+ /**
88
+ * One edit. A run is the changed content between two blocks that both
89
+ * documents keep in place. Importing a set of groups writes each run whose
90
+ * groups are all selected, between the same two blocks as in the document the
91
+ * run comes from. Groups with edits in one run require each other, and groups
92
+ * that move a word found once in each document from one run to another are
93
+ * one group.
94
+ */
95
+ type ComparedChange = Readonly<{
96
+ after: readonly ComparisonSpan[];
97
+ before: readonly ComparisonSpan[];
98
+ /** Three-way branch contribution. Omitted for ordinary two-way results. */
99
+ branches?: readonly ComparisonBranch[];
100
+ correspondence: readonly ComparisonCorrespondence[];
101
+ effects: readonly ComparisonEffect[];
102
+ evidence: ComparisonEvidence;
103
+ id: string;
104
+ /**
105
+ * Groups that must be selected with this one. The list is not closed: select
106
+ * what each listed group requires too, transitively. Groups with edits in
107
+ * one run require each other this way, and a container's group requires the
108
+ * edits inside it that it repeats, such as bold applied across a quote, each
109
+ * of which still selects alone.
110
+ */
111
+ requiredChangeIds: readonly string[];
112
+ }>;
113
+ type TwoWayComparison<V extends Value = Value> = Readonly<{
114
+ after: ComparisonSnapshot<V>;
115
+ before: ComparisonSnapshot<V>;
116
+ change: DocumentChange;
117
+ changes: readonly ComparedChange[];
118
+ diagnostics: readonly ComparisonDiagnostic[];
119
+ id: string;
120
+ kind: 'two-way';
121
+ policy: Readonly<{
122
+ id: 'structural-diff';
123
+ version: 1;
124
+ }>;
125
+ }>;
126
+ type ComparisonBranch = 'local' | 'remote';
127
+ type ComparisonConflictAlternative = Readonly<{
128
+ branch: ComparisonBranch;
129
+ /**
130
+ * This branch's groups in the conflict, with every group of the branch that
131
+ * one of them requires or that requires one of them, transitively.
132
+ */
133
+ changeIds: readonly string[];
134
+ spans: readonly ComparisonSpan[];
135
+ }>;
136
+ type ComparisonConflict = Readonly<{
137
+ base: readonly ComparisonSpan[];
138
+ changeIds: readonly string[];
139
+ id: string;
140
+ kind: 'delete-edit' | 'grid' | 'order' | 'placement' | 'root' | 'structure';
141
+ local: ComparisonConflictAlternative;
142
+ remote: ComparisonConflictAlternative;
143
+ requiredChangeIds: readonly string[];
144
+ }>;
145
+ type ThreeWayComparison<V extends Value = Value> = Readonly<{
146
+ base: ComparisonSnapshot<V>;
147
+ changes: readonly ComparedChange[];
148
+ conflicts: readonly ComparisonConflict[];
149
+ diagnostics: readonly ComparisonDiagnostic[];
150
+ id: string;
151
+ kind: 'three-way';
152
+ local: ComparisonSnapshot<V>;
153
+ policy: Readonly<{
154
+ id: 'structural-diff';
155
+ version: 1;
156
+ }>;
157
+ remote: ComparisonSnapshot<V>;
158
+ }>;
159
+ type Comparison<V extends Value = Value> = ThreeWayComparison<V> | TwoWayComparison<V>;
160
+ type ComparisonResolution = Readonly<{
161
+ comparisonId: string;
162
+ conflictId: string;
163
+ choice: ComparisonBranch | Readonly<{
164
+ document: unknown;
165
+ kind: 'custom';
166
+ }>;
167
+ }>;
168
+ type ComparisonResolutionResult<V extends Value = Value> = Readonly<{
169
+ comparison: TwoWayComparison<V>;
170
+ status: 'resolved';
171
+ }> | Readonly<{
172
+ conflicts: readonly ComparisonConflict[];
173
+ status: 'unresolved';
174
+ }> | Readonly<{
175
+ diagnostics: readonly ComparisonDiagnostic[];
176
+ status: 'invalid';
177
+ }>;
178
+ //#endregion
179
+ export { ComparisonConflictAlternative as a, ComparisonEffect as c, ComparisonResolutionResult as d, ComparisonSnapshot as f, TwoWayComparison as h, ComparisonConflict as i, ComparisonEvidence as l, ThreeWayComparison as m, Comparison as n, ComparisonCorrespondence as o, ComparisonSpan as p, ComparisonBranch as r, ComparisonDiagnostic as s, ComparedChange as t, ComparisonResolution as u };