@fluidframework/tree 2.90.0 → 2.92.0

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 (1006) hide show
  1. package/CHANGELOG.md +365 -0
  2. package/alpha.d.ts +2 -2
  3. package/api-extractor/api-extractor-lint-alpha.cjs.json +1 -1
  4. package/api-extractor/api-extractor-lint-alpha.esm.json +1 -1
  5. package/api-extractor/api-extractor-lint-beta.cjs.json +1 -1
  6. package/api-extractor/api-extractor-lint-beta.esm.json +1 -1
  7. package/api-extractor/api-extractor-lint-bundle.json +1 -1
  8. package/api-extractor/api-extractor-lint-legacy.cjs.json +1 -1
  9. package/api-extractor/api-extractor-lint-legacy.esm.json +1 -1
  10. package/api-extractor/api-extractor-lint-public.cjs.json +1 -1
  11. package/api-extractor/api-extractor-lint-public.esm.json +1 -1
  12. package/api-extractor/api-extractor.current.json +1 -1
  13. package/api-extractor/api-extractor.legacy.json +2 -1
  14. package/api-extractor.json +1 -0
  15. package/api-report/tree.alpha.api.md +141 -37
  16. package/beta.d.ts +2 -2
  17. package/dist/api.d.ts +6 -1
  18. package/dist/api.d.ts.map +1 -1
  19. package/dist/api.js.map +1 -1
  20. package/dist/codec/codec.d.ts +28 -2
  21. package/dist/codec/codec.d.ts.map +1 -1
  22. package/dist/codec/codec.js +1 -0
  23. package/dist/codec/codec.js.map +1 -1
  24. package/dist/codec/index.d.ts +2 -2
  25. package/dist/codec/index.d.ts.map +1 -1
  26. package/dist/codec/index.js +2 -4
  27. package/dist/codec/index.js.map +1 -1
  28. package/dist/codec/versioned/codec.d.ts +18 -36
  29. package/dist/codec/versioned/codec.d.ts.map +1 -1
  30. package/dist/codec/versioned/codec.js +46 -59
  31. package/dist/codec/versioned/codec.js.map +1 -1
  32. package/dist/codec/versioned/index.d.ts +1 -1
  33. package/dist/codec/versioned/index.d.ts.map +1 -1
  34. package/dist/codec/versioned/index.js +2 -4
  35. package/dist/codec/versioned/index.js.map +1 -1
  36. package/dist/core/forest/forest.d.ts +5 -2
  37. package/dist/core/forest/forest.d.ts.map +1 -1
  38. package/dist/core/forest/forest.js.map +1 -1
  39. package/dist/core/index.d.ts +1 -1
  40. package/dist/core/index.d.ts.map +1 -1
  41. package/dist/core/index.js +6 -2
  42. package/dist/core/index.js.map +1 -1
  43. package/dist/core/rebase/changeRebaser.d.ts +8 -1
  44. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  45. package/dist/core/rebase/changeRebaser.js.map +1 -1
  46. package/dist/core/rebase/revisionTagCodec.d.ts +4 -3
  47. package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
  48. package/dist/core/rebase/revisionTagCodec.js +2 -0
  49. package/dist/core/rebase/revisionTagCodec.js.map +1 -1
  50. package/dist/core/rebase/utils.d.ts +2 -2
  51. package/dist/core/rebase/utils.d.ts.map +1 -1
  52. package/dist/core/rebase/utils.js +4 -4
  53. package/dist/core/rebase/utils.js.map +1 -1
  54. package/dist/core/schema-stored/formatV2.d.ts +1 -1
  55. package/dist/core/schema-stored/formatV2.js +1 -1
  56. package/dist/core/schema-stored/formatV2.js.map +1 -1
  57. package/dist/core/tree/anchorSet.d.ts +8 -0
  58. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  59. package/dist/core/tree/anchorSet.js +42 -7
  60. package/dist/core/tree/anchorSet.js.map +1 -1
  61. package/dist/core/tree/cursor.d.ts +25 -1
  62. package/dist/core/tree/cursor.d.ts.map +1 -1
  63. package/dist/core/tree/cursor.js +45 -1
  64. package/dist/core/tree/cursor.js.map +1 -1
  65. package/dist/core/tree/deltaUtil.d.ts +13 -1
  66. package/dist/core/tree/deltaUtil.d.ts.map +1 -1
  67. package/dist/core/tree/deltaUtil.js +34 -1
  68. package/dist/core/tree/deltaUtil.js.map +1 -1
  69. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +5 -5
  70. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  71. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  72. package/dist/core/tree/index.d.ts +2 -2
  73. package/dist/core/tree/index.d.ts.map +1 -1
  74. package/dist/core/tree/index.js +6 -2
  75. package/dist/core/tree/index.js.map +1 -1
  76. package/dist/core/tree/visitDelta.d.ts +11 -0
  77. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  78. package/dist/core/tree/visitDelta.js +1 -1
  79. package/dist/core/tree/visitDelta.js.map +1 -1
  80. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  81. package/dist/core/tree/visitorUtils.js +5 -0
  82. package/dist/core/tree/visitorUtils.js.map +1 -1
  83. package/dist/entrypoints/alpha.d.ts +6 -0
  84. package/dist/entrypoints/alpha.d.ts.map +1 -0
  85. package/dist/entrypoints/alpha.js +91 -0
  86. package/dist/entrypoints/alpha.js.map +1 -0
  87. package/dist/entrypoints/beta.d.ts +6 -0
  88. package/dist/entrypoints/beta.d.ts.map +1 -0
  89. package/dist/entrypoints/beta.js +43 -0
  90. package/dist/entrypoints/beta.js.map +1 -0
  91. package/dist/entrypoints/internal.d.ts +6 -0
  92. package/dist/entrypoints/internal.d.ts.map +1 -0
  93. package/dist/entrypoints/internal.js +28 -0
  94. package/dist/entrypoints/internal.js.map +1 -0
  95. package/dist/entrypoints/legacy.d.ts +6 -0
  96. package/dist/entrypoints/legacy.d.ts.map +1 -0
  97. package/dist/entrypoints/legacy.js +49 -0
  98. package/dist/entrypoints/legacy.js.map +1 -0
  99. package/dist/entrypoints/public.d.ts +6 -0
  100. package/dist/entrypoints/public.d.ts.map +1 -0
  101. package/dist/entrypoints/public.js +27 -0
  102. package/dist/entrypoints/public.js.map +1 -0
  103. package/dist/feature-libraries/changeAtomIdCodec.d.ts +4 -3
  104. package/dist/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  105. package/dist/feature-libraries/changeAtomIdCodec.js +2 -0
  106. package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
  107. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -1
  108. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  109. package/dist/feature-libraries/chunked-forest/chunkedForest.js +2 -2
  110. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  111. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +4 -4
  112. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  113. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -6
  114. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  115. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  116. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  117. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  118. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -2
  119. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  120. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  121. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -4
  122. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  123. package/dist/feature-libraries/chunked-forest/codec/codecs.js +6 -6
  124. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  125. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +12 -12
  126. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  127. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +3 -3
  128. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  129. package/dist/feature-libraries/chunked-forest/codec/{formatGeneric.d.ts → format/formatGeneric.d.ts} +1 -1
  130. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -0
  131. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -0
  132. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +187 -0
  133. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -0
  134. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +115 -0
  135. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -0
  136. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +33 -0
  137. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -0
  138. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +16 -0
  139. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -0
  140. package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts +10 -0
  141. package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -0
  142. package/dist/feature-libraries/chunked-forest/codec/format/index.js +18 -0
  143. package/dist/feature-libraries/chunked-forest/codec/format/index.js.map +1 -0
  144. package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts +93 -0
  145. package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -0
  146. package/dist/feature-libraries/chunked-forest/codec/format/versions.js +29 -0
  147. package/dist/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -0
  148. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  149. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  150. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -2
  151. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  152. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
  153. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  154. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  155. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  156. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  157. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +6 -4
  158. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  159. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +1 -1
  160. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  161. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +3 -3
  162. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  163. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  164. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  165. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  166. package/dist/feature-libraries/cursorComparator.d.ts +23 -0
  167. package/dist/feature-libraries/cursorComparator.d.ts.map +1 -0
  168. package/dist/feature-libraries/cursorComparator.js +65 -0
  169. package/dist/feature-libraries/cursorComparator.js.map +1 -0
  170. package/dist/feature-libraries/forest-summary/codec.d.ts +1 -1
  171. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +3 -3
  172. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  173. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  174. package/dist/feature-libraries/index.d.ts +3 -2
  175. package/dist/feature-libraries/index.d.ts.map +1 -1
  176. package/dist/feature-libraries/index.js +5 -5
  177. package/dist/feature-libraries/index.js.map +1 -1
  178. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +2 -0
  179. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  180. package/dist/feature-libraries/indexing/anchorTreeIndex.js +12 -7
  181. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  182. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  183. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  184. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  185. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +3 -3
  186. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  187. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  188. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +1 -0
  189. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
  190. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -6
  191. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  192. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +3 -3
  193. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  194. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  195. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  196. package/dist/feature-libraries/modular-schema/genericFieldKind.js +0 -1
  197. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  198. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +10 -10
  199. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  200. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -4
  201. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  202. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +3 -3
  203. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  204. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  205. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +3 -3
  206. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  207. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  208. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -1
  209. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  210. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +11 -6
  211. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  212. package/dist/feature-libraries/object-forest/objectForest.d.ts +1 -1
  213. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  214. package/dist/feature-libraries/object-forest/objectForest.js +2 -2
  215. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  216. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +4 -4
  217. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  218. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  219. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +3 -3
  220. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  221. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  222. package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
  223. package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
  224. package/dist/feature-libraries/schema-edits/index.js +2 -3
  225. package/dist/feature-libraries/schema-edits/index.js.map +1 -1
  226. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -15
  227. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  228. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +8 -54
  229. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  230. package/dist/feature-libraries/schema-index/codec.d.ts +3 -16
  231. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  232. package/dist/feature-libraries/schema-index/codec.js +1 -21
  233. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  234. package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
  235. package/dist/feature-libraries/schema-index/formatV2.js +1 -1
  236. package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
  237. package/dist/feature-libraries/schema-index/index.d.ts +1 -1
  238. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  239. package/dist/feature-libraries/schema-index/index.js +1 -2
  240. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  241. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +1 -1
  242. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  243. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  244. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -4
  245. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  246. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  247. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +3 -3
  248. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  249. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  250. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +3 -3
  251. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  252. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  253. package/dist/index.d.ts +8 -2
  254. package/dist/index.d.ts.map +1 -1
  255. package/dist/index.js +4 -3
  256. package/dist/index.js.map +1 -1
  257. package/dist/packageVersion.d.ts +1 -1
  258. package/dist/packageVersion.js +1 -1
  259. package/dist/packageVersion.js.map +1 -1
  260. package/dist/shared-tree/independentView.d.ts +1 -1
  261. package/dist/shared-tree/independentView.d.ts.map +1 -1
  262. package/dist/shared-tree/independentView.js +14 -21
  263. package/dist/shared-tree/independentView.js.map +1 -1
  264. package/dist/shared-tree/index.d.ts +2 -2
  265. package/dist/shared-tree/index.d.ts.map +1 -1
  266. package/dist/shared-tree/index.js +1 -2
  267. package/dist/shared-tree/index.js.map +1 -1
  268. package/dist/shared-tree/schematizingTreeView.d.ts +2 -36
  269. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  270. package/dist/shared-tree/schematizingTreeView.js +15 -117
  271. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  272. package/dist/shared-tree/sharedTree.d.ts +3 -22
  273. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  274. package/dist/shared-tree/sharedTree.js +10 -27
  275. package/dist/shared-tree/sharedTree.js.map +1 -1
  276. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +3 -2
  277. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  278. package/dist/shared-tree/sharedTreeChangeCodecs.js +23 -16
  279. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  280. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  281. package/dist/shared-tree/sharedTreeChangeEnricher.js +1 -1
  282. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  283. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  284. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  285. package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
  286. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  287. package/dist/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  288. package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  289. package/dist/shared-tree/sharedTreeChangeFormat.js +13 -5
  290. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  291. package/dist/shared-tree/tree.d.ts.map +1 -1
  292. package/dist/shared-tree/tree.js +2 -1
  293. package/dist/shared-tree/tree.js.map +1 -1
  294. package/dist/shared-tree/treeAlpha.d.ts +13 -1
  295. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  296. package/dist/shared-tree/treeAlpha.js +3 -0
  297. package/dist/shared-tree/treeAlpha.js.map +1 -1
  298. package/dist/shared-tree/treeCheckout.d.ts +34 -69
  299. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  300. package/dist/shared-tree/treeCheckout.js +885 -677
  301. package/dist/shared-tree/treeCheckout.js.map +1 -1
  302. package/dist/shared-tree/unhydratedTreeContext.js +3 -3
  303. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
  304. package/dist/shared-tree-core/editManagerCodecs.d.ts +23 -12
  305. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  306. package/dist/shared-tree-core/editManagerCodecs.js +40 -67
  307. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  308. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  309. package/dist/shared-tree-core/editManagerCodecsCommons.js +0 -1
  310. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  311. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +10 -2
  312. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  313. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +18 -13
  314. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  315. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
  316. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  317. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +6 -9
  318. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  319. package/dist/shared-tree-core/index.d.ts +3 -3
  320. package/dist/shared-tree-core/index.d.ts.map +1 -1
  321. package/dist/shared-tree-core/index.js +5 -8
  322. package/dist/shared-tree-core/index.js.map +1 -1
  323. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -3
  324. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  325. package/dist/shared-tree-core/messageCodecV1ToV4.js +8 -8
  326. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  327. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts +2 -3
  328. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  329. package/dist/shared-tree-core/messageCodecVSharedBranches.js +5 -4
  330. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  331. package/dist/shared-tree-core/messageCodecs.d.ts +15 -14
  332. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  333. package/dist/shared-tree-core/messageCodecs.js +38 -74
  334. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  335. package/dist/shared-tree-core/messageFormat.d.ts +0 -1
  336. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  337. package/dist/shared-tree-core/messageFormat.js +1 -2
  338. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  339. package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -3
  340. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  341. package/dist/shared-tree-core/sharedTreeCore.js +12 -2
  342. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  343. package/dist/sharedTreeAttributes.d.ts.map +1 -1
  344. package/dist/sharedTreeAttributes.js +3 -0
  345. package/dist/sharedTreeAttributes.js.map +1 -1
  346. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +43 -0
  347. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  348. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  349. package/dist/simple-tree/api/index.d.ts +4 -2
  350. package/dist/simple-tree/api/index.d.ts.map +1 -1
  351. package/dist/simple-tree/api/index.js.map +1 -1
  352. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  353. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  354. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +126 -29
  355. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  356. package/dist/simple-tree/api/schemaFactoryAlpha.js +72 -7
  357. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  358. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  359. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  360. package/dist/simple-tree/api/schemaStatics.d.ts +10 -11
  361. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  362. package/dist/simple-tree/api/schemaStatics.js +13 -7
  363. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  364. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  365. package/dist/simple-tree/api/storedSchema.js +6 -6
  366. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  367. package/dist/simple-tree/api/tree.d.ts +7 -19
  368. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  369. package/dist/simple-tree/api/tree.js.map +1 -1
  370. package/dist/simple-tree/api/treeAlpha.d.ts +69 -0
  371. package/dist/simple-tree/api/treeAlpha.d.ts.map +1 -0
  372. package/dist/simple-tree/api/treeAlpha.js +7 -0
  373. package/dist/simple-tree/api/treeAlpha.js.map +1 -0
  374. package/dist/simple-tree/api/treeBeta.d.ts +1 -1
  375. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  376. package/dist/simple-tree/api/treeChangeEvents.d.ts +3 -0
  377. package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  378. package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
  379. package/dist/simple-tree/api/treeNodeApi.d.ts +49 -0
  380. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  381. package/dist/simple-tree/api/treeNodeApi.js +41 -2
  382. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  383. package/dist/simple-tree/api/typesUnsafe.d.ts +23 -2
  384. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  385. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  386. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  387. package/dist/simple-tree/core/treeNodeKernel.js +45 -8
  388. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  389. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  390. package/dist/simple-tree/core/unhydratedFlexTree.js +5 -1
  391. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  392. package/dist/simple-tree/fieldSchema.d.ts +3 -2
  393. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  394. package/dist/simple-tree/fieldSchema.js +3 -4
  395. package/dist/simple-tree/fieldSchema.js.map +1 -1
  396. package/dist/simple-tree/index.d.ts +2 -2
  397. package/dist/simple-tree/index.d.ts.map +1 -1
  398. package/dist/simple-tree/index.js.map +1 -1
  399. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +16 -0
  400. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  401. package/dist/simple-tree/node-kinds/array/arrayNode.js +23 -0
  402. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  403. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +10 -1
  404. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  405. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  406. package/dist/simple-tree/node-kinds/array/index.d.ts +2 -2
  407. package/dist/simple-tree/node-kinds/array/index.d.ts.map +1 -1
  408. package/dist/simple-tree/node-kinds/array/index.js.map +1 -1
  409. package/dist/simple-tree/node-kinds/index.d.ts +2 -2
  410. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  411. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  412. package/dist/simple-tree/node-kinds/object/index.d.ts +2 -2
  413. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  414. package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
  415. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +43 -7
  416. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  417. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  418. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +26 -2
  419. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  420. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  421. package/dist/text/textDomainFormatted.d.ts +321 -13
  422. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  423. package/dist/text/textDomainFormatted.js +100 -25
  424. package/dist/text/textDomainFormatted.js.map +1 -1
  425. package/dist/treeFactory.d.ts.map +1 -1
  426. package/dist/treeFactory.js +5 -2
  427. package/dist/treeFactory.js.map +1 -1
  428. package/dist/util/rangeMap.d.ts +25 -18
  429. package/dist/util/rangeMap.d.ts.map +1 -1
  430. package/dist/util/rangeMap.js +24 -30
  431. package/dist/util/rangeMap.js.map +1 -1
  432. package/dist/util/referenceCounting.d.ts.map +1 -1
  433. package/dist/util/referenceCounting.js +0 -1
  434. package/dist/util/referenceCounting.js.map +1 -1
  435. package/dist/util/typeCheck.d.ts.map +1 -1
  436. package/dist/util/typeCheck.js.map +1 -1
  437. package/dist/util/typeUtils.d.ts.map +1 -1
  438. package/dist/util/typeUtils.js.map +1 -1
  439. package/eslint.config.mts +10 -2
  440. package/internal.d.ts +2 -2
  441. package/legacy.d.ts +2 -2
  442. package/lib/api.d.ts +6 -1
  443. package/lib/api.d.ts.map +1 -1
  444. package/lib/api.js.map +1 -1
  445. package/lib/codec/codec.d.ts +28 -2
  446. package/lib/codec/codec.d.ts.map +1 -1
  447. package/lib/codec/codec.js +1 -0
  448. package/lib/codec/codec.js.map +1 -1
  449. package/lib/codec/index.d.ts +2 -2
  450. package/lib/codec/index.d.ts.map +1 -1
  451. package/lib/codec/index.js +1 -1
  452. package/lib/codec/index.js.map +1 -1
  453. package/lib/codec/versioned/codec.d.ts +18 -36
  454. package/lib/codec/versioned/codec.d.ts.map +1 -1
  455. package/lib/codec/versioned/codec.js +45 -56
  456. package/lib/codec/versioned/codec.js.map +1 -1
  457. package/lib/codec/versioned/index.d.ts +1 -1
  458. package/lib/codec/versioned/index.d.ts.map +1 -1
  459. package/lib/codec/versioned/index.js +1 -1
  460. package/lib/codec/versioned/index.js.map +1 -1
  461. package/lib/core/forest/forest.d.ts +5 -2
  462. package/lib/core/forest/forest.d.ts.map +1 -1
  463. package/lib/core/forest/forest.js.map +1 -1
  464. package/lib/core/index.d.ts +1 -1
  465. package/lib/core/index.d.ts.map +1 -1
  466. package/lib/core/index.js +1 -1
  467. package/lib/core/index.js.map +1 -1
  468. package/lib/core/rebase/changeRebaser.d.ts +8 -1
  469. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  470. package/lib/core/rebase/changeRebaser.js.map +1 -1
  471. package/lib/core/rebase/revisionTagCodec.d.ts +4 -3
  472. package/lib/core/rebase/revisionTagCodec.d.ts.map +1 -1
  473. package/lib/core/rebase/revisionTagCodec.js +2 -0
  474. package/lib/core/rebase/revisionTagCodec.js.map +1 -1
  475. package/lib/core/rebase/utils.d.ts +2 -2
  476. package/lib/core/rebase/utils.d.ts.map +1 -1
  477. package/lib/core/rebase/utils.js +4 -4
  478. package/lib/core/rebase/utils.js.map +1 -1
  479. package/lib/core/schema-stored/formatV2.d.ts +1 -1
  480. package/lib/core/schema-stored/formatV2.js +1 -1
  481. package/lib/core/schema-stored/formatV2.js.map +1 -1
  482. package/lib/core/tree/anchorSet.d.ts +8 -0
  483. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  484. package/lib/core/tree/anchorSet.js +42 -7
  485. package/lib/core/tree/anchorSet.js.map +1 -1
  486. package/lib/core/tree/cursor.d.ts +25 -1
  487. package/lib/core/tree/cursor.d.ts.map +1 -1
  488. package/lib/core/tree/cursor.js +43 -0
  489. package/lib/core/tree/cursor.js.map +1 -1
  490. package/lib/core/tree/deltaUtil.d.ts +13 -1
  491. package/lib/core/tree/deltaUtil.d.ts.map +1 -1
  492. package/lib/core/tree/deltaUtil.js +31 -0
  493. package/lib/core/tree/deltaUtil.js.map +1 -1
  494. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +5 -5
  495. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  496. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  497. package/lib/core/tree/index.d.ts +2 -2
  498. package/lib/core/tree/index.d.ts.map +1 -1
  499. package/lib/core/tree/index.js +2 -2
  500. package/lib/core/tree/index.js.map +1 -1
  501. package/lib/core/tree/visitDelta.d.ts +11 -0
  502. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  503. package/lib/core/tree/visitDelta.js +1 -1
  504. package/lib/core/tree/visitDelta.js.map +1 -1
  505. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  506. package/lib/core/tree/visitorUtils.js +5 -0
  507. package/lib/core/tree/visitorUtils.js.map +1 -1
  508. package/lib/entrypoints/alpha.d.ts +6 -0
  509. package/lib/entrypoints/alpha.d.ts.map +1 -0
  510. package/lib/entrypoints/alpha.js +12 -0
  511. package/lib/entrypoints/alpha.js.map +1 -0
  512. package/lib/entrypoints/beta.d.ts +6 -0
  513. package/lib/entrypoints/beta.d.ts.map +1 -0
  514. package/lib/entrypoints/beta.js +12 -0
  515. package/lib/entrypoints/beta.js.map +1 -0
  516. package/lib/entrypoints/internal.d.ts +6 -0
  517. package/lib/entrypoints/internal.d.ts.map +1 -0
  518. package/lib/entrypoints/internal.js +12 -0
  519. package/lib/entrypoints/internal.js.map +1 -0
  520. package/lib/entrypoints/legacy.d.ts +6 -0
  521. package/lib/entrypoints/legacy.d.ts.map +1 -0
  522. package/lib/entrypoints/legacy.js +15 -0
  523. package/lib/entrypoints/legacy.js.map +1 -0
  524. package/lib/entrypoints/public.d.ts +6 -0
  525. package/lib/entrypoints/public.d.ts.map +1 -0
  526. package/lib/entrypoints/public.js +10 -0
  527. package/lib/entrypoints/public.js.map +1 -0
  528. package/lib/feature-libraries/changeAtomIdCodec.d.ts +4 -3
  529. package/lib/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  530. package/lib/feature-libraries/changeAtomIdCodec.js +2 -0
  531. package/lib/feature-libraries/changeAtomIdCodec.js.map +1 -1
  532. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -1
  533. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  534. package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -2
  535. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  536. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +4 -4
  537. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  538. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +4 -4
  539. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  540. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  541. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  542. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  543. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -2
  544. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  545. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  546. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -4
  547. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  548. package/lib/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  549. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  550. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +12 -12
  551. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  552. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
  553. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  554. package/lib/feature-libraries/chunked-forest/codec/{formatGeneric.d.ts → format/formatGeneric.d.ts} +1 -1
  555. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -0
  556. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -0
  557. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +187 -0
  558. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -0
  559. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js +112 -0
  560. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -0
  561. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +33 -0
  562. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -0
  563. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js +13 -0
  564. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -0
  565. package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts +10 -0
  566. package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -0
  567. package/lib/feature-libraries/chunked-forest/codec/format/index.js +8 -0
  568. package/lib/feature-libraries/chunked-forest/codec/format/index.js.map +1 -0
  569. package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts +93 -0
  570. package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -0
  571. package/lib/feature-libraries/chunked-forest/codec/format/versions.js +26 -0
  572. package/lib/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -0
  573. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  574. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  575. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  576. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  577. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
  578. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  579. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  580. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  581. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  582. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +4 -2
  583. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  584. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +1 -1
  585. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  586. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
  587. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  588. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  589. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  590. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  591. package/lib/feature-libraries/cursorComparator.d.ts +23 -0
  592. package/lib/feature-libraries/cursorComparator.d.ts.map +1 -0
  593. package/lib/feature-libraries/cursorComparator.js +61 -0
  594. package/lib/feature-libraries/cursorComparator.js.map +1 -0
  595. package/lib/feature-libraries/forest-summary/codec.d.ts +1 -1
  596. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +3 -3
  597. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  598. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  599. package/lib/feature-libraries/index.d.ts +3 -2
  600. package/lib/feature-libraries/index.d.ts.map +1 -1
  601. package/lib/feature-libraries/index.js +3 -2
  602. package/lib/feature-libraries/index.js.map +1 -1
  603. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +2 -0
  604. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  605. package/lib/feature-libraries/indexing/anchorTreeIndex.js +12 -7
  606. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  607. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  608. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  609. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  610. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +3 -3
  611. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  612. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  613. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +1 -0
  614. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
  615. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -6
  616. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  617. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +3 -3
  618. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  619. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  620. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  621. package/lib/feature-libraries/modular-schema/genericFieldKind.js +0 -1
  622. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  623. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +10 -10
  624. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  625. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -4
  626. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  627. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +3 -3
  628. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  629. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  630. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +3 -3
  631. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  632. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  633. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -1
  634. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  635. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +11 -6
  636. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  637. package/lib/feature-libraries/object-forest/objectForest.d.ts +1 -1
  638. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  639. package/lib/feature-libraries/object-forest/objectForest.js +2 -2
  640. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  641. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +4 -4
  642. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  643. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +1 -1
  644. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  645. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +3 -3
  646. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  647. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  648. package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
  649. package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
  650. package/lib/feature-libraries/schema-edits/index.js +1 -1
  651. package/lib/feature-libraries/schema-edits/index.js.map +1 -1
  652. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -15
  653. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  654. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -50
  655. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  656. package/lib/feature-libraries/schema-index/codec.d.ts +3 -16
  657. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  658. package/lib/feature-libraries/schema-index/codec.js +0 -19
  659. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  660. package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
  661. package/lib/feature-libraries/schema-index/formatV2.js +1 -1
  662. package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
  663. package/lib/feature-libraries/schema-index/index.d.ts +1 -1
  664. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  665. package/lib/feature-libraries/schema-index/index.js +1 -1
  666. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  667. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +1 -1
  668. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  669. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  670. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -4
  671. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  672. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  673. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +3 -3
  674. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  675. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +1 -1
  676. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  677. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +3 -3
  678. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  679. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  680. package/lib/index.d.ts +8 -2
  681. package/lib/index.d.ts.map +1 -1
  682. package/lib/index.js +9 -1
  683. package/lib/index.js.map +1 -1
  684. package/lib/packageVersion.d.ts +1 -1
  685. package/lib/packageVersion.js +1 -1
  686. package/lib/packageVersion.js.map +1 -1
  687. package/lib/shared-tree/independentView.d.ts +1 -1
  688. package/lib/shared-tree/independentView.d.ts.map +1 -1
  689. package/lib/shared-tree/independentView.js +4 -11
  690. package/lib/shared-tree/independentView.js.map +1 -1
  691. package/lib/shared-tree/index.d.ts +2 -2
  692. package/lib/shared-tree/index.d.ts.map +1 -1
  693. package/lib/shared-tree/index.js +1 -1
  694. package/lib/shared-tree/index.js.map +1 -1
  695. package/lib/shared-tree/schematizingTreeView.d.ts +2 -36
  696. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  697. package/lib/shared-tree/schematizingTreeView.js +17 -116
  698. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  699. package/lib/shared-tree/sharedTree.d.ts +3 -22
  700. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  701. package/lib/shared-tree/sharedTree.js +11 -27
  702. package/lib/shared-tree/sharedTree.js.map +1 -1
  703. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +3 -2
  704. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  705. package/lib/shared-tree/sharedTreeChangeCodecs.js +19 -12
  706. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  707. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  708. package/lib/shared-tree/sharedTreeChangeEnricher.js +2 -2
  709. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  710. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  711. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  712. package/lib/shared-tree/sharedTreeChangeFamily.js +2 -2
  713. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  714. package/lib/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  715. package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  716. package/lib/shared-tree/sharedTreeChangeFormat.js +11 -5
  717. package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  718. package/lib/shared-tree/tree.d.ts.map +1 -1
  719. package/lib/shared-tree/tree.js +2 -1
  720. package/lib/shared-tree/tree.js.map +1 -1
  721. package/lib/shared-tree/treeAlpha.d.ts +13 -1
  722. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  723. package/lib/shared-tree/treeAlpha.js +3 -0
  724. package/lib/shared-tree/treeAlpha.js.map +1 -1
  725. package/lib/shared-tree/treeCheckout.d.ts +34 -69
  726. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  727. package/lib/shared-tree/treeCheckout.js +889 -682
  728. package/lib/shared-tree/treeCheckout.js.map +1 -1
  729. package/lib/shared-tree/unhydratedTreeContext.js +1 -1
  730. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
  731. package/lib/shared-tree-core/editManagerCodecs.d.ts +23 -12
  732. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  733. package/lib/shared-tree-core/editManagerCodecs.js +41 -65
  734. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  735. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  736. package/lib/shared-tree-core/editManagerCodecsCommons.js +0 -1
  737. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  738. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +10 -2
  739. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  740. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +16 -11
  741. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  742. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
  743. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  744. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +5 -8
  745. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  746. package/lib/shared-tree-core/index.d.ts +3 -3
  747. package/lib/shared-tree-core/index.d.ts.map +1 -1
  748. package/lib/shared-tree-core/index.js +3 -3
  749. package/lib/shared-tree-core/index.js.map +1 -1
  750. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -3
  751. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  752. package/lib/shared-tree-core/messageCodecV1ToV4.js +8 -8
  753. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  754. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts +2 -3
  755. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  756. package/lib/shared-tree-core/messageCodecVSharedBranches.js +5 -4
  757. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  758. package/lib/shared-tree-core/messageCodecs.d.ts +15 -14
  759. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  760. package/lib/shared-tree-core/messageCodecs.js +38 -71
  761. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  762. package/lib/shared-tree-core/messageFormat.d.ts +0 -1
  763. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  764. package/lib/shared-tree-core/messageFormat.js +0 -1
  765. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  766. package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -3
  767. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  768. package/lib/shared-tree-core/sharedTreeCore.js +14 -4
  769. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  770. package/lib/sharedTreeAttributes.d.ts.map +1 -1
  771. package/lib/sharedTreeAttributes.js +3 -0
  772. package/lib/sharedTreeAttributes.js.map +1 -1
  773. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +43 -0
  774. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  775. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  776. package/lib/simple-tree/api/index.d.ts +4 -2
  777. package/lib/simple-tree/api/index.d.ts.map +1 -1
  778. package/lib/simple-tree/api/index.js +1 -1
  779. package/lib/simple-tree/api/index.js.map +1 -1
  780. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  781. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  782. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +126 -29
  783. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  784. package/lib/simple-tree/api/schemaFactoryAlpha.js +66 -1
  785. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  786. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  787. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  788. package/lib/simple-tree/api/schemaStatics.d.ts +10 -11
  789. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  790. package/lib/simple-tree/api/schemaStatics.js +14 -8
  791. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  792. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  793. package/lib/simple-tree/api/storedSchema.js +7 -7
  794. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  795. package/lib/simple-tree/api/tree.d.ts +7 -19
  796. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  797. package/lib/simple-tree/api/tree.js.map +1 -1
  798. package/lib/simple-tree/api/treeAlpha.d.ts +69 -0
  799. package/lib/simple-tree/api/treeAlpha.d.ts.map +1 -0
  800. package/lib/simple-tree/api/treeAlpha.js +6 -0
  801. package/lib/simple-tree/api/treeAlpha.js.map +1 -0
  802. package/lib/simple-tree/api/treeBeta.d.ts +1 -1
  803. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  804. package/lib/simple-tree/api/treeChangeEvents.d.ts +3 -0
  805. package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  806. package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
  807. package/lib/simple-tree/api/treeNodeApi.d.ts +49 -0
  808. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  809. package/lib/simple-tree/api/treeNodeApi.js +41 -2
  810. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  811. package/lib/simple-tree/api/typesUnsafe.d.ts +23 -2
  812. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  813. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  814. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  815. package/lib/simple-tree/core/treeNodeKernel.js +45 -8
  816. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  817. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  818. package/lib/simple-tree/core/unhydratedFlexTree.js +5 -1
  819. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  820. package/lib/simple-tree/fieldSchema.d.ts +3 -2
  821. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  822. package/lib/simple-tree/fieldSchema.js +3 -4
  823. package/lib/simple-tree/fieldSchema.js.map +1 -1
  824. package/lib/simple-tree/index.d.ts +2 -2
  825. package/lib/simple-tree/index.d.ts.map +1 -1
  826. package/lib/simple-tree/index.js.map +1 -1
  827. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +16 -0
  828. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  829. package/lib/simple-tree/node-kinds/array/arrayNode.js +23 -0
  830. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  831. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +10 -1
  832. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  833. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  834. package/lib/simple-tree/node-kinds/array/index.d.ts +2 -2
  835. package/lib/simple-tree/node-kinds/array/index.d.ts.map +1 -1
  836. package/lib/simple-tree/node-kinds/array/index.js.map +1 -1
  837. package/lib/simple-tree/node-kinds/index.d.ts +2 -2
  838. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  839. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  840. package/lib/simple-tree/node-kinds/object/index.d.ts +2 -2
  841. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  842. package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
  843. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +43 -7
  844. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  845. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  846. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +26 -2
  847. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  848. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  849. package/lib/text/textDomainFormatted.d.ts +321 -13
  850. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  851. package/lib/text/textDomainFormatted.js +103 -28
  852. package/lib/text/textDomainFormatted.js.map +1 -1
  853. package/lib/treeFactory.d.ts.map +1 -1
  854. package/lib/treeFactory.js +6 -3
  855. package/lib/treeFactory.js.map +1 -1
  856. package/lib/util/rangeMap.d.ts +25 -18
  857. package/lib/util/rangeMap.d.ts.map +1 -1
  858. package/lib/util/rangeMap.js +25 -31
  859. package/lib/util/rangeMap.js.map +1 -1
  860. package/lib/util/referenceCounting.d.ts.map +1 -1
  861. package/lib/util/referenceCounting.js +0 -1
  862. package/lib/util/referenceCounting.js.map +1 -1
  863. package/lib/util/typeCheck.d.ts.map +1 -1
  864. package/lib/util/typeCheck.js.map +1 -1
  865. package/lib/util/typeUtils.d.ts.map +1 -1
  866. package/lib/util/typeUtils.js.map +1 -1
  867. package/package.json +50 -50
  868. package/scripts/generate-entrypoint-sources.sh +31 -0
  869. package/src/api.ts +11 -0
  870. package/src/codec/codec.ts +32 -2
  871. package/src/codec/index.ts +2 -3
  872. package/src/codec/versioned/codec.ts +99 -109
  873. package/src/codec/versioned/index.ts +1 -3
  874. package/src/core/forest/forest.ts +5 -2
  875. package/src/core/index.ts +4 -0
  876. package/src/core/rebase/changeRebaser.ts +8 -0
  877. package/src/core/rebase/revisionTagCodec.ts +4 -4
  878. package/src/core/rebase/utils.ts +9 -2
  879. package/src/core/schema-stored/formatV2.ts +1 -1
  880. package/src/core/tree/anchorSet.ts +67 -10
  881. package/src/core/tree/cursor.ts +52 -1
  882. package/src/core/tree/deltaUtil.ts +37 -1
  883. package/src/core/tree/detachedFieldIndexCodecs.ts +4 -4
  884. package/src/core/tree/index.ts +4 -0
  885. package/src/core/tree/visitDelta.ts +13 -1
  886. package/src/core/tree/visitorUtils.ts +5 -0
  887. package/{dist/alpha.d.ts → src/entrypoints/alpha.ts} +25 -11
  888. package/{lib/beta.d.ts → src/entrypoints/beta.ts} +4 -7
  889. package/src/entrypoints/internal.ts +13 -0
  890. package/{lib/legacy.d.ts → src/entrypoints/legacy.ts} +13 -8
  891. package/{dist/public.d.ts → src/entrypoints/public.ts} +3 -6
  892. package/src/feature-libraries/changeAtomIdCodec.ts +8 -7
  893. package/src/feature-libraries/chunked-forest/chunkedForest.ts +3 -2
  894. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +18 -13
  895. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
  896. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -2
  897. package/src/feature-libraries/chunked-forest/codec/codecs.ts +16 -10
  898. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +16 -14
  899. package/src/feature-libraries/chunked-forest/codec/{formatGeneric.ts → format/formatGeneric.ts} +1 -1
  900. package/src/feature-libraries/chunked-forest/codec/{format.ts → format/formatV1.ts} +41 -111
  901. package/src/feature-libraries/chunked-forest/codec/format/formatV2.ts +31 -0
  902. package/src/feature-libraries/chunked-forest/codec/format/index.ts +31 -0
  903. package/src/feature-libraries/chunked-forest/codec/format/versions.ts +81 -0
  904. package/src/feature-libraries/chunked-forest/codec/index.ts +6 -2
  905. package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +19 -12
  906. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +6 -4
  907. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +10 -10
  908. package/src/feature-libraries/chunked-forest/index.ts +2 -1
  909. package/src/feature-libraries/cursorComparator.ts +77 -0
  910. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +5 -5
  911. package/src/feature-libraries/index.ts +5 -3
  912. package/src/feature-libraries/indexing/anchorTreeIndex.ts +20 -10
  913. package/src/feature-libraries/mitigatedChangeFamily.ts +4 -1
  914. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +3 -8
  915. package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +16 -8
  916. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +4 -5
  917. package/src/feature-libraries/modular-schema/genericFieldKind.ts +0 -1
  918. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +19 -26
  919. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +4 -4
  920. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -5
  921. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +15 -6
  922. package/src/feature-libraries/object-forest/objectForest.ts +8 -2
  923. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +11 -13
  924. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +4 -5
  925. package/src/feature-libraries/schema-edits/index.ts +1 -4
  926. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +10 -78
  927. package/src/feature-libraries/schema-index/codec.ts +0 -25
  928. package/src/feature-libraries/schema-index/formatV2.ts +1 -1
  929. package/src/feature-libraries/schema-index/index.ts +1 -4
  930. package/src/feature-libraries/sequence-field/moveEffectTable.ts +1 -1
  931. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +6 -6
  932. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +8 -5
  933. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +4 -5
  934. package/src/index.ts +29 -3
  935. package/src/packageVersion.ts +1 -1
  936. package/src/shared-tree/independentView.ts +5 -18
  937. package/src/shared-tree/index.ts +0 -4
  938. package/src/shared-tree/schematizingTreeView.ts +19 -165
  939. package/src/shared-tree/sharedTree.ts +16 -59
  940. package/src/shared-tree/sharedTreeChangeCodecs.ts +23 -29
  941. package/src/shared-tree/sharedTreeChangeEnricher.ts +1 -2
  942. package/src/shared-tree/sharedTreeChangeFamily.ts +2 -0
  943. package/src/shared-tree/sharedTreeChangeFormat.ts +23 -8
  944. package/src/shared-tree/tree.ts +2 -5
  945. package/src/shared-tree/treeAlpha.ts +26 -0
  946. package/src/shared-tree/treeCheckout.ts +277 -100
  947. package/src/shared-tree/unhydratedTreeContext.ts +1 -1
  948. package/src/shared-tree-core/editManagerCodecs.ts +99 -124
  949. package/src/shared-tree-core/editManagerCodecsCommons.ts +0 -1
  950. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +54 -59
  951. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +72 -95
  952. package/src/shared-tree-core/index.ts +4 -8
  953. package/src/shared-tree-core/messageCodecV1ToV4.ts +56 -71
  954. package/src/shared-tree-core/messageCodecVSharedBranches.ts +76 -92
  955. package/src/shared-tree-core/messageCodecs.ts +88 -126
  956. package/src/shared-tree-core/messageFormat.ts +0 -3
  957. package/src/shared-tree-core/sharedTreeCore.ts +14 -21
  958. package/src/sharedTreeAttributes.ts +3 -0
  959. package/src/simple-tree/api/eraseSchemaDetails.ts +60 -0
  960. package/src/simple-tree/api/index.ts +22 -1
  961. package/src/simple-tree/api/schemaFactory.ts +8 -3
  962. package/src/simple-tree/api/schemaFactoryAlpha.ts +275 -27
  963. package/src/simple-tree/api/schemaFactoryBeta.ts +10 -1
  964. package/src/simple-tree/api/schemaStatics.ts +79 -21
  965. package/src/simple-tree/api/storedSchema.ts +8 -19
  966. package/src/simple-tree/api/tree.ts +7 -20
  967. package/src/simple-tree/api/treeAlpha.ts +90 -0
  968. package/src/simple-tree/api/treeBeta.ts +1 -1
  969. package/src/simple-tree/api/treeChangeEvents.ts +3 -0
  970. package/src/simple-tree/api/treeNodeApi.ts +95 -3
  971. package/src/simple-tree/api/typesUnsafe.ts +49 -1
  972. package/src/simple-tree/core/treeNodeKernel.ts +53 -7
  973. package/src/simple-tree/core/unhydratedFlexTree.ts +5 -1
  974. package/src/simple-tree/fieldSchema.ts +29 -5
  975. package/src/simple-tree/index.ts +20 -0
  976. package/src/simple-tree/node-kinds/array/arrayNode.ts +64 -0
  977. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +25 -1
  978. package/src/simple-tree/node-kinds/array/index.ts +2 -0
  979. package/src/simple-tree/node-kinds/index.ts +5 -0
  980. package/src/simple-tree/node-kinds/object/index.ts +3 -0
  981. package/src/simple-tree/node-kinds/object/objectNode.ts +69 -11
  982. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +33 -2
  983. package/src/text/textDomainFormatted.ts +113 -11
  984. package/src/treeFactory.ts +10 -5
  985. package/src/util/rangeMap.ts +54 -50
  986. package/src/util/referenceCounting.ts +0 -1
  987. package/src/util/typeCheck.ts +1 -0
  988. package/src/util/typeUtils.ts +4 -7
  989. package/dist/beta.d.ts +0 -152
  990. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +0 -383
  991. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +0 -1
  992. package/dist/feature-libraries/chunked-forest/codec/format.js +0 -191
  993. package/dist/feature-libraries/chunked-forest/codec/format.js.map +0 -1
  994. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +0 -1
  995. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +0 -1
  996. package/dist/legacy.d.ts +0 -159
  997. package/lib/alpha.d.ts +0 -304
  998. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +0 -383
  999. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +0 -1
  1000. package/lib/feature-libraries/chunked-forest/codec/format.js +0 -188
  1001. package/lib/feature-libraries/chunked-forest/codec/format.js.map +0 -1
  1002. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +0 -1
  1003. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +0 -1
  1004. package/lib/public.d.ts +0 -94
  1005. /package/dist/feature-libraries/chunked-forest/codec/{formatGeneric.js → format/formatGeneric.js} +0 -0
  1006. /package/lib/feature-libraries/chunked-forest/codec/{formatGeneric.js → format/formatGeneric.js} +0 -0
