@fluidframework/tree 2.74.0-365691 → 2.74.0-370705

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 (1268) hide show
  1. package/.vscode/settings.json +2 -2
  2. package/api-report/tree.alpha.api.md +119 -85
  3. package/api-report/tree.beta.api.md +0 -1
  4. package/api-report/tree.legacy.beta.api.md +0 -1
  5. package/api-report/tree.legacy.public.api.md +0 -1
  6. package/api-report/tree.public.api.md +0 -1
  7. package/dist/alpha.d.ts +3 -2
  8. package/dist/codec/codec.d.ts +14 -1
  9. package/dist/codec/codec.d.ts.map +1 -1
  10. package/dist/codec/codec.js +11 -0
  11. package/dist/codec/codec.js.map +1 -1
  12. package/dist/codec/versioned/codec.d.ts +1 -1
  13. package/dist/codec/versioned/codec.d.ts.map +1 -1
  14. package/dist/codec/versioned/codec.js.map +1 -1
  15. package/dist/codec/versioned/format.d.ts +4 -1
  16. package/dist/codec/versioned/format.d.ts.map +1 -1
  17. package/dist/codec/versioned/format.js +4 -1
  18. package/dist/codec/versioned/format.js.map +1 -1
  19. package/dist/core/change-family/changeFamily.d.ts +4 -1
  20. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  21. package/dist/core/change-family/changeFamily.js.map +1 -1
  22. package/dist/core/change-family/index.d.ts +1 -1
  23. package/dist/core/change-family/index.d.ts.map +1 -1
  24. package/dist/core/change-family/index.js.map +1 -1
  25. package/dist/core/index.d.ts +3 -3
  26. package/dist/core/index.d.ts.map +1 -1
  27. package/dist/core/index.js +7 -4
  28. package/dist/core/index.js.map +1 -1
  29. package/dist/core/rebase/changeRebaser.d.ts +6 -1
  30. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  31. package/dist/core/rebase/changeRebaser.js.map +1 -1
  32. package/dist/core/rebase/index.d.ts +1 -1
  33. package/dist/core/rebase/index.d.ts.map +1 -1
  34. package/dist/core/rebase/index.js +2 -1
  35. package/dist/core/rebase/index.js.map +1 -1
  36. package/dist/core/rebase/types.d.ts +2 -1
  37. package/dist/core/rebase/types.d.ts.map +1 -1
  38. package/dist/core/rebase/types.js +5 -1
  39. package/dist/core/rebase/types.js.map +1 -1
  40. package/dist/core/rebase/utils.d.ts.map +1 -1
  41. package/dist/core/rebase/utils.js +25 -7
  42. package/dist/core/rebase/utils.js.map +1 -1
  43. package/dist/core/tree/detachedFieldIndex.d.ts +40 -13
  44. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  45. package/dist/core/tree/detachedFieldIndex.js +21 -12
  46. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  47. package/dist/core/tree/index.d.ts +4 -3
  48. package/dist/core/tree/index.d.ts.map +1 -1
  49. package/dist/core/tree/index.js +6 -2
  50. package/dist/core/tree/index.js.map +1 -1
  51. package/dist/core/tree/pathTree.d.ts +11 -3
  52. package/dist/core/tree/pathTree.d.ts.map +1 -1
  53. package/dist/core/tree/pathTree.js +14 -2
  54. package/dist/core/tree/pathTree.js.map +1 -1
  55. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  56. package/dist/feature-libraries/chunked-forest/basicChunk.js +7 -0
  57. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  58. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  59. package/dist/feature-libraries/chunked-forest/chunkTree.js +4 -1
  60. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
  62. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  65. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  66. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +91 -42
  67. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  68. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +238 -69
  69. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  70. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
  71. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  72. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +33 -28
  73. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  74. package/dist/feature-libraries/default-schema/index.d.ts +2 -1
  75. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  76. package/dist/feature-libraries/default-schema/index.js +5 -2
  77. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  78. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +36 -0
  79. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  80. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +126 -0
  81. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  82. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  83. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  84. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  85. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  86. package/dist/feature-libraries/deltaUtils.d.ts +1 -0
  87. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  88. package/dist/feature-libraries/deltaUtils.js +6 -1
  89. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  90. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  91. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  92. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +41 -11
  93. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  94. package/dist/feature-libraries/flex-tree/context.d.ts +9 -0
  95. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  96. package/dist/feature-libraries/flex-tree/context.js +6 -0
  97. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  98. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  99. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  100. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  101. package/dist/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  102. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  103. package/dist/feature-libraries/flex-tree/lazyField.js +37 -8
  104. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  105. package/dist/feature-libraries/forest-summary/codec.d.ts +2 -2
  106. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  107. package/dist/feature-libraries/forest-summary/codec.js +4 -4
  108. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  109. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
  110. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  111. package/dist/feature-libraries/forest-summary/forestSummarizer.js +21 -26
  112. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  113. package/dist/feature-libraries/forest-summary/format.d.ts +41 -5
  114. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  115. package/dist/feature-libraries/forest-summary/format.js +7 -7
  116. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  117. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
  118. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  119. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +16 -29
  120. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  121. package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
  122. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  123. package/dist/feature-libraries/forest-summary/index.js +3 -2
  124. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  125. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
  126. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  127. package/dist/feature-libraries/forest-summary/summaryTypes.js +57 -0
  128. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  129. package/dist/feature-libraries/index.d.ts +4 -4
  130. package/dist/feature-libraries/index.d.ts.map +1 -1
  131. package/dist/feature-libraries/index.js +8 -3
  132. package/dist/feature-libraries/index.js.map +1 -1
  133. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  134. package/dist/feature-libraries/mapTreeCursor.js +1 -0
  135. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  136. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  137. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  138. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  139. package/dist/feature-libraries/modular-schema/comparison.d.ts +18 -2
  140. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  141. package/dist/feature-libraries/modular-schema/comparison.js +54 -3
  142. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  143. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  144. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  145. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -7
  146. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  147. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -52
  148. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  149. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  150. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  151. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  152. package/dist/feature-libraries/modular-schema/fieldKind.js +0 -21
  153. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  154. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  155. package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -10
  156. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  157. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +2 -2
  158. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  159. package/dist/feature-libraries/modular-schema/index.d.ts +6 -6
  160. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  161. package/dist/feature-libraries/modular-schema/index.js +13 -8
  162. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  163. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
  164. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
  165. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +388 -0
  166. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
  167. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
  168. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
  169. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +413 -0
  170. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
  171. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  172. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  173. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +8 -284
  174. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  175. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +49 -15
  176. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  177. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1306 -465
  178. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  179. package/dist/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
  180. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
  181. package/dist/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +5 -5
  182. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
  183. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
  184. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
  185. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +32 -0
  186. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
  187. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
  188. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  189. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +24 -3
  190. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  191. package/dist/feature-libraries/optional-field/index.d.ts +2 -2
  192. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  193. package/dist/feature-libraries/optional-field/index.js +1 -2
  194. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  195. package/dist/feature-libraries/optional-field/optionalField.d.ts +5 -26
  196. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  197. package/dist/feature-libraries/optional-field/optionalField.js +217 -451
  198. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  199. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  200. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  201. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +31 -0
  202. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  203. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  204. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  205. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  206. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  207. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  208. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +57 -28
  209. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  210. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  211. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  212. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +57 -0
  213. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  214. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  215. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  216. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  217. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  218. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  219. package/dist/feature-libraries/schema-index/schemaSummarizer.js +42 -16
  220. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  221. package/dist/feature-libraries/sequence-field/compose.d.ts +6 -7
  222. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  223. package/dist/feature-libraries/sequence-field/compose.js +80 -256
  224. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  225. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  226. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  227. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  228. package/dist/feature-libraries/sequence-field/index.d.ts +2 -3
  229. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  230. package/dist/feature-libraries/sequence-field/index.js +1 -3
  231. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  232. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  233. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  234. package/dist/feature-libraries/sequence-field/invert.js +65 -167
  235. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  236. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  237. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  238. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  239. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  240. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  241. package/dist/feature-libraries/sequence-field/moveEffectTable.js +7 -86
  242. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  243. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  244. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  245. package/dist/feature-libraries/sequence-field/rebase.js +106 -112
  246. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  247. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  248. package/dist/feature-libraries/sequence-field/replaceRevisions.js +16 -33
  249. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  250. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  251. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  252. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  253. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  254. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  255. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +358 -179
  256. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  257. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  258. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +20 -60
  259. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  260. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  261. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  262. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  263. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  264. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  265. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  266. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
  267. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  268. package/dist/feature-libraries/sequence-field/types.d.ts +30 -59
  269. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  270. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  271. package/dist/feature-libraries/sequence-field/utils.d.ts +15 -24
  272. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  273. package/dist/feature-libraries/sequence-field/utils.js +111 -299
  274. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  275. package/dist/index.d.ts +1 -1
  276. package/dist/index.d.ts.map +1 -1
  277. package/dist/index.js +3 -3
  278. package/dist/index.js.map +1 -1
  279. package/dist/packageVersion.d.ts +1 -1
  280. package/dist/packageVersion.js +1 -1
  281. package/dist/packageVersion.js.map +1 -1
  282. package/dist/shared-tree/independentView.d.ts +1 -1
  283. package/dist/shared-tree/independentView.d.ts.map +1 -1
  284. package/dist/shared-tree/independentView.js.map +1 -1
  285. package/dist/shared-tree/index.d.ts +1 -1
  286. package/dist/shared-tree/index.d.ts.map +1 -1
  287. package/dist/shared-tree/index.js.map +1 -1
  288. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  289. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  290. package/dist/shared-tree/schematizeTree.js +2 -1
  291. package/dist/shared-tree/schematizeTree.js.map +1 -1
  292. package/dist/shared-tree/schematizingTreeView.d.ts +1 -5
  293. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  294. package/dist/shared-tree/schematizingTreeView.js +32 -33
  295. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  296. package/dist/shared-tree/sharedTree.d.ts +11 -5
  297. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  298. package/dist/shared-tree/sharedTree.js +14 -4
  299. package/dist/shared-tree/sharedTree.js.map +1 -1
  300. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  301. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  302. package/dist/shared-tree/sharedTreeChangeCodecs.js +1 -0
  303. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  304. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  305. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  306. package/dist/shared-tree/sharedTreeChangeEnricher.js +26 -12
  307. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  308. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +5 -5
  309. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  310. package/dist/shared-tree/sharedTreeChangeFamily.js +10 -4
  311. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  312. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  313. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  314. package/dist/shared-tree/sharedTreeEditBuilder.js +14 -7
  315. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  316. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  317. package/dist/shared-tree/treeAlpha.js +1 -1
  318. package/dist/shared-tree/treeAlpha.js.map +1 -1
  319. package/dist/shared-tree/treeCheckout.d.ts +12 -10
  320. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  321. package/dist/shared-tree/treeCheckout.js +66 -17
  322. package/dist/shared-tree/treeCheckout.js.map +1 -1
  323. package/dist/shared-tree-core/branch.d.ts +3 -2
  324. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  325. package/dist/shared-tree-core/branch.js +4 -3
  326. package/dist/shared-tree-core/branch.js.map +1 -1
  327. package/dist/shared-tree-core/editManager.d.ts +2 -2
  328. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  329. package/dist/shared-tree-core/editManager.js +9 -9
  330. package/dist/shared-tree-core/editManager.js.map +1 -1
  331. package/dist/shared-tree-core/editManagerCodecs.d.ts +4 -0
  332. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  333. package/dist/shared-tree-core/editManagerCodecs.js +16 -6
  334. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  335. package/{lib/shared-tree-core/editManagerCodecsV5.d.ts → dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  336. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  337. package/dist/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +7 -7
  338. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  339. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
  340. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  341. package/dist/shared-tree-core/editManagerFormatCommons.js +22 -7
  342. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  343. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  344. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  345. package/dist/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  346. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  347. package/dist/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  348. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  349. package/dist/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  350. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  351. package/dist/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  352. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  353. package/dist/shared-tree-core/editManagerSummarizer.js +41 -13
  354. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  355. package/dist/shared-tree-core/index.d.ts +5 -3
  356. package/dist/shared-tree-core/index.d.ts.map +1 -1
  357. package/dist/shared-tree-core/index.js +8 -1
  358. package/dist/shared-tree-core/index.js.map +1 -1
  359. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  360. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  361. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  362. package/{lib/shared-tree-core/messageCodecV5.d.ts → dist/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  363. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  364. package/dist/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +6 -6
  365. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  366. package/dist/shared-tree-core/messageCodecs.d.ts +4 -0
  367. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  368. package/dist/shared-tree-core/messageCodecs.js +16 -6
  369. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  370. package/dist/shared-tree-core/messageFormat.d.ts +20 -6
  371. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  372. package/dist/shared-tree-core/messageFormat.js +22 -7
  373. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  374. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  375. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  376. package/dist/shared-tree-core/messageFormatV1ToV4.js +8 -1
  377. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  378. package/dist/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
  379. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  380. package/dist/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  381. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  382. package/dist/shared-tree-core/sharedTreeCore.d.ts +14 -47
  383. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  384. package/dist/shared-tree-core/sharedTreeCore.js +30 -18
  385. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  386. package/dist/shared-tree-core/summaryTypes.d.ts +94 -0
  387. package/dist/shared-tree-core/summaryTypes.d.ts.map +1 -0
  388. package/dist/shared-tree-core/summaryTypes.js +47 -0
  389. package/dist/shared-tree-core/summaryTypes.js.map +1 -0
  390. package/dist/shared-tree-core/versionedSummarizer.d.ts +67 -0
  391. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  392. package/dist/shared-tree-core/versionedSummarizer.js +63 -0
  393. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -0
  394. package/dist/simple-tree/api/configuration.d.ts +3 -26
  395. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  396. package/dist/simple-tree/api/configuration.js +10 -21
  397. package/dist/simple-tree/api/configuration.js.map +1 -1
  398. package/dist/simple-tree/api/dirtyIndex.d.ts +11 -0
  399. package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  400. package/dist/simple-tree/api/dirtyIndex.js +7 -0
  401. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  402. package/dist/simple-tree/api/discrepancies.d.ts +1 -1
  403. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  404. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  405. package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -3
  406. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  407. package/dist/simple-tree/api/getSimpleSchema.js +9 -3
  408. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  409. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  410. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  411. package/dist/simple-tree/api/incrementalAllowedTypes.js +7 -0
  412. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  413. package/dist/simple-tree/api/index.d.ts +3 -4
  414. package/dist/simple-tree/api/index.d.ts.map +1 -1
  415. package/dist/simple-tree/api/index.js +4 -5
  416. package/dist/simple-tree/api/index.js.map +1 -1
  417. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  418. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  419. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  420. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  421. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  422. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  423. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  424. package/dist/simple-tree/api/schemaFactoryRecursive.js +0 -1
  425. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  426. package/dist/simple-tree/api/schemaFromSimple.d.ts +6 -1
  427. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  428. package/dist/simple-tree/api/schemaFromSimple.js +5 -0
  429. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  430. package/dist/simple-tree/api/schemaStatics.d.ts +12 -12
  431. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  432. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  433. package/dist/simple-tree/api/simpleSchemaCodec.js +18 -6
  434. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  435. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  436. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  437. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  438. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  439. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  440. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +13 -8
  441. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  442. package/dist/simple-tree/api/typesUnsafe.d.ts +3 -3
  443. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  444. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  445. package/dist/simple-tree/core/allowedTypes.d.ts +2 -2
  446. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  447. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  448. package/dist/simple-tree/core/index.d.ts +1 -1
  449. package/dist/simple-tree/core/index.d.ts.map +1 -1
  450. package/dist/simple-tree/core/index.js +2 -3
  451. package/dist/simple-tree/core/index.js.map +1 -1
  452. package/dist/simple-tree/core/toStored.d.ts +17 -15
  453. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  454. package/dist/simple-tree/core/toStored.js +5 -40
  455. package/dist/simple-tree/core/toStored.js.map +1 -1
  456. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  457. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  458. package/dist/simple-tree/core/unhydratedFlexTree.js +59 -8
  459. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  460. package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
  461. package/dist/simple-tree/core/walkSchema.js +4 -0
  462. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  463. package/dist/simple-tree/createContext.d.ts.map +1 -1
  464. package/dist/simple-tree/createContext.js +20 -5
  465. package/dist/simple-tree/createContext.js.map +1 -1
  466. package/dist/simple-tree/fieldSchema.d.ts +7 -7
  467. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  468. package/dist/simple-tree/fieldSchema.js.map +1 -1
  469. package/dist/simple-tree/index.d.ts +8 -7
  470. package/dist/simple-tree/index.d.ts.map +1 -1
  471. package/dist/simple-tree/index.js +15 -12
  472. package/dist/simple-tree/index.js.map +1 -1
  473. package/dist/simple-tree/leafNodeSchema.d.ts +5 -5
  474. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  475. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  476. package/dist/simple-tree/node-kinds/array/arrayNode.js +5 -3
  477. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  478. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  479. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  480. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  481. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  482. package/dist/simple-tree/node-kinds/common.js +1 -1
  483. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  484. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  485. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
  486. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  487. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  488. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  489. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  490. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  491. package/dist/simple-tree/node-kinds/object/objectNode.js +18 -18
  492. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  493. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  494. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  495. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  496. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  497. package/dist/simple-tree/node-kinds/record/recordNode.js +4 -2
  498. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  499. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  500. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  501. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  502. package/dist/simple-tree/prepareForInsertion.d.ts +54 -47
  503. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  504. package/dist/simple-tree/prepareForInsertion.js +183 -125
  505. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  506. package/dist/simple-tree/simpleSchema.d.ts +55 -23
  507. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  508. package/dist/simple-tree/simpleSchema.js +17 -0
  509. package/dist/simple-tree/simpleSchema.js.map +1 -1
  510. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  511. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  512. package/dist/simple-tree/simpleSchemaFormatV1.js +8 -1
  513. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  514. package/dist/simple-tree/toStoredSchema.d.ts +58 -11
  515. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  516. package/dist/simple-tree/toStoredSchema.js +205 -30
  517. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  518. package/dist/simple-tree/treeSchema.d.ts +23 -0
  519. package/dist/simple-tree/treeSchema.d.ts.map +1 -0
  520. package/dist/simple-tree/treeSchema.js +25 -0
  521. package/dist/simple-tree/treeSchema.js.map +1 -0
  522. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  523. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  524. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +29 -11
  525. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  526. package/dist/tableSchema.d.ts +117 -63
  527. package/dist/tableSchema.d.ts.map +1 -1
  528. package/dist/tableSchema.js +159 -58
  529. package/dist/tableSchema.js.map +1 -1
  530. package/dist/treeFactory.d.ts.map +1 -1
  531. package/dist/treeFactory.js +17 -3
  532. package/dist/treeFactory.js.map +1 -1
  533. package/dist/util/index.d.ts +2 -1
  534. package/dist/util/index.d.ts.map +1 -1
  535. package/dist/util/index.js +4 -1
  536. package/dist/util/index.js.map +1 -1
  537. package/dist/util/rangeMap.d.ts +24 -12
  538. package/dist/util/rangeMap.d.ts.map +1 -1
  539. package/dist/util/rangeMap.js +46 -6
  540. package/dist/util/rangeMap.js.map +1 -1
  541. package/dist/util/readSnapshotBlob.d.ts +13 -0
  542. package/dist/util/readSnapshotBlob.d.ts.map +1 -0
  543. package/dist/util/readSnapshotBlob.js +18 -0
  544. package/dist/util/readSnapshotBlob.js.map +1 -0
  545. package/lib/alpha.d.ts +3 -2
  546. package/lib/codec/codec.d.ts +14 -1
  547. package/lib/codec/codec.d.ts.map +1 -1
  548. package/lib/codec/codec.js +11 -0
  549. package/lib/codec/codec.js.map +1 -1
  550. package/lib/codec/versioned/codec.d.ts +1 -1
  551. package/lib/codec/versioned/codec.d.ts.map +1 -1
  552. package/lib/codec/versioned/codec.js.map +1 -1
  553. package/lib/codec/versioned/format.d.ts +4 -1
  554. package/lib/codec/versioned/format.d.ts.map +1 -1
  555. package/lib/codec/versioned/format.js +4 -1
  556. package/lib/codec/versioned/format.js.map +1 -1
  557. package/lib/core/change-family/changeFamily.d.ts +4 -1
  558. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  559. package/lib/core/change-family/changeFamily.js.map +1 -1
  560. package/lib/core/change-family/index.d.ts +1 -1
  561. package/lib/core/change-family/index.d.ts.map +1 -1
  562. package/lib/core/change-family/index.js.map +1 -1
  563. package/lib/core/index.d.ts +3 -3
  564. package/lib/core/index.d.ts.map +1 -1
  565. package/lib/core/index.js +2 -2
  566. package/lib/core/index.js.map +1 -1
  567. package/lib/core/rebase/changeRebaser.d.ts +6 -1
  568. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  569. package/lib/core/rebase/changeRebaser.js.map +1 -1
  570. package/lib/core/rebase/index.d.ts +1 -1
  571. package/lib/core/rebase/index.d.ts.map +1 -1
  572. package/lib/core/rebase/index.js +1 -1
  573. package/lib/core/rebase/index.js.map +1 -1
  574. package/lib/core/rebase/types.d.ts +2 -1
  575. package/lib/core/rebase/types.d.ts.map +1 -1
  576. package/lib/core/rebase/types.js +3 -0
  577. package/lib/core/rebase/types.js.map +1 -1
  578. package/lib/core/rebase/utils.d.ts.map +1 -1
  579. package/lib/core/rebase/utils.js +25 -7
  580. package/lib/core/rebase/utils.js.map +1 -1
  581. package/lib/core/tree/detachedFieldIndex.d.ts +40 -13
  582. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  583. package/lib/core/tree/detachedFieldIndex.js +22 -13
  584. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  585. package/lib/core/tree/index.d.ts +4 -3
  586. package/lib/core/tree/index.d.ts.map +1 -1
  587. package/lib/core/tree/index.js +3 -2
  588. package/lib/core/tree/index.js.map +1 -1
  589. package/lib/core/tree/pathTree.d.ts +11 -3
  590. package/lib/core/tree/pathTree.d.ts.map +1 -1
  591. package/lib/core/tree/pathTree.js +12 -1
  592. package/lib/core/tree/pathTree.js.map +1 -1
  593. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  594. package/lib/feature-libraries/chunked-forest/basicChunk.js +8 -1
  595. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  596. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  597. package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -1
  598. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  599. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
  600. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  601. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  602. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  603. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  604. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +91 -42
  605. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  606. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +236 -70
  607. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  608. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
  609. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  610. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +34 -29
  611. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  612. package/lib/feature-libraries/default-schema/index.d.ts +2 -1
  613. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  614. package/lib/feature-libraries/default-schema/index.js +2 -1
  615. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  616. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +36 -0
  617. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  618. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +122 -0
  619. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  620. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  621. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  622. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  623. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  624. package/lib/feature-libraries/deltaUtils.d.ts +1 -0
  625. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  626. package/lib/feature-libraries/deltaUtils.js +5 -1
  627. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  628. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  629. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  630. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +38 -8
  631. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  632. package/lib/feature-libraries/flex-tree/context.d.ts +9 -0
  633. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  634. package/lib/feature-libraries/flex-tree/context.js +6 -0
  635. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  636. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  637. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  638. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  639. package/lib/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  640. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  641. package/lib/feature-libraries/flex-tree/lazyField.js +38 -9
  642. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  643. package/lib/feature-libraries/forest-summary/codec.d.ts +2 -2
  644. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  645. package/lib/feature-libraries/forest-summary/codec.js +5 -5
  646. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  647. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
  648. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  649. package/lib/feature-libraries/forest-summary/forestSummarizer.js +17 -22
  650. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  651. package/lib/feature-libraries/forest-summary/format.d.ts +41 -5
  652. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  653. package/lib/feature-libraries/forest-summary/format.js +3 -3
  654. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  655. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
  656. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  657. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +13 -26
  658. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  659. package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
  660. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  661. package/lib/feature-libraries/forest-summary/index.js +2 -1
  662. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  663. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
  664. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  665. package/lib/feature-libraries/forest-summary/summaryTypes.js +53 -0
  666. package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  667. package/lib/feature-libraries/index.d.ts +4 -4
  668. package/lib/feature-libraries/index.d.ts.map +1 -1
  669. package/lib/feature-libraries/index.js +3 -3
  670. package/lib/feature-libraries/index.js.map +1 -1
  671. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  672. package/lib/feature-libraries/mapTreeCursor.js +2 -1
  673. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  674. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  675. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  676. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  677. package/lib/feature-libraries/modular-schema/comparison.d.ts +18 -2
  678. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  679. package/lib/feature-libraries/modular-schema/comparison.js +55 -5
  680. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  681. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  682. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  683. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +3 -5
  684. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  685. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -52
  686. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  687. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  688. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  689. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  690. package/lib/feature-libraries/modular-schema/fieldKind.js +0 -21
  691. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  692. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  693. package/lib/feature-libraries/modular-schema/genericFieldKind.js +7 -10
  694. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  695. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -1
  696. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  697. package/lib/feature-libraries/modular-schema/index.d.ts +6 -6
  698. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  699. package/lib/feature-libraries/modular-schema/index.js +5 -4
  700. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  701. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
  702. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
  703. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +384 -0
  704. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
  705. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
  706. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
  707. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +409 -0
  708. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
  709. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  710. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  711. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +9 -285
  712. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  713. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +49 -15
  714. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  715. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1291 -458
  716. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  717. package/lib/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
  718. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
  719. package/lib/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +2 -2
  720. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
  721. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
  722. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
  723. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +29 -0
  724. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
  725. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
  726. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  727. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +20 -2
  728. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  729. package/lib/feature-libraries/optional-field/index.d.ts +2 -2
  730. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  731. package/lib/feature-libraries/optional-field/index.js +1 -1
  732. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  733. package/lib/feature-libraries/optional-field/optionalField.d.ts +5 -26
  734. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  735. package/lib/feature-libraries/optional-field/optionalField.js +217 -449
  736. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  737. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  738. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  739. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +27 -0
  740. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  741. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  742. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  743. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  744. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  745. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  746. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +55 -26
  747. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  748. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  749. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  750. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +53 -0
  751. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  752. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  753. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  754. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  755. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  756. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  757. package/lib/feature-libraries/schema-index/schemaSummarizer.js +38 -12
  758. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  759. package/lib/feature-libraries/sequence-field/compose.d.ts +6 -7
  760. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  761. package/lib/feature-libraries/sequence-field/compose.js +82 -258
  762. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  763. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  764. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  765. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  766. package/lib/feature-libraries/sequence-field/index.d.ts +2 -3
  767. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  768. package/lib/feature-libraries/sequence-field/index.js +0 -1
  769. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  770. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  771. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  772. package/lib/feature-libraries/sequence-field/invert.js +67 -169
  773. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  774. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  775. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  776. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  777. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  778. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  779. package/lib/feature-libraries/sequence-field/moveEffectTable.js +6 -80
  780. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  781. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  782. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  783. package/lib/feature-libraries/sequence-field/rebase.js +108 -114
  784. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  785. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  786. package/lib/feature-libraries/sequence-field/replaceRevisions.js +16 -33
  787. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  788. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  789. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  790. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  791. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  792. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  793. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +350 -175
  794. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  795. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  796. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +21 -61
  797. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  798. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  799. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  800. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  801. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  802. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  803. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  804. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
  805. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  806. package/lib/feature-libraries/sequence-field/types.d.ts +30 -59
  807. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  808. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  809. package/lib/feature-libraries/sequence-field/utils.d.ts +15 -24
  810. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  811. package/lib/feature-libraries/sequence-field/utils.js +107 -292
  812. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  813. package/lib/index.d.ts +1 -1
  814. package/lib/index.d.ts.map +1 -1
  815. package/lib/index.js +1 -1
  816. package/lib/index.js.map +1 -1
  817. package/lib/packageVersion.d.ts +1 -1
  818. package/lib/packageVersion.js +1 -1
  819. package/lib/packageVersion.js.map +1 -1
  820. package/lib/shared-tree/independentView.d.ts +1 -1
  821. package/lib/shared-tree/independentView.d.ts.map +1 -1
  822. package/lib/shared-tree/independentView.js.map +1 -1
  823. package/lib/shared-tree/index.d.ts +1 -1
  824. package/lib/shared-tree/index.d.ts.map +1 -1
  825. package/lib/shared-tree/index.js.map +1 -1
  826. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  827. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  828. package/lib/shared-tree/schematizeTree.js +3 -2
  829. package/lib/shared-tree/schematizeTree.js.map +1 -1
  830. package/lib/shared-tree/schematizingTreeView.d.ts +1 -5
  831. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  832. package/lib/shared-tree/schematizingTreeView.js +35 -36
  833. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  834. package/lib/shared-tree/sharedTree.d.ts +11 -5
  835. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  836. package/lib/shared-tree/sharedTree.js +14 -4
  837. package/lib/shared-tree/sharedTree.js.map +1 -1
  838. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  839. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  840. package/lib/shared-tree/sharedTreeChangeCodecs.js +1 -0
  841. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  842. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  843. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  844. package/lib/shared-tree/sharedTreeChangeEnricher.js +27 -13
  845. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  846. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +5 -5
  847. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  848. package/lib/shared-tree/sharedTreeChangeFamily.js +11 -5
  849. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  850. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  851. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  852. package/lib/shared-tree/sharedTreeEditBuilder.js +12 -6
  853. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  854. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  855. package/lib/shared-tree/treeAlpha.js +2 -2
  856. package/lib/shared-tree/treeAlpha.js.map +1 -1
  857. package/lib/shared-tree/treeCheckout.d.ts +12 -10
  858. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  859. package/lib/shared-tree/treeCheckout.js +69 -20
  860. package/lib/shared-tree/treeCheckout.js.map +1 -1
  861. package/lib/shared-tree-core/branch.d.ts +3 -2
  862. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  863. package/lib/shared-tree-core/branch.js +4 -3
  864. package/lib/shared-tree-core/branch.js.map +1 -1
  865. package/lib/shared-tree-core/editManager.d.ts +2 -2
  866. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  867. package/lib/shared-tree-core/editManager.js +9 -9
  868. package/lib/shared-tree-core/editManager.js.map +1 -1
  869. package/lib/shared-tree-core/editManagerCodecs.d.ts +4 -0
  870. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  871. package/lib/shared-tree-core/editManagerCodecs.js +14 -5
  872. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  873. package/{dist/shared-tree-core/editManagerCodecsV5.d.ts → lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  874. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  875. package/lib/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +4 -4
  876. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  877. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
  878. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  879. package/lib/shared-tree-core/editManagerFormatCommons.js +22 -7
  880. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  881. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  882. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  883. package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  884. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  885. package/lib/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  886. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  887. package/lib/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  888. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  889. package/lib/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  890. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  891. package/lib/shared-tree-core/editManagerSummarizer.js +39 -11
  892. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  893. package/lib/shared-tree-core/index.d.ts +5 -3
  894. package/lib/shared-tree-core/index.d.ts.map +1 -1
  895. package/lib/shared-tree-core/index.js +4 -2
  896. package/lib/shared-tree-core/index.js.map +1 -1
  897. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  898. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  899. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  900. package/{dist/shared-tree-core/messageCodecV5.d.ts → lib/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  901. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  902. package/lib/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +3 -3
  903. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  904. package/lib/shared-tree-core/messageCodecs.d.ts +4 -0
  905. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  906. package/lib/shared-tree-core/messageCodecs.js +14 -5
  907. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  908. package/lib/shared-tree-core/messageFormat.d.ts +20 -6
  909. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  910. package/lib/shared-tree-core/messageFormat.js +22 -7
  911. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  912. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  913. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  914. package/lib/shared-tree-core/messageFormatV1ToV4.js +8 -1
  915. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  916. package/lib/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
  917. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  918. package/lib/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  919. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  920. package/lib/shared-tree-core/sharedTreeCore.d.ts +14 -47
  921. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  922. package/lib/shared-tree-core/sharedTreeCore.js +28 -16
  923. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  924. package/lib/shared-tree-core/summaryTypes.d.ts +94 -0
  925. package/lib/shared-tree-core/summaryTypes.d.ts.map +1 -0
  926. package/lib/shared-tree-core/summaryTypes.js +43 -0
  927. package/lib/shared-tree-core/summaryTypes.js.map +1 -0
  928. package/lib/shared-tree-core/versionedSummarizer.d.ts +67 -0
  929. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  930. package/lib/shared-tree-core/versionedSummarizer.js +59 -0
  931. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -0
  932. package/lib/simple-tree/api/configuration.d.ts +3 -26
  933. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  934. package/lib/simple-tree/api/configuration.js +14 -25
  935. package/lib/simple-tree/api/configuration.js.map +1 -1
  936. package/lib/simple-tree/api/dirtyIndex.d.ts +11 -0
  937. package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  938. package/lib/simple-tree/api/dirtyIndex.js +7 -0
  939. package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
  940. package/lib/simple-tree/api/discrepancies.d.ts +1 -1
  941. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  942. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  943. package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -3
  944. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  945. package/lib/simple-tree/api/getSimpleSchema.js +9 -3
  946. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
  947. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  948. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  949. package/lib/simple-tree/api/incrementalAllowedTypes.js +8 -1
  950. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  951. package/lib/simple-tree/api/index.d.ts +3 -4
  952. package/lib/simple-tree/api/index.d.ts.map +1 -1
  953. package/lib/simple-tree/api/index.js +2 -3
  954. package/lib/simple-tree/api/index.js.map +1 -1
  955. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  956. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  957. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  958. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  959. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  960. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  961. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  962. package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -1
  963. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  964. package/lib/simple-tree/api/schemaFromSimple.d.ts +6 -1
  965. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  966. package/lib/simple-tree/api/schemaFromSimple.js +5 -0
  967. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  968. package/lib/simple-tree/api/schemaStatics.d.ts +12 -12
  969. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  970. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  971. package/lib/simple-tree/api/simpleSchemaCodec.js +15 -3
  972. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  973. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  974. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  975. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  976. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  977. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  978. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +15 -10
  979. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  980. package/lib/simple-tree/api/typesUnsafe.d.ts +3 -3
  981. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  982. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  983. package/lib/simple-tree/core/allowedTypes.d.ts +2 -2
  984. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  985. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  986. package/lib/simple-tree/core/index.d.ts +1 -1
  987. package/lib/simple-tree/core/index.d.ts.map +1 -1
  988. package/lib/simple-tree/core/index.js +1 -1
  989. package/lib/simple-tree/core/index.js.map +1 -1
  990. package/lib/simple-tree/core/toStored.d.ts +17 -15
  991. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  992. package/lib/simple-tree/core/toStored.js +4 -37
  993. package/lib/simple-tree/core/toStored.js.map +1 -1
  994. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  995. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  996. package/lib/simple-tree/core/unhydratedFlexTree.js +58 -8
  997. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  998. package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
  999. package/lib/simple-tree/core/walkSchema.js +5 -1
  1000. package/lib/simple-tree/core/walkSchema.js.map +1 -1
  1001. package/lib/simple-tree/createContext.d.ts.map +1 -1
  1002. package/lib/simple-tree/createContext.js +20 -5
  1003. package/lib/simple-tree/createContext.js.map +1 -1
  1004. package/lib/simple-tree/fieldSchema.d.ts +7 -7
  1005. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  1006. package/lib/simple-tree/fieldSchema.js.map +1 -1
  1007. package/lib/simple-tree/index.d.ts +8 -7
  1008. package/lib/simple-tree/index.d.ts.map +1 -1
  1009. package/lib/simple-tree/index.js +6 -5
  1010. package/lib/simple-tree/index.js.map +1 -1
  1011. package/lib/simple-tree/leafNodeSchema.d.ts +5 -5
  1012. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  1013. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  1014. package/lib/simple-tree/node-kinds/array/arrayNode.js +6 -4
  1015. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  1016. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  1017. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  1018. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  1019. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  1020. package/lib/simple-tree/node-kinds/common.js +2 -2
  1021. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  1022. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  1023. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  1024. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  1025. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  1026. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  1027. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  1028. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  1029. package/lib/simple-tree/node-kinds/object/objectNode.js +19 -19
  1030. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  1031. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  1032. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  1033. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  1034. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  1035. package/lib/simple-tree/node-kinds/record/recordNode.js +4 -2
  1036. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  1037. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  1038. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  1039. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  1040. package/lib/simple-tree/prepareForInsertion.d.ts +54 -47
  1041. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  1042. package/lib/simple-tree/prepareForInsertion.js +183 -124
  1043. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  1044. package/lib/simple-tree/simpleSchema.d.ts +55 -23
  1045. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  1046. package/lib/simple-tree/simpleSchema.js +16 -1
  1047. package/lib/simple-tree/simpleSchema.js.map +1 -1
  1048. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  1049. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  1050. package/lib/simple-tree/simpleSchemaFormatV1.js +8 -1
  1051. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  1052. package/lib/simple-tree/toStoredSchema.d.ts +58 -11
  1053. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  1054. package/lib/simple-tree/toStoredSchema.js +204 -31
  1055. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  1056. package/lib/simple-tree/treeSchema.d.ts +23 -0
  1057. package/lib/simple-tree/treeSchema.d.ts.map +1 -0
  1058. package/lib/simple-tree/treeSchema.js +21 -0
  1059. package/lib/simple-tree/treeSchema.js.map +1 -0
  1060. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  1061. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  1062. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +26 -9
  1063. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  1064. package/lib/tableSchema.d.ts +117 -63
  1065. package/lib/tableSchema.d.ts.map +1 -1
  1066. package/lib/tableSchema.js +160 -59
  1067. package/lib/tableSchema.js.map +1 -1
  1068. package/lib/treeFactory.d.ts.map +1 -1
  1069. package/lib/treeFactory.js +18 -4
  1070. package/lib/treeFactory.js.map +1 -1
  1071. package/lib/util/index.d.ts +2 -1
  1072. package/lib/util/index.d.ts.map +1 -1
  1073. package/lib/util/index.js +2 -1
  1074. package/lib/util/index.js.map +1 -1
  1075. package/lib/util/rangeMap.d.ts +24 -12
  1076. package/lib/util/rangeMap.d.ts.map +1 -1
  1077. package/lib/util/rangeMap.js +44 -5
  1078. package/lib/util/rangeMap.js.map +1 -1
  1079. package/lib/util/readSnapshotBlob.d.ts +13 -0
  1080. package/lib/util/readSnapshotBlob.d.ts.map +1 -0
  1081. package/lib/util/readSnapshotBlob.js +14 -0
  1082. package/lib/util/readSnapshotBlob.js.map +1 -0
  1083. package/package.json +21 -21
  1084. package/src/codec/codec.ts +15 -1
  1085. package/src/codec/versioned/codec.ts +1 -1
  1086. package/src/codec/versioned/format.ts +4 -1
  1087. package/src/core/change-family/changeFamily.ts +5 -0
  1088. package/src/core/change-family/index.ts +1 -0
  1089. package/src/core/index.ts +7 -2
  1090. package/src/core/rebase/changeRebaser.ts +6 -1
  1091. package/src/core/rebase/index.ts +1 -0
  1092. package/src/core/rebase/types.ts +8 -1
  1093. package/src/core/rebase/utils.ts +31 -7
  1094. package/src/core/tree/detachedFieldIndex.ts +71 -14
  1095. package/src/core/tree/index.ts +9 -3
  1096. package/src/core/tree/pathTree.ts +16 -4
  1097. package/src/feature-libraries/chunked-forest/basicChunk.ts +7 -1
  1098. package/src/feature-libraries/chunked-forest/chunkTree.ts +6 -1
  1099. package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +15 -7
  1100. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
  1101. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +398 -127
  1102. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +35 -38
  1103. package/src/feature-libraries/default-schema/index.ts +17 -5
  1104. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +180 -0
  1105. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +35 -9
  1106. package/src/feature-libraries/deltaUtils.ts +6 -1
  1107. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +62 -15
  1108. package/src/feature-libraries/flex-tree/context.ts +17 -0
  1109. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +7 -8
  1110. package/src/feature-libraries/flex-tree/lazyField.ts +66 -24
  1111. package/src/feature-libraries/forest-summary/codec.ts +8 -8
  1112. package/src/feature-libraries/forest-summary/forestSummarizer.ts +45 -37
  1113. package/src/feature-libraries/forest-summary/format.ts +4 -4
  1114. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +23 -39
  1115. package/src/feature-libraries/forest-summary/index.ts +2 -1
  1116. package/src/feature-libraries/forest-summary/summaryTypes.ts +61 -0
  1117. package/src/feature-libraries/index.ts +23 -9
  1118. package/src/feature-libraries/mapTreeCursor.ts +2 -1
  1119. package/src/feature-libraries/mitigatedChangeFamily.ts +3 -1
  1120. package/src/feature-libraries/modular-schema/comparison.ts +63 -5
  1121. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +142 -44
  1122. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +36 -57
  1123. package/src/feature-libraries/modular-schema/fieldKind.ts +24 -40
  1124. package/src/feature-libraries/modular-schema/genericFieldKind.ts +10 -19
  1125. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -1
  1126. package/src/feature-libraries/modular-schema/index.ts +22 -15
  1127. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +732 -0
  1128. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +790 -0
  1129. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +29 -499
  1130. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2547 -739
  1131. package/src/feature-libraries/modular-schema/{modularChangeFormat.ts → modularChangeFormatV1.ts} +2 -1
  1132. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +62 -0
  1133. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +98 -10
  1134. package/src/feature-libraries/optional-field/index.ts +1 -3
  1135. package/src/feature-libraries/optional-field/optionalField.ts +317 -574
  1136. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +45 -0
  1137. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +24 -38
  1138. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
  1139. package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +94 -0
  1140. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -1
  1141. package/src/feature-libraries/schema-index/schemaSummarizer.ts +59 -18
  1142. package/src/feature-libraries/sequence-field/compose.ts +134 -519
  1143. package/src/feature-libraries/sequence-field/helperTypes.ts +34 -19
  1144. package/src/feature-libraries/sequence-field/index.ts +0 -9
  1145. package/src/feature-libraries/sequence-field/invert.ts +103 -228
  1146. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1147. package/src/feature-libraries/sequence-field/moveEffectTable.ts +8 -191
  1148. package/src/feature-libraries/sequence-field/rebase.ts +168 -203
  1149. package/src/feature-libraries/sequence-field/replaceRevisions.ts +31 -52
  1150. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +0 -2
  1151. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +643 -220
  1152. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +56 -68
  1153. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +25 -27
  1154. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +19 -129
  1155. package/src/feature-libraries/sequence-field/types.ts +34 -64
  1156. package/src/feature-libraries/sequence-field/utils.ts +133 -346
  1157. package/src/index.ts +3 -2
  1158. package/src/packageVersion.ts +1 -1
  1159. package/src/shared-tree/independentView.ts +1 -1
  1160. package/src/shared-tree/index.ts +3 -2
  1161. package/src/shared-tree/schematizeTree.ts +21 -8
  1162. package/src/shared-tree/schematizingTreeView.ts +50 -68
  1163. package/src/shared-tree/sharedTree.ts +39 -12
  1164. package/src/shared-tree/sharedTreeChangeCodecs.ts +5 -1
  1165. package/src/shared-tree/sharedTreeChangeEnricher.ts +33 -11
  1166. package/src/shared-tree/sharedTreeChangeFamily.ts +15 -5
  1167. package/src/shared-tree/sharedTreeEditBuilder.ts +47 -13
  1168. package/src/shared-tree/treeAlpha.ts +2 -3
  1169. package/src/shared-tree/treeCheckout.ts +104 -31
  1170. package/src/shared-tree-core/branch.ts +8 -2
  1171. package/src/shared-tree-core/editManager.ts +16 -2
  1172. package/src/shared-tree-core/editManagerCodecs.ts +17 -5
  1173. package/src/shared-tree-core/{editManagerCodecsV5.ts → editManagerCodecsVSharedBranches.ts} +3 -3
  1174. package/src/shared-tree-core/editManagerFormatCommons.ts +22 -7
  1175. package/src/shared-tree-core/editManagerFormatV1toV4.ts +3 -1
  1176. package/src/shared-tree-core/{editManagerFormatV5.ts → editManagerFormatVSharedBranches.ts} +2 -2
  1177. package/src/shared-tree-core/editManagerSummarizer.ts +58 -16
  1178. package/src/shared-tree-core/index.ts +11 -3
  1179. package/src/shared-tree-core/messageCodecV1ToV4.ts +2 -1
  1180. package/src/shared-tree-core/{messageCodecV5.ts → messageCodecVSharedBranches.ts} +3 -3
  1181. package/src/shared-tree-core/messageCodecs.ts +17 -5
  1182. package/src/shared-tree-core/messageFormat.ts +22 -7
  1183. package/src/shared-tree-core/messageFormatV1ToV4.ts +16 -2
  1184. package/src/shared-tree-core/{messageFormatV5.ts → messageFormatVSharedBranches.ts} +4 -6
  1185. package/src/shared-tree-core/sharedTreeCore.ts +67 -76
  1186. package/src/shared-tree-core/summaryTypes.ts +122 -0
  1187. package/src/shared-tree-core/versionedSummarizer.ts +107 -0
  1188. package/src/simple-tree/api/configuration.ts +21 -68
  1189. package/src/simple-tree/api/dirtyIndex.ts +11 -0
  1190. package/src/simple-tree/api/discrepancies.ts +1 -1
  1191. package/src/simple-tree/api/getSimpleSchema.ts +13 -6
  1192. package/src/simple-tree/api/incrementalAllowedTypes.ts +15 -3
  1193. package/src/simple-tree/api/index.ts +3 -4
  1194. package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
  1195. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
  1196. package/src/simple-tree/api/schemaFactoryRecursive.ts +0 -2
  1197. package/src/simple-tree/api/schemaFromSimple.ts +11 -5
  1198. package/src/simple-tree/api/simpleSchemaCodec.ts +17 -3
  1199. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
  1200. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +18 -10
  1201. package/src/simple-tree/api/typesUnsafe.ts +7 -3
  1202. package/src/simple-tree/core/allowedTypes.ts +3 -3
  1203. package/src/simple-tree/core/index.ts +2 -2
  1204. package/src/simple-tree/core/toStored.ts +22 -55
  1205. package/src/simple-tree/core/unhydratedFlexTree.ts +87 -36
  1206. package/src/simple-tree/core/walkSchema.ts +6 -0
  1207. package/src/simple-tree/createContext.ts +26 -11
  1208. package/src/simple-tree/fieldSchema.ts +16 -7
  1209. package/src/simple-tree/index.ts +12 -11
  1210. package/src/simple-tree/node-kinds/array/arrayNode.ts +12 -7
  1211. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +3 -3
  1212. package/src/simple-tree/node-kinds/common.ts +2 -5
  1213. package/src/simple-tree/node-kinds/map/mapNode.ts +9 -6
  1214. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +3 -3
  1215. package/src/simple-tree/node-kinds/object/objectNode.ts +26 -26
  1216. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -2
  1217. package/src/simple-tree/node-kinds/record/recordNode.ts +15 -11
  1218. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +3 -3
  1219. package/src/simple-tree/prepareForInsertion.ts +343 -200
  1220. package/src/simple-tree/simpleSchema.ts +79 -32
  1221. package/src/simple-tree/simpleSchemaFormatV1.ts +9 -1
  1222. package/src/simple-tree/toStoredSchema.ts +319 -61
  1223. package/src/simple-tree/treeSchema.ts +54 -0
  1224. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +42 -14
  1225. package/src/tableSchema.ts +485 -166
  1226. package/src/treeFactory.ts +19 -5
  1227. package/src/util/index.ts +5 -0
  1228. package/src/util/rangeMap.ts +72 -18
  1229. package/src/util/readSnapshotBlob.ts +23 -0
  1230. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
  1231. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
  1232. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  1233. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  1234. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -50
  1235. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  1236. package/dist/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  1237. package/dist/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  1238. package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  1239. package/dist/shared-tree-core/editManagerFormatV5.js.map +0 -1
  1240. package/dist/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  1241. package/dist/shared-tree-core/messageCodecV5.js.map +0 -1
  1242. package/dist/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  1243. package/dist/shared-tree-core/messageFormatV5.js.map +0 -1
  1244. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  1245. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  1246. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +0 -177
  1247. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  1248. package/docs/main/sequence-field/move-composition.md +0 -46
  1249. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
  1250. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
  1251. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  1252. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  1253. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -46
  1254. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  1255. package/lib/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  1256. package/lib/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  1257. package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  1258. package/lib/shared-tree-core/editManagerFormatV5.js.map +0 -1
  1259. package/lib/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  1260. package/lib/shared-tree-core/messageCodecV5.js.map +0 -1
  1261. package/lib/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  1262. package/lib/shared-tree-core/messageFormatV5.js.map +0 -1
  1263. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  1264. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  1265. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +0 -171
  1266. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  1267. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
  1268. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +0 -209
@@ -1 +1 @@
1
- {"version":3,"file":"mapNode.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/map/mapNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EACN,WAAW,GAKX,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EACN,kBAAkB,EAClB,SAAS,EAET,QAAQ;AAER,kDAAkD;AAClD,cAAc,EAEd,gBAAgB,EAChB,YAAY,EAGZ,qBAAqB,EAKrB,aAAa,EAIb,iBAAiB,EACjB,+BAA+B,EAG/B,6BAA6B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,gCAAgC,GAGhC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACN,KAAK,EACL,KAAK,EACL,eAAe,GAGf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAM1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc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,QAAQ,IAAI,EAAE,CAAC;IACL,wBAAiB,GACvC,iBAAiB,CAAC;IAcpB,MAAM,YAAY,GAOW,MAAM,CAAC;IACpC,OAAO,YAAY,CAAC;AACrB,CAAC;AAUD;;GAEG;AACH,SAAS,wBAAwB,CAAC,IAAoB;IACrD,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,OAAO,kBAAkB,CAAC,IAAI,CAAC;IAChC,CAAC;IAED,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,6IAA6I;QAC7I,OAAO,kBAAkB,CAAC,GAAG,CAAC;IAC/B,CAAC;IAED,IAAI,MAAM,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC7B,OAAO,kBAAkB,CAAC,MAAM,CAAC;IAClC,CAAC;IAED,gFAAgF;IAChF,OAAO,kBAAkB,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,UAAU,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,2BAA2B,CAAC,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 { assert, Lazy } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\tisTreeValue,\n\ttype FlexibleNodeContent,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype OptionalFieldEditBuilder,\n} from \"../../../feature-libraries/index.js\";\nimport { tryGetTreeNodeForField } from \"../../getTreeNodeForField.js\";\nimport { createFieldSchema, FieldKind } from \"../../fieldSchema.js\";\nimport {\n\tCompatibilityLevel,\n\tgetKernel,\n\ttype InnerNode,\n\tNodeKind,\n\ttype TreeNodeSchema,\n\t// eslint-disable-next-line import-x/no-deprecated\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 {\n\tunhydratedFlexTreeFromInsertable,\n\ttype FactoryContent,\n\ttype InsertableContent,\n} from \"../../unhydratedFlexTreeFromInsertable.js\";\nimport { prepareForInsertion } from \"../../prepareForInsertion.js\";\nimport {\n\tbrand,\n\tcount,\n\tisReadonlyArray,\n\ttype JsonCompatibleReadOnlyObject,\n\ttype RestrictiveStringRecord,\n} from \"../../../util/index.js\";\nimport { getTreeNodeSchemaInitializedData } from \"../../createContext.js\";\nimport type {\n\tMapNodeCustomizableSchema,\n\tMapNodePojoEmulationSchema,\n\tMapNodeSchema,\n} from \"./mapNodeTypes.js\";\nimport { recordLikeDataToFlexContent } from \"../common.js\";\nimport { MapNodeStoredSchema } from \"../../../core/index.js\";\nimport type { NodeSchemaOptionsAlpha } from \"../../api/index.js\";\nimport type { SimpleAllowedTypeAttributes } from \"../../simpleSchema.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// 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<TreeMapNode<any>> = {\n\tgetPrototypeOf: () => {\n\t\treturn Map.prototype;\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\treturn 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 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 TreeMapNode<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\t// TODO: add `clear` once we have established merge semantics for it.\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 TreeMapNode<T> {\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<string, SimpleAllowedTypeAttributes> {\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\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;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EACN,WAAW,GAKX,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EACN,kBAAkB,EAClB,SAAS,EAET,QAAQ;AAER,kDAAkD;AAClD,cAAc,EAEd,gBAAgB,EAChB,YAAY,EAGZ,qBAAqB,EAKrB,aAAa,EAIb,iBAAiB,EACjB,+BAA+B,EAG/B,6BAA6B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,gCAAgC,GAGhC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACN,KAAK,EACL,KAAK,EACL,eAAe,GAGf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAM1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAwF7D,0IAA0I;AAC1I,uDAAuD;AACvD,8DAA8D;AAC9D,MAAM,OAAO,GAAmC;IAC/C,cAAc,EAAE,GAAG,EAAE;QACpB,OAAO,GAAG,CAAC,SAAS,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,MAAe,iBAAw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IAAI,CAAC;IAChC,CAAC;IAED,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,6IAA6I;QAC7I,OAAO,kBAAkB,CAAC,GAAG,CAAC;IAC/B,CAAC;IAED,IAAI,MAAM,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC7B,OAAO,kBAAkB,CAAC,MAAM,CAAC;IAClC,CAAC;IAED,gFAAgF;IAChF,OAAO,kBAAkB,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,UAAU,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,2BAA2B,CAAC,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 { assert, Lazy } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\tisTreeValue,\n\ttype FlexibleNodeContent,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype OptionalFieldEditor,\n} from \"../../../feature-libraries/index.js\";\nimport { tryGetTreeNodeForField } from \"../../getTreeNodeForField.js\";\nimport { createFieldSchema, FieldKind } from \"../../fieldSchema.js\";\nimport {\n\tCompatibilityLevel,\n\tgetKernel,\n\ttype InnerNode,\n\tNodeKind,\n\ttype TreeNodeSchema,\n\t// eslint-disable-next-line import-x/no-deprecated\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 {\n\tunhydratedFlexTreeFromInsertable,\n\ttype FactoryContent,\n\ttype InsertableContent,\n} from \"../../unhydratedFlexTreeFromInsertable.js\";\nimport { prepareForInsertion } from \"../../prepareForInsertion.js\";\nimport {\n\tbrand,\n\tcount,\n\tisReadonlyArray,\n\ttype JsonCompatibleReadOnlyObject,\n\ttype RestrictiveStringRecord,\n} from \"../../../util/index.js\";\nimport { getTreeNodeSchemaInitializedData } from \"../../createContext.js\";\nimport type {\n\tMapNodeCustomizableSchema,\n\tMapNodePojoEmulationSchema,\n\tMapNodeSchema,\n} from \"./mapNodeTypes.js\";\nimport { recordLikeDataToFlexContent } from \"../common.js\";\nimport { MapNodeStoredSchema } from \"../../../core/index.js\";\nimport type { NodeSchemaOptionsAlpha } from \"../../api/index.js\";\nimport type { SchemaType, SimpleAllowedTypeAttributes } from \"../../simpleSchema.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// 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<TreeMapNode<any>> = {\n\tgetPrototypeOf: () => {\n\t\treturn Map.prototype;\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): OptionalFieldEditor<FlexibleNodeContent, FlexTreeNode> {\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).clear(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\treturn 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).attach(mapTree, field.length === 0);\n\t\treturn this;\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 TreeMapNode<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\t// TODO: add `clear` once we have established merge semantics for it.\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 TreeMapNode<T> {\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\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"]}
@@ -5,18 +5,18 @@
5
5
  import type { MapNodeInsertableData, TreeMapNode } from "./mapNode.js";
6
6
  import { NodeKind } from "../../core/index.js";
7
7
  import type { TreeNodeSchemaClass, TreeNodeSchema, TreeNodeSchemaNonClass, WithType, ImplicitAllowedTypes } from "../../core/index.js";
8
- import type { SimpleMapNodeSchema } from "../../simpleSchema.js";
8
+ import type { SchemaType, SimpleMapNodeSchema } from "../../simpleSchema.js";
9
9
  /**
10
10
  * A schema for customizable {@link (TreeMapNode:interface)}s.
11
11
  * @system @sealed @alpha
12
12
  */
13
- export interface MapNodeCustomizableSchema<out TName extends string = string, in out T extends ImplicitAllowedTypes = ImplicitAllowedTypes, out ImplicitlyConstructable extends boolean = true, out TCustomMetadata = unknown> extends TreeNodeSchemaClass<TName, NodeKind.Map, TreeMapNode<T> & WithType<TName, NodeKind.Map, T>, MapNodeInsertableData<T>, ImplicitlyConstructable, T, undefined, TCustomMetadata>, SimpleMapNodeSchema<TCustomMetadata> {
13
+ export interface MapNodeCustomizableSchema<out TName extends string = string, in out T extends ImplicitAllowedTypes = ImplicitAllowedTypes, out ImplicitlyConstructable extends boolean = true, out TCustomMetadata = unknown> extends TreeNodeSchemaClass<TName, NodeKind.Map, TreeMapNode<T> & WithType<TName, NodeKind.Map, T>, MapNodeInsertableData<T>, ImplicitlyConstructable, T, undefined, TCustomMetadata>, SimpleMapNodeSchema<SchemaType.View, TCustomMetadata> {
14
14
  }
15
15
  /**
16
16
  * A schema for POJO emulation mode {@link (TreeMapNode:interface)}s.
17
17
  * @system @sealed @alpha
18
18
  */
19
- export interface MapNodePojoEmulationSchema<out TName extends string = string, in out T extends ImplicitAllowedTypes = ImplicitAllowedTypes, out ImplicitlyConstructable extends boolean = true, out TCustomMetadata = unknown> extends TreeNodeSchemaNonClass<TName, NodeKind.Map, TreeMapNode<T> & WithType<TName, NodeKind.Map, T>, MapNodeInsertableData<T>, ImplicitlyConstructable, T, undefined, TCustomMetadata>, SimpleMapNodeSchema<TCustomMetadata> {
19
+ export interface MapNodePojoEmulationSchema<out TName extends string = string, in out T extends ImplicitAllowedTypes = ImplicitAllowedTypes, out ImplicitlyConstructable extends boolean = true, out TCustomMetadata = unknown> extends TreeNodeSchemaNonClass<TName, NodeKind.Map, TreeMapNode<T> & WithType<TName, NodeKind.Map, T>, MapNodeInsertableData<T>, ImplicitlyConstructable, T, undefined, TCustomMetadata>, SimpleMapNodeSchema<SchemaType.View, TCustomMetadata> {
20
20
  }
21
21
  /**
22
22
  * A schema for {@link (TreeMapNode:interface)}s.
@@ -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,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvE,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;AAE7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;;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,WAAW,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,EACjD,qBAAqB,CAAC,CAAC,CAAC,EACxB,uBAAuB,EACvB,CAAC,EACD,SAAS,EACT,eAAe,CACf,EACD,mBAAmB,CAAC,eAAe,CAAC;CAAG;AAEzC;;;GAGG;AACH,MAAM,WAAW,0BA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AAc,GAAG,MAAM,IAAI,aAAa,CAE/E"}
@@ -1 +1 @@
1
- {"version":3,"file":"mapNodeTypes.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/map/mapNodeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AA+D/C;;GAEG;AACH,MAAM,CAAC,MAAM,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,MAAM,UAAU,eAAe,CAAC,MAAsB;IACrD,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,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 type { MapNodeInsertableData, TreeMapNode } from \"./mapNode.js\";\nimport { NodeKind } from \"../../core/index.js\";\nimport type {\n\tTreeNodeSchemaClass,\n\tTreeNodeSchema,\n\tTreeNodeSchemaNonClass,\n\tWithType,\n\tImplicitAllowedTypes,\n} from \"../../core/index.js\";\n\nimport type { SimpleMapNodeSchema } from \"../../simpleSchema.js\";\n\n/**\n * A schema for customizable {@link (TreeMapNode: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\tTreeMapNode<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<TCustomMetadata> {}\n\n/**\n * A schema for POJO emulation mode {@link (TreeMapNode: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\tTreeMapNode<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<TCustomMetadata> {}\n\n/**\n * A schema for {@link (TreeMapNode: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;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AA+D/C;;GAEG;AACH,MAAM,CAAC,MAAM,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,MAAM,UAAU,eAAe,CAAC,MAAsB;IACrD,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,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 type { MapNodeInsertableData, TreeMapNode } from \"./mapNode.js\";\nimport { NodeKind } from \"../../core/index.js\";\nimport type {\n\tTreeNodeSchemaClass,\n\tTreeNodeSchema,\n\tTreeNodeSchemaNonClass,\n\tWithType,\n\tImplicitAllowedTypes,\n} from \"../../core/index.js\";\n\nimport type { SchemaType, SimpleMapNodeSchema } from \"../../simpleSchema.js\";\n\n/**\n * A schema for customizable {@link (TreeMapNode: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\tTreeMapNode<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 (TreeMapNode: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\tTreeMapNode<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 (TreeMapNode: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,EAC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D;;;;;;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,CAuKzB"}
@@ -15,7 +15,7 @@ import { getTreeNodeSchemaInitializedData, getUnhydratedContext, } from "../../c
15
15
  import { tryGetTreeNodeForField } from "../../getTreeNodeForField.js";
16
16
  import { prepareForInsertion } from "../../prepareForInsertion.js";
17
17
  import { getStoredKey, getExplicitStoredKey, FieldSchemaAlpha, normalizeFieldSchema, FieldKind, extractFieldProvider, isConstant, } from "../../fieldSchema.js";
18
- import { unhydratedFlexTreeFromInsertable, unhydratedFlexTreeFromInsertableNode, } from "../../unhydratedFlexTreeFromInsertable.js";
18
+ import { unhydratedFlexTreeFromInsertable, flexTreeFromInsertableNode, } from "../../unhydratedFlexTreeFromInsertable.js";
19
19
  import { convertFieldKind } from "../../toStoredSchema.js";
20
20
  /**
21
21
  * Caches the mappings from property keys to stored keys for the provided object field schemas in {@link simpleKeyToFlexKeyCache}.
@@ -126,22 +126,24 @@ function createProxyHandler(schema, allowAdditionalProperties) {
126
126
  return handler;
127
127
  }
128
128
  export function setField(field, simpleFieldSchema, value, destinationSchema) {
129
- const mapTree = prepareForInsertion(value, simpleFieldSchema, field.context, destinationSchema);
130
- switch (field.schema) {
131
- case FieldKinds.required.identifier: {
132
- assert(mapTree !== undefined, 0xa04 /* Cannot set a required field to undefined */);
133
- const typedField = field;
134
- typedField.editor.set(mapTree);
135
- break;
136
- }
137
- case FieldKinds.optional.identifier: {
138
- const typedField = field;
139
- typedField.editor.set(mapTree, typedField.length === 0);
140
- break;
129
+ field.context.runInTransaction(() => {
130
+ const mapTree = prepareForInsertion(value, simpleFieldSchema, field.context, destinationSchema);
131
+ switch (field.schema) {
132
+ case FieldKinds.required.identifier: {
133
+ assert(mapTree !== undefined, 0xa04 /* Cannot set a required field to undefined */);
134
+ const typedField = field;
135
+ typedField.editor.attach(mapTree);
136
+ break;
137
+ }
138
+ case FieldKinds.optional.identifier: {
139
+ const typedField = field;
140
+ typedField.editor.attach(mapTree, typedField.length === 0);
141
+ break;
142
+ }
143
+ default:
144
+ fail(0xade /* invalid FieldKind */);
141
145
  }
142
- default:
143
- fail(0xade /* invalid FieldKind */);
144
- }
146
+ });
145
147
  }
146
148
  /**
147
149
  * {@link FieldSchemaAlpha} including {@link SimpleObjectFieldSchema}.
@@ -331,9 +333,7 @@ function objectToFlexContent(data, schema) {
331
333
  children = isConstant(fieldProvider) ? fieldProvider() : fieldProvider;
332
334
  }
333
335
  else {
334
- children = [
335
- unhydratedFlexTreeFromInsertableNode(value, fieldInfo.schema.allowedTypeSet),
336
- ];
336
+ children = [flexTreeFromInsertableNode(value, fieldInfo.schema.allowedTypeSet)];
337
337
  }
338
338
  const kind = convertFieldKind.get(fieldInfo.schema.kind) ?? fail(0xbb2 /* Invalid field kind */);
339
339
  fields.set(fieldInfo.storedKey, createField(context, kind.identifier, fieldInfo.storedKey, children));
@@ -1 +1 @@
1
- {"version":3,"file":"objectNode.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/object/objectNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAEvE,OAAO,EACN,s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I,CAAC,IAAI;QACX,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACtE,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAClC,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IACnF,MAAM,CACL,YAAY,YAAY,sBAAsB,EAC9C,KAAK,CAAC,qCAAqC,CAC3C,CAAC;IAEF,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,SAAS,EAAE,CAAC;QACjF,OAAO;IACR,CAAC;IAED,QAAQ,CACP,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,EACnC,SAAS,CAAC,MAAM,EAChB,KAAK,EACL,YAAY,CAAC,cAAc,CAAC,SAAS,CAAC,SAAS,CAAC,CAChD,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, Lazy, fail, debugAssert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\tObjectNodeStoredSchema,\n\ttype FieldKey,\n\ttype TreeFieldStoredSchema,\n} from \"../../../core/index.js\";\nimport {\n\tFieldKinds,\n\tisTreeValue,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n} from \"../../../feature-libraries/index.js\";\nimport type {\n\tRestrictiveStringRecord,\n\tFlattenKeys,\n\tJsonCompatibleReadOnlyObject,\n} from \"../../../util/index.js\";\nimport { brand } from \"../../../util/index.js\";\n\nimport {\n\tCompatibilityLevel,\n\ttype TreeNodeSchema,\n\tNodeKind,\n\ttype WithType,\n\t// eslint-disable-next-line import-x/no-deprecated\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\ttype InternalTreeNode,\n\ttype TreeNode,\n\ttype UnhydratedFlexTreeNode,\n\tgetInnerNode,\n\ttype NodeSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\tTreeNodeValid,\n\ttype MostDerivedData,\n\ttype TreeNodeSchemaInitializedData,\n\tprivateDataSymbol,\n\tcreateTreeNodeSchemaPrivateData,\n\ttype FlexContent,\n\ttype UnhydratedFlexTreeField,\n\tcreateField,\n\ttype TreeNodeSchemaCorePrivate,\n\ttype TreeNodeSchemaPrivateData,\n} from \"../../core/index.js\";\nimport {\n\tgetTreeNodeSchemaInitializedData,\n\tgetUnhydratedContext,\n} from \"../../createContext.js\";\nimport { tryGetTreeNodeForField } from \"../../getTreeNodeForField.js\";\nimport type {\n\tObjectNodeSchema,\n\tObjectNodeSchemaInternalData,\n\tObjectNodeSchemaPrivate,\n} from \"./objectNodeTypes.js\";\nimport { prepareForInsertion } from \"../../prepareForInsertion.js\";\nimport {\n\ttype ImplicitFieldSchema,\n\tgetStoredKey,\n\tgetExplicitStoredKey,\n\ttype TreeFieldFromImplicitField,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype FieldSchema,\n\tFieldSchemaAlpha,\n\tnormalizeFieldSchema,\n\tFieldKind,\n\ttype FieldProps,\n\ttype ContextualFieldProvider,\n\textractFieldProvider,\n\tisConstant,\n} from \"../../fieldSchema.js\";\nimport type { SimpleObjectFieldSchema } from \"../../simpleSchema.js\";\nimport {\n\tunhydratedFlexTreeFromInsertable,\n\tunhydratedFlexTreeFromInsertableNode,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n\ttype InsertableContent,\n} from \"../../unhydratedFlexTreeFromInsertable.js\";\nimport { convertFieldKind } from \"../../toStoredSchema.js\";\nimport type { ObjectSchemaOptionsAlpha } from \"../../api/index.js\";\n\n/**\n * Generates the properties for an ObjectNode from its field schema object.\n * @remarks\n * Due to {@link https://github.com/microsoft/TypeScript/issues/43826}, we can't enable implicit construction of {@link TreeNode|TreeNodes} for setters.\n * Therefore code assigning to these fields must explicitly construct nodes using the schema's constructor or create method,\n * or using some other method like {@link (TreeAlpha:interface).create}.\n * @system @public\n */\nexport type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> =\n\tRestrictiveStringRecord<ImplicitFieldSchema> extends T\n\t\t? // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n\t\t\t{}\n\t\t: {\n\t\t\t\t-readonly [Property in keyof T]: Property extends string\n\t\t\t\t\t? TreeFieldFromImplicitField<T[Property]>\n\t\t\t\t\t: unknown;\n\t\t\t};\n\n/**\n * A {@link TreeNode} which models a JavaScript object.\n * @remarks\n * Object nodes consist of a type which specifies which {@link TreeNodeSchema} they use (see {@link TreeNodeApi.schema} and {@link SchemaFactory.object}),\n * and a collections of fields, each with a distinct `key` and its own {@link FieldSchema} defining what can be placed under that key.\n *\n * All fields on an object node are exposed as own properties with string keys.\n * Non-empty fields are enumerable and empty optional fields are non-enumerable own properties with the value `undefined`.\n * No other own `own` or `enumerable` properties are included on object nodes unless the user of the node manually adds custom session only state.\n * This allows a majority of general purpose JavaScript object processing operations (like `for...in`, `Reflect.ownKeys()` and `Object.entries()`) to enumerate all the children.\n *\n * Field Assignment and Deletion\n * Assigning to a field updates the tree value as long as it is still valid based on the schema.\n * - For required fields, assigning `undefined` is invalid, and will throw.\n * - For optional fields, assigning `undefined` removes the field's contents, and marks it as empty (non-enumerable and value set to undefined).\n *\n * Example:\n * ```ts\n * const Foo = schemaFactory.object(\"Foo\", {bar: schemaFactory.optional(schemaFactory.number)});\n * const node = new Foo({bar: 1})\n *\n * // This clears the field, is non-enumerable, and value is undefined.\n * delete node.bar;\n *\n * // This is equivalent to the delete example.\n * node.bar = undefined\n * ```\n *\n * The API for fields is defined by {@link ObjectFromSchemaRecord}.\n * @public\n */\nexport type TreeObjectNode<\n\tT extends RestrictiveStringRecord<ImplicitFieldSchema>,\n\tTypeName extends string = string,\n> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName, NodeKind.Object, T>;\n\n/**\n * Type utility for determining if an implicit field schema is known to have a default value.\n *\n * @remarks Yields `false` when unknown.\n *\n * @privateRemarks\n * TODO: Account for field schemas with default value providers.\n * For now, this only captures field kinds that we know always have defaults - optional fields and identifier fields.\n *\n * @system @public\n */\nexport type FieldHasDefault<T extends ImplicitFieldSchema> = [T] extends [\n\tFieldSchema<FieldKind.Optional | FieldKind.Identifier>,\n]\n\t? true\n\t: false;\n\n/**\n * Helper used to produce types for:\n *\n * 1. Insertable content which can be used to construct an object node.\n * In this case, only own properties are considered.\n * This reduces the risk of incorrectly interpreting data at the cost of occasionally requiring users to convert data into a compatible format.\n *\n * 2. Insertable content which is an unhydrated object node.\n *\n * 3. Union of 1 and 2.\n *\n * @see {@link Input}\n *\n * @privateRemarks\n * TODO: consider separating these cases into different types.\n *\n * Empty objects don't get \"no excess property\" checks in literals.\n * To prevent extraneous properties in literals for the fields of an empty object from compiling, the empty case is special cased to produce `Record<string, never>`.\n * More details at {@link https://mercury.com/blog/creating-an-emptyobject-type-in-typescript}.\n *\n * Additionally when T is exactly `RestrictiveStringRecord<ImplicitFieldSchema>` produce just `never` so that it is assignable to the insertable for any given object type.\n *\n * Separating `{}` from `RestrictiveStringRecord<ImplicitFieldSchema>` is a bit messy since both extend each-other despite them being very different types.\n * A third dummy type `{ arbitraryKey: \"arbitraryValue\" }` is used to resolve this.\n *\n * @system @public\n */\nexport type InsertableObjectFromSchemaRecord<\n\tT extends RestrictiveStringRecord<ImplicitFieldSchema>,\n> = RestrictiveStringRecord<ImplicitFieldSchema> extends T\n\t? { arbitraryKey: \"arbitraryValue\" } extends T\n\t\t? // {} case\n\t\t\tRecord<string, never>\n\t\t: // RestrictiveStringRecord<ImplicitFieldSchema> case\n\t\t\tnever\n\t: FlattenKeys<\n\t\t\t{\n\t\t\t\treadonly [Property in keyof T]?: InsertableTreeFieldFromImplicitField<\n\t\t\t\t\tT[Property & string]\n\t\t\t\t>;\n\t\t\t} & {\n\t\t\t\t// Field does not have a known default, make it required:\n\t\t\t\treadonly [Property in keyof T as FieldHasDefault<T[Property & string]> extends false\n\t\t\t\t\t? Property\n\t\t\t\t\t: never]: InsertableTreeFieldFromImplicitField<T[Property & string]>;\n\t\t\t}\n\t\t>;\n\n/**\n * Maps from simple field keys (\"property\" keys) to information about the field.\n *\n * @remarks\n * A missing entry for a given property key indicates that no such field exists.\n * Keys with symbols are currently never used, but allowed to make lookups on non-field things\n * (returning undefined) easier.\n */\nexport type SimpleKeyMap = ReadonlyMap<\n\tstring | symbol,\n\t{ storedKey: FieldKey; schema: FieldSchema }\n>;\n\n/**\n * Caches the mappings from property keys to stored keys for the provided object field schemas in {@link simpleKeyToFlexKeyCache}.\n */\nfunction createFlexKeyMapping(fields: Record<string, ImplicitFieldSchema>): SimpleKeyMap {\n\tconst keyMap: Map<string | symbol, { storedKey: FieldKey; schema: FieldSchema }> = new Map();\n\tfor (const [propertyKey, fieldSchema] of Object.entries(fields)) {\n\t\tconst schema = normalizeFieldSchema(fieldSchema);\n\t\tconst storedKey = getStoredKey(propertyKey, schema);\n\t\tkeyMap.set(propertyKey, { storedKey, schema });\n\t}\n\n\treturn keyMap;\n}\n\n/**\n * Creates a proxy handler for the given schema.\n *\n * @param allowAdditionalProperties - If true, setting of unexpected properties will be forwarded to the target object.\n * Otherwise setting of unexpected properties will error.\n * TODO: consider implementing this using `Object.preventExtension` instead.\n * @param customTargetObject - Target object of the proxy.\n * If not provided `{}` is used for the target.\n */\nfunction createProxyHandler(\n\tschema: ObjectNodeSchemaPrivate,\n\tallowAdditionalProperties: boolean,\n): ProxyHandler<TreeNode> {\n\t// To satisfy 'deepEquals' level scrutiny, the target of the proxy must be an object with the same\n\t// prototype as an object literal '{}'. This is because 'deepEquals' uses 'Object.getPrototypeOf'\n\t// as a way to quickly reject objects with different prototype chains.\n\t//\n\t// (Note that the prototype of an object literal appears as '[Object: null prototype] {}', not because\n\t// the prototype is null, but because the prototype object itself has a null prototype.)\n\n\t// TODO: Although the target is an object literal, it's still worthwhile to try experimenting with\n\t// a dispatch object to see if it improves performance.\n\tconst handler: ProxyHandler<TreeNode> = {\n\t\tget(target, propertyKey, proxy): unknown {\n\t\t\tconst fieldInfo = schema.flexKeyMap.get(propertyKey);\n\t\t\tif (fieldInfo !== undefined) {\n\t\t\t\tconst flexNode = getInnerNode(proxy);\n\t\t\t\tdebugAssert(() => !flexNode.context.isDisposed() || \"FlexTreeNode is disposed\");\n\t\t\t\tconst field = flexNode.tryGetField(fieldInfo.storedKey);\n\t\t\t\tif (field !== undefined) {\n\t\t\t\t\treturn tryGetTreeNodeForField(field);\n\t\t\t\t}\n\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// POJO mode objects don't have TreeNode's built in members on their targets, so special case them:\n\t\t\tif (propertyKey === typeSchemaSymbol) {\n\t\t\t\treturn schema;\n\t\t\t}\n\t\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\t\tif (propertyKey === typeNameSymbol) {\n\t\t\t\treturn schema.identifier;\n\t\t\t}\n\n\t\t\t// Pass the proxy as the receiver here, so that any methods on the prototype receive `proxy` as `this`.\n\t\t\treturn Reflect.get(target, propertyKey, proxy);\n\t\t},\n\t\tset(target, propertyKey, value: InsertableContent | undefined, proxy) {\n\t\t\tconst fieldInfo = schema.flexKeyMap.get(propertyKey);\n\t\t\tif (fieldInfo === undefined) {\n\t\t\t\t// Pass the proxy as the receiver here, so that setters on the prototype receive `proxy` as `this`.\n\t\t\t\treturn allowAdditionalProperties\n\t\t\t\t\t? Reflect.set(target, propertyKey, value, proxy)\n\t\t\t\t\t: false;\n\t\t\t}\n\n\t\t\tapplyFieldChange(schema, { kind: \"proxy\", node: proxy }, fieldInfo, value);\n\t\t\treturn true;\n\t\t},\n\t\tdeleteProperty(target, propertyKey): boolean {\n\t\t\tconst fieldInfo = schema.flexKeyMap.get(propertyKey);\n\t\t\tif (fieldInfo === undefined) {\n\t\t\t\treturn allowAdditionalProperties ? Reflect.deleteProperty(target, propertyKey) : false;\n\t\t\t}\n\n\t\t\tapplyFieldChange(schema, { kind: \"target\", node: target }, fieldInfo, undefined);\n\t\t\treturn true;\n\t\t},\n\t\thas: (target, propertyKey) => {\n\t\t\treturn (\n\t\t\t\tschema.flexKeyMap.has(propertyKey) ||\n\t\t\t\t(allowAdditionalProperties ? Reflect.has(target, propertyKey) : false)\n\t\t\t);\n\t\t},\n\t\townKeys: (target) => {\n\t\t\treturn [\n\t\t\t\t...schema.flexKeyMap.keys(),\n\t\t\t\t...(allowAdditionalProperties ? Reflect.ownKeys(target) : []),\n\t\t\t];\n\t\t},\n\t\tgetOwnPropertyDescriptor: (target, propertyKey) => {\n\t\t\tconst fieldInfo = schema.flexKeyMap.get(propertyKey);\n\n\t\t\tif (fieldInfo === undefined) {\n\t\t\t\treturn allowAdditionalProperties\n\t\t\t\t\t? Reflect.getOwnPropertyDescriptor(target, propertyKey)\n\t\t\t\t\t: undefined;\n\t\t\t}\n\n\t\t\t// For some reason, the getOwnPropertyDescriptor is not passed in the receiver, so use a weak map.\n\t\t\t// If a refactoring is done to associated flex tree data with the target not the proxy, this extra map could be removed,\n\t\t\t// and the design would be more compatible with proxyless nodes.\n\t\t\tconst proxy = targetToProxy.get(target) ?? fail(0xadd /* missing proxy */);\n\t\t\tconst field = getInnerNode(proxy).tryGetField(fieldInfo.storedKey);\n\n\t\t\tconst p: PropertyDescriptor = {\n\t\t\t\tvalue: field === undefined ? undefined : tryGetTreeNodeForField(field),\n\t\t\t\twritable: true,\n\t\t\t\t// Report empty fields as own properties so they shadow inherited properties (even when empty) to match TypeScript typing.\n\t\t\t\t// Make empty fields not enumerable so they get skipped when iterating over an object to better align with\n\t\t\t\t// JSON and deep equals with JSON compatible object (which can't have undefined fields).\n\t\t\t\tenumerable: field !== undefined,\n\t\t\t\tconfigurable: true, // Must be 'configurable' if property is absent from proxy target.\n\t\t\t};\n\n\t\t\treturn p;\n\t\t},\n\t};\n\treturn handler;\n}\n\nexport function setField(\n\tfield: FlexTreeField,\n\tsimpleFieldSchema: FieldSchema,\n\tvalue: InsertableContent | undefined,\n\tdestinationSchema: TreeFieldStoredSchema,\n): void {\n\tconst mapTree = prepareForInsertion(\n\t\tvalue,\n\t\tsimpleFieldSchema,\n\t\tfield.context,\n\t\tdestinationSchema,\n\t);\n\n\tswitch (field.schema) {\n\t\tcase FieldKinds.required.identifier: {\n\t\t\tassert(mapTree !== undefined, 0xa04 /* Cannot set a required field to undefined */);\n\t\t\tconst typedField = field as FlexTreeRequiredField;\n\t\t\ttypedField.editor.set(mapTree);\n\t\t\tbreak;\n\t\t}\n\t\tcase FieldKinds.optional.identifier: {\n\t\t\tconst typedField = field as FlexTreeOptionalField;\n\t\t\ttypedField.editor.set(mapTree, typedField.length === 0);\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault:\n\t\t\tfail(0xade /* invalid FieldKind */);\n\t}\n}\n\n/**\n * {@link FieldSchemaAlpha} including {@link SimpleObjectFieldSchema}.\n */\nexport class ObjectFieldSchema<\n\t\tKind extends FieldKind,\n\t\tTypes extends ImplicitAllowedTypes,\n\t\tTCustomMetadata = unknown,\n\t>\n\textends FieldSchemaAlpha<Kind, Types, TCustomMetadata>\n\timplements SimpleObjectFieldSchema\n{\n\tpublic readonly storedKey: string;\n\n\tpublic constructor(\n\t\tkind: Kind,\n\t\tallowedTypes: Types,\n\t\tprops: FieldProps<TCustomMetadata> & { readonly key: string },\n\t) {\n\t\tsuper(kind, allowedTypes, props);\n\t\tthis.storedKey = props.key;\n\t}\n}\n\nabstract class CustomObjectNodeBase<\n\tconst T extends RestrictiveStringRecord<ImplicitFieldSchema>,\n> extends TreeNodeValid<InsertableObjectFromSchemaRecord<T>> {\n\tpublic static readonly kind = NodeKind.Object;\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link TreeObjectNode}.\n *\n * @param name - Unique identifier for this schema within this factory's scope.\n * @param fields - Schema for fields of the object node's schema. Defines what children can be placed under each key.\n * @param persistedMetadata - Optional persisted metadata for the object node schema.\n */\nexport function objectSchema<\n\tTName extends string,\n\tconst T extends RestrictiveStringRecord<ImplicitFieldSchema>,\n\tconst ImplicitlyConstructable extends boolean,\n\tconst TCustomMetadata = unknown,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tnodeOptions: ObjectSchemaOptionsAlpha<TCustomMetadata>,\n): ObjectNodeSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> &\n\tObjectNodeSchemaInternalData &\n\tTreeNodeSchemaCorePrivate {\n\t// Field set can't be modified after this since derived data is stored in maps.\n\tObject.freeze(info);\n\n\t// Ensure no collisions between final set of property keys, and final set of stored keys (including those\n\t// implicitly derived from property keys)\n\tassertUniqueKeys(identifier, info);\n\n\t// Performance optimization: cache property key => stored key and schema.\n\tconst flexKeyMap: SimpleKeyMap = createFlexKeyMapping(info);\n\n\tconst identifierFieldKeys: FieldKey[] = [];\n\tfor (const item of flexKeyMap.values()) {\n\t\tif (item.schema.kind === FieldKind.Identifier) {\n\t\t\tidentifierFieldKeys.push(item.storedKey);\n\t\t}\n\t}\n\n\tconst lazyChildTypes = new Lazy(\n\t\t() => new Set(Array.from(flexKeyMap.values(), (f) => [...f.schema.allowedTypeSet]).flat()),\n\t);\n\n\tlet privateData: TreeNodeSchemaPrivateData | undefined;\n\n\tlet handler: ProxyHandler<object>;\n\tlet customizable: boolean;\n\n\tclass CustomObjectNode extends CustomObjectNodeBase<T> {\n\t\tpublic static readonly fields: ReadonlyMap<\n\t\t\tstring,\n\t\t\tFieldSchemaAlpha & SimpleObjectFieldSchema\n\t\t> = new Map(\n\t\t\tArray.from(flexKeyMap, ([key, value]) => [\n\t\t\t\tkey as string,\n\t\t\t\tnew ObjectFieldSchema(value.schema.kind, value.schema.allowedTypes, {\n\t\t\t\t\t...value.schema.props,\n\t\t\t\t\tkey: getStoredKey(key as string, value.schema),\n\t\t\t\t}),\n\t\t\t]),\n\t\t);\n\t\tpublic static readonly flexKeyMap: SimpleKeyMap = flexKeyMap;\n\t\tpublic static readonly storedKeyToPropertyKey: ReadonlyMap<FieldKey, string> = new Map<\n\t\t\tFieldKey,\n\t\t\tstring\n\t\t>(\n\t\t\tArray.from(flexKeyMap, ([key, value]): [FieldKey, string] => [\n\t\t\t\tvalue.storedKey,\n\t\t\t\tkey as string,\n\t\t\t]),\n\t\t);\n\t\tpublic static readonly identifierFieldKeys: readonly FieldKey[] = identifierFieldKeys;\n\t\tpublic static readonly allowUnknownOptionalFields: boolean =\n\t\t\tnodeOptions.allowUnknownOptionalFields ?? false;\n\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\t// Differentiate between the following cases:\n\t\t\t//\n\t\t\t// Case 1: Direct construction (POJO emulation)\n\t\t\t//\n\t\t\t// const Foo = schemaFactory.object(\"Foo\", {bar: schemaFactory.number});\n\t\t\t//\n\t\t\t// assert.deepEqual(new Foo({ bar: 42 }), { bar: 42 },\n\t\t\t//\t\t \"Prototype chain equivalent to POJO.\");\n\t\t\t//\n\t\t\t// Case 2: Subclass construction (Customizable Object)\n\t\t\t//\n\t\t\t// \t class Foo extends schemaFactory.object(\"Foo\", {bar: schemaFactory.number}) {}\n\t\t\t//\n\t\t\t// \t assert.notDeepEqual(new Foo({ bar: 42 }), { bar: 42 },\n\t\t\t// \t \"Subclass prototype chain differs from POJO.\");\n\t\t\t//\n\t\t\t// In Case 1 (POJO emulation), the prototype chain match '{}' (proxyTarget = undefined)\n\t\t\t// In Case 2 (Customizable Object), the prototype chain include the user's subclass (proxyTarget = this)\n\n\t\t\tconst proxyTarget = customizable ? instance : {};\n\t\t\tconst proxy = new Proxy(proxyTarget, handler) as CustomObjectNode;\n\t\t\ttargetToProxy.set(proxyTarget, proxy);\n\t\t\treturn proxy;\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 object, this as Output);\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup(): TreeNodeSchemaInitializedData {\n\t\t\t// One time initialization that required knowing the most derived type (from this.constructor) and thus has to be lazy.\n\t\t\tcustomizable = (this as unknown) !== CustomObjectNode;\n\t\t\tconst schema = this as unknown as ObjectNodeSchemaPrivate;\n\t\t\thandler = createProxyHandler(schema, customizable);\n\n\t\t\t// First run, do extra validation.\n\t\t\t// TODO: provide a way for TreeConfiguration to trigger this same validation to ensure it gets run early.\n\t\t\t// Scan for shadowing inherited members which won't work, but stop scan early to allow shadowing built in (which seems to work ok).\n\t\t\t{\n\t\t\t\tlet prototype: object = this.prototype;\n\t\t\t\t// There isn't a clear cleaner way to author this loop.\n\t\t\t\twhile (prototype !== CustomObjectNode.prototype) {\n\t\t\t\t\tfor (const [key] of flexKeyMap) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t// constructor is a special case, since one is built in on the derived type, and shadowing it works fine since we only use it before fields are applied.\n\t\t\t\t\t\t\tkey !== \"constructor\" &&\n\t\t\t\t\t\t\tReflect.getOwnPropertyDescriptor(prototype, key) !== undefined\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t`Schema ${identifier} defines an inherited property \"${key.toString()}\" which shadows a field. Since fields are exposed as own properties, this shadowing will not work, and is an error.`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Since this stops at CustomObjectNode, it should never see a null prototype, so this case is safe.\n\t\t\t\t\t// Additionally, if the prototype chain is ever messed up such that CustomObjectNode is not in it,\n\t\t\t\t\t// the null that would show up here does at least ensure this code throws instead of hanging.\n\t\t\t\t\tprototype = Reflect.getPrototypeOf(prototype) as object;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn getTreeNodeSchemaInitializedData(schema, {\n\t\t\t\tshallowCompatibilityTest: (data: FactoryContent): CompatibilityLevel =>\n\t\t\t\t\tshallowCompatibilityTest(data, schema),\n\t\t\t\ttoFlexContent: (\n\t\t\t\t\tdata: FactoryContent,\n\t\t\t\t\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n\t\t\t\t): FlexContent => objectToFlexContent(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 lazyChildTypes.value;\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\tnodeOptions.persistedMetadata;\n\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tpublic get [typeNameSymbol](): TName {\n\t\t\treturn identifier;\n\t\t}\n\t\tpublic get [typeSchemaSymbol](): Output {\n\t\t\treturn CustomObjectNode.constructorCached?.constructor as unknown as Output;\n\t\t}\n\n\t\tpublic static get [privateDataSymbol](): TreeNodeSchemaPrivateData {\n\t\t\treturn (privateData ??= createTreeNodeSchemaPrivateData(\n\t\t\t\tthis,\n\t\t\t\tArray.from(CustomObjectNode.fields.values(), (schema) => schema.allowedTypesFull),\n\t\t\t));\n\t\t}\n\t}\n\ttype Output = typeof CustomObjectNode &\n\t\t(new (\n\t\t\tinput: InsertableObjectFromSchemaRecord<T> | InternalTreeNode,\n\t\t) => TreeObjectNode<T, TName>);\n\treturn CustomObjectNode as Output;\n}\n\nconst targetToProxy: WeakMap<object, TreeNode> = new WeakMap();\n\n/**\n * Ensures that the set of property keys in the schema is unique.\n * Also ensure that the final set of stored keys (including those implicitly derived from property keys) is unique.\n * @throws Throws a `UsageError` if either of the key uniqueness invariants is violated.\n */\nfunction assertUniqueKeys<\n\tconst Name extends number | string,\n\tconst Fields extends RestrictiveStringRecord<ImplicitFieldSchema>,\n>(schemaName: Name, fields: Fields): void {\n\t// Verify that there are no duplicates among the explicitly specified stored keys.\n\tconst explicitStoredKeys = new Set<string>();\n\tfor (const schema of Object.values(fields)) {\n\t\tconst storedKey = getExplicitStoredKey(schema);\n\t\tif (storedKey === undefined) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (explicitStoredKeys.has(storedKey)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Duplicate stored key \"${storedKey}\" in schema \"${schemaName}\". Stored keys must be unique within an object schema.`,\n\t\t\t);\n\t\t}\n\t\texplicitStoredKeys.add(storedKey);\n\t}\n\n\t// Verify that there are no duplicates among the derived\n\t// (including those implicitly derived from property keys) stored keys.\n\tconst derivedStoredKeys = new Set<string>();\n\tfor (const [propertyKey, schema] of Object.entries(fields)) {\n\t\tconst storedKey = getStoredKey(propertyKey, schema);\n\t\tif (derivedStoredKeys.has(storedKey)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Stored key \"${storedKey}\" in schema \"${schemaName}\" conflicts with a property key of the same name, which is not overridden by a stored key. The final set of stored keys in an object schema must be unique.`,\n\t\t\t);\n\t\t}\n\t\tderivedStoredKeys.add(storedKey);\n\t}\n}\n\n/**\n * {@link TreeNodeSchemaInitializedData.toFlexContent} for object nodes.\n *\n * @param data - The tree data to be transformed. Must be a Record-like object.\n * @param schema - The schema to comply with.\n */\nfunction objectToFlexContent(\n\tdata: FactoryContent,\n\tschema: TreeNodeSchema & ObjectNodeSchemaInternalData,\n): FlexContent {\n\tif (\n\t\ttypeof data !== \"object\" ||\n\t\tdata === null ||\n\t\tSymbol.iterator in data ||\n\t\tisFluidHandle(data)\n\t) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\tthrow new UsageError(`Input data is incompatible with Object schema: ${data}`);\n\t}\n\n\tconst fields = new Map<FieldKey, UnhydratedFlexTreeField>();\n\tconst context = getUnhydratedContext(schema).flexContext;\n\n\tfor (const [key, fieldInfo] of schema.flexKeyMap) {\n\t\tconst value = getFieldProperty(data, key);\n\n\t\tlet children: UnhydratedFlexTreeNode[] | ContextualFieldProvider;\n\t\tif (value === undefined) {\n\t\t\tconst defaultProvider =\n\t\t\t\tfieldInfo.schema.props?.defaultProvider ??\n\t\t\t\tfail(0xbb1 /* missing field has no default provider */);\n\t\t\tconst fieldProvider = extractFieldProvider(defaultProvider);\n\t\t\tchildren = isConstant(fieldProvider) ? fieldProvider() : fieldProvider;\n\t\t} else {\n\t\t\tchildren = [\n\t\t\t\tunhydratedFlexTreeFromInsertableNode(value, fieldInfo.schema.allowedTypeSet),\n\t\t\t];\n\t\t}\n\n\t\tconst kind =\n\t\t\tconvertFieldKind.get(fieldInfo.schema.kind) ?? fail(0xbb2 /* Invalid field kind */);\n\t\tfields.set(\n\t\t\tfieldInfo.storedKey,\n\t\t\tcreateField(context, kind.identifier, fieldInfo.storedKey, children),\n\t\t);\n\t}\n\n\treturn [{ type: brand(schema.identifier) }, fields];\n}\n\n/**\n * {@link TreeNodeSchemaInitializedData.shallowCompatibilityTest} for Object nodes.\n */\nfunction shallowCompatibilityTest(\n\tdata: FactoryContent,\n\tschema: ObjectNodeSchema & ObjectNodeSchemaInternalData,\n): CompatibilityLevel {\n\tif (isTreeValue(data)) {\n\t\treturn CompatibilityLevel.None;\n\t}\n\n\tif (Symbol.iterator in data) {\n\t\treturn CompatibilityLevel.None;\n\t}\n\n\t// TODO: Improve type inference by making this logic more thorough. Handle at least:\n\t// * Types which are strict subsets of other types in the same polymorphic union\n\t// * Types which have the same keys but different types for those keys in the polymorphic union\n\t// * Types which have the same required fields but different optional fields and enough of those optional fields are populated to disambiguate\n\n\t// TODO#7441: Consider allowing data to be inserted which has keys that are extraneous/unknown to the schema (those keys are ignored)\n\n\t// If the schema has a required key which is not present in the input object, reject it.\n\tfor (const [fieldKey, fieldSchema] of schema.fields) {\n\t\tif (fieldSchema.requiresValue) {\n\t\t\tif (getFieldProperty(data, fieldKey) === undefined) {\n\t\t\t\treturn CompatibilityLevel.None;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn CompatibilityLevel.Normal;\n}\n\n/**\n * Check {@link FactoryContentObject} for a property which could be store a field.\n *\n * @returns If the property exists, return its value. Otherwise, returns undefined.\n * @remarks\n * The currently policy is to only consider own properties.\n * See {@link InsertableObjectFromSchemaRecord} for where this policy is documented in the public API.\n *\n * Explicit undefined values are treated the same as missing properties to allow explicit use of undefined with defaulted identifiers.\n *\n * @privateRemarks\n * If we ever want to have an optional field which defaults to something other than undefined, this will need changes.\n * It would need to adjusting the handling of explicit undefined in contexts where undefined is allowed, and a default provider also exists.\n */\nfunction getFieldProperty(\n\tdata: FactoryContentObject,\n\tkey: string | symbol,\n): InsertableContent | undefined {\n\t// This policy only allows own properties.\n\tif (Object.hasOwnProperty.call(data, key)) {\n\t\treturn (data as Record<string, InsertableContent>)[key as string];\n\t}\n\treturn undefined;\n}\n\nfunction applyFieldChange(\n\tschema: ObjectNodeSchemaPrivate,\n\tfrom: { kind: \"proxy\"; node: TreeNode } | { kind: \"target\"; node: object },\n\tfieldInfo: { storedKey: FieldKey; schema: FieldSchema },\n\tvalue: InsertableContent | undefined,\n): void {\n\tconst proxy =\n\t\tfrom.kind === \"proxy\"\n\t\t\t? from.node\n\t\t\t: (targetToProxy.get(from.node) ?? fail(0xc95 /* missing proxy */));\n\tconst inner = getInnerNode(proxy);\n\tconst storedSchema = inner.context.schema.nodeSchema.get(brand(schema.identifier));\n\tassert(\n\t\tstoredSchema instanceof ObjectNodeStoredSchema,\n\t\t0xc96 /* Expected ObjectNodeStoredSchema */,\n\t);\n\n\tif (value === undefined && inner.tryGetField(fieldInfo.storedKey) === undefined) {\n\t\treturn;\n\t}\n\n\tsetField(\n\t\tinner.getBoxed(fieldInfo.storedKey),\n\t\tfieldInfo.schema,\n\t\tvalue,\n\t\tstoredSchema.getFieldSchema(fieldInfo.storedKey),\n\t);\n}\n"]}
1
+ {"version":3,"file":"objectNode.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/object/objectNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAEvE,OAAO,EACN,sBAAsB,GAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,UAAU,EACV,WAAW,GAKX,MAAM,qCAAqC,CAAC;AAM7C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,OAAO,EACN,kBAAkB,EAElB,QAAQ;AAER,kDAAkD;AAClD,cAAc,EACd,gBAAgB,EAIhB,YAAY,EAGZ,aAAa,EAGb,iBAAiB,EACjB,+BAA+B,EAG/B,WAAW,GAGX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,gCAAgC,EAChC,oBAAoB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAMtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAEN,YAAY,EACZ,oBAAoB,EAIpB,gBAAgB,EAChB,oBAAoB,EACpB,SAAS,EAGT,oBAAoB,EACpB,UAAU,GACV,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,gCAAgC,EAChC,0BAA0B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AC,SAAS,CAAC,SAAS,CAAC,EACnC,SAAS,CAAC,MAAM,EAChB,KAAK,EACL,YAAY,CAAC,cAAc,CAAC,SAAS,CAAC,SAAS,CAAC,CAChD,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, Lazy, fail, debugAssert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\tObjectNodeStoredSchema,\n\ttype FieldKey,\n\ttype TreeFieldStoredSchema,\n} from \"../../../core/index.js\";\nimport {\n\tFieldKinds,\n\tisTreeValue,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n} from \"../../../feature-libraries/index.js\";\nimport type {\n\tRestrictiveStringRecord,\n\tFlattenKeys,\n\tJsonCompatibleReadOnlyObject,\n} from \"../../../util/index.js\";\nimport { brand } from \"../../../util/index.js\";\n\nimport {\n\tCompatibilityLevel,\n\ttype TreeNodeSchema,\n\tNodeKind,\n\ttype WithType,\n\t// eslint-disable-next-line import-x/no-deprecated\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\ttype InternalTreeNode,\n\ttype TreeNode,\n\ttype UnhydratedFlexTreeNode,\n\tgetInnerNode,\n\ttype NodeSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\tTreeNodeValid,\n\ttype MostDerivedData,\n\ttype TreeNodeSchemaInitializedData,\n\tprivateDataSymbol,\n\tcreateTreeNodeSchemaPrivateData,\n\ttype FlexContent,\n\ttype UnhydratedFlexTreeField,\n\tcreateField,\n\ttype TreeNodeSchemaCorePrivate,\n\ttype TreeNodeSchemaPrivateData,\n} from \"../../core/index.js\";\nimport {\n\tgetTreeNodeSchemaInitializedData,\n\tgetUnhydratedContext,\n} from \"../../createContext.js\";\nimport { tryGetTreeNodeForField } from \"../../getTreeNodeForField.js\";\nimport type {\n\tObjectNodeSchema,\n\tObjectNodeSchemaInternalData,\n\tObjectNodeSchemaPrivate,\n} from \"./objectNodeTypes.js\";\nimport { prepareForInsertion } from \"../../prepareForInsertion.js\";\nimport {\n\ttype ImplicitFieldSchema,\n\tgetStoredKey,\n\tgetExplicitStoredKey,\n\ttype TreeFieldFromImplicitField,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype FieldSchema,\n\tFieldSchemaAlpha,\n\tnormalizeFieldSchema,\n\tFieldKind,\n\ttype FieldProps,\n\ttype ContextualFieldProvider,\n\textractFieldProvider,\n\tisConstant,\n} from \"../../fieldSchema.js\";\nimport type { SimpleObjectFieldSchema } from \"../../simpleSchema.js\";\nimport {\n\tunhydratedFlexTreeFromInsertable,\n\tflexTreeFromInsertableNode,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n\ttype InsertableContent,\n} from \"../../unhydratedFlexTreeFromInsertable.js\";\nimport { convertFieldKind } from \"../../toStoredSchema.js\";\nimport type { ObjectSchemaOptionsAlpha } from \"../../api/index.js\";\n\n/**\n * Generates the properties for an ObjectNode from its field schema object.\n * @remarks\n * Due to {@link https://github.com/microsoft/TypeScript/issues/43826}, we can't enable implicit construction of {@link TreeNode|TreeNodes} for setters.\n * Therefore code assigning to these fields must explicitly construct nodes using the schema's constructor or create method,\n * or using some other method like {@link (TreeAlpha:interface).create}.\n * @system @public\n */\nexport type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> =\n\tRestrictiveStringRecord<ImplicitFieldSchema> extends T\n\t\t? // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n\t\t\t{}\n\t\t: {\n\t\t\t\t-readonly [Property in keyof T]: Property extends string\n\t\t\t\t\t? TreeFieldFromImplicitField<T[Property]>\n\t\t\t\t\t: unknown;\n\t\t\t};\n\n/**\n * A {@link TreeNode} which models a JavaScript object.\n * @remarks\n * Object nodes consist of a type which specifies which {@link TreeNodeSchema} they use (see {@link TreeNodeApi.schema} and {@link SchemaFactory.object}),\n * and a collections of fields, each with a distinct `key` and its own {@link FieldSchema} defining what can be placed under that key.\n *\n * All fields on an object node are exposed as own properties with string keys.\n * Non-empty fields are enumerable and empty optional fields are non-enumerable own properties with the value `undefined`.\n * No other own `own` or `enumerable` properties are included on object nodes unless the user of the node manually adds custom session only state.\n * This allows a majority of general purpose JavaScript object processing operations (like `for...in`, `Reflect.ownKeys()` and `Object.entries()`) to enumerate all the children.\n *\n * Field Assignment and Deletion\n * Assigning to a field updates the tree value as long as it is still valid based on the schema.\n * - For required fields, assigning `undefined` is invalid, and will throw.\n * - For optional fields, assigning `undefined` removes the field's contents, and marks it as empty (non-enumerable and value set to undefined).\n *\n * Example:\n * ```ts\n * const Foo = schemaFactory.object(\"Foo\", {bar: schemaFactory.optional(schemaFactory.number)});\n * const node = new Foo({bar: 1})\n *\n * // This clears the field, is non-enumerable, and value is undefined.\n * delete node.bar;\n *\n * // This is equivalent to the delete example.\n * node.bar = undefined\n * ```\n *\n * The API for fields is defined by {@link ObjectFromSchemaRecord}.\n * @public\n */\nexport type TreeObjectNode<\n\tT extends RestrictiveStringRecord<ImplicitFieldSchema>,\n\tTypeName extends string = string,\n> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName, NodeKind.Object, T>;\n\n/**\n * Type utility for determining if an implicit field schema is known to have a default value.\n *\n * @remarks Yields `false` when unknown.\n *\n * @privateRemarks\n * TODO: Account for field schemas with default value providers.\n * For now, this only captures field kinds that we know always have defaults - optional fields and identifier fields.\n *\n * @system @public\n */\nexport type FieldHasDefault<T extends ImplicitFieldSchema> = [T] extends [\n\tFieldSchema<FieldKind.Optional | FieldKind.Identifier>,\n]\n\t? true\n\t: false;\n\n/**\n * Helper used to produce types for:\n *\n * 1. Insertable content which can be used to construct an object node.\n * In this case, only own properties are considered.\n * This reduces the risk of incorrectly interpreting data at the cost of occasionally requiring users to convert data into a compatible format.\n *\n * 2. Insertable content which is an unhydrated object node.\n *\n * 3. Union of 1 and 2.\n *\n * @see {@link Input}\n *\n * @privateRemarks\n * TODO: consider separating these cases into different types.\n *\n * Empty objects don't get \"no excess property\" checks in literals.\n * To prevent extraneous properties in literals for the fields of an empty object from compiling, the empty case is special cased to produce `Record<string, never>`.\n * More details at {@link https://mercury.com/blog/creating-an-emptyobject-type-in-typescript}.\n *\n * Additionally when T is exactly `RestrictiveStringRecord<ImplicitFieldSchema>` produce just `never` so that it is assignable to the insertable for any given object type.\n *\n * Separating `{}` from `RestrictiveStringRecord<ImplicitFieldSchema>` is a bit messy since both extend each-other despite them being very different types.\n * A third dummy type `{ arbitraryKey: \"arbitraryValue\" }` is used to resolve this.\n *\n * @system @public\n */\nexport type InsertableObjectFromSchemaRecord<\n\tT extends RestrictiveStringRecord<ImplicitFieldSchema>,\n> = RestrictiveStringRecord<ImplicitFieldSchema> extends T\n\t? { arbitraryKey: \"arbitraryValue\" } extends T\n\t\t? // {} case\n\t\t\tRecord<string, never>\n\t\t: // RestrictiveStringRecord<ImplicitFieldSchema> case\n\t\t\tnever\n\t: FlattenKeys<\n\t\t\t{\n\t\t\t\treadonly [Property in keyof T]?: InsertableTreeFieldFromImplicitField<\n\t\t\t\t\tT[Property & string]\n\t\t\t\t>;\n\t\t\t} & {\n\t\t\t\t// Field does not have a known default, make it required:\n\t\t\t\treadonly [Property in keyof T as FieldHasDefault<T[Property & string]> extends false\n\t\t\t\t\t? Property\n\t\t\t\t\t: never]: InsertableTreeFieldFromImplicitField<T[Property & string]>;\n\t\t\t}\n\t\t>;\n\n/**\n * Maps from simple field keys (\"property\" keys) to information about the field.\n *\n * @remarks\n * A missing entry for a given property key indicates that no such field exists.\n * Keys with symbols are currently never used, but allowed to make lookups on non-field things\n * (returning undefined) easier.\n */\nexport type SimpleKeyMap = ReadonlyMap<\n\tstring | symbol,\n\t{ storedKey: FieldKey; schema: FieldSchema }\n>;\n\n/**\n * Caches the mappings from property keys to stored keys for the provided object field schemas in {@link simpleKeyToFlexKeyCache}.\n */\nfunction createFlexKeyMapping(fields: Record<string, ImplicitFieldSchema>): SimpleKeyMap {\n\tconst keyMap: Map<string | symbol, { storedKey: FieldKey; schema: FieldSchema }> = new Map();\n\tfor (const [propertyKey, fieldSchema] of Object.entries(fields)) {\n\t\tconst schema = normalizeFieldSchema(fieldSchema);\n\t\tconst storedKey = getStoredKey(propertyKey, schema);\n\t\tkeyMap.set(propertyKey, { storedKey, schema });\n\t}\n\n\treturn keyMap;\n}\n\n/**\n * Creates a proxy handler for the given schema.\n *\n * @param allowAdditionalProperties - If true, setting of unexpected properties will be forwarded to the target object.\n * Otherwise setting of unexpected properties will error.\n * TODO: consider implementing this using `Object.preventExtension` instead.\n * @param customTargetObject - Target object of the proxy.\n * If not provided `{}` is used for the target.\n */\nfunction createProxyHandler(\n\tschema: ObjectNodeSchemaPrivate,\n\tallowAdditionalProperties: boolean,\n): ProxyHandler<TreeNode> {\n\t// To satisfy 'deepEquals' level scrutiny, the target of the proxy must be an object with the same\n\t// prototype as an object literal '{}'. This is because 'deepEquals' uses 'Object.getPrototypeOf'\n\t// as a way to quickly reject objects with different prototype chains.\n\t//\n\t// (Note that the prototype of an object literal appears as '[Object: null prototype] {}', not because\n\t// the prototype is null, but because the prototype object itself has a null prototype.)\n\n\t// TODO: Although the target is an object literal, it's still worthwhile to try experimenting with\n\t// a dispatch object to see if it improves performance.\n\tconst handler: ProxyHandler<TreeNode> = {\n\t\tget(target, propertyKey, proxy): unknown {\n\t\t\tconst fieldInfo = schema.flexKeyMap.get(propertyKey);\n\t\t\tif (fieldInfo !== undefined) {\n\t\t\t\tconst flexNode = getInnerNode(proxy);\n\t\t\t\tdebugAssert(() => !flexNode.context.isDisposed() || \"FlexTreeNode is disposed\");\n\t\t\t\tconst field = flexNode.tryGetField(fieldInfo.storedKey);\n\t\t\t\tif (field !== undefined) {\n\t\t\t\t\treturn tryGetTreeNodeForField(field);\n\t\t\t\t}\n\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// POJO mode objects don't have TreeNode's built in members on their targets, so special case them:\n\t\t\tif (propertyKey === typeSchemaSymbol) {\n\t\t\t\treturn schema;\n\t\t\t}\n\t\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\t\tif (propertyKey === typeNameSymbol) {\n\t\t\t\treturn schema.identifier;\n\t\t\t}\n\n\t\t\t// Pass the proxy as the receiver here, so that any methods on the prototype receive `proxy` as `this`.\n\t\t\treturn Reflect.get(target, propertyKey, proxy);\n\t\t},\n\t\tset(target, propertyKey, value: InsertableContent | undefined, proxy) {\n\t\t\tconst fieldInfo = schema.flexKeyMap.get(propertyKey);\n\t\t\tif (fieldInfo === undefined) {\n\t\t\t\t// Pass the proxy as the receiver here, so that setters on the prototype receive `proxy` as `this`.\n\t\t\t\treturn allowAdditionalProperties\n\t\t\t\t\t? Reflect.set(target, propertyKey, value, proxy)\n\t\t\t\t\t: false;\n\t\t\t}\n\n\t\t\tapplyFieldChange(schema, { kind: \"proxy\", node: proxy }, fieldInfo, value);\n\t\t\treturn true;\n\t\t},\n\t\tdeleteProperty(target, propertyKey): boolean {\n\t\t\tconst fieldInfo = schema.flexKeyMap.get(propertyKey);\n\t\t\tif (fieldInfo === undefined) {\n\t\t\t\treturn allowAdditionalProperties ? Reflect.deleteProperty(target, propertyKey) : false;\n\t\t\t}\n\n\t\t\tapplyFieldChange(schema, { kind: \"target\", node: target }, fieldInfo, undefined);\n\t\t\treturn true;\n\t\t},\n\t\thas: (target, propertyKey) => {\n\t\t\treturn (\n\t\t\t\tschema.flexKeyMap.has(propertyKey) ||\n\t\t\t\t(allowAdditionalProperties ? Reflect.has(target, propertyKey) : false)\n\t\t\t);\n\t\t},\n\t\townKeys: (target) => {\n\t\t\treturn [\n\t\t\t\t...schema.flexKeyMap.keys(),\n\t\t\t\t...(allowAdditionalProperties ? Reflect.ownKeys(target) : []),\n\t\t\t];\n\t\t},\n\t\tgetOwnPropertyDescriptor: (target, propertyKey) => {\n\t\t\tconst fieldInfo = schema.flexKeyMap.get(propertyKey);\n\n\t\t\tif (fieldInfo === undefined) {\n\t\t\t\treturn allowAdditionalProperties\n\t\t\t\t\t? Reflect.getOwnPropertyDescriptor(target, propertyKey)\n\t\t\t\t\t: undefined;\n\t\t\t}\n\n\t\t\t// For some reason, the getOwnPropertyDescriptor is not passed in the receiver, so use a weak map.\n\t\t\t// If a refactoring is done to associated flex tree data with the target not the proxy, this extra map could be removed,\n\t\t\t// and the design would be more compatible with proxyless nodes.\n\t\t\tconst proxy = targetToProxy.get(target) ?? fail(0xadd /* missing proxy */);\n\t\t\tconst field = getInnerNode(proxy).tryGetField(fieldInfo.storedKey);\n\n\t\t\tconst p: PropertyDescriptor = {\n\t\t\t\tvalue: field === undefined ? undefined : tryGetTreeNodeForField(field),\n\t\t\t\twritable: true,\n\t\t\t\t// Report empty fields as own properties so they shadow inherited properties (even when empty) to match TypeScript typing.\n\t\t\t\t// Make empty fields not enumerable so they get skipped when iterating over an object to better align with\n\t\t\t\t// JSON and deep equals with JSON compatible object (which can't have undefined fields).\n\t\t\t\tenumerable: field !== undefined,\n\t\t\t\tconfigurable: true, // Must be 'configurable' if property is absent from proxy target.\n\t\t\t};\n\n\t\t\treturn p;\n\t\t},\n\t};\n\treturn handler;\n}\n\nexport function setField(\n\tfield: FlexTreeField,\n\tsimpleFieldSchema: FieldSchema,\n\tvalue: InsertableContent | undefined,\n\tdestinationSchema: TreeFieldStoredSchema,\n): void {\n\tfield.context.runInTransaction(() => {\n\t\tconst mapTree = prepareForInsertion(\n\t\t\tvalue,\n\t\t\tsimpleFieldSchema,\n\t\t\tfield.context,\n\t\t\tdestinationSchema,\n\t\t);\n\n\t\tswitch (field.schema) {\n\t\t\tcase FieldKinds.required.identifier: {\n\t\t\t\tassert(mapTree !== undefined, 0xa04 /* Cannot set a required field to undefined */);\n\t\t\t\tconst typedField = field as FlexTreeRequiredField;\n\t\t\t\ttypedField.editor.attach(mapTree);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase FieldKinds.optional.identifier: {\n\t\t\t\tconst typedField = field as FlexTreeOptionalField;\n\t\t\t\ttypedField.editor.attach(mapTree, typedField.length === 0);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdefault:\n\t\t\t\tfail(0xade /* invalid FieldKind */);\n\t\t}\n\t});\n}\n\n/**\n * {@link FieldSchemaAlpha} including {@link SimpleObjectFieldSchema}.\n */\nexport class ObjectFieldSchema<\n\t\tKind extends FieldKind,\n\t\tTypes extends ImplicitAllowedTypes,\n\t\tTCustomMetadata = unknown,\n\t>\n\textends FieldSchemaAlpha<Kind, Types, TCustomMetadata>\n\timplements SimpleObjectFieldSchema\n{\n\tpublic readonly storedKey: string;\n\n\tpublic constructor(\n\t\tkind: Kind,\n\t\tallowedTypes: Types,\n\t\tprops: FieldProps<TCustomMetadata> & { readonly key: string },\n\t) {\n\t\tsuper(kind, allowedTypes, props);\n\t\tthis.storedKey = props.key;\n\t}\n}\n\nabstract class CustomObjectNodeBase<\n\tconst T extends RestrictiveStringRecord<ImplicitFieldSchema>,\n> extends TreeNodeValid<InsertableObjectFromSchemaRecord<T>> {\n\tpublic static readonly kind = NodeKind.Object;\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link TreeObjectNode}.\n *\n * @param name - Unique identifier for this schema within this factory's scope.\n * @param fields - Schema for fields of the object node's schema. Defines what children can be placed under each key.\n * @param persistedMetadata - Optional persisted metadata for the object node schema.\n */\nexport function objectSchema<\n\tTName extends string,\n\tconst T extends RestrictiveStringRecord<ImplicitFieldSchema>,\n\tconst ImplicitlyConstructable extends boolean,\n\tconst TCustomMetadata = unknown,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tnodeOptions: ObjectSchemaOptionsAlpha<TCustomMetadata>,\n): ObjectNodeSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> &\n\tObjectNodeSchemaInternalData &\n\tTreeNodeSchemaCorePrivate {\n\t// Field set can't be modified after this since derived data is stored in maps.\n\tObject.freeze(info);\n\n\t// Ensure no collisions between final set of property keys, and final set of stored keys (including those\n\t// implicitly derived from property keys)\n\tassertUniqueKeys(identifier, info);\n\n\t// Performance optimization: cache property key => stored key and schema.\n\tconst flexKeyMap: SimpleKeyMap = createFlexKeyMapping(info);\n\n\tconst identifierFieldKeys: FieldKey[] = [];\n\tfor (const item of flexKeyMap.values()) {\n\t\tif (item.schema.kind === FieldKind.Identifier) {\n\t\t\tidentifierFieldKeys.push(item.storedKey);\n\t\t}\n\t}\n\n\tconst lazyChildTypes = new Lazy(\n\t\t() => new Set(Array.from(flexKeyMap.values(), (f) => [...f.schema.allowedTypeSet]).flat()),\n\t);\n\n\tlet privateData: TreeNodeSchemaPrivateData | undefined;\n\n\tlet handler: ProxyHandler<object>;\n\tlet customizable: boolean;\n\n\tclass CustomObjectNode extends CustomObjectNodeBase<T> {\n\t\tpublic static readonly fields: ReadonlyMap<\n\t\t\tstring,\n\t\t\tFieldSchemaAlpha & SimpleObjectFieldSchema\n\t\t> = new Map(\n\t\t\tArray.from(flexKeyMap, ([key, value]) => [\n\t\t\t\tkey as string,\n\t\t\t\tnew ObjectFieldSchema(value.schema.kind, value.schema.allowedTypes, {\n\t\t\t\t\t...value.schema.props,\n\t\t\t\t\tkey: getStoredKey(key as string, value.schema),\n\t\t\t\t}),\n\t\t\t]),\n\t\t);\n\t\tpublic static readonly flexKeyMap: SimpleKeyMap = flexKeyMap;\n\t\tpublic static readonly storedKeyToPropertyKey: ReadonlyMap<FieldKey, string> = new Map<\n\t\t\tFieldKey,\n\t\t\tstring\n\t\t>(\n\t\t\tArray.from(flexKeyMap, ([key, value]): [FieldKey, string] => [\n\t\t\t\tvalue.storedKey,\n\t\t\t\tkey as string,\n\t\t\t]),\n\t\t);\n\t\tpublic static readonly identifierFieldKeys: readonly FieldKey[] = identifierFieldKeys;\n\t\tpublic static readonly allowUnknownOptionalFields: boolean =\n\t\t\tnodeOptions.allowUnknownOptionalFields ?? false;\n\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\t// Differentiate between the following cases:\n\t\t\t//\n\t\t\t// Case 1: Direct construction (POJO emulation)\n\t\t\t//\n\t\t\t// const Foo = schemaFactory.object(\"Foo\", {bar: schemaFactory.number});\n\t\t\t//\n\t\t\t// assert.deepEqual(new Foo({ bar: 42 }), { bar: 42 },\n\t\t\t//\t\t \"Prototype chain equivalent to POJO.\");\n\t\t\t//\n\t\t\t// Case 2: Subclass construction (Customizable Object)\n\t\t\t//\n\t\t\t// \t class Foo extends schemaFactory.object(\"Foo\", {bar: schemaFactory.number}) {}\n\t\t\t//\n\t\t\t// \t assert.notDeepEqual(new Foo({ bar: 42 }), { bar: 42 },\n\t\t\t// \t \"Subclass prototype chain differs from POJO.\");\n\t\t\t//\n\t\t\t// In Case 1 (POJO emulation), the prototype chain match '{}' (proxyTarget = undefined)\n\t\t\t// In Case 2 (Customizable Object), the prototype chain include the user's subclass (proxyTarget = this)\n\n\t\t\tconst proxyTarget = customizable ? instance : {};\n\t\t\tconst proxy = new Proxy(proxyTarget, handler) as CustomObjectNode;\n\t\t\ttargetToProxy.set(proxyTarget, proxy);\n\t\t\treturn proxy;\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 object, this as Output);\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup(): TreeNodeSchemaInitializedData {\n\t\t\t// One time initialization that required knowing the most derived type (from this.constructor) and thus has to be lazy.\n\t\t\tcustomizable = (this as unknown) !== CustomObjectNode;\n\t\t\tconst schema = this as unknown as ObjectNodeSchemaPrivate;\n\t\t\thandler = createProxyHandler(schema, customizable);\n\n\t\t\t// First run, do extra validation.\n\t\t\t// TODO: provide a way for TreeConfiguration to trigger this same validation to ensure it gets run early.\n\t\t\t// Scan for shadowing inherited members which won't work, but stop scan early to allow shadowing built in (which seems to work ok).\n\t\t\t{\n\t\t\t\tlet prototype: object = this.prototype;\n\t\t\t\t// There isn't a clear cleaner way to author this loop.\n\t\t\t\twhile (prototype !== CustomObjectNode.prototype) {\n\t\t\t\t\tfor (const [key] of flexKeyMap) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t// constructor is a special case, since one is built in on the derived type, and shadowing it works fine since we only use it before fields are applied.\n\t\t\t\t\t\t\tkey !== \"constructor\" &&\n\t\t\t\t\t\t\tReflect.getOwnPropertyDescriptor(prototype, key) !== undefined\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t`Schema ${identifier} defines an inherited property \"${key.toString()}\" which shadows a field. Since fields are exposed as own properties, this shadowing will not work, and is an error.`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Since this stops at CustomObjectNode, it should never see a null prototype, so this case is safe.\n\t\t\t\t\t// Additionally, if the prototype chain is ever messed up such that CustomObjectNode is not in it,\n\t\t\t\t\t// the null that would show up here does at least ensure this code throws instead of hanging.\n\t\t\t\t\tprototype = Reflect.getPrototypeOf(prototype) as object;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn getTreeNodeSchemaInitializedData(schema, {\n\t\t\t\tshallowCompatibilityTest: (data: FactoryContent): CompatibilityLevel =>\n\t\t\t\t\tshallowCompatibilityTest(data, schema),\n\t\t\t\ttoFlexContent: (\n\t\t\t\t\tdata: FactoryContent,\n\t\t\t\t\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n\t\t\t\t): FlexContent => objectToFlexContent(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 lazyChildTypes.value;\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\tnodeOptions.persistedMetadata;\n\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tpublic get [typeNameSymbol](): TName {\n\t\t\treturn identifier;\n\t\t}\n\t\tpublic get [typeSchemaSymbol](): Output {\n\t\t\treturn CustomObjectNode.constructorCached?.constructor as unknown as Output;\n\t\t}\n\n\t\tpublic static get [privateDataSymbol](): TreeNodeSchemaPrivateData {\n\t\t\treturn (privateData ??= createTreeNodeSchemaPrivateData(\n\t\t\t\tthis,\n\t\t\t\tArray.from(CustomObjectNode.fields.values(), (schema) => schema.allowedTypesFull),\n\t\t\t));\n\t\t}\n\t}\n\ttype Output = typeof CustomObjectNode &\n\t\t(new (\n\t\t\tinput: InsertableObjectFromSchemaRecord<T> | InternalTreeNode,\n\t\t) => TreeObjectNode<T, TName>);\n\treturn CustomObjectNode as Output;\n}\n\nconst targetToProxy: WeakMap<object, TreeNode> = new WeakMap();\n\n/**\n * Ensures that the set of property keys in the schema is unique.\n * Also ensure that the final set of stored keys (including those implicitly derived from property keys) is unique.\n * @throws Throws a `UsageError` if either of the key uniqueness invariants is violated.\n */\nfunction assertUniqueKeys<\n\tconst Name extends number | string,\n\tconst Fields extends RestrictiveStringRecord<ImplicitFieldSchema>,\n>(schemaName: Name, fields: Fields): void {\n\t// Verify that there are no duplicates among the explicitly specified stored keys.\n\tconst explicitStoredKeys = new Set<string>();\n\tfor (const schema of Object.values(fields)) {\n\t\tconst storedKey = getExplicitStoredKey(schema);\n\t\tif (storedKey === undefined) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (explicitStoredKeys.has(storedKey)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Duplicate stored key \"${storedKey}\" in schema \"${schemaName}\". Stored keys must be unique within an object schema.`,\n\t\t\t);\n\t\t}\n\t\texplicitStoredKeys.add(storedKey);\n\t}\n\n\t// Verify that there are no duplicates among the derived\n\t// (including those implicitly derived from property keys) stored keys.\n\tconst derivedStoredKeys = new Set<string>();\n\tfor (const [propertyKey, schema] of Object.entries(fields)) {\n\t\tconst storedKey = getStoredKey(propertyKey, schema);\n\t\tif (derivedStoredKeys.has(storedKey)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Stored key \"${storedKey}\" in schema \"${schemaName}\" conflicts with a property key of the same name, which is not overridden by a stored key. The final set of stored keys in an object schema must be unique.`,\n\t\t\t);\n\t\t}\n\t\tderivedStoredKeys.add(storedKey);\n\t}\n}\n\n/**\n * {@link TreeNodeSchemaInitializedData.toFlexContent} for object nodes.\n *\n * @param data - The tree data to be transformed. Must be a Record-like object.\n * @param schema - The schema to comply with.\n */\nfunction objectToFlexContent(\n\tdata: FactoryContent,\n\tschema: TreeNodeSchema & ObjectNodeSchemaInternalData,\n): FlexContent {\n\tif (\n\t\ttypeof data !== \"object\" ||\n\t\tdata === null ||\n\t\tSymbol.iterator in data ||\n\t\tisFluidHandle(data)\n\t) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\tthrow new UsageError(`Input data is incompatible with Object schema: ${data}`);\n\t}\n\n\tconst fields = new Map<FieldKey, UnhydratedFlexTreeField>();\n\tconst context = getUnhydratedContext(schema).flexContext;\n\n\tfor (const [key, fieldInfo] of schema.flexKeyMap) {\n\t\tconst value = getFieldProperty(data, key);\n\n\t\tlet children: FlexTreeNode[] | ContextualFieldProvider;\n\t\tif (value === undefined) {\n\t\t\tconst defaultProvider =\n\t\t\t\tfieldInfo.schema.props?.defaultProvider ??\n\t\t\t\tfail(0xbb1 /* missing field has no default provider */);\n\t\t\tconst fieldProvider = extractFieldProvider(defaultProvider);\n\t\t\tchildren = isConstant(fieldProvider) ? fieldProvider() : fieldProvider;\n\t\t} else {\n\t\t\tchildren = [flexTreeFromInsertableNode(value, fieldInfo.schema.allowedTypeSet)];\n\t\t}\n\n\t\tconst kind =\n\t\t\tconvertFieldKind.get(fieldInfo.schema.kind) ?? fail(0xbb2 /* Invalid field kind */);\n\t\tfields.set(\n\t\t\tfieldInfo.storedKey,\n\t\t\tcreateField(context, kind.identifier, fieldInfo.storedKey, children),\n\t\t);\n\t}\n\n\treturn [{ type: brand(schema.identifier) }, fields];\n}\n\n/**\n * {@link TreeNodeSchemaInitializedData.shallowCompatibilityTest} for Object nodes.\n */\nfunction shallowCompatibilityTest(\n\tdata: FactoryContent,\n\tschema: ObjectNodeSchema & ObjectNodeSchemaInternalData,\n): CompatibilityLevel {\n\tif (isTreeValue(data)) {\n\t\treturn CompatibilityLevel.None;\n\t}\n\n\tif (Symbol.iterator in data) {\n\t\treturn CompatibilityLevel.None;\n\t}\n\n\t// TODO: Improve type inference by making this logic more thorough. Handle at least:\n\t// * Types which are strict subsets of other types in the same polymorphic union\n\t// * Types which have the same keys but different types for those keys in the polymorphic union\n\t// * Types which have the same required fields but different optional fields and enough of those optional fields are populated to disambiguate\n\n\t// TODO#7441: Consider allowing data to be inserted which has keys that are extraneous/unknown to the schema (those keys are ignored)\n\n\t// If the schema has a required key which is not present in the input object, reject it.\n\tfor (const [fieldKey, fieldSchema] of schema.fields) {\n\t\tif (fieldSchema.requiresValue) {\n\t\t\tif (getFieldProperty(data, fieldKey) === undefined) {\n\t\t\t\treturn CompatibilityLevel.None;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn CompatibilityLevel.Normal;\n}\n\n/**\n * Check {@link FactoryContentObject} for a property which could be store a field.\n *\n * @returns If the property exists, return its value. Otherwise, returns undefined.\n * @remarks\n * The currently policy is to only consider own properties.\n * See {@link InsertableObjectFromSchemaRecord} for where this policy is documented in the public API.\n *\n * Explicit undefined values are treated the same as missing properties to allow explicit use of undefined with defaulted identifiers.\n *\n * @privateRemarks\n * If we ever want to have an optional field which defaults to something other than undefined, this will need changes.\n * It would need to adjusting the handling of explicit undefined in contexts where undefined is allowed, and a default provider also exists.\n */\nfunction getFieldProperty(\n\tdata: FactoryContentObject,\n\tkey: string | symbol,\n): InsertableContent | undefined {\n\t// This policy only allows own properties.\n\tif (Object.hasOwnProperty.call(data, key)) {\n\t\treturn (data as Record<string, InsertableContent>)[key as string];\n\t}\n\treturn undefined;\n}\n\nfunction applyFieldChange(\n\tschema: ObjectNodeSchemaPrivate,\n\tfrom: { kind: \"proxy\"; node: TreeNode } | { kind: \"target\"; node: object },\n\tfieldInfo: { storedKey: FieldKey; schema: FieldSchema },\n\tvalue: InsertableContent | undefined,\n): void {\n\tconst proxy =\n\t\tfrom.kind === \"proxy\"\n\t\t\t? from.node\n\t\t\t: (targetToProxy.get(from.node) ?? fail(0xc95 /* missing proxy */));\n\tconst inner = getInnerNode(proxy);\n\tconst storedSchema = inner.context.schema.nodeSchema.get(brand(schema.identifier));\n\tassert(\n\t\tstoredSchema instanceof ObjectNodeStoredSchema,\n\t\t0xc96 /* Expected ObjectNodeStoredSchema */,\n\t);\n\n\tif (value === undefined && inner.tryGetField(fieldInfo.storedKey) === undefined) {\n\t\treturn;\n\t}\n\n\tsetField(\n\t\tinner.getBoxed(fieldInfo.storedKey),\n\t\tfieldInfo.schema,\n\t\tvalue,\n\t\tstoredSchema.getFieldSchema(fieldInfo.storedKey),\n\t);\n}\n"]}
@@ -7,13 +7,13 @@ import type { TreeObjectNode, SimpleKeyMap, InsertableObjectFromSchemaRecord } f
7
7
  import type { FieldSchemaAlpha, ImplicitFieldSchema } from "../../fieldSchema.js";
