@fluidframework/tree 2.41.0-338401 → 2.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1111) hide show
  1. package/.vscode/settings.json +1 -0
  2. package/CHANGELOG.md +374 -0
  3. package/api-report/tree.alpha.api.md +21 -7
  4. package/dist/alpha.d.ts +2 -0
  5. package/dist/codec/codec.d.ts +33 -3
  6. package/dist/codec/codec.d.ts.map +1 -1
  7. package/dist/codec/codec.js +13 -3
  8. package/dist/codec/codec.js.map +1 -1
  9. package/dist/codec/index.d.ts +1 -1
  10. package/dist/codec/index.d.ts.map +1 -1
  11. package/dist/codec/index.js.map +1 -1
  12. package/dist/codec/versioned/codec.d.ts +35 -2
  13. package/dist/codec/versioned/codec.d.ts.map +1 -1
  14. package/dist/codec/versioned/codec.js +38 -3
  15. package/dist/codec/versioned/codec.js.map +1 -1
  16. package/dist/core/index.d.ts +1 -1
  17. package/dist/core/index.d.ts.map +1 -1
  18. package/dist/core/index.js +2 -1
  19. package/dist/core/index.js.map +1 -1
  20. package/dist/core/rebase/types.d.ts +2 -2
  21. package/dist/core/rebase/types.js +2 -2
  22. package/dist/core/rebase/types.js.map +1 -1
  23. package/dist/core/rebase/utils.d.ts +0 -2
  24. package/dist/core/rebase/utils.d.ts.map +1 -1
  25. package/dist/core/rebase/utils.js +6 -10
  26. package/dist/core/rebase/utils.js.map +1 -1
  27. package/dist/core/schema-stored/formatV1.d.ts +0 -1
  28. package/dist/core/schema-stored/formatV1.d.ts.map +1 -1
  29. package/dist/core/schema-stored/formatV1.js +1 -2
  30. package/dist/core/schema-stored/formatV1.js.map +1 -1
  31. package/dist/core/schema-stored/index.d.ts +1 -1
  32. package/dist/core/schema-stored/index.d.ts.map +1 -1
  33. package/dist/core/schema-stored/index.js +2 -1
  34. package/dist/core/schema-stored/index.js.map +1 -1
  35. package/dist/core/schema-stored/schema.d.ts +6 -0
  36. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  37. package/dist/core/schema-stored/schema.js +8 -1
  38. package/dist/core/schema-stored/schema.js.map +1 -1
  39. package/dist/core/tree/anchorSet.d.ts +2 -1
  40. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  41. package/dist/core/tree/anchorSet.js +2 -1
  42. package/dist/core/tree/anchorSet.js.map +1 -1
  43. package/dist/core/tree/detachedFieldIndex.d.ts +2 -2
  44. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  45. package/dist/core/tree/detachedFieldIndex.js +5 -1
  46. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  47. package/dist/core/tree/mapTree.d.ts +2 -1
  48. package/dist/core/tree/mapTree.d.ts.map +1 -1
  49. package/dist/core/tree/mapTree.js +11 -5
  50. package/dist/core/tree/mapTree.js.map +1 -1
  51. package/dist/core/tree/pathTree.d.ts +12 -11
  52. package/dist/core/tree/pathTree.d.ts.map +1 -1
  53. package/dist/core/tree/pathTree.js +8 -7
  54. package/dist/core/tree/pathTree.js.map +1 -1
  55. package/dist/core/tree/treeTextFormat.d.ts +1 -1
  56. package/dist/core/tree/treeTextFormat.js +1 -1
  57. package/dist/core/tree/treeTextFormat.js.map +1 -1
  58. package/dist/core/tree/visitorUtils.d.ts +2 -2
  59. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  60. package/dist/core/tree/visitorUtils.js.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +1 -1
  62. package/dist/feature-libraries/chunked-forest/chunkedForest.js +1 -1
  63. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  64. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -2
  65. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  66. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +1 -1
  67. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  68. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  69. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  70. package/dist/feature-libraries/default-schema/index.js +2 -2
  71. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  72. package/dist/feature-libraries/default-schema/schemaChecker.d.ts +17 -16
  73. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  74. package/dist/feature-libraries/default-schema/schemaChecker.js +54 -38
  75. package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  76. package/dist/feature-libraries/flex-tree/context.d.ts +32 -8
  77. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  78. package/dist/feature-libraries/flex-tree/context.js +22 -6
  79. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  80. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +37 -16
  81. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  82. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +7 -2
  83. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  84. package/dist/feature-libraries/flex-tree/index.d.ts +2 -2
  85. package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
  86. package/dist/feature-libraries/flex-tree/index.js.map +1 -1
  87. package/dist/feature-libraries/flex-tree/lazyField.d.ts +6 -6
  88. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  89. package/dist/feature-libraries/flex-tree/lazyField.js +1 -1
  90. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  91. package/dist/feature-libraries/flex-tree/lazyNode.d.ts +3 -2
  92. package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  93. package/dist/feature-libraries/flex-tree/lazyNode.js +3 -0
  94. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  95. package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  96. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  97. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -3
  98. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  99. package/dist/feature-libraries/forest-summary/forestSummarizer.js +7 -7
  100. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  101. package/dist/feature-libraries/index.d.ts +4 -4
  102. package/dist/feature-libraries/index.d.ts.map +1 -1
  103. package/dist/feature-libraries/index.js +5 -4
  104. package/dist/feature-libraries/index.js.map +1 -1
  105. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +2 -2
  106. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  107. package/dist/feature-libraries/indexing/anchorTreeIndex.js +15 -15
  108. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  109. package/dist/feature-libraries/mapTreeCursor.d.ts +39 -3
  110. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  111. package/dist/feature-libraries/mapTreeCursor.js +45 -7
  112. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  113. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  114. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  115. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +1 -1
  116. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  117. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  118. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +1 -1
  119. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +1 -1
  120. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
  121. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  122. package/dist/feature-libraries/modular-schema/genericFieldKind.js +2 -2
  123. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  124. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  125. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  126. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
  127. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  128. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +0 -2
  129. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  130. package/dist/feature-libraries/modular-schema/isNeverTree.js +0 -2
  131. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  132. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +1 -1
  133. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  134. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +5 -5
  135. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  136. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -0
  137. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  138. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +2 -0
  139. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  140. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  141. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  142. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts.map +1 -1
  143. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +8 -3
  144. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  145. package/dist/feature-libraries/object-forest/objectForest.d.ts +22 -5
  146. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  147. package/dist/feature-libraries/object-forest/objectForest.js +296 -207
  148. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  149. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -2
  150. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  151. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +3 -2
  152. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  153. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  154. package/dist/feature-libraries/schema-index/codec.d.ts +6 -12
  155. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  156. package/dist/feature-libraries/schema-index/codec.js +8 -15
  157. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  158. package/dist/feature-libraries/schema-index/formatV1.d.ts +2 -2
  159. package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  160. package/dist/feature-libraries/schema-index/formatV1.js +1 -1
  161. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
  162. package/dist/feature-libraries/schema-index/index.d.ts +1 -1
  163. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  164. package/dist/feature-libraries/schema-index/index.js +1 -2
  165. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  166. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -1
  167. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  168. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  169. package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  170. package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -1
  171. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  172. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  173. package/dist/feature-libraries/sequence-field/prune.d.ts.map +1 -1
  174. package/dist/feature-libraries/sequence-field/prune.js.map +1 -1
  175. package/dist/feature-libraries/sequence-field/rebase.js +1 -1
  176. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  177. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +1 -1
  178. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
  179. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  180. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  181. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  182. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +1 -1
  183. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
  184. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
  185. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
  186. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  187. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  188. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
  189. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  190. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +1 -1
  191. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  192. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +2 -2
  193. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  194. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +1 -1
  195. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  196. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  197. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +1 -1
  198. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  199. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  200. package/dist/feature-libraries/sequence-field/utils.d.ts +7 -5
  201. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  202. package/dist/feature-libraries/sequence-field/utils.js +7 -5
  203. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  204. package/dist/feature-libraries/treeCursorUtils.d.ts +5 -1
  205. package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  206. package/dist/feature-libraries/treeCursorUtils.js +10 -4
  207. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  208. package/dist/feature-libraries/treeTextCursor.d.ts +1 -1
  209. package/dist/feature-libraries/treeTextCursor.js +1 -1
  210. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  211. package/dist/index.d.ts +3 -3
  212. package/dist/index.d.ts.map +1 -1
  213. package/dist/index.js +2 -6
  214. package/dist/index.js.map +1 -1
  215. package/dist/packageVersion.d.ts +1 -1
  216. package/dist/packageVersion.d.ts.map +1 -1
  217. package/dist/packageVersion.js +1 -1
  218. package/dist/packageVersion.js.map +1 -1
  219. package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
  220. package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -1
  221. package/dist/shared-tree/independentView.d.ts +1 -1
  222. package/dist/shared-tree/independentView.d.ts.map +1 -1
  223. package/dist/shared-tree/independentView.js +8 -3
  224. package/dist/shared-tree/independentView.js.map +1 -1
  225. package/dist/shared-tree/index.d.ts +1 -1
  226. package/dist/shared-tree/index.d.ts.map +1 -1
  227. package/dist/shared-tree/index.js.map +1 -1
  228. package/dist/shared-tree/schematizeTree.d.ts +1 -1
  229. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  230. package/dist/shared-tree/schematizeTree.js.map +1 -1
  231. package/dist/shared-tree/schematizingTreeView.d.ts +12 -2
  232. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  233. package/dist/shared-tree/schematizingTreeView.js +37 -23
  234. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  235. package/dist/shared-tree/sharedTree.d.ts +6 -6
  236. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  237. package/dist/shared-tree/sharedTree.js +9 -8
  238. package/dist/shared-tree/sharedTree.js.map +1 -1
  239. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  240. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  241. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  242. package/dist/shared-tree/tree.d.ts.map +1 -1
  243. package/dist/shared-tree/tree.js +9 -25
  244. package/dist/shared-tree/tree.js.map +1 -1
  245. package/dist/shared-tree/treeAlpha.d.ts +78 -5
  246. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  247. package/dist/shared-tree/treeAlpha.js +52 -8
  248. package/dist/shared-tree/treeAlpha.js.map +1 -1
  249. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  250. package/dist/shared-tree/treeCheckout.js +8 -4
  251. package/dist/shared-tree/treeCheckout.js.map +1 -1
  252. package/dist/shared-tree-core/branch.d.ts +2 -2
  253. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  254. package/dist/shared-tree-core/branch.js +2 -2
  255. package/dist/shared-tree-core/branch.js.map +1 -1
  256. package/dist/shared-tree-core/branchCommitEnricher.d.ts +1 -1
  257. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  258. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  259. package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  260. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  261. package/dist/shared-tree-core/editManager.d.ts +3 -1
  262. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  263. package/dist/shared-tree-core/editManager.js +4 -2
  264. package/dist/shared-tree-core/editManager.js.map +1 -1
  265. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  266. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  267. package/dist/shared-tree-core/editManagerSummarizer.d.ts +1 -1
  268. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  269. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  270. package/dist/shared-tree-core/messageCodecs.d.ts +1 -1
  271. package/dist/shared-tree-core/messageCodecs.js +1 -1
  272. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  273. package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  274. package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
  275. package/dist/shared-tree-core/sharedTreeCore.d.ts +2 -2
  276. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  277. package/dist/shared-tree-core/sharedTreeCore.js +4 -4
  278. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  279. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  280. package/dist/shared-tree-core/transaction.js +1 -1
  281. package/dist/shared-tree-core/transaction.js.map +1 -1
  282. package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  283. package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
  284. package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
  285. package/dist/simple-tree/api/conciseTree.js +1 -1
  286. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  287. package/dist/simple-tree/api/configuration.d.ts +2 -2
  288. package/dist/simple-tree/api/configuration.js +5 -5
  289. package/dist/simple-tree/api/configuration.js.map +1 -1
  290. package/dist/simple-tree/api/create.d.ts +10 -29
  291. package/dist/simple-tree/api/create.d.ts.map +1 -1
  292. package/dist/simple-tree/api/create.js +27 -51
  293. package/dist/simple-tree/api/create.js.map +1 -1
  294. package/dist/simple-tree/api/customTree.d.ts +5 -1
  295. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  296. package/dist/simple-tree/api/customTree.js +33 -25
  297. package/dist/simple-tree/api/customTree.js.map +1 -1
  298. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  299. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  300. package/dist/simple-tree/api/identifierIndex.js +2 -2
  301. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  302. package/dist/simple-tree/api/index.d.ts +2 -3
  303. package/dist/simple-tree/api/index.d.ts.map +1 -1
  304. package/dist/simple-tree/api/index.js +2 -10
  305. package/dist/simple-tree/api/index.js.map +1 -1
  306. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  307. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  308. package/dist/simple-tree/api/schemaFactory.d.ts +14 -6
  309. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  310. package/dist/simple-tree/api/schemaFactory.js +45 -16
  311. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  312. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +1 -3
  313. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  314. package/dist/simple-tree/api/schemaFactoryAlpha.js +4 -6
  315. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  316. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +2 -2
  317. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  318. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  319. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  320. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  321. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  322. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  323. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +4 -6
  324. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  325. package/dist/simple-tree/api/storedSchema.d.ts +1 -1
  326. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  327. package/dist/simple-tree/api/storedSchema.js +7 -6
  328. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  329. package/dist/simple-tree/api/tree.d.ts +2 -2
  330. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  331. package/dist/simple-tree/api/tree.js.map +1 -1
  332. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  333. package/dist/simple-tree/api/treeBeta.js +1 -1
  334. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  335. package/dist/simple-tree/api/treeNodeApi.d.ts +44 -6
  336. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  337. package/dist/simple-tree/api/treeNodeApi.js +56 -29
  338. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  339. package/dist/simple-tree/api/typesUnsafe.d.ts +1 -1
  340. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  341. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  342. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  343. package/dist/simple-tree/api/verboseTree.js +15 -12
  344. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  345. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  346. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +4 -6
  347. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  348. package/dist/simple-tree/core/context.d.ts.map +1 -1
  349. package/dist/simple-tree/core/context.js.map +1 -1
  350. package/dist/simple-tree/core/getOrCreateNode.d.ts +1 -1
  351. package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  352. package/dist/simple-tree/core/getOrCreateNode.js +2 -1
  353. package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
  354. package/dist/simple-tree/core/index.d.ts +2 -2
  355. package/dist/simple-tree/core/index.d.ts.map +1 -1
  356. package/dist/simple-tree/core/index.js +3 -4
  357. package/dist/simple-tree/core/index.js.map +1 -1
  358. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  359. package/dist/simple-tree/core/treeNode.js +1 -1
  360. package/dist/simple-tree/core/treeNode.js.map +1 -1
  361. package/dist/simple-tree/core/treeNodeKernel.d.ts +18 -28
  362. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  363. package/dist/simple-tree/core/treeNodeKernel.js +28 -35
  364. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  365. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  366. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  367. package/dist/simple-tree/core/types.d.ts.map +1 -1
  368. package/dist/simple-tree/core/types.js.map +1 -1
  369. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +128 -59
  370. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  371. package/dist/simple-tree/core/unhydratedFlexTree.js +180 -193
  372. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  373. package/dist/simple-tree/core/withType.d.ts +1 -1
  374. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  375. package/dist/simple-tree/core/withType.js.map +1 -1
  376. package/dist/simple-tree/createContext.d.ts.map +1 -1
  377. package/dist/simple-tree/createContext.js.map +1 -1
  378. package/dist/simple-tree/getTreeNodeForField.d.ts.map +1 -1
  379. package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
  380. package/dist/simple-tree/index.d.ts +4 -11
  381. package/dist/simple-tree/index.d.ts.map +1 -1
  382. package/dist/simple-tree/index.js +16 -24
  383. package/dist/simple-tree/index.js.map +1 -1
  384. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  385. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  386. package/dist/simple-tree/{arrayNode.d.ts → node-kinds/array/arrayNode.d.ts} +3 -3
  387. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -0
  388. package/dist/simple-tree/{arrayNode.js → node-kinds/array/arrayNode.js} +12 -13
  389. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -0
  390. package/dist/simple-tree/{arrayNodeTypes.d.ts → node-kinds/array/arrayNodeTypes.d.ts} +3 -3
  391. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -0
  392. package/dist/simple-tree/{arrayNodeTypes.js → node-kinds/array/arrayNodeTypes.js} +1 -1
  393. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -0
  394. package/dist/simple-tree/node-kinds/array/index.d.ts +7 -0
  395. package/dist/simple-tree/node-kinds/array/index.d.ts.map +1 -0
  396. package/dist/simple-tree/node-kinds/array/index.js +16 -0
  397. package/dist/simple-tree/node-kinds/array/index.js.map +1 -0
  398. package/dist/simple-tree/node-kinds/index.d.ts +8 -0
  399. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -0
  400. package/dist/simple-tree/node-kinds/index.js +25 -0
  401. package/dist/simple-tree/node-kinds/index.js.map +1 -0
  402. package/dist/simple-tree/node-kinds/map/index.d.ts +7 -0
  403. package/dist/simple-tree/node-kinds/map/index.d.ts.map +1 -0
  404. package/dist/simple-tree/node-kinds/map/index.js +13 -0
  405. package/dist/simple-tree/node-kinds/map/index.js.map +1 -0
  406. package/{lib/simple-tree → dist/simple-tree/node-kinds/map}/mapNode.d.ts +3 -3
  407. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -0
  408. package/dist/simple-tree/{mapNode.js → node-kinds/map/mapNode.js} +9 -9
  409. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -0
  410. package/dist/simple-tree/{mapNodeTypes.d.ts → node-kinds/map/mapNodeTypes.d.ts} +3 -3
  411. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -0
  412. package/dist/simple-tree/{mapNodeTypes.js → node-kinds/map/mapNodeTypes.js} +1 -1
  413. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -0
  414. package/dist/simple-tree/node-kinds/object/index.d.ts +7 -0
  415. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -0
  416. package/dist/simple-tree/node-kinds/object/index.js +15 -0
  417. package/dist/simple-tree/node-kinds/object/index.js.map +1 -0
  418. package/{lib/simple-tree → dist/simple-tree/node-kinds/object}/objectNode.d.ts +6 -6
  419. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -0
  420. package/dist/simple-tree/{objectNode.js → node-kinds/object/objectNode.js} +9 -17
  421. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -0
  422. package/{lib/simple-tree → dist/simple-tree/node-kinds/object}/objectNodeTypes.d.ts +5 -5
  423. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -0
  424. package/dist/simple-tree/{objectNodeTypes.js → node-kinds/object/objectNodeTypes.js} +1 -1
  425. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -0
  426. package/dist/simple-tree/prepareForInsertion.d.ts +20 -6
  427. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  428. package/dist/simple-tree/prepareForInsertion.js +26 -19
  429. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  430. package/dist/simple-tree/schemaTypes.d.ts +9 -9
  431. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  432. package/dist/simple-tree/schemaTypes.js.map +1 -1
  433. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  434. package/dist/simple-tree/simpleSchema.js.map +1 -1
  435. package/dist/simple-tree/toStoredSchema.d.ts +6 -1
  436. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  437. package/dist/simple-tree/toStoredSchema.js +7 -4
  438. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  439. package/dist/simple-tree/treeNodeValid.d.ts +1 -1
  440. package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
  441. package/dist/simple-tree/treeNodeValid.js +10 -10
  442. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  443. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +72 -0
  444. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -0
  445. package/dist/simple-tree/{toMapTree.js → unhydratedFlexTreeFromInsertable.js} +136 -178
  446. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -0
  447. package/dist/simple-tree/walkFieldSchema.d.ts.map +1 -1
  448. package/dist/simple-tree/walkFieldSchema.js.map +1 -1
  449. package/dist/tableSchema.d.ts +10 -10
  450. package/dist/treeFactory.d.ts +1 -1
  451. package/dist/treeFactory.d.ts.map +1 -1
  452. package/dist/treeFactory.js +7 -2
  453. package/dist/treeFactory.js.map +1 -1
  454. package/dist/util/bTreeUtils.d.ts.map +1 -1
  455. package/dist/util/bTreeUtils.js.map +1 -1
  456. package/dist/util/breakable.d.ts +23 -4
  457. package/dist/util/breakable.d.ts.map +1 -1
  458. package/dist/util/breakable.js +12 -3
  459. package/dist/util/breakable.js.map +1 -1
  460. package/dist/util/index.d.ts +1 -1
  461. package/dist/util/index.d.ts.map +1 -1
  462. package/dist/util/index.js +2 -1
  463. package/dist/util/index.js.map +1 -1
  464. package/dist/util/utils.d.ts +4 -0
  465. package/dist/util/utils.d.ts.map +1 -1
  466. package/dist/util/utils.js +8 -1
  467. package/dist/util/utils.js.map +1 -1
  468. package/docs/SharedTree Philosophy.md +5 -5
  469. package/docs/user-facing/schema-evolution.md +1 -1
  470. package/lib/alpha.d.ts +2 -0
  471. package/lib/codec/codec.d.ts +33 -3
  472. package/lib/codec/codec.d.ts.map +1 -1
  473. package/lib/codec/codec.js +13 -3
  474. package/lib/codec/codec.js.map +1 -1
  475. package/lib/codec/index.d.ts +1 -1
  476. package/lib/codec/index.d.ts.map +1 -1
  477. package/lib/codec/index.js.map +1 -1
  478. package/lib/codec/versioned/codec.d.ts +35 -2
  479. package/lib/codec/versioned/codec.d.ts.map +1 -1
  480. package/lib/codec/versioned/codec.js +36 -2
  481. package/lib/codec/versioned/codec.js.map +1 -1
  482. package/lib/core/index.d.ts +1 -1
  483. package/lib/core/index.d.ts.map +1 -1
  484. package/lib/core/index.js +1 -1
  485. package/lib/core/index.js.map +1 -1
  486. package/lib/core/rebase/types.d.ts +2 -2
  487. package/lib/core/rebase/types.js +2 -2
  488. package/lib/core/rebase/types.js.map +1 -1
  489. package/lib/core/rebase/utils.d.ts +0 -2
  490. package/lib/core/rebase/utils.d.ts.map +1 -1
  491. package/lib/core/rebase/utils.js +6 -10
  492. package/lib/core/rebase/utils.js.map +1 -1
  493. package/lib/core/schema-stored/formatV1.d.ts +0 -1
  494. package/lib/core/schema-stored/formatV1.d.ts.map +1 -1
  495. package/lib/core/schema-stored/formatV1.js +0 -1
  496. package/lib/core/schema-stored/formatV1.js.map +1 -1
  497. package/lib/core/schema-stored/index.d.ts +1 -1
  498. package/lib/core/schema-stored/index.d.ts.map +1 -1
  499. package/lib/core/schema-stored/index.js +1 -1
  500. package/lib/core/schema-stored/index.js.map +1 -1
  501. package/lib/core/schema-stored/schema.d.ts +6 -0
  502. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  503. package/lib/core/schema-stored/schema.js +7 -0
  504. package/lib/core/schema-stored/schema.js.map +1 -1
  505. package/lib/core/tree/anchorSet.d.ts +2 -1
  506. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  507. package/lib/core/tree/anchorSet.js +2 -1
  508. package/lib/core/tree/anchorSet.js.map +1 -1
  509. package/lib/core/tree/detachedFieldIndex.d.ts +2 -2
  510. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  511. package/lib/core/tree/detachedFieldIndex.js +6 -2
  512. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  513. package/lib/core/tree/mapTree.d.ts +2 -1
  514. package/lib/core/tree/mapTree.d.ts.map +1 -1
  515. package/lib/core/tree/mapTree.js +11 -5
  516. package/lib/core/tree/mapTree.js.map +1 -1
  517. package/lib/core/tree/pathTree.d.ts +12 -11
  518. package/lib/core/tree/pathTree.d.ts.map +1 -1
  519. package/lib/core/tree/pathTree.js +8 -7
  520. package/lib/core/tree/pathTree.js.map +1 -1
  521. package/lib/core/tree/treeTextFormat.d.ts +1 -1
  522. package/lib/core/tree/treeTextFormat.js +1 -1
  523. package/lib/core/tree/treeTextFormat.js.map +1 -1
  524. package/lib/core/tree/visitorUtils.d.ts +2 -2
  525. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  526. package/lib/core/tree/visitorUtils.js.map +1 -1
  527. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +1 -1
  528. package/lib/feature-libraries/chunked-forest/chunkedForest.js +1 -1
  529. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  530. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -2
  531. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  532. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +1 -1
  533. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  534. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  535. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  536. package/lib/feature-libraries/default-schema/index.js +1 -1
  537. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  538. package/lib/feature-libraries/default-schema/schemaChecker.d.ts +17 -16
  539. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  540. package/lib/feature-libraries/default-schema/schemaChecker.js +53 -37
  541. package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  542. package/lib/feature-libraries/flex-tree/context.d.ts +32 -8
  543. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  544. package/lib/feature-libraries/flex-tree/context.js +23 -7
  545. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  546. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +37 -16
  547. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  548. package/lib/feature-libraries/flex-tree/flexTreeTypes.js +7 -2
  549. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  550. package/lib/feature-libraries/flex-tree/index.d.ts +2 -2
  551. package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
  552. package/lib/feature-libraries/flex-tree/index.js.map +1 -1
  553. package/lib/feature-libraries/flex-tree/lazyField.d.ts +6 -6
  554. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  555. package/lib/feature-libraries/flex-tree/lazyField.js +1 -1
  556. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  557. package/lib/feature-libraries/flex-tree/lazyNode.d.ts +3 -2
  558. package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  559. package/lib/feature-libraries/flex-tree/lazyNode.js +3 -0
  560. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  561. package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  562. package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
  563. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -3
  564. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  565. package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -2
  566. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  567. package/lib/feature-libraries/index.d.ts +4 -4
  568. package/lib/feature-libraries/index.d.ts.map +1 -1
  569. package/lib/feature-libraries/index.js +3 -3
  570. package/lib/feature-libraries/index.js.map +1 -1
  571. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +2 -2
  572. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  573. package/lib/feature-libraries/indexing/anchorTreeIndex.js +1 -1
  574. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  575. package/lib/feature-libraries/mapTreeCursor.d.ts +39 -3
  576. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  577. package/lib/feature-libraries/mapTreeCursor.js +43 -7
  578. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  579. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  580. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  581. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +1 -1
  582. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  583. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  584. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +1 -1
  585. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +1 -1
  586. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
  587. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  588. package/lib/feature-libraries/modular-schema/genericFieldKind.js +2 -2
  589. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  590. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  591. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  592. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
  593. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  594. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +0 -2
  595. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  596. package/lib/feature-libraries/modular-schema/isNeverTree.js +0 -2
  597. package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  598. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +1 -1
  599. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  600. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +5 -5
  601. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  602. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -0
  603. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  604. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +2 -0
  605. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  606. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  607. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  608. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts.map +1 -1
  609. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +8 -3
  610. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  611. package/lib/feature-libraries/object-forest/objectForest.d.ts +22 -5
  612. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  613. package/lib/feature-libraries/object-forest/objectForest.js +299 -209
  614. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  615. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -2
  616. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  617. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +4 -3
  618. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  619. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  620. package/lib/feature-libraries/schema-index/codec.d.ts +6 -12
  621. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  622. package/lib/feature-libraries/schema-index/codec.js +8 -15
  623. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  624. package/lib/feature-libraries/schema-index/formatV1.d.ts +2 -2
  625. package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  626. package/lib/feature-libraries/schema-index/formatV1.js +2 -2
  627. package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
  628. package/lib/feature-libraries/schema-index/index.d.ts +1 -1
  629. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  630. package/lib/feature-libraries/schema-index/index.js +1 -1
  631. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  632. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -1
  633. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  634. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  635. package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  636. package/lib/feature-libraries/sequence-field/formatV3.js.map +1 -1
  637. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  638. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  639. package/lib/feature-libraries/sequence-field/prune.d.ts.map +1 -1
  640. package/lib/feature-libraries/sequence-field/prune.js.map +1 -1
  641. package/lib/feature-libraries/sequence-field/rebase.js +1 -1
  642. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  643. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +1 -1
  644. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
  645. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  646. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  647. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  648. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +1 -1
  649. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
  650. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
  651. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
  652. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  653. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  654. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
  655. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  656. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +1 -1
  657. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  658. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +2 -2
  659. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  660. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +1 -1
  661. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  662. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  663. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +1 -1
  664. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  665. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  666. package/lib/feature-libraries/sequence-field/utils.d.ts +7 -5
  667. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  668. package/lib/feature-libraries/sequence-field/utils.js +7 -5
  669. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  670. package/lib/feature-libraries/treeCursorUtils.d.ts +5 -1
  671. package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  672. package/lib/feature-libraries/treeCursorUtils.js +10 -4
  673. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  674. package/lib/feature-libraries/treeTextCursor.d.ts +1 -1
  675. package/lib/feature-libraries/treeTextCursor.js +1 -1
  676. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  677. package/lib/index.d.ts +3 -3
  678. package/lib/index.d.ts.map +1 -1
  679. package/lib/index.js +0 -2
  680. package/lib/index.js.map +1 -1
  681. package/lib/packageVersion.d.ts +1 -1
  682. package/lib/packageVersion.d.ts.map +1 -1
  683. package/lib/packageVersion.js +1 -1
  684. package/lib/packageVersion.js.map +1 -1
  685. package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
  686. package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -1
  687. package/lib/shared-tree/independentView.d.ts +1 -1
  688. package/lib/shared-tree/independentView.d.ts.map +1 -1
  689. package/lib/shared-tree/independentView.js +10 -5
  690. package/lib/shared-tree/independentView.js.map +1 -1
  691. package/lib/shared-tree/index.d.ts +1 -1
  692. package/lib/shared-tree/index.d.ts.map +1 -1
  693. package/lib/shared-tree/index.js +1 -1
  694. package/lib/shared-tree/index.js.map +1 -1
  695. package/lib/shared-tree/schematizeTree.d.ts +1 -1
  696. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  697. package/lib/shared-tree/schematizeTree.js.map +1 -1
  698. package/lib/shared-tree/schematizingTreeView.d.ts +12 -2
  699. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  700. package/lib/shared-tree/schematizingTreeView.js +35 -22
  701. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  702. package/lib/shared-tree/sharedTree.d.ts +6 -6
  703. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  704. package/lib/shared-tree/sharedTree.js +12 -11
  705. package/lib/shared-tree/sharedTree.js.map +1 -1
  706. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  707. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  708. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  709. package/lib/shared-tree/tree.d.ts.map +1 -1
  710. package/lib/shared-tree/tree.js +2 -18
  711. package/lib/shared-tree/tree.js.map +1 -1
  712. package/lib/shared-tree/treeAlpha.d.ts +78 -5
  713. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  714. package/lib/shared-tree/treeAlpha.js +53 -9
  715. package/lib/shared-tree/treeAlpha.js.map +1 -1
  716. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  717. package/lib/shared-tree/treeCheckout.js +9 -5
  718. package/lib/shared-tree/treeCheckout.js.map +1 -1
  719. package/lib/shared-tree-core/branch.d.ts +2 -2
  720. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  721. package/lib/shared-tree-core/branch.js +2 -2
  722. package/lib/shared-tree-core/branch.js.map +1 -1
  723. package/lib/shared-tree-core/branchCommitEnricher.d.ts +1 -1
  724. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  725. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  726. package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  727. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  728. package/lib/shared-tree-core/editManager.d.ts +3 -1
  729. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  730. package/lib/shared-tree-core/editManager.js +4 -2
  731. package/lib/shared-tree-core/editManager.js.map +1 -1
  732. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  733. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  734. package/lib/shared-tree-core/editManagerSummarizer.d.ts +1 -1
  735. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  736. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  737. package/lib/shared-tree-core/messageCodecs.d.ts +1 -1
  738. package/lib/shared-tree-core/messageCodecs.js +1 -1
  739. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  740. package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  741. package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
  742. package/lib/shared-tree-core/sharedTreeCore.d.ts +2 -2
  743. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  744. package/lib/shared-tree-core/sharedTreeCore.js +4 -4
  745. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  746. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  747. package/lib/shared-tree-core/transaction.js +1 -1
  748. package/lib/shared-tree-core/transaction.js.map +1 -1
  749. package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  750. package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
  751. package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
  752. package/lib/simple-tree/api/conciseTree.js +1 -1
  753. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  754. package/lib/simple-tree/api/configuration.d.ts +2 -2
  755. package/lib/simple-tree/api/configuration.js +2 -2
  756. package/lib/simple-tree/api/configuration.js.map +1 -1
  757. package/lib/simple-tree/api/create.d.ts +10 -29
  758. package/lib/simple-tree/api/create.d.ts.map +1 -1
  759. package/lib/simple-tree/api/create.js +23 -45
  760. package/lib/simple-tree/api/create.js.map +1 -1
  761. package/lib/simple-tree/api/customTree.d.ts +5 -1
  762. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  763. package/lib/simple-tree/api/customTree.js +10 -3
  764. package/lib/simple-tree/api/customTree.js.map +1 -1
  765. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  766. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
  767. package/lib/simple-tree/api/identifierIndex.js +1 -1
  768. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  769. package/lib/simple-tree/api/index.d.ts +2 -3
  770. package/lib/simple-tree/api/index.d.ts.map +1 -1
  771. package/lib/simple-tree/api/index.js +2 -5
  772. package/lib/simple-tree/api/index.js.map +1 -1
  773. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  774. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  775. package/lib/simple-tree/api/schemaFactory.d.ts +14 -6
  776. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  777. package/lib/simple-tree/api/schemaFactory.js +44 -15
  778. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  779. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +1 -3
  780. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  781. package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -3
  782. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  783. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +2 -2
  784. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  785. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  786. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  787. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  788. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  789. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  790. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +1 -3
  791. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  792. package/lib/simple-tree/api/storedSchema.d.ts +1 -1
  793. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  794. package/lib/simple-tree/api/storedSchema.js +3 -2
  795. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  796. package/lib/simple-tree/api/tree.d.ts +2 -2
  797. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  798. package/lib/simple-tree/api/tree.js.map +1 -1
  799. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  800. package/lib/simple-tree/api/treeBeta.js +1 -1
  801. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  802. package/lib/simple-tree/api/treeNodeApi.d.ts +44 -6
  803. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  804. package/lib/simple-tree/api/treeNodeApi.js +55 -29
  805. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  806. package/lib/simple-tree/api/typesUnsafe.d.ts +1 -1
  807. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  808. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  809. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  810. package/lib/simple-tree/api/verboseTree.js +14 -11
  811. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  812. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  813. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +1 -3
  814. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  815. package/lib/simple-tree/core/context.d.ts.map +1 -1
  816. package/lib/simple-tree/core/context.js.map +1 -1
  817. package/lib/simple-tree/core/getOrCreateNode.d.ts +1 -1
  818. package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  819. package/lib/simple-tree/core/getOrCreateNode.js +3 -2
  820. package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
  821. package/lib/simple-tree/core/index.d.ts +2 -2
  822. package/lib/simple-tree/core/index.d.ts.map +1 -1
  823. package/lib/simple-tree/core/index.js +2 -2
  824. package/lib/simple-tree/core/index.js.map +1 -1
  825. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  826. package/lib/simple-tree/core/treeNode.js +1 -1
  827. package/lib/simple-tree/core/treeNode.js.map +1 -1
  828. package/lib/simple-tree/core/treeNodeKernel.d.ts +18 -28
  829. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  830. package/lib/simple-tree/core/treeNodeKernel.js +26 -34
  831. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  832. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  833. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  834. package/lib/simple-tree/core/types.d.ts.map +1 -1
  835. package/lib/simple-tree/core/types.js.map +1 -1
  836. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +128 -59
  837. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  838. package/lib/simple-tree/core/unhydratedFlexTree.js +167 -182
  839. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  840. package/lib/simple-tree/core/withType.d.ts +1 -1
  841. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  842. package/lib/simple-tree/core/withType.js.map +1 -1
  843. package/lib/simple-tree/createContext.d.ts.map +1 -1
  844. package/lib/simple-tree/createContext.js.map +1 -1
  845. package/lib/simple-tree/getTreeNodeForField.d.ts.map +1 -1
  846. package/lib/simple-tree/getTreeNodeForField.js.map +1 -1
  847. package/lib/simple-tree/index.d.ts +4 -11
  848. package/lib/simple-tree/index.d.ts.map +1 -1
  849. package/lib/simple-tree/index.js +4 -8
  850. package/lib/simple-tree/index.js.map +1 -1
  851. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  852. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  853. package/lib/simple-tree/{arrayNode.d.ts → node-kinds/array/arrayNode.d.ts} +3 -3
  854. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -0
  855. package/lib/simple-tree/{arrayNode.js → node-kinds/array/arrayNode.js} +10 -11
  856. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -0
  857. package/lib/simple-tree/{arrayNodeTypes.d.ts → node-kinds/array/arrayNodeTypes.d.ts} +3 -3
  858. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -0
  859. package/lib/simple-tree/{arrayNodeTypes.js → node-kinds/array/arrayNodeTypes.js} +1 -1
  860. package/{dist/simple-tree → lib/simple-tree/node-kinds/array}/arrayNodeTypes.js.map +1 -1
  861. package/lib/simple-tree/node-kinds/array/index.d.ts +7 -0
  862. package/lib/simple-tree/node-kinds/array/index.d.ts.map +1 -0
  863. package/lib/simple-tree/node-kinds/array/index.js +7 -0
  864. package/lib/simple-tree/node-kinds/array/index.js.map +1 -0
  865. package/lib/simple-tree/node-kinds/index.d.ts +8 -0
  866. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -0
  867. package/lib/simple-tree/node-kinds/index.js +8 -0
  868. package/lib/simple-tree/node-kinds/index.js.map +1 -0
  869. package/lib/simple-tree/node-kinds/map/index.d.ts +7 -0
  870. package/lib/simple-tree/node-kinds/map/index.d.ts.map +1 -0
  871. package/lib/simple-tree/node-kinds/map/index.js +7 -0
  872. package/lib/simple-tree/node-kinds/map/index.js.map +1 -0
  873. package/{dist/simple-tree → lib/simple-tree/node-kinds/map}/mapNode.d.ts +3 -3
  874. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -0
  875. package/lib/simple-tree/{mapNode.js → node-kinds/map/mapNode.js} +9 -9
  876. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -0
  877. package/lib/simple-tree/{mapNodeTypes.d.ts → node-kinds/map/mapNodeTypes.d.ts} +3 -3
  878. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -0
  879. package/lib/simple-tree/{mapNodeTypes.js → node-kinds/map/mapNodeTypes.js} +1 -1
  880. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -0
  881. package/lib/simple-tree/node-kinds/object/index.d.ts +7 -0
  882. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -0
  883. package/lib/simple-tree/node-kinds/object/index.js +7 -0
  884. package/lib/simple-tree/node-kinds/object/index.js.map +1 -0
  885. package/{dist/simple-tree → lib/simple-tree/node-kinds/object}/objectNode.d.ts +6 -6
  886. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -0
  887. package/lib/simple-tree/{objectNode.js → node-kinds/object/objectNode.js} +9 -17
  888. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -0
  889. package/{dist/simple-tree → lib/simple-tree/node-kinds/object}/objectNodeTypes.d.ts +5 -5
  890. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -0
  891. package/lib/simple-tree/{objectNodeTypes.js → node-kinds/object/objectNodeTypes.js} +1 -1
  892. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -0
  893. package/lib/simple-tree/prepareForInsertion.d.ts +20 -6
  894. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  895. package/lib/simple-tree/prepareForInsertion.js +25 -19
  896. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  897. package/lib/simple-tree/schemaTypes.d.ts +9 -9
  898. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  899. package/lib/simple-tree/schemaTypes.js.map +1 -1
  900. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  901. package/lib/simple-tree/simpleSchema.js.map +1 -1
  902. package/lib/simple-tree/toStoredSchema.d.ts +6 -1
  903. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  904. package/lib/simple-tree/toStoredSchema.js +5 -2
  905. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  906. package/lib/simple-tree/treeNodeValid.d.ts +1 -1
  907. package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
  908. package/lib/simple-tree/treeNodeValid.js +2 -2
  909. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  910. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +72 -0
  911. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -0
  912. package/lib/simple-tree/{toMapTree.js → unhydratedFlexTreeFromInsertable.js} +138 -179
  913. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -0
  914. package/lib/simple-tree/walkFieldSchema.d.ts.map +1 -1
  915. package/lib/simple-tree/walkFieldSchema.js.map +1 -1
  916. package/lib/tableSchema.d.ts +10 -10
  917. package/lib/treeFactory.d.ts +1 -1
  918. package/lib/treeFactory.d.ts.map +1 -1
  919. package/lib/treeFactory.js +7 -2
  920. package/lib/treeFactory.js.map +1 -1
  921. package/lib/util/bTreeUtils.d.ts.map +1 -1
  922. package/lib/util/bTreeUtils.js.map +1 -1
  923. package/lib/util/breakable.d.ts +23 -4
  924. package/lib/util/breakable.d.ts.map +1 -1
  925. package/lib/util/breakable.js +12 -3
  926. package/lib/util/breakable.js.map +1 -1
  927. package/lib/util/index.d.ts +1 -1
  928. package/lib/util/index.d.ts.map +1 -1
  929. package/lib/util/index.js +1 -1
  930. package/lib/util/index.js.map +1 -1
  931. package/lib/util/utils.d.ts +4 -0
  932. package/lib/util/utils.d.ts.map +1 -1
  933. package/lib/util/utils.js +6 -0
  934. package/lib/util/utils.js.map +1 -1
  935. package/package.json +22 -22
  936. package/src/codec/codec.ts +37 -6
  937. package/src/codec/index.ts +1 -0
  938. package/src/codec/versioned/codec.ts +42 -5
  939. package/src/core/index.ts +1 -0
  940. package/src/core/rebase/types.ts +2 -2
  941. package/src/core/rebase/utils.ts +10 -10
  942. package/src/core/schema-stored/formatV1.ts +0 -2
  943. package/src/core/schema-stored/index.ts +1 -0
  944. package/src/core/schema-stored/schema.ts +7 -0
  945. package/src/core/tree/anchorSet.ts +2 -1
  946. package/src/core/tree/detachedFieldIndex.ts +13 -4
  947. package/src/core/tree/mapTree.ts +22 -7
  948. package/src/core/tree/pathTree.ts +12 -11
  949. package/src/core/tree/treeTextFormat.ts +1 -1
  950. package/src/core/tree/visitorUtils.ts +2 -2
  951. package/src/feature-libraries/chunked-forest/chunkedForest.ts +1 -1
  952. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +4 -3
  953. package/src/feature-libraries/default-schema/index.ts +1 -1
  954. package/src/feature-libraries/default-schema/schemaChecker.ts +51 -35
  955. package/src/feature-libraries/flex-tree/context.ts +46 -15
  956. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +39 -17
  957. package/src/feature-libraries/flex-tree/index.ts +4 -0
  958. package/src/feature-libraries/flex-tree/lazyField.ts +9 -7
  959. package/src/feature-libraries/flex-tree/lazyNode.ts +6 -2
  960. package/src/feature-libraries/flex-tree/utilities.ts +1 -1
  961. package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -3
  962. package/src/feature-libraries/index.ts +10 -2
  963. package/src/feature-libraries/indexing/anchorTreeIndex.ts +4 -2
  964. package/src/feature-libraries/mapTreeCursor.ts +103 -16
  965. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +1 -0
  966. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +1 -1
  967. package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +1 -1
  968. package/src/feature-libraries/modular-schema/genericFieldKind.ts +4 -2
  969. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -0
  970. package/src/feature-libraries/modular-schema/genericFieldKindTypes.ts +1 -0
  971. package/src/feature-libraries/modular-schema/isNeverTree.ts +0 -2
  972. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +10 -6
  973. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2 -0
  974. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +1 -0
  975. package/src/feature-libraries/node-identifier/mockNodeIdentifierManager.ts +11 -5
  976. package/src/feature-libraries/object-forest/objectForest.ts +65 -7
  977. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +5 -8
  978. package/src/feature-libraries/schema-index/codec.ts +13 -21
  979. package/src/feature-libraries/schema-index/formatV1.ts +2 -2
  980. package/src/feature-libraries/schema-index/index.ts +0 -1
  981. package/src/feature-libraries/schema-index/schemaSummarizer.ts +1 -1
  982. package/src/feature-libraries/sequence-field/formatV3.ts +1 -0
  983. package/src/feature-libraries/sequence-field/markQueue.ts +1 -0
  984. package/src/feature-libraries/sequence-field/prune.ts +1 -0
  985. package/src/feature-libraries/sequence-field/rebase.ts +1 -1
  986. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +1 -1
  987. package/src/feature-libraries/sequence-field/replaceRevisions.ts +3 -1
  988. package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +2 -2
  989. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +3 -3
  990. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +3 -3
  991. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +2 -2
  992. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +1 -1
  993. package/src/feature-libraries/sequence-field/utils.ts +7 -5
  994. package/src/feature-libraries/treeCursorUtils.ts +23 -12
  995. package/src/feature-libraries/treeTextCursor.ts +1 -1
  996. package/src/index.ts +2 -4
  997. package/src/packageVersion.ts +1 -1
  998. package/src/shared-tree/checkoutFlexTreeView.ts +1 -0
  999. package/src/shared-tree/independentView.ts +10 -3
  1000. package/src/shared-tree/index.ts +4 -1
  1001. package/src/shared-tree/schematizeTree.ts +2 -1
  1002. package/src/shared-tree/schematizingTreeView.ts +42 -24
  1003. package/src/shared-tree/sharedTree.ts +35 -22
  1004. package/src/shared-tree/sharedTreeChangeFamily.ts +1 -1
  1005. package/src/shared-tree/tree.ts +6 -21
  1006. package/src/shared-tree/treeAlpha.ts +159 -29
  1007. package/src/shared-tree/treeCheckout.ts +9 -5
  1008. package/src/shared-tree-core/branch.ts +3 -4
  1009. package/src/shared-tree-core/branchCommitEnricher.ts +3 -1
  1010. package/src/shared-tree-core/defaultResubmitMachine.ts +2 -0
  1011. package/src/shared-tree-core/editManager.ts +4 -2
  1012. package/src/shared-tree-core/editManagerCodecs.ts +1 -0
  1013. package/src/shared-tree-core/editManagerSummarizer.ts +1 -1
  1014. package/src/shared-tree-core/messageCodecs.ts +1 -1
  1015. package/src/shared-tree-core/sequenceIdUtils.ts +1 -0
  1016. package/src/shared-tree-core/sharedTreeCore.ts +5 -5
  1017. package/src/shared-tree-core/transaction.ts +4 -2
  1018. package/src/shared-tree-core/transactionEnricher.ts +2 -0
  1019. package/src/simple-tree/api/conciseTree.ts +3 -2
  1020. package/src/simple-tree/api/configuration.ts +4 -4
  1021. package/src/simple-tree/api/create.ts +52 -99
  1022. package/src/simple-tree/api/customTree.ts +14 -4
  1023. package/src/simple-tree/api/getSimpleSchema.ts +1 -0
  1024. package/src/simple-tree/api/identifierIndex.ts +1 -1
  1025. package/src/simple-tree/api/index.ts +2 -14
  1026. package/src/simple-tree/api/schemaCompatibilityTester.ts +2 -0
  1027. package/src/simple-tree/api/schemaFactory.ts +89 -35
  1028. package/src/simple-tree/api/schemaFactoryAlpha.ts +8 -6
  1029. package/src/simple-tree/api/schemaFactoryRecursive.ts +3 -3
  1030. package/src/simple-tree/api/schemaFromSimple.ts +3 -1
  1031. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -3
  1032. package/src/simple-tree/api/storedSchema.ts +5 -4
  1033. package/src/simple-tree/api/tree.ts +3 -4
  1034. package/src/simple-tree/api/treeBeta.ts +3 -2
  1035. package/src/simple-tree/api/treeNodeApi.ts +115 -45
  1036. package/src/simple-tree/api/typesUnsafe.ts +1 -1
  1037. package/src/simple-tree/api/verboseTree.ts +16 -13
  1038. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +1 -3
  1039. package/src/simple-tree/core/context.ts +1 -0
  1040. package/src/simple-tree/core/getOrCreateNode.ts +6 -3
  1041. package/src/simple-tree/core/index.ts +2 -3
  1042. package/src/simple-tree/core/treeNode.ts +1 -1
  1043. package/src/simple-tree/core/treeNodeKernel.ts +47 -62
  1044. package/src/simple-tree/core/treeNodeSchema.ts +1 -0
  1045. package/src/simple-tree/core/types.ts +1 -1
  1046. package/src/simple-tree/core/unhydratedFlexTree.ts +224 -262
  1047. package/src/simple-tree/core/withType.ts +1 -1
  1048. package/src/simple-tree/createContext.ts +1 -0
  1049. package/src/simple-tree/getTreeNodeForField.ts +2 -0
  1050. package/src/simple-tree/index.ts +17 -24
  1051. package/src/simple-tree/leafNodeSchema.ts +1 -0
  1052. package/src/simple-tree/{arrayNode.ts → node-kinds/array/arrayNode.ts} +18 -19
  1053. package/src/simple-tree/{arrayNodeTypes.ts → node-kinds/array/arrayNodeTypes.ts} +3 -3
  1054. package/src/simple-tree/node-kinds/array/index.ts +18 -0
  1055. package/src/simple-tree/node-kinds/index.ts +39 -0
  1056. package/src/simple-tree/node-kinds/map/index.ts +16 -0
  1057. package/src/simple-tree/{mapNode.ts → node-kinds/map/mapNode.ts} +14 -17
  1058. package/src/simple-tree/{mapNodeTypes.ts → node-kinds/map/mapNodeTypes.ts} +3 -3
  1059. package/src/simple-tree/node-kinds/object/index.ts +16 -0
  1060. package/src/simple-tree/{objectNode.ts → node-kinds/object/objectNode.ts} +32 -45
  1061. package/src/simple-tree/{objectNodeTypes.ts → node-kinds/object/objectNodeTypes.ts} +5 -5
  1062. package/src/simple-tree/prepareForInsertion.ts +50 -43
  1063. package/src/simple-tree/schemaTypes.ts +12 -10
  1064. package/src/simple-tree/simpleSchema.ts +1 -0
  1065. package/src/simple-tree/toStoredSchema.ts +10 -3
  1066. package/src/simple-tree/treeNodeValid.ts +3 -3
  1067. package/src/simple-tree/{toMapTree.ts → unhydratedFlexTreeFromInsertable.ts} +138 -249
  1068. package/src/simple-tree/walkFieldSchema.ts +0 -1
  1069. package/src/treeFactory.ts +7 -2
  1070. package/src/util/bTreeUtils.ts +1 -0
  1071. package/src/util/breakable.ts +19 -4
  1072. package/src/util/index.ts +1 -0
  1073. package/src/util/utils.ts +7 -0
  1074. package/dist/simple-tree/api/testRecursiveDomain.d.ts +0 -62
  1075. package/dist/simple-tree/api/testRecursiveDomain.d.ts.map +0 -1
  1076. package/dist/simple-tree/api/testRecursiveDomain.js +0 -45
  1077. package/dist/simple-tree/api/testRecursiveDomain.js.map +0 -1
  1078. package/dist/simple-tree/arrayNode.d.ts.map +0 -1
  1079. package/dist/simple-tree/arrayNode.js.map +0 -1
  1080. package/dist/simple-tree/arrayNodeTypes.d.ts.map +0 -1
  1081. package/dist/simple-tree/mapNode.d.ts.map +0 -1
  1082. package/dist/simple-tree/mapNode.js.map +0 -1
  1083. package/dist/simple-tree/mapNodeTypes.d.ts.map +0 -1
  1084. package/dist/simple-tree/mapNodeTypes.js.map +0 -1
  1085. package/dist/simple-tree/objectNode.d.ts.map +0 -1
  1086. package/dist/simple-tree/objectNode.js.map +0 -1
  1087. package/dist/simple-tree/objectNodeTypes.d.ts.map +0 -1
  1088. package/dist/simple-tree/objectNodeTypes.js.map +0 -1
  1089. package/dist/simple-tree/toMapTree.d.ts +0 -98
  1090. package/dist/simple-tree/toMapTree.d.ts.map +0 -1
  1091. package/dist/simple-tree/toMapTree.js.map +0 -1
  1092. package/lib/simple-tree/api/testRecursiveDomain.d.ts +0 -62
  1093. package/lib/simple-tree/api/testRecursiveDomain.d.ts.map +0 -1
  1094. package/lib/simple-tree/api/testRecursiveDomain.js +0 -41
  1095. package/lib/simple-tree/api/testRecursiveDomain.js.map +0 -1
  1096. package/lib/simple-tree/arrayNode.d.ts.map +0 -1
  1097. package/lib/simple-tree/arrayNode.js.map +0 -1
  1098. package/lib/simple-tree/arrayNodeTypes.d.ts.map +0 -1
  1099. package/lib/simple-tree/arrayNodeTypes.js.map +0 -1
  1100. package/lib/simple-tree/mapNode.d.ts.map +0 -1
  1101. package/lib/simple-tree/mapNode.js.map +0 -1
  1102. package/lib/simple-tree/mapNodeTypes.d.ts.map +0 -1
  1103. package/lib/simple-tree/mapNodeTypes.js.map +0 -1
  1104. package/lib/simple-tree/objectNode.d.ts.map +0 -1
  1105. package/lib/simple-tree/objectNode.js.map +0 -1
  1106. package/lib/simple-tree/objectNodeTypes.d.ts.map +0 -1
  1107. package/lib/simple-tree/objectNodeTypes.js.map +0 -1
  1108. package/lib/simple-tree/toMapTree.d.ts +0 -98
  1109. package/lib/simple-tree/toMapTree.d.ts.map +0 -1
  1110. package/lib/simple-tree/toMapTree.js.map +0 -1
  1111. package/src/simple-tree/api/testRecursiveDomain.ts +0 -53
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/utilities.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAO6B;AAG7B,yDAAgD;AAChD;;;;GAIG;AACH,SAAgB,2BAA2B,CAAC,aAA4B;IACvE,OAAO,aAAa,KAAK,oBAAS,CAAC,CAAC,CAAC,6BAAU,CAAC,UAAU,CAAC,CAAC,CAAC,6BAAU,CAAC,OAAO,CAAC;AACjF,CAAC;AAFD,kEAEC;AAED;;;;;;;;;GASG;AACH,SAAgB,yBAAyB,CAAC,UAAsB;IAC/D,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAiB,CAAC,CAAC;IACtD,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,SAAS,CAAC;IAClD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,kGAAkG;QAClG,OAAO,2BAA2B,CACjC,6BAA6B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAC3D,CAAC;IACH,CAAC;SAAM,CAAC;QACP,wFAAwF;QACxF,IAAI,KAAK,CAAC,gBAAgB,KAAK,gBAAgB,EAAE,CAAC;YACjD,OAAO,2BAA2B,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACzD,CAAC;QACD,kHAAkH;QAClH,OAAO,2BAA2B,CACjC,6BAA6B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAC3D,CAAC;IACH,CAAC;AACF,CAAC;AAlBD,8DAkBC;AAED;;GAEG;AACH,SAAS,6BAA6B,CACrC,UAAsB,EACtB,gBAAwB;IAExB,MAAM,aAAa,GAAG,IAAA,yCAA8B,EAAC,UAAU,CAAC,CAAC;IACjE,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAiB,EAAE;QACvC,gBAAgB;QAChB,aAAa;KACb,CAAC,CAAC;IACH,OAAO,aAAa,CAAC;AACtB,CAAC;AAEY,QAAA,iBAAiB,GAAG,IAAA,qBAAU,GAAsB,CAAC;AAOlE;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,OAAwB;IAC1D,OAAO;QACN,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,YAAY;KAC5B,CAAC;AACH,CAAC;AALD,gDAKC;AAED;;;;;;;;;GASG;AACH,SAAgB,UAAU,CAAC,KAAa,EAAE,MAAc;IACvD,IAAI,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,UAAU,GAAG,CAAC,CAAC;IAChB,CAAC;IACD,IAAI,UAAU,GAAG,CAAC,MAAM,IAAI,UAAU,IAAI,MAAM,EAAE,CAAC;QAClD,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QACpB,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;IAClC,CAAC;IACD,OAAO,UAAU,CAAC;AACnB,CAAC;AAZD,gCAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype AnchorNode,\n\ttype DetachedField,\n\tanchorSlot,\n\tgetDetachedFieldContainingPath,\n\trootField,\n\ttype SchemaAndPolicy,\n} from \"../../core/index.js\";\nimport type { FlexTreeContext } from \"./context.js\";\n\nimport { TreeStatus } from \"./flexTreeTypes.js\";\n/**\n * Checks the detached field and returns the TreeStatus based on whether or not the detached field is a root field.\n * @param detachedField - the detached field you want to check.\n * @returns the {@link TreeStatus} from the detached field provided.\n */\nexport function treeStatusFromDetachedField(detachedField: DetachedField): TreeStatus {\n\treturn detachedField === rootField ? TreeStatus.InDocument : TreeStatus.Removed;\n}\n\n/**\n * Determines the tree status based on the anchor cache.\n *\n * Checks the anchorNode's cache to get the tree status.\n * If the cache is undefined or stale, it is updated and the treeStatus based on its detachedField is returned.\n *\n * @param anchors - the {@link AnchorSet} to compare your anchorNode cache to.\n * @param anchorNode - the {@link AnchorNode} to get the {@link TreeStatus} of.\n * @returns - the {@link TreeStatus} of the anchorNode provided.\n */\nexport function treeStatusFromAnchorCache(anchorNode: AnchorNode): TreeStatus {\n\tconst cache = anchorNode.slots.get(detachedFieldSlot);\n\tconst { generationNumber } = anchorNode.anchorSet;\n\tif (cache === undefined) {\n\t\t// If the cache is undefined, set the cache and return the treeStatus based on the detached field.\n\t\treturn treeStatusFromDetachedField(\n\t\t\tgetCachedUpdatedDetachedField(anchorNode, generationNumber),\n\t\t);\n\t} else {\n\t\t// If the cache is up to date, return the treeStatus based on the cached detached field.\n\t\tif (cache.generationNumber === generationNumber) {\n\t\t\treturn treeStatusFromDetachedField(cache.detachedField);\n\t\t}\n\t\t// If the cache is not up to date, update the cache and return the treeStatus based on the updated detached field.\n\t\treturn treeStatusFromDetachedField(\n\t\t\tgetCachedUpdatedDetachedField(anchorNode, generationNumber),\n\t\t);\n\t}\n}\n\n/**\n * Updates the anchorNode cache with the provided generation number, and returns its detachedField.\n */\nfunction getCachedUpdatedDetachedField(\n\tanchorNode: AnchorNode,\n\tgenerationNumber: number,\n): DetachedField {\n\tconst detachedField = getDetachedFieldContainingPath(anchorNode);\n\tanchorNode.slots.set(detachedFieldSlot, {\n\t\tgenerationNumber,\n\t\tdetachedField,\n\t});\n\treturn detachedField;\n}\n\nexport const detachedFieldSlot = anchorSlot<DetachedFieldCache>();\n\nexport interface DetachedFieldCache {\n\tgenerationNumber: number;\n\tdetachedField: DetachedField;\n}\n\n/**\n * Utility function to get a {@link SchemaAndPolicy} object from a {@link FlexTreeContext}.\n * @returns A {@link SchemaAndPolicy} object with the stored schema and policy from the context provided.\n * For {@link Unhydrated} contexts this schema may only describe the types allowed subtree for this particular entity.\n */\nexport function getSchemaAndPolicy(context: FlexTreeContext): SchemaAndPolicy {\n\treturn {\n\t\tschema: context.schema,\n\t\tpolicy: context.schemaPolicy,\n\t};\n}\n\n/**\n * Indexing for {@link FlexTreeField.boxedAt} and {@link FlexTreeSequenceField.at} supports the\n * usage of negative indices, which regular indexing using `[` and `]` does not.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at\n * for additional context on the semantics.\n *\n * @returns A positive index that can be used in regular indexing. Returns\n * undefined if that index would be out-of-bounds.\n */\nexport function indexForAt(index: number, length: number): number | undefined {\n\tlet finalIndex = Math.trunc(+index);\n\tif (Number.isNaN(finalIndex)) {\n\t\tfinalIndex = 0;\n\t}\n\tif (finalIndex < -length || finalIndex >= length) {\n\t\treturn undefined;\n\t}\n\tif (finalIndex < 0) {\n\t\tfinalIndex = finalIndex + length;\n\t}\n\treturn finalIndex;\n}\n"]}
1
+ {"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/utilities.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAO6B;AAG7B,yDAAgD;AAChD;;;;GAIG;AACH,SAAgB,2BAA2B,CAAC,aAA4B;IACvE,OAAO,aAAa,KAAK,oBAAS,CAAC,CAAC,CAAC,6BAAU,CAAC,UAAU,CAAC,CAAC,CAAC,6BAAU,CAAC,OAAO,CAAC;AACjF,CAAC;AAFD,kEAEC;AAED;;;;;;;;;GASG;AACH,SAAgB,yBAAyB,CAAC,UAAsB;IAC/D,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAiB,CAAC,CAAC;IACtD,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,SAAS,CAAC;IACl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S,CAAC;IAClB,CAAC;IACD,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QACpB,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;IAClC,CAAC;IACD,OAAO,UAAU,CAAC;AACnB,CAAC;AAZD,gCAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype AnchorNode,\n\ttype DetachedField,\n\tanchorSlot,\n\tgetDetachedFieldContainingPath,\n\trootField,\n\ttype SchemaAndPolicy,\n} from \"../../core/index.js\";\n\nimport type { FlexTreeContext } from \"./context.js\";\nimport { TreeStatus } from \"./flexTreeTypes.js\";\n/**\n * Checks the detached field and returns the TreeStatus based on whether or not the detached field is a root field.\n * @param detachedField - the detached field you want to check.\n * @returns the {@link TreeStatus} from the detached field provided.\n */\nexport function treeStatusFromDetachedField(detachedField: DetachedField): TreeStatus {\n\treturn detachedField === rootField ? TreeStatus.InDocument : TreeStatus.Removed;\n}\n\n/**\n * Determines the tree status based on the anchor cache.\n *\n * Checks the anchorNode's cache to get the tree status.\n * If the cache is undefined or stale, it is updated and the treeStatus based on its detachedField is returned.\n *\n * @param anchors - the {@link AnchorSet} to compare your anchorNode cache to.\n * @param anchorNode - the {@link AnchorNode} to get the {@link TreeStatus} of.\n * @returns - the {@link TreeStatus} of the anchorNode provided.\n */\nexport function treeStatusFromAnchorCache(anchorNode: AnchorNode): TreeStatus {\n\tconst cache = anchorNode.slots.get(detachedFieldSlot);\n\tconst { generationNumber } = anchorNode.anchorSet;\n\tif (cache === undefined) {\n\t\t// If the cache is undefined, set the cache and return the treeStatus based on the detached field.\n\t\treturn treeStatusFromDetachedField(\n\t\t\tgetCachedUpdatedDetachedField(anchorNode, generationNumber),\n\t\t);\n\t} else {\n\t\t// If the cache is up to date, return the treeStatus based on the cached detached field.\n\t\tif (cache.generationNumber === generationNumber) {\n\t\t\treturn treeStatusFromDetachedField(cache.detachedField);\n\t\t}\n\t\t// If the cache is not up to date, update the cache and return the treeStatus based on the updated detached field.\n\t\treturn treeStatusFromDetachedField(\n\t\t\tgetCachedUpdatedDetachedField(anchorNode, generationNumber),\n\t\t);\n\t}\n}\n\n/**\n * Updates the anchorNode cache with the provided generation number, and returns its detachedField.\n */\nfunction getCachedUpdatedDetachedField(\n\tanchorNode: AnchorNode,\n\tgenerationNumber: number,\n): DetachedField {\n\tconst detachedField = getDetachedFieldContainingPath(anchorNode);\n\tanchorNode.slots.set(detachedFieldSlot, {\n\t\tgenerationNumber,\n\t\tdetachedField,\n\t});\n\treturn detachedField;\n}\n\nexport const detachedFieldSlot = anchorSlot<DetachedFieldCache>();\n\nexport interface DetachedFieldCache {\n\tgenerationNumber: number;\n\tdetachedField: DetachedField;\n}\n\n/**\n * Utility function to get a {@link SchemaAndPolicy} object from a {@link FlexTreeContext}.\n * @returns A {@link SchemaAndPolicy} object with the stored schema and policy from the context provided.\n * For {@link Unhydrated} contexts this schema may only describe the types allowed subtree for this particular entity.\n */\nexport function getSchemaAndPolicy(context: FlexTreeContext): SchemaAndPolicy {\n\treturn {\n\t\tschema: context.schema,\n\t\tpolicy: context.schemaPolicy,\n\t};\n}\n\n/**\n * Indexing for {@link FlexTreeField.boxedAt} and {@link FlexTreeSequenceField.at} supports the\n * usage of negative indices, which regular indexing using `[` and `]` does not.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at\n * for additional context on the semantics.\n *\n * @returns A positive index that can be used in regular indexing. Returns\n * undefined if that index would be out-of-bounds.\n */\nexport function indexForAt(index: number, length: number): number | undefined {\n\tlet finalIndex = Math.trunc(+index);\n\tif (Number.isNaN(finalIndex)) {\n\t\tfinalIndex = 0;\n\t}\n\tif (finalIndex < -length || finalIndex >= length) {\n\t\treturn undefined;\n\t}\n\tif (finalIndex < 0) {\n\t\tfinalIndex = finalIndex + length;\n\t}\n\treturn finalIndex;\n}\n"]}
@@ -3,12 +3,12 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
6
+ import type { IIdCompressor } from "@fluidframework/id-compressor";
6
7
  import type { ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions/internal";
7
- import { type ICodecOptions } from "../../codec/index.js";
8
+ import type { CodecWriteOptions } from "../../codec/index.js";
8
9
  import { type IEditableForest, type RevisionTagCodec } from "../../core/index.js";
9
10
  import type { Summarizable, SummaryElementParser, SummaryElementStringifier } from "../../shared-tree-core/index.js";
10
11
  import type { FieldBatchCodec, FieldBatchEncodingContext } from "../chunked-forest/index.js";
11
- import type { IIdCompressor } from "@fluidframework/id-compressor";
12
12
  /**
13
13
  * Provides methods for summarizing and loading a forest.
14
14
  */
@@ -22,7 +22,7 @@ export declare class ForestSummarizer implements Summarizable {
22
22
  /**
23
23
  * @param encoderContext - The schema if provided here must be mutated by the caller to keep it up to date.
24
24
  */
25
- constructor(forest: IEditableForest, revisionTagCodec: RevisionTagCodec, fieldBatchCodec: FieldBatchCodec, encoderContext: FieldBatchEncodingContext, options: ICodecOptions | undefined, idCompressor: IIdCompressor);
25
+ constructor(forest: IEditableForest, revisionTagCodec: RevisionTagCodec, fieldBatchCodec: FieldBatchCodec, encoderContext: FieldBatchEncodingContext, options: CodecWriteOptions, idCompressor: IIdCompressor);
26
26
  /**
27
27
  * Synchronous monolithic summarization of tree content.
28
28
  *
@@ -1 +1 @@
1
- {"version":3,"file":"forestSummarizer.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/forestSummarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EACX,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,8CAA8C,CAAC;AAGtD,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAIN,KAAK,eAAe,EAGpB,KAAK,gBAA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AU,CAAC,EAAE,OAAO,EACpB,gBAAgB,CAAC,EAAE,iBAAiB,GAClC,OAAO,CAAC,qBAAqB,CAAC;IAIpB,IAAI,CAChB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC;CAgChB"}
@@ -8,9 +8,8 @@ exports.ForestSummarizer = void 0;
8
8
  const client_utils_1 = require("@fluid-internal/client-utils");
9
9
  const internal_1 = require("@fluidframework/core-utils/internal");
10
10
  const internal_2 = require("@fluidframework/shared-object-base/internal");
11
- const index_js_1 = require("../../codec/index.js");
12
- const index_js_2 = require("../../core/index.js");
13
- const index_js_3 = require("../../util/index.js");
11
+ const index_js_1 = require("../../core/index.js");
12
+ const index_js_2 = require("../../util/index.js");
14
13
  // eslint-disable-next-line import/no-internal-modules
15
14
  const chunkTree_js_1 = require("../chunked-forest/chunkTree.js");
16
15
  const codec_js_1 = require("./codec.js");
@@ -25,12 +24,13 @@ class ForestSummarizer {
25
24
  /**
26
25
  * @param encoderContext - The schema if provided here must be mutated by the caller to keep it up to date.
27
26
  */
28
- constructor(forest, revisionTagCodec, fieldBatchCodec, encoderContext, options = { jsonValidator: index_js_1.noopValidator }, idCompressor) {
27
+ constructor(forest, revisionTagCodec, fieldBatchCodec, encoderContext, options, idCompressor) {
29
28
  this.forest = forest;
30
29
  this.revisionTagCodec = revisionTagCodec;
31
30
  this.encoderContext = encoderContext;
32
31
  this.idCompressor = idCompressor;
33
32
  this.key = "Forest";
33
+ // TODO: this should take in CodecWriteOptions, and use it to pick the write version.
34
34
  this.codec = (0, codec_js_1.makeForestSummarizerCodec)(options, fieldBatchCodec);
35
35
  }
36
36
  /**
@@ -44,7 +44,7 @@ class ForestSummarizer {
44
44
  const rootCursor = this.forest.getCursorAboveDetachedFields();
45
45
  const fieldMap = new Map();
46
46
  // TODO: Encode all detached fields in one operation for better performance and compression
47
- (0, index_js_2.forEachField)(rootCursor, (cursor) => {
47
+ (0, index_js_1.forEachField)(rootCursor, (cursor) => {
48
48
  const key = cursor.getFieldKey();
49
49
  const innerCursor = this.forest.allocateCursor("getTreeString");
50
50
  (0, internal_1.assert)(this.forest.tryMoveCursorToField({ fieldKey: key, parent: undefined }, innerCursor) ===
@@ -68,7 +68,7 @@ class ForestSummarizer {
68
68
  // TODO: this code is parsing data without an optional validator, this should be defined in a typebox schema as part of the
69
69
  // forest summary format.
70
70
  const fields = this.codec.decode(parse(treeBufferString), this.encoderContext);
71
- const allocator = (0, index_js_3.idAllocatorFromMaxId)();
71
+ const allocator = (0, index_js_2.idAllocatorFromMaxId)();
72
72
  const fieldChanges = [];
73
73
  const build = [];
74
74
  for (const [fieldKey, field] of fields) {
@@ -84,7 +84,7 @@ class ForestSummarizer {
84
84
  fieldChanges.push([fieldKey, [{ count: chunked.topLevelLength, attach: buildId }]]);
85
85
  }
86
86
  (0, internal_1.assert)(this.forest.isEmpty, 0x797 /* forest must be empty */);
87
- (0, index_js_2.applyDelta)({ build, fields: new Map(fieldChanges) }, undefined, this.forest, (0, index_js_2.makeDetachedFieldIndex)("init", this.revisionTagCodec, this.idCompressor));
87
+ (0, index_js_1.applyDelta)({ build, fields: new Map(fieldChanges) }, undefined, this.forest, (0, index_js_1.makeDetachedFieldIndex)("init", this.revisionTagCodec, this.idCompressor));
88
88
  }
89
89
  }