@@ -6,14 +6,14 @@ import { type ITreeCursorSynchronous, type TreeNodeSchemaIdentifier } from "../.
6
6
  import type { Counter, DeduplicationTable } from "./chunkCodecUtilities.js";
7
7
  import { type BufferFormat, Shape } from "./chunkEncodingGeneric.js";
8
8
  import { type EncoderContext, type FieldEncoder, type KeyedFieldEncoder, type NodeEncoder } from "./compressedEncode.js";
9
- import type { EncodedChunkShape, EncodedFieldShape, EncodedValueShape } from "./format.js";
9
+ import type { EncodedChunkShapeV1OrV2, EncodedFieldShape, EncodedValueShape } from "./format/index.js";
10
10
  /**
11
11
  * Encodes a node with the {@link EncodedNodeShape} shape.
12
12
  * @remarks
13
13
  * The fact this is also a Shape is an implementation detail of the encoder: that allows the shape it uses to be itself,
14
14
  * which is an easy way to keep all the related code together without extra objects.
15
15
  */
16
- export declare class NodeShapeBasedEncoder extends Shape<EncodedChunkShape> implements NodeEncoder {
16
+ export declare class NodeShapeBasedEncoder extends Shape<EncodedChunkShapeV1OrV2> implements NodeEncoder {
17
17
  readonly type: undefined | TreeNodeSchemaIdentifier;
18
18
  readonly value: EncodedValueShape;
19
19
  /**
@@ -57,10 +57,10 @@ export declare class NodeShapeBasedEncoder extends Shape<EncodedChunkShape> impl
57
57
  */
58
58
  otherFieldsEncoder: undefined | FieldEncoder);
59
59
  private getValueToEncode;
60
- encodeNode(cursor: ITreeCursorSynchronous, context: EncoderContext, outputBuffer: BufferFormat<EncodedChunkShape>): void;
61
- encodeShape(identifiers: DeduplicationTable<string>, shapes: DeduplicationTable<Shape<EncodedChunkShape>>): EncodedChunkShape;
62
- countReferencedShapesAndIdentifiers(identifiers: Counter<string>, shapeDiscovered: (shape: Shape<EncodedChunkShape>) => void): void;
63
- get shape(): Shape<EncodedChunkShape>;
60
+ encodeNode(cursor: ITreeCursorSynchronous, context: EncoderContext, outputBuffer: BufferFormat<EncodedChunkShapeV1OrV2>): void;
61
+ encodeShape(identifiers: DeduplicationTable<string>, shapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>): EncodedChunkShapeV1OrV2;
62
+ countReferencedShapesAndIdentifiers(identifiers: Counter<string>, shapeDiscovered: (shape: Shape<EncodedChunkShapeV1OrV2>) => void): void;
63
+ get shape(): Shape<EncodedChunkShapeV1OrV2>;
64
64
  }
