@fluidframework/tree 2.74.0 → 2.81.0-374083

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 (1318) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/api-report/tree.alpha.api.md +63 -9
  3. package/dist/alpha.d.ts +9 -0
  4. package/dist/codec/codec.d.ts +31 -3
  5. package/dist/codec/codec.d.ts.map +1 -1
  6. package/dist/codec/codec.js +10 -0
  7. package/dist/codec/codec.js.map +1 -1
  8. package/dist/codec/index.d.ts +2 -2
  9. package/dist/codec/index.d.ts.map +1 -1
  10. package/dist/codec/index.js +2 -2
  11. package/dist/codec/index.js.map +1 -1
  12. package/dist/codec/versioned/codec.d.ts +80 -22
  13. package/dist/codec/versioned/codec.d.ts.map +1 -1
  14. package/dist/codec/versioned/codec.js +137 -15
  15. package/dist/codec/versioned/codec.js.map +1 -1
  16. package/dist/codec/versioned/index.d.ts +1 -1
  17. package/dist/codec/versioned/index.d.ts.map +1 -1
  18. package/dist/codec/versioned/index.js +2 -2
  19. package/dist/codec/versioned/index.js.map +1 -1
  20. package/dist/core/change-family/changeFamily.d.ts +4 -1
  21. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  22. package/dist/core/change-family/changeFamily.js.map +1 -1
  23. package/dist/core/change-family/index.d.ts +1 -1
  24. package/dist/core/change-family/index.d.ts.map +1 -1
  25. package/dist/core/change-family/index.js.map +1 -1
  26. package/dist/core/index.d.ts +3 -3
  27. package/dist/core/index.d.ts.map +1 -1
  28. package/dist/core/index.js +7 -6
  29. package/dist/core/index.js.map +1 -1
  30. package/dist/core/rebase/changeRebaser.d.ts +42 -3
  31. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  32. package/dist/core/rebase/changeRebaser.js.map +1 -1
  33. package/dist/core/rebase/index.d.ts +2 -2
  34. package/dist/core/rebase/index.d.ts.map +1 -1
  35. package/dist/core/rebase/index.js +2 -2
  36. package/dist/core/rebase/index.js.map +1 -1
  37. package/dist/core/rebase/types.d.ts +52 -10
  38. package/dist/core/rebase/types.d.ts.map +1 -1
  39. package/dist/core/rebase/types.js +5 -12
  40. package/dist/core/rebase/types.js.map +1 -1
  41. package/dist/core/rebase/utils.d.ts.map +1 -1
  42. package/dist/core/rebase/utils.js +33 -11
  43. package/dist/core/rebase/utils.js.map +1 -1
  44. package/dist/core/schema-stored/schema.js +3 -3
  45. package/dist/core/schema-stored/schema.js.map +1 -1
  46. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  47. package/dist/core/tree/anchorSet.js +4 -4
  48. package/dist/core/tree/anchorSet.js.map +1 -1
  49. package/dist/core/tree/detachedFieldIndex.d.ts +7 -2
  50. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  51. package/dist/core/tree/detachedFieldIndex.js +21 -56
  52. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  53. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +18 -10
  54. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  55. package/dist/core/tree/detachedFieldIndexCodecCommon.js +6 -6
  56. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  57. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +2 -3
  58. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  59. package/dist/core/tree/detachedFieldIndexCodecV1.js +4 -5
  60. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  61. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts +2 -3
  62. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  63. package/dist/core/tree/detachedFieldIndexCodecV2.js +4 -6
  64. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  65. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +5 -6
  66. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  67. package/dist/core/tree/detachedFieldIndexCodecs.js +11 -41
  68. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  69. package/dist/core/tree/index.d.ts +2 -2
  70. package/dist/core/tree/index.d.ts.map +1 -1
  71. package/dist/core/tree/index.js +5 -4
  72. package/dist/core/tree/index.js.map +1 -1
  73. package/dist/core/tree/mapTree.js +1 -1
  74. package/dist/core/tree/mapTree.js.map +1 -1
  75. package/dist/core/tree/pathTree.d.ts +11 -3
  76. package/dist/core/tree/pathTree.d.ts.map +1 -1
  77. package/dist/core/tree/pathTree.js +14 -2
  78. package/dist/core/tree/pathTree.js.map +1 -1
  79. package/dist/core/tree/sparseTree.d.ts.map +1 -1
  80. package/dist/core/tree/sparseTree.js +1 -0
  81. package/dist/core/tree/sparseTree.js.map +1 -1
  82. package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
  83. package/dist/core/tree/treeTextFormat.js +5 -9
  84. package/dist/core/tree/treeTextFormat.js.map +1 -1
  85. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  86. package/dist/core/tree/visitDelta.js +3 -2
  87. package/dist/core/tree/visitDelta.js.map +1 -1
  88. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  89. package/dist/core/tree/visitorUtils.js +58 -18
  90. package/dist/core/tree/visitorUtils.js.map +1 -1
  91. package/dist/feature-libraries/changeAtomIdBTree.d.ts +16 -0
  92. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -0
  93. package/dist/feature-libraries/changeAtomIdBTree.js +30 -0
  94. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -0
  95. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  96. package/dist/feature-libraries/chunked-forest/basicChunk.js +8 -1
  97. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  98. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  99. package/dist/feature-libraries/chunked-forest/chunkTree.js +4 -1
  100. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  101. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  102. package/dist/feature-libraries/chunked-forest/chunkedForest.js +9 -7
  103. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  104. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  105. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +7 -4
  106. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  107. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  108. package/dist/feature-libraries/chunked-forest/codec/codecs.js +19 -11
  109. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  110. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -3
  111. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  112. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +9 -5
  113. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  114. package/dist/feature-libraries/chunked-forest/uniformChunk.js +1 -1
  115. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  116. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +103 -44
  117. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  118. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +251 -77
  119. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  120. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
  121. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  122. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +22 -3
  123. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  124. package/dist/feature-libraries/default-schema/index.d.ts +2 -1
  125. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  126. package/dist/feature-libraries/default-schema/index.js +5 -2
  127. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  128. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +38 -0
  129. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  130. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +132 -0
  131. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  132. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +9 -6
  133. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  134. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +21 -0
  135. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  136. package/dist/feature-libraries/deltaUtils.d.ts +1 -0
  137. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  138. package/dist/feature-libraries/deltaUtils.js +6 -1
  139. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  140. package/dist/feature-libraries/flex-tree/context.d.ts +9 -0
  141. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  142. package/dist/feature-libraries/flex-tree/context.js +6 -0
  143. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  144. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  145. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  146. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  147. package/dist/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  148. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  149. package/dist/feature-libraries/flex-tree/lazyField.js +44 -15
  150. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  151. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  152. package/dist/feature-libraries/forest-summary/forestSummarizer.js +3 -1
  153. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  154. package/dist/feature-libraries/index.d.ts +5 -4
  155. package/dist/feature-libraries/index.d.ts.map +1 -1
  156. package/dist/feature-libraries/index.js +15 -8
  157. package/dist/feature-libraries/index.js.map +1 -1
  158. package/dist/feature-libraries/indexing/anchorTreeIndex.js +6 -6
  159. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  160. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  161. package/dist/feature-libraries/mapTreeCursor.js +1 -0
  162. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  163. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  164. package/dist/feature-libraries/mitigatedChangeFamily.js +12 -3
  165. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  166. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  167. package/dist/feature-libraries/modular-schema/comparison.js +12 -9
  168. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  169. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  170. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  171. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -7
  172. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  173. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +25 -0
  174. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -0
  175. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +59 -0
  176. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -0
  177. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +22 -53
  178. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  179. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  180. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  181. package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -13
  182. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  183. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +2 -2
  184. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  185. package/dist/feature-libraries/modular-schema/index.d.ts +7 -5
  186. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  187. package/dist/feature-libraries/modular-schema/index.js +12 -8
  188. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  189. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +32 -0
  190. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
  191. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +409 -0
  192. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
  193. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +15 -0
  194. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
  195. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +31 -0
  196. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
  197. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +15 -0
  198. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +1 -0
  199. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js +393 -0
  200. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js.map +1 -0
  201. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  202. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  203. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +32 -288
  204. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  205. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +60 -26
  206. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  207. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1519 -615
  208. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  209. package/{lib/feature-libraries/modular-schema/modularChangeFormat.d.ts → dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts} +5 -6
  210. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
  211. package/dist/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +7 -7
  212. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
  213. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +112 -0
  214. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
  215. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +21 -0
  216. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
  217. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +146 -0
  218. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +1 -0
  219. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js +32 -0
  220. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js.map +1 -0
  221. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +59 -13
  222. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  223. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +3 -3
  224. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  225. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -1
  226. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  227. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  228. package/dist/feature-libraries/object-forest/objectForest.js +7 -5
  229. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  230. package/dist/feature-libraries/optional-field/index.d.ts +2 -2
  231. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  232. package/dist/feature-libraries/optional-field/index.js +1 -2
  233. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  234. package/dist/feature-libraries/optional-field/optionalField.d.ts +5 -26
  235. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  236. package/dist/feature-libraries/optional-field/optionalField.js +223 -450
  237. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  238. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  239. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  240. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +31 -0
  241. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  242. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  243. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  244. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  245. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  246. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  247. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +57 -28
  248. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  249. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  250. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  251. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +57 -0
  252. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  253. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  254. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  255. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  256. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  257. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +14 -2
  258. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  259. package/dist/feature-libraries/schema-index/codec.d.ts +7 -21
  260. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  261. package/dist/feature-libraries/schema-index/codec.js +28 -70
  262. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  263. package/dist/feature-libraries/schema-index/index.d.ts +2 -2
  264. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  265. package/dist/feature-libraries/schema-index/index.js +2 -5
  266. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  267. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -9
  268. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  269. package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -12
  270. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  271. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
  272. package/dist/feature-libraries/schemaChecker.js +11 -6
  273. package/dist/feature-libraries/schemaChecker.js.map +1 -1
  274. package/dist/feature-libraries/sequence-field/compose.d.ts +6 -7
  275. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  276. package/dist/feature-libraries/sequence-field/compose.js +91 -263
  277. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  278. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  279. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  280. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  281. package/dist/feature-libraries/sequence-field/index.d.ts +2 -3
  282. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  283. package/dist/feature-libraries/sequence-field/index.js +1 -3
  284. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  285. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  286. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  287. package/dist/feature-libraries/sequence-field/invert.js +67 -168
  288. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  289. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  290. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  291. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  292. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  293. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  294. package/dist/feature-libraries/sequence-field/moveEffectTable.js +10 -87
  295. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  296. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  297. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  298. package/dist/feature-libraries/sequence-field/rebase.js +120 -119
  299. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  300. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
  301. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  302. package/dist/feature-libraries/sequence-field/replaceRevisions.js +35 -43
  303. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  304. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  305. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  306. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  307. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  308. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  309. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +365 -179
  310. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  311. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  312. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +20 -60
  313. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  314. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  315. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  316. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  317. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  318. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  319. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  320. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +20 -112
  321. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  322. package/dist/feature-libraries/sequence-field/types.d.ts +30 -59
  323. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  324. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  325. package/dist/feature-libraries/sequence-field/utils.d.ts +15 -24
  326. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  327. package/dist/feature-libraries/sequence-field/utils.js +148 -318
  328. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  329. package/dist/feature-libraries/treeCursorUtils.js +7 -7
  330. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  331. package/dist/feature-libraries/treeTextCursor.js +2 -2
  332. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  333. package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
  334. package/dist/feature-libraries/valueUtilities.js +16 -8
  335. package/dist/feature-libraries/valueUtilities.js.map +1 -1
  336. package/dist/index.d.ts +4 -3
  337. package/dist/index.d.ts.map +1 -1
  338. package/dist/index.js +4 -1
  339. package/dist/index.js.map +1 -1
  340. package/dist/packageVersion.d.ts +1 -1
  341. package/dist/packageVersion.d.ts.map +1 -1
  342. package/dist/packageVersion.js +1 -1
  343. package/dist/packageVersion.js.map +1 -1
  344. package/dist/shared-tree/index.d.ts +1 -1
  345. package/dist/shared-tree/index.d.ts.map +1 -1
  346. package/dist/shared-tree/index.js.map +1 -1
  347. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  348. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  349. package/dist/shared-tree/schematizeTree.js +2 -1
  350. package/dist/shared-tree/schematizeTree.js.map +1 -1
  351. package/dist/shared-tree/schematizingTreeView.d.ts +3 -8
  352. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  353. package/dist/shared-tree/schematizingTreeView.js +58 -44
  354. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  355. package/dist/shared-tree/sharedTree.d.ts +9 -3
  356. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  357. package/dist/shared-tree/sharedTree.js +72 -44
  358. package/dist/shared-tree/sharedTree.js.map +1 -1
  359. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  360. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  361. package/dist/shared-tree/sharedTreeChangeCodecs.js +10 -8
  362. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  363. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  364. package/dist/shared-tree/sharedTreeChangeEnricher.js +5 -3
  365. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  366. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +7 -6
  367. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  368. package/dist/shared-tree/sharedTreeChangeFamily.js +29 -18
  369. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  370. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  371. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  372. package/dist/shared-tree/sharedTreeEditBuilder.js +14 -7
  373. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  374. package/dist/shared-tree/treeAlpha.d.ts +35 -29
  375. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  376. package/dist/shared-tree/treeAlpha.js +21 -23
  377. package/dist/shared-tree/treeAlpha.js.map +1 -1
  378. package/dist/shared-tree/treeCheckout.d.ts +11 -10
  379. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  380. package/dist/shared-tree/treeCheckout.js +93 -25
  381. package/dist/shared-tree/treeCheckout.js.map +1 -1
  382. package/dist/shared-tree-core/branch.d.ts +6 -3
  383. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  384. package/dist/shared-tree-core/branch.js +13 -6
  385. package/dist/shared-tree-core/branch.js.map +1 -1
  386. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  387. package/dist/shared-tree-core/branchCommitEnricher.js +1 -1
  388. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  389. package/dist/shared-tree-core/editManager.d.ts +2 -2
  390. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  391. package/dist/shared-tree-core/editManager.js +21 -15
  392. package/dist/shared-tree-core/editManager.js.map +1 -1
  393. package/dist/shared-tree-core/editManagerCodecs.d.ts +4 -0
  394. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  395. package/dist/shared-tree-core/editManagerCodecs.js +18 -5
  396. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  397. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +2 -0
  398. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  399. package/dist/shared-tree-core/editManagerFormatCommons.js +12 -0
  400. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  401. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  402. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  403. package/dist/shared-tree-core/editManagerFormatV1toV4.js +2 -0
  404. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  405. package/dist/shared-tree-core/editManagerSummarizer.js +3 -3
  406. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  407. package/dist/shared-tree-core/index.d.ts +2 -2
  408. package/dist/shared-tree-core/index.d.ts.map +1 -1
  409. package/dist/shared-tree-core/index.js +3 -1
  410. package/dist/shared-tree-core/index.js.map +1 -1
  411. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  412. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  413. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  414. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  415. package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -1
  416. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  417. package/dist/shared-tree-core/messageCodecs.d.ts +4 -0
  418. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  419. package/dist/shared-tree-core/messageCodecs.js +17 -5
  420. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  421. package/dist/shared-tree-core/messageFormat.d.ts +2 -0
  422. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  423. package/dist/shared-tree-core/messageFormat.js +12 -0
  424. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  425. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  426. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  427. package/dist/shared-tree-core/messageFormatV1ToV4.js +9 -1
  428. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  429. package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  430. package/dist/shared-tree-core/sequenceIdUtils.js +4 -4
  431. package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
  432. package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -0
  433. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  434. package/dist/shared-tree-core/sharedTreeCore.js +13 -9
  435. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  436. package/dist/shared-tree-core/transaction.d.ts +25 -8
  437. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  438. package/dist/shared-tree-core/transaction.js +65 -30
  439. package/dist/shared-tree-core/transaction.js.map +1 -1
  440. package/dist/shared-tree-core/transactionEnricher.d.ts +2 -2
  441. package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  442. package/dist/shared-tree-core/transactionEnricher.js +3 -3
  443. package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
  444. package/dist/simple-tree/api/configuration.js +1 -1
  445. package/dist/simple-tree/api/configuration.js.map +1 -1
  446. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  447. package/dist/simple-tree/api/customTree.js +13 -9
  448. package/dist/simple-tree/api/customTree.js.map +1 -1
  449. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  450. package/dist/simple-tree/api/discrepancies.js +21 -17
  451. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  452. package/dist/simple-tree/api/index.d.ts +2 -2
  453. package/dist/simple-tree/api/index.d.ts.map +1 -1
  454. package/dist/simple-tree/api/index.js +2 -1
  455. package/dist/simple-tree/api/index.js.map +1 -1
  456. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  457. package/dist/simple-tree/api/schemaFactory.js +12 -8
  458. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  459. package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -1
  460. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  461. package/dist/simple-tree/api/schemaFactoryBeta.js +1 -1
  462. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  463. package/dist/simple-tree/api/schemaFromSimple.js +18 -9
  464. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  465. package/dist/simple-tree/api/simpleSchemaCodec.js +10 -5
  466. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  467. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  468. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +19 -15
  469. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  470. package/dist/simple-tree/api/simpleTreeIndex.js +10 -10
  471. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  472. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
  473. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  474. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +297 -1
  475. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  476. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  477. package/dist/simple-tree/api/storedSchema.js +2 -3
  478. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  479. package/dist/simple-tree/api/transactionTypes.d.ts +17 -4
  480. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  481. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  482. package/dist/simple-tree/api/tree.d.ts +3 -1
  483. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  484. package/dist/simple-tree/api/tree.js.map +1 -1
  485. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  486. package/dist/simple-tree/api/treeNodeApi.js +21 -13
  487. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  488. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  489. package/dist/simple-tree/api/verboseTree.js +14 -9
  490. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  491. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  492. package/dist/simple-tree/core/treeNodeKernel.js +12 -5
  493. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  494. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  495. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  496. package/dist/simple-tree/core/unhydratedFlexTree.js +79 -23
  497. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  498. package/dist/simple-tree/fieldSchema.d.ts +4 -4
  499. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  500. package/dist/simple-tree/fieldSchema.js.map +1 -1
  501. package/dist/simple-tree/getTreeNodeForField.d.ts.map +1 -1
  502. package/dist/simple-tree/getTreeNodeForField.js +2 -1
  503. package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
  504. package/dist/simple-tree/index.d.ts +3 -3
  505. package/dist/simple-tree/index.d.ts.map +1 -1
  506. package/dist/simple-tree/index.js +4 -3
  507. package/dist/simple-tree/index.js.map +1 -1
  508. package/dist/simple-tree/leafNodeSchema.js +9 -6
  509. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  510. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  511. package/dist/simple-tree/node-kinds/array/arrayNode.js +22 -20
  512. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  513. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  514. package/dist/simple-tree/node-kinds/common.js +1 -1
  515. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  516. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
  517. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  518. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  519. package/dist/simple-tree/node-kinds/object/objectNode.js +21 -22
  520. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  521. package/dist/simple-tree/node-kinds/record/recordNode.js +6 -5
  522. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  523. package/dist/simple-tree/prepareForInsertion.d.ts +54 -47
  524. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  525. package/dist/simple-tree/prepareForInsertion.js +184 -126
  526. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  527. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  528. package/dist/simple-tree/toStoredSchema.js +9 -5
  529. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  530. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  531. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  532. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +31 -13
  533. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  534. package/dist/text/index.d.ts +6 -0
  535. package/dist/text/index.d.ts.map +1 -0
  536. package/dist/text/index.js +10 -0
  537. package/dist/text/index.js.map +1 -0
  538. package/dist/text/textDomain.d.ts +138 -0
  539. package/dist/text/textDomain.d.ts.map +1 -0
  540. package/dist/text/textDomain.js +121 -0
  541. package/dist/text/textDomain.js.map +1 -0
  542. package/dist/treeFactory.d.ts.map +1 -1
  543. package/dist/treeFactory.js +17 -3
  544. package/dist/treeFactory.js.map +1 -1
  545. package/dist/util/bTreeUtils.d.ts +12 -4
  546. package/dist/util/bTreeUtils.d.ts.map +1 -1
  547. package/dist/util/bTreeUtils.js +15 -19
  548. package/dist/util/bTreeUtils.js.map +1 -1
  549. package/dist/util/breakable.js +7 -9
  550. package/dist/util/breakable.js.map +1 -1
  551. package/dist/util/idAllocator.d.ts.map +1 -1
  552. package/dist/util/idAllocator.js +1 -2
  553. package/dist/util/idAllocator.js.map +1 -1
  554. package/dist/util/index.d.ts +1 -1
  555. package/dist/util/index.d.ts.map +1 -1
  556. package/dist/util/index.js +2 -1
  557. package/dist/util/index.js.map +1 -1
  558. package/dist/util/nestedMap.d.ts.map +1 -1
  559. package/dist/util/nestedMap.js +13 -13
  560. package/dist/util/nestedMap.js.map +1 -1
  561. package/dist/util/rangeMap.d.ts +24 -12
  562. package/dist/util/rangeMap.d.ts.map +1 -1
  563. package/dist/util/rangeMap.js +46 -6
  564. package/dist/util/rangeMap.js.map +1 -1
  565. package/dist/util/utils.d.ts.map +1 -1
  566. package/dist/util/utils.js +16 -15
  567. package/dist/util/utils.js.map +1 -1
  568. package/docs/user-facing/merge-semantics.md +3 -2
  569. package/eslint.config.mts +5 -48
  570. package/lib/alpha.d.ts +9 -0
  571. package/lib/codec/codec.d.ts +31 -3
  572. package/lib/codec/codec.d.ts.map +1 -1
  573. package/lib/codec/codec.js +10 -0
  574. package/lib/codec/codec.js.map +1 -1
  575. package/lib/codec/index.d.ts +2 -2
  576. package/lib/codec/index.d.ts.map +1 -1
  577. package/lib/codec/index.js +1 -1
  578. package/lib/codec/index.js.map +1 -1
  579. package/lib/codec/versioned/codec.d.ts +80 -22
  580. package/lib/codec/versioned/codec.d.ts.map +1 -1
  581. package/lib/codec/versioned/codec.js +138 -15
  582. package/lib/codec/versioned/codec.js.map +1 -1
  583. package/lib/codec/versioned/index.d.ts +1 -1
  584. package/lib/codec/versioned/index.d.ts.map +1 -1
  585. package/lib/codec/versioned/index.js +1 -1
  586. package/lib/codec/versioned/index.js.map +1 -1
  587. package/lib/core/change-family/changeFamily.d.ts +4 -1
  588. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  589. package/lib/core/change-family/changeFamily.js.map +1 -1
  590. package/lib/core/change-family/index.d.ts +1 -1
  591. package/lib/core/change-family/index.d.ts.map +1 -1
  592. package/lib/core/change-family/index.js.map +1 -1
  593. package/lib/core/index.d.ts +3 -3
  594. package/lib/core/index.d.ts.map +1 -1
  595. package/lib/core/index.js +2 -2
  596. package/lib/core/index.js.map +1 -1
  597. package/lib/core/rebase/changeRebaser.d.ts +42 -3
  598. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  599. package/lib/core/rebase/changeRebaser.js.map +1 -1
  600. package/lib/core/rebase/index.d.ts +2 -2
  601. package/lib/core/rebase/index.d.ts.map +1 -1
  602. package/lib/core/rebase/index.js +1 -1
  603. package/lib/core/rebase/index.js.map +1 -1
  604. package/lib/core/rebase/types.d.ts +52 -10
  605. package/lib/core/rebase/types.d.ts.map +1 -1
  606. package/lib/core/rebase/types.js +3 -10
  607. package/lib/core/rebase/types.js.map +1 -1
  608. package/lib/core/rebase/utils.d.ts.map +1 -1
  609. package/lib/core/rebase/utils.js +33 -11
  610. package/lib/core/rebase/utils.js.map +1 -1
  611. package/lib/core/schema-stored/schema.js +3 -3
  612. package/lib/core/schema-stored/schema.js.map +1 -1
  613. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  614. package/lib/core/tree/anchorSet.js +4 -4
  615. package/lib/core/tree/anchorSet.js.map +1 -1
  616. package/lib/core/tree/detachedFieldIndex.d.ts +7 -2
  617. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  618. package/lib/core/tree/detachedFieldIndex.js +23 -58
  619. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  620. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +18 -10
  621. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  622. package/lib/core/tree/detachedFieldIndexCodecCommon.js +4 -4
  623. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  624. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +2 -3
  625. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  626. package/lib/core/tree/detachedFieldIndexCodecV1.js +4 -5
  627. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  628. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts +2 -3
  629. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  630. package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -6
  631. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  632. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +5 -6
  633. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  634. package/lib/core/tree/detachedFieldIndexCodecs.js +12 -39
  635. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  636. package/lib/core/tree/index.d.ts +2 -2
  637. package/lib/core/tree/index.d.ts.map +1 -1
  638. package/lib/core/tree/index.js +2 -2
  639. package/lib/core/tree/index.js.map +1 -1
  640. package/lib/core/tree/mapTree.js +1 -1
  641. package/lib/core/tree/mapTree.js.map +1 -1
  642. package/lib/core/tree/pathTree.d.ts +11 -3
  643. package/lib/core/tree/pathTree.d.ts.map +1 -1
  644. package/lib/core/tree/pathTree.js +12 -1
  645. package/lib/core/tree/pathTree.js.map +1 -1
  646. package/lib/core/tree/sparseTree.d.ts.map +1 -1
  647. package/lib/core/tree/sparseTree.js +1 -0
  648. package/lib/core/tree/sparseTree.js.map +1 -1
  649. package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
  650. package/lib/core/tree/treeTextFormat.js +5 -9
  651. package/lib/core/tree/treeTextFormat.js.map +1 -1
  652. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  653. package/lib/core/tree/visitDelta.js +3 -2
  654. package/lib/core/tree/visitDelta.js.map +1 -1
  655. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  656. package/lib/core/tree/visitorUtils.js +58 -18
  657. package/lib/core/tree/visitorUtils.js.map +1 -1
  658. package/lib/feature-libraries/changeAtomIdBTree.d.ts +16 -0
  659. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -0
  660. package/lib/feature-libraries/changeAtomIdBTree.js +24 -0
  661. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -0
  662. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  663. package/lib/feature-libraries/chunked-forest/basicChunk.js +9 -2
  664. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  665. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  666. package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -1
  667. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  668. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  669. package/lib/feature-libraries/chunked-forest/chunkedForest.js +9 -7
  670. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  671. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  672. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +7 -4
  673. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  674. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  675. package/lib/feature-libraries/chunked-forest/codec/codecs.js +19 -11
  676. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  677. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -3
  678. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  679. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +9 -5
  680. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  681. package/lib/feature-libraries/chunked-forest/uniformChunk.js +1 -1
  682. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  683. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +103 -44
  684. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  685. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +249 -78
  686. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  687. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
  688. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  689. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +22 -3
  690. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  691. package/lib/feature-libraries/default-schema/index.d.ts +2 -1
  692. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  693. package/lib/feature-libraries/default-schema/index.js +2 -1
  694. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  695. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +38 -0
  696. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  697. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +128 -0
  698. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  699. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +9 -6
  700. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  701. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +21 -0
  702. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  703. package/lib/feature-libraries/deltaUtils.d.ts +1 -0
  704. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  705. package/lib/feature-libraries/deltaUtils.js +5 -1
  706. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  707. package/lib/feature-libraries/flex-tree/context.d.ts +9 -0
  708. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  709. package/lib/feature-libraries/flex-tree/context.js +6 -0
  710. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  711. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  712. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  713. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  714. package/lib/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  715. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  716. package/lib/feature-libraries/flex-tree/lazyField.js +45 -16
  717. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  718. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  719. package/lib/feature-libraries/forest-summary/forestSummarizer.js +3 -1
  720. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  721. package/lib/feature-libraries/index.d.ts +5 -4
  722. package/lib/feature-libraries/index.d.ts.map +1 -1
  723. package/lib/feature-libraries/index.js +5 -4
  724. package/lib/feature-libraries/index.js.map +1 -1
  725. package/lib/feature-libraries/indexing/anchorTreeIndex.js +6 -6
  726. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  727. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  728. package/lib/feature-libraries/mapTreeCursor.js +2 -1
  729. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  730. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  731. package/lib/feature-libraries/mitigatedChangeFamily.js +12 -3
  732. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  733. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  734. package/lib/feature-libraries/modular-schema/comparison.js +12 -9
  735. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  736. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  737. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  738. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +3 -5
  739. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  740. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +25 -0
  741. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -0
  742. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +55 -0
  743. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -0
  744. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +22 -53
  745. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  746. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  747. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  748. package/lib/feature-libraries/modular-schema/genericFieldKind.js +8 -14
  749. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  750. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -1
  751. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  752. package/lib/feature-libraries/modular-schema/index.d.ts +7 -5
  753. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  754. package/lib/feature-libraries/modular-schema/index.js +5 -3
  755. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  756. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +32 -0
  757. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
  758. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +402 -0
  759. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
  760. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +15 -0
  761. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
  762. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +27 -0
  763. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
  764. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +15 -0
  765. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +1 -0
  766. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js +389 -0
  767. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js.map +1 -0
  768. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  769. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  770. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +34 -290
  771. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  772. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +60 -26
  773. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  774. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1441 -546
  775. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  776. package/{dist/feature-libraries/modular-schema/modularChangeFormat.d.ts → lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts} +5 -6
  777. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
  778. package/lib/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +4 -4
  779. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
  780. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +112 -0
  781. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
  782. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +18 -0
  783. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
  784. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +146 -0
  785. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +1 -0
  786. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js +29 -0
  787. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js.map +1 -0
  788. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +59 -13
  789. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  790. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +1 -1
  791. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  792. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -1
  793. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  794. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  795. package/lib/feature-libraries/object-forest/objectForest.js +7 -5
  796. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  797. package/lib/feature-libraries/optional-field/index.d.ts +2 -2
  798. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  799. package/lib/feature-libraries/optional-field/index.js +1 -1
  800. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  801. package/lib/feature-libraries/optional-field/optionalField.d.ts +5 -26
  802. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  803. package/lib/feature-libraries/optional-field/optionalField.js +223 -448
  804. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  805. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  806. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  807. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +27 -0
  808. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  809. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  810. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  811. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  812. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  813. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  814. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +55 -26
  815. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  816. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  817. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  818. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +53 -0
  819. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  820. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  821. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  822. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  823. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  824. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +15 -3
  825. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  826. package/lib/feature-libraries/schema-index/codec.d.ts +7 -21
  827. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  828. package/lib/feature-libraries/schema-index/codec.js +30 -68
  829. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  830. package/lib/feature-libraries/schema-index/index.d.ts +2 -2
  831. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  832. package/lib/feature-libraries/schema-index/index.js +2 -2
  833. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  834. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -9
  835. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  836. package/lib/feature-libraries/schema-index/schemaSummarizer.js +0 -10
  837. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  838. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
  839. package/lib/feature-libraries/schemaChecker.js +11 -6
  840. package/lib/feature-libraries/schemaChecker.js.map +1 -1
  841. package/lib/feature-libraries/sequence-field/compose.d.ts +6 -7
  842. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  843. package/lib/feature-libraries/sequence-field/compose.js +93 -265
  844. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  845. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  846. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  847. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  848. package/lib/feature-libraries/sequence-field/index.d.ts +2 -3
  849. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  850. package/lib/feature-libraries/sequence-field/index.js +0 -1
  851. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  852. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  853. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  854. package/lib/feature-libraries/sequence-field/invert.js +69 -170
  855. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  856. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  857. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  858. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  859. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  860. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  861. package/lib/feature-libraries/sequence-field/moveEffectTable.js +9 -81
  862. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  863. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  864. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  865. package/lib/feature-libraries/sequence-field/rebase.js +122 -121
  866. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  867. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
  868. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  869. package/lib/feature-libraries/sequence-field/replaceRevisions.js +36 -44
  870. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  871. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  872. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  873. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  874. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  875. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  876. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +356 -174
  877. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  878. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  879. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +21 -61
  880. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  881. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  882. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  883. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  884. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  885. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  886. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  887. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +20 -112
  888. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  889. package/lib/feature-libraries/sequence-field/types.d.ts +30 -59
  890. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  891. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  892. package/lib/feature-libraries/sequence-field/utils.d.ts +15 -24
  893. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  894. package/lib/feature-libraries/sequence-field/utils.js +144 -311
  895. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  896. package/lib/feature-libraries/treeCursorUtils.js +7 -7
  897. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  898. package/lib/feature-libraries/treeTextCursor.js +2 -2
  899. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  900. package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
  901. package/lib/feature-libraries/valueUtilities.js +16 -8
  902. package/lib/feature-libraries/valueUtilities.js.map +1 -1
  903. package/lib/index.d.ts +4 -3
  904. package/lib/index.d.ts.map +1 -1
  905. package/lib/index.js +2 -1
  906. package/lib/index.js.map +1 -1
  907. package/lib/packageVersion.d.ts +1 -1
  908. package/lib/packageVersion.d.ts.map +1 -1
  909. package/lib/packageVersion.js +1 -1
  910. package/lib/packageVersion.js.map +1 -1
  911. package/lib/shared-tree/index.d.ts +1 -1
  912. package/lib/shared-tree/index.d.ts.map +1 -1
  913. package/lib/shared-tree/index.js.map +1 -1
  914. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  915. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  916. package/lib/shared-tree/schematizeTree.js +3 -2
  917. package/lib/shared-tree/schematizeTree.js.map +1 -1
  918. package/lib/shared-tree/schematizingTreeView.d.ts +3 -8
  919. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  920. package/lib/shared-tree/schematizingTreeView.js +61 -47
  921. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  922. package/lib/shared-tree/sharedTree.d.ts +9 -3
  923. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  924. package/lib/shared-tree/sharedTree.js +41 -13
  925. package/lib/shared-tree/sharedTree.js.map +1 -1
  926. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  927. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  928. package/lib/shared-tree/sharedTreeChangeCodecs.js +10 -8
  929. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  930. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  931. package/lib/shared-tree/sharedTreeChangeEnricher.js +6 -4
  932. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  933. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +7 -6
  934. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  935. package/lib/shared-tree/sharedTreeChangeFamily.js +30 -19
  936. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  937. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  938. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  939. package/lib/shared-tree/sharedTreeEditBuilder.js +12 -6
  940. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  941. package/lib/shared-tree/treeAlpha.d.ts +35 -29
  942. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  943. package/lib/shared-tree/treeAlpha.js +21 -23
  944. package/lib/shared-tree/treeAlpha.js.map +1 -1
  945. package/lib/shared-tree/treeCheckout.d.ts +11 -10
  946. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  947. package/lib/shared-tree/treeCheckout.js +97 -29
  948. package/lib/shared-tree/treeCheckout.js.map +1 -1
  949. package/lib/shared-tree-core/branch.d.ts +6 -3
  950. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  951. package/lib/shared-tree-core/branch.js +13 -6
  952. package/lib/shared-tree-core/branch.js.map +1 -1
  953. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  954. package/lib/shared-tree-core/branchCommitEnricher.js +2 -2
  955. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  956. package/lib/shared-tree-core/editManager.d.ts +2 -2
  957. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  958. package/lib/shared-tree-core/editManager.js +21 -15
  959. package/lib/shared-tree-core/editManager.js.map +1 -1
  960. package/lib/shared-tree-core/editManagerCodecs.d.ts +4 -0
  961. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  962. package/lib/shared-tree-core/editManagerCodecs.js +16 -4
  963. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  964. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +2 -0
  965. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  966. package/lib/shared-tree-core/editManagerFormatCommons.js +12 -0
  967. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  968. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  969. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  970. package/lib/shared-tree-core/editManagerFormatV1toV4.js +2 -0
  971. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  972. package/lib/shared-tree-core/editManagerSummarizer.js +3 -3
  973. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  974. package/lib/shared-tree-core/index.d.ts +2 -2
  975. package/lib/shared-tree-core/index.d.ts.map +1 -1
  976. package/lib/shared-tree-core/index.js +2 -2
  977. package/lib/shared-tree-core/index.js.map +1 -1
  978. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  979. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  980. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  981. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  982. package/lib/shared-tree-core/messageCodecVSharedBranches.js +2 -1
  983. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  984. package/lib/shared-tree-core/messageCodecs.d.ts +4 -0
  985. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  986. package/lib/shared-tree-core/messageCodecs.js +15 -4
  987. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  988. package/lib/shared-tree-core/messageFormat.d.ts +2 -0
  989. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  990. package/lib/shared-tree-core/messageFormat.js +12 -0
  991. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  992. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  993. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  994. package/lib/shared-tree-core/messageFormatV1ToV4.js +9 -1
  995. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  996. package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  997. package/lib/shared-tree-core/sequenceIdUtils.js +4 -4
  998. package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
  999. package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -0
  1000. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  1001. package/lib/shared-tree-core/sharedTreeCore.js +13 -9
  1002. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  1003. package/lib/shared-tree-core/transaction.d.ts +25 -8
  1004. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  1005. package/lib/shared-tree-core/transaction.js +67 -32
  1006. package/lib/shared-tree-core/transaction.js.map +1 -1
  1007. package/lib/shared-tree-core/transactionEnricher.d.ts +2 -2
  1008. package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  1009. package/lib/shared-tree-core/transactionEnricher.js +3 -3
  1010. package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
  1011. package/lib/simple-tree/api/configuration.js +1 -1
  1012. package/lib/simple-tree/api/configuration.js.map +1 -1
  1013. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  1014. package/lib/simple-tree/api/customTree.js +13 -9
  1015. package/lib/simple-tree/api/customTree.js.map +1 -1
  1016. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  1017. package/lib/simple-tree/api/discrepancies.js +21 -17
  1018. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  1019. package/lib/simple-tree/api/index.d.ts +2 -2
  1020. package/lib/simple-tree/api/index.d.ts.map +1 -1
  1021. package/lib/simple-tree/api/index.js +1 -1
  1022. package/lib/simple-tree/api/index.js.map +1 -1
  1023. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  1024. package/lib/simple-tree/api/schemaFactory.js +12 -8
  1025. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  1026. package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -1
  1027. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  1028. package/lib/simple-tree/api/schemaFactoryBeta.js +1 -1
  1029. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  1030. package/lib/simple-tree/api/schemaFromSimple.js +18 -9
  1031. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  1032. package/lib/simple-tree/api/simpleSchemaCodec.js +10 -5
  1033. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  1034. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  1035. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +19 -15
  1036. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  1037. package/lib/simple-tree/api/simpleTreeIndex.js +10 -10
  1038. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  1039. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
  1040. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  1041. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +270 -0
  1042. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  1043. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  1044. package/lib/simple-tree/api/storedSchema.js +4 -7
  1045. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  1046. package/lib/simple-tree/api/transactionTypes.d.ts +17 -4
  1047. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  1048. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  1049. package/lib/simple-tree/api/tree.d.ts +3 -1
  1050. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  1051. package/lib/simple-tree/api/tree.js.map +1 -1
  1052. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  1053. package/lib/simple-tree/api/treeNodeApi.js +21 -13
  1054. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  1055. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  1056. package/lib/simple-tree/api/verboseTree.js +14 -9
  1057. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  1058. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  1059. package/lib/simple-tree/core/treeNodeKernel.js +12 -5
  1060. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  1061. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  1062. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  1063. package/lib/simple-tree/core/unhydratedFlexTree.js +78 -23
  1064. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  1065. package/lib/simple-tree/fieldSchema.d.ts +4 -4
  1066. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  1067. package/lib/simple-tree/fieldSchema.js.map +1 -1
  1068. package/lib/simple-tree/getTreeNodeForField.d.ts.map +1 -1
  1069. package/lib/simple-tree/getTreeNodeForField.js +2 -1
  1070. package/lib/simple-tree/getTreeNodeForField.js.map +1 -1
  1071. package/lib/simple-tree/index.d.ts +3 -3
  1072. package/lib/simple-tree/index.d.ts.map +1 -1
  1073. package/lib/simple-tree/index.js +2 -2
  1074. package/lib/simple-tree/index.js.map +1 -1
  1075. package/lib/simple-tree/leafNodeSchema.js +9 -6
  1076. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  1077. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  1078. package/lib/simple-tree/node-kinds/array/arrayNode.js +23 -21
  1079. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  1080. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  1081. package/lib/simple-tree/node-kinds/common.js +2 -2
  1082. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  1083. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  1084. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  1085. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  1086. package/lib/simple-tree/node-kinds/object/objectNode.js +22 -23
  1087. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  1088. package/lib/simple-tree/node-kinds/record/recordNode.js +6 -5
  1089. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  1090. package/lib/simple-tree/prepareForInsertion.d.ts +54 -47
  1091. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  1092. package/lib/simple-tree/prepareForInsertion.js +184 -125
  1093. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  1094. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  1095. package/lib/simple-tree/toStoredSchema.js +9 -5
  1096. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  1097. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  1098. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  1099. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +28 -11
  1100. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  1101. package/lib/text/index.d.ts +6 -0
  1102. package/lib/text/index.d.ts.map +1 -0
  1103. package/lib/text/index.js +6 -0
  1104. package/lib/text/index.js.map +1 -0
  1105. package/lib/text/textDomain.d.ts +138 -0
  1106. package/lib/text/textDomain.d.ts.map +1 -0
  1107. package/lib/text/textDomain.js +118 -0
  1108. package/lib/text/textDomain.js.map +1 -0
  1109. package/lib/treeFactory.d.ts.map +1 -1
  1110. package/lib/treeFactory.js +18 -4
  1111. package/lib/treeFactory.js.map +1 -1
  1112. package/lib/util/bTreeUtils.d.ts +12 -4
  1113. package/lib/util/bTreeUtils.d.ts.map +1 -1
  1114. package/lib/util/bTreeUtils.js +16 -20
  1115. package/lib/util/bTreeUtils.js.map +1 -1
  1116. package/lib/util/breakable.js +7 -9
  1117. package/lib/util/breakable.js.map +1 -1
  1118. package/lib/util/idAllocator.d.ts.map +1 -1
  1119. package/lib/util/idAllocator.js +1 -2
  1120. package/lib/util/idAllocator.js.map +1 -1
  1121. package/lib/util/index.d.ts +1 -1
  1122. package/lib/util/index.d.ts.map +1 -1
  1123. package/lib/util/index.js +1 -1
  1124. package/lib/util/index.js.map +1 -1
  1125. package/lib/util/nestedMap.d.ts.map +1 -1
  1126. package/lib/util/nestedMap.js +13 -13
  1127. package/lib/util/nestedMap.js.map +1 -1
  1128. package/lib/util/rangeMap.d.ts +24 -12
  1129. package/lib/util/rangeMap.d.ts.map +1 -1
  1130. package/lib/util/rangeMap.js +44 -5
  1131. package/lib/util/rangeMap.js.map +1 -1
  1132. package/lib/util/utils.d.ts.map +1 -1
  1133. package/lib/util/utils.js +16 -15
  1134. package/lib/util/utils.js.map +1 -1
  1135. package/package.json +33 -33
  1136. package/src/codec/codec.ts +48 -8
  1137. package/src/codec/index.ts +4 -1
  1138. package/src/codec/versioned/codec.ts +340 -22
  1139. package/src/codec/versioned/index.ts +3 -1
  1140. package/src/core/change-family/changeFamily.ts +5 -0
  1141. package/src/core/change-family/index.ts +1 -0
  1142. package/src/core/index.ts +8 -3
  1143. package/src/core/rebase/changeRebaser.ts +46 -7
  1144. package/src/core/rebase/index.ts +4 -1
  1145. package/src/core/rebase/types.ts +71 -39
  1146. package/src/core/rebase/utils.ts +42 -14
  1147. package/src/core/schema-stored/schema.ts +3 -3
  1148. package/src/core/tree/anchorSet.ts +4 -4
  1149. package/src/core/tree/detachedFieldIndex.ts +29 -74
  1150. package/src/core/tree/detachedFieldIndexCodecCommon.ts +4 -8
  1151. package/src/core/tree/detachedFieldIndexCodecV1.ts +3 -7
  1152. package/src/core/tree/detachedFieldIndexCodecV2.ts +5 -9
  1153. package/src/core/tree/detachedFieldIndexCodecs.ts +21 -64
  1154. package/src/core/tree/index.ts +3 -2
  1155. package/src/core/tree/mapTree.ts +1 -1
  1156. package/src/core/tree/pathTree.ts +16 -4
  1157. package/src/core/tree/sparseTree.ts +1 -0
  1158. package/src/core/tree/treeTextFormat.ts +5 -9
  1159. package/src/core/tree/visitDelta.ts +6 -2
  1160. package/src/core/tree/visitorUtils.ts +55 -19
  1161. package/src/feature-libraries/changeAtomIdBTree.ts +56 -0
  1162. package/src/feature-libraries/chunked-forest/basicChunk.ts +8 -2
  1163. package/src/feature-libraries/chunked-forest/chunkTree.ts +6 -1
  1164. package/src/feature-libraries/chunked-forest/chunkedForest.ts +8 -6
  1165. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +7 -4
  1166. package/src/feature-libraries/chunked-forest/codec/codecs.ts +19 -11
  1167. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +4 -3
  1168. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -5
  1169. package/src/feature-libraries/chunked-forest/uniformChunk.ts +1 -1
  1170. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +442 -139
  1171. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +24 -6
  1172. package/src/feature-libraries/default-schema/index.ts +17 -5
  1173. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +188 -0
  1174. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +41 -9
  1175. package/src/feature-libraries/deltaUtils.ts +6 -1
  1176. package/src/feature-libraries/flex-tree/context.ts +17 -0
  1177. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +7 -8
  1178. package/src/feature-libraries/flex-tree/lazyField.ts +72 -30
  1179. package/src/feature-libraries/forest-summary/forestSummarizer.ts +3 -1
  1180. package/src/feature-libraries/index.ts +32 -13
  1181. package/src/feature-libraries/indexing/anchorTreeIndex.ts +5 -5
  1182. package/src/feature-libraries/mapTreeCursor.ts +2 -1
  1183. package/src/feature-libraries/mitigatedChangeFamily.ts +14 -7
  1184. package/src/feature-libraries/modular-schema/comparison.ts +12 -9
  1185. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +142 -44
  1186. package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +70 -0
  1187. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +35 -64
  1188. package/src/feature-libraries/modular-schema/genericFieldKind.ts +11 -25
  1189. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -1
  1190. package/src/feature-libraries/modular-schema/index.ts +20 -16
  1191. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +912 -0
  1192. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +89 -0
  1193. package/src/feature-libraries/modular-schema/modularChangeCodecV3.ts +760 -0
  1194. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +52 -523
  1195. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2756 -884
  1196. package/src/feature-libraries/modular-schema/{modularChangeFormat.ts → modularChangeFormatV1.ts} +5 -4
  1197. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +34 -0
  1198. package/src/feature-libraries/modular-schema/modularChangeFormatV3.ts +62 -0
  1199. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +70 -14
  1200. package/src/feature-libraries/node-identifier/mockNodeIdentifierManager.ts +1 -1
  1201. package/src/feature-libraries/object-forest/objectForest.ts +7 -5
  1202. package/src/feature-libraries/optional-field/index.ts +1 -3
  1203. package/src/feature-libraries/optional-field/optionalField.ts +320 -576
  1204. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +45 -0
  1205. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +24 -38
  1206. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
  1207. package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +94 -0
  1208. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -1
  1209. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +18 -3
  1210. package/src/feature-libraries/schema-index/codec.ts +30 -90
  1211. package/src/feature-libraries/schema-index/index.ts +2 -4
  1212. package/src/feature-libraries/schema-index/schemaSummarizer.ts +0 -17
  1213. package/src/feature-libraries/schemaChecker.ts +11 -6
  1214. package/src/feature-libraries/sequence-field/compose.ts +147 -526
  1215. package/src/feature-libraries/sequence-field/helperTypes.ts +34 -19
  1216. package/src/feature-libraries/sequence-field/index.ts +0 -9
  1217. package/src/feature-libraries/sequence-field/invert.ts +103 -227
  1218. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1219. package/src/feature-libraries/sequence-field/moveEffectTable.ts +11 -192
  1220. package/src/feature-libraries/sequence-field/rebase.ts +182 -210
  1221. package/src/feature-libraries/sequence-field/replaceRevisions.ts +54 -80
  1222. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +0 -2
  1223. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +648 -220
  1224. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +56 -68
  1225. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +25 -27
  1226. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +25 -132
  1227. package/src/feature-libraries/sequence-field/types.ts +34 -64
  1228. package/src/feature-libraries/sequence-field/utils.ts +171 -366
  1229. package/src/feature-libraries/treeCursorUtils.ts +7 -7
  1230. package/src/feature-libraries/treeTextCursor.ts +2 -2
  1231. package/src/feature-libraries/valueUtilities.ts +16 -8
  1232. package/src/index.ts +11 -0
  1233. package/src/packageVersion.ts +1 -1
  1234. package/src/shared-tree/index.ts +3 -2
  1235. package/src/shared-tree/schematizeTree.ts +21 -8
  1236. package/src/shared-tree/schematizingTreeView.ts +79 -83
  1237. package/src/shared-tree/sharedTree.ts +50 -17
  1238. package/src/shared-tree/sharedTreeChangeCodecs.ts +14 -9
  1239. package/src/shared-tree/sharedTreeChangeEnricher.ts +6 -2
  1240. package/src/shared-tree/sharedTreeChangeFamily.ts +44 -24
  1241. package/src/shared-tree/sharedTreeEditBuilder.ts +48 -13
  1242. package/src/shared-tree/treeAlpha.ts +60 -51
  1243. package/src/shared-tree/treeCheckout.ts +160 -73
  1244. package/src/shared-tree-core/branch.ts +21 -6
  1245. package/src/shared-tree-core/branchCommitEnricher.ts +3 -8
  1246. package/src/shared-tree-core/editManager.ts +43 -29
  1247. package/src/shared-tree-core/editManagerCodecs.ts +19 -4
  1248. package/src/shared-tree-core/editManagerFormatCommons.ts +12 -0
  1249. package/src/shared-tree-core/editManagerFormatV1toV4.ts +5 -1
  1250. package/src/shared-tree-core/editManagerSummarizer.ts +3 -3
  1251. package/src/shared-tree-core/index.ts +2 -0
  1252. package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -1
  1253. package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -1
  1254. package/src/shared-tree-core/messageCodecs.ts +18 -4
  1255. package/src/shared-tree-core/messageFormat.ts +12 -1
  1256. package/src/shared-tree-core/messageFormatV1ToV4.ts +18 -2
  1257. package/src/shared-tree-core/sequenceIdUtils.ts +4 -4
  1258. package/src/shared-tree-core/sharedTreeCore.ts +15 -8
  1259. package/src/shared-tree-core/transaction.ts +115 -56
  1260. package/src/shared-tree-core/transactionEnricher.ts +5 -6
  1261. package/src/simple-tree/api/configuration.ts +1 -1
  1262. package/src/simple-tree/api/customTree.ts +14 -10
  1263. package/src/simple-tree/api/discrepancies.ts +23 -17
  1264. package/src/simple-tree/api/index.ts +5 -0
  1265. package/src/simple-tree/api/schemaFactory.ts +11 -7
  1266. package/src/simple-tree/api/schemaFactoryAlpha.ts +1 -1
  1267. package/src/simple-tree/api/schemaFactoryBeta.ts +1 -1
  1268. package/src/simple-tree/api/schemaFromSimple.ts +18 -9
  1269. package/src/simple-tree/api/simpleSchemaCodec.ts +10 -5
  1270. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +21 -17
  1271. package/src/simple-tree/api/simpleTreeIndex.ts +8 -8
  1272. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +501 -0
  1273. package/src/simple-tree/api/storedSchema.ts +10 -7
  1274. package/src/simple-tree/api/transactionTypes.ts +19 -4
  1275. package/src/simple-tree/api/tree.ts +3 -1
  1276. package/src/simple-tree/api/treeNodeApi.ts +21 -13
  1277. package/src/simple-tree/api/verboseTree.ts +14 -9
  1278. package/src/simple-tree/core/treeNodeKernel.ts +12 -5
  1279. package/src/simple-tree/core/unhydratedFlexTree.ts +109 -53
  1280. package/src/simple-tree/fieldSchema.ts +6 -4
  1281. package/src/simple-tree/getTreeNodeForField.ts +2 -1
  1282. package/src/simple-tree/index.ts +7 -1
  1283. package/src/simple-tree/leafNodeSchema.ts +8 -5
  1284. package/src/simple-tree/node-kinds/array/arrayNode.ts +32 -30
  1285. package/src/simple-tree/node-kinds/common.ts +2 -5
  1286. package/src/simple-tree/node-kinds/map/mapNode.ts +4 -4
  1287. package/src/simple-tree/node-kinds/object/objectNode.ts +29 -30
  1288. package/src/simple-tree/node-kinds/record/recordNode.ts +12 -12
  1289. package/src/simple-tree/prepareForInsertion.ts +343 -201
  1290. package/src/simple-tree/toStoredSchema.ts +9 -5
  1291. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +43 -15
  1292. package/src/text/README.md +8 -0
  1293. package/src/text/index.ts +6 -0
  1294. package/src/text/textDomain.ts +199 -0
  1295. package/src/treeFactory.ts +20 -5
  1296. package/src/util/bTreeUtils.ts +34 -23
  1297. package/src/util/breakable.ts +9 -9
  1298. package/src/util/idAllocator.ts +1 -2
  1299. package/src/util/index.ts +3 -0
  1300. package/src/util/nestedMap.ts +13 -15
  1301. package/src/util/rangeMap.ts +72 -18
  1302. package/src/util/utils.ts +14 -13
  1303. package/.eslintrc.cjs +0 -140
  1304. package/assertTagging.config.mjs +0 -14
  1305. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
  1306. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
  1307. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  1308. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  1309. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -50
  1310. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  1311. package/docs/main/sequence-field/move-composition.md +0 -46
  1312. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
  1313. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
  1314. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  1315. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  1316. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -46
  1317. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  1318. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
