@fluidframework/tree 2.41.0-338186 → 2.41.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 (1205) hide show
  1. package/CHANGELOG.md +341 -0
  2. package/api-report/tree.alpha.api.md +174 -4
  3. package/dist/alpha.d.ts +3 -0
  4. package/dist/codec/codec.d.ts +52 -7
  5. package/dist/codec/codec.d.ts.map +1 -1
  6. package/dist/codec/codec.js +60 -8
  7. package/dist/codec/codec.js.map +1 -1
  8. package/dist/core/change-family/editBuilder.d.ts.map +1 -1
  9. package/dist/core/change-family/editBuilder.js.map +1 -1
  10. package/dist/core/forest/forest.d.ts.map +1 -1
  11. package/dist/core/forest/forest.js.map +1 -1
  12. package/dist/core/index.d.ts +1 -1
  13. package/dist/core/index.d.ts.map +1 -1
  14. package/dist/core/index.js +2 -1
  15. package/dist/core/index.js.map +1 -1
  16. package/dist/core/rebase/types.d.ts +2 -2
  17. package/dist/core/rebase/types.js +2 -2
  18. package/dist/core/rebase/types.js.map +1 -1
  19. package/dist/core/rebase/utils.d.ts +0 -2
  20. package/dist/core/rebase/utils.d.ts.map +1 -1
  21. package/dist/core/rebase/utils.js +6 -10
  22. package/dist/core/rebase/utils.js.map +1 -1
  23. package/dist/core/schema-stored/formatV1.d.ts +0 -1
  24. package/dist/core/schema-stored/formatV1.d.ts.map +1 -1
  25. package/dist/core/schema-stored/formatV1.js +1 -2
  26. package/dist/core/schema-stored/formatV1.js.map +1 -1
  27. package/dist/core/schema-stored/index.d.ts +1 -1
  28. package/dist/core/schema-stored/index.d.ts.map +1 -1
  29. package/dist/core/schema-stored/index.js +2 -1
  30. package/dist/core/schema-stored/index.js.map +1 -1
  31. package/dist/core/schema-stored/schema.d.ts +6 -0
  32. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  33. package/dist/core/schema-stored/schema.js +8 -1
  34. package/dist/core/schema-stored/schema.js.map +1 -1
  35. package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  36. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  37. package/dist/core/schema-stored/storedSchemaRepository.js +1 -1
  38. package/dist/core/schema-stored/storedSchemaRepository.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 +4 -3
  42. package/dist/core/tree/anchorSet.js.map +1 -1
  43. package/dist/core/tree/chunk.d.ts.map +1 -1
  44. package/dist/core/tree/chunk.js.map +1 -1
  45. package/dist/core/tree/delta.d.ts.map +1 -1
  46. package/dist/core/tree/delta.js.map +1 -1
  47. package/dist/core/tree/deltaUtil.d.ts.map +1 -1
  48. package/dist/core/tree/deltaUtil.js.map +1 -1
  49. package/dist/core/tree/detachedFieldIndex.d.ts +1 -1
  50. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  51. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  52. package/dist/core/tree/detachedFieldIndexCodec.d.ts +1 -1
  53. package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
  54. package/dist/core/tree/detachedFieldIndexCodec.js +1 -1
  55. package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
  56. package/dist/core/tree/pathTree.d.ts +12 -11
  57. package/dist/core/tree/pathTree.d.ts.map +1 -1
  58. package/dist/core/tree/pathTree.js +8 -7
  59. package/dist/core/tree/pathTree.js.map +1 -1
  60. package/dist/core/tree/treeTextFormat.d.ts +1 -1
  61. package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
  62. package/dist/core/tree/treeTextFormat.js +1 -1
  63. package/dist/core/tree/treeTextFormat.js.map +1 -1
  64. package/dist/core/tree/visitDelta.d.ts +1 -1
  65. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  66. package/dist/core/tree/visitDelta.js.map +1 -1
  67. package/dist/core/tree/visitorUtils.d.ts +2 -2
  68. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  69. package/dist/core/tree/visitorUtils.js.map +1 -1
  70. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
  71. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  72. package/dist/feature-libraries/chunked-forest/chunkTree.js +1 -1
  73. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  74. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -2
  75. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  76. package/dist/feature-libraries/chunked-forest/chunkedForest.js +2 -2
  77. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  79. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  80. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  81. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +2 -2
  82. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  83. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  84. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  85. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  86. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -2
  87. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  88. package/dist/feature-libraries/chunked-forest/codec/codecs.js +12 -1
  89. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  90. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
  91. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  92. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  93. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  94. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  95. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
  96. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  97. package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
  98. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +1 -1
  99. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
  100. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  101. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  102. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  103. package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
  104. package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  105. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  106. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  107. package/dist/feature-libraries/chunked-forest/index.js +2 -1
  108. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  109. package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
  110. package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
  111. package/dist/feature-libraries/chunked-forest/sequenceChunk.js +4 -4
  112. package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  113. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -1
  114. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  115. package/dist/feature-libraries/chunked-forest/uniformChunk.js +1 -1
  116. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  117. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +1 -1
  118. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  119. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  120. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  121. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  122. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  123. package/dist/feature-libraries/default-schema/index.js +3 -2
  124. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  125. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  126. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  127. package/dist/feature-libraries/default-schema/schemaChecker.d.ts +18 -14
  128. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  129. package/dist/feature-libraries/default-schema/schemaChecker.js +78 -54
  130. package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  131. package/dist/feature-libraries/flex-tree/context.d.ts +18 -2
  132. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  133. package/dist/feature-libraries/flex-tree/context.js +22 -6
  134. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  135. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +3 -2
  136. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  137. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +3 -2
  138. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  139. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  140. package/dist/feature-libraries/flex-tree/lazyField.js +1 -1
  141. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  142. package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  143. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  144. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +1 -1
  145. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  146. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  147. package/dist/feature-libraries/index.d.ts +3 -3
  148. package/dist/feature-libraries/index.d.ts.map +1 -1
  149. package/dist/feature-libraries/index.js +5 -4
  150. package/dist/feature-libraries/index.js.map +1 -1
  151. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +2 -2
  152. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  153. package/dist/feature-libraries/indexing/anchorTreeIndex.js +15 -15
  154. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  155. package/dist/feature-libraries/initializeForest.d.ts.map +1 -1
  156. package/dist/feature-libraries/initializeForest.js.map +1 -1
  157. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  158. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  159. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +1 -1
  160. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  161. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  162. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +1 -1
  163. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +1 -1
  164. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
  165. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  166. package/dist/feature-libraries/modular-schema/genericFieldKind.js +2 -2
  167. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  168. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  169. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  170. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
  171. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  172. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +0 -2
  173. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  174. package/dist/feature-libraries/modular-schema/isNeverTree.js +0 -2
  175. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  176. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  177. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  178. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -0
  179. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  180. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +2 -0
  181. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  182. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  183. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  184. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts.map +1 -1
  185. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +8 -3
  186. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  187. package/dist/feature-libraries/object-forest/objectForest.d.ts +22 -5
  188. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  189. package/dist/feature-libraries/object-forest/objectForest.js +296 -207
  190. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  191. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -2
  192. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  193. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +3 -2
  194. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  195. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  196. package/dist/feature-libraries/schema-index/codec.d.ts +6 -12
  197. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  198. package/dist/feature-libraries/schema-index/codec.js +8 -15
  199. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  200. package/dist/feature-libraries/schema-index/formatV1.d.ts +2 -2
  201. package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  202. package/dist/feature-libraries/schema-index/formatV1.js +1 -1
  203. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
  204. package/dist/feature-libraries/schema-index/index.d.ts +1 -1
  205. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  206. package/dist/feature-libraries/schema-index/index.js +1 -2
  207. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  208. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -1
  209. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  210. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  211. package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  212. package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -1
  213. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  214. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  215. package/dist/feature-libraries/sequence-field/prune.d.ts.map +1 -1
  216. package/dist/feature-libraries/sequence-field/prune.js.map +1 -1
  217. package/dist/feature-libraries/sequence-field/rebase.js +1 -1
  218. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  219. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +1 -1
  220. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
  221. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  222. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  223. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  224. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +1 -1
  225. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
  226. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
  227. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
  228. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  229. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  230. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
  231. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  232. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +1 -1
  233. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  234. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +2 -2
  235. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  236. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +1 -1
  237. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  238. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  239. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +1 -1
  240. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  241. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  242. package/dist/feature-libraries/sequence-field/utils.d.ts +7 -5
  243. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  244. package/dist/feature-libraries/sequence-field/utils.js +7 -5
  245. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  246. package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  247. package/dist/feature-libraries/treeCursorUtils.js +3 -3
  248. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  249. package/dist/feature-libraries/treeTextCursor.d.ts +1 -1
  250. package/dist/feature-libraries/treeTextCursor.js +1 -1
  251. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  252. package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
  253. package/dist/feature-libraries/valueUtilities.js +6 -6
  254. package/dist/feature-libraries/valueUtilities.js.map +1 -1
  255. package/dist/index.d.ts +2 -2
  256. package/dist/index.d.ts.map +1 -1
  257. package/dist/index.js +2 -6
  258. package/dist/index.js.map +1 -1
  259. package/dist/jsonDomainSchema.d.ts.map +1 -1
  260. package/dist/jsonDomainSchema.js.map +1 -1
  261. package/dist/packageVersion.d.ts +1 -1
  262. package/dist/packageVersion.d.ts.map +1 -1
  263. package/dist/packageVersion.js +1 -1
  264. package/dist/packageVersion.js.map +1 -1
  265. package/dist/serializableDomainSchema.d.ts.map +1 -1
  266. package/dist/serializableDomainSchema.js.map +1 -1
  267. package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
  268. package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -1
  269. package/dist/shared-tree/independentView.d.ts +1 -1
  270. package/dist/shared-tree/independentView.d.ts.map +1 -1
  271. package/dist/shared-tree/independentView.js +8 -3
  272. package/dist/shared-tree/independentView.js.map +1 -1
  273. package/dist/shared-tree/index.d.ts +1 -1
  274. package/dist/shared-tree/index.d.ts.map +1 -1
  275. package/dist/shared-tree/index.js.map +1 -1
  276. package/dist/shared-tree/schematizeTree.d.ts +1 -1
  277. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  278. package/dist/shared-tree/schematizeTree.js.map +1 -1
  279. package/dist/shared-tree/schematizingTreeView.d.ts +1 -1
  280. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  281. package/dist/shared-tree/schematizingTreeView.js +1 -1
  282. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  283. package/dist/shared-tree/sharedTree.d.ts +3 -3
  284. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  285. package/dist/shared-tree/sharedTree.js +8 -8
  286. package/dist/shared-tree/sharedTree.js.map +1 -1
  287. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  288. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  289. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  290. package/dist/shared-tree/tree.js +1 -1
  291. package/dist/shared-tree/tree.js.map +1 -1
  292. package/dist/shared-tree/treeAlpha.d.ts +84 -2
  293. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  294. package/dist/shared-tree/treeAlpha.js +75 -22
  295. package/dist/shared-tree/treeAlpha.js.map +1 -1
  296. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  297. package/dist/shared-tree/treeCheckout.js +3 -2
  298. package/dist/shared-tree/treeCheckout.js.map +1 -1
  299. package/dist/shared-tree-core/branch.d.ts +2 -2
  300. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  301. package/dist/shared-tree-core/branch.js +2 -2
  302. package/dist/shared-tree-core/branch.js.map +1 -1
  303. package/dist/shared-tree-core/branchCommitEnricher.d.ts +1 -1
  304. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  305. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  306. package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  307. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  308. package/dist/shared-tree-core/editManager.d.ts +3 -1
  309. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  310. package/dist/shared-tree-core/editManager.js +4 -2
  311. package/dist/shared-tree-core/editManager.js.map +1 -1
  312. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  313. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  314. package/dist/shared-tree-core/editManagerSummarizer.d.ts +1 -1
  315. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  316. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  317. package/dist/shared-tree-core/messageCodecs.d.ts +1 -1
  318. package/dist/shared-tree-core/messageCodecs.js +1 -1
  319. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  320. package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  321. package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
  322. package/dist/shared-tree-core/sharedTreeCore.d.ts +2 -2
  323. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  324. package/dist/shared-tree-core/sharedTreeCore.js +4 -4
  325. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  326. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  327. package/dist/shared-tree-core/transaction.js +1 -1
  328. package/dist/shared-tree-core/transaction.js.map +1 -1
  329. package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  330. package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
  331. package/dist/sharedTreeAttributes.d.ts.map +1 -1
  332. package/dist/sharedTreeAttributes.js.map +1 -1
  333. package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
  334. package/dist/simple-tree/api/conciseTree.js +1 -1
  335. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  336. package/dist/simple-tree/api/configuration.js +4 -4
  337. package/dist/simple-tree/api/configuration.js.map +1 -1
  338. package/dist/simple-tree/api/create.d.ts +2 -26
  339. package/dist/simple-tree/api/create.d.ts.map +1 -1
  340. package/dist/simple-tree/api/create.js +5 -42
  341. package/dist/simple-tree/api/create.js.map +1 -1
  342. package/dist/simple-tree/api/customTree.d.ts +1 -1
  343. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  344. package/dist/simple-tree/api/customTree.js +24 -24
  345. package/dist/simple-tree/api/customTree.js.map +1 -1
  346. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  347. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  348. package/dist/simple-tree/api/identifierIndex.js +2 -2
  349. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  350. package/dist/simple-tree/api/index.d.ts +2 -3
  351. package/dist/simple-tree/api/index.d.ts.map +1 -1
  352. package/dist/simple-tree/api/index.js +4 -9
  353. package/dist/simple-tree/api/index.js.map +1 -1
  354. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  355. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  356. package/dist/simple-tree/api/schemaFactory.d.ts +5 -5
  357. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  358. package/dist/simple-tree/api/schemaFactory.js +8 -8
  359. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  360. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +1 -3
  361. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  362. package/dist/simple-tree/api/schemaFactoryAlpha.js +4 -6
  363. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  364. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +2 -2
  365. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  366. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  367. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  368. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  369. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  370. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  371. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +4 -6
  372. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  373. package/dist/simple-tree/api/storedSchema.d.ts +1 -1
  374. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  375. package/dist/simple-tree/api/storedSchema.js +7 -6
  376. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  377. package/dist/simple-tree/api/tree.d.ts +2 -2
  378. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  379. package/dist/simple-tree/api/tree.js.map +1 -1
  380. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  381. package/dist/simple-tree/api/treeBeta.js +1 -1
  382. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  383. package/dist/simple-tree/api/treeNodeApi.d.ts +38 -3
  384. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  385. package/dist/simple-tree/api/treeNodeApi.js +42 -28
  386. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  387. package/dist/simple-tree/api/typesUnsafe.d.ts +1 -1
  388. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  389. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  390. package/dist/simple-tree/api/verboseTree.js +3 -3
  391. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  392. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  393. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +4 -6
  394. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  395. package/dist/simple-tree/core/context.d.ts.map +1 -1
  396. package/dist/simple-tree/core/context.js.map +1 -1
  397. package/dist/simple-tree/core/getOrCreateNode.d.ts +1 -1
  398. package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  399. package/dist/simple-tree/core/getOrCreateNode.js +1 -1
  400. package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
  401. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  402. package/dist/simple-tree/core/treeNode.js +1 -1
  403. package/dist/simple-tree/core/treeNode.js.map +1 -1
  404. package/dist/simple-tree/core/treeNodeKernel.d.ts +8 -20
  405. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  406. package/dist/simple-tree/core/treeNodeKernel.js +19 -50
  407. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  408. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  409. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  410. package/dist/simple-tree/core/types.d.ts.map +1 -1
  411. package/dist/simple-tree/core/types.js.map +1 -1
  412. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  413. package/dist/simple-tree/core/unhydratedFlexTree.js +21 -21
  414. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  415. package/dist/simple-tree/core/withType.d.ts +1 -1
  416. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  417. package/dist/simple-tree/core/withType.js.map +1 -1
  418. package/dist/simple-tree/createContext.d.ts.map +1 -1
  419. package/dist/simple-tree/createContext.js.map +1 -1
  420. package/{lib/simple-tree/proxies.d.ts → dist/simple-tree/getTreeNodeForField.d.ts} +1 -1
  421. package/dist/simple-tree/getTreeNodeForField.d.ts.map +1 -0
  422. package/dist/simple-tree/{proxies.js → getTreeNodeForField.js} +1 -1
  423. package/dist/simple-tree/getTreeNodeForField.js.map +1 -0
  424. package/dist/simple-tree/index.d.ts +3 -10
  425. package/dist/simple-tree/index.d.ts.map +1 -1
  426. package/dist/simple-tree/index.js +17 -23
  427. package/dist/simple-tree/index.js.map +1 -1
  428. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  429. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  430. package/dist/simple-tree/{arrayNode.d.ts → node-kinds/array/arrayNode.d.ts} +3 -3
  431. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -0
  432. package/dist/simple-tree/{arrayNode.js → node-kinds/array/arrayNode.js} +10 -10
  433. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -0
  434. package/dist/simple-tree/{arrayNodeTypes.d.ts → node-kinds/array/arrayNodeTypes.d.ts} +3 -3
  435. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -0
  436. package/dist/simple-tree/{arrayNodeTypes.js → node-kinds/array/arrayNodeTypes.js} +1 -1
  437. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -0
  438. package/dist/simple-tree/node-kinds/array/index.d.ts +7 -0
  439. package/dist/simple-tree/node-kinds/array/index.d.ts.map +1 -0
  440. package/dist/simple-tree/node-kinds/array/index.js +16 -0
  441. package/dist/simple-tree/node-kinds/array/index.js.map +1 -0
  442. package/dist/simple-tree/node-kinds/index.d.ts +8 -0
  443. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -0
  444. package/dist/simple-tree/node-kinds/index.js +26 -0
  445. package/dist/simple-tree/node-kinds/index.js.map +1 -0
  446. package/dist/simple-tree/node-kinds/map/index.d.ts +7 -0
  447. package/dist/simple-tree/node-kinds/map/index.d.ts.map +1 -0
  448. package/dist/simple-tree/node-kinds/map/index.js +13 -0
  449. package/dist/simple-tree/node-kinds/map/index.js.map +1 -0
  450. package/{lib/simple-tree → dist/simple-tree/node-kinds/map}/mapNode.d.ts +3 -3
  451. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -0
  452. package/dist/simple-tree/{mapNode.js → node-kinds/map/mapNode.js} +11 -11
  453. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -0
  454. package/dist/simple-tree/{mapNodeTypes.d.ts → node-kinds/map/mapNodeTypes.d.ts} +3 -3
  455. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -0
  456. package/dist/simple-tree/{mapNodeTypes.js → node-kinds/map/mapNodeTypes.js} +1 -1
  457. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -0
  458. package/dist/simple-tree/node-kinds/object/index.d.ts +7 -0
  459. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -0
  460. package/dist/simple-tree/node-kinds/object/index.js +16 -0
  461. package/dist/simple-tree/node-kinds/object/index.js.map +1 -0
  462. package/{lib/simple-tree → dist/simple-tree/node-kinds/object}/objectNode.d.ts +17 -6
  463. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -0
  464. package/dist/simple-tree/{objectNode.js → node-kinds/object/objectNode.js} +49 -26
  465. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -0
  466. package/{lib/simple-tree → dist/simple-tree/node-kinds/object}/objectNodeTypes.d.ts +5 -5
  467. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -0
  468. package/dist/simple-tree/{objectNodeTypes.js → node-kinds/object/objectNodeTypes.js} +1 -1
  469. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -0
  470. package/dist/simple-tree/prepareForInsertion.d.ts +18 -6
  471. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  472. package/dist/simple-tree/prepareForInsertion.js +51 -22
  473. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  474. package/dist/simple-tree/schemaTypes.d.ts +2 -2
  475. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  476. package/dist/simple-tree/schemaTypes.js.map +1 -1
  477. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  478. package/dist/simple-tree/simpleSchema.js.map +1 -1
  479. package/dist/simple-tree/toMapTree.d.ts +2 -22
  480. package/dist/simple-tree/toMapTree.d.ts.map +1 -1
  481. package/dist/simple-tree/toMapTree.js +44 -23
  482. package/dist/simple-tree/toMapTree.js.map +1 -1
  483. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  484. package/dist/simple-tree/toStoredSchema.js +1 -1
  485. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  486. package/dist/simple-tree/treeNodeValid.d.ts +1 -1
  487. package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
  488. package/dist/simple-tree/treeNodeValid.js +10 -10
  489. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  490. package/dist/simple-tree/walkFieldSchema.d.ts.map +1 -1
  491. package/dist/simple-tree/walkFieldSchema.js.map +1 -1
  492. package/dist/tableSchema.d.ts +119 -72
  493. package/dist/tableSchema.d.ts.map +1 -1
  494. package/dist/tableSchema.js +83 -36
  495. package/dist/tableSchema.js.map +1 -1
  496. package/dist/treeFactory.d.ts +1 -1
  497. package/dist/treeFactory.d.ts.map +1 -1
  498. package/dist/treeFactory.js +3 -3
  499. package/dist/treeFactory.js.map +1 -1
  500. package/dist/util/bTreeUtils.d.ts.map +1 -1
  501. package/dist/util/bTreeUtils.js.map +1 -1
  502. package/dist/util/breakable.d.ts +23 -4
  503. package/dist/util/breakable.d.ts.map +1 -1
  504. package/dist/util/breakable.js +12 -3
  505. package/dist/util/breakable.js.map +1 -1
  506. package/docs/SharedTree Philosophy.md +5 -5
  507. package/lib/alpha.d.ts +3 -0
  508. package/lib/codec/codec.d.ts +52 -7
  509. package/lib/codec/codec.d.ts.map +1 -1
  510. package/lib/codec/codec.js +60 -8
  511. package/lib/codec/codec.js.map +1 -1
  512. package/lib/core/change-family/editBuilder.d.ts.map +1 -1
  513. package/lib/core/change-family/editBuilder.js.map +1 -1
  514. package/lib/core/forest/forest.d.ts.map +1 -1
  515. package/lib/core/forest/forest.js.map +1 -1
  516. package/lib/core/index.d.ts +1 -1
  517. package/lib/core/index.d.ts.map +1 -1
  518. package/lib/core/index.js +1 -1
  519. package/lib/core/index.js.map +1 -1
  520. package/lib/core/rebase/types.d.ts +2 -2
  521. package/lib/core/rebase/types.js +2 -2
  522. package/lib/core/rebase/types.js.map +1 -1
  523. package/lib/core/rebase/utils.d.ts +0 -2
  524. package/lib/core/rebase/utils.d.ts.map +1 -1
  525. package/lib/core/rebase/utils.js +6 -10
  526. package/lib/core/rebase/utils.js.map +1 -1
  527. package/lib/core/schema-stored/formatV1.d.ts +0 -1
  528. package/lib/core/schema-stored/formatV1.d.ts.map +1 -1
  529. package/lib/core/schema-stored/formatV1.js +0 -1
  530. package/lib/core/schema-stored/formatV1.js.map +1 -1
  531. package/lib/core/schema-stored/index.d.ts +1 -1
  532. package/lib/core/schema-stored/index.d.ts.map +1 -1
  533. package/lib/core/schema-stored/index.js +1 -1
  534. package/lib/core/schema-stored/index.js.map +1 -1
  535. package/lib/core/schema-stored/schema.d.ts +6 -0
  536. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  537. package/lib/core/schema-stored/schema.js +7 -0
  538. package/lib/core/schema-stored/schema.js.map +1 -1
  539. package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  540. package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  541. package/lib/core/schema-stored/storedSchemaRepository.js +1 -1
  542. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  543. package/lib/core/tree/anchorSet.d.ts +2 -1
  544. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  545. package/lib/core/tree/anchorSet.js +4 -3
  546. package/lib/core/tree/anchorSet.js.map +1 -1
  547. package/lib/core/tree/chunk.d.ts.map +1 -1
  548. package/lib/core/tree/chunk.js.map +1 -1
  549. package/lib/core/tree/delta.d.ts.map +1 -1
  550. package/lib/core/tree/delta.js.map +1 -1
  551. package/lib/core/tree/deltaUtil.d.ts.map +1 -1
  552. package/lib/core/tree/deltaUtil.js.map +1 -1
  553. package/lib/core/tree/detachedFieldIndex.d.ts +1 -1
  554. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  555. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  556. package/lib/core/tree/detachedFieldIndexCodec.d.ts +1 -1
  557. package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
  558. package/lib/core/tree/detachedFieldIndexCodec.js +1 -1
  559. package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
  560. package/lib/core/tree/pathTree.d.ts +12 -11
  561. package/lib/core/tree/pathTree.d.ts.map +1 -1
  562. package/lib/core/tree/pathTree.js +8 -7
  563. package/lib/core/tree/pathTree.js.map +1 -1
  564. package/lib/core/tree/treeTextFormat.d.ts +1 -1
  565. package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
  566. package/lib/core/tree/treeTextFormat.js +1 -1
  567. package/lib/core/tree/treeTextFormat.js.map +1 -1
  568. package/lib/core/tree/visitDelta.d.ts +1 -1
  569. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  570. package/lib/core/tree/visitDelta.js.map +1 -1
  571. package/lib/core/tree/visitorUtils.d.ts +2 -2
  572. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  573. package/lib/core/tree/visitorUtils.js.map +1 -1
  574. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
  575. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  576. package/lib/feature-libraries/chunked-forest/chunkTree.js +1 -1
  577. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  578. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -2
  579. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  580. package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -2
  581. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  582. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  583. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  584. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  585. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +2 -2
  586. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  587. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  588. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  589. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  590. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -2
  591. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  592. package/lib/feature-libraries/chunked-forest/codec/codecs.js +10 -0
  593. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  594. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
  595. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  596. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  597. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  598. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  599. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  600. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  601. package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
  602. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +1 -1
  603. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
  604. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  605. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  606. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  607. package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
  608. package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  609. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  610. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  611. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  612. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  613. package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
  614. package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
  615. package/lib/feature-libraries/chunked-forest/sequenceChunk.js +1 -1
  616. package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  617. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -1
  618. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  619. package/lib/feature-libraries/chunked-forest/uniformChunk.js +1 -1
  620. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  621. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +1 -1
  622. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  623. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  624. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  625. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  626. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  627. package/lib/feature-libraries/default-schema/index.js +1 -1
  628. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  629. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  630. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  631. package/lib/feature-libraries/default-schema/schemaChecker.d.ts +18 -14
  632. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  633. package/lib/feature-libraries/default-schema/schemaChecker.js +76 -53
  634. package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  635. package/lib/feature-libraries/flex-tree/context.d.ts +18 -2
  636. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  637. package/lib/feature-libraries/flex-tree/context.js +23 -7
  638. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  639. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +3 -2
  640. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  641. package/lib/feature-libraries/flex-tree/flexTreeTypes.js +3 -2
  642. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  643. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  644. package/lib/feature-libraries/flex-tree/lazyField.js +1 -1
  645. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  646. package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  647. package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
  648. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +1 -1
  649. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  650. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  651. package/lib/feature-libraries/index.d.ts +3 -3
  652. package/lib/feature-libraries/index.d.ts.map +1 -1
  653. package/lib/feature-libraries/index.js +3 -3
  654. package/lib/feature-libraries/index.js.map +1 -1
  655. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +2 -2
  656. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  657. package/lib/feature-libraries/indexing/anchorTreeIndex.js +1 -1
  658. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  659. package/lib/feature-libraries/initializeForest.d.ts.map +1 -1
  660. package/lib/feature-libraries/initializeForest.js.map +1 -1
  661. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  662. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  663. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +1 -1
  664. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  665. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  666. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +1 -1
  667. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +1 -1
  668. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
  669. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  670. package/lib/feature-libraries/modular-schema/genericFieldKind.js +2 -2
  671. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  672. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  673. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  674. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
  675. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  676. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +0 -2
  677. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  678. package/lib/feature-libraries/modular-schema/isNeverTree.js +0 -2
  679. package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  680. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  681. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  682. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -0
  683. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  684. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +2 -0
  685. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  686. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  687. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  688. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts.map +1 -1
  689. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +8 -3
  690. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  691. package/lib/feature-libraries/object-forest/objectForest.d.ts +22 -5
  692. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  693. package/lib/feature-libraries/object-forest/objectForest.js +299 -209
  694. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  695. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -2
  696. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  697. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +4 -3
  698. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  699. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  700. package/lib/feature-libraries/schema-index/codec.d.ts +6 -12
  701. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  702. package/lib/feature-libraries/schema-index/codec.js +8 -15
  703. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  704. package/lib/feature-libraries/schema-index/formatV1.d.ts +2 -2
  705. package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  706. package/lib/feature-libraries/schema-index/formatV1.js +2 -2
  707. package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
  708. package/lib/feature-libraries/schema-index/index.d.ts +1 -1
  709. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  710. package/lib/feature-libraries/schema-index/index.js +1 -1
  711. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  712. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -1
  713. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  714. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  715. package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  716. package/lib/feature-libraries/sequence-field/formatV3.js.map +1 -1
  717. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  718. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  719. package/lib/feature-libraries/sequence-field/prune.d.ts.map +1 -1
  720. package/lib/feature-libraries/sequence-field/prune.js.map +1 -1
  721. package/lib/feature-libraries/sequence-field/rebase.js +1 -1
  722. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  723. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +1 -1
  724. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
  725. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  726. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  727. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  728. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +1 -1
  729. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
  730. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
  731. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
  732. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  733. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  734. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
  735. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  736. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +1 -1
  737. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  738. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +2 -2
  739. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  740. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +1 -1
  741. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  742. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  743. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +1 -1
  744. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  745. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  746. package/lib/feature-libraries/sequence-field/utils.d.ts +7 -5
  747. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  748. package/lib/feature-libraries/sequence-field/utils.js +7 -5
  749. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  750. package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  751. package/lib/feature-libraries/treeCursorUtils.js +3 -3
  752. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  753. package/lib/feature-libraries/treeTextCursor.d.ts +1 -1
  754. package/lib/feature-libraries/treeTextCursor.js +1 -1
  755. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  756. package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
  757. package/lib/feature-libraries/valueUtilities.js +1 -1
  758. package/lib/feature-libraries/valueUtilities.js.map +1 -1
  759. package/lib/index.d.ts +2 -2
  760. package/lib/index.d.ts.map +1 -1
  761. package/lib/index.js +0 -2
  762. package/lib/index.js.map +1 -1
  763. package/lib/jsonDomainSchema.d.ts.map +1 -1
  764. package/lib/jsonDomainSchema.js.map +1 -1
  765. package/lib/packageVersion.d.ts +1 -1
  766. package/lib/packageVersion.d.ts.map +1 -1
  767. package/lib/packageVersion.js +1 -1
  768. package/lib/packageVersion.js.map +1 -1
  769. package/lib/serializableDomainSchema.d.ts.map +1 -1
  770. package/lib/serializableDomainSchema.js.map +1 -1
  771. package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
  772. package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -1
  773. package/lib/shared-tree/independentView.d.ts +1 -1
  774. package/lib/shared-tree/independentView.d.ts.map +1 -1
  775. package/lib/shared-tree/independentView.js +10 -5
  776. package/lib/shared-tree/independentView.js.map +1 -1
  777. package/lib/shared-tree/index.d.ts +1 -1
  778. package/lib/shared-tree/index.d.ts.map +1 -1
  779. package/lib/shared-tree/index.js +1 -1
  780. package/lib/shared-tree/index.js.map +1 -1
  781. package/lib/shared-tree/schematizeTree.d.ts +1 -1
  782. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  783. package/lib/shared-tree/schematizeTree.js.map +1 -1
  784. package/lib/shared-tree/schematizingTreeView.d.ts +1 -1
  785. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  786. package/lib/shared-tree/schematizingTreeView.js +1 -1
  787. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  788. package/lib/shared-tree/sharedTree.d.ts +3 -3
  789. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  790. package/lib/shared-tree/sharedTree.js +10 -10
  791. package/lib/shared-tree/sharedTree.js.map +1 -1
  792. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  793. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  794. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  795. package/lib/shared-tree/tree.js +1 -1
  796. package/lib/shared-tree/tree.js.map +1 -1
  797. package/lib/shared-tree/treeAlpha.d.ts +84 -2
  798. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  799. package/lib/shared-tree/treeAlpha.js +65 -12
  800. package/lib/shared-tree/treeAlpha.js.map +1 -1
  801. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  802. package/lib/shared-tree/treeCheckout.js +3 -2
  803. package/lib/shared-tree/treeCheckout.js.map +1 -1
  804. package/lib/shared-tree-core/branch.d.ts +2 -2
  805. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  806. package/lib/shared-tree-core/branch.js +2 -2
  807. package/lib/shared-tree-core/branch.js.map +1 -1
  808. package/lib/shared-tree-core/branchCommitEnricher.d.ts +1 -1
  809. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  810. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  811. package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  812. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  813. package/lib/shared-tree-core/editManager.d.ts +3 -1
  814. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  815. package/lib/shared-tree-core/editManager.js +4 -2
  816. package/lib/shared-tree-core/editManager.js.map +1 -1
  817. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  818. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  819. package/lib/shared-tree-core/editManagerSummarizer.d.ts +1 -1
  820. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  821. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  822. package/lib/shared-tree-core/messageCodecs.d.ts +1 -1
  823. package/lib/shared-tree-core/messageCodecs.js +1 -1
  824. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  825. package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  826. package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
  827. package/lib/shared-tree-core/sharedTreeCore.d.ts +2 -2
  828. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  829. package/lib/shared-tree-core/sharedTreeCore.js +4 -4
  830. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  831. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  832. package/lib/shared-tree-core/transaction.js +1 -1
  833. package/lib/shared-tree-core/transaction.js.map +1 -1
  834. package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  835. package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
  836. package/lib/sharedTreeAttributes.d.ts.map +1 -1
  837. package/lib/sharedTreeAttributes.js.map +1 -1
  838. package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
  839. package/lib/simple-tree/api/conciseTree.js +1 -1
  840. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  841. package/lib/simple-tree/api/configuration.js +1 -1
  842. package/lib/simple-tree/api/configuration.js.map +1 -1
  843. package/lib/simple-tree/api/create.d.ts +2 -26
  844. package/lib/simple-tree/api/create.d.ts.map +1 -1
  845. package/lib/simple-tree/api/create.js +2 -37
  846. package/lib/simple-tree/api/create.js.map +1 -1
  847. package/lib/simple-tree/api/customTree.d.ts +1 -1
  848. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  849. package/lib/simple-tree/api/customTree.js +3 -3
  850. package/lib/simple-tree/api/customTree.js.map +1 -1
  851. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  852. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
  853. package/lib/simple-tree/api/identifierIndex.js +1 -1
  854. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  855. package/lib/simple-tree/api/index.d.ts +2 -3
  856. package/lib/simple-tree/api/index.d.ts.map +1 -1
  857. package/lib/simple-tree/api/index.js +2 -5
  858. package/lib/simple-tree/api/index.js.map +1 -1
  859. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  860. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  861. package/lib/simple-tree/api/schemaFactory.d.ts +5 -5
  862. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  863. package/lib/simple-tree/api/schemaFactory.js +5 -5
  864. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  865. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +1 -3
  866. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  867. package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -3
  868. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  869. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +2 -2
  870. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  871. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  872. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  873. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  874. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  875. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  876. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +1 -3
  877. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  878. package/lib/simple-tree/api/storedSchema.d.ts +1 -1
  879. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  880. package/lib/simple-tree/api/storedSchema.js +3 -2
  881. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  882. package/lib/simple-tree/api/tree.d.ts +2 -2
  883. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  884. package/lib/simple-tree/api/tree.js.map +1 -1
  885. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  886. package/lib/simple-tree/api/treeBeta.js +1 -1
  887. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  888. package/lib/simple-tree/api/treeNodeApi.d.ts +38 -3
  889. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  890. package/lib/simple-tree/api/treeNodeApi.js +39 -28
  891. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  892. package/lib/simple-tree/api/typesUnsafe.d.ts +1 -1
  893. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  894. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  895. package/lib/simple-tree/api/verboseTree.js +1 -1
  896. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  897. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  898. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +1 -3
  899. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  900. package/lib/simple-tree/core/context.d.ts.map +1 -1
  901. package/lib/simple-tree/core/context.js.map +1 -1
  902. package/lib/simple-tree/core/getOrCreateNode.d.ts +1 -1
  903. package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  904. package/lib/simple-tree/core/getOrCreateNode.js +2 -2
  905. package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
  906. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  907. package/lib/simple-tree/core/treeNode.js +1 -1
  908. package/lib/simple-tree/core/treeNode.js.map +1 -1
  909. package/lib/simple-tree/core/treeNodeKernel.d.ts +8 -20
  910. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  911. package/lib/simple-tree/core/treeNodeKernel.js +18 -49
  912. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  913. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  914. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  915. package/lib/simple-tree/core/types.d.ts.map +1 -1
  916. package/lib/simple-tree/core/types.js.map +1 -1
  917. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  918. package/lib/simple-tree/core/unhydratedFlexTree.js +3 -3
  919. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  920. package/lib/simple-tree/core/withType.d.ts +1 -1
  921. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  922. package/lib/simple-tree/core/withType.js.map +1 -1
  923. package/lib/simple-tree/createContext.d.ts.map +1 -1
  924. package/lib/simple-tree/createContext.js.map +1 -1
  925. package/{dist/simple-tree/proxies.d.ts → lib/simple-tree/getTreeNodeForField.d.ts} +1 -1
  926. package/lib/simple-tree/getTreeNodeForField.d.ts.map +1 -0
  927. package/lib/simple-tree/{proxies.js → getTreeNodeForField.js} +1 -1
  928. package/lib/simple-tree/getTreeNodeForField.js.map +1 -0
  929. package/lib/simple-tree/index.d.ts +3 -10
  930. package/lib/simple-tree/index.d.ts.map +1 -1
  931. package/lib/simple-tree/index.js +3 -7
  932. package/lib/simple-tree/index.js.map +1 -1
  933. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  934. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  935. package/lib/simple-tree/{arrayNode.d.ts → node-kinds/array/arrayNode.d.ts} +3 -3
  936. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -0
  937. package/lib/simple-tree/{arrayNode.js → node-kinds/array/arrayNode.js} +10 -10
  938. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -0
  939. package/lib/simple-tree/{arrayNodeTypes.d.ts → node-kinds/array/arrayNodeTypes.d.ts} +3 -3
  940. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -0
  941. package/lib/simple-tree/{arrayNodeTypes.js → node-kinds/array/arrayNodeTypes.js} +1 -1
  942. package/{dist/simple-tree → lib/simple-tree/node-kinds/array}/arrayNodeTypes.js.map +1 -1
  943. package/lib/simple-tree/node-kinds/array/index.d.ts +7 -0
  944. package/lib/simple-tree/node-kinds/array/index.d.ts.map +1 -0
  945. package/lib/simple-tree/node-kinds/array/index.js +7 -0
  946. package/lib/simple-tree/node-kinds/array/index.js.map +1 -0
  947. package/lib/simple-tree/node-kinds/index.d.ts +8 -0
  948. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -0
  949. package/lib/simple-tree/node-kinds/index.js +8 -0
  950. package/lib/simple-tree/node-kinds/index.js.map +1 -0
  951. package/lib/simple-tree/node-kinds/map/index.d.ts +7 -0
  952. package/lib/simple-tree/node-kinds/map/index.d.ts.map +1 -0
  953. package/lib/simple-tree/node-kinds/map/index.js +7 -0
  954. package/lib/simple-tree/node-kinds/map/index.js.map +1 -0
  955. package/{dist/simple-tree → lib/simple-tree/node-kinds/map}/mapNode.d.ts +3 -3
  956. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -0
  957. package/lib/simple-tree/{mapNode.js → node-kinds/map/mapNode.js} +8 -8
  958. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -0
  959. package/lib/simple-tree/{mapNodeTypes.d.ts → node-kinds/map/mapNodeTypes.d.ts} +3 -3
  960. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -0
  961. package/lib/simple-tree/{mapNodeTypes.js → node-kinds/map/mapNodeTypes.js} +1 -1
  962. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -0
  963. package/lib/simple-tree/node-kinds/object/index.d.ts +7 -0
  964. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -0
  965. package/lib/simple-tree/node-kinds/object/index.js +7 -0
  966. package/lib/simple-tree/node-kinds/object/index.js.map +1 -0
  967. package/{dist/simple-tree → lib/simple-tree/node-kinds/object}/objectNode.d.ts +17 -6
  968. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -0
  969. package/lib/simple-tree/{objectNode.js → node-kinds/object/objectNode.js} +35 -13
  970. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -0
  971. package/{dist/simple-tree → lib/simple-tree/node-kinds/object}/objectNodeTypes.d.ts +5 -5
  972. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -0
  973. package/lib/simple-tree/{objectNodeTypes.js → node-kinds/object/objectNodeTypes.js} +1 -1
  974. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -0
  975. package/lib/simple-tree/prepareForInsertion.d.ts +18 -6
  976. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  977. package/lib/simple-tree/prepareForInsertion.js +51 -22
  978. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  979. package/lib/simple-tree/schemaTypes.d.ts +2 -2
  980. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  981. package/lib/simple-tree/schemaTypes.js.map +1 -1
  982. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  983. package/lib/simple-tree/simpleSchema.js.map +1 -1
  984. package/lib/simple-tree/toMapTree.d.ts +2 -22
  985. package/lib/simple-tree/toMapTree.d.ts.map +1 -1
  986. package/lib/simple-tree/toMapTree.js +44 -22
  987. package/lib/simple-tree/toMapTree.js.map +1 -1
  988. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  989. package/lib/simple-tree/toStoredSchema.js +1 -1
  990. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  991. package/lib/simple-tree/treeNodeValid.d.ts +1 -1
  992. package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
  993. package/lib/simple-tree/treeNodeValid.js +2 -2
  994. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  995. package/lib/simple-tree/walkFieldSchema.d.ts.map +1 -1
  996. package/lib/simple-tree/walkFieldSchema.js.map +1 -1
  997. package/lib/tableSchema.d.ts +119 -72
  998. package/lib/tableSchema.d.ts.map +1 -1
  999. package/lib/tableSchema.js +83 -36
  1000. package/lib/tableSchema.js.map +1 -1
  1001. package/lib/treeFactory.d.ts +1 -1
  1002. package/lib/treeFactory.d.ts.map +1 -1
  1003. package/lib/treeFactory.js +3 -3
  1004. package/lib/treeFactory.js.map +1 -1
  1005. package/lib/util/bTreeUtils.d.ts.map +1 -1
  1006. package/lib/util/bTreeUtils.js.map +1 -1
  1007. package/lib/util/breakable.d.ts +23 -4
  1008. package/lib/util/breakable.d.ts.map +1 -1
  1009. package/lib/util/breakable.js +12 -3
  1010. package/lib/util/breakable.js.map +1 -1
  1011. package/package.json +21 -21
  1012. package/src/codec/codec.ts +64 -8
  1013. package/src/core/change-family/editBuilder.ts +1 -0
  1014. package/src/core/forest/forest.ts +1 -1
  1015. package/src/core/index.ts +1 -0
  1016. package/src/core/rebase/types.ts +2 -2
  1017. package/src/core/rebase/utils.ts +10 -10
  1018. package/src/core/schema-stored/formatV1.ts +0 -2
  1019. package/src/core/schema-stored/index.ts +1 -0
  1020. package/src/core/schema-stored/schema.ts +9 -0
  1021. package/src/core/schema-stored/storedSchemaRepository.ts +2 -2
  1022. package/src/core/tree/anchorSet.ts +6 -5
  1023. package/src/core/tree/chunk.ts +2 -1
  1024. package/src/core/tree/delta.ts +1 -0
  1025. package/src/core/tree/deltaUtil.ts +1 -1
  1026. package/src/core/tree/detachedFieldIndex.ts +1 -1
  1027. package/src/core/tree/detachedFieldIndexCodec.ts +2 -2
  1028. package/src/core/tree/pathTree.ts +13 -12
  1029. package/src/core/tree/treeTextFormat.ts +2 -1
  1030. package/src/core/tree/visitDelta.ts +1 -1
  1031. package/src/core/tree/visitorUtils.ts +3 -2
  1032. package/src/feature-libraries/chunked-forest/chunkTree.ts +2 -2
  1033. package/src/feature-libraries/chunked-forest/chunkedForest.ts +4 -4
  1034. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +5 -5
  1035. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +2 -2
  1036. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -0
  1037. package/src/feature-libraries/chunked-forest/codec/codecs.ts +15 -1
  1038. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +1 -1
  1039. package/src/feature-libraries/chunked-forest/codec/index.ts +1 -0
  1040. package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +1 -1
  1041. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +1 -1
  1042. package/src/feature-libraries/chunked-forest/emptyChunk.ts +1 -0
  1043. package/src/feature-libraries/chunked-forest/index.ts +1 -0
  1044. package/src/feature-libraries/chunked-forest/sequenceChunk.ts +1 -1
  1045. package/src/feature-libraries/chunked-forest/uniformChunk.ts +2 -3
  1046. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +2 -2
  1047. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +1 -0
  1048. package/src/feature-libraries/default-schema/index.ts +6 -1
  1049. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +1 -0
  1050. package/src/feature-libraries/default-schema/schemaChecker.ts +74 -48
  1051. package/src/feature-libraries/flex-tree/context.ts +29 -8
  1052. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +3 -2
  1053. package/src/feature-libraries/flex-tree/lazyField.ts +1 -1
  1054. package/src/feature-libraries/flex-tree/utilities.ts +1 -1
  1055. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -1
  1056. package/src/feature-libraries/index.ts +3 -2
  1057. package/src/feature-libraries/indexing/anchorTreeIndex.ts +4 -2
  1058. package/src/feature-libraries/initializeForest.ts +1 -1
  1059. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +1 -0
  1060. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +1 -1
  1061. package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +1 -1
  1062. package/src/feature-libraries/modular-schema/genericFieldKind.ts +4 -2
  1063. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -0
  1064. package/src/feature-libraries/modular-schema/genericFieldKindTypes.ts +1 -0
  1065. package/src/feature-libraries/modular-schema/isNeverTree.ts +0 -2
  1066. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +1 -1
  1067. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2 -0
  1068. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +1 -0
  1069. package/src/feature-libraries/node-identifier/mockNodeIdentifierManager.ts +11 -5
  1070. package/src/feature-libraries/object-forest/objectForest.ts +65 -7
  1071. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +5 -8
  1072. package/src/feature-libraries/schema-index/codec.ts +13 -21
  1073. package/src/feature-libraries/schema-index/formatV1.ts +2 -2
  1074. package/src/feature-libraries/schema-index/index.ts +0 -1
  1075. package/src/feature-libraries/schema-index/schemaSummarizer.ts +1 -1
  1076. package/src/feature-libraries/sequence-field/formatV3.ts +1 -0
  1077. package/src/feature-libraries/sequence-field/markQueue.ts +1 -0
  1078. package/src/feature-libraries/sequence-field/prune.ts +1 -0
  1079. package/src/feature-libraries/sequence-field/rebase.ts +1 -1
  1080. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +1 -1
  1081. package/src/feature-libraries/sequence-field/replaceRevisions.ts +3 -1
  1082. package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +2 -2
  1083. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +3 -3
  1084. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +3 -3
  1085. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +2 -2
  1086. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +1 -1
  1087. package/src/feature-libraries/sequence-field/utils.ts +7 -5
  1088. package/src/feature-libraries/treeCursorUtils.ts +3 -3
  1089. package/src/feature-libraries/treeTextCursor.ts +1 -1
  1090. package/src/feature-libraries/valueUtilities.ts +1 -1
  1091. package/src/index.ts +1 -4
  1092. package/src/jsonDomainSchema.ts +0 -1
  1093. package/src/packageVersion.ts +1 -1
  1094. package/src/serializableDomainSchema.ts +1 -0
  1095. package/src/shared-tree/checkoutFlexTreeView.ts +1 -0
  1096. package/src/shared-tree/independentView.ts +10 -3
  1097. package/src/shared-tree/index.ts +4 -1
  1098. package/src/shared-tree/schematizeTree.ts +2 -1
  1099. package/src/shared-tree/schematizingTreeView.ts +2 -2
  1100. package/src/shared-tree/sharedTree.ts +26 -19
  1101. package/src/shared-tree/sharedTreeChangeFamily.ts +1 -1
  1102. package/src/shared-tree/tree.ts +1 -1
  1103. package/src/shared-tree/treeAlpha.ts +171 -26
  1104. package/src/shared-tree/treeCheckout.ts +3 -2
  1105. package/src/shared-tree-core/branch.ts +3 -4
  1106. package/src/shared-tree-core/branchCommitEnricher.ts +3 -1
  1107. package/src/shared-tree-core/defaultResubmitMachine.ts +2 -0
  1108. package/src/shared-tree-core/editManager.ts +4 -2
  1109. package/src/shared-tree-core/editManagerCodecs.ts +1 -0
  1110. package/src/shared-tree-core/editManagerSummarizer.ts +1 -1
  1111. package/src/shared-tree-core/messageCodecs.ts +1 -1
  1112. package/src/shared-tree-core/sequenceIdUtils.ts +1 -0
  1113. package/src/shared-tree-core/sharedTreeCore.ts +5 -5
  1114. package/src/shared-tree-core/transaction.ts +4 -2
  1115. package/src/shared-tree-core/transactionEnricher.ts +2 -0
  1116. package/src/sharedTreeAttributes.ts +1 -0
  1117. package/src/simple-tree/api/conciseTree.ts +3 -2
  1118. package/src/simple-tree/api/configuration.ts +1 -1
  1119. package/src/simple-tree/api/create.ts +4 -80
  1120. package/src/simple-tree/api/customTree.ts +4 -4
  1121. package/src/simple-tree/api/getSimpleSchema.ts +1 -0
  1122. package/src/simple-tree/api/identifierIndex.ts +1 -1
  1123. package/src/simple-tree/api/index.ts +8 -11
  1124. package/src/simple-tree/api/schemaCompatibilityTester.ts +2 -0
  1125. package/src/simple-tree/api/schemaFactory.ts +28 -23
  1126. package/src/simple-tree/api/schemaFactoryAlpha.ts +8 -6
  1127. package/src/simple-tree/api/schemaFactoryRecursive.ts +3 -3
  1128. package/src/simple-tree/api/schemaFromSimple.ts +3 -1
  1129. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -3
  1130. package/src/simple-tree/api/storedSchema.ts +5 -4
  1131. package/src/simple-tree/api/tree.ts +3 -4
  1132. package/src/simple-tree/api/treeBeta.ts +3 -2
  1133. package/src/simple-tree/api/treeNodeApi.ts +91 -42
  1134. package/src/simple-tree/api/typesUnsafe.ts +1 -1
  1135. package/src/simple-tree/api/verboseTree.ts +1 -1
  1136. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +1 -3
  1137. package/src/simple-tree/core/context.ts +1 -0
  1138. package/src/simple-tree/core/getOrCreateNode.ts +4 -3
  1139. package/src/simple-tree/core/treeNode.ts +1 -1
  1140. package/src/simple-tree/core/treeNodeKernel.ts +32 -61
  1141. package/src/simple-tree/core/treeNodeSchema.ts +1 -0
  1142. package/src/simple-tree/core/types.ts +1 -1
  1143. package/src/simple-tree/core/unhydratedFlexTree.ts +4 -3
  1144. package/src/simple-tree/core/withType.ts +1 -1
  1145. package/src/simple-tree/createContext.ts +1 -0
  1146. package/src/simple-tree/{proxies.ts → getTreeNodeForField.ts} +2 -0
  1147. package/src/simple-tree/index.ts +17 -22
  1148. package/src/simple-tree/leafNodeSchema.ts +1 -0
  1149. package/src/simple-tree/{arrayNode.ts → node-kinds/array/arrayNode.ts} +11 -11
  1150. package/src/simple-tree/{arrayNodeTypes.ts → node-kinds/array/arrayNodeTypes.ts} +3 -3
  1151. package/src/simple-tree/node-kinds/array/index.ts +18 -0
  1152. package/src/simple-tree/node-kinds/index.ts +40 -0
  1153. package/src/simple-tree/node-kinds/map/index.ts +16 -0
  1154. package/src/simple-tree/{mapNode.ts → node-kinds/map/mapNode.ts} +10 -10
  1155. package/src/simple-tree/{mapNodeTypes.ts → node-kinds/map/mapNodeTypes.ts} +3 -3
  1156. package/src/simple-tree/node-kinds/object/index.ts +17 -0
  1157. package/src/simple-tree/{objectNode.ts → node-kinds/object/objectNode.ts} +63 -34
  1158. package/src/simple-tree/{objectNodeTypes.ts → node-kinds/object/objectNodeTypes.ts} +5 -5
  1159. package/src/simple-tree/prepareForInsertion.ts +68 -28
  1160. package/src/simple-tree/schemaTypes.ts +4 -3
  1161. package/src/simple-tree/simpleSchema.ts +1 -0
  1162. package/src/simple-tree/toMapTree.ts +13 -56
  1163. package/src/simple-tree/toStoredSchema.ts +3 -2
  1164. package/src/simple-tree/treeNodeValid.ts +3 -3
  1165. package/src/simple-tree/walkFieldSchema.ts +0 -1
  1166. package/src/tableSchema.ts +109 -62
  1167. package/src/treeFactory.ts +3 -5
  1168. package/src/util/bTreeUtils.ts +1 -0
  1169. package/src/util/breakable.ts +19 -4
  1170. package/dist/simple-tree/api/testRecursiveDomain.d.ts +0 -62
  1171. package/dist/simple-tree/api/testRecursiveDomain.d.ts.map +0 -1
  1172. package/dist/simple-tree/api/testRecursiveDomain.js +0 -45
  1173. package/dist/simple-tree/api/testRecursiveDomain.js.map +0 -1
  1174. package/dist/simple-tree/arrayNode.d.ts.map +0 -1
  1175. package/dist/simple-tree/arrayNode.js.map +0 -1
  1176. package/dist/simple-tree/arrayNodeTypes.d.ts.map +0 -1
  1177. package/dist/simple-tree/mapNode.d.ts.map +0 -1
  1178. package/dist/simple-tree/mapNode.js.map +0 -1
  1179. package/dist/simple-tree/mapNodeTypes.d.ts.map +0 -1
  1180. package/dist/simple-tree/mapNodeTypes.js.map +0 -1
  1181. package/dist/simple-tree/objectNode.d.ts.map +0 -1
  1182. package/dist/simple-tree/objectNode.js.map +0 -1
  1183. package/dist/simple-tree/objectNodeTypes.d.ts.map +0 -1
  1184. package/dist/simple-tree/objectNodeTypes.js.map +0 -1
  1185. package/dist/simple-tree/proxies.d.ts.map +0 -1
  1186. package/dist/simple-tree/proxies.js.map +0 -1
  1187. package/lib/simple-tree/api/testRecursiveDomain.d.ts +0 -62
  1188. package/lib/simple-tree/api/testRecursiveDomain.d.ts.map +0 -1
  1189. package/lib/simple-tree/api/testRecursiveDomain.js +0 -41
  1190. package/lib/simple-tree/api/testRecursiveDomain.js.map +0 -1
  1191. package/lib/simple-tree/arrayNode.d.ts.map +0 -1
  1192. package/lib/simple-tree/arrayNode.js.map +0 -1
  1193. package/lib/simple-tree/arrayNodeTypes.d.ts.map +0 -1
  1194. package/lib/simple-tree/arrayNodeTypes.js.map +0 -1
  1195. package/lib/simple-tree/mapNode.d.ts.map +0 -1
  1196. package/lib/simple-tree/mapNode.js.map +0 -1
  1197. package/lib/simple-tree/mapNodeTypes.d.ts.map +0 -1
  1198. package/lib/simple-tree/mapNodeTypes.js.map +0 -1
  1199. package/lib/simple-tree/objectNode.d.ts.map +0 -1
  1200. package/lib/simple-tree/objectNode.js.map +0 -1
  1201. package/lib/simple-tree/objectNodeTypes.d.ts.map +0 -1
  1202. package/lib/simple-tree/objectNodeTypes.js.map +0 -1
  1203. package/lib/simple-tree/proxies.d.ts.map +0 -1
  1204. package/lib/simple-tree/proxies.js.map +0 -1
  1205. package/src/simple-tree/api/testRecursiveDomain.ts +0 -53