90
90
  }
@@ -1 +1 @@
1
- {"version":3,"file":"forestSummarizer.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/forestSummarizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAC9D,kEAA6D;AAM7D,0EAAsF;AAEtF,mDAAyE;AACzE,kDAY6B;AAM7B,kDAA2D;AAC3D,sDAAsD;AACtD,iEAAsF;AAGtF,yCAAyE;AAGzE;;GAEG;AACH,MAAM,WAAW,GAAG,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAa,gBAAgB;IAK5B;;OAEG;IACH,YACkB,MAAuB,EACvB,gBAAkC,EACnD,eAAg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BACtE,KAAK,CAAC,IAAI,CAAC;oBACV,EAAE,EAAE,OAAO;oBACX,KAAK,EAAE,OAAO;iBACd,CAAC,CAAC;gBACH,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;YACrF,CAAC;YAED,IAAA,iBAAM,EAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;YAC9D,IAAA,qBAAU,EACT,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAG,CAAC,YAAY,CAAC,EAAE,EACxC,SAAS,EACT,IAAI,CAAC,MAAM,EACX,IAAA,iCAAsB,EAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC,CACxE,CAAC;QACH,CAAC;IACF,CAAC;CACD;AApGD,4CAoGC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { createSingleBlobSummary } from \"@fluidframework/shared-object-base/internal\";\n\nimport { type ICodecOptions, noopValidator } from \"../../codec/index.js\";\nimport {\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaFieldChanges,\n\ttype FieldKey,\n\ttype IEditableForest,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\ttype RevisionTagCodec,\n\tTreeNavigationResult,\n\tapplyDelta,\n\tforEachField,\n\tmakeDetachedFieldIndex,\n} from \"../../core/index.js\";\nimport type {\n\tSummarizable,\n\tSummaryElementParser,\n\tSummaryElementStringifier,\n} from \"../../shared-tree-core/index.js\";\nimport { idAllocatorFromMaxId } from \"../../util/index.js\";\n// eslint-disable-next-line import/no-internal-modules\nimport { chunkFieldSingle, defaultChunkPolicy } from \"../chunked-forest/chunkTree.js\";\nimport type { FieldBatchCodec, FieldBatchEncodingContext } from \"../chunked-forest/index.js\";\n\nimport { type ForestCodec, makeForestSummarizerCodec } from \"./codec.js\";\nimport type { Format } from \"./format.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n/**\n * The storage key for the blob in the summary containing tree data\n */\nconst treeBlobKey = \"ForestTree\";\n\n/**\n * Provides methods for summarizing and loading a forest.\n */\nexport class ForestSummarizer implements Summarizable {\n\tpublic readonly key = \"Forest\";\n\n\tprivate readonly codec: ForestCodec;\n\n\t/**\n\t * @param encoderContext - The schema if provided here must be mutated by the caller to keep it up to date.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IEditableForest,\n\t\tprivate readonly revisionTagCodec: RevisionTagCodec,\n\t\tfieldBatchCodec: FieldBatchCodec,\n\t\tprivate readonly encoderContext: FieldBatchEncodingContext,\n\t\toptions: ICodecOptions = { jsonValidator: noopValidator },\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t) {\n\t\tthis.codec = makeForestSummarizerCodec(options, fieldBatchCodec);\n\t}\n\n\t/**\n\t * Synchronous monolithic summarization of tree content.\n\t *\n\t * TODO: when perf matters, this should be replaced with a chunked async version using a binary format.\n\t *\n\t * @returns a snapshot of the forest's tree as a string.\n\t */\n\tprivate getTreeString(stringify: SummaryElementStringifier): string {\n\t\tconst rootCursor = this.forest.getCursorAboveDetachedFields();\n\t\tconst fieldMap: Map<FieldKey, ITreeCursorSynchronous & ITreeSubscriptionCursor> =\n\t\t\tnew Map();\n\t\t// TODO: Encode all detached fields in one operation for better performance and compression\n\t\tforEachField(rootCursor, (cursor) => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tconst innerCursor = this.forest.allocateCursor(\"getTreeString\");\n\t\t\tassert(\n\t\t\t\tthis.forest.tryMoveCursorToField({ fieldKey: key, parent: undefined }, innerCursor) ===\n\t\t\t\t\tTreeNavigationResult.Ok,\n\t\t\t\t0x892 /* failed to navigate to field */,\n\t\t\t);\n\t\t\tfieldMap.set(key, innerCursor as ITreeCursorSynchronous & ITreeSubscriptionCursor);\n\t\t});\n\t\tconst encoded = this.codec.encode(fieldMap, this.encoderContext);\n\n\t\tfieldMap.forEach((value) => value.free());\n\t\treturn stringify(encoded);\n\t}\n\n\tpublic getAttachSummary(\n\t\tstringify: SummaryElementStringifier,\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummaryTreeWithStats {\n\t\treturn createSingleBlobSummary(treeBlobKey, this.getTreeString(stringify));\n\t}\n\n\tpublic async summarize(\n\t\tstringify: SummaryElementStringifier,\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats> {\n\t\treturn createSingleBlobSummary(treeBlobKey, this.getTreeString(stringify));\n\t}\n\n\tpublic async load(\n\t\tservices: IChannelStorageService,\n\t\tparse: SummaryElementParser,\n\t): Promise<void> {\n\t\tif (await services.contains(treeBlobKey)) {\n\t\t\tconst treeBuffer = await services.readBlob(treeBlobKey);\n\t\t\tconst treeBufferString = bufferToString(treeBuffer, \"utf8\");\n\t\t\t// TODO: this code is parsing data without an optional validator, this should be defined in a typebox schema as part of the\n\t\t\t// forest summary format.\n\t\t\tconst fields = this.codec.decode(parse(treeBufferString) as Format, this.encoderContext);\n\t\t\tconst allocator = idAllocatorFromMaxId();\n\t\t\tconst fieldChanges: [FieldKey, DeltaFieldChanges][] = [];\n\t\t\tconst build: DeltaDetachedNodeBuild[] = [];\n\t\t\tfor (const [fieldKey, field] of fields) {\n\t\t\t\tconst chunked = chunkFieldSingle(field, {\n\t\t\t\t\tpolicy: defaultChunkPolicy,\n\t\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t\t});\n\t\t\t\tconst buildId = { minor: allocator.allocate(chunked.topLevelLength) };\n\t\t\t\tbuild.push({\n\t\t\t\t\tid: buildId,\n\t\t\t\t\ttrees: chunked,\n\t\t\t\t});\n\t\t\t\tfieldChanges.push([fieldKey, [{ count: chunked.topLevelLength, attach: buildId }]]);\n\t\t\t}\n\n\t\t\tassert(this.forest.isEmpty, 0x797 /* forest must be empty */);\n\t\t\tapplyDelta(\n\t\t\t\t{ build, fields: new Map(fieldChanges) },\n\t\t\t\tundefined,\n\t\t\t\tthis.forest,\n\t\t\t\tmakeDetachedFieldIndex(\"init\", this.revisionTagCodec, this.idCompressor),\n\t\t\t);\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"forestSummarizer.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/forestSummarizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAC9D,kEAA6D;AAO7D,0EAAsF;AAGtF,kDAY6B;AAM7B,kDAA2D;AAC3D,sDAAsD;AACtD,iEAAsF;AAGtF,yCAAyE;AAEzE;;GAEG;AACH,MAAM,WAAW,GAAG,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAa,gBAAgB;IAK5B;;OAEG;IACH,YACkB,MAAuB,EACvB,gBAAkC,EACnD,eAAgC,EACf,cAAyC,EAC1D,OAA0B,EACT,YAA2B;QAL3B,WAAM,GAAN,MAAM,CAAiB;QACvB,qBAAgB,GAAhB,gBAAgB,CAAkB;QAElC,mBAAc,GAAd,cAAc,CAA2B;QAEzC,iBAAY,GAAZ,YAAY,CAAe;QAb7B,QAAG,GAAG,QAAQ,CAAC;QAe9B,qFAAqF;QACrF,IAAI,CAAC,KAAK,GAAG,IAAA,oCAAyB,EAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;OAMG;IACK,aAAa,CAAC,SAAoC;QACzD,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,4BAA4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,EAAE,EACxC,SAAS,EACT,IAAI,CAAC,MAAM,EACX,IAAA,iCAAsB,EAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC,CACxE,CAAC;QACH,CAAC;IACF,CAAC;CACD;AArGD,4CAqGC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport type {\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { createSingleBlobSummary } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { CodecWriteOptions } from \"../../codec/index.js\";\nimport {\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaFieldChanges,\n\ttype FieldKey,\n\ttype IEditableForest,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\ttype RevisionTagCodec,\n\tTreeNavigationResult,\n\tapplyDelta,\n\tforEachField,\n\tmakeDetachedFieldIndex,\n} from \"../../core/index.js\";\nimport type {\n\tSummarizable,\n\tSummaryElementParser,\n\tSummaryElementStringifier,\n} from \"../../shared-tree-core/index.js\";\nimport { idAllocatorFromMaxId } from \"../../util/index.js\";\n// eslint-disable-next-line import/no-internal-modules\nimport { chunkFieldSingle, defaultChunkPolicy } from \"../chunked-forest/chunkTree.js\";\nimport type { FieldBatchCodec, FieldBatchEncodingContext } from \"../chunked-forest/index.js\";\n\nimport { type ForestCodec, makeForestSummarizerCodec } from \"./codec.js\";\nimport type { Format } from \"./format.js\";\n/**\n * The storage key for the blob in the summary containing tree data\n */\nconst treeBlobKey = \"ForestTree\";\n\n/**\n * Provides methods for summarizing and loading a forest.\n */\nexport class ForestSummarizer implements Summarizable {\n\tpublic readonly key = \"Forest\";\n\n\tprivate readonly codec: ForestCodec;\n\n\t/**\n\t * @param encoderContext - The schema if provided here must be mutated by the caller to keep it up to date.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IEditableForest,\n\t\tprivate readonly revisionTagCodec: RevisionTagCodec,\n\t\tfieldBatchCodec: FieldBatchCodec,\n\t\tprivate readonly encoderContext: FieldBatchEncodingContext,\n\t\toptions: CodecWriteOptions,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t) {\n\t\t// TODO: this should take in CodecWriteOptions, and use it to pick the write version.\n\t\tthis.codec = makeForestSummarizerCodec(options, fieldBatchCodec);\n\t}\n\n\t/**\n\t * Synchronous monolithic summarization of tree content.\n\t *\n\t * TODO: when perf matters, this should be replaced with a chunked async version using a binary format.\n\t *\n\t * @returns a snapshot of the forest's tree as a string.\n\t */\n\tprivate getTreeString(stringify: SummaryElementStringifier): string {\n\t\tconst rootCursor = this.forest.getCursorAboveDetachedFields();\n\t\tconst fieldMap: Map<FieldKey, ITreeCursorSynchronous & ITreeSubscriptionCursor> =\n\t\t\tnew Map();\n\t\t// TODO: Encode all detached fields in one operation for better performance and compression\n\t\tforEachField(rootCursor, (cursor) => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tconst innerCursor = this.forest.allocateCursor(\"getTreeString\");\n\t\t\tassert(\n\t\t\t\tthis.forest.tryMoveCursorToField({ fieldKey: key, parent: undefined }, innerCursor) ===\n\t\t\t\t\tTreeNavigationResult.Ok,\n\t\t\t\t0x892 /* failed to navigate to field */,\n\t\t\t);\n\t\t\tfieldMap.set(key, innerCursor as ITreeCursorSynchronous & ITreeSubscriptionCursor);\n\t\t});\n\t\tconst encoded = this.codec.encode(fieldMap, this.encoderContext);\n\n\t\tfieldMap.forEach((value) => value.free());\n\t\treturn stringify(encoded);\n\t}\n\n\tpublic getAttachSummary(\n\t\tstringify: SummaryElementStringifier,\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummaryTreeWithStats {\n\t\treturn createSingleBlobSummary(treeBlobKey, this.getTreeString(stringify));\n\t}\n\n\tpublic async summarize(\n\t\tstringify: SummaryElementStringifier,\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats> {\n\t\treturn createSingleBlobSummary(treeBlobKey, this.getTreeString(stringify));\n\t}\n\n\tpublic async load(\n\t\tservices: IChannelStorageService,\n\t\tparse: SummaryElementParser,\n\t): Promise<void> {\n\t\tif (await services.contains(treeBlobKey)) {\n\t\t\tconst treeBuffer = await services.readBlob(treeBlobKey);\n\t\t\tconst treeBufferString = bufferToString(treeBuffer, \"utf8\");\n\t\t\t// TODO: this code is parsing data without an optional validator, this should be defined in a typebox schema as part of the\n\t\t\t// forest summary format.\n\t\t\tconst fields = this.codec.decode(parse(treeBufferString) as Format, this.encoderContext);\n\t\t\tconst allocator = idAllocatorFromMaxId();\n\t\t\tconst fieldChanges: [FieldKey, DeltaFieldChanges][] = [];\n\t\t\tconst build: DeltaDetachedNodeBuild[] = [];\n\t\t\tfor (const [fieldKey, field] of fields) {\n\t\t\t\tconst chunked = chunkFieldSingle(field, {\n\t\t\t\t\tpolicy: defaultChunkPolicy,\n\t\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t\t});\n\t\t\t\tconst buildId = { minor: allocator.allocate(chunked.topLevelLength) };\n\t\t\t\tbuild.push({\n\t\t\t\t\tid: buildId,\n\t\t\t\t\ttrees: chunked,\n\t\t\t\t});\n\t\t\t\tfieldChanges.push([fieldKey, [{ count: chunked.topLevelLength, attach: buildId }]]);\n\t\t\t}\n\n\t\t\tassert(this.forest.isEmpty, 0x797 /* forest must be empty */);\n\t\t\tapplyDelta(\n\t\t\t\t{ build, fields: new Map(fieldChanges) },\n\t\t\t\tundefined,\n\t\t\t\tthis.forest,\n\t\t\t\tmakeDetachedFieldIndex(\"init\", this.revisionTagCodec, this.idCompressor),\n\t\t\t);\n\t\t}\n\t}\n}\n"]}
@@ -5,9 +5,9 @@
5
5
  export { type DownPath, toDownPath, } from "./editableTreeBinder.js";