@@ -2,18 +2,27 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { SemanticVersion } from "@fluidframework/runtime-utils/internal";
5
+ import { type ConfigMapEntry, type SemanticVersion } from "@fluidframework/runtime-utils/internal";
6
6
  import { type TSchema } from "@sinclair/typebox";
7
- import type { JsonCompatibleReadOnly } from "../../util/index.js";
8
- import { type ICodecFamily, type ICodecOptions, type IJsonCodec, type FormatVersion, type CodecWriteOptions } from "../codec.js";
7
+ import type { JsonCompatibleReadOnly, JsonCompatibleReadOnlyObject } from "../../util/index.js";
8
+ import { type ICodecFamily, type ICodecOptions, type IJsonCodec, type FormatVersion, type CodecWriteOptions, type IMultiFormatCodec, type CodecName, type CodecTree } from "../codec.js";
9
9
  import { Versioned } from "./format.js";
10
10
  import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
11
- export declare function makeVersionedCodec<TDecoded, TEncoded extends Versioned = JsonCompatibleReadOnly & Versioned, TValidate = TEncoded, TContext = void>(supportedVersions: Set<FormatVersion>, { jsonValidator: validator }: ICodecOptions, inner: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>): IJsonCodec<TDecoded, TEncoded, TValidate, TContext>;
12
- export declare function makeVersionedValidatedCodec<EncodedSchema extends TSchema, TDecoded, TEncoded extends Versioned = JsonCompatibleReadOnly & Versioned, TValidate = TEncoded, TContext = void>(options: ICodecOptions, supportedVersions: Set<FormatVersion>, schema: EncodedSchema, codec: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>): IJsonCodec<TDecoded, TEncoded, TValidate, TContext>;
11
+ /**
12
+ * Json compatible data with a format version.
13
+ */
14
+ type VersionedJson = JsonCompatibleReadOnlyObject & Versioned;
15
+ /**
16
+ * TODO: users of this should migrate to {@link ClientVersionDispatchingCodecBuilder}.
17
+ */
18
+ export declare function makeVersionedValidatedCodec<EncodedSchema extends TSchema, TDecoded, TEncoded extends Versioned = VersionedJson, TValidate = TEncoded, TContext = void>(options: ICodecOptions, supportedVersions: Set<FormatVersion>, schema: EncodedSchema, codec: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>): IJsonCodec<TDecoded, TEncoded, TValidate, TContext>;
13
19
  /**
14
20
  * Creates a codec which always throws a UsageError when encoding or decoding, indicating that the format version is discontinued.
21
+ *
22
+ * TODO: {@link ClientVersionDispatchingCodecBuilder} should get support for extra decode only entries and/or unstable formats (codecs without a minVersionForCollab that will never be selected for write unless overridden).
23
+ * Once done, users of this should migrate to ClientVersionDispatchingCodecBuilder and this function can be simplified.
15
24
  */
