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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/README.md +36 -12
  2. package/dist/src/index.d.ts +24 -1
  3. package/dist/src/index.d.ts.map +1 -1
  4. package/dist/src/structs/AbstractStruct.d.ts +14 -17
  5. package/dist/src/structs/AbstractStruct.d.ts.map +1 -1
  6. package/dist/src/structs/GC.d.ts +9 -14
  7. package/dist/src/structs/GC.d.ts.map +1 -1
  8. package/dist/src/structs/Item.d.ts +569 -31
  9. package/dist/src/structs/Item.d.ts.map +1 -1
  10. package/dist/src/structs/Skip.d.ts +9 -11
  11. package/dist/src/structs/Skip.d.ts.map +1 -1
  12. package/dist/src/utils/BlockSet.d.ts +8 -7
  13. package/dist/src/utils/BlockSet.d.ts.map +1 -1
  14. package/dist/src/utils/Doc.d.ts +4 -9
  15. package/dist/src/utils/Doc.d.ts.map +1 -1
  16. package/dist/src/utils/ID.d.ts +0 -1
  17. package/dist/src/utils/ID.d.ts.map +1 -1
  18. package/dist/src/utils/RelativePosition.d.ts +2 -5
  19. package/dist/src/utils/RelativePosition.d.ts.map +1 -1
  20. package/dist/src/utils/Renderer.d.ts +144 -0
  21. package/dist/src/utils/Renderer.d.ts.map +1 -0
  22. package/dist/src/utils/Snapshot.d.ts +7 -11
  23. package/dist/src/utils/Snapshot.d.ts.map +1 -1
  24. package/dist/src/utils/StructStore.d.ts +45 -23
  25. package/dist/src/utils/StructStore.d.ts.map +1 -1
  26. package/dist/src/utils/Transaction.d.ts +11 -21
  27. package/dist/src/utils/Transaction.d.ts.map +1 -1
  28. package/dist/src/utils/UndoManager.d.ts +13 -14
  29. package/dist/src/utils/UndoManager.d.ts.map +1 -1
  30. package/dist/src/utils/UpdateDecoder.d.ts +1 -1
  31. package/dist/src/utils/UpdateDecoder.d.ts.map +1 -1
  32. package/dist/src/utils/UpdateEncoder.d.ts +0 -1
  33. package/dist/src/utils/UpdateEncoder.d.ts.map +1 -1
  34. package/dist/src/utils/YEvent.d.ts +22 -26
  35. package/dist/src/utils/YEvent.d.ts.map +1 -1
  36. package/dist/src/utils/content-helper.d.ts +2 -0
  37. package/dist/src/utils/content-helper.d.ts.map +1 -0
  38. package/dist/src/utils/delta-helpers.d.ts +2 -3
  39. package/dist/src/utils/delta-helpers.d.ts.map +1 -1
  40. package/dist/src/utils/encoding-helpers.d.ts +6 -0
  41. package/dist/src/utils/encoding-helpers.d.ts.map +1 -0
  42. package/dist/src/utils/encoding.d.ts +16 -18
  43. package/dist/src/utils/encoding.d.ts.map +1 -1
  44. package/dist/src/utils/ids.d.ts +331 -0
  45. package/dist/src/utils/ids.d.ts.map +1 -0
  46. package/dist/src/utils/isParentOf.d.ts +1 -2
  47. package/dist/src/utils/isParentOf.d.ts.map +1 -1
  48. package/dist/src/utils/logging.d.ts +0 -1
  49. package/dist/src/utils/logging.d.ts.map +1 -1
  50. package/dist/src/utils/meta.d.ts +15 -64
  51. package/dist/src/utils/meta.d.ts.map +1 -1
  52. package/dist/src/utils/renderer-helpers.d.ts +99 -0
  53. package/dist/src/utils/renderer-helpers.d.ts.map +1 -0
  54. package/dist/src/utils/schemas.d.ts +3 -0
  55. package/dist/src/utils/schemas.d.ts.map +1 -0
  56. package/dist/src/utils/transaction-helpers.d.ts +18 -0
  57. package/dist/src/utils/transaction-helpers.d.ts.map +1 -0
  58. package/dist/src/utils/updates.d.ts +19 -25
  59. package/dist/src/utils/updates.d.ts.map +1 -1
  60. package/dist/src/ytype.d.ts +55 -24
  61. package/dist/src/ytype.d.ts.map +1 -1
  62. package/global.d.ts +53 -0
  63. package/package.json +12 -16
  64. package/src/index.js +32 -124
  65. package/src/structs/AbstractStruct.js +21 -16
  66. package/src/structs/GC.js +15 -20
  67. package/src/structs/Item.js +992 -318
  68. package/src/structs/Skip.js +16 -19
  69. package/src/utils/BlockSet.js +20 -20
  70. package/src/utils/Doc.js +15 -29
  71. package/src/utils/ID.js +0 -2
  72. package/src/utils/RelativePosition.js +15 -25
  73. package/src/utils/{AttributionManager.js → Renderer.js} +42 -197
  74. package/src/utils/Snapshot.js +15 -37
  75. package/src/utils/StructStore.js +89 -227
  76. package/src/utils/Transaction.js +63 -307
  77. package/src/utils/UndoManager.js +157 -19
  78. package/src/utils/UpdateDecoder.js +2 -3
  79. package/src/utils/UpdateEncoder.js +0 -4
  80. package/src/utils/YEvent.js +20 -26
  81. package/src/utils/content-helper.js +0 -0
  82. package/src/utils/delta-helpers.js +21 -42
  83. package/src/utils/encoding-helpers.js +110 -0
  84. package/src/utils/encoding.js +197 -122
  85. package/src/utils/ids.js +1527 -0
  86. package/src/utils/isParentOf.js +2 -4
  87. package/src/utils/logging.js +0 -4
  88. package/src/utils/meta.js +57 -46
  89. package/src/utils/renderer-helpers.js +110 -0
  90. package/src/utils/schemas.js +3 -0
  91. package/src/utils/transaction-helpers.js +413 -0
  92. package/src/utils/updates.js +24 -146
  93. package/src/ytype.js +325 -117
  94. package/tests/testHelper.js +10 -12
  95. package/dist/src/internals.d.ts +0 -36
  96. package/dist/src/internals.d.ts.map +0 -1
  97. package/dist/src/structs/ContentAny.d.ts +0 -67
  98. package/dist/src/structs/ContentAny.d.ts.map +0 -1
  99. package/dist/src/structs/ContentBinary.d.ts +0 -64
  100. package/dist/src/structs/ContentBinary.d.ts.map +0 -1
  101. package/dist/src/structs/ContentDeleted.d.ts +0 -64
  102. package/dist/src/structs/ContentDeleted.d.ts.map +0 -1
  103. package/dist/src/structs/ContentDoc.d.ts +0 -72
  104. package/dist/src/structs/ContentDoc.d.ts.map +0 -1
  105. package/dist/src/structs/ContentEmbed.d.ts +0 -67
  106. package/dist/src/structs/ContentEmbed.d.ts.map +0 -1
  107. package/dist/src/structs/ContentFormat.d.ts +0 -69
  108. package/dist/src/structs/ContentFormat.d.ts.map +0 -1
  109. package/dist/src/structs/ContentJSON.d.ts +0 -70
  110. package/dist/src/structs/ContentJSON.d.ts.map +0 -1
  111. package/dist/src/structs/ContentString.d.ts +0 -70
  112. package/dist/src/structs/ContentString.d.ts.map +0 -1
  113. package/dist/src/structs/ContentType.d.ts +0 -77
  114. package/dist/src/structs/ContentType.d.ts.map +0 -1
  115. package/dist/src/utils/AttributionManager.d.ts +0 -238
  116. package/dist/src/utils/AttributionManager.d.ts.map +0 -1
  117. package/dist/src/utils/IdMap.d.ts +0 -164
  118. package/dist/src/utils/IdMap.d.ts.map +0 -1
  119. package/dist/src/utils/IdSet.d.ts +0 -163
  120. package/dist/src/utils/IdSet.d.ts.map +0 -1
  121. package/dist/tests/IdMap.tests.d.ts +0 -9
  122. package/dist/tests/IdMap.tests.d.ts.map +0 -1
  123. package/dist/tests/IdSet.tests.d.ts +0 -9
  124. package/dist/tests/IdSet.tests.d.ts.map +0 -1
  125. package/dist/tests/attribution.tests.d.ts +0 -9
  126. package/dist/tests/attribution.tests.d.ts.map +0 -1
  127. package/dist/tests/compatibility.tests.d.ts +0 -5
  128. package/dist/tests/compatibility.tests.d.ts.map +0 -1
  129. package/dist/tests/delta.tests.d.ts +0 -7
  130. package/dist/tests/delta.tests.d.ts.map +0 -1
  131. package/dist/tests/doc.tests.d.ts +0 -13
  132. package/dist/tests/doc.tests.d.ts.map +0 -1
  133. package/dist/tests/encoding.tests.d.ts +0 -5
  134. package/dist/tests/encoding.tests.d.ts.map +0 -1
  135. package/dist/tests/index.d.ts +0 -2
  136. package/dist/tests/index.d.ts.map +0 -1
  137. package/dist/tests/relativePositions.tests.d.ts +0 -11
  138. package/dist/tests/relativePositions.tests.d.ts.map +0 -1
  139. package/dist/tests/snapshot.tests.d.ts +0 -14
  140. package/dist/tests/snapshot.tests.d.ts.map +0 -1
  141. package/dist/tests/testHelper.d.ts +0 -171
  142. package/dist/tests/testHelper.d.ts.map +0 -1
  143. package/dist/tests/undo-redo.tests.d.ts +0 -27
  144. package/dist/tests/undo-redo.tests.d.ts.map +0 -1
  145. package/dist/tests/updates.tests.d.ts +0 -26
  146. package/dist/tests/updates.tests.d.ts.map +0 -1
  147. package/dist/tests/y-array.tests.d.ts +0 -43
  148. package/dist/tests/y-array.tests.d.ts.map +0 -1
  149. package/dist/tests/y-map.tests.d.ts +0 -42
  150. package/dist/tests/y-map.tests.d.ts.map +0 -1
  151. package/dist/tests/y-text.tests.d.ts +0 -49
  152. package/dist/tests/y-text.tests.d.ts.map +0 -1
  153. package/dist/tests/y-xml.tests.d.ts +0 -14
  154. package/dist/tests/y-xml.tests.d.ts.map +0 -1
  155. package/src/internals.js +0 -35
  156. package/src/structs/ContentAny.js +0 -115
  157. package/src/structs/ContentBinary.js +0 -93
  158. package/src/structs/ContentDeleted.js +0 -101
  159. package/src/structs/ContentDoc.js +0 -141
  160. package/src/structs/ContentEmbed.js +0 -98
  161. package/src/structs/ContentFormat.js +0 -105
  162. package/src/structs/ContentJSON.js +0 -119
  163. package/src/structs/ContentString.js +0 -113
  164. package/src/structs/ContentType.js +0 -152
  165. package/src/utils/IdMap.js +0 -673
  166. package/src/utils/IdSet.js +0 -825