6
6
  export { allowsValue, assertAllowedValue, isTreeValue } from "./valueUtilities.js";
7
7
  export { ForestSummarizer } from "./forest-summary/index.js";
8
- export { cursorForMapTreeField, cursorForMapTreeNode, mapTreeFromCursor, mapTreeFieldFromCursor, } from "./mapTreeCursor.js";
8
+ export { cursorForMapTreeField, cursorForMapTreeNode, mapTreeFromCursor, mapTreeFieldFromCursor, type MinimalMapTreeNodeView, mapTreeFieldsWithField, mapTreeWithField, type MapTreeFieldViewGeneric, type MapTreeNodeViewGeneric, } from "./mapTreeCursor.js";
9
9
  export { buildForest } from "./object-forest/index.js";
10
- export { SchemaSummarizer, encodeTreeSchema, makeSchemaCodec, makeSchemaCodecs, SchemaCodecVersion, } from "./schema-index/index.js";
10
+ export { SchemaSummarizer, encodeTreeSchema, makeSchemaCodec, makeSchemaCodecs, } from "./schema-index/index.js";
11
11
  export { stackTreeNodeCursor, type CursorAdapter, prefixPath, prefixFieldPath, type CursorWithNode, stackTreeFieldCursor, } from "./treeCursorUtils.js";
