@fluidframework/tree 2.90.0-378676 → 2.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1244) hide show
  1. package/.vscode/settings.json +6 -5
  2. package/CHANGELOG.md +342 -0
  3. package/README.md +1 -1
  4. package/alpha.d.ts +2 -2
  5. package/api-extractor/api-extractor-lint-alpha.cjs.json +1 -1
  6. package/api-extractor/api-extractor-lint-alpha.esm.json +1 -1
  7. package/api-extractor/api-extractor-lint-beta.cjs.json +1 -1
  8. package/api-extractor/api-extractor-lint-beta.esm.json +1 -1
  9. package/api-extractor/api-extractor-lint-bundle.json +1 -1
  10. package/api-extractor/api-extractor-lint-legacy.cjs.json +1 -1
  11. package/api-extractor/api-extractor-lint-legacy.esm.json +1 -1
  12. package/api-extractor/api-extractor-lint-public.cjs.json +1 -1
  13. package/api-extractor/api-extractor-lint-public.esm.json +1 -1
  14. package/api-extractor/api-extractor.current.json +1 -1
  15. package/api-extractor/api-extractor.legacy.json +2 -1
  16. package/api-extractor.json +1 -0
  17. package/api-report/tree.alpha.api.md +144 -40
  18. package/api-report/tree.beta.api.md +30 -0
  19. package/api-report/tree.legacy.beta.api.md +30 -0
  20. package/beta.d.ts +2 -2
  21. package/dist/codec/codec.d.ts +2 -0
  22. package/dist/codec/codec.d.ts.map +1 -1
  23. package/dist/codec/codec.js +4 -3
  24. package/dist/codec/codec.js.map +1 -1
  25. package/dist/codec/index.d.ts +1 -1
  26. package/dist/codec/index.d.ts.map +1 -1
  27. package/dist/codec/index.js +2 -1
  28. package/dist/codec/index.js.map +1 -1
  29. package/dist/codec/versioned/codec.d.ts +13 -1
  30. package/dist/codec/versioned/codec.d.ts.map +1 -1
  31. package/dist/codec/versioned/codec.js +18 -3
  32. package/dist/codec/versioned/codec.js.map +1 -1
  33. package/dist/codec/versioned/format.d.ts +22 -1
  34. package/dist/codec/versioned/format.d.ts.map +1 -1
  35. package/dist/codec/versioned/format.js +16 -3
  36. package/dist/codec/versioned/format.js.map +1 -1
  37. package/dist/codec/versioned/index.d.ts +1 -1
  38. package/dist/codec/versioned/index.d.ts.map +1 -1
  39. package/dist/codec/versioned/index.js +2 -1
  40. package/dist/codec/versioned/index.js.map +1 -1
  41. package/dist/core/change-family/changeFamily.d.ts +1 -4
  42. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  43. package/dist/core/change-family/changeFamily.js.map +1 -1
  44. package/dist/core/change-family/index.d.ts +1 -1
  45. package/dist/core/change-family/index.d.ts.map +1 -1
  46. package/dist/core/change-family/index.js.map +1 -1
  47. package/dist/core/index.d.ts +3 -4
  48. package/dist/core/index.d.ts.map +1 -1
  49. package/dist/core/index.js +4 -8
  50. package/dist/core/index.js.map +1 -1
  51. package/dist/core/rebase/changeRebaser.d.ts +1 -6
  52. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  53. package/dist/core/rebase/changeRebaser.js.map +1 -1
  54. package/dist/core/rebase/index.d.ts +1 -1
  55. package/dist/core/rebase/index.d.ts.map +1 -1
  56. package/dist/core/rebase/index.js +1 -2
  57. package/dist/core/rebase/index.js.map +1 -1
  58. package/dist/core/rebase/types.d.ts +78 -1
  59. package/dist/core/rebase/types.d.ts.map +1 -1
  60. package/dist/core/rebase/types.js +1 -5
  61. package/dist/core/rebase/types.js.map +1 -1
  62. package/dist/core/rebase/utils.d.ts.map +1 -1
  63. package/dist/core/rebase/utils.js +7 -25
  64. package/dist/core/rebase/utils.js.map +1 -1
  65. package/dist/core/tree/delta.d.ts +0 -5
  66. package/dist/core/tree/delta.d.ts.map +1 -1
  67. package/dist/core/tree/delta.js.map +1 -1
  68. package/dist/core/tree/detachedFieldIndex.d.ts +1 -13
  69. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  70. package/dist/core/tree/detachedFieldIndex.js +1 -14
  71. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  72. package/dist/core/tree/detachedFieldIndexTypes.d.ts +0 -4
  73. package/dist/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  74. package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
  75. package/dist/core/tree/index.d.ts +2 -2
  76. package/dist/core/tree/index.d.ts.map +1 -1
  77. package/dist/core/tree/index.js +3 -4
  78. package/dist/core/tree/index.js.map +1 -1
  79. package/dist/core/tree/pathTree.d.ts +3 -11
  80. package/dist/core/tree/pathTree.d.ts.map +1 -1
  81. package/dist/core/tree/pathTree.js +2 -14
  82. package/dist/core/tree/pathTree.js.map +1 -1
  83. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  84. package/dist/core/tree/visitDelta.js +13 -17
  85. package/dist/core/tree/visitDelta.js.map +1 -1
  86. package/dist/entrypoints/alpha.d.ts +6 -0
  87. package/dist/entrypoints/alpha.d.ts.map +1 -0
  88. package/dist/entrypoints/alpha.js +92 -0
  89. package/dist/entrypoints/alpha.js.map +1 -0
  90. package/dist/entrypoints/beta.d.ts +6 -0
  91. package/dist/entrypoints/beta.d.ts.map +1 -0
  92. package/dist/entrypoints/beta.js +43 -0
  93. package/dist/entrypoints/beta.js.map +1 -0
  94. package/{lib/core/schema-view/index.js → dist/entrypoints/internal.d.ts} +2 -2
  95. package/dist/entrypoints/internal.d.ts.map +1 -0
  96. package/dist/entrypoints/internal.js +28 -0
  97. package/dist/entrypoints/internal.js.map +1 -0
  98. package/dist/entrypoints/legacy.d.ts +6 -0
  99. package/dist/entrypoints/legacy.d.ts.map +1 -0
  100. package/dist/entrypoints/legacy.js +49 -0
  101. package/dist/entrypoints/legacy.js.map +1 -0
  102. package/dist/entrypoints/public.d.ts +6 -0
  103. package/dist/entrypoints/public.d.ts.map +1 -0
  104. package/dist/entrypoints/public.js +27 -0
  105. package/dist/entrypoints/public.js.map +1 -0
  106. package/dist/feature-libraries/changeAtomIdBTree.d.ts +2 -3
  107. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  108. package/dist/feature-libraries/changeAtomIdBTree.js +2 -15
  109. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  110. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -7
  111. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  112. package/dist/feature-libraries/chunked-forest/codec/codecs.js +22 -44
  113. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  114. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  115. package/dist/feature-libraries/chunked-forest/codec/format.js +11 -0
  116. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  117. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +3 -2
  118. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  119. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -4
  120. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  121. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  122. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  123. package/dist/feature-libraries/chunked-forest/index.js +2 -4
  124. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  125. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +44 -92
  126. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  127. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +70 -220
  128. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  129. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  130. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +2 -12
  131. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  132. package/dist/feature-libraries/default-schema/index.d.ts +1 -2
  133. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  134. package/dist/feature-libraries/default-schema/index.js +2 -4
  135. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  136. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +6 -7
  137. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  138. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +0 -15
  139. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  140. package/dist/feature-libraries/deltaUtils.d.ts +0 -1
  141. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  142. package/dist/feature-libraries/deltaUtils.js +1 -6
  143. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  144. package/dist/feature-libraries/flex-tree/context.d.ts +0 -9
  145. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  146. package/dist/feature-libraries/flex-tree/context.js +0 -6
  147. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  148. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  149. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  150. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  151. package/dist/feature-libraries/flex-tree/lazyField.d.ts +7 -8
  152. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  153. package/dist/feature-libraries/flex-tree/lazyField.js +8 -39
  154. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  155. package/dist/feature-libraries/flex-tree/observer.d.ts +17 -0
  156. package/dist/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  157. package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
  158. package/dist/feature-libraries/forest-summary/codec.d.ts +5 -12
  159. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  160. package/dist/feature-libraries/forest-summary/codec.js +33 -33
  161. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  162. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -2
  163. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  164. package/dist/feature-libraries/forest-summary/forestSummarizer.js +6 -7
  165. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  166. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +6 -4
  167. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  168. package/dist/feature-libraries/forest-summary/formatCommon.js +13 -11
  169. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  170. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +19 -14
  171. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  172. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +31 -48
  173. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  174. package/dist/feature-libraries/forest-summary/index.d.ts +1 -1
  175. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  176. package/dist/feature-libraries/forest-summary/index.js +2 -2
  177. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  178. package/dist/feature-libraries/index.d.ts +6 -6
  179. package/dist/feature-libraries/index.d.ts.map +1 -1
  180. package/dist/feature-libraries/index.js +6 -11
  181. package/dist/feature-libraries/index.js.map +1 -1
  182. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -3
  183. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  184. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  185. package/dist/feature-libraries/indexing/index.d.ts +1 -1
  186. package/dist/feature-libraries/indexing/index.d.ts.map +1 -1
  187. package/dist/feature-libraries/indexing/index.js.map +1 -1
  188. package/dist/feature-libraries/indexing/types.d.ts +15 -13
  189. package/dist/feature-libraries/indexing/types.d.ts.map +1 -1
  190. package/dist/feature-libraries/indexing/types.js.map +1 -1
  191. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  192. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  193. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  194. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +24 -100
  195. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  196. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +12 -8
  197. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  198. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +1 -0
  199. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
  200. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -6
  201. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  202. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +51 -85
  203. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  204. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  205. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  206. package/dist/feature-libraries/modular-schema/genericFieldKind.js +9 -4
  207. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  208. package/dist/feature-libraries/modular-schema/index.d.ts +3 -3
  209. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  210. package/dist/feature-libraries/modular-schema/index.js +3 -2
  211. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  212. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +22 -18
  213. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  214. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +158 -276
  215. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  216. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  217. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  218. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  219. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +0 -1
  220. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  221. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +0 -8
  222. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  223. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +22 -56
  224. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  225. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +468 -1392
  226. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  227. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  228. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  229. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +2 -1
  230. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  231. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +3 -3
  232. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  233. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +10 -49
  234. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  235. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +3 -3
  236. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  237. package/dist/feature-libraries/optional-field/optionalField.d.ts +32 -13
  238. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  239. package/dist/feature-libraries/optional-field/optionalField.js +446 -257
  240. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  241. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +31 -31
  242. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  243. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  244. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  245. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  246. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +28 -57
  247. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  248. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  249. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  250. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  251. package/dist/feature-libraries/optional-field/requiredField.d.ts +2 -3
  252. package/dist/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
  253. package/dist/feature-libraries/optional-field/requiredField.js +1 -6
  254. package/dist/feature-libraries/optional-field/requiredField.js.map +1 -1
  255. package/dist/feature-libraries/sequence-field/compose.d.ts +7 -6
  256. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  257. package/dist/feature-libraries/sequence-field/compose.js +259 -81
  258. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  259. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +10 -14
  260. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  261. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  262. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  263. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  264. package/dist/feature-libraries/sequence-field/invert.js +167 -65
  265. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  266. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  267. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  268. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  269. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +56 -4
  270. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  271. package/dist/feature-libraries/sequence-field/moveEffectTable.js +90 -7
  272. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  273. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  274. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  275. package/dist/feature-libraries/sequence-field/rebase.js +116 -109
  276. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  277. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +9 -0
  278. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -0
  279. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +50 -0
  280. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -0
  281. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  282. package/dist/feature-libraries/sequence-field/replaceRevisions.js +32 -19
  283. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  284. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  285. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +2 -1
  286. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  287. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -22
  288. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  289. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +187 -388
  290. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  291. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  292. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +62 -20
  293. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  294. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  295. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  296. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +13 -13
  297. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  298. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +2 -3
  299. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  300. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +111 -16
  301. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  302. package/dist/feature-libraries/sequence-field/types.d.ts +74 -37
  303. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  304. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  305. package/dist/feature-libraries/sequence-field/utils.d.ts +25 -20
  306. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  307. package/dist/feature-libraries/sequence-field/utils.js +320 -159
  308. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  309. package/dist/index.d.ts +9 -3
  310. package/dist/index.d.ts.map +1 -1
  311. package/dist/index.js +4 -2
  312. package/dist/index.js.map +1 -1
  313. package/dist/packageVersion.d.ts +1 -1
  314. package/dist/packageVersion.d.ts.map +1 -1
  315. package/dist/packageVersion.js +1 -1
  316. package/dist/packageVersion.js.map +1 -1
  317. package/dist/shared-tree/independentView.d.ts.map +1 -1
  318. package/dist/shared-tree/independentView.js +3 -3
  319. package/dist/shared-tree/independentView.js.map +1 -1
  320. package/dist/shared-tree/index.d.ts +1 -1
  321. package/dist/shared-tree/index.d.ts.map +1 -1
  322. package/dist/shared-tree/index.js.map +1 -1
  323. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  324. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  325. package/dist/shared-tree/schematizeTree.js +1 -2
  326. package/dist/shared-tree/schematizeTree.js.map +1 -1
  327. package/dist/shared-tree/schematizingTreeView.d.ts +10 -1
  328. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  329. package/dist/shared-tree/schematizingTreeView.js +70 -28
  330. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  331. package/dist/shared-tree/sharedTree.d.ts +3 -9
  332. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  333. package/dist/shared-tree/sharedTree.js +8 -11
  334. package/dist/shared-tree/sharedTree.js.map +1 -1
  335. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +0 -1
  336. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  337. package/dist/shared-tree/sharedTreeChangeCodecs.js +0 -8
  338. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  339. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  340. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  341. package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
  342. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  343. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +6 -16
  344. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  345. package/dist/shared-tree/sharedTreeEditBuilder.js +7 -14
  346. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  347. package/dist/shared-tree/tree.js +1 -1
  348. package/dist/shared-tree/tree.js.map +1 -1
  349. package/dist/shared-tree/treeAlpha.d.ts +8 -1
  350. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  351. package/dist/shared-tree/treeAlpha.js +48 -8
  352. package/dist/shared-tree/treeAlpha.js.map +1 -1
  353. package/dist/shared-tree/treeCheckout.d.ts +46 -16
  354. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  355. package/dist/shared-tree/treeCheckout.js +131 -74
  356. package/dist/shared-tree/treeCheckout.js.map +1 -1
  357. package/dist/shared-tree/unhydratedTreeContext.d.ts +20 -0
  358. package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -0
  359. package/dist/shared-tree/unhydratedTreeContext.js +56 -0
  360. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -0
  361. package/dist/shared-tree-core/branch.d.ts +2 -3
  362. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  363. package/dist/shared-tree-core/branch.js +3 -4
  364. package/dist/shared-tree-core/branch.js.map +1 -1
  365. package/dist/shared-tree-core/editManager.d.ts +2 -2
  366. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  367. package/dist/shared-tree-core/editManager.js +9 -9
  368. package/dist/shared-tree-core/editManager.js.map +1 -1
  369. package/dist/shared-tree-core/editManagerCodecs.d.ts +0 -4
  370. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  371. package/dist/shared-tree-core/editManagerCodecs.js +2 -10
  372. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  373. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +0 -1
  374. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  375. package/dist/shared-tree-core/editManagerFormatCommons.js +0 -6
  376. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  377. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  378. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  379. package/dist/shared-tree-core/editManagerFormatV1toV4.js +0 -1
  380. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  381. package/dist/shared-tree-core/index.d.ts +2 -2
  382. package/dist/shared-tree-core/index.d.ts.map +1 -1
  383. package/dist/shared-tree-core/index.js +1 -3
  384. package/dist/shared-tree-core/index.js.map +1 -1
  385. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  386. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  387. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  388. package/dist/shared-tree-core/messageCodecs.d.ts +0 -4
  389. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  390. package/dist/shared-tree-core/messageCodecs.js +2 -10
  391. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  392. package/dist/shared-tree-core/messageFormat.d.ts +0 -1
  393. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  394. package/dist/shared-tree-core/messageFormat.js +0 -6
  395. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  396. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  397. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  398. package/dist/shared-tree-core/messageFormatV1ToV4.js +0 -1
  399. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  400. package/dist/shared-tree-core/sharedTreeCore.d.ts +0 -1
  401. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  402. package/dist/shared-tree-core/sharedTreeCore.js +1 -1
  403. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  404. package/dist/shared-tree-core/transaction.d.ts +15 -27
  405. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  406. package/dist/shared-tree-core/transaction.js +7 -11
  407. package/dist/shared-tree-core/transaction.js.map +1 -1
  408. package/dist/simple-tree/api/configuration.d.ts +4 -0
  409. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  410. package/dist/simple-tree/api/configuration.js.map +1 -1
  411. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +43 -0
  412. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  413. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  414. package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
  415. package/dist/simple-tree/api/identifierIndex.d.ts.map +1 -1
  416. package/dist/simple-tree/api/identifierIndex.js +1 -1
  417. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  418. package/dist/simple-tree/api/index.d.ts +6 -5
  419. package/dist/simple-tree/api/index.d.ts.map +1 -1
  420. package/dist/simple-tree/api/index.js +2 -2
  421. package/dist/simple-tree/api/index.js.map +1 -1
  422. package/dist/simple-tree/api/schemaFactory.d.ts +3 -2
  423. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  424. package/dist/simple-tree/api/schemaFactory.js +3 -2
  425. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  426. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +125 -28
  427. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  428. package/dist/simple-tree/api/schemaFactoryAlpha.js +72 -7
  429. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  430. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  431. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  432. package/dist/simple-tree/api/schemaStatics.d.ts +10 -11
  433. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  434. package/dist/simple-tree/api/schemaStatics.js +13 -7
  435. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  436. package/dist/simple-tree/api/simpleTreeIndex.d.ts +15 -13
  437. package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  438. package/dist/simple-tree/api/simpleTreeIndex.js +4 -4
  439. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  440. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +4 -4
  441. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  442. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  443. package/dist/simple-tree/api/transactionTypes.d.ts +22 -25
  444. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  445. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  446. package/dist/simple-tree/api/tree.d.ts +69 -132
  447. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  448. package/dist/simple-tree/api/tree.js.map +1 -1
  449. package/dist/simple-tree/api/typesUnsafe.d.ts +23 -2
  450. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  451. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  452. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +12 -16
  453. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  454. package/dist/simple-tree/core/unhydratedFlexTree.js +8 -59
  455. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  456. package/dist/simple-tree/fieldSchema.d.ts +7 -6
  457. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  458. package/dist/simple-tree/fieldSchema.js +3 -4
  459. package/dist/simple-tree/fieldSchema.js.map +1 -1
  460. package/dist/simple-tree/index.d.ts +4 -4
  461. package/dist/simple-tree/index.d.ts.map +1 -1
  462. package/dist/simple-tree/index.js +3 -3
  463. package/dist/simple-tree/index.js.map +1 -1
  464. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  465. package/dist/simple-tree/node-kinds/array/arrayNode.js +3 -5
  466. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  467. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  468. package/dist/simple-tree/node-kinds/common.js +1 -1
  469. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  470. package/dist/simple-tree/node-kinds/index.d.ts +1 -1
  471. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  472. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  473. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
  474. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  475. package/dist/simple-tree/node-kinds/object/index.d.ts +2 -2
  476. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  477. package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
  478. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +43 -7
  479. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  480. package/dist/simple-tree/node-kinds/object/objectNode.js +19 -19
  481. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  482. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +26 -2
  483. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  484. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  485. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  486. package/dist/simple-tree/node-kinds/record/recordNode.js +2 -4
  487. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  488. package/dist/simple-tree/prepareForInsertion.d.ts +47 -54
  489. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  490. package/dist/simple-tree/prepareForInsertion.js +125 -183
  491. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  492. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +3 -8
  493. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  494. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +13 -27
  495. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  496. package/dist/text/textDomain.d.ts +27 -9
  497. package/dist/text/textDomain.d.ts.map +1 -1
  498. package/dist/text/textDomain.js +43 -7
  499. package/dist/text/textDomain.js.map +1 -1
  500. package/dist/text/textDomainFormatted.d.ts +16 -12
  501. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  502. package/dist/text/textDomainFormatted.js +97 -25
  503. package/dist/text/textDomainFormatted.js.map +1 -1
  504. package/dist/treeFactory.d.ts.map +1 -1
  505. package/dist/treeFactory.js +2 -12
  506. package/dist/treeFactory.js.map +1 -1
  507. package/dist/util/index.d.ts +1 -1
  508. package/dist/util/index.d.ts.map +1 -1
  509. package/dist/util/index.js +1 -2
  510. package/dist/util/index.js.map +1 -1
  511. package/dist/util/rangeMap.d.ts +10 -14
  512. package/dist/util/rangeMap.d.ts.map +1 -1
  513. package/dist/util/rangeMap.js +22 -62
  514. package/dist/util/rangeMap.js.map +1 -1
  515. package/dist/util/typeCheck.d.ts.map +1 -1
  516. package/dist/util/typeCheck.js.map +1 -1
  517. package/dist/util/typeUtils.d.ts.map +1 -1
  518. package/dist/util/typeUtils.js.map +1 -1
  519. package/docs/main/sequence-field/move-composition.md +46 -0
  520. package/eslint.config.mts +10 -2
  521. package/internal.d.ts +2 -2
  522. package/legacy.d.ts +4 -3
  523. package/lib/codec/codec.d.ts +2 -0
  524. package/lib/codec/codec.d.ts.map +1 -1
  525. package/lib/codec/codec.js +4 -3
  526. package/lib/codec/codec.js.map +1 -1
  527. package/lib/codec/index.d.ts +1 -1
  528. package/lib/codec/index.d.ts.map +1 -1
  529. package/lib/codec/index.js +1 -1
  530. package/lib/codec/index.js.map +1 -1
  531. package/lib/codec/versioned/codec.d.ts +13 -1
  532. package/lib/codec/versioned/codec.d.ts.map +1 -1
  533. package/lib/codec/versioned/codec.js +18 -3
  534. package/lib/codec/versioned/codec.js.map +1 -1
  535. package/lib/codec/versioned/format.d.ts +22 -1
  536. package/lib/codec/versioned/format.d.ts.map +1 -1
  537. package/lib/codec/versioned/format.js +15 -2
  538. package/lib/codec/versioned/format.js.map +1 -1
  539. package/lib/codec/versioned/index.d.ts +1 -1
  540. package/lib/codec/versioned/index.d.ts.map +1 -1
  541. package/lib/codec/versioned/index.js +1 -1
  542. package/lib/codec/versioned/index.js.map +1 -1
  543. package/lib/core/change-family/changeFamily.d.ts +1 -4
  544. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  545. package/lib/core/change-family/changeFamily.js.map +1 -1
  546. package/lib/core/change-family/index.d.ts +1 -1
  547. package/lib/core/change-family/index.d.ts.map +1 -1
  548. package/lib/core/change-family/index.js.map +1 -1
  549. package/lib/core/index.d.ts +3 -4
  550. package/lib/core/index.d.ts.map +1 -1
  551. package/lib/core/index.js +2 -3
  552. package/lib/core/index.js.map +1 -1
  553. package/lib/core/rebase/changeRebaser.d.ts +1 -6
  554. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  555. package/lib/core/rebase/changeRebaser.js.map +1 -1
  556. package/lib/core/rebase/index.d.ts +1 -1
  557. package/lib/core/rebase/index.d.ts.map +1 -1
  558. package/lib/core/rebase/index.js +1 -1
  559. package/lib/core/rebase/index.js.map +1 -1
  560. package/lib/core/rebase/types.d.ts +78 -1
  561. package/lib/core/rebase/types.d.ts.map +1 -1
  562. package/lib/core/rebase/types.js +0 -3
  563. package/lib/core/rebase/types.js.map +1 -1
  564. package/lib/core/rebase/utils.d.ts.map +1 -1
  565. package/lib/core/rebase/utils.js +7 -25
  566. package/lib/core/rebase/utils.js.map +1 -1
  567. package/lib/core/tree/delta.d.ts +0 -5
  568. package/lib/core/tree/delta.d.ts.map +1 -1
  569. package/lib/core/tree/delta.js.map +1 -1
  570. package/lib/core/tree/detachedFieldIndex.d.ts +1 -13
  571. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  572. package/lib/core/tree/detachedFieldIndex.js +2 -15
  573. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  574. package/lib/core/tree/detachedFieldIndexTypes.d.ts +0 -4
  575. package/lib/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  576. package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
  577. package/lib/core/tree/index.d.ts +2 -2
  578. package/lib/core/tree/index.d.ts.map +1 -1
  579. package/lib/core/tree/index.js +1 -1
  580. package/lib/core/tree/index.js.map +1 -1
  581. package/lib/core/tree/pathTree.d.ts +3 -11
  582. package/lib/core/tree/pathTree.d.ts.map +1 -1
  583. package/lib/core/tree/pathTree.js +1 -12
  584. package/lib/core/tree/pathTree.js.map +1 -1
  585. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  586. package/lib/core/tree/visitDelta.js +13 -17
  587. package/lib/core/tree/visitDelta.js.map +1 -1
  588. package/lib/entrypoints/alpha.d.ts +6 -0
  589. package/lib/entrypoints/alpha.d.ts.map +1 -0
  590. package/lib/entrypoints/alpha.js +12 -0
  591. package/lib/entrypoints/alpha.js.map +1 -0
  592. package/lib/entrypoints/beta.d.ts +6 -0
  593. package/lib/entrypoints/beta.d.ts.map +1 -0
  594. package/lib/entrypoints/beta.js +12 -0
  595. package/lib/entrypoints/beta.js.map +1 -0
  596. package/{src/core/schema-view/index.ts → lib/entrypoints/internal.d.ts} +2 -6
  597. package/lib/entrypoints/internal.d.ts.map +1 -0
  598. package/lib/entrypoints/internal.js +12 -0
  599. package/lib/entrypoints/internal.js.map +1 -0
  600. package/lib/entrypoints/legacy.d.ts +6 -0
  601. package/lib/entrypoints/legacy.d.ts.map +1 -0
  602. package/lib/entrypoints/legacy.js +15 -0
  603. package/lib/entrypoints/legacy.js.map +1 -0
  604. package/lib/entrypoints/public.d.ts +6 -0
  605. package/lib/entrypoints/public.d.ts.map +1 -0
  606. package/lib/entrypoints/public.js +10 -0
  607. package/lib/entrypoints/public.js.map +1 -0
  608. package/lib/feature-libraries/changeAtomIdBTree.d.ts +2 -3
  609. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  610. package/lib/feature-libraries/changeAtomIdBTree.js +3 -15
  611. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
  612. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -7
  613. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  614. package/lib/feature-libraries/chunked-forest/codec/codecs.js +25 -45
  615. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  616. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  617. package/lib/feature-libraries/chunked-forest/codec/format.js +11 -0
  618. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  619. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +3 -2
  620. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  621. package/lib/feature-libraries/chunked-forest/codec/index.js +2 -2
  622. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  623. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  624. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  625. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  626. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  627. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +44 -92
  628. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  629. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +69 -217
  630. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  631. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  632. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +2 -12
  633. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  634. package/lib/feature-libraries/default-schema/index.d.ts +1 -2
  635. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  636. package/lib/feature-libraries/default-schema/index.js +1 -2
  637. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  638. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +6 -7
  639. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  640. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +0 -15
  641. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  642. package/lib/feature-libraries/deltaUtils.d.ts +0 -1
  643. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  644. package/lib/feature-libraries/deltaUtils.js +1 -5
  645. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  646. package/lib/feature-libraries/flex-tree/context.d.ts +0 -9
  647. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  648. package/lib/feature-libraries/flex-tree/context.js +0 -6
  649. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  650. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  651. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  652. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  653. package/lib/feature-libraries/flex-tree/lazyField.d.ts +7 -8
  654. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  655. package/lib/feature-libraries/flex-tree/lazyField.js +9 -40
  656. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  657. package/lib/feature-libraries/flex-tree/observer.d.ts +17 -0
  658. package/lib/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  659. package/lib/feature-libraries/flex-tree/observer.js.map +1 -1
  660. package/lib/feature-libraries/forest-summary/codec.d.ts +5 -12
  661. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  662. package/lib/feature-libraries/forest-summary/codec.js +35 -32
  663. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  664. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -2
  665. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  666. package/lib/feature-libraries/forest-summary/forestSummarizer.js +7 -8
  667. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  668. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +6 -4
  669. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  670. package/lib/feature-libraries/forest-summary/formatCommon.js +7 -4
  671. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  672. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +19 -14
  673. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  674. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +30 -47
  675. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  676. package/lib/feature-libraries/forest-summary/index.d.ts +1 -1
  677. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  678. package/lib/feature-libraries/forest-summary/index.js +1 -1
  679. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  680. package/lib/feature-libraries/index.d.ts +6 -6
  681. package/lib/feature-libraries/index.d.ts.map +1 -1
  682. package/lib/feature-libraries/index.js +5 -5
  683. package/lib/feature-libraries/index.js.map +1 -1
  684. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -3
  685. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  686. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  687. package/lib/feature-libraries/indexing/index.d.ts +1 -1
  688. package/lib/feature-libraries/indexing/index.d.ts.map +1 -1
  689. package/lib/feature-libraries/indexing/index.js.map +1 -1
  690. package/lib/feature-libraries/indexing/types.d.ts +15 -13
  691. package/lib/feature-libraries/indexing/types.d.ts.map +1 -1
  692. package/lib/feature-libraries/indexing/types.js.map +1 -1
  693. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  694. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  695. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  696. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +24 -100
  697. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  698. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +10 -7
  699. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  700. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +1 -0
  701. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
  702. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -6
  703. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  704. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +51 -85
  705. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  706. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  707. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  708. package/lib/feature-libraries/modular-schema/genericFieldKind.js +9 -4
  709. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  710. package/lib/feature-libraries/modular-schema/index.d.ts +3 -3
  711. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  712. package/lib/feature-libraries/modular-schema/index.js +1 -1
  713. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  714. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +22 -18
  715. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  716. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +144 -267
  717. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  718. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  719. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  720. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  721. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +0 -1
  722. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  723. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +0 -8
  724. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  725. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +22 -56
  726. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  727. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +474 -1389
  728. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  729. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  730. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  731. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +2 -1
  732. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  733. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +1 -1
  734. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  735. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +10 -49
  736. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  737. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +1 -1
  738. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  739. package/lib/feature-libraries/optional-field/optionalField.d.ts +32 -13
  740. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  741. package/lib/feature-libraries/optional-field/optionalField.js +442 -254
  742. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  743. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +31 -31
  744. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  745. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  746. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  747. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  748. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +26 -55
  749. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  750. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  751. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  752. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  753. package/lib/feature-libraries/optional-field/requiredField.d.ts +2 -3
  754. package/lib/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
  755. package/lib/feature-libraries/optional-field/requiredField.js +1 -5
  756. package/lib/feature-libraries/optional-field/requiredField.js.map +1 -1
  757. package/lib/feature-libraries/sequence-field/compose.d.ts +7 -6
  758. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  759. package/lib/feature-libraries/sequence-field/compose.js +261 -83
  760. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  761. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +10 -14
  762. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  763. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  764. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  765. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  766. package/lib/feature-libraries/sequence-field/invert.js +169 -67
  767. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  768. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  769. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  770. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  771. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +56 -4
  772. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  773. package/lib/feature-libraries/sequence-field/moveEffectTable.js +84 -6
  774. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  775. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  776. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  777. package/lib/feature-libraries/sequence-field/rebase.js +118 -111
  778. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  779. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +9 -0
  780. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -0
  781. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +46 -0
  782. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -0
  783. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  784. package/lib/feature-libraries/sequence-field/replaceRevisions.js +32 -19
  785. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  786. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  787. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +3 -2
  788. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  789. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -22
  790. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  791. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +182 -379
  792. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  793. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  794. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +63 -21
  795. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  796. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  797. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  798. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +13 -13
  799. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  800. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +2 -3
  801. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  802. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +111 -16
  803. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  804. package/lib/feature-libraries/sequence-field/types.d.ts +74 -37
  805. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  806. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  807. package/lib/feature-libraries/sequence-field/utils.d.ts +25 -20
  808. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  809. package/lib/feature-libraries/sequence-field/utils.js +313 -155
  810. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  811. package/lib/index.d.ts +9 -3
  812. package/lib/index.d.ts.map +1 -1
  813. package/lib/index.js +9 -1
  814. package/lib/index.js.map +1 -1
  815. package/lib/packageVersion.d.ts +1 -1
  816. package/lib/packageVersion.d.ts.map +1 -1
  817. package/lib/packageVersion.js +1 -1
  818. package/lib/packageVersion.js.map +1 -1
  819. package/lib/shared-tree/independentView.d.ts.map +1 -1
  820. package/lib/shared-tree/independentView.js +4 -4
  821. package/lib/shared-tree/independentView.js.map +1 -1
  822. package/lib/shared-tree/index.d.ts +1 -1
  823. package/lib/shared-tree/index.d.ts.map +1 -1
  824. package/lib/shared-tree/index.js.map +1 -1
  825. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  826. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  827. package/lib/shared-tree/schematizeTree.js +2 -3
  828. package/lib/shared-tree/schematizeTree.js.map +1 -1
  829. package/lib/shared-tree/schematizingTreeView.d.ts +10 -1
  830. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  831. package/lib/shared-tree/schematizingTreeView.js +71 -30
  832. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  833. package/lib/shared-tree/sharedTree.d.ts +3 -9
  834. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  835. package/lib/shared-tree/sharedTree.js +9 -12
  836. package/lib/shared-tree/sharedTree.js.map +1 -1
  837. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +0 -1
  838. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  839. package/lib/shared-tree/sharedTreeChangeCodecs.js +0 -8
  840. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  841. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  842. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  843. package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
  844. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  845. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +6 -16
  846. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  847. package/lib/shared-tree/sharedTreeEditBuilder.js +6 -12
  848. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  849. package/lib/shared-tree/tree.js +1 -1
  850. package/lib/shared-tree/tree.js.map +1 -1
  851. package/lib/shared-tree/treeAlpha.d.ts +8 -1
  852. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  853. package/lib/shared-tree/treeAlpha.js +49 -9
  854. package/lib/shared-tree/treeAlpha.js.map +1 -1
  855. package/lib/shared-tree/treeCheckout.d.ts +46 -16
  856. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  857. package/lib/shared-tree/treeCheckout.js +134 -77
  858. package/lib/shared-tree/treeCheckout.js.map +1 -1
  859. package/lib/shared-tree/unhydratedTreeContext.d.ts +20 -0
  860. package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -0
  861. package/lib/shared-tree/unhydratedTreeContext.js +52 -0
  862. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -0
  863. package/lib/shared-tree-core/branch.d.ts +2 -3
  864. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  865. package/lib/shared-tree-core/branch.js +3 -4
  866. package/lib/shared-tree-core/branch.js.map +1 -1
  867. package/lib/shared-tree-core/editManager.d.ts +2 -2
  868. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  869. package/lib/shared-tree-core/editManager.js +9 -9
  870. package/lib/shared-tree-core/editManager.js.map +1 -1
  871. package/lib/shared-tree-core/editManagerCodecs.d.ts +0 -4
  872. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  873. package/lib/shared-tree-core/editManagerCodecs.js +1 -8
  874. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  875. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +0 -1
  876. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  877. package/lib/shared-tree-core/editManagerFormatCommons.js +0 -6
  878. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  879. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  880. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  881. package/lib/shared-tree-core/editManagerFormatV1toV4.js +0 -1
  882. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  883. package/lib/shared-tree-core/index.d.ts +2 -2
  884. package/lib/shared-tree-core/index.d.ts.map +1 -1
  885. package/lib/shared-tree-core/index.js +2 -2
  886. package/lib/shared-tree-core/index.js.map +1 -1
  887. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  888. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  889. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  890. package/lib/shared-tree-core/messageCodecs.d.ts +0 -4
  891. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  892. package/lib/shared-tree-core/messageCodecs.js +1 -8
  893. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  894. package/lib/shared-tree-core/messageFormat.d.ts +0 -1
  895. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  896. package/lib/shared-tree-core/messageFormat.js +0 -6
  897. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  898. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  899. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  900. package/lib/shared-tree-core/messageFormatV1ToV4.js +0 -1
  901. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  902. package/lib/shared-tree-core/sharedTreeCore.d.ts +0 -1
  903. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  904. package/lib/shared-tree-core/sharedTreeCore.js +1 -1
  905. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  906. package/lib/shared-tree-core/transaction.d.ts +15 -27
  907. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  908. package/lib/shared-tree-core/transaction.js +7 -11
  909. package/lib/shared-tree-core/transaction.js.map +1 -1
  910. package/lib/simple-tree/api/configuration.d.ts +4 -0
  911. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  912. package/lib/simple-tree/api/configuration.js.map +1 -1
  913. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +43 -0
  914. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  915. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  916. package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
  917. package/lib/simple-tree/api/identifierIndex.d.ts.map +1 -1
  918. package/lib/simple-tree/api/identifierIndex.js +2 -2
  919. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  920. package/lib/simple-tree/api/index.d.ts +6 -5
  921. package/lib/simple-tree/api/index.d.ts.map +1 -1
  922. package/lib/simple-tree/api/index.js +2 -2
  923. package/lib/simple-tree/api/index.js.map +1 -1
  924. package/lib/simple-tree/api/schemaFactory.d.ts +3 -2
  925. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  926. package/lib/simple-tree/api/schemaFactory.js +3 -2
  927. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  928. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +125 -28
  929. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  930. package/lib/simple-tree/api/schemaFactoryAlpha.js +66 -1
  931. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  932. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  933. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  934. package/lib/simple-tree/api/schemaStatics.d.ts +10 -11
  935. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  936. package/lib/simple-tree/api/schemaStatics.js +14 -8
  937. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  938. package/lib/simple-tree/api/simpleTreeIndex.d.ts +15 -13
  939. package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  940. package/lib/simple-tree/api/simpleTreeIndex.js +2 -2
  941. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  942. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +4 -4
  943. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  944. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  945. package/lib/simple-tree/api/transactionTypes.d.ts +22 -25
  946. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  947. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  948. package/lib/simple-tree/api/tree.d.ts +69 -132
  949. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  950. package/lib/simple-tree/api/tree.js.map +1 -1
  951. package/lib/simple-tree/api/typesUnsafe.d.ts +23 -2
  952. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  953. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  954. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +12 -16
  955. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  956. package/lib/simple-tree/core/unhydratedFlexTree.js +8 -58
  957. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  958. package/lib/simple-tree/fieldSchema.d.ts +7 -6
  959. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  960. package/lib/simple-tree/fieldSchema.js +3 -4
  961. package/lib/simple-tree/fieldSchema.js.map +1 -1
  962. package/lib/simple-tree/index.d.ts +4 -4
  963. package/lib/simple-tree/index.d.ts.map +1 -1
  964. package/lib/simple-tree/index.js +2 -2
  965. package/lib/simple-tree/index.js.map +1 -1
  966. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  967. package/lib/simple-tree/node-kinds/array/arrayNode.js +4 -6
  968. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  969. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  970. package/lib/simple-tree/node-kinds/common.js +2 -2
  971. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  972. package/lib/simple-tree/node-kinds/index.d.ts +1 -1
  973. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  974. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  975. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  976. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  977. package/lib/simple-tree/node-kinds/object/index.d.ts +2 -2
  978. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  979. package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
  980. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +43 -7
  981. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  982. package/lib/simple-tree/node-kinds/object/objectNode.js +20 -20
  983. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  984. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +26 -2
  985. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  986. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  987. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  988. package/lib/simple-tree/node-kinds/record/recordNode.js +2 -4
  989. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  990. package/lib/simple-tree/prepareForInsertion.d.ts +47 -54
  991. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  992. package/lib/simple-tree/prepareForInsertion.js +125 -184
  993. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  994. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +3 -8
  995. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  996. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +10 -23
  997. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  998. package/lib/text/textDomain.d.ts +27 -9
  999. package/lib/text/textDomain.d.ts.map +1 -1
  1000. package/lib/text/textDomain.js +45 -9
  1001. package/lib/text/textDomain.js.map +1 -1
  1002. package/lib/text/textDomainFormatted.d.ts +16 -12
  1003. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  1004. package/lib/text/textDomainFormatted.js +80 -8
  1005. package/lib/text/textDomainFormatted.js.map +1 -1
  1006. package/lib/treeFactory.d.ts.map +1 -1
  1007. package/lib/treeFactory.js +3 -13
  1008. package/lib/treeFactory.js.map +1 -1
  1009. package/lib/util/index.d.ts +1 -1
  1010. package/lib/util/index.d.ts.map +1 -1
  1011. package/lib/util/index.js +1 -1
  1012. package/lib/util/index.js.map +1 -1
  1013. package/lib/util/rangeMap.d.ts +10 -14
  1014. package/lib/util/rangeMap.d.ts.map +1 -1
  1015. package/lib/util/rangeMap.js +22 -61
  1016. package/lib/util/rangeMap.js.map +1 -1
  1017. package/lib/util/typeCheck.d.ts.map +1 -1
  1018. package/lib/util/typeCheck.js.map +1 -1
  1019. package/lib/util/typeUtils.d.ts.map +1 -1
  1020. package/lib/util/typeUtils.js.map +1 -1
  1021. package/package.json +49 -49
  1022. package/scripts/generate-entrypoint-sources.sh +29 -0
  1023. package/src/codec/codec.ts +5 -4
  1024. package/src/codec/index.ts +1 -0
  1025. package/src/codec/versioned/codec.ts +32 -6
  1026. package/src/codec/versioned/format.ts +17 -2
  1027. package/src/codec/versioned/index.ts +1 -1
  1028. package/src/core/change-family/changeFamily.ts +0 -5
  1029. package/src/core/change-family/index.ts +0 -1
  1030. package/src/core/index.ts +3 -10
  1031. package/src/core/rebase/changeRebaser.ts +1 -6
  1032. package/src/core/rebase/index.ts +2 -1
  1033. package/src/core/rebase/types.ts +80 -4
  1034. package/src/core/rebase/utils.ts +7 -31
  1035. package/src/core/tree/delta.ts +0 -6
  1036. package/src/core/tree/detachedFieldIndex.ts +1 -29
  1037. package/src/core/tree/detachedFieldIndexTypes.ts +0 -5
  1038. package/src/core/tree/index.ts +12 -13
  1039. package/src/core/tree/pathTree.ts +4 -16
  1040. package/src/core/tree/visitDelta.ts +11 -31
  1041. package/{dist/alpha.d.ts → src/entrypoints/alpha.ts} +22 -11
  1042. package/{lib/beta.d.ts → src/entrypoints/beta.ts} +6 -6
  1043. package/src/entrypoints/internal.ts +13 -0
  1044. package/{lib/legacy.d.ts → src/entrypoints/legacy.ts} +6 -6
  1045. package/{lib/public.d.ts → src/entrypoints/public.ts} +2 -5
  1046. package/src/feature-libraries/changeAtomIdBTree.ts +3 -28
  1047. package/src/feature-libraries/chunked-forest/codec/codecs.ts +59 -78
  1048. package/src/feature-libraries/chunked-forest/codec/format.ts +11 -0
  1049. package/src/feature-libraries/chunked-forest/codec/index.ts +3 -3
  1050. package/src/feature-libraries/chunked-forest/index.ts +2 -3
  1051. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +127 -369
  1052. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +4 -13
  1053. package/src/feature-libraries/default-schema/index.ts +5 -16
  1054. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +9 -35
  1055. package/src/feature-libraries/deltaUtils.ts +1 -6
  1056. package/src/feature-libraries/flex-tree/context.ts +0 -17
  1057. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +8 -7
  1058. package/src/feature-libraries/flex-tree/lazyField.ts +24 -65
  1059. package/src/feature-libraries/flex-tree/observer.ts +17 -0
  1060. package/src/feature-libraries/forest-summary/codec.ts +46 -56
  1061. package/src/feature-libraries/forest-summary/forestSummarizer.ts +5 -14
  1062. package/src/feature-libraries/forest-summary/formatCommon.ts +14 -19
  1063. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +44 -74
  1064. package/src/feature-libraries/forest-summary/index.ts +1 -1
  1065. package/src/feature-libraries/index.ts +11 -26
  1066. package/src/feature-libraries/indexing/anchorTreeIndex.ts +3 -5
  1067. package/src/feature-libraries/indexing/index.ts +1 -1
  1068. package/src/feature-libraries/indexing/types.ts +15 -17
  1069. package/src/feature-libraries/mitigatedChangeFamily.ts +1 -3
  1070. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +47 -149
  1071. package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +16 -8
  1072. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +58 -113
  1073. package/src/feature-libraries/modular-schema/genericFieldKind.ts +18 -7
  1074. package/src/feature-libraries/modular-schema/index.ts +16 -16
  1075. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +329 -604
  1076. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +0 -1
  1077. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +0 -14
  1078. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +754 -2695
  1079. package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +0 -1
  1080. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +1 -1
  1081. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +10 -62
  1082. package/src/feature-libraries/optional-field/optionalField.ts +568 -359
  1083. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +35 -31
  1084. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +35 -89
  1085. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
  1086. package/src/feature-libraries/optional-field/requiredField.ts +2 -15
  1087. package/src/feature-libraries/sequence-field/compose.ts +522 -137
  1088. package/src/feature-libraries/sequence-field/helperTypes.ts +19 -34
  1089. package/src/feature-libraries/sequence-field/invert.ts +228 -102
  1090. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1091. package/src/feature-libraries/sequence-field/moveEffectTable.ts +195 -8
  1092. package/src/feature-libraries/sequence-field/rebase.ts +207 -171
  1093. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +57 -0
  1094. package/src/feature-libraries/sequence-field/replaceRevisions.ts +52 -26
  1095. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +3 -8
  1096. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +229 -677
  1097. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +70 -56
  1098. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +30 -28
  1099. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +131 -21
  1100. package/src/feature-libraries/sequence-field/types.ts +79 -40
  1101. package/src/feature-libraries/sequence-field/utils.ts +370 -211
  1102. package/src/index.ts +25 -3
  1103. package/src/packageVersion.ts +1 -1
  1104. package/src/shared-tree/independentView.ts +9 -15
  1105. package/src/shared-tree/index.ts +2 -3
  1106. package/src/shared-tree/schematizeTree.ts +8 -21
  1107. package/src/shared-tree/schematizingTreeView.ts +111 -48
  1108. package/src/shared-tree/sharedTree.ts +23 -40
  1109. package/src/shared-tree/sharedTreeChangeCodecs.ts +0 -8
  1110. package/src/shared-tree/sharedTreeChangeFamily.ts +4 -7
  1111. package/src/shared-tree/sharedTreeEditBuilder.ts +8 -43
  1112. package/src/shared-tree/tree.ts +1 -1
  1113. package/src/shared-tree/treeAlpha.ts +64 -11
  1114. package/src/shared-tree/treeCheckout.ts +161 -115
  1115. package/src/shared-tree/unhydratedTreeContext.ts +87 -0
  1116. package/src/shared-tree-core/branch.ts +2 -8
  1117. package/src/shared-tree-core/editManager.ts +2 -16
  1118. package/src/shared-tree-core/editManagerCodecs.ts +1 -11
  1119. package/src/shared-tree-core/editManagerFormatCommons.ts +0 -6
  1120. package/src/shared-tree-core/editManagerFormatV1toV4.ts +1 -3
  1121. package/src/shared-tree-core/index.ts +0 -2
  1122. package/src/shared-tree-core/messageCodecV1ToV4.ts +1 -2
  1123. package/src/shared-tree-core/messageCodecs.ts +1 -11
  1124. package/src/shared-tree-core/messageFormat.ts +0 -6
  1125. package/src/shared-tree-core/messageFormatV1ToV4.ts +1 -3
  1126. package/src/shared-tree-core/sharedTreeCore.ts +1 -4
  1127. package/src/shared-tree-core/transaction.ts +19 -39
  1128. package/src/simple-tree/api/configuration.ts +4 -0
  1129. package/src/simple-tree/api/eraseSchemaDetails.ts +60 -0
  1130. package/src/simple-tree/api/identifierIndex.ts +4 -4
  1131. package/src/simple-tree/api/index.ts +15 -2
  1132. package/src/simple-tree/api/schemaFactory.ts +11 -3
  1133. package/src/simple-tree/api/schemaFactoryAlpha.ts +262 -25
  1134. package/src/simple-tree/api/schemaFactoryBeta.ts +10 -1
  1135. package/src/simple-tree/api/schemaStatics.ts +79 -21
  1136. package/src/simple-tree/api/simpleTreeIndex.ts +26 -20
  1137. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +4 -4
  1138. package/src/simple-tree/api/transactionTypes.ts +24 -26
  1139. package/src/simple-tree/api/tree.ts +92 -131
  1140. package/src/simple-tree/api/typesUnsafe.ts +49 -1
  1141. package/src/simple-tree/core/unhydratedFlexTree.ts +35 -82
  1142. package/src/simple-tree/fieldSchema.ts +33 -11
  1143. package/src/simple-tree/index.ts +15 -4
  1144. package/src/simple-tree/node-kinds/array/arrayNode.ts +5 -7
  1145. package/src/simple-tree/node-kinds/common.ts +5 -2
  1146. package/src/simple-tree/node-kinds/index.ts +3 -0
  1147. package/src/simple-tree/node-kinds/map/mapNode.ts +4 -4
  1148. package/src/simple-tree/node-kinds/object/index.ts +3 -0
  1149. package/src/simple-tree/node-kinds/object/objectNode.ts +95 -37
  1150. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +33 -2
  1151. package/src/simple-tree/node-kinds/record/recordNode.ts +9 -10
  1152. package/src/simple-tree/prepareForInsertion.ts +200 -342
  1153. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +15 -35
  1154. package/src/text/textDomain.ts +91 -12
  1155. package/src/text/textDomainFormatted.ts +127 -15
  1156. package/src/treeFactory.ts +4 -16
  1157. package/src/util/index.ts +0 -3
  1158. package/src/util/rangeMap.ts +34 -78
  1159. package/src/util/typeCheck.ts +1 -0
  1160. package/src/util/typeUtils.ts +4 -7
  1161. package/dist/beta.d.ts +0 -149
  1162. package/dist/core/schema-view/index.d.ts +0 -6
  1163. package/dist/core/schema-view/index.d.ts.map +0 -1
  1164. package/dist/core/schema-view/index.js +0 -10
  1165. package/dist/core/schema-view/index.js.map +0 -1
  1166. package/dist/core/schema-view/view.d.ts +0 -31
  1167. package/dist/core/schema-view/view.d.ts.map +0 -1
  1168. package/dist/core/schema-view/view.js +0 -18
  1169. package/dist/core/schema-view/view.js.map +0 -1
  1170. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +0 -40
  1171. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +0 -1
  1172. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +0 -153
  1173. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +0 -1
  1174. package/dist/feature-libraries/forest-summary/formatV1.d.ts +0 -12
  1175. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +0 -1
  1176. package/dist/feature-libraries/forest-summary/formatV1.js +0 -10
  1177. package/dist/feature-libraries/forest-summary/formatV1.js.map +0 -1
  1178. package/dist/feature-libraries/forest-summary/formatV2.d.ts +0 -12
  1179. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +0 -1
  1180. package/dist/feature-libraries/forest-summary/formatV2.js +0 -10
  1181. package/dist/feature-libraries/forest-summary/formatV2.js.map +0 -1
  1182. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +0 -15
  1183. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +0 -1
  1184. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js +0 -296
  1185. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js.map +0 -1
  1186. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +0 -74
  1187. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +0 -1
  1188. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js +0 -35
  1189. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js.map +0 -1
  1190. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +0 -23
  1191. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +0 -1
  1192. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +0 -31
  1193. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +0 -1
  1194. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +0 -12
  1195. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +0 -1
  1196. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +0 -57
  1197. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +0 -1
  1198. package/dist/legacy.d.ts +0 -156
  1199. package/dist/public.d.ts +0 -94
  1200. package/lib/alpha.d.ts +0 -300
  1201. package/lib/core/schema-view/index.d.ts +0 -6
  1202. package/lib/core/schema-view/index.d.ts.map +0 -1
  1203. package/lib/core/schema-view/index.js.map +0 -1
  1204. package/lib/core/schema-view/view.d.ts +0 -31
  1205. package/lib/core/schema-view/view.d.ts.map +0 -1
  1206. package/lib/core/schema-view/view.js +0 -14
  1207. package/lib/core/schema-view/view.js.map +0 -1
  1208. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +0 -40
  1209. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +0 -1
  1210. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +0 -149
  1211. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +0 -1
  1212. package/lib/feature-libraries/forest-summary/formatV1.d.ts +0 -12
  1213. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +0 -1
  1214. package/lib/feature-libraries/forest-summary/formatV1.js +0 -7
  1215. package/lib/feature-libraries/forest-summary/formatV1.js.map +0 -1
  1216. package/lib/feature-libraries/forest-summary/formatV2.d.ts +0 -12
  1217. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +0 -1
  1218. package/lib/feature-libraries/forest-summary/formatV2.js +0 -7
  1219. package/lib/feature-libraries/forest-summary/formatV2.js.map +0 -1
  1220. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +0 -15
  1221. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +0 -1
  1222. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js +0 -292
  1223. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js.map +0 -1
  1224. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +0 -74
  1225. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +0 -1
  1226. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js +0 -32
  1227. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js.map +0 -1
  1228. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +0 -23
  1229. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +0 -1
  1230. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +0 -27
  1231. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +0 -1
  1232. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +0 -12
  1233. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +0 -1
  1234. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +0 -53
  1235. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +0 -1
  1236. package/src/core/schema-view/README.md +0 -9
  1237. package/src/core/schema-view/view.ts +0 -38
  1238. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +0 -231
  1239. package/src/feature-libraries/forest-summary/formatV1.ts +0 -11
  1240. package/src/feature-libraries/forest-summary/formatV2.ts +0 -11
  1241. package/src/feature-libraries/modular-schema/modularChangeCodecV3.ts +0 -649
  1242. package/src/feature-libraries/modular-schema/modularChangeFormatV3.ts +0 -67
  1243. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +0 -45
  1244. package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +0 -94