16
- export declare function makeDiscontinuedCodecVersion<TDecoded, TEncoded extends Versioned = JsonCompatibleReadOnly & Versioned, TContext = unknown>(options: ICodecOptions, discontinuedVersion: FormatVersion, discontinuedSince: SemanticVersion): IJsonCodec<TDecoded, TEncoded, TEncoded, TContext>;
25
+ export declare function makeDiscontinuedCodecVersion<TDecoded, TEncoded extends Versioned = VersionedJson, TContext = unknown>(options: ICodecOptions, discontinuedVersion: FormatVersion, discontinuedSince: SemanticVersion): IJsonCodec<TDecoded, TEncoded, TEncoded, TContext>;
17
26
  /**
18
27
  * Creates a codec which dispatches to the appropriate member of a codec family based on the version of
19
28
  * data it encounters.
@@ -23,36 +32,85 @@ export declare function makeDiscontinuedCodecVersion<TDecoded, TEncoded extends
23
32
  * TODO: Users of this should migrate to {@link ClientVersionDispatchingCodecBuilder} so that the actual format version used can be encapsulated.
24
33
  */
25
34
  export declare function makeVersionDispatchingCodec<TDecoded, TContext>(family: ICodecFamily<TDecoded, TContext>, options: ICodecOptions & {
26
- writeVersion: number | string;
35
+ writeVersion: FormatVersion;
27
36
  }): IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>;
