@y/y 14.0.0-16
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/LICENSE +23 -0
- package/README.md +1406 -0
- package/dist/Skip-j0kX7pdq.js +12173 -0
- package/dist/Skip-j0kX7pdq.js.map +1 -0
- package/dist/Skip-wRT7BKFP.js +11877 -0
- package/dist/Skip-wRT7BKFP.js.map +1 -0
- package/dist/index-DyTeTfmj.js +163 -0
- package/dist/index-DyTeTfmj.js.map +1 -0
- package/dist/index-R7GxO-36.js +165 -0
- package/dist/index-R7GxO-36.js.map +1 -0
- package/dist/internals.cjs +286 -0
- package/dist/internals.cjs.map +1 -0
- package/dist/internals.mjs +25 -0
- package/dist/internals.mjs.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/internals.d.ts +43 -0
- package/dist/src/internals.d.ts.map +1 -0
- package/dist/src/structs/AbstractStruct.d.ts +42 -0
- package/dist/src/structs/AbstractStruct.d.ts.map +1 -0
- package/dist/src/structs/ContentAny.d.ts +67 -0
- package/dist/src/structs/ContentAny.d.ts.map +1 -0
- package/dist/src/structs/ContentBinary.d.ts +64 -0
- package/dist/src/structs/ContentBinary.d.ts.map +1 -0
- package/dist/src/structs/ContentDeleted.d.ts +64 -0
- package/dist/src/structs/ContentDeleted.d.ts.map +1 -0
- package/dist/src/structs/ContentDoc.d.ts +72 -0
- package/dist/src/structs/ContentDoc.d.ts.map +1 -0
- package/dist/src/structs/ContentEmbed.d.ts +67 -0
- package/dist/src/structs/ContentEmbed.d.ts.map +1 -0
- package/dist/src/structs/ContentFormat.d.ts +69 -0
- package/dist/src/structs/ContentFormat.d.ts.map +1 -0
- package/dist/src/structs/ContentJSON.d.ts +70 -0
- package/dist/src/structs/ContentJSON.d.ts.map +1 -0
- package/dist/src/structs/ContentString.d.ts +70 -0
- package/dist/src/structs/ContentString.d.ts.map +1 -0
- package/dist/src/structs/ContentType.d.ts +83 -0
- package/dist/src/structs/ContentType.d.ts.map +1 -0
- package/dist/src/structs/GC.d.ts +31 -0
- package/dist/src/structs/GC.d.ts.map +1 -0
- package/dist/src/structs/Item.d.ts +212 -0
- package/dist/src/structs/Item.d.ts.map +1 -0
- package/dist/src/structs/Skip.d.ts +33 -0
- package/dist/src/structs/Skip.d.ts.map +1 -0
- package/dist/src/types/AbstractType.d.ts +239 -0
- package/dist/src/types/AbstractType.d.ts.map +1 -0
- package/dist/src/types/YArray.d.ts +128 -0
- package/dist/src/types/YArray.d.ts.map +1 -0
- package/dist/src/types/YMap.d.ts +112 -0
- package/dist/src/types/YMap.d.ts.map +1 -0
- package/dist/src/types/YText.d.ts +216 -0
- package/dist/src/types/YText.d.ts.map +1 -0
- package/dist/src/types/YXmlElement.d.ts +106 -0
- package/dist/src/types/YXmlElement.d.ts.map +1 -0
- package/dist/src/types/YXmlFragment.d.ts +143 -0
- package/dist/src/types/YXmlFragment.d.ts.map +1 -0
- package/dist/src/types/YXmlHook.d.ts +32 -0
- package/dist/src/types/YXmlHook.d.ts.map +1 -0
- package/dist/src/types/YXmlText.d.ts +34 -0
- package/dist/src/types/YXmlText.d.ts.map +1 -0
- package/dist/src/utils/AbstractConnector.d.ts +20 -0
- package/dist/src/utils/AbstractConnector.d.ts.map +1 -0
- package/dist/src/utils/AttributionManager.d.ts +224 -0
- package/dist/src/utils/AttributionManager.d.ts.map +1 -0
- package/dist/src/utils/Doc.d.ts +267 -0
- package/dist/src/utils/Doc.d.ts.map +1 -0
- package/dist/src/utils/EventHandler.d.ts +19 -0
- package/dist/src/utils/EventHandler.d.ts.map +1 -0
- package/dist/src/utils/ID.d.ts +26 -0
- package/dist/src/utils/ID.d.ts.map +1 -0
- package/dist/src/utils/IdMap.d.ts +161 -0
- package/dist/src/utils/IdMap.d.ts.map +1 -0
- package/dist/src/utils/IdSet.d.ts +163 -0
- package/dist/src/utils/IdSet.d.ts.map +1 -0
- package/dist/src/utils/RelativePosition.d.ts +91 -0
- package/dist/src/utils/RelativePosition.d.ts.map +1 -0
- package/dist/src/utils/Snapshot.d.ts +40 -0
- package/dist/src/utils/Snapshot.d.ts.map +1 -0
- package/dist/src/utils/StructSet.d.ts +27 -0
- package/dist/src/utils/StructSet.d.ts.map +1 -0
- package/dist/src/utils/StructStore.d.ts +41 -0
- package/dist/src/utils/StructStore.d.ts.map +1 -0
- package/dist/src/utils/Transaction.d.ts +136 -0
- package/dist/src/utils/Transaction.d.ts.map +1 -0
- package/dist/src/utils/UndoManager.d.ts +188 -0
- package/dist/src/utils/UndoManager.d.ts.map +1 -0
- package/dist/src/utils/UpdateDecoder.d.ts +167 -0
- package/dist/src/utils/UpdateDecoder.d.ts.map +1 -0
- package/dist/src/utils/UpdateEncoder.d.ts +164 -0
- package/dist/src/utils/UpdateEncoder.d.ts.map +1 -0
- package/dist/src/utils/YEvent.d.ts +120 -0
- package/dist/src/utils/YEvent.d.ts.map +1 -0
- package/dist/src/utils/delta-helpers.d.ts +6 -0
- package/dist/src/utils/delta-helpers.d.ts.map +1 -0
- package/dist/src/utils/encoding.d.ts +30 -0
- package/dist/src/utils/encoding.d.ts.map +1 -0
- package/dist/src/utils/isParentOf.d.ts +3 -0
- package/dist/src/utils/isParentOf.d.ts.map +1 -0
- package/dist/src/utils/logging.d.ts +3 -0
- package/dist/src/utils/logging.d.ts.map +1 -0
- package/dist/src/utils/types.d.ts +7 -0
- package/dist/src/utils/types.d.ts.map +1 -0
- package/dist/src/utils/updates.d.ts +89 -0
- package/dist/src/utils/updates.d.ts.map +1 -0
- package/dist/testHelper.cjs +780 -0
- package/dist/testHelper.cjs.map +1 -0
- package/dist/testHelper.mjs +617 -0
- package/dist/testHelper.mjs.map +1 -0
- package/dist/tests/IdMap.tests.d.ts +9 -0
- package/dist/tests/IdMap.tests.d.ts.map +1 -0
- package/dist/tests/IdSet.tests.d.ts +9 -0
- package/dist/tests/IdSet.tests.d.ts.map +1 -0
- package/dist/tests/attribution.tests.d.ts +8 -0
- package/dist/tests/attribution.tests.d.ts.map +1 -0
- package/dist/tests/compatibility.tests.d.ts +5 -0
- package/dist/tests/compatibility.tests.d.ts.map +1 -0
- package/dist/tests/delta.tests.d.ts +7 -0
- package/dist/tests/delta.tests.d.ts.map +1 -0
- package/dist/tests/doc.tests.d.ts +13 -0
- package/dist/tests/doc.tests.d.ts.map +1 -0
- package/dist/tests/encoding.tests.d.ts +5 -0
- package/dist/tests/encoding.tests.d.ts.map +1 -0
- package/dist/tests/index.d.ts +2 -0
- package/dist/tests/index.d.ts.map +1 -0
- package/dist/tests/relativePositions.tests.d.ts +11 -0
- package/dist/tests/relativePositions.tests.d.ts.map +1 -0
- package/dist/tests/snapshot.tests.d.ts +13 -0
- package/dist/tests/snapshot.tests.d.ts.map +1 -0
- package/dist/tests/testHelper.d.ts +167 -0
- package/dist/tests/testHelper.d.ts.map +1 -0
- package/dist/tests/undo-redo.tests.d.ts +27 -0
- package/dist/tests/undo-redo.tests.d.ts.map +1 -0
- package/dist/tests/updates.tests.d.ts +24 -0
- package/dist/tests/updates.tests.d.ts.map +1 -0
- package/dist/tests/y-array.tests.d.ts +45 -0
- package/dist/tests/y-array.tests.d.ts.map +1 -0
- package/dist/tests/y-map.tests.d.ts +45 -0
- package/dist/tests/y-map.tests.d.ts.map +1 -0
- package/dist/tests/y-text.tests.d.ts +49 -0
- package/dist/tests/y-text.tests.d.ts.map +1 -0
- package/dist/tests/y-xml.tests.d.ts +15 -0
- package/dist/tests/y-xml.tests.d.ts.map +1 -0
- package/dist/yjs.cjs +151 -0
- package/dist/yjs.cjs.map +1 -0
- package/dist/yjs.mjs +26 -0
- package/dist/yjs.mjs.map +1 -0
- package/package.json +101 -0
- package/src/index.js +153 -0
- package/src/internals.js +44 -0
- package/src/structs/AbstractStruct.js +59 -0
- package/src/structs/ContentAny.js +115 -0
- package/src/structs/ContentBinary.js +93 -0
- package/src/structs/ContentDeleted.js +101 -0
- package/src/structs/ContentDoc.js +141 -0
- package/src/structs/ContentEmbed.js +98 -0
- package/src/structs/ContentFormat.js +105 -0
- package/src/structs/ContentJSON.js +119 -0
- package/src/structs/ContentString.js +113 -0
- package/src/structs/ContentType.js +176 -0
- package/src/structs/GC.js +80 -0
- package/src/structs/Item.js +845 -0
- package/src/structs/Skip.js +75 -0
- package/src/types/AbstractType.js +1434 -0
- package/src/types/YArray.js +270 -0
- package/src/types/YMap.js +244 -0
- package/src/types/YText.js +934 -0
- package/src/types/YXmlElement.js +227 -0
- package/src/types/YXmlFragment.js +266 -0
- package/src/types/YXmlHook.js +68 -0
- package/src/types/YXmlText.js +66 -0
- package/src/utils/AbstractConnector.js +25 -0
- package/src/utils/AttributionManager.js +619 -0
- package/src/utils/Doc.js +372 -0
- package/src/utils/EventHandler.js +87 -0
- package/src/utils/ID.js +89 -0
- package/src/utils/IdMap.js +629 -0
- package/src/utils/IdSet.js +823 -0
- package/src/utils/RelativePosition.js +352 -0
- package/src/utils/Snapshot.js +220 -0
- package/src/utils/StructSet.js +137 -0
- package/src/utils/StructStore.js +289 -0
- package/src/utils/Transaction.js +489 -0
- package/src/utils/UndoManager.js +391 -0
- package/src/utils/UpdateDecoder.js +281 -0
- package/src/utils/UpdateEncoder.js +320 -0
- package/src/utils/YEvent.js +216 -0
- package/src/utils/delta-helpers.js +54 -0
- package/src/utils/encoding.js +623 -0
- package/src/utils/isParentOf.js +21 -0
- package/src/utils/logging.js +21 -0
- package/src/utils/types.js +28 -0
- package/src/utils/updates.js +715 -0
- package/tests/testHelper.js +600 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function testDeltaBug(_tc: t.TestCase): void;
|
|
2
|
+
export function testDeltaBug2(_tc: t.TestCase): void;
|
|
3
|
+
export function testDeltaAfterConcurrentFormatting(tc: t.TestCase): void;
|
|
4
|
+
export function testBasicInsertAndDelete(tc: t.TestCase): void;
|
|
5
|
+
export function testBasicFormat(tc: t.TestCase): void;
|
|
6
|
+
export function testFalsyFormats(tc: t.TestCase): void;
|
|
7
|
+
export function testMultilineFormat(_tc: t.TestCase): void;
|
|
8
|
+
export function testNotMergeEmptyLinesFormat(_tc: t.TestCase): void;
|
|
9
|
+
export function testPreserveAttributesThroughDelete(_tc: t.TestCase): void;
|
|
10
|
+
export function testGetDeltaWithEmbeds(tc: t.TestCase): void;
|
|
11
|
+
export function testTypesAsEmbed(tc: t.TestCase): void;
|
|
12
|
+
export function testSnapshot(tc: t.TestCase): void;
|
|
13
|
+
export function testSnapshotDeleteAfter(tc: t.TestCase): void;
|
|
14
|
+
export function testToJson(tc: t.TestCase): void;
|
|
15
|
+
export function testToDeltaEmbedAttributes(tc: t.TestCase): void;
|
|
16
|
+
export function testToDeltaEmbedNoAttributes(tc: t.TestCase): void;
|
|
17
|
+
export function testFormattingRemoved(tc: t.TestCase): void;
|
|
18
|
+
export function testFormattingRemovedInMidText(tc: t.TestCase): void;
|
|
19
|
+
export function testFormattingDeltaUnnecessaryAttributeChange(tc: t.TestCase): void;
|
|
20
|
+
export function testInsertAndDeleteAtRandomPositions(tc: t.TestCase): void;
|
|
21
|
+
export function testAppendChars(tc: t.TestCase): void;
|
|
22
|
+
export function testBestCase(_tc: t.TestCase): void;
|
|
23
|
+
export function testLargeFragmentedDocument(_tc: t.TestCase): void;
|
|
24
|
+
export function testIncrementalUpdatesPerformanceOnLargeFragmentedDocument(_tc: t.TestCase): void;
|
|
25
|
+
export function testSplitSurrogateCharacter(tc: t.TestCase): void;
|
|
26
|
+
export function testSearchMarkerBug1(tc: t.TestCase): void;
|
|
27
|
+
export function testFormattingBug(_tc: t.TestCase): Promise<void>;
|
|
28
|
+
export function testDeleteFormatting(_tc: t.TestCase): void;
|
|
29
|
+
export function testAttributedContent(_tc: t.TestCase): void;
|
|
30
|
+
export function testAttributedDiffing(_tc: t.TestCase): void;
|
|
31
|
+
export function testRepeatGenerateTextChanges5(tc: t.TestCase): void;
|
|
32
|
+
export function testRepeatGenerateTextChanges30(tc: t.TestCase): void;
|
|
33
|
+
export function testRepeatGenerateTextChanges40(tc: t.TestCase): void;
|
|
34
|
+
export function testRepeatGenerateTextChanges50(tc: t.TestCase): void;
|
|
35
|
+
export function testRepeatGenerateTextChanges70(tc: t.TestCase): void;
|
|
36
|
+
export function testRepeatGenerateTextChanges90(tc: t.TestCase): void;
|
|
37
|
+
export function testRepeatGenerateTextChanges300(tc: t.TestCase): void;
|
|
38
|
+
export function testAttributionManagerDefaultPerformance(tc: t.TestCase): void;
|
|
39
|
+
export function testRepeatGenerateQuillChanges1(tc: t.TestCase): void;
|
|
40
|
+
export function testRepeatGenerateQuillChanges2(tc: t.TestCase): void;
|
|
41
|
+
export function testRepeatGenerateQuillChanges2Repeat(tc: t.TestCase): void;
|
|
42
|
+
export function testRepeatGenerateQuillChanges3(tc: t.TestCase): void;
|
|
43
|
+
export function testRepeatGenerateQuillChanges30(tc: t.TestCase): void;
|
|
44
|
+
export function testRepeatGenerateQuillChanges40(tc: t.TestCase): void;
|
|
45
|
+
export function testRepeatGenerateQuillChanges70(tc: t.TestCase): void;
|
|
46
|
+
export function testRepeatGenerateQuillChanges100(tc: t.TestCase): void;
|
|
47
|
+
export function testRepeatGenerateQuillChanges300(tc: t.TestCase): void;
|
|
48
|
+
import * as t from 'lib0/testing';
|
|
49
|
+
//# sourceMappingURL=y-text.tests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"y-text.tests.d.ts","sourceRoot":"","sources":["../../tests/y-text.tests.js"],"names":[],"mappings":"AAeO,kCAFI,CAAC,CAAC,QAAQ,QAgSpB;AAMM,mCAFI,CAAC,CAAC,QAAQ,QAu5BpB;AASM,uDAFI,CAAC,CAAC,QAAQ,QAoBpB;AAKM,6CAFI,CAAC,CAAC,QAAQ,QAgCpB;AAKM,oCAFI,CAAC,CAAC,QAAQ,QAmCpB;AAKM,qCAFI,CAAC,CAAC,QAAQ,QAkBpB;AAKM,yCAFI,CAAC,CAAC,QAAQ,QAuBpB;AAKM,kDAFI,CAAC,CAAC,QAAQ,QAoBpB;AAKM,yDAFI,CAAC,CAAC,QAAQ,QAqBpB;AAKM,2CAFI,CAAC,CAAC,QAAQ,QAUpB;AAKM,qCAFI,CAAC,CAAC,QAAQ,QAoBpB;AAKM,iCAFI,CAAC,CAAC,QAAQ,QAiCpB;AAKM,4CAFI,CAAC,CAAC,QAAQ,QAgBpB;AAKM,+BAFI,CAAC,CAAC,QAAQ,QAMpB;AAKM,+CAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,iDAFI,CAAC,CAAC,QAAQ,QAgBpB;AAKM,0CAFI,CAAC,CAAC,QAAQ,QAQpB;AAKM,mDAFI,CAAC,CAAC,QAAQ,QAQpB;AAOM,kEAFI,CAAC,CAAC,QAAQ,QA4BpB;AAKM,yDAFI,CAAC,CAAC,QAAQ,QA2BpB;AAKM,oCAFI,CAAC,CAAC,QAAQ,QAWpB;AAUM,kCAFI,CAAC,CAAC,QAAQ,QA4BpB;AAaM,iDAFI,CAAC,CAAC,QAAQ,QA6BpB;AAKM,gFAFI,CAAC,CAAC,QAAQ,QAiCpB;AASM,gDAFI,CAAC,CAAC,QAAQ,QA2BpB;AAOM,yCAFI,CAAC,CAAC,QAAQ,QAiCpB;AAOM,uCAFI,CAAC,CAAC,QAAQ,iBAoBpB;AAOM,0CAFI,CAAC,CAAC,QAAQ,QAwBpB;AAKM,2CAFI,CAAC,CAAC,QAAQ,QA0BpB;AAKM,2CAFI,CAAC,CAAC,QAAQ,QA6BpB;AA0CM,mDAFI,CAAC,CAAC,QAAQ,QAMpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QAMpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QAMpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QAMpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QAMpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QAMpB;AAKM,qDAFI,CAAC,CAAC,QAAQ,QAMpB;AAuIM,6DAFI,CAAC,CAAC,QAAQ,QAgCpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QAMpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QAMpB;AAKM,0DAFI,CAAC,CAAC,QAAQ,QAQpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QAIpB;AAKM,qDAFI,CAAC,CAAC,QAAQ,QAIpB;AAKM,qDAFI,CAAC,CAAC,QAAQ,QAIpB;AAKM,qDAFI,CAAC,CAAC,QAAQ,QAIpB;AAKM,sDAFI,CAAC,CAAC,QAAQ,QAIpB;AAKM,sDAFI,CAAC,CAAC,QAAQ,QAIpB;mBAhvEkB,cAAc"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function testCustomTypings(): void;
|
|
2
|
+
export function testSetProperty(tc: t.TestCase): void;
|
|
3
|
+
export function testHasProperty(tc: t.TestCase): void;
|
|
4
|
+
export function testYtextAttributes(_tc: t.TestCase): void;
|
|
5
|
+
export function testSiblings(_tc: t.TestCase): void;
|
|
6
|
+
export function testInsertafter(_tc: t.TestCase): void;
|
|
7
|
+
export function testClone(_tc: t.TestCase): void;
|
|
8
|
+
export function testFormattingBug(_tc: t.TestCase): void;
|
|
9
|
+
export function testElement(_tc: t.TestCase): void;
|
|
10
|
+
export function testFragmentAttributedContent(_tc: t.TestCase): void;
|
|
11
|
+
export function testElementAttributedContent(_tc: t.TestCase): void;
|
|
12
|
+
export function testElementAttributedContentViaDiffer(_tc: t.TestCase): void;
|
|
13
|
+
export function testAttributionManagerSimpleExample(_tc: t.TestCase): void;
|
|
14
|
+
import * as t from 'lib0/testing';
|
|
15
|
+
//# sourceMappingURL=y-xml.tests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"y-xml.tests.d.ts","sourceRoot":"","sources":["../../tests/y-xml.tests.js"],"names":[],"mappings":"AAKO,0CAyBN;AAKM,oCAFI,CAAC,CAAC,QAAQ,QASpB;AAKM,oCAFI,CAAC,CAAC,QAAQ,QAcpB;AAKM,yCAFI,CAAC,CAAC,QAAQ,QAWpB;AAKM,kCAFI,CAAC,CAAC,QAAQ,QAapB;AAKM,qCAFI,CAAC,CAAC,QAAQ,QA2BpB;AAKM,+BAFI,CAAC,CAAC,QAAQ,QAcpB;AAKM,uCAFI,CAAC,CAAC,QAAQ,QAWpB;AAKM,iCAFI,CAAC,CAAC,QAAQ,QASpB;AAKM,mDAFI,CAAC,CAAC,QAAQ,QA0BpB;AAKM,kDAFI,CAAC,CAAC,QAAQ,QAgDpB;AAKM,2DAFI,CAAC,CAAC,QAAQ,QAiFpB;AAKM,yDAFI,CAAC,CAAC,QAAQ,QAuEpB;mBA9YkB,cAAc"}
|
package/dist/yjs.cjs
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Skip = require('./Skip-j0kX7pdq.js');
|
|
4
|
+
require('lib0/function');
|
|
5
|
+
require('lib0/decoding');
|
|
6
|
+
require('lib0/binary');
|
|
7
|
+
require('lib0/map');
|
|
8
|
+
require('./index-R7GxO-36.js');
|
|
9
|
+
require('lib0/observable');
|
|
10
|
+
require('lib0/array');
|
|
11
|
+
require('lib0/math');
|
|
12
|
+
require('lib0/encoding');
|
|
13
|
+
require('lib0/traits');
|
|
14
|
+
require('lib0/random');
|
|
15
|
+
require('lib0/promise');
|
|
16
|
+
require('lib0/buffer');
|
|
17
|
+
require('lib0/error');
|
|
18
|
+
require('lib0/set');
|
|
19
|
+
require('lib0/logging');
|
|
20
|
+
require('lib0/time');
|
|
21
|
+
require('lib0/string');
|
|
22
|
+
require('lib0/delta');
|
|
23
|
+
require('lib0/hash/rabin');
|
|
24
|
+
require('lib0/iterator');
|
|
25
|
+
require('lib0/object');
|
|
26
|
+
require('lib0/environment');
|
|
27
|
+
require('lib0/schema');
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
exports.AbsolutePosition = Skip.AbsolutePosition;
|
|
32
|
+
exports.AbstractAttributionManager = Skip.AbstractAttributionManager;
|
|
33
|
+
exports.AbstractConnector = Skip.AbstractConnector;
|
|
34
|
+
exports.AbstractStruct = Skip.AbstractStruct;
|
|
35
|
+
exports.AbstractType = Skip.AbstractType;
|
|
36
|
+
exports.Array = Skip.YArray;
|
|
37
|
+
exports.Attribution = Skip.AttributionItem;
|
|
38
|
+
exports.ContentAny = Skip.ContentAny;
|
|
39
|
+
exports.ContentBinary = Skip.ContentBinary;
|
|
40
|
+
exports.ContentDeleted = Skip.ContentDeleted;
|
|
41
|
+
exports.ContentDoc = Skip.ContentDoc;
|
|
42
|
+
exports.ContentEmbed = Skip.ContentEmbed;
|
|
43
|
+
exports.ContentFormat = Skip.ContentFormat;
|
|
44
|
+
exports.ContentJSON = Skip.ContentJSON;
|
|
45
|
+
exports.ContentString = Skip.ContentString;
|
|
46
|
+
exports.ContentType = Skip.ContentType;
|
|
47
|
+
exports.DiffAttributionManager = Skip.DiffAttributionManager;
|
|
48
|
+
exports.Doc = Skip.Doc;
|
|
49
|
+
exports.GC = Skip.GC;
|
|
50
|
+
exports.ID = Skip.ID;
|
|
51
|
+
exports.IdMap = Skip.IdMap;
|
|
52
|
+
exports.IdSet = Skip.IdSet;
|
|
53
|
+
exports.Item = Skip.Item;
|
|
54
|
+
exports.Map = Skip.YMap;
|
|
55
|
+
exports.RelativePosition = Skip.RelativePosition;
|
|
56
|
+
exports.Skip = Skip.Skip;
|
|
57
|
+
exports.Snapshot = Skip.Snapshot;
|
|
58
|
+
exports.Text = Skip.YText;
|
|
59
|
+
exports.Transaction = Skip.Transaction;
|
|
60
|
+
exports.TwosetAttributionManager = Skip.TwosetAttributionManager;
|
|
61
|
+
exports.UndoManager = Skip.UndoManager;
|
|
62
|
+
exports.UpdateDecoderV1 = Skip.UpdateDecoderV1;
|
|
63
|
+
exports.UpdateDecoderV2 = Skip.UpdateDecoderV2;
|
|
64
|
+
exports.UpdateEncoderV1 = Skip.UpdateEncoderV1;
|
|
65
|
+
exports.UpdateEncoderV2 = Skip.UpdateEncoderV2;
|
|
66
|
+
exports.XmlElement = Skip.YXmlElement;
|
|
67
|
+
exports.XmlFragment = Skip.YXmlFragment;
|
|
68
|
+
exports.XmlHook = Skip.YXmlHook;
|
|
69
|
+
exports.XmlText = Skip.YXmlText;
|
|
70
|
+
exports.YEvent = Skip.YEvent;
|
|
71
|
+
exports.applyUpdate = Skip.applyUpdate;
|
|
72
|
+
exports.applyUpdateV2 = Skip.applyUpdateV2;
|
|
73
|
+
exports.cleanupYTextFormatting = Skip.cleanupYTextFormatting;
|
|
74
|
+
exports.cloneDoc = Skip.cloneDoc;
|
|
75
|
+
exports.compareIDs = Skip.compareIDs;
|
|
76
|
+
exports.compareRelativePositions = Skip.compareRelativePositions;
|
|
77
|
+
exports.convertUpdateFormatV1ToV2 = Skip.convertUpdateFormatV1ToV2;
|
|
78
|
+
exports.convertUpdateFormatV2ToV1 = Skip.convertUpdateFormatV2ToV1;
|
|
79
|
+
exports.createAbsolutePositionFromRelativePosition = Skip.createAbsolutePositionFromRelativePosition;
|
|
80
|
+
exports.createAttributionItem = Skip.createAttributionItem;
|
|
81
|
+
exports.createAttributionManagerFromDiff = Skip.createAttributionManagerFromDiff;
|
|
82
|
+
exports.createDeleteSetFromStructStore = Skip.createDeleteSetFromStructStore;
|
|
83
|
+
exports.createDocFromSnapshot = Skip.createDocFromSnapshot;
|
|
84
|
+
exports.createID = Skip.createID;
|
|
85
|
+
exports.createIdMap = Skip.createIdMap;
|
|
86
|
+
exports.createIdMapFromIdSet = Skip.createIdMapFromIdSet;
|
|
87
|
+
exports.createIdSet = Skip.createIdSet;
|
|
88
|
+
exports.createInsertionSetFromStructStore = Skip.createInsertSetFromStructStore;
|
|
89
|
+
exports.createRelativePositionFromJSON = Skip.createRelativePositionFromJSON;
|
|
90
|
+
exports.createRelativePositionFromTypeIndex = Skip.createRelativePositionFromTypeIndex;
|
|
91
|
+
exports.createSnapshot = Skip.createSnapshot;
|
|
92
|
+
exports.decodeIdMap = Skip.decodeIdMap;
|
|
93
|
+
exports.decodeRelativePosition = Skip.decodeRelativePosition;
|
|
94
|
+
exports.decodeSnapshot = Skip.decodeSnapshot;
|
|
95
|
+
exports.decodeSnapshotV2 = Skip.decodeSnapshotV2;
|
|
96
|
+
exports.decodeStateVector = Skip.decodeStateVector;
|
|
97
|
+
exports.decodeUpdate = Skip.decodeUpdate;
|
|
98
|
+
exports.decodeUpdateV2 = Skip.decodeUpdateV2;
|
|
99
|
+
exports.diffDocsToDelta = Skip.diffDocsToDelta;
|
|
100
|
+
exports.diffIdMap = Skip.diffIdMap;
|
|
101
|
+
exports.diffIdSet = Skip.diffIdSet;
|
|
102
|
+
exports.diffUpdate = Skip.diffUpdate;
|
|
103
|
+
exports.diffUpdateV2 = Skip.diffUpdateV2;
|
|
104
|
+
exports.emptySnapshot = Skip.emptySnapshot;
|
|
105
|
+
exports.encodeIdMap = Skip.encodeIdMap;
|
|
106
|
+
exports.encodeRelativePosition = Skip.encodeRelativePosition;
|
|
107
|
+
exports.encodeSnapshot = Skip.encodeSnapshot;
|
|
108
|
+
exports.encodeSnapshotV2 = Skip.encodeSnapshotV2;
|
|
109
|
+
exports.encodeStateAsUpdate = Skip.encodeStateAsUpdate;
|
|
110
|
+
exports.encodeStateAsUpdateV2 = Skip.encodeStateAsUpdateV2;
|
|
111
|
+
exports.encodeStateVector = Skip.encodeStateVector;
|
|
112
|
+
exports.encodeStateVectorFromUpdate = Skip.encodeStateVectorFromUpdate;
|
|
113
|
+
exports.encodeStateVectorFromUpdateV2 = Skip.encodeStateVectorFromUpdateV2;
|
|
114
|
+
exports.equalIdSets = Skip.equalIdSets;
|
|
115
|
+
exports.equalSnapshots = Skip.equalSnapshots;
|
|
116
|
+
exports.findIndexSS = Skip.findIndexSS;
|
|
117
|
+
exports.findRootTypeKey = Skip.findRootTypeKey;
|
|
118
|
+
exports.getItem = Skip.getItem;
|
|
119
|
+
exports.getItemCleanEnd = Skip.getItemCleanEnd;
|
|
120
|
+
exports.getItemCleanStart = Skip.getItemCleanStart;
|
|
121
|
+
exports.getState = Skip.getState;
|
|
122
|
+
exports.getTypeChildren = Skip.getTypeChildren;
|
|
123
|
+
exports.insertIntoIdMap = Skip.insertIntoIdMap;
|
|
124
|
+
exports.insertIntoIdSet = Skip.insertIntoIdSet;
|
|
125
|
+
exports.isParentOf = Skip.isParentOf;
|
|
126
|
+
exports.iterateStructsByIdSet = Skip.iterateStructsByIdSet;
|
|
127
|
+
exports.logType = Skip.logType;
|
|
128
|
+
exports.logUpdate = Skip.logUpdate;
|
|
129
|
+
exports.logUpdateV2 = Skip.logUpdateV2;
|
|
130
|
+
exports.mergeIdMaps = Skip.mergeIdMaps;
|
|
131
|
+
exports.mergeIdSets = Skip.mergeIdSets;
|
|
132
|
+
exports.mergeUpdates = Skip.mergeUpdates;
|
|
133
|
+
exports.mergeUpdatesV2 = Skip.mergeUpdatesV2;
|
|
134
|
+
exports.noAttributionsManager = Skip.noAttributionsManager;
|
|
135
|
+
exports.obfuscateUpdate = Skip.obfuscateUpdate;
|
|
136
|
+
exports.obfuscateUpdateV2 = Skip.obfuscateUpdateV2;
|
|
137
|
+
exports.readIdMap = Skip.readIdMap;
|
|
138
|
+
exports.readIdSet = Skip.readIdSet;
|
|
139
|
+
exports.readUpdate = Skip.readUpdate;
|
|
140
|
+
exports.readUpdateIdRanges = Skip.readUpdateIdRanges;
|
|
141
|
+
exports.readUpdateIdRangesV2 = Skip.readUpdateIdRangesV2;
|
|
142
|
+
exports.readUpdateV2 = Skip.readUpdateV2;
|
|
143
|
+
exports.relativePositionToJSON = Skip.relativePositionToJSON;
|
|
144
|
+
exports.snapshot = Skip.snapshot;
|
|
145
|
+
exports.snapshotContainsUpdate = Skip.snapshotContainsUpdate;
|
|
146
|
+
exports.transact = Skip.transact;
|
|
147
|
+
exports.tryGc = Skip.tryGc;
|
|
148
|
+
exports.typeListToArraySnapshot = Skip.typeListToArraySnapshot;
|
|
149
|
+
exports.typeMapGetAllSnapshot = Skip.typeMapGetAllSnapshot;
|
|
150
|
+
exports.typeMapGetSnapshot = Skip.typeMapGetSnapshot;
|
|
151
|
+
//# sourceMappingURL=yjs.cjs.map
|
package/dist/yjs.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yjs.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/yjs.mjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export { ah as AbsolutePosition, bF as AbstractAttributionManager, A as AbstractConnector, cy as AbstractStruct, bU as AbstractType, cf as Array, bl as Attribution, cN as ContentAny, cB as ContentBinary, cD as ContentDeleted, cF as ContentDoc, cH as ContentEmbed, cJ as ContentFormat, cL as ContentJSON, cP as ContentString, cZ as ContentType, bJ as DiffAttributionManager, D as Doc, cA as GC, a6 as ID, bt as IdMap, b as IdSet, d4 as Item, ch as Map, ae as RelativePosition, d9 as Skip, ar as Snapshot, co as Text, aS as Transaction, bG as TwosetAttributionManager, aZ as UndoManager, U as UpdateDecoderV1, C as UpdateDecoderV2, F as UpdateEncoderV1, H as UpdateEncoderV2, cs as XmlElement, cq as XmlFragment, cu as XmlHook, cw as XmlText, bh as YEvent, Q as applyUpdate, P as applyUpdateV2, cl as cleanupYTextFormatting, y as cloneDoc, a7 as compareIDs, aq as compareRelativePositions, bf as convertUpdateFormatV1ToV2, bg as convertUpdateFormatV2ToV1, ap as createAbsolutePositionFromRelativePosition, bm as createAttributionItem, bK as createAttributionManagerFromDiff, q as createDeleteSetFromStructStore, aC as createDocFromSnapshot, a8 as createID, by as createIdMap, bs as createIdMapFromIdSet, p as createIdSet, s as createInsertionSetFromStructStore, ag as createRelativePositionFromJSON, ak as createRelativePositionFromTypeIndex, ax as createSnapshot, bx as decodeIdMap, ao as decodeRelativePosition, aw as decodeSnapshot, av as decodeSnapshotV2, W as decodeStateVector, b1 as decodeUpdate, b2 as decodeUpdateV2, bN as diffDocsToDelta, bA as diffIdMap, j as diffIdSet, bb as diffUpdate, ba as diffUpdateV2, ay as emptySnapshot, bv as encodeIdMap, am as encodeRelativePosition, au as encodeSnapshot, at as encodeSnapshotV2, T as encodeStateAsUpdate, S as encodeStateAsUpdateV2, $ as encodeStateVector, b6 as encodeStateVectorFromUpdate, b5 as encodeStateVectorFromUpdateV2, v as equalIdSets, as as equalSnapshots, aK as findIndexSS, ab as findRootTypeKey, aM as getItem, aP as getItemCleanEnd, aO as getItemCleanStart, aH as getState, bS as getTypeChildren, bz as insertIntoIdMap, g as insertIntoIdSet, ac as isParentOf, i as iterateStructsByIdSet, ad as logType, a$ as logUpdate, b0 as logUpdateV2, br as mergeIdMaps, m as mergeIdSets, b4 as mergeUpdates, b9 as mergeUpdatesV2, bI as noAttributionsManager, bd as obfuscateUpdate, be as obfuscateUpdateV2, bw as readIdMap, t as readIdSet, O as readUpdate, b8 as readUpdateIdRanges, b7 as readUpdateIdRangesV2, N as readUpdateV2, af as relativePositionToJSON, az as snapshot, aE as snapshotContainsUpdate, aX as transact, aW as tryGc, bY as typeListToArraySnapshot, cd as typeMapGetAllSnapshot, cc as typeMapGetSnapshot } from './Skip-wRT7BKFP.js';
|
|
2
|
+
import 'lib0/function';
|
|
3
|
+
import 'lib0/decoding';
|
|
4
|
+
import 'lib0/binary';
|
|
5
|
+
import 'lib0/map';
|
|
6
|
+
import './index-DyTeTfmj.js';
|
|
7
|
+
import 'lib0/observable';
|
|
8
|
+
import 'lib0/array';
|
|
9
|
+
import 'lib0/math';
|
|
10
|
+
import 'lib0/encoding';
|
|
11
|
+
import 'lib0/traits';
|
|
12
|
+
import 'lib0/random';
|
|
13
|
+
import 'lib0/promise';
|
|
14
|
+
import 'lib0/buffer';
|
|
15
|
+
import 'lib0/error';
|
|
16
|
+
import 'lib0/set';
|
|
17
|
+
import 'lib0/logging';
|
|
18
|
+
import 'lib0/time';
|
|
19
|
+
import 'lib0/string';
|
|
20
|
+
import 'lib0/delta';
|
|
21
|
+
import 'lib0/hash/rabin';
|
|
22
|
+
import 'lib0/iterator';
|
|
23
|
+
import 'lib0/object';
|
|
24
|
+
import 'lib0/environment';
|
|
25
|
+
import 'lib0/schema';
|
|
26
|
+
//# sourceMappingURL=yjs.mjs.map
|
package/dist/yjs.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yjs.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@y/y",
|
|
3
|
+
"version": "14.0.0-16",
|
|
4
|
+
"description": "Shared Editing Library",
|
|
5
|
+
"main": "./dist/yjs.cjs",
|
|
6
|
+
"module": "./dist/yjs.mjs",
|
|
7
|
+
"types": "./dist/src/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"funding": {
|
|
11
|
+
"type": "GitHub Sponsors ❤",
|
|
12
|
+
"url": "https://github.com/sponsors/dmonad"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"clean": "rm -rf dist",
|
|
16
|
+
"test": "NODE_ENV=development node ./tests/index.js --repetition-time 50",
|
|
17
|
+
"test-extensive": "node ./tests/index.js --production --repetition-time 10000",
|
|
18
|
+
"dist": "npm run clean && rollup -c && (tsc --skipLibCheck|| true)",
|
|
19
|
+
"watch": "rollup -wc",
|
|
20
|
+
"lint": "markdownlint README.md && standard && tsc --skipLibCheck",
|
|
21
|
+
"preversion": "PRODUCTION=1 npm run dist && test -e dist/src/index.d.ts && test -e dist/yjs.cjs && test -e dist/yjs.cjs",
|
|
22
|
+
"debug": "npm run gentesthtml && 0serve -o test.html",
|
|
23
|
+
"trace-deopt": "clear && node --trace-deopt ./tests/index.js",
|
|
24
|
+
"trace-opt": "clear && node --trace-opt ./tests/index.js",
|
|
25
|
+
"gentesthtml": "0gentesthtml --script ./tests/index.js --include-dependencies @y/protocols > test.html"
|
|
26
|
+
},
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/src/index.d.ts",
|
|
30
|
+
"module": "./src/index.js",
|
|
31
|
+
"require": "./dist/yjs.cjs",
|
|
32
|
+
"import": "./src/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./internals": {
|
|
35
|
+
"types": "./dist/src/internals.d.ts",
|
|
36
|
+
"module": "./src/internals.js",
|
|
37
|
+
"require": "./dist/internals.cjs",
|
|
38
|
+
"import": "./src/internals.js"
|
|
39
|
+
},
|
|
40
|
+
"./testHelper": {
|
|
41
|
+
"types": "./dist/tests/testHelper.d.ts",
|
|
42
|
+
"module": "./tests/testHelper.js",
|
|
43
|
+
"require": "./dist/testHelper.cjs",
|
|
44
|
+
"import": "./tests/testHelper.js"
|
|
45
|
+
},
|
|
46
|
+
"./package.json": "./package.json"
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"dist/*",
|
|
50
|
+
"dist/src",
|
|
51
|
+
"src",
|
|
52
|
+
"tests/testHelper.js",
|
|
53
|
+
"dist/testHelper.mjs"
|
|
54
|
+
],
|
|
55
|
+
"dictionaries": {
|
|
56
|
+
"test": "tests"
|
|
57
|
+
},
|
|
58
|
+
"standard": {
|
|
59
|
+
"ignore": [
|
|
60
|
+
"/dist",
|
|
61
|
+
"/node_modules"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"repository": {
|
|
65
|
+
"type": "git",
|
|
66
|
+
"url": "https://github.com/yjs/yjs.git"
|
|
67
|
+
},
|
|
68
|
+
"keywords": [
|
|
69
|
+
"Yjs",
|
|
70
|
+
"CRDT",
|
|
71
|
+
"offline",
|
|
72
|
+
"offline-first",
|
|
73
|
+
"shared-editing",
|
|
74
|
+
"concurrency",
|
|
75
|
+
"collaboration"
|
|
76
|
+
],
|
|
77
|
+
"author": "Kevin Jahns",
|
|
78
|
+
"email": "kevin.jahns@protonmail.com",
|
|
79
|
+
"license": "MIT",
|
|
80
|
+
"bugs": {
|
|
81
|
+
"url": "https://github.com/yjs/yjs/issues"
|
|
82
|
+
},
|
|
83
|
+
"homepage": "https://docs.yjs.dev",
|
|
84
|
+
"dependencies": {
|
|
85
|
+
"lib0": "^0.2.115-6"
|
|
86
|
+
},
|
|
87
|
+
"devDependencies": {
|
|
88
|
+
"@types/node": "^22.14.1",
|
|
89
|
+
"@y/protocols": "^1.0.6-1",
|
|
90
|
+
"concurrently": "^9.2.1",
|
|
91
|
+
"markdownlint-cli": "^0.45.0",
|
|
92
|
+
"rollup": "^4.52.5",
|
|
93
|
+
"standard": "^17.1.2",
|
|
94
|
+
"typescript": "^5.9.3",
|
|
95
|
+
"yjs": "."
|
|
96
|
+
},
|
|
97
|
+
"engines": {
|
|
98
|
+
"npm": ">=8.0.0",
|
|
99
|
+
"node": ">=16.0.0"
|
|
100
|
+
}
|
|
101
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/** eslint-env browser */
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Doc,
|
|
5
|
+
Transaction,
|
|
6
|
+
YArray as Array,
|
|
7
|
+
YMap as Map,
|
|
8
|
+
YText as Text,
|
|
9
|
+
YXmlText as XmlText,
|
|
10
|
+
YXmlHook as XmlHook,
|
|
11
|
+
YXmlElement as XmlElement,
|
|
12
|
+
YXmlFragment as XmlFragment,
|
|
13
|
+
YEvent,
|
|
14
|
+
Item,
|
|
15
|
+
AbstractStruct,
|
|
16
|
+
GC,
|
|
17
|
+
Skip,
|
|
18
|
+
ContentBinary,
|
|
19
|
+
ContentDeleted,
|
|
20
|
+
ContentDoc,
|
|
21
|
+
ContentEmbed,
|
|
22
|
+
ContentFormat,
|
|
23
|
+
ContentJSON,
|
|
24
|
+
ContentAny,
|
|
25
|
+
ContentString,
|
|
26
|
+
ContentType,
|
|
27
|
+
AbstractType,
|
|
28
|
+
getTypeChildren,
|
|
29
|
+
createRelativePositionFromTypeIndex,
|
|
30
|
+
createRelativePositionFromJSON,
|
|
31
|
+
createAbsolutePositionFromRelativePosition,
|
|
32
|
+
compareRelativePositions,
|
|
33
|
+
AbsolutePosition,
|
|
34
|
+
RelativePosition,
|
|
35
|
+
ID,
|
|
36
|
+
createID,
|
|
37
|
+
compareIDs,
|
|
38
|
+
getState,
|
|
39
|
+
Snapshot,
|
|
40
|
+
createSnapshot,
|
|
41
|
+
cleanupYTextFormatting,
|
|
42
|
+
snapshot,
|
|
43
|
+
emptySnapshot,
|
|
44
|
+
findRootTypeKey,
|
|
45
|
+
findIndexSS,
|
|
46
|
+
getItem,
|
|
47
|
+
getItemCleanStart,
|
|
48
|
+
getItemCleanEnd,
|
|
49
|
+
typeListToArraySnapshot,
|
|
50
|
+
typeMapGetSnapshot,
|
|
51
|
+
typeMapGetAllSnapshot,
|
|
52
|
+
createDocFromSnapshot,
|
|
53
|
+
applyUpdate,
|
|
54
|
+
applyUpdateV2,
|
|
55
|
+
readUpdate,
|
|
56
|
+
readUpdateV2,
|
|
57
|
+
encodeStateAsUpdate,
|
|
58
|
+
encodeStateAsUpdateV2,
|
|
59
|
+
encodeStateVector,
|
|
60
|
+
UndoManager,
|
|
61
|
+
decodeSnapshot,
|
|
62
|
+
encodeSnapshot,
|
|
63
|
+
decodeSnapshotV2,
|
|
64
|
+
encodeSnapshotV2,
|
|
65
|
+
decodeStateVector,
|
|
66
|
+
logUpdate,
|
|
67
|
+
logUpdateV2,
|
|
68
|
+
decodeUpdate,
|
|
69
|
+
decodeUpdateV2,
|
|
70
|
+
relativePositionToJSON,
|
|
71
|
+
isParentOf,
|
|
72
|
+
equalSnapshots,
|
|
73
|
+
tryGc,
|
|
74
|
+
transact,
|
|
75
|
+
AbstractConnector,
|
|
76
|
+
logType,
|
|
77
|
+
mergeUpdates,
|
|
78
|
+
mergeUpdatesV2,
|
|
79
|
+
encodeStateVectorFromUpdate,
|
|
80
|
+
encodeStateVectorFromUpdateV2,
|
|
81
|
+
encodeRelativePosition,
|
|
82
|
+
decodeRelativePosition,
|
|
83
|
+
diffUpdate,
|
|
84
|
+
diffUpdateV2,
|
|
85
|
+
convertUpdateFormatV1ToV2,
|
|
86
|
+
convertUpdateFormatV2ToV1,
|
|
87
|
+
obfuscateUpdate,
|
|
88
|
+
obfuscateUpdateV2,
|
|
89
|
+
UpdateEncoderV1,
|
|
90
|
+
UpdateEncoderV2,
|
|
91
|
+
UpdateDecoderV1,
|
|
92
|
+
UpdateDecoderV2,
|
|
93
|
+
snapshotContainsUpdate,
|
|
94
|
+
// idset
|
|
95
|
+
IdSet,
|
|
96
|
+
equalIdSets,
|
|
97
|
+
createDeleteSetFromStructStore,
|
|
98
|
+
IdMap,
|
|
99
|
+
createIdMap,
|
|
100
|
+
createAttributionItem,
|
|
101
|
+
createInsertSetFromStructStore as createInsertionSetFromStructStore,
|
|
102
|
+
diffIdMap,
|
|
103
|
+
diffIdSet,
|
|
104
|
+
AttributionItem as Attribution,
|
|
105
|
+
encodeIdMap,
|
|
106
|
+
createIdMapFromIdSet,
|
|
107
|
+
TwosetAttributionManager,
|
|
108
|
+
noAttributionsManager,
|
|
109
|
+
AbstractAttributionManager,
|
|
110
|
+
iterateStructsByIdSet,
|
|
111
|
+
createAttributionManagerFromDiff,
|
|
112
|
+
DiffAttributionManager,
|
|
113
|
+
createIdSet,
|
|
114
|
+
mergeIdSets,
|
|
115
|
+
cloneDoc,
|
|
116
|
+
readUpdateIdRanges,
|
|
117
|
+
readUpdateIdRangesV2,
|
|
118
|
+
insertIntoIdMap,
|
|
119
|
+
insertIntoIdSet,
|
|
120
|
+
mergeIdMaps,
|
|
121
|
+
readIdMap,
|
|
122
|
+
readIdSet,
|
|
123
|
+
decodeIdMap,
|
|
124
|
+
diffDocsToDelta
|
|
125
|
+
} from './internals.js'
|
|
126
|
+
|
|
127
|
+
const glo = /** @type {any} */ (typeof globalThis !== 'undefined'
|
|
128
|
+
? globalThis
|
|
129
|
+
: typeof window !== 'undefined'
|
|
130
|
+
? window
|
|
131
|
+
// @ts-ignore
|
|
132
|
+
: typeof global !== 'undefined' ? global : {})
|
|
133
|
+
|
|
134
|
+
const importIdentifier = '__ $YJS$ __'
|
|
135
|
+
|
|
136
|
+
if (glo[importIdentifier] === true) {
|
|
137
|
+
/**
|
|
138
|
+
* Dear reader of this message. Please take this seriously.
|
|
139
|
+
*
|
|
140
|
+
* If you see this message, make sure that you only import one version of Yjs. In many cases,
|
|
141
|
+
* your package manager installs two versions of Yjs that are used by different packages within your project.
|
|
142
|
+
* Another reason for this message is that some parts of your project use the commonjs version of Yjs
|
|
143
|
+
* and others use the EcmaScript version of Yjs.
|
|
144
|
+
*
|
|
145
|
+
* This often leads to issues that are hard to debug. We often need to perform constructor checks,
|
|
146
|
+
* e.g. `struct instanceof GC`. If you imported different versions of Yjs, it is impossible for us to
|
|
147
|
+
* do the constructor checks anymore - which might break the CRDT algorithm.
|
|
148
|
+
*
|
|
149
|
+
* https://github.com/yjs/yjs/issues/438
|
|
150
|
+
*/
|
|
151
|
+
console.error('Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438')
|
|
152
|
+
}
|
|
153
|
+
glo[importIdentifier] = true
|
package/src/internals.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export * from './utils/AbstractConnector.js'
|
|
2
|
+
export * from './utils/IdSet.js'
|
|
3
|
+
export * from './utils/Doc.js'
|
|
4
|
+
export * from './utils/UpdateDecoder.js'
|
|
5
|
+
export * from './utils/UpdateEncoder.js'
|
|
6
|
+
export * from './utils/encoding.js'
|
|
7
|
+
export * from './utils/EventHandler.js'
|
|
8
|
+
export * from './utils/ID.js'
|
|
9
|
+
export * from './utils/isParentOf.js'
|
|
10
|
+
export * from './utils/logging.js'
|
|
11
|
+
export * from './utils/RelativePosition.js'
|
|
12
|
+
export * from './utils/Snapshot.js'
|
|
13
|
+
export * from './utils/StructStore.js'
|
|
14
|
+
export * from './utils/Transaction.js'
|
|
15
|
+
export * from './utils/UndoManager.js'
|
|
16
|
+
export * from './utils/updates.js'
|
|
17
|
+
export * from './utils/YEvent.js'
|
|
18
|
+
export * from './utils/StructSet.js'
|
|
19
|
+
export * from './utils/IdMap.js'
|
|
20
|
+
export * from './utils/AttributionManager.js'
|
|
21
|
+
export * from './utils/delta-helpers.js'
|
|
22
|
+
|
|
23
|
+
export * from './types/AbstractType.js'
|
|
24
|
+
export * from './types/YArray.js'
|
|
25
|
+
export * from './types/YMap.js'
|
|
26
|
+
export * from './types/YText.js'
|
|
27
|
+
export * from './types/YXmlFragment.js'
|
|
28
|
+
export * from './types/YXmlElement.js'
|
|
29
|
+
export * from './types/YXmlHook.js'
|
|
30
|
+
export * from './types/YXmlText.js'
|
|
31
|
+
|
|
32
|
+
export * from './structs/AbstractStruct.js'
|
|
33
|
+
export * from './structs/GC.js'
|
|
34
|
+
export * from './structs/ContentBinary.js'
|
|
35
|
+
export * from './structs/ContentDeleted.js'
|
|
36
|
+
export * from './structs/ContentDoc.js'
|
|
37
|
+
export * from './structs/ContentEmbed.js'
|
|
38
|
+
export * from './structs/ContentFormat.js'
|
|
39
|
+
export * from './structs/ContentJSON.js'
|
|
40
|
+
export * from './structs/ContentAny.js'
|
|
41
|
+
export * from './structs/ContentString.js'
|
|
42
|
+
export * from './structs/ContentType.js'
|
|
43
|
+
export * from './structs/Item.js'
|
|
44
|
+
export * from './structs/Skip.js'
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UpdateEncoderV1, UpdateEncoderV2, ID, Transaction // eslint-disable-line
|
|
3
|
+
} from '../internals.js'
|
|
4
|
+
|
|
5
|
+
import * as error from 'lib0/error'
|
|
6
|
+
|
|
7
|
+
export class AbstractStruct {
|
|
8
|
+
/**
|
|
9
|
+
* @param {ID} id
|
|
10
|
+
* @param {number} length
|
|
11
|
+
*/
|
|
12
|
+
constructor (id, length) {
|
|
13
|
+
this.id = id
|
|
14
|
+
this.length = length
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @type {boolean}
|
|
19
|
+
*/
|
|
20
|
+
get deleted () {
|
|
21
|
+
throw error.methodUnimplemented()
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Merge this struct with the item to the right.
|
|
26
|
+
* This method is already assuming that `this.id.clock + this.length === this.id.clock`.
|
|
27
|
+
* Also this method does *not* remove right from StructStore!
|
|
28
|
+
* @param {AbstractStruct} right
|
|
29
|
+
* @return {boolean} whether this merged with right
|
|
30
|
+
*/
|
|
31
|
+
mergeWith (right) {
|
|
32
|
+
return false
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.
|
|
37
|
+
* @param {number} offset
|
|
38
|
+
* @param {number} encodingRef
|
|
39
|
+
*/
|
|
40
|
+
write (encoder, offset, encodingRef) {
|
|
41
|
+
throw error.methodUnimplemented()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @param {Transaction} transaction
|
|
46
|
+
* @param {number} offset
|
|
47
|
+
*/
|
|
48
|
+
integrate (transaction, offset) {
|
|
49
|
+
throw error.methodUnimplemented()
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @param {number} diff
|
|
54
|
+
* @return {import('../internals.js').GC|import('../internals.js').Item}
|
|
55
|
+
*/
|
|
56
|
+
splice (diff) {
|
|
57
|
+
throw error.methodUnimplemented()
|
|
58
|
+
}
|
|
59
|
+
}
|