65
- export declare function encodeFieldShapes(fieldEncoders: readonly KeyedFieldEncoder[], identifiers: DeduplicationTable<string>, shapes: DeduplicationTable<Shape<EncodedChunkShape>>): EncodedFieldShape[] | undefined;
65
+ export declare function encodeFieldShapes(fieldEncoders: readonly KeyedFieldEncoder[], identifiers: DeduplicationTable<string>, shapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>): EncodedFieldShape[] | undefined;
66
66
  //# sourceMappingURL=nodeEncoder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodeEncoder.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/nodeEncoder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAEN,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAG7B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,KAAK,YAAY,EAAmB,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAEhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE3F;;;;;GAKG;AACH,qBAAa,qBAAsB,SAAQ,KAAK,CAAC,iBAAiB,CAAE,YAAW,WAAW;aAQxE,IAAI,EAAE,SAAS,GAAG,wBAAwB;aAC1C,KAAK,EAAE,iBAAiB;IACx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CAAC;AAED,SAAS,UAAU,CAClB,KAA+B,EAC/B,MAAoD;IAEpD,OAAO,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAC1E,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport { isStableId } from \"@fluidframework/id-compressor/internal\";\n\nimport {\n\ttype FieldKey,\n\ttype ITreeCursorSynchronous,\n\ttype TreeNodeSchemaIdentifier,\n\tforEachField,\n\ttype Value,\n} from \"../../../core/index.js\";\nimport { brand } from \"../../../util/index.js\";\n\nimport type { Counter, DeduplicationTable } from \"./chunkCodecUtilities.js\";\nimport { type BufferFormat, IdentifierToken, Shape } from \"./chunkEncodingGeneric.js\";\nimport {\n\ttype EncoderContext,\n\ttype FieldEncoder,\n\ttype KeyedFieldEncoder,\n\ttype NodeEncoder,\n\tencodeValue,\n} from \"./compressedEncode.js\";\nimport type { EncodedChunkShape, EncodedFieldShape, EncodedValueShape } from \"./format.js\";\n\n/**\n * Encodes a node with the {@link EncodedNodeShape} shape.\n * @remarks\n * The fact this is also a Shape is an implementation detail of the encoder: that allows the shape it uses to be itself,\n * which is an easy way to keep all the related code together without extra objects.\n */\nexport class NodeShapeBasedEncoder extends Shape<EncodedChunkShape> implements NodeEncoder {\n\t/**\n\t * Set of keys for fields that are encoded using {@link NodeShapeBasedEncoder.specializedFieldEncoders}.\n\t * TODO: Ensure uniform chunks, encoding and identifier generation sort fields the same.\n\t */\n\tprivate readonly specializedFieldKeys: Set<FieldKey>;\n\n\tpublic constructor(\n\t\tpublic readonly type: undefined | TreeNodeSchemaIdentifier,\n\t\tpublic readonly value: EncodedValueShape,\n\t\t/**\n\t\t * Encoders for a specific set of fields, by key, in the order they will be encoded.\n\t\t * These are fields for which specialized encoding is provided as an optimization.\n\t\t * Using these for a given field instead of falling back to {@link NodeShapeBasedEncoder.specializedFieldEncoders} is often more efficient:\n\t\t * this avoids the need to explicitly include the key and shape in the encoded data for each node instance.\n\t\t * Instead, this information is here, and thus is encoded only once as part of the node shape.\n\t\t * These encoders will be used, even if the field they apply to is empty (which can add overhead for fields which are usually empty).\n\t\t *\n\t\t * Any fields not included here will be encoded using {@link NodeShapeBasedEncoder.otherFieldsEncoder}.\n\t\t * If {@link NodeShapeBasedEncoder.otherFieldsEncoder} is undefined, then this must handle all non-empty fields.\n\t\t */\n\t\tpublic readonly specializedFieldEncoders: readonly KeyedFieldEncoder[],\n\t\t/**\n\t\t * Encoder for all other fields that are not in {@link NodeShapeBasedEncoder.specializedFieldEncoders}. These fields must\n\t\t * be encoded after the specialized fields.\n\t\t */\n\t\tpublic readonly otherFieldsEncoder: undefined | FieldEncoder,\n\t) {\n\t\tsuper();\n\t\tthis.specializedFieldKeys = new Set(this.specializedFieldEncoders.map((f) => f.key));\n\t}\n\n\tprivate getValueToEncode(cursor: ITreeCursorSynchronous, context: EncoderContext): Value {\n\t\tif (this.value === 0) {\n\t\t\tassert(typeof cursor.value === \"string\", 0x9aa /* identifier must be type string */);\n\t\t\tif (isStableId(cursor.value)) {\n\t\t\t\tconst sessionSpaceCompressedId = context.idCompressor.tryRecompress(cursor.value);\n\t\t\t\tif (sessionSpaceCompressedId !== undefined) {\n\t\t\t\t\treturn context.idCompressor.normalizeToOpSpace(sessionSpaceCompressedId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn cursor.value;\n\t}\n\n\tpublic encodeNode(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat<EncodedChunkShape>,\n\t): void {\n\t\tif (this.type === undefined) {\n\t\t\toutputBuffer.push(new IdentifierToken(cursor.type));\n\t\t} else {\n\t\t\tassert(cursor.type === this.type, 0x741 /* type must match shape */);\n\t\t}\n\t\tencodeValue(this.getValueToEncode(cursor, context), this.value, outputBuffer);\n\t\tfor (const fieldEncoder of this.specializedFieldEncoders) {\n\t\t\tcursor.enterField(brand(fieldEncoder.key));\n\t\t\tfieldEncoder.encoder.encodeField(cursor, context, outputBuffer);\n\t\t\tcursor.exitField();\n\t\t}\n\n\t\tconst otherFieldsBuffer: BufferFormat<EncodedChunkShape> = [];\n\n\t\tforEachField(cursor, () => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tif (!this.specializedFieldKeys.has(key)) {\n\t\t\t\tassert(\n\t\t\t\t\tthis.otherFieldsEncoder !== undefined,\n\t\t\t\t\t0x742 /* had extra local fields when shape does not support them */,\n\t\t\t\t);\n\t\t\t\totherFieldsBuffer.push(new IdentifierToken(key));\n\t\t\t\tthis.otherFieldsEncoder.encodeField(cursor, context, otherFieldsBuffer);\n\t\t\t}\n\t\t});\n\n\t\tif (this.otherFieldsEncoder !== undefined) {\n\t\t\toutputBuffer.push(otherFieldsBuffer);\n\t\t}\n\t}\n\n\tpublic encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape<EncodedChunkShape>>,\n\t): EncodedChunkShape {\n\t\treturn {\n\t\t\tc: {\n\t\t\t\ttype: encodeOptionalIdentifier(this.type, identifiers),\n\t\t\t\tvalue: this.value,\n\t\t\t\tfields: encodeFieldShapes(this.specializedFieldEncoders, identifiers, shapes),\n\t\t\t\textraFields: encodeOptionalFieldShape(this.otherFieldsEncoder, shapes),\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic countReferencedShapesAndIdentifiers(\n\t\tidentifiers: Counter<string>,\n\t\tshapeDiscovered: (shape: Shape<EncodedChunkShape>) => void,\n\t): void {\n\t\tif (this.type !== undefined) {\n\t\t\tidentifiers.add(this.type);\n\t\t}\n\n\t\tfor (const fieldEncoder of this.specializedFieldEncoders) {\n\t\t\tidentifiers.add(fieldEncoder.key);\n\t\t\tshapeDiscovered(fieldEncoder.encoder.shape);\n\t\t}\n\n\t\tif (this.otherFieldsEncoder !== undefined) {\n\t\t\tshapeDiscovered(this.otherFieldsEncoder.shape);\n\t\t}\n\t}\n\n\tpublic get shape(): Shape<EncodedChunkShape> {\n\t\treturn this;\n\t}\n}\n\nexport function encodeFieldShapes(\n\tfieldEncoders: readonly KeyedFieldEncoder[],\n\tidentifiers: DeduplicationTable<string>,\n\tshapes: DeduplicationTable<Shape<EncodedChunkShape>>,\n): EncodedFieldShape[] | undefined {\n\tif (fieldEncoders.length === 0) {\n\t\treturn undefined;\n\t}\n\treturn fieldEncoders.map((fieldEncoder) => [\n\t\t// key\n\t\tencodeIdentifier(fieldEncoder.key, identifiers),\n\t\t// shape\n\t\tshapes.valueToIndex.get(fieldEncoder.encoder.shape) ?? fail(0xb50 /* missing shape */),\n\t]);\n}\n\nfunction encodeIdentifier(\n\tidentifier: string,\n\tidentifiers: DeduplicationTable<string>,\n): string | number {\n\treturn identifiers.valueToIndex.get(identifier) ?? identifier;\n}\n\nfunction encodeOptionalIdentifier(\n\tidentifier: string | undefined,\n\tidentifiers: DeduplicationTable<string>,\n): string | number | undefined {\n\treturn identifier === undefined ? undefined : encodeIdentifier(identifier, identifiers);\n}\n\nfunction encodeOptionalFieldShape(\n\tencoder: FieldEncoder | undefined,\n\tshapes: DeduplicationTable<Shape<EncodedChunkShape>>,\n): number | undefined {\n\treturn encoder === undefined ? undefined : dedupShape(encoder.shape, shapes);\n}\n\nfunction dedupShape(\n\tshape: Shape<EncodedChunkShape>,\n\tshapes: DeduplicationTable<Shape<EncodedChunkShape>>,\n): number {\n\treturn shapes.valueToIndex.get(shape) ?? fail(0xb51 /* missing shape */);\n}\n"]}