@@ -1 +1 @@
1
- {"version":3,"file":"recordNode.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/record/recordNode.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,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EACN,WAAW,GAGX,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAqC,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAElF,OAAO,EAEN,QAAQ;AACR,kDAAkD;AAClD,cAAc,EACd,gBAAgB,EAEhB,YAAY,E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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 { MapNodeStoredSchema } from \"../../../core/index.js\";\nimport {\n\tisTreeValue,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n} from \"../../../feature-libraries/index.js\";\nimport { type JsonCompatibleReadOnlyObject, brand } from \"../../../util/index.js\";\nimport type { NodeSchemaOptionsAlpha } from \"../../api/index.js\";\nimport {\n\ttype TreeNodeSchema,\n\tNodeKind,\n\t// eslint-disable-next-line import-x/no-deprecated\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\ttype UnhydratedFlexTreeNode,\n\tgetInnerNode,\n\tgetKernel,\n\ttype InternalTreeNode,\n\ttype NodeSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\tnormalizeAllowedTypes,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\tTreeNodeValid,\n\ttype MostDerivedData,\n\ttype TreeNodeSchemaInitializedData,\n\ttype TreeNodeSchemaCorePrivate,\n\tprivateDataSymbol,\n\tcreateTreeNodeSchemaPrivateData,\n\ttype FlexContent,\n\tCompatibilityLevel,\n\ttype TreeNodeSchemaPrivateData,\n\tAnnotatedAllowedTypesInternal,\n} from \"../../core/index.js\";\nimport { getTreeNodeSchemaInitializedData } from \"../../createContext.js\";\nimport { createFieldSchema, FieldKind } from \"../../fieldSchema.js\";\nimport { tryGetTreeNodeForField } from \"../../getTreeNodeForField.js\";\nimport { prepareForInsertion } from \"../../prepareForInsertion.js\";\nimport type { SchemaType, SimpleAllowedTypeAttributes } from \"../../simpleSchema.js\";\nimport {\n\tunhydratedFlexTreeFromInsertable,\n\ttype FactoryContent,\n\ttype InsertableContent,\n} from \"../../unhydratedFlexTreeFromInsertable.js\";\nimport { recordLikeDataToFlexContent } from \"../common.js\";\n\nimport type {\n\tRecordNodeCustomizableSchema,\n\tRecordNodeInsertableData,\n\tRecordNodePojoEmulationSchema,\n\tRecordNodeSchema,\n\tTreeRecordNode,\n} from \"./recordNodeTypes.js\";\n\n/**\n * Create a proxy which implements the {@link TreeRecordNode} API.\n * @param proxyTarget - Target object of the proxy.\n * @param customizable - See {@link RecordNodeSchemaOptions.customizable}.\n * @param schema - The schema of the record node.\n */\nfunction createRecordNodeProxy(\n\tproxyTarget: object,\n\tcustomizable: boolean,\n\tschema: RecordNodeSchema,\n): TreeRecordNode {\n\tconst proxy: TreeRecordNode = new Proxy<TreeRecordNode>(proxyTarget as TreeRecordNode, {\n\t\tget: (target, key, receiver): unknown => {\n\t\t\tif (typeof key === \"symbol\") {\n\t\t\t\tswitch (key) {\n\t\t\t\t\t// POJO mode records don't have TreeNode's build in members on their targets, so special case them:\n\t\t\t\t\tcase typeSchemaSymbol: {\n\t\t\t\t\t\treturn schema;\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\t\t\t\tcase typeNameSymbol: {\n\t\t\t\t\t\treturn schema.identifier;\n\t\t\t\t\t}\n\t\t\t\t\tcase Symbol.iterator: {\n\t\t\t\t\t\treturn () => recordIterator(proxy);\n\t\t\t\t\t}\n\t\t\t\t\tcase Symbol.toPrimitive: {\n\t\t\t\t\t\t// Handle string interpolation and coercion to string\n\t\t\t\t\t\treturn () => Object.prototype.toString.call(proxy);\n\t\t\t\t\t}\n\t\t\t\t\tcase Symbol.toStringTag: {\n\t\t\t\t\t\t// In order to satisfy deep equality checks in POJO (non-customizable) mode,\n\t\t\t\t\t\t// we cannot override the behavior of this.\n\t\t\t\t\t\tif (customizable) {\n\t\t\t\t\t\t\t// Generates nicer toString behavior for customizable records.\n\t\t\t\t\t\t\t// E.g. `[object My.Record]` instead of `[object Object]`.\n\t\t\t\t\t\t\treturn schema.identifier;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t// No-op\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof key === \"string\") {\n\t\t\t\tconst innerNode = getInnerNode(receiver);\n\t\t\t\tconst field = innerNode.tryGetField(brand(key));\n\t\t\t\tif (field !== undefined) {\n\t\t\t\t\treturn tryGetTreeNodeForField(field);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t},\n\t\tset: (target, key, value: InsertableContent | undefined, receiver): boolean => {\n\t\t\tif (typeof key === \"symbol\") {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst innerNode = getInnerNode(receiver);\n\t\t\tconst field = innerNode.getBoxed(brand(key)) as FlexTreeOptionalField;\n\t\t\tconst kernel = getKernel(receiver);\n\t\t\tconst innerSchema = innerNode.context.schema.nodeSchema.get(brand(schema.identifier));\n\t\t\tassert(\n\t\t\t\tinnerSchema instanceof MapNodeStoredSchema,\n\t\t\t\t0xc1a /* Expected MapNodeStoredSchema */,\n\t\t\t);\n\t\t\tfield.context.runInTransaction(() => {\n\t\t\t\tconst mapTree = prepareForInsertion(\n\t\t\t\t\tvalue,\n\t\t\t\t\tcreateFieldSchema(FieldKind.Optional, kernel.schema.info as ImplicitAllowedTypes),\n\t\t\t\t\tinnerNode.context,\n\t\t\t\t\tinnerSchema.mapFields,\n\t\t\t\t);\n\n\t\t\t\tfield.editor.attach(mapTree, field.length === 0);\n\t\t\t});\n\t\t\treturn true;\n\t\t},\n\t\thas: (target, key): boolean => {\n\t\t\tif (typeof key === \"symbol\") {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst innerNode = getInnerNode(proxy);\n\t\t\tconst childField = innerNode.tryGetField(brand(key));\n\n\t\t\treturn childField !== undefined;\n\t\t},\n\t\townKeys: (target) => {\n\t\t\tconst innerNode = getInnerNode(proxy);\n\t\t\treturn [...innerNode.keys()];\n\t\t},\n\t\tgetOwnPropertyDescriptor: (target, key) => {\n\t\t\tif (typeof key === \"symbol\") {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst innerNode = getInnerNode(proxy);\n\t\t\tconst field = innerNode.tryGetField(brand(key));\n\n\t\t\tif (field === undefined) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tvalue: tryGetTreeNodeForField(field),\n\t\t\t\twritable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true, // Must be 'configurable' if property is absent from proxy target.\n\t\t\t};\n\t\t},\n\t\tdefineProperty(target, key, attributes) {\n\t\t\tthrow new UsageError(\"Shadowing properties of record nodes is not permitted.\");\n\t\t},\n\t\tdeleteProperty(target, key) {\n\t\t\tif (typeof key === \"symbol\") {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst innerNode = getInnerNode(proxy);\n\t\t\tconst field = innerNode.tryGetField(brand(key)) as FlexTreeOptionalField | undefined;\n\t\t\tif (field !== undefined) {\n\t\t\t\tfield.editor.set(undefined, field.length === 0);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\t});\n\treturn proxy;\n}\n\nabstract class CustomRecordNodeBase<\n\tconst TAllowedTypes extends ImplicitAllowedTypes,\n> extends TreeNodeValid<RecordNodeInsertableData<TAllowedTypes>> {\n\tpublic static readonly kind = NodeKind.Record;\n\n\tpublic constructor(\n\t\tinput?: InternalTreeNode | RecordNodeInsertableData<TAllowedTypes> | undefined,\n\t) {\n\t\tsuper(input ?? {});\n\t}\n}\n\n/**\n * {@link recordSchema} options.\n * @input\n */\nexport interface RecordSchemaOptions<\n\tTName extends string,\n\tTAllowedTypes extends ImplicitAllowedTypes,\n\tTImplicitlyConstructable extends boolean,\n\tTCustomMetadata = unknown,\n> {\n\t/**\n\t * Unique identifier for this schema within this factory's scope.\n\t */\n\treadonly identifier: TName;\n\n\treadonly customizable: boolean;\n\n\t/**\n\t * The kinds of nodes that are allowed as children of this record.\n\t */\n\treadonly info: TAllowedTypes;\n\n\treadonly implicitlyConstructable: TImplicitlyConstructable;\n\n\treadonly nodeOptions?: NodeSchemaOptionsAlpha<TCustomMetadata>;\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link TreeRecordNode}.\n *\n * @param fields - Schema for fields of the object node's schema. Defines what children can be placed under each key.\n * @param persistedMetadata -\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function recordSchema<\n\tTName extends string,\n\tconst TAllowedTypes extends ImplicitAllowedTypes,\n\tconst TImplicitlyConstructable extends boolean,\n\tconst TCustomMetadata = unknown,\n>(\n\toptions: RecordSchemaOptions<\n\t\tTName,\n\t\tTAllowedTypes,\n\t\tTImplicitlyConstructable,\n\t\tTCustomMetadata\n\t>,\n) {\n\tconst { identifier, info, customizable, implicitlyConstructable, nodeOptions } = options;\n\tconst persistedMetadata = nodeOptions?.persistedMetadata;\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\n\tclass Schema\n\t\textends CustomRecordNodeBase<TAllowedTypes>\n\t\timplements TreeRecordNode<TAllowedTypes>\n\t{\n\t\t/**\n\t\t * Record-like index signature for the node.\n\t\t */\n\t\t[key: string]: TreeNodeFromImplicitAllowedTypes<TAllowedTypes>;\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.record(\"Foo\", 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 Record)\n\t\t\t//\n\t\t\t// \t class Foo extends schemaFactory.record(\"Foo\", 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\t\t\tconst proxyTarget = customizable ? instance : {};\n\t\t\treturn createRecordNodeProxy(\n\t\t\t\tproxyTarget,\n\t\t\t\tcustomizable,\n\t\t\t\tthis as unknown as RecordNodeSchema,\n\t\t\t) as unknown as Schema;\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 typeof Schema);\n\t\t}\n\n\t\tprotected static override oneTimeSetup(): TreeNodeSchemaInitializedData {\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 !== Schema.prototype) {\n\t\t\t\t\tfor (const key of Object.getOwnPropertyNames(prototype)) {\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 could shadow a legal entry. Since child fields are exposed as own properties, shadowing properties of record nodes is not permitted.`,\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 CustomRecordNode, 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 CustomRecordNode 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\tconst schema = this as RecordNodeSchema;\n\t\t\treturn getTreeNodeSchemaInitializedData(this, {\n\t\t\t\tshallowCompatibilityTest,\n\t\t\t\ttoFlexContent: (data: FactoryContent): FlexContent =>\n\t\t\t\t\trecordToFlexContent(data, schema),\n\t\t\t});\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\tpublic static readonly identifier = identifier;\n\t\tpublic static readonly info = info;\n\t\tpublic static readonly implicitlyConstructable: TImplicitlyConstructable =\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](): Output {\n\t\t\treturn Schema.constructorCached?.constructor as unknown as Output;\n\t\t}\n\n\t\tpublic [Symbol.iterator](): IterableIterator<\n\t\t\t[string, TreeNodeFromImplicitAllowedTypes<TAllowedTypes>]\n\t\t> {\n\t\t\treturn recordIterator(this);\n\t\t}\n\t\tpublic get [Symbol.toStringTag](): string {\n\t\t\treturn identifier;\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\n\ttype Output = RecordNodeCustomizableSchema<\n\t\tTName,\n\t\tTAllowedTypes,\n\t\tTImplicitlyConstructable,\n\t\tTCustomMetadata\n\t> &\n\t\tRecordNodePojoEmulationSchema<\n\t\t\tTName,\n\t\t\tTAllowedTypes,\n\t\t\tTImplicitlyConstructable,\n\t\t\tTCustomMetadata\n\t\t> &\n\t\tTreeNodeSchemaCorePrivate;\n\n\tconst output: Output = Schema;\n\treturn output;\n}\n\nfunction* recordIterator<TAllowedTypes extends ImplicitAllowedTypes>(\n\trecord: TreeRecordNode<TAllowedTypes>,\n): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<TAllowedTypes>]> {\n\tfor (const [key, value] of Object.entries(record)) {\n\t\tyield [key, value];\n\t}\n}\n\n/**\n * {@link TreeNodeSchemaInitializedData.shallowCompatibilityTest} for Record nodes.\n */\nfunction shallowCompatibilityTest(data: FactoryContent): 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\treturn CompatibilityLevel.Normal;\n}\n\n/**\n * {@link TreeNodeSchemaInitializedData.toFlexContent} for Record nodes.\n *\n * Transforms data under a Record schema.\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 recordToFlexContent(data: FactoryContent, schema: RecordNodeSchema): FlexContent {\n\tif (!(typeof data === \"object\" && data !== null)) {\n\t\tthrow new UsageError(`Input data is incompatible with Record schema: ${data}`);\n\t}\n\n\tconst fieldsIterator: Iterable<readonly [string, InsertableContent]> = Object.entries(data);\n\treturn recordLikeDataToFlexContent(fieldsIterator, schema);\n}\n"]}
1
+ {"version":3,"file":"recordNode.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/record/recordNode.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,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EACN,WAAW,GAGX,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAqC,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAElF,OAAO,EAEN,QAAQ;AACR,kDAAkD;AAClD,cAAc,EACd,gBAAgB,EAEhB,YAAY,EACZ,SAAS,EAIT,qBAAqB,EAErB,aAAa,EAIb,iBAAiB,EACjB,+BAA+B,EAE/B,kBAAkB,EAElB,6BAA6B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EACN,gCAAgC,GAGhC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,2BAA2B,EA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E,CAAC;QACnD,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACpB,CAAC;AACF,CAAC;AAED;;GAEG;AACH,SAAS,wBAAwB,CAAC,IAAoB;IACrD,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,OAAO,kBAAkB,CAAC,IAAI,CAAC;IAChC,CAAC;IAED,IAAI,MAAM,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC7B,OAAO,kBAAkB,CAAC,IAAI,CAAC;IAChC,CAAC;IAED,OAAO,kBAAkB,CAAC,MAAM,CAAC;AAClC,CAAC;AAED;;;;;;GAMG;AACH,SAAS,mBAAmB,CAAC,IAAoB,EAAE,MAAwB;IAC1E,IAAI,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,UAAU,CAAC,kDAAkD,IAAI,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,MAAM,cAAc,GAAmD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5F,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 { MapNodeStoredSchema } from \"../../../core/index.js\";\nimport {\n\tisTreeValue,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n} from \"../../../feature-libraries/index.js\";\nimport { type JsonCompatibleReadOnlyObject, brand } from \"../../../util/index.js\";\nimport type { NodeSchemaOptionsAlpha } from \"../../api/index.js\";\nimport {\n\ttype TreeNodeSchema,\n\tNodeKind,\n\t// eslint-disable-next-line import-x/no-deprecated\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\ttype UnhydratedFlexTreeNode,\n\tgetInnerNode,\n\tgetKernel,\n\ttype InternalTreeNode,\n\ttype NodeSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\tnormalizeAllowedTypes,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\tTreeNodeValid,\n\ttype MostDerivedData,\n\ttype TreeNodeSchemaInitializedData,\n\ttype TreeNodeSchemaCorePrivate,\n\tprivateDataSymbol,\n\tcreateTreeNodeSchemaPrivateData,\n\ttype FlexContent,\n\tCompatibilityLevel,\n\ttype TreeNodeSchemaPrivateData,\n\tAnnotatedAllowedTypesInternal,\n} from \"../../core/index.js\";\nimport { getTreeNodeSchemaInitializedData } from \"../../createContext.js\";\nimport { createFieldSchema, FieldKind } from \"../../fieldSchema.js\";\nimport { tryGetTreeNodeForField } from \"../../getTreeNodeForField.js\";\nimport { prepareForInsertion } from \"../../prepareForInsertion.js\";\nimport type { SchemaType, SimpleAllowedTypeAttributes } from \"../../simpleSchema.js\";\nimport {\n\tunhydratedFlexTreeFromInsertable,\n\ttype FactoryContent,\n\ttype InsertableContent,\n} from \"../../unhydratedFlexTreeFromInsertable.js\";\nimport { recordLikeDataToFlexContent } from \"../common.js\";\n\nimport type {\n\tRecordNodeCustomizableSchema,\n\tRecordNodeInsertableData,\n\tRecordNodePojoEmulationSchema,\n\tRecordNodeSchema,\n\tTreeRecordNode,\n} from \"./recordNodeTypes.js\";\n\n/**\n * Create a proxy which implements the {@link TreeRecordNode} API.\n * @param proxyTarget - Target object of the proxy.\n * @param customizable - See {@link RecordNodeSchemaOptions.customizable}.\n * @param schema - The schema of the record node.\n */\nfunction createRecordNodeProxy(\n\tproxyTarget: object,\n\tcustomizable: boolean,\n\tschema: RecordNodeSchema,\n): TreeRecordNode {\n\tconst proxy: TreeRecordNode = new Proxy<TreeRecordNode>(proxyTarget as TreeRecordNode, {\n\t\tget: (target, key, receiver): unknown => {\n\t\t\tif (typeof key === \"symbol\") {\n\t\t\t\tswitch (key) {\n\t\t\t\t\t// POJO mode records don't have TreeNode's build in members on their targets, so special case them:\n\t\t\t\t\tcase typeSchemaSymbol: {\n\t\t\t\t\t\treturn schema;\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\t\t\t\tcase typeNameSymbol: {\n\t\t\t\t\t\treturn schema.identifier;\n\t\t\t\t\t}\n\t\t\t\t\tcase Symbol.iterator: {\n\t\t\t\t\t\treturn () => recordIterator(proxy);\n\t\t\t\t\t}\n\t\t\t\t\tcase Symbol.toPrimitive: {\n\t\t\t\t\t\t// Handle string interpolation and coercion to string\n\t\t\t\t\t\treturn () => Object.prototype.toString.call(proxy);\n\t\t\t\t\t}\n\t\t\t\t\tcase Symbol.toStringTag: {\n\t\t\t\t\t\t// In order to satisfy deep equality checks in POJO (non-customizable) mode,\n\t\t\t\t\t\t// we cannot override the behavior of this.\n\t\t\t\t\t\tif (customizable) {\n\t\t\t\t\t\t\t// Generates nicer toString behavior for customizable records.\n\t\t\t\t\t\t\t// E.g. `[object My.Record]` instead of `[object Object]`.\n\t\t\t\t\t\t\treturn schema.identifier;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t// No-op\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof key === \"string\") {\n\t\t\t\tconst innerNode = getInnerNode(receiver);\n\t\t\t\tconst field = innerNode.tryGetField(brand(key));\n\t\t\t\tif (field !== undefined) {\n\t\t\t\t\treturn tryGetTreeNodeForField(field);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t},\n\t\tset: (target, key, value: InsertableContent | undefined, receiver): boolean => {\n\t\t\tif (typeof key === \"symbol\") {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst innerNode = getInnerNode(receiver);\n\t\t\tconst field = innerNode.getBoxed(brand(key)) as FlexTreeOptionalField;\n\t\t\tconst kernel = getKernel(receiver);\n\t\t\tconst innerSchema = innerNode.context.schema.nodeSchema.get(brand(schema.identifier));\n\t\t\tassert(\n\t\t\t\tinnerSchema instanceof MapNodeStoredSchema,\n\t\t\t\t0xc1a /* Expected MapNodeStoredSchema */,\n\t\t\t);\n\n\t\t\tconst mapTree = prepareForInsertion(\n\t\t\t\tvalue,\n\t\t\t\tcreateFieldSchema(FieldKind.Optional, kernel.schema.info as ImplicitAllowedTypes),\n\t\t\t\tinnerNode.context,\n\t\t\t\tinnerSchema.mapFields,\n\t\t\t);\n\n\t\t\tfield.editor.set(mapTree, field.length === 0);\n\t\t\treturn true;\n\t\t},\n\t\thas: (target, key): boolean => {\n\t\t\tif (typeof key === \"symbol\") {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst innerNode = getInnerNode(proxy);\n\t\t\tconst childField = innerNode.tryGetField(brand(key));\n\n\t\t\treturn childField !== undefined;\n\t\t},\n\t\townKeys: (target) => {\n\t\t\tconst innerNode = getInnerNode(proxy);\n\t\t\treturn [...innerNode.keys()];\n\t\t},\n\t\tgetOwnPropertyDescriptor: (target, key) => {\n\t\t\tif (typeof key === \"symbol\") {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst innerNode = getInnerNode(proxy);\n\t\t\tconst field = innerNode.tryGetField(brand(key));\n\n\t\t\tif (field === undefined) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tvalue: tryGetTreeNodeForField(field),\n\t\t\t\twritable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true, // Must be 'configurable' if property is absent from proxy target.\n\t\t\t};\n\t\t},\n\t\tdefineProperty(target, key, attributes) {\n\t\t\tthrow new UsageError(\"Shadowing properties of record nodes is not permitted.\");\n\t\t},\n\t\tdeleteProperty(target, key) {\n\t\t\tif (typeof key === \"symbol\") {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst innerNode = getInnerNode(proxy);\n\t\t\tconst field = innerNode.tryGetField(brand(key)) as FlexTreeOptionalField | undefined;\n\t\t\tif (field !== undefined) {\n\t\t\t\tfield.editor.set(undefined, field.length === 0);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\t});\n\treturn proxy;\n}\n\nabstract class CustomRecordNodeBase<\n\tconst TAllowedTypes extends ImplicitAllowedTypes,\n> extends TreeNodeValid<RecordNodeInsertableData<TAllowedTypes>> {\n\tpublic static readonly kind = NodeKind.Record;\n\n\tpublic constructor(\n\t\tinput?: InternalTreeNode | RecordNodeInsertableData<TAllowedTypes> | undefined,\n\t) {\n\t\tsuper(input ?? {});\n\t}\n}\n\n/**\n * {@link recordSchema} options.\n * @input\n */\nexport interface RecordSchemaOptions<\n\tTName extends string,\n\tTAllowedTypes extends ImplicitAllowedTypes,\n\tTImplicitlyConstructable extends boolean,\n\tTCustomMetadata = unknown,\n> {\n\t/**\n\t * Unique identifier for this schema within this factory's scope.\n\t */\n\treadonly identifier: TName;\n\n\treadonly customizable: boolean;\n\n\t/**\n\t * The kinds of nodes that are allowed as children of this record.\n\t */\n\treadonly info: TAllowedTypes;\n\n\treadonly implicitlyConstructable: TImplicitlyConstructable;\n\n\treadonly nodeOptions?: NodeSchemaOptionsAlpha<TCustomMetadata>;\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link TreeRecordNode}.\n *\n * @param fields - Schema for fields of the object node's schema. Defines what children can be placed under each key.\n * @param persistedMetadata -\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function recordSchema<\n\tTName extends string,\n\tconst TAllowedTypes extends ImplicitAllowedTypes,\n\tconst TImplicitlyConstructable extends boolean,\n\tconst TCustomMetadata = unknown,\n>(\n\toptions: RecordSchemaOptions<\n\t\tTName,\n\t\tTAllowedTypes,\n\t\tTImplicitlyConstructable,\n\t\tTCustomMetadata\n\t>,\n) {\n\tconst { identifier, info, customizable, implicitlyConstructable, nodeOptions } = options;\n\tconst persistedMetadata = nodeOptions?.persistedMetadata;\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\n\tclass Schema\n\t\textends CustomRecordNodeBase<TAllowedTypes>\n\t\timplements TreeRecordNode<TAllowedTypes>\n\t{\n\t\t/**\n\t\t * Record-like index signature for the node.\n\t\t */\n\t\t[key: string]: TreeNodeFromImplicitAllowedTypes<TAllowedTypes>;\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.record(\"Foo\", 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 Record)\n\t\t\t//\n\t\t\t// \t class Foo extends schemaFactory.record(\"Foo\", 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\t\t\tconst proxyTarget = customizable ? instance : {};\n\t\t\treturn createRecordNodeProxy(\n\t\t\t\tproxyTarget,\n\t\t\t\tcustomizable,\n\t\t\t\tthis as unknown as RecordNodeSchema,\n\t\t\t) as unknown as Schema;\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 typeof Schema);\n\t\t}\n\n\t\tprotected static override oneTimeSetup(): TreeNodeSchemaInitializedData {\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 !== Schema.prototype) {\n\t\t\t\t\tfor (const key of Object.getOwnPropertyNames(prototype)) {\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 could shadow a legal entry. Since child fields are exposed as own properties, shadowing properties of record nodes is not permitted.`,\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 CustomRecordNode, 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 CustomRecordNode 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\tconst schema = this as RecordNodeSchema;\n\t\t\treturn getTreeNodeSchemaInitializedData(this, {\n\t\t\t\tshallowCompatibilityTest,\n\t\t\t\ttoFlexContent: (data: FactoryContent): FlexContent =>\n\t\t\t\t\trecordToFlexContent(data, schema),\n\t\t\t});\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\tpublic static readonly identifier = identifier;\n\t\tpublic static readonly info = info;\n\t\tpublic static readonly implicitlyConstructable: TImplicitlyConstructable =\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](): Output {\n\t\t\treturn Schema.constructorCached?.constructor as unknown as Output;\n\t\t}\n\n\t\tpublic [Symbol.iterator](): IterableIterator<\n\t\t\t[string, TreeNodeFromImplicitAllowedTypes<TAllowedTypes>]\n\t\t> {\n\t\t\treturn recordIterator(this);\n\t\t}\n\t\tpublic get [Symbol.toStringTag](): string {\n\t\t\treturn identifier;\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\n\ttype Output = RecordNodeCustomizableSchema<\n\t\tTName,\n\t\tTAllowedTypes,\n\t\tTImplicitlyConstructable,\n\t\tTCustomMetadata\n\t> &\n\t\tRecordNodePojoEmulationSchema<\n\t\t\tTName,\n\t\t\tTAllowedTypes,\n\t\t\tTImplicitlyConstructable,\n\t\t\tTCustomMetadata\n\t\t> &\n\t\tTreeNodeSchemaCorePrivate;\n\n\tconst output: Output = Schema;\n\treturn output;\n}\n\nfunction* recordIterator<TAllowedTypes extends ImplicitAllowedTypes>(\n\trecord: TreeRecordNode<TAllowedTypes>,\n): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<TAllowedTypes>]> {\n\tfor (const [key, value] of Object.entries(record)) {\n\t\tyield [key, value];\n\t}\n}\n\n/**\n * {@link TreeNodeSchemaInitializedData.shallowCompatibilityTest} for Record nodes.\n */\nfunction shallowCompatibilityTest(data: FactoryContent): 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\treturn CompatibilityLevel.Normal;\n}\n\n/**\n * {@link TreeNodeSchemaInitializedData.toFlexContent} for Record nodes.\n *\n * Transforms data under a Record schema.\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 recordToFlexContent(data: FactoryContent, schema: RecordNodeSchema): FlexContent {\n\tif (!(typeof data === \"object\" && data !== null)) {\n\t\tthrow new UsageError(`Input data is incompatible with Record schema: ${data}`);\n\t}\n\n\tconst fieldsIterator: Iterable<readonly [string, InsertableContent]> = Object.entries(data);\n\treturn recordLikeDataToFlexContent(fieldsIterator, schema);\n}\n"]}
@@ -2,10 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { SchemaAndPolicy, TreeFieldStoredSchema, TreeTypeSet } from "../core/index.js";
6
- import { type FlexTreeContext, type FlexTreeHydratedContextMinimal, type FlexibleFieldContent, type FlexibleNodeContent, type FlexTreeNode, type DetachedRootsLocation } from "../feature-libraries/index.js";
7
- import { type ImplicitAllowedTypes } from "./core/index.js";
8
- import { type ImplicitFieldSchema } from "./fieldSchema.js";
5
+ import type { SchemaAndPolicy, UpPath, TreeFieldStoredSchema, TreeTypeSet } from "../core/index.js";
6
+ import { type FlexTreeContext, type FlexTreeHydratedContextMinimal, type FlexibleFieldContent, type FlexibleNodeContent } from "../feature-libraries/index.js";
7
+ import { type Mutable } from "../util/index.js";
8
+ import { type ImplicitAllowedTypes, type TreeNode, type UnhydratedFlexTreeNode } from "./core/index.js";
9
+ import type { ImplicitFieldSchema } from "./fieldSchema.js";
9
10
  import { type InsertableContent } from "./unhydratedFlexTreeFromInsertable.js";
