@fluidframework/tree 2.0.0-dev-rc.5.0.0.271045 → 2.0.0-dev-rc.5.0.0.271717

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 (1607) hide show
  1. package/.eslintrc.cjs +5 -0
  2. package/api-report/tree.alpha.api.md +10 -21
  3. package/api-report/tree.beta.api.md +10 -21
  4. package/api-report/tree.public.api.md +10 -21
  5. package/dist/beta.d.ts +0 -1
  6. package/dist/codec/codec.d.ts +2 -2
  7. package/dist/codec/codec.d.ts.map +1 -1
  8. package/dist/codec/codec.js +0 -1
  9. package/dist/codec/codec.js.map +1 -1
  10. package/dist/codec/discriminatedUnions.d.ts +2 -2
  11. package/dist/codec/discriminatedUnions.d.ts.map +1 -1
  12. package/dist/codec/discriminatedUnions.js +0 -1
  13. package/dist/codec/discriminatedUnions.js.map +1 -1
  14. package/dist/codec/noopValidator.d.ts +1 -1
  15. package/dist/codec/noopValidator.d.ts.map +1 -1
  16. package/dist/codec/noopValidator.js.map +1 -1
  17. package/dist/codec/versioned/codec.d.ts +3 -3
  18. package/dist/codec/versioned/codec.d.ts.map +1 -1
  19. package/dist/codec/versioned/codec.js.map +1 -1
  20. package/dist/codec/versioned/format.d.ts +1 -1
  21. package/dist/codec/versioned/format.d.ts.map +1 -1
  22. package/dist/codec/versioned/format.js.map +1 -1
  23. package/dist/core/change-family/changeFamily.d.ts +5 -5
  24. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  25. package/dist/core/change-family/changeFamily.js.map +1 -1
  26. package/dist/core/change-family/editBuilder.d.ts +1 -1
  27. package/dist/core/change-family/editBuilder.d.ts.map +1 -1
  28. package/dist/core/change-family/editBuilder.js +0 -2
  29. package/dist/core/change-family/editBuilder.js.map +1 -1
  30. package/dist/core/forest/editableForest.d.ts +5 -5
  31. package/dist/core/forest/editableForest.d.ts.map +1 -1
  32. package/dist/core/forest/editableForest.js.map +1 -1
  33. package/dist/core/forest/forest.d.ts +3 -3
  34. package/dist/core/forest/forest.d.ts.map +1 -1
  35. package/dist/core/forest/forest.js.map +1 -1
  36. package/dist/core/rebase/changeRebaser.d.ts +1 -1
  37. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  38. package/dist/core/rebase/changeRebaser.js.map +1 -1
  39. package/dist/core/rebase/revisionTagCodec.d.ts +4 -4
  40. package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
  41. package/dist/core/rebase/revisionTagCodec.js +0 -2
  42. package/dist/core/rebase/revisionTagCodec.js.map +1 -1
  43. package/dist/core/rebase/types.d.ts +3 -3
  44. package/dist/core/rebase/types.d.ts.map +1 -1
  45. package/dist/core/rebase/types.js.map +1 -1
  46. package/dist/core/rebase/utils.d.ts +2 -2
  47. package/dist/core/rebase/utils.d.ts.map +1 -1
  48. package/dist/core/rebase/utils.js.map +1 -1
  49. package/dist/core/schema-stored/format.d.ts +2 -2
  50. package/dist/core/schema-stored/format.d.ts.map +1 -1
  51. package/dist/core/schema-stored/format.js.map +1 -1
  52. package/dist/core/schema-stored/schema.d.ts +3 -3
  53. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  54. package/dist/core/schema-stored/schema.js +0 -4
  55. package/dist/core/schema-stored/schema.js.map +1 -1
  56. package/dist/core/schema-stored/storedSchemaRepository.d.ts +3 -3
  57. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  58. package/dist/core/schema-stored/storedSchemaRepository.js +1 -3
  59. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  60. package/dist/core/schema-view/view.d.ts +1 -1
  61. package/dist/core/schema-view/view.d.ts.map +1 -1
  62. package/dist/core/schema-view/view.js +0 -2
  63. package/dist/core/schema-view/view.js.map +1 -1
  64. package/dist/core/tree/anchorSet.d.ts +56 -18
  65. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  66. package/dist/core/tree/anchorSet.js +97 -52
  67. package/dist/core/tree/anchorSet.js.map +1 -1
  68. package/dist/core/tree/cursor.d.ts +3 -3
  69. package/dist/core/tree/cursor.d.ts.map +1 -1
  70. package/dist/core/tree/cursor.js.map +1 -1
  71. package/dist/core/tree/delta.d.ts +3 -3
  72. package/dist/core/tree/delta.d.ts.map +1 -1
  73. package/dist/core/tree/delta.js.map +1 -1
  74. package/dist/core/tree/deltaUtil.d.ts +2 -2
  75. package/dist/core/tree/deltaUtil.d.ts.map +1 -1
  76. package/dist/core/tree/deltaUtil.js.map +1 -1
  77. package/dist/core/tree/detachedFieldIndex.d.ts +7 -7
  78. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  79. package/dist/core/tree/detachedFieldIndex.js +2 -8
  80. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  81. package/dist/core/tree/detachedFieldIndexCodec.d.ts +4 -4
  82. package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
  83. package/dist/core/tree/detachedFieldIndexCodec.js +0 -3
  84. package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
  85. package/dist/core/tree/detachedFieldIndexFormat.d.ts +2 -2
  86. package/dist/core/tree/detachedFieldIndexFormat.d.ts.map +1 -1
  87. package/dist/core/tree/detachedFieldIndexFormat.js.map +1 -1
  88. package/dist/core/tree/detachedFieldIndexTypes.d.ts +3 -3
  89. package/dist/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  90. package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
  91. package/dist/core/tree/mapTree.d.ts +2 -2
  92. package/dist/core/tree/mapTree.d.ts.map +1 -1
  93. package/dist/core/tree/mapTree.js.map +1 -1
  94. package/dist/core/tree/pathTree.d.ts +3 -3
  95. package/dist/core/tree/pathTree.d.ts.map +1 -1
  96. package/dist/core/tree/pathTree.js.map +1 -1
  97. package/dist/core/tree/persistedTreeTextFormat.d.ts +1 -1
  98. package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  99. package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
  100. package/dist/core/tree/sparseTree.d.ts +2 -2
  101. package/dist/core/tree/sparseTree.d.ts.map +1 -1
  102. package/dist/core/tree/sparseTree.js +11 -15
  103. package/dist/core/tree/sparseTree.js.map +1 -1
  104. package/dist/core/tree/treeTextFormat.d.ts +2 -2
  105. package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
  106. package/dist/core/tree/treeTextFormat.js.map +1 -1
  107. package/dist/core/tree/types.d.ts +3 -3
  108. package/dist/core/tree/types.d.ts.map +1 -1
  109. package/dist/core/tree/types.js +0 -1
  110. package/dist/core/tree/types.js.map +1 -1
  111. package/dist/core/tree/visitDelta.d.ts +5 -5
  112. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  113. package/dist/core/tree/visitDelta.js.map +1 -1
  114. package/dist/core/tree/visitPath.d.ts +2 -2
  115. package/dist/core/tree/visitPath.d.ts.map +1 -1
  116. package/dist/core/tree/visitPath.js.map +1 -1
  117. package/dist/core/tree/visitorUtils.d.ts +7 -7
  118. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  119. package/dist/core/tree/visitorUtils.js.map +1 -1
  120. package/dist/domains/json/jsonCursor.d.ts +2 -2
  121. package/dist/domains/json/jsonCursor.d.ts.map +1 -1
  122. package/dist/domains/json/jsonCursor.js.map +1 -1
  123. package/dist/domains/json/jsonDomainSchema.js.map +1 -1
  124. package/dist/domains/schemaBuilder.d.ts +2 -2
  125. package/dist/domains/schemaBuilder.d.ts.map +1 -1
  126. package/dist/domains/schemaBuilder.js +70 -70
  127. package/dist/domains/schemaBuilder.js.map +1 -1
  128. package/dist/events/events.js +1 -2
  129. package/dist/events/events.js.map +1 -1
  130. package/dist/feature-libraries/changeAtomIdCodec.d.ts +2 -2
  131. package/dist/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  132. package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
  133. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts +2 -2
  134. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  135. package/dist/feature-libraries/chunked-forest/basicChunk.js +1 -14
  136. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  137. package/dist/feature-libraries/chunked-forest/chunk.d.ts +2 -2
  138. package/dist/feature-libraries/chunked-forest/chunk.d.ts.map +1 -1
  139. package/dist/feature-libraries/chunked-forest/chunk.js.map +1 -1
  140. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +4 -4
  141. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  142. package/dist/feature-libraries/chunked-forest/chunkTree.js +6 -13
  143. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  144. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -4
  145. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  146. package/dist/feature-libraries/chunked-forest/chunkedForest.js +2 -9
  147. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  148. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +3 -3
  149. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
  150. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +3 -1
  151. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  152. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +17 -7
  153. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  154. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -11
  155. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  156. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +8 -8
  157. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  158. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +2 -5
  159. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  160. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +3 -3
  161. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  162. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +0 -1
  163. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  164. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +6 -5
  165. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  166. package/dist/feature-libraries/chunked-forest/codec/codecs.js +4 -1
  167. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  168. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +7 -7
  169. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  170. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +13 -25
  171. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  172. package/dist/feature-libraries/chunked-forest/codec/fieldBatch.d.ts +1 -1
  173. package/dist/feature-libraries/chunked-forest/codec/fieldBatch.d.ts.map +1 -1
  174. package/dist/feature-libraries/chunked-forest/codec/fieldBatch.js.map +1 -1
  175. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +1 -1
  176. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  177. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  178. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +1 -1
  179. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  180. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  181. package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts +5 -5
  182. package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
  183. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +5 -8
  184. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
  185. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts +6 -6
  186. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +1 -1
  187. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
  188. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +2 -2
  189. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  190. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  191. package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
  192. package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
  193. package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  194. package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
  195. package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
  196. package/dist/feature-libraries/chunked-forest/sequenceChunk.js +0 -1
  197. package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  198. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +2 -2
  199. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  200. package/dist/feature-libraries/chunked-forest/uniformChunk.js +5 -40
  201. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  202. package/dist/feature-libraries/contextuallyTyped.d.ts +5 -5
  203. package/dist/feature-libraries/contextuallyTyped.d.ts.map +1 -1
  204. package/dist/feature-libraries/contextuallyTyped.js.map +1 -1
  205. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -3
  206. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  207. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +0 -2
  208. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  209. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
  210. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  211. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  212. package/dist/feature-libraries/default-schema/defaultSchema.d.ts +1 -1
  213. package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  214. package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  215. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  216. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  217. package/dist/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  218. package/dist/feature-libraries/deltaUtils.d.ts +1 -1
  219. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  220. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  221. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +4 -4
  222. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  223. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +1 -2
  224. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  225. package/dist/feature-libraries/editableTreeBinder.d.ts +3 -3
  226. package/dist/feature-libraries/editableTreeBinder.d.ts.map +1 -1
  227. package/dist/feature-libraries/editableTreeBinder.js +12 -13
  228. package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
  229. package/dist/feature-libraries/fieldGenerator.d.ts +2 -2
  230. package/dist/feature-libraries/fieldGenerator.d.ts.map +1 -1
  231. package/dist/feature-libraries/fieldGenerator.js.map +1 -1
  232. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +5 -5
  233. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  234. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +11 -12
  235. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  236. package/dist/feature-libraries/flex-tree/context.d.ts +8 -8
  237. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  238. package/dist/feature-libraries/flex-tree/context.js +3 -7
  239. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  240. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +9 -9
  241. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  242. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  243. package/dist/feature-libraries/flex-tree/index.d.ts +1 -1
  244. package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
  245. package/dist/feature-libraries/flex-tree/index.js +1 -4
  246. package/dist/feature-libraries/flex-tree/index.js.map +1 -1
  247. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +4 -4
  248. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  249. package/dist/feature-libraries/flex-tree/lazyEntity.js +22 -13
  250. package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  251. package/dist/feature-libraries/flex-tree/lazyField.d.ts +6 -6
  252. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  253. package/dist/feature-libraries/flex-tree/lazyField.js +0 -6
  254. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  255. package/dist/feature-libraries/flex-tree/lazyNode.d.ts +5 -5
  256. package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  257. package/dist/feature-libraries/flex-tree/lazyNode.js +19 -13
  258. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  259. package/dist/feature-libraries/flex-tree/treeEvents.d.ts +1 -13
  260. package/dist/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
  261. package/dist/feature-libraries/flex-tree/treeEvents.js +0 -31
  262. package/dist/feature-libraries/flex-tree/treeEvents.js.map +1 -1
  263. package/dist/feature-libraries/flex-tree/unboxed.d.ts +5 -5
  264. package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
  265. package/dist/feature-libraries/flex-tree/unboxed.js.map +1 -1
  266. package/dist/feature-libraries/flex-tree/utilities.d.ts +1 -1
  267. package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  268. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  269. package/dist/feature-libraries/forest-summary/codec.d.ts +3 -3
  270. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  271. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  272. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +7 -7
  273. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  274. package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -6
  275. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  276. package/dist/feature-libraries/forest-summary/format.d.ts +1 -1
  277. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  278. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  279. package/dist/feature-libraries/index.d.ts +1 -1
  280. package/dist/feature-libraries/index.d.ts.map +1 -1
  281. package/dist/feature-libraries/index.js +1 -3
  282. package/dist/feature-libraries/index.js.map +1 -1
  283. package/dist/feature-libraries/mapTreeCursor.d.ts +2 -2
  284. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  285. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  286. package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts +1 -1
  287. package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts.map +1 -1
  288. package/dist/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
  289. package/dist/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  290. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  291. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  292. package/dist/feature-libraries/modular-schema/comparison.d.ts +2 -2
  293. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  294. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  295. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +2 -2
  296. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  297. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  298. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -7
  299. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  300. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  301. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +1 -1
  302. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  303. package/dist/feature-libraries/modular-schema/fieldKind.js +0 -2
  304. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  305. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
  306. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  307. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  308. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +3 -3
  309. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
  310. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -3
  311. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
  312. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +4 -4
  313. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  314. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  315. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  316. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  317. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  318. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +1 -1
  319. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  320. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  321. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts +1 -1
  322. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
  323. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  324. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +2 -2
  325. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  326. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  327. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +5 -5
  328. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  329. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +2 -0
  330. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  331. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +6 -6
  332. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  333. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +2 -5
  334. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  335. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +3 -3
  336. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  337. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  338. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +3 -3
  339. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  340. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  341. package/dist/feature-libraries/node-key/mockNodeKeyManager.d.ts +2 -2
  342. package/dist/feature-libraries/node-key/mockNodeKeyManager.d.ts.map +1 -1
  343. package/dist/feature-libraries/node-key/mockNodeKeyManager.js +4 -2
  344. package/dist/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
  345. package/dist/feature-libraries/node-key/nodeKey.d.ts +3 -3
  346. package/dist/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
  347. package/dist/feature-libraries/node-key/nodeKey.js.map +1 -1
  348. package/dist/feature-libraries/node-key/nodeKeyIndex.d.ts +4 -4
  349. package/dist/feature-libraries/node-key/nodeKeyIndex.d.ts.map +1 -1
  350. package/dist/feature-libraries/node-key/nodeKeyIndex.js +0 -3
  351. package/dist/feature-libraries/node-key/nodeKeyIndex.js.map +1 -1
  352. package/dist/feature-libraries/node-key/nodeKeyManager.d.ts +1 -1
  353. package/dist/feature-libraries/node-key/nodeKeyManager.d.ts.map +1 -1
  354. package/dist/feature-libraries/node-key/nodeKeyManager.js.map +1 -1
  355. package/dist/feature-libraries/object-forest/objectForest.d.ts +2 -2
  356. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  357. package/dist/feature-libraries/object-forest/objectForest.js +28 -23
  358. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  359. package/dist/feature-libraries/optional-field/optionalField.d.ts +3 -3
  360. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  361. package/dist/feature-libraries/optional-field/optionalField.js +3 -1
  362. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  363. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +1 -1
  364. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  365. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
  366. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +1 -1
  367. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  368. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
  369. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +2 -2
  370. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  371. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  372. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +3 -3
  373. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +1 -1
  374. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js.map +1 -1
  375. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +3 -3
  376. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  377. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  378. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  379. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  380. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  381. package/dist/feature-libraries/schema-aware/schemaAware.d.ts +4 -4
  382. package/dist/feature-libraries/schema-aware/schemaAware.d.ts.map +1 -1
  383. package/dist/feature-libraries/schema-aware/schemaAware.js +0 -2
  384. package/dist/feature-libraries/schema-aware/schemaAware.js.map +1 -1
  385. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -2
  386. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  387. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  388. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +1 -1
  389. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  390. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  391. package/dist/feature-libraries/schema-edits/schemaChangeTypes.d.ts +1 -1
  392. package/dist/feature-libraries/schema-edits/schemaChangeTypes.d.ts.map +1 -1
  393. package/dist/feature-libraries/schema-edits/schemaChangeTypes.js.map +1 -1
  394. package/dist/feature-libraries/schema-index/codec.d.ts +2 -2
  395. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  396. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  397. package/dist/feature-libraries/schema-index/format.d.ts +1 -1
  398. package/dist/feature-libraries/schema-index/format.d.ts.map +1 -1
  399. package/dist/feature-libraries/schema-index/format.js.map +1 -1
  400. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +7 -7
  401. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  402. package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -5
  403. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  404. package/dist/feature-libraries/schemaBuilder.d.ts +2 -2
  405. package/dist/feature-libraries/schemaBuilder.d.ts.map +1 -1
  406. package/dist/feature-libraries/schemaBuilder.js.map +1 -1
  407. package/dist/feature-libraries/schemaBuilderBase.d.ts +4 -4
  408. package/dist/feature-libraries/schemaBuilderBase.d.ts.map +1 -1
  409. package/dist/feature-libraries/schemaBuilderBase.js +3 -14
  410. package/dist/feature-libraries/schemaBuilderBase.js.map +1 -1
  411. package/dist/feature-libraries/sequence-field/compose.d.ts +5 -5
  412. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  413. package/dist/feature-libraries/sequence-field/compose.js +0 -6
  414. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  415. package/dist/feature-libraries/sequence-field/formatV1.d.ts +1 -1
  416. package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  417. package/dist/feature-libraries/sequence-field/formatV1.js.map +1 -1
  418. package/dist/feature-libraries/sequence-field/formatV2.d.ts +1 -1
  419. package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  420. package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
  421. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +1 -1
  422. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  423. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  424. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  425. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  426. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  427. package/dist/feature-libraries/sequence-field/markListFactory.d.ts +1 -1
  428. package/dist/feature-libraries/sequence-field/markListFactory.d.ts.map +1 -1
  429. package/dist/feature-libraries/sequence-field/markListFactory.js +4 -3
  430. package/dist/feature-libraries/sequence-field/markListFactory.js.map +1 -1
  431. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  432. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  433. package/dist/feature-libraries/sequence-field/markQueue.js +2 -4
  434. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  435. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +5 -5
  436. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  437. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  438. package/dist/feature-libraries/sequence-field/prune.d.ts +2 -2
  439. package/dist/feature-libraries/sequence-field/prune.d.ts.map +1 -1
  440. package/dist/feature-libraries/sequence-field/prune.js.map +1 -1
  441. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  442. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  443. package/dist/feature-libraries/sequence-field/rebase.js +0 -6
  444. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  445. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +3 -3
  446. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
  447. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  448. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
  449. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  450. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  451. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts +3 -3
  452. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  453. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  454. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +2 -2
  455. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
  456. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
  457. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +5 -5
  458. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
  459. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
  460. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +5 -5
  461. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  462. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  463. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +4 -4
  464. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  465. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  466. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +3 -3
  467. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  468. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  469. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -3
  470. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  471. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  472. package/dist/feature-libraries/sequence-field/types.d.ts +2 -2
  473. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  474. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  475. package/dist/feature-libraries/sequence-field/utils.d.ts +5 -5
  476. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  477. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  478. package/dist/feature-libraries/storedToViewSchema.d.ts +2 -2
  479. package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  480. package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
  481. package/dist/feature-libraries/treeCursorUtils.d.ts +1 -1
  482. package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  483. package/dist/feature-libraries/treeCursorUtils.js +9 -13
  484. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  485. package/dist/feature-libraries/treeTextCursor.d.ts +2 -2
  486. package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
  487. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  488. package/dist/feature-libraries/typed-schema/schemaCollection.d.ts +3 -3
  489. package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  490. package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  491. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +4 -4
  492. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  493. package/dist/feature-libraries/typed-schema/typedTreeSchema.js +4 -23
  494. package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  495. package/dist/feature-libraries/typed-schema/view.d.ts +4 -4
  496. package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
  497. package/dist/feature-libraries/typed-schema/view.js +0 -7
  498. package/dist/feature-libraries/typed-schema/view.js.map +1 -1
  499. package/dist/feature-libraries/valueUtilities.d.ts +2 -2
  500. package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
  501. package/dist/feature-libraries/valueUtilities.js.map +1 -1
  502. package/dist/index.d.ts +1 -1
  503. package/dist/index.d.ts.map +1 -1
  504. package/dist/index.js +1 -2
  505. package/dist/index.js.map +1 -1
  506. package/dist/packageVersion.d.ts +1 -1
  507. package/dist/packageVersion.js +1 -1
  508. package/dist/packageVersion.js.map +1 -1
  509. package/dist/public.d.ts +0 -1
  510. package/dist/shared-tree/schematizeTree.d.ts +3 -3
  511. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  512. package/dist/shared-tree/schematizeTree.js.map +1 -1
  513. package/dist/shared-tree/schematizingTreeView.d.ts +4 -4
  514. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  515. package/dist/shared-tree/schematizingTreeView.js +10 -27
  516. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  517. package/dist/shared-tree/sharedTree.d.ts +15 -11
  518. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  519. package/dist/shared-tree/sharedTree.js +13 -10
  520. package/dist/shared-tree/sharedTree.js.map +1 -1
  521. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +4 -4
  522. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  523. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  524. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +3 -3
  525. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  526. package/dist/shared-tree/sharedTreeChangeEnricher.js +11 -14
  527. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  528. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  529. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  530. package/dist/shared-tree/sharedTreeChangeFamily.js +3 -5
  531. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  532. package/dist/shared-tree/sharedTreeChangeFormat.d.ts +1 -1
  533. package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  534. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  535. package/dist/shared-tree/sharedTreeChangeTypes.d.ts +1 -1
  536. package/dist/shared-tree/sharedTreeChangeTypes.d.ts.map +1 -1
  537. package/dist/shared-tree/sharedTreeChangeTypes.js.map +1 -1
  538. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +3 -3
  539. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  540. package/dist/shared-tree/sharedTreeEditBuilder.js +0 -2
  541. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  542. package/dist/shared-tree/treeApi.d.ts +1 -1
  543. package/dist/shared-tree/treeApi.d.ts.map +1 -1
  544. package/dist/shared-tree/treeApi.js.map +1 -1
  545. package/dist/shared-tree/treeCheckout.d.ts +7 -7
  546. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  547. package/dist/shared-tree/treeCheckout.js +11 -22
  548. package/dist/shared-tree/treeCheckout.js.map +1 -1
  549. package/dist/shared-tree/treeView.d.ts +3 -3
  550. package/dist/shared-tree/treeView.d.ts.map +1 -1
  551. package/dist/shared-tree/treeView.js +0 -6
  552. package/dist/shared-tree/treeView.js.map +1 -1
  553. package/dist/shared-tree-core/branch.d.ts +2 -2
  554. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  555. package/dist/shared-tree-core/branch.js +25 -31
  556. package/dist/shared-tree-core/branch.js.map +1 -1
  557. package/dist/shared-tree-core/branchCommitEnricher.d.ts +2 -2
  558. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  559. package/dist/shared-tree-core/branchCommitEnricher.js +9 -12
  560. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  561. package/dist/shared-tree-core/changeEnricher.d.ts +1 -1
  562. package/dist/shared-tree-core/changeEnricher.d.ts.map +1 -1
  563. package/dist/shared-tree-core/changeEnricher.js.map +1 -1
  564. package/dist/shared-tree-core/defaultResubmitMachine.d.ts +2 -2
  565. package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  566. package/dist/shared-tree-core/defaultResubmitMachine.js +19 -21
  567. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  568. package/dist/shared-tree-core/editManager.d.ts +3 -3
  569. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  570. package/dist/shared-tree-core/editManager.js +37 -53
  571. package/dist/shared-tree-core/editManager.js.map +1 -1
  572. package/dist/shared-tree-core/editManagerCodecs.d.ts +5 -5
  573. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  574. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  575. package/dist/shared-tree-core/editManagerFormat.d.ts +4 -4
  576. package/dist/shared-tree-core/editManagerFormat.d.ts.map +1 -1
  577. package/dist/shared-tree-core/editManagerFormat.js.map +1 -1
  578. package/dist/shared-tree-core/editManagerSummarizer.d.ts +9 -9
  579. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  580. package/dist/shared-tree-core/editManagerSummarizer.js +1 -5
  581. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  582. package/dist/shared-tree-core/messageCodecs.d.ts +5 -5
  583. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  584. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  585. package/dist/shared-tree-core/messageFormat.d.ts +4 -4
  586. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  587. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  588. package/dist/shared-tree-core/messageTypes.d.ts +2 -2
  589. package/dist/shared-tree-core/messageTypes.d.ts.map +1 -1
  590. package/dist/shared-tree-core/messageTypes.js.map +1 -1
  591. package/dist/shared-tree-core/resubmitMachine.d.ts +1 -1
  592. package/dist/shared-tree-core/resubmitMachine.d.ts.map +1 -1
  593. package/dist/shared-tree-core/resubmitMachine.js.map +1 -1
  594. package/dist/shared-tree-core/sequenceIdUtils.d.ts +1 -1
  595. package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  596. package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
  597. package/dist/shared-tree-core/sharedTreeCore.d.ts +10 -10
  598. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  599. package/dist/shared-tree-core/sharedTreeCore.js +7 -24
  600. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  601. package/dist/shared-tree-core/transactionEnricher.d.ts +2 -2
  602. package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  603. package/dist/shared-tree-core/transactionEnricher.js +1 -3
  604. package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
  605. package/dist/shared-tree-core/transactionStack.d.ts +1 -1
  606. package/dist/shared-tree-core/transactionStack.d.ts.map +1 -1
  607. package/dist/shared-tree-core/transactionStack.js +3 -1
  608. package/dist/shared-tree-core/transactionStack.js.map +1 -1
  609. package/dist/simple-tree/arrayNode.d.ts +2 -2
  610. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  611. package/dist/simple-tree/arrayNode.js +34 -26
  612. package/dist/simple-tree/arrayNode.js.map +1 -1
  613. package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
  614. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  615. package/dist/simple-tree/leafNodeSchema.js +2 -4
  616. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  617. package/dist/simple-tree/mapNode.d.ts +2 -2
  618. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  619. package/dist/simple-tree/mapNode.js +5 -5
  620. package/dist/simple-tree/mapNode.js.map +1 -1
  621. package/dist/simple-tree/nodeKeys.d.ts +2 -2
  622. package/dist/simple-tree/nodeKeys.d.ts.map +1 -1
  623. package/dist/simple-tree/nodeKeys.js.map +1 -1
  624. package/dist/simple-tree/objectNode.d.ts +5 -5
  625. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  626. package/dist/simple-tree/objectNode.js +6 -6
  627. package/dist/simple-tree/objectNode.js.map +1 -1
  628. package/dist/simple-tree/proxies.d.ts +4 -4
  629. package/dist/simple-tree/proxies.d.ts.map +1 -1
  630. package/dist/simple-tree/proxies.js +6 -4
  631. package/dist/simple-tree/proxies.js.map +1 -1
  632. package/dist/simple-tree/proxyBinding.d.ts +6 -6
  633. package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
  634. package/dist/simple-tree/proxyBinding.js.map +1 -1
  635. package/dist/simple-tree/schemaCaching.d.ts +2 -2
  636. package/dist/simple-tree/schemaCaching.d.ts.map +1 -1
  637. package/dist/simple-tree/schemaCaching.js.map +1 -1
  638. package/dist/simple-tree/schemaCreationUtilities.d.ts +5 -5
  639. package/dist/simple-tree/schemaCreationUtilities.d.ts.map +1 -1
  640. package/dist/simple-tree/schemaCreationUtilities.js.map +1 -1
  641. package/dist/simple-tree/schemaFactory.d.ts +25 -12
  642. package/dist/simple-tree/schemaFactory.d.ts.map +1 -1
  643. package/dist/simple-tree/schemaFactory.js +65 -53
  644. package/dist/simple-tree/schemaFactory.js.map +1 -1
  645. package/dist/simple-tree/schemaFactoryRecursive.d.ts +6 -6
  646. package/dist/simple-tree/schemaFactoryRecursive.d.ts.map +1 -1
  647. package/dist/simple-tree/schemaFactoryRecursive.js.map +1 -1
  648. package/dist/simple-tree/schemaTypes.d.ts +6 -6
  649. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  650. package/dist/simple-tree/schemaTypes.js +3 -12
  651. package/dist/simple-tree/schemaTypes.js.map +1 -1
  652. package/dist/simple-tree/testRecursiveDomain.d.ts +1 -1
  653. package/dist/simple-tree/testRecursiveDomain.d.ts.map +1 -1
  654. package/dist/simple-tree/testRecursiveDomain.js.map +1 -1
  655. package/dist/simple-tree/toFlexSchema.d.ts +4 -4
  656. package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
  657. package/dist/simple-tree/toFlexSchema.js.map +1 -1
  658. package/dist/simple-tree/toMapTree.d.ts +2 -2
  659. package/dist/simple-tree/toMapTree.d.ts.map +1 -1
  660. package/dist/simple-tree/toMapTree.js.map +1 -1
  661. package/dist/simple-tree/tree.d.ts +6 -27
  662. package/dist/simple-tree/tree.d.ts.map +1 -1
  663. package/dist/simple-tree/tree.js +0 -21
  664. package/dist/simple-tree/tree.js.map +1 -1
  665. package/dist/simple-tree/treeNodeApi.d.ts +30 -27
  666. package/dist/simple-tree/treeNodeApi.d.ts.map +1 -1
  667. package/dist/simple-tree/treeNodeApi.js +8 -3
  668. package/dist/simple-tree/treeNodeApi.js.map +1 -1
  669. package/dist/simple-tree/types.d.ts +29 -9
  670. package/dist/simple-tree/types.d.ts.map +1 -1
  671. package/dist/simple-tree/types.js +79 -54
  672. package/dist/simple-tree/types.js.map +1 -1
  673. package/dist/simple-tree/typesUnsafe.d.ts +5 -5
  674. package/dist/simple-tree/typesUnsafe.d.ts.map +1 -1
  675. package/dist/simple-tree/typesUnsafe.js.map +1 -1
  676. package/dist/treeFactory.d.ts +5 -5
  677. package/dist/treeFactory.d.ts.map +1 -1
  678. package/dist/treeFactory.js +10 -9
  679. package/dist/treeFactory.js.map +1 -1
  680. package/dist/util/brand.js +0 -1
  681. package/dist/util/brand.js.map +1 -1
  682. package/dist/util/brandedMap.d.ts +1 -1
  683. package/dist/util/brandedMap.d.ts.map +1 -1
  684. package/dist/util/brandedMap.js.map +1 -1
  685. package/dist/util/nestedMap.d.ts +1 -1
  686. package/dist/util/nestedMap.d.ts.map +1 -1
  687. package/dist/util/nestedMap.js +4 -2
  688. package/dist/util/nestedMap.js.map +1 -1
  689. package/dist/util/nestedSet.d.ts +1 -1
  690. package/dist/util/nestedSet.d.ts.map +1 -1
  691. package/dist/util/nestedSet.js.map +1 -1
  692. package/dist/util/offsetList.js +4 -2
  693. package/dist/util/offsetList.js.map +1 -1
  694. package/dist/util/referenceCounting.js +0 -1
  695. package/dist/util/referenceCounting.js.map +1 -1
  696. package/dist/util/stackyIterator.js +2 -3
  697. package/dist/util/stackyIterator.js.map +1 -1
  698. package/dist/util/typeboxBrand.d.ts +1 -1
  699. package/dist/util/typeboxBrand.d.ts.map +1 -1
  700. package/dist/util/typeboxBrand.js.map +1 -1
  701. package/lib/beta.d.ts +0 -1
  702. package/lib/codec/codec.d.ts +2 -2
  703. package/lib/codec/codec.d.ts.map +1 -1
  704. package/lib/codec/codec.js +0 -1
  705. package/lib/codec/codec.js.map +1 -1
  706. package/lib/codec/discriminatedUnions.d.ts +2 -2
  707. package/lib/codec/discriminatedUnions.d.ts.map +1 -1
  708. package/lib/codec/discriminatedUnions.js +0 -1
  709. package/lib/codec/discriminatedUnions.js.map +1 -1
  710. package/lib/codec/noopValidator.d.ts +1 -1
  711. package/lib/codec/noopValidator.d.ts.map +1 -1
  712. package/lib/codec/noopValidator.js.map +1 -1
  713. package/lib/codec/versioned/codec.d.ts +3 -3
  714. package/lib/codec/versioned/codec.d.ts.map +1 -1
  715. package/lib/codec/versioned/codec.js.map +1 -1
  716. package/lib/codec/versioned/format.d.ts +1 -1
  717. package/lib/codec/versioned/format.d.ts.map +1 -1
  718. package/lib/codec/versioned/format.js.map +1 -1
  719. package/lib/core/change-family/changeFamily.d.ts +5 -5
  720. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  721. package/lib/core/change-family/changeFamily.js.map +1 -1
  722. package/lib/core/change-family/editBuilder.d.ts +1 -1
  723. package/lib/core/change-family/editBuilder.d.ts.map +1 -1
  724. package/lib/core/change-family/editBuilder.js +0 -2
  725. package/lib/core/change-family/editBuilder.js.map +1 -1
  726. package/lib/core/forest/editableForest.d.ts +5 -5
  727. package/lib/core/forest/editableForest.d.ts.map +1 -1
  728. package/lib/core/forest/editableForest.js.map +1 -1
  729. package/lib/core/forest/forest.d.ts +3 -3
  730. package/lib/core/forest/forest.d.ts.map +1 -1
  731. package/lib/core/forest/forest.js.map +1 -1
  732. package/lib/core/rebase/changeRebaser.d.ts +1 -1
  733. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  734. package/lib/core/rebase/changeRebaser.js.map +1 -1
  735. package/lib/core/rebase/revisionTagCodec.d.ts +4 -4
  736. package/lib/core/rebase/revisionTagCodec.d.ts.map +1 -1
  737. package/lib/core/rebase/revisionTagCodec.js +0 -2
  738. package/lib/core/rebase/revisionTagCodec.js.map +1 -1
  739. package/lib/core/rebase/types.d.ts +3 -3
  740. package/lib/core/rebase/types.d.ts.map +1 -1
  741. package/lib/core/rebase/types.js.map +1 -1
  742. package/lib/core/rebase/utils.d.ts +2 -2
  743. package/lib/core/rebase/utils.d.ts.map +1 -1
  744. package/lib/core/rebase/utils.js.map +1 -1
  745. package/lib/core/schema-stored/format.d.ts +2 -2
  746. package/lib/core/schema-stored/format.d.ts.map +1 -1
  747. package/lib/core/schema-stored/format.js.map +1 -1
  748. package/lib/core/schema-stored/schema.d.ts +3 -3
  749. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  750. package/lib/core/schema-stored/schema.js +0 -4
  751. package/lib/core/schema-stored/schema.js.map +1 -1
  752. package/lib/core/schema-stored/storedSchemaRepository.d.ts +3 -3
  753. package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  754. package/lib/core/schema-stored/storedSchemaRepository.js +1 -3
  755. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  756. package/lib/core/schema-view/view.d.ts +1 -1
  757. package/lib/core/schema-view/view.d.ts.map +1 -1
  758. package/lib/core/schema-view/view.js +0 -2
  759. package/lib/core/schema-view/view.js.map +1 -1
  760. package/lib/core/tree/anchorSet.d.ts +56 -18
  761. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  762. package/lib/core/tree/anchorSet.js +97 -52
  763. package/lib/core/tree/anchorSet.js.map +1 -1
  764. package/lib/core/tree/cursor.d.ts +3 -3
  765. package/lib/core/tree/cursor.d.ts.map +1 -1
  766. package/lib/core/tree/cursor.js.map +1 -1
  767. package/lib/core/tree/delta.d.ts +3 -3
  768. package/lib/core/tree/delta.d.ts.map +1 -1
  769. package/lib/core/tree/delta.js.map +1 -1
  770. package/lib/core/tree/deltaUtil.d.ts +2 -2
  771. package/lib/core/tree/deltaUtil.d.ts.map +1 -1
  772. package/lib/core/tree/deltaUtil.js.map +1 -1
  773. package/lib/core/tree/detachedFieldIndex.d.ts +7 -7
  774. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  775. package/lib/core/tree/detachedFieldIndex.js +2 -8
  776. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  777. package/lib/core/tree/detachedFieldIndexCodec.d.ts +4 -4
  778. package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
  779. package/lib/core/tree/detachedFieldIndexCodec.js +1 -4
  780. package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
  781. package/lib/core/tree/detachedFieldIndexFormat.d.ts +2 -2
  782. package/lib/core/tree/detachedFieldIndexFormat.d.ts.map +1 -1
  783. package/lib/core/tree/detachedFieldIndexFormat.js.map +1 -1
  784. package/lib/core/tree/detachedFieldIndexTypes.d.ts +3 -3
  785. package/lib/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  786. package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
  787. package/lib/core/tree/mapTree.d.ts +2 -2
  788. package/lib/core/tree/mapTree.d.ts.map +1 -1
  789. package/lib/core/tree/mapTree.js.map +1 -1
  790. package/lib/core/tree/pathTree.d.ts +3 -3
  791. package/lib/core/tree/pathTree.d.ts.map +1 -1
  792. package/lib/core/tree/pathTree.js.map +1 -1
  793. package/lib/core/tree/persistedTreeTextFormat.d.ts +1 -1
  794. package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  795. package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
  796. package/lib/core/tree/sparseTree.d.ts +2 -2
  797. package/lib/core/tree/sparseTree.d.ts.map +1 -1
  798. package/lib/core/tree/sparseTree.js +11 -15
  799. package/lib/core/tree/sparseTree.js.map +1 -1
  800. package/lib/core/tree/treeTextFormat.d.ts +2 -2
  801. package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
  802. package/lib/core/tree/treeTextFormat.js.map +1 -1
  803. package/lib/core/tree/types.d.ts +3 -3
  804. package/lib/core/tree/types.d.ts.map +1 -1
  805. package/lib/core/tree/types.js +1 -2
  806. package/lib/core/tree/types.js.map +1 -1
  807. package/lib/core/tree/visitDelta.d.ts +5 -5
  808. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  809. package/lib/core/tree/visitDelta.js.map +1 -1
  810. package/lib/core/tree/visitPath.d.ts +2 -2
  811. package/lib/core/tree/visitPath.d.ts.map +1 -1
  812. package/lib/core/tree/visitPath.js.map +1 -1
  813. package/lib/core/tree/visitorUtils.d.ts +7 -7
  814. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  815. package/lib/core/tree/visitorUtils.js.map +1 -1
  816. package/lib/domains/json/jsonCursor.d.ts +2 -2
  817. package/lib/domains/json/jsonCursor.d.ts.map +1 -1
  818. package/lib/domains/json/jsonCursor.js.map +1 -1
  819. package/lib/domains/json/jsonDomainSchema.js.map +1 -1
  820. package/lib/domains/schemaBuilder.d.ts +2 -2
  821. package/lib/domains/schemaBuilder.d.ts.map +1 -1
  822. package/lib/domains/schemaBuilder.js +70 -70
  823. package/lib/domains/schemaBuilder.js.map +1 -1
  824. package/lib/events/events.js +1 -2
  825. package/lib/events/events.js.map +1 -1
  826. package/lib/feature-libraries/changeAtomIdCodec.d.ts +2 -2
  827. package/lib/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  828. package/lib/feature-libraries/changeAtomIdCodec.js.map +1 -1
  829. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts +2 -2
  830. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  831. package/lib/feature-libraries/chunked-forest/basicChunk.js +1 -14
  832. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  833. package/lib/feature-libraries/chunked-forest/chunk.d.ts +2 -2
  834. package/lib/feature-libraries/chunked-forest/chunk.d.ts.map +1 -1
  835. package/lib/feature-libraries/chunked-forest/chunk.js.map +1 -1
  836. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +4 -4
  837. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  838. package/lib/feature-libraries/chunked-forest/chunkTree.js +6 -13
  839. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  840. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -4
  841. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  842. package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -9
  843. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  844. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +3 -3
  845. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
  846. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +3 -1
  847. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  848. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +17 -7
  849. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  850. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -11
  851. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  852. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +8 -8
  853. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  854. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +3 -6
  855. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  856. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +3 -3
  857. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  858. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +0 -1
  859. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  860. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +6 -5
  861. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  862. package/lib/feature-libraries/chunked-forest/codec/codecs.js +5 -2
  863. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  864. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +7 -7
  865. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  866. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +13 -25
  867. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  868. package/lib/feature-libraries/chunked-forest/codec/fieldBatch.d.ts +1 -1
  869. package/lib/feature-libraries/chunked-forest/codec/fieldBatch.d.ts.map +1 -1
  870. package/lib/feature-libraries/chunked-forest/codec/fieldBatch.js.map +1 -1
  871. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +1 -1
  872. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  873. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  874. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +1 -1
  875. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  876. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  877. package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts +5 -5
  878. package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
  879. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +5 -8
  880. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
  881. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts +6 -6
  882. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +1 -1
  883. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
  884. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +2 -2
  885. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  886. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
  887. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  888. package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
  889. package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
  890. package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  891. package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
  892. package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
  893. package/lib/feature-libraries/chunked-forest/sequenceChunk.js +0 -1
  894. package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  895. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +2 -2
  896. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  897. package/lib/feature-libraries/chunked-forest/uniformChunk.js +5 -40
  898. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  899. package/lib/feature-libraries/contextuallyTyped.d.ts +5 -5
  900. package/lib/feature-libraries/contextuallyTyped.d.ts.map +1 -1
  901. package/lib/feature-libraries/contextuallyTyped.js.map +1 -1
  902. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -3
  903. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  904. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +0 -2
  905. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  906. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
  907. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  908. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  909. package/lib/feature-libraries/default-schema/defaultSchema.d.ts +1 -1
  910. package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  911. package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  912. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  913. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  914. package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  915. package/lib/feature-libraries/deltaUtils.d.ts +1 -1
  916. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  917. package/lib/feature-libraries/deltaUtils.js +1 -1
  918. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  919. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +4 -4
  920. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  921. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +1 -2
  922. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  923. package/lib/feature-libraries/editableTreeBinder.d.ts +3 -3
  924. package/lib/feature-libraries/editableTreeBinder.d.ts.map +1 -1
  925. package/lib/feature-libraries/editableTreeBinder.js +12 -13
  926. package/lib/feature-libraries/editableTreeBinder.js.map +1 -1
  927. package/lib/feature-libraries/fieldGenerator.d.ts +2 -2
  928. package/lib/feature-libraries/fieldGenerator.d.ts.map +1 -1
  929. package/lib/feature-libraries/fieldGenerator.js.map +1 -1
  930. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +5 -5
  931. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  932. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +11 -12
  933. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  934. package/lib/feature-libraries/flex-tree/context.d.ts +8 -8
  935. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  936. package/lib/feature-libraries/flex-tree/context.js +3 -7
  937. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  938. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +9 -9
  939. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  940. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  941. package/lib/feature-libraries/flex-tree/index.d.ts +1 -1
  942. package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
  943. package/lib/feature-libraries/flex-tree/index.js +0 -1
  944. package/lib/feature-libraries/flex-tree/index.js.map +1 -1
  945. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +4 -4
  946. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  947. package/lib/feature-libraries/flex-tree/lazyEntity.js +23 -14
  948. package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  949. package/lib/feature-libraries/flex-tree/lazyField.d.ts +6 -6
  950. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  951. package/lib/feature-libraries/flex-tree/lazyField.js +0 -6
  952. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  953. package/lib/feature-libraries/flex-tree/lazyNode.d.ts +5 -5
  954. package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  955. package/lib/feature-libraries/flex-tree/lazyNode.js +19 -13
  956. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  957. package/lib/feature-libraries/flex-tree/treeEvents.d.ts +1 -13
  958. package/lib/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
  959. package/lib/feature-libraries/flex-tree/treeEvents.js +1 -28
  960. package/lib/feature-libraries/flex-tree/treeEvents.js.map +1 -1
  961. package/lib/feature-libraries/flex-tree/unboxed.d.ts +5 -5
  962. package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
  963. package/lib/feature-libraries/flex-tree/unboxed.js.map +1 -1
  964. package/lib/feature-libraries/flex-tree/utilities.d.ts +1 -1
  965. package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  966. package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
  967. package/lib/feature-libraries/forest-summary/codec.d.ts +3 -3
  968. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  969. package/lib/feature-libraries/forest-summary/codec.js +1 -1
  970. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  971. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +7 -7
  972. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  973. package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -6
  974. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  975. package/lib/feature-libraries/forest-summary/format.d.ts +1 -1
  976. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  977. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  978. package/lib/feature-libraries/index.d.ts +1 -1
  979. package/lib/feature-libraries/index.d.ts.map +1 -1
  980. package/lib/feature-libraries/index.js +1 -1
  981. package/lib/feature-libraries/index.js.map +1 -1
  982. package/lib/feature-libraries/mapTreeCursor.d.ts +2 -2
  983. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  984. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  985. package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts +1 -1
  986. package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts.map +1 -1
  987. package/lib/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
  988. package/lib/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  989. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  990. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  991. package/lib/feature-libraries/modular-schema/comparison.d.ts +2 -2
  992. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  993. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  994. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +2 -2
  995. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  996. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  997. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -7
  998. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  999. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  1000. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +1 -1
  1001. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  1002. package/lib/feature-libraries/modular-schema/fieldKind.js +0 -2
  1003. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  1004. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
  1005. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  1006. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  1007. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +3 -3
  1008. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
  1009. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -3
  1010. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
  1011. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +4 -4
  1012. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  1013. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  1014. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  1015. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  1016. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  1017. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +1 -1
  1018. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  1019. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  1020. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts +1 -1
  1021. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
  1022. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  1023. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +2 -2
  1024. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  1025. package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  1026. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +5 -5
  1027. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  1028. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +2 -0
  1029. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  1030. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +6 -6
  1031. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  1032. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +2 -5
  1033. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  1034. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +3 -3
  1035. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  1036. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  1037. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +3 -3
  1038. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  1039. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  1040. package/lib/feature-libraries/node-key/mockNodeKeyManager.d.ts +2 -2
  1041. package/lib/feature-libraries/node-key/mockNodeKeyManager.d.ts.map +1 -1
  1042. package/lib/feature-libraries/node-key/mockNodeKeyManager.js +4 -2
  1043. package/lib/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
  1044. package/lib/feature-libraries/node-key/nodeKey.d.ts +3 -3
  1045. package/lib/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
  1046. package/lib/feature-libraries/node-key/nodeKey.js.map +1 -1
  1047. package/lib/feature-libraries/node-key/nodeKeyIndex.d.ts +4 -4
  1048. package/lib/feature-libraries/node-key/nodeKeyIndex.d.ts.map +1 -1
  1049. package/lib/feature-libraries/node-key/nodeKeyIndex.js +0 -3
  1050. package/lib/feature-libraries/node-key/nodeKeyIndex.js.map +1 -1
  1051. package/lib/feature-libraries/node-key/nodeKeyManager.d.ts +1 -1
  1052. package/lib/feature-libraries/node-key/nodeKeyManager.d.ts.map +1 -1
  1053. package/lib/feature-libraries/node-key/nodeKeyManager.js.map +1 -1
  1054. package/lib/feature-libraries/object-forest/objectForest.d.ts +2 -2
  1055. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  1056. package/lib/feature-libraries/object-forest/objectForest.js +28 -23
  1057. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  1058. package/lib/feature-libraries/optional-field/optionalField.d.ts +3 -3
  1059. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  1060. package/lib/feature-libraries/optional-field/optionalField.js +3 -1
  1061. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  1062. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +1 -1
  1063. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  1064. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
  1065. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +1 -1
  1066. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  1067. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
  1068. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +2 -2
  1069. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  1070. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  1071. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +3 -3
  1072. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +1 -1
  1073. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js.map +1 -1
  1074. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +3 -3
  1075. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  1076. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  1077. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  1078. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  1079. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  1080. package/lib/feature-libraries/schema-aware/schemaAware.d.ts +4 -4
  1081. package/lib/feature-libraries/schema-aware/schemaAware.d.ts.map +1 -1
  1082. package/lib/feature-libraries/schema-aware/schemaAware.js +1 -2
  1083. package/lib/feature-libraries/schema-aware/schemaAware.js.map +1 -1
  1084. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -2
  1085. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  1086. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  1087. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +1 -1
  1088. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  1089. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  1090. package/lib/feature-libraries/schema-edits/schemaChangeTypes.d.ts +1 -1
  1091. package/lib/feature-libraries/schema-edits/schemaChangeTypes.d.ts.map +1 -1
  1092. package/lib/feature-libraries/schema-edits/schemaChangeTypes.js.map +1 -1
  1093. package/lib/feature-libraries/schema-index/codec.d.ts +2 -2
  1094. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  1095. package/lib/feature-libraries/schema-index/codec.js +1 -1
  1096. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  1097. package/lib/feature-libraries/schema-index/format.d.ts +1 -1
  1098. package/lib/feature-libraries/schema-index/format.d.ts.map +1 -1
  1099. package/lib/feature-libraries/schema-index/format.js.map +1 -1
  1100. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +7 -7
  1101. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  1102. package/lib/feature-libraries/schema-index/schemaSummarizer.js +2 -6
  1103. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  1104. package/lib/feature-libraries/schemaBuilder.d.ts +2 -2
  1105. package/lib/feature-libraries/schemaBuilder.d.ts.map +1 -1
  1106. package/lib/feature-libraries/schemaBuilder.js.map +1 -1
  1107. package/lib/feature-libraries/schemaBuilderBase.d.ts +4 -4
  1108. package/lib/feature-libraries/schemaBuilderBase.d.ts.map +1 -1
  1109. package/lib/feature-libraries/schemaBuilderBase.js +3 -14
  1110. package/lib/feature-libraries/schemaBuilderBase.js.map +1 -1
  1111. package/lib/feature-libraries/sequence-field/compose.d.ts +5 -5
  1112. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  1113. package/lib/feature-libraries/sequence-field/compose.js +0 -6
  1114. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  1115. package/lib/feature-libraries/sequence-field/formatV1.d.ts +1 -1
  1116. package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  1117. package/lib/feature-libraries/sequence-field/formatV1.js.map +1 -1
  1118. package/lib/feature-libraries/sequence-field/formatV2.d.ts +1 -1
  1119. package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  1120. package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
  1121. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +1 -1
  1122. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  1123. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  1124. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  1125. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  1126. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  1127. package/lib/feature-libraries/sequence-field/markListFactory.d.ts +1 -1
  1128. package/lib/feature-libraries/sequence-field/markListFactory.d.ts.map +1 -1
  1129. package/lib/feature-libraries/sequence-field/markListFactory.js +4 -3
  1130. package/lib/feature-libraries/sequence-field/markListFactory.js.map +1 -1
  1131. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  1132. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  1133. package/lib/feature-libraries/sequence-field/markQueue.js +2 -4
  1134. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  1135. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +5 -5
  1136. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  1137. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  1138. package/lib/feature-libraries/sequence-field/prune.d.ts +2 -2
  1139. package/lib/feature-libraries/sequence-field/prune.d.ts.map +1 -1
  1140. package/lib/feature-libraries/sequence-field/prune.js.map +1 -1
  1141. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  1142. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  1143. package/lib/feature-libraries/sequence-field/rebase.js +0 -6
  1144. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  1145. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +3 -3
  1146. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
  1147. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  1148. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
  1149. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  1150. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  1151. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts +3 -3
  1152. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  1153. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  1154. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +2 -2
  1155. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
  1156. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
  1157. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +5 -5
  1158. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
  1159. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
  1160. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +5 -5
  1161. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  1162. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  1163. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +4 -4
  1164. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  1165. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  1166. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +3 -3
  1167. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  1168. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  1169. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -3
  1170. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  1171. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  1172. package/lib/feature-libraries/sequence-field/types.d.ts +2 -2
  1173. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  1174. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  1175. package/lib/feature-libraries/sequence-field/utils.d.ts +5 -5
  1176. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  1177. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  1178. package/lib/feature-libraries/storedToViewSchema.d.ts +2 -2
  1179. package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  1180. package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
  1181. package/lib/feature-libraries/treeCursorUtils.d.ts +1 -1
  1182. package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  1183. package/lib/feature-libraries/treeCursorUtils.js +9 -13
  1184. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  1185. package/lib/feature-libraries/treeTextCursor.d.ts +2 -2
  1186. package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
  1187. package/lib/feature-libraries/treeTextCursor.js +1 -1
  1188. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  1189. package/lib/feature-libraries/typed-schema/schemaCollection.d.ts +3 -3
  1190. package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  1191. package/lib/feature-libraries/typed-schema/schemaCollection.js +1 -1
  1192. package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  1193. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +4 -4
  1194. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  1195. package/lib/feature-libraries/typed-schema/typedTreeSchema.js +4 -23
  1196. package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  1197. package/lib/feature-libraries/typed-schema/view.d.ts +4 -4
  1198. package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
  1199. package/lib/feature-libraries/typed-schema/view.js +0 -7
  1200. package/lib/feature-libraries/typed-schema/view.js.map +1 -1
  1201. package/lib/feature-libraries/valueUtilities.d.ts +2 -2
  1202. package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
  1203. package/lib/feature-libraries/valueUtilities.js.map +1 -1
  1204. package/lib/index.d.ts +1 -1
  1205. package/lib/index.d.ts.map +1 -1
  1206. package/lib/index.js +1 -1
  1207. package/lib/index.js.map +1 -1
  1208. package/lib/packageVersion.d.ts +1 -1
  1209. package/lib/packageVersion.js +1 -1
  1210. package/lib/packageVersion.js.map +1 -1
  1211. package/lib/public.d.ts +0 -1
  1212. package/lib/shared-tree/schematizeTree.d.ts +3 -3
  1213. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  1214. package/lib/shared-tree/schematizeTree.js.map +1 -1
  1215. package/lib/shared-tree/schematizingTreeView.d.ts +4 -4
  1216. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  1217. package/lib/shared-tree/schematizingTreeView.js +11 -28
  1218. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  1219. package/lib/shared-tree/sharedTree.d.ts +15 -11
  1220. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  1221. package/lib/shared-tree/sharedTree.js +14 -11
  1222. package/lib/shared-tree/sharedTree.js.map +1 -1
  1223. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +4 -4
  1224. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  1225. package/lib/shared-tree/sharedTreeChangeCodecs.js +1 -1
  1226. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  1227. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +3 -3
  1228. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  1229. package/lib/shared-tree/sharedTreeChangeEnricher.js +11 -14
  1230. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  1231. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  1232. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  1233. package/lib/shared-tree/sharedTreeChangeFamily.js +4 -6
  1234. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  1235. package/lib/shared-tree/sharedTreeChangeFormat.d.ts +1 -1
  1236. package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  1237. package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  1238. package/lib/shared-tree/sharedTreeChangeTypes.d.ts +1 -1
  1239. package/lib/shared-tree/sharedTreeChangeTypes.d.ts.map +1 -1
  1240. package/lib/shared-tree/sharedTreeChangeTypes.js.map +1 -1
  1241. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +3 -3
  1242. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  1243. package/lib/shared-tree/sharedTreeEditBuilder.js +0 -2
  1244. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  1245. package/lib/shared-tree/treeApi.d.ts +1 -1
  1246. package/lib/shared-tree/treeApi.d.ts.map +1 -1
  1247. package/lib/shared-tree/treeApi.js.map +1 -1
  1248. package/lib/shared-tree/treeCheckout.d.ts +7 -7
  1249. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  1250. package/lib/shared-tree/treeCheckout.js +12 -23
  1251. package/lib/shared-tree/treeCheckout.js.map +1 -1
  1252. package/lib/shared-tree/treeView.d.ts +3 -3
  1253. package/lib/shared-tree/treeView.d.ts.map +1 -1
  1254. package/lib/shared-tree/treeView.js +0 -6
  1255. package/lib/shared-tree/treeView.js.map +1 -1
  1256. package/lib/shared-tree-core/branch.d.ts +2 -2
  1257. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  1258. package/lib/shared-tree-core/branch.js +25 -31
  1259. package/lib/shared-tree-core/branch.js.map +1 -1
  1260. package/lib/shared-tree-core/branchCommitEnricher.d.ts +2 -2
  1261. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  1262. package/lib/shared-tree-core/branchCommitEnricher.js +9 -12
  1263. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  1264. package/lib/shared-tree-core/changeEnricher.d.ts +1 -1
  1265. package/lib/shared-tree-core/changeEnricher.d.ts.map +1 -1
  1266. package/lib/shared-tree-core/changeEnricher.js.map +1 -1
  1267. package/lib/shared-tree-core/defaultResubmitMachine.d.ts +2 -2
  1268. package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  1269. package/lib/shared-tree-core/defaultResubmitMachine.js +19 -21
  1270. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  1271. package/lib/shared-tree-core/editManager.d.ts +3 -3
  1272. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  1273. package/lib/shared-tree-core/editManager.js +37 -53
  1274. package/lib/shared-tree-core/editManager.js.map +1 -1
  1275. package/lib/shared-tree-core/editManagerCodecs.d.ts +5 -5
  1276. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  1277. package/lib/shared-tree-core/editManagerCodecs.js +1 -1
  1278. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  1279. package/lib/shared-tree-core/editManagerFormat.d.ts +4 -4
  1280. package/lib/shared-tree-core/editManagerFormat.d.ts.map +1 -1
  1281. package/lib/shared-tree-core/editManagerFormat.js.map +1 -1
  1282. package/lib/shared-tree-core/editManagerSummarizer.d.ts +9 -9
  1283. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  1284. package/lib/shared-tree-core/editManagerSummarizer.js +1 -5
  1285. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  1286. package/lib/shared-tree-core/messageCodecs.d.ts +5 -5
  1287. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  1288. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  1289. package/lib/shared-tree-core/messageFormat.d.ts +4 -4
  1290. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  1291. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  1292. package/lib/shared-tree-core/messageTypes.d.ts +2 -2
  1293. package/lib/shared-tree-core/messageTypes.d.ts.map +1 -1
  1294. package/lib/shared-tree-core/messageTypes.js.map +1 -1
  1295. package/lib/shared-tree-core/resubmitMachine.d.ts +1 -1
  1296. package/lib/shared-tree-core/resubmitMachine.d.ts.map +1 -1
  1297. package/lib/shared-tree-core/resubmitMachine.js.map +1 -1
  1298. package/lib/shared-tree-core/sequenceIdUtils.d.ts +1 -1
  1299. package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  1300. package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
  1301. package/lib/shared-tree-core/sharedTreeCore.d.ts +10 -10
  1302. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  1303. package/lib/shared-tree-core/sharedTreeCore.js +7 -24
  1304. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  1305. package/lib/shared-tree-core/transactionEnricher.d.ts +2 -2
  1306. package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  1307. package/lib/shared-tree-core/transactionEnricher.js +1 -3
  1308. package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
  1309. package/lib/shared-tree-core/transactionStack.d.ts +1 -1
  1310. package/lib/shared-tree-core/transactionStack.d.ts.map +1 -1
  1311. package/lib/shared-tree-core/transactionStack.js +3 -1
  1312. package/lib/shared-tree-core/transactionStack.js.map +1 -1
  1313. package/lib/simple-tree/arrayNode.d.ts +2 -2
  1314. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  1315. package/lib/simple-tree/arrayNode.js +35 -27
  1316. package/lib/simple-tree/arrayNode.js.map +1 -1
  1317. package/lib/simple-tree/leafNodeSchema.d.ts +1 -1
  1318. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  1319. package/lib/simple-tree/leafNodeSchema.js +2 -4
  1320. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  1321. package/lib/simple-tree/mapNode.d.ts +2 -2
  1322. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  1323. package/lib/simple-tree/mapNode.js +5 -5
  1324. package/lib/simple-tree/mapNode.js.map +1 -1
  1325. package/lib/simple-tree/nodeKeys.d.ts +2 -2
  1326. package/lib/simple-tree/nodeKeys.d.ts.map +1 -1
  1327. package/lib/simple-tree/nodeKeys.js.map +1 -1
  1328. package/lib/simple-tree/objectNode.d.ts +5 -5
  1329. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  1330. package/lib/simple-tree/objectNode.js +6 -6
  1331. package/lib/simple-tree/objectNode.js.map +1 -1
  1332. package/lib/simple-tree/proxies.d.ts +4 -4
  1333. package/lib/simple-tree/proxies.d.ts.map +1 -1
  1334. package/lib/simple-tree/proxies.js +7 -5
  1335. package/lib/simple-tree/proxies.js.map +1 -1
  1336. package/lib/simple-tree/proxyBinding.d.ts +6 -6
  1337. package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
  1338. package/lib/simple-tree/proxyBinding.js.map +1 -1
  1339. package/lib/simple-tree/schemaCaching.d.ts +2 -2
  1340. package/lib/simple-tree/schemaCaching.d.ts.map +1 -1
  1341. package/lib/simple-tree/schemaCaching.js.map +1 -1
  1342. package/lib/simple-tree/schemaCreationUtilities.d.ts +5 -5
  1343. package/lib/simple-tree/schemaCreationUtilities.d.ts.map +1 -1
  1344. package/lib/simple-tree/schemaCreationUtilities.js.map +1 -1
  1345. package/lib/simple-tree/schemaFactory.d.ts +25 -12
  1346. package/lib/simple-tree/schemaFactory.d.ts.map +1 -1
  1347. package/lib/simple-tree/schemaFactory.js +66 -54
  1348. package/lib/simple-tree/schemaFactory.js.map +1 -1
  1349. package/lib/simple-tree/schemaFactoryRecursive.d.ts +6 -6
  1350. package/lib/simple-tree/schemaFactoryRecursive.d.ts.map +1 -1
  1351. package/lib/simple-tree/schemaFactoryRecursive.js +1 -1
  1352. package/lib/simple-tree/schemaFactoryRecursive.js.map +1 -1
  1353. package/lib/simple-tree/schemaTypes.d.ts +6 -6
  1354. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  1355. package/lib/simple-tree/schemaTypes.js +3 -12
  1356. package/lib/simple-tree/schemaTypes.js.map +1 -1
  1357. package/lib/simple-tree/testRecursiveDomain.d.ts +1 -1
  1358. package/lib/simple-tree/testRecursiveDomain.d.ts.map +1 -1
  1359. package/lib/simple-tree/testRecursiveDomain.js.map +1 -1
  1360. package/lib/simple-tree/toFlexSchema.d.ts +4 -4
  1361. package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
  1362. package/lib/simple-tree/toFlexSchema.js.map +1 -1
  1363. package/lib/simple-tree/toMapTree.d.ts +2 -2
  1364. package/lib/simple-tree/toMapTree.d.ts.map +1 -1
  1365. package/lib/simple-tree/toMapTree.js.map +1 -1
  1366. package/lib/simple-tree/tree.d.ts +6 -27
  1367. package/lib/simple-tree/tree.d.ts.map +1 -1
  1368. package/lib/simple-tree/tree.js +0 -21
  1369. package/lib/simple-tree/tree.js.map +1 -1
  1370. package/lib/simple-tree/treeNodeApi.d.ts +30 -27
  1371. package/lib/simple-tree/treeNodeApi.d.ts.map +1 -1
  1372. package/lib/simple-tree/treeNodeApi.js +8 -3
  1373. package/lib/simple-tree/treeNodeApi.js.map +1 -1
  1374. package/lib/simple-tree/types.d.ts +29 -9
  1375. package/lib/simple-tree/types.d.ts.map +1 -1
  1376. package/lib/simple-tree/types.js +78 -54
  1377. package/lib/simple-tree/types.js.map +1 -1
  1378. package/lib/simple-tree/typesUnsafe.d.ts +5 -5
  1379. package/lib/simple-tree/typesUnsafe.d.ts.map +1 -1
  1380. package/lib/simple-tree/typesUnsafe.js.map +1 -1
  1381. package/lib/treeFactory.d.ts +5 -5
  1382. package/lib/treeFactory.d.ts.map +1 -1
  1383. package/lib/treeFactory.js +10 -9
  1384. package/lib/treeFactory.js.map +1 -1
  1385. package/lib/util/brand.js +0 -1
  1386. package/lib/util/brand.js.map +1 -1
  1387. package/lib/util/brandedMap.d.ts +1 -1
  1388. package/lib/util/brandedMap.d.ts.map +1 -1
  1389. package/lib/util/brandedMap.js.map +1 -1
  1390. package/lib/util/nestedMap.d.ts +1 -1
  1391. package/lib/util/nestedMap.d.ts.map +1 -1
  1392. package/lib/util/nestedMap.js +4 -2
  1393. package/lib/util/nestedMap.js.map +1 -1
  1394. package/lib/util/nestedSet.d.ts +1 -1
  1395. package/lib/util/nestedSet.d.ts.map +1 -1
  1396. package/lib/util/nestedSet.js.map +1 -1
  1397. package/lib/util/offsetList.js +4 -2
  1398. package/lib/util/offsetList.js.map +1 -1
  1399. package/lib/util/referenceCounting.js +0 -1
  1400. package/lib/util/referenceCounting.js.map +1 -1
  1401. package/lib/util/stackyIterator.js +2 -3
  1402. package/lib/util/stackyIterator.js.map +1 -1
  1403. package/lib/util/typeboxBrand.d.ts +1 -1
  1404. package/lib/util/typeboxBrand.d.ts.map +1 -1
  1405. package/lib/util/typeboxBrand.js.map +1 -1
  1406. package/package.json +20 -20
  1407. package/src/codec/codec.ts +2 -2
  1408. package/src/codec/discriminatedUnions.ts +2 -2
  1409. package/src/codec/noopValidator.ts +1 -1
  1410. package/src/codec/versioned/codec.ts +4 -4
  1411. package/src/codec/versioned/format.ts +1 -1
  1412. package/src/core/change-family/changeFamily.ts +5 -5
  1413. package/src/core/change-family/editBuilder.ts +1 -1
  1414. package/src/core/forest/editableForest.ts +9 -9
  1415. package/src/core/forest/forest.ts +8 -8
  1416. package/src/core/rebase/changeRebaser.ts +1 -1
  1417. package/src/core/rebase/revisionTagCodec.ts +4 -4
  1418. package/src/core/rebase/types.ts +5 -5
  1419. package/src/core/rebase/utils.ts +6 -6
  1420. package/src/core/schema-stored/format.ts +2 -2
  1421. package/src/core/schema-stored/schema.ts +7 -7
  1422. package/src/core/schema-stored/storedSchemaRepository.ts +6 -6
  1423. package/src/core/schema-view/view.ts +1 -1
  1424. package/src/core/tree/anchorSet.ts +115 -23
  1425. package/src/core/tree/cursor.ts +3 -3
  1426. package/src/core/tree/delta.ts +3 -3
  1427. package/src/core/tree/deltaUtil.ts +4 -4
  1428. package/src/core/tree/detachedFieldIndex.ts +11 -11
  1429. package/src/core/tree/detachedFieldIndexCodec.ts +11 -7
  1430. package/src/core/tree/detachedFieldIndexFormat.ts +2 -2
  1431. package/src/core/tree/detachedFieldIndexTypes.ts +3 -3
  1432. package/src/core/tree/mapTree.ts +2 -2
  1433. package/src/core/tree/pathTree.ts +3 -3
  1434. package/src/core/tree/persistedTreeTextFormat.ts +1 -1
  1435. package/src/core/tree/sparseTree.ts +2 -2
  1436. package/src/core/tree/treeTextFormat.ts +2 -2
  1437. package/src/core/tree/types.ts +10 -4
  1438. package/src/core/tree/visitDelta.ts +8 -8
  1439. package/src/core/tree/visitPath.ts +2 -2
  1440. package/src/core/tree/visitorUtils.ts +9 -9
  1441. package/src/domains/json/jsonCursor.ts +5 -5
  1442. package/src/domains/json/jsonDomainSchema.ts +2 -2
  1443. package/src/domains/schemaBuilder.ts +9 -9
  1444. package/src/feature-libraries/changeAtomIdCodec.ts +2 -2
  1445. package/src/feature-libraries/chunked-forest/basicChunk.ts +9 -9
  1446. package/src/feature-libraries/chunked-forest/chunk.ts +4 -4
  1447. package/src/feature-libraries/chunked-forest/chunkTree.ts +12 -12
  1448. package/src/feature-libraries/chunked-forest/chunkedForest.ts +17 -17
  1449. package/src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts +3 -3
  1450. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +33 -17
  1451. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +12 -7
  1452. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +5 -5
  1453. package/src/feature-libraries/chunked-forest/codec/codecs.ts +14 -6
  1454. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +16 -16
  1455. package/src/feature-libraries/chunked-forest/codec/fieldBatch.ts +1 -1
  1456. package/src/feature-libraries/chunked-forest/codec/format.ts +1 -1
  1457. package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +1 -1
  1458. package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +19 -14
  1459. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncoding.ts +11 -11
  1460. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +10 -5
  1461. package/src/feature-libraries/chunked-forest/emptyChunk.ts +5 -5
  1462. package/src/feature-libraries/chunked-forest/sequenceChunk.ts +1 -1
  1463. package/src/feature-libraries/chunked-forest/uniformChunk.ts +8 -8
  1464. package/src/feature-libraries/contextuallyTyped.ts +12 -12
  1465. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +17 -17
  1466. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +11 -11
  1467. package/src/feature-libraries/default-schema/defaultSchema.ts +1 -1
  1468. package/src/feature-libraries/default-schema/noChangeCodecs.ts +2 -2
  1469. package/src/feature-libraries/deltaUtils.ts +7 -2
  1470. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +5 -5
  1471. package/src/feature-libraries/editableTreeBinder.ts +10 -10
  1472. package/src/feature-libraries/fieldGenerator.ts +2 -2
  1473. package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +32 -32
  1474. package/src/feature-libraries/flex-tree/context.ts +11 -11
  1475. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +15 -12
  1476. package/src/feature-libraries/flex-tree/index.ts +1 -1
  1477. package/src/feature-libraries/flex-tree/lazyEntity.ts +9 -4
  1478. package/src/feature-libraries/flex-tree/lazyField.ts +22 -22
  1479. package/src/feature-libraries/flex-tree/lazyNode.ts +32 -38
  1480. package/src/feature-libraries/flex-tree/treeEvents.ts +1 -38
  1481. package/src/feature-libraries/flex-tree/unboxed.ts +7 -7
  1482. package/src/feature-libraries/flex-tree/utilities.ts +2 -2
  1483. package/src/feature-libraries/forest-summary/codec.ts +7 -3
  1484. package/src/feature-libraries/forest-summary/forestSummarizer.ts +15 -15
  1485. package/src/feature-libraries/forest-summary/format.ts +1 -1
  1486. package/src/feature-libraries/index.ts +0 -2
  1487. package/src/feature-libraries/mapTreeCursor.ts +6 -6
  1488. package/src/feature-libraries/memoizedIdRangeAllocator.ts +3 -3
  1489. package/src/feature-libraries/mitigatedChangeFamily.ts +1 -1
  1490. package/src/feature-libraries/modular-schema/comparison.ts +6 -6
  1491. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +3 -3
  1492. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +7 -7
  1493. package/src/feature-libraries/modular-schema/fieldKind.ts +1 -1
  1494. package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +2 -2
  1495. package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +3 -3
  1496. package/src/feature-libraries/modular-schema/genericFieldKind.ts +10 -10
  1497. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +3 -3
  1498. package/src/feature-libraries/modular-schema/genericFieldKindFormat.ts +1 -1
  1499. package/src/feature-libraries/modular-schema/genericFieldKindTypes.ts +1 -1
  1500. package/src/feature-libraries/modular-schema/isNeverTree.ts +4 -4
  1501. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +25 -20
  1502. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +34 -34
  1503. package/src/feature-libraries/modular-schema/modularChangeFormat.ts +3 -3
  1504. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +3 -3
  1505. package/src/feature-libraries/node-key/mockNodeKeyManager.ts +2 -2
  1506. package/src/feature-libraries/node-key/nodeKey.ts +3 -3
  1507. package/src/feature-libraries/node-key/nodeKeyIndex.ts +4 -4
  1508. package/src/feature-libraries/node-key/nodeKeyManager.ts +1 -1
  1509. package/src/feature-libraries/object-forest/objectForest.ts +22 -22
  1510. package/src/feature-libraries/optional-field/optionalField.ts +20 -20
  1511. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV1.ts +1 -1
  1512. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV2.ts +1 -1
  1513. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +2 -2
  1514. package/src/feature-libraries/optional-field/optionalFieldCodecV1.ts +4 -4
  1515. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +4 -4
  1516. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +2 -2
  1517. package/src/feature-libraries/schema-aware/schemaAware.ts +8 -4
  1518. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +3 -3
  1519. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +1 -1
  1520. package/src/feature-libraries/schema-edits/schemaChangeTypes.ts +1 -1
  1521. package/src/feature-libraries/schema-index/codec.ts +8 -4
  1522. package/src/feature-libraries/schema-index/format.ts +1 -1
  1523. package/src/feature-libraries/schema-index/schemaSummarizer.ts +11 -7
  1524. package/src/feature-libraries/schemaBuilder.ts +2 -2
  1525. package/src/feature-libraries/schemaBuilderBase.ts +12 -12
  1526. package/src/feature-libraries/sequence-field/compose.ts +18 -18
  1527. package/src/feature-libraries/sequence-field/formatV1.ts +1 -1
  1528. package/src/feature-libraries/sequence-field/formatV2.ts +1 -1
  1529. package/src/feature-libraries/sequence-field/helperTypes.ts +1 -1
  1530. package/src/feature-libraries/sequence-field/invert.ts +14 -14
  1531. package/src/feature-libraries/sequence-field/markListFactory.ts +1 -1
  1532. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1533. package/src/feature-libraries/sequence-field/moveEffectTable.ts +5 -5
  1534. package/src/feature-libraries/sequence-field/prune.ts +2 -2
  1535. package/src/feature-libraries/sequence-field/rebase.ts +18 -18
  1536. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +3 -3
  1537. package/src/feature-libraries/sequence-field/replaceRevisions.ts +7 -7
  1538. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +3 -3
  1539. package/src/feature-libraries/sequence-field/sequenceFieldChangeRebaser.ts +2 -2
  1540. package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +17 -17
  1541. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +16 -16
  1542. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +4 -4
  1543. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +12 -3
  1544. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +7 -7
  1545. package/src/feature-libraries/sequence-field/types.ts +2 -2
  1546. package/src/feature-libraries/sequence-field/utils.ts +25 -25
  1547. package/src/feature-libraries/storedToViewSchema.ts +7 -7
  1548. package/src/feature-libraries/treeCursorUtils.ts +8 -8
  1549. package/src/feature-libraries/treeTextCursor.ts +10 -6
  1550. package/src/feature-libraries/typed-schema/schemaCollection.ts +11 -6
  1551. package/src/feature-libraries/typed-schema/typedTreeSchema.ts +16 -16
  1552. package/src/feature-libraries/typed-schema/view.ts +8 -8
  1553. package/src/feature-libraries/valueUtilities.ts +2 -2
  1554. package/src/index.ts +0 -1
  1555. package/src/packageVersion.ts +1 -1
  1556. package/src/shared-tree/schematizeTree.ts +7 -7
  1557. package/src/shared-tree/schematizingTreeView.ts +19 -16
  1558. package/src/shared-tree/sharedTree.ts +28 -16
  1559. package/src/shared-tree/sharedTreeChangeCodecs.ts +11 -8
  1560. package/src/shared-tree/sharedTreeChangeEnricher.ts +8 -8
  1561. package/src/shared-tree/sharedTreeChangeFamily.ts +21 -15
  1562. package/src/shared-tree/sharedTreeChangeFormat.ts +1 -1
  1563. package/src/shared-tree/sharedTreeChangeTypes.ts +1 -1
  1564. package/src/shared-tree/sharedTreeEditBuilder.ts +4 -4
  1565. package/src/shared-tree/treeApi.ts +5 -5
  1566. package/src/shared-tree/treeCheckout.ts +28 -23
  1567. package/src/shared-tree/treeView.ts +8 -8
  1568. package/src/shared-tree-core/branch.ts +8 -8
  1569. package/src/shared-tree-core/branchCommitEnricher.ts +2 -2
  1570. package/src/shared-tree-core/changeEnricher.ts +1 -1
  1571. package/src/shared-tree-core/defaultResubmitMachine.ts +2 -2
  1572. package/src/shared-tree-core/editManager.ts +8 -8
  1573. package/src/shared-tree-core/editManagerCodecs.ts +13 -8
  1574. package/src/shared-tree-core/editManagerFormat.ts +5 -5
  1575. package/src/shared-tree-core/editManagerSummarizer.ts +13 -9
  1576. package/src/shared-tree-core/messageCodecs.ts +7 -7
  1577. package/src/shared-tree-core/messageFormat.ts +4 -4
  1578. package/src/shared-tree-core/messageTypes.ts +2 -2
  1579. package/src/shared-tree-core/resubmitMachine.ts +1 -1
  1580. package/src/shared-tree-core/sequenceIdUtils.ts +1 -1
  1581. package/src/shared-tree-core/sharedTreeCore.ts +20 -20
  1582. package/src/shared-tree-core/transactionEnricher.ts +2 -2
  1583. package/src/shared-tree-core/transactionStack.ts +1 -1
  1584. package/src/simple-tree/arrayNode.ts +32 -28
  1585. package/src/simple-tree/leafNodeSchema.ts +4 -4
  1586. package/src/simple-tree/mapNode.ts +10 -10
  1587. package/src/simple-tree/nodeKeys.ts +2 -2
  1588. package/src/simple-tree/objectNode.ts +18 -18
  1589. package/src/simple-tree/proxies.ts +21 -27
  1590. package/src/simple-tree/proxyBinding.ts +14 -14
  1591. package/src/simple-tree/schemaCaching.ts +5 -5
  1592. package/src/simple-tree/schemaCreationUtilities.ts +5 -5
  1593. package/src/simple-tree/schemaFactory.ts +39 -22
  1594. package/src/simple-tree/schemaFactoryRecursive.ts +13 -13
  1595. package/src/simple-tree/schemaTypes.ts +8 -8
  1596. package/src/simple-tree/testRecursiveDomain.ts +1 -1
  1597. package/src/simple-tree/toFlexSchema.ts +13 -13
  1598. package/src/simple-tree/toMapTree.ts +4 -4
  1599. package/src/simple-tree/tree.ts +6 -31
  1600. package/src/simple-tree/treeNodeApi.ts +45 -33
  1601. package/src/simple-tree/types.ts +60 -12
  1602. package/src/simple-tree/typesUnsafe.ts +6 -6
  1603. package/src/treeFactory.ts +5 -5
  1604. package/src/util/brandedMap.ts +1 -1
  1605. package/src/util/nestedMap.ts +1 -1
  1606. package/src/util/nestedSet.ts +1 -1
  1607. package/src/util/typeboxBrand.ts +1 -1