1
+ {"version":3,"file":"nodeEncoder.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/nodeEncoder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AACnE,qEAAoE;AAEpE,qDAMgC;AAChC,qDAA+C;AAG/C,uEAAsF;AACtF,+DAM+B;AAO/B;;;;;GAKG;AACH,M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AAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,mBAAmB,CAAC;KACtF,CAAC,CAAC;AACJ,CAAC;AAdD,8CAcC;AAED,SAAS,gBAAgB,CACxB,UAAkB,EAClB,WAAuC;IAEvC,OAAO,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC;AAC/D,CAAC;AAED,SAAS,wBAAwB,CAChC,UAA8B,EAC9B,WAAuC;IAEvC,OAAO,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,wBAAwB,CAChC,OAAiC,EACjC,MAA0D;IAE1D,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,UAAU,CAClB,KAAqC,EACrC,MAA0D;IAE1D,OAAO,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAC1E,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport { isStableId } from \"@fluidframework/id-compressor/internal\";\n\nimport {\n\ttype FieldKey,\n\ttype ITreeCursorSynchronous,\n\ttype TreeNodeSchemaIdentifier,\n\tforEachField,\n\ttype Value,\n} from \"../../../core/index.js\";\nimport { brand } from \"../../../util/index.js\";\n\nimport type { Counter, DeduplicationTable } from \"./chunkCodecUtilities.js\";\nimport { type BufferFormat, IdentifierToken, Shape } from \"./chunkEncodingGeneric.js\";\nimport {\n\ttype EncoderContext,\n\ttype FieldEncoder,\n\ttype KeyedFieldEncoder,\n\ttype NodeEncoder,\n\tencodeValue,\n} from \"./compressedEncode.js\";\nimport type {\n\tEncodedChunkShapeV1OrV2,\n\tEncodedFieldShape,\n\tEncodedValueShape,\n} from \"./format/index.js\";\n\n/**\n * Encodes a node with the {@link EncodedNodeShape} shape.\n * @remarks\n * The fact this is also a Shape is an implementation detail of the encoder: that allows the shape it uses to be itself,\n * which is an easy way to keep all the related code together without extra objects.\n */\nexport class NodeShapeBasedEncoder\n\textends Shape<EncodedChunkShapeV1OrV2>\n\timplements NodeEncoder\n{\n\t/**\n\t * Set of keys for fields that are encoded using {@link NodeShapeBasedEncoder.specializedFieldEncoders}.\n\t * TODO: Ensure uniform chunks, encoding and identifier generation sort fields the same.\n\t */\n\tprivate readonly specializedFieldKeys: Set<FieldKey>;\n\n\tpublic constructor(\n\t\tpublic readonly type: undefined | TreeNodeSchemaIdentifier,\n\t\tpublic readonly value: EncodedValueShape,\n\t\t/**\n\t\t * Encoders for a specific set of fields, by key, in the order they will be encoded.\n\t\t * These are fields for which specialized encoding is provided as an optimization.\n\t\t * Using these for a given field instead of falling back to {@link NodeShapeBasedEncoder.specializedFieldEncoders} is often more efficient:\n\t\t * this avoids the need to explicitly include the key and shape in the encoded data for each node instance.\n\t\t * Instead, this information is here, and thus is encoded only once as part of the node shape.\n\t\t * These encoders will be used, even if the field they apply to is empty (which can add overhead for fields which are usually empty).\n\t\t *\n\t\t * Any fields not included here will be encoded using {@link NodeShapeBasedEncoder.otherFieldsEncoder}.\n\t\t * If {@link NodeShapeBasedEncoder.otherFieldsEncoder} is undefined, then this must handle all non-empty fields.\n\t\t */\n\t\tpublic readonly specializedFieldEncoders: readonly KeyedFieldEncoder[],\n\t\t/**\n\t\t * Encoder for all other fields that are not in {@link NodeShapeBasedEncoder.specializedFieldEncoders}. These fields must\n\t\t * be encoded after the specialized fields.\n\t\t */\n\t\tpublic readonly otherFieldsEncoder: undefined | FieldEncoder,\n\t) {\n\t\tsuper();\n\t\tthis.specializedFieldKeys = new Set(this.specializedFieldEncoders.map((f) => f.key));\n\t}\n\n\tprivate getValueToEncode(cursor: ITreeCursorSynchronous, context: EncoderContext): Value {\n\t\tif (this.value === 0) {\n\t\t\tassert(typeof cursor.value === \"string\", 0x9aa /* identifier must be type string */);\n\t\t\tif (isStableId(cursor.value)) {\n\t\t\t\tconst sessionSpaceCompressedId = context.idCompressor.tryRecompress(cursor.value);\n\t\t\t\tif (sessionSpaceCompressedId !== undefined) {\n\t\t\t\t\treturn context.idCompressor.normalizeToOpSpace(sessionSpaceCompressedId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn cursor.value;\n\t}\n\n\tpublic encodeNode(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat<EncodedChunkShapeV1OrV2>,\n\t): void {\n\t\tif (this.type === undefined) {\n\t\t\toutputBuffer.push(new IdentifierToken(cursor.type));\n\t\t} else {\n\t\t\tassert(cursor.type === this.type, 0x741 /* type must match shape */);\n\t\t}\n\t\tencodeValue(this.getValueToEncode(cursor, context), this.value, outputBuffer);\n\t\tfor (const fieldEncoder of this.specializedFieldEncoders) {\n\t\t\tcursor.enterField(brand(fieldEncoder.key));\n\t\t\tfieldEncoder.encoder.encodeField(cursor, context, outputBuffer);\n\t\t\tcursor.exitField();\n\t\t}\n\n\t\tconst otherFieldsBuffer: BufferFormat<EncodedChunkShapeV1OrV2> = [];\n\n\t\tforEachField(cursor, () => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tif (!this.specializedFieldKeys.has(key)) {\n\t\t\t\tassert(\n\t\t\t\t\tthis.otherFieldsEncoder !== undefined,\n\t\t\t\t\t0x742 /* had extra local fields when shape does not support them */,\n\t\t\t\t);\n\t\t\t\totherFieldsBuffer.push(new IdentifierToken(key));\n\t\t\t\tthis.otherFieldsEncoder.encodeField(cursor, context, otherFieldsBuffer);\n\t\t\t}\n\t\t});\n\n\t\tif (this.otherFieldsEncoder !== undefined) {\n\t\t\toutputBuffer.push(otherFieldsBuffer);\n\t\t}\n\t}\n\n\tpublic encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>,\n\t): EncodedChunkShapeV1OrV2 {\n\t\treturn {\n\t\t\tc: {\n\t\t\t\ttype: encodeOptionalIdentifier(this.type, identifiers),\n\t\t\t\tvalue: this.value,\n\t\t\t\tfields: encodeFieldShapes(this.specializedFieldEncoders, identifiers, shapes),\n\t\t\t\textraFields: encodeOptionalFieldShape(this.otherFieldsEncoder, shapes),\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic countReferencedShapesAndIdentifiers(\n\t\tidentifiers: Counter<string>,\n\t\tshapeDiscovered: (shape: Shape<EncodedChunkShapeV1OrV2>) => void,\n\t): void {\n\t\tif (this.type !== undefined) {\n\t\t\tidentifiers.add(this.type);\n\t\t}\n\n\t\tfor (const fieldEncoder of this.specializedFieldEncoders) {\n\t\t\tidentifiers.add(fieldEncoder.key);\n\t\t\tshapeDiscovered(fieldEncoder.encoder.shape);\n\t\t}\n\n\t\tif (this.otherFieldsEncoder !== undefined) {\n\t\t\tshapeDiscovered(this.otherFieldsEncoder.shape);\n\t\t}\n\t}\n\n\tpublic get shape(): Shape<EncodedChunkShapeV1OrV2> {\n\t\treturn this;\n\t}\n}\n\nexport function encodeFieldShapes(\n\tfieldEncoders: readonly KeyedFieldEncoder[],\n\tidentifiers: DeduplicationTable<string>,\n\tshapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>,\n): EncodedFieldShape[] | undefined {\n\tif (fieldEncoders.length === 0) {\n\t\treturn undefined;\n\t}\n\treturn fieldEncoders.map((fieldEncoder) => [\n\t\t// key\n\t\tencodeIdentifier(fieldEncoder.key, identifiers),\n\t\t// shape\n\t\tshapes.valueToIndex.get(fieldEncoder.encoder.shape) ?? fail(0xb50 /* missing shape */),\n\t]);\n}\n\nfunction encodeIdentifier(\n\tidentifier: string,\n\tidentifiers: DeduplicationTable<string>,\n): string | number {\n\treturn identifiers.valueToIndex.get(identifier) ?? identifier;\n}\n\nfunction encodeOptionalIdentifier(\n\tidentifier: string | undefined,\n\tidentifiers: DeduplicationTable<string>,\n): string | number | undefined {\n\treturn identifier === undefined ? undefined : encodeIdentifier(identifier, identifiers);\n}\n\nfunction encodeOptionalFieldShape(\n\tencoder: FieldEncoder | undefined,\n\tshapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>,\n): number | undefined {\n\treturn encoder === undefined ? undefined : dedupShape(encoder.shape, shapes);\n}\n\nfunction dedupShape(\n\tshape: Shape<EncodedChunkShapeV1OrV2>,\n\tshapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>,\n): number {\n\treturn shapes.valueToIndex.get(shape) ?? fail(0xb51 /* missing shape */);\n}\n"]}
@@ -7,7 +7,7 @@ import { type StoredSchemaCollection, type TreeFieldStoredSchema, type TreeNodeS
7
7
  import type { IncrementalEncoder } from "./codecs.js";
8
8
  import { EncoderContext, type FieldEncoder, type FieldEncodeBuilder, type NodeEncodeBuilder } from "./compressedEncode.js";
9
9
  import type { FieldBatch } from "./fieldBatch.js";
10
- import { type EncodedFieldBatchV1, type EncodedFieldBatchV2, FieldBatchFormatVersion } from "./format.js";
10
+ import { type EncodedFieldBatchV1, type EncodedFieldBatchV2, FieldBatchFormatVersion } from "./format/index.js";
11
11
  import { NodeShapeBasedEncoder } from "./nodeEncoder.js";
12
12
  /**
13
13
  * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.
@@ -1 +1 @@
1
- {"version":3,"file":"schemaBasedEncode.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAIN,KAAK,sBAAsB,EAC3B,KAAK,qBAA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pC,UAAU,EAAE,wBAAwB,EACpC,kBAAkB,CAAC,EAAE,kBAAkB,GACrC,qBAAqB,CA4CvB"}
1
+ {"version":3,"file":"schemaBasedEncode.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAIN,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAI7B,KAAK,YAAY,EACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACN,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAEvB,KAAK,iBAAiB,EAKtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACN,KAAK,mBAAmB,EAExB,KAAK,mBAAmB,EAExB,uBAAuB,EAEvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,sBAAsB,EAC9B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,aAAa,GACzB,mBAAmB,CAWrB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,sBAAsB,EAC9B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,aAAa,EAC3B,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,GAChD,mBAAmB,CASrB;AA0BD,wBAAgB,YAAY,CAC3B,YAAY,EAAE,sBAAsB,EACpC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,aAAa,EAC3B,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,EAClD,OAAO,EAAE,uBAAuB,GAC9B,cAAc,CAYhB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,WAAW,EAAE,iBAAiB,EAC9B,KAAK,EAAE,qBAAqB,EAC5B,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,sBAAsB,GAClC,YAAY,CA8Bd;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC7B,YAAY,EAAE,kBAAkB,EAChC,YAAY,EAAE,sBAAsB,EACpC,UAAU,EAAE,wBAAwB,EACpC,kBAAkB,CAAC,EAAE,kBAAkB,GACrC,qBAAqB,CA4CvB"}
@@ -9,7 +9,7 @@ const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../../../core/index.js");
10
10
  const index_js_2 = require("../../../util/index.js");
11
11
  const compressedEncode_js_1 = require("./compressedEncode.js");
12
- const format_js_1 = require("./format.js");
12
+ const index_js_3 = require("./format/index.js");
13
13
  const incrementalEncodingPolicy_js_1 = require("./incrementalEncodingPolicy.js");
14
14
  const nodeEncoder_js_1 = require("./nodeEncoder.js");
15
15
  /**
@@ -18,7 +18,9 @@ const nodeEncoder_js_1 = require("./nodeEncoder.js");
18
18
  * This version does not support incremental encoding.
19
19
  */
20
20
  function schemaCompressedEncodeV1(schema, policy, fieldBatch, idCompressor) {
21
- return schemaCompressedEncode(schema, policy, fieldBatch, idCompressor, undefined /* incrementalEncoder */, (0, index_js_2.brand)(format_js_1.FieldBatchFormatVersion.v1));
21
+ const encoded = schemaCompressedEncode(schema, policy, fieldBatch, idCompressor, undefined /* incrementalEncoder */, (0, index_js_2.brand)(index_js_3.FieldBatchFormatVersion.v1));
22
+ // Since incrementalEncoder was not provided, no V2 features should be used, and this cast should be safe.
23
+ return encoded;
22
24
  }
23
25
  exports.schemaCompressedEncodeV1 = schemaCompressedEncodeV1;
24
26
  /**
@@ -27,7 +29,7 @@ exports.schemaCompressedEncodeV1 = schemaCompressedEncodeV1;
27
29
  * Incremental encoding is supported from this version onwards.
28
30
  */
29
31
  function schemaCompressedEncodeV2(schema, policy, fieldBatch, idCompressor, incrementalEncoder) {
30
- return schemaCompressedEncode(schema, policy, fieldBatch, idCompressor, incrementalEncoder, (0, index_js_2.brand)(format_js_1.FieldBatchFormatVersion.v2));
32
+ return schemaCompressedEncode(schema, policy, fieldBatch, idCompressor, incrementalEncoder, (0, index_js_2.brand)(index_js_3.FieldBatchFormatVersion.v2));
31
33
  }
32
34
  exports.schemaCompressedEncodeV2 = schemaCompressedEncodeV2;
33
35
  /**
@@ -62,7 +64,7 @@ function getFieldEncoder(nodeBuilder, field, context, storedSchema) {
62
64
  (0, internal_1.assert)(nodeSchema !== undefined, 0x99a /* nodeSchema must be defined */);