10
11
  /**
11
12
  * Prepare content from a user for insertion into a tree.
@@ -30,66 +31,58 @@ export declare function prepareForInsertion<TIn extends InsertableContent | unde
30
31
  * due to how the eventing in prepareContentForHydration works.
31
32
  */
32
33
  export declare function prepareArrayContentForInsertion(data: readonly InsertableContent[], schema: ImplicitAllowedTypes, destinationContext: FlexTreeContext, destinationSchema: TreeTypeSet): FlexibleFieldContent;
33
- export interface PreparedContent {
34
- /**
35
- * New content which to be attached. Rooted in detached fields.
36
- * @remarks
37
- * When destination is a hydrated context, this will contain hydrated flex tree nodes.
38
- * The corresponding TreeNodes will not yet be hydrated, and some subtrees may be in separate detached fields.
39
- *
40
- * TODO: Eventually, this should be a single detached field, not an array of nodes each in their own detached field.
41
- */
42
- readonly toAttach?: readonly FlexTreeNode[];
43
- /**
44
- * Location of toAttach.
45
- * @remarks
46
- * This is redundant with `toAttach.key` but in a different format/type.
47
- * Only provided for hydrated destinations.
48
- */
49
- readonly rootsLocations?: DetachedRootsLocation;
50
- /**
51
- * Finalizes the prepared content. Moves in missing subtrees from detached fields, and hydrates TreeNodes as needed.
52
- *
53
- * @param attached - The nodes that were attached to the tree.
54
- *
55
- * @remarks
56
- * Call this exactly once, after `toAttach` has been attached to its final location.
57
- * There must be no app facing events between creation of this `PreparedContent` and its finalization since during this time TreeNodes may be in an invalid state (inner node hydrated, but TreeNode not).
58
- *
59
- * The implementation of this must not assume the context provided to `prepareForInsertion*` is still valid.
60
- */
61
- readonly finalize: (attached: readonly FlexTreeNode[]) => void;
62
- }
63
34
  /**
64
- * This exists to handle the required root initialize case where the flex tree nodes get invalidated by a schema change and thus new node instances need to be provided.
35
+ * Split out from {@link prepareForInsertion} as to allow use without a context.
36
+ *
37
+ * @param hydratedData - If specified, the `mapTrees` will be prepared for hydration into this context.
38
+ * `undefined` when `mapTrees` are being inserted into an {@link Unhydrated} tree.
39
+ *
40
+ * @remarks
41
+ * Adding this entry point is a workaround for initialize not currently having a context.
65
42
  */
