@fluidframework/tree 2.117.0 → 3.0.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 (1275) hide show
  1. package/CHANGELOG.md +385 -7
  2. package/README.md +55 -52
  3. package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
  4. package/api-report/tree.alpha.api.md +174 -146
  5. package/api-report/tree.beta.api.md +160 -91
  6. package/api-report/tree.legacy.beta.api.md +160 -91
  7. package/api-report/tree.legacy.public.api.md +26 -43
  8. package/api-report/tree.public.api.md +26 -43
  9. package/dist/api.d.ts +9 -1
  10. package/dist/api.d.ts.map +1 -1
  11. package/dist/api.js +2 -3
  12. package/dist/api.js.map +1 -1
  13. package/dist/codec/codec.d.ts +2 -2
  14. package/dist/codec/codec.d.ts.map +1 -1
  15. package/dist/codec/codec.js +9 -7
  16. package/dist/codec/codec.js.map +1 -1
  17. package/dist/codec/discriminatedUnions.js +1 -0
  18. package/dist/codec/discriminatedUnions.js.map +1 -1
  19. package/dist/codec/versioned/codec.d.ts.map +1 -1
  20. package/dist/codec/versioned/codec.js +4 -2
  21. package/dist/codec/versioned/codec.js.map +1 -1
  22. package/dist/componentApi.d.ts.map +1 -1
  23. package/dist/componentApi.js +20 -17
  24. package/dist/componentApi.js.map +1 -1
  25. package/dist/core/change-family/editBuilder.js +1 -0
  26. package/dist/core/change-family/editBuilder.js.map +1 -1
  27. package/dist/core/forest/editableForest.js +1 -2
  28. package/dist/core/forest/editableForest.js.map +1 -1
  29. package/dist/core/forest/forest.js +3 -3
  30. package/dist/core/forest/forest.js.map +1 -1
  31. package/dist/core/index.d.ts +2 -2
  32. package/dist/core/index.d.ts.map +1 -1
  33. package/dist/core/index.js +9 -5
  34. package/dist/core/index.js.map +1 -1
  35. package/dist/core/rebase/changeRebaser.js +5 -5
  36. package/dist/core/rebase/changeRebaser.js.map +1 -1
  37. package/dist/core/rebase/index.d.ts +1 -1
  38. package/dist/core/rebase/index.d.ts.map +1 -1
  39. package/dist/core/rebase/index.js +2 -1
  40. package/dist/core/rebase/index.js.map +1 -1
  41. package/dist/core/rebase/revisionTagCodec.d.ts +1 -1
  42. package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
  43. package/dist/core/rebase/revisionTagCodec.js +3 -1
  44. package/dist/core/rebase/revisionTagCodec.js.map +1 -1
  45. package/dist/core/rebase/types.d.ts +12 -1
  46. package/dist/core/rebase/types.d.ts.map +1 -1
  47. package/dist/core/rebase/types.js +19 -15
  48. package/dist/core/rebase/types.js.map +1 -1
  49. package/dist/core/rebase/utils.js +9 -10
  50. package/dist/core/rebase/utils.js.map +1 -1
  51. package/dist/core/schema-stored/schema.js +9 -4
  52. package/dist/core/schema-stored/schema.js.map +1 -1
  53. package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  54. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  55. package/dist/core/schema-stored/storedSchemaRepository.js +6 -4
  56. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  57. package/dist/core/tree/anchorSet.d.ts +1 -1
  58. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  59. package/dist/core/tree/anchorSet.js +62 -55
  60. package/dist/core/tree/anchorSet.js.map +1 -1
  61. package/dist/core/tree/chunk.js +2 -2
  62. package/dist/core/tree/chunk.js.map +1 -1
  63. package/dist/core/tree/cursor.js +12 -12
  64. package/dist/core/tree/cursor.js.map +1 -1
  65. package/dist/core/tree/deltaUtil.d.ts +34 -9
  66. package/dist/core/tree/deltaUtil.d.ts.map +1 -1
  67. package/dist/core/tree/deltaUtil.js +51 -17
  68. package/dist/core/tree/deltaUtil.js.map +1 -1
  69. package/dist/core/tree/detachedFieldIndex.js +23 -21
  70. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  71. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +10 -10
  72. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  73. package/dist/core/tree/detachedFieldIndexCodecCommon.js +1 -2
  74. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  75. package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
  76. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  77. package/dist/core/tree/detachedFieldIndexCodecV2.js +3 -2
  78. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  79. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +3 -3
  80. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  81. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +1 -1
  82. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
  83. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  84. package/dist/core/tree/index.d.ts +1 -1
  85. package/dist/core/tree/index.d.ts.map +1 -1
  86. package/dist/core/tree/index.js +7 -4
  87. package/dist/core/tree/index.js.map +1 -1
  88. package/dist/core/tree/mapTree.js +1 -2
  89. package/dist/core/tree/mapTree.js.map +1 -1
  90. package/dist/core/tree/pathTree.js +7 -8
  91. package/dist/core/tree/pathTree.js.map +1 -1
  92. package/dist/core/tree/persistedTreeTextFormat.d.ts +4 -4
  93. package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  94. package/dist/core/tree/sparseTree.js +17 -13
  95. package/dist/core/tree/sparseTree.js.map +1 -1
  96. package/dist/core/tree/treeTextFormat.js +4 -5
  97. package/dist/core/tree/treeTextFormat.js.map +1 -1
  98. package/dist/core/tree/types.js +3 -3
  99. package/dist/core/tree/types.js.map +1 -1
  100. package/dist/core/tree/visitDelta.js +1 -2
  101. package/dist/core/tree/visitDelta.js.map +1 -1
  102. package/dist/core/tree/visitorUtils.js +5 -6
  103. package/dist/core/tree/visitorUtils.js.map +1 -1
  104. package/dist/entrypoints/alpha.d.ts +1 -1
  105. package/dist/entrypoints/alpha.d.ts.map +1 -1
  106. package/dist/entrypoints/alpha.js +6 -4
  107. package/dist/entrypoints/alpha.js.map +1 -1
  108. package/dist/entrypoints/beta.d.ts +1 -1
  109. package/dist/entrypoints/beta.d.ts.map +1 -1
  110. package/dist/entrypoints/beta.js +2 -2
  111. package/dist/entrypoints/beta.js.map +1 -1
  112. package/dist/entrypoints/legacy.d.ts +1 -1
  113. package/dist/entrypoints/legacy.d.ts.map +1 -1
  114. package/dist/entrypoints/legacy.js +2 -2
  115. package/dist/entrypoints/legacy.js.map +1 -1
  116. package/dist/entrypoints/public.d.ts +1 -1
  117. package/dist/entrypoints/public.d.ts.map +1 -1
  118. package/dist/entrypoints/public.js +1 -2
  119. package/dist/entrypoints/public.js.map +1 -1
  120. package/dist/extensibleUnionNode.d.ts.map +1 -1
  121. package/dist/extensibleUnionNode.js +1 -1
  122. package/dist/extensibleUnionNode.js.map +1 -1
  123. package/dist/feature-libraries/changeAtomIdBTree.js +3 -4
  124. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  125. package/dist/feature-libraries/changeAtomIdCodec.js +1 -2
  126. package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
  127. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  128. package/dist/feature-libraries/chunked-forest/basicChunk.js +14 -1
  129. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  130. package/dist/feature-libraries/chunked-forest/chunkTree.js +28 -20
  131. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  132. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  133. package/dist/feature-libraries/chunked-forest/chunkedForest.js +22 -16
  134. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  135. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +9 -11
  136. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  137. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +15 -7
  138. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  139. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +7 -3
  140. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  141. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +3 -2
  142. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  143. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  144. package/dist/feature-libraries/chunked-forest/codec/codecs.js +2 -0
  145. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  146. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +33 -17
  147. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  148. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +2 -2
  149. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
  150. package/dist/feature-libraries/chunked-forest/codec/format/versions.js +2 -2
  151. package/dist/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -1
  152. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +11 -2
  153. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  154. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +5 -6
  155. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  156. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -3
  157. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  158. package/dist/feature-libraries/chunked-forest/sequenceChunk.js +1 -0
  159. package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  160. package/dist/feature-libraries/chunked-forest/uniformChunk.js +73 -15
  161. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  162. package/dist/feature-libraries/comparison-forest/comparisonForest.js +79 -79
  163. package/dist/feature-libraries/comparison-forest/comparisonForest.js.map +1 -1
  164. package/dist/feature-libraries/cursorComparator.d.ts +8 -0
  165. package/dist/feature-libraries/cursorComparator.d.ts.map +1 -1
  166. package/dist/feature-libraries/cursorComparator.js +43 -10
  167. package/dist/feature-libraries/cursorComparator.js.map +1 -1
  168. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  169. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  170. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +2 -2
  171. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  172. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +2 -0
  173. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  174. package/dist/feature-libraries/deltaUtils.js +2 -3
  175. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  176. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +2 -0
  177. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  178. package/dist/feature-libraries/editableTreeBinder.js +1 -2
  179. package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
  180. package/dist/feature-libraries/flex-tree/context.js +19 -3
  181. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  182. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +2 -2
  183. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  184. package/dist/feature-libraries/flex-tree/lazyEntity.js +14 -14
  185. package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  186. package/dist/feature-libraries/flex-tree/lazyField.js +28 -30
  187. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  188. package/dist/feature-libraries/flex-tree/lazyNode.js +24 -23
  189. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  190. package/dist/feature-libraries/flex-tree/observer.js +2 -2
  191. package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
  192. package/dist/feature-libraries/flex-tree/utilities.js +5 -5
  193. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  194. package/dist/feature-libraries/forest-summary/forestSummarizer.js +122 -117
  195. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  196. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +49 -32
  197. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  198. package/dist/feature-libraries/forest-summary/summaryTypes.js +2 -3
  199. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  200. package/dist/feature-libraries/index.d.ts +1 -1
  201. package/dist/feature-libraries/index.js.map +1 -1
  202. package/dist/feature-libraries/indexing/anchorTreeIndex.js +35 -31
  203. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  204. package/dist/feature-libraries/mapTreeCursor.js +6 -7
  205. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  206. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -3
  207. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  208. package/dist/feature-libraries/modular-schema/comparison.js +6 -7
  209. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  210. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -4
  211. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  212. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -12
  213. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  214. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +63 -10
  215. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  216. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +3 -3
  217. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  218. package/dist/feature-libraries/modular-schema/fieldKind.js +10 -0
  219. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  220. package/dist/feature-libraries/modular-schema/filterEdits.d.ts +13 -0
  221. package/dist/feature-libraries/modular-schema/filterEdits.d.ts.map +1 -0
  222. package/dist/feature-libraries/modular-schema/filterEdits.js +51 -0
  223. package/dist/feature-libraries/modular-schema/filterEdits.js.map +1 -0
  224. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  225. package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -4
  226. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  227. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -2
  228. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  229. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +2 -2
  230. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  231. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js +1 -2
  232. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  233. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  234. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  235. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  236. package/dist/feature-libraries/modular-schema/invert.d.ts +1 -1
  237. package/dist/feature-libraries/modular-schema/invert.d.ts.map +1 -1
  238. package/dist/feature-libraries/modular-schema/invert.js +5 -30
  239. package/dist/feature-libraries/modular-schema/invert.js.map +1 -1
  240. package/dist/feature-libraries/modular-schema/isNeverTree.js +4 -5
  241. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  242. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +5 -7
  243. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  244. package/dist/feature-libraries/modular-schema/minimizeModularChange.js +459 -10
  245. package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  246. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +14 -15
  247. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  248. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -2
  249. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  250. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +2 -2
  251. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  252. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -10
  253. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  254. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +30 -97
  255. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  256. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +9 -9
  257. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  258. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +4 -4
  259. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +1 -2
  260. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  261. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts +13 -1
  262. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -1
  263. package/dist/feature-libraries/modular-schema/modularChangeUtils.js +115 -12
  264. package/dist/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -1
  265. package/dist/feature-libraries/modular-schema/prune.d.ts +2 -3
  266. package/dist/feature-libraries/modular-schema/prune.d.ts.map +1 -1
  267. package/dist/feature-libraries/modular-schema/prune.js +25 -8
  268. package/dist/feature-libraries/modular-schema/prune.js.map +1 -1
  269. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -3
  270. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  271. package/dist/feature-libraries/node-identifier/nodeIdentifier.js +2 -2
  272. package/dist/feature-libraries/node-identifier/nodeIdentifier.js.map +1 -1
  273. package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js +3 -3
  274. package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -1
  275. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  276. package/dist/feature-libraries/object-forest/objectForest.js +274 -267
  277. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  278. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  279. package/dist/feature-libraries/optional-field/optionalField.js +27 -35
  280. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  281. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +7 -7
  282. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  283. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +8 -8
  284. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  285. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +1 -2
  286. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  287. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  288. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +1 -2
  289. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  290. package/dist/feature-libraries/schema-index/schemaSummarizer.js +3 -0
  291. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  292. package/dist/feature-libraries/schemaChecker.d.ts +9 -19
  293. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
  294. package/dist/feature-libraries/schemaChecker.js +135 -51
  295. package/dist/feature-libraries/schemaChecker.js.map +1 -1
  296. package/dist/feature-libraries/sequence-field/compose.js +8 -2
  297. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  298. package/dist/feature-libraries/sequence-field/filterEdits.d.ts +3 -3
  299. package/dist/feature-libraries/sequence-field/filterEdits.d.ts.map +1 -1
  300. package/dist/feature-libraries/sequence-field/filterEdits.js +29 -11
  301. package/dist/feature-libraries/sequence-field/filterEdits.js.map +1 -1
  302. package/dist/feature-libraries/sequence-field/formatV1.d.ts +102 -102
  303. package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  304. package/dist/feature-libraries/sequence-field/formatV2.d.ts +79 -79
  305. package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  306. package/dist/feature-libraries/sequence-field/formatV3.d.ts +56 -56
  307. package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  308. package/dist/feature-libraries/sequence-field/invert.js +1 -2
  309. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  310. package/dist/feature-libraries/sequence-field/markListFactory.js +3 -4
  311. package/dist/feature-libraries/sequence-field/markListFactory.js.map +1 -1
  312. package/dist/feature-libraries/sequence-field/markQueue.js +4 -2
  313. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  314. package/dist/feature-libraries/sequence-field/moveEffectTable.js +9 -9
  315. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  316. package/dist/feature-libraries/sequence-field/prune.js +1 -2
  317. package/dist/feature-libraries/sequence-field/prune.js.map +1 -1
  318. package/dist/feature-libraries/sequence-field/rebase.js +7 -2
  319. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  320. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +1 -2
  321. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  322. package/dist/feature-libraries/sequence-field/replaceRevisions.js +1 -2
  323. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  324. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +2 -3
  325. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  326. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +1 -2
  327. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  328. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  329. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +9 -9
  330. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  331. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +1 -2
  332. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  333. package/dist/feature-libraries/sequence-field/utils.d.ts +2 -2
  334. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  335. package/dist/feature-libraries/sequence-field/utils.js +54 -67
  336. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  337. package/dist/feature-libraries/treeCursorUtils.js +19 -15
  338. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  339. package/dist/feature-libraries/treeTextCursor.js +8 -8
  340. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  341. package/dist/feature-libraries/valueUtilities.js +4 -5
  342. package/dist/feature-libraries/valueUtilities.js.map +1 -1
  343. package/dist/index.d.ts +4 -29
  344. package/dist/index.d.ts.map +1 -1
  345. package/dist/index.js +6 -9
  346. package/dist/index.js.map +1 -1
  347. package/dist/internalTypes.d.ts +1 -1
  348. package/dist/internalTypes.d.ts.map +1 -1
  349. package/dist/internalTypes.js.map +1 -1
  350. package/dist/packageVersion.d.ts +1 -1
  351. package/dist/packageVersion.d.ts.map +1 -1
  352. package/dist/packageVersion.js +1 -1
  353. package/dist/packageVersion.js.map +1 -1
  354. package/dist/serializableDomainSchema.d.ts +1 -1
  355. package/dist/shared-tree/history.d.ts.map +1 -1
  356. package/dist/shared-tree/history.js +32 -13
  357. package/dist/shared-tree/history.js.map +1 -1
  358. package/dist/shared-tree/independentView.d.ts +27 -3
  359. package/dist/shared-tree/independentView.d.ts.map +1 -1
  360. package/dist/shared-tree/independentView.js +36 -7
  361. package/dist/shared-tree/independentView.js.map +1 -1
  362. package/dist/shared-tree/index.d.ts +2 -1
  363. package/dist/shared-tree/index.d.ts.map +1 -1
  364. package/dist/shared-tree/index.js +6 -2
  365. package/dist/shared-tree/index.js.map +1 -1
  366. package/dist/shared-tree/isAuditableFromOutcome.js +1 -2
  367. package/dist/shared-tree/isAuditableFromOutcome.js.map +1 -1
  368. package/dist/shared-tree/schematizeTree.js +3 -4
  369. package/dist/shared-tree/schematizeTree.js.map +1 -1
  370. package/dist/shared-tree/schematizingTreeView.d.ts +14 -4
  371. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  372. package/dist/shared-tree/schematizingTreeView.js +107 -37
  373. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  374. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  375. package/dist/shared-tree/sharedTree.js +28 -19
  376. package/dist/shared-tree/sharedTree.js.map +1 -1
  377. package/dist/shared-tree/sharedTreeChangeCodecs.js +3 -3
  378. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  379. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  380. package/dist/shared-tree/sharedTreeChangeEnricher.js +12 -4
  381. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  382. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  383. package/dist/shared-tree/sharedTreeChangeFamily.js +11 -8
  384. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  385. package/dist/shared-tree/sharedTreeChangeFormat.js +2 -3
  386. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  387. package/dist/shared-tree/sharedTreeEditBuilder.js +2 -0
  388. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  389. package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
  390. package/dist/shared-tree/transactionMinimize.js +2 -1
  391. package/dist/shared-tree/transactionMinimize.js.map +1 -1
  392. package/dist/shared-tree/transactionPostProcessor.js +2 -3
  393. package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
  394. package/dist/shared-tree/tree.js +2 -2
  395. package/dist/shared-tree/tree.js.map +1 -1
  396. package/dist/shared-tree/treeAlpha.d.ts +5 -16
  397. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  398. package/dist/shared-tree/treeAlpha.js +18 -11
  399. package/dist/shared-tree/treeAlpha.js.map +1 -1
  400. package/{lib/simple-tree/api → dist/shared-tree}/treeBeta.d.ts +8 -65
  401. package/dist/shared-tree/treeBeta.d.ts.map +1 -0
  402. package/dist/shared-tree/treeBeta.js +70 -0
  403. package/dist/shared-tree/treeBeta.js.map +1 -0
  404. package/dist/shared-tree/treeCheckout.d.ts +5 -0
  405. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  406. package/dist/shared-tree/treeCheckout.js +986 -907
  407. package/dist/shared-tree/treeCheckout.js.map +1 -1
  408. package/dist/shared-tree/unhydratedTreeContext.js +3 -4
  409. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
  410. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  411. package/dist/shared-tree-core/branch.js +24 -20
  412. package/dist/shared-tree-core/branch.js.map +1 -1
  413. package/dist/shared-tree-core/branchCommitCounter.js +35 -32
  414. package/dist/shared-tree-core/branchCommitCounter.js.map +1 -1
  415. package/dist/shared-tree-core/branchCommitEnricher.js +9 -8
  416. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  417. package/dist/shared-tree-core/branchIdCodec.js +2 -3
  418. package/dist/shared-tree-core/branchIdCodec.js.map +1 -1
  419. package/dist/shared-tree-core/customMetadataCodec.js +2 -3
  420. package/dist/shared-tree-core/customMetadataCodec.js.map +1 -1
  421. package/dist/shared-tree-core/customMetadataFormat.d.ts.map +1 -1
  422. package/dist/shared-tree-core/defaultResubmitMachine.js +11 -9
  423. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  424. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  425. package/dist/shared-tree-core/editManager.js +73 -44
  426. package/dist/shared-tree-core/editManager.js.map +1 -1
  427. package/dist/shared-tree-core/editManagerCodecs.js +3 -3
  428. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  429. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  430. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  431. package/dist/shared-tree-core/editManagerCodecsCommons.js +33 -36
  432. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  433. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +1 -2
  434. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  435. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -2
  436. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  437. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +11 -11
  438. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  439. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +5 -4
  440. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  441. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +10 -9
  442. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  443. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  444. package/dist/shared-tree-core/editManagerSummarizer.js +6 -1
  445. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  446. package/dist/shared-tree-core/messageCodecV1ToV4.js +1 -2
  447. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  448. package/dist/shared-tree-core/messageCodecVSharedBranches.js +1 -2
  449. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  450. package/dist/shared-tree-core/messageCodecs.js +3 -3
  451. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  452. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  453. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  454. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +3 -2
  455. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  456. package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  457. package/dist/shared-tree-core/sharedTreeCore.js +44 -22
  458. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  459. package/dist/shared-tree-core/summaryTypes.js +2 -2
  460. package/dist/shared-tree-core/summaryTypes.js.map +1 -1
  461. package/dist/shared-tree-core/transaction.js +36 -39
  462. package/dist/shared-tree-core/transaction.js.map +1 -1
  463. package/dist/shared-tree-core/versionedSummarizer.js +4 -0
  464. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
  465. package/dist/simple-tree/api/cloneTree.d.ts +11 -0
  466. package/dist/simple-tree/api/cloneTree.d.ts.map +1 -0
  467. package/dist/simple-tree/api/cloneTree.js +31 -0
  468. package/dist/simple-tree/api/cloneTree.js.map +1 -0
  469. package/dist/simple-tree/api/conciseTree.js +2 -3
  470. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  471. package/dist/simple-tree/api/configuration.d.ts +4 -4
  472. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  473. package/dist/simple-tree/api/configuration.js +21 -2
  474. package/dist/simple-tree/api/configuration.js.map +1 -1
  475. package/dist/simple-tree/api/create.js +2 -3
  476. package/dist/simple-tree/api/create.js.map +1 -1
  477. package/dist/simple-tree/api/customTree.js +6 -6
  478. package/dist/simple-tree/api/customTree.js.map +1 -1
  479. package/dist/simple-tree/api/dirtyIndex.js +1 -2
  480. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  481. package/dist/simple-tree/api/discrepancies.d.ts +36 -3
  482. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  483. package/dist/simple-tree/api/discrepancies.js +42 -17
  484. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  485. package/dist/simple-tree/api/eraseSchemaDetails.js +2 -3
  486. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  487. package/dist/simple-tree/api/getJsonSchema.js +1 -2
  488. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  489. package/dist/simple-tree/api/getSimpleSchema.js +1 -2
  490. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  491. package/dist/simple-tree/api/identifierIndex.js +1 -2
  492. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  493. package/dist/simple-tree/api/incrementalAllowedTypes.js +2 -2
  494. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  495. package/dist/simple-tree/api/index.d.ts +5 -4
  496. package/dist/simple-tree/api/index.d.ts.map +1 -1
  497. package/dist/simple-tree/api/index.js +5 -7
  498. package/dist/simple-tree/api/index.js.map +1 -1
  499. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +22 -3
  500. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  501. package/dist/simple-tree/api/schemaCompatibilityTester.js +140 -11
  502. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  503. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -7
  504. package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  505. package/dist/simple-tree/api/schemaCreationUtilities.js +6 -9
  506. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  507. package/dist/simple-tree/api/schemaFactory.d.ts +4 -9
  508. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  509. package/dist/simple-tree/api/schemaFactory.js +13 -12
  510. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  511. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +20 -22
  512. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  513. package/dist/simple-tree/api/schemaFactoryAlpha.js +78 -81
  514. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  515. package/dist/simple-tree/api/schemaFactoryBeta.d.ts +7 -9
  516. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  517. package/dist/simple-tree/api/schemaFactoryBeta.js +32 -35
  518. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  519. package/dist/simple-tree/api/schemaFactoryRecursive.js +1 -2
  520. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  521. package/dist/simple-tree/api/schemaFromSimple.js +1 -2
  522. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  523. package/dist/simple-tree/api/schemaStatics.d.ts +7 -7
  524. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  525. package/dist/simple-tree/api/simpleSchemaCodec.js +2 -3
  526. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  527. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +2 -3
  528. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  529. package/dist/simple-tree/api/simpleTreeIndex.js +1 -2
  530. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  531. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +46 -2
  532. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  533. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +54 -12
  534. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  535. package/dist/simple-tree/api/storedSchema.js +2 -3
  536. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  537. package/dist/simple-tree/api/transactionTypes.d.ts +4 -4
  538. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  539. package/dist/simple-tree/api/tree.d.ts +243 -58
  540. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  541. package/dist/simple-tree/api/tree.js +3 -5
  542. package/dist/simple-tree/api/tree.js.map +1 -1
  543. package/dist/simple-tree/api/treeChangeEvents.d.ts +16 -4
  544. package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  545. package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
  546. package/dist/simple-tree/api/treeChangeEventsBeta.d.ts +209 -0
  547. package/dist/simple-tree/api/treeChangeEventsBeta.d.ts.map +1 -0
  548. package/dist/simple-tree/api/{treeAlpha.js → treeChangeEventsBeta.js} +1 -1
  549. package/dist/simple-tree/api/treeChangeEventsBeta.js.map +1 -0
  550. package/dist/simple-tree/api/treeNodeApi.d.ts +1 -75
  551. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  552. package/dist/simple-tree/api/treeNodeApi.js +7 -7
  553. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  554. package/dist/simple-tree/api/typesUnsafe.d.ts +8 -6
  555. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  556. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  557. package/dist/simple-tree/api/verboseTree.js +5 -6
  558. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  559. package/dist/simple-tree/core/allowedTypes.js +22 -13
  560. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  561. package/dist/simple-tree/core/context.js +3 -0
  562. package/dist/simple-tree/core/context.js.map +1 -1
  563. package/dist/simple-tree/core/flexList.js +2 -3
  564. package/dist/simple-tree/core/flexList.js.map +1 -1
  565. package/dist/simple-tree/core/getOrCreateNode.js +2 -3
  566. package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
  567. package/dist/simple-tree/core/index.d.ts +1 -1
  568. package/dist/simple-tree/core/index.d.ts.map +1 -1
  569. package/dist/simple-tree/core/index.js +2 -2
  570. package/dist/simple-tree/core/index.js.map +1 -1
  571. package/dist/simple-tree/core/toStored.d.ts +7 -0
  572. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  573. package/dist/simple-tree/core/toStored.js.map +1 -1
  574. package/dist/simple-tree/core/treeNode.d.ts +3 -4
  575. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  576. package/dist/simple-tree/core/treeNode.js +31 -32
  577. package/dist/simple-tree/core/treeNode.js.map +1 -1
  578. package/dist/simple-tree/core/treeNodeKernel.js +194 -192
  579. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  580. package/dist/simple-tree/core/treeNodeSchema.js +3 -3
  581. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  582. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  583. package/dist/simple-tree/core/treeNodeValid.js +25 -25
  584. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  585. package/dist/simple-tree/core/types.js +1 -2
  586. package/dist/simple-tree/core/types.js.map +1 -1
  587. package/dist/simple-tree/core/unhydratedFlexTree.js +177 -150
  588. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  589. package/dist/simple-tree/core/walkSchema.js +2 -3
  590. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  591. package/dist/simple-tree/core/withType.d.ts +7 -9
  592. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  593. package/dist/simple-tree/core/withType.js +6 -7
  594. package/dist/simple-tree/core/withType.js.map +1 -1
  595. package/dist/simple-tree/createContext.js +2 -3
  596. package/dist/simple-tree/createContext.js.map +1 -1
  597. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  598. package/dist/simple-tree/fieldSchema.js +33 -15
  599. package/dist/simple-tree/fieldSchema.js.map +1 -1
  600. package/dist/simple-tree/getTreeNodeForField.js +1 -2
  601. package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
  602. package/dist/simple-tree/index.d.ts +2 -2
  603. package/dist/simple-tree/index.d.ts.map +1 -1
  604. package/dist/simple-tree/index.js +6 -8
  605. package/dist/simple-tree/index.js.map +1 -1
  606. package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
  607. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  608. package/dist/simple-tree/leafNodeSchema.js +18 -17
  609. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  610. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +3 -2
  611. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  612. package/dist/simple-tree/node-kinds/array/arrayNode.js +31 -33
  613. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  614. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  615. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js +2 -2
  616. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  617. package/dist/simple-tree/node-kinds/common.js +1 -2
  618. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  619. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +6 -6
  620. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  621. package/dist/simple-tree/node-kinds/map/mapNode.js +10 -16
  622. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  623. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  624. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js +2 -2
  625. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  626. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  627. package/dist/simple-tree/node-kinds/object/objectNode.js +27 -28
  628. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  629. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +1 -1
  630. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  631. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js +2 -2
  632. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  633. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  634. package/dist/simple-tree/node-kinds/record/recordNode.js +10 -13
  635. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  636. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -2
  637. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  638. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js +2 -2
  639. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  640. package/dist/simple-tree/prepareForInsertion.js +4 -5
  641. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  642. package/dist/simple-tree/toStoredSchema.js +11 -11
  643. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  644. package/dist/simple-tree/treeSchema.js +1 -2
  645. package/dist/simple-tree/treeSchema.js.map +1 -1
  646. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +3 -4
  647. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  648. package/dist/simple-tree/walkFieldSchema.js +1 -2
  649. package/dist/simple-tree/walkFieldSchema.js.map +1 -1
  650. package/dist/tableSchema.d.ts +2 -87
  651. package/dist/tableSchema.d.ts.map +1 -1
  652. package/dist/tableSchema.js +309 -275
  653. package/dist/tableSchema.js.map +1 -1
  654. package/dist/text/codePointUtils.d.ts +16 -3
  655. package/dist/text/codePointUtils.d.ts.map +1 -1
  656. package/dist/text/codePointUtils.js +24 -13
  657. package/dist/text/codePointUtils.js.map +1 -1
  658. package/dist/text/textDomain.d.ts +7 -1
  659. package/dist/text/textDomain.d.ts.map +1 -1
  660. package/dist/text/textDomain.js +32 -28
  661. package/dist/text/textDomain.js.map +1 -1
  662. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  663. package/dist/text/textDomainFormatted.js +45 -34
  664. package/dist/text/textDomainFormatted.js.map +1 -1
  665. package/dist/text/textDomainFormattedDefault.js +2 -5
  666. package/dist/text/textDomainFormattedDefault.js.map +1 -1
  667. package/dist/treeDataStore.js +2 -3
  668. package/dist/treeDataStore.js.map +1 -1
  669. package/dist/treeFactory.js +7 -7
  670. package/dist/treeFactory.js.map +1 -1
  671. package/dist/util/arrayUtilities.js +5 -6
  672. package/dist/util/arrayUtilities.js.map +1 -1
  673. package/dist/util/bTreeUtils.js +3 -4
  674. package/dist/util/bTreeUtils.js.map +1 -1
  675. package/dist/util/brand.js +6 -5
  676. package/dist/util/brand.js.map +1 -1
  677. package/dist/util/brandedMap.js +2 -3
  678. package/dist/util/brandedMap.js.map +1 -1
  679. package/dist/util/breakable.d.ts.map +1 -1
  680. package/dist/util/breakable.js +7 -4
  681. package/dist/util/breakable.js.map +1 -1
  682. package/dist/util/cloneWithReplacements.js +1 -2
  683. package/dist/util/cloneWithReplacements.js.map +1 -1
  684. package/dist/util/compressedIds.js +29 -7
  685. package/dist/util/compressedIds.js.map +1 -1
  686. package/dist/util/idAllocator.js +3 -3
  687. package/dist/util/idAllocator.js.map +1 -1
  688. package/dist/util/nestedMap.js +15 -17
  689. package/dist/util/nestedMap.js.map +1 -1
  690. package/dist/util/nestedSet.js +2 -3
  691. package/dist/util/nestedSet.js.map +1 -1
  692. package/dist/util/offsetList.js +2 -4
  693. package/dist/util/offsetList.js.map +1 -1
  694. package/dist/util/opaque.js +2 -3
  695. package/dist/util/opaque.js.map +1 -1
  696. package/dist/util/rangeMap.js +6 -2
  697. package/dist/util/rangeMap.js.map +1 -1
  698. package/dist/util/readSnapshotBlob.d.ts.map +1 -1
  699. package/dist/util/referenceCounting.js +1 -0
  700. package/dist/util/referenceCounting.js.map +1 -1
  701. package/dist/util/stackyIterator.js +3 -2
  702. package/dist/util/stackyIterator.js.map +1 -1
  703. package/dist/util/typeUtils.js +1 -2
  704. package/dist/util/typeUtils.js.map +1 -1
  705. package/dist/util/typeboxBrand.js +2 -3
  706. package/dist/util/typeboxBrand.js.map +1 -1
  707. package/dist/util/utils.d.ts +2 -2
  708. package/dist/util/utils.d.ts.map +1 -1
  709. package/dist/util/utils.js +32 -32
  710. package/dist/util/utils.js.map +1 -1
  711. package/lib/api.d.ts +9 -1
  712. package/lib/api.d.ts.map +1 -1
  713. package/lib/api.js.map +1 -1
  714. package/lib/codec/codec.d.ts +2 -2
  715. package/lib/codec/codec.d.ts.map +1 -1
  716. package/lib/codec/codec.js +2 -0
  717. package/lib/codec/codec.js.map +1 -1
  718. package/lib/codec/discriminatedUnions.js +1 -0
  719. package/lib/codec/discriminatedUnions.js.map +1 -1
  720. package/lib/codec/versioned/codec.d.ts.map +1 -1
  721. package/lib/codec/versioned/codec.js +2 -0
  722. package/lib/codec/versioned/codec.js.map +1 -1
  723. package/lib/componentApi.d.ts.map +1 -1
  724. package/lib/componentApi.js +20 -17
  725. package/lib/componentApi.js.map +1 -1
  726. package/lib/core/change-family/editBuilder.js +1 -0
  727. package/lib/core/change-family/editBuilder.js.map +1 -1
  728. package/lib/core/index.d.ts +2 -2
  729. package/lib/core/index.d.ts.map +1 -1
  730. package/lib/core/index.js +2 -2
  731. package/lib/core/index.js.map +1 -1
  732. package/lib/core/rebase/index.d.ts +1 -1
  733. package/lib/core/rebase/index.d.ts.map +1 -1
  734. package/lib/core/rebase/index.js +1 -1
  735. package/lib/core/rebase/index.js.map +1 -1
  736. package/lib/core/rebase/revisionTagCodec.js +3 -1
  737. package/lib/core/rebase/revisionTagCodec.js.map +1 -1
  738. package/lib/core/rebase/types.d.ts +12 -1
  739. package/lib/core/rebase/types.d.ts.map +1 -1
  740. package/lib/core/rebase/types.js +3 -0
  741. package/lib/core/rebase/types.js.map +1 -1
  742. package/lib/core/schema-stored/schema.js +5 -0
  743. package/lib/core/schema-stored/schema.js.map +1 -1
  744. package/lib/core/schema-stored/storedSchemaRepository.js +4 -2
  745. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  746. package/lib/core/tree/anchorSet.js +61 -54
  747. package/lib/core/tree/anchorSet.js.map +1 -1
  748. package/lib/core/tree/deltaUtil.d.ts +34 -9
  749. package/lib/core/tree/deltaUtil.d.ts.map +1 -1
  750. package/lib/core/tree/deltaUtil.js +41 -10
  751. package/lib/core/tree/deltaUtil.js.map +1 -1
  752. package/lib/core/tree/detachedFieldIndex.js +23 -21
  753. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  754. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +10 -10
  755. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  756. package/lib/core/tree/detachedFieldIndexCodecV1.js +2 -0
  757. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  758. package/lib/core/tree/detachedFieldIndexCodecV2.js +2 -0
  759. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  760. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +3 -3
  761. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  762. package/lib/core/tree/index.d.ts +1 -1
  763. package/lib/core/tree/index.d.ts.map +1 -1
  764. package/lib/core/tree/index.js +1 -1
  765. package/lib/core/tree/index.js.map +1 -1
  766. package/lib/core/tree/persistedTreeTextFormat.d.ts +4 -4
  767. package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  768. package/lib/core/tree/sparseTree.js +15 -11
  769. package/lib/core/tree/sparseTree.js.map +1 -1
  770. package/lib/entrypoints/alpha.d.ts +1 -1
  771. package/lib/entrypoints/alpha.d.ts.map +1 -1
  772. package/lib/entrypoints/alpha.js +1 -1
  773. package/lib/entrypoints/alpha.js.map +1 -1
  774. package/lib/entrypoints/beta.d.ts +1 -1
  775. package/lib/entrypoints/beta.d.ts.map +1 -1
  776. package/lib/entrypoints/beta.js +1 -1
  777. package/lib/entrypoints/beta.js.map +1 -1
  778. package/lib/entrypoints/legacy.d.ts +1 -1
  779. package/lib/entrypoints/legacy.d.ts.map +1 -1
  780. package/lib/entrypoints/legacy.js +1 -1
  781. package/lib/entrypoints/legacy.js.map +1 -1
  782. package/lib/entrypoints/public.d.ts +1 -1
  783. package/lib/entrypoints/public.d.ts.map +1 -1
  784. package/lib/entrypoints/public.js +1 -1
  785. package/lib/entrypoints/public.js.map +1 -1
  786. package/lib/extensibleUnionNode.d.ts.map +1 -1
  787. package/lib/extensibleUnionNode.js +2 -2
  788. package/lib/extensibleUnionNode.js.map +1 -1
  789. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  790. package/lib/feature-libraries/chunked-forest/basicChunk.js +14 -1
  791. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  792. package/lib/feature-libraries/chunked-forest/chunkTree.js +14 -6
  793. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  794. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  795. package/lib/feature-libraries/chunked-forest/chunkedForest.js +18 -12
  796. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  797. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +1 -3
  798. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  799. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +8 -0
  800. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  801. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -0
  802. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  803. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +1 -0
  804. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  805. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  806. package/lib/feature-libraries/chunked-forest/codec/codecs.js +2 -0
  807. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  808. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +28 -12
  809. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  810. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +2 -2
  811. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
  812. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +9 -0
  813. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  814. package/lib/feature-libraries/chunked-forest/sequenceChunk.js +1 -0
  815. package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  816. package/lib/feature-libraries/chunked-forest/uniformChunk.js +71 -13
  817. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  818. package/lib/feature-libraries/comparison-forest/comparisonForest.js +79 -79
  819. package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -1
  820. package/lib/feature-libraries/cursorComparator.d.ts +8 -0
  821. package/lib/feature-libraries/cursorComparator.d.ts.map +1 -1
  822. package/lib/feature-libraries/cursorComparator.js +43 -9
  823. package/lib/feature-libraries/cursorComparator.js.map +1 -1
  824. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +3 -0
  825. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  826. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +2 -0
  827. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  828. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +2 -0
  829. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  830. package/lib/feature-libraries/flex-tree/context.js +19 -3
  831. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  832. package/lib/feature-libraries/flex-tree/lazyEntity.js +12 -12
  833. package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  834. package/lib/feature-libraries/flex-tree/lazyField.js +25 -27
  835. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  836. package/lib/feature-libraries/flex-tree/lazyNode.js +22 -21
  837. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  838. package/lib/feature-libraries/forest-summary/forestSummarizer.js +122 -117
  839. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  840. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +49 -32
  841. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  842. package/lib/feature-libraries/index.d.ts +1 -1
  843. package/lib/feature-libraries/index.js.map +1 -1
  844. package/lib/feature-libraries/indexing/anchorTreeIndex.js +33 -29
  845. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  846. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -12
  847. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  848. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +63 -10
  849. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  850. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  851. package/lib/feature-libraries/modular-schema/fieldKind.js +10 -0
  852. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  853. package/lib/feature-libraries/modular-schema/filterEdits.d.ts +13 -0
  854. package/lib/feature-libraries/modular-schema/filterEdits.d.ts.map +1 -0
  855. package/lib/feature-libraries/modular-schema/filterEdits.js +46 -0
  856. package/lib/feature-libraries/modular-schema/filterEdits.js.map +1 -0
  857. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  858. package/lib/feature-libraries/modular-schema/genericFieldKind.js +5 -2
  859. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  860. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +2 -2
  861. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  862. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  863. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  864. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  865. package/lib/feature-libraries/modular-schema/invert.d.ts +1 -1
  866. package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -1
  867. package/lib/feature-libraries/modular-schema/invert.js +6 -30
  868. package/lib/feature-libraries/modular-schema/invert.js.map +1 -1
  869. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +5 -7
  870. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  871. package/lib/feature-libraries/modular-schema/minimizeModularChange.js +458 -8
  872. package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  873. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -10
  874. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  875. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +20 -85
  876. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  877. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +13 -1
  878. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -1
  879. package/lib/feature-libraries/modular-schema/modularChangeUtils.js +100 -3
  880. package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -1
  881. package/lib/feature-libraries/modular-schema/prune.d.ts +2 -3
  882. package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -1
  883. package/lib/feature-libraries/modular-schema/prune.js +25 -7
  884. package/lib/feature-libraries/modular-schema/prune.js.map +1 -1
  885. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -3
  886. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  887. package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js +1 -0
  888. package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -1
  889. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  890. package/lib/feature-libraries/object-forest/objectForest.js +273 -266
  891. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  892. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  893. package/lib/feature-libraries/optional-field/optionalField.js +24 -32
  894. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  895. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +1 -1
  896. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  897. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +1 -1
  898. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  899. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  900. package/lib/feature-libraries/schema-index/schemaSummarizer.js +3 -0
  901. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  902. package/lib/feature-libraries/schemaChecker.d.ts +9 -19
  903. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
  904. package/lib/feature-libraries/schemaChecker.js +133 -49
  905. package/lib/feature-libraries/schemaChecker.js.map +1 -1
  906. package/lib/feature-libraries/sequence-field/compose.js +6 -0
  907. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  908. package/lib/feature-libraries/sequence-field/filterEdits.d.ts +3 -3
  909. package/lib/feature-libraries/sequence-field/filterEdits.d.ts.map +1 -1
  910. package/lib/feature-libraries/sequence-field/filterEdits.js +31 -12
  911. package/lib/feature-libraries/sequence-field/filterEdits.js.map +1 -1
  912. package/lib/feature-libraries/sequence-field/formatV1.d.ts +3 -3
  913. package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  914. package/lib/feature-libraries/sequence-field/formatV2.d.ts +3 -3
  915. package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  916. package/lib/feature-libraries/sequence-field/formatV3.d.ts +2 -2
  917. package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  918. package/lib/feature-libraries/sequence-field/markListFactory.js +3 -4
  919. package/lib/feature-libraries/sequence-field/markListFactory.js.map +1 -1
  920. package/lib/feature-libraries/sequence-field/markQueue.js +4 -2
  921. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  922. package/lib/feature-libraries/sequence-field/rebase.js +6 -0
  923. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  924. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  925. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +9 -9
  926. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  927. package/lib/feature-libraries/sequence-field/utils.d.ts +2 -2
  928. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  929. package/lib/feature-libraries/sequence-field/utils.js +3 -15
  930. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  931. package/lib/feature-libraries/treeCursorUtils.js +13 -9
  932. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  933. package/lib/index.d.ts +4 -29
  934. package/lib/index.d.ts.map +1 -1
  935. package/lib/index.js +2 -17
  936. package/lib/index.js.map +1 -1
  937. package/lib/internalTypes.d.ts +1 -1
  938. package/lib/internalTypes.d.ts.map +1 -1
  939. package/lib/internalTypes.js.map +1 -1
  940. package/lib/packageVersion.d.ts +1 -1
  941. package/lib/packageVersion.d.ts.map +1 -1
  942. package/lib/packageVersion.js +1 -1
  943. package/lib/packageVersion.js.map +1 -1
  944. package/lib/serializableDomainSchema.d.ts +1 -1
  945. package/lib/shared-tree/history.d.ts.map +1 -1
  946. package/lib/shared-tree/history.js +32 -13
  947. package/lib/shared-tree/history.js.map +1 -1
  948. package/lib/shared-tree/independentView.d.ts +27 -3
  949. package/lib/shared-tree/independentView.d.ts.map +1 -1
  950. package/lib/shared-tree/independentView.js +30 -2
  951. package/lib/shared-tree/independentView.js.map +1 -1
  952. package/lib/shared-tree/index.d.ts +2 -1
  953. package/lib/shared-tree/index.d.ts.map +1 -1
  954. package/lib/shared-tree/index.js +2 -1
  955. package/lib/shared-tree/index.js.map +1 -1
  956. package/lib/shared-tree/schematizingTreeView.d.ts +14 -4
  957. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  958. package/lib/shared-tree/schematizingTreeView.js +109 -39
  959. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  960. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  961. package/lib/shared-tree/sharedTree.js +24 -15
  962. package/lib/shared-tree/sharedTree.js.map +1 -1
  963. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  964. package/lib/shared-tree/sharedTreeChangeEnricher.js +12 -4
  965. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  966. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  967. package/lib/shared-tree/sharedTreeChangeFamily.js +6 -3
  968. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  969. package/lib/shared-tree/sharedTreeEditBuilder.js +2 -0
  970. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  971. package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
  972. package/lib/shared-tree/transactionMinimize.js +4 -3
  973. package/lib/shared-tree/transactionMinimize.js.map +1 -1
  974. package/lib/shared-tree/treeAlpha.d.ts +5 -16
  975. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  976. package/lib/shared-tree/treeAlpha.js +13 -6
  977. package/lib/shared-tree/treeAlpha.js.map +1 -1
  978. package/{dist/simple-tree/api → lib/shared-tree}/treeBeta.d.ts +8 -65
  979. package/lib/shared-tree/treeBeta.d.ts.map +1 -0
  980. package/lib/shared-tree/treeBeta.js +64 -0
  981. package/lib/shared-tree/treeBeta.js.map +1 -0
  982. package/lib/shared-tree/treeCheckout.d.ts +5 -0
  983. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  984. package/lib/shared-tree/treeCheckout.js +985 -906
  985. package/lib/shared-tree/treeCheckout.js.map +1 -1
  986. package/lib/shared-tree/unhydratedTreeContext.js +3 -4
  987. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
  988. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  989. package/lib/shared-tree-core/branch.js +22 -18
  990. package/lib/shared-tree-core/branch.js.map +1 -1
  991. package/lib/shared-tree-core/branchCommitCounter.js +35 -32
  992. package/lib/shared-tree-core/branchCommitCounter.js.map +1 -1
  993. package/lib/shared-tree-core/branchCommitEnricher.js +9 -8
  994. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  995. package/lib/shared-tree-core/customMetadataFormat.d.ts.map +1 -1
  996. package/lib/shared-tree-core/defaultResubmitMachine.js +11 -9
  997. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  998. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  999. package/lib/shared-tree-core/editManager.js +73 -44
  1000. package/lib/shared-tree-core/editManager.js.map +1 -1
  1001. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  1002. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  1003. package/lib/shared-tree-core/editManagerCodecsCommons.js +32 -34
  1004. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  1005. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  1006. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  1007. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +4 -4
  1008. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  1009. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -1
  1010. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  1011. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +2 -1
  1012. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  1013. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  1014. package/lib/shared-tree-core/editManagerSummarizer.js +6 -1
  1015. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  1016. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -1
  1017. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  1018. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +2 -1
  1019. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  1020. package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  1021. package/lib/shared-tree-core/sharedTreeCore.js +45 -23
  1022. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  1023. package/lib/shared-tree-core/transaction.js +36 -39
  1024. package/lib/shared-tree-core/transaction.js.map +1 -1
  1025. package/lib/shared-tree-core/versionedSummarizer.js +4 -0
  1026. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
  1027. package/lib/simple-tree/api/cloneTree.d.ts +11 -0
  1028. package/lib/simple-tree/api/cloneTree.d.ts.map +1 -0
  1029. package/lib/simple-tree/api/cloneTree.js +28 -0
  1030. package/lib/simple-tree/api/cloneTree.js.map +1 -0
  1031. package/lib/simple-tree/api/configuration.d.ts +4 -4
  1032. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  1033. package/lib/simple-tree/api/configuration.js +19 -0
  1034. package/lib/simple-tree/api/configuration.js.map +1 -1
  1035. package/lib/simple-tree/api/discrepancies.d.ts +36 -3
  1036. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  1037. package/lib/simple-tree/api/discrepancies.js +40 -14
  1038. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  1039. package/lib/simple-tree/api/index.d.ts +5 -4
  1040. package/lib/simple-tree/api/index.d.ts.map +1 -1
  1041. package/lib/simple-tree/api/index.js +2 -2
  1042. package/lib/simple-tree/api/index.js.map +1 -1
  1043. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +22 -3
  1044. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  1045. package/lib/simple-tree/api/schemaCompatibilityTester.js +136 -7
  1046. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  1047. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -7
  1048. package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  1049. package/lib/simple-tree/api/schemaCreationUtilities.js +1 -3
  1050. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  1051. package/lib/simple-tree/api/schemaFactory.d.ts +4 -9
  1052. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  1053. package/lib/simple-tree/api/schemaFactory.js +9 -8
  1054. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  1055. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +18 -20
  1056. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  1057. package/lib/simple-tree/api/schemaFactoryAlpha.js +78 -81
  1058. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  1059. package/lib/simple-tree/api/schemaFactoryBeta.d.ts +7 -9
  1060. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  1061. package/lib/simple-tree/api/schemaFactoryBeta.js +32 -35
  1062. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  1063. package/lib/simple-tree/api/schemaStatics.d.ts +7 -7
  1064. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  1065. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +46 -2
  1066. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  1067. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +48 -6
  1068. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  1069. package/lib/simple-tree/api/transactionTypes.d.ts +4 -4
  1070. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  1071. package/lib/simple-tree/api/tree.d.ts +243 -58
  1072. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  1073. package/lib/simple-tree/api/tree.js +2 -3
  1074. package/lib/simple-tree/api/tree.js.map +1 -1
  1075. package/lib/simple-tree/api/treeChangeEvents.d.ts +16 -4
  1076. package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  1077. package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
  1078. package/lib/simple-tree/api/treeChangeEventsBeta.d.ts +209 -0
  1079. package/lib/simple-tree/api/treeChangeEventsBeta.d.ts.map +1 -0
  1080. package/lib/simple-tree/api/{treeAlpha.js → treeChangeEventsBeta.js} +1 -1
  1081. package/lib/simple-tree/api/treeChangeEventsBeta.js.map +1 -0
  1082. package/lib/simple-tree/api/treeNodeApi.d.ts +1 -75
  1083. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  1084. package/lib/simple-tree/api/treeNodeApi.js +1 -1
  1085. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  1086. package/lib/simple-tree/api/typesUnsafe.d.ts +8 -6
  1087. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  1088. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  1089. package/lib/simple-tree/core/allowedTypes.js +12 -3
  1090. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  1091. package/lib/simple-tree/core/context.js +3 -0
  1092. package/lib/simple-tree/core/context.js.map +1 -1
  1093. package/lib/simple-tree/core/index.d.ts +1 -1
  1094. package/lib/simple-tree/core/index.d.ts.map +1 -1
  1095. package/lib/simple-tree/core/index.js +1 -1
  1096. package/lib/simple-tree/core/index.js.map +1 -1
  1097. package/lib/simple-tree/core/toStored.d.ts +7 -0
  1098. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  1099. package/lib/simple-tree/core/toStored.js.map +1 -1
  1100. package/lib/simple-tree/core/treeNode.d.ts +3 -4
  1101. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  1102. package/lib/simple-tree/core/treeNode.js +29 -30
  1103. package/lib/simple-tree/core/treeNode.js.map +1 -1
  1104. package/lib/simple-tree/core/treeNodeKernel.js +181 -179
  1105. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  1106. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  1107. package/lib/simple-tree/core/treeNodeValid.js +22 -22
  1108. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  1109. package/lib/simple-tree/core/unhydratedFlexTree.js +173 -146
  1110. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  1111. package/lib/simple-tree/core/withType.d.ts +7 -9
  1112. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  1113. package/lib/simple-tree/core/withType.js +5 -6
  1114. package/lib/simple-tree/core/withType.js.map +1 -1
  1115. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  1116. package/lib/simple-tree/fieldSchema.js +23 -5
  1117. package/lib/simple-tree/fieldSchema.js.map +1 -1
  1118. package/lib/simple-tree/index.d.ts +2 -2
  1119. package/lib/simple-tree/index.d.ts.map +1 -1
  1120. package/lib/simple-tree/index.js +2 -2
  1121. package/lib/simple-tree/index.js.map +1 -1
  1122. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  1123. package/lib/simple-tree/leafNodeSchema.js +16 -15
  1124. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  1125. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +3 -2
  1126. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  1127. package/lib/simple-tree/node-kinds/array/arrayNode.js +28 -32
  1128. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  1129. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  1130. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +6 -6
  1131. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  1132. package/lib/simple-tree/node-kinds/map/mapNode.js +10 -17
  1133. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  1134. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  1135. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  1136. package/lib/simple-tree/node-kinds/object/objectNode.js +25 -28
  1137. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  1138. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +1 -1
  1139. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  1140. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  1141. package/lib/simple-tree/node-kinds/record/recordNode.js +10 -14
  1142. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  1143. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -2
  1144. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  1145. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  1146. package/lib/tableSchema.d.ts +2 -87
  1147. package/lib/tableSchema.d.ts.map +1 -1
  1148. package/lib/tableSchema.js +309 -275
  1149. package/lib/tableSchema.js.map +1 -1
  1150. package/lib/text/codePointUtils.d.ts +16 -3
  1151. package/lib/text/codePointUtils.d.ts.map +1 -1
  1152. package/lib/text/codePointUtils.js +22 -10
  1153. package/lib/text/codePointUtils.js.map +1 -1
  1154. package/lib/text/textDomain.d.ts +7 -1
  1155. package/lib/text/textDomain.d.ts.map +1 -1
  1156. package/lib/text/textDomain.js +21 -17
  1157. package/lib/text/textDomain.js.map +1 -1
  1158. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  1159. package/lib/text/textDomainFormatted.js +43 -32
  1160. package/lib/text/textDomainFormatted.js.map +1 -1
  1161. package/lib/text/textDomainFormattedDefault.js +2 -5
  1162. package/lib/text/textDomainFormattedDefault.js.map +1 -1
  1163. package/lib/util/brand.js +1 -0
  1164. package/lib/util/brand.js.map +1 -1
  1165. package/lib/util/breakable.d.ts.map +1 -1
  1166. package/lib/util/breakable.js +3 -0
  1167. package/lib/util/breakable.js.map +1 -1
  1168. package/lib/util/compressedIds.js +22 -0
  1169. package/lib/util/compressedIds.js.map +1 -1
  1170. package/lib/util/nestedMap.js +2 -4
  1171. package/lib/util/nestedMap.js.map +1 -1
  1172. package/lib/util/offsetList.js +2 -4
  1173. package/lib/util/offsetList.js.map +1 -1
  1174. package/lib/util/rangeMap.js +4 -0
  1175. package/lib/util/rangeMap.js.map +1 -1
  1176. package/lib/util/readSnapshotBlob.d.ts.map +1 -1
  1177. package/lib/util/referenceCounting.js +1 -0
  1178. package/lib/util/referenceCounting.js.map +1 -1
  1179. package/lib/util/stackyIterator.js +3 -2
  1180. package/lib/util/stackyIterator.js.map +1 -1
  1181. package/lib/util/utils.d.ts +2 -2
  1182. package/lib/util/utils.d.ts.map +1 -1
  1183. package/package.json +67 -95
  1184. package/src/api.ts +11 -0
  1185. package/src/core/index.ts +6 -2
  1186. package/src/core/rebase/index.ts +1 -0
  1187. package/src/core/rebase/types.ts +16 -1
  1188. package/src/core/tree/anchorSet.ts +2 -2
  1189. package/src/core/tree/deltaUtil.ts +67 -13
  1190. package/src/core/tree/index.ts +5 -2
  1191. package/src/entrypoints/alpha.ts +21 -20
  1192. package/src/entrypoints/beta.ts +14 -5
  1193. package/src/entrypoints/legacy.ts +14 -5
  1194. package/src/entrypoints/public.ts +1 -5
  1195. package/src/extensibleUnionNode.ts +1 -2
  1196. package/src/feature-libraries/cursorComparator.ts +57 -9
  1197. package/src/feature-libraries/index.ts +1 -1
  1198. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +77 -12
  1199. package/src/feature-libraries/modular-schema/filterEdits.ts +108 -0
  1200. package/src/feature-libraries/modular-schema/genericFieldKind.ts +7 -4
  1201. package/src/feature-libraries/modular-schema/index.ts +5 -2
  1202. package/src/feature-libraries/modular-schema/invert.ts +16 -61
  1203. package/src/feature-libraries/modular-schema/minimizeModularChange.ts +831 -10
  1204. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +10 -124
  1205. package/src/feature-libraries/modular-schema/modularChangeUtils.ts +164 -2
  1206. package/src/feature-libraries/modular-schema/prune.ts +52 -10
  1207. package/src/feature-libraries/optional-field/optionalField.ts +30 -42
  1208. package/src/feature-libraries/schemaChecker.ts +198 -82
  1209. package/src/feature-libraries/sequence-field/filterEdits.ts +62 -26
  1210. package/src/feature-libraries/sequence-field/utils.ts +7 -19
  1211. package/src/index.ts +10 -39
  1212. package/src/internalTypes.ts +1 -1
  1213. package/src/packageVersion.ts +1 -1
  1214. package/src/shared-tree/history.ts +41 -19
  1215. package/src/shared-tree/independentView.ts +40 -3
  1216. package/src/shared-tree/index.ts +5 -1
  1217. package/src/shared-tree/schematizingTreeView.ts +77 -23
  1218. package/src/shared-tree/sharedTree.ts +2 -1
  1219. package/src/shared-tree/transactionMinimize.ts +13 -4
  1220. package/src/shared-tree/treeAlpha.ts +17 -31
  1221. package/src/{simple-tree/api → shared-tree}/treeBeta.ts +56 -167
  1222. package/src/shared-tree/treeCheckout.ts +82 -9
  1223. package/src/shared-tree-core/editManager.ts +16 -8
  1224. package/src/shared-tree-core/editManagerCodecsCommons.ts +30 -34
  1225. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +1 -1
  1226. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -2
  1227. package/src/simple-tree/api/cloneTree.ts +47 -0
  1228. package/src/simple-tree/api/configuration.ts +4 -4
  1229. package/src/simple-tree/api/discrepancies.ts +100 -5
  1230. package/src/simple-tree/api/index.ts +22 -22
  1231. package/src/simple-tree/api/schemaCompatibilityTester.ts +185 -11
  1232. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
  1233. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +87 -6
  1234. package/src/simple-tree/api/transactionTypes.ts +4 -4
  1235. package/src/simple-tree/api/tree.ts +318 -87
  1236. package/src/simple-tree/api/treeChangeEvents.ts +16 -4
  1237. package/src/simple-tree/api/treeChangeEventsBeta.ts +245 -0
  1238. package/src/simple-tree/api/treeNodeApi.ts +6 -85
  1239. package/src/simple-tree/api/typesUnsafe.ts +8 -6
  1240. package/src/simple-tree/core/index.ts +1 -1
  1241. package/src/simple-tree/core/toStored.ts +8 -0
  1242. package/src/simple-tree/core/treeNode.ts +3 -10
  1243. package/src/simple-tree/core/treeNodeValid.ts +3 -1
  1244. package/src/simple-tree/core/withType.ts +8 -11
  1245. package/src/simple-tree/index.ts +7 -7
  1246. package/src/simple-tree/node-kinds/array/arrayNode.ts +14 -12
  1247. package/src/simple-tree/node-kinds/map/mapNode.ts +14 -15
  1248. package/src/simple-tree/node-kinds/object/objectNode.ts +3 -6
  1249. package/src/simple-tree/node-kinds/record/recordNode.ts +6 -8
  1250. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +2 -1
  1251. package/src/tableSchema.ts +8 -187
  1252. package/src/text/codePointUtils.ts +25 -14
  1253. package/src/text/textDomain.ts +15 -2
  1254. package/src/text/textDomainFormatted.ts +9 -4
  1255. package/tsconfig.json +1 -1
  1256. package/alpha.d.ts +0 -11
  1257. package/beta.d.ts +0 -11
  1258. package/dist/simple-tree/api/treeAlpha.d.ts +0 -126
  1259. package/dist/simple-tree/api/treeAlpha.d.ts.map +0 -1
  1260. package/dist/simple-tree/api/treeAlpha.js.map +0 -1
  1261. package/dist/simple-tree/api/treeBeta.d.ts.map +0 -1
  1262. package/dist/simple-tree/api/treeBeta.js +0 -83
  1263. package/dist/simple-tree/api/treeBeta.js.map +0 -1
  1264. package/docs/main/runtime-schema-upgrade.md +0 -208
  1265. package/internal.d.ts +0 -11
  1266. package/legacy.d.ts +0 -11
  1267. package/lib/simple-tree/api/treeAlpha.d.ts +0 -126
  1268. package/lib/simple-tree/api/treeAlpha.d.ts.map +0 -1
  1269. package/lib/simple-tree/api/treeAlpha.js.map +0 -1
  1270. package/lib/simple-tree/api/treeBeta.d.ts.map +0 -1
  1271. package/lib/simple-tree/api/treeBeta.js +0 -77
  1272. package/lib/simple-tree/api/treeBeta.js.map +0 -1
  1273. package/src/simple-tree/api/treeAlpha.ts +0 -153
  1274. /package/api-extractor/{api-extractor.current.json → api-extractor-report.current.json} +0 -0
  1275. /package/api-extractor/{api-extractor.legacy.json → api-extractor-report.legacy.json} +0 -0
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { FluidReadonlyMap } from "@fluidframework/core-interfaces/internal";
5
+ import type { FluidIterableIterator, FluidReadonlyMap } from "@fluidframework/core-interfaces";
6
6
  import { type RestrictiveStringRecord } from "../../../util/index.js";