@@ -1,42 +0,0 @@
1
- export function testIterators(_tc: t.TestCase): void;
2
- export function testNestedMapEvent(): void;
3
- export function testNestedMapEvent2(): void;
4
- export function testMapEventError(_tc: t.TestCase): void;
5
- export function testMapHavingIterableAsConstructorParamTests(tc: t.TestCase): void;
6
- export function testBasicMapTests(tc: t.TestCase): void;
7
- export function testGetAndSetOfMapProperty(tc: t.TestCase): void;
8
- export function testYmapSetsYmap(tc: t.TestCase): void;
9
- export function testYmapSetsYarray(tc: t.TestCase): void;
10
- export function testGetAndSetOfMapPropertySyncs(tc: t.TestCase): void;
11
- export function testGetAndSetOfMapPropertyWithConflict(tc: t.TestCase): void;
12
- export function testSizeAndDeleteOfMapProperty(tc: t.TestCase): void;
13
- export function testGetAndSetAndDeleteOfMapProperty(tc: t.TestCase): void;
14
- export function testSetAndClearOfMapProperties(tc: t.TestCase): void;
15
- export function testSetAndClearOfMapPropertiesWithConflicts(tc: t.TestCase): void;
16
- export function testGetAndSetOfMapPropertyWithThreeConflicts(tc: t.TestCase): void;
17
- export function testGetAndSetAndDeleteOfMapPropertyWithThreeConflicts(tc: t.TestCase): void;
18
- export function testThrowsAddAndUpdateAndDeleteEvents(tc: t.TestCase): void;
19
- export function testThrowsDeleteEventsOnClear(tc: t.TestCase): void;
20
- export function testChangeEvent(tc: t.TestCase): void;
21
- export function testYmapEventExceptionsShouldCompleteTransaction(_tc: t.TestCase): void;
22
- export function testYmapEventHasCorrectValueWhenSettingAPrimitive(tc: t.TestCase): void;
23
- export function testYmapEventHasCorrectValueWhenSettingAPrimitiveFromOtherUser(tc: t.TestCase): void;
24
- export function testAttributedContent(_tc: t.TestCase): void;
25
- export function testRepeatGeneratingYmapTests10(tc: t.TestCase): void;
26
- export function testRepeatGeneratingYmapTests40(tc: t.TestCase): void;
27
- export function testRepeatGeneratingYmapTests42(tc: t.TestCase): void;
28
- export function testRepeatGeneratingYmapTests43(tc: t.TestCase): void;
29
- export function testRepeatGeneratingYmapTests44(tc: t.TestCase): void;
30
- export function testRepeatGeneratingYmapTests45(tc: t.TestCase): void;
31
- export function testRepeatGeneratingYmapTests46(tc: t.TestCase): void;
32
- export function testRepeatGeneratingYmapTests300(tc: t.TestCase): void;
33
- export function testRepeatGeneratingYmapTests400(tc: t.TestCase): void;
34
- export function testRepeatGeneratingYmapTests500(tc: t.TestCase): void;
35
- export function testRepeatGeneratingYmapTests600(tc: t.TestCase): void;
36
- export function testRepeatGeneratingYmapTests1000(tc: t.TestCase): void;
37
- export function testRepeatGeneratingYmapTests1800(tc: t.TestCase): void;
38
- export function testRepeatGeneratingYmapTests5000(tc: t.TestCase): void;
39
- export function testRepeatGeneratingYmapTests10000(tc: t.TestCase): void;
40
- export function testRepeatGeneratingYmapTests100000(tc: t.TestCase): void;
41
- import * as t from 'lib0/testing';
42
- //# sourceMappingURL=y-map.tests.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"y-map.tests.d.ts","sourceRoot":"","sources":["../../tests/y-map.tests.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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;AAKM,sDAFI,CAAC,CAAC,QAAQ,QAKpB;AAKM,uDAFI,CAAC,CAAC,QAAQ,QAKpB;AAKM,wDAFI,CAAC,CAAC,QAAQ,QAKpB;mBA3sBkB,cAAc"}
@@ -1,49 +0,0 @@
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 testDeltaCompare(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
@@ -1 +0,0 @@
1
- {"version":3,"file":"y-text.tests.d.ts","sourceRoot":"","sources":["../../tests/y-text.tests.js"],"names":[],"mappings":"AAcO,kCAFI,CAAC,CAAC,QAAQ,QAgSpB;AAMM,mCAFI,CAAC,CAAC,QAAQ,QAu5BpB;AASM,uDAFI,CAAC,CAAC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;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"}
@@ -1,14 +0,0 @@
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 testClone(_tc: t.TestCase): void;
7
- export function testFormattingBug(_tc: t.TestCase): void;
8
- export function testElement(_tc: t.TestCase): void;
9
- export function testFragmentAttributedContent(_tc: t.TestCase): void;
10
- export function testElementAttributedContent(_tc: t.TestCase): void;
11
- export function testElementAttributedContentViaDiffer(_tc: t.TestCase): void;
12
- export function testAttributionManagerSimpleExample(_tc: t.TestCase): void;
13
- import * as t from 'lib0/testing';
14
- //# sourceMappingURL=y-xml.tests.d.ts.map
@@ -1 +0,0 @@
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,QAapB;AAKM,yCAFI,CAAC,CAAC,QAAQ,QAWpB;AAKM,kCAFI,CAAC,CAAC,QAAQ,QAUpB;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,QA8BpB;AAKM,2DAFI,CAAC,CAAC,QAAQ,QAiFpB;AAKM,yDAFI,CAAC,CAAC,QAAQ,QAuEpB;mBA1VkB,cAAc"}
package/src/internals.js DELETED
@@ -1,35 +0,0 @@
1
- export * from './utils/IdSet.js'
2
- export * from './utils/Doc.js'
3
- export * from './utils/UpdateDecoder.js'
4
- export * from './utils/UpdateEncoder.js'
5
- export * from './utils/encoding.js'
6
- export * from './utils/EventHandler.js'
7
- export * from './utils/ID.js'
8
- export * from './utils/isParentOf.js'
9
- export * from './utils/logging.js'
10
- export * from './utils/RelativePosition.js'
11
- export * from './utils/Snapshot.js'
12
- export * from './utils/StructStore.js'
13
- export * from './utils/Transaction.js'
14
- export * from './utils/UndoManager.js'
15
- export * from './utils/updates.js'
16
- export * from './utils/YEvent.js'
17
- export * from './utils/BlockSet.js'
18
- export * from './utils/IdMap.js'
19
- export * from './utils/AttributionManager.js'
20
- export * from './utils/delta-helpers.js'
21
- export * from './utils/meta.js'
22
- export * from './ytype.js'
23
- export * from './structs/AbstractStruct.js'
24
- export * from './structs/GC.js'
25
- export * from './structs/ContentBinary.js'
26
- export * from './structs/ContentDeleted.js'
27
- export * from './structs/ContentDoc.js'
28
- export * from './structs/ContentEmbed.js'
29
- export * from './structs/ContentFormat.js'
30
- export * from './structs/ContentJSON.js'
31
- export * from './structs/ContentAny.js'
32
- export * from './structs/ContentString.js'
33
- export * from './structs/ContentType.js'
34
- export * from './structs/Item.js'
35
- export * from './structs/Skip.js'
@@ -1,115 +0,0 @@
1
- import {
2
- UpdateEncoderV1, UpdateEncoderV2, UpdateDecoderV1, UpdateDecoderV2, Transaction, Item, StructStore // eslint-disable-line
3
- } from '../internals.js'
4
-
5
- import * as env from 'lib0/environment'
6
- import * as object from 'lib0/object'
7
-
8
- const isDevMode = env.getVariable('node_env') === 'development'
9
-
10
- export class ContentAny {
11
- /**
12
- * @param {Array<any>} arr
13
- */
14
- constructor (arr) {
15
- /**
16
- * @type {Array<any>}
17
- */
18
- this.arr = arr
19
- isDevMode && object.deepFreeze(arr)
20
- }
21
-
22
- /**
23
- * @return {number}
24
- */
25
- getLength () {
26
- return this.arr.length
27
- }
28
-
29
- /**
30
- * @return {Array<any>}
31
- */
32
- getContent () {
33
- return this.arr
34
- }
35
-
36
- /**
37
- * @return {boolean}
38
- */
39
- isCountable () {
40
- return true
41
- }
42
-
43
- /**
44
- * @return {ContentAny}
45
- */
46
- copy () {
47
- return new ContentAny(this.arr)
48
- }
49
-
50
- /**
51
- * @param {number} offset
52
- * @return {ContentAny}
53
- */
54
- splice (offset) {
55
- const right = new ContentAny(this.arr.slice(offset))
56
- this.arr = this.arr.slice(0, offset)
57
- return right
58
- }
59
-
60
- /**
61
- * @param {ContentAny} right
62
- * @return {boolean}
63
- */
64
- mergeWith (right) {
65
- this.arr = this.arr.concat(right.arr)
66
- return true
67
- }
68
-
69
- /**
70
- * @param {Transaction} transaction
71
- * @param {Item} item
72
- */
73
- integrate (transaction, item) {}
74
- /**
75
- * @param {Transaction} transaction
76
- */
77
- delete (transaction) {}
78
- /**
79
- * @param {Transaction} _tr
80
- */
81
- gc (_tr) {}
82
- /**
83
- * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
84
- * @param {number} offset
85
- * @param {number} offsetEnd
86
- */
87
- write (encoder, offset, offsetEnd) {
88
- const end = this.arr.length - offsetEnd
89
- encoder.writeLen(end - offset)
90
- for (let i = offset; i < end; i++) {
91
- const c = this.arr[i]
92
- encoder.writeAny(c)
93
- }
94
- }
95
-
96
- /**
97
- * @return {number}
98
- */
99
- getRef () {
100
- return 8
101
- }
102
- }
103
-
104
- /**
105
- * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder
106
- * @return {ContentAny}
107
- */
108
- export const readContentAny = decoder => {
109
- const len = decoder.readLen()
110
- const cs = []
111
- for (let i = 0; i < len; i++) {
112
- cs.push(decoder.readAny())
113
- }
114
- return new ContentAny(cs)
115
- }
@@ -1,93 +0,0 @@
1
- import {
2
- UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Item, Transaction // eslint-disable-line
3
- } from '../internals.js'
4
-
5
- import * as error from 'lib0/error'
6
-
7
- export class ContentBinary {
8
- /**
9
- * @param {Uint8Array} content
10
- */
11
- constructor (content) {
12
- this.content = content
13
- }
14
-
15
- /**
16
- * @return {number}
17
- */
18
- getLength () {
19
- return 1
20
- }
21
-
22
- /**
23
- * @return {Array<any>}
24
- */
25
- getContent () {
26
- return [this.content]
27
- }
28
-
29
- /**
30
- * @return {boolean}
31
- */
32
- isCountable () {
33
- return true
34
- }
35
-
36
- /**
37
- * @return {ContentBinary}
38
- */
39
- copy () {
40
- return new ContentBinary(this.content)
41
- }
42
-
43
- /**
44
- * @param {number} offset
45
- * @return {ContentBinary}
46
- */
47
- splice (offset) {
48
- throw error.methodUnimplemented()
49
- }
50
-
51
- /**
52
- * @param {ContentBinary} right
53
- * @return {boolean}
54
- */
55
- mergeWith (right) {
56
- return false
57
- }
58
-
59
- /**
60
- * @param {Transaction} transaction
61
- * @param {Item} item
62
- */
63
- integrate (transaction, item) {}
64
- /**
65
- * @param {Transaction} transaction
66
- */
67
- delete (transaction) {}
68
- /**
69
- * @param {Transaction} _tr
70
- */
71
- gc (_tr) {}
72
- /**
73
- * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
74
- * @param {number} _offset
75
- * @param {number} _offsetEnd
76
- */
77
- write (encoder, _offset, _offsetEnd) {
78
- encoder.writeBuf(this.content)
79
- }
80
-
81
- /**
82
- * @return {number}
83
- */
84
- getRef () {
85
- return 3
86
- }
87
- }
88
-
89
- /**
90
- * @param {UpdateDecoderV1 | UpdateDecoderV2 } decoder
91
- * @return {ContentBinary}
92
- */
93
- export const readContentBinary = decoder => new ContentBinary(decoder.readBuf())
@@ -1,101 +0,0 @@
1
- import {
2
- addToIdSet,
3
- UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Item, Transaction // eslint-disable-line
4
- } from '../internals.js'
5
-
6
- export class ContentDeleted {
7
- /**
8
- * @param {number} len
9
- */
10
- constructor (len) {
11
- this.len = len
12
- }
13
-
14
- /**
15
- * @return {number}
16
- */
17
- getLength () {
18
- return this.len
19
- }
20
-
21
- /**
22
- * @return {Array<any>}
23
- */
24
- getContent () {
25
- return []
26
- }
27
-
28
- /**
29
- * @return {boolean}
30
- */
31
- isCountable () {
32
- return false
33
- }
34
-
35
- /**
36
- * @return {ContentDeleted}
37
- */
38
- copy () {
39
- return new ContentDeleted(this.len)
40
- }
41
-
42
- /**
43
- * @param {number} offset
44
- * @return {ContentDeleted}
45
- */
46
- splice (offset) {
47
- const right = new ContentDeleted(this.len - offset)
48
- this.len = offset
49
- return right
50
- }
51
-
52
- /**
53
- * @param {ContentDeleted} right
54
- * @return {boolean}
55
- */
56
- mergeWith (right) {
57
- this.len += right.len
58
- return true
59
- }
60
-
61
- /**
62
- * @param {Transaction} transaction
63
- * @param {Item} item
64
- */
65
- integrate (transaction, item) {
66
- addToIdSet(transaction.deleteSet, item.id.client, item.id.clock, this.len)
67
- item.markDeleted()
68
- }
69
-
70
- /**
71
- * @param {Transaction} _transaction
72
- */
73
- delete (_transaction) {}
74
- /**
75
- * @param {Transaction} _tr
76
- */
77
- gc (_tr) {}
78
- /**
79
- * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
80
- * @param {number} offset
81
- * @param {number} offsetEnd
82
- */
83
- write (encoder, offset, offsetEnd) {
84
- encoder.writeLen(this.len - offset - offsetEnd)
85
- }
86
-
87
- /**
88
- * @return {number}
89
- */
90
- getRef () {
91
- return 1
92
- }
93
- }
94
-
95
- /**
96
- * @private
97
- *
98
- * @param {UpdateDecoderV1 | UpdateDecoderV2 } decoder
99
- * @return {ContentDeleted}
100
- */
101
- export const readContentDeleted = decoder => new ContentDeleted(decoder.readLen())
@@ -1,141 +0,0 @@
1
- import {
2
- Doc, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, Item // eslint-disable-line
3
- } from '../internals.js'
4
-
5
- import * as error from 'lib0/error'
6
-
7
- /**
8
- * @param {string} guid
9
- * @param {Object<string, any>} opts
10
- */
11
- const createDocFromOpts = (guid, opts) => new Doc({ guid, ...opts, shouldLoad: opts.shouldLoad || opts.autoLoad || false })
12
-
13
- /**
14
- * @private
15
- */
16
- export class ContentDoc {
17
- /**
18
- * @param {Doc} doc
19
- */
20
- constructor (doc) {
21
- if (doc._item) {
22
- console.error('This document was already integrated as a sub-document. You should create a second instance instead with the same guid.')
23
- }
24
- /**
25
- * @type {Doc}
26
- */
27
- this.doc = doc
28
- /**
29
- * @type {any}
30
- */
31
- const opts = {}
32
- this.opts = opts
33
- if (!doc.gc) {
34
- opts.gc = false
35
- }
36
- if (doc.autoLoad) {
37
- opts.autoLoad = true
38
- }
39
- if (doc.meta !== null) {
40
- opts.meta = doc.meta
41
- }
42
- }
43
-
44
- /**
45
- * @return {number}
46
- */
47
- getLength () {
48
- return 1
49
- }
50
-
51
- /**
52
- * @return {Array<any>}
53
- */
54
- getContent () {
55
- return [this.doc]
56
- }
57
-
58
- /**
59
- * @return {boolean}
60
- */
61
- isCountable () {
62
- return true
63
- }
64
-
65
- /**
66
- * @return {ContentDoc}
67
- */
68
- copy () {
69
- return new ContentDoc(createDocFromOpts(this.doc.guid, this.opts))
70
- }
71
-
72
- /**
73
- * @param {number} offset
74
- * @return {ContentDoc}
75
- */
76
- splice (offset) {
77
- throw error.methodUnimplemented()
78
- }
79
-
80
- /**
81
- * @param {ContentDoc} right
82
- * @return {boolean}
83
- */
84
- mergeWith (right) {
85
- return false
86
- }
87
-
88
- /**
89
- * @param {Transaction} transaction
90
- * @param {Item} item
91
- */
92
- integrate (transaction, item) {
93
- // this needs to be reflected in doc.destroy as well
94
- this.doc._item = item
95
- transaction.subdocsAdded.add(this.doc)
96
- if (this.doc.shouldLoad) {
97
- transaction.subdocsLoaded.add(this.doc)
98
- }
99
- }
100
-
101
- /**
102
- * @param {Transaction} transaction
103
- */
104
- delete (transaction) {
105
- if (transaction.subdocsAdded.has(this.doc)) {
106
- transaction.subdocsAdded.delete(this.doc)
107
- } else {
108
- transaction.subdocsRemoved.add(this.doc)
109
- }
110
- }
111
-
112
- /**
113
- * @param {Transaction} _tr
114
- */
115
- gc (_tr) {}
116
-
117
- /**
118
- * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
119
- * @param {number} _offset
120
- * @param {number} _offsetEnd
121
- */
122
- write (encoder, _offset, _offsetEnd) {
123
- encoder.writeString(this.doc.guid)
124
- encoder.writeAny(this.opts)
125
- }
126
-
127
- /**
128
- * @return {number}
129
- */
130
- getRef () {
131
- return 9
132
- }
133
- }
134
-
135
- /**
136
- * @private
137
- *
138
- * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder
139
- * @return {ContentDoc}
140
- */
141
- export const readContentDoc = decoder => new ContentDoc(createDocFromOpts(decoder.readString(), decoder.readAny()))