66
- export interface PreparedContentInitialize extends PreparedContent {
67
- /**
68
- * {@inheritDoc PreparedContent.rootIds}
69
- */
70
- readonly rootsLocations: DetachedRootsLocation;
43
+ export declare function prepareForInsertionContextless<TIn extends InsertableContent | undefined>(data: TIn, schema: ImplicitFieldSchema, schemaAndPolicy: SchemaAndPolicy, hydratedData: FlexTreeHydratedContextMinimal | undefined, destinationSchema: TreeFieldStoredSchema, scheduleHydrationOverride?: HydrationScheduler): TIn extends undefined ? undefined : FlexibleNodeContent;
44
+ /**
45
+ * The path from the included node to the root of the content tree it was inserted as part of.
46
+ */
47
+ interface RelativeNodePath {
48
+ readonly path: UpPath;
49
+ readonly node: TreeNode;
71
50
  }
72
51
  /**
73
- * This exists to handle the required root initialize case where the flex tree nodes get invalidated by a schema change and thus new node instances need to be provided.
52
+ * {@link RelativeNodePath}s for every {@link TreeNode} in the content tree inserted as an atomic operation.
74
53
  */
75
- export interface PreparedContentRegular extends PreparedContent {
76
- /**
77
- * {@inheritDoc PreparedContent.toAttach}
78
- */
79
- readonly toAttach: readonly FlexTreeNode[];
54
+ interface LocatedNodesBatch {
80
55
  /**
81
- * {@link PreparedContent.finalize} but without `attached` parameter: assumes `toAttach` is the same is still valid and uses that.
56
+ * UpPath shared by all {@link RelativeNodePath}s in this batch corresponding to the root of the inserted content.
82
57
  */
83
- readonly finalize: () => void;
58
+ readonly rootPath: Mutable<UpPath>;
59
+ readonly paths: RelativeNodePath[];
84
60
  }
85
61
  /**
86
- * Split out from {@link prepareForInsertion} as to allow use without a context.
62
+ * Records any {@link TreeNode}s in the given `content` tree and does the necessary bookkeeping to ensure they are synchronized with subsequent reads of the tree.
63
+ * Additionally populates any {@link UnhydratedFlexTreeField.pendingDefault}s using the provided `context`.
87
64
  *
88
- * @param hydratedData - If specified, the `mapTrees` will be prepared for hydration into this context.
89
- * `undefined` when `mapTrees` are being inserted into an {@link Unhydrated} tree.
65
+ * @remarks If the content tree contains has any associated {@link TreeNode}s, this function must be called just prior to inserting the content into the tree.
66
+ * Specifically, no other content may be inserted into the tree between the invocation of this function and the insertion of `content`.
67
+ * The insertion of `content` must occur or else this function will cause memory leaks.
90
68
  *
91
- * @remarks
92
- * Adding this entry point is a workaround for initialize not currently having a context.
69
+ * Exported for testing purposes: otherwise should not be used outside this module.
70
+ * @param content - the content subsequence to be inserted, of which might deeply contain {@link TreeNode}s which need to be hydrated.
71
+ * @param forest - the forest the content is being inserted into.
72
+ */
73
+ export declare function prepareContentForHydration(content: readonly UnhydratedFlexTreeNode[], scheduler: HydrationScheduler, context: FlexTreeHydratedContextMinimal): void;
74
+ /**
75
+ * A function which can schedule hydration of batches of nodes to occur at a later time (which must be after they have been inserted into the tree).
76
+ */
77
+ type HydrationScheduler = (locatedNodes: readonly LocatedNodesBatch[],
78
+ /**
79
+ * Does the actual hydration. Should be called for each index in `locatedNodes` once the corresponding content has been inserted into the tree.
80
+ */
81
+ doHydration: Hydrator) => void;
82
+ /**
83
+ * Does the actual hydration.
84
+ * The provided `attachPath` is the path the content is currently under (where it was attached in the tree).
93
85
  */
94
- export declare function prepareForInsertionContextless<TIn extends InsertableContent | undefined>(data: TIn, schema: ImplicitFieldSchema, schemaAndPolicy: SchemaAndPolicy, hydratedData: FlexTreeHydratedContextMinimal, destinationSchema: TreeFieldStoredSchema): PreparedContentInitialize;
86
+ type Hydrator = (batch: LocatedNodesBatch, attachPath: UpPath) => void;
87
+ export {};
95
88
  //# sourceMappingURL=prepareForInsertion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prepareForInsertion.d.ts","sourceRoot":"","sources":["../../src/simple-tree/prepareForInsertion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EACX,eAAe,EAEf,qBAAqB,EACrB,WAAW,EACX,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,KAAK,eAAe,EAEpB,KAAK,8BAA8B,EAEnC,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EAOjB,KAAK,qBAAqB,EAC1B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAMN,KAAK,oBAAoB,EAGzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGlF,OAAO,EACN,KAAK,iBAAiB,EAEtB,MAAM,uCAAuC,CAAC;AA4B/C;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,SAAS,iBAAiB,GAAG,SAAS,EAC5E,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,mBAAmB,EAC3B,kBAAkB,EAAE,eAAe,EACnC,iBAAiB,EAAE,qBAAqB,GACtC,GAAG,SAAS,SAAS,GAAG,SAAS,GAAG,mBAAmB,CAuBzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,+BAA+B,CAC9C,IAAI,EAAE,SAAS,iBAAiB,EAAE,EAClC,MAAM,EAAE,oBAAoB,EAC5B,kBAAkB,EAAE,eAAe,EACnC,iBAAiB,EAAE,WAAW,GAC5B,oBAAoB,CA6CtB;AAED,MAAM,WAAW,eAAe;IAC/B;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAE5C;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,CAAC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