@@ -164,8 +164,6 @@ function rebaseChange(changeRebaser, change, sourceHead, targetHead, mintRevisio
164
164
  };
165
165
  }
166
166
  exports.rebaseChange = rebaseChange;
167
- /**
168
- */
169
167
  function revisionMetadataSourceFromInfo(revInfos) {
170
168
  const getIndex = (revision) => {
171
169
  const index = revInfos.findIndex((revInfo) => revInfo.revision === revision);
@@ -210,18 +208,16 @@ function revisionInfoFromTaggedChange(taggedChange) {
210
208
  return revInfos;
211
209
  }
212
210
  function rollbackFromCommit(changeRebaser, commit, mintRevisionTag, cache) {
213
- const rollback = Rollback.get(commit);
214
- if (rollback !== undefined) {
215
- return rollback;
211
+ const cachedRollback = Rollback.get(commit);
212
+ if (cachedRollback !== undefined) {
213
+ return cachedRollback;
216
214
  }
217
215
  const tag = mintRevisionTag();
218
- const untagged = changeRebaser.invert(commit, true, tag);
219
- const deeplyTaggedRollback = changeRebaser.changeRevision(untagged, tag, commit.revision);
220
- const fullyTaggedRollback = (0, changeRebaser_js_1.tagRollbackInverse)(deeplyTaggedRollback, tag, commit.revision);
216
+ const rollback = (0, changeRebaser_js_1.tagRollbackInverse)(changeRebaser.invert(commit, true, tag), tag, commit.revision);
221
217
  if (cache === true) {
222
- Rollback.set(commit, fullyTaggedRollback);
218
+ Rollback.set(commit, rollback);
223
219
  }
224
- return fullyTaggedRollback;
220
+ return rollback;
225
221
  }
226
222
  function findAncestor(descendant, predicate = (t) => t.parent === undefined) {
227
223
  let d;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/core/rebase/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAkE;AAElE,kDAAsF;AAEtF,yDAS4B;AAC5B,yCAA4E;AAuK5E,SAAgB,YAAY,CAC3B,eAAkC,EAClC,aAAqC,EACrC,UAAgC,EAChC,YAAkC,EAClC,UAAU,GAAG,YAAY;IAEzB,4CAA4C;IAC5C,MAAM,UA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;GAMG;AACH,SAAgB,UAAU,CACzB,QAAe,EACf,UAAiB,EACjB,UAAmB;IAEnB,IAAI,UAAU,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC;IAChC,OAAO,OAAO,KAAK,SAAS,EAAE,CAAC;QAC9B,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAlBD,gCAkBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\n\nimport { defineLazyCachedProperty, hasSome, type Mutable } from \"../../util/index.js\";\n\nimport {\n\ttype ChangeRebaser,\n\ttype RevisionInfo,\n\ttype RevisionMetadataSource,\n\ttype TaggedChange,\n\tmakeAnonChange,\n\tmapTaggedChange,\n\ttagChange,\n\ttagRollbackInverse,\n} from \"./changeRebaser.js\";\nimport { type GraphCommit, type RevisionTag, mintCommit } from \"./types.js\";\n\n/**\n * Contains information about how the commit graph changed as the result of rebasing a source branch onto another target branch.\n * @remarks\n * ```text\n * Consider the commit graph below containing two branches, X and Y, with head commits C and E, respectively.\n * Branch Y branches off of Branch X at their common ancestor commit A, i.e. \"Y is based off of X at commit A\".\n *\n * A ─ B ─ C ← Branch X\n * └─ D ─ E ← Branch Y\n *\n * Branch Y is then rebased onto Branch X. This results in the following commit graph:\n *\n * A ─ B ─ C ← Branch X\n * └─ D'─ E'← Branch Y\n *\n * Commits D' and E' are the rebased versions of commits D and E, respectively. This results in:\n * deletedSourceCommits: [D, E],\n * targetCommits: [B, C],\n * sourceCommits: [D', E']\n * ```\n */\nexport interface RebasedCommits<TChange> {\n\t/**\n\t * The commits on the original source branch that were rebased. These are no longer referenced by the source branch and have\n\t * been replaced with new versions on the new source branch, see {@link sourceCommits}. In the case that the source\n\t * branch was already ahead of the target branch before the rebase, this list will be empty.\n\t */\n\tdeletedSourceCommits: GraphCommit<TChange>[];\n\t/**\n\t * All commits on the target branch that the source branch's commits were rebased over. These are now the direct\n\t * ancestors of {@link sourceCommits}. In the case that the source branch was already ahead of the target branch\n\t * before the rebase, this list will be empty.\n\t */\n\ttargetCommits: GraphCommit<TChange>[];\n\t/**\n\t * All commits on the source branch that are not also on the target branch after the rebase operation. In the case that the\n\t * source branch was already ahead of the target branch before the rebase, these are the same commits that were already on\n\t * the source branch before the rebase, otherwise these are the new, rebased versions of {@link deletedSourceCommits}.\n\t */\n\tsourceCommits: GraphCommit<TChange>[];\n}\n\n/**\n * Telemetry metrics for a rebase operation.\n */\nexport interface RebaseStats {\n\t/**\n\t * The length of the source branch before the rebase.\n\t */\n\treadonly sourceBranchLength: number;\n\t/**\n\t * Number of commits rebased over on the target branch.\n\t */\n\treadonly rebaseDistance: number;\n\t/**\n\t * The number of commits that are dropped from the source branch when rebased to the target branch.\n\t */\n\treadonly countDropped: number;\n}\n\nexport interface RebaseStatsWithDuration extends RebaseStats {\n\treadonly duration: number;\n}\n\nexport interface BranchRebaseResult<TChange> {\n\t/**\n\t * The head of a rebased source branch.\n\t */\n\treadonly newSourceHead: GraphCommit<TChange>;\n\t/**\n\t * A thunk that computes the cumulative change to the source branch (undefined if no change occurred)\n\t */\n\treadonly sourceChange: TChange | undefined;\n\t/**\n\t * Details about how the commits on the source branch changed\n\t */\n\treadonly commits: RebasedCommits<TChange>;\n\t/**\n\t * Telemetry properties for the rebase operation.\n\t */\n\treadonly telemetryProperties: RebaseStats;\n}\n\ninterface RebaseChangeResult<TChange> {\n\treadonly change: TChange;\n\t/**\n\t * Telemetry properties for the rebase operation.\n\t */\n\treadonly telemetryProperties: RebaseStats;\n}\n\n/**\n * Rebases a source branch onto another commit in a target branch.\n *\n * A \"branch\" is defined as a \"head\" commit and all ancestors of that commit, i.e. one linked list in a graph of commits.\n *\n * The source and target branch must share an ancestor.\n * @param changeRebaser - the change rebaser responsible for rebasing the changes in the commits of each branch\n * @param sourceHead - the head of the source branch, which will be rebased onto `targetHead`\n * @param targetHead - the commit to rebase the source branch onto\n * @returns a {@link BranchRebaseResult}\n * @remarks While a single branch must not have multiple commits with the same revision tag (that will result in undefined\n * behavior), there may be a commit on the source branch with the same revision tag as a commit on the target branch. If such\n * a pair is encountered while rebasing, it will be \"cancelled out\" in the new branch. For example:\n * ```\n * // (A)-(B)-(C) <- Branch X\n * // \\\n * // (B')-(D) <- Branch Y\n * //\n * // As Branch Y is rebased onto Branch X, commits B and B' cancel out so there is no version of B on the new rebased source branch\n * //\n * // (A)-(B)-(C) <- Branch X\n * // \\\n * // (D') <- Branch Y'\n * //\n * ```\n */\nexport function rebaseBranch<TChange>(\n\tmintRevisionTag: () => RevisionTag,\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetHead: GraphCommit<TChange>,\n): BranchRebaseResult<TChange>;\n\n/**\n * Rebases a source branch onto another commit in a target branch.\n *\n * A \"branch\" is defined as a \"head\" commit and all ancestors of that commit, i.e. one linked list in a graph of commits.\n *\n * The source and target branch must share an ancestor.\n * @param changeRebaser - the change rebaser responsible for rebasing the changes in the commits of each branch\n * @param sourceHead - the head of the source branch, which will be rebased onto `newBase`\n * @param targetCommit - the commit on the target branch to rebase the source branch onto.\n * @param targetHead - the head of the branch that `newBase` belongs to. Must be `newBase` or a descendent of `newBase`.\n * @returns a {@link BranchRebaseResult}\n * @remarks While a single branch must not have multiple commits with the same revision tag (that will result in undefined\n * behavior), there may be a commit on the source branch with the same revision tag as a commit on the target branch. If such\n * a pair is encountered while rebasing, it will be \"cancelled out\" in the new branch. Additionally, this function will rebase\n * the source branch _farther_ than `newBase` if the source branch's next commits after `newBase` match those on the target branch.\n * For example:\n * ```\n * // (A)-(B)-(C)-(D)-(E) <- Branch X\n * // \\\n * // (B')-(D')-(F) <- Branch Y\n * //\n * // If Branch Y is rebased onto commit C of Branch X, the branches must at least look like this afterwards (B was cancelled out):\n * //\n * // (A)-(B)-(C)-(D)-(E) <- Branch X\n * // \\\n * // (D'')-(F') <- Branch Y'\n * //\n * // But this function will recognize that B is equivalent to B' and D is equivalent to D', and instead produce:\n * //\n * // (A)-(B)-(C)-(D)-(E) <- Branch X\n * // \\\n * // (F') <- Branch Y'\n * ```\n */\nexport function rebaseBranch<TChange>(\n\tmintRevisionTag: () => RevisionTag,\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetCommit: GraphCommit<TChange>,\n\ttargetHead: GraphCommit<TChange>,\n): BranchRebaseResult<TChange>;\nexport function rebaseBranch<TChange>(\n\tmintRevisionTag: () => RevisionTag,\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetCommit: GraphCommit<TChange>,\n\ttargetHead = targetCommit,\n): BranchRebaseResult<TChange> {\n\t// Get both source and target as path arrays\n\tconst sourcePath: GraphCommit<TChange>[] = [];\n\tconst targetPath: GraphCommit<TChange>[] = [];\n\tconst ancestor = findCommonAncestor([sourceHead, sourcePath], [targetHead, targetPath]);\n\tassert(ancestor !== undefined, 0x675 /* branches must be related */);\n\n\tconst sourceBranchLength = sourcePath.length;\n\n\t// Find where `targetCommit` is in the target branch\n\tconst targetCommitIndex = targetPath.findIndex((r) => r === targetCommit);\n\tif (targetCommitIndex === -1) {\n\t\t// If the targetCommit is not in the target path, then it is either disjoint from `target` or it is behind/at\n\t\t// the commit where source and target diverge (ancestor), in which case there is nothing more to rebase\n\t\t// TODO: Ideally, this would be an \"assertExpensive\". It is commented out because it causes O(N²) behavior when\n\t\t// processing N inbound commits from the same client whose ref seq# is not advancing (which is a common case).\n\t\t// N can be large when the client is sending a burst of changes (potentially on reconnection).\n\t\t// assert(\n\t\t// \tfindCommonAncestor(targetCommit, targetHead) !== undefined,\n\t\t// \t0x676 /* target commit is not in target branch */,\n\t\t// );\n\t\treturn {\n\t\t\tnewSourceHead: sourceHead,\n\t\t\tsourceChange: undefined,\n\t\t\tcommits: { deletedSourceCommits: [], targetCommits: [], sourceCommits: sourcePath },\n\t\t\ttelemetryProperties: {\n\t\t\t\tsourceBranchLength,\n\t\t\t\trebaseDistance: targetCommitIndex + 1,\n\t\t\t\tcountDropped: 0,\n\t\t\t},\n\t\t};\n\t}\n\n\t// Iterate through the target path and look for commits that are also present on the source branch (i.e. they\n\t// have matching tags). Each commit found in the target branch can be skipped when processing the source branch\n\t// because it has already been rebased onto the target. In the case that one or more of these commits are present\n\t// directly after `targetCommit`, then the new base can be advanced further without having to do any work.\n\tconst sourceSet = new Set(sourcePath.map((r) => r.revision));\n\tlet newBaseIndex = targetCommitIndex;\n\n\tfor (const [i, { revision }] of targetPath.entries()) {\n\t\tif (sourceSet.has(revision)) {\n\t\t\tsourceSet.delete(revision);\n\t\t\tnewBaseIndex = Math.max(newBaseIndex, i);\n\t\t} else if (i > targetCommitIndex) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/** The commit on the target branch that the new source branch branches off of (i.e. the new common ancestor) */\n\tconst newBase = targetPath[newBaseIndex] ?? oob();\n\t// Figure out how much of the trunk to start rebasing over.\n\tconst targetCommits = targetPath.slice(0, newBaseIndex + 1);\n\tconst deletedSourceCommits = [...sourcePath];\n\n\t// If the source and target rebase path begin with a range that has all the same revisions, remove it; it is\n\t// equivalent on both branches and doesn't need to be rebased.\n\tconst targetRebasePath = [...targetCommits];\n\tif (hasSome(sourcePath) && hasSome(targetRebasePath)) {\n\t\tconst minLength = Math.min(sourcePath.length, targetRebasePath.length);\n\t\tfor (let i = 0; i < minLength; i++) {\n\t\t\tconst firstSourcePath = sourcePath[0];\n\t\t\tconst firstTargetRebasePath = targetRebasePath[0];\n\t\t\tif (firstSourcePath.revision === firstTargetRebasePath.revision) {\n\t\t\t\tsourcePath.shift();\n\t\t\t\ttargetRebasePath.shift();\n\t\t\t}\n\t\t}\n\t}\n\n\tconst sourceCommits: GraphCommit<TChange>[] = [];\n\n\t// If all commits that are about to be rebased over on the target branch already comprise the start of the source branch,\n\t// are in the same order, and have no other commits interleaving them, then no rebasing needs to occur. Those commits can\n\t// simply be removed from the source branch, and the remaining commits on the source branch are reparented off of the new\n\t// base commit.\n\tif (!hasSome(targetRebasePath)) {\n\t\tfor (const c of sourcePath) {\n\t\t\tsourceCommits.push(mintCommit(sourceCommits[sourceCommits.length - 1] ?? newBase, c));\n\t\t}\n\t\treturn {\n\t\t\tnewSourceHead: sourceCommits[sourceCommits.length - 1] ?? newBase,\n\t\t\tsourceChange: undefined,\n\t\t\tcommits: {\n\t\t\t\tdeletedSourceCommits,\n\t\t\t\ttargetCommits,\n\t\t\t\tsourceCommits,\n\t\t\t},\n\t\t\ttelemetryProperties: {\n\t\t\t\tsourceBranchLength,\n\t\t\t\trebaseDistance: targetCommits.length,\n\t\t\t\tcountDropped: sourceBranchLength - sourceSet.size,\n\t\t\t},\n\t\t};\n\t}\n\n\t// For each source commit, rebase backwards over the inverses of any commits already rebased, and then\n\t// rebase forwards over the rest of the commits up to the new base before advancing the new base.\n\tlet newHead = newBase;\n\tconst revInfos = getRevInfoFromTaggedChanges([...targetRebasePath, ...sourcePath]);\n\t// Note that the `revisionMetadata` gets updated as `revInfos` gets updated.\n\tconst revisionMetadata = revisionMetadataSourceFromInfo(revInfos);\n\tlet editsToCompose: TaggedChange<TChange>[] = targetRebasePath.slice();\n\tfor (const c of sourcePath) {\n\t\tconst rollback = rollbackFromCommit(changeRebaser, c, mintRevisionTag, true /* cache */);\n\t\tif (sourceSet.has(c.revision)) {\n\t\t\tconst currentComposedEdit = makeAnonChange(changeRebaser.compose(editsToCompose));\n\t\t\teditsToCompose = [currentComposedEdit];\n\t\t\tconst change = changeRebaser.rebase(c, currentComposedEdit, revisionMetadata);\n\t\t\tnewHead = {\n\t\t\t\trevision: c.revision,\n\t\t\t\tchange,\n\t\t\t\tparent: newHead,\n\t\t\t};\n\t\t\tsourceCommits.push(newHead);\n\t\t\teditsToCompose.push(tagChange(change, c.revision));\n\t\t}\n\t\trevInfos.push({ revision: c.revision });\n\t\teditsToCompose.unshift(rollback);\n\t\trevInfos.unshift({ revision: rollback.revision, rollbackOf: rollback.rollbackOf });\n\t}\n\n\treturn defineLazyCachedProperty(\n\t\t{\n\t\t\tnewSourceHead: newHead,\n\t\t\tcommits: {\n\t\t\t\tdeletedSourceCommits,\n\t\t\t\ttargetCommits,\n\t\t\t\tsourceCommits,\n\t\t\t},\n\t\t\ttelemetryProperties: {\n\t\t\t\tsourceBranchLength,\n\t\t\t\trebaseDistance: targetCommits.length,\n\t\t\t\tcountDropped: sourceBranchLength - sourceSet.size,\n\t\t\t},\n\t\t},\n\t\t\"sourceChange\",\n\t\t() => changeRebaser.compose(editsToCompose),\n\t);\n}\n\n/**\n * \"Sandwich/Horseshoe Rebase\" a change over the given source and target branches\n * @param changeRebaser - the change rebaser responsible for rebasing the change over the commits in each branch\n * @param change - the change to rebase\n * @param sourceHead - the head of the branch that `change` is based on\n * @param targetHead - the branch to rebase `change` onto\n * @returns the rebased change\n *\n * @remarks inverses will be cached.\n */\nexport function rebaseChange<TChange>(\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tchange: TaggedChange<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetHead: GraphCommit<TChange>,\n\tmintRevisionTag: () => RevisionTag,\n): RebaseChangeResult<TChange> {\n\tconst sourcePath: GraphCommit<TChange>[] = [];\n\tconst targetPath: GraphCommit<TChange>[] = [];\n\tassert(\n\t\tfindCommonAncestor([sourceHead, sourcePath], [targetHead, targetPath]) !== undefined,\n\t\t0x576 /* branch A and branch B must be related */,\n\t);\n\n\tconst inverses = sourcePath.map((commit) =>\n\t\trollbackFromCommit(changeRebaser, commit, mintRevisionTag, true),\n\t);\n\tinverses.reverse();\n\n\tconst telemetryProperties = {\n\t\tsourceBranchLength: 1,\n\t\trebaseDistance: sourcePath.length + targetPath.length,\n\t\tcountDropped: 0,\n\t};\n\n\treturn {\n\t\tchange: rebaseChangeOverChanges(changeRebaser, change, [...inverses, ...targetPath]),\n\t\ttelemetryProperties,\n\t};\n}\n\n/**\n */\nexport function revisionMetadataSourceFromInfo(\n\trevInfos: readonly RevisionInfo[],\n): RevisionMetadataSource {\n\tconst getIndex = (revision: RevisionTag): number | undefined => {\n\t\tconst index = revInfos.findIndex((revInfo) => revInfo.revision === revision);\n\t\treturn index >= 0 ? index : undefined;\n\t};\n\tconst tryGetInfo = (revision: RevisionTag | undefined): RevisionInfo | undefined => {\n\t\tif (revision === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst index = getIndex(revision);\n\t\treturn index === undefined ? undefined : revInfos[index];\n\t};\n\n\tconst hasRollback = (revision: RevisionTag): boolean => {\n\t\treturn revInfos.find((info) => info.rollbackOf === revision) !== undefined;\n\t};\n\n\treturn { getIndex, tryGetInfo, hasRollback };\n}\n\nexport function rebaseChangeOverChanges<TChange>(\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tchangeToRebase: TaggedChange<TChange>,\n\tchangesToRebaseOver: TaggedChange<TChange>[],\n): TChange {\n\tconst revisionMetadata = revisionMetadataSourceFromInfo(\n\t\tgetRevInfoFromTaggedChanges([...changesToRebaseOver, changeToRebase]),\n\t);\n\n\treturn changesToRebaseOver.reduce(\n\t\t(a, b) => mapTaggedChange(changeToRebase, changeRebaser.rebase(a, b, revisionMetadata)),\n\t\tchangeToRebase,\n\t).change;\n}\n\n// TODO: Deduplicate\nfunction getRevInfoFromTaggedChanges(changes: TaggedChange<unknown>[]): RevisionInfo[] {\n\tconst revInfos: RevisionInfo[] = [];\n\tfor (const taggedChange of changes) {\n\t\trevInfos.push(...revisionInfoFromTaggedChange(taggedChange));\n\t}\n\n\treturn revInfos;\n}\n\n// TODO: Deduplicate\nfunction revisionInfoFromTaggedChange(taggedChange: TaggedChange<unknown>): RevisionInfo[] {\n\tconst revInfos: RevisionInfo[] = [];\n\tif (taggedChange.revision !== undefined) {\n\t\tconst info: Mutable<RevisionInfo> = { revision: taggedChange.revision };\n\t\tif (taggedChange.rollbackOf !== undefined) {\n\t\t\tinfo.rollbackOf = taggedChange.rollbackOf;\n\t\t}\n\t\trevInfos.push(info);\n\t}\n\treturn revInfos;\n}\n\nfunction rollbackFromCommit<TChange>(\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tcommit: GraphCommit<TChange>,\n\tmintRevisionTag: () => RevisionTag,\n\tcache?: boolean,\n): TaggedChange<TChange, RevisionTag> {\n\tconst rollback = Rollback.get(commit);\n\tif (rollback !== undefined) {\n\t\treturn rollback;\n\t}\n\tconst tag = mintRevisionTag();\n\tconst untagged = changeRebaser.invert(commit, true, tag);\n\tconst deeplyTaggedRollback = changeRebaser.changeRevision(untagged, tag, commit.revision);\n\tconst fullyTaggedRollback = tagRollbackInverse(deeplyTaggedRollback, tag, commit.revision);\n\n\tif (cache === true) {\n\t\tRollback.set(commit, fullyTaggedRollback);\n\t}\n\treturn fullyTaggedRollback;\n}\n\n/**\n * Find the furthest ancestor of some descendant.\n * @param descendant - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of ancestry for `descendant` from most distant to closest (not including the furthest ancestor,\n * but otherwise including `descendant`).\n * @returns the furthest ancestor of `descendant`, or `descendant` itself if `descendant` has no ancestors.\n */\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T, path?: T[]],\n): T;\n/**\n * Find the furthest ancestor of some descendant.\n * @param descendant - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of ancestry for `descendant` from most distant to closest (not including the furthest ancestor,\n * but otherwise including `descendant`).\n * @returns the furthest ancestor of `descendant`, or `descendant` itself if `descendant` has no ancestors. Returns\n * `undefined` if `descendant` is undefined.\n */\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T | undefined, path?: T[]] | undefined,\n): T | undefined;\n/**\n * Find an ancestor of some descendant.\n * @param descendant - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of ancestry for `descendant` from most distant to closest (not including the ancestor found by `predicate`,\n * but otherwise including `descendant`).\n * @param predicate - a function which will be evaluated on `descendant` and then ancestor of `descendant` (in ascending order) until it returns true.\n * @returns the closest ancestor of `descendant` that satisfies `predicate`, or `undefined` if no such ancestor exists.\n *\n * @example\n *\n * ```typescript\n * interface Parented {\n * id: string;\n * parent?: Parented;\n * }\n * const g = { id: \"g\" }; // Grandparent\n * const p = { parent: g, id: \"p\" }; // Parent\n * const c = { parent: p, id: \"c\" }; // Child\n * const path: Parented[] = [];\n * const ancestor = findAncestor<Parented>([c, path], (n) => n.id === \"g\");\n * // ancestor === g\n * // path === [p, c]\n * ```\n */\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T | undefined, path?: T[]] | undefined,\n\tpredicate: (t: T) => boolean,\n): T | undefined;\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T | undefined, path?: T[]] | undefined,\n\tpredicate: (t: T) => boolean = (t): boolean => t.parent === undefined,\n): T | undefined {\n\tlet d: T | undefined;\n\tlet path: T[] | undefined;\n\tif (Array.isArray(descendant)) {\n\t\t[d, path] = descendant;\n\t} else {\n\t\td = descendant;\n\t}\n\tfor (let cur = d; cur !== undefined; cur = cur.parent) {\n\t\tif (predicate(cur)) {\n\t\t\tpath?.reverse();\n\t\t\treturn cur;\n\t\t}\n\t\tpath?.push(cur);\n\t}\n\n\tif (path !== undefined) {\n\t\tpath.length = 0;\n\t}\n\treturn undefined;\n}\n\n/**\n * Find a common ancestor between two descendants that are linked by parent pointers.\n * @param descendantA - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of commits from the ancestor to `descendantA` (not including the ancestor).\n * @param descendantB - another descendant. If an empty `path` array is included, it will be populated\n * with the chain of commits from the ancestor to `descendantB` (not including the ancestor).\n * @returns the common ancestor of `descendantA` and `descendantB`, or `undefined` if no such ancestor exists.\n *\n * @example\n *\n * ```typescript\n * interface Parented {\n * parent?: Parented;\n * }\n * const shared = {};\n * const a = { parent: shared };\n * const b1 = { parent: shared };\n * const b2 = { parent: b1 };\n * const pathB: Parented[] = []\n * const ancestor = findCommonAncestor<Parented>(a, [b2, pathB]);\n * // ancestor === shared\n * // pathB === [b1, b2]\n * ```\n */\nexport function findCommonAncestor<T extends { parent?: T }>(\n\tdescendantA: T | [descendantA: T, path?: T[]] | undefined,\n\tdescendantB: T | [descendantB: T, path?: T[]] | undefined,\n): T | undefined {\n\tlet a: T | undefined;\n\tlet b: T | undefined;\n\tlet pathA: T[] | undefined;\n\tlet pathB: T[] | undefined;\n\tif (Array.isArray(descendantA)) {\n\t\t[a, pathA] = descendantA;\n\t\tassert(pathA === undefined || pathA.length === 0, 0x578 /* Path A must be empty */);\n\t} else {\n\t\ta = descendantA;\n\t}\n\tif (Array.isArray(descendantB)) {\n\t\t[b, pathB] = descendantB;\n\t\tassert(pathB === undefined || pathB.length === 0, 0x579 /* Path B must be empty */);\n\t} else {\n\t\tb = descendantB;\n\t}\n\n\tif (a === b) {\n\t\treturn a;\n\t}\n\n\tconst reversePaths = (): void => {\n\t\tpathA?.reverse();\n\t\tpathB?.reverse();\n\t};\n\n\tconst visited = new Set();\n\twhile (a !== undefined || b !== undefined) {\n\t\tif (a !== undefined) {\n\t\t\tif (visited.has(a)) {\n\t\t\t\tif (pathB !== undefined) {\n\t\t\t\t\tpathB.length = pathB.findIndex((r) => Object.is(r, a));\n\t\t\t\t}\n\t\t\t\treversePaths();\n\t\t\t\treturn a;\n\t\t\t}\n\t\t\tvisited.add(a);\n\t\t\tpathA?.push(a);\n\t\t\ta = a.parent;\n\t\t}\n\n\t\tif (b !== undefined) {\n\t\t\tif (visited.has(b)) {\n\t\t\t\tif (pathA !== undefined) {\n\t\t\t\t\tpathA.length = pathA.findIndex((r) => Object.is(r, b));\n\t\t\t\t}\n\t\t\t\treversePaths();\n\t\t\t\treturn b;\n\t\t\t}\n\t\t\tvisited.add(b);\n\t\t\tpathB?.push(b);\n\t\t\tb = b.parent;\n\t\t}\n\t}\n\n\tif (pathA !== undefined) {\n\t\tpathA.length = 0;\n\t}\n\tif (pathB !== undefined) {\n\t\tpathB.length = 0;\n\t}\n\treturn undefined;\n}\n\nexport function replaceChange<TChange>(\n\tcommit: GraphCommit<TChange>,\n\tchange: TChange,\n): GraphCommit<TChange> {\n\tconst output = { ...commit, change };\n\tRollback.set(output, undefined);\n\treturn output;\n}\n\n/** Associates rollback data with commits */\nnamespace Rollback {\n\tconst map = new WeakMap<GraphCommit<unknown>, TaggedChange<unknown, RevisionTag>>();\n\n\texport function get<TChange>(\n\t\tcommit: GraphCommit<TChange>,\n\t): TaggedChange<TChange, RevisionTag> | undefined {\n\t\treturn map.get(commit) as TaggedChange<TChange, RevisionTag> | undefined;\n\t}\n\n\texport function set<TChange>(\n\t\tcommit: GraphCommit<TChange>,\n\t\trollback: TaggedChange<TChange, RevisionTag> | undefined,\n\t): void {\n\t\tif (rollback === undefined) {\n\t\t\tmap.delete(commit);\n\t\t} else {\n\t\t\tmap.set(commit, rollback);\n\t\t}\n\t}\n}\n\n/**\n * Checks if one node is an ancestor of another in a parent-linked tree structure.\n * @param ancestor - The potential ancestor node\n * @param descendant - The potential descendant node\n * @param allowEqual - If true, returns true when ancestor === descendant\n * @returns true if ancestor is an ancestor of descendant (or equal if allowEqual is true)\n */\nexport function isAncestor<TNode extends { readonly parent?: TNode }>(\n\tancestor: TNode,\n\tdescendant: TNode,\n\tallowEqual: boolean,\n): boolean {\n\tif (allowEqual && ancestor === descendant) {\n\t\treturn true;\n\t}\n\n\tlet current = descendant.parent;\n\twhile (current !== undefined) {\n\t\tif (current === ancestor) {\n\t\t\treturn true;\n\t\t}\n\t\tcurrent = current.parent;\n\t}\n\n\treturn false;\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/core/rebase/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAkE;AAElE,kDAA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G;AACH,SAAgB,UAAU,CACzB,QAAe,EACf,UAAiB,EACjB,UAAmB;IAEnB,IAAI,UAAU,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC;IAChC,OAAO,OAAO,KAAK,SAAS,EAAE,CAAC;QAC9B,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAlBD,gCAkBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\n\nimport { defineLazyCachedProperty, hasSome, type Mutable } from \"../../util/index.js\";\n\nimport {\n\ttype ChangeRebaser,\n\ttype RevisionInfo,\n\ttype RevisionMetadataSource,\n\ttype TaggedChange,\n\tmakeAnonChange,\n\tmapTaggedChange,\n\ttagChange,\n\ttagRollbackInverse,\n} from \"./changeRebaser.js\";\nimport { type GraphCommit, type RevisionTag, mintCommit } from \"./types.js\";\n\n/**\n * Contains information about how the commit graph changed as the result of rebasing a source branch onto another target branch.\n * @remarks\n * ```text\n * Consider the commit graph below containing two branches, X and Y, with head commits C and E, respectively.\n * Branch Y branches off of Branch X at their common ancestor commit A, i.e. \"Y is based off of X at commit A\".\n *\n * A ─ B ─ C ← Branch X\n * └─ D ─ E ← Branch Y\n *\n * Branch Y is then rebased onto Branch X. This results in the following commit graph:\n *\n * A ─ B ─ C ← Branch X\n * └─ D'─ E'← Branch Y\n *\n * Commits D' and E' are the rebased versions of commits D and E, respectively. This results in:\n * deletedSourceCommits: [D, E],\n * targetCommits: [B, C],\n * sourceCommits: [D', E']\n * ```\n */\nexport interface RebasedCommits<TChange> {\n\t/**\n\t * The commits on the original source branch that were rebased. These are no longer referenced by the source branch and have\n\t * been replaced with new versions on the new source branch, see {@link sourceCommits}. In the case that the source\n\t * branch was already ahead of the target branch before the rebase, this list will be empty.\n\t */\n\tdeletedSourceCommits: GraphCommit<TChange>[];\n\t/**\n\t * All commits on the target branch that the source branch's commits were rebased over. These are now the direct\n\t * ancestors of {@link sourceCommits}. In the case that the source branch was already ahead of the target branch\n\t * before the rebase, this list will be empty.\n\t */\n\ttargetCommits: GraphCommit<TChange>[];\n\t/**\n\t * All commits on the source branch that are not also on the target branch after the rebase operation. In the case that the\n\t * source branch was already ahead of the target branch before the rebase, these are the same commits that were already on\n\t * the source branch before the rebase, otherwise these are the new, rebased versions of {@link deletedSourceCommits}.\n\t */\n\tsourceCommits: GraphCommit<TChange>[];\n}\n\n/**\n * Telemetry metrics for a rebase operation.\n */\nexport interface RebaseStats {\n\t/**\n\t * The length of the source branch before the rebase.\n\t */\n\treadonly sourceBranchLength: number;\n\t/**\n\t * Number of commits rebased over on the target branch.\n\t */\n\treadonly rebaseDistance: number;\n\t/**\n\t * The number of commits that are dropped from the source branch when rebased to the target branch.\n\t */\n\treadonly countDropped: number;\n}\n\nexport interface RebaseStatsWithDuration extends RebaseStats {\n\treadonly duration: number;\n}\n\nexport interface BranchRebaseResult<TChange> {\n\t/**\n\t * The head of a rebased source branch.\n\t */\n\treadonly newSourceHead: GraphCommit<TChange>;\n\t/**\n\t * A thunk that computes the cumulative change to the source branch (undefined if no change occurred)\n\t */\n\treadonly sourceChange: TChange | undefined;\n\t/**\n\t * Details about how the commits on the source branch changed\n\t */\n\treadonly commits: RebasedCommits<TChange>;\n\t/**\n\t * Telemetry properties for the rebase operation.\n\t */\n\treadonly telemetryProperties: RebaseStats;\n}\n\ninterface RebaseChangeResult<TChange> {\n\treadonly change: TChange;\n\t/**\n\t * Telemetry properties for the rebase operation.\n\t */\n\treadonly telemetryProperties: RebaseStats;\n}\n\n/**\n * Rebases a source branch onto another commit in a target branch.\n *\n * A \"branch\" is defined as a \"head\" commit and all ancestors of that commit, i.e. one linked list in a graph of commits.\n *\n * The source and target branch must share an ancestor.\n * @param changeRebaser - the change rebaser responsible for rebasing the changes in the commits of each branch\n * @param sourceHead - the head of the source branch, which will be rebased onto `targetHead`\n * @param targetHead - the commit to rebase the source branch onto\n * @returns a {@link BranchRebaseResult}\n * @remarks While a single branch must not have multiple commits with the same revision tag (that will result in undefined\n * behavior), there may be a commit on the source branch with the same revision tag as a commit on the target branch. If such\n * a pair is encountered while rebasing, it will be \"cancelled out\" in the new branch. For example:\n * ```\n * // (A)-(B)-(C) <- Branch X\n * // \\\n * // (B')-(D) <- Branch Y\n * //\n * // As Branch Y is rebased onto Branch X, commits B and B' cancel out so there is no version of B on the new rebased source branch\n * //\n * // (A)-(B)-(C) <- Branch X\n * // \\\n * // (D') <- Branch Y'\n * //\n * ```\n */\nexport function rebaseBranch<TChange>(\n\tmintRevisionTag: () => RevisionTag,\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetHead: GraphCommit<TChange>,\n): BranchRebaseResult<TChange>;\n\n/**\n * Rebases a source branch onto another commit in a target branch.\n *\n * A \"branch\" is defined as a \"head\" commit and all ancestors of that commit, i.e. one linked list in a graph of commits.\n *\n * The source and target branch must share an ancestor.\n * @param changeRebaser - the change rebaser responsible for rebasing the changes in the commits of each branch\n * @param sourceHead - the head of the source branch, which will be rebased onto `newBase`\n * @param targetCommit - the commit on the target branch to rebase the source branch onto.\n * @param targetHead - the head of the branch that `newBase` belongs to. Must be `newBase` or a descendent of `newBase`.\n * @returns a {@link BranchRebaseResult}\n * @remarks While a single branch must not have multiple commits with the same revision tag (that will result in undefined\n * behavior), there may be a commit on the source branch with the same revision tag as a commit on the target branch. If such\n * a pair is encountered while rebasing, it will be \"cancelled out\" in the new branch. Additionally, this function will rebase\n * the source branch _farther_ than `newBase` if the source branch's next commits after `newBase` match those on the target branch.\n * For example:\n * ```\n * // (A)-(B)-(C)-(D)-(E) <- Branch X\n * // \\\n * // (B')-(D')-(F) <- Branch Y\n * //\n * // If Branch Y is rebased onto commit C of Branch X, the branches must at least look like this afterwards (B was cancelled out):\n * //\n * // (A)-(B)-(C)-(D)-(E) <- Branch X\n * // \\\n * // (D'')-(F') <- Branch Y'\n * //\n * // But this function will recognize that B is equivalent to B' and D is equivalent to D', and instead produce:\n * //\n * // (A)-(B)-(C)-(D)-(E) <- Branch X\n * // \\\n * // (F') <- Branch Y'\n * ```\n */\nexport function rebaseBranch<TChange>(\n\tmintRevisionTag: () => RevisionTag,\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetCommit: GraphCommit<TChange>,\n\ttargetHead: GraphCommit<TChange>,\n): BranchRebaseResult<TChange>;\nexport function rebaseBranch<TChange>(\n\tmintRevisionTag: () => RevisionTag,\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetCommit: GraphCommit<TChange>,\n\ttargetHead = targetCommit,\n): BranchRebaseResult<TChange> {\n\t// Get both source and target as path arrays\n\tconst sourcePath: GraphCommit<TChange>[] = [];\n\tconst targetPath: GraphCommit<TChange>[] = [];\n\tconst ancestor = findCommonAncestor([sourceHead, sourcePath], [targetHead, targetPath]);\n\tassert(ancestor !== undefined, 0x675 /* branches must be related */);\n\n\tconst sourceBranchLength = sourcePath.length;\n\n\t// Find where `targetCommit` is in the target branch\n\tconst targetCommitIndex = targetPath.findIndex((r) => r === targetCommit);\n\tif (targetCommitIndex === -1) {\n\t\t// If the targetCommit is not in the target path, then it is either disjoint from `target` or it is behind/at\n\t\t// the commit where source and target diverge (ancestor), in which case there is nothing more to rebase\n\t\t// TODO: Ideally, this would be an \"assertExpensive\". It is commented out because it causes O(N²) behavior when\n\t\t// processing N inbound commits from the same client whose ref seq# is not advancing (which is a common case).\n\t\t// N can be large when the client is sending a burst of changes (potentially on reconnection).\n\t\t// assert(\n\t\t// \tfindCommonAncestor(targetCommit, targetHead) !== undefined,\n\t\t// \t0x676 /* target commit is not in target branch */,\n\t\t// );\n\t\treturn {\n\t\t\tnewSourceHead: sourceHead,\n\t\t\tsourceChange: undefined,\n\t\t\tcommits: { deletedSourceCommits: [], targetCommits: [], sourceCommits: sourcePath },\n\t\t\ttelemetryProperties: {\n\t\t\t\tsourceBranchLength,\n\t\t\t\trebaseDistance: targetCommitIndex + 1,\n\t\t\t\tcountDropped: 0,\n\t\t\t},\n\t\t};\n\t}\n\n\t// Iterate through the target path and look for commits that are also present on the source branch (i.e. they\n\t// have matching tags). Each commit found in the target branch can be skipped when processing the source branch\n\t// because it has already been rebased onto the target. In the case that one or more of these commits are present\n\t// directly after `targetCommit`, then the new base can be advanced further without having to do any work.\n\tconst sourceSet = new Set(sourcePath.map((r) => r.revision));\n\tlet newBaseIndex = targetCommitIndex;\n\n\tfor (const [i, { revision }] of targetPath.entries()) {\n\t\tif (sourceSet.has(revision)) {\n\t\t\tsourceSet.delete(revision);\n\t\t\tnewBaseIndex = Math.max(newBaseIndex, i);\n\t\t} else if (i > targetCommitIndex) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/** The commit on the target branch that the new source branch branches off of (i.e. the new common ancestor) */\n\tconst newBase = targetPath[newBaseIndex] ?? oob();\n\t// Figure out how much of the trunk to start rebasing over.\n\tconst targetCommits = targetPath.slice(0, newBaseIndex + 1);\n\tconst deletedSourceCommits = [...sourcePath];\n\n\t// If the source and target rebase path begin with a range that has all the same revisions, remove it; it is\n\t// equivalent on both branches and doesn't need to be rebased.\n\tconst targetRebasePath = [...targetCommits];\n\tif (hasSome(sourcePath) && hasSome(targetRebasePath)) {\n\t\tconst minLength = Math.min(sourcePath.length, targetRebasePath.length);\n\t\tfor (let i = 0; i < minLength; i++) {\n\t\t\tconst firstSourcePath = sourcePath[0];\n\t\t\tconst firstTargetRebasePath = targetRebasePath[0];\n\t\t\tif (firstSourcePath.revision === firstTargetRebasePath.revision) {\n\t\t\t\tsourcePath.shift();\n\t\t\t\ttargetRebasePath.shift();\n\t\t\t}\n\t\t}\n\t}\n\n\tconst sourceCommits: GraphCommit<TChange>[] = [];\n\n\t// If all commits that are about to be rebased over on the target branch already comprise the start of the source branch,\n\t// are in the same order, and have no other commits interleaving them, then no rebasing needs to occur. Those commits can\n\t// simply be removed from the source branch, and the remaining commits on the source branch are reparented off of the new\n\t// base commit.\n\tif (!hasSome(targetRebasePath)) {\n\t\tfor (const c of sourcePath) {\n\t\t\tsourceCommits.push(mintCommit(sourceCommits[sourceCommits.length - 1] ?? newBase, c));\n\t\t}\n\t\treturn {\n\t\t\tnewSourceHead: sourceCommits[sourceCommits.length - 1] ?? newBase,\n\t\t\tsourceChange: undefined,\n\t\t\tcommits: {\n\t\t\t\tdeletedSourceCommits,\n\t\t\t\ttargetCommits,\n\t\t\t\tsourceCommits,\n\t\t\t},\n\t\t\ttelemetryProperties: {\n\t\t\t\tsourceBranchLength,\n\t\t\t\trebaseDistance: targetCommits.length,\n\t\t\t\tcountDropped: sourceBranchLength - sourceSet.size,\n\t\t\t},\n\t\t};\n\t}\n\n\t// For each source commit, rebase backwards over the inverses of any commits already rebased, and then\n\t// rebase forwards over the rest of the commits up to the new base before advancing the new base.\n\tlet newHead = newBase;\n\tconst revInfos = getRevInfoFromTaggedChanges([...targetRebasePath, ...sourcePath]);\n\t// Note that the `revisionMetadata` gets updated as `revInfos` gets updated.\n\tconst revisionMetadata = revisionMetadataSourceFromInfo(revInfos);\n\tlet editsToCompose: TaggedChange<TChange>[] = targetRebasePath.slice();\n\tfor (const c of sourcePath) {\n\t\tconst rollback = rollbackFromCommit(changeRebaser, c, mintRevisionTag, true /* cache */);\n\t\tif (sourceSet.has(c.revision)) {\n\t\t\tconst currentComposedEdit = makeAnonChange(changeRebaser.compose(editsToCompose));\n\t\t\teditsToCompose = [currentComposedEdit];\n\t\t\tconst change = changeRebaser.rebase(c, currentComposedEdit, revisionMetadata);\n\t\t\tnewHead = {\n\t\t\t\trevision: c.revision,\n\t\t\t\tchange,\n\t\t\t\tparent: newHead,\n\t\t\t};\n\t\t\tsourceCommits.push(newHead);\n\t\t\teditsToCompose.push(tagChange(change, c.revision));\n\t\t}\n\t\trevInfos.push({ revision: c.revision });\n\t\teditsToCompose.unshift(rollback);\n\t\trevInfos.unshift({ revision: rollback.revision, rollbackOf: rollback.rollbackOf });\n\t}\n\n\treturn defineLazyCachedProperty(\n\t\t{\n\t\t\tnewSourceHead: newHead,\n\t\t\tcommits: {\n\t\t\t\tdeletedSourceCommits,\n\t\t\t\ttargetCommits,\n\t\t\t\tsourceCommits,\n\t\t\t},\n\t\t\ttelemetryProperties: {\n\t\t\t\tsourceBranchLength,\n\t\t\t\trebaseDistance: targetCommits.length,\n\t\t\t\tcountDropped: sourceBranchLength - sourceSet.size,\n\t\t\t},\n\t\t},\n\t\t\"sourceChange\",\n\t\t() => changeRebaser.compose(editsToCompose),\n\t);\n}\n\n/**\n * \"Sandwich/Horseshoe Rebase\" a change over the given source and target branches\n * @param changeRebaser - the change rebaser responsible for rebasing the change over the commits in each branch\n * @param change - the change to rebase\n * @param sourceHead - the head of the branch that `change` is based on\n * @param targetHead - the branch to rebase `change` onto\n * @returns the rebased change\n *\n * @remarks inverses will be cached.\n */\nexport function rebaseChange<TChange>(\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tchange: TaggedChange<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetHead: GraphCommit<TChange>,\n\tmintRevisionTag: () => RevisionTag,\n): RebaseChangeResult<TChange> {\n\tconst sourcePath: GraphCommit<TChange>[] = [];\n\tconst targetPath: GraphCommit<TChange>[] = [];\n\tassert(\n\t\tfindCommonAncestor([sourceHead, sourcePath], [targetHead, targetPath]) !== undefined,\n\t\t0x576 /* branch A and branch B must be related */,\n\t);\n\n\tconst inverses = sourcePath.map((commit) =>\n\t\trollbackFromCommit(changeRebaser, commit, mintRevisionTag, true),\n\t);\n\tinverses.reverse();\n\n\tconst telemetryProperties = {\n\t\tsourceBranchLength: 1,\n\t\trebaseDistance: sourcePath.length + targetPath.length,\n\t\tcountDropped: 0,\n\t};\n\n\treturn {\n\t\tchange: rebaseChangeOverChanges(changeRebaser, change, [...inverses, ...targetPath]),\n\t\ttelemetryProperties,\n\t};\n}\n\nexport function revisionMetadataSourceFromInfo(\n\trevInfos: readonly RevisionInfo[],\n): RevisionMetadataSource {\n\tconst getIndex = (revision: RevisionTag): number | undefined => {\n\t\tconst index = revInfos.findIndex((revInfo) => revInfo.revision === revision);\n\t\treturn index >= 0 ? index : undefined;\n\t};\n\tconst tryGetInfo = (revision: RevisionTag | undefined): RevisionInfo | undefined => {\n\t\tif (revision === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst index = getIndex(revision);\n\t\treturn index === undefined ? undefined : revInfos[index];\n\t};\n\n\tconst hasRollback = (revision: RevisionTag): boolean => {\n\t\treturn revInfos.find((info) => info.rollbackOf === revision) !== undefined;\n\t};\n\n\treturn { getIndex, tryGetInfo, hasRollback };\n}\n\nexport function rebaseChangeOverChanges<TChange>(\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tchangeToRebase: TaggedChange<TChange>,\n\tchangesToRebaseOver: TaggedChange<TChange>[],\n): TChange {\n\tconst revisionMetadata = revisionMetadataSourceFromInfo(\n\t\tgetRevInfoFromTaggedChanges([...changesToRebaseOver, changeToRebase]),\n\t);\n\n\treturn changesToRebaseOver.reduce(\n\t\t(a, b) => mapTaggedChange(changeToRebase, changeRebaser.rebase(a, b, revisionMetadata)),\n\t\tchangeToRebase,\n\t).change;\n}\n\n// TODO: Deduplicate\nfunction getRevInfoFromTaggedChanges(changes: TaggedChange<unknown>[]): RevisionInfo[] {\n\tconst revInfos: RevisionInfo[] = [];\n\tfor (const taggedChange of changes) {\n\t\trevInfos.push(...revisionInfoFromTaggedChange(taggedChange));\n\t}\n\n\treturn revInfos;\n}\n\n// TODO: Deduplicate\nfunction revisionInfoFromTaggedChange(taggedChange: TaggedChange<unknown>): RevisionInfo[] {\n\tconst revInfos: RevisionInfo[] = [];\n\tif (taggedChange.revision !== undefined) {\n\t\tconst info: Mutable<RevisionInfo> = { revision: taggedChange.revision };\n\t\tif (taggedChange.rollbackOf !== undefined) {\n\t\t\tinfo.rollbackOf = taggedChange.rollbackOf;\n\t\t}\n\t\trevInfos.push(info);\n\t}\n\treturn revInfos;\n}\n\nfunction rollbackFromCommit<TChange>(\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tcommit: GraphCommit<TChange>,\n\tmintRevisionTag: () => RevisionTag,\n\tcache?: boolean,\n): TaggedChange<TChange, RevisionTag> {\n\tconst cachedRollback = Rollback.get(commit);\n\tif (cachedRollback !== undefined) {\n\t\treturn cachedRollback;\n\t}\n\tconst tag = mintRevisionTag();\n\tconst rollback = tagRollbackInverse(\n\t\tchangeRebaser.invert(commit, true, tag),\n\t\ttag,\n\t\tcommit.revision,\n\t);\n\n\tif (cache === true) {\n\t\tRollback.set(commit, rollback);\n\t}\n\treturn rollback;\n}\n\n/**\n * Find the furthest ancestor of some descendant.\n * @param descendant - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of ancestry for `descendant` from most distant to closest (not including the furthest ancestor,\n * but otherwise including `descendant`).\n * @returns the furthest ancestor of `descendant`, or `descendant` itself if `descendant` has no ancestors.\n */\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T, path?: T[]],\n): T;\n/**\n * Find the furthest ancestor of some descendant.\n * @param descendant - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of ancestry for `descendant` from most distant to closest (not including the furthest ancestor,\n * but otherwise including `descendant`).\n * @returns the furthest ancestor of `descendant`, or `descendant` itself if `descendant` has no ancestors. Returns\n * `undefined` if `descendant` is undefined.\n */\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T | undefined, path?: T[]] | undefined,\n): T | undefined;\n/**\n * Find an ancestor of some descendant.\n * @param descendant - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of ancestry for `descendant` from most distant to closest (not including the ancestor found by `predicate`,\n * but otherwise including `descendant`).\n * @param predicate - a function which will be evaluated on `descendant` and then ancestor of `descendant` (in ascending order) until it returns true.\n * @returns the closest ancestor of `descendant` that satisfies `predicate`, or `undefined` if no such ancestor exists.\n *\n * @example\n *\n * ```typescript\n * interface Parented {\n * id: string;\n * parent?: Parented;\n * }\n * const g = { id: \"g\" }; // Grandparent\n * const p = { parent: g, id: \"p\" }; // Parent\n * const c = { parent: p, id: \"c\" }; // Child\n * const path: Parented[] = [];\n * const ancestor = findAncestor<Parented>([c, path], (n) => n.id === \"g\");\n * // ancestor === g\n * // path === [p, c]\n * ```\n */\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T | undefined, path?: T[]] | undefined,\n\tpredicate: (t: T) => boolean,\n): T | undefined;\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T | undefined, path?: T[]] | undefined,\n\tpredicate: (t: T) => boolean = (t): boolean => t.parent === undefined,\n): T | undefined {\n\tlet d: T | undefined;\n\tlet path: T[] | undefined;\n\tif (Array.isArray(descendant)) {\n\t\t[d, path] = descendant;\n\t} else {\n\t\td = descendant;\n\t}\n\tfor (let cur = d; cur !== undefined; cur = cur.parent) {\n\t\tif (predicate(cur)) {\n\t\t\tpath?.reverse();\n\t\t\treturn cur;\n\t\t}\n\t\tpath?.push(cur);\n\t}\n\n\tif (path !== undefined) {\n\t\tpath.length = 0;\n\t}\n\treturn undefined;\n}\n\n/**\n * Find a common ancestor between two descendants that are linked by parent pointers.\n * @param descendantA - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of commits from the ancestor to `descendantA` (not including the ancestor).\n * @param descendantB - another descendant. If an empty `path` array is included, it will be populated\n * with the chain of commits from the ancestor to `descendantB` (not including the ancestor).\n * @returns the common ancestor of `descendantA` and `descendantB`, or `undefined` if no such ancestor exists.\n *\n * @example\n *\n * ```typescript\n * interface Parented {\n * parent?: Parented;\n * }\n * const shared = {};\n * const a = { parent: shared };\n * const b1 = { parent: shared };\n * const b2 = { parent: b1 };\n * const pathB: Parented[] = []\n * const ancestor = findCommonAncestor<Parented>(a, [b2, pathB]);\n * // ancestor === shared\n * // pathB === [b1, b2]\n * ```\n */\nexport function findCommonAncestor<T extends { parent?: T }>(\n\tdescendantA: T | [descendantA: T, path?: T[]] | undefined,\n\tdescendantB: T | [descendantB: T, path?: T[]] | undefined,\n): T | undefined {\n\tlet a: T | undefined;\n\tlet b: T | undefined;\n\tlet pathA: T[] | undefined;\n\tlet pathB: T[] | undefined;\n\tif (Array.isArray(descendantA)) {\n\t\t[a, pathA] = descendantA;\n\t\tassert(pathA === undefined || pathA.length === 0, 0x578 /* Path A must be empty */);\n\t} else {\n\t\ta = descendantA;\n\t}\n\tif (Array.isArray(descendantB)) {\n\t\t[b, pathB] = descendantB;\n\t\tassert(pathB === undefined || pathB.length === 0, 0x579 /* Path B must be empty */);\n\t} else {\n\t\tb = descendantB;\n\t}\n\n\tif (a === b) {\n\t\treturn a;\n\t}\n\n\tconst reversePaths = (): void => {\n\t\tpathA?.reverse();\n\t\tpathB?.reverse();\n\t};\n\n\tconst visited = new Set();\n\twhile (a !== undefined || b !== undefined) {\n\t\tif (a !== undefined) {\n\t\t\tif (visited.has(a)) {\n\t\t\t\tif (pathB !== undefined) {\n\t\t\t\t\tpathB.length = pathB.findIndex((r) => Object.is(r, a));\n\t\t\t\t}\n\t\t\t\treversePaths();\n\t\t\t\treturn a;\n\t\t\t}\n\t\t\tvisited.add(a);\n\t\t\tpathA?.push(a);\n\t\t\ta = a.parent;\n\t\t}\n\n\t\tif (b !== undefined) {\n\t\t\tif (visited.has(b)) {\n\t\t\t\tif (pathA !== undefined) {\n\t\t\t\t\tpathA.length = pathA.findIndex((r) => Object.is(r, b));\n\t\t\t\t}\n\t\t\t\treversePaths();\n\t\t\t\treturn b;\n\t\t\t}\n\t\t\tvisited.add(b);\n\t\t\tpathB?.push(b);\n\t\t\tb = b.parent;\n\t\t}\n\t}\n\n\tif (pathA !== undefined) {\n\t\tpathA.length = 0;\n\t}\n\tif (pathB !== undefined) {\n\t\tpathB.length = 0;\n\t}\n\treturn undefined;\n}\n\nexport function replaceChange<TChange>(\n\tcommit: GraphCommit<TChange>,\n\tchange: TChange,\n): GraphCommit<TChange> {\n\tconst output = { ...commit, change };\n\tRollback.set(output, undefined);\n\treturn output;\n}\n\n/** Associates rollback data with commits */\nnamespace Rollback {\n\tconst map = new WeakMap<GraphCommit<unknown>, TaggedChange<unknown, RevisionTag>>();\n\n\texport function get<TChange>(\n\t\tcommit: GraphCommit<TChange>,\n\t): TaggedChange<TChange, RevisionTag> | undefined {\n\t\treturn map.get(commit) as TaggedChange<TChange, RevisionTag> | undefined;\n\t}\n\n\texport function set<TChange>(\n\t\tcommit: GraphCommit<TChange>,\n\t\trollback: TaggedChange<TChange, RevisionTag> | undefined,\n\t): void {\n\t\tif (rollback === undefined) {\n\t\t\tmap.delete(commit);\n\t\t} else {\n\t\t\tmap.set(commit, rollback);\n\t\t}\n\t}\n}\n\n/**\n * Checks if one node is an ancestor of another in a parent-linked tree structure.\n * @param ancestor - The potential ancestor node\n * @param descendant - The potential descendant node\n * @param allowEqual - If true, returns true when ancestor === descendant\n * @returns true if ancestor is an ancestor of descendant (or equal if allowEqual is true)\n */\nexport function isAncestor<TNode extends { readonly parent?: TNode }>(\n\tancestor: TNode,\n\tdescendant: TNode,\n\tallowEqual: boolean,\n): boolean {\n\tif (allowEqual && ancestor === descendant) {\n\t\treturn true;\n\t}\n\n\tlet current = descendant.parent;\n\twhile (current !== undefined) {\n\t\tif (current === ancestor) {\n\t\t\treturn true;\n\t\t}\n\t\tcurrent = current.parent;\n\t}\n\n\treturn false;\n}\n"]}
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { type Static } from "@sinclair/typebox";
6
6
  import { type Brand } from "../../util/index.js";
7
- export declare const version: 1;
8
7
  /**
9
8
  * Key (aka Name or Label) for a field which is scoped to a specific TreeNodeStoredSchema.
10
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"formatV1.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAG1E,OAAO,EAAE,KAAK,KAAK,EAAqB,MAAM,qBAAqB,CAAC;AAEpE,eAAO,MAAM,OAAO,GAAa,CAAC;AAElC;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,cAAc,+CAAgC,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,KAAK,CAC1E,KAAK,EACL,+BAA+B,CAC/B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;AAC5E,eAAO,MAAM,yBAAyB,0DAA2C,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,8BAA8B,uEAAgD,CAAC;AAS5F,eAAO,MAAM,iBAAiB;;;EAA6D,CAAC;AAE5F;;GAEG;AACH,oBAAY,oBAAoB;IAC/B,MAAM,IAAA;IACN,MAAM,IAAA;IACN,OAAO,IAAA;IACP,WAAW,IAAA;IACX,IAAI,IAAA;CACJ;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;IAEnC;;OAEG;;;;;IAEH;;OAEG;;;;;IAEH;;OAEG;;EAIJ,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE/E,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
1
+ {"version":3,"file":"formatV1.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAG1E,OAAO,EAAE,KAAK,KAAK,EAAqB,MAAM,qBAAqB,CAAC;AAEpE;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,cAAc,+CAAgC,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,KAAK,CAC1E,KAAK,EACL,+BAA+B,CAC/B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;AAC5E,eAAO,MAAM,yBAAyB,0DAA2C,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,8BAA8B,uEAAgD,CAAC;AAS5F,eAAO,MAAM,iBAAiB;;;EAA6D,CAAC;AAE5F;;GAEG;AACH,oBAAY,oBAAoB;IAC/B,MAAM,IAAA;IACN,MAAM,IAAA;IACN,OAAO,IAAA;IACP,WAAW,IAAA;IACX,IAAI,IAAA;CACJ;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;IAEnC;;OAEG;;;;;IAEH;;OAEG;;;;;IAEH;;OAEG;;EAIJ,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE/E,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -4,11 +4,10 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.TreeNodeSchemaDataFormat = exports.PersistedValueSchema = exports.FieldSchemaFormat = exports.TreeNodeSchemaIdentifierSchema = exports.FieldKindIdentifierSchema = exports.FieldKeySchema = exports.version = void 0;
7
+ exports.TreeNodeSchemaDataFormat = exports.PersistedValueSchema = exports.FieldSchemaFormat = exports.TreeNodeSchemaIdentifierSchema = exports.FieldKindIdentifierSchema = exports.FieldKeySchema = void 0;
8
8
  const typebox_1 = require("@sinclair/typebox");
9
9
  const index_js_1 = require("../../codec/index.js");
10
10
  const index_js_2 = require("../../util/index.js");
11
- exports.version = 1;
12
11
  /**
13
12
  * TypeBox Schema for encoding {@link FieldKey} in persisted data.
14
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"formatV1.js","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA0E;AAE1E,mDAAoD;AACpD,kDAAoE;AAEvD,QAAA,OAAO,GAAG,CAAU,CAAC;AASlC;;GAEG;AACU,QAAA,cAAc,GAAG,IAAA,4BAAiB,GAAY,CAAC;AAoB/C,QAAA,yBAAyB,GAAG,IAAA,4BAAiB,GAAuB,CAAC;AAElF;;GAEG;AACU,QAAA,8BAA8B,GAAG,IAAA,4BAAiB,GAA4B,CAAC;AAE5F,MAAM,qBAAqB,GAAG,cAAI,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,iCAAyB;IAC/B,KAAK,EAAE,cAAI,CAAC,KAAK,CAAC,sCAA8B,CAAC;CACjD,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAE5D,QAAA,iBAAiB,GAAG,cAAI,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAE5F;;GAEG;AACH,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC/B,mEAAM,CAAA;IACN,mEAAM,CAAA;IACN,qEAAO,CAAA;IACP,6EAAW,CAAA;IACX,+DAAI,CAAA;AACL,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B;AAED;;;;GAIG;AACU,QAAA,wBAAwB,GAAG,cAAI,CAAC,MAAM,CAClD;IACC;;OAEG;IACH,MAAM,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,cAAI,CAAC,MAAM,EAAE,EAAE,yBAAiB,CAAC,CAAC;IACpE;;OAEG;IACH,GAAG,EAAE,cAAI,CAAC,QAAQ,CAAC,yBAAiB,CAAC;IACrC;;OAEG;IACH,IAAI,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;CACpD,EACD,uBAAY,CACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../codec/index.js\";\nimport { type Brand, brandedStringType } from \"../../util/index.js\";\n\nexport const version = 1 as const;\n\n/**\n * Key (aka Name or Label) for a field which is scoped to a specific TreeNodeStoredSchema.\n *\n * Stable identifier, used when persisting data.\n */\nexport type FieldKey = Brand<string, \"tree.FieldKey\">;\n\n/**\n * TypeBox Schema for encoding {@link FieldKey} in persisted data.\n */\nexport const FieldKeySchema = brandedStringType<FieldKey>();\n\n/**\n * Identifier for a TreeNode schema.\n * Also known as \"Definition\"\n *\n * Stable identifier, used when persisting data.\n */\nexport type TreeNodeSchemaIdentifier<TName extends string = string> = Brand<\n\tTName,\n\t\"tree.TreeNodeSchemaIdentifier\"\n>;\n\n/**\n * Identifier for a FieldKind.\n * Refers to an exact stable policy (ex: specific version of a policy),\n * for how to handle (ex: edit and merge edits to) fields marked with this kind.\n * Persisted in documents as part of stored schema.\n */\nexport type FieldKindIdentifier = Brand<string, \"tree.FieldKindIdentifier\">;\nexport const FieldKindIdentifierSchema = brandedStringType<FieldKindIdentifier>();\n\n/**\n * TypeBox Schema for encoding {@link TreeNodeSchemaIdentifiers} in persisted data.\n */\nexport const TreeNodeSchemaIdentifierSchema = brandedStringType<TreeNodeSchemaIdentifier>();\n\nconst FieldSchemaFormatBase = Type.Object({\n\tkind: FieldKindIdentifierSchema,\n\ttypes: Type.Array(TreeNodeSchemaIdentifierSchema),\n});\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nexport const FieldSchemaFormat = Type.Composite([FieldSchemaFormatBase], noAdditionalProps);\n\n/**\n * Persisted version of {@link ValueSchema}.\n */\nexport enum PersistedValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Discriminated union content of tree node schema.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const TreeNodeSchemaDataFormat = Type.Object(\n\t{\n\t\t/**\n\t\t * Object node union member.\n\t\t */\n\t\tobject: Type.Optional(Type.Record(Type.String(), FieldSchemaFormat)),\n\t\t/**\n\t\t * Map node union member.\n\t\t */\n\t\tmap: Type.Optional(FieldSchemaFormat),\n\t\t/**\n\t\t * Leaf node union member.\n\t\t */\n\t\tleaf: Type.Optional(Type.Enum(PersistedValueSchema)),\n\t},\n\tunionOptions,\n);\n\nexport type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;\n\nexport type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;\n"]}
1
+ {"version":3,"file":"formatV1.js","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA0E;AAE1E,mDAAoD;AACpD,kDAAoE;AASpE;;GAEG;AACU,QAAA,cAAc,GAAG,IAAA,4BAAiB,GAAY,CAAC;AAoB/C,QAAA,yBAAyB,GAAG,IAAA,4BAAiB,GAAuB,CAAC;AAElF;;GAEG;AACU,QAAA,8BAA8B,GAAG,IAAA,4BAAiB,GAA4B,CAAC;AAE5F,MAAM,qBAAqB,GAAG,cAAI,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,iCAAyB;IAC/B,KAAK,EAAE,cAAI,CAAC,KAAK,CAAC,sCAA8B,CAAC;CACjD,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAE5D,QAAA,iBAAiB,GAAG,cAAI,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAE5F;;GAEG;AACH,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC/B,mEAAM,CAAA;IACN,mEAAM,CAAA;IACN,qEAAO,CAAA;IACP,6EAAW,CAAA;IACX,+DAAI,CAAA;AACL,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B;AAED;;;;GAIG;AACU,QAAA,wBAAwB,GAAG,cAAI,CAAC,MAAM,CAClD;IACC;;OAEG;IACH,MAAM,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,cAAI,CAAC,MAAM,EAAE,EAAE,yBAAiB,CAAC,CAAC;IACpE;;OAEG;IACH,GAAG,EAAE,cAAI,CAAC,QAAQ,CAAC,yBAAiB,CAAC;IACrC;;OAEG;IACH,IAAI,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;CACpD,EACD,uBAAY,CACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../codec/index.js\";\nimport { type Brand, brandedStringType } from \"../../util/index.js\";\n\n/**\n * Key (aka Name or Label) for a field which is scoped to a specific TreeNodeStoredSchema.\n *\n * Stable identifier, used when persisting data.\n */\nexport type FieldKey = Brand<string, \"tree.FieldKey\">;\n\n/**\n * TypeBox Schema for encoding {@link FieldKey} in persisted data.\n */\nexport const FieldKeySchema = brandedStringType<FieldKey>();\n\n/**\n * Identifier for a TreeNode schema.\n * Also known as \"Definition\"\n *\n * Stable identifier, used when persisting data.\n */\nexport type TreeNodeSchemaIdentifier<TName extends string = string> = Brand<\n\tTName,\n\t\"tree.TreeNodeSchemaIdentifier\"\n>;\n\n/**\n * Identifier for a FieldKind.\n * Refers to an exact stable policy (ex: specific version of a policy),\n * for how to handle (ex: edit and merge edits to) fields marked with this kind.\n * Persisted in documents as part of stored schema.\n */\nexport type FieldKindIdentifier = Brand<string, \"tree.FieldKindIdentifier\">;\nexport const FieldKindIdentifierSchema = brandedStringType<FieldKindIdentifier>();\n\n/**\n * TypeBox Schema for encoding {@link TreeNodeSchemaIdentifiers} in persisted data.\n */\nexport const TreeNodeSchemaIdentifierSchema = brandedStringType<TreeNodeSchemaIdentifier>();\n\nconst FieldSchemaFormatBase = Type.Object({\n\tkind: FieldKindIdentifierSchema,\n\ttypes: Type.Array(TreeNodeSchemaIdentifierSchema),\n});\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nexport const FieldSchemaFormat = Type.Composite([FieldSchemaFormatBase], noAdditionalProps);\n\n/**\n * Persisted version of {@link ValueSchema}.\n */\nexport enum PersistedValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Discriminated union content of tree node schema.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const TreeNodeSchemaDataFormat = Type.Object(\n\t{\n\t\t/**\n\t\t * Object node union member.\n\t\t */\n\t\tobject: Type.Optional(Type.Record(Type.String(), FieldSchemaFormat)),\n\t\t/**\n\t\t * Map node union member.\n\t\t */\n\t\tmap: Type.Optional(FieldSchemaFormat),\n\t\t/**\n\t\t * Leaf node union member.\n\t\t */\n\t\tleaf: Type.Optional(Type.Enum(PersistedValueSchema)),\n\t},\n\tunionOptions,\n);\n\nexport type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;\n\nexport type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { type TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, type TreeTypeSet, type FieldKindData, type TreeStoredSchema, forbiddenFieldKindIdentifier, identifierFieldKindIdentifier, storedEmptyFieldSchema, type StoredSchemaCollection, LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema, decodeFieldSchema, encodeFieldSchema, storedSchemaDecodeDispatcher, type SchemaAndPolicy, type SchemaPolicy, } from "./schema.js";
5
+ export { type TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, type TreeTypeSet, type FieldKindData, type TreeStoredSchema, forbiddenFieldKindIdentifier, identifierFieldKindIdentifier, storedEmptyFieldSchema, type StoredSchemaCollection, LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema, decodeFieldSchema, encodeFieldSchema, storedSchemaDecodeDispatcher, type SchemaAndPolicy, type SchemaPolicy, SchemaVersion, } from "./schema.js";
6
6
  export { type TreeStoredSchemaSubscription, type MutableTreeStoredSchema, TreeStoredSchemaRepository, schemaDataIsEmpty, type SchemaEvents, } from "./storedSchemaRepository.js";
7
7
  export { Multiplicity } from "./multiplicity.js";
8
8
  export type { TreeNodeSchemaIdentifier, FieldKey, FieldKindIdentifier } from "./formatV1.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,qBAAqB,EAC1B,WAAW,EACX,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,4BAA4B,EAC5B,6BAA6B,EAC7B,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,EAC5B,KAAK,eAAe,EACpB,KAAK,YAAY,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,0BAA0B,EAC1B,iBAAiB,EACjB,KAAK,YAAY,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,YAAY,EAAE,wBAAwB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE7F,OAAO,KAAK,cAAc,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,qBAAqB,EAC1B,WAAW,EACX,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,4BAA4B,EAC5B,6BAA6B,EAC7B,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,EAC5B,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,aAAa,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,0BAA0B,EAC1B,iBAAiB,EACjB,KAAK,YAAY,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,YAAY,EAAE,wBAAwB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE7F,OAAO,KAAK,cAAc,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  return result;
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.schemaFormatV1 = exports.Multiplicity = exports.schemaDataIsEmpty = exports.TreeStoredSchemaRepository = exports.storedSchemaDecodeDispatcher = exports.encodeFieldSchema = exports.decodeFieldSchema = exports.MapNodeStoredSchema = exports.ObjectNodeStoredSchema = exports.LeafNodeStoredSchema = exports.storedEmptyFieldSchema = exports.identifierFieldKindIdentifier = exports.forbiddenFieldKindIdentifier = exports.TreeNodeStoredSchema = exports.ValueSchema = void 0;
30
+ exports.schemaFormatV1 = exports.Multiplicity = exports.schemaDataIsEmpty = exports.TreeStoredSchemaRepository = exports.SchemaVersion = exports.storedSchemaDecodeDispatcher = exports.encodeFieldSchema = exports.decodeFieldSchema = exports.MapNodeStoredSchema = exports.ObjectNodeStoredSchema = exports.LeafNodeStoredSchema = exports.storedEmptyFieldSchema = exports.identifierFieldKindIdentifier = exports.forbiddenFieldKindIdentifier = exports.TreeNodeStoredSchema = exports.ValueSchema = void 0;
31
31
  var schema_js_1 = require("./schema.js");
32
32
  Object.defineProperty(exports, "ValueSchema", { enumerable: true, get: function () { return schema_js_1.ValueSchema; } });
33
33
  Object.defineProperty(exports, "TreeNodeStoredSchema", { enumerable: true, get: function () { return schema_js_1.TreeNodeStoredSchema; } });
@@ -40,6 +40,7 @@ Object.defineProperty(exports, "MapNodeStoredSchema", { enumerable: true, get: f
40
40
  Object.defineProperty(exports, "decodeFieldSchema", { enumerable: true, get: function () { return schema_js_1.decodeFieldSchema; } });
41
41
  Object.defineProperty(exports, "encodeFieldSchema", { enumerable: true, get: function () { return schema_js_1.encodeFieldSchema; } });
42
42
  Object.defineProperty(exports, "storedSchemaDecodeDispatcher", { enumerable: true, get: function () { return schema_js_1.storedSchemaDecodeDispatcher; } });
43
+ Object.defineProperty(exports, "SchemaVersion", { enumerable: true, get: function () { return schema_js_1.SchemaVersion; } });
43
44
  var storedSchemaRepository_js_1 = require("./storedSchemaRepository.js");
44
45
  Object.defineProperty(exports, "TreeStoredSchemaRepository", { enumerable: true, get: function () { return storedSchemaRepository_js_1.TreeStoredSchemaRepository; } });
45
46
  Object.defineProperty(exports, "schemaDataIsEmpty", { enumerable: true, get: function () { return storedSchemaRepository_js_1.schemaDataIsEmpty; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/schema-stored/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yCAmBqB;AAjBpB,wGAAA,WAAW,OAAA;AACX,iHAAA,oBAAoB,OAAA;AAIpB,yHAAA,4BAA4B,OAAA;AAC5B,0HAAA,6BAA6B,OAAA;AAC7B,mHAAA,sBAAsB,OAAA;AAEtB,iHAAA,oBAAoB,OAAA;AACpB,mHAAA,sBAAsB,OAAA;AACtB,gHAAA,mBAAmB,OAAA;AACnB,8GAAA,iBAAiB,OAAA;AACjB,8GAAA,iBAAiB,OAAA;AACjB,yHAAA,4BAA4B,OAAA;AAI7B,yEAMqC;AAHpC,uIAAA,0BAA0B,OAAA;AAC1B,8HAAA,iBAAiB,OAAA;AAGlB,qDAAiD;AAAxC,+GAAA,YAAY,OAAA;AAIrB,8DAAgD;AACvC,wCAAc","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype TreeTypeSet,\n\ttype FieldKindData,\n\ttype TreeStoredSchema,\n\tforbiddenFieldKindIdentifier,\n\tidentifierFieldKindIdentifier,\n\tstoredEmptyFieldSchema,\n\ttype StoredSchemaCollection,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchema,\n\tstoredSchemaDecodeDispatcher,\n\ttype SchemaAndPolicy,\n\ttype SchemaPolicy,\n} from \"./schema.js\";\nexport {\n\ttype TreeStoredSchemaSubscription,\n\ttype MutableTreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tschemaDataIsEmpty,\n\ttype SchemaEvents,\n} from \"./storedSchemaRepository.js\";\nexport { Multiplicity } from \"./multiplicity.js\";\n\nexport type { TreeNodeSchemaIdentifier, FieldKey, FieldKindIdentifier } from \"./formatV1.js\";\n\nimport * as schemaFormatV1 from \"./formatV1.js\";\nexport { schemaFormatV1 };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/schema-stored/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yCAoBqB;AAlBpB,wGAAA,WAAW,OAAA;AACX,iHAAA,oBAAoB,OAAA;AAIpB,yHAAA,4BAA4B,OAAA;AAC5B,0HAAA,6BAA6B,OAAA;AAC7B,mHAAA,sBAAsB,OAAA;AAEtB,iHAAA,oBAAoB,OAAA;AACpB,mHAAA,sBAAsB,OAAA;AACtB,gHAAA,mBAAmB,OAAA;AACnB,8GAAA,iBAAiB,OAAA;AACjB,8GAAA,iBAAiB,OAAA;AACjB,yHAAA,4BAA4B,OAAA;AAG5B,0GAAA,aAAa,OAAA;AAEd,yEAMqC;AAHpC,uIAAA,0BAA0B,OAAA;AAC1B,8HAAA,iBAAiB,OAAA;AAGlB,qDAAiD;AAAxC,+GAAA,YAAY,OAAA;AAIrB,8DAAgD;AACvC,wCAAc","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype TreeTypeSet,\n\ttype FieldKindData,\n\ttype TreeStoredSchema,\n\tforbiddenFieldKindIdentifier,\n\tidentifierFieldKindIdentifier,\n\tstoredEmptyFieldSchema,\n\ttype StoredSchemaCollection,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchema,\n\tstoredSchemaDecodeDispatcher,\n\ttype SchemaAndPolicy,\n\ttype SchemaPolicy,\n\tSchemaVersion,\n} from \"./schema.js\";\nexport {\n\ttype TreeStoredSchemaSubscription,\n\ttype MutableTreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tschemaDataIsEmpty,\n\ttype SchemaEvents,\n} from \"./storedSchemaRepository.js\";\nexport { Multiplicity } from \"./multiplicity.js\";\n\nexport type { TreeNodeSchemaIdentifier, FieldKey, FieldKindIdentifier } from \"./formatV1.js\";\n\nimport * as schemaFormatV1 from \"./formatV1.js\";\nexport { schemaFormatV1 };\n"]}
@@ -6,6 +6,12 @@ import { DiscriminatedUnionDispatcher } from "../../codec/index.js";
6
6
  import { type MakeNominal } from "../../util/index.js";
7
7
  import { type FieldKey, type FieldKindIdentifier, type FieldSchemaFormat, type TreeNodeSchemaDataFormat, type TreeNodeSchemaIdentifier } from "./formatV1.js";
8
8
  import type { Multiplicity } from "./multiplicity.js";
9
+ /**
10
+ * The format version for the schema.
11
+ */
12
+ export declare enum SchemaVersion {
13
+ v1 = 1
14
+ }
9
15
  /**
10
16
  * Schema for what {@link TreeLeafValue} is allowed on a Leaf node.
11
17
  * @privateRemarks
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,KAAK,WAAW,EAAoB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EAEtB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;;;;;;GAQG;AACH,oBAAY,WAAW;IACtB,MAAM,IAAA;IACN,MAAM,IAAA;IACN,OAAO,IAAA;IACP,WAAW,IAAA;IACX,IAAI,IAAA;CACJ;AAED;;;;;;;;;;;;;;;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AM,EAAE,iBAAiB,GAAG,qBAAqB,CAOlF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;IAC/D;;OAEG;IACH,QAAQ,CAAC,eAAe,EAAE,qBAAqB,CAAC;CAChD;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAAC;CACjF"}
@@ -4,11 +4,18 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.decodeFieldSchema = exports.encodeFieldSchema = exports.storedSchemaDecodeDispatcher = exports.LeafNodeStoredSchema = exports.MapNodeStoredSchema = exports.ObjectNodeStoredSchema = exports.TreeNodeStoredSchema = exports.identifierFieldKindIdentifier = exports.storedEmptyFieldSchema = exports.forbiddenFieldKindIdentifier = exports.ValueSchema = void 0;
7
+ exports.decodeFieldSchema = exports.encodeFieldSchema = exports.storedSchemaDecodeDispatcher = exports.LeafNodeStoredSchema = exports.MapNodeStoredSchema = exports.ObjectNodeStoredSchema = exports.TreeNodeStoredSchema = exports.identifierFieldKindIdentifier = exports.storedEmptyFieldSchema = exports.forbiddenFieldKindIdentifier = exports.ValueSchema = exports.SchemaVersion = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../../codec/index.js");
10
10
  const index_js_2 = require("../../util/index.js");
11
11
  const formatV1_js_1 = require("./formatV1.js");
12
+ /**
13
+ * The format version for the schema.
14
+ */
15
+ var SchemaVersion;
16
+ (function (SchemaVersion) {
17
+ SchemaVersion[SchemaVersion["v1"] = 1] = "v1";
18
+ })(SchemaVersion || (exports.SchemaVersion = SchemaVersion = {}));
12
19
  /**
13
20
  * Schema for what {@link TreeLeafValue} is allowed on a Leaf node.
14
21
  * @privateRemarks
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"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AAK,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;KAC/B,CAAC;AACH,CAAC;AAND,8CAMC;AAED,SAAgB,iBAAiB,CAAC,MAAyB;IAC1D,MAAM,GAAG,GAA0B;QAClC,kFAAkF;QAClF,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;KAC5B,CAAC;IACF,OAAO,GAAG,CAAC;AACZ,CAAC;AAPD,8CAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport { DiscriminatedUnionDispatcher } from \"../../codec/index.js\";\nimport { type MakeNominal, brand, invertMap } from \"../../util/index.js\";\nimport {\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype FieldSchemaFormat,\n\tPersistedValueSchema,\n\ttype TreeNodeSchemaDataFormat,\n\ttype TreeNodeSchemaIdentifier,\n} from \"./formatV1.js\";\nimport type { Multiplicity } from \"./multiplicity.js\";\n\n/**\n * Schema for what {@link TreeLeafValue} is allowed on a Leaf node.\n * @privateRemarks\n * See also {@link TreeValue}.\n * If further stabilizing this,\n * consider the implications of how this might prevent adding of new leaf types in the future.\n * Maybe add a disclaimer that it might be extended like on {@link NodeKind}?\n * @alpha\n */\nexport enum ValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Set of allowed tree types.\n * Providing multiple values here allows polymorphism, tagged union style.\n *\n * In the future, this could be extended to allow inlining a TreeNodeStoredSchema here\n * (or some similar structural schema system).\n * For structural types which could go here, there are a few interesting options:\n *\n * - Allow replacing the whole set with a structural type for terminal / non-tree data,\n * and use this as a replacement for values on the tree nodes.\n *\n * - Allow expression structural constraints for child trees, for example requiring specific traits\n * (ex: via TreeNodeStoredSchema), instead of by type.\n *\n * There are two ways this could work:\n *\n * - Constrain the child nodes based on their shape:\n * this makes schema safe editing difficult because nodes would incur extra editing constraints to prevent them\n * from going out of schema based on their location in such a field.\n *\n * - Constrain the types allowed based on which types guarantee their data will always meet the constraints.\n *\n * Care would need to be taken to make sure this is sound for the schema updating mechanisms.\n */\nexport type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier>;\n\n/**\n * Declarative portion of a Field Kind.\n *\n * @remarks\n * Enough info about a field kind to know if a given tree is is schema.\n */\nexport interface FieldKindData {\n\treadonly identifier: FieldKindIdentifier;\n\treadonly multiplicity: Multiplicity;\n}\n\n/**\n * Everything needed to define what it means for a tree to be in schema.\n */\nexport interface SchemaAndPolicy {\n\treadonly schema: StoredSchemaCollection;\n\treadonly policy: SchemaPolicy;\n}\n\n/**\n * Extra data needed to interpret schema.\n */\nexport interface SchemaPolicy {\n\t/**\n\t * Policy information about FieldKinds:\n\t * This is typically stored as code, not in documents, and defines how to handle fields based on their kind.\n\t * It is assumed that all users of a document will have exactly the same FieldKind policies,\n\t * though older applications might be missing some,\n\t * and will be unable to process any changes that use those FieldKinds.\n\t */\n\treadonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindData>;\n\n\t/**\n\t * If true, new content inserted into the tree should be validated against the stored schema.\n\t */\n\treadonly validateSchema: boolean;\n\n\t/**\n\t * Whether to allow a document to be opened when a particular stored schema (identified by `identifier`)\n\t * contains optional fields that are not known to the view schema.\n\t *\n\t * @privateRemarks\n\t * Plumbing this in via `SchemaPolicy` avoids needing to walk the view schema representation repeatedly in places\n\t * that need it (schema validation, view vs stored compatibility checks).\n\t */\n\tallowUnknownOptionalFields(identifier: TreeNodeSchemaIdentifier): boolean;\n}\n\n/**\n * Schema for a field.\n * Object implementing this interface should never be modified.\n */\nexport interface TreeFieldStoredSchema {\n\treadonly kind: FieldKindIdentifier;\n\n\t/**\n\t * The set of allowed child types.\n\t * If not specified, types are unconstrained.\n\t */\n\treadonly types: TreeTypeSet;\n}\n\n/**\n * Identifier used for the FieldKind for fields which must be empty.\n *\n * @remarks\n * This mainly show up in:\n *\n * 1. The root default field for documents.\n *\n * 2. The schema used for out of schema fields (which thus must be empty/not exist) on object and leaf nodes.\n */\nexport const forbiddenFieldKindIdentifier = \"Forbidden\";\n\n/**\n * A schema for empty fields (fields which must always be empty).\n * There are multiple ways this could be encoded, but this is the most explicit.\n */\nexport const storedEmptyFieldSchema: TreeFieldStoredSchema = {\n\t// This kind requires the field to be empty.\n\tkind: brand(forbiddenFieldKindIdentifier),\n\t// This type set also forces the field to be empty not not allowing any types as all.\n\ttypes: new Set(),\n};\n\n/**\n * Identifier used for the FieldKind for fields of type identifier.\n */\nexport const identifierFieldKindIdentifier = \"Identifier\";\n\n/**\n */\nexport abstract class TreeNodeStoredSchema {\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * @privateRemarks\n\t * Returns TreeNodeSchemaDataFormat.\n\t * This is uses an opaque type to avoid leaking these types out of the package,\n\t * and is runtime validated by the codec.\n\t */\n\tpublic abstract encode(): TreeNodeSchemaDataFormat;\n\n\t/**\n\t * Returns the schema for the provided field.\n\t */\n\tpublic abstract getFieldSchema(field: FieldKey): TreeFieldStoredSchema;\n}\n\n/**\n */\nexport class ObjectNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param objectNodeFields -\n\t * Schema for fields with keys scoped to this TreeNodeStoredSchema.\n\t * This refers to the TreeFieldStoredSchema directly\n\t * (as opposed to just supporting FieldSchemaIdentifier and having a central FieldKey -\\> TreeFieldStoredSchema map).\n\t * This allows us short friendly field keys which can be ergonomically used as field names in code.\n\t * It also interoperates well with mapFields being used as a map with arbitrary data as keys.\n\t */\n\tpublic constructor(\n\t\tpublic readonly objectNodeFields: ReadonlyMap<FieldKey, TreeFieldStoredSchema>,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): TreeNodeSchemaDataFormat {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> = Object.create(null);\n\t\t// Sort fields to ensure output is identical for for equivalent schema (since field order is not considered significant).\n\t\t// This makes comparing schema easier, and ensures chunk reuse for schema summaries isn't needlessly broken.\n\t\tfor (const key of [...this.objectNodeFields.keys()].sort()) {\n\t\t\tObject.defineProperty(fieldsObject, key, {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: encodeFieldSchema(\n\t\t\t\t\tthis.objectNodeFields.get(key) ?? fail(0xae7 /* missing field */),\n\t\t\t\t),\n\t\t\t});\n\t\t}\n\t\treturn {\n\t\t\tobject: fieldsObject,\n\t\t};\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.objectNodeFields.get(field) ?? storedEmptyFieldSchema;\n\t}\n}\n\n/**\n */\nexport class MapNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param mapFields -\n\t * Allows using the fields as a map, with the keys being\n\t * FieldKeys and the values being constrained by this TreeFieldStoredSchema.\n\t * Usually `FieldKind.Value` should NOT be used here\n\t * since no nodes can ever be in schema if you use `FieldKind.Value` here\n\t * (that would require infinite children).\n\t */\n\tpublic constructor(public readonly mapFields: TreeFieldStoredSchema) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): TreeNodeSchemaDataFormat {\n\t\treturn {\n\t\t\tmap: encodeFieldSchema(this.mapFields),\n\t\t};\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.mapFields;\n\t}\n}\n\n/**\n */\nexport class LeafNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param leafValue -\n\t * There are several approaches for how to store actual data in the tree\n\t * (special node types, special field contents, data on nodes etc.)\n\t * as well as several options about how the data should be modeled at this level\n\t * (byte sequence? javascript type? json?),\n\t * as well as options for how much of this would be exposed in the schema language\n\t * (ex: would all nodes with values be special built-ins, or could any schema add them?)\n\t * A simple easy to do in javascript approach is taken here:\n\t * this is not intended to be a suggestion of what approach to take, or what to expose in the schema language.\n\t * This is simply one approach that can work for modeling them in the internal schema representation.\n\t */\n\tpublic constructor(public readonly leafValue: ValueSchema) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): TreeNodeSchemaDataFormat {\n\t\treturn {\n\t\t\tleaf: encodeValueSchema(this.leafValue),\n\t\t};\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn storedEmptyFieldSchema;\n\t}\n}\n\nexport const storedSchemaDecodeDispatcher: DiscriminatedUnionDispatcher<\n\tTreeNodeSchemaDataFormat,\n\t[],\n\tTreeNodeStoredSchema\n> = new DiscriminatedUnionDispatcher({\n\tleaf: (data: PersistedValueSchema) => new LeafNodeStoredSchema(decodeValueSchema(data)),\n\tobject: (\n\t\tdata: Record<TreeNodeSchemaIdentifier, FieldSchemaFormat>,\n\t): TreeNodeStoredSchema => {\n\t\tconst map = new Map();\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tmap.set(key, decodeFieldSchema(value));\n\t\t}\n\t\treturn new ObjectNodeStoredSchema(map);\n\t},\n\tmap: (data: FieldSchemaFormat) => new MapNodeStoredSchema(decodeFieldSchema(data)),\n});\n\nconst valueSchemaEncode = new Map([\n\t[ValueSchema.Number, PersistedValueSchema.Number],\n\t[ValueSchema.String, PersistedValueSchema.String],\n\t[ValueSchema.Boolean, PersistedValueSchema.Boolean],\n\t[ValueSchema.FluidHandle, PersistedValueSchema.FluidHandle],\n\t[ValueSchema.Null, PersistedValueSchema.Null],\n]);\n\nconst valueSchemaDecode = invertMap(valueSchemaEncode);\n\nfunction encodeValueSchema(inMemory: ValueSchema): PersistedValueSchema {\n\treturn valueSchemaEncode.get(inMemory) ?? fail(0xae8 /* missing PersistedValueSchema */);\n}\n\nfunction decodeValueSchema(inMemory: PersistedValueSchema): ValueSchema {\n\treturn valueSchemaDecode.get(inMemory) ?? fail(0xae9 /* missing ValueSchema */);\n}\n\nexport function encodeFieldSchema(schema: TreeFieldStoredSchema): FieldSchemaFormat {\n\treturn {\n\t\tkind: schema.kind,\n\t\t// Types are sorted by identifier to improve stability of persisted data to increase chance of schema blob reuse.\n\t\ttypes: [...schema.types].sort(),\n\t};\n}\n\nexport function decodeFieldSchema(schema: FieldSchemaFormat): TreeFieldStoredSchema {\n\tconst out: TreeFieldStoredSchema = {\n\t\t// TODO: maybe provide actual FieldKind objects here, error on unrecognized kinds.\n\t\tkind: schema.kind,\n\t\ttypes: new Set(schema.types),\n\t};\n\treturn out;\n}\n\n/**\n * Document schema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hand onto a specific version, make a copy.\n */\nexport interface TreeStoredSchema extends StoredSchemaCollection {\n\t/**\n\t * Schema for the root field which contains the whole tree.\n\t */\n\treadonly rootFieldSchema: TreeFieldStoredSchema;\n}\n\n/**\n * Collection of TreeNodeSchema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hang onto a specific version, make a copy.\n */\nexport interface StoredSchemaCollection {\n\t/**\n\t * {@inheritdoc StoredSchemaCollection}\n\t */\n\treadonly nodeSchema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;\n}\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAE3D,mDAAoE;AACpE,kDAAyE;AAEzE,+CAOuB;AAGvB;;GAEG;AACH,IAAY,aAEX;AAFD,WAAY,aAAa;IACxB,6CAAM,CAAA;AACP,CAAC,EAFW,aAAa,6BAAb,aAAa,QAExB;AAED;;;;;;;;GAQG;AACH,IAAY,WAMX;AAND,WAAY,WAAW;IACtB,iDAAM,CAAA;IACN,iDAAM,CAAA;IACN,mDAAO,CAAA;IACP,2DAAW,CAAA;IACX,6CAAI,CAAA;AACL,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AA0FD;;;;;;;;;GASG;AACU,QAAA,4BA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*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport { DiscriminatedUnionDispatcher } from \"../../codec/index.js\";\nimport { type MakeNominal, brand, invertMap } from \"../../util/index.js\";\n\nimport {\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype FieldSchemaFormat,\n\tPersistedValueSchema,\n\ttype TreeNodeSchemaDataFormat,\n\ttype TreeNodeSchemaIdentifier,\n} from \"./formatV1.js\";\nimport type { Multiplicity } from \"./multiplicity.js\";\n\n/**\n * The format version for the schema.\n */\nexport enum SchemaVersion {\n\tv1 = 1,\n}\n\n/**\n * Schema for what {@link TreeLeafValue} is allowed on a Leaf node.\n * @privateRemarks\n * See also {@link TreeValue}.\n * If further stabilizing this,\n * consider the implications of how this might prevent adding of new leaf types in the future.\n * Maybe add a disclaimer that it might be extended like on {@link NodeKind}?\n * @alpha\n */\nexport enum ValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Set of allowed tree types.\n * Providing multiple values here allows polymorphism, tagged union style.\n *\n * In the future, this could be extended to allow inlining a TreeNodeStoredSchema here\n * (or some similar structural schema system).\n * For structural types which could go here, there are a few interesting options:\n *\n * - Allow replacing the whole set with a structural type for terminal / non-tree data,\n * and use this as a replacement for values on the tree nodes.\n *\n * - Allow expression structural constraints for child trees, for example requiring specific traits\n * (ex: via TreeNodeStoredSchema), instead of by type.\n *\n * There are two ways this could work:\n *\n * - Constrain the child nodes based on their shape:\n * this makes schema safe editing difficult because nodes would incur extra editing constraints to prevent them\n * from going out of schema based on their location in such a field.\n *\n * - Constrain the types allowed based on which types guarantee their data will always meet the constraints.\n *\n * Care would need to be taken to make sure this is sound for the schema updating mechanisms.\n */\nexport type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier>;\n\n/**\n * Declarative portion of a Field Kind.\n *\n * @remarks\n * Enough info about a field kind to know if a given tree is is schema.\n */\nexport interface FieldKindData {\n\treadonly identifier: FieldKindIdentifier;\n\treadonly multiplicity: Multiplicity;\n}\n\n/**\n * Everything needed to define what it means for a tree to be in schema.\n */\nexport interface SchemaAndPolicy {\n\treadonly schema: StoredSchemaCollection;\n\treadonly policy: SchemaPolicy;\n}\n\n/**\n * Extra data needed to interpret schema.\n */\nexport interface SchemaPolicy {\n\t/**\n\t * Policy information about FieldKinds:\n\t * This is typically stored as code, not in documents, and defines how to handle fields based on their kind.\n\t * It is assumed that all users of a document will have exactly the same FieldKind policies,\n\t * though older applications might be missing some,\n\t * and will be unable to process any changes that use those FieldKinds.\n\t */\n\treadonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindData>;\n\n\t/**\n\t * If true, new content inserted into the tree should be validated against the stored schema.\n\t */\n\treadonly validateSchema: boolean;\n\n\t/**\n\t * Whether to allow a document to be opened when a particular stored schema (identified by `identifier`)\n\t * contains optional fields that are not known to the view schema.\n\t *\n\t * @privateRemarks\n\t * Plumbing this in via `SchemaPolicy` avoids needing to walk the view schema representation repeatedly in places\n\t * that need it (schema validation, view vs stored compatibility checks).\n\t */\n\tallowUnknownOptionalFields(identifier: TreeNodeSchemaIdentifier): boolean;\n}\n\n/**\n * Schema for a field.\n * Object implementing this interface should never be modified.\n */\nexport interface TreeFieldStoredSchema {\n\treadonly kind: FieldKindIdentifier;\n\n\t/**\n\t * The set of allowed child types.\n\t * If not specified, types are unconstrained.\n\t */\n\treadonly types: TreeTypeSet;\n}\n\n/**\n * Identifier used for the FieldKind for fields which must be empty.\n *\n * @remarks\n * This mainly show up in:\n *\n * 1. The root default field for documents.\n *\n * 2. The schema used for out of schema fields (which thus must be empty/not exist) on object and leaf nodes.\n */\nexport const forbiddenFieldKindIdentifier = \"Forbidden\";\n\n/**\n * A schema for empty fields (fields which must always be empty).\n * There are multiple ways this could be encoded, but this is the most explicit.\n */\nexport const storedEmptyFieldSchema: TreeFieldStoredSchema = {\n\t// This kind requires the field to be empty.\n\tkind: brand(forbiddenFieldKindIdentifier),\n\t// This type set also forces the field to be empty not not allowing any types as all.\n\ttypes: new Set(),\n};\n\n/**\n * Identifier used for the FieldKind for fields of type identifier.\n */\nexport const identifierFieldKindIdentifier = \"Identifier\";\n\n/**\n */\nexport abstract class TreeNodeStoredSchema {\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * @privateRemarks\n\t * Returns TreeNodeSchemaDataFormat.\n\t * This is uses an opaque type to avoid leaking these types out of the package,\n\t * and is runtime validated by the codec.\n\t */\n\tpublic abstract encode(): TreeNodeSchemaDataFormat;\n\n\t/**\n\t * Returns the schema for the provided field.\n\t */\n\tpublic abstract getFieldSchema(field: FieldKey): TreeFieldStoredSchema;\n}\n\n/**\n */\nexport class ObjectNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param objectNodeFields -\n\t * Schema for fields with keys scoped to this TreeNodeStoredSchema.\n\t * This refers to the TreeFieldStoredSchema directly\n\t * (as opposed to just supporting FieldSchemaIdentifier and having a central FieldKey -\\> TreeFieldStoredSchema map).\n\t * This allows us short friendly field keys which can be ergonomically used as field names in code.\n\t * It also interoperates well with mapFields being used as a map with arbitrary data as keys.\n\t */\n\tpublic constructor(\n\t\tpublic readonly objectNodeFields: ReadonlyMap<FieldKey, TreeFieldStoredSchema>,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): TreeNodeSchemaDataFormat {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> = Object.create(null);\n\t\t// Sort fields to ensure output is identical for for equivalent schema (since field order is not considered significant).\n\t\t// This makes comparing schema easier, and ensures chunk reuse for schema summaries isn't needlessly broken.\n\t\tfor (const key of [...this.objectNodeFields.keys()].sort()) {\n\t\t\tObject.defineProperty(fieldsObject, key, {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: encodeFieldSchema(\n\t\t\t\t\tthis.objectNodeFields.get(key) ?? fail(0xae7 /* missing field */),\n\t\t\t\t),\n\t\t\t});\n\t\t}\n\t\treturn {\n\t\t\tobject: fieldsObject,\n\t\t};\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.objectNodeFields.get(field) ?? storedEmptyFieldSchema;\n\t}\n}\n\n/**\n */\nexport class MapNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param mapFields -\n\t * Allows using the fields as a map, with the keys being\n\t * FieldKeys and the values being constrained by this TreeFieldStoredSchema.\n\t * Usually `FieldKind.Value` should NOT be used here\n\t * since no nodes can ever be in schema if you use `FieldKind.Value` here\n\t * (that would require infinite children).\n\t */\n\tpublic constructor(public readonly mapFields: TreeFieldStoredSchema) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): TreeNodeSchemaDataFormat {\n\t\treturn {\n\t\t\tmap: encodeFieldSchema(this.mapFields),\n\t\t};\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.mapFields;\n\t}\n}\n\n/**\n */\nexport class LeafNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param leafValue -\n\t * There are several approaches for how to store actual data in the tree\n\t * (special node types, special field contents, data on nodes etc.)\n\t * as well as several options about how the data should be modeled at this level\n\t * (byte sequence? javascript type? json?),\n\t * as well as options for how much of this would be exposed in the schema language\n\t * (ex: would all nodes with values be special built-ins, or could any schema add them?)\n\t * A simple easy to do in javascript approach is taken here:\n\t * this is not intended to be a suggestion of what approach to take, or what to expose in the schema language.\n\t * This is simply one approach that can work for modeling them in the internal schema representation.\n\t */\n\tpublic constructor(public readonly leafValue: ValueSchema) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): TreeNodeSchemaDataFormat {\n\t\treturn {\n\t\t\tleaf: encodeValueSchema(this.leafValue),\n\t\t};\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn storedEmptyFieldSchema;\n\t}\n}\n\nexport const storedSchemaDecodeDispatcher: DiscriminatedUnionDispatcher<\n\tTreeNodeSchemaDataFormat,\n\t[],\n\tTreeNodeStoredSchema\n> = new DiscriminatedUnionDispatcher({\n\tleaf: (data: PersistedValueSchema) => new LeafNodeStoredSchema(decodeValueSchema(data)),\n\tobject: (\n\t\tdata: Record<TreeNodeSchemaIdentifier, FieldSchemaFormat>,\n\t): TreeNodeStoredSchema => {\n\t\tconst map = new Map();\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tmap.set(key, decodeFieldSchema(value));\n\t\t}\n\t\treturn new ObjectNodeStoredSchema(map);\n\t},\n\tmap: (data: FieldSchemaFormat) => new MapNodeStoredSchema(decodeFieldSchema(data)),\n});\n\nconst valueSchemaEncode = new Map([\n\t[ValueSchema.Number, PersistedValueSchema.Number],\n\t[ValueSchema.String, PersistedValueSchema.String],\n\t[ValueSchema.Boolean, PersistedValueSchema.Boolean],\n\t[ValueSchema.FluidHandle, PersistedValueSchema.FluidHandle],\n\t[ValueSchema.Null, PersistedValueSchema.Null],\n]);\n\nconst valueSchemaDecode = invertMap(valueSchemaEncode);\n\nfunction encodeValueSchema(inMemory: ValueSchema): PersistedValueSchema {\n\treturn valueSchemaEncode.get(inMemory) ?? fail(0xae8 /* missing PersistedValueSchema */);\n}\n\nfunction decodeValueSchema(inMemory: PersistedValueSchema): ValueSchema {\n\treturn valueSchemaDecode.get(inMemory) ?? fail(0xae9 /* missing ValueSchema */);\n}\n\nexport function encodeFieldSchema(schema: TreeFieldStoredSchema): FieldSchemaFormat {\n\treturn {\n\t\tkind: schema.kind,\n\t\t// Types are sorted by identifier to improve stability of persisted data to increase chance of schema blob reuse.\n\t\ttypes: [...schema.types].sort(),\n\t};\n}\n\nexport function decodeFieldSchema(schema: FieldSchemaFormat): TreeFieldStoredSchema {\n\tconst out: TreeFieldStoredSchema = {\n\t\t// TODO: maybe provide actual FieldKind objects here, error on unrecognized kinds.\n\t\tkind: schema.kind,\n\t\ttypes: new Set(schema.types),\n\t};\n\treturn out;\n}\n\n/**\n * Document schema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hand onto a specific version, make a copy.\n */\nexport interface TreeStoredSchema extends StoredSchemaCollection {\n\t/**\n\t * Schema for the root field which contains the whole tree.\n\t */\n\treadonly rootFieldSchema: TreeFieldStoredSchema;\n}\n\n/**\n * Collection of TreeNodeSchema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hang onto a specific version, make a copy.\n */\nexport interface StoredSchemaCollection {\n\t/**\n\t * {@inheritdoc StoredSchemaCollection}\n\t */\n\treadonly nodeSchema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;\n}\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { BTree } from "@tylerbu/sorted-btree-es6";
6
5
  import type { Listenable } from "@fluidframework/core-interfaces/internal";
6
+ import { BTree } from "@tylerbu/sorted-btree-es6";
7
7
  import type { TreeNodeSchemaIdentifier } from "./formatV1.js";
8
8
  import { type TreeFieldStoredSchema, type TreeNodeStoredSchema, type TreeStoredSchema } from "./schema.js";
9
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"storedSchemaRepository.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/storedSchemaRepository.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAI3E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAEN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAErB,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,k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ineProperty(exports, "__esModule", { value: true });
7
7
  exports.schemaDataIsEmpty = exports.TreeStoredSchemaRepository = void 0;
8
- const sorted_btree_es6_1 = require("@tylerbu/sorted-btree-es6");
9
8
  const client_utils_1 = require("@fluid-internal/client-utils");
9
+ const sorted_btree_es6_1 = require("@tylerbu/sorted-btree-es6");
10
10
  const index_js_1 = require("../../util/index.js");
11
11
  const schema_js_1 = require("./schema.js");
12
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"storedSchemaRepository.js","sourceRoot":"","sources":["../../../src/core/schema-stored/storedSchemaRepository.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,gEAAkD;AAGlD,+DAA6D;AAC7D,kDAAqD;AAGrD,2CAMqB;AAyCrB;;GAEG;AACH,MAAa,0BAA0B;IAMtC;;;;;;;;;;;;OAYG;IACH,YAAmB,IAAuB;QAhBvB,YAAO,GAAG,IAAA,4BAAa,GAAgB,CAAC;QAC3C,WAAM,GAA6B,IAAI,CAAC,OAAO,CAAC;QAgB/D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,CAAC,mBAAmB,GAAG,kCAAsB,CAAC;YAClD,IAAI,CAAC,cAAc,GAAG,IAAI,wBAAK,CAC9B,EAAE,EACF,yBAAc,CACd,CAAC;QACH,CAAC;aAAM,CAAC;YACP,IAAI,IAAI,YAAY,0BAA0B,EAAE,CAAC;gBAChD,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,eAAe,CAAC;gBAChD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;YACnD,CAAC;iBAAM,CAAC;gBACP,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,eAAe,CAAC;gBAChD,IAAI,CAAC,cAAc,GAAG,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC5D,CAAC;QACF,CAAC;IACF,CAAC;IAED,IAAW,UAAU;QACpB,wDAAwD;QACxD,OAAO,IAAI,CAAC,cAGX,CAAC;IACH,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IACjC,CAAC;IAEM,KAAK,CAAC,SAA2B;QACvC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC;QACnD,MAAM,KAAK,GAAG,IAAI,0BAA0B,CAAC,SAAS,CAAC,CAAC;QACxD,wFAAwF;QACxF,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC;QACrD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;QAC3C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;IACnD,CAAC;IAEM,KAAK;QACX,OAAO,IAAI,0BAA0B,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;CACD;AA7DD,gEA6DC;AAED,SAAgB,iBAAiB,CAAC,IAAsB;IACvD,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,CAAC;AACnC,CAAC;AAFD,8CAEC;AAED,SAAS,mBAAmB,CAC3B,UAAgD;IAEhD,kGAAkG;IAClG,MAAM,OAAO,GAAuD;QACnE,GAAG,UAAU,CAAC,OAAO,EAAE;KACvB,CAAC;IACF,OAAO,IAAI,wBAAK,CAAiD,OAAO,EAAE,yBAAc,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { BTree } from \"@tylerbu/sorted-btree-es6\";\n\nimport type { Listenable } from \"@fluidframework/core-interfaces/internal\";\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport { compareStrings } from \"../../util/index.js\";\n\nimport type { TreeNodeSchemaIdentifier } from \"./formatV1.js\";\nimport {\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tstoredEmptyFieldSchema,\n} from \"./schema.js\";\n\n/**\n * Events for {@link TreeStoredSchemaSubscription}.\n *\n * TODO: consider having before and after events per subtree instead while applying anchor (and this just shows what happens at the root).\n */\nexport interface SchemaEvents {\n\t/**\n\t * Schema change is about to be applied.\n\t */\n\tbeforeSchemaChange(newSchema: TreeStoredSchema): void;\n\n\t/**\n\t * Schema change was just applied.\n\t */\n\tafterSchemaChange(newSchema: TreeStoredSchema): void;\n}\n\n/**\n * A collection of stored schema that fires events in response to changes.\n */\nexport interface TreeStoredSchemaSubscription extends TreeStoredSchema {\n\t/**\n\t * Events for this schema subscription.\n\t */\n\treadonly events: Listenable<SchemaEvents>;\n}\n\n/**\n * Mutable collection of stored schema.\n */\nexport interface MutableTreeStoredSchema extends TreeStoredSchemaSubscription {\n\t/**\n\t * Mutates the stored schema.\n\t * Replaces all schema with the provided schema.\n\t * Can over-write preexisting schema, and removes unmentioned schema.\n\t */\n\tapply(newSchema: TreeStoredSchema): void;\n}\n\n/**\n * Mutable TreeStoredSchema repository.\n */\nexport class TreeStoredSchemaRepository implements MutableTreeStoredSchema {\n\tprotected nodeSchemaData: BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;\n\tprotected rootFieldSchemaData: TreeFieldStoredSchema;\n\tprotected readonly _events = createEmitter<SchemaEvents>();\n\tpublic readonly events: Listenable<SchemaEvents> = this._events;\n\n\t/**\n\t * Copies in the provided schema. If `data` is an TreeStoredSchemaRepository, it will be cheap-cloned.\n\t * Otherwise, it will be deep-cloned.\n\t *\n\t * We might not want to store schema in maps long term, as we might want a way to reserve a\n\t * large space of schema IDs within a schema.\n\t * The way mapFields has been structured mitigates the need for this, but it still might be useful.\n\t *\n\t * (ex: someone using data as field identifiers might want to\n\t * reserve all fields identifiers starting with \"foo.\" to have a specific schema).\n\t * Combined with support for such namespaces in the allowed sets in the schema objects,\n\t * that might provide a decent alternative to mapFields (which is a bit odd).\n\t */\n\tpublic constructor(data?: TreeStoredSchema) {\n\t\tif (data === undefined) {\n\t\t\tthis.rootFieldSchemaData = storedEmptyFieldSchema;\n\t\t\tthis.nodeSchemaData = new BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>(\n\t\t\t\t[],\n\t\t\t\tcompareStrings,\n\t\t\t);\n\t\t} else {\n\t\t\tif (data instanceof TreeStoredSchemaRepository) {\n\t\t\t\tthis.rootFieldSchemaData = data.rootFieldSchema;\n\t\t\t\tthis.nodeSchemaData = data.nodeSchemaData.clone();\n\t\t\t} else {\n\t\t\t\tthis.rootFieldSchemaData = data.rootFieldSchema;\n\t\t\t\tthis.nodeSchemaData = cloneNodeSchemaData(data.nodeSchema);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get nodeSchema(): ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> {\n\t\t// Btree implements iterator, but not in a type-safe way\n\t\treturn this.nodeSchemaData as unknown as ReadonlyMap<\n\t\t\tTreeNodeSchemaIdentifier,\n\t\t\tTreeNodeStoredSchema\n\t\t>;\n\t}\n\n\tpublic get rootFieldSchema(): TreeFieldStoredSchema {\n\t\treturn this.rootFieldSchemaData;\n\t}\n\n\tpublic apply(newSchema: TreeStoredSchema): void {\n\t\tthis._events.emit(\"beforeSchemaChange\", newSchema);\n\t\tconst clone = new TreeStoredSchemaRepository(newSchema);\n\t\t// In the future, we could use btree's delta functionality to do a more efficient update\n\t\tthis.rootFieldSchemaData = clone.rootFieldSchemaData;\n\t\tthis.nodeSchemaData = clone.nodeSchemaData;\n\t\tthis._events.emit(\"afterSchemaChange\", newSchema);\n\t}\n\n\tpublic clone(): TreeStoredSchemaRepository {\n\t\treturn new TreeStoredSchemaRepository(this);\n\t}\n}\n\nexport function schemaDataIsEmpty(data: TreeStoredSchema): boolean {\n\treturn data.nodeSchema.size === 0;\n}\n\nfunction cloneNodeSchemaData(\n\tnodeSchema: StoredSchemaCollection[\"nodeSchema\"],\n): BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> {\n\t// Schema objects are immutable (unlike stored schema repositories), so this shallow copy is fine.\n\tconst entries: [TreeNodeSchemaIdentifier, TreeNodeStoredSchema][] = [\n\t\t...nodeSchema.entries(),\n\t];\n\treturn new BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>(entries, compareStrings);\n}\n"]}
1
+ {"version":3,"file":"storedSchemaRepository.js","sourceRoot":"","sources":["../../../src/core/schema-stored/storedSchemaRepository.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA6D;AAE7D,gEAAkD;AAElD,kDAAqD;AAGrD,2CAMqB;AAyCrB;;GAEG;AACH,MAAa,0BAA0B;IAMtC;;;;;;;;;;;;OAYG;IACH,YAAmB,IAAuB;QAhBvB,YAAO,GAAG,IAAA,4BAAa,GAAgB,CAAC;QAC3C,WAAM,GAA6B,IAAI,CAAC,OAAO,CAAC;QAgB/D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,CAAC,mBAAmB,GAAG,kCAAsB,CAAC;YAClD,IAAI,CAAC,cAAc,GAAG,IAAI,wBAAK,CAC9B,EAAE,EACF,yBAAc,CACd,CAAC;QACH,CAAC;aAAM,CAAC;YACP,IAAI,IAAI,YAAY,0BAA0B,EAAE,CAAC;gBAChD,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,eAAe,CAAC;gBAChD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;YACnD,CAAC;iBAAM,CAAC;gBACP,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,eAAe,CAAC;gBAChD,IAAI,CAAC,cAAc,GAAG,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC5D,CAAC;QACF,CAAC;IACF,CAAC;IAED,IAAW,UAAU;QACpB,wDAAwD;QACxD,OAAO,IAAI,CAAC,cAGX,CAAC;IACH,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IACjC,CAAC;IAEM,KAAK,CAAC,SAA2B;QACvC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC;QACnD,MAAM,KAAK,GAAG,IAAI,0BAA0B,CAAC,SAAS,CAAC,CAAC;QACxD,wFAAwF;QACxF,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC;QACrD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;QAC3C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;IACnD,CAAC;IAEM,KAAK;QACX,OAAO,IAAI,0BAA0B,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;CACD;AA7DD,gEA6DC;AAED,SAAgB,iBAAiB,CAAC,IAAsB;IACvD,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,CAAC;AACnC,CAAC;AAFD,8CAEC;AAED,SAAS,mBAAmB,CAC3B,UAAgD;IAEhD,kGAAkG;IAClG,MAAM,OAAO,GAAuD;QACnE,GAAG,UAAU,CAAC,OAAO,EAAE;KACvB,CAAC;IACF,OAAO,IAAI,wBAAK,CAAiD,OAAO,EAAE,yBAAc,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { Listenable } from \"@fluidframework/core-interfaces/internal\";\nimport { BTree } from \"@tylerbu/sorted-btree-es6\";\n\nimport { compareStrings } from \"../../util/index.js\";\n\nimport type { TreeNodeSchemaIdentifier } from \"./formatV1.js\";\nimport {\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tstoredEmptyFieldSchema,\n} from \"./schema.js\";\n\n/**\n * Events for {@link TreeStoredSchemaSubscription}.\n *\n * TODO: consider having before and after events per subtree instead while applying anchor (and this just shows what happens at the root).\n */\nexport interface SchemaEvents {\n\t/**\n\t * Schema change is about to be applied.\n\t */\n\tbeforeSchemaChange(newSchema: TreeStoredSchema): void;\n\n\t/**\n\t * Schema change was just applied.\n\t */\n\tafterSchemaChange(newSchema: TreeStoredSchema): void;\n}\n\n/**\n * A collection of stored schema that fires events in response to changes.\n */\nexport interface TreeStoredSchemaSubscription extends TreeStoredSchema {\n\t/**\n\t * Events for this schema subscription.\n\t */\n\treadonly events: Listenable<SchemaEvents>;\n}\n\n/**\n * Mutable collection of stored schema.\n */\nexport interface MutableTreeStoredSchema extends TreeStoredSchemaSubscription {\n\t/**\n\t * Mutates the stored schema.\n\t * Replaces all schema with the provided schema.\n\t * Can over-write preexisting schema, and removes unmentioned schema.\n\t */\n\tapply(newSchema: TreeStoredSchema): void;\n}\n\n/**\n * Mutable TreeStoredSchema repository.\n */\nexport class TreeStoredSchemaRepository implements MutableTreeStoredSchema {\n\tprotected nodeSchemaData: BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;\n\tprotected rootFieldSchemaData: TreeFieldStoredSchema;\n\tprotected readonly _events = createEmitter<SchemaEvents>();\n\tpublic readonly events: Listenable<SchemaEvents> = this._events;\n\n\t/**\n\t * Copies in the provided schema. If `data` is an TreeStoredSchemaRepository, it will be cheap-cloned.\n\t * Otherwise, it will be deep-cloned.\n\t *\n\t * We might not want to store schema in maps long term, as we might want a way to reserve a\n\t * large space of schema IDs within a schema.\n\t * The way mapFields has been structured mitigates the need for this, but it still might be useful.\n\t *\n\t * (ex: someone using data as field identifiers might want to\n\t * reserve all fields identifiers starting with \"foo.\" to have a specific schema).\n\t * Combined with support for such namespaces in the allowed sets in the schema objects,\n\t * that might provide a decent alternative to mapFields (which is a bit odd).\n\t */\n\tpublic constructor(data?: TreeStoredSchema) {\n\t\tif (data === undefined) {\n\t\t\tthis.rootFieldSchemaData = storedEmptyFieldSchema;\n\t\t\tthis.nodeSchemaData = new BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>(\n\t\t\t\t[],\n\t\t\t\tcompareStrings,\n\t\t\t);\n\t\t} else {\n\t\t\tif (data instanceof TreeStoredSchemaRepository) {\n\t\t\t\tthis.rootFieldSchemaData = data.rootFieldSchema;\n\t\t\t\tthis.nodeSchemaData = data.nodeSchemaData.clone();\n\t\t\t} else {\n\t\t\t\tthis.rootFieldSchemaData = data.rootFieldSchema;\n\t\t\t\tthis.nodeSchemaData = cloneNodeSchemaData(data.nodeSchema);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get nodeSchema(): ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> {\n\t\t// Btree implements iterator, but not in a type-safe way\n\t\treturn this.nodeSchemaData as unknown as ReadonlyMap<\n\t\t\tTreeNodeSchemaIdentifier,\n\t\t\tTreeNodeStoredSchema\n\t\t>;\n\t}\n\n\tpublic get rootFieldSchema(): TreeFieldStoredSchema {\n\t\treturn this.rootFieldSchemaData;\n\t}\n\n\tpublic apply(newSchema: TreeStoredSchema): void {\n\t\tthis._events.emit(\"beforeSchemaChange\", newSchema);\n\t\tconst clone = new TreeStoredSchemaRepository(newSchema);\n\t\t// In the future, we could use btree's delta functionality to do a more efficient update\n\t\tthis.rootFieldSchemaData = clone.rootFieldSchemaData;\n\t\tthis.nodeSchemaData = clone.nodeSchemaData;\n\t\tthis._events.emit(\"afterSchemaChange\", newSchema);\n\t}\n\n\tpublic clone(): TreeStoredSchemaRepository {\n\t\treturn new TreeStoredSchemaRepository(this);\n\t}\n}\n\nexport function schemaDataIsEmpty(data: TreeStoredSchema): boolean {\n\treturn data.nodeSchema.size === 0;\n}\n\nfunction cloneNodeSchemaData(\n\tnodeSchema: StoredSchemaCollection[\"nodeSchema\"],\n): BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> {\n\t// Schema objects are immutable (unlike stored schema repositories), so this shallow copy is fine.\n\tconst entries: [TreeNodeSchemaIdentifier, TreeNodeStoredSchema][] = [\n\t\t...nodeSchema.entries(),\n\t];\n\treturn new BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>(entries, compareStrings);\n}\n"]}
@@ -488,7 +488,8 @@ declare class PathNode extends ReferenceCountedBase implements AnchorNode {
488
488
  child(key: FieldKey, index: number): UpPath<AnchorNode>;
489
489
  getOrCreateChildRef(key: FieldKey, index: number): [Anchor, AnchorNode];
490
490
  /**
491
- * @returns true iff this PathNode is the special root node that sits above all the detached fields.
491
+ * Whether or not this `PathNode` is the special root node that sits above all the detached fields.
492
+ * @remarks
492
493
  * In this case, the fields are detached sequences.
493
494
  * Note that the special root node should never appear in an UpPath
494
495
  * since UpPaths represent this root as `undefined`.
@@ -1 +1 @@
1
- {"version":3,"file":"anchorSet.d.ts","sourceRoot":"","sources":["../../../src/core/tree/anchorSet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,EACN,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,oBAAoB,EAKpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAC;AACzC,OAAO,EAEN,KAAK,iBAAiB,EAItB,KAAK,MAAM,EACX,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAOrD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;CAC/C;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,QAAQ,I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,12 @@ var _AnchorSet_events;
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.AnchorSet = exports.anchorSlot = void 0;
14
14
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
15
- const internal_1 = require("@fluidframework/core-utils/internal");
16
15
  const client_utils_1 = require("@fluid-internal/client-utils");
16
+ const internal_1 = require("@fluidframework/core-utils/internal");
17
17
  const index_js_1 = require("../../util/index.js");
18
+ const deltaUtil_js_1 = require("./deltaUtil.js");
18
19
  const pathTree_js_1 = require("./pathTree.js");
19
20
  const types_js_1 = require("./types.js");
20
- const deltaUtil_js_1 = require("./deltaUtil.js");
21
21
  /**
22
22
  * A singleton which represents a permanently invalid location (i.e. there is never a node there)
23
23
  */
@@ -722,7 +722,8 @@ class PathNode extends index_js_1.ReferenceCountedBase {
722
722
  return [anchor, node];
723
723
  }
724
724
  /**
725
- * @returns true iff this PathNode is the special root node that sits above all the detached fields.
725
+ * Whether or not this `PathNode` is the special root node that sits above all the detached fields.
726
+ * @remarks
726
727
  * In this case, the fields are detached sequences.
727
728
  * Note that the special root node should never appear in an UpPath
728
729
  * since UpPaths represent this root as `undefined`.