37
+ /**
38
+ * A friendly format for codec authors use to define their codec and schema for use in {@link CodecVersion}.
39
+ * @remarks
40
+ * The codec should not perform its own schema validation.
41
+ * The schema validation gets added when normalizing to {@link NormalizedCodecVersion}.
42
+ */
43
+ export type CodecAndSchema<TDecoded, TContext = void> = {
44
+ readonly schema: TSchema;
45
+ } & (IMultiFormatCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext> | IJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>);
46
+ /**
47
+ * A codec alongside its format version and schema.
48
+ */
49
+ export interface CodecVersionBase<T = unknown, TFormatVersion extends FormatVersion = FormatVersion> {
50
+ readonly formatVersion: TFormatVersion;
51
+ readonly codec: T;
52
+ }
53
+ /**
54
+ * A particular version of a codec and when to use it.
55
+ * @privateRemarks
56
+ * This allows lazy building of the codec with options.
57
+ * This option can likely be removed as the codec handling is made simpler and more consistent.
58
+ * Removing support for this laziness would be nice to help prevent unexpected coupling and alteration to codec behavior,
59
+ * helping ensure that tests and production code behave the same.
60
+ */
61
+ export interface CodecVersion<TDecoded, TContext, TFormatVersion extends FormatVersion, TBuildOptions extends CodecWriteOptions> extends CodecVersionBase<CodecAndSchema<TDecoded, TContext> | ((options: TBuildOptions) => CodecAndSchema<TDecoded, TContext>), TFormatVersion> {
62
+ }
63
+ /**
64
+ * {@link CodecVersion} after normalization into a consistent type.
65
+ * @remarks
66
+ * Produced by {@link normalizeCodecVersion}.
67
+ * Includes schema validation.
68
+ */
69
+ export interface NormalizedCodecVersion<TDecoded, TContext, TFormatVersion extends FormatVersion, TBuildOptions extends CodecWriteOptions> extends CodecVersionBase<(options: TBuildOptions) => IJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>, TFormatVersion> {
70
+ }
71
+ /**
72
+ * {@link NormalizedCodecVersion} after applying the build options.
73
+ * @remarks
74
+ * Produced by {@link ClientVersionDispatchingCodecBuilder.applyOptions}.
75
+ */
76
+ export interface EvaluatedCodecVersion<TDecoded, TContext, TFormatVersion extends FormatVersion> extends CodecVersionBase<IJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>, TFormatVersion> {
77
+ }
28
78
  /**
29
79
  * Creates a codec which dispatches to the appropriate member of a codec family based on the `minVersionForCollab` for encode and the
30
80
  * version number in data it encounters for decode.
31
81
  * @privateRemarks
32
82
  * This is a two stage builder so the first stage can encapsulate all codec specific details and the second can bring in configuration.
33
83
  */