@@ -2,13 +2,13 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { ICodecOptions } from "../../codec/index.js";
6
- import { Brand, IdAllocator, JsonCompatibleReadOnly } from "../../util/index.js";
7
- import { RevisionTagCodec } from "../rebase/index.js";
8
- import { FieldKey } from "../schema-stored/index.js";
9
- import * as Delta from "./delta.js";
10
- import { Major } from "./detachedFieldIndexTypes.js";
11
- import { IIdCompressor } from "@fluidframework/id-compressor";
5
+ import { type ICodecOptions } from "../../codec/index.js";
6
+ import { type Brand, type IdAllocator, type JsonCompatibleReadOnly } from "../../util/index.js";
7
+ import type { RevisionTagCodec } from "../rebase/index.js";
8
+ import type { FieldKey } from "../schema-stored/index.js";
9
+ import type * as Delta from "./delta.js";
10
+ import type { Major } from "./detachedFieldIndexTypes.js";
11
+ import type { IIdCompressor } from "@fluidframework/id-compressor";
12
12
  /**
13
13
  * ID used to create a detached field key for a removed subtree.
14
14
  *
@@ -1 +1 @@
1
- {"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_1 = require("./detachedFieldIndexCodec.js");
13
13
  * The tree index records detached field IDs and associates them with a change atom ID.
14
14
  */