7
7
  import type { NodeSchemaOptionsAlpha } from "../../api/index.js";
8
8
  import { NodeKind, type TreeNode, type ImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaCorePrivate } from "../../core/index.js";
@@ -15,7 +15,7 @@ import type { MapNodeCustomizableSchema, MapNodePojoEmulationSchema } from "./ma
15
15
  *
16
16
  * @sealed @public
17
17
  */
18
- export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>, TreeNode {
18
+ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends FluidReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>, TreeNode {
19
19
  /**
20
20
  * Adds or updates an entry in the map with a specified `key` and a `value`.
21
21
  *
@@ -48,7 +48,7 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
48
48
  * Note: no guarantees are made regarding the order of the keys returned.
49
49
  * If your usage scenario depends on consistent ordering, you will need to sort these yourself.
50
50
  */
51
- keys(): IterableIterator<string>;
51
+ keys(): FluidIterableIterator<string>;
52
52
  /**
53
53
  * Returns an iterable of values in the map.
54
54
  *
@@ -56,7 +56,7 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
56
56
  * Note: no guarantees are made regarding the order of the values returned.
57
57
  * If your usage scenario depends on consistent ordering, you will need to sort these yourself.
58
58
  */
59
- values(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>>;
59
+ values(): FluidIterableIterator<TreeNodeFromImplicitAllowedTypes<T>>;
60
60
  /**
61
61
  * Returns an iterable of key, value pairs for every entry in the map.
62
62
  *
@@ -64,7 +64,7 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
64
64
  * Note: no guarantees are made regarding the order of the entries returned.
65
65
  * If your usage scenario depends on consistent ordering, you will need to sort these yourself.
66
66
  */
67
- entries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>;
67
+ entries(): FluidIterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>;
68
68
  /**
69
69
  * Executes the provided function once per each key/value pair in this map.
70
70
  *
@@ -72,7 +72,7 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
72
72
  * Note: no guarantees are made regarding the order in which the function is called with respect to the map's entries.
73
73
  * If your usage scenario depends on consistent ordering, you will need to account for this.
74
74
  */
75
- forEach(callbackfn: (value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>) => void, thisArg?: any): void;
75
+ forEach(callbackfn: (value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: FluidReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>) => void, thisArg?: any): void;
76
76
  }
77
77
  /**
78
78
  * {@link TreeMapNode} with FluidReadonlyMap-based iteration.
@@ -1 +1 @@
1
- {"version":3,"file":"mapNode.d.ts","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/map/mapNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAYjF,OAAO,EAKN,KAAK,uBAAuB,EAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACX,sBAAsB,EAGtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAIN,QAAQ,EAIR,KAAK,QAAQ,EAMb,KAAK,oBAAoB,EACzB,KAAK,0CAA0C,EAE/C,KAAK,gCAAgC,EAIrC,KAAK,yBAAyB,EAM9B,MAAM,qBAAqB,CAAC;AAa7B,OAAO,KAAK,EACX,yBAAyB,EACzB,0BAA0B,EAE1B,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,CACjF,SAAQ,WAAW,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC,CAAC,CAAC,EAC/D,QAAQ;IACT;;;;;;;;OAQG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,0CAA0C,CAAC,CAAC,CAAC,GAAG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EACX,aAAa,EAAE,0CAA0C,CAAC,CAAC,CAAC,GAC1D,gCAAgC,CAAC,CAAC,CAAC,CAAC;IAEvC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,mBAAmB,CAClB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,0CAA0C,CAAC,CAAC,CAAC,GACtE,gCAAgC,CAAC,CAAC,CAAC,CAAC;CACvC;AA2JD;;;;;;GAMG;AAEH,wBAAgB,SAAS,CACxB,KAAK,SAAS,MAAM,EACpB,KAAK,CAAC,CAAC,SAAS,oBAAoB,EACpC,KAAK,CAAC,uBAAuB,SAAS,OAAO,EAC7C,KAAK,CAAC,eAAe,GAAG,OAAO,EAE/B,UAAU,EAAE,KAAK,EACjB,IAAI,EAAE,CAAC,EACP,uBAAuB,EAAE,uBAAuB,EAChD,eAAe,EAAE,OAAO,EACxB,WAAW,GAAE,sBAAsB,CAAC,eAAe,CAAM,kPAuFzD;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,oBAAoB,IAC7D,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,0CAA0C,CAAC,CAAC,CAAC,CAAC,CAAC,GAC1E,uBAAuB,CAAC,0CAA0C,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.mapSchema = void 0;
7
+ exports.mapSchema = mapSchema;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const internal_2 = require("@fluidframework/telemetry-utils/internal");
10
10
  const index_js_1 = require("../../../core/index.js");
@@ -43,6 +43,7 @@ const handler = {
43
43
  },
44
44
  };
45
45
  class CustomMapNodeBase extends index_js_4.TreeNodeValid {
46
+ static kind = index_js_4.NodeKind.Map;
46
47
  constructor(input) {
47
48
  super(input ?? []);
48
49
  }
@@ -131,7 +132,6 @@ class CustomMapNodeBase extends index_js_4.TreeNodeValid {
131
132
  transaction?.commit();
132
133
  }
133
134
  }
134
- CustomMapNodeBase.kind = index_js_4.NodeKind.Map;
135
135
  /**
136
136
  * Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.
137
137
  *
@@ -141,7 +141,6 @@ CustomMapNodeBase.kind = index_js_4.NodeKind.Map;
141
141
  */
142
142
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
143
143
  function mapSchema(identifier, info, implicitlyConstructable, useMapPrototype, nodeOptions = {}) {
144
- var _a;
145
144
  const normalizedTypes = (0, index_js_4.normalizeAllowedTypes)(info);
146
145
  const lazyAllowedTypesIdentifiers = new internal_1.Lazy(() => new Set(normalizedTypes.evaluate().map((type) => type.identifier)));
147
146
  const lazySimpleAllowedTypes = new internal_1.Lazy(() => {
@@ -150,10 +149,7 @@ function mapSchema(identifier, info, implicitlyConstructable, useMapPrototype, n
150
149
  let privateData;
151
150
  const persistedMetadata = nodeOptions.persistedMetadata;
152
151
  class Schema extends CustomMapNodeBase {
153
- constructor() {
154
- super(...arguments);
155
- this[_a] = "TreeMapNodeSchema";
156
- }
152
+ [Symbol.toStringTag] = "TreeMapNodeSchema";
157
153
  static prepareInstance(instance, flexNode) {
158
154
  if (useMapPrototype) {
159
155
  return new Proxy(instance, handler);
@@ -169,6 +165,7 @@ function mapSchema(identifier, info, implicitlyConstructable, useMapPrototype, n
169
165
  static get simpleAllowedTypes() {
170
166
  return lazySimpleAllowedTypes.value;
171
167
  }
168
+ static constructorCached = undefined;
172
169
  static oneTimeSetup() {
173
170
  const schema = this;
174
171
  return (0, createContext_js_1.getTreeNodeSchemaInitializedData)(this, {
@@ -176,11 +173,15 @@ function mapSchema(identifier, info, implicitlyConstructable, useMapPrototype, n
176
173
  toFlexContent: (data) => mapToFlexContent(data, schema),
177
174
  });
178
175
  }
176
+ static identifier = identifier;
177
+ static info = info;
178
+ static implicitlyConstructable = implicitlyConstructable;
179
179
  static get childTypes() {
180
180
  return normalizedTypes.evaluateSet();
181
181
  }
182
- // eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.
183
- get [(_a = Symbol.toStringTag, index_js_4.typeNameSymbol)]() {
182
+ static metadata = nodeOptions.metadata ?? {};
183
+ static persistedMetadata = persistedMetadata;
184
+ get [index_js_4.schemaIdentifierBrand]() {
184
185
  return identifier;
185
186
  }
186
187
  get [index_js_4.typeSchemaSymbol]() {
@@ -190,16 +191,9 @@ function mapSchema(identifier, info, implicitlyConstructable, useMapPrototype, n
190
191
  return (privateData ??= (0, index_js_4.createTreeNodeSchemaPrivateData)(this, [normalizedTypes]));
191
192
  }
192
193
  }
193
- Schema.constructorCached = undefined;
194
- Schema.identifier = identifier;
195
- Schema.info = info;
196
- Schema.implicitlyConstructable = implicitlyConstructable;
197
- Schema.metadata = nodeOptions.metadata ?? {};
198
- Schema.persistedMetadata = persistedMetadata;
199
194
  const schemaErased = Schema;
200
195
  return schemaErased;
201
196
  }
202
- exports.mapSchema = mapSchema;
203
197
  /**
204
198
  * {@link TreeNodeSchemaInitializedData.shallowCompatibilityTest} for Map nodes.
205
199
  */
@@ -1 +1 @@
1
- {"version":3,"file":"mapNode.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/map/mapNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAAmE;AACnE,uEAAsE;AAEtE,qDAA6D;AAC7D,kEAM6C;AAC7C,qDAMgC;AAMhC,kDA2B6B;AAC7B,6DAA0E;AAC1E,yDAAoE;AACpE,yEAAsE;AACtE,yEAAmE;AAEnE,mGAImD;AACnD,4CAA2D;AA6M3D,0IAA0I;AAC1I,uDAAuD;AACvD,8DAA8D;AAC9D,MAAM,OAAO,GAAwC;IACpD,cAAc,EAAE,GAAG,EAAE;QACpB,OAAO,GAAG,CAAC,SAAS,CAAC;IACtB,CAAC;IACD,GAAG,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE;QAC9B,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E,CAAC,CAAC;IAC7E,CAAC;IAED,MAAM,cAAc,GAAG,CACtB,MAAM,CAAC,QAAQ,IAAI,IAAI;QACtB,CAAC,CAAC,+DAA+D;YAChE,IAAI;QACL,CAAC,CAAC,iDAAiD;YAClD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAC4B,CAAC;IAEpD,OAAO,IAAA,uCAA2B,EAAC,cAAc,EAAE,MAAM,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FluidReadonlyMap } from \"@fluidframework/core-interfaces/internal\";\nimport { assert, Lazy } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { MapNodeStoredSchema } from \"../../../core/index.js\";\nimport {\n\tisTreeValue,\n\ttype FlexibleNodeContent,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype OptionalFieldEditBuilder,\n} from \"../../../feature-libraries/index.js\";\nimport {\n\tbrand,\n\tcount,\n\tisReadonlyArray,\n\ttype JsonCompatibleReadOnlyObject,\n\ttype RestrictiveStringRecord,\n} from \"../../../util/index.js\";\nimport type {\n\tNodeSchemaOptionsAlpha,\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Referenced by TSDoc {@link} in this file.\n\tRunTransactionParamsAlpha,\n} from \"../../api/index.js\";\nimport {\n\tCompatibilityLevel,\n\tgetKernel,\n\ttype InnerNode,\n\tNodeKind,\n\ttype TreeNodeSchema,\n\t// eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.\n\ttypeNameSymbol,\n\ttype TreeNode,\n\ttypeSchemaSymbol,\n\tgetInnerNode,\n\ttype InternalTreeNode,\n\ttype UnhydratedFlexTreeNode,\n\tnormalizeAllowedTypes,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeSchemaMetadata,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\tTreeNodeValid,\n\ttype MostDerivedData,\n\ttype TreeNodeSchemaInitializedData,\n\ttype TreeNodeSchemaCorePrivate,\n\tprivateDataSymbol,\n\tcreateTreeNodeSchemaPrivateData,\n\ttype FlexContent,\n\ttype TreeNodeSchemaPrivateData,\n\tAnnotatedAllowedTypesInternal,\n} from \"../../core/index.js\";\nimport { getTreeNodeSchemaInitializedData } from \"../../createContext.js\";\nimport { createFieldSchema, FieldKind } from \"../../fieldSchema.js\";\nimport { tryGetTreeNodeForField } from \"../../getTreeNodeForField.js\";\nimport { prepareForInsertion } from \"../../prepareForInsertion.js\";\nimport type { SchemaType, SimpleAllowedTypeAttributes } from \"../../simpleSchema.js\";\nimport {\n\tunhydratedFlexTreeFromInsertable,\n\ttype FactoryContent,\n\ttype InsertableContent,\n} from \"../../unhydratedFlexTreeFromInsertable.js\";\nimport { recordLikeDataToFlexContent } from \"../common.js\";\n\nimport type {\n\tMapNodeCustomizableSchema,\n\tMapNodePojoEmulationSchema,\n\tMapNodeSchema,\n} from \"./mapNodeTypes.js\";\n\n/**\n * A map of string keys to tree objects.\n *\n * @privateRemarks\n * Add support for `clear` once we have established merge semantics for it.\n *\n * @sealed @public\n */\nexport interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes>\n\textends ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\tTreeNode {\n\t/**\n\t * Adds or updates an entry in the map with a specified `key` and a `value`.\n\t *\n\t * @param key - The key of the element to add to the map.\n\t * @param value - The value of the element to add to the map.\n\t *\n\t * @remarks\n\t * Setting the value at a key to `undefined` is equivalent to calling {@link TreeMapNode.delete} with that key.\n\t */\n\tset(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T> | undefined): void;\n\n\t/**\n\t * Removes the specified element from this map by its `key`.\n\t *\n\t * @remarks\n\t * Note: unlike JavaScript's Map API, this method does not return a flag indicating whether or not the value was\n\t * deleted.\n\t *\n\t * @privateRemarks\n\t * Regarding the choice to not return a boolean: Since this data structure is distributed in nature, it isn't\n\t * possible to tell whether or not the item was deleted as a result of this method call. Returning a \"best guess\"\n\t * is more likely to create issues / promote bad usage patterns than offer useful information.\n\t *\n\t * @param key - The key of the element to remove from the map.\n\t */\n\tdelete(key: string): void;\n\n\t/**\n\t * Returns an iterable of keys in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the keys returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tkeys(): IterableIterator<string>;\n\n\t/**\n\t * Returns an iterable of values in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the values returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tvalues(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>>;\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the entries returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tentries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>;\n\n\t/**\n\t * Executes the provided function once per each key/value pair in this map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order in which the function is called with respect to the map's entries.\n\t * If your usage scenario depends on consistent ordering, you will need to account for this.\n\t */\n\tforEach(\n\t\tcallbackfn: (\n\t\t\tvalue: TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\tkey: string,\n\t\t\tmap: ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\t) => void,\n\t\t// Typing inherited from `ReadonlyMap`.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tthisArg?: any,\n\t): void;\n}\n\n/**\n * {@link TreeMapNode} with FluidReadonlyMap-based iteration.\n *\n * @remarks\n * This is the same as {@link TreeMapNode} except that it extends FluidReadonlyMap\n * instead of the built-in `ReadonlyMap`, insulating against breaking changes\n * in TypeScript's standard library iterator types.\n *\n * @sealed @alpha\n */\nexport interface TreeMapNodeAlpha<T extends ImplicitAllowedTypes = ImplicitAllowedTypes>\n\textends FluidReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\tTreeNode,\n\t\tPick<TreeMapNode<T>, \"set\" | \"delete\"> {\n\t/**\n\t * Removes all elements from the map.\n\t * @remarks\n\t * The merge semantics of this operation are loosely specified. Either of the following may occur:\n\t *\n\t * - `clear` may remove all elements that were in the map when the edit was authored,\n\t * even if some of those elements have since been moved elsewhere in the tree\n\t * (in which case they are removed from their new location).\n\t *\n\t * - `clear` may remove all elements that are in the map when the edit is sequenced,\n\t * even if some of those elements were not yet in the map when the edit was authored.\n\t */\n\tclear(): void;\n\t/**\n\t * Returns the value at `key`, first inserting `fallbackValue` if this map has no entry for `key`.\n\t *\n\t * @param key - The key of the element to return or insert at.\n\t * @param fallbackValue - The value to insert if `key` has no entry.\n\t * @returns The value at `key`, which may be the provided `fallbackValue`\n\t * if the map had no previous entry for `key`.\n\t *\n\t * @remarks\n\t * The check for the presence of an existing entry with the given `key` is performed at the time the edit is authored.\n\t * This has implications for the merge semantics of this operation:\n\t *\n\t * - If no entry is present for `key` at authoring time (thus leading to an insert)\n\t * while a peer concurrently inserts a value for the same `key`,\n\t * then the two inserts will race and the one that is sequenced second will overwrite the value inserted by the one\n\t * that is sequenced first.\n\t *\n\t * - If an entry is present for `key` at authoring time (thus leading to no insert)\n\t * while a peer concurrently deletes the entry for `key`,\n\t * then the map will end up with no entry for `key` no matter how the two edits are sequenced.\n\t *\n\t * - If an entry is present for `key` at authoring time (thus leading to no insert)\n\t * while a peer concurrently inserts a new entry for `key`,\n\t * then the map will end up with the entry set by the peer no matter how the two edits are sequenced.\n\t *\n\t * These last two points mean that, upon sequencing of an edit made with this API,\n\t * there is no guarantee that the entry for the given key will be the current one (if any) or the fallback one.\n\t * If such a guarantee is important, then consider using {@link RunTransactionParamsAlpha.preconditions}\n\t * to ensure the edit only applies when appropriate.\n\t *\n\t * This API is **not** equivalent to the following alternative:\n\t *\n\t * ```typescript\n\t * map.set(key, map.get(key) ?? fallbackValue);\n\t * ```\n\t *\n\t * They differ in the following ways:\n\t *\n\t * - This API treats entries containing `null` values as populated.\n\t * By contrast, the above alternative's usage of `??` means that a `null` entry is treated as equivalent to a missing entry.\n\t *\n\t * - This API only inserts/sets the entry for the given `key` when there is no current one.\n\t * By contrast, the above alternative always performs an insert.\n\t * That insert will throw an error for non-leaf types (objects, maps, arrays, and records) in cases where the entry\n\t * is already populated, because inserting a node that was already inserted is not supported.\n\t * It will always succeed for leaf types (number, string, boolean, null, and handle) since a new node is created\n\t * from the value.\n\t * Note that even in the cases where it does not throw,\n\t * the `set` operation has the potential to overwrite entries that are concurrently inserted even when the map had\n\t * an entry for `key`, which is not the case with this API.\n\t *\n\t * Avoid using this API to write a default value into the document when the application could instead return that\n\t * default when reading a missing entry, which is much less costly.\n\t * A more appropriate use of this API is when the value to be optionally inserted varies with the key.\n\t */\n\tgetOrInsert(\n\t\tkey: string,\n\t\tfallbackValue: InsertableTreeNodeFromImplicitAllowedTypes<T>,\n\t): TreeNodeFromImplicitAllowedTypes<T>;\n\n\t/**\n\t * Returns the value at `key`, first inserting the value produced by `callback` if this map has no entry for `key`.\n\t *\n\t * @param key - The key of the element to return or insert at.\n\t * @param callback - Invoked with `key` to produce the value to insert if `key` has no entry.\n\t * Not invoked if an entry is present.\n\t * @returns The value at `key`, which may be the value produced by `callback`\n\t * if the map had no previous entry for `key`.\n\t *\n\t * @remarks\n\t * This API is equivalent to {@link TreeMapNodeAlpha.getOrInsert} except that the fallback value is computed lazily:\n\t * `callback` is only invoked when the map has no entry for `key`.\n\t * Prefer this API over {@link TreeMapNodeAlpha.getOrInsert} when producing the fallback value is expensive.\n\t *\n\t * The check for the presence of an existing entry with the given `key` is performed at the time the edit is authored.\n\t * See {@link TreeMapNodeAlpha.getOrInsert} for the implications this has on the merge semantics of this operation.\n\t *\n\t * If `callback` throws, no edit is made and the error is propagated to the caller.\n\t * If `callback` sets an entry for `key` in this map, that entry is overwritten with the value `callback` returned.\n\t */\n\tgetOrInsertComputed(\n\t\tkey: string,\n\t\tcallback: (key: string) => InsertableTreeNodeFromImplicitAllowedTypes<T>,\n\t): TreeNodeFromImplicitAllowedTypes<T>;\n}\n\n// TreeMapNode is invariant over schema type, so for this handler to work with all schema, the only possible type for the schema is `any`.\n// This is not ideal, but no alternatives are possible.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst handler: ProxyHandler<TreeMapNodeAlpha<any>> = {\n\tgetPrototypeOf: () => {\n\t\treturn Map.prototype;\n\t},\n\tget: (target, key, receiver) => {\n\t\tconst value = Reflect.get(target, key, receiver) as unknown;\n\t\tif (value !== undefined) {\n\t\t\treturn value;\n\t\t}\n\t\t// If the property is a function on Map.prototype but not on the target,\n\t\t// return a function that throws a descriptive TypeError when called.\n\t\tif (\n\t\t\ttypeof key === \"string\" &&\n\t\t\t!(key in target) &&\n\t\t\tkey in Map.prototype &&\n\t\t\ttypeof (Map.prototype as unknown as Record<string, unknown>)[key] === \"function\"\n\t\t) {\n\t\t\treturn () => {\n\t\t\t\tthrow new TypeError(\n\t\t\t\t\t`MapNode does not support '${key}'. Use the MapNode API (e.g., set, get, delete, keys, values, entries).`,\n\t\t\t\t);\n\t\t\t};\n\t\t}\n\t\treturn value;\n\t},\n};\n\nabstract class CustomMapNodeBase<const T extends ImplicitAllowedTypes> extends TreeNodeValid<\n\tMapNodeInsertableData<T>\n> {\n\tpublic static readonly kind = NodeKind.Map;\n\n\tpublic constructor(input?: InternalTreeNode | MapNodeInsertableData<T> | undefined) {\n\t\tsuper(input ?? []);\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\treturn this.entries();\n\t}\n\n\tprivate get innerNode(): InnerNode {\n\t\treturn getInnerNode(this);\n\t}\n\n\tprivate editor(key: string): OptionalFieldEditBuilder<FlexibleNodeContent> {\n\t\tconst field = this.innerNode.getBoxed(brand(key)) as FlexTreeOptionalField;\n\t\treturn field.editor;\n\t}\n\n\tpublic delete(key: string): void {\n\t\tconst field = this.innerNode.getBoxed(brand(key));\n\t\tthis.editor(key).set(undefined, field.length === 0);\n\t}\n\tpublic *entries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\tconst node = this.innerNode;\n\t\tfor (const key of node.keys()) {\n\t\t\tyield [\n\t\t\t\tkey,\n\t\t\t\ttryGetTreeNodeForField(node.getBoxed(key)) as TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\t];\n\t\t}\n\t}\n\tpublic get(key: string): TreeNodeFromImplicitAllowedTypes<T> {\n\t\tconst node = this.innerNode;\n\t\tconst field = node.getBoxed(brand(key));\n\t\treturn tryGetTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t}\n\tpublic has(key: string): boolean {\n\t\treturn this.innerNode.tryGetField(brand(key)) !== undefined;\n\t}\n\tpublic *keys(): IterableIterator<string> {\n\t\tconst node = this.innerNode;\n\t\tyield* node.keys();\n\t}\n\tpublic set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T>): this {\n\t\tconst kernel = getKernel(this);\n\t\tconst node = this.innerNode;\n\t\tconst innerSchema = this.innerNode.context.schema.nodeSchema.get(\n\t\t\tbrand(kernel.schema.identifier),\n\t\t);\n\t\tassert(\n\t\t\tinnerSchema instanceof MapNodeStoredSchema,\n\t\t\t0xc17 /* Expected MapNodeStoredSchema */,\n\t\t);\n\n\t\tconst mapTree = prepareForInsertion(\n\t\t\tvalue as InsertableContent | undefined,\n\t\t\tcreateFieldSchema(FieldKind.Optional, kernel.schema.info as ImplicitAllowedTypes),\n\t\t\tnode.context,\n\t\t\tinnerSchema.mapFields,\n\t\t);\n\n\t\tconst field = node.getBoxed(brand(key));\n\n\t\tthis.editor(key).set(mapTree, field.length === 0);\n\t\treturn this;\n\t}\n\tpublic getOrInsert(\n\t\tkey: string,\n\t\tfallbackValue: InsertableTreeNodeFromImplicitAllowedTypes<T>,\n\t): TreeNodeFromImplicitAllowedTypes<T> {\n\t\tconst existing = this.get(key);\n\t\tif (existing !== undefined) {\n\t\t\treturn existing;\n\t\t}\n\t\tthis.set(key, fallbackValue);\n\t\treturn this.get(key);\n\t}\n\tpublic getOrInsertComputed(\n\t\tkey: string,\n\t\tcallback: (key: string) => InsertableTreeNodeFromImplicitAllowedTypes<T>,\n\t): TreeNodeFromImplicitAllowedTypes<T> {\n\t\tconst existing = this.get(key);\n\t\tif (existing !== undefined) {\n\t\t\treturn existing;\n\t\t}\n\t\tthis.set(key, callback(key));\n\t\treturn this.get(key);\n\t}\n\tpublic get size(): number {\n\t\treturn count(this.innerNode.keys());\n\t}\n\tpublic *values(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>> {\n\t\tfor (const [, value] of this.entries()) {\n\t\t\tyield value;\n\t\t}\n\t}\n\tpublic forEach<TThis extends TreeMapNodeAlpha<T>>(\n\t\tthis: TThis,\n\t\tcallbackFn: (value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: TThis) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tfor (const field of getInnerNode(this)) {\n\t\t\tconst node = tryGetTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t\t\tcallbackFn.call(thisArg, node, field.key, this);\n\t\t}\n\t}\n\tpublic clear(): void {\n\t\tconst node = this.innerNode;\n\t\tconst transaction = node.isHydrated() ? node.context.checkout.transaction : undefined;\n\t\ttransaction?.start();\n\t\tfor (const key of [...node.keys()]) {\n\t\t\tthis.delete(key);\n\t\t}\n\t\ttransaction?.commit();\n\t}\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.\n *\n * @param base - base schema type to extend.\n * @param useMapPrototype - should this type emulate a ES6 Map object (by faking its prototype with a proxy).\n * @param persistedMetadata - Optional persisted metadata for the object node schema.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function mapSchema<\n\tTName extends string,\n\tconst T extends ImplicitAllowedTypes,\n\tconst ImplicitlyConstructable extends boolean,\n\tconst TCustomMetadata = unknown,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tuseMapPrototype: boolean,\n\tnodeOptions: NodeSchemaOptionsAlpha<TCustomMetadata> = {},\n) {\n\tconst normalizedTypes = normalizeAllowedTypes(info);\n\tconst lazyAllowedTypesIdentifiers = new Lazy(\n\t\t() => new Set(normalizedTypes.evaluate().map((type) => type.identifier)),\n\t);\n\tconst lazySimpleAllowedTypes = new Lazy(() => {\n\t\treturn AnnotatedAllowedTypesInternal.evaluateSimpleAllowedTypes(normalizedTypes);\n\t});\n\n\tlet privateData: TreeNodeSchemaPrivateData | undefined;\n\tconst persistedMetadata = nodeOptions.persistedMetadata;\n\n\tclass Schema extends CustomMapNodeBase<T> implements TreeMapNodeAlpha<T> {\n\t\tpublic readonly [Symbol.toStringTag] = \"TreeMapNodeSchema\";\n\t\tpublic static override prepareInstance<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tflexNode: FlexTreeNode,\n\t\t): TreeNodeValid<T2> {\n\t\t\tif (useMapPrototype) {\n\t\t\t\treturn new Proxy<Schema>(instance as Schema, handler as ProxyHandler<Schema>);\n\t\t\t}\n\t\t\treturn instance;\n\t\t}\n\n\t\tpublic static override buildRawNode<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tinput: T2,\n\t\t): UnhydratedFlexTreeNode {\n\t\t\treturn unhydratedFlexTreeFromInsertable(input as FactoryContent, this as typeof Schema);\n\t\t}\n\n\t\tpublic static get allowedTypesIdentifiers(): ReadonlySet<string> {\n\t\t\treturn lazyAllowedTypesIdentifiers.value;\n\t\t}\n\n\t\tpublic static get simpleAllowedTypes(): ReadonlyMap<\n\t\t\tstring,\n\t\t\tSimpleAllowedTypeAttributes<SchemaType.View>\n\t\t> {\n\t\t\treturn lazySimpleAllowedTypes.value;\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup(): TreeNodeSchemaInitializedData {\n\t\t\tconst schema = this as MapNodeSchema;\n\t\t\treturn getTreeNodeSchemaInitializedData(this, {\n\t\t\t\tshallowCompatibilityTest,\n\t\t\t\ttoFlexContent: (data: FactoryContent): FlexContent => mapToFlexContent(data, schema),\n\t\t\t});\n\t\t}\n\n\t\tpublic static readonly identifier = identifier;\n\t\tpublic static readonly info = info;\n\t\tpublic static readonly implicitlyConstructable: ImplicitlyConstructable =\n\t\t\timplicitlyConstructable;\n\t\tpublic static get childTypes(): ReadonlySet<TreeNodeSchema> {\n\t\t\treturn normalizedTypes.evaluateSet();\n\t\t}\n\t\tpublic static readonly metadata: NodeSchemaMetadata<TCustomMetadata> =\n\t\t\tnodeOptions.metadata ?? {};\n\t\tpublic static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =\n\t\t\tpersistedMetadata;\n\n\t\t// eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.\n\t\tpublic get [typeNameSymbol](): TName {\n\t\t\treturn identifier;\n\t\t}\n\t\tpublic get [typeSchemaSymbol](): typeof schemaErased {\n\t\t\treturn Schema.constructorCached?.constructor as unknown as typeof schemaErased;\n\t\t}\n\n\t\tpublic static get [privateDataSymbol](): TreeNodeSchemaPrivateData {\n\t\t\treturn (privateData ??= createTreeNodeSchemaPrivateData(this, [normalizedTypes]));\n\t\t}\n\t}\n\tconst schemaErased: MapNodeCustomizableSchema<\n\t\tTName,\n\t\tT,\n\t\tImplicitlyConstructable,\n\t\tTCustomMetadata\n\t> &\n\t\tMapNodePojoEmulationSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> &\n\t\tTreeNodeSchemaCorePrivate = Schema;\n\treturn schemaErased;\n}\n\n/**\n * Content which can be used to construct a Map node, explicitly or implicitly.\n * @system @public\n */\nexport type MapNodeInsertableData<T extends ImplicitAllowedTypes> =\n\t| Iterable<readonly [string, InsertableTreeNodeFromImplicitAllowedTypes<T>]>\n\t| RestrictiveStringRecord<InsertableTreeNodeFromImplicitAllowedTypes<T>>;\n\n/**\n * {@link TreeNodeSchemaInitializedData.shallowCompatibilityTest} for Map nodes.\n */\nfunction shallowCompatibilityTest(data: FactoryContent): CompatibilityLevel {\n\tif (isTreeValue(data)) {\n\t\treturn CompatibilityLevel.None;\n\t}\n\n\tif (isReadonlyArray(data)) {\n\t\t// Arrays are iterable, so type checking does allow constructing a MapNode from an array if the array's type is key values pairs for the map.\n\t\treturn CompatibilityLevel.Low;\n\t}\n\n\tif (Symbol.iterator in data) {\n\t\treturn CompatibilityLevel.Normal;\n\t}\n\n\t// When not unioned with an ObjectNode, allow objects to be used to create maps.\n\treturn CompatibilityLevel.Low;\n}\n\n/**\n * {@link TreeNodeSchemaInitializedData.toFlexContent} for Map nodes.\n *\n * Transforms data under a Map schema.\n * @param data - The tree data to be transformed. Must be an iterable or Record like object.\n * @param schema - The schema to comply with.\n */\nfunction mapToFlexContent(data: FactoryContent, schema: MapNodeSchema): FlexContent {\n\tif (!(typeof data === \"object\" && data !== null)) {\n\t\tthrow new UsageError(`Input data is incompatible with Map schema: ${data}`);\n\t}\n\n\tconst fieldsIterator = (\n\t\tSymbol.iterator in data\n\t\t\t? // Support iterables of key value pairs (including Map objects)\n\t\t\t\tdata\n\t\t\t: // Support record objects for JSON style Map data\n\t\t\t\tObject.entries(data)\n\t) as Iterable<readonly [string, InsertableContent]>;\n\n\treturn recordLikeDataToFlexContent(fieldsIterator, schema);\n}\n"]}
1
+ {"version":3,"file":"mapNode.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/map/mapNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AA4aH,8BAiGC;AA1gBD,kEAAmE;AACnE,uEAAsE;AAEtE,qDAA6D;AAC7D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,EAAE,CAAC;QAC7B,OAAO,6BAAkB,CAAC,MAAM,CAAC;IAClC,CAAC;IAED,gFAAgF;IAChF,OAAO,6BAAkB,CAAC,GAAG,CAAC;AAC/B,CAAC;AAED;;;;;;GAMG;AACH,SAAS,gBAAgB,CAAC,IAAoB,EAAE,MAAqB;IACpE,IAAI,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,qBAAU,CAAC,+CAA+C,IAAI,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,MAAM,cAAc,GAAG,CACtB,MAAM,CAAC,QAAQ,IAAI,IAAI;QACtB,CAAC,CAAC,+DAA+D;YAChE,IAAI;QACL,CAAC,CAAC,iDAAiD;YAClD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAC4B,CAAC;IAEpD,OAAO,IAAA,uCAA2B,EAAC,cAAc,EAAE,MAAM,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FluidIterableIterator, FluidReadonlyMap } from \"@fluidframework/core-interfaces\";\nimport { assert, Lazy } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { MapNodeStoredSchema } from \"../../../core/index.js\";\nimport {\n\tisTreeValue,\n\ttype FlexibleNodeContent,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype OptionalFieldEditBuilder,\n} from \"../../../feature-libraries/index.js\";\nimport {\n\tbrand,\n\tcount,\n\tisReadonlyArray,\n\ttype JsonCompatibleReadOnlyObject,\n\ttype RestrictiveStringRecord,\n} from \"../../../util/index.js\";\nimport type {\n\tNodeSchemaOptionsAlpha,\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Referenced by TSDoc {@link} in this file.\n\tRunTransactionParamsAlpha,\n} from \"../../api/index.js\";\nimport {\n\tCompatibilityLevel,\n\tgetKernel,\n\ttype InnerNode,\n\tNodeKind,\n\ttype TreeNodeSchema,\n\tschemaIdentifierBrand,\n\ttype TreeNode,\n\ttypeSchemaSymbol,\n\tgetInnerNode,\n\ttype InternalTreeNode,\n\ttype UnhydratedFlexTreeNode,\n\tnormalizeAllowedTypes,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeSchemaMetadata,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\tTreeNodeValid,\n\ttype MostDerivedData,\n\ttype TreeNodeSchemaInitializedData,\n\ttype TreeNodeSchemaCorePrivate,\n\tprivateDataSymbol,\n\tcreateTreeNodeSchemaPrivateData,\n\ttype FlexContent,\n\ttype TreeNodeSchemaPrivateData,\n\tAnnotatedAllowedTypesInternal,\n} from \"../../core/index.js\";\nimport { getTreeNodeSchemaInitializedData } from \"../../createContext.js\";\nimport { createFieldSchema, FieldKind } from \"../../fieldSchema.js\";\nimport { tryGetTreeNodeForField } from \"../../getTreeNodeForField.js\";\nimport { prepareForInsertion } from \"../../prepareForInsertion.js\";\nimport type { SchemaType, SimpleAllowedTypeAttributes } from \"../../simpleSchema.js\";\nimport {\n\tunhydratedFlexTreeFromInsertable,\n\ttype FactoryContent,\n\ttype InsertableContent,\n} from \"../../unhydratedFlexTreeFromInsertable.js\";\nimport { recordLikeDataToFlexContent } from \"../common.js\";\n\nimport type {\n\tMapNodeCustomizableSchema,\n\tMapNodePojoEmulationSchema,\n\tMapNodeSchema,\n} from \"./mapNodeTypes.js\";\n\n/**\n * A map of string keys to tree objects.\n *\n * @privateRemarks\n * Add support for `clear` once we have established merge semantics for it.\n *\n * @sealed @public\n */\nexport interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes>\n\textends FluidReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\tTreeNode {\n\t/**\n\t * Adds or updates an entry in the map with a specified `key` and a `value`.\n\t *\n\t * @param key - The key of the element to add to the map.\n\t * @param value - The value of the element to add to the map.\n\t *\n\t * @remarks\n\t * Setting the value at a key to `undefined` is equivalent to calling {@link TreeMapNode.delete} with that key.\n\t */\n\tset(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T> | undefined): void;\n\n\t/**\n\t * Removes the specified element from this map by its `key`.\n\t *\n\t * @remarks\n\t * Note: unlike JavaScript's Map API, this method does not return a flag indicating whether or not the value was\n\t * deleted.\n\t *\n\t * @privateRemarks\n\t * Regarding the choice to not return a boolean: Since this data structure is distributed in nature, it isn't\n\t * possible to tell whether or not the item was deleted as a result of this method call. Returning a \"best guess\"\n\t * is more likely to create issues / promote bad usage patterns than offer useful information.\n\t *\n\t * @param key - The key of the element to remove from the map.\n\t */\n\tdelete(key: string): void;\n\n\t/**\n\t * Returns an iterable of keys in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the keys returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tkeys(): FluidIterableIterator<string>;\n\t/**\n\t * Returns an iterable of values in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the values returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tvalues(): FluidIterableIterator<TreeNodeFromImplicitAllowedTypes<T>>;\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the entries returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tentries(): FluidIterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>;\n\n\t/**\n\t * Executes the provided function once per each key/value pair in this map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order in which the function is called with respect to the map's entries.\n\t * If your usage scenario depends on consistent ordering, you will need to account for this.\n\t */\n\tforEach(\n\t\tcallbackfn: (\n\t\t\tvalue: TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\tkey: string,\n\t\t\tmap: FluidReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\t) => void,\n\t\t// Typing inherited from `ReadonlyMap`.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tthisArg?: any,\n\t): void;\n}\n\n/**\n * {@link TreeMapNode} with FluidReadonlyMap-based iteration.\n *\n * @remarks\n * This is the same as {@link TreeMapNode} except that it extends FluidReadonlyMap\n * instead of the built-in `ReadonlyMap`, insulating against breaking changes\n * in TypeScript's standard library iterator types.\n *\n * @sealed @alpha\n */\nexport interface TreeMapNodeAlpha<T extends ImplicitAllowedTypes = ImplicitAllowedTypes>\n\textends FluidReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\tTreeNode,\n\t\tPick<TreeMapNode<T>, \"set\" | \"delete\"> {\n\t/**\n\t * Removes all elements from the map.\n\t * @remarks\n\t * The merge semantics of this operation are loosely specified. Either of the following may occur:\n\t *\n\t * - `clear` may remove all elements that were in the map when the edit was authored,\n\t * even if some of those elements have since been moved elsewhere in the tree\n\t * (in which case they are removed from their new location).\n\t *\n\t * - `clear` may remove all elements that are in the map when the edit is sequenced,\n\t * even if some of those elements were not yet in the map when the edit was authored.\n\t */\n\tclear(): void;\n\t/**\n\t * Returns the value at `key`, first inserting `fallbackValue` if this map has no entry for `key`.\n\t *\n\t * @param key - The key of the element to return or insert at.\n\t * @param fallbackValue - The value to insert if `key` has no entry.\n\t * @returns The value at `key`, which may be the provided `fallbackValue`\n\t * if the map had no previous entry for `key`.\n\t *\n\t * @remarks\n\t * The check for the presence of an existing entry with the given `key` is performed at the time the edit is authored.\n\t * This has implications for the merge semantics of this operation:\n\t *\n\t * - If no entry is present for `key` at authoring time (thus leading to an insert)\n\t * while a peer concurrently inserts a value for the same `key`,\n\t * then the two inserts will race and the one that is sequenced second will overwrite the value inserted by the one\n\t * that is sequenced first.\n\t *\n\t * - If an entry is present for `key` at authoring time (thus leading to no insert)\n\t * while a peer concurrently deletes the entry for `key`,\n\t * then the map will end up with no entry for `key` no matter how the two edits are sequenced.\n\t *\n\t * - If an entry is present for `key` at authoring time (thus leading to no insert)\n\t * while a peer concurrently inserts a new entry for `key`,\n\t * then the map will end up with the entry set by the peer no matter how the two edits are sequenced.\n\t *\n\t * These last two points mean that, upon sequencing of an edit made with this API,\n\t * there is no guarantee that the entry for the given key will be the current one (if any) or the fallback one.\n\t * If such a guarantee is important, then consider using {@link RunTransactionParamsAlpha.preconditions}\n\t * to ensure the edit only applies when appropriate.\n\t *\n\t * This API is **not** equivalent to the following alternative:\n\t *\n\t * ```typescript\n\t * map.set(key, map.get(key) ?? fallbackValue);\n\t * ```\n\t *\n\t * They differ in the following ways:\n\t *\n\t * - This API treats entries containing `null` values as populated.\n\t * By contrast, the above alternative's usage of `??` means that a `null` entry is treated as equivalent to a missing entry.\n\t *\n\t * - This API only inserts/sets the entry for the given `key` when there is no current one.\n\t * By contrast, the above alternative always performs an insert.\n\t * That insert will throw an error for non-leaf types (objects, maps, arrays, and records) in cases where the entry\n\t * is already populated, because inserting a node that was already inserted is not supported.\n\t * It will always succeed for leaf types (number, string, boolean, null, and handle) since a new node is created\n\t * from the value.\n\t * Note that even in the cases where it does not throw,\n\t * the `set` operation has the potential to overwrite entries that are concurrently inserted even when the map had\n\t * an entry for `key`, which is not the case with this API.\n\t *\n\t * Avoid using this API to write a default value into the document when the application could instead return that\n\t * default when reading a missing entry, which is much less costly.\n\t * A more appropriate use of this API is when the value to be optionally inserted varies with the key.\n\t */\n\tgetOrInsert(\n\t\tkey: string,\n\t\tfallbackValue: InsertableTreeNodeFromImplicitAllowedTypes<T>,\n\t): TreeNodeFromImplicitAllowedTypes<T>;\n\n\t/**\n\t * Returns the value at `key`, first inserting the value produced by `callback` if this map has no entry for `key`.\n\t *\n\t * @param key - The key of the element to return or insert at.\n\t * @param callback - Invoked with `key` to produce the value to insert if `key` has no entry.\n\t * Not invoked if an entry is present.\n\t * @returns The value at `key`, which may be the value produced by `callback`\n\t * if the map had no previous entry for `key`.\n\t *\n\t * @remarks\n\t * This API is equivalent to {@link TreeMapNodeAlpha.getOrInsert} except that the fallback value is computed lazily:\n\t * `callback` is only invoked when the map has no entry for `key`.\n\t * Prefer this API over {@link TreeMapNodeAlpha.getOrInsert} when producing the fallback value is expensive.\n\t *\n\t * The check for the presence of an existing entry with the given `key` is performed at the time the edit is authored.\n\t * See {@link TreeMapNodeAlpha.getOrInsert} for the implications this has on the merge semantics of this operation.\n\t *\n\t * If `callback` throws, no edit is made and the error is propagated to the caller.\n\t * If `callback` sets an entry for `key` in this map, that entry is overwritten with the value `callback` returned.\n\t */\n\tgetOrInsertComputed(\n\t\tkey: string,\n\t\tcallback: (key: string) => InsertableTreeNodeFromImplicitAllowedTypes<T>,\n\t): TreeNodeFromImplicitAllowedTypes<T>;\n}\n\n// TreeMapNode is invariant over schema type, so for this handler to work with all schema, the only possible type for the schema is `any`.\n// This is not ideal, but no alternatives are possible.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst handler: ProxyHandler<TreeMapNodeAlpha<any>> = {\n\tgetPrototypeOf: () => {\n\t\treturn Map.prototype;\n\t},\n\tget: (target, key, receiver) => {\n\t\tconst value = Reflect.get(target, key, receiver) as unknown;\n\t\tif (value !== undefined) {\n\t\t\treturn value;\n\t\t}\n\t\t// If the property is a function on Map.prototype but not on the target,\n\t\t// return a function that throws a descriptive TypeError when called.\n\t\tif (\n\t\t\ttypeof key === \"string\" &&\n\t\t\t!(key in target) &&\n\t\t\tkey in Map.prototype &&\n\t\t\ttypeof (Map.prototype as unknown as Record<string, unknown>)[key] === \"function\"\n\t\t) {\n\t\t\treturn () => {\n\t\t\t\tthrow new TypeError(\n\t\t\t\t\t`MapNode does not support '${key}'. Use the MapNode API (e.g., set, get, delete, keys, values, entries).`,\n\t\t\t\t);\n\t\t\t};\n\t\t}\n\t\treturn value;\n\t},\n};\n\nabstract class CustomMapNodeBase<const T extends ImplicitAllowedTypes> extends TreeNodeValid<\n\tMapNodeInsertableData<T>\n> {\n\tpublic static readonly kind = NodeKind.Map;\n\n\tpublic constructor(input?: InternalTreeNode | MapNodeInsertableData<T> | undefined) {\n\t\tsuper(input ?? []);\n\t}\n\n\tpublic [Symbol.iterator](): FluidIterableIterator<\n\t\t[string, TreeNodeFromImplicitAllowedTypes<T>]\n\t> {\n\t\treturn this.entries();\n\t}\n\n\tprivate get innerNode(): InnerNode {\n\t\treturn getInnerNode(this);\n\t}\n\n\tprivate editor(key: string): OptionalFieldEditBuilder<FlexibleNodeContent> {\n\t\tconst field = this.innerNode.getBoxed(brand(key)) as FlexTreeOptionalField;\n\t\treturn field.editor;\n\t}\n\n\tpublic delete(key: string): void {\n\t\tconst field = this.innerNode.getBoxed(brand(key));\n\t\tthis.editor(key).set(undefined, field.length === 0);\n\t}\n\tpublic *entries(): FluidIterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\tconst node = this.innerNode;\n\t\tfor (const key of node.keys()) {\n\t\t\tyield [\n\t\t\t\tkey,\n\t\t\t\ttryGetTreeNodeForField(node.getBoxed(key)) as TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\t];\n\t\t}\n\t}\n\tpublic get(key: string): TreeNodeFromImplicitAllowedTypes<T> {\n\t\tconst node = this.innerNode;\n\t\tconst field = node.getBoxed(brand(key));\n\t\treturn tryGetTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t}\n\tpublic has(key: string): boolean {\n\t\treturn this.innerNode.tryGetField(brand(key)) !== undefined;\n\t}\n\tpublic *keys(): Generator<string, void, undefined> {\n\t\tconst node = this.innerNode;\n\t\tyield* node.keys();\n\t}\n\tpublic set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T>): this {\n\t\tconst kernel = getKernel(this);\n\t\tconst node = this.innerNode;\n\t\tconst innerSchema = this.innerNode.context.schema.nodeSchema.get(\n\t\t\tbrand(kernel.schema.identifier),\n\t\t);\n\t\tassert(\n\t\t\tinnerSchema instanceof MapNodeStoredSchema,\n\t\t\t0xc17 /* Expected MapNodeStoredSchema */,\n\t\t);\n\n\t\tconst mapTree = prepareForInsertion(\n\t\t\tvalue as InsertableContent | undefined,\n\t\t\tcreateFieldSchema(FieldKind.Optional, kernel.schema.info as ImplicitAllowedTypes),\n\t\t\tnode.context,\n\t\t\tinnerSchema.mapFields,\n\t\t);\n\n\t\tconst field = node.getBoxed(brand(key));\n\n\t\tthis.editor(key).set(mapTree, field.length === 0);\n\t\treturn this;\n\t}\n\tpublic getOrInsert(\n\t\tkey: string,\n\t\tfallbackValue: InsertableTreeNodeFromImplicitAllowedTypes<T>,\n\t): TreeNodeFromImplicitAllowedTypes<T> {\n\t\tconst existing = this.get(key);\n\t\tif (existing !== undefined) {\n\t\t\treturn existing;\n\t\t}\n\t\tthis.set(key, fallbackValue);\n\t\treturn this.get(key);\n\t}\n\tpublic getOrInsertComputed(\n\t\tkey: string,\n\t\tcallback: (key: string) => InsertableTreeNodeFromImplicitAllowedTypes<T>,\n\t): TreeNodeFromImplicitAllowedTypes<T> {\n\t\tconst existing = this.get(key);\n\t\tif (existing !== undefined) {\n\t\t\treturn existing;\n\t\t}\n\t\tthis.set(key, callback(key));\n\t\treturn this.get(key);\n\t}\n\tpublic get size(): number {\n\t\treturn count(this.innerNode.keys());\n\t}\n\tpublic *values(): FluidIterableIterator<TreeNodeFromImplicitAllowedTypes<T>> {\n\t\tfor (const [, value] of this.entries()) {\n\t\t\tyield value;\n\t\t}\n\t}\n\tpublic forEach<TThis extends TreeMapNodeAlpha<T>>(\n\t\tthis: TThis,\n\t\tcallbackFn: (value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: TThis) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tfor (const field of getInnerNode(this)) {\n\t\t\tconst node = tryGetTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t\t\tcallbackFn.call(thisArg, node, field.key, this);\n\t\t}\n\t}\n\tpublic clear(): void {\n\t\tconst node = this.innerNode;\n\t\tconst transaction = node.isHydrated() ? node.context.checkout.transaction : undefined;\n\t\ttransaction?.start();\n\t\tfor (const key of [...node.keys()]) {\n\t\t\tthis.delete(key);\n\t\t}\n\t\ttransaction?.commit();\n\t}\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.\n *\n * @param base - base schema type to extend.\n * @param useMapPrototype - should this type emulate a ES6 Map object (by faking its prototype with a proxy).\n * @param persistedMetadata - Optional persisted metadata for the object node schema.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function mapSchema<\n\tTName extends string,\n\tconst T extends ImplicitAllowedTypes,\n\tconst ImplicitlyConstructable extends boolean,\n\tconst TCustomMetadata = unknown,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tuseMapPrototype: boolean,\n\tnodeOptions: NodeSchemaOptionsAlpha<TCustomMetadata> = {},\n) {\n\tconst normalizedTypes = normalizeAllowedTypes(info);\n\tconst lazyAllowedTypesIdentifiers = new Lazy(\n\t\t() => new Set(normalizedTypes.evaluate().map((type) => type.identifier)),\n\t);\n\tconst lazySimpleAllowedTypes = new Lazy(() => {\n\t\treturn AnnotatedAllowedTypesInternal.evaluateSimpleAllowedTypes(normalizedTypes);\n\t});\n\n\tlet privateData: TreeNodeSchemaPrivateData | undefined;\n\tconst persistedMetadata = nodeOptions.persistedMetadata;\n\n\tclass Schema extends CustomMapNodeBase<T> implements TreeMapNodeAlpha<T> {\n\t\tpublic readonly [Symbol.toStringTag] = \"TreeMapNodeSchema\";\n\t\tpublic static override prepareInstance<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tflexNode: FlexTreeNode,\n\t\t): TreeNodeValid<T2> {\n\t\t\tif (useMapPrototype) {\n\t\t\t\treturn new Proxy<Schema>(instance as Schema, handler as ProxyHandler<Schema>);\n\t\t\t}\n\t\t\treturn instance;\n\t\t}\n\n\t\tpublic static override buildRawNode<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tinput: T2,\n\t\t): UnhydratedFlexTreeNode {\n\t\t\treturn unhydratedFlexTreeFromInsertable(input as FactoryContent, this as typeof Schema);\n\t\t}\n\n\t\tpublic static get allowedTypesIdentifiers(): ReadonlySet<string> {\n\t\t\treturn lazyAllowedTypesIdentifiers.value;\n\t\t}\n\n\t\tpublic static get simpleAllowedTypes(): ReadonlyMap<\n\t\t\tstring,\n\t\t\tSimpleAllowedTypeAttributes<SchemaType.View>\n\t\t> {\n\t\t\treturn lazySimpleAllowedTypes.value;\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup(): TreeNodeSchemaInitializedData {\n\t\t\tconst schema = this as MapNodeSchema;\n\t\t\treturn getTreeNodeSchemaInitializedData(this, {\n\t\t\t\tshallowCompatibilityTest,\n\t\t\t\ttoFlexContent: (data: FactoryContent): FlexContent => mapToFlexContent(data, schema),\n\t\t\t});\n\t\t}\n\n\t\tpublic static readonly identifier = identifier;\n\t\tpublic static readonly info = info;\n\t\tpublic static readonly implicitlyConstructable: ImplicitlyConstructable =\n\t\t\timplicitlyConstructable;\n\t\tpublic static get childTypes(): ReadonlySet<TreeNodeSchema> {\n\t\t\treturn normalizedTypes.evaluateSet();\n\t\t}\n\t\tpublic static readonly metadata: NodeSchemaMetadata<TCustomMetadata> =\n\t\t\tnodeOptions.metadata ?? {};\n\t\tpublic static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =\n\t\t\tpersistedMetadata;\n\n\t\tpublic get [schemaIdentifierBrand](): TName {\n\t\t\treturn identifier;\n\t\t}\n\t\tpublic get [typeSchemaSymbol](): typeof schemaErased {\n\t\t\treturn Schema.constructorCached?.constructor as unknown as typeof schemaErased;\n\t\t}\n\n\t\tpublic static get [privateDataSymbol](): TreeNodeSchemaPrivateData {\n\t\t\treturn (privateData ??= createTreeNodeSchemaPrivateData(this, [normalizedTypes]));\n\t\t}\n\t}\n\tconst schemaErased: MapNodeCustomizableSchema<\n\t\tTName,\n\t\tT,\n\t\tImplicitlyConstructable,\n\t\tTCustomMetadata\n\t> &\n\t\tMapNodePojoEmulationSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> &\n\t\tTreeNodeSchemaCorePrivate = Schema;\n\treturn schemaErased;\n}\n\n/**\n * Content which can be used to construct a Map node, explicitly or implicitly.\n * @system @public\n */\nexport type MapNodeInsertableData<T extends ImplicitAllowedTypes> =\n\t| Iterable<readonly [string, InsertableTreeNodeFromImplicitAllowedTypes<T>]>\n\t| RestrictiveStringRecord<InsertableTreeNodeFromImplicitAllowedTypes<T>>;\n\n/**\n * {@link TreeNodeSchemaInitializedData.shallowCompatibilityTest} for Map nodes.\n */\nfunction shallowCompatibilityTest(data: FactoryContent): CompatibilityLevel {\n\tif (isTreeValue(data)) {\n\t\treturn CompatibilityLevel.None;\n\t}\n\n\tif (isReadonlyArray(data)) {\n\t\t// Arrays are iterable, so type checking does allow constructing a MapNode from an array if the array's type is key values pairs for the map.\n\t\treturn CompatibilityLevel.Low;\n\t}\n\n\tif (Symbol.iterator in data) {\n\t\treturn CompatibilityLevel.Normal;\n\t}\n\n\t// When not unioned with an ObjectNode, allow objects to be used to create maps.\n\treturn CompatibilityLevel.Low;\n}\n\n/**\n * {@link TreeNodeSchemaInitializedData.toFlexContent} for Map nodes.\n *\n * Transforms data under a Map schema.\n * @param data - The tree data to be transformed. Must be an iterable or Record like object.\n * @param schema - The schema to comply with.\n */\nfunction mapToFlexContent(data: FactoryContent, schema: MapNodeSchema): FlexContent {\n\tif (!(typeof data === \"object\" && data !== null)) {\n\t\tthrow new UsageError(`Input data is incompatible with Map schema: ${data}`);\n\t}\n\n\tconst fieldsIterator = (\n\t\tSymbol.iterator in data\n\t\t\t? // Support iterables of key value pairs (including Map objects)\n\t\t\t\tdata\n\t\t\t: // Support record objects for JSON style Map data\n\t\t\t\tObject.entries(data)\n\t) as Iterable<readonly [string, InsertableContent]>;\n\n\treturn recordLikeDataToFlexContent(fieldsIterator, schema);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"mapNodeTypes.d.ts","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/map/mapNodeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,EACX,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,QAAQ,EACR,oBAAoB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE5E;;;GAGG;AACH,MAAM,WAAW,yBAAyB,CACzC,GAAG,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EACjC,EAAE,CAAC,GAAG,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,EAC5D,GAAG,CAAC,uBAAuB,SAAS,OAAO,GAAG,IAAI,EAClD,GAAG,CAAC,eAAe,GAAG,OAAO,CAC5B,SAAQ,mBAAmB,CAC1B,KAAK,EACL,QAAQ,CAAC,GAAG,EACZ,gBAAgB,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,EACtD,qBAAqB,CAAC,CAAC,CAAC,EACxB,uBAAuB,EACvB,CAAC,EACD,SAAS,EACT,eAAe,CACf,EACD,mBAAmB,CAAC,UAAU,CAAC,IAAI,EAAE,eAAe,CAAC;CAAG;AAE1D;;;GAGG;AACH,MAAM,WAAW,0BAA0B,CAC1C,GAAG,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EACjC,EAAE,CAAC,GAAG,CAAC,CAAC,SAAS,oBAAoB,GAAG,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8 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.isMapNodeSchema = exports.MapNodeSchema = void 0;
7
+ exports.MapNodeSchema = void 0;
8
+ exports.isMapNodeSchema = isMapNodeSchema;
8
9
  const index_js_1 = require("../../core/index.js");
9
10
  /**
10
11
  * @alpha
@@ -26,5 +27,4 @@ exports.MapNodeSchema = {
26
27
  function isMapNodeSchema(schema) {
27
28
  return schema.kind === index_js_1.NodeKind.Map;
28
29
  }
29
- exports.isMapNodeSchema = isMapNodeSchema;
30
30
  //# sourceMappingURL=mapNodeTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapNodeTypes.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/map/mapNodeTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAA+C;AAgE/C;;GAEG;AACU,QAAA,aAAa,GAAG;IAC5B;;OAEG;IACH,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAqB;QACzC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACQ,CAAC;AAEX;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,MAAsB;IACrD,OAAO,MAAM,CAAC,IAAI,KAAK,mBAAQ,CAAC,GAAG,CAAC;AACrC,CAAC;AAFD,0CAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { NodeKind } from \"../../core/index.js\";\nimport type {\n\tTreeNodeSchemaClass,\n\tTreeNodeSchema,\n\tTreeNodeSchemaNonClass,\n\tWithType,\n\tImplicitAllowedTypes,\n} from \"../../core/index.js\";\nimport type { SchemaType, SimpleMapNodeSchema } from \"../../simpleSchema.js\";\n\nimport type { MapNodeInsertableData, TreeMapNodeAlpha } from \"./mapNode.js\";\n\n/**\n * A schema for customizable {@link (TreeMapNodeAlpha:interface)}s.\n * @system @sealed @alpha\n */\nexport interface MapNodeCustomizableSchema<\n\tout TName extends string = string,\n\tin out T extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\tout ImplicitlyConstructable extends boolean = true,\n\tout TCustomMetadata = unknown,\n> extends TreeNodeSchemaClass<\n\t\t\tTName,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNodeAlpha<T> & WithType<TName, NodeKind.Map, T>,\n\t\t\tMapNodeInsertableData<T>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleMapNodeSchema<SchemaType.View, TCustomMetadata> {}\n\n/**\n * A schema for POJO emulation mode {@link (TreeMapNodeAlpha:interface)}s.\n * @system @sealed @alpha\n */\nexport interface MapNodePojoEmulationSchema<\n\tout TName extends string = string,\n\tin out T extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\tout ImplicitlyConstructable extends boolean = true,\n\tout TCustomMetadata = unknown,\n> extends TreeNodeSchemaNonClass<\n\t\t\tTName,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNodeAlpha<T> & WithType<TName, NodeKind.Map, T>,\n\t\t\tMapNodeInsertableData<T>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleMapNodeSchema<SchemaType.View, TCustomMetadata> {}\n\n/**\n * A schema for {@link (TreeMapNodeAlpha:interface)}s.\n * @privateRemarks\n * This could have generic arguments added and forwarded.\n * The expected use-cases for this don't need them however, and if they did want an argument it would probably be the allowed types;\n * perhaps if moving to an order independent way to pass generic arguments, adding support for them here would make sense.\n * @alpha\n */\nexport type MapNodeSchema = MapNodeCustomizableSchema | MapNodePojoEmulationSchema;\n\n/**\n * @alpha\n */\nexport const MapNodeSchema = {\n\t/**\n\t * instanceof-based narrowing support for MapNodeSchema in Javascript and TypeScript 5.3 or newer.\n\t */\n\t[Symbol.hasInstance](value: TreeNodeSchema): value is MapNodeSchema {\n\t\treturn isMapNodeSchema(value);\n\t},\n} as const;\n\n/**\n * Narrows a {@link (TreeNodeSchema:interface)} to an {@link (MapNodeSchema:interface)}.\n * @privateRemarks\n * If at some point we want to have internal only APIs for MapNodeSchema (like done for objects),\n * this can include those since its not the public facing API.\n */\nexport function isMapNodeSchema(schema: TreeNodeSchema): schema is MapNodeSchema {\n\treturn schema.kind === NodeKind.Map;\n}\n"]}
1
+ {"version":3,"file":"mapNodeTypes.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/map/mapNodeTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAoFH,0CAEC;AApFD,kDAA+C;AAgE/C;;GAEG;AACU,QAAA,aAAa,GAAG;IAC5B;;OAEG;IACH,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAqB;QACzC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACQ,CAAC;AAEX;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,MAAsB;IACrD,OAAO,MAAM,CAAC,IAAI,KAAK,mBAAQ,CAAC,GAAG,CAAC;AACrC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { NodeKind } from \"../../core/index.js\";\nimport type {\n\tTreeNodeSchemaClass,\n\tTreeNodeSchema,\n\tTreeNodeSchemaNonClass,\n\tWithType,\n\tImplicitAllowedTypes,\n} from \"../../core/index.js\";\nimport type { SchemaType, SimpleMapNodeSchema } from \"../../simpleSchema.js\";\n\nimport type { MapNodeInsertableData, TreeMapNodeAlpha } from \"./mapNode.js\";\n\n/**\n * A schema for customizable {@link (TreeMapNodeAlpha:interface)}s.\n * @system @sealed @alpha\n */\nexport interface MapNodeCustomizableSchema<\n\tout TName extends string = string,\n\tin out T extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\tout ImplicitlyConstructable extends boolean = true,\n\tout TCustomMetadata = unknown,\n> extends TreeNodeSchemaClass<\n\t\t\tTName,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNodeAlpha<T> & WithType<TName, NodeKind.Map, T>,\n\t\t\tMapNodeInsertableData<T>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleMapNodeSchema<SchemaType.View, TCustomMetadata> {}\n\n/**\n * A schema for POJO emulation mode {@link (TreeMapNodeAlpha:interface)}s.\n * @system @sealed @alpha\n */\nexport interface MapNodePojoEmulationSchema<\n\tout TName extends string = string,\n\tin out T extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\tout ImplicitlyConstructable extends boolean = true,\n\tout TCustomMetadata = unknown,\n> extends TreeNodeSchemaNonClass<\n\t\t\tTName,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNodeAlpha<T> & WithType<TName, NodeKind.Map, T>,\n\t\t\tMapNodeInsertableData<T>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleMapNodeSchema<SchemaType.View, TCustomMetadata> {}\n\n/**\n * A schema for {@link (TreeMapNodeAlpha:interface)}s.\n * @privateRemarks\n * This could have generic arguments added and forwarded.\n * The expected use-cases for this don't need them however, and if they did want an argument it would probably be the allowed types;\n * perhaps if moving to an order independent way to pass generic arguments, adding support for them here would make sense.\n * @alpha\n */\nexport type MapNodeSchema = MapNodeCustomizableSchema | MapNodePojoEmulationSchema;\n\n/**\n * @alpha\n */\nexport const MapNodeSchema = {\n\t/**\n\t * instanceof-based narrowing support for MapNodeSchema in Javascript and TypeScript 5.3 or newer.\n\t */\n\t[Symbol.hasInstance](value: TreeNodeSchema): value is MapNodeSchema {\n\t\treturn isMapNodeSchema(value);\n\t},\n} as const;\n\n/**\n * Narrows a {@link (TreeNodeSchema:interface)} to an {@link (MapNodeSchema:interface)}.\n * @privateRemarks\n * If at some point we want to have internal only APIs for MapNodeSchema (like done for objects),\n * this can include those since its not the public facing API.\n */\nexport function isMapNodeSchema(schema: TreeNodeSchema): schema is MapNodeSchema {\n\treturn schema.kind === NodeKind.Map;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"objectNode.d.ts","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/object/objectNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAEN,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGN,KAAK,aAAa,EAIlB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EACX,uBAAuB,EACvB,WAAW,EAEX,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAGN,QAAQ,EACR,KAAK,QAAQ,EAKb,KAAK,QAAQ,EAIb,KAAK,oBAAoB,EASzB,KAAK,yBAAyB,EAE9B,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EACN,KAAK,mBAAmB,EAGxB,KAAK,0BAA0B,EAC/B,KAAK,oCAAoC,EACzC,KAAK,WAAW,EAChB,gBAAgB,EAEhB,SAAS,EACT,KAAK,UAAU,EAIf,KAAK,eAAe,EACpB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAKN,KAAK,iBAAiB,EACtB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EACX,gBAAgB,EAChB,4BAA4B,EAE5B,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,uBAAuB,CAAC,mBAAmB,CAAC,IACxF,uBAAuB,CAAC,mBAAmB,CAAC,SAAS,CAAC,GACnD,EAAE,GACF;IACA,CAAC,UAAU,QAAQ,IAAI,MAAM,CAAC,GAAG,QAAQ,SAAS,MAAM,GACrD,0BAA0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MAAM,CAAA;CAAE,CAE3D,SAAQ,gBAAgB,CAAC,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,CAC7D,YAAW,uBAAuB;IAElC,SAAgB,SAAS,EAAE,MAAM,CAAC;gBAEf,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM;CAIjE;AAQD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC3B,KAAK,SAAS,MAAM,EACpB,KAAK,CAAC,CAAC,SAAS,uBAAuB,CAAC,mBAAmB,CAAC,EAC5D,KAAK,CAAC,uBAAuB,SAAS,OAAO,EAC7C,KAAK,CAAC,eAAe,GAAG,OAAO,EAE/B,UAAU,EAAE,KAAK,EACjB,IAAI,EAAE,CAAC,EACP,uBAAuB,EAAE,uBAAuB,EAChD,WAAW,EAAE,wBAAwB,CAAC,eAAe,CAAC,GACpD,gBAAgB,CAAC,KAAK,EAAE,CAAC,EAAE,uBAAuB,EAAE,eAAe,CAAC,GACtE,4BAA4B,GAC5B,yBAAyB,CAsKzB"}
@@ -4,7 +4,9 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.objectSchema = exports.ObjectFieldSchema = exports.setField = void 0;
7
+ exports.ObjectFieldSchema = void 0;
8
+ exports.setField = setField;
9
+ exports.objectSchema = objectSchema;
8
10
  const internal_1 = require("@fluidframework/core-utils/internal");
9
11
  const internal_2 = require("@fluidframework/runtime-utils/internal");
10
12
  const internal_3 = require("@fluidframework/telemetry-utils/internal");
@@ -64,8 +66,7 @@ function createProxyHandler(schema, allowAdditionalProperties) {
64
66
  if (propertyKey === index_js_4.typeSchemaSymbol) {
65
67
  return schema;
66
68
  }
67
- // eslint-disable-next-line import-x/no-deprecated -- Required to handle the deprecated typeNameSymbol API.
68
- if (propertyKey === index_js_4.typeNameSymbol) {
69
+ if (propertyKey === index_js_4.schemaIdentifierBrand) {
69
70
  return schema.identifier;
70
71
  }
71
72
  // Pass the proxy as the receiver here, so that any methods on the prototype receive `proxy` as `this`.
@@ -145,11 +146,11 @@ function setField(field, simpleFieldSchema, value, destinationSchema) {
145
146
  }
146
147
  }
147
148
  }
148
- exports.setField = setField;
149
149
  /**
150
150
  * {@link FieldSchemaAlpha} including {@link SimpleObjectFieldSchema}.
151
151
  */
152
152
  class ObjectFieldSchema extends fieldSchema_js_1.FieldSchemaAlpha {
153
+ storedKey;
153
154
  constructor(kind, allowedTypes, props) {
154
155
  super(kind, allowedTypes, props);
155
156
  this.storedKey = props.key;
@@ -157,8 +158,8 @@ class ObjectFieldSchema extends fieldSchema_js_1.FieldSchemaAlpha {
157
158
  }
158
159
  exports.ObjectFieldSchema = ObjectFieldSchema;
159
160
  class CustomObjectNodeBase extends index_js_4.TreeNodeValid {
161
+ static kind = index_js_4.NodeKind.Object;
160
162
  }
161
- CustomObjectNodeBase.kind = index_js_4.NodeKind.Object;
162
163
  /**
163
164
  * Define a {@link TreeNodeSchema} for a {@link TreeObjectNode}.
164
165
  *
@@ -185,6 +186,20 @@ function objectSchema(identifier, info, implicitlyConstructable, nodeOptions) {
185
186
  let handler;
186
187
  let customizable;
187
188
  class CustomObjectNode extends CustomObjectNodeBase {
189
+ static fields = new Map(Array.from(flexKeyMap, ([key, value]) => [
190
+ key,
191
+ new ObjectFieldSchema(value.schema.kind, value.schema.allowedTypes, {
192
+ ...value.schema.props,
193
+ key: (0, fieldSchema_js_1.getStoredKey)(key, value.schema),
194
+ }),
195
+ ]));
196
+ static flexKeyMap = flexKeyMap;
197
+ static storedKeyToPropertyKey = new Map(Array.from(flexKeyMap, ([key, value]) => [
198
+ value.storedKey,
199
+ key,
200
+ ]));
201
+ static identifierFieldKeys = identifierFieldKeys;
202
+ static allowUnknownOptionalFields = nodeOptions.allowUnknownOptionalFields ?? false;
188
203
  static prepareInstance(instance, flexNode) {
189
204
  // Differentiate between the following cases:
190
205
  //
@@ -212,6 +227,7 @@ function objectSchema(identifier, info, implicitlyConstructable, nodeOptions) {
212
227
  static buildRawNode(instance, input) {
213
228
  return (0, unhydratedFlexTreeFromInsertable_js_1.unhydratedFlexTreeFromInsertable)(input, this);
214
229
  }
230
+ static constructorCached = undefined;
215
231
  static oneTimeSetup() {
216
232
  // One time initialization that required knowing the most derived type (from this.constructor) and thus has to be lazy.
217
233
  customizable = this !== CustomObjectNode;
@@ -243,11 +259,15 @@ function objectSchema(identifier, info, implicitlyConstructable, nodeOptions) {
243
259
  toFlexContent: (data, allowedTypes) => objectToFlexContent(data, schema),
244
260
  });
245
261
  }
262
+ static identifier = identifier;
263
+ static info = info;
264
+ static implicitlyConstructable = implicitlyConstructable;
246
265
  static get childTypes() {
247
266
  return lazyChildTypes.value;
248
267
  }
249
- // eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.
250
- get [index_js_4.typeNameSymbol]() {
268
+ static metadata = nodeOptions.metadata ?? {};
269
+ static persistedMetadata = nodeOptions.persistedMetadata;
270
+ get [index_js_4.schemaIdentifierBrand]() {
251
271
  return identifier;
252
272
  }
253
273
  get [index_js_4.typeSchemaSymbol]() {
@@ -257,29 +277,8 @@ function objectSchema(identifier, info, implicitlyConstructable, nodeOptions) {
257
277
  return (privateData ??= (0, index_js_4.createTreeNodeSchemaPrivateData)(this, Array.from(CustomObjectNode.fields.values(), (schema) => schema.allowedTypesFull)));
258
278
  }
259
279
  }
260
- CustomObjectNode.fields = new Map(Array.from(flexKeyMap, ([key, value]) => [
261
- key,
262
- new ObjectFieldSchema(value.schema.kind, value.schema.allowedTypes, {
263
- ...value.schema.props,
264
- key: (0, fieldSchema_js_1.getStoredKey)(key, value.schema),
265
- }),
266
- ]));
267
- CustomObjectNode.flexKeyMap = flexKeyMap;
268
- CustomObjectNode.storedKeyToPropertyKey = new Map(Array.from(flexKeyMap, ([key, value]) => [
269
- value.storedKey,
270
- key,
271
- ]));
272
- CustomObjectNode.identifierFieldKeys = identifierFieldKeys;
273
- CustomObjectNode.allowUnknownOptionalFields = nodeOptions.allowUnknownOptionalFields ?? false;
274
- CustomObjectNode.constructorCached = undefined;
275
- CustomObjectNode.identifier = identifier;
276
- CustomObjectNode.info = info;
277
- CustomObjectNode.implicitlyConstructable = implicitlyConstructable;
278
- CustomObjectNode.metadata = nodeOptions.metadata ?? {};
279
- CustomObjectNode.persistedMetadata = nodeOptions.persistedMetadata;
280
280
  return CustomObjectNode;
281
281
  }
282
- exports.objectSchema = objectSchema;
283
282
  const targetToProxy = new WeakMap();
284
283
  /**
285
284
  * Ensures that the set of property keys in the schema is unique.