34
- export declare class ClientVersionDispatchingCodecBuilder<TDecoded, TContext> {
84
+ export declare class ClientVersionDispatchingCodecBuilder<Name extends CodecName, TDecoded, TContext, TFormatVersion extends FormatVersion, TBuildOptions extends CodecWriteOptions> {
85
+ /**
86
+ * See {@link CodecName}.
87
+ */
88
+ readonly name: Name;
89
+ readonly registry: ReadonlyMap<MinimumVersionForCollab, NormalizedCodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>>;
35
90
  /**
36
- * The codec family to dispatch to.
91
+ * Use {@link ClientVersionDispatchingCodecBuilder.build} to create an instance of this class.
37
92
  */
38
- private readonly family;
93
+ private constructor();
39
94
  /**
40
- * A function which maps a {@link MinimumVersionForCollab} to a version number for the codec family which is supported by that version.
41
- * This can (and typically does) pick the newest version of the codec which is known to be compatible with the client version so that
42
- * any improvements in newer versions of the codec can be used when allowed.
95
+ * Applies the provided options to the codec registry to produce a list of evaluated codecs.
96
+ * @remarks
97
+ * This is used by build, which is what production code should use.
98
+ * This is only exposed for testing purposes.
43
99
  */
44
- private readonly versionMapping;
45
- constructor(
100
+ applyOptions(options: TBuildOptions): [MinimumVersionForCollab, EvaluatedCodecVersion<TDecoded, TContext, TFormatVersion>][];
46
101
  /**
47
- * The codec family to dispatch to.
102
+ * Produce a single codec which can read any supported format, and writes a version selected based on the provided options.
48
103
  */
49
- family: ICodecFamily<TDecoded, TContext>,
104
+ build(options: TBuildOptions): IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>;
105
+ getCodecTree(clientVersion: MinimumVersionForCollab): CodecTree;
50
106
  /**
51
- * A function which maps a {@link MinimumVersionForCollab} to a version number for the codec family which is supported by that version.
52
- * This can (and typically does) pick the newest version of the codec which is known to be compatible with the client version so that
53
- * any improvements in newer versions of the codec can be used when allowed.
107
+ * Builds a ClientVersionDispatchingCodecBuilder from the provided registry.
108
+ * @remarks
109
+ * This static method infers the types of the builder from the provided registry,
110
+ * making it easier to create builders without needing to explicitly specify all type parameters.
111
+ * This gets better type inference than the constructor.
54
112
  */
55
- versionMapping: (minVersionForCollab: MinimumVersionForCollab) => number);
56
- build(options: CodecWriteOptions): IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>;
113
+ static build<Name extends CodecName, Entry extends CodecVersion<unknown, unknown, FormatVersion, never>>(name: Name, inputRegistry: ConfigMapEntry<Entry>): ClientVersionDispatchingCodecBuilder<Name, Entry extends CodecVersion<infer D, unknown, FormatVersion, never> ? D : never, (Entry extends CodecVersion<unknown, infer C, FormatVersion, never> ? C : never) extends unknown ? void : Entry extends CodecVersion<unknown, infer C, FormatVersion, never> ? C : never, Entry extends CodecVersion<unknown, unknown, infer F extends FormatVersion, never> ? F : never, Entry extends CodecVersion<unknown, unknown, FormatVersion, infer B extends CodecWriteOptions> ? B : never>;
57
114
  }
115
+ export {};
58
116
  //# sourceMappingURL=codec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/codec/versioned/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAQ,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EAEf,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAE5F,wBAAgB,kBAAkB,CACjC,QAAQ,EACR,QAAQ,SAAS,SAAS,GAAG,sBAAsB,GAAG,SAAS,EAC/D,SAAS,GAAG,QAAQ,EACpB,QAAQ,GAAG,IAAI,EAEf,iBAAiB,EAAE,GAAG,CAAC,aAAa,CAAC,EACrC,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,aAAa,EAC3C,KAAK,EAAE,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,GACxD,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CA0BrD;AAED,wBAAgB,2BAA2B,CAC1C,aAAa,SAAS,OAAO,EAC7B,QAAQ,EACR,QAAQ,SAAS,SAAS,GAAG,sBAAsB,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Aa,EAAE,KAAK,CAAC,EACjE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,cAAc,CAAC,KAAK,CAAC;CA2BlD"}
@@ -4,10 +4,12 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.ClientVersionDispatchingCodecBuilder = exports.makeVersionDispatchingCodec = exports.makeDiscontinuedCodecVersion = exports.makeVersionedValidatedCodec = exports.makeVersionedCodec = void 0;
7
+ exports.ClientVersionDispatchingCodecBuilder = exports.makeVersionDispatchingCodec = exports.makeDiscontinuedCodecVersion = exports.makeVersionedValidatedCodec = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const internal_2 = require("@fluidframework/telemetry-utils/internal");
10
+ const internal_3 = require("@fluidframework/runtime-utils/internal");
10
11
  const typebox_1 = require("@sinclair/typebox");
12
+ const semver_ts_1 = require("semver-ts");
11
13
  const codec_js_1 = require("../codec.js");
12
14
  const format_js_1 = require("./format.js");
13
15
  const packageVersion_js_1 = require("../../packageVersion.js");
@@ -21,7 +23,7 @@ function makeVersionedCodec(supportedVersions, { jsonValidator: validator }, inn
21
23
  decode: (data, context) => {
22
24
  const versioned = data; // Validated by withSchemaValidation
23
25
  if (!supportedVersions.has(versioned.version)) {
24
- throw new internal_2.UsageError(`Unsupported version ${versioned.version} encountered while decoding data. Supported versions for this data are: ${Array.from(supportedVersions).join(", ")}.
26
+ throw new internal_2.UsageError(`Unsupported version ${versioned.version} encountered while decoding data. Supported versions for this data are: ${[...supportedVersions].join(", ")}.
25
27
  The client which encoded this data likely specified an "minVersionForCollab" value which corresponds to a version newer than the version of this client ("${packageVersion_js_1.pkgVersion}").`);
26
28
  }
27
29
  const decoded = inner.decode(data, context);
@@ -32,13 +34,18 @@ The client which encoded this data likely specified an "minVersionForCollab" val
32
34
  ? codec
33
35
  : (0, codec_js_1.withSchemaValidation)(format_js_1.Versioned, codec, validator);
34
36
  }
35
- exports.makeVersionedCodec = makeVersionedCodec;
37
+ /**
38
+ * TODO: users of this should migrate to {@link ClientVersionDispatchingCodecBuilder}.
39
+ */
36
40
  function makeVersionedValidatedCodec(options, supportedVersions, schema, codec) {
37
41
  return makeVersionedCodec(supportedVersions, options, (0, codec_js_1.withSchemaValidation)(schema, codec, options.jsonValidator));
38
42
  }
39
43
  exports.makeVersionedValidatedCodec = makeVersionedValidatedCodec;
40
44
  /**
41
45
  * Creates a codec which always throws a UsageError when encoding or decoding, indicating that the format version is discontinued.
46
+ *
47
+ * TODO: {@link ClientVersionDispatchingCodecBuilder} should get support for extra decode only entries and/or unstable formats (codecs without a minVersionForCollab that will never be selected for write unless overridden).
48
+ * Once done, users of this should migrate to ClientVersionDispatchingCodecBuilder and this function can be simplified.
42
49
  */
43
50
  function makeDiscontinuedCodecVersion(options, discontinuedVersion, discontinuedSince) {
44
51
  const schema = typebox_1.Type.Object({
@@ -50,10 +57,10 @@ function makeDiscontinuedCodecVersion(options, discontinuedVersion, discontinued
50
57
  { additionalProperties: true });
51
58
  const codec = {
52
59
  encode: (_) => {
53
- throw new internal_2.UsageError(`Cannot encode data to format ${discontinuedVersion}. The codec was discontinued in FF version ${discontinuedSince}.`);
60
+ throw new internal_2.UsageError(`Cannot encode data to format ${discontinuedVersion}. The codec was discontinued in Fluid Framework client version ${discontinuedSince}.`);
54
61
  },
55
62
  decode: (data) => {
56
- throw new internal_2.UsageError(`Cannot decode data to format ${data.version}. The codec was discontinued in FF version ${discontinuedSince}.`);
63
+ throw new internal_2.UsageError(`Cannot decode data to format ${data.version}. The codec was discontinued in Fluid Framework client version ${discontinuedSince}.`);
57
64
  },
58
65
  };
59
66
  return makeVersionedValidatedCodec(options, new Set([discontinuedVersion]), schema, codec);
@@ -81,6 +88,26 @@ function makeVersionDispatchingCodec(family, options) {
81
88
  });
82
89
  }
83
90
  exports.makeVersionDispatchingCodec = makeVersionDispatchingCodec;
91
+ /**
92
+ * Normalize the codec to a single format.
93
+ * @remarks
94
+ * Bakes in schema validation, so output no longer exposes the schema.
95
+ */
96
+ function normalizeCodecVersion(codecVersion) {
97
+ const codecBuilder = typeof codecVersion.codec === "function"
98
+ ? codecVersion.codec
99
+ : () => codecVersion.codec;
100
+ const codec = (options) => {
101
+ const built = codecBuilder(options);
102
+ // We currently don't expose or use binary formats, but someday we might.
103
+ const multiFormat = (0, codec_js_1.ensureBinaryEncoding)(built);
104
+ return makeVersionedValidatedCodec(options, new Set([codecVersion.formatVersion]), built.schema, multiFormat.json);
105
+ };
106
+ return {
107
+ formatVersion: codecVersion.formatVersion,
108
+ codec,
109
+ };
110
+ }
84
111
  /**
85
112
  * Creates a codec which dispatches to the appropriate member of a codec family based on the `minVersionForCollab` for encode and the
86
113
  * version number in data it encounters for decode.
@@ -88,24 +115,119 @@ exports.makeVersionDispatchingCodec = makeVersionDispatchingCodec;
88
115
  * This is a two stage builder so the first stage can encapsulate all codec specific details and the second can bring in configuration.
89
116
  */
90
117
  class ClientVersionDispatchingCodecBuilder {
118
+ /**
119
+ * Use {@link ClientVersionDispatchingCodecBuilder.build} to create an instance of this class.
120
+ */
91
121
  constructor(
92
122
  /**
93
- * The codec family to dispatch to.
123
+ * See {@link CodecName}.
124
+ */
125
+ name,
126
+ /**
127
+ * The registry of codecs which this builder can use to encode and decode data.
94
128
  */
95
- family,
129
+ inputRegistry) {
130
+ this.name = name;
131
+ const normalizedRegistry = new Map();
132
+ for (const [minVersionForCollab, codec] of Object.entries(inputRegistry)) {
133
+ const normalizedCodec = normalizeCodecVersion(codec);
134
+ normalizedRegistry.set(minVersionForCollab, normalizedCodec);
135
+ }
136
+ this.registry = normalizedRegistry;
137
+ }
96
138
  /**
97
- * A function which maps a {@link MinimumVersionForCollab} to a version number for the codec family which is supported by that version.
98
- * This can (and typically does) pick the newest version of the codec which is known to be compatible with the client version so that
99
- * any improvements in newer versions of the codec can be used when allowed.
139
+ * Applies the provided options to the codec registry to produce a list of evaluated codecs.
140
+ * @remarks
141
+ * This is used by build, which is what production code should use.
142
+ * This is only exposed for testing purposes.
100
143
  */
101
- versionMapping) {
102
- this.family = family;
103
- this.versionMapping = versionMapping;
144
+ applyOptions(options) {
145
+ return Array.from(this.registry, ([version, codec]) => [
146
+ version,
147
+ {
148
+ formatVersion: codec.formatVersion,
149
+ codec: codec.codec(options),
150
+ },
151
+ ]);
104
152
  }
153
+ /**
154
+ * Produce a single codec which can read any supported format, and writes a version selected based on the provided options.
155
+ */
105
156
  build(options) {
106
- const writeVersion = this.versionMapping(options.minVersionForCollab);
107
- return makeVersionDispatchingCodec(this.family, { ...options, writeVersion });
157
+ const applied = this.applyOptions(options);
158
+ const writeVersion = getWriteVersion(this.name, options, applied);
159
+ const fromFormatVersion = new Map(applied.map(([_version, codec]) => [codec.formatVersion, codec]));
160
+ return {
161
+ encode: (data, context) => {
162
+ return writeVersion.codec.encode(data, context);
163
+ },
164
+ decode: (data, context) => {
165
+ const versioned = data;
166
+ const codec = fromFormatVersion.get(versioned.version);
167
+ if (codec === undefined) {
168
+ throw new internal_2.UsageError(`Unsupported version ${versioned.version} encountered while decoding ${this.name} data. Supported versions for this data are: ${versionList(applied)}.
169
+ The client which encoded this data likely specified an "minVersionForCollab" value which corresponds to a version newer than the version of this client ("${packageVersion_js_1.pkgVersion}").`);
170
+ }
171
+ return codec.codec.decode(data, context);
172
+ },
173
+ };
174
+ }
175
+ getCodecTree(clientVersion) {
176
+ // TODO: add support for children codecs.
177
+ const selected = (0, internal_3.getConfigForMinVersionForCollabIterable)(clientVersion, this.registry);
178
+ return {
179
+ name: this.name,
180
+ version: selected.formatVersion,
181
+ };
182
+ }
183
+ /**
184
+ * Builds a ClientVersionDispatchingCodecBuilder from the provided registry.
185
+ * @remarks
186
+ * This static method infers the types of the builder from the provided registry,
187
+ * making it easier to create builders without needing to explicitly specify all type parameters.
188
+ * This gets better type inference than the constructor.
189
+ */
190
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
191
+ static build(name, inputRegistry) {
192
+ const builder = new ClientVersionDispatchingCodecBuilder(name, inputRegistry);
193
+ return builder;
108
194
  }
109
195
  }
110
196
  exports.ClientVersionDispatchingCodecBuilder = ClientVersionDispatchingCodecBuilder;
197
+ /**
198
+ * Selects which format should be used when writing data.
199
+ * @remarks
200
+ * This either uses the override specified in the options, or selects the newest format compatible with the provided minVersionForCollab.
201
+ */
202
+ function getWriteVersion(name, options, versions) {
203
+ if (options.writeVersionOverrides?.has(name) === true) {
204
+ const selectedFormatVersion = options.writeVersionOverrides.get(name);
205
+ const selected = versions.find(([_v, codec]) => codec.formatVersion === selectedFormatVersion);
206
+ if (selected === undefined) {
207
+ throw new internal_2.UsageError(`Codec "${name}" does not support requested format version ${selectedFormatVersion}. Supported versions are: ${versionList(versions)}.`);
208
+ }
209
+ else if (options.allowPossiblyIncompatibleWriteVersionOverrides !== true) {
210
+ const selectedMinVersionForCollab = selected[0];
211
+ // Currently all versions must specify a minVersionForCollab, so undefined is not expected here.
212
+ // TODO: It should be possible to have a version which would never be automatically selected for write (and thus does not have or need a minVersionForCollab), but can be selected via override.
213
+ // Use-cases for this include experimental versions not yet stable, and discontinued or intermediate versions which are mainly being kept for read compatibility but still support writing (perhaps for round-trip testing).
214
+ // For now, this check should never pass, and there is no way to create such a version yet.
215
+ if (selectedMinVersionForCollab === undefined) {
216
+ throw new internal_2.UsageError(`Codec "${name}" does not support requested format version ${selectedFormatVersion} because it does not specify a minVersionForCollab. Use "allowPossiblyIncompatibleWriteVersionOverrides" to suppress this error if appropriate.`);
217
+ }
218
+ else if ((0, semver_ts_1.gt)(selectedMinVersionForCollab, options.minVersionForCollab)) {
219
+ throw new internal_2.UsageError(`Codec "${name}" does not support requested format version ${selectedFormatVersion} because it is only compatible back to client version ${selectedMinVersionForCollab} and the requested oldest compatible client was ${options.minVersionForCollab}. Use "allowPossiblyIncompatibleWriteVersionOverrides" to suppress this error if appropriate.`);
220
+ }
221
+ }
222
+ return selected[1];
223
+ }
224
+ const result = (0, internal_3.getConfigForMinVersionForCollabIterable)(options.minVersionForCollab, versions);
225
+ return result;
226
+ }
227
+ /**
228
+ * Formats a list of versions for use in UsageErrors.
229
+ */
230
+ function versionList(versions) {
231
+ return `${Array.from(versions, ([_v, codec]) => codec.formatVersion).join(", ")}`;
232
+ }
111
233
  //# sourceMappingURL=codec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/codec/versioned/codec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAC7D,uEAAsE;AAEtE,+CAAuD;AAGvD,0CAOqB;AAErB,2CAAwC;AACxC,+DAAqD;AAGrD,SAAgB,kBAAkB,CAMjC,iBAAqC,EACrC,EAAE,aAAa,EAAE,SAAS,EAAiB,EAC3C,KAA0D;IAE1D,MAAM,KAAK,GAAG;QACb,MAAM,EAAE,CAAC,IAAc,EAAE,OAAiB,EAAY,EAAE;YACvD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC5C,IAAA,iBAAM,EACL,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EACtC,KAAK,CAAC,+CAA+C,CACrD,CAAC;YACF,OAAO,OAAO,CAAC;QAChB,CAAC;QACD,MAAM,EAAE,CAAC,IAAe,EAAE,OAAiB,EAAY,EAAE;YACxD,MAAM,SAAS,GAAG,IAAiB,CAAC,CAAC,oCAAoC;YACzE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC/C,MAAM,IAAI,qBAAU,CACnB,uBAAuB,SAAS,CAAC,OAAO,2EAA2E,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;4JACJ,8BAAU,KAAK,CACtK,CAAC;YACH,CAAC;YACD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC5C,OAAO,OAAO,CAAC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AgCC;AAED;;;;;;;GAOG;AACH,SAAgB,2BAA2B,CAC1C,MAAwC,EACxC,OAA0D;IAE1D,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC;IAC7D,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAChE,OAAO,kBAAkB,CAAC,iBAAiB,EAAE,OAAO,EAAE;QACrD,MAAM,CAAC,IAAI,EAAE,OAAO;YACnB,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAc,CAAC;QACtD,CAAC;QACD,MAAM,CAAC,IAAe,EAAE,OAAO;YAC9B,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC3C,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACzC,CAAC;KACD,CAAC,CAAC;AACJ,CAAC;AAfD,kEAeC;AAED;;;;;GAKG;AACH,MAAa,oCAAoC;IAChD;IACC;;OAEG;IACc,MAAwC;IACzD;;;;OAIG;IACc,cAAwE;QANxE,WAAM,GAAN,MAAM,CAAkC;QAMxC,mBAAc,GAAd,cAAc,CAA0D;IACvF,CAAC;IAEG,KAAK,CACX,OAA0B;QAE1B,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACtE,OAAO,2BAA2B,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;IAC/E,CAAC;CACD;AApBD,oFAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport type { SemanticVersion } from \"@fluidframework/runtime-utils/internal\";\nimport { Type, type TSchema } from \"@sinclair/typebox\";\n\nimport type { JsonCompatibleReadOnly } from \"../../util/index.js\";\nimport {\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\twithSchemaValidation,\n\ttype FormatVersion,\n\ttype CodecWriteOptions,\n} from \"../codec.js\";\n\nimport { Versioned } from \"./format.js\";\nimport { pkgVersion } from \"../../packageVersion.js\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\n\nexport function makeVersionedCodec<\n\tTDecoded,\n\tTEncoded extends Versioned = JsonCompatibleReadOnly & Versioned,\n\tTValidate = TEncoded,\n\tTContext = void,\n>(\n\tsupportedVersions: Set<FormatVersion>,\n\t{ jsonValidator: validator }: ICodecOptions,\n\tinner: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>,\n): IJsonCodec<TDecoded, TEncoded, TValidate, TContext> {\n\tconst codec = {\n\t\tencode: (data: TDecoded, context: TContext): TEncoded => {\n\t\t\tconst encoded = inner.encode(data, context);\n\t\t\tassert(\n\t\t\t\tsupportedVersions.has(encoded.version),\n\t\t\t\t0x88b /* version being encoded should be supported */,\n\t\t\t);\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (data: TValidate, context: TContext): TDecoded => {\n\t\t\tconst versioned = data as Versioned; // Validated by withSchemaValidation\n\t\t\tif (!supportedVersions.has(versioned.version)) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`Unsupported version ${versioned.version} encountered while decoding data. Supported versions for this data are: ${Array.from(supportedVersions).join(\", \")}.\nThe client which encoded this data likely specified an \"minVersionForCollab\" value which corresponds to a version newer than the version of this client (\"${pkgVersion}\").`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst decoded = inner.decode(data, context);\n\t\t\treturn decoded;\n\t\t},\n\t};\n\n\treturn supportedVersions.has(undefined)\n\t\t? codec\n\t\t: withSchemaValidation(Versioned, codec, validator);\n}\n\nexport function makeVersionedValidatedCodec<\n\tEncodedSchema extends TSchema,\n\tTDecoded,\n\tTEncoded extends Versioned = JsonCompatibleReadOnly & Versioned,\n\tTValidate = TEncoded,\n\tTContext = void,\n>(\n\toptions: ICodecOptions,\n\tsupportedVersions: Set<FormatVersion>,\n\tschema: EncodedSchema,\n\tcodec: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>,\n): IJsonCodec<TDecoded, TEncoded, TValidate, TContext> {\n\treturn makeVersionedCodec(\n\t\tsupportedVersions,\n\t\toptions,\n\t\twithSchemaValidation(schema, codec, options.jsonValidator),\n\t);\n}\n\n/**\n * Creates a codec which always throws a UsageError when encoding or decoding, indicating that the format version is discontinued.\n */\nexport function makeDiscontinuedCodecVersion<\n\tTDecoded,\n\tTEncoded extends Versioned = JsonCompatibleReadOnly & Versioned,\n\tTContext = unknown,\n>(\n\toptions: ICodecOptions,\n\tdiscontinuedVersion: FormatVersion,\n\tdiscontinuedSince: SemanticVersion,\n): IJsonCodec<TDecoded, TEncoded, TEncoded, TContext> {\n\tconst schema = Type.Object(\n\t\t{\n\t\t\tversion:\n\t\t\t\tdiscontinuedVersion === undefined\n\t\t\t\t\t? Type.Undefined()\n\t\t\t\t\t: Type.Literal(discontinuedVersion),\n\t\t},\n\t\t// Using `additionalProperties: true` allows this schema to be used when loading data encoded by older versions even though they contain additional properties.\n\t\t{ additionalProperties: true },\n\t);\n\tconst codec: IJsonCodec<TDecoded, TEncoded, TEncoded, TContext> = {\n\t\tencode: (_: TDecoded): TEncoded => {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Cannot encode data to format ${discontinuedVersion}. The codec was discontinued in FF version ${discontinuedSince}.`,\n\t\t\t);\n\t\t},\n\t\tdecode: (data: TEncoded): TDecoded => {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Cannot decode data to format ${data.version}. The codec was discontinued in FF version ${discontinuedSince}.`,\n\t\t\t);\n\t\t},\n\t};\n\treturn makeVersionedValidatedCodec(options, new Set([discontinuedVersion]), schema, codec);\n}\n\n/**\n * Creates a codec which dispatches to the appropriate member of a codec family based on the version of\n * data it encounters.\n * @remarks\n * Each member of the codec family must write an explicit version number into the data it encodes (implementing {@link Versioned}).\n *\n * TODO: Users of this should migrate to {@link ClientVersionDispatchingCodecBuilder} so that the actual format version used can be encapsulated.\n */\nexport function makeVersionDispatchingCodec<TDecoded, TContext>(\n\tfamily: ICodecFamily<TDecoded, TContext>,\n\toptions: ICodecOptions & { writeVersion: number | string },\n): IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\tconst writeCodec = family.resolve(options.writeVersion).json;\n\tconst supportedVersions = new Set(family.getSupportedFormats());\n\treturn makeVersionedCodec(supportedVersions, options, {\n\t\tencode(data, context): Versioned {\n\t\t\treturn writeCodec.encode(data, context) as Versioned;\n\t\t},\n\t\tdecode(data: Versioned, context) {\n\t\t\tconst codec = family.resolve(data.version);\n\t\t\treturn codec.json.decode(data, context);\n\t\t},\n\t});\n}\n\n/**\n * Creates a codec which dispatches to the appropriate member of a codec family based on the `minVersionForCollab` for encode and the\n * version number in data it encounters for decode.\n * @privateRemarks\n * This is a two stage builder so the first stage can encapsulate all codec specific details and the second can bring in configuration.\n */\nexport class ClientVersionDispatchingCodecBuilder<TDecoded, TContext> {\n\tpublic constructor(\n\t\t/**\n\t\t * The codec family to dispatch to.\n\t\t */\n\t\tprivate readonly family: ICodecFamily<TDecoded, TContext>,\n\t\t/**\n\t\t * A function which maps a {@link MinimumVersionForCollab} to a version number for the codec family which is supported by that version.\n\t\t * This can (and typically does) pick the newest version of the codec which is known to be compatible with the client version so that\n\t\t * any improvements in newer versions of the codec can be used when allowed.\n\t\t */\n\t\tprivate readonly versionMapping: (minVersionForCollab: MinimumVersionForCollab) => number,\n\t) {}\n\n\tpublic build(\n\t\toptions: CodecWriteOptions,\n\t): IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\t\tconst writeVersion = this.versionMapping(options.minVersionForCollab);\n\t\treturn makeVersionDispatchingCodec(this.family, { ...options, writeVersion });\n\t}\n}\n"]}
1
+ {"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/codec/versioned/codec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAC7D,uEAAsE;AACtE,qEAKgD;AAChD,+CAAuD;AACvD,yCAA+B;AAM/B,0CAWqB;AAErB,2CAAwC;AACxC,+DAAqD;AAQrD,SAAS,kBAAkB,CAM1B,iBAAqC,EACrC,EAAE,aAAa,EAAE,SAAS,EAAiB,EAC3C,KAA0D;IAE1D,MAAM,KAAK,GAAG;QACb,MAAM,EAAE,CAAC,IAAc,EAAE,OAAiB,EAAY,EAAE;YACvD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC5C,IAAA,iBAAM,EACL,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EACtC,KAAK,CAAC,+CAA+C,CACrD,CAAC;YACF,OAAO,OAAO,CAAC;QAChB,CAAC;QACD,MAAM,EAAE,CAAC,IAAe,EAAE,OAAiB,EAAY,EAAE;YACxD,MAAM,SAAS,GAAG,IAAiB,CAAC,CAAC,oCAAoC;YACzE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC/C,MAAM,IAAI,qBAAU,CACnB,uBAAuB,SAAS,CAAC,OAAO,2EAA2E,CAAC,GAAG,iBAAiB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;4JACG,8BAAU,KAAK,CACtK,CAAC;YACH,CAAC;YACD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC5C,OAAO,OAAO,CAAC;QAChB,CAAC;KACD,CAAC;IAEF,OAAO,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC;QACtC,CAAC,CAAC,KAAK;QACP,CAAC,CAA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AAC,EAAE,CAAC;AACnF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport {\n\tgetConfigForMinVersionForCollabIterable,\n\ttype ConfigMapEntry,\n\ttype MinimumMinorSemanticVersion,\n\ttype SemanticVersion,\n} from \"@fluidframework/runtime-utils/internal\";\nimport { Type, type TSchema } from \"@sinclair/typebox\";\nimport { gt } from \"semver-ts\";\n\nimport type {\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlyObject,\n} from \"../../util/index.js\";\nimport {\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\twithSchemaValidation,\n\ttype FormatVersion,\n\ttype CodecWriteOptions,\n\ttype IMultiFormatCodec,\n\ttype CodecName,\n\tensureBinaryEncoding,\n\ttype CodecTree,\n} from \"../codec.js\";\n\nimport { Versioned } from \"./format.js\";\nimport { pkgVersion } from \"../../packageVersion.js\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\n\n/**\n * Json compatible data with a format version.\n */\ntype VersionedJson = JsonCompatibleReadOnlyObject & Versioned;\n\nfunction makeVersionedCodec<\n\tTDecoded,\n\tTEncoded extends Versioned = VersionedJson,\n\tTValidate = TEncoded,\n\tTContext = void,\n>(\n\tsupportedVersions: Set<FormatVersion>,\n\t{ jsonValidator: validator }: ICodecOptions,\n\tinner: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>,\n): IJsonCodec<TDecoded, TEncoded, TValidate, TContext> {\n\tconst codec = {\n\t\tencode: (data: TDecoded, context: TContext): TEncoded => {\n\t\t\tconst encoded = inner.encode(data, context);\n\t\t\tassert(\n\t\t\t\tsupportedVersions.has(encoded.version),\n\t\t\t\t0x88b /* version being encoded should be supported */,\n\t\t\t);\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (data: TValidate, context: TContext): TDecoded => {\n\t\t\tconst versioned = data as Versioned; // Validated by withSchemaValidation\n\t\t\tif (!supportedVersions.has(versioned.version)) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`Unsupported version ${versioned.version} encountered while decoding data. Supported versions for this data are: ${[...supportedVersions].join(\", \")}.\nThe client which encoded this data likely specified an \"minVersionForCollab\" value which corresponds to a version newer than the version of this client (\"${pkgVersion}\").`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst decoded = inner.decode(data, context);\n\t\t\treturn decoded;\n\t\t},\n\t};\n\n\treturn supportedVersions.has(undefined)\n\t\t? codec\n\t\t: withSchemaValidation(Versioned, codec, validator);\n}\n\n/**\n * TODO: users of this should migrate to {@link ClientVersionDispatchingCodecBuilder}.\n */\nexport function makeVersionedValidatedCodec<\n\tEncodedSchema extends TSchema,\n\tTDecoded,\n\tTEncoded extends Versioned = VersionedJson,\n\tTValidate = TEncoded,\n\tTContext = void,\n>(\n\toptions: ICodecOptions,\n\tsupportedVersions: Set<FormatVersion>,\n\tschema: EncodedSchema,\n\tcodec: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>,\n): IJsonCodec<TDecoded, TEncoded, TValidate, TContext> {\n\treturn makeVersionedCodec(\n\t\tsupportedVersions,\n\t\toptions,\n\t\twithSchemaValidation(schema, codec, options.jsonValidator),\n\t);\n}\n\n/**\n * Creates a codec which always throws a UsageError when encoding or decoding, indicating that the format version is discontinued.\n *\n * TODO: {@link ClientVersionDispatchingCodecBuilder} should get support for extra decode only entries and/or unstable formats (codecs without a minVersionForCollab that will never be selected for write unless overridden).\n * Once done, users of this should migrate to ClientVersionDispatchingCodecBuilder and this function can be simplified.\n */\nexport function makeDiscontinuedCodecVersion<\n\tTDecoded,\n\tTEncoded extends Versioned = VersionedJson,\n\tTContext = unknown,\n>(\n\toptions: ICodecOptions,\n\tdiscontinuedVersion: FormatVersion,\n\tdiscontinuedSince: SemanticVersion,\n): IJsonCodec<TDecoded, TEncoded, TEncoded, TContext> {\n\tconst schema = Type.Object(\n\t\t{\n\t\t\tversion:\n\t\t\t\tdiscontinuedVersion === undefined\n\t\t\t\t\t? Type.Undefined()\n\t\t\t\t\t: Type.Literal(discontinuedVersion),\n\t\t},\n\t\t// Using `additionalProperties: true` allows this schema to be used when loading data encoded by older versions even though they contain additional properties.\n\t\t{ additionalProperties: true },\n\t);\n\tconst codec: IJsonCodec<TDecoded, TEncoded, TEncoded, TContext> = {\n\t\tencode: (_: TDecoded): TEncoded => {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Cannot encode data to format ${discontinuedVersion}. The codec was discontinued in Fluid Framework client version ${discontinuedSince}.`,\n\t\t\t);\n\t\t},\n\t\tdecode: (data: TEncoded): TDecoded => {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Cannot decode data to format ${data.version}. The codec was discontinued in Fluid Framework client version ${discontinuedSince}.`,\n\t\t\t);\n\t\t},\n\t};\n\treturn makeVersionedValidatedCodec(options, new Set([discontinuedVersion]), schema, codec);\n}\n\n/**\n * Creates a codec which dispatches to the appropriate member of a codec family based on the version of\n * data it encounters.\n * @remarks\n * Each member of the codec family must write an explicit version number into the data it encodes (implementing {@link Versioned}).\n *\n * TODO: Users of this should migrate to {@link ClientVersionDispatchingCodecBuilder} so that the actual format version used can be encapsulated.\n */\nexport function makeVersionDispatchingCodec<TDecoded, TContext>(\n\tfamily: ICodecFamily<TDecoded, TContext>,\n\toptions: ICodecOptions & { writeVersion: FormatVersion },\n): IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\tconst writeCodec = family.resolve(options.writeVersion).json;\n\tconst supportedVersions = new Set(family.getSupportedFormats());\n\treturn makeVersionedCodec(supportedVersions, options, {\n\t\tencode(data, context): Versioned {\n\t\t\treturn writeCodec.encode(data, context) as Versioned;\n\t\t},\n\t\tdecode(data: Versioned, context) {\n\t\t\tconst codec = family.resolve(data.version);\n\t\t\treturn codec.json.decode(data, context);\n\t\t},\n\t});\n}\n\n/**\n * A friendly format for codec authors use to define their codec and schema for use in {@link CodecVersion}.\n * @remarks\n * The codec should not perform its own schema validation.\n * The schema validation gets added when normalizing to {@link NormalizedCodecVersion}.\n */\nexport type CodecAndSchema<TDecoded, TContext = void> = { readonly schema: TSchema } & (\n\t| IMultiFormatCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>\n\t| IJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>\n);\n\n/**\n * A codec alongside its format version and schema.\n */\nexport interface CodecVersionBase<\n\tT = unknown,\n\tTFormatVersion extends FormatVersion = FormatVersion,\n> {\n\treadonly formatVersion: TFormatVersion;\n\treadonly codec: T;\n}\n\n/**\n * A particular version of a codec and when to use it.\n * @privateRemarks\n * This allows lazy building of the codec with options.\n * This option can likely be removed as the codec handling is made simpler and more consistent.\n * Removing support for this laziness would be nice to help prevent unexpected coupling and alteration to codec behavior,\n * helping ensure that tests and production code behave the same.\n */\nexport interface CodecVersion<\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n\tTBuildOptions extends CodecWriteOptions,\n> extends CodecVersionBase<\n\t\t| CodecAndSchema<TDecoded, TContext>\n\t\t| ((options: TBuildOptions) => CodecAndSchema<TDecoded, TContext>),\n\t\tTFormatVersion\n\t> {}\n\n/**\n * {@link CodecVersion} after normalization into a consistent type.\n * @remarks\n * Produced by {@link normalizeCodecVersion}.\n * Includes schema validation.\n */\nexport interface NormalizedCodecVersion<\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n\tTBuildOptions extends CodecWriteOptions,\n> extends CodecVersionBase<\n\t\t(\n\t\t\toptions: TBuildOptions,\n\t\t) => IJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>,\n\t\tTFormatVersion\n\t> {}\n\n/**\n * {@link NormalizedCodecVersion} after applying the build options.\n * @remarks\n * Produced by {@link ClientVersionDispatchingCodecBuilder.applyOptions}.\n */\nexport interface EvaluatedCodecVersion<\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n> extends CodecVersionBase<\n\t\tIJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>,\n\t\tTFormatVersion\n\t> {}\n\n/**\n * Normalize the codec to a single format.\n * @remarks\n * Bakes in schema validation, so output no longer exposes the schema.\n */\nfunction normalizeCodecVersion<\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n\tTBuildOptions extends CodecWriteOptions,\n>(\n\tcodecVersion: CodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>,\n): NormalizedCodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions> {\n\tconst codecBuilder: (options: TBuildOptions) => CodecAndSchema<TDecoded, TContext> =\n\t\ttypeof codecVersion.codec === \"function\"\n\t\t\t? codecVersion.codec\n\t\t\t: () => codecVersion.codec as CodecAndSchema<TDecoded, TContext>;\n\tconst codec = (\n\t\toptions: TBuildOptions,\n\t): IJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext> => {\n\t\tconst built = codecBuilder(options);\n\t\t// We currently don't expose or use binary formats, but someday we might.\n\t\tconst multiFormat = ensureBinaryEncoding<TDecoded, TContext, VersionedJson>(built);\n\t\treturn makeVersionedValidatedCodec(\n\t\t\toptions,\n\t\t\tnew Set([codecVersion.formatVersion]),\n\t\t\tbuilt.schema,\n\t\t\tmultiFormat.json,\n\t\t);\n\t};\n\n\treturn {\n\t\tformatVersion: codecVersion.formatVersion,\n\t\tcodec,\n\t};\n}\n\n/**\n * Creates a codec which dispatches to the appropriate member of a codec family based on the `minVersionForCollab` for encode and the\n * version number in data it encounters for decode.\n * @privateRemarks\n * This is a two stage builder so the first stage can encapsulate all codec specific details and the second can bring in configuration.\n */\nexport class ClientVersionDispatchingCodecBuilder<\n\tName extends CodecName,\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n\tTBuildOptions extends CodecWriteOptions,\n> {\n\tpublic readonly registry: ReadonlyMap<\n\t\tMinimumVersionForCollab,\n\t\tNormalizedCodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>\n\t>;\n\n\t/**\n\t * Use {@link ClientVersionDispatchingCodecBuilder.build} to create an instance of this class.\n\t */\n\tprivate constructor(\n\t\t/**\n\t\t * See {@link CodecName}.\n\t\t */\n\t\tpublic readonly name: Name,\n\t\t/**\n\t\t * The registry of codecs which this builder can use to encode and decode data.\n\t\t */\n\t\tinputRegistry: ConfigMapEntry<\n\t\t\tCodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>\n\t\t>,\n\t) {\n\t\ttype Normalized = NormalizedCodecVersion<\n\t\t\tTDecoded,\n\t\t\tTContext,\n\t\t\tTFormatVersion,\n\t\t\tTBuildOptions\n\t\t>;\n\t\tconst normalizedRegistry = new Map<MinimumVersionForCollab, Normalized>();\n\n\t\tfor (const [minVersionForCollab, codec] of Object.entries(inputRegistry) as Iterable<\n\t\t\t[\n\t\t\t\tMinimumVersionForCollab,\n\t\t\t\tCodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>,\n\t\t\t]\n\t\t>) {\n\t\t\tconst normalizedCodec = normalizeCodecVersion(codec);\n\t\t\tnormalizedRegistry.set(minVersionForCollab, normalizedCodec);\n\t\t}\n\n\t\tthis.registry = normalizedRegistry;\n\t}\n\n\t/**\n\t * Applies the provided options to the codec registry to produce a list of evaluated codecs.\n\t * @remarks\n\t * This is used by build, which is what production code should use.\n\t * This is only exposed for testing purposes.\n\t */\n\tpublic applyOptions(\n\t\toptions: TBuildOptions,\n\t): [MinimumVersionForCollab, EvaluatedCodecVersion<TDecoded, TContext, TFormatVersion>][] {\n\t\treturn Array.from(\n\t\t\tthis.registry,\n\t\t\t([version, codec]) =>\n\t\t\t\t[\n\t\t\t\t\tversion,\n\t\t\t\t\t{\n\t\t\t\t\t\tformatVersion: codec.formatVersion,\n\t\t\t\t\t\tcodec: codec.codec(options),\n\t\t\t\t\t},\n\t\t\t\t] as const,\n\t\t);\n\t}\n\n\t/**\n\t * Produce a single codec which can read any supported format, and writes a version selected based on the provided options.\n\t */\n\tpublic build(\n\t\toptions: TBuildOptions,\n\t): IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\t\tconst applied = this.applyOptions(options);\n\t\tconst writeVersion = getWriteVersion(this.name, options, applied);\n\t\tconst fromFormatVersion = new Map<\n\t\t\tFormatVersion,\n\t\t\tEvaluatedCodecVersion<TDecoded, TContext, TFormatVersion>\n\t\t>(applied.map(([_version, codec]) => [codec.formatVersion, codec]));\n\t\treturn {\n\t\t\tencode: (data: TDecoded, context: TContext): JsonCompatibleReadOnly => {\n\t\t\t\treturn writeVersion.codec.encode(data, context);\n\t\t\t},\n\t\t\tdecode: (data: JsonCompatibleReadOnly, context: TContext): TDecoded => {\n\t\t\t\tconst versioned = data as Partial<Versioned>;\n\t\t\t\tconst codec = fromFormatVersion.get(versioned.version);\n\t\t\t\tif (codec === undefined) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Unsupported version ${versioned.version} encountered while decoding ${this.name} data. Supported versions for this data are: ${versionList(applied)}.\nThe client which encoded this data likely specified an \"minVersionForCollab\" value which corresponds to a version newer than the version of this client (\"${pkgVersion}\").`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn codec.codec.decode(data, context);\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic getCodecTree(clientVersion: MinimumVersionForCollab): CodecTree {\n\t\t// TODO: add support for children codecs.\n\t\tconst selected = getConfigForMinVersionForCollabIterable(clientVersion, this.registry);\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tversion: selected.formatVersion,\n\t\t};\n\t}\n\n\t/**\n\t * Builds a ClientVersionDispatchingCodecBuilder from the provided registry.\n\t * @remarks\n\t * This static method infers the types of the builder from the provided registry,\n\t * making it easier to create builders without needing to explicitly specify all type parameters.\n\t * This gets better type inference than the constructor.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tpublic static build<\n\t\tName extends CodecName,\n\t\tEntry extends CodecVersion<unknown, unknown, FormatVersion, never>,\n\t>(name: Name, inputRegistry: ConfigMapEntry<Entry>) {\n\t\ttype TDecoded2 = Entry extends CodecVersion<infer D, unknown, FormatVersion, never>\n\t\t\t? D\n\t\t\t: never;\n\t\ttype TContext2 = Entry extends CodecVersion<unknown, infer C, FormatVersion, never>\n\t\t\t? C\n\t\t\t: never;\n\t\ttype TFormatVersion2 = Entry extends CodecVersion<unknown, unknown, infer F, never>\n\t\t\t? F\n\t\t\t: never;\n\t\ttype TBuildOptions2 = Entry extends CodecVersion<unknown, unknown, FormatVersion, infer B>\n\t\t\t? B\n\t\t\t: never;\n\t\tconst builder = new ClientVersionDispatchingCodecBuilder(\n\t\t\tname,\n\t\t\tinputRegistry as ConfigMapEntry<unknown> as ConfigMapEntry<\n\t\t\t\tCodecVersion<\n\t\t\t\t\tTDecoded2,\n\t\t\t\t\t// If it does not matter what context is provided, undefined is fine, so allow it to be omitted.\n\t\t\t\t\tTContext2 extends unknown ? void : TContext2,\n\t\t\t\t\tTFormatVersion2,\n\t\t\t\t\tTBuildOptions2\n\t\t\t\t>\n\t\t\t>,\n\t\t);\n\t\treturn builder;\n\t}\n}\n\n/**\n * Selects which format should be used when writing data.\n * @remarks\n * This either uses the override specified in the options, or selects the newest format compatible with the provided minVersionForCollab.\n */\nfunction getWriteVersion<T extends CodecVersionBase>(\n\tname: CodecName,\n\toptions: CodecWriteOptions,\n\tversions: readonly [MinimumMinorSemanticVersion | MinimumVersionForCollab, T][],\n): T {\n\tif (options.writeVersionOverrides?.has(name) === true) {\n\t\tconst selectedFormatVersion = options.writeVersionOverrides.get(name);\n\t\tconst selected = versions.find(\n\t\t\t([_v, codec]) => codec.formatVersion === selectedFormatVersion,\n\t\t);\n\t\tif (selected === undefined) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Codec \"${name}\" does not support requested format version ${selectedFormatVersion}. Supported versions are: ${versionList(versions)}.`,\n\t\t\t);\n\t\t} else if (options.allowPossiblyIncompatibleWriteVersionOverrides !== true) {\n\t\t\tconst selectedMinVersionForCollab = selected[0];\n\t\t\t// Currently all versions must specify a minVersionForCollab, so undefined is not expected here.\n\t\t\t// TODO: It should be possible to have a version which would never be automatically selected for write (and thus does not have or need a minVersionForCollab), but can be selected via override.\n\t\t\t// Use-cases for this include experimental versions not yet stable, and discontinued or intermediate versions which are mainly being kept for read compatibility but still support writing (perhaps for round-trip testing).\n\t\t\t// For now, this check should never pass, and there is no way to create such a version yet.\n\t\t\tif (selectedMinVersionForCollab === undefined) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`Codec \"${name}\" does not support requested format version ${selectedFormatVersion} because it does not specify a minVersionForCollab. Use \"allowPossiblyIncompatibleWriteVersionOverrides\" to suppress this error if appropriate.`,\n\t\t\t\t);\n\t\t\t} else if (gt(selectedMinVersionForCollab, options.minVersionForCollab)) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`Codec \"${name}\" does not support requested format version ${selectedFormatVersion} because it is only compatible back to client version ${selectedMinVersionForCollab} and the requested oldest compatible client was ${options.minVersionForCollab}. Use \"allowPossiblyIncompatibleWriteVersionOverrides\" to suppress this error if appropriate.`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn selected[1];\n\t}\n\tconst result: T = getConfigForMinVersionForCollabIterable(\n\t\toptions.minVersionForCollab,\n\t\tversions,\n\t);\n\treturn result;\n}\n\n/**\n * Formats a list of versions for use in UsageErrors.\n */\nfunction versionList(\n\tversions: readonly [\n\t\tMinimumMinorSemanticVersion | MinimumVersionForCollab,\n\t\tCodecVersionBase,\n\t][],\n): string {\n\treturn `${Array.from(versions, ([_v, codec]) => codec.formatVersion).join(\", \")}`;\n}\n"]}
@@ -3,5 +3,5 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export { Versioned } from "./format.js";
6
- export { makeVersionedCodec, makeVersionedValidatedCodec, makeVersionDispatchingCodec, makeDiscontinuedCodecVersion, } from "./codec.js";
6
+ export { makeVersionedValidatedCodec, makeVersionDispatchingCodec, makeDiscontinuedCodecVersion, ClientVersionDispatchingCodecBuilder, type CodecVersion, type CodecAndSchema, } from "./codec.js";
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/codec/versioned/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACN,kBAAkB,EAClB,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,GAC5B,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/codec/versioned/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACN,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,oCAAoC,EACpC,KAAK,YAAY,EACjB,KAAK,cAAc,GACnB,MAAM,YAAY,CAAC"}
@@ -4,12 +4,12 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.makeDiscontinuedCodecVersion = exports.makeVersionDispatchingCodec = exports.makeVersionedValidatedCodec = exports.makeVersionedCodec = exports.Versioned = void 0;
7
+ exports.ClientVersionDispatchingCodecBuilder = exports.makeDiscontinuedCodecVersion = exports.makeVersionDispatchingCodec = exports.makeVersionedValidatedCodec = exports.Versioned = void 0;
8
8
  var format_js_1 = require("./format.js");
9
9
  Object.defineProperty(exports, "Versioned", { enumerable: true, get: function () { return format_js_1.Versioned; } });
10
10
  var codec_js_1 = require("./codec.js");
11
- Object.defineProperty(exports, "makeVersionedCodec", { enumerable: true, get: function () { return codec_js_1.makeVersionedCodec; } });
12
11
  Object.defineProperty(exports, "makeVersionedValidatedCodec", { enumerable: true, get: function () { return codec_js_1.makeVersionedValidatedCodec; } });
13
12
  Object.defineProperty(exports, "makeVersionDispatchingCodec", { enumerable: true, get: function () { return codec_js_1.makeVersionDispatchingCodec; } });
14
13
  Object.defineProperty(exports, "makeDiscontinuedCodecVersion", { enumerable: true, get: function () { return codec_js_1.makeDiscontinuedCodecVersion; } });
14
+ Object.defineProperty(exports, "ClientVersionDispatchingCodecBuilder", { enumerable: true, get: function () { return codec_js_1.ClientVersionDispatchingCodecBuilder; } });
15
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/codec/versioned/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,uCAKoB;AAJnB,8GAAA,kBAAkB,OAAA;AAClB,uHAAA,2BAA2B,OAAA;AAC3B,uHAAA,2BAA2B,OAAA;AAC3B,wHAAA,4BAA4B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { Versioned } from \"./format.js\";\nexport {\n\tmakeVersionedCodec,\n\tmakeVersionedValidatedCodec,\n\tmakeVersionDispatchingCodec,\n\tmakeDiscontinuedCodecVersion,\n} from \"./codec.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/codec/versioned/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,uCAOoB;AANnB,uHAAA,2BAA2B,OAAA;AAC3B,uHAAA,2BAA2B,OAAA;AAC3B,wHAAA,4BAA4B,OAAA;AAC5B,gIAAA,oCAAoC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { Versioned } from \"./format.js\";\nexport {\n\tmakeVersionedValidatedCodec,\n\tmakeVersionDispatchingCodec,\n\tmakeDiscontinuedCodecVersion,\n\tClientVersionDispatchingCodecBuilder,\n\ttype CodecVersion,\n\ttype CodecAndSchema,\n} from \"./codec.js\";\n"]}
@@ -8,10 +8,13 @@ import type { SchemaAndPolicy } from "../../core/index.js";
8
8
  import type { JsonCompatibleReadOnly } from "../../util/index.js";
9
9
  import type { ChangeRebaser, RevisionTag, TaggedChange } from "../rebase/index.js";
10
10
  export interface ChangeFamily<TEditor extends ChangeFamilyEditor, TChange> {
11
- buildEditor(mintRevisionTag: () => RevisionTag, changeReceiver: (change: TaggedChange<TChange>) => void): TEditor;
11
+ buildEditor(mintRevisionTag: () => RevisionTag, changeReceiver: (change: TaggedChange<TChange>) => void, options?: EditorOptions): TEditor;
12
12
  readonly rebaser: ChangeRebaser<TChange>;
13
13
  readonly codecs: ICodecFamily<TChange, ChangeEncodingContext>;
14
14
  }
15
+ export interface EditorOptions {
16
+ readonly canMakeDetachedRootEdits: boolean;
17
+ }
15
18
  export interface ChangeEncodingContext {
16
19
  readonly originatorId: SessionId;
17
20
  readonly revision: RevisionTag | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"changeFamily.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/changeFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE9E,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEnF,MAAM,WAAW,YAAY,CAAC,OAAO,SAAS,kBAAkB,EAAE,OAAO;IACxE,WAAW,CACV,eAAe,EAAE,MAAM,WAAW,EAClC,cAAc,EAAE,CAAC,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AAc,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,IAAI,EACvD,OAAO,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC;IAEX,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;CAC9D;AAED,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,wBAAwB,EAAE,OAAO,CAAC;CAC3C;AAED,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,MAAM,iBAAiB,CAAC,OAAO,IAAI,UAAU,CAClD,OAAO,EACP,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,CACrB,CAAC;AAEF,MAAM,WAAW,kBAAkB;IAClC;;;;;;;OAOG;IACH,gBAAgB,IAAI,IAAI,CAAC;IAEzB;;;;;;;OAOG;IACH,eAAe,IAAI,IAAI,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"changeFamily.js","sourceRoot":"","sources":["../../../src/core/change-family/changeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { ICodecFamily, IJsonCodec } from \"../../codec/index.js\";\nimport type { SchemaAndPolicy } from \"../../core/index.js\";\nimport type { JsonCompatibleReadOnly } from \"../../util/index.js\";\nimport type { ChangeRebaser, RevisionTag, TaggedChange } from \"../rebase/index.js\";\n\nexport interface ChangeFamily<TEditor extends ChangeFamilyEditor, TChange> {\n\tbuildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<TChange>) => void,\n\t): TEditor;\n\n\treadonly rebaser: ChangeRebaser<TChange>;\n\treadonly codecs: ICodecFamily<TChange, ChangeEncodingContext>;\n}\n\nexport interface ChangeEncodingContext {\n\treadonly originatorId: SessionId;\n\treadonly revision: RevisionTag | undefined;\n\treadonly idCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n}\n\nexport type ChangeFamilyCodec<TChange> = IJsonCodec<\n\tTChange,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tChangeEncodingContext\n>;\n\nexport interface ChangeFamilyEditor {\n\t/**\n\t * Must be called when a new transaction starts.\n\t *\n\t * Note: transactions are an optional feature. It is valid to make edits outside of a transaction.\n\t *\n\t * For each call to this function, a matching call to `exitTransaction` must be made at a later time.\n\t * Can be called repeatedly to indicate the start of nesting transactions.\n\t */\n\tenterTransaction(): void;\n\n\t/**\n\t * Must be called when a transaction ends.\n\t *\n\t * Note: transactions are an optional feature. It is valid to make edits outside of a transaction.\n\t *\n\t * For each call to this function, a matching call to `enterTransaction` must be made at an earlier time.\n\t * Can be called repeatedly to indicate the end of nesting transactions.\n\t */\n\texitTransaction(): void;\n}\n"]}
1
+ {"version":3,"file":"changeFamily.js","sourceRoot":"","sources":["../../../src/core/change-family/changeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { ICodecFamily, IJsonCodec } from \"../../codec/index.js\";\nimport type { SchemaAndPolicy } from \"../../core/index.js\";\nimport type { JsonCompatibleReadOnly } from \"../../util/index.js\";\nimport type { ChangeRebaser, RevisionTag, TaggedChange } from \"../rebase/index.js\";\n\nexport interface ChangeFamily<TEditor extends ChangeFamilyEditor, TChange> {\n\tbuildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<TChange>) => void,\n\t\toptions?: EditorOptions,\n\t): TEditor;\n\n\treadonly rebaser: ChangeRebaser<TChange>;\n\treadonly codecs: ICodecFamily<TChange, ChangeEncodingContext>;\n}\n\nexport interface EditorOptions {\n\treadonly canMakeDetachedRootEdits: boolean; // default is false,\n}\n\nexport interface ChangeEncodingContext {\n\treadonly originatorId: SessionId;\n\treadonly revision: RevisionTag | undefined;\n\treadonly idCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n}\n\nexport type ChangeFamilyCodec<TChange> = IJsonCodec<\n\tTChange,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tChangeEncodingContext\n>;\n\nexport interface ChangeFamilyEditor {\n\t/**\n\t * Must be called when a new transaction starts.\n\t *\n\t * Note: transactions are an optional feature. It is valid to make edits outside of a transaction.\n\t *\n\t * For each call to this function, a matching call to `exitTransaction` must be made at a later time.\n\t * Can be called repeatedly to indicate the start of nesting transactions.\n\t */\n\tenterTransaction(): void;\n\n\t/**\n\t * Must be called when a transaction ends.\n\t *\n\t * Note: transactions are an optional feature. It is valid to make edits outside of a transaction.\n\t *\n\t * For each call to this function, a matching call to `enterTransaction` must be made at an earlier time.\n\t * Can be called repeatedly to indicate the end of nesting transactions.\n\t */\n\texitTransaction(): void;\n}\n"]}
@@ -2,6 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export type { ChangeFamily, ChangeFamilyEditor, ChangeEncodingContext, ChangeFamilyCodec, } from "./changeFamily.js";
5
+ export type { ChangeFamily, ChangeFamilyEditor, ChangeEncodingContext, ChangeFamilyCodec, EditorOptions, } from "./changeFamily.js";
6
6
  export { EditBuilder } from "./editBuilder.js";
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/change-family/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,mDAA+C;AAAtC,6GAAA,WAAW,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tChangeFamily,\n\tChangeFamilyEditor,\n\tChangeEncodingContext,\n\tChangeFamilyCodec,\n} from \"./changeFamily.js\";\nexport { EditBuilder } from \"./editBuilder.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/change-family/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,mDAA+C;AAAtC,6GAAA,WAAW,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tChangeFamily,\n\tChangeFamilyEditor,\n\tChangeEncodingContext,\n\tChangeFamilyCodec,\n\tEditorOptions,\n} from \"./changeFamily.js\";\nexport { EditBuilder } from \"./editBuilder.js\";\n"]}
@@ -2,11 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { EmptyKey, type TreeType, type Value, type TreeValue, AnchorSet, type DetachedField, type UpPath, type NormalizedUpPath, type INormalizedUpPath, type NormalizedFieldUpPath, type Range, type RangeUpPath, type PlaceUpPath, type PlaceIndex, type NodeIndex, type FieldUpPath, type Anchor, type RootField, type ChildCollection, type ChildLocation, type FieldMapObject, type NodeData, type GenericTreeNode, type JsonableTree, EncodedJsonableTree, rootFieldKey, rootField, type ITreeCursor, CursorLocationType, type ITreeCursorSynchronous, castCursorToSynchronous, type GenericFieldsNode, type AnchorLocator, genericTreeKeys, getGenericTreeField, genericTreeDeleteIfEmpty, getDepth, mapCursorField, mapCursorFields, iterateCursorField, type MapTree, detachedFieldAsKey, keyAsDetachedField, visitDelta, createAnnouncedVisitor, combineVisitors, announceDelta, applyDelta, makeDetachedFieldIndex, setGenericTreeField, type DeltaVisitor, type AnnouncedVisitor, SparseNode, getDescendant, compareUpPaths, clonePath, topDownPath, compareFieldUpPaths, forEachNode, forEachNodeInSubtree, forEachField, type PathRootPrefix, deltaForRootInitialization, makeDetachedNodeId, offsetDetachId, emptyDelta, type AnchorSlot, type AnchorNode, anchorSlot, type UpPathDefault, isDetachedUpPath, inCursorField, inCursorNode, type AnchorEvents, type AnchorSetRootEvents, type ProtoNodes, CursorMarker, isCursor, DetachedFieldIndex, type ReadOnlyDetachedFieldIndex, type DetachedFieldIndexCheckpoint, type ForestRootId, getDetachedFieldContainingPath, aboveRootPlaceholder, type DeltaRoot, type DeltaMark, type DeltaDetachedNodeId, type DeltaFieldMap, type DeltaDetachedNodeChanges, type DeltaDetachedNodeBuild, type DeltaDetachedNodeDestruction, type DeltaDetachedNodeRename, type DeltaFieldChanges, type ExclusiveMapTree, deepCopyMapTree, type TreeChunk, dummyRoot, cursorChunk, tryGetChunk, type ChunkedCursor, DetachedFieldIndexFormatVersion, getCodecTreeForDetachedFieldIndexFormat, } from "./tree/index.js";
5
+ export { EmptyKey, type TreeType, type Value, type TreeValue, AnchorSet, type DetachedField, type UpPath, type NormalizedUpPath, type INormalizedUpPath, type NormalizedFieldUpPath, type Range, type RangeUpPath, type PlaceUpPath, type PlaceIndex, type NodeIndex, type FieldUpPath, type Anchor, type RootField, type ChildCollection, type ChildLocation, type FieldMapObject, type NodeData, type GenericTreeNode, type JsonableTree, EncodedJsonableTree, rootFieldKey, rootField, type ITreeCursor, CursorLocationType, type ITreeCursorSynchronous, castCursorToSynchronous, type GenericFieldsNode, type AnchorLocator, genericTreeKeys, getGenericTreeField, genericTreeDeleteIfEmpty, getDepth, mapCursorField, mapCursorFields, iterateCursorField, type MapTree, detachedFieldAsKey, keyAsDetachedField, visitDelta, createAnnouncedVisitor, combineVisitors, announceDelta, applyDelta, makeDetachedFieldIndex, setGenericTreeField, type DeltaVisitor, type AnnouncedVisitor, SparseNode, getDescendant, compareUpPaths, clonePath, topDownPath, compareFieldUpPaths, forEachNode, forEachNodeInSubtree, forEachField, type PathRootPrefix, deltaForRootInitialization, makeDetachedNodeId, offsetDetachId, emptyDelta, type AnchorSlot, type AnchorNode, anchorSlot, type UpPathDefault, isDetachedUpPathRoot, inCursorField, inCursorNode, type AnchorEvents, type AnchorSetRootEvents, type ProtoNodes, CursorMarker, isCursor, DetachedFieldIndex, type ReadOnlyDetachedFieldIndex, type DetachedFieldIndexCheckpoint, type ForestRootId, getDetachedFieldContainingPath, getDetachedFieldContainingFieldPath, aboveRootPlaceholder, type DeltaRoot, type DeltaMark, type DeltaDetachedNodeId, type DeltaFieldMap, type DeltaDetachedNodeChanges, type DeltaDetachedNodeBuild, type DeltaDetachedNodeDestruction, type DeltaDetachedNodeRename, type DeltaFieldChanges, type ExclusiveMapTree, deepCopyMapTree, type TreeChunk, dummyRoot, cursorChunk, tryGetChunk, type ChunkedCursor, DetachedFieldIndexFormatVersion, detachedFieldIndexCodecBuilder, } from "./tree/index.js";
6
6
  export { TreeNavigationResult, type IEditableForest, type IForestSubscription, type TreeLocation, type FieldLocation, type ForestLocation, type ITreeSubscriptionCursor, ITreeSubscriptionCursorState, type FieldAnchor, moveToDetachedField, type ForestEvents, } from "./forest/index.js";
