@y/y 14.0.0-rc.2 → 14.0.0-rc.21

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 (166) hide show
  1. package/README.md +36 -12
  2. package/dist/src/index.d.ts +24 -1
  3. package/dist/src/index.d.ts.map +1 -1
  4. package/dist/src/structs/AbstractStruct.d.ts +14 -17
  5. package/dist/src/structs/AbstractStruct.d.ts.map +1 -1
  6. package/dist/src/structs/GC.d.ts +9 -14
  7. package/dist/src/structs/GC.d.ts.map +1 -1
  8. package/dist/src/structs/Item.d.ts +569 -31
  9. package/dist/src/structs/Item.d.ts.map +1 -1
  10. package/dist/src/structs/Skip.d.ts +9 -11
  11. package/dist/src/structs/Skip.d.ts.map +1 -1
  12. package/dist/src/utils/BlockSet.d.ts +8 -7
  13. package/dist/src/utils/BlockSet.d.ts.map +1 -1
  14. package/dist/src/utils/Doc.d.ts +4 -9
  15. package/dist/src/utils/Doc.d.ts.map +1 -1
  16. package/dist/src/utils/ID.d.ts +0 -1
  17. package/dist/src/utils/ID.d.ts.map +1 -1
  18. package/dist/src/utils/RelativePosition.d.ts +2 -5
  19. package/dist/src/utils/RelativePosition.d.ts.map +1 -1
  20. package/dist/src/utils/Renderer.d.ts +144 -0
  21. package/dist/src/utils/Renderer.d.ts.map +1 -0
  22. package/dist/src/utils/Snapshot.d.ts +7 -11
  23. package/dist/src/utils/Snapshot.d.ts.map +1 -1
  24. package/dist/src/utils/StructStore.d.ts +45 -23
  25. package/dist/src/utils/StructStore.d.ts.map +1 -1
  26. package/dist/src/utils/Transaction.d.ts +11 -21
  27. package/dist/src/utils/Transaction.d.ts.map +1 -1
  28. package/dist/src/utils/UndoManager.d.ts +13 -14
  29. package/dist/src/utils/UndoManager.d.ts.map +1 -1
  30. package/dist/src/utils/UpdateDecoder.d.ts +1 -1
  31. package/dist/src/utils/UpdateDecoder.d.ts.map +1 -1
  32. package/dist/src/utils/UpdateEncoder.d.ts +0 -1
  33. package/dist/src/utils/UpdateEncoder.d.ts.map +1 -1
  34. package/dist/src/utils/YEvent.d.ts +22 -26
  35. package/dist/src/utils/YEvent.d.ts.map +1 -1
  36. package/dist/src/utils/content-helper.d.ts +2 -0
  37. package/dist/src/utils/content-helper.d.ts.map +1 -0
  38. package/dist/src/utils/delta-helpers.d.ts +2 -3
  39. package/dist/src/utils/delta-helpers.d.ts.map +1 -1
  40. package/dist/src/utils/encoding-helpers.d.ts +6 -0
  41. package/dist/src/utils/encoding-helpers.d.ts.map +1 -0
  42. package/dist/src/utils/encoding.d.ts +16 -18
  43. package/dist/src/utils/encoding.d.ts.map +1 -1
  44. package/dist/src/utils/ids.d.ts +331 -0
  45. package/dist/src/utils/ids.d.ts.map +1 -0
  46. package/dist/src/utils/isParentOf.d.ts +1 -2
  47. package/dist/src/utils/isParentOf.d.ts.map +1 -1
  48. package/dist/src/utils/logging.d.ts +0 -1
  49. package/dist/src/utils/logging.d.ts.map +1 -1
  50. package/dist/src/utils/meta.d.ts +15 -64
  51. package/dist/src/utils/meta.d.ts.map +1 -1
  52. package/dist/src/utils/renderer-helpers.d.ts +99 -0
  53. package/dist/src/utils/renderer-helpers.d.ts.map +1 -0
  54. package/dist/src/utils/schemas.d.ts +3 -0
  55. package/dist/src/utils/schemas.d.ts.map +1 -0
  56. package/dist/src/utils/transaction-helpers.d.ts +18 -0
  57. package/dist/src/utils/transaction-helpers.d.ts.map +1 -0
  58. package/dist/src/utils/updates.d.ts +19 -25
  59. package/dist/src/utils/updates.d.ts.map +1 -1
  60. package/dist/src/ytype.d.ts +144 -41
  61. package/dist/src/ytype.d.ts.map +1 -1
  62. package/global.d.ts +53 -0
  63. package/package.json +12 -16
  64. package/src/index.js +32 -124
  65. package/src/structs/AbstractStruct.js +21 -16
  66. package/src/structs/GC.js +15 -20
  67. package/src/structs/Item.js +992 -318
  68. package/src/structs/Skip.js +16 -19
  69. package/src/utils/BlockSet.js +20 -20
  70. package/src/utils/Doc.js +18 -29
  71. package/src/utils/ID.js +0 -2
  72. package/src/utils/RelativePosition.js +15 -25
  73. package/src/utils/{AttributionManager.js → Renderer.js} +42 -197
  74. package/src/utils/Snapshot.js +15 -37
  75. package/src/utils/StructStore.js +89 -227
  76. package/src/utils/Transaction.js +89 -321
  77. package/src/utils/UndoManager.js +157 -19
  78. package/src/utils/UpdateDecoder.js +2 -3
  79. package/src/utils/UpdateEncoder.js +0 -4
  80. package/src/utils/YEvent.js +20 -26
  81. package/src/utils/content-helper.js +0 -0
  82. package/src/utils/delta-helpers.js +21 -42
  83. package/src/utils/encoding-helpers.js +110 -0
  84. package/src/utils/encoding.js +197 -122
  85. package/src/utils/ids.js +1527 -0
  86. package/src/utils/isParentOf.js +2 -4
  87. package/src/utils/logging.js +0 -4
  88. package/src/utils/meta.js +57 -46
  89. package/src/utils/renderer-helpers.js +110 -0
  90. package/src/utils/schemas.js +3 -0
  91. package/src/utils/transaction-helpers.js +413 -0
  92. package/src/utils/updates.js +24 -146
  93. package/src/ytype.js +626 -255
  94. package/tests/testHelper.js +10 -12
  95. package/dist/src/internals.d.ts +0 -36
  96. package/dist/src/internals.d.ts.map +0 -1
  97. package/dist/src/structs/ContentAny.d.ts +0 -67
  98. package/dist/src/structs/ContentAny.d.ts.map +0 -1
  99. package/dist/src/structs/ContentBinary.d.ts +0 -64
  100. package/dist/src/structs/ContentBinary.d.ts.map +0 -1
  101. package/dist/src/structs/ContentDeleted.d.ts +0 -64
  102. package/dist/src/structs/ContentDeleted.d.ts.map +0 -1
  103. package/dist/src/structs/ContentDoc.d.ts +0 -72
  104. package/dist/src/structs/ContentDoc.d.ts.map +0 -1
  105. package/dist/src/structs/ContentEmbed.d.ts +0 -67
  106. package/dist/src/structs/ContentEmbed.d.ts.map +0 -1
  107. package/dist/src/structs/ContentFormat.d.ts +0 -69
  108. package/dist/src/structs/ContentFormat.d.ts.map +0 -1
  109. package/dist/src/structs/ContentJSON.d.ts +0 -70
  110. package/dist/src/structs/ContentJSON.d.ts.map +0 -1
  111. package/dist/src/structs/ContentString.d.ts +0 -70
  112. package/dist/src/structs/ContentString.d.ts.map +0 -1
  113. package/dist/src/structs/ContentType.d.ts +0 -77
  114. package/dist/src/structs/ContentType.d.ts.map +0 -1
  115. package/dist/src/utils/AttributionManager.d.ts +0 -238
  116. package/dist/src/utils/AttributionManager.d.ts.map +0 -1
  117. package/dist/src/utils/IdMap.d.ts +0 -164
  118. package/dist/src/utils/IdMap.d.ts.map +0 -1
  119. package/dist/src/utils/IdSet.d.ts +0 -163
  120. package/dist/src/utils/IdSet.d.ts.map +0 -1
  121. package/dist/tests/IdMap.tests.d.ts +0 -9
  122. package/dist/tests/IdMap.tests.d.ts.map +0 -1
  123. package/dist/tests/IdSet.tests.d.ts +0 -9
  124. package/dist/tests/IdSet.tests.d.ts.map +0 -1
  125. package/dist/tests/attribution.tests.d.ts +0 -9
  126. package/dist/tests/attribution.tests.d.ts.map +0 -1
  127. package/dist/tests/compatibility.tests.d.ts +0 -5
  128. package/dist/tests/compatibility.tests.d.ts.map +0 -1
  129. package/dist/tests/delta.tests.d.ts +0 -7
  130. package/dist/tests/delta.tests.d.ts.map +0 -1
  131. package/dist/tests/doc.tests.d.ts +0 -13
  132. package/dist/tests/doc.tests.d.ts.map +0 -1
  133. package/dist/tests/encoding.tests.d.ts +0 -5
  134. package/dist/tests/encoding.tests.d.ts.map +0 -1
  135. package/dist/tests/index.d.ts +0 -2
  136. package/dist/tests/index.d.ts.map +0 -1
  137. package/dist/tests/relativePositions.tests.d.ts +0 -11
  138. package/dist/tests/relativePositions.tests.d.ts.map +0 -1
  139. package/dist/tests/snapshot.tests.d.ts +0 -14
  140. package/dist/tests/snapshot.tests.d.ts.map +0 -1
  141. package/dist/tests/testHelper.d.ts +0 -171
  142. package/dist/tests/testHelper.d.ts.map +0 -1
  143. package/dist/tests/undo-redo.tests.d.ts +0 -27
  144. package/dist/tests/undo-redo.tests.d.ts.map +0 -1
  145. package/dist/tests/updates.tests.d.ts +0 -26
  146. package/dist/tests/updates.tests.d.ts.map +0 -1
  147. package/dist/tests/y-array.tests.d.ts +0 -43
  148. package/dist/tests/y-array.tests.d.ts.map +0 -1
  149. package/dist/tests/y-map.tests.d.ts +0 -42
  150. package/dist/tests/y-map.tests.d.ts.map +0 -1
  151. package/dist/tests/y-text.tests.d.ts +0 -49
  152. package/dist/tests/y-text.tests.d.ts.map +0 -1
  153. package/dist/tests/y-xml.tests.d.ts +0 -14
  154. package/dist/tests/y-xml.tests.d.ts.map +0 -1
  155. package/src/internals.js +0 -35
  156. package/src/structs/ContentAny.js +0 -115
  157. package/src/structs/ContentBinary.js +0 -93
  158. package/src/structs/ContentDeleted.js +0 -101
  159. package/src/structs/ContentDoc.js +0 -141
  160. package/src/structs/ContentEmbed.js +0 -98
  161. package/src/structs/ContentFormat.js +0 -105
  162. package/src/structs/ContentJSON.js +0 -119
  163. package/src/structs/ContentString.js +0 -113
  164. package/src/structs/ContentType.js +0 -152
  165. package/src/utils/IdMap.js +0 -673
  166. package/src/utils/IdSet.js +0 -825