15
15
  class DetachedFieldIndex {
16
- name;
17
- rootIdAllocator;
18
- revisionTagCodec;
19
- idCompressor;
20
- // TODO: don't store the field key in the index, it can be derived from the root ID
21
- detachedNodeToField = new Map();
22
- codec;
23
- options;
24
16
  /**
25
17
  * @param name - A name for the index, used as a prefix for the generated field keys.
26
18
  * @param rootIdAllocator - An ID allocator used to generate unique field keys.
@@ -30,6 +22,8 @@ class DetachedFieldIndex {
30
22
  this.rootIdAllocator = rootIdAllocator;
31
23
  this.revisionTagCodec = revisionTagCodec;
32
24
  this.idCompressor = idCompressor;
25
+ // TODO: don't store the field key in the index, it can be derived from the root ID
26
+ this.detachedNodeToField = new Map();
33
27
  this.options = options ?? { jsonValidator: index_js_1.noopValidator };
34
28
  this.codec = (0, detachedFieldIndexCodec_js_1.makeDetachedNodeToFieldCodec)(revisionTagCodec, this.options, idCompressor);
35
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"detachedFieldIndex.js","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndex.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,mDAAgF;AAChF,kDAW6B;AAK7B,6EAA4E;AAa5E;;GAEG;AACH,MAAa,kBAAkB;IAWZ;IACT;IACS;IACA;IAblB,mFAAmF;IAC3E,mBAAmB,GAA0C,IAAI,GAAG,EAAE,CAAC;IAC9D,KAAK,CAA+C;IACpD,OAAO,CAAgB;IAExC;;;OAGG;IACH,YACkB,IAAY,EACrB,eAA0C,EACjC,gBAAkC,EAClC,YAA2B,EAC5C,OAAuB;QAJN,SAAI,GAAJ,IAAI,CAAQ;QACrB,oBAAe,GAAf,eAAe,CAA2B;QACjC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,iBAAY,GAAZ,YAAY,CAAe;QAG5C,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE,aAAa,EAA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IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAC,IAAI,CAAC;IACpD,CAAC;CACD;AA/ID,gDA+IC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { ICodecOptions, IJsonCodec, noopValidator } from \"../../codec/index.js\";\nimport {\n\tBrand,\n\tIdAllocator,\n\tJsonCompatibleReadOnly,\n\tNestedMap,\n\tbrand,\n\tdeleteFromNestedMap,\n\tidAllocatorFromMaxId,\n\tpopulateNestedMap,\n\tsetInNestedMap,\n\ttryGetFromNestedMap,\n} from \"../../util/index.js\";\nimport { RevisionTagCodec } from \"../rebase/index.js\";\nimport { FieldKey } from \"../schema-stored/index.js\";\n\nimport * as Delta from \"./delta.js\";\nimport { makeDetachedNodeToFieldCodec } from \"./detachedFieldIndexCodec.js\";\nimport { Format } from \"./detachedFieldIndexFormat.js\";\nimport { DetachedFieldSummaryData, Major, Minor } from \"./detachedFieldIndexTypes.js\";\nimport { IIdCompressor } from \"@fluidframework/id-compressor\";\n\n/**\n * ID used to create a detached field key for a removed subtree.\n *\n * TODO: Move to Forest once forests can support multiple roots.\n * @internal\n */\nexport type ForestRootId = Brand<number, \"tree.ForestRootId\">;\n\n/**\n * The tree index records detached field IDs and associates them with a change atom ID.\n */\nexport class DetachedFieldIndex {\n\t// TODO: don't store the field key in the index, it can be derived from the root ID\n\tprivate detachedNodeToField: NestedMap<Major, Minor, ForestRootId> = new Map();\n\tprivate readonly codec: IJsonCodec<DetachedFieldSummaryData, Format>;\n\tprivate readonly options: ICodecOptions;\n\n\t/**\n\t * @param name - A name for the index, used as a prefix for the generated field keys.\n\t * @param rootIdAllocator - An ID allocator used to generate unique field keys.\n\t */\n\tpublic constructor(\n\t\tprivate readonly name: string,\n\t\tprivate rootIdAllocator: IdAllocator<ForestRootId>,\n\t\tprivate readonly revisionTagCodec: RevisionTagCodec,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t\toptions?: ICodecOptions,\n\t) {\n\t\tthis.options = options ?? { jsonValidator: noopValidator };\n\t\tthis.codec = makeDetachedNodeToFieldCodec(revisionTagCodec, this.options, idCompressor);\n\t}\n\n\tpublic clone(): DetachedFieldIndex {\n\t\tconst clone = new DetachedFieldIndex(\n\t\t\tthis.name,\n\t\t\tidAllocatorFromMaxId(this.rootIdAllocator.getMaxId()) as IdAllocator<ForestRootId>,\n\t\t\tthis.revisionTagCodec,\n\t\t\tthis.idCompressor,\n\t\t\tthis.options,\n\t\t);\n\t\tpopulateNestedMap(this.detachedNodeToField, clone.detachedNodeToField, true);\n\t\treturn clone;\n\t}\n\n\tpublic *entries(): Generator<{ root: ForestRootId } & { id: Delta.DetachedNodeId }> {\n\t\tfor (const [major, innerMap] of this.detachedNodeToField) {\n\t\t\tif (major !== undefined) {\n\t\t\t\tfor (const [minor, entry] of innerMap) {\n\t\t\t\t\tyield { id: { major, minor }, root: entry };\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const [minor, entry] of innerMap) {\n\t\t\t\t\tyield { id: { minor }, root: entry };\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Removes all entries from the index.\n\t */\n\tpublic purge(): void {\n\t\tthis.detachedNodeToField.clear();\n\t}\n\n\tpublic updateMajor(current: Major, updated: Major): void {\n\t\tconst innerCurrent = this.detachedNodeToField.get(current);\n\t\tif (innerCurrent !== undefined) {\n\t\t\tthis.detachedNodeToField.delete(current);\n\t\t\tconst innerUpdated = this.detachedNodeToField.get(updated);\n\t\t\tif (innerUpdated === undefined) {\n\t\t\t\tthis.detachedNodeToField.set(updated, innerCurrent);\n\t\t\t} else {\n\t\t\t\tfor (const [minor, entry] of innerCurrent) {\n\t\t\t\t\tassert(\n\t\t\t\t\t\tinnerUpdated.get(minor) === undefined,\n\t\t\t\t\t\t0x7a9 /* Collision during index update */,\n\t\t\t\t\t);\n\t\t\t\t\tinnerUpdated.set(minor, entry);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns a field key for the given ID.\n\t * This does not save the field key on the index. To do so, call {@link createEntry}.\n\t */\n\tpublic toFieldKey(id: ForestRootId): FieldKey {\n\t\treturn brand(`${this.name}-${id}`);\n\t}\n\n\t/**\n\t * Returns the FieldKey associated with the given id.\n\t * Returns undefined if no such id is known to the index.\n\t */\n\tpublic tryGetEntry(id: Delta.DetachedNodeId): ForestRootId | undefined {\n\t\treturn tryGetFromNestedMap(this.detachedNodeToField, id.major, id.minor);\n\t}\n\n\t/**\n\t * Returns the FieldKey associated with the given id.\n\t * Fails if no such id is known to the index.\n\t */\n\tpublic getEntry(id: Delta.DetachedNodeId): ForestRootId {\n\t\tconst key = this.tryGetEntry(id);\n\t\tassert(key !== undefined, 0x7aa /* Unknown removed node ID */);\n\t\treturn key;\n\t}\n\n\tpublic deleteEntry(nodeId: Delta.DetachedNodeId): void {\n\t\tconst found = deleteFromNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor);\n\t\tassert(found, 0x7ab /* Unable to delete unknown entry */);\n\t}\n\n\t/**\n\t * Associates the DetachedNodeId with a field key and creates an entry for it in the index.\n\t */\n\tpublic createEntry(nodeId?: Delta.DetachedNodeId, count: number = 1): ForestRootId {\n\t\tconst root = this.rootIdAllocator.allocate(count);\n\t\tif (nodeId !== undefined) {\n\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\tassert(\n\t\t\t\t\ttryGetFromNestedMap(\n\t\t\t\t\t\tthis.detachedNodeToField,\n\t\t\t\t\t\tnodeId.major,\n\t\t\t\t\t\tnodeId.minor + i,\n\t\t\t\t\t) === undefined,\n\t\t\t\t\t0x7ce /* Detached node ID already exists in index */,\n\t\t\t\t);\n\t\t\t\tsetInNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor + i, root + i);\n\t\t\t}\n\t\t}\n\t\treturn root;\n\t}\n\n\tpublic encode(): JsonCompatibleReadOnly {\n\t\treturn this.codec.encode({\n\t\t\tdata: this.detachedNodeToField,\n\t\t\tmaxId: this.rootIdAllocator.getMaxId(),\n\t\t}) as JsonCompatibleReadOnly;\n\t}\n\n\t/**\n\t * Loads the tree index from the given string, this overrides any existing data.\n\t */\n\tpublic loadData(data: JsonCompatibleReadOnly): void {\n\t\tconst detachedFieldIndex: DetachedFieldSummaryData = this.codec.decode(data as Format);\n\n\t\tthis.rootIdAllocator = idAllocatorFromMaxId(\n\t\t\tdetachedFieldIndex.maxId,\n\t\t) as IdAllocator<ForestRootId>;\n\t\tthis.detachedNodeToField = detachedFieldIndex.data;\n\t}\n}\n"]}
1
+ {"version":3,"file":"detachedFieldIndex.js","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndex.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,mDAA0F;AAC1F,kDAW6B;AAK7B,6EAA4E;AAa5E;;GAEG;AACH,MAAa,kBAAkB;IAM9B;;;OAGG;IACH,YACkB,IAAY,EACrB,eAA0C,EACjC,gBAAkC,EAClC,YAA2B,EAC5C,OAAuB;QAJN,SAAI,GAAJ,IAAI,CAAQ;QACrB,oBAAe,GAAf,eAAe,CAA2B;QACjC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,iBAAY,GAAZ,YAAY,CAAe;QAb7C,mFAAmF;QAC3E,wBAAmB,GAA0C,IAAI,GAAG,EAAE,CAAC;QAe9E,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE,aAAa,EAAE,wBAAa,EAAE,CAAC;QAC3D,IAAI,CAAC,KAAK,GAAG,IAAA,yDAA4B,EAAC,gBAAgB,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACzF,CAAC;IAEM,KAAK;QACX,MAAM,KAAK,GAAG,IAAI,kBAAkB,CACnC,IAAI,CAAC,IAAI,EACT,IAAA,+BAAoB,EAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,CAA8B,EAClF,IAAI,CA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,KAAK,CAAC,CAAC;QAClD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;gBAChC,IAAA,iBAAM,EACL,IAAA,8BAAmB,EAClB,IAAI,CAAC,mBAAmB,EACxB,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,KAAK,GAAG,CAAC,CAChB,KAAK,SAAS,EACf,KAAK,CAAC,8CAA8C,CACpD,CAAC;gBACF,IAAA,yBAAc,EAAC,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC;YACpF,CAAC;QACF,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,MAAM;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YACxB,IAAI,EAAE,IAAI,CAAC,mBAAmB;YAC9B,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;SACtC,CAA2B,CAAC;IAC9B,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,IAA4B;QAC3C,MAAM,kBAAkB,GAA6B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAc,CAAC,CAAC;QAEvF,IAAI,CAAC,eAAe,GAAG,IAAA,+BAAoB,EAC1C,kBAAkB,CAAC,KAAK,CACK,CAAC;QAC/B,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAC,IAAI,CAAC;IACpD,CAAC;CACD;AA/ID,gDA+IC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { type ICodecOptions, type IJsonCodec, noopValidator } from \"../../codec/index.js\";\nimport {\n\ttype Brand,\n\ttype IdAllocator,\n\ttype JsonCompatibleReadOnly,\n\ttype NestedMap,\n\tbrand,\n\tdeleteFromNestedMap,\n\tidAllocatorFromMaxId,\n\tpopulateNestedMap,\n\tsetInNestedMap,\n\ttryGetFromNestedMap,\n} from \"../../util/index.js\";\nimport type { RevisionTagCodec } from \"../rebase/index.js\";\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type * as Delta from \"./delta.js\";\nimport { makeDetachedNodeToFieldCodec } from \"./detachedFieldIndexCodec.js\";\nimport type { Format } from \"./detachedFieldIndexFormat.js\";\nimport type { DetachedFieldSummaryData, Major, Minor } from \"./detachedFieldIndexTypes.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\n/**\n * ID used to create a detached field key for a removed subtree.\n *\n * TODO: Move to Forest once forests can support multiple roots.\n * @internal\n */\nexport type ForestRootId = Brand<number, \"tree.ForestRootId\">;\n\n/**\n * The tree index records detached field IDs and associates them with a change atom ID.\n */\nexport class DetachedFieldIndex {\n\t// TODO: don't store the field key in the index, it can be derived from the root ID\n\tprivate detachedNodeToField: NestedMap<Major, Minor, ForestRootId> = new Map();\n\tprivate readonly codec: IJsonCodec<DetachedFieldSummaryData, Format>;\n\tprivate readonly options: ICodecOptions;\n\n\t/**\n\t * @param name - A name for the index, used as a prefix for the generated field keys.\n\t * @param rootIdAllocator - An ID allocator used to generate unique field keys.\n\t */\n\tpublic constructor(\n\t\tprivate readonly name: string,\n\t\tprivate rootIdAllocator: IdAllocator<ForestRootId>,\n\t\tprivate readonly revisionTagCodec: RevisionTagCodec,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t\toptions?: ICodecOptions,\n\t) {\n\t\tthis.options = options ?? { jsonValidator: noopValidator };\n\t\tthis.codec = makeDetachedNodeToFieldCodec(revisionTagCodec, this.options, idCompressor);\n\t}\n\n\tpublic clone(): DetachedFieldIndex {\n\t\tconst clone = new DetachedFieldIndex(\n\t\t\tthis.name,\n\t\t\tidAllocatorFromMaxId(this.rootIdAllocator.getMaxId()) as IdAllocator<ForestRootId>,\n\t\t\tthis.revisionTagCodec,\n\t\t\tthis.idCompressor,\n\t\t\tthis.options,\n\t\t);\n\t\tpopulateNestedMap(this.detachedNodeToField, clone.detachedNodeToField, true);\n\t\treturn clone;\n\t}\n\n\tpublic *entries(): Generator<{ root: ForestRootId } & { id: Delta.DetachedNodeId }> {\n\t\tfor (const [major, innerMap] of this.detachedNodeToField) {\n\t\t\tif (major !== undefined) {\n\t\t\t\tfor (const [minor, entry] of innerMap) {\n\t\t\t\t\tyield { id: { major, minor }, root: entry };\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const [minor, entry] of innerMap) {\n\t\t\t\t\tyield { id: { minor }, root: entry };\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Removes all entries from the index.\n\t */\n\tpublic purge(): void {\n\t\tthis.detachedNodeToField.clear();\n\t}\n\n\tpublic updateMajor(current: Major, updated: Major): void {\n\t\tconst innerCurrent = this.detachedNodeToField.get(current);\n\t\tif (innerCurrent !== undefined) {\n\t\t\tthis.detachedNodeToField.delete(current);\n\t\t\tconst innerUpdated = this.detachedNodeToField.get(updated);\n\t\t\tif (innerUpdated === undefined) {\n\t\t\t\tthis.detachedNodeToField.set(updated, innerCurrent);\n\t\t\t} else {\n\t\t\t\tfor (const [minor, entry] of innerCurrent) {\n\t\t\t\t\tassert(\n\t\t\t\t\t\tinnerUpdated.get(minor) === undefined,\n\t\t\t\t\t\t0x7a9 /* Collision during index update */,\n\t\t\t\t\t);\n\t\t\t\t\tinnerUpdated.set(minor, entry);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns a field key for the given ID.\n\t * This does not save the field key on the index. To do so, call {@link createEntry}.\n\t */\n\tpublic toFieldKey(id: ForestRootId): FieldKey {\n\t\treturn brand(`${this.name}-${id}`);\n\t}\n\n\t/**\n\t * Returns the FieldKey associated with the given id.\n\t * Returns undefined if no such id is known to the index.\n\t */\n\tpublic tryGetEntry(id: Delta.DetachedNodeId): ForestRootId | undefined {\n\t\treturn tryGetFromNestedMap(this.detachedNodeToField, id.major, id.minor);\n\t}\n\n\t/**\n\t * Returns the FieldKey associated with the given id.\n\t * Fails if no such id is known to the index.\n\t */\n\tpublic getEntry(id: Delta.DetachedNodeId): ForestRootId {\n\t\tconst key = this.tryGetEntry(id);\n\t\tassert(key !== undefined, 0x7aa /* Unknown removed node ID */);\n\t\treturn key;\n\t}\n\n\tpublic deleteEntry(nodeId: Delta.DetachedNodeId): void {\n\t\tconst found = deleteFromNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor);\n\t\tassert(found, 0x7ab /* Unable to delete unknown entry */);\n\t}\n\n\t/**\n\t * Associates the DetachedNodeId with a field key and creates an entry for it in the index.\n\t */\n\tpublic createEntry(nodeId?: Delta.DetachedNodeId, count: number = 1): ForestRootId {\n\t\tconst root = this.rootIdAllocator.allocate(count);\n\t\tif (nodeId !== undefined) {\n\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\tassert(\n\t\t\t\t\ttryGetFromNestedMap(\n\t\t\t\t\t\tthis.detachedNodeToField,\n\t\t\t\t\t\tnodeId.major,\n\t\t\t\t\t\tnodeId.minor + i,\n\t\t\t\t\t) === undefined,\n\t\t\t\t\t0x7ce /* Detached node ID already exists in index */,\n\t\t\t\t);\n\t\t\t\tsetInNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor + i, root + i);\n\t\t\t}\n\t\t}\n\t\treturn root;\n\t}\n\n\tpublic encode(): JsonCompatibleReadOnly {\n\t\treturn this.codec.encode({\n\t\t\tdata: this.detachedNodeToField,\n\t\t\tmaxId: this.rootIdAllocator.getMaxId(),\n\t\t}) as JsonCompatibleReadOnly;\n\t}\n\n\t/**\n\t * Loads the tree index from the given string, this overrides any existing data.\n\t */\n\tpublic loadData(data: JsonCompatibleReadOnly): void {\n\t\tconst detachedFieldIndex: DetachedFieldSummaryData = this.codec.decode(data as Format);\n\n\t\tthis.rootIdAllocator = idAllocatorFromMaxId(\n\t\t\tdetachedFieldIndex.maxId,\n\t\t) as IdAllocator<ForestRootId>;\n\t\tthis.detachedNodeToField = detachedFieldIndex.data;\n\t}\n}\n"]}
@@ -2,10 +2,10 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { ICodecOptions, IJsonCodec } from "../../codec/index.js";
6
- import { RevisionTagCodec } from "../rebase/index.js";
5
+ import { type ICodecOptions, type IJsonCodec } from "../../codec/index.js";
6
+ import type { RevisionTagCodec } from "../rebase/index.js";
7
7
  import { Format } from "./detachedFieldIndexFormat.js";
