@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.
- package/README.md +36 -12
- package/dist/src/index.d.ts +24 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/structs/AbstractStruct.d.ts +14 -17
- package/dist/src/structs/AbstractStruct.d.ts.map +1 -1
- package/dist/src/structs/GC.d.ts +9 -14
- package/dist/src/structs/GC.d.ts.map +1 -1
- package/dist/src/structs/Item.d.ts +569 -31
- package/dist/src/structs/Item.d.ts.map +1 -1
- package/dist/src/structs/Skip.d.ts +9 -11
- package/dist/src/structs/Skip.d.ts.map +1 -1
- package/dist/src/utils/BlockSet.d.ts +8 -7
- package/dist/src/utils/BlockSet.d.ts.map +1 -1
- package/dist/src/utils/Doc.d.ts +4 -9
- package/dist/src/utils/Doc.d.ts.map +1 -1
- package/dist/src/utils/ID.d.ts +0 -1
- package/dist/src/utils/ID.d.ts.map +1 -1
- package/dist/src/utils/RelativePosition.d.ts +2 -5
- package/dist/src/utils/RelativePosition.d.ts.map +1 -1
- package/dist/src/utils/Renderer.d.ts +144 -0
- package/dist/src/utils/Renderer.d.ts.map +1 -0
- package/dist/src/utils/Snapshot.d.ts +7 -11
- package/dist/src/utils/Snapshot.d.ts.map +1 -1
- package/dist/src/utils/StructStore.d.ts +45 -23
- package/dist/src/utils/StructStore.d.ts.map +1 -1
- package/dist/src/utils/Transaction.d.ts +11 -21
- package/dist/src/utils/Transaction.d.ts.map +1 -1
- package/dist/src/utils/UndoManager.d.ts +13 -14
- package/dist/src/utils/UndoManager.d.ts.map +1 -1
- package/dist/src/utils/UpdateDecoder.d.ts +1 -1
- package/dist/src/utils/UpdateDecoder.d.ts.map +1 -1
- package/dist/src/utils/UpdateEncoder.d.ts +0 -1
- package/dist/src/utils/UpdateEncoder.d.ts.map +1 -1
- package/dist/src/utils/YEvent.d.ts +22 -26
- package/dist/src/utils/YEvent.d.ts.map +1 -1
- package/dist/src/utils/content-helper.d.ts +2 -0
- package/dist/src/utils/content-helper.d.ts.map +1 -0
- package/dist/src/utils/delta-helpers.d.ts +2 -3
- package/dist/src/utils/delta-helpers.d.ts.map +1 -1
- package/dist/src/utils/encoding-helpers.d.ts +6 -0
- package/dist/src/utils/encoding-helpers.d.ts.map +1 -0
- package/dist/src/utils/encoding.d.ts +16 -18
- package/dist/src/utils/encoding.d.ts.map +1 -1
- package/dist/src/utils/ids.d.ts +331 -0
- package/dist/src/utils/ids.d.ts.map +1 -0
- package/dist/src/utils/isParentOf.d.ts +1 -2
- package/dist/src/utils/isParentOf.d.ts.map +1 -1
- package/dist/src/utils/logging.d.ts +0 -1
- package/dist/src/utils/logging.d.ts.map +1 -1
- package/dist/src/utils/meta.d.ts +15 -64
- package/dist/src/utils/meta.d.ts.map +1 -1
- package/dist/src/utils/renderer-helpers.d.ts +99 -0
- package/dist/src/utils/renderer-helpers.d.ts.map +1 -0
- package/dist/src/utils/schemas.d.ts +3 -0
- package/dist/src/utils/schemas.d.ts.map +1 -0
- package/dist/src/utils/transaction-helpers.d.ts +18 -0
- package/dist/src/utils/transaction-helpers.d.ts.map +1 -0
- package/dist/src/utils/updates.d.ts +19 -25
- package/dist/src/utils/updates.d.ts.map +1 -1
- package/dist/src/ytype.d.ts +144 -41
- package/dist/src/ytype.d.ts.map +1 -1
- package/global.d.ts +53 -0
- package/package.json +12 -16
- package/src/index.js +32 -124
- package/src/structs/AbstractStruct.js +21 -16
- package/src/structs/GC.js +15 -20
- package/src/structs/Item.js +992 -318
- package/src/structs/Skip.js +16 -19
- package/src/utils/BlockSet.js +20 -20
- package/src/utils/Doc.js +18 -29
- package/src/utils/ID.js +0 -2
- package/src/utils/RelativePosition.js +15 -25
- package/src/utils/{AttributionManager.js → Renderer.js} +42 -197
- package/src/utils/Snapshot.js +15 -37
- package/src/utils/StructStore.js +89 -227
- package/src/utils/Transaction.js +89 -321
- package/src/utils/UndoManager.js +157 -19
- package/src/utils/UpdateDecoder.js +2 -3
- package/src/utils/UpdateEncoder.js +0 -4
- package/src/utils/YEvent.js +20 -26
- package/src/utils/content-helper.js +0 -0
- package/src/utils/delta-helpers.js +21 -42
- package/src/utils/encoding-helpers.js +110 -0
- package/src/utils/encoding.js +197 -122
- package/src/utils/ids.js +1527 -0
- package/src/utils/isParentOf.js +2 -4
- package/src/utils/logging.js +0 -4
- package/src/utils/meta.js +57 -46
- package/src/utils/renderer-helpers.js +110 -0
- package/src/utils/schemas.js +3 -0
- package/src/utils/transaction-helpers.js +413 -0
- package/src/utils/updates.js +24 -146
- package/src/ytype.js +626 -255
- package/tests/testHelper.js +10 -12
- package/dist/src/internals.d.ts +0 -36
- package/dist/src/internals.d.ts.map +0 -1
- package/dist/src/structs/ContentAny.d.ts +0 -67
- package/dist/src/structs/ContentAny.d.ts.map +0 -1
- package/dist/src/structs/ContentBinary.d.ts +0 -64
- package/dist/src/structs/ContentBinary.d.ts.map +0 -1
- package/dist/src/structs/ContentDeleted.d.ts +0 -64
- package/dist/src/structs/ContentDeleted.d.ts.map +0 -1
- package/dist/src/structs/ContentDoc.d.ts +0 -72
- package/dist/src/structs/ContentDoc.d.ts.map +0 -1
- package/dist/src/structs/ContentEmbed.d.ts +0 -67
- package/dist/src/structs/ContentEmbed.d.ts.map +0 -1
- package/dist/src/structs/ContentFormat.d.ts +0 -69
- package/dist/src/structs/ContentFormat.d.ts.map +0 -1
- package/dist/src/structs/ContentJSON.d.ts +0 -70
- package/dist/src/structs/ContentJSON.d.ts.map +0 -1
- package/dist/src/structs/ContentString.d.ts +0 -70
- package/dist/src/structs/ContentString.d.ts.map +0 -1
- package/dist/src/structs/ContentType.d.ts +0 -77
- package/dist/src/structs/ContentType.d.ts.map +0 -1
- package/dist/src/utils/AttributionManager.d.ts +0 -238
- package/dist/src/utils/AttributionManager.d.ts.map +0 -1
- package/dist/src/utils/IdMap.d.ts +0 -164
- package/dist/src/utils/IdMap.d.ts.map +0 -1
- package/dist/src/utils/IdSet.d.ts +0 -163
- package/dist/src/utils/IdSet.d.ts.map +0 -1
- package/dist/tests/IdMap.tests.d.ts +0 -9
- package/dist/tests/IdMap.tests.d.ts.map +0 -1
- package/dist/tests/IdSet.tests.d.ts +0 -9
- package/dist/tests/IdSet.tests.d.ts.map +0 -1
- package/dist/tests/attribution.tests.d.ts +0 -9
- package/dist/tests/attribution.tests.d.ts.map +0 -1
- package/dist/tests/compatibility.tests.d.ts +0 -5
- package/dist/tests/compatibility.tests.d.ts.map +0 -1
- package/dist/tests/delta.tests.d.ts +0 -7
- package/dist/tests/delta.tests.d.ts.map +0 -1
- package/dist/tests/doc.tests.d.ts +0 -13
- package/dist/tests/doc.tests.d.ts.map +0 -1
- package/dist/tests/encoding.tests.d.ts +0 -5
- package/dist/tests/encoding.tests.d.ts.map +0 -1
- package/dist/tests/index.d.ts +0 -2
- package/dist/tests/index.d.ts.map +0 -1
- package/dist/tests/relativePositions.tests.d.ts +0 -11
- package/dist/tests/relativePositions.tests.d.ts.map +0 -1
- package/dist/tests/snapshot.tests.d.ts +0 -14
- package/dist/tests/snapshot.tests.d.ts.map +0 -1
- package/dist/tests/testHelper.d.ts +0 -171
- package/dist/tests/testHelper.d.ts.map +0 -1
- package/dist/tests/undo-redo.tests.d.ts +0 -27
- package/dist/tests/undo-redo.tests.d.ts.map +0 -1
- package/dist/tests/updates.tests.d.ts +0 -26
- package/dist/tests/updates.tests.d.ts.map +0 -1
- package/dist/tests/y-array.tests.d.ts +0 -43
- package/dist/tests/y-array.tests.d.ts.map +0 -1
- package/dist/tests/y-map.tests.d.ts +0 -42
- package/dist/tests/y-map.tests.d.ts.map +0 -1
- package/dist/tests/y-text.tests.d.ts +0 -49
- package/dist/tests/y-text.tests.d.ts.map +0 -1
- package/dist/tests/y-xml.tests.d.ts +0 -14
- package/dist/tests/y-xml.tests.d.ts.map +0 -1
- package/src/internals.js +0 -35
- package/src/structs/ContentAny.js +0 -115
- package/src/structs/ContentBinary.js +0 -93
- package/src/structs/ContentDeleted.js +0 -101
- package/src/structs/ContentDoc.js +0 -141
- package/src/structs/ContentEmbed.js +0 -98
- package/src/structs/ContentFormat.js +0 -105
- package/src/structs/ContentJSON.js +0 -119
- package/src/structs/ContentString.js +0 -113
- package/src/structs/ContentType.js +0 -152
- package/src/utils/IdMap.js +0 -673
- package/src/utils/IdSet.js +0 -825
package/README.md
CHANGED
|
@@ -50,7 +50,6 @@ Showcase](https://yjs-diagram.synergy.codes/).
|
|
|
50
50
|
|
|
51
51
|
* [AFFiNE](https://affine.pro/) A local-first, privacy-first, open source
|
|
52
52
|
knowledge base. :star2:
|
|
53
|
-
* [Huly](https://huly.io/) - Open Source All-in-One Project Management Platform :star2:
|
|
54
53
|
* [Cargo](https://cargo.site/) Site builder for designers and artists :star2:
|
|
55
54
|
* [Gitbook](https://gitbook.com) Knowledge management for technical teams :star2:
|
|
56
55
|
* [Evernote](https://evernote.com) Note-taking app :star2:
|
|
@@ -62,6 +61,7 @@ Showcase](https://yjs-diagram.synergy.codes/).
|
|
|
62
61
|
* [Dynaboard](https://dynaboard.com/) Build web apps collaboratively. :star:
|
|
63
62
|
* [Relm](https://www.relm.us/) A collaborative gameworld for teamwork and
|
|
64
63
|
community. :star:
|
|
64
|
+
* [Huly](https://huly.io/) - Open Source All-in-One Project Management Platform
|
|
65
65
|
* [Room.sh](https://room.sh/) A meeting application with integrated
|
|
66
66
|
collaborative drawing, editing, and coding tools. :star:
|
|
67
67
|
* [Nimbus Note](https://nimbusweb.me/note.php) A note-taking app designed by
|
|
@@ -131,6 +131,8 @@ editing for your IDE or custom editor
|
|
|
131
131
|
* [ProtonMail | Proton Docs](https://proton.me/drive/docs) - E2E encrypted
|
|
132
132
|
collaborative documents in Proton Drive.
|
|
133
133
|
* [Theneo](https://www.theneo.io/) - AI-powered API docs with live team collaboration.
|
|
134
|
+
* [ToolJet](https://tooljet.com/) - Build full-stack enterprise internal apps in
|
|
135
|
+
minutes.
|
|
134
136
|
|
|
135
137
|
## Table of Contents
|
|
136
138
|
|
|
@@ -157,8 +159,8 @@ are implemented in separate modules.
|
|
|
157
159
|
|
|
158
160
|
### Bindings
|
|
159
161
|
|
|
160
|
-
| Name | Cursors | Binding |
|
|
161
|
-
|
|
162
|
+
| Name | Cursors | Binding | Demo |
|
|
163
|
+
| --- | :-: | --- | --- |
|
|
162
164
|
| [ProseMirror](https://prosemirror.net/) | ✔ | [y-prosemirror](https://github.com/yjs/y-prosemirror) | [demo](https://demos.yjs.dev/prosemirror/prosemirror.html) |
|
|
163
165
|
| [Quill](https://quilljs.com/) | ✔ | [y-quill](https://github.com/yjs/y-quill) | [demo](https://demos.yjs.dev/quill/quill.html) |
|
|
164
166
|
| [CodeMirror](https://codemirror.net/) | ✔ | [y-codemirror](https://github.com/yjs/y-codemirror) | [demo](https://demos.yjs.dev/codemirror/codemirror.html) |
|
|
@@ -171,12 +173,13 @@ are implemented in separate modules.
|
|
|
171
173
|
| [Tiptap](https://tiptap.dev/) | ✔ | [y-prosemirror](https://github.com/yjs/y-prosemirror) | [demo](https://template.tiptap.dev/preview/templates/simple) |
|
|
172
174
|
| [Milkdown](https://github.com/Milkdown/milkdown) | ✔ | [y-prosemirror](https://github.com/yjs/y-prosemirror) | [demo](https://milkdown.dev/playground) |
|
|
173
175
|
| [Superdoc](https://superdoc.dev/) | ✔ | (native) | [demo](https://superdoc.dev/) |
|
|
174
|
-
| [valtio](https://github.com/pmndrs/valtio) |
|
|
175
|
-
| [immer](https://github.com/immerjs/immer) |
|
|
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
|
+
| [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) |
|
|
176
179
|
| React | | [react-yjs](https://github.com/nikgraf/react-yjs) | [demo](https://react-yjs-example.vercel.app/) |
|
|
177
180
|
| React / Vue / Svelte / MobX | | [SyncedStore](https://syncedstore.org) | [demo](https://syncedstore.org/docs/react) |
|
|
178
|
-
| [mobx-keystone](https://mobx-keystone.js.org/) |
|
|
179
|
-
| [PSPDFKit](https://www.nutrient.io/) |
|
|
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) |
|
|
182
|
+
| [PSPDFKit](https://www.nutrient.io/) | | [yjs-pspdfkit](https://github.com/hoangqwe159/yjs-pspdfkit) | [demo](https://github.com/hoangqwe159/yjs-pspdfkit) |
|
|
180
183
|
| [Rows n'Columns](https://www.rowsncolumns.app/) | ✔ | [@rowsncolumns/y-spreadsheet](https://docs.rowsncolumns.app/collaboration/yjs-collaboration) | |
|
|
181
184
|
|
|
182
185
|
### Utilities
|
|
@@ -190,7 +193,7 @@ Library with <code>YMultiDocUndoManager</code> (undo/redo across Yjs docs) and
|
|
|
190
193
|
<code>YKeyValue</code> (optimized key-value store).
|
|
191
194
|
</dd>
|
|
192
195
|
<dt>
|
|
193
|
-
<a href="https://github.com/Tulip-Writer/yjs-orderedtree">
|
|
196
|
+
<a href="https://github.com/Tulip-Writer/yjs-orderedtree">yjs-orderedtree</a> 🌳
|
|
194
197
|
</dt>
|
|
195
198
|
<dd>
|
|
196
199
|
Class for ordered trees via Y.Map. Handles <code>insert</code>,
|
|
@@ -304,6 +307,13 @@ Encryption (E2EE).
|
|
|
304
307
|
<dd>
|
|
305
308
|
An ActionCable companion for Yjs clients. There is a fitting
|
|
306
309
|
<a href="https://github.com/y-crdt/yrb-redis">redis extension</a> as well.
|
|
310
|
+
</dd>
|
|
311
|
+
<dt><a href="https://github.com/uwx/y-atproto">y-atproto</a></dt>
|
|
312
|
+
<dd>
|
|
313
|
+
A Yjs provider that syncs documents over the
|
|
314
|
+
<a href="https://atproto.com/">AT Protocol</a> (the decentralized protocol
|
|
315
|
+
behind Bluesky). Documents are stored as ATProto records and real-time updates
|
|
316
|
+
are delivered via <a href="https://github.com/bluesky-social/jetstream">Jetstream</a>.
|
|
307
317
|
</dd>
|
|
308
318
|
<dt><a href="https://github.com/y-crdt/ypy-websocket">ypy-websocket</a></dt>
|
|
309
319
|
<dd>
|
|
@@ -391,13 +401,18 @@ There are several Yjs-compatible ports to other programming languages.
|
|
|
391
401
|
* [y-crdt](https://github.com/y-crdt/y-crdt) - Rust implementation with multiple
|
|
392
402
|
language bindings to other languages
|
|
393
403
|
* [yrs](https://github.com/y-crdt/y-crdt/tree/main/yrs) - Rust interface
|
|
394
|
-
* [
|
|
404
|
+
* [pycrdt](https://github.com/y-crdt/pycrdt) - Python binding
|
|
395
405
|
* [yrb](https://github.com/y-crdt/yrb) - Ruby binding
|
|
406
|
+
* [yr](https://github.com/y-crdt/yr) - R binding
|
|
407
|
+
* [ydotnet](https://github.com/y-crdt/ydotnet) - .NET/C# binding
|
|
396
408
|
* [yswift](https://github.com/y-crdt/yswift) - Swift binding
|
|
409
|
+
* [ykt](https://github.com/y-crdt/ykt) - Kotlin binding
|
|
397
410
|
* [yffi](https://github.com/y-crdt/y-crdt/tree/main/yffi) - C-FFI
|
|
398
411
|
* [ywasm](https://github.com/y-crdt/y-crdt/tree/main/ywasm) - WASM binding
|
|
399
|
-
* [y_ex](https://github.com/satoren/y_ex) - Elixir
|
|
412
|
+
* [y_ex](https://github.com/satoren/y_ex) - Elixir binding
|
|
413
|
+
* [ypy](https://github.com/y-crdt/ypy) - Python binding (deprecated, use pycrdt)
|
|
400
414
|
* [ycs](https://github.com/yjs/ycs) - .Net compatible C# implementation.
|
|
415
|
+
* [ygo](https://github.com/reearth/ygo) - Go implementation.
|
|
401
416
|
|
|
402
417
|
## Getting Started
|
|
403
418
|
|
|
@@ -559,7 +574,8 @@ to JSON using their <code>toJSON</code> method.
|
|
|
559
574
|
</dd>
|
|
560
575
|
<b><code>[Symbol.Iterator]</code></b>
|
|
561
576
|
<dd>
|
|
562
|
-
Returns an YArray Iterator that contains the values for each index in
|
|
577
|
+
Returns an YArray Iterator that contains the values for each index in
|
|
578
|
+
the array.
|
|
563
579
|
<pre>for (let value of yarray) { .. }</pre>
|
|
564
580
|
</dd>
|
|
565
581
|
<b><code>observe(function(YArrayEvent, Transaction):void)</code></b>
|
|
@@ -1189,8 +1205,16 @@ ytext.toString() // => 'abc'
|
|
|
1189
1205
|
|
|
1190
1206
|
<dl>
|
|
1191
1207
|
<b><code>constructor(scope:Y.AbstractType|Array<Y.AbstractType>
|
|
1192
|
-
[, {captureTimeout:number,trackedOrigins:Set<any>,deleteFilter:function(item):boolean}])</code></b>
|
|
1208
|
+
[, {captureTimeout:number,trackedOrigins:Set<any>,deleteFilter:function(item):boolean,ignoreRemoteAttributeChanges:boolean}])</code></b>
|
|
1193
1209
|
<dd>Accepts either single type as scope or an array of types.</dd>
|
|
1210
|
+
<b><code>ignoreRemoteAttributeChanges:boolean</code></b>
|
|
1211
|
+
<dd>
|
|
1212
|
+
By default, the UndoManager will never overwrite remote changes. In some cases
|
|
1213
|
+
this is not the expected behavior. When set to <code>true</code>, undo/redo may
|
|
1214
|
+
overwrite remote attribute changes (e.g. on <code>Y.Map</code> keys or
|
|
1215
|
+
<code>Y.XmlElement</code> / <code>Y.XmlText</code> attributes). Defaults to
|
|
1216
|
+
<code>false</code>. <em>(previously named <code>ignoreRemoteMapChanges</code>)</em>
|
|
1217
|
+
</dd>
|
|
1194
1218
|
<b><code>undo()</code></b>
|
|
1195
1219
|
<dd></dd>
|
|
1196
1220
|
<b><code>redo()</code></b>
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
export { Doc } from "./utils/Doc.js";
|
|
2
|
+
export { isParentOf } from "./utils/isParentOf.js";
|
|
3
|
+
export { logType } from "./utils/logging.js";
|
|
4
|
+
export { diffDocsToDelta } from "./utils/delta-helpers.js";
|
|
5
|
+
export { AbstractStruct } from "./structs/AbstractStruct.js";
|
|
6
|
+
export { GC } from "./structs/GC.js";
|
|
7
|
+
export { Skip } from "./structs/Skip.js";
|
|
1
8
|
export * from "./utils/meta.js";
|
|
2
|
-
export
|
|
9
|
+
export type ContentIds = import("./utils/ids.js").ContentIds;
|
|
10
|
+
export type ContentMap = import("./utils/ids.js").ContentMap;
|
|
11
|
+
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";
|
|
12
|
+
export { UpdateDecoderV1, UpdateDecoderV2 } from "./utils/UpdateDecoder.js";
|
|
13
|
+
export { UpdateEncoderV1, UpdateEncoderV2 } from "./utils/UpdateEncoder.js";
|
|
14
|
+
export { applyUpdate, applyUpdateV2, readUpdate, readUpdateV2, encodeStateAsUpdate, encodeStateAsUpdateV2, encodeStateVector, decodeStateVector, diffUpdate, diffUpdateV2, mergeUpdates, mergeUpdatesV2, createDocFromUpdate, createDocFromUpdateV2, cloneDoc } from "./utils/encoding.js";
|
|
15
|
+
export { ID, createID, compareIDs, findRootTypeKey } from "./utils/ID.js";
|
|
16
|
+
export { createRelativePositionFromTypeIndex, createRelativePositionFromJSON, createAbsolutePositionFromRelativePosition, compareRelativePositions, AbsolutePosition, RelativePosition, relativePositionToJSON, encodeRelativePosition, decodeRelativePosition } from "./utils/RelativePosition.js";
|
|
17
|
+
export { Snapshot, createSnapshot, snapshot, emptySnapshot, createDocFromSnapshot, decodeSnapshot, encodeSnapshot, decodeSnapshotV2, encodeSnapshotV2, equalSnapshots, snapshotContainsUpdate } from "./utils/Snapshot.js";
|
|
18
|
+
export { findIndexSS, getItemCleanStart, getItemCleanEnd, tryGc } from "./utils/transaction-helpers.js";
|
|
19
|
+
export { Transaction, transact, cleanupYTextFormatting } from "./utils/Transaction.js";
|
|
20
|
+
export { UndoManager, undoContentIds } from "./utils/UndoManager.js";
|
|
21
|
+
export { logUpdate, logUpdateV2, decodeUpdate, decodeUpdateV2, encodeStateVectorFromUpdate, encodeStateVectorFromUpdateV2, convertUpdateFormatV1ToV2, convertUpdateFormatV2ToV1, obfuscateUpdate, obfuscateUpdateV2, createContentIdsFromUpdate, createContentIdsFromUpdateV2, intersectUpdateWithContentIds, intersectUpdateWithContentIdsV2 } from "./utils/updates.js";
|
|
22
|
+
export { YEvent, getPathTo } from "./utils/YEvent.js";
|
|
23
|
+
export { TwosetRenderer, baseRenderer, AbstractRenderer, createDiffRenderer, DiffRenderer, createSnapshotRenderer, SnapshotRenderer, Attributions, $renderer } from "./utils/Renderer.js";
|
|
24
|
+
export { YType as Type, getTypeChildren, typeMapGetSnapshot, typeMapGetAllSnapshot, $ytype, $ytypeAny } from "./ytype.js";
|
|
25
|
+
export { Item, ContentBinary, ContentDeleted, ContentDoc, ContentEmbed, ContentFormat, ContentJSON, ContentAny, ContentString, ContentType } from "./structs/Item.js";
|
|
3
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;yBA+Ba,OAAO,gBAAgB,EAAE,UAAU;yBAGnC,OAAO,gBAAgB,EAAE,UAAU"}
|
|
@@ -4,7 +4,7 @@ export class AbstractStruct {
|
|
|
4
4
|
* @param {number} length
|
|
5
5
|
*/
|
|
6
6
|
constructor(id: ID, length: number);
|
|
7
|
-
id: ID;
|
|
7
|
+
id: import("../index.js").ID;
|
|
8
8
|
length: number;
|
|
9
9
|
/**
|
|
10
10
|
* @type {boolean}
|
|
@@ -14,29 +14,26 @@ export class AbstractStruct {
|
|
|
14
14
|
* Merge this struct with the item to the right.
|
|
15
15
|
* This method is already assuming that `this.id.clock + this.length === this.id.clock`.
|
|
16
16
|
* Also this method does *not* remove right from StructStore!
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {GC|Item|Skip} _right
|
|
18
18
|
* @return {boolean} whether this merged with right
|
|
19
19
|
*/
|
|
20
|
-
mergeWith(
|
|
20
|
+
mergeWith(_right: GC | Item | Skip): boolean;
|
|
21
21
|
/**
|
|
22
|
-
* @param {UpdateEncoderV1 | UpdateEncoderV2}
|
|
23
|
-
* @param {number}
|
|
24
|
-
* @param {number}
|
|
22
|
+
* @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder The encoder to write data to.
|
|
23
|
+
* @param {number} _offset
|
|
24
|
+
* @param {number} _encodingRef
|
|
25
25
|
*/
|
|
26
|
-
write(
|
|
26
|
+
write(_encoder: UpdateEncoderV1 | UpdateEncoderV2, _offset: number, _encodingRef: number): void;
|
|
27
27
|
/**
|
|
28
|
-
* @param {Transaction}
|
|
29
|
-
* @param {number}
|
|
28
|
+
* @param {Transaction} _transaction
|
|
29
|
+
* @param {number} _offset
|
|
30
30
|
*/
|
|
31
|
-
integrate(
|
|
31
|
+
integrate(_transaction: Transaction, _offset: number): void;
|
|
32
32
|
/**
|
|
33
|
-
* @param {number}
|
|
34
|
-
* @return {
|
|
33
|
+
* @param {number} _diff
|
|
34
|
+
* @return {GC|Item|Skip}
|
|
35
35
|
*/
|
|
36
|
-
splice(
|
|
36
|
+
splice(_diff: number): GC | Item | Skip;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
import { UpdateEncoderV1 } from '../internals.js';
|
|
40
|
-
import { UpdateEncoderV2 } from '../internals.js';
|
|
41
|
-
import { Transaction } from '../internals.js';
|
|
38
|
+
export function addStructToIdSet(idSet: IdSet, struct: AbstractStruct): void;
|
|
42
39
|
//# sourceMappingURL=AbstractStruct.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractStruct.d.ts","sourceRoot":"","sources":["../../../src/structs/AbstractStruct.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AbstractStruct.d.ts","sourceRoot":"","sources":["../../../src/structs/AbstractStruct.js"],"names":[],"mappings":"AAEA;IACE;;;OAGG;IACH,gBAHW,EAAE,UACF,MAAM,EAKhB;IAFC,6BAAY;IACZ,eAAoB;IAGtB;;OAEG;IACH,eAFU,OAAO,CAIhB;IAED;;;;;;OAMG;IACH,kBAHW,EAAE,GAAC,IAAI,GAAC,IAAI,GACX,OAAO,CAIlB;IAED;;;;OAIG;IACH,gBAJW,eAAe,GAAG,eAAe,WACjC,MAAM,gBACN,MAAM,QAIhB;IAED;;;OAGG;IACH,wBAHW,WAAW,WACX,MAAM,QAIhB;IAED;;;OAGG;IACH,cAHW,MAAM,GACL,EAAE,GAAC,IAAI,GAAC,IAAI,CAIvB;CACF;AASM,wCANI,KAAK,UACL,cAAc,QAKqF"}
|
package/dist/src/structs/GC.d.ts
CHANGED
|
@@ -4,17 +4,6 @@ export const structGCRefNumber: 0;
|
|
|
4
4
|
*/
|
|
5
5
|
export class GC extends AbstractStruct {
|
|
6
6
|
delete(): void;
|
|
7
|
-
/**
|
|
8
|
-
* @param {GC} right
|
|
9
|
-
* @return {boolean}
|
|
10
|
-
*/
|
|
11
|
-
mergeWith(right: GC): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* @param {Transaction} _transaction
|
|
14
|
-
* @param {StructStore} _store
|
|
15
|
-
* @return {null | number}
|
|
16
|
-
*/
|
|
17
|
-
getMissing(_transaction: Transaction, _store: StructStore): null | number;
|
|
18
7
|
/**
|
|
19
8
|
* gc structs can't be spliced.
|
|
20
9
|
*
|
|
@@ -24,8 +13,14 @@ export class GC extends AbstractStruct {
|
|
|
24
13
|
* @param {number} diff
|
|
25
14
|
*/
|
|
26
15
|
splice(diff: number): GC;
|
|
16
|
+
/**
|
|
17
|
+
* @type {0}
|
|
18
|
+
*/
|
|
19
|
+
ref: 0;
|
|
20
|
+
/**
|
|
21
|
+
* @type {false}
|
|
22
|
+
*/
|
|
23
|
+
isItem: false;
|
|
27
24
|
}
|
|
28
|
-
import { AbstractStruct } from '
|
|
29
|
-
import { Transaction } from '../internals.js';
|
|
30
|
-
import { StructStore } from '../internals.js';
|
|
25
|
+
import { AbstractStruct } from './AbstractStruct.js';
|
|
31
26
|
//# sourceMappingURL=GC.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GC.d.ts","sourceRoot":"","sources":["../../../src/structs/GC.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GC.d.ts","sourceRoot":"","sources":["../../../src/structs/GC.js"],"names":[],"mappings":"AAGA,gCAAiC,CAAC,CAAA;AAElC;;GAEG;AACH;IAKE,eAAY;IAsCZ;;;;;;;OAOG;IACH,aAFW,MAAM,MAMhB;IAGH;;OAEG;IACH,KAFU,CAAC,CAEK;IAEhB;;OAEG;IACH,QAFU,KAAK,CAEI;CAVlB;+BAhEgD,qBAAqB"}
|