@@ -1,18 +1,19 @@
1
1
  export function warnPrematureAccess(): void;
2
+ export function createAttributionFromAttributionItems(attrs: Array<ContentAttribute<any>> | null, deleted: boolean): Attribution | undefined;
2
3
  export class ItemTextListPosition {
3
4
  /**
4
5
  * @param {Item|null} left
5
6
  * @param {Item|null} right
6
7
  * @param {number} index
7
- * @param {Map<string,any>} currentAttributes
8
- * @param {AbstractAttributionManager} am
8
+ * @param {Map<string,any>} currentFormats
9
+ * @param {AbstractRenderer} renderer
9
10
  */
10
- constructor(left: Item | null, right: Item | null, index: number, currentAttributes: Map<string, any>, am: AbstractAttributionManager);
11
+ constructor(left: Item | null, right: Item | null, index: number, currentFormats: Map<string, any>, renderer: AbstractRenderer);
11
12
  left: Item | null;
12
13
  right: Item | null;
13
14
  index: number;
14
- currentAttributes: Map<string, any>;
15
- am: AbstractAttributionManager;
15
+ currentFormats: Map<string, any>;
16
+ renderer: import("./utils/renderer-helpers.js").AbstractRenderer;
16
17
  /**
17
18
  * Only call this if you know that this.right is defined
18
19
  */
@@ -21,18 +22,18 @@ export class ItemTextListPosition {
21
22
  * @param {Transaction} transaction
22
23
  * @param {YType} parent
23
24
  * @param {number} length
24
- * @param {Object<string,any>} attributes
25
+ * @param {Object<string,any>} formats
25
26
  *
26
27
  * @function
27
28
  */
28
- formatText(transaction: Transaction, parent: YType, length: number, attributes: {
29
+ formatText(transaction: Transaction, parent: YType, length: number, formats: {
29
30
  [x: string]: any;
30
31
  }): void;
31
32
  }
32
- export function insertContent(transaction: Transaction, parent: YType, currPos: ItemTextListPosition, content: import("./structs/Item.js").AbstractContent, attributes: {
33
+ export function insertContent(transaction: Transaction, parent: YType, currPos: ItemTextListPosition, content: import("./structs/Item.js").AbstractContent, formats: {
33
34
  [x: string]: any;
34
35
  }): void;
35
- export function insertContentHelper(transaction: Transaction, parent: YType, currPos: ItemTextListPosition, insert: Array<any> | string, attributes: {
36
+ export function insertContentHelper(transaction: Transaction, parent: YType, currPos: ItemTextListPosition, insert: Array<any> | string, formats: {
36
37
  [x: string]: any;
37
38
  }): void;
38
39
  export function deleteText(transaction: Transaction, currPos: ItemTextListPosition, length: number): ItemTextListPosition;
@@ -51,10 +52,23 @@ export function updateMarkerChanges(searchMarker: Array<ArraySearchMarker>, inde
51
52
  export function getTypeChildren(t: YType): Array<Item>;
52
53
  export function callTypeObservers(type: YType, transaction: Transaction, event: YEvent<any>): void;
53
54
  /**
54
- * Abstract Yjs Type class
55
+ * Abstract Yjs Type class.
56
+ *
57
+ * A `YType` is a {@link https://github.com/dmonad/lib0 lib0} `RDT` ("replicated data type", see
58
+ * `lib0/delta/rdt.js`): it emits a `'delta'` event whenever its state changes, accepts foreign
59
+ * changes via {@link YType#applyDelta}, exposes its delta {@link YType#$delta schema}, and can be
60
+ * torn down via {@link YType#destroy}. This lets a `YType` be `bind()`-ed to any other RDT (another
61
+ * `YType`, an in-memory delta, a DOM subtree, …). The legacy {@link YType#observe `observe`} /
62
+ * {@link YType#observeDeep `observeDeep`} `YEvent` API continues to work alongside the `'delta'`
63
+ * channel.
64
+ *
55
65
  * @template {delta.DeltaConf} [DConf=any]
66
+ * @extends {ObservableV2<{ delta: (delta: delta.Delta<DConf>) => void, destroy: (type: YType<DConf>) => void }>}
56
67
  */
57
- export class YType<DConf extends delta.DeltaConf = any> {
68
+ export class YType<DConf extends delta.DeltaConf = any> extends ObservableV2<{
69
+ delta: (delta: delta.Delta<DConf>) => void;
70
+ destroy: (type: YType<DConf>) => void;
71
+ }> {
58
72
  /**
59
73
  * @template {delta.DeltaConf} DC
60
74
  * @param {delta.Delta<DC>} d
@@ -101,16 +115,72 @@ export class YType<DConf extends delta.DeltaConf = any> {
101
115
  */
102
116
  _searchMarker: null | Array<ArraySearchMarker>;
103
117
  /**
104
- * @type {delta.DeltaBuilder<DConf>}
105
- * @private
118
+ * Maintained deep-delta cache backing {@link YType#delta}. `null` until `delta` is first
119
+ * accessed; thereafter kept current on every event of this type (incrementally, by applying the
120
+ * deep change) and re-diffed by {@link YType#useRenderer}. Cleared by {@link YType#clearCache}.
121
+ * @type {delta.DeltaBuilderAny | null}
106
122
  */
107
- private _content;
123
+ _delta: delta.DeltaBuilderAny | null;
108
124
  _legacyTypeRef: number;
109
125
  /**
110
- * Whether this YText contains formatting attributes.
126
+ * Whether this YText contains formats.
111
127
  * This flag is updated when a formatting item is integrated (see ContentFormat.integrate)
112
128
  */
113
129
  _hasFormatting: boolean;
130
+ /**
131
+ * The active default renderer. Used by `toDelta`, `applyDelta`, and the events whenever no
132
+ * explicit renderer is passed. Change it via {@link YType#useRenderer}.
133
+ * @type {AbstractRenderer}
134
+ */
135
+ _renderer: AbstractRenderer;
136
+ /**
137
+ * Schema of the deltas this type produces — part of the lib0 `RDT` interface.
138
+ *
139
+ * @type {s.Schema<delta.Delta<DConf>>}
140
+ */
141
+ get $delta(): s.Schema<delta.Delta<DConf>>;
142
+ /**
143
+ * The deep delta of this type (the full nested content tree, children rendered as their own
144
+ * deltas).
145
+ *
146
+ * The returned value is the type's **live** maintained cache: it is materialized on first access
147
+ * and then kept current on every event fired on this type (and re-diffed by
148
+ * {@link YType#useRenderer}), so a reference held across edits keeps updating in place. Clone it
149
+ * (e.g. `type.delta.clone()`) if you need a stable snapshot, and call {@link YType#clearCache} to
150
+ * drop the cache.
151
+ *
152
+ * @type {delta.Delta<DConf>}
153
+ */
154
+ get delta(): delta.Delta<DConf>;
155
+ /**
156
+ * Render the full deep current state into a fresh `isFinal` builder (so subsequent `.apply`s of
157
+ * deep changes update content in place). Uses this type's active renderer.
158
+ *
159
+ * @return {delta.DeltaBuilderAny}
160
+ */
161
+ _renderDelta(): delta.DeltaBuilderAny;
162
+ /**
163
+ * Discard the cached deep delta backing {@link YType#delta}.
164
+ *
165
+ * After `delta` is first accessed, the cache is updated on every event fired on this type (and
166
+ * re-diffed by {@link YType#useRenderer}). Call this to drop it — e.g. to reclaim memory, or to
167
+ * force an exact recomputation after editing while a non-base renderer is active (the incremental
168
+ * updates can drift from a fresh deep render in that case).
169
+ */
170
+ clearCache(): void;
171
+ /**
172
+ * Change the default renderer used by this type. After calling `useRenderer(renderer)`, the
173
+ * `toDelta`, `applyDelta`, and event methods all use `renderer` whenever no explicit renderer is
174
+ * passed (an explicit `{ renderer }` argument still overrides it per call).
175
+ *
176
+ * If the deep-delta cache ({@link YType#delta}) is being maintained, or a `'delta'` listener is
177
+ * attached, the content is re-rendered with the new renderer and the difference is emitted on the
178
+ * `'delta'` channel only (a renderer switch is not a CRDT change, so no `YEvent` is produced).
179
+ *
180
+ * @param {AbstractRenderer} renderer
181
+ * @return {this}
182
+ */
183
+ useRenderer(renderer: AbstractRenderer): this;
114
184
  get length(): number;
115
185
  /**
116
186
  * Returns a fresh delta that can be used to change this YType.
@@ -182,23 +252,24 @@ export class YType<DConf extends delta.DeltaConf = any> {
182
252
  *
183
253
  * @template {boolean} [Deep=false]
184
254
  *
185
- * @param {AbstractAttributionManager} am
186
255
  * @param {Object} [opts]
187
- * @param {import('./utils/IdSet.js').IdSet?} [opts.itemsToRender]
256
+ * @param {AbstractRenderer} [opts.renderer] - renders the content (with attributions); defaults to this type's active renderer (see {@link YType#useRenderer}), i.e. `baseRenderer` unless changed
257
+ * @param {IdSet?} [opts.itemsToRender]
188
258
  * @param {boolean} [opts.retainInserts] - if true, retain rendered inserts with attributions
189
259
  * @param {boolean} [opts.retainDeletes] - if true, retain rendered+attributed deletes only
190
- * @param {import('./utils/IdSet.js').IdSet?} [opts.deletedItems] - used for computing prevItem in attributes
260
+ * @param {IdSet?} [opts.deletedItems] - used for computing prevItem in attributes
191
261
  * @param {Map<YType,Set<string|null>>|null} [opts.modified] - set of types that should be rendered as modified children
192
262
  * @param {Deep} [opts.deep] - render child types as delta
193
263
  * @return {Deep extends true ? delta.Delta<DConf> : delta.Delta<DeltaConfDeltaToYType<DConf>>} The Delta representation of this type.
194
264
  *
195
265
  * @public
196
266
  */
197
- public toDelta<Deep extends boolean = false>(am?: AbstractAttributionManager, opts?: {
198
- itemsToRender?: import("./internals.js").IdSet | null | undefined;
267
+ public toDelta<Deep extends boolean = false>(opts?: {
268
+ renderer?: import("./utils/renderer-helpers.js").AbstractRenderer | undefined;
269
+ itemsToRender?: import("./utils/ids.js").IdSet | null | undefined;
199
270
  retainInserts?: boolean | undefined;
200
271
  retainDeletes?: boolean | undefined;
201
- deletedItems?: import("./internals.js").IdSet | null | undefined;
272
+ deletedItems?: import("./utils/ids.js").IdSet | null | undefined;
202
273
  modified?: Map<YType<any>, Set<string | null>> | null | undefined;
203
274
  deep?: Deep | undefined;
204
275
  }): Deep extends true ? delta.Delta<DConf> : delta.Delta<DeltaConfDeltaToYType<DConf>>;
@@ -206,19 +277,27 @@ export class YType<DConf extends delta.DeltaConf = any> {
206
277
  * Render the difference to another ydoc (which can be empty) and highlight the differences with
207
278
  * attributions.
208
279
  *
209
- * @param {AbstractAttributionManager} am
280
+ * @param {Object} [opts]
281
+ * @param {AbstractRenderer} [opts.renderer] - renders the content (with attributions); defaults to this type's active renderer (see {@link YType#useRenderer}), i.e. `baseRenderer` unless changed
210
282
  * @return {delta.Delta<DConf>}
211
283
  */
212
- toDeltaDeep(am?: AbstractAttributionManager): delta.Delta<DConf>;
284
+ toDeltaDeep(opts?: {
285
+ renderer?: import("./utils/renderer-helpers.js").AbstractRenderer | undefined;
286
+ }): delta.Delta<DConf>;
213
287
  /**
214
288
  * Apply a {@link Delta} on this shared type.
215
289
  *
216
290
  * @param {delta.DeltaAny} d The changes to apply on this element.
217
- * @param {AbstractAttributionManager} am
291
+ * @param {Object} [opts]
292
+ * @param {AbstractRenderer} [opts.renderer] - renders the content (with attributions); defaults to this type's active renderer (see {@link YType#useRenderer}), i.e. `baseRenderer` unless changed
293
+ * @return {null} The lib0 `RDT` "fix" of this apply — always `null`: a `YType` accepts every valid
294
+ * delta as-is and never needs to self-correct.
218
295
  *
219
296
  * @public
220
297
  */
221
- public applyDelta(d: delta.DeltaAny, am?: AbstractAttributionManager): this;
298
+ public applyDelta(d: delta.DeltaAny, { renderer }?: {
299
+ renderer?: import("./utils/renderer-helpers.js").AbstractRenderer | undefined;
300
+ }): null;
222
301
  /**
223
302
  * Makes a copy of this data type that can be included somewhere else.
224
303
  *
@@ -294,9 +373,9 @@ export class YType<DConf extends delta.DeltaConf = any> {
294
373
  *
295
374
  * @param {number} index The index to insert content at.
296
375
  * @param {Array<delta.DeltaConfGetChildren<DConf>>|delta.DeltaConfGetText<DConf>} content Array of content to append.
297
- * @param {delta.FormattingAttributes} [format]
376
+ * @param {delta.Formats} [format]
298
377
  */
299
- insert(index: number, content: Array<delta.DeltaConfGetChildren<DConf>> | delta.DeltaConfGetText<DConf>, format?: delta.FormattingAttributes): void;
378
+ insert(index: number, content: Array<delta.DeltaConfGetChildren<DConf>> | delta.DeltaConfGetText<DConf>, format?: delta.Formats): void;
300
379
  /**
301
380
  * Inserts new content at an index.
302
381
  *
@@ -312,10 +391,10 @@ export class YType<DConf extends delta.DeltaConf = any> {
312
391
  *
313
392
  * @param {number} index The index to insert content at.
314
393
  * @param {number} length The index to insert content at.
315
- * @param {delta.FormattingAttributes} formats
394
+ * @param {delta.Formats} formats
316
395
  *
317
396
  */
318
- format(index: number, length: number, formats: delta.FormattingAttributes): void;
397
+ format(index: number, length: number, formats: delta.Formats): void;
319
398
  /**
320
399
  * Appends content to this YArray.
321
400
  *
@@ -441,8 +520,10 @@ export class YType<DConf extends delta.DeltaConf = any> {
441
520
  */
442
521
  [traits.EqualityTraitSymbol](other: this): boolean;
443
522
  }
444
- export function readYType(decoder: import("./utils/UpdateDecoder.js").UpdateDecoderV1 | import("./utils/UpdateDecoder.js").UpdateDecoderV2): YType;
445
- export function equalAttrs(a: any, b: any): boolean;
523
+ export function $ytype<DConf extends import("lib0/delta").ReadableDeltaConf>(_dconf: DConf): s.Schema<YType<import("lib0/delta").ReadDeltaConf<DConf>>>;
524
+ export const $ytypeAny: s.Schema<YType<any>>;
525
+ export function computeModifiedFromItems(store: StructStore, items: IdSet): Map<YType<any>, Set<string | null>>;
526
+ export function equalFormats(a: any, b: any): boolean;
446
527
  export function typeListSlice(type: YType<any>, start: number, end: number): Array<any>;
447
528
  export function typeListGet(type: YType, index: number): any;
448
529
  export function typeListInsertGenericsAfter(transaction: Transaction, parent: YType, referenceItem: Item | null, content: Array<YValue>): void;
@@ -463,8 +544,9 @@ export function typeMapGetAll(parent: YType<any>): {
463
544
  [x: string]: any;
464
545
  } | null | undefined;
465
546
  };
466
- export function typeMapGetDelta<TypeDelta extends delta.DeltaBuilderAny>(d: TypeDelta, parent: YType, attrsToRender: Set<string | null> | null, am: import("./internals.js").AbstractAttributionManager, deep: boolean, modified?: Set<YType> | Map<YType, any> | null, deletedItems?: import("./utils/IdSet.js").IdSet | null, itemsToRender?: import("./utils/IdSet.js").IdSet | null, opts?: any, optsAll?: any): void;
547
+ export function typeMapGetDelta<TypeDelta extends delta.DeltaBuilderAny>(d: TypeDelta, parent: YType, attrsToRender: Set<string | null> | null, renderer: AbstractRenderer, deep: boolean, modified?: Set<YType> | Map<YType, any> | null, deletedItems?: IdSet | null, itemsToRender?: IdSet | null, opts?: any, optsAll?: any): void;
467
548
  export function typeMapHas(parent: YType<any>, key: string): boolean;
549
+ export function isVisible(item: Item, snapshot: Snapshot | undefined): boolean;
468
550
  export function typeMapGetSnapshot(parent: YType<any>, key: string, snapshot: Snapshot): {
469
551
  [x: string]: any;
470
552
  } | number | null | Array<any> | string | Uint8Array | YType<any> | undefined;
@@ -476,6 +558,23 @@ export function typeMapGetAllSnapshot(parent: YType<any>, snapshot: Snapshot): {
476
558
  export function createMapIterator(type: YType<any> & {
477
559
  _map: Map<string, Item>;
478
560
  }): IterableIterator<Array<any>>;
561
+ export function readContentType(decoder: UpdateDecoderV1 | UpdateDecoderV2): ContentType;
562
+ export function readContentString(decoder: UpdateDecoderV1 | UpdateDecoderV2): ContentString;
563
+ export function readContentJSON(decoder: UpdateDecoderV1 | UpdateDecoderV2): ContentJSON;
564
+ export function readContentFormat(decoder: UpdateDecoderV1 | UpdateDecoderV2): ContentFormat;
565
+ export function readContentEmbed(decoder: UpdateDecoderV1 | UpdateDecoderV2): ContentEmbed;
566
+ export function readContentDoc(decoder: UpdateDecoderV1 | UpdateDecoderV2): ContentDoc;
567
+ export function readContentAny(decoder: UpdateDecoderV1 | UpdateDecoderV2): ContentAny;
568
+ export function readContentBinary(decoder: UpdateDecoderV1 | UpdateDecoderV2): ContentBinary;
569
+ export function readContentDeleted(decoder: UpdateDecoderV1 | UpdateDecoderV2): ContentDeleted;
570
+ /**
571
+ * A lookup map for reading Item content.
572
+ *
573
+ * @type {Array<function(UpdateDecoderV1 | UpdateDecoderV2):AbstractContent>}
574
+ */
575
+ export const contentRefs: Array<(arg0: UpdateDecoderV1 | UpdateDecoderV2) => AbstractContent>;
576
+ export function readItemContent(decoder: UpdateDecoderV1 | UpdateDecoderV2, info: number): import("./structs/Item.js").AbstractContent;
577
+ export function readYType(decoder: UpdateDecoderV1 | UpdateDecoderV2): YType;
479
578
  export type YValue = {
480
579
  [x: string]: any;
481
580
  } | Array<any> | number | null | string | Uint8Array | bigint | YType<any>;
@@ -484,15 +583,19 @@ export type DeltaConfDeltaToYType<DConf extends delta.DeltaConf> = delta.DeltaCo
484
583
  children: DeltaToYType<delta.DeltaConfGetChildren<DConf>>;
485
584
  }>;
486
585
  export type DeltaToYType<Data extends unknown> = Exclude<Data, delta.DeltaAny> | (Extract<Data, delta.DeltaAny> extends delta.Delta<infer DConf> ? (unknown extends DConf ? YType<DConf> : never) : never);
487
- import { Item } from './internals.js';
488
- import { AbstractAttributionManager } from './internals.js';
489
- import { Transaction } from './internals.js';
490
- import { YEvent } from './internals.js';
586
+ import { Item } from './structs/Item.js';
587
+ import { YEvent } from './utils/YEvent.js';
491
588
  import * as delta from 'lib0/delta';
492
- import { Doc } from './internals.js';
493
- import { EventHandler } from './internals.js';
494
- import { Snapshot } from './internals.js';
495
- import { UpdateEncoderV1 } from './internals.js';
496
- import { UpdateEncoderV2 } from './internals.js';
589
+ import { ObservableV2 } from 'lib0/observable';
590
+ import * as s from 'lib0/schema';
497
591
  import * as traits from 'lib0/traits';
592
+ import { ContentType } from './structs/Item.js';
593
+ import { ContentString } from './structs/Item.js';
594
+ import { ContentJSON } from './structs/Item.js';
595
+ import { ContentFormat } from './structs/Item.js';
596
+ import { ContentEmbed } from './structs/Item.js';
597
+ import { ContentDoc } from './structs/Item.js';
598
+ import { ContentAny } from './structs/Item.js';
599
+ import { ContentBinary } from './structs/Item.js';
600
+ import { ContentDeleted } from './structs/Item.js';
498
601
  //# sourceMappingURL=ytype.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ytype.d.ts","sourceRoot":"","sources":["../../src/ytype.js"],"names":[],"mappings":"AA4CO,4CAAiH;AAaxH;IACE;;;;;;OAMG;IACH,kBANW,IAAI,GAAC,IAAI,SACT,IAAI,GAAC,IAAI,SACT,MAAM,qBACN,GAAG,CAAC,MAAM,EAAC,GAAG,CAAC,MACf,0BAA0B,EAQpC;IALC,kBAAgB;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K,CAAC,CAAC,CAAA;CAC1D,CAAC;yBAKY,IAAI,oBACV,OAAO,CAAC,IAAI,EAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,OAAO,SAAS,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;qBApoD7J,mBAAmB;uBAOH,mBAAmB;uBAjCnB,YAAY;6BAUN,iBAAiB;mBAF3B,aAAa;wBACR,aAAa;4BAiB9B,mBAAmB;8BAAnB,mBAAmB;4BAAnB,mBAAmB;8BAAnB,mBAAmB;6BAAnB,mBAAmB;2BAAnB,mBAAmB;2BAAnB,mBAAmB;8BAAnB,mBAAmB;+BAAnB,mBAAmB"}
package/global.d.ts ADDED
@@ -0,0 +1,53 @@
1
+ declare type GC = import('./src/structs/GC.js').GC
2
+ declare type Item = import('./src/structs/Item.js').Item
3
+ declare type Skip = import('./src/structs/Skip.js').Skip
4
+ declare type IdRange = import('./src/utils/ids.js').IdRange
5
+ declare type IdSet = import('./src/utils/ids.js').IdSet
6
+ declare type IdMap<Attrs> = import('./src/utils/ids.js').IdMap<Attrs>
7
+ declare type AttrRanges<Attrs = any> = import('./src/utils/ids.js').AttrRanges<Attrs>
8
+ declare type AttrRange<Attrs = any> = import('./src/utils/ids.js').AttrRange<Attrs>
9
+ declare type ContentAttribute<V=any> = import('./src/utils/ids.js').ContentAttribute<V>
10
+ declare type ContentIds = import('./src/utils/ids.js').ContentIds
11
+ declare type ContentMap= import('./src/utils/ids.js').ContentMap
12
+
13
+
14
+ declare type BlockSet = import('./src/utils/BlockSet.js').BlockSet
15
+ declare type UpdateDecoderV1 = import('./src/utils/UpdateDecoder.js').UpdateDecoderV1
16
+ declare type UpdateDecoderV2 = import('./src/utils/UpdateDecoder.js').UpdateDecoderV2
17
+ declare type UpdateEncoderV1 = import('./src/utils/UpdateEncoder.js').UpdateEncoderV1
18
+ declare type UpdateEncoderV2 = import('./src/utils/UpdateEncoder.js').UpdateEncoderV2
19
+ declare type IdSetEncoderV1 = import('./src/utils/UpdateEncoder.js').IdSetEncoderV1
20
+ declare type IdSetEncoderV2 = import('./src/utils/UpdateEncoder.js').IdSetEncoderV2
21
+ declare type IdSetDecoderV1 = import('./src/utils/UpdateDecoder.js').IdSetDecoderV1
22
+ declare type IdSetDecoderV2 = import('./src/utils/UpdateDecoder.js').IdSetDecoderV2
23
+
24
+ declare type ID = import('./src/utils/ID.js').ID
25
+ declare type Transaction = import('./src/utils/Transaction.js').Transaction
26
+ declare type StructStore = import('./src/utils/StructStore.js').StructStore
27
+ declare type Doc = import('./src/utils/Doc.js').Doc
28
+ declare type YType<DConf extends import('lib0/delta').DeltaConf = any> = import('./src/ytype.js').YType<DConf>
29
+ declare type YEvent<DConf extends import('lib0/delta').DeltaConf> = import('./src/utils/YEvent.js').YEvent<DConf>
30
+ declare type EventHandler<ARG1=any,ARG2=any> = import('./src/utils/EventHandler.js').EventHandler<ARG1, ARG2>
31
+
32
+ declare type AbstractStruct = import('./src/structs/AbstractStruct.js').AbstractStruct
33
+ declare type AbstractContent = import('./src/structs/Item.js').AbstractContent
34
+ declare type ContentType = import('./src/structs/Item.js').ContentType
35
+ declare type ContentAny = import('./src/structs/Item.js').ContentAny
36
+ declare type ContentDoc = import('./src/structs/Item.js').ContentDoc
37
+ declare type ContentJSON = import('./src/structs/Item.js').ContentJSON
38
+ declare type ContentEmbed = import('./src/structs/Item.js').ContentEmbed
39
+ declare type ContentFormat = import('./src/structs/Item.js').ContentFormat
40
+ declare type ContentDeleted = import('./src/structs/Item.js').ContentDeleted
41
+ declare type ContentString = import('./src/structs/Item.js').ContentString
42
+
43
+ declare type DeltaConf = import('lib0/delta').DeltaConf
44
+ declare type Delta<DConf extends DeltaConf> = import('lib0/delta').Delta<DConf>
45
+
46
+ // @todo the below should have a separate Y/[mod] export
47
+ declare type StackItem = import('./src/utils/UndoManager.js').StackItem
48
+ declare type UndoManager = import('./src/utils/UndoManager.js').UndoManager
49
+ declare type AbstractRenderer = import('./src/utils/renderer-helpers.js').AbstractRenderer
50
+ declare type Attribution = import('./src/utils/renderer-helpers.js').Attribution
51
+ declare type AttributedContent<T = any> = import('./src/utils/renderer-helpers.js').AttributedContent<T>
52
+
53
+ declare type Snapshot = import('./src/utils/Snapshot.js').Snapshot
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@y/y",
3
- "version": "14.0.0-rc.2",
3
+ "version": "14.0.0-rc.21",
4
4
  "description": "Shared Editing Library",
5
- "types": "./dist/src/index.d.ts",
6
5
  "type": "module",
7
6
  "sideEffects": false,
8
7
  "funding": {
@@ -13,9 +12,8 @@
13
12
  "clean": "rm -rf dist",
14
13
  "test": "NODE_ENV=development node ./tests/index.js --repetition-time 50",
15
14
  "test-extensive": "node ./tests/index.js --production --repetition-time 10000",
16
- "dist": "npm run clean && (tsc --skipLibCheck --noEmit false|| true)",
17
- "release": "PRODUCTION=1 npm run dist && test -e dist/src/index.d.ts && np",
18
- "lint": "markdownlint README.md && standard && tsc --skipLibCheck",
15
+ "dist": "npm run clean && PRODUCTION=1 tsc --noEmit false && test -e dist/src/index.d.ts",
16
+ "lint": "markdownlint README.md && standard && tsc && npx dpdm --exit-code circular:1 --warning false --tree false src/index.js",
19
17
  "debug": "npm run gentesthtml && 0serve -o test.html",
20
18
  "debug:node": "node --inspect-brk tests/index.js",
21
19
  "trace-deopt": "clear && node --trace-deopt ./tests/index.js",
@@ -27,10 +25,6 @@
27
25
  "types": "./dist/src/index.d.ts",
28
26
  "default": "./src/index.js"
29
27
  },
30
- "./internals": {
31
- "types": "./dist/src/internals.d.ts",
32
- "default": "./src/internals.js"
33
- },
34
28
  "./meta": {
35
29
  "types": "./dist/src/utils/meta.d.ts",
36
30
  "default": "./src/utils/meta.js"
@@ -43,8 +37,9 @@
43
37
  },
44
38
  "files": [
45
39
  "src",
46
- "dist",
47
- "tests/testHelper.js"
40
+ "dist/src",
41
+ "tests/testHelper.js",
42
+ "global.d.ts"
48
43
  ],
49
44
  "dictionaries": {
50
45
  "test": "tests"
@@ -76,19 +71,20 @@
76
71
  },
77
72
  "homepage": "https://docs.yjs.dev",
78
73
  "dependencies": {
79
- "lib0": "^1.0.0-rc.5"
74
+ "lib0": "^1.0.0-rc.18"
80
75
  },
81
76
  "devDependencies": {
82
77
  "@types/node": "^22.14.1",
83
78
  "@y/protocols": "^1.0.6-rc.1",
79
+ "@y/y": ".",
80
+ "dpdm": "^4.0.1",
84
81
  "markdownlint": "^0.40.0",
85
- "markdownlint-cli": "^0.45.0",
82
+ "markdownlint-cli": "^0.49.0",
86
83
  "standard": "^17.1.2",
87
- "typescript": "^5.9.3",
88
- "@y/y": "."
84
+ "typescript": "^5.9.3"
89
85
  },
90
86
  "engines": {
91
87
  "npm": ">=8.0.0",
92
- "node": ">=16.0.0"
88
+ "node": ">=22.0.0"
93
89
  }
94
90
  }
package/src/index.js CHANGED
@@ -1,132 +1,40 @@
1
+ /// <reference types="../global.d.ts" />
1
2
  /** eslint-env browser */
2
3
 
3
- export {
4
- Doc,
5
- Transaction,
6
- YType as Type,
7
- YEvent,
8
- Item,
9
- AbstractStruct,
10
- GC,
11
- Skip,
12
- ContentBinary,
13
- ContentDeleted,
14
- ContentDoc,
15
- ContentEmbed,
16
- ContentFormat,
17
- ContentJSON,
18
- ContentAny,
19
- ContentString,
20
- ContentType,
21
- getTypeChildren,
22
- createRelativePositionFromTypeIndex,
23
- createRelativePositionFromJSON,
24
- createAbsolutePositionFromRelativePosition,
25
- compareRelativePositions,
26
- AbsolutePosition,
27
- RelativePosition,
28
- ID,
29
- createID,
30
- compareIDs,
31
- getState,
32
- Snapshot,
33
- createSnapshot,
34
- cleanupYTextFormatting,
35
- snapshot,
36
- emptySnapshot,
37
- findRootTypeKey,
38
- findIndexSS,
39
- getItem,
40
- getItemCleanStart,
41
- getItemCleanEnd,
42
- typeMapGetSnapshot,
43
- typeMapGetAllSnapshot,
44
- createDocFromSnapshot,
45
- applyUpdate,
46
- applyUpdateV2,
47
- readUpdate,
48
- readUpdateV2,
49
- encodeStateAsUpdate,
50
- encodeStateAsUpdateV2,
51
- encodeStateVector,
52
- UndoManager,
53
- decodeSnapshot,
54
- encodeSnapshot,
55
- decodeSnapshotV2,
56
- encodeSnapshotV2,
57
- decodeStateVector,
58
- logUpdate,
59
- logUpdateV2,
60
- decodeUpdate,
61
- decodeUpdateV2,
62
- relativePositionToJSON,
63
- isParentOf,
64
- equalSnapshots,
65
- tryGc,
66
- transact,
67
- logType,
68
- mergeUpdates,
69
- mergeUpdatesV2,
70
- encodeStateVectorFromUpdate,
71
- encodeStateVectorFromUpdateV2,
72
- encodeRelativePosition,
73
- decodeRelativePosition,
74
- diffUpdate,
75
- diffUpdateV2,
76
- convertUpdateFormatV1ToV2,
77
- convertUpdateFormatV2ToV1,
78
- obfuscateUpdate,
79
- obfuscateUpdateV2,
80
- UpdateEncoderV1,
81
- UpdateEncoderV2,
82
- UpdateDecoderV1,
83
- UpdateDecoderV2,
84
- snapshotContainsUpdate,
85
- // idset
86
- IdSet,
87
- equalIdSets,
88
- createDeleteSetFromStructStore,
89
- IdMap,
90
- createIdMap,
91
- createContentAttribute,
92
- createInsertSetFromStructStore,
93
- diffIdMap,
94
- diffIdSet,
95
- ContentAttribute,
96
- encodeIdMap,
97
- createIdMapFromIdSet,
98
- TwosetAttributionManager,
99
- noAttributionsManager,
100
- AbstractAttributionManager,
101
- iterateStructsByIdSet,
102
- createAttributionManagerFromDiff,
103
- DiffAttributionManager,
104
- createAttributionManagerFromSnapshots,
105
- SnapshotAttributionManager,
106
- createIdSet,
107
- mergeIdSets,
108
- cloneDoc,
109
- createContentIdsFromUpdate,
110
- createContentIdsFromUpdateV2,
111
- insertIntoIdMap,
112
- insertIntoIdSet,
113
- mergeIdMaps,
114
- readIdMap,
115
- readIdSet,
116
- decodeIdMap,
117
- diffDocsToDelta,
118
- getPathTo,
119
- Attributions,
120
- filterIdMap,
121
- undoContentIds,
122
- intersectUpdateWithContentIds,
123
- intersectUpdateWithContentIdsV2,
124
- createDocFromUpdate,
125
- createDocFromUpdateV2
126
- } from './internals.js'
4
+ // Order matters: follows internals.js ordering to avoid circular dependency issues
5
+
6
+ export { IdSet, equalIdSets, createDeleteSetFromStructStore, createInsertSetFromStructStore, diffIdSet, createIdSet, mergeIdSets, insertIntoIdSet, iterateStructsByIdSet, gcIdSet, readIdSet, writeIdSet, encodeIdSet, decodeIdSet, IdMap, createIdMap, createContentAttribute, ContentAttribute, diffIdMap, encodeIdMap, createIdMapFromIdSet, createIdSetFromIdMap, insertIntoIdMap, mergeIdMaps, readIdMap, writeIdMap, decodeIdMap, filterIdMap, intersectSets, intersectMaps } from './utils/ids.js'
7
+ export { Doc } from './utils/Doc.js'
8
+ export { UpdateDecoderV1, UpdateDecoderV2 } from './utils/UpdateDecoder.js'
9
+ export { UpdateEncoderV1, UpdateEncoderV2 } from './utils/UpdateEncoder.js'
10
+ export { applyUpdate, applyUpdateV2, readUpdate, readUpdateV2, encodeStateAsUpdate, encodeStateAsUpdateV2, encodeStateVector, decodeStateVector, diffUpdate, diffUpdateV2, mergeUpdates, mergeUpdatesV2, createDocFromUpdate, createDocFromUpdateV2, cloneDoc } from './utils/encoding.js'
11
+ export { ID, createID, compareIDs, findRootTypeKey } from './utils/ID.js'
12
+ export { isParentOf } from './utils/isParentOf.js'
13
+ export { logType } from './utils/logging.js'
14
+ export { createRelativePositionFromTypeIndex, createRelativePositionFromJSON, createAbsolutePositionFromRelativePosition, compareRelativePositions, AbsolutePosition, RelativePosition, relativePositionToJSON, encodeRelativePosition, decodeRelativePosition } from './utils/RelativePosition.js'
15
+ export { Snapshot, createSnapshot, snapshot, emptySnapshot, createDocFromSnapshot, decodeSnapshot, encodeSnapshot, decodeSnapshotV2, encodeSnapshotV2, equalSnapshots, snapshotContainsUpdate } from './utils/Snapshot.js'
16
+ export { findIndexSS, getItemCleanStart, getItemCleanEnd, tryGc } from './utils/transaction-helpers.js'
17
+ export { Transaction, transact, cleanupYTextFormatting } from './utils/Transaction.js'
18
+ export { UndoManager, undoContentIds } from './utils/UndoManager.js'
19
+ export { logUpdate, logUpdateV2, decodeUpdate, decodeUpdateV2, encodeStateVectorFromUpdate, encodeStateVectorFromUpdateV2, convertUpdateFormatV1ToV2, convertUpdateFormatV2ToV1, obfuscateUpdate, obfuscateUpdateV2, createContentIdsFromUpdate, createContentIdsFromUpdateV2, intersectUpdateWithContentIds, intersectUpdateWithContentIdsV2 } from './utils/updates.js'
20
+ export { YEvent, getPathTo } from './utils/YEvent.js'
21
+ export { TwosetRenderer, baseRenderer, AbstractRenderer, createDiffRenderer, DiffRenderer, createSnapshotRenderer, SnapshotRenderer, Attributions, $renderer } from './utils/Renderer.js'
22
+ export { diffDocsToDelta } from './utils/delta-helpers.js'
23
+ export { YType as Type, getTypeChildren, typeMapGetSnapshot, typeMapGetAllSnapshot, $ytype, $ytypeAny } from './ytype.js'
24
+ export { AbstractStruct } from './structs/AbstractStruct.js'
25
+ export { GC } from './structs/GC.js'
26
+ export { Item, ContentBinary, ContentDeleted, ContentDoc, ContentEmbed, ContentFormat, ContentJSON, ContentAny, ContentString, ContentType } from './structs/Item.js'
27
+ export { Skip } from './structs/Skip.js'
127
28
 
128
29
  export * from './utils/meta.js'
129
30
 
31
+ /**
32
+ * @typedef {import('./utils/ids.js').ContentIds} ContentIds
33
+ */
34
+ /**
35
+ * @typedef {import('./utils/ids.js').ContentMap} ContentMap
36
+ */
37
+
130
38
  const glo = /** @type {any} */ (typeof globalThis !== 'undefined'
131
39
  ? globalThis
132
40
  : typeof window !== 'undefined'