63
65
  (0, internal_1.assert)(nodeSchema instanceof index_js_1.LeafNodeStoredSchema, 0x99b /* nodeSchema must be LeafNodeStoredSchema */);
64
66
  (0, internal_1.assert)(nodeSchema.leafValue === index_js_1.ValueSchema.String, 0x99c /* identifier field can only be type string */);
65
- const identifierNodeEncoder = new nodeEncoder_js_1.NodeShapeBasedEncoder(type, format_js_1.SpecialField.Identifier, [], undefined);
67
+ const identifierNodeEncoder = new nodeEncoder_js_1.NodeShapeBasedEncoder(type, index_js_3.SpecialField.Identifier, [], undefined);
66
68
  return (0, compressedEncode_js_1.asFieldEncoder)(identifierNodeEncoder);
67
69
  }
68
70
  return (0, compressedEncode_js_1.asFieldEncoder)(nodeEncoder);
@@ -1 +1 @@
1
- {"version":3,"file":"schemaBasedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAGpF,qDAWgC;AAChC,qDAAgE;AAGhE,+DAU+B;AAE/B,2CAOqB;AACrB,iFAAkF;AAClF,qDAAyD;AAEzD;;;;GAIG;AACH,SAAgB,wBAAwB,CACvC,MAA8B,EAC9B,MAAoB,EACpB,UAAsB,EACtB,YAA2B;IA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AAmB,EAAE,CAAC;QAC3C,MAAM,YAAY,GAAG,yBAAyB,CAAC,UAAU,CAAC;YACzD,CAAC,CAAC,6CAAuB;YACzB,CAAC,CAAC,YAAY,CAAC,sBAAsB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,KAAK,GAAG,IAAI,sCAAqB,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;QAC7E,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAA,eAAI,EAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;AACzC,CAAC;AAjDD,wCAiDC;AAED,SAAS,oBAAoB,CAAC,MAA+B;IAC5D,QAAQ,MAAM,EAAE,CAAC;QAChB,KAAK,SAAS,CAAC,CAAC,CAAC;YAChB,OAAO,KAAK,CAAC;QACd,CAAC;QACD,KAAK,sBAAW,CAAC,MAAM,CAAC;QACxB,KAAK,sBAAW,CAAC,MAAM,CAAC;QACxB,KAAK,sBAAW,CAAC,OAAO,CAAC;QACzB,KAAK,sBAAW,CAAC,WAAW,CAAC,CAAC,CAAC;YAC9B,OAAO,IAAI,CAAC;QACb,CAAC;QACD,KAAK,sBAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,CAAC;QACf,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,IAAA,0BAAe,EAAC,MAAM,CAAC,CAAC;QACzB,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\tValueSchema,\n\tMultiplicity,\n\tidentifierFieldKindIdentifier,\n\ttype SchemaPolicy,\n} from \"../../../core/index.js\";\nimport { brand, oneFromIterable } from \"../../../util/index.js\";\n\nimport type { IncrementalEncoder } from \"./codecs.js\";\nimport {\n\tEncoderContext,\n\ttype FieldEncoder,\n\ttype FieldEncodeBuilder,\n\ttype KeyedFieldEncoder,\n\ttype NodeEncodeBuilder,\n\tanyNodeEncoder,\n\tasFieldEncoder,\n\tcompressedEncode,\n\tincrementalFieldEncoder,\n} from \"./compressedEncode.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\ttype EncodedFieldBatch,\n\ttype EncodedFieldBatchV1,\n\ttype EncodedFieldBatchV2,\n\ttype EncodedValueShape,\n\tFieldBatchFormatVersion,\n\tSpecialField,\n} from \"./format.js\";\nimport { defaultIncrementalEncodingPolicy } from \"./incrementalEncodingPolicy.js\";\nimport { NodeShapeBasedEncoder } from \"./nodeEncoder.js\";\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.\n * @remarks See {@link schemaCompressedEncode} for more details.\n * This version does not support incremental encoding.\n */\nexport function schemaCompressedEncodeV1(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n): EncodedFieldBatchV1 {\n\treturn schemaCompressedEncode(\n\t\tschema,\n\t\tpolicy,\n\t\tfieldBatch,\n\t\tidCompressor,\n\t\tundefined /* incrementalEncoder */,\n\t\tbrand(FieldBatchFormatVersion.v1),\n\t);\n}\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.\n * @remarks See {@link schemaCompressedEncode} for more details.\n * Incremental encoding is supported from this version onwards.\n */\nexport function schemaCompressedEncodeV2(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n): EncodedFieldBatchV2 {\n\treturn schemaCompressedEncode(\n\t\tschema,\n\t\tpolicy,\n\t\tfieldBatch,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t\tbrand(FieldBatchFormatVersion.v2),\n\t);\n}\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk`.\n * @remarks\n * If `incrementalEncoder` is provided,\n * fields that support incremental encoding will encode their chunks separately via the `incrementalEncoder`.\n * See {@link IncrementalEncoder} for more details.\n *\n * Optimized for encoded size and encoding performance.\n * TODO: This function should eventually also take in the root FieldSchema to more efficiently compress the nodes.\n */\nfunction schemaCompressedEncode(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n\tversion: FieldBatchFormatVersion,\n): EncodedFieldBatch {\n\treturn compressedEncode(\n\t\tfieldBatch,\n\t\tbuildContext(schema, policy, idCompressor, incrementalEncoder, version),\n\t);\n}\n\nexport function buildContext(\n\tstoredSchema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n\tversion: FieldBatchFormatVersion,\n): EncoderContext {\n\tconst context: EncoderContext = new EncoderContext(\n\t\t(fieldBuilder: FieldEncodeBuilder, schemaName: TreeNodeSchemaIdentifier) =>\n\t\t\tgetNodeEncoder(fieldBuilder, storedSchema, schemaName, incrementalEncoder),\n\t\t(nodeBuilder: NodeEncodeBuilder, fieldSchema: TreeFieldStoredSchema) =>\n\t\t\tgetFieldEncoder(nodeBuilder, fieldSchema, context, storedSchema),\n\t\tpolicy.fieldKinds,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t\tversion,\n\t);\n\treturn context;\n}\n\n/**\n * Selects an encoder to use to encode fields.\n */\nexport function getFieldEncoder(\n\tnodeBuilder: NodeEncodeBuilder,\n\tfield: TreeFieldStoredSchema,\n\tcontext: EncoderContext,\n\tstoredSchema: StoredSchemaCollection,\n): FieldEncoder {\n\tconst kind = context.fieldShapes.get(field.kind) ?? fail(0xb52 /* missing FieldKind */);\n\tconst type = oneFromIterable(field.types);\n\tconst nodeEncoder =\n\t\ttype === undefined ? anyNodeEncoder : nodeBuilder.nodeEncoderFromSchema(type);\n\tif (kind.multiplicity === Multiplicity.Single) {\n\t\tif (field.kind === identifierFieldKindIdentifier) {\n\t\t\tassert(type !== undefined, 0x999 /* field type must be defined in identifier field */);\n\t\t\tconst nodeSchema = storedSchema.nodeSchema.get(type);\n\t\t\tassert(nodeSchema !== undefined, 0x99a /* nodeSchema must be defined */);\n\t\t\tassert(\n\t\t\t\tnodeSchema instanceof LeafNodeStoredSchema,\n\t\t\t\t0x99b /* nodeSchema must be LeafNodeStoredSchema */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tnodeSchema.leafValue === ValueSchema.String,\n\t\t\t\t0x99c /* identifier field can only be type string */,\n\t\t\t);\n\t\t\tconst identifierNodeEncoder = new NodeShapeBasedEncoder(\n\t\t\t\ttype,\n\t\t\t\tSpecialField.Identifier,\n\t\t\t\t[],\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\treturn asFieldEncoder(identifierNodeEncoder);\n\t\t}\n\t\treturn asFieldEncoder(nodeEncoder);\n\t} else {\n\t\treturn context.nestedArrayEncoder(nodeEncoder);\n\t}\n}\n\n/**\n * Selects an encoder to use to encode nodes.\n */\nexport function getNodeEncoder(\n\tfieldBuilder: FieldEncodeBuilder,\n\tstoredSchema: StoredSchemaCollection,\n\tschemaName: TreeNodeSchemaIdentifier,\n\tincrementalEncoder?: IncrementalEncoder,\n): NodeShapeBasedEncoder {\n\tconst shouldEncodeIncrementally =\n\t\tincrementalEncoder?.shouldEncodeIncrementally ?? defaultIncrementalEncodingPolicy;\n\tconst schema =\n\t\tstoredSchema.nodeSchema.get(schemaName) ?? fail(0xb53 /* missing node schema */);\n\n\t// This handles both object and array nodes.\n\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\t// TODO:Performance:\n\t\t// consider moving some optional and sequence fields to extra fields if they are commonly empty\n\t\t// to reduce encoded size.\n\t\tconst objectNodeFields: KeyedFieldEncoder[] = [];\n\t\tfor (const [key, field] of schema.objectNodeFields ?? []) {\n\t\t\tconst fieldEncoder = shouldEncodeIncrementally(schemaName, key)\n\t\t\t\t? incrementalFieldEncoder\n\t\t\t\t: fieldBuilder.fieldEncoderFromSchema(field);\n\t\t\tobjectNodeFields.push({\n\t\t\t\tkey,\n\t\t\t\tencoder: fieldEncoder,\n\t\t\t});\n\t\t}\n\n\t\tconst shape = new NodeShapeBasedEncoder(schemaName, false, objectNodeFields, undefined);\n\t\treturn shape;\n\t}\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\tconst shape = new NodeShapeBasedEncoder(\n\t\t\tschemaName,\n\t\t\tvalueShapeFromSchema(schema.leafValue),\n\t\t\t[],\n\t\t\tundefined,\n\t\t);\n\t\treturn shape;\n\t}\n\n\t// This handles both maps and record nodes.\n\tif (schema instanceof MapNodeStoredSchema) {\n\t\tconst fieldEncoder = shouldEncodeIncrementally(schemaName)\n\t\t\t? incrementalFieldEncoder\n\t\t\t: fieldBuilder.fieldEncoderFromSchema(schema.mapFields);\n\t\tconst shape = new NodeShapeBasedEncoder(schemaName, false, [], fieldEncoder);\n\t\treturn shape;\n\t}\n\tfail(0xb54 /* unsupported node kind */);\n}\n\nfunction valueShapeFromSchema(schema: ValueSchema | undefined): undefined | EncodedValueShape {\n\tswitch (schema) {\n\t\tcase undefined: {\n\t\t\treturn false;\n\t\t}\n\t\tcase ValueSchema.Number:\n\t\tcase ValueSchema.String:\n\t\tcase ValueSchema.Boolean:\n\t\tcase ValueSchema.FluidHandle: {\n\t\t\treturn true;\n\t\t}\n\t\tcase ValueSchema.Null: {\n\t\t\treturn [null];\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(schema);\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"schemaBasedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAGpF,qDAWgC;AAChC,qDAAgE;AAGhE,+DAU+B;AAE/B,gDAO2B;AAC3B,iFAAkF;AAClF,qDAAyD;AAEzD;;;;GAIG;AACH,SAAgB,wBAAwB,CACvC,MAA8B,EAC9B,MAAoB,EACpB,UAAsB,EACtB,YAA2B;IAE3B,MAAM,OAAO,GAA4B,sBAAsB,CAC9D,MAAM,EACN,MAAM,EACN,UAAU,EACV,YAAY,EACZ,SAAS,CAAC,wBAAwB,EAClC,IAAA,gBAAK,EAAC,kCAAuB,CAAC,EAAE,CAAC,CACjC,CAAC;IACF,0GAA0G;IAC1G,OAAO,OAA8B,CAAC;AACvC,CAAC;AAhBD,4DAgBC;AAED;;;;GAIG;AACH,SAAgB,wBAAwB,CACvC,MAA8B,EAC9B,MAAoB,EACpB,UAAsB,EACtB,YAA2B,EAC3B,kBAAkD;IAElD,OAAO,sBAAsB,CAC5B,MAAM,EACN,MAAM,EACN,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,IAAA,gBAAK,EAAC,kCAAuB,CAAC,EAAE,CAAC,CACjC,CAAC;AACH,CAAC;AAfD,4DAeC;AAED;;;;;;;;;GASG;AACH,SAAS,sBAAsB,CAC9B,MAA8B,EAC9B,MAAoB,EACpB,UAAsB,EACtB,YAA2B,EAC3B,kBAAkD,EAClD,OAAgC;IAEhC,OAAO,IAAA,sCAAgB,EACtB,UAAU,EACV,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,OAAO,CAAC,CACvE,CAAC;AACH,CAAC;AAED,SAAgB,YAAY,CAC3B,YAAoC,EACpC,MAAoB,EACpB,YAA2B,EAC3B,kBAAkD,EAClD,OAAgC;IAEhC,MAAM,OAAO,GAAmB,IAAI,oCAAc,CACjD,CAAC,YAAgC,EAAE,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AAM,CAAC,CAAC;QACzB,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\tValueSchema,\n\tMultiplicity,\n\tidentifierFieldKindIdentifier,\n\ttype SchemaPolicy,\n} from \"../../../core/index.js\";\nimport { brand, oneFromIterable } from \"../../../util/index.js\";\n\nimport type { IncrementalEncoder } from \"./codecs.js\";\nimport {\n\tEncoderContext,\n\ttype FieldEncoder,\n\ttype FieldEncodeBuilder,\n\ttype KeyedFieldEncoder,\n\ttype NodeEncodeBuilder,\n\tanyNodeEncoder,\n\tasFieldEncoder,\n\tcompressedEncode,\n\tincrementalFieldEncoder,\n} from \"./compressedEncode.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\ttype EncodedFieldBatchV1,\n\ttype EncodedFieldBatchV1OrV2,\n\ttype EncodedFieldBatchV2,\n\ttype EncodedValueShape,\n\tFieldBatchFormatVersion,\n\tSpecialField,\n} from \"./format/index.js\";\nimport { defaultIncrementalEncodingPolicy } from \"./incrementalEncodingPolicy.js\";\nimport { NodeShapeBasedEncoder } from \"./nodeEncoder.js\";\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.\n * @remarks See {@link schemaCompressedEncode} for more details.\n * This version does not support incremental encoding.\n */\nexport function schemaCompressedEncodeV1(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n): EncodedFieldBatchV1 {\n\tconst encoded: EncodedFieldBatchV1OrV2 = schemaCompressedEncode(\n\t\tschema,\n\t\tpolicy,\n\t\tfieldBatch,\n\t\tidCompressor,\n\t\tundefined /* incrementalEncoder */,\n\t\tbrand(FieldBatchFormatVersion.v1),\n\t);\n\t// Since incrementalEncoder was not provided, no V2 features should be used, and this cast should be safe.\n\treturn encoded as EncodedFieldBatchV1;\n}\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.\n * @remarks See {@link schemaCompressedEncode} for more details.\n * Incremental encoding is supported from this version onwards.\n */\nexport function schemaCompressedEncodeV2(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n): EncodedFieldBatchV2 {\n\treturn schemaCompressedEncode(\n\t\tschema,\n\t\tpolicy,\n\t\tfieldBatch,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t\tbrand(FieldBatchFormatVersion.v2),\n\t);\n}\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk`.\n * @remarks\n * If `incrementalEncoder` is provided,\n * fields that support incremental encoding will encode their chunks separately via the `incrementalEncoder`.\n * See {@link IncrementalEncoder} for more details.\n *\n * Optimized for encoded size and encoding performance.\n * TODO: This function should eventually also take in the root FieldSchema to more efficiently compress the nodes.\n */\nfunction schemaCompressedEncode(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n\tversion: FieldBatchFormatVersion,\n): EncodedFieldBatchV1OrV2 {\n\treturn compressedEncode(\n\t\tfieldBatch,\n\t\tbuildContext(schema, policy, idCompressor, incrementalEncoder, version),\n\t);\n}\n\nexport function buildContext(\n\tstoredSchema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n\tversion: FieldBatchFormatVersion,\n): EncoderContext {\n\tconst context: EncoderContext = new EncoderContext(\n\t\t(fieldBuilder: FieldEncodeBuilder, schemaName: TreeNodeSchemaIdentifier) =>\n\t\t\tgetNodeEncoder(fieldBuilder, storedSchema, schemaName, incrementalEncoder),\n\t\t(nodeBuilder: NodeEncodeBuilder, fieldSchema: TreeFieldStoredSchema) =>\n\t\t\tgetFieldEncoder(nodeBuilder, fieldSchema, context, storedSchema),\n\t\tpolicy.fieldKinds,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t\tversion,\n\t);\n\treturn context;\n}\n\n/**\n * Selects an encoder to use to encode fields.\n */\nexport function getFieldEncoder(\n\tnodeBuilder: NodeEncodeBuilder,\n\tfield: TreeFieldStoredSchema,\n\tcontext: EncoderContext,\n\tstoredSchema: StoredSchemaCollection,\n): FieldEncoder {\n\tconst kind = context.fieldShapes.get(field.kind) ?? fail(0xb52 /* missing FieldKind */);\n\tconst type = oneFromIterable(field.types);\n\tconst nodeEncoder =\n\t\ttype === undefined ? anyNodeEncoder : nodeBuilder.nodeEncoderFromSchema(type);\n\tif (kind.multiplicity === Multiplicity.Single) {\n\t\tif (field.kind === identifierFieldKindIdentifier) {\n\t\t\tassert(type !== undefined, 0x999 /* field type must be defined in identifier field */);\n\t\t\tconst nodeSchema = storedSchema.nodeSchema.get(type);\n\t\t\tassert(nodeSchema !== undefined, 0x99a /* nodeSchema must be defined */);\n\t\t\tassert(\n\t\t\t\tnodeSchema instanceof LeafNodeStoredSchema,\n\t\t\t\t0x99b /* nodeSchema must be LeafNodeStoredSchema */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tnodeSchema.leafValue === ValueSchema.String,\n\t\t\t\t0x99c /* identifier field can only be type string */,\n\t\t\t);\n\t\t\tconst identifierNodeEncoder = new NodeShapeBasedEncoder(\n\t\t\t\ttype,\n\t\t\t\tSpecialField.Identifier,\n\t\t\t\t[],\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\treturn asFieldEncoder(identifierNodeEncoder);\n\t\t}\n\t\treturn asFieldEncoder(nodeEncoder);\n\t} else {\n\t\treturn context.nestedArrayEncoder(nodeEncoder);\n\t}\n}\n\n/**\n * Selects an encoder to use to encode nodes.\n */\nexport function getNodeEncoder(\n\tfieldBuilder: FieldEncodeBuilder,\n\tstoredSchema: StoredSchemaCollection,\n\tschemaName: TreeNodeSchemaIdentifier,\n\tincrementalEncoder?: IncrementalEncoder,\n): NodeShapeBasedEncoder {\n\tconst shouldEncodeIncrementally =\n\t\tincrementalEncoder?.shouldEncodeIncrementally ?? defaultIncrementalEncodingPolicy;\n\tconst schema =\n\t\tstoredSchema.nodeSchema.get(schemaName) ?? fail(0xb53 /* missing node schema */);\n\n\t// This handles both object and array nodes.\n\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\t// TODO:Performance:\n\t\t// consider moving some optional and sequence fields to extra fields if they are commonly empty\n\t\t// to reduce encoded size.\n\t\tconst objectNodeFields: KeyedFieldEncoder[] = [];\n\t\tfor (const [key, field] of schema.objectNodeFields ?? []) {\n\t\t\tconst fieldEncoder = shouldEncodeIncrementally(schemaName, key)\n\t\t\t\t? incrementalFieldEncoder\n\t\t\t\t: fieldBuilder.fieldEncoderFromSchema(field);\n\t\t\tobjectNodeFields.push({\n\t\t\t\tkey,\n\t\t\t\tencoder: fieldEncoder,\n\t\t\t});\n\t\t}\n\n\t\tconst shape = new NodeShapeBasedEncoder(schemaName, false, objectNodeFields, undefined);\n\t\treturn shape;\n\t}\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\tconst shape = new NodeShapeBasedEncoder(\n\t\t\tschemaName,\n\t\t\tvalueShapeFromSchema(schema.leafValue),\n\t\t\t[],\n\t\t\tundefined,\n\t\t);\n\t\treturn shape;\n\t}\n\n\t// This handles both maps and record nodes.\n\tif (schema instanceof MapNodeStoredSchema) {\n\t\tconst fieldEncoder = shouldEncodeIncrementally(schemaName)\n\t\t\t? incrementalFieldEncoder\n\t\t\t: fieldBuilder.fieldEncoderFromSchema(schema.mapFields);\n\t\tconst shape = new NodeShapeBasedEncoder(schemaName, false, [], fieldEncoder);\n\t\treturn shape;\n\t}\n\tfail(0xb54 /* unsupported node kind */);\n}\n\nfunction valueShapeFromSchema(schema: ValueSchema | undefined): undefined | EncodedValueShape {\n\tswitch (schema) {\n\t\tcase undefined: {\n\t\t\treturn false;\n\t\t}\n\t\tcase ValueSchema.Number:\n\t\tcase ValueSchema.String:\n\t\tcase ValueSchema.Boolean:\n\t\tcase ValueSchema.FluidHandle: {\n\t\t\treturn true;\n\t\t}\n\t\tcase ValueSchema.Null: {\n\t\t\treturn [null];\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(schema);\n\t\t}\n\t}\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { FieldBatch } from "./fieldBatch.js";
6
- import { type EncodedFieldBatchV1, type EncodedFieldBatchV2 } from "./format.js";
6
+ import type { EncodedFieldBatchV1, EncodedFieldBatchV2 } from "./format/index.js";
7
7
  /**
8
8
  * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.
9
9
  * @remarks See {@link uncompressedEncode} for more details.
@@ -1 +1 @@
1
- {"version":3,"file":"uncompressedEncode.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAGN,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAGxB,MAAM,aAAa,CAAC;AAGrB;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAE3E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAE3E"}
1
+ {"version":3,"file":"uncompressedEncode.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACX,mBAAmB,EAEnB,mBAAmB,EAInB,MAAM,mBAAmB,CAAC;AAG3B;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAE3E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAE3E"}
@@ -7,13 +7,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.uncompressedEncodeV2 = exports.uncompressedEncodeV1 = void 0;
8
8
  const index_js_1 = require("../../../core/index.js");
9
9
  const index_js_2 = require("../../../util/index.js");
10
- const format_js_1 = require("./format.js");
10
+ const index_js_3 = require("./format/index.js");
11
11
  /**
12
12
  * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.
13
13
  * @remarks See {@link uncompressedEncode} for more details.
14
14
  */