8
8
  import { NodeKind, type TreeNodeSchemaClass, type TreeNodeSchema, type TreeNodeSchemaCorePrivate } from "../../core/index.js";
9
9
  import type { FieldKey } from "../../../core/index.js";
10
- import type { SimpleObjectFieldSchema, SimpleObjectNodeSchema } from "../../simpleSchema.js";
10
+ import type { SchemaType, SimpleObjectFieldSchema, SimpleObjectNodeSchema } from "../../simpleSchema.js";
11
11
  /**
12
12
  * A schema for {@link TreeObjectNode}s.
13
13
  * @sealed
14
14
  * @alpha
15
15
  */
16
- export interface ObjectNodeSchema<out TName extends string = string, in out T extends RestrictiveStringRecord<ImplicitFieldSchema> = RestrictiveStringRecord<ImplicitFieldSchema>, ImplicitlyConstructable extends boolean = boolean, out TCustomMetadata = unknown> extends TreeNodeSchemaClass<TName, NodeKind.Object, TreeObjectNode<T, TName>, InsertableObjectFromSchemaRecord<T>, ImplicitlyConstructable, T, never, TCustomMetadata>, SimpleObjectNodeSchema<TCustomMetadata> {
16
+ export interface ObjectNodeSchema<out TName extends string = string, in out T extends RestrictiveStringRecord<ImplicitFieldSchema> = RestrictiveStringRecord<ImplicitFieldSchema>, ImplicitlyConstructable extends boolean = boolean, out TCustomMetadata = unknown> extends TreeNodeSchemaClass<TName, NodeKind.Object, TreeObjectNode<T, TName>, InsertableObjectFromSchemaRecord<T>, ImplicitlyConstructable, T, never, TCustomMetadata>, SimpleObjectNodeSchema<SchemaType.View, TCustomMetadata> {
17
17
  /**
18
18
  * From property keys to the associated schema.
19
19
  */
@@ -1 +1 @@
1
- {"version":3,"file":"objectNodeTypes.d.ts","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/object/objectNodeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EACX,cAAc,EACd,YAAY,EACZ,gCAAgC,EAChC,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EACN,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,Q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AC,MAAM,EAAE,cAAc,GAAG,MAAM,IAAI,uBAAuB,CAE5F"}
1
+ {"version":3,"file":"objectNodeTypes.d.ts","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/object/objectNodeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EACX,cAAc,EACd,YAAY,EACZ,gCAAgC,EAChC,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EACN,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EACX,UAAU,EACV,uBAAuB,EACvB,sBAAsB,EACtB,MAAM,uBAAuB,CAAC;AAE/B;;;;GAIG;AACH,MAAM,WAAW,gBAAgB,CAChC,GAAG,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EACjC,EAAE,CAAC,GAAG,CAAC,CAAC,SACP,uBAAuB,CAAC,mBAAmB,CAAC,GAAG,uBAAuB,CAAC,mBAAmB,CAAC,EAC5F,uBAAuB,SAAS,OAAO,GAAG,OAAO,EACjD,GAAG,CAAC,eAAe,GAAG,OAAO,CAC5B,SAAQ,mBAAmB,CAC1B,KAAK,EACL,QAAQ,CAAC,MAAM,EACf,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,EACxB,gCAAgC,CAAC,CAAC,CAAC,EACnC,uBAAuB,EACvB,CAAC,EACD,KAAK,EACL,eAAe,CACf,EACD,sBAAsB,CAAC,UAAU,CAAC,IAAI,EAAE,eAAe,CAAC;IACzD;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,GAAG,uBAAuB,CAAC,CAAC;CACjF;AAED;;GAEG;AACH,MAAM,WAAW,4BAA6B,SAAQ,yBAAyB;IAC9E;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAC;IAElC;;OAEG;IACH,QAAQ,CAAC,sBAAsB,EAAE,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE/D;;OAEG;IACH,QAAQ,CAAC,mBAAmB,EAAE,SAAS,QAAQ,EAAE,CAAC;IAElD;;OAEG;IACH,QAAQ,CAAC,0BAA0B,EAAE,OAAO,CAAC;CAC7C;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC5B;;OAEG;2CACyB,cAAc;CAGjC,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,GACrD,4BAA4B,GAC5B,yBAAyB,CAAC;AAE3B,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,IAAI,uBAAuB,CAE5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"objectNodeTypes.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/object/objectNodeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EACN,QAAQ,GAIR,MAAM,qBAAqB,CAAC;AAyD7B;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B;;OAEG;IACH,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAqB;QACzC,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;CACQ,CAAC;AASX,MAAM,UAAU,kBAAkB,CAAC,MAAsB;IACxD,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,MAAM,CAAC;AACxC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { RestrictiveStringRecord } from \"../../../util/index.js\";\nimport type {\n\tTreeObjectNode,\n\tSimpleKeyMap,\n\tInsertableObjectFromSchemaRecord,\n} from \"./objectNode.js\";\nimport type { FieldSchemaAlpha, ImplicitFieldSchema } from \"../../fieldSchema.js\";\nimport {\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaCorePrivate,\n} from \"../../core/index.js\";\nimport type { FieldKey } from \"../../../core/index.js\";\nimport type { SimpleObjectFieldSchema, SimpleObjectNodeSchema } from \"../../simpleSchema.js\";\n\n/**\n * A schema for {@link TreeObjectNode}s.\n * @sealed\n * @alpha\n */\nexport interface ObjectNodeSchema<\n\tout TName extends string = string,\n\tin out T extends\n\t\tRestrictiveStringRecord<ImplicitFieldSchema> = RestrictiveStringRecord<ImplicitFieldSchema>,\n\tImplicitlyConstructable extends boolean = boolean,\n\tout TCustomMetadata = unknown,\n> extends TreeNodeSchemaClass<\n\t\t\tTName,\n\t\t\tNodeKind.Object,\n\t\t\tTreeObjectNode<T, TName>,\n\t\t\tInsertableObjectFromSchemaRecord<T>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tnever,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleObjectNodeSchema<TCustomMetadata> {\n\t/**\n\t * From property keys to the associated schema.\n\t */\n\treadonly fields: ReadonlyMap<string, FieldSchemaAlpha & SimpleObjectFieldSchema>;\n}\n\n/**\n * Extra data provided on all {@link ObjectNodeSchema} that is not included in the (soon possibly public) ObjectNodeSchema type.\n */\nexport interface ObjectNodeSchemaInternalData extends TreeNodeSchemaCorePrivate {\n\t/**\n\t * {@inheritdoc SimpleKeyMap}\n\t */\n\treadonly flexKeyMap: SimpleKeyMap;\n\n\t/**\n\t * Lookup the property keys from the stored keys.\n\t */\n\treadonly storedKeyToPropertyKey: ReadonlyMap<FieldKey, string>;\n\n\t/**\n\t * Stored keys which hold identifiers.\n\t */\n\treadonly identifierFieldKeys: readonly FieldKey[];\n\n\t/**\n\t * Whether to tolerate (and preserve) additional unknown optional fields in instances of this object node.\n\t */\n\treadonly allowUnknownOptionalFields: boolean;\n}\n\n/**\n * @alpha\n */\nexport const ObjectNodeSchema = {\n\t/**\n\t * instanceof-based narrowing support for ObjectNodeSchema in Javascript and TypeScript 5.3 or newer.\n\t */\n\t[Symbol.hasInstance](value: TreeNodeSchema): value is ObjectNodeSchema {\n\t\treturn isObjectNodeSchema(value);\n\t},\n} as const;\n\n/**\n * {@link ObjectNodeSchema} with data that is not part of the package-exported API surface.\n */\nexport type ObjectNodeSchemaPrivate = ObjectNodeSchema &\n\tObjectNodeSchemaInternalData &\n\tTreeNodeSchemaCorePrivate;\n\nexport function isObjectNodeSchema(schema: TreeNodeSchema): schema is ObjectNodeSchemaPrivate {\n\treturn schema.kind === NodeKind.Object;\n}\n"]}
1
+ {"version":3,"file":"objectNodeTypes.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/object/objectNodeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EACN,QAAQ,GAIR,MAAM,qBAAqB,CAAC;AA6D7B;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B;;OAEG;IACH,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAqB;QACzC,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;CACQ,CAAC;AASX,MAAM,UAAU,kBAAkB,CAAC,MAAsB;IACxD,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,MAAM,CAAC;AACxC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { RestrictiveStringRecord } from \"../../../util/index.js\";\nimport type {\n\tTreeObjectNode,\n\tSimpleKeyMap,\n\tInsertableObjectFromSchemaRecord,\n} from \"./objectNode.js\";\nimport type { FieldSchemaAlpha, ImplicitFieldSchema } from \"../../fieldSchema.js\";\nimport {\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaCorePrivate,\n} from \"../../core/index.js\";\nimport type { FieldKey } from \"../../../core/index.js\";\nimport type {\n\tSchemaType,\n\tSimpleObjectFieldSchema,\n\tSimpleObjectNodeSchema,\n} from \"../../simpleSchema.js\";\n\n/**\n * A schema for {@link TreeObjectNode}s.\n * @sealed\n * @alpha\n */\nexport interface ObjectNodeSchema<\n\tout TName extends string = string,\n\tin out T extends\n\t\tRestrictiveStringRecord<ImplicitFieldSchema> = RestrictiveStringRecord<ImplicitFieldSchema>,\n\tImplicitlyConstructable extends boolean = boolean,\n\tout TCustomMetadata = unknown,\n> extends TreeNodeSchemaClass<\n\t\t\tTName,\n\t\t\tNodeKind.Object,\n\t\t\tTreeObjectNode<T, TName>,\n\t\t\tInsertableObjectFromSchemaRecord<T>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tnever,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleObjectNodeSchema<SchemaType.View, TCustomMetadata> {\n\t/**\n\t * From property keys to the associated schema.\n\t */\n\treadonly fields: ReadonlyMap<string, FieldSchemaAlpha & SimpleObjectFieldSchema>;\n}\n\n/**\n * Extra data provided on all {@link ObjectNodeSchema} that is not included in the (soon possibly public) ObjectNodeSchema type.\n */\nexport interface ObjectNodeSchemaInternalData extends TreeNodeSchemaCorePrivate {\n\t/**\n\t * {@inheritdoc SimpleKeyMap}\n\t */\n\treadonly flexKeyMap: SimpleKeyMap;\n\n\t/**\n\t * Lookup the property keys from the stored keys.\n\t */\n\treadonly storedKeyToPropertyKey: ReadonlyMap<FieldKey, string>;\n\n\t/**\n\t * Stored keys which hold identifiers.\n\t */\n\treadonly identifierFieldKeys: readonly FieldKey[];\n\n\t/**\n\t * Whether to tolerate (and preserve) additional unknown optional fields in instances of this object node.\n\t */\n\treadonly allowUnknownOptionalFields: boolean;\n}\n\n/**\n * @alpha\n */\nexport const ObjectNodeSchema = {\n\t/**\n\t * instanceof-based narrowing support for ObjectNodeSchema in Javascript and TypeScript 5.3 or newer.\n\t */\n\t[Symbol.hasInstance](value: TreeNodeSchema): value is ObjectNodeSchema {\n\t\treturn isObjectNodeSchema(value);\n\t},\n} as const;\n\n/**\n * {@link ObjectNodeSchema} with data that is not part of the package-exported API surface.\n */\nexport type ObjectNodeSchemaPrivate = ObjectNodeSchema &\n\tObjectNodeSchemaInternalData &\n\tTreeNodeSchemaCorePrivate;\n\nexport function isObjectNodeSchema(schema: TreeNodeSchema): schema is ObjectNodeSchemaPrivate {\n\treturn schema.kind === NodeKind.Object;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"recordNode.d.ts","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/record/recordNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAEN,QAAQ,EASR,KAAK,oBAAoB,EAMzB,KAAK,yBAAyB,EAO9B,MAAM,qBAAqB,CAAC;AAS7B,OAAO,KAAK,EACX,4BAA4B,EAE5B,6BAA6B,EAG7B,MAAM,sBAAsB,CAAC;AAS9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAoJjE;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CACnC,KAAK,SAAS,MAAM,EACpB,aAAa,SAAS,oBAAoB,EAC1C,wBAAwB,SAAS,OAAO,EACxC,eAAe,GAAG,OAAO;IAEzB;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC;IAE3B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAE7B,QAAQ,CAAC,uBAAuB,EAAE,wBAAwB,CAAC;IAE3D,QAAQ,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAC,eAAe,CAAC,CAAC;CAC/D;AAED;;;;;GAKG;AAEH,wBAAgB,YAAY,CAC3B,KAAK,SAAS,MAAM,EACpB,KAAK,CAAC,aAAa,SAAS,oBAAoB,EAChD,KAAK,CAAC,wBAAwB,SAAS,OAAO,EAC9C,KAAK,CAAC,eAAe,GAAG,OAAO,EAE/B,OAAO,EAAE,mBAAmB,CAC3B,KAAK,EACL,aAAa,EACb,wBAAwB,EACxB,eAAe,CACf,kRA6JD"}
1
+ {"version":3,"file":"recordNode.d.ts","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/record/recordNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAEN,QAAQ,EASR,KAAK,oBAAoB,EAMzB,KAAK,yBAAyB,EAO9B,MAAM,qBAAqB,CAAC;AAS7B,OAAO,KAAK,EACX,4BAA4B,EAE5B,6BAA6B,EAG7B,MAAM,sBAAsB,CAAC;AAS9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAqJjE;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CACnC,KAAK,SAAS,MAAM,EACpB,aAAa,SAAS,oBAAoB,EAC1C,wBAAwB,SAAS,OAAO,EACxC,eAAe,GAAG,OAAO;IAEzB;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC;IAE3B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAE7B,QAAQ,CAAC,uBAAuB,EAAE,wBAAwB,CAAC;IAE3D,QAAQ,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAC,eAAe,CAAC,CAAC;CAC/D;AAED;;;;;GAKG;AAEH,wBAAgB,YAAY,CAC3B,KAAK,SAAS,MAAM,EACpB,KAAK,CAAC,aAAa,SAAS,oBAAoB,EAChD,KAAK,CAAC,wBAAwB,SAAS,OAAO,EAC9C,KAAK,CAAC,eAAe,GAAG,OAAO,EAE/B,OAAO,EAAE,mBAAmB,CAC3B,KAAK,EACL,aAAa,EACb,wBAAwB,EACxB,eAAe,CACf,kRAgKD"}
@@ -75,8 +75,10 @@ function createRecordNodeProxy(proxyTarget, customizable, schema) {
75
75
  const kernel = getKernel(receiver);
76
76
  const innerSchema = innerNode.context.schema.nodeSchema.get(brand(schema.identifier));
77
77
  assert(innerSchema instanceof MapNodeStoredSchema, 0xc1a /* Expected MapNodeStoredSchema */);
78
- const mapTree = prepareForInsertion(value, createFieldSchema(FieldKind.Optional, kernel.schema.info), innerNode.context, innerSchema.mapFields);
79
- field.editor.set(mapTree, field.length === 0);
78
+ field.context.runInTransaction(() => {
79
+ const mapTree = prepareForInsertion(value, createFieldSchema(FieldKind.Optional, kernel.schema.info), innerNode.context, innerSchema.mapFields);
80
+ field.editor.attach(mapTree, field.length === 0);
81
+ });
80
82
  return true;
81
83
  },
82
84
  has: (target, key) => {