@y/y 14.0.0-rc.20 → 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.
package/README.md CHANGED
@@ -175,7 +175,7 @@ are implemented in separate modules.
175
175
  | [Superdoc](https://superdoc.dev/) | ✔ | (native) | [demo](https://superdoc.dev/) |
176
176
  | [valtio](https://github.com/pmndrs/valtio) | | [valtio-yjs](https://github.com/dai-shi/valtio-yjs) | [demo](https://codesandbox.io/s/valtio-yjs-demo-ox3iy) |
177
177
  | [immer](https://github.com/immerjs/immer) | | [immer-yjs](https://github.com/sep2/immer-yjs) | [demo](https://codesandbox.io/s/immer-yjs-demo-6e0znb) |
178
- | [mutative](https://github.com/unadlib/mutative) | | [mutative-yjs](https://github.com/mutativejs/mutative-yjs) | [demo](https://codesandbox.io/p/sandbox/fjrwk3) |
178
+ | [mutative](https://github.com/unadlib/mutative) | | [mutative-yjs](https://github.com/mutativejs/mutative-yjs) | [demo](https://codesandbox.io/p/sandbox/fjrwk3) |
179
179
  | React | | [react-yjs](https://github.com/nikgraf/react-yjs) | [demo](https://react-yjs-example.vercel.app/) |
180
180
  | React / Vue / Svelte / MobX | | [SyncedStore](https://syncedstore.org) | [demo](https://syncedstore.org/docs/react) |
181
181
  | [mobx-keystone](https://mobx-keystone.js.org/) | | [mobx-keystone-yjs](https://github.com/xaviergonz/mobx-keystone/tree/master/packages/mobx-keystone-yjs) | [demo](https://mobx-keystone.js.org/examples/yjs-binding) |
@@ -1 +1 @@
1
- {"version":3,"file":"Doc.d.ts","sourceRoot":"","sources":["../../../src/utils/Doc.js"],"names":[],"mappings":"AAeA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;;;GAcG;AAEH;;;GAGG;AACH;IACE;;OAEG;IACH,gGAFW,OAAO,EAwFjB;IApFC,YAAY;IACZ,iBAtCmB,IAAI,KAAE,OAAO,CAsCR;IACxB,iBAAqC;IACrC,aAAgB;IAChB,4BAAgC;IACh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AEG;IACH,QAFU,GAAG,CAEO;IACpB;;;OAGG;IACH,MAFU,GAAG,CAAC,GAAG,EAAC,GAAG,CAAC,CAED;IACrB;;;OAGG;IACH,OAFU,OAAO,CAEC;IAClB;;OAEG;IACH,cAFU,GAAG,CAAC,GAAG,CAAC,CAEW;IAC7B;;OAEG;IACH,gBAFU,GAAG,CAAC,GAAG,CAAC,CAEa;IAC/B;;OAEG;IACH,eAFU,GAAG,CAAC,GAAG,CAAC,CAEY;IAC9B;;OAEG;IACH,wBAFU,OAAO,CAEkB;IACnC,eAAkB;IAGpB;;;;;OAKG;IACH,mBAFU,GAAG,gBAAe,CAW3B;IAED;;;;;OAKG;IACH,kBAFU,GAAG,gBAAe,CAc3B;CACF;AAcM,6CAHI,KAAK,GACJ,MAAM,CA2BjB;AAwIM,0DAFI,WAAW,QAsCrB;AAcM,yBATM,CAAC,OACH,GAAG,KACH,CAAS,IAAW,EAAX,WAAW,KAAE,CAAC,WACvB,GAAG,UACH,OAAO,GACN,CAAC,CAwCZ;wBA3ZuB,aAAa;uBAJd,aAAa"}
1
+ {"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../../../src/utils/Transaction.js"],"names":[],"mappings":"AAiBA,uDAAgD;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IACE;;;;OAIG;IACH,iBAJW,GAAG,UACH,GAAG,SACH,OAAO,EA+EjB;IA5EC;;;OAGG;IACH,KAFU,GAAG,CAEC;IACd;;OAEG;IACH,oCAA8B;IAC9B;;;OAGG;IACH,mCAA6B;IAC7B;;OAEG;IACH,oCAA8B;IAC9B;;;OAGG;IACH,cAFU,GAAG,gBAAe,OAAC,CAEL;IACxB;;;OAGG;IACH,aAFU,GAAG,gBAAe,OAAC,CAEN;IACvB;;;;;OAKG;IACH,SAFU,GAAG,CAAC,KAAK,EAAC,GAAG,CAAC,SAAO,IAAI,CAAC,CAAC,CAEb;IACxB;;;;OAIG;IACH,oBAFU,GAAG,CAAC,KAAK,EAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAEJ;IACnC;;OAEG;IACH,eAFU,KAAK,CAAC,cAAc,CAAC,CAER;IACvB;;OAEG;IACH,QAFU,GAAG,CAEO;IACpB;;;OAGG;IACH,MAFU,GAAG,CAAC,GAAG,EAAC,GAAG,CAAC,CAED;IACrB;;;OAGG;IACH,OAFU,OAAO,CAEC;IAClB;;OAEG;IACH,cAFU,GAAG,CAAC,GAAG,CAAC,CAEW;IAC7B;;OAEG;IACH,gBAFU,GAAG,CAAC,GAAG,CAAC,CAEa;IAC/B;;OAEG;IACH,eAFU,GAAG,CAAC,GAAG,CAAC,CAEY;IAC9B;;OAEG;IACH,wBAFU,OAAO,CAEkB;IACnC,eAAkB;IAGpB;;;;;OAKG;IACH,mBAFU,GAAG,gBAAe,CAW3B;IAED;;;;;OAKG;IACH,kBAFU,GAAG,gBAAe,CAc3B;CACF;AAcM,6CAHI,KAAK,GACJ,MAAM,CA2BjB;AAoJM,0DAFI,WAAW,QAsCrB;AAcM,yBATM,CAAC,OACH,GAAG,KACH,CAAS,IAAW,EAAX,WAAW,KAAE,CAAC,WACvB,GAAG,UACH,OAAO,GACN,CAAC,CAwCZ;wBAvauB,aAAa;uBAJd,aAAa"}
@@ -64,7 +64,7 @@ export class YEvent<DConf extends DeltaConf> {
64
64
  /**
65
65
  * @template {boolean} [Deep=false]
66
66
  * @param {object} [opts]
67
- * @param {AbstractRenderer} [opts.renderer] - renders the content (with attributions); defaults to `baseRenderer`
67
+ * @param {AbstractRenderer} [opts.renderer] - renders the content (with attributions); defaults to the target type's active renderer (see {@link YType#useRenderer}), i.e. `baseRenderer` unless changed
68
68
  * @param {Deep} [opts.deep]
69
69
  * @return {Deep extends true ? Delta<DConf> : Delta<import('../ytype.js').DeltaConfDeltaToYType<DConf>>} The Delta representation of this type.
70
70
  *
@@ -13,6 +13,6 @@ export function tryGcDeleteSet(tr: Transaction, ds: IdSet, gcFilter: (arg0: Item
13
13
  export function tryMerge(ds: IdSet, store: StructStore): void;
14
14
  export function tryGc(tr: Transaction, idset: IdSet, gcFilter: (arg0: Item) => boolean): void;
15
15
  export function cleanupContextlessFormattingGap(transaction: Transaction, item: Item | null): 0 | undefined;
16
- export function updateCurrentAttributes(currentAttributes: Map<string, any>, { key, value }: ContentFormat): void;
17
- export function cleanupFormattingGap(transaction: Transaction, start: Item, curr: Item | null, startAttributes: Map<string, any>, currAttributes: Map<string, any>): number;
16
+ export function updateCurrentFormats(currentFormats: Map<string, any>, { key, value }: ContentFormat): void;
17
+ export function cleanupFormattingGap(transaction: Transaction, start: Item, curr: Item | null, startFormats: Map<string, any>, currFormats: Map<string, any>): number;
18
18
  //# sourceMappingURL=transaction-helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/transaction-helpers.js"],"names":[],"mappings":"AAqBO,qCAPI,KAAK,CAAC,IAAI,GAAC,EAAE,GAAC,IAAI,CAAC,SACnB,MAAM,GACL,MAAM,CAiCjB;AAOM,iDAJI,WAAW,OAAC,WACZ,KAAK,CAAC,IAAI,GAAC,EAAE,GAAC,IAAI,CAAC,SACnB,MAAM,UAUhB;AAYM,+CAPI,WAAW,MACX,EAAE,GACD,IAAI,CAQf;AAaM,6CARI,WAAW,SACX,WAAW,MACX,EAAE,GACD,IAAI,CAaf;AAWM,kCAPI,WAAW,UACX,EAAE,GAAC,IAAI,aACP,EAAE,GAAC,IAAI,QASjB;AAaM,4CARI,WAAW,WACX,KAAK,CAAC,IAAI,GAAC,EAAE,CAAC,cACd,MAAM,OACN,MAAM,KACN,CAAS,IAAO,EAAP,EAAE,GAAC,IAAI,KAAE,IAAI,QAkBhC;AAaM,qDAPI,KAAK,CAAC,IAAI,GAAC,EAAE,CAAC,cACd,MAAM,OACN,MAAM,KACN,CAAC,MAAM,EAAE,EAAE,GAAC,IAAI,GAAC,IAAI,EAAE,MAAM,EAAC,MAAM,EAAE,GAAG,EAAC,MAAM,KAAG,IAAI,QAkBjE;AAYM,yCARI,WAAW,OAAC,cACZ,IAAI,GAAC,EAAE,GAAC,IAAI,QACZ,MAAM,GACL,EAAE,GAAC,IAAI,GAAC,IAAI,CAavB;AAQM,oCALI,WAAW,wBAQrB;AAUM,yDAJI,WAAW,QACX,KAAK,aACL,MAAM,GAAC,IAAI,QAOrB;AAOM,6CAJI,KAAK,CAAC,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,OACvB,MAAM,GACL,MAAM,CAuBjB;AAOM,mCAJI,WAAW,MACX,KAAK,YACL,CAAS,IAAI,EAAJ,IAAI,KAAE,OAAO,QAwBhC;AAMM,6BAHI,KAAK,SACL,WAAW,QAqBrB;AAOM,0BAJI,WAAW,SACX,KAAK,YACL,CAAS,IAAI,EAAJ,IAAI,KAAE,OAAO,QAKhC;AAMM,6DAHI,WAAW,QACX,IAAI,GAAG,IAAI,iBAsBrB;AASM,2DANI,GAAG,CAAC,MAAM,EAAC,GAAG,CAAC,kBACf,aAAa,QAWvB;AAeM,kDATI,WAAW,SACX,IAAI,QACJ,IAAI,GAAC,IAAI,mBACT,GAAG,CAAC,MAAM,EAAC,GAAG,CAAC,kBACf,GAAG,CAAC,MAAM,EAAC,GAAG,CAAC,GACd,MAAM,CAqDjB"}
1
+ {"version":3,"file":"transaction-helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/transaction-helpers.js"],"names":[],"mappings":"AAqBO,qCAPI,KAAK,CAAC,IAAI,GAAC,EAAE,GAAC,IAAI,CAAC,SACnB,MAAM,GACL,MAAM,CAiCjB;AAOM,iDAJI,WAAW,OAAC,WACZ,KAAK,CAAC,IAAI,GAAC,EAAE,GAAC,IAAI,CAAC,SACnB,MAAM,UAUhB;AAYM,+CAPI,WAAW,MACX,EAAE,GACD,IAAI,CAQf;AAaM,6CARI,WAAW,SACX,WAAW,MACX,EAAE,GACD,IAAI,CAaf;AAWM,kCAPI,WAAW,UACX,EAAE,GAAC,IAAI,aACP,EAAE,GAAC,IAAI,QASjB;AAaM,4CARI,WAAW,WACX,KAAK,CAAC,IAAI,GAAC,EAAE,CAAC,cACd,MAAM,OACN,MAAM,KACN,CAAS,IAAO,EAAP,EAAE,GAAC,IAAI,KAAE,IAAI,QAkBhC;AAaM,qDAPI,KAAK,CAAC,IAAI,GAAC,EAAE,CAAC,cACd,MAAM,OACN,MAAM,KACN,CAAC,MAAM,EAAE,EAAE,GAAC,IAAI,GAAC,IAAI,EAAE,MAAM,EAAC,MAAM,EAAE,GAAG,EAAC,MAAM,KAAG,IAAI,QAkBjE;AAYM,yCARI,WAAW,OAAC,cACZ,IAAI,GAAC,EAAE,GAAC,IAAI,QACZ,MAAM,GACL,EAAE,GAAC,IAAI,GAAC,IAAI,CAavB;AAQM,oCALI,WAAW,wBAQrB;AAUM,yDAJI,WAAW,QACX,KAAK,aACL,MAAM,GAAC,IAAI,QAOrB;AAOM,6CAJI,KAAK,CAAC,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,OACvB,MAAM,GACL,MAAM,CAuBjB;AAOM,mCAJI,WAAW,MACX,KAAK,YACL,CAAS,IAAI,EAAJ,IAAI,KAAE,OAAO,QAwBhC;AAMM,6BAHI,KAAK,SACL,WAAW,QAqBrB;AAOM,0BAJI,WAAW,SACX,KAAK,YACL,CAAS,IAAI,EAAJ,IAAI,KAAE,OAAO,QAKhC;AAMM,6DAHI,WAAW,QACX,IAAI,GAAG,IAAI,iBAsBrB;AASM,qDANI,GAAG,CAAC,MAAM,EAAC,GAAG,CAAC,kBACf,aAAa,QAWvB;AAeM,kDATI,WAAW,SACX,IAAI,QACJ,IAAI,GAAC,IAAI,gBACT,GAAG,CAAC,MAAM,EAAC,GAAG,CAAC,eACf,GAAG,CAAC,MAAM,EAAC,GAAG,CAAC,GACd,MAAM,CAqDjB"}
@@ -1,18 +1,18 @@
1
1
  export function warnPrematureAccess(): void;
2
- export function createAttributionFromAttributionItems(attrs: Array<ContentAttribute<any>> | null, deleted: boolean): Attribution | null;
2
+ export function createAttributionFromAttributionItems(attrs: Array<ContentAttribute<any>> | null, deleted: boolean): Attribution | undefined;
3
3
  export class ItemTextListPosition {
4
4
  /**
5
5
  * @param {Item|null} left
6
6
  * @param {Item|null} right
7
7
  * @param {number} index
8
- * @param {Map<string,any>} currentAttributes
8
+ * @param {Map<string,any>} currentFormats
9
9
  * @param {AbstractRenderer} renderer
10
10
  */
11
- constructor(left: Item | null, right: Item | null, index: number, currentAttributes: Map<string, any>, renderer: AbstractRenderer);
11
+ constructor(left: Item | null, right: Item | null, index: number, currentFormats: Map<string, any>, renderer: AbstractRenderer);
12
12
  left: Item | null;
13
13
  right: Item | null;
14
14
  index: number;
15
- currentAttributes: Map<string, any>;
15
+ currentFormats: Map<string, any>;
16
16
  renderer: import("./utils/renderer-helpers.js").AbstractRenderer;
17
17
  /**
18
18
  * Only call this if you know that this.right is defined
@@ -22,18 +22,18 @@ export class ItemTextListPosition {
22
22
  * @param {Transaction} transaction
23
23
  * @param {YType} parent
24
24
  * @param {number} length
25
- * @param {Object<string,any>} attributes
25
+ * @param {Object<string,any>} formats
26
26
  *
27
27
  * @function
28
28
  */
29
- formatText(transaction: Transaction, parent: YType, length: number, attributes: {
29
+ formatText(transaction: Transaction, parent: YType, length: number, formats: {
30
30
  [x: string]: any;
31
31
  }): void;
32
32
  }
33
- 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: {
34
34
  [x: string]: any;
35
35
  }): void;
36
- 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: {
37
37
  [x: string]: any;
38
38
  }): void;
39
39
  export function deleteText(transaction: Transaction, currPos: ItemTextListPosition, length: number): ItemTextListPosition;
@@ -52,10 +52,23 @@ export function updateMarkerChanges(searchMarker: Array<ArraySearchMarker>, inde
52
52
  export function getTypeChildren(t: YType): Array<Item>;
53
53
  export function callTypeObservers(type: YType, transaction: Transaction, event: YEvent<any>): void;
54
54
  /**
55
- * 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
+ *
56
65
  * @template {delta.DeltaConf} [DConf=any]
66
+ * @extends {ObservableV2<{ delta: (delta: delta.Delta<DConf>) => void, destroy: (type: YType<DConf>) => void }>}
57
67
  */
58
- 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
+ }> {
59
72
  /**
60
73
  * @template {delta.DeltaConf} DC
61
74
  * @param {delta.Delta<DC>} d
@@ -102,16 +115,72 @@ export class YType<DConf extends delta.DeltaConf = any> {
102
115
  */
103
116
  _searchMarker: null | Array<ArraySearchMarker>;
104
117
  /**
105
- * @type {delta.DeltaBuilder<DConf>}
106
- * @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}
107
122
  */
108
- private _content;
123
+ _delta: delta.DeltaBuilderAny | null;
109
124
  _legacyTypeRef: number;
110
125
  /**
111
- * Whether this YText contains formatting attributes.
126
+ * Whether this YText contains formats.
112
127
  * This flag is updated when a formatting item is integrated (see ContentFormat.integrate)
113
128
  */
114
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;
115
184
  get length(): number;
116
185
  /**
117
186
  * Returns a fresh delta that can be used to change this YType.
@@ -184,7 +253,7 @@ export class YType<DConf extends delta.DeltaConf = any> {
184
253
  * @template {boolean} [Deep=false]
185
254
  *
186
255
  * @param {Object} [opts]
187
- * @param {AbstractRenderer} [opts.renderer] - renders the content (with attributions); defaults to `baseRenderer`
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
188
257
  * @param {IdSet?} [opts.itemsToRender]
189
258
  * @param {boolean} [opts.retainInserts] - if true, retain rendered inserts with attributions
190
259
  * @param {boolean} [opts.retainDeletes] - if true, retain rendered+attributed deletes only
@@ -209,7 +278,7 @@ export class YType<DConf extends delta.DeltaConf = any> {
209
278
  * attributions.
210
279
  *
211
280
  * @param {Object} [opts]
212
- * @param {AbstractRenderer} [opts.renderer] - renders the content (with attributions); defaults to `baseRenderer`
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
213
282
  * @return {delta.Delta<DConf>}
214
283
  */
215
284
  toDeltaDeep(opts?: {
@@ -220,13 +289,15 @@ export class YType<DConf extends delta.DeltaConf = any> {
220
289
  *
221
290
  * @param {delta.DeltaAny} d The changes to apply on this element.
222
291
  * @param {Object} [opts]
223
- * @param {AbstractRenderer} [opts.renderer] - renders the content (with attributions); defaults to `baseRenderer`
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.
224
295
  *
225
296
  * @public
226
297
  */
227
298
  public applyDelta(d: delta.DeltaAny, { renderer }?: {
228
299
  renderer?: import("./utils/renderer-helpers.js").AbstractRenderer | undefined;
229
- }): this;
300
+ }): null;
230
301
  /**
231
302
  * Makes a copy of this data type that can be included somewhere else.
232
303
  *
@@ -302,9 +373,9 @@ export class YType<DConf extends delta.DeltaConf = any> {
302
373
  *
303
374
  * @param {number} index The index to insert content at.
304
375
  * @param {Array<delta.DeltaConfGetChildren<DConf>>|delta.DeltaConfGetText<DConf>} content Array of content to append.
305
- * @param {delta.FormattingAttributes} [format]
376
+ * @param {delta.Formats} [format]
306
377
  */
307
- 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;
308
379
  /**
309
380
  * Inserts new content at an index.
310
381
  *
@@ -320,10 +391,10 @@ export class YType<DConf extends delta.DeltaConf = any> {
320
391
  *
321
392
  * @param {number} index The index to insert content at.
322
393
  * @param {number} length The index to insert content at.
323
- * @param {delta.FormattingAttributes} formats
394
+ * @param {delta.Formats} formats
324
395
  *
325
396
  */
326
- format(index: number, length: number, formats: delta.FormattingAttributes): void;
397
+ format(index: number, length: number, formats: delta.Formats): void;
327
398
  /**
328
399
  * Appends content to this YArray.
329
400
  *
@@ -452,7 +523,7 @@ export class YType<DConf extends delta.DeltaConf = any> {
452
523
  export function $ytype<DConf extends import("lib0/delta").ReadableDeltaConf>(_dconf: DConf): s.Schema<YType<import("lib0/delta").ReadDeltaConf<DConf>>>;
453
524
  export const $ytypeAny: s.Schema<YType<any>>;
454
525
  export function computeModifiedFromItems(store: StructStore, items: IdSet): Map<YType<any>, Set<string | null>>;
455
- export function equalAttrs(a: any, b: any): boolean;
526
+ export function equalFormats(a: any, b: any): boolean;
456
527
  export function typeListSlice(type: YType<any>, start: number, end: number): Array<any>;
457
528
  export function typeListGet(type: YType, index: number): any;
458
529
  export function typeListInsertGenericsAfter(transaction: Transaction, parent: YType, referenceItem: Item | null, content: Array<YValue>): void;
@@ -515,8 +586,9 @@ export type DeltaToYType<Data extends unknown> = Exclude<Data, delta.DeltaAny> |
515
586
  import { Item } from './structs/Item.js';
516
587
  import { YEvent } from './utils/YEvent.js';
517
588
  import * as delta from 'lib0/delta';
518
- import * as traits from 'lib0/traits';
589
+ import { ObservableV2 } from 'lib0/observable';
519
590
  import * as s from 'lib0/schema';
591
+ import * as traits from 'lib0/traits';
520
592
  import { ContentType } from './structs/Item.js';
521
593
  import { ContentString } from './structs/Item.js';
522
594
  import { ContentJSON } from './structs/Item.js';
@@ -1 +1 @@
1
- {"version":3,"file":"ytype.d.ts","sourceRoot":"","sources":["../../src/ytype.js"],"names":[],"mappings":"AA4CO,4CAAiH;AAUjH,6DAJI,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,OAAC,WAC7B,OAAO,GACN,WAAW,OAAC,CAgCvB;AAWD;IACE;;;;;;OAMG;IACH,kBANW,IAAI,GAAC,IAAI,SACT,IAAI,GAAC,IAAI,SACT,MAAM,qBACN,GAAG,CAAC,MAAM,EAAC,GAAG,CAAC,YACf,gBAAgB,EAQ1B;IALC,kBAAgB;IAChB,mBAAkB;IAClB,cAAkB;IAClB,oCAA0C;IAC1C,iEAAwB;IAG1B;;OAEG;IACH,gBAgBC;IAED;;;;;;;OAOG;IACH,wBAPW,WAAW,UACX,KAAK,UACL,MAAM;;aA4EhB;CACF;AAqHM,2CATI,WAAW,UACX,KAAK,WACL,oBAAoB,WACpB,OAAO,mBAAmB,EAAE,eAAe;;SA0BrD;AASM,iDANI,WAAW,UACX,KAAK,WACL,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"version": "14.0.0-rc.21",
4
4
  "description": "Shared Editing Library",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -71,7 +71,7 @@
71
71
  },
72
72
  "homepage": "https://docs.yjs.dev",
73
73
  "dependencies": {
74
- "lib0": "^1.0.0-rc.15"
74
+ "lib0": "^1.0.0-rc.18"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@types/node": "^22.14.1",
@@ -79,7 +79,7 @@
79
79
  "@y/y": ".",
80
80
  "dpdm": "^4.0.1",
81
81
  "markdownlint": "^0.40.0",
82
- "markdownlint-cli": "^0.43.0",
82
+ "markdownlint-cli": "^0.49.0",
83
83
  "standard": "^17.1.2",
84
84
  "typescript": "^5.9.3"
85
85
  },
package/src/utils/Doc.js CHANGED
@@ -226,6 +226,9 @@ export class Doc extends ObservableV2 {
226
226
  */
227
227
  destroy () {
228
228
  this.isDestroyed = true
229
+ // Tear down the top-level shared types as RDTs (emits their `'destroy'` event so any bindings
230
+ // unsubscribe). Only top-level types are destroyed here; nested child types are not recursed.
231
+ this.share.forEach(type => type.destroy())
229
232
  array.from(this.subdocs).forEach(subdoc => subdoc.destroy())
230
233
  const item = this._item
231
234
  if (item !== null) {
@@ -12,7 +12,7 @@ import { GC } from '../structs/GC.js'
12
12
  import { YEvent } from './YEvent.js'
13
13
  import { writeUpdateMessageFromTransaction } from './encoding-helpers.js'
14
14
  import { UpdateEncoderV1, UpdateEncoderV2 } from './UpdateEncoder.js'
15
- import { findIndexSS, updateCurrentAttributes, cleanupFormattingGap, tryGcDeleteSet, tryMerge, tryToMergeWithLefts, cleanupContextlessFormattingGap } from './transaction-helpers.js'
15
+ import { findIndexSS, updateCurrentFormats, cleanupFormattingGap, tryGcDeleteSet, tryMerge, tryToMergeWithLefts, cleanupContextlessFormattingGap } from './transaction-helpers.js'
16
16
  import * as random from 'lib0/random'
17
17
 
18
18
  export const generateNewClientId = random.uint53
@@ -168,14 +168,14 @@ export class Transaction {
168
168
  /**
169
169
  * This function is experimental and subject to change / be removed.
170
170
  *
171
- * Ideally, we don't need this function at all. Formatting attributes should be cleaned up
171
+ * Ideally, we don't need this function at all. Formats should be cleaned up
172
172
  * automatically after each change. This function iterates twice over the complete YText type
173
- * and removes unnecessary formatting attributes. This is also helpful for testing.
173
+ * and removes unnecessary formats. This is also helpful for testing.
174
174
  *
175
175
  * This function won't be exported anymore as soon as there is confidence that the YText type works as intended.
176
176
  *
177
177
  * @param {YType} type
178
- * @return {number} How many formatting attributes have been cleaned up.
178
+ * @return {number} How many formats have been cleaned up.
179
179
  */
180
180
  export const cleanupYTextFormatting = type => {
181
181
  if (!type.doc?.cleanupFormatting) return 0
@@ -183,17 +183,17 @@ export const cleanupYTextFormatting = type => {
183
183
  transact(/** @type {Doc} */ (type.doc), transaction => {
184
184
  let start = /** @type {Item} */ (type._start)
185
185
  let end = type._start
186
- let startAttributes = map.create()
187
- const currentAttributes = map.copy(startAttributes)
186
+ let startFormats = map.create()
187
+ const currentFormats = map.copy(startFormats)
188
188
  while (end) {
189
189
  if (end.deleted === false) {
190
190
  switch (end.content.constructor) {
191
191
  case ContentFormat:
192
- updateCurrentAttributes(currentAttributes, /** @type {ContentFormat} */ (end.content))
192
+ updateCurrentFormats(currentFormats, /** @type {ContentFormat} */ (end.content))
193
193
  break
194
194
  default:
195
- res += cleanupFormattingGap(transaction, start, end, startAttributes, currentAttributes)
196
- startAttributes = map.copy(currentAttributes)
195
+ res += cleanupFormattingGap(transaction, start, end, startFormats, currentFormats)
196
+ startFormats = map.copy(currentFormats)
197
197
  start = end
198
198
  break
199
199
  }
@@ -236,17 +236,29 @@ const cleanupTransactions = (transactionCleanups, i) => {
236
236
  })
237
237
  )
238
238
  fs.push(() => {
239
- // deep observe events
239
+ // deep observe events + the RDT `'delta'` channel. `changedParentTypes` holds the changed
240
+ // type AND all of its ancestors, so both `observeDeep` and `'delta'` bubble identically.
240
241
  transaction.changedParentTypes.forEach((events, type) => {
241
242
  // We need to think about the possibility that the user transforms the
242
243
  // Y.Doc in the event.
243
- if (type._dEH.l.length > 0 && (type._item === null || !type._item.deleted)) {
244
- /**
245
- * @type {YEvent<any>}
246
- */
247
- const deepEventHandler = events.find(event => event.target === type) || new YEvent(type, transaction, new Set(null))
244
+ if (type._item !== null && type._item.deleted) return
245
+ const hasDeep = type._dEH.l.length > 0
246
+ const hasDeltaListeners = (type._observers.get('delta')?.size ?? 0) > 0
247
+ const maintaining = type._delta !== null
248
+ if (!hasDeep && !hasDeltaListeners && !maintaining) return
249
+ /**
250
+ * @type {YEvent<any>}
251
+ */
252
+ const deepEventHandler = events.find(event => event.target === type) || new YEvent(type, transaction, new Set(null))
253
+ if (hasDeep) {
248
254
  callEventHandlerListeners(type._dEH, deepEventHandler, transaction)
249
255
  }
256
+ if (hasDeltaListeners || maintaining) {
257
+ // the type-rooted deep delta of this transaction (a nested `modify` chain for ancestors)
258
+ const change = /** @type {any} */ (deepEventHandler.getDelta({ renderer: type._renderer, deep: true }).done())
259
+ type._delta?.apply(change) // keep the cache current (incl. ancestors and diff-renderer attributions)
260
+ if (hasDeltaListeners) type.emit('delta', [change])
261
+ }
250
262
  })
251
263
  })
252
264
  fs.push(() => doc.emit('afterTransaction', [transaction, doc]))
@@ -334,7 +346,7 @@ const cleanupTransactions = (transactionCleanups, i) => {
334
346
 
335
347
  /**
336
348
  * This will be called by the transaction once the event handlers are called to potentially cleanup
337
- * formatting attributes.
349
+ * formats.
338
350
  *
339
351
  * @param {Transaction} transaction
340
352
  */
@@ -362,14 +374,14 @@ export const cleanupYTextAfterTransaction = transaction => {
362
374
  if (item.content.constructor === ContentFormat) {
363
375
  needFullCleanup.add(parent)
364
376
  } else {
365
- // If no formatting attribute was inserted or deleted, we can make due with contextless
377
+ // If no format was inserted or deleted, we can make due with contextless
366
378
  // formatting cleanups.
367
- // Contextless: it is not necessary to compute currentAttributes for the affected position.
379
+ // Contextless: it is not necessary to compute currentFormats for the affected position.
368
380
  cleanupContextlessFormattingGap(t, item)
369
381
  }
370
382
  })
371
383
  // If a formatting item was inserted, we simply clean the whole type.
372
- // We need to compute currentAttributes for the current position anyway.
384
+ // We need to compute currentFormats for the current position anyway.
373
385
  for (const yText of needFullCleanup) {
374
386
  cleanupYTextFormatting(yText)
375
387
  }
@@ -86,13 +86,13 @@ export class YEvent {
86
86
  /**
87
87
  * @template {boolean} [Deep=false]
88
88
  * @param {object} [opts]
89
- * @param {AbstractRenderer} [opts.renderer] - renders the content (with attributions); defaults to `baseRenderer`
89
+ * @param {AbstractRenderer} [opts.renderer] - renders the content (with attributions); defaults to the target type's active renderer (see {@link YType#useRenderer}), i.e. `baseRenderer` unless changed
90
90
  * @param {Deep} [opts.deep]
91
91
  * @return {Deep extends true ? Delta<DConf> : Delta<import('../ytype.js').DeltaConfDeltaToYType<DConf>>} The Delta representation of this type.
92
92
  *
93
93
  * @public
94
94
  */
95
- getDelta ({ renderer = baseRenderer, deep } = {}) {
95
+ getDelta ({ renderer = this.target._renderer, deep } = {}) {
96
96
  const itemsToRender = mergeIdSets([diffIdSet(this.transaction.insertSet, this.transaction.deleteSet), diffIdSet(this.transaction.deleteSet, this.transaction.insertSet)])
97
97
  /**
98
98
  * @todo this should be done only one in the transaction step
@@ -334,17 +334,17 @@ export const cleanupContextlessFormattingGap = (transaction, item) => {
334
334
  }
335
335
 
336
336
  /**
337
- * @param {Map<string,any>} currentAttributes
337
+ * @param {Map<string,any>} currentFormats
338
338
  * @param {ContentFormat} format
339
339
  *
340
340
  * @private
341
341
  * @function
342
342
  */
343
- export const updateCurrentAttributes = (currentAttributes, { key, value }) => {
343
+ export const updateCurrentFormats = (currentFormats, { key, value }) => {
344
344
  if (value === null) {
345
- currentAttributes.delete(key)
345
+ currentFormats.delete(key)
346
346
  } else {
347
- currentAttributes.set(key, value)
347
+ currentFormats.set(key, value)
348
348
  }
349
349
  }
350
350
 
@@ -355,13 +355,13 @@ export const updateCurrentAttributes = (currentAttributes, { key, value }) => {
355
355
  * @param {Transaction} transaction
356
356
  * @param {Item} start
357
357
  * @param {Item|null} curr exclusive end, automatically iterates to the next Content Item
358
- * @param {Map<string,any>} startAttributes
359
- * @param {Map<string,any>} currAttributes
358
+ * @param {Map<string,any>} startFormats
359
+ * @param {Map<string,any>} currFormats
360
360
  * @return {number} The amount of formatting Items deleted.
361
361
  *
362
362
  * @function
363
363
  */
364
- export const cleanupFormattingGap = (transaction, start, curr, startAttributes, currAttributes) => {
364
+ export const cleanupFormattingGap = (transaction, start, curr, startFormats, currFormats) => {
365
365
  if (!transaction.doc.cleanupFormatting) return 0
366
366
  /**
367
367
  * @type {Item|null}
@@ -388,22 +388,22 @@ export const cleanupFormattingGap = (transaction, start, curr, startAttributes,
388
388
  const content = start.content
389
389
  if (content.getRef() === 6) { // is ContentFormat
390
390
  const { key, value } = /** @type {ContentFormat} */ (content)
391
- const startAttrValue = startAttributes.get(key) ?? null
392
- if (endFormats.get(key) !== content || startAttrValue === value) {
393
- // Either this format is overwritten or it is not necessary because the attribute already existed.
391
+ const startFormatValue = startFormats.get(key) ?? null
392
+ if (endFormats.get(key) !== content || startFormatValue === value) {
393
+ // Either this format is overwritten or it is not necessary because the format already existed.
394
394
  start.delete(transaction)
395
395
  transaction.cleanUps.add(start.id.client, start.id.clock, start.length)
396
396
  cleanups++
397
- if (!reachedCurr && (currAttributes.get(key) ?? null) === value && startAttrValue !== value) {
398
- if (startAttrValue === null) {
399
- currAttributes.delete(key)
397
+ if (!reachedCurr && (currFormats.get(key) ?? null) === value && startFormatValue !== value) {
398
+ if (startFormatValue === null) {
399
+ currFormats.delete(key)
400
400
  } else {
401
- currAttributes.set(key, startAttrValue)
401
+ currFormats.set(key, startFormatValue)
402
402
  }
403
403
  }
404
404
  }
405
405
  if (!reachedCurr && !start.deleted) {
406
- updateCurrentAttributes(currAttributes, /** @type {ContentFormat} */ (content))
406
+ updateCurrentFormats(currFormats, /** @type {ContentFormat} */ (content))
407
407
  }
408
408
  }
409
409
  }