15
15
  function uncompressedEncodeV1(batch) {
16
- return uncompressedEncode(batch, (0, index_js_2.brand)(format_js_1.FieldBatchFormatVersion.v1));
16
+ return uncompressedEncode(batch, (0, index_js_2.brand)(index_js_3.FieldBatchFormatVersion.v1));
17
17
  }
18
18
  exports.uncompressedEncodeV1 = uncompressedEncodeV1;
19
19
  /**
@@ -21,7 +21,7 @@ exports.uncompressedEncodeV1 = uncompressedEncodeV1;
21
21
  * @remarks See {@link uncompressedEncode} for more details.
22
22
  */
23
23
  function uncompressedEncodeV2(batch) {
24
- return uncompressedEncode(batch, (0, index_js_2.brand)(format_js_1.FieldBatchFormatVersion.v2));
24
+ return uncompressedEncode(batch, (0, index_js_2.brand)(index_js_3.FieldBatchFormatVersion.v2));
25
25
  }
26
26
  exports.uncompressedEncodeV2 = uncompressedEncodeV2;
27
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"uncompressedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAIgC;AAChC,qDAA+C;AAI/C,2CAOqB;AAGrB;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,KAAiB;IACrD,OAAO,kBAAkB,CAAC,KAAK,EAAE,IAAA,gBAAK,EAAC,mCAAuB,CAAC,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,oDAEC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,KAAiB;IACrD,OAAO,kBAAkB,CAAC,KAAK,EAAE,IAAA,gBAAK,EAAC,mCAAuB,CAAC,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,oDAEC;AAED;;;;;;;GAOG;AACH,SAAS,kBAAkB,CAC1B,KAAiB,EACjB,OAAgC;IAEhC,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC7C,OAAO;QACN,OAAO;QACP,WAAW,EAAE,EAAE;QACf,4CAA4C;QAC5C,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC9C,mFAAmF;QACnF,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;KAClD,CAAC;AACH,CAAC;AAED,MAAM,SAAS,GAAe,CAAC,CAAC;AAChC,MAAM,UAAU,GAAe,CAAC,CAAC;AAEjC,MAAM,YAAY,GAAqB;IACtC,WAAW,EAAE,UAAU;CACvB,CAAC;AAEF,MAAM,QAAQ,GAA4B,SAAS,CAAC;AAEpD;;;;;GAKG;AACH,SAAS,cAAc,CAAC,MAA8B;IACrD,MAAM,IAAI,GAAgC,EAAE,CAAC;IAC7C,IAAA,sBAAW,EAAC,MAAM,EAAE,GAAG,EAAE;QACxB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,KAAK,GAAgC,EAAE,CAAC;QAC9C,IAAA,uBAAY,EAAC,MAAM,EAAE,GAAG,EAAE;YACzB,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YACjC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype ITreeCursorSynchronous,\n\tforEachField,\n\tforEachNode,\n} from \"../../../core/index.js\";\nimport { brand } from \"../../../util/index.js\";\nimport type { FluidSerializableReadOnly } from \"../../valueUtilities.js\";\n\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\tFieldBatchFormatVersion,\n\ttype EncodedFieldBatch,\n\ttype EncodedFieldBatchV1,\n\ttype EncodedFieldBatchV2,\n\ttype EncodedNestedArrayShape,\n\ttype EncodedNodeShape,\n} from \"./format.js\";\nimport type { ShapeIndex } from \"./formatGeneric.js\";\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.\n * @remarks See {@link uncompressedEncode} for more details.\n */\nexport function uncompressedEncodeV1(batch: FieldBatch): EncodedFieldBatchV1 {\n\treturn uncompressedEncode(batch, brand(FieldBatchFormatVersion.v1));\n}\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.\n * @remarks See {@link uncompressedEncode} for more details.\n */\nexport function uncompressedEncodeV2(batch: FieldBatch): EncodedFieldBatchV2 {\n\treturn uncompressedEncode(batch, brand(FieldBatchFormatVersion.v2));\n}\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk`.\n *\n * No polymorphism, identifier deduplication or schema based compression.\n * Just uses two hard coded shapes and inline identifiers.\n *\n * This is intended as a simple reference implementation with minimal code and dependencies.\n */\nfunction uncompressedEncode(\n\tbatch: FieldBatch,\n\tversion: FieldBatchFormatVersion,\n): EncodedFieldBatch {\n\tconst rootFields = batch.map(encodeSequence);\n\treturn {\n\t\tversion,\n\t\tidentifiers: [],\n\t\t// A single shape used to encode all fields.\n\t\tshapes: [{ c: anyNodeShape }, { a: anyArray }],\n\t\t// Wrap up each field as an indicator to use the above shape, and its encoded data.\n\t\tdata: rootFields.map((data) => [arrayIndex, data]),\n\t};\n}\n\nconst treeIndex: ShapeIndex = 0;\nconst arrayIndex: ShapeIndex = 1;\n\nconst anyNodeShape: EncodedNodeShape = {\n\textraFields: arrayIndex,\n};\n\nconst anyArray: EncodedNestedArrayShape = treeIndex;\n\n/**\n * Encode a field using the hard coded shape above.\n * @remarks\n * Since this shape contains no information about the actual schema, all schema/shape information is inline in the data:\n * that is why this encoding is called \"uncompressed\".\n */\nfunction encodeSequence(cursor: ITreeCursorSynchronous): FluidSerializableReadOnly[] {\n\tconst data: FluidSerializableReadOnly[] = [];\n\tforEachNode(cursor, () => {\n\t\tdata.push(cursor.type);\n\t\tconst value = cursor.value;\n\t\tdata.push(value !== undefined);\n\t\tif (value !== undefined) {\n\t\t\tdata.push(value);\n\t\t}\n\t\tconst local: FluidSerializableReadOnly[] = [];\n\t\tforEachField(cursor, () => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tlocal.push(key, encodeSequence(cursor));\n\t\t});\n\t\tdata.push(local);\n\t});\n\treturn data;\n}\n"]}
1
+ {"version":3,"file":"uncompressedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAIgC;AAChC,qDAA+C;AAY/C,gDAA4D;AAE5D;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,KAAiB;IACrD,OAAO,kBAAkB,CAAC,KAAK,EAAE,IAAA,gBAAK,EAAC,kCAAuB,CAAC,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,oDAEC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,KAAiB;IACrD,OAAO,kBAAkB,CAAC,KAAK,EAAE,IAAA,gBAAK,EAAC,kCAAuB,CAAC,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,oDAEC;AAED;;;;;;;GAOG;AACH,SAAS,kBAAkB,CAC1B,KAAiB,EACjB,OAAgC;IAEhC,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC7C,OAAO;QACN,OAAO;QACP,WAAW,EAAE,EAAE;QACf,4CAA4C;QAC5C,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC9C,mFAAmF;QACnF,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;KAClD,CAAC;AACH,CAAC;AAED,MAAM,SAAS,GAAe,CAAC,CAAC;AAChC,MAAM,UAAU,GAAe,CAAC,CAAC;AAEjC,MAAM,YAAY,GAAqB;IACtC,WAAW,EAAE,UAAU;CACvB,CAAC;AAEF,MAAM,QAAQ,GAA4B,SAAS,CAAC;AAEpD;;;;;GAKG;AACH,SAAS,cAAc,CAAC,MAA8B;IACrD,MAAM,IAAI,GAAgC,EAAE,CAAC;IAC7C,IAAA,sBAAW,EAAC,MAAM,EAAE,GAAG,EAAE;QACxB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,KAAK,GAAgC,EAAE,CAAC;QAC9C,IAAA,uBAAY,EAAC,MAAM,EAAE,GAAG,EAAE;YACzB,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YACjC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype ITreeCursorSynchronous,\n\tforEachField,\n\tforEachNode,\n} from \"../../../core/index.js\";\nimport { brand } from \"../../../util/index.js\";\nimport type { FluidSerializableReadOnly } from \"../../valueUtilities.js\";\n\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport type {\n\tEncodedFieldBatchV1,\n\tEncodedFieldBatchV1AndV2,\n\tEncodedFieldBatchV2,\n\tEncodedNestedArrayShape,\n\tEncodedNodeShape,\n\tShapeIndex,\n} from \"./format/index.js\";\nimport { FieldBatchFormatVersion } from \"./format/index.js\";\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.\n * @remarks See {@link uncompressedEncode} for more details.\n */\nexport function uncompressedEncodeV1(batch: FieldBatch): EncodedFieldBatchV1 {\n\treturn uncompressedEncode(batch, brand(FieldBatchFormatVersion.v1));\n}\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.\n * @remarks See {@link uncompressedEncode} for more details.\n */\nexport function uncompressedEncodeV2(batch: FieldBatch): EncodedFieldBatchV2 {\n\treturn uncompressedEncode(batch, brand(FieldBatchFormatVersion.v2));\n}\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk`.\n *\n * No polymorphism, identifier deduplication or schema based compression.\n * Just uses two hard coded shapes and inline identifiers.\n *\n * This is intended as a simple reference implementation with minimal code and dependencies.\n */\nfunction uncompressedEncode(\n\tbatch: FieldBatch,\n\tversion: FieldBatchFormatVersion,\n): EncodedFieldBatchV1AndV2 {\n\tconst rootFields = batch.map(encodeSequence);\n\treturn {\n\t\tversion,\n\t\tidentifiers: [],\n\t\t// A single shape used to encode all fields.\n\t\tshapes: [{ c: anyNodeShape }, { a: anyArray }],\n\t\t// Wrap up each field as an indicator to use the above shape, and its encoded data.\n\t\tdata: rootFields.map((data) => [arrayIndex, data]),\n\t};\n}\n\nconst treeIndex: ShapeIndex = 0;\nconst arrayIndex: ShapeIndex = 1;\n\nconst anyNodeShape: EncodedNodeShape = {\n\textraFields: arrayIndex,\n};\n\nconst anyArray: EncodedNestedArrayShape = treeIndex;\n\n/**\n * Encode a field using the hard coded shape above.\n * @remarks\n * Since this shape contains no information about the actual schema, all schema/shape information is inline in the data:\n * that is why this encoding is called \"uncompressed\".\n */\nfunction encodeSequence(cursor: ITreeCursorSynchronous): FluidSerializableReadOnly[] {\n\tconst data: FluidSerializableReadOnly[] = [];\n\tforEachNode(cursor, () => {\n\t\tdata.push(cursor.type);\n\t\tconst value = cursor.value;\n\t\tdata.push(value !== undefined);\n\t\tif (value !== undefined) {\n\t\t\tdata.push(value);\n\t\t}\n\t\tconst local: FluidSerializableReadOnly[] = [];\n\t\tforEachField(cursor, () => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tlocal.push(key, encodeSequence(cursor));\n\t\t});\n\t\tdata.push(local);\n\t});\n\treturn data;\n}\n"]}
@@ -6,6 +6,6 @@ export { uniformChunk, ChunkShape } from "./uniformChunk.js";
6
6
  export { type TreeChunk, dummyRoot } from "../../core/index.js";