8
- import { DetachedFieldSummaryData } from "./detachedFieldIndexTypes.js";
9
- import { IIdCompressor } from "@fluidframework/id-compressor";
8
+ import type { DetachedFieldSummaryData } from "./detachedFieldIndexTypes.js";
9
+ import type { IIdCompressor } from "@fluidframework/id-compressor";
10
10
  export declare function makeDetachedNodeToFieldCodec(revisionTagCodec: RevisionTagCodec, options: ICodecOptions, idCompressor: IIdCompressor): IJsonCodec<DetachedFieldSummaryData, Format>;
11
11
  //# sourceMappingURL=detachedFieldIndexCodec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"detachedFieldIndexCodec.d.ts","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndexCodec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAE,UAAU,EAA+B,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EAAsB,gBAAgB,EAAoB,MAAM,oBAAoB,CAAC;AAG5F,OAAO,EAEN,MAAM,EAGN,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAS,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AA6C9D,wBAAgB,4BAA4B,CAC3C,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,aAAa,GACzB,UAAU,CAAC,wBAAwB,EAAE,MAAM,CAAC,CA2C9C"}
1
+ {"version":3,"file":"detachedFieldIndexCodec.d.ts","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndexCodec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,UAAU,EAEf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAsB,gBAAgB,EAAe,MAAM,oBAAoB,CAAC;AAG5F,OAAO,EAEN,MAAM,EAGN,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,wBAAwB,EAAS,MAAM,8BAA8B,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AA6CnE,wBAAgB,4BAA4B,CAC3C,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,aAAa,GACzB,UAAU,CAAC,wBAAwB,EAAE,MAAM,CAAC,CA2C9C"}
@@ -9,9 +9,6 @@ const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../../codec/index.js");
10
10
  const detachedFieldIndexFormat_js_1 = require("./detachedFieldIndexFormat.js");