7
7
  export { type FieldKey, type TreeNodeSchemaIdentifier, type TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, type TreeStoredSchemaSubscription, type MutableTreeStoredSchema, type FieldKindIdentifier, type FieldKindData, type TreeTypeSet, type TreeStoredSchema, TreeStoredSchemaRepository, schemaDataIsEmpty, type SchemaEvents, forbiddenFieldKindIdentifier, identifierFieldKindIdentifier, storedEmptyFieldSchema, type StoredSchemaCollection, schemaFormatV1, schemaFormatV2, LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema, decodeFieldSchema, encodeFieldSchemaV1, encodeFieldSchemaV2, storedSchemaDecodeDispatcher, type SchemaAndPolicy, Multiplicity, type SchemaPolicy, SchemaFormatVersion, } from "./schema-stored/index.js";
8
- export { type ChangeFamily, type ChangeFamilyCodec, type ChangeEncodingContext, type ChangeFamilyEditor, EditBuilder, } from "./change-family/index.js";
9
- export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, type ChangeRebaser, findAncestor, findCommonAncestor, type GraphCommit, CommitKind, type CommitMetadata, type ChangeMetadata, type RevisionTag, RevisionTagSchema, RevisionTagCodec, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, type TaggedChange, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, SessionIdSchema, mintCommit, rebaseBranch, type BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, type RevisionMetadataSource, revisionMetadataSourceFromInfo, type RevisionInfo, type EncodedRevisionTag, type EncodedStableId, type EncodedChangeAtomId, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, replaceAtomRevisions, replaceChange, type RebaseStats, type RebaseStatsWithDuration, isAncestor, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, compareRevisions, diffHistories, } from "./rebase/index.js";
8
+ export { type ChangeFamily, type ChangeFamilyCodec, type ChangeEncodingContext, type ChangeFamilyEditor, EditBuilder, type EditorOptions, } from "./change-family/index.js";
9
+ export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, type ChangeRebaser, findAncestor, findCommonAncestor, type GraphCommit, CommitKind, type CommitMetadata, type LocalChangeMetadata, type RemoteChangeMetadata, type ChangeMetadata, type RevisionTag, RevisionTagSchema, RevisionTagCodec, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, type TaggedChange, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, SessionIdSchema, mintCommit, rebaseBranch, type BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, type RevisionMetadataSource, revisionMetadataSourceFromInfo, type RevisionInfo, type EncodedRevisionTag, type EncodedStableId, type EncodedChangeAtomId, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, replaceChange, type RebaseStats, type RebaseStatsWithDuration, isAncestor, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, newChangeAtomIdTransform, compareRevisions, diffHistories, type RevisionReplacer, } from "./rebase/index.js";
10
10
  export { type Adapters, AdaptedViewSchema, type TreeAdapter, } from "./schema-view/index.js";
11
11
  export { type Revertible, RevertibleStatus, type RevertibleFactory, type RevertibleAlphaFactory, type RevertibleAlpha, } from "./revertible.js";
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf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WAAW,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,KAAK,kBAAkB,EACvB,YAAY,EACZ,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,8BAA8B,EAC9B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,UAAU,EACV,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,gBAAgB,EAChB,aAAa,GACb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,KAAK,QAAQ,EACb,iBAAiB,EACjB,KAAK,WAAW,GAChB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,GACpB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,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