7
7
  export { chunkTree, defaultChunkPolicy, makeTreeChunker, type IChunker, chunkFieldSingle, chunkField, combineChunks, } from "./chunkTree.js";
8
8
  export { buildChunkedForest } from "./chunkedForest.js";
9
- export { type EncodedFieldBatch, FieldBatchFormatVersion, type FieldBatch, type FieldBatchCodec, fieldBatchCodecBuilder, type FieldBatchEncodingContext, type IncrementalEncoderDecoder, type ChunkReferenceId, type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, } from "./codec/index.js";
9
+ export { FieldBatchFormatVersion, type FieldBatch, type FieldBatchCodec, fieldBatchCodecBuilder, type FieldBatchEncodingContext, type IncrementalEncoderDecoder, type ChunkReferenceId, type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, type EncodedFieldBatchV1OrV2, type EncodedFieldBatchV2, } from "./codec/index.js";
10
10
  export { emptyChunk } from "./emptyChunk.js";
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,KAAK,QAAQ,EACb,gBAAgB,EAChB,UAAU,EACV,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACN,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,sBAAsB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,gCAAgC,GAChC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,KAAK,QAAQ,EACb,gBAAgB,EAChB,UAAU,EACV,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACN,uBAAuB,EACvB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,sBAAsB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,gCAAgC,EAChC,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAA6D;AAApD,+GAAA,YAAY,OAAA;AAAE,6GAAA,UAAU,OAAA;AACjC,gDAAgE;AAAvC,qGAAA,SAAS,OAAA;AAClC,+CAQwB;AAPvB,yGAAA,SAAS,OAAA;AACT,kHAAA,kBAAkB,OAAA;AAClB,+GAAA,eAAe,OAAA;AAEf,gHAAA,gBAAgB,OAAA;AAChB,0GAAA,UAAU,OAAA;AACV,6GAAA,aAAa,OAAA;AAEd,uDAAwD;AAA/C,sHAAA,kBAAkB,OAAA;AAC3B,6CAW0B;AATzB,mHAAA,uBAAuB,OAAA;AAGvB,kHAAA,sBAAsB,OAAA;AAKtB,4HAAA,gCAAgC,OAAA;AAEjC,iDAA6C;AAApC,2GAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { uniformChunk, ChunkShape } from \"./uniformChunk.js\";\nexport { type TreeChunk, dummyRoot } from \"../../core/index.js\";\nexport {\n\tchunkTree,\n\tdefaultChunkPolicy,\n\tmakeTreeChunker,\n\ttype IChunker,\n\tchunkFieldSingle,\n\tchunkField,\n\tcombineChunks,\n} from \"./chunkTree.js\";\nexport { buildChunkedForest } from \"./chunkedForest.js\";\nexport {\n\ttype EncodedFieldBatch,\n\tFieldBatchFormatVersion,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tfieldBatchCodecBuilder,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncoderDecoder,\n\ttype ChunkReferenceId,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./codec/index.js\";\nexport { emptyChunk } from \"./emptyChunk.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAA6D;AAApD,+GAAA,YAAY,OAAA;AAAE,6GAAA,UAAU,OAAA;AACjC,gDAAgE;AAAvC,qGAAA,SAAS,OAAA;AAClC,+CAQwB;AAPvB,yGAAA,SAAS,OAAA;AACT,kHAAA,kBAAkB,OAAA;AAClB,+GAAA,eAAe,OAAA;AAEf,gHAAA,gBAAgB,OAAA;AAChB,0GAAA,UAAU,OAAA;AACV,6GAAA,aAAa,OAAA;AAEd,uDAAwD;AAA/C,sHAAA,kBAAkB,OAAA;AAC3B,6CAY0B;AAXzB,mHAAA,uBAAuB,OAAA;AAGvB,kHAAA,sBAAsB,OAAA;AAKtB,4HAAA,gCAAgC,OAAA;AAIjC,iDAA6C;AAApC,2GAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { uniformChunk, ChunkShape } from \"./uniformChunk.js\";\nexport { type TreeChunk, dummyRoot } from \"../../core/index.js\";\nexport {\n\tchunkTree,\n\tdefaultChunkPolicy,\n\tmakeTreeChunker,\n\ttype IChunker,\n\tchunkFieldSingle,\n\tchunkField,\n\tcombineChunks,\n} from \"./chunkTree.js\";\nexport { buildChunkedForest } from \"./chunkedForest.js\";\nexport {\n\tFieldBatchFormatVersion,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tfieldBatchCodecBuilder,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncoderDecoder,\n\ttype ChunkReferenceId,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n\ttype EncodedFieldBatchV1OrV2,\n\ttype EncodedFieldBatchV2,\n} from \"./codec/index.js\";\nexport { emptyChunk } from \"./emptyChunk.js\";\n"]}
@@ -0,0 +1,23 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { type ITreeCursorSynchronous } from "../core/index.js";
6
+ /**
7
+ * Tests whether a cursor's current node matches a previously captured subtree.
8
+ * Built by {@link buildNodeComparator}
9
+ */
10
+ export type NodeComparator = (cursor: ITreeCursorSynchronous) => boolean;
11
+ /**
12
+ * Walks the cursor at its current node position and builds a comparator that can test whether another
13
+ * cursor position has the same structure and values.
14
+ *
15
+ * @remarks
16
+ * Fields are compared by key (not iteration order), so this is safe regardless of cursor field ordering.
17
+ * Missing fields in the compared node will cause a mismatch.
18
+ *
19
+ * The cursor must be in Nodes mode. After this call, the cursor is restored to its original position.
20
+ *
21
+ */
22
+ export declare function buildNodeComparator(cursor: ITreeCursorSynchronous): NodeComparator;
23
+ //# sourceMappingURL=cursorComparator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursorComparator.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/cursorComparator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIN,KAAK,sBAAsB,EAE3B,MAAM,kBAAkB,CAAC;AAC1B;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,sBAAsB,KAAK,OAAO,CAAC;AA2BzE;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,sBAAsB,GAAG,cAAc,CAsBlF"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.buildNodeComparator = void 0;
8
+ const index_js_1 = require("../core/index.js");
9
+ /**
10
+ * creates a FieldComparator that checks a field has the expected number of
11
+ *
12
+ * @remarks
13
+ * The returned comparator checks that the field has the expected number of children
14
+ * and that each child node matches the corresponding comparator.
15
+ */
16
+ function buildFieldComparator(nodeComparators) {
17
+ const expectedLength = nodeComparators.length;
18
+ return (cursor) => {
19
+ if (cursor.getFieldLength() !== expectedLength) {
20
+ return false;
21
+ }
22
+ for (let inNodes = cursor.firstNode(); inNodes; inNodes = cursor.nextNode()) {
23
+ const comparator = nodeComparators[cursor.fieldIndex];
24
+ if (comparator?.(cursor) !== true) {
25
+ cursor.exitNode();
26
+ return false;
27
+ }
28
+ }
29
+ return true;
30
+ };
31
+ }
32
+ /**
33
+ * Walks the cursor at its current node position and builds a comparator that can test whether another
34
+ * cursor position has the same structure and values.
35
+ *
36
+ * @remarks
37
+ * Fields are compared by key (not iteration order), so this is safe regardless of cursor field ordering.
38
+ * Missing fields in the compared node will cause a mismatch.
39
+ *
40
+ * The cursor must be in Nodes mode. After this call, the cursor is restored to its original position.
41
+ *
42
+ */
43
+ function buildNodeComparator(cursor) {
44
+ const expectedValue = cursor.value;
45
+ if (expectedValue !== undefined) {
46
+ return (other) => Object.is(other.value, expectedValue);
47
+ }
48
+ const fieldComparators = (0, index_js_1.mapCursorFields)(cursor, (fieldCursor) => ({
49
+ key: fieldCursor.getFieldKey(),
50
+ compare: buildFieldComparator((0, index_js_1.mapCursorField)(fieldCursor, buildNodeComparator)),
51
+ }));
52
+ return (other) => {
53
+ if (!Object.is(other.value, expectedValue)) {
54
+ return false;
55
+ }
56
+ for (const { key, compare } of fieldComparators) {
57
+ if (!(0, index_js_1.inCursorField)(other, key, () => compare(other))) {
58
+ return false;
59
+ }
60
+ }
61
+ return true;
62
+ };
63
+ }
64
+ exports.buildNodeComparator = buildNodeComparator;
65
+ //# sourceMappingURL=cursorComparator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursorComparator.js","sourceRoot":"","sources":["../../src/feature-libraries/cursorComparator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAM0B;AAS1B;;;;;;GAMG;AACH,SAAS,oBAAoB,CAAC,eAAiC;IAC9D,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,CAAC;IAC9C,OAAO,CAAC,MAA8B,EAAW,EAAE;QAClD,IAAI,MAAM,CAAC,cAAc,EAAE,KAAK,cAAc,EAAE,CAAC;YAChD,OAAO,KAAK,CAAC;QACd,CAAC;QACD,KAAK,IAAI,OAAO,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;YAC7E,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YACtD,IAAI,UAAU,EAAE,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;gBACnC,MAAM,CAAC,QAAQ,EAAE,CAAC;gBAClB,OAAO,KAAK,CAAC;YACd,CAAC;QACF,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC,CAAC;AACH,CAAC;AACD;;;;;;;;;;GAUG;AACH,SAAgB,mBAAmB,CAAC,MAA8B;IACjE,MAAM,aAAa,GAAU,MAAM,CAAC,KAAK,CAAC;IAC1C,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QACjC,OAAO,CAAC,KAA6B,EAAW,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAC1F,CAAC;IACD,MAAM,gBAAgB,GAAG,IAAA,0BAAe,EAAC,MAAM,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAClE,GAAG,EAAE,WAAW,CAAC,WAAW,EAAE;QAC9B,OAAO,EAAE,oBAAoB,CAAC,IAAA,yBAAc,EAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;KAC/E,CAAC,CAAC,CAAC;IAEJ,OAAO,CAAC,KAA6B,EAAW,EAAE;QACjD,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,EAAE,CAAC;YAC5C,OAAO,KAAK,CAAC;QACd,CAAC;QACD,KAAK,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,gBAAgB,EAAE,CAAC;YACjD,IAAI,CAAC,IAAA,wBAAa,EAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;gBACtD,OAAO,KAAK,CAAC;YACd,CAAC;QACF,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC,CAAC;AACH,CAAC;AAtBD,kDAsBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tmapCursorField,\n\tmapCursorFields,\n\tinCursorField,\n\ttype ITreeCursorSynchronous,\n\ttype Value,\n} from \"../core/index.js\";\n/**\n * Tests whether a cursor's current node matches a previously captured subtree.\n * Built by {@link buildNodeComparator}\n */\nexport type NodeComparator = (cursor: ITreeCursorSynchronous) => boolean;\n\ntype FieldComparator = (cursor: ITreeCursorSynchronous) => boolean;\n\n/**\n * creates a FieldComparator that checks a field has the expected number of\n *\n * @remarks\n * The returned comparator checks that the field has the expected number of children\n * and that each child node matches the corresponding comparator.\n */\nfunction buildFieldComparator(nodeComparators: NodeComparator[]): FieldComparator {\n\tconst expectedLength = nodeComparators.length;\n\treturn (cursor: ITreeCursorSynchronous): boolean => {\n\t\tif (cursor.getFieldLength() !== expectedLength) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (let inNodes = cursor.firstNode(); inNodes; inNodes = cursor.nextNode()) {\n\t\t\tconst comparator = nodeComparators[cursor.fieldIndex];\n\t\t\tif (comparator?.(cursor) !== true) {\n\t\t\t\tcursor.exitNode();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t};\n}\n/**\n * Walks the cursor at its current node position and builds a comparator that can test whether another\n * cursor position has the same structure and values.\n *\n * @remarks\n * Fields are compared by key (not iteration order), so this is safe regardless of cursor field ordering.\n * Missing fields in the compared node will cause a mismatch.\n *\n * The cursor must be in Nodes mode. After this call, the cursor is restored to its original position.\n *\n */\nexport function buildNodeComparator(cursor: ITreeCursorSynchronous): NodeComparator {\n\tconst expectedValue: Value = cursor.value;\n\tif (expectedValue !== undefined) {\n\t\treturn (other: ITreeCursorSynchronous): boolean => Object.is(other.value, expectedValue);\n\t}\n\tconst fieldComparators = mapCursorFields(cursor, (fieldCursor) => ({\n\t\tkey: fieldCursor.getFieldKey(),\n\t\tcompare: buildFieldComparator(mapCursorField(fieldCursor, buildNodeComparator)),\n\t}));\n\n\treturn (other: ITreeCursorSynchronous): boolean => {\n\t\tif (!Object.is(other.value, expectedValue)) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (const { key, compare } of fieldComparators) {\n\t\t\tif (!inCursorField(other, key, () => compare(other))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t};\n}\n"]}
@@ -13,5 +13,5 @@ export type ForestCodec = ReturnType<typeof forestCodecBuilder.build>;
13
13
  /**
14
14
  * {@link ClientVersionDispatchingCodecBuilder} for forest summarizer codecs.
15
15
  */