12
12
  export { cursorForJsonableTreeNode, cursorForJsonableTreeField, jsonableTreeFromCursor, jsonableTreeFromFieldCursor, jsonableTreeFromForest, } from "./treeTextCursor.js";
13
13
  import * as SequenceField from "./sequence-field/index.js";
@@ -16,8 +16,8 @@ export { isNeverField, ModularEditBuilder, type FieldEditDescription as EditDesc
16
16
  export { mapRootChanges } from "./deltaUtils.js";
17
17
  export { type TreeChunk, chunkTree, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, type FieldBatch, type FieldBatchCodec, makeTreeChunker, makeFieldBatchCodec, fluidVersionToFieldBatchCodecWriteVersion, type FieldBatchEncodingContext, } from "./chunked-forest/index.js";
18
18
  export { compareLocalNodeIdentifiers, createNodeIdentifierManager, isStableNodeIdentifier, type LocalNodeIdentifier, MockNodeIdentifierManager, type NodeIdentifierManager, nodeKeyTreeIdentifier, type StableNodeIdentifier, } from "./node-identifier/index.js";
19
- export { FieldKinds, type Required, type Optional, type Sequence, type Identifier, type Forbidden, type DefaultChangeset, DefaultChangeFamily, DefaultEditBuilder, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, SchemaValidationErrors, isNodeInSchema, isFieldInSchema, inSchemaOrThrow, } from "./default-schema/index.js";
20
- export { type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, Skip, type FlexTreeContext, type FlexTreeHydratedContext, type FlexTreeTypedField, type FlexTreeEntity, type FlexTreeField, type FlexTreeNode, TreeStatus, Context, type FlexTreeNodeEvents, type FlexTreeUnknownUnboxed, isFlexTreeNode, ContextSlot, flexTreeMarker, assertFlexTreeEntityNotFreed, flexTreeSlot, getSchemaAndPolicy, LazyEntity, treeStatusFromAnchorCache, indexForAt, FlexTreeEntityKind, } from "./flex-tree/index.js";
19
+ export { FieldKinds, type Required, type Optional, type Sequence, type Identifier, type Forbidden, type DefaultChangeset, DefaultChangeFamily, DefaultEditBuilder, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, SchemaValidationError, isNodeInSchema, isFieldInSchema, inSchemaOrThrow, } from "./default-schema/index.js";
20
+ export { type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, Skip, type FlexTreeContext, type FlexTreeHydratedContext, type FlexTreeTypedField, type FlexTreeEntity, type FlexTreeField, type FlexTreeNode, TreeStatus, Context, type FlexTreeNodeEvents, type FlexTreeUnknownUnboxed, isFlexTreeNode, ContextSlot, flexTreeMarker, assertFlexTreeEntityNotFreed, flexTreeSlot, getSchemaAndPolicy, LazyEntity, treeStatusFromAnchorCache, indexForAt, FlexTreeEntityKind, type FlexibleNodeContent, type FlexibleFieldContent, type FlexTreeHydratedContextMinimal, type HydratedFlexTreeNode, } from "./flex-tree/index.js";
21
21
  export { TreeCompressionStrategy } from "./treeCompressionUtils.js";
22
22
  export { valueSchemaAllows } from "./valueUtilities.js";
23
23
  export { DetachedFieldIndexSummarizer } from "./detachedFieldIndexSummarizer.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EACnB,KAAK,aAAa,EAClB,UAAU,EACV,eAAe,EACf,KAAK,cAAc,EACnB,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,GACtB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,KAAK,oBAAoB,IAAI,eAAe,EAC5C,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EA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BAAgB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -27,8 +27,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  return result;
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.makeFieldBatchCodec = exports.makeTreeChunker = exports.defaultChunkPolicy = exports.buildChunkedForest = exports.chunkFieldSingle = exports.chunkTree = exports.mapRootChanges = exports.posetLte = exports.comparePosetElements = exports.PosetComparisonResult = exports.fieldRealizer = exports.isNeverTree = exports.isRepoSuperset = exports.getAllowedContentDiscrepancies = exports.updateRefreshers = exports.EncodedModularChangeset = exports.ModularChangeFamily = exports.FieldKindWithEditor = exports.genericFieldKind = exports.allowsRepoSuperset = exports.FlexFieldKind = exports.CrossFieldTarget = exports.makeModularChangeCodecFamily = exports.ModularEditBuilder = exports.isNeverField = exports.SequenceField = exports.jsonableTreeFromForest = exports.jsonableTreeFromFieldCursor = exports.jsonableTreeFromCursor = exports.cursorForJsonableTreeField = exports.cursorForJsonableTreeNode = exports.stackTreeFieldCursor = exports.prefixFieldPath = exports.prefixPath = exports.stackTreeNodeCursor = exports.SchemaCodecVersion = exports.makeSchemaCodecs = exports.makeSchemaCodec = exports.encodeTreeSchema = exports.SchemaSummarizer = exports.buildForest = exports.mapTreeFieldFromCursor = exports.mapTreeFromCursor = exports.cursorForMapTreeNode = exports.cursorForMapTreeField = exports.ForestSummarizer = exports.isTreeValue = exports.assertAllowedValue = exports.allowsValue = exports.toDownPath = void 0;
31
- exports.initializeForest = exports.hasElement = exports.AnchorTreeIndex = exports.makeMitigatedChangeFamily = exports.EncodedSchemaChange = exports.makeSchemaChangeCodecs = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategy = exports.FlexTreeEntityKind = exports.indexForAt = exports.treeStatusFromAnchorCache = exports.LazyEntity = exports.getSchemaAndPolicy = exports.flexTreeSlot = exports.assertFlexTreeEntityNotFreed = exports.flexTreeMarker = exports.ContextSlot = exports.isFlexTreeNode = exports.Context = exports.TreeStatus = exports.Skip = exports.inSchemaOrThrow = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationErrors = exports.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = exports.MockNodeIdentifierManager = exports.isStableNodeIdentifier = exports.createNodeIdentifierManager = exports.compareLocalNodeIdentifiers = exports.fluidVersionToFieldBatchCodecWriteVersion = void 0;
30
+ exports.makeTreeChunker = exports.defaultChunkPolicy = exports.buildChunkedForest = exports.chunkFieldSingle = exports.chunkTree = exports.mapRootChanges = exports.posetLte = exports.comparePosetElements = exports.PosetComparisonResult = exports.fieldRealizer = exports.isNeverTree = exports.isRepoSuperset = exports.getAllowedContentDiscrepancies = exports.updateRefreshers = exports.EncodedModularChangeset = exports.ModularChangeFamily = exports.FieldKindWithEditor = exports.genericFieldKind = exports.allowsRepoSuperset = exports.FlexFieldKind = exports.CrossFieldTarget = exports.makeModularChangeCodecFamily = exports.ModularEditBuilder = exports.isNeverField = exports.SequenceField = exports.jsonableTreeFromForest = exports.jsonableTreeFromFieldCursor = exports.jsonableTreeFromCursor = exports.cursorForJsonableTreeField = exports.cursorForJsonableTreeNode = exports.stackTreeFieldCursor = exports.prefixFieldPath = exports.prefixPath = exports.stackTreeNodeCursor = exports.makeSchemaCodecs = exports.makeSchemaCodec = exports.encodeTreeSchema = exports.SchemaSummarizer = exports.buildForest = exports.mapTreeWithField = exports.mapTreeFieldsWithField = exports.mapTreeFieldFromCursor = exports.mapTreeFromCursor = exports.cursorForMapTreeNode = exports.cursorForMapTreeField = exports.ForestSummarizer = exports.isTreeValue = exports.assertAllowedValue = exports.allowsValue = exports.toDownPath = void 0;
31
+ exports.initializeForest = exports.hasElement = exports.AnchorTreeIndex = exports.makeMitigatedChangeFamily = exports.EncodedSchemaChange = exports.makeSchemaChangeCodecs = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategy = exports.FlexTreeEntityKind = exports.indexForAt = exports.treeStatusFromAnchorCache = exports.LazyEntity = exports.getSchemaAndPolicy = exports.flexTreeSlot = exports.assertFlexTreeEntityNotFreed = exports.flexTreeMarker = exports.ContextSlot = exports.isFlexTreeNode = exports.Context = exports.TreeStatus = exports.Skip = exports.inSchemaOrThrow = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationError = exports.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = exports.MockNodeIdentifierManager = exports.isStableNodeIdentifier = exports.createNodeIdentifierManager = exports.compareLocalNodeIdentifiers = exports.fluidVersionToFieldBatchCodecWriteVersion = exports.makeFieldBatchCodec = void 0;
32
32
  var editableTreeBinder_js_1 = require("./editableTreeBinder.js");
33
33
  Object.defineProperty(exports, "toDownPath", { enumerable: true, get: function () { return editableTreeBinder_js_1.toDownPath; } });
34
34
  var valueUtilities_js_1 = require("./valueUtilities.js");
@@ -42,6 +42,8 @@ Object.defineProperty(exports, "cursorForMapTreeField", { enumerable: true, get:
42
42
  Object.defineProperty(exports, "cursorForMapTreeNode", { enumerable: true, get: function () { return mapTreeCursor_js_1.cursorForMapTreeNode; } });
43
43
  Object.defineProperty(exports, "mapTreeFromCursor", { enumerable: true, get: function () { return mapTreeCursor_js_1.mapTreeFromCursor; } });
44
44
  Object.defineProperty(exports, "mapTreeFieldFromCursor", { enumerable: true, get: function () { return mapTreeCursor_js_1.mapTreeFieldFromCursor; } });
45
+ Object.defineProperty(exports, "mapTreeFieldsWithField", { enumerable: true, get: function () { return mapTreeCursor_js_1.mapTreeFieldsWithField; } });
46
+ Object.defineProperty(exports, "mapTreeWithField", { enumerable: true, get: function () { return mapTreeCursor_js_1.mapTreeWithField; } });
45
47
  var index_js_2 = require("./object-forest/index.js");
46
48
  Object.defineProperty(exports, "buildForest", { enumerable: true, get: function () { return index_js_2.buildForest; } });
47
49
  var index_js_3 = require("./schema-index/index.js");
@@ -49,7 +51,6 @@ Object.defineProperty(exports, "SchemaSummarizer", { enumerable: true, get: func
49
51
  Object.defineProperty(exports, "encodeTreeSchema", { enumerable: true, get: function () { return index_js_3.encodeTreeSchema; } });
50
52
  Object.defineProperty(exports, "makeSchemaCodec", { enumerable: true, get: function () { return index_js_3.makeSchemaCodec; } });
51
53
  Object.defineProperty(exports, "makeSchemaCodecs", { enumerable: true, get: function () { return index_js_3.makeSchemaCodecs; } });
52
- Object.defineProperty(exports, "SchemaCodecVersion", { enumerable: true, get: function () { return index_js_3.SchemaCodecVersion; } });
53
54
  var treeCursorUtils_js_1 = require("./treeCursorUtils.js");
54
55
  Object.defineProperty(exports, "stackTreeNodeCursor", { enumerable: true, get: function () { return treeCursorUtils_js_1.stackTreeNodeCursor; } });
55
56
  Object.defineProperty(exports, "prefixPath", { enumerable: true, get: function () { return treeCursorUtils_js_1.prefixPath; } });
@@ -108,7 +109,7 @@ Object.defineProperty(exports, "fieldKinds", { enumerable: true, get: function (
108
109
  Object.defineProperty(exports, "fieldKindConfigurations", { enumerable: true, get: function () { return index_js_7.fieldKindConfigurations; } });
109
110
  Object.defineProperty(exports, "intoDelta", { enumerable: true, get: function () { return index_js_7.intoDelta; } });
110
111
  Object.defineProperty(exports, "relevantRemovedRoots", { enumerable: true, get: function () { return index_js_7.relevantRemovedRoots; } });
111
- Object.defineProperty(exports, "SchemaValidationErrors", { enumerable: true, get: function () { return index_js_7.SchemaValidationErrors; } });
112
+ Object.defineProperty(exports, "SchemaValidationError", { enumerable: true, get: function () { return index_js_7.SchemaValidationError; } });
112
113
  Object.defineProperty(exports, "isNodeInSchema", { enumerable: true, get: function () { return index_js_7.isNodeInSchema; } });
113
114
  Object.defineProperty(exports, "isFieldInSchema", { enumerable: true, get: function () { return index_js_7.isFieldInSchema; } });
114
115
  Object.defineProperty(exports, "inSchemaOrThrow", { enumerable: true, get: function () { return index_js_7.inSchemaOrThrow; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iEAGiC;AADhC,mHAAA,UAAU,OAAA;AAEX,yDAAmF;AAA1E,gHAAA,WAAW,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAAE,gHAAA,WAAW,OAAA;AAErD,sDAA6D;AAApD,4GAAA,gBAAgB,OAAA;AACzB,uDAK4B;AAJ3B,yHAAA,qBAAqB,OAAA;AACrB,wHAAA,oBAAoB,OAAA;AACpB,qHAAA,iBAAiB,OAAA;AACjB,0HAAA,sBAAsB,OAAA;AAEvB,qDAAuD;AAA9C,uGAAA,WAAW,OAAA;AACpB,oDAMiC;AALhC,4GAAA,gBAAgB,OAAA;AAChB,4GAAA,gBAAgB,OAAA;AAChB,2GAAA,eAAe,OAAA;AACf,4GAAA,gBAAgB,OAAA;AAChB,8GAAA,kBAAkB,OAAA;AAEnB,2DAO8B;AAN7B,yHAAA,mBAAmB,OAAA;AAEnB,gHAAA,UAAU,OAAA;AACV,qHAAA,eAAe,OAAA;AAEf,0HAAA,oBAAoB,OAAA;AAErB,yDAM6B;AAL5B,8HAAA,yBAAyB,OAAA;AACzB,+HAAA,0BAA0B,OAAA;AAC1B,2HAAA,sBAAsB,OAAA;AACtB,gIAAA,2BAA2B,OAAA;AAC3B,2HAAA,sBAAsB,OAAA;AAGvB,sFAAsF;AACtF,yEAA2D;AAClD,sCAAa;AAEtB,sDAmDmC;AAlDlC,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAUlB,wHAAA,4BAA4B,OAAA;AAM5B,4GAAA,gBAAgB,OAAA;AAChB,yGAAA,aAAa,OAAA;AAEb,8GAAA,kBAAkB,OAAA;AAElB,4GAAA,gBAAgB,OAAA;AAGhB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A;AAC5B,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAClB,sGAAA,UAAU,OAAA;AACV,qHAAA,yBAAyB,OAAA;AACzB,sGAAA,UAAU,OAAA;AACV,8GAAA,kBAAkB,OAAA;AAGnB,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAEhC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAE1B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AAErC,oDAIiC;AAFhC,kHAAA,sBAAsB,OAAA;AACtB,+GAAA,mBAAmB,OAAA;AAGpB,uEAAuE;AAA9D,qIAAA,yBAAyB,OAAA;AAElC,iDAO6B;AAL5B,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA;AAMX,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport { ForestSummarizer } from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport {\n\tSchemaSummarizer,\n\tencodeTreeSchema,\n\tmakeSchemaCodec,\n\tmakeSchemaCodecs,\n\tSchemaCodecVersion,\n} from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\n// Split this up into separate import and export for compatibility with API-Extractor.\nimport * as SequenceField from \"./sequence-field/index.js\";\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tFieldKindWithEditor,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangeset,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tgetAllowedContentDiscrepancies,\n\tisRepoSuperset,\n\ttype AllowedTypeDiscrepancy,\n\ttype FieldKindDiscrepancy,\n\ttype ValueSchemaDiscrepancy,\n\ttype FieldDiscrepancy,\n\ttype NodeDiscrepancy,\n\ttype NodeKindDiscrepancy,\n\ttype NodeFieldsDiscrepancy,\n\tisNeverTree,\n\ttype LinearExtension,\n\ttype Realizer,\n\tfieldRealizer,\n\tPosetComparisonResult,\n\tcomparePosetElements,\n\tposetLte,\n} from \"./modular-schema/index.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\tfluidVersionToFieldBatchCodecWriteVersion,\n\ttype FieldBatchEncodingContext,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tSchemaValidationErrors,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tinSchemaOrThrow,\n} from \"./default-schema/index.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\tSkip,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n} from \"./flex-tree/index.js\";\n\nexport { TreeCompressionStrategy } from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n\nexport { initializeForest } from \"./initializeForest.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iEAGiC;AADhC,mHAAA,UAAU,OAAA;AAEX,yDAAmF;AAA1E,gHAAA,WAAW,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAAE,gHAAA,WAAW,OAAA;AAErD,sDAA6D;AAApD,4GAAA,gBAAgB,OAAA;AACzB,uDAU4B;AAT3B,yHAAA,qBAAqB,OAAA;AACrB,wHAAA,oBAAoB,OAAA;AACpB,qHAAA,iBAAiB,OAAA;AACjB,0HAAA,sBAAsB,OAAA;AAEtB,0HAAA,sBAAsB,OAAA;AACtB,oHAAA,gBAAgB,OAAA;AAIjB,qDAAuD;AAA9C,uGAAA,WAAW,OAAA;AACpB,oDAKiC;AAJhC,4GAAA,gBAAgB,OAAA;AAChB,4GAAA,gBAAgB,OAAA;AAChB,2GAAA,eAAe,OAAA;AACf,4GAAA,gBAAgB,OAAA;AAEjB,2DAO8B;AAN7B,yHAAA,mBAAmB,OAAA;AAEnB,gHAAA,UAAU,OAAA;AACV,qHAAA,eAAe,OAAA;AAEf,0HAAA,oBAAoB,OAAA;AAErB,yDAM6B;AAL5B,8HAAA,yBAAyB,OAAA;AACzB,+HAAA,0BAA0B,OAAA;AAC1B,2HAAA,sBAAsB,OAAA;AACt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B,OAAA;AACpB,iHAAA,qBAAqB,OAAA;AACrB,0GAAA,cAAc,OAAA;AACd,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AAGhB,iDA8B8B;AA1B7B,gGAAA,IAAI,OAAA;AAOJ,sGAAA,UAAU,OAAA;AACV,mGAAA,OAAO,OAAA;AAGP,0GAAA,cAAc,OAAA;AACd,uGAAA,WAAW,OAAA;AACX,WAAW;AACX,0GAAA,cAAc,OAAA;AACd,wHAAA,4BAA4B,OAAA;AAC5B,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAClB,sGAAA,UAAU,OAAA;AACV,qHAAA,yBAAyB,OAAA;AACzB,sGAAA,UAAU,OAAA;AACV,8GAAA,kBAAkB,OAAA;AAOnB,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAEhC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAE1B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AAErC,oDAIiC;AAFhC,kHAAA,sBAAsB,OAAA;AACtB,+GAAA,mBAAmB,OAAA;AAGpB,uEAAuE;AAA9D,qIAAA,yBAAyB,OAAA;AAElC,iDAO6B;AAL5B,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA;AAMX,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport { ForestSummarizer } from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n\ttype MinimalMapTreeNodeView,\n\tmapTreeFieldsWithField,\n\tmapTreeWithField,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport {\n\tSchemaSummarizer,\n\tencodeTreeSchema,\n\tmakeSchemaCodec,\n\tmakeSchemaCodecs,\n} from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\n// Split this up into separate import and export for compatibility with API-Extractor.\nimport * as SequenceField from \"./sequence-field/index.js\";\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tFieldKindWithEditor,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangeset,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tgetAllowedContentDiscrepancies,\n\tisRepoSuperset,\n\ttype AllowedTypeDiscrepancy,\n\ttype FieldKindDiscrepancy,\n\ttype ValueSchemaDiscrepancy,\n\ttype FieldDiscrepancy,\n\ttype NodeDiscrepancy,\n\ttype NodeKindDiscrepancy,\n\ttype NodeFieldsDiscrepancy,\n\tisNeverTree,\n\ttype LinearExtension,\n\ttype Realizer,\n\tfieldRealizer,\n\tPosetComparisonResult,\n\tcomparePosetElements,\n\tposetLte,\n} from \"./modular-schema/index.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\tfluidVersionToFieldBatchCodecWriteVersion,\n\ttype FieldBatchEncodingContext,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tSchemaValidationError,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tinSchemaOrThrow,\n} from \"./default-schema/index.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\tSkip,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n\ttype FlexibleNodeContent,\n\ttype FlexibleFieldContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype HydratedFlexTreeNode,\n} from \"./flex-tree/index.js\";\n\nexport { TreeCompressionStrategy } from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n\nexport { initializeForest } from \"./initializeForest.js\";\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 { disposeSymbol } from "../../util/index.js";
6
5
  import { type AnchorNode, type TreeNodeSchemaIdentifier, type ITreeSubscriptionCursor, type IForestSubscription } from "../../core/index.js";
7
- import type { TreeIndex, TreeIndexKey, TreeIndexNodes } from "./types.js";
6
+ import { disposeSymbol } from "../../util/index.js";
8
7
  import { TreeStatus } from "../flex-tree/index.js";
8
+ import type { TreeIndex, TreeIndexKey, TreeIndexNodes } from "./types.js";
9
9
  /**
10
10
  * A function that gets the value to index a node on, must be pure and functional.
11
11
  * The given cursor should point to the node that will be indexed.
@@ -1 +1 @@
1
- {"version":3,"file":"anchorTreeIndex.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/indexing/anchorTreeIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAe,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAEN,KAAK,UAAU,EAEf,KAAK,wBAAwB,EAG7B,KAAK,uBAAuB,EAE5B,KAAK,mBAAmB,EASxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,SAAS,CAAC,IAAI,SAAS,YAAY,IAAI,CAAC,IAAI,EAAE,uBAAuB,KAAK,IAAI,CAAC;AAE3F;;;;;;;GAOG;AACH,qBAAa,eAAe,CAAC,IAAI,SAAS,YAAY,EAAE,MAAM,CAC7D,YAAW,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;IAqCjC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAGxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAzCzB,QAAQ,UAAS;IACxB;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+D;IAC1F;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiC;IAC5D;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IACzD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmC;IAC3D;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS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CAAC,KAAK,IAAI,EAClF,OAAO,CAAC,EAAE,OAAO,GACf,IAAI;IAUP;;;OAGG;IACK,UAAU,IAAI,gBAAgB,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAU/C,OAAO,IAAI,IAAI;IAItB;;OAEG;IACI,CAAC,aAAa,CAAC,IAAI,IAAI;IAa9B;;OAEG;IACH,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,gBAAgB;IASxB;;OAEG;IACH,OAAO,CAAC,SAAS;IA8CjB;;OAEG;IACH,OAAO,CAAC,UAAU;IAUlB;;OAEG;IACH,OAAO,CAAC,UAAU;IAuBlB,OAAO,CAAC,YAAY;IAqBpB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAUxB;AAgBD;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,KAAK,IAAI,cAAc,CAAC,CAAC,CAAC,CAE7E"}
@@ -6,8 +6,8 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.hasElement = exports.AnchorTreeIndex = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
- const index_js_1 = require("../../util/index.js");
10
- const index_js_2 = require("../../core/index.js");
9
+ const index_js_1 = require("../../core/index.js");
10
+ const index_js_2 = require("../../util/index.js");
11
11
  const index_js_3 = require("../flex-tree/index.js");
12
12
  /**
13
13
  * An index from some arbitrary keys to anchor nodes. Keys can be anything that is a {@link TreeValue}.
@@ -60,7 +60,7 @@ class AnchorTreeIndex {
60
60
  this.forest.registerAnnouncedVisitor(this.keyFinder);
61
61
  const detachedFieldKeys = [];
62
62
  const detachedFieldsCursor = forest.getCursorAboveDetachedFields();
63
- (0, index_js_2.forEachField)(detachedFieldsCursor, (field) => {
63
+ (0, index_js_1.forEachField)(detachedFieldsCursor, (field) => {
64
64
  detachedFieldKeys.push(field.getFieldKey());
65
65
  });
66
66
  // index all existing trees (this includes the primary document tree and all other detached/removed trees)
@@ -78,7 +78,7 @@ class AnchorTreeIndex {
78
78
  this.checkNotDisposed("visitor getter should be deregistered from the forest when index is disposed");
79
79
  let parentField;
80
80
  let parent;
81
- return (0, index_js_2.createAnnouncedVisitor)({
81
+ return (0, index_js_1.createAnnouncedVisitor)({
82
82
  // nodes (and their entire subtrees) are added to the index as soon as they are created
83
83
  afterCreate: (content, destination) => {
84
84
  const detachedCursor = this.forest.allocateCursor();
@@ -217,12 +217,12 @@ class AnchorTreeIndex {
217
217
  }
218
218
  }
219
219
  dispose() {
220
- this[index_js_1.disposeSymbol]();
220
+ this[index_js_2.disposeSymbol]();
221
221
  }
222
222
  /**
223
223
  * Disposes this index and all the anchors it holds onto.
224
224
  */
225
- [index_js_1.disposeSymbol]() {
225
+ [index_js_2.disposeSymbol]() {
226
226
  this.checkNotDisposed("index is already disposed");
227
227
  for (const anchors of this.anchors.values()) {
228
228
  for (const anchor of anchors) {
@@ -261,7 +261,7 @@ class AnchorTreeIndex {
261
261
  * Given a cursor in node mode, indexes it.
262
262
  */
263
263
  indexNode(nodeCursor) {
264
- const keyFinder = (0, index_js_1.getOrCreate)(this.keyFinders,
264
+ const keyFinder = (0, index_js_2.getOrCreate)(this.keyFinders,
265
265
  // the node schema type to look up
266
266
  nodeCursor.type,
267
267
  // if the indexer does not return a key finder for this schema, we cache a null value to indicate the indexer
@@ -272,7 +272,7 @@ class AnchorTreeIndex {
272
272
  const key = keyFinder(nodeCursor);
273
273
  // TODO: determine perf impact of this check, alternative is not doing it in which case (if the key finder is not pure and functional),
274
274
  // an error may be thrown further down the line if the structure of the nodes aren't expected or the contents of the index could be inaccurate
275
- if (!(0, index_js_2.compareUpPaths)(nodeCursor.getPath(), expectedPath)) {
275
+ if (!(0, index_js_1.compareUpPaths)(nodeCursor.getPath(), expectedPath)) {
276
276
  throw new Error("key finder should be pure and functional");
277
277
  }
278
278
  const anchor = nodeCursor.buildAnchor();
@@ -290,9 +290,9 @@ class AnchorTreeIndex {
290
290
  this.removeAnchor(anchorNode, existingKey);
291
291
  }
292
292
  }
293
- (0, index_js_1.getOrCreate)(this.keyToNodes, key, () => []).push(anchorNode);
293
+ (0, index_js_2.getOrCreate)(this.keyToNodes, key, () => []).push(anchorNode);
294
294
  this.nodeToKey.set(anchorNode, key);
295
- (0, index_js_1.getOrCreate)(this.anchors, anchorNode, () => []).push(anchor);
295
+ (0, index_js_2.getOrCreate)(this.anchors, anchorNode, () => []).push(anchor);
296
296
  // when the anchor node is destroyed, delete it from the index
297
297
  anchorNode.events.on("afterDestroy", () => {
298
298
  this.removeAnchor(anchorNode, key);
@@ -303,9 +303,9 @@ class AnchorTreeIndex {
303
303
  * Given a cursor in field mode, recursively indexes all nodes under the field.
304
304
  */
305
305
  indexField(fieldCursor) {
306
- (0, index_js_2.forEachNode)(fieldCursor, (nodeCursor) => {
306
+ (0, index_js_1.forEachNode)(fieldCursor, (nodeCursor) => {
307
307
  this.indexNode(nodeCursor);
308
- (0, index_js_2.forEachField)(nodeCursor, (f) => {
308
+ (0, index_js_1.forEachField)(nodeCursor, (f) => {
309
309
  this.indexField(f);
310
310
  });
311
311
  });
@@ -314,7 +314,7 @@ class AnchorTreeIndex {
314
314
  * Given a cursor in field mode, indexes all nodes under the field and then indexes all nodes up the spine.
315
315
  */
316
316
  indexSpine(cursor) {
317
- if ((0, index_js_2.keyAsDetachedField)(cursor.getFieldKey()) !== index_js_2.rootField) {
317
+ if ((0, index_js_1.keyAsDetachedField)(cursor.getFieldKey()) !== index_js_1.rootField) {
318
318
  cursor.exitField();
319
319
  cursor.exitNode();
320
320
  }
@@ -324,8 +324,8 @@ class AnchorTreeIndex {
324
324
  }
325
325
  // walk up the spine and index nodes until we reach the root
326
326
  while (cursor.mode === 1 /* CursorLocationType.Fields */ &&
327
- (0, index_js_2.keyAsDetachedField)(cursor.getFieldKey()) !== index_js_2.rootField) {
328
- (0, index_js_2.forEachNode)(cursor, (nodeCursor) => {
327
+ (0, index_js_1.keyAsDetachedField)(cursor.getFieldKey()) !== index_js_1.rootField) {
328
+ (0, index_js_1.forEachNode)(cursor, (nodeCursor) => {
329
329
  this.indexNode(nodeCursor);
330
330
  });
331
331
  cursor.exitField();
@@ -1 +1 @@
1
- {"version":3,"file":"anchorTreeIndex.js","sourceRoot":"","sources":["../../../src/feature-libraries/indexing/anchorTreeIndex.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AACnE,kDAAiE;AACjE,kDAkB6B;AAE7B,oDAAmD;AAenD;;;;;;;GAOG;AACH,MAAa,eAAe;IA4B3B;;;;;;;;OAQG;IACH,YACkB,MAA2B,EAC3B,OAEe,EACf,QAAyE,EACzE,eAA6D,EAC7D,iBAAiB,KAAK;QANtB,WAAM,GAAN,MAAM,CAAqB;QAC3B,YAAO,GAAP,OAAO,CAEQ;QACf,aAAQ,GAAR,QAAQ,CAAiE;QACzE,oBAAe,GAAf,eAAe,CAA8C;QAC7D,mBAAc,GAAd,cAAc,CAAQ;QAzCjC,aAAQ,GAAG,KAAK,CAAC;QACxB;;;;WAIG;QACc,eAAU,GAAG,IAAI,GAAG,EAAoD,CAAC;QAC1F;;WAEG;QACc,eAAU,GAAG,IAAI,GAAG,EAAsB,CAAC;QAC5D;;WAEG;QACc,cAAS,GAAG,IAAI,GAAG,EAAoB,CAAC;QACzD;;WAEG;QACc,YAAO,GAAG,IAAI,GAAG,EAAwB,CAAC;QAC3D;;;WAGG;QACc,cAAS,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAoB3D,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAErD,MAAM,iBAAiB,GAAe,EAAE,CAAC;QACzC,MAAM,oBAAoB,GAAG,MAAM,CAAC,4BAA4B,EAAE,CAAC;QACnE,IAAA,uBAAY,EAAC,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE;YAC5C,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,W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OAAO,UAAU,KAAK,qBAAU,CAAC,UAAU,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,IAAI,aAAa,KAAK,SAAS,IAAI,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;YAC9D,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACrC,CAAC;IACF,CAAC;CACD;AAhZD,0CAgZC;AAED;;GAEG;AACH,SAAS,WAAW,CACnB,WAA8C,EAC9C,MAAqC;IAErC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAI,KAAmB;IAChD,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;AAC1B,CAAC;AAFD,gCAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport { disposeSymbol, getOrCreate } from \"../../util/index.js\";\nimport {\n\ttype Anchor,\n\ttype AnchorNode,\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\tforEachField,\n\tforEachNode,\n\ttype ITreeSubscriptionCursor,\n\tcreateAnnouncedVisitor,\n\ttype IForestSubscription,\n\ttype AnnouncedVisitor,\n\tCursorLocationType,\n\trootField,\n\ttype UpPath,\n\tkeyAsDetachedField,\n\tcompareUpPaths,\n\tTreeNavigationResult,\n\ttype ITreeCursorSynchronous,\n} from \"../../core/index.js\";\nimport type { TreeIndex, TreeIndexKey, TreeIndexNodes } from \"./types.js\";\nimport { TreeStatus } from \"../flex-tree/index.js\";\n\n/**\n * A function that gets the value to index a node on, must be pure and functional.\n * The given cursor should point to the node that will be indexed.\n *\n * @returns a value the index will use as the key for the given node\n *\n * @remarks\n * This function does not own the cursor in any way, it walks the cursor to find the key the node is indexed on\n * but returns the cursor to the state it was in before being passed to the function. It should also not be disposed by this function\n * and must be disposed elsewhere.\n */\nexport type KeyFinder<TKey extends TreeIndexKey> = (tree: ITreeSubscriptionCursor) => TKey;\n\n/**\n * An index from some arbitrary keys to anchor nodes. Keys can be anything that is a {@link TreeValue}.\n * A key can map to multiple nodes but each collection of nodes only results in a single value.\n *\n * @remarks\n * Detached nodes are stored in the index but filtered out when any public facing apis are called. This means that\n * calling {@link keys} will not include any keys that are stored in the index but only map to detached nodes.\n */\nexport class AnchorTreeIndex<TKey extends TreeIndexKey, TValue>\n\timplements TreeIndex<TKey, TValue>\n{\n\tpublic disposed = false;\n\t/**\n\t * Caches {@link KeyFinder}s for each schema definition. If a schema maps to null, it does not\n\t * need to be considered at all for this index. This allows us to skip subtrees that aren't relevant\n\t * as a performance optimization.\n\t */\n\tprivate readonly keyFinders = new Map<TreeNodeSchemaIdentifier, KeyFinder<TKey> | null>();\n\t/**\n\t * The actual index from keys to anchor nodes.\n\t */\n\tprivate readonly keyToNodes = new Map<TKey, AnchorNode[]>();\n\t/**\n\t * Maintained for efficient removal of anchor nodes from the index when updating their keys\n\t */\n\tprivate readonly nodeToKey = new Map<AnchorNode, TKey>();\n\t/**\n\t * Keeps track of anchors for disposal.\n\t */\n\tprivate readonly anchors = new Map<AnchorNode, Anchor[]>();\n\t/**\n\t * The key finder that is registered on the forest to keep this index updated, maintained\n\t * here for deregistration on disposal\n\t */\n\tprivate readonly keyFinder = this.acquireVisitor.bind(this);\n\n\t/**\n\t * @param forest - the forest that is being indexed\n\t * @param indexer - a function that retrieves the key finder based on a given schema or undefined if the schema does not have an associated key finder\n\t * @param getValue - a pure and functional function that returns the associated value of one or more anchor nodes, can be used to map and filter the indexed anchor nodes\n\t * so that the values returned from the index are more usable\n\t * @param checkTreeStatus - a function that gets the tree status from an anchor node, used for filtering out detached nodes\n\t * @param isShallowIndex - indicates if this index is shallow, meaning that it only allows nodes to be keyed off of fields directly under them rather than anywhere in their subtree.\n\t * As a performance optimization, re-indexing up the spine can be turned off for shallow indexes.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IForestSubscription,\n\t\tprivate readonly indexer: (\n\t\t\tschemaId: TreeNodeSchemaIdentifier,\n\t\t) => KeyFinder<TKey> | undefined,\n\t\tprivate readonly getValue: (anchorNodes: TreeIndexNodes<AnchorNode>) => TValue | undefined,\n\t\tprivate readonly checkTreeStatus: (node: AnchorNode) => TreeStatus | undefined,\n\t\tprivate readonly isShallowIndex = false,\n\t) {\n\t\tthis.forest.registerAnnouncedVisitor(this.keyFinder);\n\n\t\tconst detachedFieldKeys: FieldKey[] = [];\n\t\tconst detachedFieldsCursor = forest.getCursorAboveDetachedFields();\n\t\tforEachField(detachedFieldsCursor, (field) => {\n\t\t\tdetachedFieldKeys.push(field.getFieldKey());\n\t\t});\n\n\t\t// index all existing trees (this includes the primary document tree and all other detached/removed trees)\n\t\tfor (const fieldKey of detachedFieldKeys) {\n\t\t\tconst cursor = forest.allocateCursor();\n\t\t\tforest.tryMoveCursorToField({ fieldKey, parent: undefined }, cursor);\n\t\t\tthis.indexField(cursor);\n\t\t\tcursor.free();\n\t\t}\n\t}\n\n\t/**\n\t * Creates an announced visitor that responds to edits to the forest and updates the index accordingly.\n\t */\n\tprivate acquireVisitor(): AnnouncedVisitor {\n\t\tthis.checkNotDisposed(\n\t\t\t\"visitor getter should be deregistered from the forest when index is disposed\",\n\t\t);\n\t\tlet parentField: FieldKey | undefined;\n\t\tlet parent: UpPath | undefined;\n\n\t\treturn createAnnouncedVisitor({\n\t\t\t// nodes (and their entire subtrees) are added to the index as soon as they are created\n\t\t\tafterCreate: (content: readonly ITreeCursorSynchronous[], destination: FieldKey) => {\n\t\t\t\tconst detachedCursor = this.forest.allocateCursor();\n\t\t\t\tassert(\n\t\t\t\t\tthis.forest.tryMoveCursorToField(\n\t\t\t\t\t\t{ fieldKey: destination, parent: undefined },\n\t\t\t\t\t\tdetachedCursor,\n\t\t\t\t\t) === TreeNavigationResult.Ok,\n\t\t\t\t\t0xa8a /* destination of created nodes must be a valid detached field */,\n\t\t\t\t);\n\t\t\t\tthis.indexField(detachedCursor);\n\t\t\t\tdetachedCursor.free();\n\t\t\t},\n\t\t\tafterAttach: () => {\n\t\t\t\tassert(parent !== undefined, 0xa99 /* must have a parent */);\n\t\t\t\tthis.reIndexSpine(parent);\n\t\t\t},\n\t\t\tafterDetach: (_source, _count_, _destination, isReplaced) => {\n\t\t\t\tif (isReplaced) {\n\t\t\t\t\t// If the node will be replaced, we defer re-indexing until the corresponding attach event.\n\t\t\t\t\t// This has performance benefits but is also required to avoid experiencing the error case where the field that is used as the indexing key is empty.\n\t\t\t\t} else {\n\t\t\t\t\tassert(parent !== undefined, 0xa9a /* must have a parent */);\n\t\t\t\t\tthis.reIndexSpine(parent);\n\t\t\t\t}\n\t\t\t},\n\t\t\t// the methods below are used to keep track of the path that has been traversed by the visitor\n\t\t\t// this is required so that cursors can be moved to the correct location when index updates are required\n\t\t\tenterNode(index: number): void {\n\t\t\t\tassert(parentField !== undefined, 0xa8d /* must be in a field to enter node */);\n\n\t\t\t\tparent = {\n\t\t\t\t\tparent,\n\t\t\t\t\tparentField,\n\t\t\t\t\tparentIndex: index,\n\t\t\t\t};\n\t\t\t\tparentField = undefined;\n\t\t\t},\n\t\t\texitNode(index: number): void {\n\t\t\t\tassert(parent !== undefined, 0xa8e /* must have parent node */);\n\t\t\t\tconst temp = parent;\n\t\t\t\tparentField = temp.parentField;\n\t\t\t\tparent = temp.parent;\n\t\t\t},\n\t\t\tenterField: (key: FieldKey) => {\n\t\t\t\tparentField = key;\n\t\t\t},\n\t\t\texitField(key: FieldKey): void {\n\t\t\t\tparentField = undefined;\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Returns the value associated with the given key if it has been indexed\n\t */\n\tpublic get(key: TKey): TValue | undefined {\n\t\tthis.checkNotDisposed();\n\t\treturn this.getFilteredValue(this.keyToNodes.get(key));\n\t}\n\n\t/**\n\t * Returns true iff the key exists in the index\n\t */\n\tpublic has(key: TKey): boolean {\n\t\tthis.checkNotDisposed();\n\t\treturn this.get(key) !== undefined;\n\t}\n\n\t/**\n\t * Returns the number of values that are indexed\n\t */\n\tpublic get size(): number {\n\t\tthis.checkNotDisposed();\n\t\tlet s = 0;\n\t\tfor (const nodes of this.keyToNodes.values()) {\n\t\t\tif (this.getFilteredValue(nodes) !== undefined) {\n\t\t\t\ts += 1;\n\t\t\t}\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Returns all keys in the index\n\t */\n\tpublic *keys(): IterableIterator<TKey> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tif (this.getFilteredValue(nodes) !== undefined) {\n\t\t\t\tyield key;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of values in the index\n\t */\n\tpublic *values(): IterableIterator<TValue> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const nodes of this.keyToNodes.values()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tyield filtered;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the index\n\t */\n\tpublic *entries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tyield [key, filtered];\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Applies the provided callback to each entry in the index.\n\t */\n\tpublic forEach(\n\t\tcallbackfn: (value: TValue, key: TKey, map: AnchorTreeIndex<TKey, TValue>) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tcallbackfn.call(thisArg, filtered, key, this);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the index, including ones that are detached.\n\t * This function should only be used for testing purposes, it is not exposed as part of the public {@link TreeIndex} API.\n\t */\n\tpublic *allEntries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst value = this.getValue(nodes as unknown as TreeIndexNodes<AnchorNode>);\n\t\t\tif (value !== undefined) {\n\t\t\t\tyield [key, value];\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tthis[disposeSymbol]();\n\t}\n\n\t/**\n\t * Disposes this index and all the anchors it holds onto.\n\t */\n\tpublic [disposeSymbol](): void {\n\t\tthis.checkNotDisposed(\"index is already disposed\");\n\t\tfor (const anchors of this.anchors.values()) {\n\t\t\tfor (const anchor of anchors) {\n\t\t\t\tthis.forest.forgetAnchor(anchor);\n\t\t\t}\n\t\t}\n\t\tthis.keyToNodes.clear();\n\t\tthis.anchors.clear();\n\t\tthis.forest.deregisterAnnouncedVisitor(this.keyFinder);\n\t\tthis.disposed = true;\n\t}\n\n\t/**\n\t * Checks if the spine needs to be re-indexed and if so, re-indexes it starting from the given path.\n\t */\n\tprivate reIndexSpine(path: UpPath): void {\n\t\tconst cursor = this.forest.allocateCursor();\n\t\tthis.forest.moveCursorToPath(path, cursor);\n\t\tassert(\n\t\t\tcursor.mode === CursorLocationType.Nodes,\n\t\t\t0xa9b /* attach should happen in a node */,\n\t\t);\n\t\tcursor.exitNode();\n\t\t// TODO ADO:36390 avoid re-indexing the whole field when not necessary\n\t\tthis.indexField(cursor);\n\t\tif (!this.isShallowIndex) {\n\t\t\tthis.indexSpine(cursor);\n\t\t}\n\t\tcursor.clear();\n\t}\n\n\tprivate checkNotDisposed(errorMessage?: string): void {\n\t\tif (this.disposed) {\n\t\t\tif (errorMessage !== undefined) {\n\t\t\t\tthrow new Error(errorMessage);\n\t\t\t}\n\t\t\tassert(false, 0xa8f /* invalid operation on a disposed index */);\n\t\t}\n\t}\n\n\t/**\n\t * Given a cursor in node mode, indexes it.\n\t */\n\tprivate indexNode(nodeCursor: ITreeSubscriptionCursor): void {\n\t\tconst keyFinder = getOrCreate(\n\t\t\tthis.keyFinders,\n\t\t\t// the node schema type to look up\n\t\t\tnodeCursor.type,\n\t\t\t// if the indexer does not return a key finder for this schema, we cache a null value to indicate the indexer\n\t\t\t// does not need to be called if this schema is encountered in the future\n\t\t\t(schema) => this.indexer(schema) ?? null,\n\t\t);\n\n\t\tif (keyFinder !== null) {\n\t\t\tconst expectedPath = nodeCursor.getPath();\n\t\t\tconst key = keyFinder(nodeCursor);\n\t\t\t// TODO: determine perf impact of this check, alternative is not doing it in which case (if the key finder is not pure and functional),\n\t\t\t// an error may be thrown further down the line if the structure of the nodes aren't expected or the contents of the index could be inaccurate\n\t\t\tif (!compareUpPaths(nodeCursor.getPath(), expectedPath)) {\n\t\t\t\tthrow new Error(\"key finder should be pure and functional\");\n\t\t\t}\n\t\t\tconst anchor = nodeCursor.buildAnchor();\n\t\t\tconst anchorNode =\n\t\t\t\tthis.forest.anchors.locate(anchor) ?? fail(0xb16 /* expected anchor node */);\n\n\t\t\t// check if this anchor node already exists in the index\n\t\t\tconst existingKey = this.nodeToKey.get(anchorNode);\n\t\t\tif (existingKey !== undefined) {\n\t\t\t\t// if the node already exists but has the same key, we return early\n\t\t\t\tif (existingKey === key) {\n\t\t\t\t\tthis.forest.forgetAnchor(anchor);\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t// if the node has a different key, we remove the existing one first because it means the key had been detached\n\t\t\t\t\tthis.removeAnchor(anchorNode, existingKey);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgetOrCreate(this.keyToNodes, key, () => []).push(anchorNode);\n\t\t\tthis.nodeToKey.set(anchorNode, key);\n\n\t\t\tgetOrCreate(this.anchors, anchorNode, () => []).push(anchor);\n\t\t\t// when the anchor node is destroyed, delete it from the index\n\t\t\tanchorNode.events.on(\"afterDestroy\", () => {\n\t\t\t\tthis.removeAnchor(anchorNode, key);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Given a cursor in field mode, recursively indexes all nodes under the field.\n\t */\n\tprivate indexField(fieldCursor: ITreeSubscriptionCursor): void {\n\t\tforEachNode(fieldCursor, (nodeCursor) => {\n\t\t\tthis.indexNode(nodeCursor);\n\n\t\t\tforEachField(nodeCursor, (f) => {\n\t\t\t\tthis.indexField(f);\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Given a cursor in field mode, indexes all nodes under the field and then indexes all nodes up the spine.\n\t */\n\tprivate indexSpine(cursor: ITreeSubscriptionCursor): void {\n\t\tif (keyAsDetachedField(cursor.getFieldKey()) !== rootField) {\n\t\t\tcursor.exitField();\n\t\t\tcursor.exitNode();\n\t\t} else {\n\t\t\t// return early if we're already at the root field\n\t\t\treturn;\n\t\t}\n\n\t\t// walk up the spine and index nodes until we reach the root\n\t\twhile (\n\t\t\tcursor.mode === CursorLocationType.Fields &&\n\t\t\tkeyAsDetachedField(cursor.getFieldKey()) !== rootField\n\t\t) {\n\t\t\tforEachNode(cursor, (nodeCursor) => {\n\t\t\t\tthis.indexNode(nodeCursor);\n\t\t\t});\n\n\t\t\tcursor.exitField();\n\t\t\tcursor.exitNode();\n\t\t}\n\t}\n\n\tprivate removeAnchor(anchorNode: AnchorNode, key: TKey): void {\n\t\tconst indexedNodes = this.keyToNodes.get(key);\n\t\tassert(\n\t\t\tindexedNodes !== undefined,\n\t\t\t0xa90 /* destroyed anchor node should be tracked by index */,\n\t\t);\n\t\tconst index = indexedNodes.indexOf(anchorNode);\n\t\tassert(index !== -1, 0xa91 /* destroyed anchor node should be tracked by index */);\n\t\tconst newNodes = filterNodes(indexedNodes, (n) => n !== anchorNode);\n\t\tif (newNodes !== undefined && newNodes.length > 0) {\n\t\t\tthis.keyToNodes.set(key, newNodes);\n\t\t} else {\n\t\t\tthis.keyToNodes.delete(key);\n\t\t}\n\t\tthis.nodeToKey.delete(anchorNode);\n\t\tassert(\n\t\t\tthis.anchors.delete(anchorNode),\n\t\t\t0xa92 /* destroyed anchor should be tracked by index */,\n\t\t);\n\t}\n\n\t/**\n\t * Filters out any anchor nodes that are detached and returns the value for the remaining nodes.\n\t */\n\tprivate getFilteredValue(anchorNodes: AnchorNode[] | undefined): TValue | undefined {\n\t\tconst attachedNodes = filterNodes(anchorNodes, (anchorNode) => {\n\t\t\tconst nodeStatus = this.checkTreeStatus(anchorNode);\n\t\t\treturn nodeStatus === TreeStatus.InDocument;\n\t\t});\n\n\t\tif (attachedNodes !== undefined && hasElement(attachedNodes)) {\n\t\t\treturn this.getValue(attachedNodes);\n\t\t}\n\t}\n}\n\n/**\n * Filters the given anchor nodes based on the given filter function.\n */\nfunction filterNodes(\n\tanchorNodes: readonly AnchorNode[] | undefined,\n\tfilter: (node: AnchorNode) => boolean,\n): AnchorNode[] | undefined {\n\tif (anchorNodes !== undefined) {\n\t\treturn anchorNodes.filter(filter);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Checks that an array is of the type {@link TreeIndexNodes} and has at least one element.\n */\nexport function hasElement<T>(array: readonly T[]): array is TreeIndexNodes<T> {\n\treturn array.length >= 1;\n}\n"]}
1
+ {"version":3,"file":"anchorTreeIndex.js","sourceRoot":"","sources":["../../../src/feature-libraries/indexing/anchorTreeIndex.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAEnE,kDAkB6B;AAC7B,kDAAiE;AACjE,oDAAmD;AAiBnD;;;;;;;GAOG;AACH,MAAa,eAAe;IA4B3B;;;;;;;;OAQG;IACH,YACkB,MAA2B,EAC3B,OAEe,EACf,QAAyE,EACzE,eAA6D,EAC7D,iBAAiB,KAAK;QANtB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AED;;GAEG;AACH,SAAgB,UAAU,CAAI,KAAmB;IAChD,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;AAC1B,CAAC;AAFD,gCAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype Anchor,\n\ttype AnchorNode,\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\tforEachField,\n\tforEachNode,\n\ttype ITreeSubscriptionCursor,\n\tcreateAnnouncedVisitor,\n\ttype IForestSubscription,\n\ttype AnnouncedVisitor,\n\tCursorLocationType,\n\trootField,\n\ttype UpPath,\n\tkeyAsDetachedField,\n\tcompareUpPaths,\n\tTreeNavigationResult,\n\ttype ITreeCursorSynchronous,\n} from \"../../core/index.js\";\nimport { disposeSymbol, getOrCreate } from \"../../util/index.js\";\nimport { TreeStatus } from \"../flex-tree/index.js\";\n\nimport type { TreeIndex, TreeIndexKey, TreeIndexNodes } from \"./types.js\";\n\n/**\n * A function that gets the value to index a node on, must be pure and functional.\n * The given cursor should point to the node that will be indexed.\n *\n * @returns a value the index will use as the key for the given node\n *\n * @remarks\n * This function does not own the cursor in any way, it walks the cursor to find the key the node is indexed on\n * but returns the cursor to the state it was in before being passed to the function. It should also not be disposed by this function\n * and must be disposed elsewhere.\n */\nexport type KeyFinder<TKey extends TreeIndexKey> = (tree: ITreeSubscriptionCursor) => TKey;\n\n/**\n * An index from some arbitrary keys to anchor nodes. Keys can be anything that is a {@link TreeValue}.\n * A key can map to multiple nodes but each collection of nodes only results in a single value.\n *\n * @remarks\n * Detached nodes are stored in the index but filtered out when any public facing apis are called. This means that\n * calling {@link keys} will not include any keys that are stored in the index but only map to detached nodes.\n */\nexport class AnchorTreeIndex<TKey extends TreeIndexKey, TValue>\n\timplements TreeIndex<TKey, TValue>\n{\n\tpublic disposed = false;\n\t/**\n\t * Caches {@link KeyFinder}s for each schema definition. If a schema maps to null, it does not\n\t * need to be considered at all for this index. This allows us to skip subtrees that aren't relevant\n\t * as a performance optimization.\n\t */\n\tprivate readonly keyFinders = new Map<TreeNodeSchemaIdentifier, KeyFinder<TKey> | null>();\n\t/**\n\t * The actual index from keys to anchor nodes.\n\t */\n\tprivate readonly keyToNodes = new Map<TKey, AnchorNode[]>();\n\t/**\n\t * Maintained for efficient removal of anchor nodes from the index when updating their keys\n\t */\n\tprivate readonly nodeToKey = new Map<AnchorNode, TKey>();\n\t/**\n\t * Keeps track of anchors for disposal.\n\t */\n\tprivate readonly anchors = new Map<AnchorNode, Anchor[]>();\n\t/**\n\t * The key finder that is registered on the forest to keep this index updated, maintained\n\t * here for deregistration on disposal\n\t */\n\tprivate readonly keyFinder = this.acquireVisitor.bind(this);\n\n\t/**\n\t * @param forest - the forest that is being indexed\n\t * @param indexer - a function that retrieves the key finder based on a given schema or undefined if the schema does not have an associated key finder\n\t * @param getValue - a pure and functional function that returns the associated value of one or more anchor nodes, can be used to map and filter the indexed anchor nodes\n\t * so that the values returned from the index are more usable\n\t * @param checkTreeStatus - a function that gets the tree status from an anchor node, used for filtering out detached nodes\n\t * @param isShallowIndex - indicates if this index is shallow, meaning that it only allows nodes to be keyed off of fields directly under them rather than anywhere in their subtree.\n\t * As a performance optimization, re-indexing up the spine can be turned off for shallow indexes.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IForestSubscription,\n\t\tprivate readonly indexer: (\n\t\t\tschemaId: TreeNodeSchemaIdentifier,\n\t\t) => KeyFinder<TKey> | undefined,\n\t\tprivate readonly getValue: (anchorNodes: TreeIndexNodes<AnchorNode>) => TValue | undefined,\n\t\tprivate readonly checkTreeStatus: (node: AnchorNode) => TreeStatus | undefined,\n\t\tprivate readonly isShallowIndex = false,\n\t) {\n\t\tthis.forest.registerAnnouncedVisitor(this.keyFinder);\n\n\t\tconst detachedFieldKeys: FieldKey[] = [];\n\t\tconst detachedFieldsCursor = forest.getCursorAboveDetachedFields();\n\t\tforEachField(detachedFieldsCursor, (field) => {\n\t\t\tdetachedFieldKeys.push(field.getFieldKey());\n\t\t});\n\n\t\t// index all existing trees (this includes the primary document tree and all other detached/removed trees)\n\t\tfor (const fieldKey of detachedFieldKeys) {\n\t\t\tconst cursor = forest.allocateCursor();\n\t\t\tforest.tryMoveCursorToField({ fieldKey, parent: undefined }, cursor);\n\t\t\tthis.indexField(cursor);\n\t\t\tcursor.free();\n\t\t}\n\t}\n\n\t/**\n\t * Creates an announced visitor that responds to edits to the forest and updates the index accordingly.\n\t */\n\tprivate acquireVisitor(): AnnouncedVisitor {\n\t\tthis.checkNotDisposed(\n\t\t\t\"visitor getter should be deregistered from the forest when index is disposed\",\n\t\t);\n\t\tlet parentField: FieldKey | undefined;\n\t\tlet parent: UpPath | undefined;\n\n\t\treturn createAnnouncedVisitor({\n\t\t\t// nodes (and their entire subtrees) are added to the index as soon as they are created\n\t\t\tafterCreate: (content: readonly ITreeCursorSynchronous[], destination: FieldKey) => {\n\t\t\t\tconst detachedCursor = this.forest.allocateCursor();\n\t\t\t\tassert(\n\t\t\t\t\tthis.forest.tryMoveCursorToField(\n\t\t\t\t\t\t{ fieldKey: destination, parent: undefined },\n\t\t\t\t\t\tdetachedCursor,\n\t\t\t\t\t) === TreeNavigationResult.Ok,\n\t\t\t\t\t0xa8a /* destination of created nodes must be a valid detached field */,\n\t\t\t\t);\n\t\t\t\tthis.indexField(detachedCursor);\n\t\t\t\tdetachedCursor.free();\n\t\t\t},\n\t\t\tafterAttach: () => {\n\t\t\t\tassert(parent !== undefined, 0xa99 /* must have a parent */);\n\t\t\t\tthis.reIndexSpine(parent);\n\t\t\t},\n\t\t\tafterDetach: (_source, _count_, _destination, isReplaced) => {\n\t\t\t\tif (isReplaced) {\n\t\t\t\t\t// If the node will be replaced, we defer re-indexing until the corresponding attach event.\n\t\t\t\t\t// This has performance benefits but is also required to avoid experiencing the error case where the field that is used as the indexing key is empty.\n\t\t\t\t} else {\n\t\t\t\t\tassert(parent !== undefined, 0xa9a /* must have a parent */);\n\t\t\t\t\tthis.reIndexSpine(parent);\n\t\t\t\t}\n\t\t\t},\n\t\t\t// the methods below are used to keep track of the path that has been traversed by the visitor\n\t\t\t// this is required so that cursors can be moved to the correct location when index updates are required\n\t\t\tenterNode(index: number): void {\n\t\t\t\tassert(parentField !== undefined, 0xa8d /* must be in a field to enter node */);\n\n\t\t\t\tparent = {\n\t\t\t\t\tparent,\n\t\t\t\t\tparentField,\n\t\t\t\t\tparentIndex: index,\n\t\t\t\t};\n\t\t\t\tparentField = undefined;\n\t\t\t},\n\t\t\texitNode(index: number): void {\n\t\t\t\tassert(parent !== undefined, 0xa8e /* must have parent node */);\n\t\t\t\tconst temp = parent;\n\t\t\t\tparentField = temp.parentField;\n\t\t\t\tparent = temp.parent;\n\t\t\t},\n\t\t\tenterField: (key: FieldKey) => {\n\t\t\t\tparentField = key;\n\t\t\t},\n\t\t\texitField(key: FieldKey): void {\n\t\t\t\tparentField = undefined;\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Returns the value associated with the given key if it has been indexed\n\t */\n\tpublic get(key: TKey): TValue | undefined {\n\t\tthis.checkNotDisposed();\n\t\treturn this.getFilteredValue(this.keyToNodes.get(key));\n\t}\n\n\t/**\n\t * Returns true iff the key exists in the index\n\t */\n\tpublic has(key: TKey): boolean {\n\t\tthis.checkNotDisposed();\n\t\treturn this.get(key) !== undefined;\n\t}\n\n\t/**\n\t * Returns the number of values that are indexed\n\t */\n\tpublic get size(): number {\n\t\tthis.checkNotDisposed();\n\t\tlet s = 0;\n\t\tfor (const nodes of this.keyToNodes.values()) {\n\t\t\tif (this.getFilteredValue(nodes) !== undefined) {\n\t\t\t\ts += 1;\n\t\t\t}\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Returns all keys in the index\n\t */\n\tpublic *keys(): IterableIterator<TKey> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tif (this.getFilteredValue(nodes) !== undefined) {\n\t\t\t\tyield key;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of values in the index\n\t */\n\tpublic *values(): IterableIterator<TValue> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const nodes of this.keyToNodes.values()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tyield filtered;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the index\n\t */\n\tpublic *entries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tyield [key, filtered];\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Applies the provided callback to each entry in the index.\n\t */\n\tpublic forEach(\n\t\tcallbackfn: (value: TValue, key: TKey, map: AnchorTreeIndex<TKey, TValue>) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tcallbackfn.call(thisArg, filtered, key, this);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the index, including ones that are detached.\n\t * This function should only be used for testing purposes, it is not exposed as part of the public {@link TreeIndex} API.\n\t */\n\tpublic *allEntries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst value = this.getValue(nodes as unknown as TreeIndexNodes<AnchorNode>);\n\t\t\tif (value !== undefined) {\n\t\t\t\tyield [key, value];\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tthis[disposeSymbol]();\n\t}\n\n\t/**\n\t * Disposes this index and all the anchors it holds onto.\n\t */\n\tpublic [disposeSymbol](): void {\n\t\tthis.checkNotDisposed(\"index is already disposed\");\n\t\tfor (const anchors of this.anchors.values()) {\n\t\t\tfor (const anchor of anchors) {\n\t\t\t\tthis.forest.forgetAnchor(anchor);\n\t\t\t}\n\t\t}\n\t\tthis.keyToNodes.clear();\n\t\tthis.anchors.clear();\n\t\tthis.forest.deregisterAnnouncedVisitor(this.keyFinder);\n\t\tthis.disposed = true;\n\t}\n\n\t/**\n\t * Checks if the spine needs to be re-indexed and if so, re-indexes it starting from the given path.\n\t */\n\tprivate reIndexSpine(path: UpPath): void {\n\t\tconst cursor = this.forest.allocateCursor();\n\t\tthis.forest.moveCursorToPath(path, cursor);\n\t\tassert(\n\t\t\tcursor.mode === CursorLocationType.Nodes,\n\t\t\t0xa9b /* attach should happen in a node */,\n\t\t);\n\t\tcursor.exitNode();\n\t\t// TODO ADO:36390 avoid re-indexing the whole field when not necessary\n\t\tthis.indexField(cursor);\n\t\tif (!this.isShallowIndex) {\n\t\t\tthis.indexSpine(cursor);\n\t\t}\n\t\tcursor.clear();\n\t}\n\n\tprivate checkNotDisposed(errorMessage?: string): void {\n\t\tif (this.disposed) {\n\t\t\tif (errorMessage !== undefined) {\n\t\t\t\tthrow new Error(errorMessage);\n\t\t\t}\n\t\t\tassert(false, 0xa8f /* invalid operation on a disposed index */);\n\t\t}\n\t}\n\n\t/**\n\t * Given a cursor in node mode, indexes it.\n\t */\n\tprivate indexNode(nodeCursor: ITreeSubscriptionCursor): void {\n\t\tconst keyFinder = getOrCreate(\n\t\t\tthis.keyFinders,\n\t\t\t// the node schema type to look up\n\t\t\tnodeCursor.type,\n\t\t\t// if the indexer does not return a key finder for this schema, we cache a null value to indicate the indexer\n\t\t\t// does not need to be called if this schema is encountered in the future\n\t\t\t(schema) => this.indexer(schema) ?? null,\n\t\t);\n\n\t\tif (keyFinder !== null) {\n\t\t\tconst expectedPath = nodeCursor.getPath();\n\t\t\tconst key = keyFinder(nodeCursor);\n\t\t\t// TODO: determine perf impact of this check, alternative is not doing it in which case (if the key finder is not pure and functional),\n\t\t\t// an error may be thrown further down the line if the structure of the nodes aren't expected or the contents of the index could be inaccurate\n\t\t\tif (!compareUpPaths(nodeCursor.getPath(), expectedPath)) {\n\t\t\t\tthrow new Error(\"key finder should be pure and functional\");\n\t\t\t}\n\t\t\tconst anchor = nodeCursor.buildAnchor();\n\t\t\tconst anchorNode =\n\t\t\t\tthis.forest.anchors.locate(anchor) ?? fail(0xb16 /* expected anchor node */);\n\n\t\t\t// check if this anchor node already exists in the index\n\t\t\tconst existingKey = this.nodeToKey.get(anchorNode);\n\t\t\tif (existingKey !== undefined) {\n\t\t\t\t// if the node already exists but has the same key, we return early\n\t\t\t\tif (existingKey === key) {\n\t\t\t\t\tthis.forest.forgetAnchor(anchor);\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t// if the node has a different key, we remove the existing one first because it means the key had been detached\n\t\t\t\t\tthis.removeAnchor(anchorNode, existingKey);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgetOrCreate(this.keyToNodes, key, () => []).push(anchorNode);\n\t\t\tthis.nodeToKey.set(anchorNode, key);\n\n\t\t\tgetOrCreate(this.anchors, anchorNode, () => []).push(anchor);\n\t\t\t// when the anchor node is destroyed, delete it from the index\n\t\t\tanchorNode.events.on(\"afterDestroy\", () => {\n\t\t\t\tthis.removeAnchor(anchorNode, key);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Given a cursor in field mode, recursively indexes all nodes under the field.\n\t */\n\tprivate indexField(fieldCursor: ITreeSubscriptionCursor): void {\n\t\tforEachNode(fieldCursor, (nodeCursor) => {\n\t\t\tthis.indexNode(nodeCursor);\n\n\t\t\tforEachField(nodeCursor, (f) => {\n\t\t\t\tthis.indexField(f);\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Given a cursor in field mode, indexes all nodes under the field and then indexes all nodes up the spine.\n\t */\n\tprivate indexSpine(cursor: ITreeSubscriptionCursor): void {\n\t\tif (keyAsDetachedField(cursor.getFieldKey()) !== rootField) {\n\t\t\tcursor.exitField();\n\t\t\tcursor.exitNode();\n\t\t} else {\n\t\t\t// return early if we're already at the root field\n\t\t\treturn;\n\t\t}\n\n\t\t// walk up the spine and index nodes until we reach the root\n\t\twhile (\n\t\t\tcursor.mode === CursorLocationType.Fields &&\n\t\t\tkeyAsDetachedField(cursor.getFieldKey()) !== rootField\n\t\t) {\n\t\t\tforEachNode(cursor, (nodeCursor) => {\n\t\t\t\tthis.indexNode(nodeCursor);\n\t\t\t});\n\n\t\t\tcursor.exitField();\n\t\t\tcursor.exitNode();\n\t\t}\n\t}\n\n\tprivate removeAnchor(anchorNode: AnchorNode, key: TKey): void {\n\t\tconst indexedNodes = this.keyToNodes.get(key);\n\t\tassert(\n\t\t\tindexedNodes !== undefined,\n\t\t\t0xa90 /* destroyed anchor node should be tracked by index */,\n\t\t);\n\t\tconst index = indexedNodes.indexOf(anchorNode);\n\t\tassert(index !== -1, 0xa91 /* destroyed anchor node should be tracked by index */);\n\t\tconst newNodes = filterNodes(indexedNodes, (n) => n !== anchorNode);\n\t\tif (newNodes !== undefined && newNodes.length > 0) {\n\t\t\tthis.keyToNodes.set(key, newNodes);\n\t\t} else {\n\t\t\tthis.keyToNodes.delete(key);\n\t\t}\n\t\tthis.nodeToKey.delete(anchorNode);\n\t\tassert(\n\t\t\tthis.anchors.delete(anchorNode),\n\t\t\t0xa92 /* destroyed anchor should be tracked by index */,\n\t\t);\n\t}\n\n\t/**\n\t * Filters out any anchor nodes that are detached and returns the value for the remaining nodes.\n\t */\n\tprivate getFilteredValue(anchorNodes: AnchorNode[] | undefined): TValue | undefined {\n\t\tconst attachedNodes = filterNodes(anchorNodes, (anchorNode) => {\n\t\t\tconst nodeStatus = this.checkTreeStatus(anchorNode);\n\t\t\treturn nodeStatus === TreeStatus.InDocument;\n\t\t});\n\n\t\tif (attachedNodes !== undefined && hasElement(attachedNodes)) {\n\t\t\treturn this.getValue(attachedNodes);\n\t\t}\n\t}\n}\n\n/**\n * Filters the given anchor nodes based on the given filter function.\n */\nfunction filterNodes(\n\tanchorNodes: readonly AnchorNode[] | undefined,\n\tfilter: (node: AnchorNode) => boolean,\n): AnchorNode[] | undefined {\n\tif (anchorNodes !== undefined) {\n\t\treturn anchorNodes.filter(filter);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Checks that an array is of the type {@link TreeIndexNodes} and has at least one element.\n */\nexport function hasElement<T>(array: readonly T[]): array is TreeIndexNodes<T> {\n\treturn array.length >= 1;\n}\n"]}