11
11
  class MajorCodec {
12
- revisionTagCodec;
13
- options;
14
- idCompressor;
15
12
  constructor(revisionTagCodec, options, idCompressor) {
16
13
  this.revisionTagCodec = revisionTagCodec;
17
14
  this.options = options;
@@ -1 +1 @@
1
- {"version":3,"file":"detachedFieldIndexCodec.js","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndexCodec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,mDAA8F;AAI9F,+EAKuC;AAIvC,MAAM,UAAU;IAEG;IACA;IACA;IAHlB,YACkB,gBAAkC,EAClC,OAAsB,EACtB,YAA2B;QAF3B,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,YAAO,GAAP,OAAO,CAAe;QACtB,iBAAY,GAAZ,YAAY,CAAe;IA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D,CAAC,CAAC;AACJ,CAAC;AA/CD,oEA+CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { ICodecOptions, IJsonCodec, makeVersionedValidatedCodec } from \"../../codec/index.js\";\nimport { EncodedRevisionTag, RevisionTagCodec, type RevisionTag } from \"../rebase/index.js\";\n\nimport { ForestRootId } from \"./detachedFieldIndex.js\";\nimport {\n\tEncodedRootsForRevision,\n\tFormat,\n\tRootRanges,\n\tversion,\n} from \"./detachedFieldIndexFormat.js\";\nimport { DetachedFieldSummaryData, Major } from \"./detachedFieldIndexTypes.js\";\nimport { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nclass MajorCodec implements IJsonCodec<Major> {\n\tpublic constructor(\n\t\tprivate readonly revisionTagCodec: RevisionTagCodec,\n\t\tprivate readonly options: ICodecOptions,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t) {}\n\n\tpublic encode(major: Major): EncodedRevisionTag {\n\t\tassert(major !== undefined, 0x88e /* Unexpected undefined revision */);\n\t\tconst id = this.revisionTagCodec.encode(major);\n\t\t/**\n\t\t * Preface: this codec is only used at summarization time (not for ops).\n\t\t * Note that the decode path must provide a session id in which to interpret the revision tag.\n\t\t * The revision associated with a detached root generally comes from the session which detaches that subtree,\n\t\t * which isn't generally the local session (nor is it available at decode time with the layering of the tree\n\t\t * package), despite decode using the local session id.\n\t\t *\n\t\t * This is made OK by enforcing that all ids on encode/decode are non-local, since local ids won't be interpretable\n\t\t * at decode time.\n\t\t * This assert is valid because the revision for an acked edit will have already been finalized, and a revision\n\t\t * for a local-only edit will be finalizable at summarization time (local edits can only occur on a summarizing client\n\t\t * if they're created while detached, and local ids made while detached are finalized before generating the attach summary).\n\t\t */\n\t\tassert(\n\t\t\tid === \"root\" || id >= 0,\n\t\t\t0x88f /* Expected final id on encode of detached field index revision */,\n\t\t);\n\t\treturn id;\n\t}\n\n\tpublic decode(major: EncodedRevisionTag): RevisionTag {\n\t\tassert(\n\t\t\tmajor === \"root\" || major >= 0,\n\t\t\t0x890 /* Expected final id on decode of detached field index revision */,\n\t\t);\n\t\treturn this.revisionTagCodec.decode(major, {\n\t\t\toriginatorId: this.revisionTagCodec.localSessionId,\n\t\t\tidCompressor: this.idCompressor,\n\t\t\trevision: undefined,\n\t\t});\n\t}\n}\n\nexport function makeDetachedNodeToFieldCodec(\n\trevisionTagCodec: RevisionTagCodec,\n\toptions: ICodecOptions,\n\tidCompressor: IIdCompressor,\n): IJsonCodec<DetachedFieldSummaryData, Format> {\n\tconst majorCodec = new MajorCodec(revisionTagCodec, options, idCompressor);\n\treturn makeVersionedValidatedCodec(options, new Set([version]), Format, {\n\t\tencode: (data: DetachedFieldSummaryData): Format => {\n\t\t\tconst rootsForRevisions: EncodedRootsForRevision[] = [];\n\t\t\tfor (const [major, innerMap] of data.data) {\n\t\t\t\tconst encodedRevision = majorCodec.encode(major);\n\t\t\t\tconst rootRanges: RootRanges = [...innerMap];\n\t\t\t\tif (rootRanges.length === 1) {\n\t\t\t\t\tconst rootsForRevision: EncodedRootsForRevision = [\n\t\t\t\t\t\tencodedRevision,\n\t\t\t\t\t\trootRanges[0][0],\n\t\t\t\t\t\trootRanges[0][1],\n\t\t\t\t\t];\n\t\t\t\t\trootsForRevisions.push(rootsForRevision);\n\t\t\t\t} else {\n\t\t\t\t\tconst rootsForRevision: EncodedRootsForRevision = [encodedRevision, rootRanges];\n\t\t\t\t\trootsForRevisions.push(rootsForRevision);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst encoded: Format = {\n\t\t\t\tversion,\n\t\t\t\tdata: rootsForRevisions,\n\t\t\t\tmaxId: data.maxId,\n\t\t\t};\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (parsed: Format): DetachedFieldSummaryData => {\n\t\t\tconst map = new Map();\n\t\t\tfor (const rootsForRevision of parsed.data) {\n\t\t\t\tconst innerMap = new Map<number, ForestRootId>(\n\t\t\t\t\trootsForRevision.length === 2\n\t\t\t\t\t\t? rootsForRevision[1]\n\t\t\t\t\t\t: [[rootsForRevision[1], rootsForRevision[2]]],\n\t\t\t\t);\n\t\t\t\tmap.set(majorCodec.decode(rootsForRevision[0]), innerMap);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tdata: map,\n\t\t\t\tmaxId: parsed.maxId,\n\t\t\t};\n\t\t},\n\t});\n}\n"]}
1
+ {"version":3,"file":"detachedFieldIndexCodec.js","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndexCodec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,mDAI8B;AAI9B,+EAKuC;AAIvC,MAAM,UAAU;IACf,YACkB,gBAAkC,EAClC,OAAsB,EACtB,YAA2B;QAF3B,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,YAAO,GAAP,OAAO,CAAe;QACtB,iBAAY,GAAZ,YAAY,CAAe;IAC1C,CAAC;IAEG,MAAM,CAAC,KAAY;QACzB,IAAA,iBAAM,EAAC,KAAK,KAAK,SAAS,EAAE,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACvE,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC/C;;;;;;;;;;;;WAYG;QACH,IAAA,iBAAM,EACL,EAAE,KAAK,MAAM,IAAI,EAAE,IAAI,CAAC,EACxB,KAAK,CAAC,kEAAkE,CACxE,CAAC;QACF,OAAO,EAAE,CAAC;IACX,CAAC;IAEM,MAAM,CAAC,KAAyB;QACtC,IAAA,iBAAM,EACL,KAAK,KAAK,MAAM,IAAI,KAAK,IAAI,CAAC,EAC9B,KAAK,CAAC,kEAAkE,CACxE,CAAC;QACF,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,EAAE;YAC1C,YAAY,EAAE,IAAI,CAAC,gBAAgB,CAAC,cAAc;YAClD,YAAY,EAAE,IAAI,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AAE,CAAC,MAAc,EAA4B,EAAE;YACpD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;YACtB,KAAK,MAAM,gBAAgB,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;gBAC5C,MAAM,QAAQ,GAAG,IAAI,GAAG,CACvB,gBAAgB,CAAC,MAAM,KAAK,CAAC;oBAC5B,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;oBACrB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAC/C,CAAC;gBACF,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;YAC3D,CAAC;YACD,OAAO;gBACN,IAAI,EAAE,GAAG;gBACT,KAAK,EAAE,MAAM,CAAC,KAAK;aACnB,CAAC;QACH,CAAC;KACD,CAAC,CAAC;AACJ,CAAC;AA/CD,oEA+CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeVersionedValidatedCodec,\n} from \"../../codec/index.js\";\nimport type { EncodedRevisionTag, RevisionTagCodec, RevisionTag } from \"../rebase/index.js\";\n\nimport type { ForestRootId } from \"./detachedFieldIndex.js\";\nimport {\n\ttype EncodedRootsForRevision,\n\tFormat,\n\ttype RootRanges,\n\tversion,\n} from \"./detachedFieldIndexFormat.js\";\nimport type { DetachedFieldSummaryData, Major } from \"./detachedFieldIndexTypes.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nclass MajorCodec implements IJsonCodec<Major> {\n\tpublic constructor(\n\t\tprivate readonly revisionTagCodec: RevisionTagCodec,\n\t\tprivate readonly options: ICodecOptions,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t) {}\n\n\tpublic encode(major: Major): EncodedRevisionTag {\n\t\tassert(major !== undefined, 0x88e /* Unexpected undefined revision */);\n\t\tconst id = this.revisionTagCodec.encode(major);\n\t\t/**\n\t\t * Preface: this codec is only used at summarization time (not for ops).\n\t\t * Note that the decode path must provide a session id in which to interpret the revision tag.\n\t\t * The revision associated with a detached root generally comes from the session which detaches that subtree,\n\t\t * which isn't generally the local session (nor is it available at decode time with the layering of the tree\n\t\t * package), despite decode using the local session id.\n\t\t *\n\t\t * This is made OK by enforcing that all ids on encode/decode are non-local, since local ids won't be interpretable\n\t\t * at decode time.\n\t\t * This assert is valid because the revision for an acked edit will have already been finalized, and a revision\n\t\t * for a local-only edit will be finalizable at summarization time (local edits can only occur on a summarizing client\n\t\t * if they're created while detached, and local ids made while detached are finalized before generating the attach summary).\n\t\t */\n\t\tassert(\n\t\t\tid === \"root\" || id >= 0,\n\t\t\t0x88f /* Expected final id on encode of detached field index revision */,\n\t\t);\n\t\treturn id;\n\t}\n\n\tpublic decode(major: EncodedRevisionTag): RevisionTag {\n\t\tassert(\n\t\t\tmajor === \"root\" || major >= 0,\n\t\t\t0x890 /* Expected final id on decode of detached field index revision */,\n\t\t);\n\t\treturn this.revisionTagCodec.decode(major, {\n\t\t\toriginatorId: this.revisionTagCodec.localSessionId,\n\t\t\tidCompressor: this.idCompressor,\n\t\t\trevision: undefined,\n\t\t});\n\t}\n}\n\nexport function makeDetachedNodeToFieldCodec(\n\trevisionTagCodec: RevisionTagCodec,\n\toptions: ICodecOptions,\n\tidCompressor: IIdCompressor,\n): IJsonCodec<DetachedFieldSummaryData, Format> {\n\tconst majorCodec = new MajorCodec(revisionTagCodec, options, idCompressor);\n\treturn makeVersionedValidatedCodec(options, new Set([version]), Format, {\n\t\tencode: (data: DetachedFieldSummaryData): Format => {\n\t\t\tconst rootsForRevisions: EncodedRootsForRevision[] = [];\n\t\t\tfor (const [major, innerMap] of data.data) {\n\t\t\t\tconst encodedRevision = majorCodec.encode(major);\n\t\t\t\tconst rootRanges: RootRanges = [...innerMap];\n\t\t\t\tif (rootRanges.length === 1) {\n\t\t\t\t\tconst rootsForRevision: EncodedRootsForRevision = [\n\t\t\t\t\t\tencodedRevision,\n\t\t\t\t\t\trootRanges[0][0],\n\t\t\t\t\t\trootRanges[0][1],\n\t\t\t\t\t];\n\t\t\t\t\trootsForRevisions.push(rootsForRevision);\n\t\t\t\t} else {\n\t\t\t\t\tconst rootsForRevision: EncodedRootsForRevision = [encodedRevision, rootRanges];\n\t\t\t\t\trootsForRevisions.push(rootsForRevision);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst encoded: Format = {\n\t\t\t\tversion,\n\t\t\t\tdata: rootsForRevisions,\n\t\t\t\tmaxId: data.maxId,\n\t\t\t};\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (parsed: Format): DetachedFieldSummaryData => {\n\t\t\tconst map = new Map();\n\t\t\tfor (const rootsForRevision of parsed.data) {\n\t\t\t\tconst innerMap = new Map<number, ForestRootId>(\n\t\t\t\t\trootsForRevision.length === 2\n\t\t\t\t\t\t? rootsForRevision[1]\n\t\t\t\t\t\t: [[rootsForRevision[1], rootsForRevision[2]]],\n\t\t\t\t);\n\t\t\t\tmap.set(majorCodec.decode(rootsForRevision[0]), innerMap);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tdata: map,\n\t\t\t\tmaxId: parsed.maxId,\n\t\t\t};\n\t\t},\n\t});\n}\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { Static } from "@sinclair/typebox";
6
- import { ForestRootId } from "./detachedFieldIndex.js";
5
+ import { type Static } from "@sinclair/typebox";
6
+ import type { ForestRootId } from "./detachedFieldIndex.js";
7
7
  export declare const version = 1;
8
8
  /**
9
9
  * The ID of a detached node. Is not globally unique on.
@@ -1 +1 @@
1
- {"version":3,"file":"detachedFieldIndexFormat.d.ts","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndexFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAKjD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,eAAO,MAAM,OAAO,IAAM,CAAC;AAE3B;;;GAGG;AACH,eAAO,MAAM,QAAQ,qCAAiC,CAAC;AAQvD;;;;GAIG;AACH,eAAO,MAAM,SAAS,8HAKpB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC;AAEjD,eAAO,MAAM,UAAU,kKAAwB,CAAC;AAChD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,uBAAuB,80BAKlC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE7E,eAAO,MAAM,MAAM;;;;EAOlB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"detachedFieldIndexFormat.d.ts","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndexFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAKtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,eAAO,MAAM,OAAO,IAAM,CAAC;AAE3B;;;GAGG;AACH,eAAO,MAAM,QAAQ,qCAAiC,CAAC;AAQvD;;;;GAIG;AACH,eAAO,MAAM,SAAS,8HAKpB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC;AAEjD,eAAO,MAAM,UAAU,kKAAwB,CAAC;AAChD,MAAM,MAAM,U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I,CAAC,MAAM,CAChC;IACC,OAAO,EAAE,cAAI,CAAC,OAAO,CAAC,eAAO,CAAC;IAC9B,IAAI,EAAE,cAAI,CAAC,KAAK,CAAC,+BAAuB,CAAC;IACzC,KAAK,EAAE,kBAAkB;CACzB,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Static, Type } from \"@sinclair/typebox\";\n\nimport { brandedNumberType } from \"../../util/index.js\";\nimport { RevisionTagSchema } from \"../rebase/index.js\";\n\nimport { ForestRootId } from \"./detachedFieldIndex.js\";\n\nexport const version = 1.0;\n\n/**\n * The ID of a detached node. Is not globally unique on.\n * A `RevisionTag` + `DetachId` pair is globally unique and eventually consistent across clients.\n */\nexport const DetachId = Type.Number({ multipleOf: 1 });\n\n/**\n * The ID of a root node in the forest associated with the owning checkout. Is unique for that forest.\n * Is not consistent across clients.\n */\nconst ForestRootIdSchema = brandedNumberType<ForestRootId>({ minimum: -1, multipleOf: 1 });\n\n/**\n * A mapping from a range of the detached node IDs the corresponding range root IDs.\n * The detached node IDs need to be qualified with a revision (stored in the containing `EncodedRootsForRevision`).\n * Note: the length of the range (currently always 1) can be looked up in the forest.\n */\nexport const RootRange = Type.Tuple([\n\t// ID for the first detached node\n\tDetachId,\n\t// ID for the first root node\n\tForestRootIdSchema,\n]);\nexport type RootRange = Static<typeof RootRange>;\n\nexport const RootRanges = Type.Array(RootRange);\nexport type RootRanges = Static<typeof RootRanges>;\n\n/**\n * For all the roots detached in a revision, represents a mapping from the detached node ID to corresponding root ID.\n */\nexport const EncodedRootsForRevision = Type.Union([\n\t// Used to represent a revision in which more than one node were detached\n\tType.Tuple([RevisionTagSchema, RootRanges]),\n\t// Used to represent a revision in which a single node was detached\n\tType.Tuple([RevisionTagSchema, DetachId, ForestRootIdSchema]),\n]);\nexport type EncodedRootsForRevision = Static<typeof EncodedRootsForRevision>;\n\nexport const Format = Type.Object(\n\t{\n\t\tversion: Type.Literal(version),\n\t\tdata: Type.Array(EncodedRootsForRevision),\n\t\tmaxId: ForestRootIdSchema,\n\t},\n\t{ additionalProperties: false },\n);\n\nexport type Format = Static<typeof Format>;\n"]}
1
+ {"version":3,"file":"detachedFieldIndexFormat.js","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndexFormat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAAsD;AAEtD,kDAAwD;AACxD,iDAAuD;AAI1C,QAAA,OAAO,GAAG,GAAG,CAAC;AAE3B;;;GAGG;AACU,QAAA,QAAQ,GAAG,cAAI,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;AAEvD;;;GAGG;AACH,MAAM,kBAAkB,GAAG,IAAA,4BAAiB,EAAe,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;AAE3F;;;;GAIG;AACU,QAAA,SAAS,GAAG,cAAI,CAAC,KAAK,CAAC;IACnC,iCAAiC;IACjC,gBAAQ;IACR,6BAA6B;IAC7B,kBAAkB;CAClB,CAAC,CAAC;AAGU,QAAA,UAAU,GAAG,cAAI,CAAC,KAAK,CAAC,iBAAS,CAAC,CAAC;AAGhD;;GAEG;AACU,QAAA,uBAAuB,GAAG,cAAI,CAAC,KAAK,CAAC;IACjD,yEAAyE;IACzE,cAAI,CAAC,KAAK,CAAC,CAAC,4BAAiB,EAAE,kBAAU,CAAC,CAAC;IAC3C,mEAAmE;IACnE,cAAI,CAAC,KAAK,CAAC,CAAC,4BAAiB,EAAE,gBAAQ,EAAE,kBAAkB,CAAC,CAAC;CAC7D,CAAC,CAAC;AAGU,QAAA,MAAM,GAAG,cAAI,CAAC,MAAM,CAChC;IACC,OAAO,EAAE,cAAI,CAAC,OAAO,CAAC,eAAO,CAAC;IAC9B,IAAI,EAAE,cAAI,CAAC,KAAK,CAAC,+BAAuB,CAAC;IACzC,KAAK,EAAE,kBAAkB;CACzB,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\n\nimport { brandedNumberType } from \"../../util/index.js\";\nimport { RevisionTagSchema } from \"../rebase/index.js\";\n\nimport type { ForestRootId } from \"./detachedFieldIndex.js\";\n\nexport const version = 1.0;\n\n/**\n * The ID of a detached node. Is not globally unique on.\n * A `RevisionTag` + `DetachId` pair is globally unique and eventually consistent across clients.\n */\nexport const DetachId = Type.Number({ multipleOf: 1 });\n\n/**\n * The ID of a root node in the forest associated with the owning checkout. Is unique for that forest.\n * Is not consistent across clients.\n */\nconst ForestRootIdSchema = brandedNumberType<ForestRootId>({ minimum: -1, multipleOf: 1 });\n\n/**\n * A mapping from a range of the detached node IDs the corresponding range root IDs.\n * The detached node IDs need to be qualified with a revision (stored in the containing `EncodedRootsForRevision`).\n * Note: the length of the range (currently always 1) can be looked up in the forest.\n */\nexport const RootRange = Type.Tuple([\n\t// ID for the first detached node\n\tDetachId,\n\t// ID for the first root node\n\tForestRootIdSchema,\n]);\nexport type RootRange = Static<typeof RootRange>;\n\nexport const RootRanges = Type.Array(RootRange);\nexport type RootRanges = Static<typeof RootRanges>;\n\n/**\n * For all the roots detached in a revision, represents a mapping from the detached node ID to corresponding root ID.\n */\nexport const EncodedRootsForRevision = Type.Union([\n\t// Used to represent a revision in which more than one node were detached\n\tType.Tuple([RevisionTagSchema, RootRanges]),\n\t// Used to represent a revision in which a single node was detached\n\tType.Tuple([RevisionTagSchema, DetachId, ForestRootIdSchema]),\n]);\nexport type EncodedRootsForRevision = Static<typeof EncodedRootsForRevision>;\n\nexport const Format = Type.Object(\n\t{\n\t\tversion: Type.Literal(version),\n\t\tdata: Type.Array(EncodedRootsForRevision),\n\t\tmaxId: ForestRootIdSchema,\n\t},\n\t{ additionalProperties: false },\n);\n\nexport type Format = Static<typeof Format>;\n"]}
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { NestedMap } from "../../util/index.js";
6
- import { RevisionTag } from "../rebase/index.js";
7
- import { ForestRootId } from "./detachedFieldIndex.js";
5
+ import type { NestedMap } from "../../util/index.js";
6
+ import type { RevisionTag } from "../rebase/index.js";
7
+ import type { ForestRootId } from "./detachedFieldIndex.js";
8
8
  export type Major = RevisionTag | undefined;
9
9
  export type Minor = number;
10
10
  export interface DetachedFieldSummaryData {
@@ -1 +1 @@
1
- {"version":3,"file":"detachedFieldIndexTypes.d.ts","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndexTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,MAAM,KAAK,GAAG,WAAW,GAAG,SAAS,CAAC;AAC5C,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAE3B,MAAM,WAAW,wBAAwB;IACxC,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;IAC5C,KAAK,EAAE,YAAY,CAAC;CACpB"}
1
+ {"version":3,"file":"detachedFieldIndexTypes.d.ts","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndexTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,MAAM,KAAK,GAAG,WAAW,GAAG,SAAS,CAAC;AAC5C,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAE3B,MAAM,WAAW,wBAAwB;IACxC,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;IAC5C,KAAK,EAAE,YAAY,CAAC;CACpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"detachedFieldIndexTypes.js","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndexTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { NestedMap } from \"../../util/index.js\";\nimport { RevisionTag } from \"../rebase/index.js\";\n\nimport { ForestRootId } from \"./detachedFieldIndex.js\";\n\nexport type Major = RevisionTag | undefined;\nexport type Minor = number;\n\nexport interface DetachedFieldSummaryData {\n\tdata: NestedMap<Major, Minor, ForestRootId>;\n\tmaxId: ForestRootId;\n}\n"]}
1
+ {"version":3,"file":"detachedFieldIndexTypes.js","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndexTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { NestedMap } from \"../../util/index.js\";\nimport type { RevisionTag } from \"../rebase/index.js\";\n\nimport type { ForestRootId } from \"./detachedFieldIndex.js\";\n\nexport type Major = RevisionTag | undefined;\nexport type Minor = number;\n\nexport interface DetachedFieldSummaryData {\n\tdata: NestedMap<Major, Minor, ForestRootId>;\n\tmaxId: ForestRootId;\n}\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { FieldKey } from "../schema-stored/index.js";
6
- import { NodeData } from "./types.js";
5
+ import type { FieldKey } from "../schema-stored/index.js";
6
+ import type { NodeData } from "./types.js";
7
7
  /**
8
8
  * This modules provides a simple in memory tree format.
9
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"mapTree.d.ts","sourceRoot":"","sources":["../../../src/core/tree/mapTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AAEH;;;;GAIG;AACH,MAAM,WAAW,OAAQ,SAAQ,QAAQ;IACxC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC,CAAC;CAC3D"}
1
+ {"version":3,"file":"mapTree.d.ts","sourceRoot":"","sources":["../../../src/core/tree/mapTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;GAEG;AAEH;;;;GAIG;AACH,MAAM,WAAW,OAAQ,SAAQ,QAAQ;IACxC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC,CAAC;CAC3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"mapTree.js","sourceRoot":"","sources":["../../../src/core/tree/mapTree.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FieldKey } from \"../schema-stored/index.js\";\n\nimport { NodeData } from \"./types.js\";\n\n/**\n * This modules provides a simple in memory tree format.\n */\n\n/**\n * Simple in memory tree representation based on Maps.\n * MapTrees should not store empty fields.\n * @internal\n */\nexport interface MapTree extends NodeData {\n\treadonly fields: ReadonlyMap<FieldKey, readonly MapTree[]>;\n}\n"]}
1
+ {"version":3,"file":"mapTree.js","sourceRoot":"","sources":["../../../src/core/tree/mapTree.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type { NodeData } from \"./types.js\";\n\n/**\n * This modules provides a simple in memory tree format.\n */\n\n/**\n * Simple in memory tree representation based on Maps.\n * MapTrees should not store empty fields.\n * @internal\n */\nexport interface MapTree extends NodeData {\n\treadonly fields: ReadonlyMap<FieldKey, readonly MapTree[]>;\n}\n"]}
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { Brand } from "../../util/index.js";
6
- import { FieldKey } from "../schema-stored/index.js";
7
- import { DetachedField } from "./types.js";
5
+ import type { Brand } from "../../util/index.js";
6
+ import type { FieldKey } from "../schema-stored/index.js";
7
+ import { type DetachedField } from "./types.js";
8
8
  /**
9
9
  * Identical to {@link UpPath}, but a duplicate declaration is needed to make
10
10
  * the default type parameter compile.
@@ -1 +1 @@
1
- {"version":3,"file":"pathTree.d.ts","sourceRoot":"","sources":["../../../src/core/tree/pathTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,aAAa,EAAsB,MAAM,YAAY,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,MAAM,CAAC,OAAO,GAAG,aAAa;IAC9C;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,WAAW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6BAAkB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC7C,CAAC;AAVD,wEAUC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Brand } from \"../../util/index.js\";\nimport { FieldKey } from \"../schema-stored/index.js\";\n\nimport { DetachedField, keyAsDetachedField } from \"./types.js\";\n\n/**\n * Identical to {@link UpPath}, but a duplicate declaration is needed to make\n * the default type parameter compile.\n *\n * @internal\n */\nexport type UpPathDefault = UpPath;\n\n/**\n * Path from a location in the tree upward.\n * UpPaths can be used with deduplicated upper parts to allow\n * working with paths localized to part of the tree without incurring\n * costs related to the depth of the local subtree.\n *\n * UpPaths can be thought of as terminating at a special root node (that is `undefined`)\n * whose FieldKeys correspond to detached sequences.\n *\n * UpPaths can be mutated over time and should be considered to be invalidated when any edits occurs:\n * Use of an UpPath that was acquired before the most recent edit is undefined behavior.\n * @internal\n */\nexport interface UpPath<TParent = UpPathDefault> {\n\t/**\n\t * The parent, or undefined in the case where this path is a member of a detached sequence.\n\t */\n\treadonly parent: TParent | undefined;\n\t/**\n\t * The Field under which this path points.\n\t * Note that if `parent` returns `undefined`, this key corresponds to a detached sequence.\n\t */\n\treadonly parentField: FieldKey; // TODO: Type information, including when in DetachedField.\n\t/**\n\t * The index within `parentField` this path is pointing to.\n\t */\n\treadonly parentIndex: NodeIndex;\n}\n\n/**\n * Path from a field in the tree upward.\n *\n * See {@link UpPath}.\n * @internal\n */\nexport interface FieldUpPath<TUpPath extends UpPath = UpPath> {\n\t/**\n\t * The parent, or undefined in the case where this path is to a detached sequence.\n\t */\n\treadonly parent: TUpPath | undefined;\n\n\t/**\n\t * The Field to which this path points.\n\t * Note that if `parent` returns `undefined`, this key corresponds to a detached sequence.\n\t */\n\treadonly field: FieldKey; // TODO: Type information, including when in DetachedField.\n}\n\n/**\n * A range of nodes in a detached field.\n * Unlike RangeUpPath, such ranges are generated by create and detach operations,\n * as well as consumed by destroy and attach operations.\n * @internal\n */\nexport type DetachedRangeUpPath = Brand<Omit<RangeUpPath, \"parent\">, \"DetachedRangeUpPath\">;\n\n/**\n * Delimits the extend of a range.\n * @internal\n */\nexport interface Range {\n\t/**\n\t * The location before the first node.\n\t * Must be less than or equal to `end`.\n\t */\n\treadonly start: PlaceIndex;\n\t/**\n\t * The location after the last node.\n\t * Must be greater than or equal to `start`.\n\t */\n\treadonly end: PlaceIndex;\n}\n\n/**\n * A possibly empty range of nodes in a field.\n * This object only characterizes the location of the range, it does not own/contain the nodes in the range.\n * @internal\n */\nexport interface RangeUpPath<TUpPath extends UpPath = UpPath> extends FieldUpPath<TUpPath>, Range {}\n\n/**\n * A place in a field.\n * @internal\n */\nexport interface PlaceUpPath<TUpPath extends UpPath = UpPath> extends FieldUpPath<TUpPath> {\n\t/**\n\t * The location in the field.\n\t */\n\treadonly index: PlaceIndex;\n}\n\n/**\n * A place in a detached field.\n * @internal\n */\nexport type DetachedPlaceUpPath = Brand<Omit<PlaceUpPath, \"parent\">, \"DetachedRangeUpPath\">;\n\n/**\n * Indicates the index of a node in a field.\n * Zero indicates the first node in a field.\n * @internal\n */\nexport type NodeIndex = number;\n\n/**\n * Indicates a place between nodes in a field or at the extremity of a field.\n * Zero indicates the place at the start of the field (before the first node if any).\n * @internal\n */\nexport type PlaceIndex = number;\n\n/**\n * @returns the number of nodes above this one.\n * Zero when the path's parent is undefined, meaning the path represents a node in a detached field.\n * Runs in O(depth) time.\n */\nexport function getDepth(path: UpPath): number {\n\tlet depth = 0;\n\tlet next = path.parent;\n\twhile (next !== undefined) {\n\t\tdepth += 1;\n\t\tnext = next.parent;\n\t}\n\treturn depth;\n}\n\n/**\n * @returns a deep copy of the provided path as simple javascript objects.\n * This is safe to hold onto and use deep object comparisons on.\n */\nexport function clonePath(path: UpPath): UpPath;\n\n/**\n * @returns a deep copy of the provided path as simple javascript objects.\n * This is safe to hold onto and use deep object comparisons on.\n */\nexport function clonePath(path: UpPath | undefined): UpPath | undefined;\n\nexport function clonePath(path: UpPath | undefined): UpPath | undefined {\n\tif (path === undefined) {\n\t\treturn undefined;\n\t}\n\treturn {\n\t\tparent: clonePath(path.parent),\n\t\tparentField: path.parentField,\n\t\tparentIndex: path.parentIndex,\n\t};\n}\n\n/**\n * @returns The elements of the given `path`, ordered from root-most to child-most.\n * These elements are unchanged and therefore still point \"up\".\n */\nexport function topDownPath(path: UpPath | undefined): UpPath[] {\n\tconst out: UpPath[] = [];\n\tlet curr = path;\n\twhile (curr !== undefined) {\n\t\tout.push(curr);\n\t\tcurr = curr.parent;\n\t}\n\tout.reverse();\n\treturn out;\n}\n\n/**\n * @returns true iff `a` and `b` describe the same path.\n *\n * Note that for mutable paths (as used in `AnchorSet`), this equality may change over time: this only checks if the two paths are currently the same.\n */\nexport function compareUpPaths(a: UpPath | undefined, b: UpPath | undefined): boolean {\n\tif (a === b) {\n\t\t// This handles the both `undefined` case, as well as provides an early out if a shared node is encountered.\n\t\treturn true;\n\t}\n\tif (a === undefined || b === undefined) {\n\t\treturn false;\n\t}\n\tif (a.parentField !== b.parentField || a.parentIndex !== b.parentIndex) {\n\t\treturn false;\n\t}\n\treturn compareUpPaths(a.parent, b.parent);\n}\n\n/**\n * @returns true iff `a` and `b` describe the same field path.\n *\n * Note that for mutable paths (as used in `AnchorSet`), this equality may change over time: this only checks if the two paths are currently the same.\n */\nexport function compareFieldUpPaths(a: FieldUpPath, b: FieldUpPath): boolean {\n\tif (a.field !== b.field) {\n\t\treturn false;\n\t}\n\treturn compareUpPaths(a.parent, b.parent);\n}\n\n/**\n * Checks whether or not a given path is parented under the root field.\n * @param path - the path you want to check.\n * @returns the {@link DetachedField} which contains the path.\n */\nexport function getDetachedFieldContainingPath(path: UpPath): DetachedField {\n\tlet currentPath = path;\n\twhile (currentPath !== undefined) {\n\t\tif (currentPath.parent === undefined) {\n\t\t\treturn keyAsDetachedField(currentPath.parentField);\n\t\t} else {\n\t\t\tcurrentPath = currentPath.parent;\n\t\t}\n\t}\n\treturn keyAsDetachedField(path.parentField);\n}\n"]}
1
+ {"version":3,"file":"pathTree.js","sourceRoot":"","sources":["../../../src/core/tree/pathTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,yCAAoE;AAyHpE;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACpC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;IACvB,OAAO,IAAI,KAAK,SAAS,EAAE,CAAC;QAC3B,KAAK,IAAI,CAAC,CAAC;QACX,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AARD,4BAQC;AAcD,SAAgB,SAAS,CAAC,IAAwB;IACjD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO;QACN,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;QAC9B,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;KAC7B,CAAC;AACH,CAAC;AATD,8BASC;AAED;;;GAGG;AACH,SAAgB,WAAW,CAAC,IAAwB;IACnD,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,IAAI,IAAI,GAAG,IAAI,CAAC;IAChB,OAAO,IAAI,KAAK,SAAS,EAAE,CAAC;QAC3B,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACf,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IACD,GAAG,CAAC,OAAO,EAAE,CAAC;IACd,OAAO,GAAG,CAAC;AACZ,CAAC;AATD,kCASC;AAED;;;;GAIG;AACH,SAAgB,cAAc,CAAC,CAAqB,EAAE,CAAqB;IAC1E,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACb,4GAA4G;QAC5G,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAI,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;QACxE,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,cAAc,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC;AAZD,wCAYC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,CAAc,EAAE,CAAc;IACjE,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,cAAc,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC;AALD,kDAKC;AAED;;;;GAIG;AACH,SAAgB,8BAA8B,CAAC,IAAY;IAC1D,IAAI,WAAW,GAAG,IAAI,CAAC;IACvB,OAAO,WAAW,KAAK,SAAS,EAAE,CAAC;QAClC,IAAI,WAAW,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YACtC,OAAO,IAAA,6BAAkB,EAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QACpD,CAAC;aAAM,CAAC;YACP,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC;QAClC,CAAC;IACF,CAAC;IACD,OAAO,IAAA,6BAAkB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC7C,CAAC;AAVD,wEAUC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Brand } from \"../../util/index.js\";\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport { type DetachedField, keyAsDetachedField } from \"./types.js\";\n\n/**\n * Identical to {@link UpPath}, but a duplicate declaration is needed to make\n * the default type parameter compile.\n *\n * @internal\n */\nexport type UpPathDefault = UpPath;\n\n/**\n * Path from a location in the tree upward.\n * UpPaths can be used with deduplicated upper parts to allow\n * working with paths localized to part of the tree without incurring\n * costs related to the depth of the local subtree.\n *\n * UpPaths can be thought of as terminating at a special root node (that is `undefined`)\n * whose FieldKeys correspond to detached sequences.\n *\n * UpPaths can be mutated over time and should be considered to be invalidated when any edits occurs:\n * Use of an UpPath that was acquired before the most recent edit is undefined behavior.\n * @internal\n */\nexport interface UpPath<TParent = UpPathDefault> {\n\t/**\n\t * The parent, or undefined in the case where this path is a member of a detached sequence.\n\t */\n\treadonly parent: TParent | undefined;\n\t/**\n\t * The Field under which this path points.\n\t * Note that if `parent` returns `undefined`, this key corresponds to a detached sequence.\n\t */\n\treadonly parentField: FieldKey; // TODO: Type information, including when in DetachedField.\n\t/**\n\t * The index within `parentField` this path is pointing to.\n\t */\n\treadonly parentIndex: NodeIndex;\n}\n\n/**\n * Path from a field in the tree upward.\n *\n * See {@link UpPath}.\n * @internal\n */\nexport interface FieldUpPath<TUpPath extends UpPath = UpPath> {\n\t/**\n\t * The parent, or undefined in the case where this path is to a detached sequence.\n\t */\n\treadonly parent: TUpPath | undefined;\n\n\t/**\n\t * The Field to which this path points.\n\t * Note that if `parent` returns `undefined`, this key corresponds to a detached sequence.\n\t */\n\treadonly field: FieldKey; // TODO: Type information, including when in DetachedField.\n}\n\n/**\n * A range of nodes in a detached field.\n * Unlike RangeUpPath, such ranges are generated by create and detach operations,\n * as well as consumed by destroy and attach operations.\n * @internal\n */\nexport type DetachedRangeUpPath = Brand<Omit<RangeUpPath, \"parent\">, \"DetachedRangeUpPath\">;\n\n/**\n * Delimits the extend of a range.\n * @internal\n */\nexport interface Range {\n\t/**\n\t * The location before the first node.\n\t * Must be less than or equal to `end`.\n\t */\n\treadonly start: PlaceIndex;\n\t/**\n\t * The location after the last node.\n\t * Must be greater than or equal to `start`.\n\t */\n\treadonly end: PlaceIndex;\n}\n\n/**\n * A possibly empty range of nodes in a field.\n * This object only characterizes the location of the range, it does not own/contain the nodes in the range.\n * @internal\n */\nexport interface RangeUpPath<TUpPath extends UpPath = UpPath> extends FieldUpPath<TUpPath>, Range {}\n\n/**\n * A place in a field.\n * @internal\n */\nexport interface PlaceUpPath<TUpPath extends UpPath = UpPath> extends FieldUpPath<TUpPath> {\n\t/**\n\t * The location in the field.\n\t */\n\treadonly index: PlaceIndex;\n}\n\n/**\n * A place in a detached field.\n * @internal\n */\nexport type DetachedPlaceUpPath = Brand<Omit<PlaceUpPath, \"parent\">, \"DetachedRangeUpPath\">;\n\n/**\n * Indicates the index of a node in a field.\n * Zero indicates the first node in a field.\n * @internal\n */\nexport type NodeIndex = number;\n\n/**\n * Indicates a place between nodes in a field or at the extremity of a field.\n * Zero indicates the place at the start of the field (before the first node if any).\n * @internal\n */\nexport type PlaceIndex = number;\n\n/**\n * @returns the number of nodes above this one.\n * Zero when the path's parent is undefined, meaning the path represents a node in a detached field.\n * Runs in O(depth) time.\n */\nexport function getDepth(path: UpPath): number {\n\tlet depth = 0;\n\tlet next = path.parent;\n\twhile (next !== undefined) {\n\t\tdepth += 1;\n\t\tnext = next.parent;\n\t}\n\treturn depth;\n}\n\n/**\n * @returns a deep copy of the provided path as simple javascript objects.\n * This is safe to hold onto and use deep object comparisons on.\n */\nexport function clonePath(path: UpPath): UpPath;\n\n/**\n * @returns a deep copy of the provided path as simple javascript objects.\n * This is safe to hold onto and use deep object comparisons on.\n */\nexport function clonePath(path: UpPath | undefined): UpPath | undefined;\n\nexport function clonePath(path: UpPath | undefined): UpPath | undefined {\n\tif (path === undefined) {\n\t\treturn undefined;\n\t}\n\treturn {\n\t\tparent: clonePath(path.parent),\n\t\tparentField: path.parentField,\n\t\tparentIndex: path.parentIndex,\n\t};\n}\n\n/**\n * @returns The elements of the given `path`, ordered from root-most to child-most.\n * These elements are unchanged and therefore still point \"up\".\n */\nexport function topDownPath(path: UpPath | undefined): UpPath[] {\n\tconst out: UpPath[] = [];\n\tlet curr = path;\n\twhile (curr !== undefined) {\n\t\tout.push(curr);\n\t\tcurr = curr.parent;\n\t}\n\tout.reverse();\n\treturn out;\n}\n\n/**\n * @returns true iff `a` and `b` describe the same path.\n *\n * Note that for mutable paths (as used in `AnchorSet`), this equality may change over time: this only checks if the two paths are currently the same.\n */\nexport function compareUpPaths(a: UpPath | undefined, b: UpPath | undefined): boolean {\n\tif (a === b) {\n\t\t// This handles the both `undefined` case, as well as provides an early out if a shared node is encountered.\n\t\treturn true;\n\t}\n\tif (a === undefined || b === undefined) {\n\t\treturn false;\n\t}\n\tif (a.parentField !== b.parentField || a.parentIndex !== b.parentIndex) {\n\t\treturn false;\n\t}\n\treturn compareUpPaths(a.parent, b.parent);\n}\n\n/**\n * @returns true iff `a` and `b` describe the same field path.\n *\n * Note that for mutable paths (as used in `AnchorSet`), this equality may change over time: this only checks if the two paths are currently the same.\n */\nexport function compareFieldUpPaths(a: FieldUpPath, b: FieldUpPath): boolean {\n\tif (a.field !== b.field) {\n\t\treturn false;\n\t}\n\treturn compareUpPaths(a.parent, b.parent);\n}\n\n/**\n * Checks whether or not a given path is parented under the root field.\n * @param path - the path you want to check.\n * @returns the {@link DetachedField} which contains the path.\n */\nexport function getDetachedFieldContainingPath(path: UpPath): DetachedField {\n\tlet currentPath = path;\n\twhile (currentPath !== undefined) {\n\t\tif (currentPath.parent === undefined) {\n\t\t\treturn keyAsDetachedField(currentPath.parentField);\n\t\t} else {\n\t\t\tcurrentPath = currentPath.parent;\n\t\t}\n\t}\n\treturn keyAsDetachedField(path.parentField);\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { Static, TSchema } from "@sinclair/typebox";
5
+ import { type Static, type TSchema } from "@sinclair/typebox";
6
6
  import { schemaFormat } from "../schema-stored/index.js";
7
7
  /**
8
8
  * This module contains persisted types for a simple, human-readable tree format.
@@ -1 +1 @@
1
- {"version":3,"file":"persistedTreeTextFormat.d.ts","sourceRoot":"","sources":["../../../src/core/tree/persistedTreeTextFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAQ,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH;;;;;;;;;;;;;;;;GAgBG;AACH,UAAU,qBAAqB,CAAC,MAAM;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACxB;AACD,QAAA,MAAM,qBAAqB,mCAAoC,MAAM,yHACL,CAAC;AAEjE,KAAK,eAAe,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AACtD,QAAA,MAAM,eAAe;;;EAGnB,CAAC;AAEH;;;GAGG;AACH,UAAU,wBAAwB,CAAC,MAAM;IACxC,MAAM,CAAC,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACvC,YAAY,CAAC,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC;CAC7C;AACD,QAAA,MAAM,wBAAwB,mCAAoC,MAAM;;;EAIrE,CAAC;AAEJ;;;GAGG;AACH,UAAU,sBAAsB,CAAC,MAAM,CACtC,SAAQ,wBAAwB,CAAC,MAAM,CAAC,EACvC,eAAe;CAAG;AACpB,QAAA,MAAM,sBAAsB,mCAAoC,MAAM;;;;;EAGnE,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB,CAAC,mBAAmB,CAAC;CAAG;AAC3F,eAAO,MAAM,mBAAmB;;;;;GAAyD,CAAC"}
1
+ {"version":3,"file":"persistedTreeTextFormat.d.ts","sourceRoot":"","sources":["../../../src/core/tree/persistedTreeTextFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAQ,MA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AAE,CAAC,CAAC,CAAC;AAGjE,MAAM,eAAe,GAAG,cAAI,CAAC,MAAM,CAAC;IACnC,KAAK,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,GAAG,EAAE,CAAC;IAChC,IAAI,EAAE,cAAI,CAAC,QAAQ,CAAC,uBAAY,CAAC,8BAA8B,CAAC;CAChE,CAAC,CAAC;AAUH,MAAM,wBAAwB,GAAG,CAAyB,MAAc,EAAE,EAAE,CAC3E,cAAI,CAAC,MAAM,CAAC;IACX,MAAM,EAAE,cAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACpD,YAAY,EAAE,cAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;CAC1D,CAAC,CAAC;AASJ,MAAM,sBAAsB,GAAG,CAAyB,MAAc,EAAE,EAAE,CACzE,cAAI,CAAC,SAAS,CAAC,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,EAAE;IACnE,oBAAoB,EAAE,KAAK;CAC3B,CAAC,CAAC;AASS,QAAA,mBAAmB,GAAG,cAAI,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;AAE1F,oEAAoE","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Static, TSchema, Type } from \"@sinclair/typebox\";\n\nimport { schemaFormat } from \"../schema-stored/index.js\";\n\n/**\n * This module contains persisted types for a simple, human-readable tree format.\n *\n * It was forked from `treeTextFormat.ts` to more cleanly separate compatibility concerns: in the long-term,\n * treeTextFormat.ts is intended to be useful for debugging/test purposes but not for persisted document storage\n * due to its unoptimized nature.\n *\n * However, at the time of forking it was also used as a persisted format for several of SharedTree's indexes.\n * Using the same types for both scenarios is problematic since `treeTextFormat.ts` types are exposed to the\n * public API.\n * These types should be used instead for all persisted format concerns.\n *\n * Before SharedTree has committed to persisted format backwards-compatibility, changes to `treeTextFormat.ts`\n * should be accompanied by the same changes to this module.\n *\n * After that point, changes to `treeTextFormat.ts` will necessitate changes to codecs that deal with these types\n * (and types in this module should not be changed except in compliance with persisted type compatibility guidelines).\n *\n * Longer-term, usages of these types should likely be replaced with a more optimized format.\n * If that switch happens before SharedTree commits to back-compat, this persisted format file can be deleted.\n */\n\n// Many of the return types in this module are intentionally derived, rather than explicitly specified.\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n\n/**\n * Json compatible map as object.\n * Keys are FieldKey strings.\n * Values are the content of the field specified by the key.\n *\n * WARNING:\n * Be very careful when using objects as maps:\n * Use `Object.prototype.hasOwnProperty.call(fieldMap, key)` to safely check for keys.\n * Do NOT simply read the field and check for undefined as this will return values for `__proto__`\n * and various methods on Object.prototype, like `hasOwnProperty` and `toString`.\n * This exposes numerous bug possibilities, including prototype pollution.\n *\n * Due to the above issue, try to avoid this type (and the whole object as map pattern).\n * Only use this type when needed for json compatible maps,\n * but even in those cases consider lists of key value pairs for serialization and using `Map`\n * for runtime.\n */\ninterface EncodedFieldMapObject<TChild> {\n\t[key: string]: TChild[];\n}\nconst EncodedFieldMapObject = <Schema extends TSchema>(tChild: Schema) =>\n\tType.Record(Type.String(), Type.Array(tChild, { minItems: 1 }));\n\ntype EncodedNodeData = Static<typeof EncodedNodeData>;\nconst EncodedNodeData = Type.Object({\n\tvalue: Type.Optional(Type.Any()),\n\ttype: Type.Readonly(schemaFormat.TreeNodeSchemaIdentifierSchema),\n});\n\n/**\n * Json comparable field collection, generic over child type.\n * Json compatibility assumes `TChild` is also json compatible.\n */\ninterface EncodedGenericFieldsNode<TChild> {\n\tfields?: EncodedFieldMapObject<TChild>;\n\tglobalFields?: EncodedFieldMapObject<TChild>;\n}\nconst EncodedGenericFieldsNode = <Schema extends TSchema>(tChild: Schema) =>\n\tType.Object({\n\t\tfields: Type.Optional(EncodedFieldMapObject(tChild)),\n\t\tglobalFields: Type.Optional(EncodedFieldMapObject(tChild)),\n\t});\n\n/**\n * Json comparable tree node, generic over child type.\n * Json compatibility assumes `TChild` is also json compatible.\n */\ninterface EncodedGenericTreeNode<TChild>\n\textends EncodedGenericFieldsNode<TChild>,\n\t\tEncodedNodeData {}\nconst EncodedGenericTreeNode = <Schema extends TSchema>(tChild: Schema) =>\n\tType.Composite([EncodedGenericFieldsNode(tChild), EncodedNodeData], {\n\t\tadditionalProperties: false,\n\t});\n\n/**\n * A tree represented using plain JavaScript objects.\n * Can be passed to `JSON.stringify()` to produce a human-readable/editable JSON tree.\n *\n * JsonableTrees must not store empty fields.\n */\nexport interface EncodedJsonableTree extends EncodedGenericTreeNode<EncodedJsonableTree> {}\nexport const EncodedJsonableTree = Type.Recursive((Self) => EncodedGenericTreeNode(Self));\n\n/* eslint-enable @typescript-eslint/explicit-function-return-type */\n"]}
1
+ {"version":3,"file":"persistedTreeTextFormat.js","sourceRoot":"","sources":["../../../src/core/tree/persistedTreeTextFormat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAAoE;AAEpE,wDAAyD;AA+CzD,MAAM,qBAAqB,GAAG,CAAyB,MAAc,EAAE,EAAE,CACxE,cAAI,CAAC,MAAM,CAAC,cAAI,CAAC,MAAM,EAAE,EAAE,cAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAGjE,MAAM,eAAe,GAAG,cAAI,CAAC,MAAM,CAAC;IACnC,KAAK,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,GAAG,EAAE,CAAC;IAChC,IAAI,EAAE,cAAI,CAAC,QAAQ,CAAC,uBAAY,CAAC,8BAA8B,CAAC;CAChE,CAAC,CAAC;AAUH,MAAM,wBAAwB,GAAG,CAAyB,MAAc,EAAE,EAAE,CAC3E,cAAI,CAAC,MAAM,CAAC;IACX,MAAM,EAAE,cAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACpD,YAAY,EAAE,cAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;CAC1D,CAAC,CAAC;AASJ,MAAM,sBAAsB,GAAG,CAAyB,MAAc,EAAE,EAAE,CACzE,cAAI,CAAC,SAAS,CAAC,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,EAAE;IACnE,oBAAoB,EAAE,KAAK;CAC3B,CAAC,CAAC;AASS,QAAA,mBAAmB,GAAG,cAAI,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;AAE1F,oEAAoE","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, type TSchema, Type } from \"@sinclair/typebox\";\n\nimport { schemaFormat } from \"../schema-stored/index.js\";\n\n/**\n * This module contains persisted types for a simple, human-readable tree format.\n *\n * It was forked from `treeTextFormat.ts` to more cleanly separate compatibility concerns: in the long-term,\n * treeTextFormat.ts is intended to be useful for debugging/test purposes but not for persisted document storage\n * due to its unoptimized nature.\n *\n * However, at the time of forking it was also used as a persisted format for several of SharedTree's indexes.\n * Using the same types for both scenarios is problematic since `treeTextFormat.ts` types are exposed to the\n * public API.\n * These types should be used instead for all persisted format concerns.\n *\n * Before SharedTree has committed to persisted format backwards-compatibility, changes to `treeTextFormat.ts`\n * should be accompanied by the same changes to this module.\n *\n * After that point, changes to `treeTextFormat.ts` will necessitate changes to codecs that deal with these types\n * (and types in this module should not be changed except in compliance with persisted type compatibility guidelines).\n *\n * Longer-term, usages of these types should likely be replaced with a more optimized format.\n * If that switch happens before SharedTree commits to back-compat, this persisted format file can be deleted.\n */\n\n// Many of the return types in this module are intentionally derived, rather than explicitly specified.\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n\n/**\n * Json compatible map as object.\n * Keys are FieldKey strings.\n * Values are the content of the field specified by the key.\n *\n * WARNING:\n * Be very careful when using objects as maps:\n * Use `Object.prototype.hasOwnProperty.call(fieldMap, key)` to safely check for keys.\n * Do NOT simply read the field and check for undefined as this will return values for `__proto__`\n * and various methods on Object.prototype, like `hasOwnProperty` and `toString`.\n * This exposes numerous bug possibilities, including prototype pollution.\n *\n * Due to the above issue, try to avoid this type (and the whole object as map pattern).\n * Only use this type when needed for json compatible maps,\n * but even in those cases consider lists of key value pairs for serialization and using `Map`\n * for runtime.\n */\ninterface EncodedFieldMapObject<TChild> {\n\t[key: string]: TChild[];\n}\nconst EncodedFieldMapObject = <Schema extends TSchema>(tChild: Schema) =>\n\tType.Record(Type.String(), Type.Array(tChild, { minItems: 1 }));\n\ntype EncodedNodeData = Static<typeof EncodedNodeData>;\nconst EncodedNodeData = Type.Object({\n\tvalue: Type.Optional(Type.Any()),\n\ttype: Type.Readonly(schemaFormat.TreeNodeSchemaIdentifierSchema),\n});\n\n/**\n * Json comparable field collection, generic over child type.\n * Json compatibility assumes `TChild` is also json compatible.\n */\ninterface EncodedGenericFieldsNode<TChild> {\n\tfields?: EncodedFieldMapObject<TChild>;\n\tglobalFields?: EncodedFieldMapObject<TChild>;\n}\nconst EncodedGenericFieldsNode = <Schema extends TSchema>(tChild: Schema) =>\n\tType.Object({\n\t\tfields: Type.Optional(EncodedFieldMapObject(tChild)),\n\t\tglobalFields: Type.Optional(EncodedFieldMapObject(tChild)),\n\t});\n\n/**\n * Json comparable tree node, generic over child type.\n * Json compatibility assumes `TChild` is also json compatible.\n */\ninterface EncodedGenericTreeNode<TChild>\n\textends EncodedGenericFieldsNode<TChild>,\n\t\tEncodedNodeData {}\nconst EncodedGenericTreeNode = <Schema extends TSchema>(tChild: Schema) =>\n\tType.Composite([EncodedGenericFieldsNode(tChild), EncodedNodeData], {\n\t\tadditionalProperties: false,\n\t});\n\n/**\n * A tree represented using plain JavaScript objects.\n * Can be passed to `JSON.stringify()` to produce a human-readable/editable JSON tree.\n *\n * JsonableTrees must not store empty fields.\n */\nexport interface EncodedJsonableTree extends EncodedGenericTreeNode<EncodedJsonableTree> {}\nexport const EncodedJsonableTree = Type.Recursive((Self) => EncodedGenericTreeNode(Self));\n\n/* eslint-enable @typescript-eslint/explicit-function-return-type */\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { FieldKey } from "../schema-stored/index.js";
6
- import { UpPath } from "./pathTree.js";
5
+ import type { FieldKey } from "../schema-stored/index.js";
6
+ import { type UpPath } from "./pathTree.js";
7
7
  /**
8
8
  * Sparse Tree of nodes.
9
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"sparseTree.d.ts","sourceRoot":"","sources":["../../../src/core/tree/sparseTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,MAAM,EAAe,MAAM,eAAe,CAAC;AAEpD;;;;;;;;GAQG;AACH,qBAAa,UAAU,CAAC,KAAK,CAAE,YAAW,MAAM;IAcvC,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,MAAM;IAC1B;;;;;;;;OAQG;IACI,UAAU,EAAE,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS;IACzC,IAAI,EAAE,KAAK;IAzBnB;;;;;;;;;OASG;IACH,SAAgB,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAa;gBAGjE,WAAW,EAAE,QAAQ,EACrB,WAAW,EAAE,MAAM;IAC1B;;;;;;;;OAQG;IACI,UAAU,EAAE,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS,EACzC,IAAI,EAAE,KAAK;IAGnB;;;;;OAKG;IACH,OAAO,CAAC,MAAM;IAId,IAAW,MAAM,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS,CAUjD;IAED;;;OAGG;IACI,gBAAgB,CAAC,GA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AAS,EACzC,IAAI,EAAE,KAAK;IAGnB;;;;;OAKG;IACH,OAAO,CAAC,MAAM;IAId,IAAW,MAAM,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS,CAUjD;IAED;;;OAGG;IACI,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;IAiB3F;;;OAGG;IACI,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS;IAS/E;;;;OAIG;IACI,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI;IAalD;;;;OAIG;IACI,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAO3C;;;;;OAKG;IACH,OAAO,CAAC,WAAW;CAGnB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAClC,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,EAC3B,IAAI,EAAE,MAAM,GAAG,SAAS,GACtB,UAAU,CAAC,KAAK,CAAC,CAYnB"}
@@ -17,21 +17,6 @@ const pathTree_js_1 = require("./pathTree.js");
17
17
  * prefix-tree style.
18
18
  */
19
19
  class SparseNode {
20
- parentField;
21
- parentIndex;
22
- parentPath;
23
- data;
24
- /**
25
- * SparseNode arrays are kept sorted the SparseNode's parentIndex for efficient search.
26
- * Users of this field must take care to maintain invariants (correct parent pointers, not empty child arrays etc.)
27
- *
28
- * Performance Note:
29
- * Large child lists could be updated more efficiently here using a data-structure optimized
30
- * for efficient prefix sum updates, such as a Fenwick tree or Finger tree.
31
- * This would be complicated by the need for parent pointers (including indexes),
32
- * but is possible to do.
33
- */
34
- children = new Map();
35
20
  constructor(parentField, parentIndex,
36
21
  /**
37
22
  * The parent of this `SparseNode` (an up pointer in the `SparseNode` tree).
@@ -47,6 +32,17 @@ class SparseNode {
47
32
  this.parentIndex = parentIndex;
48
33
  this.parentPath = parentPath;
49
34
  this.data = data;
35
+ /**
36
+ * SparseNode arrays are kept sorted the SparseNode's parentIndex for efficient search.
37
+ * Users of this field must take care to maintain invariants (correct parent pointers, not empty child arrays etc.)
38
+ *
39
+ * Performance Note:
40
+ * Large child lists could be updated more efficiently here using a data-structure optimized
41
+ * for efficient prefix sum updates, such as a Fenwick tree or Finger tree.
42
+ * This would be complicated by the need for parent pointers (including indexes),
43
+ * but is possible to do.
44
+ */
45
+ this.children = new Map();
50
46
  }
51
47
  /**
52
48
  * @returns true iff this SparseNode is the special root node that sits above all the detached fields.
@@ -1 +1 @@
1
- {"version":3,"file":"sparseTree.js","sourceRoot":"","sources":["../../../src/core/tree/sparseTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAI7D,+CAAoD;AAEpD;;;;;;;;GAQG;AACH,MAAa,UAAU;IAcd;IACA;IAUA;IACA;IAzBR;;;;;;;;;OASG;IACa,QAAQ,GAAuC,IAAI,GAAG,EAAE,CAAC;IAEzE,YACQ,WAAqB,EACrB,WAAmB;IAC1B;;;;;;;;OAQG;IACI,UAAyC,EACzC,IAAW;QAZX,gBAAW,GAAX,WAAW,CAAU;QACrB,gBAAW,GAAX,WAAW,CAAQ;QAUnB,eAAU,GAAV,UAAU,CAA+B;QACzC,SAAI,GAAJ,IAAI,CAAO;IAChB,CAAC;IAEJ;;;;;OAKG;IACK,MAAM;QACb,OAAO,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC;IACtC,CAAC;IAED,IAAW,MAAM;QAChB,IAAA,iBAAM,EACL,IAAI,CAAC,UAAU,KAAK,SAAS,EAC7B,KAAK,CAAC,gGAAgG,CACtG,CAAC;QACF,oEAAoE;QACpE,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC;YAC9B,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;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,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,GAAG,CAAC,WAAW,CAAC,CAAC;QACnE,IAAA,iBAAM,EAAC,KAAK,KAAK,SAAS,EAAE,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAChF,IAAI,GAAG,KAAK,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAfD,sCAeC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { FieldKey } from \"../schema-stored/index.js\";\n\nimport { UpPath, topDownPath } from \"./pathTree.js\";\n\n/**\n * Sparse Tree of nodes.\n *\n * Contains both child and parent pointers, which are kept in sync.\n *\n * Each node is equivalent to a path through the tree.\n * This tree structure stores a collection of these paths, but deduplicating the common prefixes of the tree\n * prefix-tree style.\n */\nexport class SparseNode<TData> implements UpPath {\n\t/**\n\t * SparseNode arrays are kept sorted the SparseNode's parentIndex for efficient search.\n\t * Users of this field must take care to maintain invariants (correct parent pointers, not empty child arrays etc.)\n\t *\n\t * Performance Note:\n\t * Large child lists could be updated more efficiently here using a data-structure optimized\n\t * for efficient prefix sum updates, such as a Fenwick tree or Finger tree.\n\t * This would be complicated by the need for parent pointers (including indexes),\n\t * but is possible to do.\n\t */\n\tpublic readonly children: Map<FieldKey, SparseNode<TData>[]> = new Map();\n\n\tpublic constructor(\n\t\tpublic parentField: FieldKey,\n\t\tpublic parentIndex: number,\n\t\t/**\n\t\t * The parent of this `SparseNode` (an up pointer in the `SparseNode` tree).\n\t\t * If the status of this node is `Alive`, then there must be a corresponding down pointer from the\n\t\t * `parentPath` node to this node.\n\t\t * When undefined, this node is the root and thus has no parent.\n\t\t *\n\t\t * When updating the tree, it is valid to transiently leave the up and down pointers inconsistent\n\t\t * (updating down pointers first), but they must be consistent when the update is completed.\n\t\t */\n\t\tpublic parentPath: SparseNode<TData> | undefined,\n\t\tpublic data: TData,\n\t) {}\n\n\t/**\n\t * @returns true iff this SparseNode is the special root node that sits above all the detached fields.\n\t * In this case, the fields are detached sequences.\n\t * Note that the special root node should never appear in an UpPath\n\t * since UpPaths represent this root as `undefined`.\n\t */\n\tprivate isRoot(): boolean {\n\t\treturn this.parentPath === undefined;\n\t}\n\n\tpublic get parent(): SparseNode<TData> | undefined {\n\t\tassert(\n\t\t\tthis.parentPath !== undefined,\n\t\t\t0x4a4 /* SparseNode.parent is an UpPath API and thus should never be called on the root SparseNode. */,\n\t\t);\n\t\t// Root SparseNode corresponds to the undefined root for UpPath API.\n\t\tif (this.parentPath.isRoot()) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.parentPath;\n\t}\n\n\t/**\n\t * Gets a child, adding a ref to it.\n\t * Creates child (with 1 ref) if needed.\n\t */\n\tpublic getOrCreateChild(key: FieldKey, index: number, data: () => TData): SparseNode<TData> {\n\t\tlet field = this.children.get(key);\n\t\tif (field === undefined) {\n\t\t\tfield = [];\n\t\t\tthis.children.set(key, field);\n\t\t}\n\t\t// TODO: should do more optimized search (ex: binary search).\n\t\tlet child = field.find((c) => c.parentIndex === index);\n\t\tif (child === undefined) {\n\t\t\tchild = new SparseNode(key, index, this, data());\n\t\t\tfield.push(child);\n\t\t\t// Keep list sorted by index.\n\t\t\tfield.sort((a, b) => a.parentIndex - b.parentIndex);\n\t\t}\n\t\treturn child;\n\t}\n\n\t/**\n\t * Gets a child if it exists.\n\t * Does NOT add a ref.\n\t */\n\tpublic tryGetChild(key: FieldKey, index: number): SparseNode<TData> | undefined {\n\t\tconst field = this.children.get(key);\n\t\tif (field === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// TODO: should do more optimized search (ex: binary search or better) using index.\n\t\treturn field.find((c) => c.parentIndex === index);\n\t}\n\n\t/**\n\t * Removes reference from this to `child`.\n\t * Since PathNodes are doubly linked,\n\t * the caller must ensure that the reference from child to parent is also removed (or the child is no longer used).\n\t */\n\tpublic removeChild(child: SparseNode<TData>): void {\n\t\tconst key = child.parentField;\n\t\tconst field = this.children.get(key);\n\t\t// TODO: should do more optimized search (ex: binary search or better) using child.parentIndex()\n\t\t// Note that this is the index in the list of child paths, not the index within the field\n\t\tconst childIndex = field?.indexOf(child) ?? -1;\n\t\tassert(childIndex !== -1, 0x4a5 /* child must be parented to be removed */);\n\t\tfield?.splice(childIndex, 1);\n\t\tif (field?.length === 0) {\n\t\t\tthis.afterEmptyField(key);\n\t\t}\n\t}\n\n\t/**\n\t * Call this after directly editing the child array for a field to be empty.\n\t * Handles cleaning up unneeded data\n\t * (like the field in the map, and possibly this entire SparseNode and its parents if they are no longer needed.)\n\t */\n\tpublic afterEmptyField(key: FieldKey): void {\n\t\tthis.children.delete(key);\n\t\tif (this.children.size === 0) {\n\t\t\tthis.disposeThis();\n\t\t}\n\t}\n\n\t/**\n\t * Removes this from parent if alive, and sets this to disposed.\n\t * Must only be called when this node is no longer needed (has no references and no children).\n\t *\n\t * Allowed when dangling (but not when disposed).\n\t */\n\tprivate disposeThis(): void {\n\t\tthis.parentPath?.removeChild(this);\n\t}\n}\n\nexport function getDescendant<TData>(\n\tancestor: SparseNode<TData>,\n\tpath: UpPath | undefined,\n): SparseNode<TData> {\n\tconst topDown = topDownPath(path);\n\tlet curr = ancestor;\n\tfor (const hop of topDown) {\n\t\tconst field = curr.children.get(hop.parentField);\n\t\tassert(field !== undefined, 0x4a6 /* Field not present in sparse node */);\n\t\t// TODO: should do more optimized search (ex: binary search).\n\t\tconst child = field.find((c) => c.parentIndex === hop.parentIndex);\n\t\tassert(child !== undefined, 0x4a7 /* Child not present in sparse node field */);\n\t\tcurr = child;\n\t}\n\treturn curr;\n}\n"]}
1
+ {"version":3,"file":"sparseTree.js","sourceRoot":"","sources":["../../../src/core/tree/sparseTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAI7D,+CAAyD;AAEzD;;;;;;;;GAQG;AACH,MAAa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,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACK,WAAW;QAClB,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACD;AA5HD,gCA4HC;AAED,SAAgB,aAAa,CAC5B,QAA2B,EAC3B,IAAwB;IAExB,MAAM,OAAO,GAAG,IAAA,yBAAW,EAAC,IAAI,CAAC,CAAC;IAClC,IAAI,IAAI,GAAG,QAAQ,CAAC;IACpB,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACjD,IAAA,iBAAM,EAAC,KAAK,KAAK,SAAS,EAAE,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC1E,6DAA6D;QAC7D,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,GAAG,CAAC,WAAW,CAAC,CAAC;QACnE,IAAA,iBAAM,EAAC,KAAK,KAAK,SAAS,EAAE,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAChF,IAAI,GAAG,KAAK,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAfD,sCAeC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport { type UpPath, topDownPath } from \"./pathTree.js\";\n\n/**\n * Sparse Tree of nodes.\n *\n * Contains both child and parent pointers, which are kept in sync.\n *\n * Each node is equivalent to a path through the tree.\n * This tree structure stores a collection of these paths, but deduplicating the common prefixes of the tree\n * prefix-tree style.\n */\nexport class SparseNode<TData> implements UpPath {\n\t/**\n\t * SparseNode arrays are kept sorted the SparseNode's parentIndex for efficient search.\n\t * Users of this field must take care to maintain invariants (correct parent pointers, not empty child arrays etc.)\n\t *\n\t * Performance Note:\n\t * Large child lists could be updated more efficiently here using a data-structure optimized\n\t * for efficient prefix sum updates, such as a Fenwick tree or Finger tree.\n\t * This would be complicated by the need for parent pointers (including indexes),\n\t * but is possible to do.\n\t */\n\tpublic readonly children: Map<FieldKey, SparseNode<TData>[]> = new Map();\n\n\tpublic constructor(\n\t\tpublic parentField: FieldKey,\n\t\tpublic parentIndex: number,\n\t\t/**\n\t\t * The parent of this `SparseNode` (an up pointer in the `SparseNode` tree).\n\t\t * If the status of this node is `Alive`, then there must be a corresponding down pointer from the\n\t\t * `parentPath` node to this node.\n\t\t * When undefined, this node is the root and thus has no parent.\n\t\t *\n\t\t * When updating the tree, it is valid to transiently leave the up and down pointers inconsistent\n\t\t * (updating down pointers first), but they must be consistent when the update is completed.\n\t\t */\n\t\tpublic parentPath: SparseNode<TData> | undefined,\n\t\tpublic data: TData,\n\t) {}\n\n\t/**\n\t * @returns true iff this SparseNode is the special root node that sits above all the detached fields.\n\t * In this case, the fields are detached sequences.\n\t * Note that the special root node should never appear in an UpPath\n\t * since UpPaths represent this root as `undefined`.\n\t */\n\tprivate isRoot(): boolean {\n\t\treturn this.parentPath === undefined;\n\t}\n\n\tpublic get parent(): SparseNode<TData> | undefined {\n\t\tassert(\n\t\t\tthis.parentPath !== undefined,\n\t\t\t0x4a4 /* SparseNode.parent is an UpPath API and thus should never be called on the root SparseNode. */,\n\t\t);\n\t\t// Root SparseNode corresponds to the undefined root for UpPath API.\n\t\tif (this.parentPath.isRoot()) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.parentPath;\n\t}\n\n\t/**\n\t * Gets a child, adding a ref to it.\n\t * Creates child (with 1 ref) if needed.\n\t */\n\tpublic getOrCreateChild(key: FieldKey, index: number, data: () => TData): SparseNode<TData> {\n\t\tlet field = this.children.get(key);\n\t\tif (field === undefined) {\n\t\t\tfield = [];\n\t\t\tthis.children.set(key, field);\n\t\t}\n\t\t// TODO: should do more optimized search (ex: binary search).\n\t\tlet child = field.find((c) => c.parentIndex === index);\n\t\tif (child === undefined) {\n\t\t\tchild = new SparseNode(key, index, this, data());\n\t\t\tfield.push(child);\n\t\t\t// Keep list sorted by index.\n\t\t\tfield.sort((a, b) => a.parentIndex - b.parentIndex);\n\t\t}\n\t\treturn child;\n\t}\n\n\t/**\n\t * Gets a child if it exists.\n\t * Does NOT add a ref.\n\t */\n\tpublic tryGetChild(key: FieldKey, index: number): SparseNode<TData> | undefined {\n\t\tconst field = this.children.get(key);\n\t\tif (field === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// TODO: should do more optimized search (ex: binary search or better) using index.\n\t\treturn field.find((c) => c.parentIndex === index);\n\t}\n\n\t/**\n\t * Removes reference from this to `child`.\n\t * Since PathNodes are doubly linked,\n\t * the caller must ensure that the reference from child to parent is also removed (or the child is no longer used).\n\t */\n\tpublic removeChild(child: SparseNode<TData>): void {\n\t\tconst key = child.parentField;\n\t\tconst field = this.children.get(key);\n\t\t// TODO: should do more optimized search (ex: binary search or better) using child.parentIndex()\n\t\t// Note that this is the index in the list of child paths, not the index within the field\n\t\tconst childIndex = field?.indexOf(child) ?? -1;\n\t\tassert(childIndex !== -1, 0x4a5 /* child must be parented to be removed */);\n\t\tfield?.splice(childIndex, 1);\n\t\tif (field?.length === 0) {\n\t\t\tthis.afterEmptyField(key);\n\t\t}\n\t}\n\n\t/**\n\t * Call this after directly editing the child array for a field to be empty.\n\t * Handles cleaning up unneeded data\n\t * (like the field in the map, and possibly this entire SparseNode and its parents if they are no longer needed.)\n\t */\n\tpublic afterEmptyField(key: FieldKey): void {\n\t\tthis.children.delete(key);\n\t\tif (this.children.size === 0) {\n\t\t\tthis.disposeThis();\n\t\t}\n\t}\n\n\t/**\n\t * Removes this from parent if alive, and sets this to disposed.\n\t * Must only be called when this node is no longer needed (has no references and no children).\n\t *\n\t * Allowed when dangling (but not when disposed).\n\t */\n\tprivate disposeThis(): void {\n\t\tthis.parentPath?.removeChild(this);\n\t}\n}\n\nexport function getDescendant<TData>(\n\tancestor: SparseNode<TData>,\n\tpath: UpPath | undefined,\n): SparseNode<TData> {\n\tconst topDown = topDownPath(path);\n\tlet curr = ancestor;\n\tfor (const hop of topDown) {\n\t\tconst field = curr.children.get(hop.parentField);\n\t\tassert(field !== undefined, 0x4a6 /* Field not present in sparse node */);\n\t\t// TODO: should do more optimized search (ex: binary search).\n\t\tconst child = field.find((c) => c.parentIndex === hop.parentIndex);\n\t\tassert(child !== undefined, 0x4a7 /* Child not present in sparse node field */);\n\t\tcurr = child;\n\t}\n\treturn curr;\n}\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { FieldKey } from "../schema-stored/index.js";
6
- import { NodeData } from "./types.js";
5
+ import type { FieldKey } from "../schema-stored/index.js";
6
+ import type { NodeData } from "./types.js";
7
7
  /**
8
8
  * This modules provides a simple human readable (and editable) tree format.
9
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"treeTextFormat.d.ts","sourceRoot":"","sources":["../../../src/core/tree/treeTextFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,cAAc,CAAC,MAAM;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe,CAAC,MAAM,CAAE,SAAQ,iBAAiB,CAAC,MAAM,CAAC,EAAE,QAAQ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AM,CAAC,IAAI,CAAC,MAAM,CAAe,CAAC;AAC1C,CAAC;AAXD,0CAWC;AAED;;;GAGG;AACH,SAAgB,wBAAwB,CACvC,IAA0B,EAC1B,GAAa,EACb,eAAwB;IAExB,MAAM,QAAQ,GAAG,sBAAsB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrD,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC;QACzD,IAAI,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,gEAAgE;YAChE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;YACrB,IAAI,eAAe,EAAE,CAAC;gBACrB,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACxC,OAAO,IAAI,CAAC,MAAM,CAAC;gBACpB,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;AACF,CAAC;AAjBD,4DAiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FieldKey } from \"../schema-stored/index.js\";\n\nimport { NodeData } from \"./types.js\";\n\n/**\n * This modules provides a simple human readable (and editable) tree format.\n *\n * This implementation can handle all trees (so it does not need a fallback for any special cases),\n * and is not optimized.\n *\n * It's suitable for testing and debugging,\n * though it could also reasonably be used as a fallback for edge cases or for small trees.\n *\n * The serialized format is valid utf-8, and also includes a json compatible intermediate in memory format.\n *\n * This format is currently not stable: its internal contents are not considered public APIs and may change.\n * There is currently no guarantee that data serialized with this library will\n * be loadable with a different version of this library.\n *\n * TODO: stabilize this format (probably after schema are more stable).\n *\n * This format does not include schema: typically schema would be stored alongside data in this format.\n *\n * @privateRemarks A forked version of these types is available at `persistedTreeTextFormat.ts`.\n * Changes to them might necessitate changes to the analogous forked types, or codecs which transcode between\n * them.\n * See persistedTreeTextFormat's module documentation for more details.\n */\n\n/**\n * Json compatible map as object.\n * Keys are FieldKey strings.\n * Values are the content of the field specified by the key.\n *\n * WARNING:\n * Be very careful when using objects as maps:\n * Use `Object.prototype.hasOwnProperty.call(fieldMap, key)` to safely check for keys.\n * Do NOT simply read the field and check for undefined as this will return values for `__proto__`\n * and various methods on Object.prototype, like `hasOwnProperty` and `toString`.\n * This exposes numerous bug possibilities, including prototype pollution.\n *\n * Due to the above issue, try to avoid this type (and the whole object as map pattern).\n * Only use this type when needed for json compatible maps,\n * but even in those cases consider lists of key value pairs for serialization and using `Map`\n * for runtime.\n *\n * @internal\n */\nexport interface FieldMapObject<TChild> {\n\t[key: string]: TChild[];\n}\n\n/**\n * Json comparable tree node, generic over child type.\n * Json compatibility assumes `TChild` is also json compatible.\n * @internal\n */\nexport interface GenericTreeNode<TChild> extends GenericFieldsNode<TChild>, NodeData {}\n\n/**\n * Json comparable field collection, generic over child type.\n * Json compatibility assumes `TChild` is also json compatible.\n * @internal\n */\nexport interface GenericFieldsNode<TChild> {\n\tfields?: FieldMapObject<TChild>;\n}\n\n/**\n * A tree represented using plain JavaScript objects.\n * Can be passed to `JSON.stringify()` to produce a human-readable/editable JSON tree.\n * If the tree may contain an {@link @fluidframework/core-interfaces#IFluidHandle},\n * {@link @fluidframework/shared-object-base#IFluidSerializer.stringify} must be used instead of `JSON.stringify`.\n *\n * JsonableTrees should not store empty fields.\n * @internal\n */\nexport interface JsonableTree extends GenericTreeNode<JsonableTree> {}\n\n/**\n * Get a field from `node`, optionally modifying the tree to create it if missing.\n */\nexport function getGenericTreeField<T>(\n\tnode: GenericFieldsNode<T>,\n\tkey: FieldKey,\n\tcreateIfMissing: boolean,\n): T[] {\n\tconst children = getGenericTreeFieldMap(node, createIfMissing);\n\n\t// Do not just read field and check for undefined: see warning on FieldMapObject.\n\tif (Object.prototype.hasOwnProperty.call(children, key)) {\n\t\treturn children[key];\n\t}\n\t// Handle missing field:\n\tif (createIfMissing === false) {\n\t\treturn [];\n\t}\n\tconst newField: T[] = [];\n\tchildren[key] = newField;\n\treturn newField;\n}\n\n/**\n * Get a FieldMap from `node`, optionally modifying the tree to create it if missing.\n */\nfunction getGenericTreeFieldMap<T>(\n\tnode: GenericFieldsNode<T>,\n\tcreateIfMissing: boolean,\n): FieldMapObject<T> {\n\tlet children = node.fields;\n\tif (children === undefined) {\n\t\tchildren = {};\n\t\t// Handle missing fields:\n\t\tif (createIfMissing) {\n\t\t\tnode.fields = children;\n\t\t}\n\t}\n\n\treturn children;\n}\n\n/**\n * Sets a field on `node`.\n */\nexport function setGenericTreeField<T>(\n\tnode: GenericFieldsNode<T>,\n\tkey: FieldKey,\n\tcontent: T[],\n): void {\n\tconst children = getGenericTreeFieldMap(node, true);\n\t// like `children[keyString] = content;` except safe when keyString == \"__proto__\".\n\tObject.defineProperty(children, key, {\n\t\tenumerable: true,\n\t\tconfigurable: true,\n\t\twritable: true,\n\t\tvalue: content,\n\t});\n}\n\n/**\n * @returns keys for fields of `tree`.\n */\nexport function genericTreeKeys<T>(tree: GenericFieldsNode<T>): readonly FieldKey[] {\n\tconst fields = tree.fields;\n\t// This function is used when iterating through a tree.\n\t// This means that this is often called on nodes with no keys\n\t// (most trees are a large portion leaf nodes).\n\t// Therefore this function special cases empty fields objects as an optimization.\n\tif (fields === undefined) {\n\t\treturn [];\n\t}\n\n\treturn Object.keys(fields) as FieldKey[];\n}\n\n/**\n * Delete a field if empty.\n * Optionally delete FieldMapObject if empty as well.\n */\nexport function genericTreeDeleteIfEmpty<T>(\n\tnode: GenericFieldsNode<T>,\n\tkey: FieldKey,\n\tremoveMapObject: boolean,\n): void {\n\tconst children = getGenericTreeFieldMap(node, false);\n\tif (Object.prototype.hasOwnProperty.call(children, key)) {\n\t\tif (children[key].length === 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\t\tdelete children[key];\n\t\t\tif (removeMapObject) {\n\t\t\t\tif (Object.keys(children).length === 0) {\n\t\t\t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,EAAE,GAAG,EAAE;QACpC,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,OAAO;KACd,CAAC,CAAC;AACJ,CAAC;AAbD,kDAaC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAI,IAA0B;IAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,uDAAuD;IACvD,6DAA6D;IAC7D,+CAA+C;IAC/C,iFAAiF;IACjF,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,EAAE,CAAC;IACX,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAe,CAAC;AAC1C,CAAC;AAXD,0CAWC;AAED;;;GAGG;AACH,SAAgB,wBAAwB,CACvC,IAA0B,EAC1B,GAAa,EACb,eAAwB;IAExB,MAAM,QAAQ,GAAG,sBAAsB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrD,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC;QACzD,IAAI,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,gEAAgE;YAChE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;YACrB,IAAI,eAAe,EAAE,CAAC;gBACrB,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACxC,OAAO,IAAI,CAAC,MAAM,CAAC;gBACpB,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;AACF,CAAC;AAjBD,4DAiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type { NodeData } from \"./types.js\";\n\n/**\n * This modules provides a simple human readable (and editable) tree format.\n *\n * This implementation can handle all trees (so it does not need a fallback for any special cases),\n * and is not optimized.\n *\n * It's suitable for testing and debugging,\n * though it could also reasonably be used as a fallback for edge cases or for small trees.\n *\n * The serialized format is valid utf-8, and also includes a json compatible intermediate in memory format.\n *\n * This format is currently not stable: its internal contents are not considered public APIs and may change.\n * There is currently no guarantee that data serialized with this library will\n * be loadable with a different version of this library.\n *\n * TODO: stabilize this format (probably after schema are more stable).\n *\n * This format does not include schema: typically schema would be stored alongside data in this format.\n *\n * @privateRemarks A forked version of these types is available at `persistedTreeTextFormat.ts`.\n * Changes to them might necessitate changes to the analogous forked types, or codecs which transcode between\n * them.\n * See persistedTreeTextFormat's module documentation for more details.\n */\n\n/**\n * Json compatible map as object.\n * Keys are FieldKey strings.\n * Values are the content of the field specified by the key.\n *\n * WARNING:\n * Be very careful when using objects as maps:\n * Use `Object.prototype.hasOwnProperty.call(fieldMap, key)` to safely check for keys.\n * Do NOT simply read the field and check for undefined as this will return values for `__proto__`\n * and various methods on Object.prototype, like `hasOwnProperty` and `toString`.\n * This exposes numerous bug possibilities, including prototype pollution.\n *\n * Due to the above issue, try to avoid this type (and the whole object as map pattern).\n * Only use this type when needed for json compatible maps,\n * but even in those cases consider lists of key value pairs for serialization and using `Map`\n * for runtime.\n *\n * @internal\n */\nexport interface FieldMapObject<TChild> {\n\t[key: string]: TChild[];\n}\n\n/**\n * Json comparable tree node, generic over child type.\n * Json compatibility assumes `TChild` is also json compatible.\n * @internal\n */\nexport interface GenericTreeNode<TChild> extends GenericFieldsNode<TChild>, NodeData {}\n\n/**\n * Json comparable field collection, generic over child type.\n * Json compatibility assumes `TChild` is also json compatible.\n * @internal\n */\nexport interface GenericFieldsNode<TChild> {\n\tfields?: FieldMapObject<TChild>;\n}\n\n/**\n * A tree represented using plain JavaScript objects.\n * Can be passed to `JSON.stringify()` to produce a human-readable/editable JSON tree.\n * If the tree may contain an {@link @fluidframework/core-interfaces#IFluidHandle},\n * {@link @fluidframework/shared-object-base#IFluidSerializer.stringify} must be used instead of `JSON.stringify`.\n *\n * JsonableTrees should not store empty fields.\n * @internal\n */\nexport interface JsonableTree extends GenericTreeNode<JsonableTree> {}\n\n/**\n * Get a field from `node`, optionally modifying the tree to create it if missing.\n */\nexport function getGenericTreeField<T>(\n\tnode: GenericFieldsNode<T>,\n\tkey: FieldKey,\n\tcreateIfMissing: boolean,\n): T[] {\n\tconst children = getGenericTreeFieldMap(node, createIfMissing);\n\n\t// Do not just read field and check for undefined: see warning on FieldMapObject.\n\tif (Object.prototype.hasOwnProperty.call(children, key)) {\n\t\treturn children[key];\n\t}\n\t// Handle missing field:\n\tif (createIfMissing === false) {\n\t\treturn [];\n\t}\n\tconst newField: T[] = [];\n\tchildren[key] = newField;\n\treturn newField;\n}\n\n/**\n * Get a FieldMap from `node`, optionally modifying the tree to create it if missing.\n */\nfunction getGenericTreeFieldMap<T>(\n\tnode: GenericFieldsNode<T>,\n\tcreateIfMissing: boolean,\n): FieldMapObject<T> {\n\tlet children = node.fields;\n\tif (children === undefined) {\n\t\tchildren = {};\n\t\t// Handle missing fields:\n\t\tif (createIfMissing) {\n\t\t\tnode.fields = children;\n\t\t}\n\t}\n\n\treturn children;\n}\n\n/**\n * Sets a field on `node`.\n */\nexport function setGenericTreeField<T>(\n\tnode: GenericFieldsNode<T>,\n\tkey: FieldKey,\n\tcontent: T[],\n): void {\n\tconst children = getGenericTreeFieldMap(node, true);\n\t// like `children[keyString] = content;` except safe when keyString == \"__proto__\".\n\tObject.defineProperty(children, key, {\n\t\tenumerable: true,\n\t\tconfigurable: true,\n\t\twritable: true,\n\t\tvalue: content,\n\t});\n}\n\n/**\n * @returns keys for fields of `tree`.\n */\nexport function genericTreeKeys<T>(tree: GenericFieldsNode<T>): readonly FieldKey[] {\n\tconst fields = tree.fields;\n\t// This function is used when iterating through a tree.\n\t// This means that this is often called on nodes with no keys\n\t// (most trees are a large portion leaf nodes).\n\t// Therefore this function special cases empty fields objects as an optimization.\n\tif (fields === undefined) {\n\t\treturn [];\n\t}\n\n\treturn Object.keys(fields) as FieldKey[];\n}\n\n/**\n * Delete a field if empty.\n * Optionally delete FieldMapObject if empty as well.\n */\nexport function genericTreeDeleteIfEmpty<T>(\n\tnode: GenericFieldsNode<T>,\n\tkey: FieldKey,\n\tremoveMapObject: boolean,\n): void {\n\tconst children = getGenericTreeFieldMap(node, false);\n\tif (Object.prototype.hasOwnProperty.call(children, key)) {\n\t\tif (children[key].length === 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\t\tdelete children[key];\n\t\t\tif (removeMapObject) {\n\t\t\t\tif (Object.keys(children).length === 0) {\n\t\t\t\t\tdelete node.fields;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IFluidHandle } from "@fluidframework/core-interfaces";
6
- import { Brand, Opaque, InternalUtilTypes } from "../../util/index.js";
7
- import { FieldKey, TreeNodeSchemaIdentifier, ValueSchema } from "../schema-stored/index.js";
5
+ import type { IFluidHandle } from "@fluidframework/core-interfaces";
6
+ import { type Brand, type Opaque, type InternalUtilTypes } from "../../util/index.js";
7
+ import type { FieldKey, TreeNodeSchemaIdentifier, ValueSchema } from "../schema-stored/index.js";
8
8
  /**
9
9
  * @internal
10
10
  */