16
- export declare const forestCodecBuilder: ClientVersionDispatchingCodecBuilder<"Forest", FieldSet, FieldBatchEncodingContext, import("../../util/brand.js").Brand<1, "ForestFormatVersion"> | import("../../util/brand.js").Brand<2, "ForestFormatVersion">, CodecWriteOptions>;
16
+ export declare const forestCodecBuilder: ClientVersionDispatchingCodecBuilder<CodecWriteOptions, FieldSet, FieldBatchEncodingContext, import("../../util/brand.js").Brand<1, "ForestFormatVersion"> | import("../../util/brand.js").Brand<2, "ForestFormatVersion">, "Forest">;
17
17
  //# sourceMappingURL=codec.d.ts.map
@@ -9,7 +9,7 @@ import { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal";
9
9
  import type { ITreeCursorSynchronous } from "../../core/index.js";
10
10
  import type { SummaryElementStringifier } from "../../shared-tree-core/index.js";
11
11
  import { type JsonCompatible } from "../../util/index.js";
12
- import type { ChunkReferenceId, EncodedFieldBatch, IncrementalEncoderDecoder, IncrementalEncodingPolicy, TreeChunk } from "../chunked-forest/index.js";
12
+ import type { ChunkReferenceId, EncodedFieldBatchV2, IncrementalEncoderDecoder, IncrementalEncodingPolicy, TreeChunk } from "../chunked-forest/index.js";
13
13
  /**
14
14
  * The behavior of the forest's incremental summary - whether the summary should be a single blob or incremental.
15
15
  */
@@ -145,7 +145,7 @@ export declare class ForestIncrementalSummaryBuilder implements IncrementalEncod
145
145
  * {@link IncrementalEncoder.encodeIncrementalField}
146
146
  * @remarks Returns an empty array if the field has no content.
147
147
  */
148
- encodeIncrementalField(cursor: ITreeCursorSynchronous, chunkEncoder: (chunk: TreeChunk) => EncodedFieldBatch): ChunkReferenceId[];
148
+ encodeIncrementalField(cursor: ITreeCursorSynchronous, chunkEncoder: (chunk: TreeChunk) => EncodedFieldBatchV2): ChunkReferenceId[];
149
149
  /**
150
150
  * Must be called after summary generation is complete to finish tracking the summary.
151
151
  * It clears any tracking state and deletes the tracking properties for summaries that are older than the
@@ -167,6 +167,6 @@ export declare class ForestIncrementalSummaryBuilder implements IncrementalEncod
167
167
  /**
168
168
  * {@link IncrementalEncoder.decodeIncrementalChunk}
169
169
  */
170
- decodeIncrementalChunk(referenceId: ChunkReferenceId, chunkDecoder: (encoded: EncodedFieldBatch) => TreeChunk): TreeChunk;
170
+ decodeIncrementalChunk(referenceId: ChunkReferenceId, chunkDecoder: (encoded: EncodedFieldBatchV2) => TreeChunk): TreeChunk;
171
171
  }
172
172
  //# sourceMappingURL=incrementalSummaryBuilder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"incrementalSummaryBuilder.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAG7F,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,8CAA8C,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAG5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAIN,KAAK,cAAc,EAEnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACX,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,EACzB,SAAS,EACT,MAAM,4BAA4B,CAAC;AAoFpC;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CAAC;QACrC,OAAO,EAAE,kBAAkB,CAAC;KAC5B,GAAG,gCAAgC;IA0BpC;;;OAGG;IACI,sBAAsB,CAC5B,MAAM,EAAE,sBAAsB,EAC9B,YAAY,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,iBAAiB,GACnD,gBAAgB,EAAE;IA0ErB;;;;;;;;;;;OAWG;IACI,eAAe,CAAC,IAAI,EAAE;QAC5B,yBAAyB,EAAE,sCAAsC,GAAG,SAAS,CAAC;QAC9E,wBAAwB,EAAE,MAAM,CAAC;QACjC,2BAA2B,EAAE,MAAM,CAAC;QACpC,OAAO,EAAE,kBAAkB,CAAC;KAC5B,GAAG,IAAI;IA6CR;;OAEG;IACI,sBAAsB,CAC5B,WAAW,EAAE,gBAAgB,EAC7B,YAAY,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,SAAS,GACrD,SAAS;CAkBZ"}
1
+ {"version":3,"file":"incrementalSummaryBuilder.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAG7F,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,8CAA8C,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAG5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAIN,KAAK,cAAc,EAEnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACX,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,SAAS,EACT,MAAM,4BAA4B,CAAC;AAoFpC;;GAEG;AACH,oBAAY,gCAAg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