@fluidframework/tree 2.82.0 → 2.90.0-378676

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 (986) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +33 -5
  3. package/api-report/tree.alpha.api.md +26 -21
  4. package/api-report/tree.beta.api.md +14 -2
  5. package/api-report/tree.legacy.beta.api.md +14 -2
  6. package/api-report/tree.legacy.public.api.md +1 -1
  7. package/api-report/tree.public.api.md +1 -1
  8. package/dist/alpha.d.ts +3 -3
  9. package/dist/beta.d.ts +1 -0
  10. package/dist/codec/codec.d.ts +3 -39
  11. package/dist/codec/codec.d.ts.map +1 -1
  12. package/dist/codec/codec.js +5 -50
  13. package/dist/codec/codec.js.map +1 -1
  14. package/dist/codec/index.d.ts +1 -1
  15. package/dist/codec/index.d.ts.map +1 -1
  16. package/dist/codec/index.js +1 -2
  17. package/dist/codec/index.js.map +1 -1
  18. package/dist/codec/versioned/codec.d.ts +20 -7
  19. package/dist/codec/versioned/codec.d.ts.map +1 -1
  20. package/dist/codec/versioned/codec.js +56 -30
  21. package/dist/codec/versioned/codec.js.map +1 -1
  22. package/dist/core/change-family/changeFamily.d.ts +4 -1
  23. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  24. package/dist/core/change-family/changeFamily.js.map +1 -1
  25. package/dist/core/change-family/index.d.ts +1 -1
  26. package/dist/core/change-family/index.d.ts.map +1 -1
  27. package/dist/core/change-family/index.js.map +1 -1
  28. package/dist/core/index.d.ts +3 -3
  29. package/dist/core/index.d.ts.map +1 -1
  30. package/dist/core/index.js +6 -4
  31. package/dist/core/index.js.map +1 -1
  32. package/dist/core/rebase/changeRebaser.d.ts +6 -1
  33. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  34. package/dist/core/rebase/changeRebaser.js.map +1 -1
  35. package/dist/core/rebase/index.d.ts +1 -1
  36. package/dist/core/rebase/index.d.ts.map +1 -1
  37. package/dist/core/rebase/index.js +2 -1
  38. package/dist/core/rebase/index.js.map +1 -1
  39. package/dist/core/rebase/types.d.ts +1 -0
  40. package/dist/core/rebase/types.d.ts.map +1 -1
  41. package/dist/core/rebase/types.js +5 -1
  42. package/dist/core/rebase/types.js.map +1 -1
  43. package/dist/core/rebase/utils.d.ts.map +1 -1
  44. package/dist/core/rebase/utils.js +25 -7
  45. package/dist/core/rebase/utils.js.map +1 -1
  46. package/dist/core/tree/delta.d.ts +5 -0
  47. package/dist/core/tree/delta.d.ts.map +1 -1
  48. package/dist/core/tree/delta.js.map +1 -1
  49. package/dist/core/tree/detachedFieldIndex.d.ts +13 -1
  50. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  51. package/dist/core/tree/detachedFieldIndex.js +14 -1
  52. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  53. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  54. package/dist/core/tree/detachedFieldIndexCodecs.js +6 -4
  55. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  56. package/dist/core/tree/detachedFieldIndexTypes.d.ts +4 -0
  57. package/dist/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  58. package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
  59. package/dist/core/tree/index.d.ts +2 -2
  60. package/dist/core/tree/index.d.ts.map +1 -1
  61. package/dist/core/tree/index.js +4 -3
  62. package/dist/core/tree/index.js.map +1 -1
  63. package/dist/core/tree/pathTree.d.ts +11 -3
  64. package/dist/core/tree/pathTree.d.ts.map +1 -1
  65. package/dist/core/tree/pathTree.js +14 -2
  66. package/dist/core/tree/pathTree.js.map +1 -1
  67. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  68. package/dist/core/tree/visitDelta.js +17 -13
  69. package/dist/core/tree/visitDelta.js.map +1 -1
  70. package/dist/extensibleUnionNode.d.ts +97 -0
  71. package/dist/extensibleUnionNode.d.ts.map +1 -0
  72. package/dist/{extensibleSchemaUnion.js → extensibleUnionNode.js} +28 -18
  73. package/dist/extensibleUnionNode.js.map +1 -0
  74. package/dist/feature-libraries/changeAtomIdBTree.d.ts +3 -2
  75. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  76. package/dist/feature-libraries/changeAtomIdBTree.js +15 -2
  77. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  79. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  80. package/dist/feature-libraries/chunked-forest/codec/codecs.js +4 -4
  81. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  82. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +92 -44
  83. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  84. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +220 -70
  85. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  86. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  87. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +12 -2
  88. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  89. package/dist/feature-libraries/default-schema/index.d.ts +2 -1
  90. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  91. package/dist/feature-libraries/default-schema/index.js +4 -2
  92. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  93. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +40 -0
  94. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  95. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +153 -0
  96. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  97. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  98. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  99. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  100. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  101. package/dist/feature-libraries/deltaUtils.d.ts +1 -0
  102. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  103. package/dist/feature-libraries/deltaUtils.js +6 -1
  104. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  105. package/dist/feature-libraries/flex-tree/context.d.ts +9 -0
  106. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  107. package/dist/feature-libraries/flex-tree/context.js +6 -0
  108. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  109. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  110. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  111. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  112. package/dist/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  113. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  114. package/dist/feature-libraries/flex-tree/lazyField.js +39 -8
  115. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  116. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  117. package/dist/feature-libraries/forest-summary/codec.js +7 -1
  118. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  119. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +3 -3
  120. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  121. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  122. package/dist/feature-libraries/forest-summary/formatV1.d.ts +2 -3
  123. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  124. package/dist/feature-libraries/forest-summary/formatV1.js +1 -2
  125. package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -1
  126. package/dist/feature-libraries/forest-summary/formatV2.d.ts +2 -3
  127. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  128. package/dist/feature-libraries/forest-summary/formatV2.js +1 -2
  129. package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -1
  130. package/dist/feature-libraries/index.d.ts +3 -3
  131. package/dist/feature-libraries/index.d.ts.map +1 -1
  132. package/dist/feature-libraries/index.js +8 -4
  133. package/dist/feature-libraries/index.js.map +1 -1
  134. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  135. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  136. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  137. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +100 -24
  138. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  139. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +8 -12
  140. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  141. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +85 -51
  142. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  143. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  144. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  145. package/dist/feature-libraries/modular-schema/genericFieldKind.js +4 -9
  146. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  147. package/dist/feature-libraries/modular-schema/index.d.ts +3 -3
  148. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  149. package/dist/feature-libraries/modular-schema/index.js +2 -3
  150. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  151. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +20 -24
  152. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  153. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +277 -159
  154. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  155. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  156. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  157. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  158. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +15 -0
  159. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +1 -0
  160. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js +296 -0
  161. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js.map +1 -0
  162. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +1 -0
  163. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  164. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +8 -0
  165. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  166. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +56 -22
  167. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  168. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1390 -462
  169. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  170. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  171. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  172. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +1 -2
  173. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  174. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +3 -3
  175. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  176. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +74 -0
  177. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +1 -0
  178. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js +35 -0
  179. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js.map +1 -0
  180. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +49 -10
  181. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  182. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +3 -3
  183. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  184. package/dist/feature-libraries/optional-field/optionalField.d.ts +13 -32
  185. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  186. package/dist/feature-libraries/optional-field/optionalField.js +257 -446
  187. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  188. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  189. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  190. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +31 -0
  191. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  192. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +31 -31
  193. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  194. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  195. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  196. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  197. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +57 -28
  198. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  199. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  200. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  201. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +57 -0
  202. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  203. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  204. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  205. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  206. package/dist/feature-libraries/optional-field/requiredField.d.ts +3 -2
  207. package/dist/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
  208. package/dist/feature-libraries/optional-field/requiredField.js +6 -1
  209. package/dist/feature-libraries/optional-field/requiredField.js.map +1 -1
  210. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  211. package/dist/feature-libraries/schema-index/codec.js +6 -4
  212. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  213. package/dist/feature-libraries/sequence-field/compose.d.ts +6 -7
  214. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  215. package/dist/feature-libraries/sequence-field/compose.js +81 -259
  216. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  217. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  218. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  219. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  220. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  221. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  222. package/dist/feature-libraries/sequence-field/invert.js +65 -167
  223. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  224. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  225. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  226. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  227. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  228. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  229. package/dist/feature-libraries/sequence-field/moveEffectTable.js +7 -90
  230. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  231. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  232. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  233. package/dist/feature-libraries/sequence-field/rebase.js +109 -116
  234. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  235. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  236. package/dist/feature-libraries/sequence-field/replaceRevisions.js +19 -32
  237. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  238. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  239. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +1 -2
  240. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  241. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  242. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  243. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +388 -187
  244. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  245. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  246. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +20 -62
  247. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  248. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  249. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  250. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +13 -13
  251. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  252. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  253. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  254. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +16 -111
  255. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  256. package/dist/feature-libraries/sequence-field/types.d.ts +37 -74
  257. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  258. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  259. package/dist/feature-libraries/sequence-field/utils.d.ts +20 -25
  260. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  261. package/dist/feature-libraries/sequence-field/utils.js +159 -320
  262. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  263. package/dist/index.d.ts +2 -2
  264. package/dist/index.d.ts.map +1 -1
  265. package/dist/index.js +4 -4
  266. package/dist/index.js.map +1 -1
  267. package/dist/legacy.d.ts +1 -0
  268. package/dist/packageVersion.d.ts +1 -1
  269. package/dist/packageVersion.d.ts.map +1 -1
  270. package/dist/packageVersion.js +1 -1
  271. package/dist/packageVersion.js.map +1 -1
  272. package/dist/shared-tree/independentView.d.ts.map +1 -1
  273. package/dist/shared-tree/independentView.js +1 -1
  274. package/dist/shared-tree/independentView.js.map +1 -1
  275. package/dist/shared-tree/index.d.ts +1 -1
  276. package/dist/shared-tree/index.d.ts.map +1 -1
  277. package/dist/shared-tree/index.js.map +1 -1
  278. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  279. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  280. package/dist/shared-tree/schematizeTree.js +2 -1
  281. package/dist/shared-tree/schematizeTree.js.map +1 -1
  282. package/dist/shared-tree/schematizingTreeView.d.ts +1 -5
  283. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  284. package/dist/shared-tree/schematizingTreeView.js +21 -35
  285. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  286. package/dist/shared-tree/sharedTree.d.ts +9 -3
  287. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  288. package/dist/shared-tree/sharedTree.js +4 -1
  289. package/dist/shared-tree/sharedTree.js.map +1 -1
  290. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -0
  291. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  292. package/dist/shared-tree/sharedTreeChangeCodecs.js +9 -1
  293. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  294. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  295. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  296. package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
  297. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  298. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  299. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  300. package/dist/shared-tree/sharedTreeEditBuilder.js +14 -7
  301. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  302. package/dist/shared-tree/tree.d.ts +1 -1
  303. package/dist/shared-tree/tree.js.map +1 -1
  304. package/dist/shared-tree/treeAlpha.d.ts +1 -1
  305. package/dist/shared-tree/treeAlpha.js.map +1 -1
  306. package/dist/shared-tree/treeCheckout.d.ts +13 -11
  307. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  308. package/dist/shared-tree/treeCheckout.js +58 -10
  309. package/dist/shared-tree/treeCheckout.js.map +1 -1
  310. package/dist/shared-tree-core/branch.d.ts +3 -2
  311. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  312. package/dist/shared-tree-core/branch.js +4 -3
  313. package/dist/shared-tree-core/branch.js.map +1 -1
  314. package/dist/shared-tree-core/editManager.d.ts +2 -2
  315. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  316. package/dist/shared-tree-core/editManager.js +9 -9
  317. package/dist/shared-tree-core/editManager.js.map +1 -1
  318. package/dist/shared-tree-core/editManagerCodecs.d.ts +4 -0
  319. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  320. package/dist/shared-tree-core/editManagerCodecs.js +10 -2
  321. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  322. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +3 -3
  323. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  324. package/dist/shared-tree-core/editManagerCodecsCommons.js +2 -2
  325. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  326. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +2 -2
  327. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  328. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  329. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  330. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
  331. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  332. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  333. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  334. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +1 -0
  335. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  336. package/dist/shared-tree-core/editManagerFormatCommons.js +6 -0
  337. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  338. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  339. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  340. package/dist/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  341. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  342. package/dist/shared-tree-core/index.d.ts +2 -2
  343. package/dist/shared-tree-core/index.d.ts.map +1 -1
  344. package/dist/shared-tree-core/index.js +3 -1
  345. package/dist/shared-tree-core/index.js.map +1 -1
  346. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  347. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  348. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  349. package/dist/shared-tree-core/messageCodecs.d.ts +4 -0
  350. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  351. package/dist/shared-tree-core/messageCodecs.js +12 -4
  352. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  353. package/dist/shared-tree-core/messageFormat.d.ts +1 -0
  354. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  355. package/dist/shared-tree-core/messageFormat.js +6 -0
  356. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  357. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  358. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  359. package/dist/shared-tree-core/messageFormatV1ToV4.js +1 -0
  360. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  361. package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -0
  362. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  363. package/dist/shared-tree-core/sharedTreeCore.js +1 -1
  364. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  365. package/dist/simple-tree/api/index.d.ts +1 -1
  366. package/dist/simple-tree/api/index.d.ts.map +1 -1
  367. package/dist/simple-tree/api/index.js +2 -2
  368. package/dist/simple-tree/api/index.js.map +1 -1
  369. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +148 -29
  370. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  371. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +180 -99
  372. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  373. package/dist/simple-tree/api/tree.d.ts +1 -1
  374. package/dist/simple-tree/api/tree.js.map +1 -1
  375. package/dist/simple-tree/api/treeBeta.d.ts +1 -1
  376. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  377. package/dist/simple-tree/core/allowedTypes.d.ts +1 -1
  378. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  379. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +17 -12
  380. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  381. package/dist/simple-tree/core/unhydratedFlexTree.js +88 -8
  382. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  383. package/dist/simple-tree/fieldSchema.d.ts +4 -4
  384. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  385. package/dist/simple-tree/fieldSchema.js.map +1 -1
  386. package/dist/simple-tree/index.d.ts +3 -3
  387. package/dist/simple-tree/index.d.ts.map +1 -1
  388. package/dist/simple-tree/index.js +3 -3
  389. package/dist/simple-tree/index.js.map +1 -1
  390. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  391. package/dist/simple-tree/node-kinds/array/arrayNode.js +9 -16
  392. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  393. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  394. package/dist/simple-tree/node-kinds/common.js +1 -1
  395. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  396. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
  397. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  398. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  399. package/dist/simple-tree/node-kinds/object/objectNode.js +19 -19
  400. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  401. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  402. package/dist/simple-tree/node-kinds/record/recordNode.js +4 -2
  403. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  404. package/dist/simple-tree/prepareForInsertion.d.ts +54 -47
  405. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  406. package/dist/simple-tree/prepareForInsertion.js +183 -125
  407. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  408. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +8 -3
  409. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  410. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +59 -19
  411. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  412. package/dist/text/textDomainFormatted.d.ts +3 -3
  413. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  414. package/dist/text/textDomainFormatted.js +48 -32
  415. package/dist/text/textDomainFormatted.js.map +1 -1
  416. package/dist/treeFactory.d.ts.map +1 -1
  417. package/dist/treeFactory.js +12 -2
  418. package/dist/treeFactory.js.map +1 -1
  419. package/dist/util/bTreeUtils.d.ts.map +1 -1
  420. package/dist/util/bTreeUtils.js +6 -6
  421. package/dist/util/bTreeUtils.js.map +1 -1
  422. package/dist/util/index.d.ts +1 -1
  423. package/dist/util/index.d.ts.map +1 -1
  424. package/dist/util/index.js +2 -1
  425. package/dist/util/index.js.map +1 -1
  426. package/dist/util/rangeMap.d.ts +23 -11
  427. package/dist/util/rangeMap.d.ts.map +1 -1
  428. package/dist/util/rangeMap.js +42 -10
  429. package/dist/util/rangeMap.js.map +1 -1
  430. package/lib/alpha.d.ts +3 -3
  431. package/lib/beta.d.ts +1 -0
  432. package/lib/codec/codec.d.ts +3 -39
  433. package/lib/codec/codec.d.ts.map +1 -1
  434. package/lib/codec/codec.js +4 -47
  435. package/lib/codec/codec.js.map +1 -1
  436. package/lib/codec/index.d.ts +1 -1
  437. package/lib/codec/index.d.ts.map +1 -1
  438. package/lib/codec/index.js +1 -1
  439. package/lib/codec/index.js.map +1 -1
  440. package/lib/codec/versioned/codec.d.ts +20 -7
  441. package/lib/codec/versioned/codec.d.ts.map +1 -1
  442. package/lib/codec/versioned/codec.js +59 -33
  443. package/lib/codec/versioned/codec.js.map +1 -1
  444. package/lib/core/change-family/changeFamily.d.ts +4 -1
  445. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  446. package/lib/core/change-family/changeFamily.js.map +1 -1
  447. package/lib/core/change-family/index.d.ts +1 -1
  448. package/lib/core/change-family/index.d.ts.map +1 -1
  449. package/lib/core/change-family/index.js.map +1 -1
  450. package/lib/core/index.d.ts +3 -3
  451. package/lib/core/index.d.ts.map +1 -1
  452. package/lib/core/index.js +2 -2
  453. package/lib/core/index.js.map +1 -1
  454. package/lib/core/rebase/changeRebaser.d.ts +6 -1
  455. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  456. package/lib/core/rebase/changeRebaser.js.map +1 -1
  457. package/lib/core/rebase/index.d.ts +1 -1
  458. package/lib/core/rebase/index.d.ts.map +1 -1
  459. package/lib/core/rebase/index.js +1 -1
  460. package/lib/core/rebase/index.js.map +1 -1
  461. package/lib/core/rebase/types.d.ts +1 -0
  462. package/lib/core/rebase/types.d.ts.map +1 -1
  463. package/lib/core/rebase/types.js +3 -0
  464. package/lib/core/rebase/types.js.map +1 -1
  465. package/lib/core/rebase/utils.d.ts.map +1 -1
  466. package/lib/core/rebase/utils.js +25 -7
  467. package/lib/core/rebase/utils.js.map +1 -1
  468. package/lib/core/tree/delta.d.ts +5 -0
  469. package/lib/core/tree/delta.d.ts.map +1 -1
  470. package/lib/core/tree/delta.js.map +1 -1
  471. package/lib/core/tree/detachedFieldIndex.d.ts +13 -1
  472. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  473. package/lib/core/tree/detachedFieldIndex.js +15 -2
  474. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  475. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  476. package/lib/core/tree/detachedFieldIndexCodecs.js +6 -4
  477. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  478. package/lib/core/tree/detachedFieldIndexTypes.d.ts +4 -0
  479. package/lib/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  480. package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
  481. package/lib/core/tree/index.d.ts +2 -2
  482. package/lib/core/tree/index.d.ts.map +1 -1
  483. package/lib/core/tree/index.js +1 -1
  484. package/lib/core/tree/index.js.map +1 -1
  485. package/lib/core/tree/pathTree.d.ts +11 -3
  486. package/lib/core/tree/pathTree.d.ts.map +1 -1
  487. package/lib/core/tree/pathTree.js +12 -1
  488. package/lib/core/tree/pathTree.js.map +1 -1
  489. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  490. package/lib/core/tree/visitDelta.js +17 -13
  491. package/lib/core/tree/visitDelta.js.map +1 -1
  492. package/lib/extensibleUnionNode.d.ts +97 -0
  493. package/lib/extensibleUnionNode.d.ts.map +1 -0
  494. package/lib/{extensibleSchemaUnion.js → extensibleUnionNode.js} +28 -18
  495. package/lib/extensibleUnionNode.js.map +1 -0
  496. package/lib/feature-libraries/changeAtomIdBTree.d.ts +3 -2
  497. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  498. package/lib/feature-libraries/changeAtomIdBTree.js +15 -3
  499. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
  500. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  501. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  502. package/lib/feature-libraries/chunked-forest/codec/codecs.js +5 -5
  503. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  504. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +92 -44
  505. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  506. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +217 -69
  507. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  508. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  509. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +12 -2
  510. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  511. package/lib/feature-libraries/default-schema/index.d.ts +2 -1
  512. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  513. package/lib/feature-libraries/default-schema/index.js +2 -1
  514. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  515. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +40 -0
  516. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  517. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +149 -0
  518. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  519. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  520. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  521. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  522. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  523. package/lib/feature-libraries/deltaUtils.d.ts +1 -0
  524. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  525. package/lib/feature-libraries/deltaUtils.js +5 -1
  526. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  527. package/lib/feature-libraries/flex-tree/context.d.ts +9 -0
  528. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  529. package/lib/feature-libraries/flex-tree/context.js +6 -0
  530. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  531. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  532. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  533. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  534. package/lib/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  535. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  536. package/lib/feature-libraries/flex-tree/lazyField.js +40 -9
  537. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  538. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  539. package/lib/feature-libraries/forest-summary/codec.js +8 -2
  540. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  541. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +3 -3
  542. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  543. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  544. package/lib/feature-libraries/forest-summary/formatV1.d.ts +2 -3
  545. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  546. package/lib/feature-libraries/forest-summary/formatV1.js +1 -2
  547. package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -1
  548. package/lib/feature-libraries/forest-summary/formatV2.d.ts +2 -3
  549. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  550. package/lib/feature-libraries/forest-summary/formatV2.js +1 -2
  551. package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -1
  552. package/lib/feature-libraries/index.d.ts +3 -3
  553. package/lib/feature-libraries/index.d.ts.map +1 -1
  554. package/lib/feature-libraries/index.js +3 -3
  555. package/lib/feature-libraries/index.js.map +1 -1
  556. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  557. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  558. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  559. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +100 -24
  560. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  561. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +7 -10
  562. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  563. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +85 -51
  564. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  565. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  566. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  567. package/lib/feature-libraries/modular-schema/genericFieldKind.js +4 -9
  568. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  569. package/lib/feature-libraries/modular-schema/index.d.ts +3 -3
  570. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  571. package/lib/feature-libraries/modular-schema/index.js +1 -1
  572. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  573. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +20 -24
  574. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  575. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +268 -145
  576. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  577. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  578. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  579. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  580. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +15 -0
  581. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +1 -0
  582. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js +292 -0
  583. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js.map +1 -0
  584. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +1 -0
  585. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  586. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +8 -0
  587. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  588. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +56 -22
  589. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  590. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1387 -468
  591. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  592. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  593. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  594. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +1 -2
  595. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  596. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +1 -1
  597. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  598. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +74 -0
  599. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +1 -0
  600. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js +32 -0
  601. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js.map +1 -0
  602. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +49 -10
  603. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  604. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +1 -1
  605. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  606. package/lib/feature-libraries/optional-field/optionalField.d.ts +13 -32
  607. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  608. package/lib/feature-libraries/optional-field/optionalField.js +254 -442
  609. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  610. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  611. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  612. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +27 -0
  613. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  614. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +31 -31
  615. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  616. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  617. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  618. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  619. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +55 -26
  620. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  621. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  622. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  623. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +53 -0
  624. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  625. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  626. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  627. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  628. package/lib/feature-libraries/optional-field/requiredField.d.ts +3 -2
  629. package/lib/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
  630. package/lib/feature-libraries/optional-field/requiredField.js +5 -1
  631. package/lib/feature-libraries/optional-field/requiredField.js.map +1 -1
  632. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  633. package/lib/feature-libraries/schema-index/codec.js +6 -4
  634. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  635. package/lib/feature-libraries/sequence-field/compose.d.ts +6 -7
  636. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  637. package/lib/feature-libraries/sequence-field/compose.js +83 -261
  638. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  639. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  640. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  641. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  642. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  643. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  644. package/lib/feature-libraries/sequence-field/invert.js +67 -169
  645. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  646. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  647. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  648. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  649. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  650. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  651. package/lib/feature-libraries/sequence-field/moveEffectTable.js +6 -84
  652. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  653. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  654. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  655. package/lib/feature-libraries/sequence-field/rebase.js +111 -118
  656. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  657. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  658. package/lib/feature-libraries/sequence-field/replaceRevisions.js +19 -32
  659. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  660. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  661. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +2 -3
  662. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  663. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  664. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  665. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +379 -182
  666. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  667. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  668. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +21 -63
  669. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  670. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  671. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  672. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +13 -13
  673. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  674. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  675. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  676. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +16 -111
  677. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  678. package/lib/feature-libraries/sequence-field/types.d.ts +37 -74
  679. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  680. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  681. package/lib/feature-libraries/sequence-field/utils.d.ts +20 -25
  682. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  683. package/lib/feature-libraries/sequence-field/utils.js +155 -313
  684. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  685. package/lib/index.d.ts +2 -2
  686. package/lib/index.d.ts.map +1 -1
  687. package/lib/index.js +2 -2
  688. package/lib/index.js.map +1 -1
  689. package/lib/legacy.d.ts +1 -0
  690. package/lib/packageVersion.d.ts +1 -1
  691. package/lib/packageVersion.d.ts.map +1 -1
  692. package/lib/packageVersion.js +1 -1
  693. package/lib/packageVersion.js.map +1 -1
  694. package/lib/shared-tree/independentView.d.ts.map +1 -1
  695. package/lib/shared-tree/independentView.js +1 -1
  696. package/lib/shared-tree/independentView.js.map +1 -1
  697. package/lib/shared-tree/index.d.ts +1 -1
  698. package/lib/shared-tree/index.d.ts.map +1 -1
  699. package/lib/shared-tree/index.js.map +1 -1
  700. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  701. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  702. package/lib/shared-tree/schematizeTree.js +3 -2
  703. package/lib/shared-tree/schematizeTree.js.map +1 -1
  704. package/lib/shared-tree/schematizingTreeView.d.ts +1 -5
  705. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  706. package/lib/shared-tree/schematizingTreeView.js +24 -38
  707. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  708. package/lib/shared-tree/sharedTree.d.ts +9 -3
  709. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  710. package/lib/shared-tree/sharedTree.js +4 -1
  711. package/lib/shared-tree/sharedTree.js.map +1 -1
  712. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -0
  713. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  714. package/lib/shared-tree/sharedTreeChangeCodecs.js +9 -1
  715. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  716. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  717. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  718. package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
  719. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  720. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  721. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  722. package/lib/shared-tree/sharedTreeEditBuilder.js +12 -6
  723. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  724. package/lib/shared-tree/tree.d.ts +1 -1
  725. package/lib/shared-tree/tree.js.map +1 -1
  726. package/lib/shared-tree/treeAlpha.d.ts +1 -1
  727. package/lib/shared-tree/treeAlpha.js.map +1 -1
  728. package/lib/shared-tree/treeCheckout.d.ts +13 -11
  729. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  730. package/lib/shared-tree/treeCheckout.js +61 -13
  731. package/lib/shared-tree/treeCheckout.js.map +1 -1
  732. package/lib/shared-tree-core/branch.d.ts +3 -2
  733. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  734. package/lib/shared-tree-core/branch.js +4 -3
  735. package/lib/shared-tree-core/branch.js.map +1 -1
  736. package/lib/shared-tree-core/editManager.d.ts +2 -2
  737. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  738. package/lib/shared-tree-core/editManager.js +9 -9
  739. package/lib/shared-tree-core/editManager.js.map +1 -1
  740. package/lib/shared-tree-core/editManagerCodecs.d.ts +4 -0
  741. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  742. package/lib/shared-tree-core/editManagerCodecs.js +8 -1
  743. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  744. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +3 -3
  745. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  746. package/lib/shared-tree-core/editManagerCodecsCommons.js +2 -2
  747. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  748. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +2 -2
  749. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  750. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +2 -2
  751. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  752. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
  753. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  754. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
  755. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  756. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +1 -0
  757. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  758. package/lib/shared-tree-core/editManagerFormatCommons.js +6 -0
  759. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  760. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  761. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  762. package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  763. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  764. package/lib/shared-tree-core/index.d.ts +2 -2
  765. package/lib/shared-tree-core/index.d.ts.map +1 -1
  766. package/lib/shared-tree-core/index.js +2 -2
  767. package/lib/shared-tree-core/index.js.map +1 -1
  768. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  769. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  770. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  771. package/lib/shared-tree-core/messageCodecs.d.ts +4 -0
  772. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  773. package/lib/shared-tree-core/messageCodecs.js +10 -3
  774. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  775. package/lib/shared-tree-core/messageFormat.d.ts +1 -0
  776. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  777. package/lib/shared-tree-core/messageFormat.js +6 -0
  778. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  779. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  780. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  781. package/lib/shared-tree-core/messageFormatV1ToV4.js +1 -0
  782. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  783. package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -0
  784. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  785. package/lib/shared-tree-core/sharedTreeCore.js +1 -1
  786. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  787. package/lib/simple-tree/api/index.d.ts +1 -1
  788. package/lib/simple-tree/api/index.d.ts.map +1 -1
  789. package/lib/simple-tree/api/index.js +1 -1
  790. package/lib/simple-tree/api/index.js.map +1 -1
  791. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +148 -29
  792. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  793. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +179 -98
  794. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  795. package/lib/simple-tree/api/tree.d.ts +1 -1
  796. package/lib/simple-tree/api/tree.js.map +1 -1
  797. package/lib/simple-tree/api/treeBeta.d.ts +1 -1
  798. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  799. package/lib/simple-tree/core/allowedTypes.d.ts +1 -1
  800. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  801. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +17 -12
  802. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  803. package/lib/simple-tree/core/unhydratedFlexTree.js +87 -8
  804. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  805. package/lib/simple-tree/fieldSchema.d.ts +4 -4
  806. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  807. package/lib/simple-tree/fieldSchema.js.map +1 -1
  808. package/lib/simple-tree/index.d.ts +3 -3
  809. package/lib/simple-tree/index.d.ts.map +1 -1
  810. package/lib/simple-tree/index.js +2 -2
  811. package/lib/simple-tree/index.js.map +1 -1
  812. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  813. package/lib/simple-tree/node-kinds/array/arrayNode.js +11 -18
  814. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  815. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  816. package/lib/simple-tree/node-kinds/common.js +2 -2
  817. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  818. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  819. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  820. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  821. package/lib/simple-tree/node-kinds/object/objectNode.js +20 -20
  822. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  823. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  824. package/lib/simple-tree/node-kinds/record/recordNode.js +4 -2
  825. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  826. package/lib/simple-tree/prepareForInsertion.d.ts +54 -47
  827. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  828. package/lib/simple-tree/prepareForInsertion.js +184 -125
  829. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  830. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +8 -3
  831. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  832. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +56 -17
  833. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  834. package/lib/text/textDomainFormatted.d.ts +3 -3
  835. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  836. package/lib/text/textDomainFormatted.js +30 -14
  837. package/lib/text/textDomainFormatted.js.map +1 -1
  838. package/lib/treeFactory.d.ts.map +1 -1
  839. package/lib/treeFactory.js +13 -3
  840. package/lib/treeFactory.js.map +1 -1
  841. package/lib/util/bTreeUtils.d.ts.map +1 -1
  842. package/lib/util/bTreeUtils.js +6 -6
  843. package/lib/util/bTreeUtils.js.map +1 -1
  844. package/lib/util/index.d.ts +1 -1
  845. package/lib/util/index.d.ts.map +1 -1
  846. package/lib/util/index.js +1 -1
  847. package/lib/util/index.js.map +1 -1
  848. package/lib/util/rangeMap.d.ts +23 -11
  849. package/lib/util/rangeMap.d.ts.map +1 -1
  850. package/lib/util/rangeMap.js +40 -9
  851. package/lib/util/rangeMap.js.map +1 -1
  852. package/package.json +23 -23
  853. package/src/codec/codec.ts +10 -112
  854. package/src/codec/index.ts +0 -3
  855. package/src/codec/versioned/codec.ts +119 -83
  856. package/src/core/change-family/changeFamily.ts +5 -0
  857. package/src/core/change-family/index.ts +1 -0
  858. package/src/core/index.ts +4 -1
  859. package/src/core/rebase/changeRebaser.ts +6 -1
  860. package/src/core/rebase/index.ts +1 -0
  861. package/src/core/rebase/types.ts +4 -0
  862. package/src/core/rebase/utils.ts +31 -7
  863. package/src/core/tree/delta.ts +6 -0
  864. package/src/core/tree/detachedFieldIndex.ts +29 -1
  865. package/src/core/tree/detachedFieldIndexCodecs.ts +6 -4
  866. package/src/core/tree/detachedFieldIndexTypes.ts +5 -0
  867. package/src/core/tree/index.ts +13 -12
  868. package/src/core/tree/pathTree.ts +16 -4
  869. package/src/core/tree/visitDelta.ts +31 -11
  870. package/src/{extensibleSchemaUnion.ts → extensibleUnionNode.ts} +61 -19
  871. package/src/feature-libraries/changeAtomIdBTree.ts +28 -3
  872. package/src/feature-libraries/chunked-forest/codec/codecs.ts +5 -11
  873. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +369 -127
  874. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +13 -4
  875. package/src/feature-libraries/default-schema/index.ts +16 -5
  876. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +231 -0
  877. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +35 -9
  878. package/src/feature-libraries/deltaUtils.ts +6 -1
  879. package/src/feature-libraries/flex-tree/context.ts +17 -0
  880. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +7 -8
  881. package/src/feature-libraries/flex-tree/lazyField.ts +65 -24
  882. package/src/feature-libraries/forest-summary/codec.ts +8 -7
  883. package/src/feature-libraries/forest-summary/formatCommon.ts +5 -3
  884. package/src/feature-libraries/forest-summary/formatV1.ts +1 -3
  885. package/src/feature-libraries/forest-summary/formatV2.ts +1 -3
  886. package/src/feature-libraries/index.ts +22 -9
  887. package/src/feature-libraries/mitigatedChangeFamily.ts +3 -1
  888. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +144 -47
  889. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +113 -58
  890. package/src/feature-libraries/modular-schema/genericFieldKind.ts +7 -18
  891. package/src/feature-libraries/modular-schema/index.ts +16 -16
  892. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +626 -352
  893. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +1 -0
  894. package/src/feature-libraries/modular-schema/modularChangeCodecV3.ts +649 -0
  895. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +14 -0
  896. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2694 -748
  897. package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +1 -0
  898. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +1 -1
  899. package/src/feature-libraries/modular-schema/modularChangeFormatV3.ts +67 -0
  900. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +62 -10
  901. package/src/feature-libraries/optional-field/optionalField.ts +359 -568
  902. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +45 -0
  903. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +31 -35
  904. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
  905. package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +94 -0
  906. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -1
  907. package/src/feature-libraries/optional-field/requiredField.ts +15 -2
  908. package/src/feature-libraries/schema-index/codec.ts +6 -4
  909. package/src/feature-libraries/sequence-field/compose.ts +137 -522
  910. package/src/feature-libraries/sequence-field/helperTypes.ts +34 -19
  911. package/src/feature-libraries/sequence-field/invert.ts +102 -228
  912. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  913. package/src/feature-libraries/sequence-field/moveEffectTable.ts +8 -195
  914. package/src/feature-libraries/sequence-field/rebase.ts +171 -207
  915. package/src/feature-libraries/sequence-field/replaceRevisions.ts +26 -52
  916. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +8 -3
  917. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +677 -229
  918. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +56 -70
  919. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +28 -30
  920. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +21 -131
  921. package/src/feature-libraries/sequence-field/types.ts +40 -79
  922. package/src/feature-libraries/sequence-field/utils.ts +211 -370
  923. package/src/index.ts +3 -3
  924. package/src/packageVersion.ts +1 -1
  925. package/src/shared-tree/independentView.ts +12 -6
  926. package/src/shared-tree/index.ts +3 -2
  927. package/src/shared-tree/schematizeTree.ts +21 -8
  928. package/src/shared-tree/schematizingTreeView.ts +38 -68
  929. package/src/shared-tree/sharedTree.ts +30 -15
  930. package/src/shared-tree/sharedTreeChangeCodecs.ts +10 -2
  931. package/src/shared-tree/sharedTreeChangeFamily.ts +7 -4
  932. package/src/shared-tree/sharedTreeEditBuilder.ts +43 -8
  933. package/src/shared-tree/tree.ts +1 -1
  934. package/src/shared-tree/treeAlpha.ts +1 -1
  935. package/src/shared-tree/treeCheckout.ts +95 -21
  936. package/src/shared-tree-core/branch.ts +8 -2
  937. package/src/shared-tree-core/editManager.ts +16 -2
  938. package/src/shared-tree-core/editManagerCodecs.ts +11 -1
  939. package/src/shared-tree-core/editManagerCodecsCommons.ts +7 -7
  940. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +3 -10
  941. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +3 -10
  942. package/src/shared-tree-core/editManagerFormatCommons.ts +6 -0
  943. package/src/shared-tree-core/editManagerFormatV1toV4.ts +3 -1
  944. package/src/shared-tree-core/index.ts +2 -0
  945. package/src/shared-tree-core/messageCodecV1ToV4.ts +2 -1
  946. package/src/shared-tree-core/messageCodecs.ts +13 -7
  947. package/src/shared-tree-core/messageFormat.ts +6 -0
  948. package/src/shared-tree-core/messageFormatV1ToV4.ts +3 -1
  949. package/src/shared-tree-core/sharedTreeCore.ts +4 -1
  950. package/src/simple-tree/api/index.ts +2 -2
  951. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +344 -142
  952. package/src/simple-tree/api/tree.ts +1 -1
  953. package/src/simple-tree/api/treeBeta.ts +1 -1
  954. package/src/simple-tree/core/allowedTypes.ts +1 -1
  955. package/src/simple-tree/core/unhydratedFlexTree.ts +124 -35
  956. package/src/simple-tree/fieldSchema.ts +6 -4
  957. package/src/simple-tree/index.ts +4 -3
  958. package/src/simple-tree/node-kinds/array/arrayNode.ts +20 -24
  959. package/src/simple-tree/node-kinds/common.ts +2 -5
  960. package/src/simple-tree/node-kinds/map/mapNode.ts +4 -4
  961. package/src/simple-tree/node-kinds/object/objectNode.ts +26 -26
  962. package/src/simple-tree/node-kinds/record/recordNode.ts +10 -9
  963. package/src/simple-tree/prepareForInsertion.ts +342 -200
  964. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +83 -22
  965. package/src/text/textDomainFormatted.ts +37 -17
  966. package/src/treeFactory.ts +16 -4
  967. package/src/util/bTreeUtils.ts +10 -6
  968. package/src/util/index.ts +3 -0
  969. package/src/util/rangeMap.ts +67 -22
  970. package/api-extractor-lint.json +0 -4
  971. package/dist/extensibleSchemaUnion.d.ts +0 -72
  972. package/dist/extensibleSchemaUnion.d.ts.map +0 -1
  973. package/dist/extensibleSchemaUnion.js.map +0 -1
  974. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  975. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  976. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -50
  977. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  978. package/docs/main/sequence-field/move-composition.md +0 -46
  979. package/lib/extensibleSchemaUnion.d.ts +0 -72
  980. package/lib/extensibleSchemaUnion.d.ts.map +0 -1
  981. package/lib/extensibleSchemaUnion.js.map +0 -1
  982. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  983. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  984. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -46
  985. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  986. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
@@ -1 +1 @@
1
- {"version":3,"file":"modularChangeFormatV1.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeFormatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAAE,KAAK,gBAAgB,EAAqB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EACN,KAAK,sBAAsB,EAG3B,MAAM,qBAAqB,CAAC;AAI7B,eAAO,MAAM,sBAAsB,uDAEjC,CAAC;AAEH,eAAO,MAAM,mBAAmB,2aAG9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAErE,eAAO,MAAM,kBAAkB;;;;EAU9B,CAAC;AAEF,MAAM,WAAW,kBAAmB,SAAQ,MAAM,CAAC,OAAO,kBAAkB,CAAC;IAC5E;;OAEG;IACH,MAAM,EAAE,sBAAsB,CAAC;CAC/B;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AAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"modularChangeFormatV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeFormatV1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA0E;AAE1E,kDAA+F;AAC/F,kDAI6B;AAE7B,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAE5D,QAAA,sBAAsB,GAAG,IAAA,4BAAiB,EAAmB;IACzE,UAAU,EAAE,CAAC;CACb,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAG,cAAI,CAAC,KAAK,CAAC;IAC7C,cAAI,CAAC,KAAK,CAAC,CAAC,8BAAsB,EAAE,4BAAiB,CAAC,CAAC;IACvD,8BAAsB;CACtB,CAAC,CAAC;AAGU,QAAA,kBAAkB,GAAG,cAAI,CAAC,MAAM,CAC5C;IACC,QAAQ,EAAE,yBAAc,CAAC,cAAc;IACvC,SAAS,EAAE,yBAAc,CAAC,yBAAyB;IACnD,6EAA6E;IAC7E,0FAA0F;IAC1F,0GAA0G;IAC1G,MAAM,EAAE,uCAA4B;CACpC,EACD,iBAAiB,CACjB,CAAC;AASW,QAAA,qBAAqB,GAAG,cAAI,CAAC,KAAK,CAAC,0BAAkB,CAAC,CAAC;AAWpE,MAAM,2BAA2B,GAAG,cAAI,CAAC,MAAM,CAC9C;IACC,QAAQ,EAAE,cAAI,CAAC,OAAO,EAAE;CACxB,EACD,iBAAiB,CACjB,CAAC;AAGW,QAAA,oBAAoB,GAAG,cAAI,CAAC,MAAM,CAC9C;IACC,YAAY,EAAE,cAAI,CAAC,QAAQ,CAAC,6BAAqB,CAAC;IAClD,oBAAoB,EAAE,cAAI,CAAC,QAAQ,CAAC,2BAA2B,CAAC;CAChE,EACD,iBAAiB,CACjB,CAAC;AAOW,QAAA,mBAAmB,GAAG,cAAI,CAAC,MAAM,CA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Q,CAAC,cAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;CACrE,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { type ChangesetLocalId, RevisionTagSchema, schemaFormatV1 } from \"../../core/index.js\";\nimport {\n\ttype JsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlySchema,\n\tbrandedNumberType,\n} from \"../../util/index.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nexport const ChangesetLocalIdSchema = brandedNumberType<ChangesetLocalId>({\n\tmultipleOf: 1,\n});\n\nexport const EncodedChangeAtomId = Type.Union([\n\tType.Tuple([ChangesetLocalIdSchema, RevisionTagSchema]),\n\tChangesetLocalIdSchema,\n]);\nexport type EncodedChangeAtomId = Static<typeof EncodedChangeAtomId>;\n\nexport const EncodedFieldChange = Type.Object(\n\t{\n\t\tfieldKey: schemaFormatV1.FieldKeySchema,\n\t\tfieldKind: schemaFormatV1.FieldKindIdentifierSchema,\n\t\t// Implementation note: node and field change encoding is mutually recursive.\n\t\t// This field marks a boundary in that recursion to avoid constructing excessively complex\n\t\t// recursive types. Encoded changes are validated at this boundary at runtime--see modularChangeCodecs.ts.\n\t\tchange: JsonCompatibleReadOnlySchema,\n\t},\n\tnoAdditionalProps,\n);\n\nexport interface EncodedFieldChange extends Static<typeof EncodedFieldChange> {\n\t/**\n\t * Encoded in format selected by `fieldKind`\n\t */\n\tchange: JsonCompatibleReadOnly;\n}\n\nexport const EncodedFieldChangeMap = Type.Array(EncodedFieldChange);\n\n/**\n * Format for encoding as json.\n *\n * This chooses to use lists of named objects instead of maps:\n * this choice is somewhat arbitrary, but avoids user data being used as object keys,\n * which can sometimes be an issue (for example handling that for \"__proto__\" can require care).\n */\nexport type EncodedFieldChangeMap = Static<typeof EncodedFieldChangeMap>;\n\nconst EncodedNodeExistsConstraint = Type.Object(\n\t{\n\t\tviolated: Type.Boolean(),\n\t},\n\tnoAdditionalProps,\n);\ntype EncodedNodeExistsConstraint = Static<typeof EncodedNodeExistsConstraint>;\n\nexport const EncodedNodeChangeset = Type.Object(\n\t{\n\t\tfieldChanges: Type.Optional(EncodedFieldChangeMap),\n\t\tnodeExistsConstraint: Type.Optional(EncodedNodeExistsConstraint),\n\t},\n\tnoAdditionalProps,\n);\n\n/**\n * Format for encoding as json.\n */\nexport type EncodedNodeChangeset = Static<typeof EncodedNodeChangeset>;\n\nexport const EncodedRevisionInfo = Type.Object(\n\t{\n\t\trevision: Type.Readonly(RevisionTagSchema),\n\t\trollbackOf: Type.ReadonlyOptional(RevisionTagSchema),\n\t},\n\tnoAdditionalProps,\n);\n\nexport type EncodedRevisionInfo = Static<typeof EncodedRevisionInfo>;\n\n/**\n * Index of field in an EncodedFieldBatch.\n */\nexport const EncodedTreeIndex = Type.Number({ multipleOf: 1, minimum: 0 });\n\nexport const CommitBuilds = Type.Array(\n\tType.Tuple([\n\t\t// ID for first node\n\t\tChangesetLocalIdSchema,\n\t\t// Index for a TreeChunk that represents all the nodes\n\t\tEncodedTreeIndex,\n\t]),\n);\nexport type CommitBuilds = Static<typeof CommitBuilds>;\n\nexport const EncodedBuildsArray = Type.Array(\n\tType.Union([\n\t\tType.Tuple([CommitBuilds, RevisionTagSchema]),\n\t\t// Revision is omitted when undefined\n\t\tType.Tuple([CommitBuilds]),\n\t]),\n);\n\nexport type EncodedBuildsArray = Static<typeof EncodedBuildsArray>;\n\nexport const EncodedBuilds = Type.Object(\n\t{\n\t\tbuilds: EncodedBuildsArray,\n\t\t/**\n\t\t * FieldBatch codec encoded data indexed by the EncodedTreeIndexes above.\n\t\t */\n\t\ttrees: JsonCompatibleReadOnlySchema,\n\t},\n\tnoAdditionalProps,\n);\n\nexport type EncodedBuilds = Static<typeof EncodedBuilds>;\n\nexport const EncodedModularChangesetV1 = Type.Object(\n\t{\n\t\tmaxId: Type.Optional(ChangesetLocalIdSchema),\n\t\tchanges: EncodedFieldChangeMap,\n\t\trevisions: Type.ReadonlyOptional(Type.Array(EncodedRevisionInfo)),\n\t\t// TODO#8574: separating `builds` and `refreshers` here means that we encode their `EncodedBuilds.trees` separately.\n\t\t// This can lead to a less efficient wire representation because of duplicated schema/shape information.\n\t\tbuilds: Type.Optional(EncodedBuilds),\n\t\trefreshers: Type.Optional(EncodedBuilds),\n\t\t/**\n\t\t * The number of constraints within this changeset that are violated.\n\t\t */\n\t\tviolations: Type.Optional(Type.Number({ minimum: 0, multipleOf: 1 })),\n\t},\n\tnoAdditionalProps,\n);\n\nexport type EncodedModularChangesetV1 = Static<typeof EncodedModularChangesetV1>;\n"]}
1
+ {"version":3,"file":"modularChangeFormatV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeFormatV1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA0E;AAE1E,kDAA+F;AAC/F,kDAI6B;AAE7B,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAE5D,QAAA,sBAAsB,GAAG,IAAA,4BAAiB,EAAmB;IACzE,UAAU,EAAE,CAAC;CACb,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAG,cAAI,CAAC,KAAK,CAAC;IAC7C,cAAI,CAAC,KAAK,CAAC,CAAC,8BAAsB,EAAE,4BAAiB,CAAC,CAAC;IACvD,8BAAsB;CACtB,CAAC,CAAC;AAGU,QAAA,kBAAkB,GAAG,cAAI,CAAC,MAAM,CAC5C;IACC,QAAQ,EAAE,yBAAc,CAAC,cAAc;IACvC,SAAS,EAAE,yBAAc,CAAC,yBAAyB;IACnD,6EAA6E;IAC7E,0FAA0F;IAC1F,0GAA0G;IAC1G,MAAM,EAAE,uCAA4B;CACpC,EACD,iBAAiB,CACjB,CAAC;AASW,QAAA,qBAAqB,GAAG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CAAC;AAIW,QAAA,yBAAyB,GAAG,cAAI,CAAC,MAAM,CACnD;IACC,KAAK,EAAE,cAAI,CAAC,QAAQ,CAAC,8BAAsB,CAAC;IAC5C,OAAO,EAAE,6BAAqB;IAC9B,SAAS,EAAE,cAAI,CAAC,gBAAgB,CAAC,cAAI,CAAC,KAAK,CAAC,2BAAmB,CAAC,CAAC;IACjE,oHAAoH;IACpH,wGAAwG;IACxG,MAAM,EAAE,cAAI,CAAC,QAAQ,CAAC,qBAAa,CAAC;IACpC,UAAU,EAAE,cAAI,CAAC,QAAQ,CAAC,qBAAa,CAAC;IAExC;;OAEG;IACH,UAAU,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;CACrE,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { type ChangesetLocalId, RevisionTagSchema, schemaFormatV1 } from \"../../core/index.js\";\nimport {\n\ttype JsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlySchema,\n\tbrandedNumberType,\n} from \"../../util/index.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nexport const ChangesetLocalIdSchema = brandedNumberType<ChangesetLocalId>({\n\tmultipleOf: 1,\n});\n\nexport const EncodedChangeAtomId = Type.Union([\n\tType.Tuple([ChangesetLocalIdSchema, RevisionTagSchema]),\n\tChangesetLocalIdSchema,\n]);\nexport type EncodedChangeAtomId = Static<typeof EncodedChangeAtomId>;\n\nexport const EncodedFieldChange = Type.Object(\n\t{\n\t\tfieldKey: schemaFormatV1.FieldKeySchema,\n\t\tfieldKind: schemaFormatV1.FieldKindIdentifierSchema,\n\t\t// Implementation note: node and field change encoding is mutually recursive.\n\t\t// This field marks a boundary in that recursion to avoid constructing excessively complex\n\t\t// recursive types. Encoded changes are validated at this boundary at runtime--see modularChangeCodecs.ts.\n\t\tchange: JsonCompatibleReadOnlySchema,\n\t},\n\tnoAdditionalProps,\n);\n\nexport interface EncodedFieldChange extends Static<typeof EncodedFieldChange> {\n\t/**\n\t * Encoded in format selected by `fieldKind`\n\t */\n\tchange: JsonCompatibleReadOnly;\n}\n\nexport const EncodedFieldChangeMap = Type.Array(EncodedFieldChange);\n\n/**\n * Format for encoding as json.\n *\n * This chooses to use lists of named objects instead of maps:\n * this choice is somewhat arbitrary, but avoids user data being used as object keys,\n * which can sometimes be an issue (for example handling that for \"__proto__\" can require care).\n */\nexport type EncodedFieldChangeMap = Static<typeof EncodedFieldChangeMap>;\n\nconst EncodedNodeExistsConstraint = Type.Object(\n\t{\n\t\tviolated: Type.Boolean(),\n\t},\n\tnoAdditionalProps,\n);\ntype EncodedNodeExistsConstraint = Static<typeof EncodedNodeExistsConstraint>;\n\nexport const EncodedNodeChangeset = Type.Object(\n\t{\n\t\tfieldChanges: Type.Optional(EncodedFieldChangeMap),\n\t\tnodeExistsConstraint: Type.Optional(EncodedNodeExistsConstraint),\n\t},\n\tnoAdditionalProps,\n);\n\n/**\n * Format for encoding as json.\n */\nexport type EncodedNodeChangeset = Static<typeof EncodedNodeChangeset>;\n\nexport const EncodedRevisionInfo = Type.Object(\n\t{\n\t\trevision: Type.Readonly(RevisionTagSchema),\n\t\trollbackOf: Type.ReadonlyOptional(RevisionTagSchema),\n\t},\n\tnoAdditionalProps,\n);\n\nexport type EncodedRevisionInfo = Static<typeof EncodedRevisionInfo>;\n\n/**\n * Index of field in an EncodedFieldBatch.\n */\nexport const EncodedTreeIndex = Type.Number({ multipleOf: 1, minimum: 0 });\n\nexport const CommitBuilds = Type.Array(\n\tType.Tuple([\n\t\t// ID for first node\n\t\tChangesetLocalIdSchema,\n\t\t// Index for a TreeChunk that represents all the nodes\n\t\tEncodedTreeIndex,\n\t]),\n);\nexport type CommitBuilds = Static<typeof CommitBuilds>;\n\nexport const EncodedBuildsArray = Type.Array(\n\tType.Union([\n\t\tType.Tuple([CommitBuilds, RevisionTagSchema]),\n\t\t// Revision is omitted when undefined\n\t\tType.Tuple([CommitBuilds]),\n\t]),\n);\n\nexport type EncodedBuildsArray = Static<typeof EncodedBuildsArray>;\n\nexport const EncodedBuilds = Type.Object(\n\t{\n\t\tbuilds: EncodedBuildsArray,\n\t\t/**\n\t\t * FieldBatch codec encoded data indexed by the EncodedTreeIndexes above.\n\t\t */\n\t\ttrees: JsonCompatibleReadOnlySchema,\n\t},\n\tnoAdditionalProps,\n);\n\nexport type EncodedBuilds = Static<typeof EncodedBuilds>;\n\nexport const EncodedModularChangesetV1 = Type.Object(\n\t{\n\t\tmaxId: Type.Optional(ChangesetLocalIdSchema),\n\t\tchanges: EncodedFieldChangeMap,\n\t\trevisions: Type.ReadonlyOptional(Type.Array(EncodedRevisionInfo)),\n\t\t// TODO#8574: separating `builds` and `refreshers` here means that we encode their `EncodedBuilds.trees` separately.\n\t\t// This can lead to a less efficient wire representation because of duplicated schema/shape information.\n\t\tbuilds: Type.Optional(EncodedBuilds),\n\t\trefreshers: Type.Optional(EncodedBuilds),\n\n\t\t/**\n\t\t * The number of constraints within this changeset that are violated.\n\t\t */\n\t\tviolations: Type.Optional(Type.Number({ minimum: 0, multipleOf: 1 })),\n\t},\n\tnoAdditionalProps,\n);\n\nexport type EncodedModularChangesetV1 = Static<typeof EncodedModularChangesetV1>;\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { type Static } from "@sinclair/typebox";
6
- declare const EncodedNoChangeConstraint: import("@sinclair/typebox").TObject<{
6
+ export declare const EncodedNoChangeConstraint: import("@sinclair/typebox").TObject<{
7
7
  violated: import("@sinclair/typebox").TBoolean;
8
8
  }>;
9
9
  export type EncodedNoChangeConstraint = Static<typeof EncodedNoChangeConstraint>;
@@ -32,5 +32,4 @@ export declare const EncodedModularChangesetV2: import("@sinclair/typebox").TObj
32
32
  }>>;
33
33
  }>;
34
34
  export type EncodedModularChangesetV2 = Static<typeof EncodedModularChangesetV2>;
35
- export {};
36
35
  //# sourceMappingURL=modularChangeFormatV2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"modularChangeFormatV2.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeFormatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAM1E,QAAA,MAAM,yBAAyB;;EAK9B,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAEjF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;EAYrC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
1
+ {"version":3,"file":"modularChangeFormatV2.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeFormatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAM1E,eAAO,MAAM,yBAAyB;;EAKrC,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAEjF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;EAYrC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -4,18 +4,18 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.EncodedModularChangesetV2 = void 0;
7
+ exports.EncodedModularChangesetV2 = exports.EncodedNoChangeConstraint = void 0;
8
8
  const typebox_1 = require("@sinclair/typebox");
9
9
  const modularChangeFormatV1_js_1 = require("./modularChangeFormatV1.js");
10
10
  const noAdditionalProps = { additionalProperties: false };
11
- const EncodedNoChangeConstraint = typebox_1.Type.Object({
11
+ exports.EncodedNoChangeConstraint = typebox_1.Type.Object({
12
12
  violated: typebox_1.Type.Boolean(),
13
13
  }, noAdditionalProps);
14
14
  exports.EncodedModularChangesetV2 = typebox_1.Type.Composite([
15
15
  modularChangeFormatV1_js_1.EncodedModularChangesetV1,
16
16
  typebox_1.Type.Object({
17
17
  /** Global no change constraint that gets violated whenever the changeset is rebased */
18
- noChangeConstraint: typebox_1.Type.Optional(EncodedNoChangeConstraint),
18
+ noChangeConstraint: typebox_1.Type.Optional(exports.EncodedNoChangeConstraint),
19
19
  }, noAdditionalProps),
20
20
  ], noAdditionalProps);
21
21
  //# sourceMappingURL=modularChangeFormatV2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modularChangeFormatV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeFormatV2.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA0E;AAE1E,yEAAuE;AAEvE,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAEzE,MAAM,yBAAyB,GAAG,cAAI,CAAC,MAAM,CAC5C;IACC,QAAQ,EAAE,cAAI,CAAC,OAAO,EAAE;CACxB,EACD,iBAAiB,CACjB,CAAC;AAGW,QAAA,yBAAyB,GAAG,cAAI,CAAC,SAAS,CACtD;IACC,oDAAyB;IACzB,cAAI,CAAC,MAAM,CACV;QACC,uFAAuF;QACvF,kBAAkB,EAAE,cAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC;KAC5D,EACD,iBAAiB,CACjB;CACD,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { EncodedModularChangesetV1 } from \"./modularChangeFormatV1.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nconst EncodedNoChangeConstraint = Type.Object(\n\t{\n\t\tviolated: Type.Boolean(),\n\t},\n\tnoAdditionalProps,\n);\nexport type EncodedNoChangeConstraint = Static<typeof EncodedNoChangeConstraint>;\n\nexport const EncodedModularChangesetV2 = Type.Composite(\n\t[\n\t\tEncodedModularChangesetV1,\n\t\tType.Object(\n\t\t\t{\n\t\t\t\t/** Global no change constraint that gets violated whenever the changeset is rebased */\n\t\t\t\tnoChangeConstraint: Type.Optional(EncodedNoChangeConstraint),\n\t\t\t},\n\t\t\tnoAdditionalProps,\n\t\t),\n\t],\n\tnoAdditionalProps,\n);\n\nexport type EncodedModularChangesetV2 = Static<typeof EncodedModularChangesetV2>;\n"]}
1
+ {"version":3,"file":"modularChangeFormatV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeFormatV2.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA0E;AAE1E,yEAAuE;AAEvE,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAE5D,QAAA,yBAAyB,GAAG,cAAI,CAAC,MAAM,CACnD;IACC,QAAQ,EAAE,cAAI,CAAC,OAAO,EAAE;CACxB,EACD,iBAAiB,CACjB,CAAC;AAGW,QAAA,yBAAyB,GAAG,cAAI,CAAC,SAAS,CACtD;IACC,oDAAyB;IACzB,cAAI,CAAC,MAAM,CACV;QACC,uFAAuF;QACvF,kBAAkB,EAAE,cAAI,CAAC,QAAQ,CAAC,iCAAyB,CAAC;KAC5D,EACD,iBAAiB,CACjB;CACD,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { EncodedModularChangesetV1 } from \"./modularChangeFormatV1.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nexport const EncodedNoChangeConstraint = Type.Object(\n\t{\n\t\tviolated: Type.Boolean(),\n\t},\n\tnoAdditionalProps,\n);\nexport type EncodedNoChangeConstraint = Static<typeof EncodedNoChangeConstraint>;\n\nexport const EncodedModularChangesetV2 = Type.Composite(\n\t[\n\t\tEncodedModularChangesetV1,\n\t\tType.Object(\n\t\t\t{\n\t\t\t\t/** Global no change constraint that gets violated whenever the changeset is rebased */\n\t\t\t\tnoChangeConstraint: Type.Optional(EncodedNoChangeConstraint),\n\t\t\t},\n\t\t\tnoAdditionalProps,\n\t\t),\n\t],\n\tnoAdditionalProps,\n);\n\nexport type EncodedModularChangesetV2 = Static<typeof EncodedModularChangesetV2>;\n"]}
@@ -0,0 +1,74 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { type Static } from "@sinclair/typebox";
6
+ declare const EncodedRenames: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
7
+ oldId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>]>, import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>]>;
8
+ newId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>]>, import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>]>;
9
+ count: import("@sinclair/typebox").TNumber;
10
+ }>>>;
11
+ export type EncodedRenames = Static<typeof EncodedRenames>;
12
+ declare const EncodedRootNodes: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
13
+ detachId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>]>, import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>]>;
14
+ nodeChangeset: import("@sinclair/typebox").TObject<{
15
+ fieldChanges: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
16
+ fieldKey: import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKey>;
17
+ fieldKind: import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKindIdentifier>;
18
+ change: import("@sinclair/typebox").TUnsafe<import("../../index.js").JsonCompatibleReadOnly>;
19
+ }>>>;
20
+ nodeExistsConstraint: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
21
+ violated: import("@sinclair/typebox").TBoolean;
22
+ }>>;
23
+ }>;
24
+ }>>>;
25
+ export type EncodedRootNodes = Static<typeof EncodedRootNodes>;
26
+ export declare const EncodedModularChangesetV3: import("@sinclair/typebox").TObject<{
27
+ maxId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>>;
28
+ fieldChanges: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
29
+ fieldKey: import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKey>;
30
+ fieldKind: import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKindIdentifier>;
31
+ change: import("@sinclair/typebox").TUnsafe<import("../../index.js").JsonCompatibleReadOnly>;
32
+ }>>;
33
+ rootNodes: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
34
+ detachId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>]>, import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>]>;
35
+ nodeChangeset: import("@sinclair/typebox").TObject<{
36
+ fieldChanges: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
37
+ fieldKey: import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKey>;
38
+ fieldKind: import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKindIdentifier>;
39
+ change: import("@sinclair/typebox").TUnsafe<import("../../index.js").JsonCompatibleReadOnly>;
40
+ }>>>;
41
+ nodeExistsConstraint: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
42
+ violated: import("@sinclair/typebox").TBoolean;
43
+ }>>;
44
+ }>;
45
+ }>>>;
46
+ nodeRenames: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
47
+ oldId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>]>, import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>]>;
48
+ newId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>]>, import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>]>;
49
+ count: import("@sinclair/typebox").TNumber;
50
+ }>>>;
51
+ revisions: import("@sinclair/typebox").TReadonlyOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
52
+ revision: import("@sinclair/typebox").TReadonly<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>>;
53
+ rollbackOf: import("@sinclair/typebox").TReadonlyOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>>;
54
+ }>>>;
55
+ builds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
56
+ builds: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TNumber]>>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>]>, import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TNumber]>>]>]>>;
57
+ trees: import("@sinclair/typebox").TUnsafe<import("../../index.js").JsonCompatibleReadOnly>;
58
+ }>>;
59
+ refreshers: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
60
+ builds: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TNumber]>>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>]>, import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TNumber]>>]>]>>;
61
+ trees: import("@sinclair/typebox").TUnsafe<import("../../index.js").JsonCompatibleReadOnly>;
62
+ }>>;
63
+ /**
64
+ * The number of constraints within this changeset that are violated.
65
+ */
66
+ violations: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
67
+ /** Global no change constraint that gets violated whenever the changeset is rebased */
68
+ noChangeConstraint: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
69
+ violated: import("@sinclair/typebox").TBoolean;
70
+ }>>;
71
+ }>;
72
+ export type EncodedModularChangesetV3 = Static<typeof EncodedModularChangesetV3>;
73
+ export {};
74
+ //# sourceMappingURL=modularChangeFormatV3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modularChangeFormatV3.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeFormatV3.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAc1E,QAAA,MAAM,cAAc;;;;IASnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AAE3D,QAAA,MAAM,gBAAgB;;;;;;;;;;;;IAOrB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE/D,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAYpC;;OAEG;;IAGH,uFAAuF;;;;EAIxF,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.EncodedModularChangesetV3 = void 0;
8
+ const typebox_1 = require("@sinclair/typebox");
9
+ const modularChangeFormatV1_js_1 = require("./modularChangeFormatV1.js");
10
+ const modularChangeFormatV2_js_1 = require("./modularChangeFormatV2.js");
11
+ const noAdditionalProps = { additionalProperties: false };
12
+ const EncodedRenames = typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
13
+ oldId: modularChangeFormatV1_js_1.EncodedChangeAtomId,
14
+ newId: modularChangeFormatV1_js_1.EncodedChangeAtomId,
15
+ count: typebox_1.Type.Number(),
16
+ }), noAdditionalProps));
17
+ const EncodedRootNodes = typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({ detachId: modularChangeFormatV1_js_1.EncodedChangeAtomId, nodeChangeset: modularChangeFormatV1_js_1.EncodedNodeChangeset }, noAdditionalProps)));
18
+ exports.EncodedModularChangesetV3 = typebox_1.Type.Object({
19
+ maxId: typebox_1.Type.Optional(modularChangeFormatV1_js_1.ChangesetLocalIdSchema),
20
+ fieldChanges: modularChangeFormatV1_js_1.EncodedFieldChangeMap,
21
+ rootNodes: EncodedRootNodes,
22
+ nodeRenames: EncodedRenames,
23
+ revisions: typebox_1.Type.ReadonlyOptional(typebox_1.Type.Array(modularChangeFormatV1_js_1.EncodedRevisionInfo)),
24
+ // TODO#8574: separating `builds` and `refreshers` here means that we encode their `EncodedBuilds.trees` separately.
25
+ // This can lead to a less efficient wire representation because of duplicated schema/shape information.
26
+ builds: typebox_1.Type.Optional(modularChangeFormatV1_js_1.EncodedBuilds),
27
+ refreshers: typebox_1.Type.Optional(modularChangeFormatV1_js_1.EncodedBuilds),
28
+ /**
29
+ * The number of constraints within this changeset that are violated.
30
+ */
31
+ violations: typebox_1.Type.Optional(typebox_1.Type.Number({ minimum: 0, multipleOf: 1 })),
32
+ /** Global no change constraint that gets violated whenever the changeset is rebased */
33
+ noChangeConstraint: typebox_1.Type.Optional(modularChangeFormatV2_js_1.EncodedNoChangeConstraint),
34
+ }, noAdditionalProps);
35
+ //# sourceMappingURL=modularChangeFormatV3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modularChangeFormatV3.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeFormatV3.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA0E;AAE1E,yEAOoC;AACpC,yEAAuE;AAEvE,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAEzE,MAAM,cAAc,GAAG,cAAI,CAAC,QAAQ,CACnC,cAAI,CAAC,KAAK,CACT,cAAI,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,8CAAmB;IAC1B,KAAK,EAAE,8CAAmB;IAC1B,KAAK,EAAE,cAAI,CAAC,MAAM,EAAE;CACpB,CAAC,EACF,iBAAiB,CACjB,CACD,CAAC;AAIF,MAAM,gBAAgB,GAAG,cAAI,CAAC,QAAQ,CACrC,cAAI,CAAC,KAAK,CACT,cAAI,CAAC,MAAM,CACV,EAAE,QAAQ,EAAE,8CAAmB,EAAE,aAAa,EAAE,+CAAoB,EAAE,EACtE,iBAAiB,CACjB,CACD,CACD,CAAC;AAIW,QAAA,yBAAyB,GAAG,cAAI,CAAC,MAAM,CACnD;IACC,KAAK,EAAE,cAAI,CAAC,QAAQ,CAAC,iDAAsB,CAAC;IAC5C,YAAY,EAAE,gDAAqB;IACnC,SAAS,EAAE,gBAAgB;IAC3B,WAAW,EAAE,cAAc;IAC3B,SAAS,EAAE,cAAI,CAAC,gBAAgB,CAAC,cAAI,CAAC,KAAK,CAAC,8CAAmB,CAAC,CAAC;IACjE,oHAAoH;IACpH,wGAAwG;IACxG,MAAM,EAAE,cAAI,CAAC,QAAQ,CAAC,wCAAa,CAAC;IACpC,UAAU,EAAE,cAAI,CAAC,QAAQ,CAAC,wCAAa,CAAC;IAExC;;OAEG;IACH,UAAU,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;IAErE,uFAAuF;IACvF,kBAAkB,EAAE,cAAI,CAAC,QAAQ,CAAC,oDAAyB,CAAC;CAC5D,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport {\n\tChangesetLocalIdSchema,\n\tEncodedBuilds,\n\tEncodedChangeAtomId,\n\tEncodedFieldChangeMap,\n\tEncodedNodeChangeset,\n\tEncodedRevisionInfo,\n} from \"./modularChangeFormatV1.js\";\nimport { EncodedNoChangeConstraint } from \"./modularChangeFormatV2.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nconst EncodedRenames = Type.Optional(\n\tType.Array(\n\t\tType.Object({\n\t\t\toldId: EncodedChangeAtomId,\n\t\t\tnewId: EncodedChangeAtomId,\n\t\t\tcount: Type.Number(),\n\t\t}),\n\t\tnoAdditionalProps,\n\t),\n);\n\nexport type EncodedRenames = Static<typeof EncodedRenames>;\n\nconst EncodedRootNodes = Type.Optional(\n\tType.Array(\n\t\tType.Object(\n\t\t\t{ detachId: EncodedChangeAtomId, nodeChangeset: EncodedNodeChangeset },\n\t\t\tnoAdditionalProps,\n\t\t),\n\t),\n);\n\nexport type EncodedRootNodes = Static<typeof EncodedRootNodes>;\n\nexport const EncodedModularChangesetV3 = Type.Object(\n\t{\n\t\tmaxId: Type.Optional(ChangesetLocalIdSchema),\n\t\tfieldChanges: EncodedFieldChangeMap,\n\t\trootNodes: EncodedRootNodes,\n\t\tnodeRenames: EncodedRenames,\n\t\trevisions: Type.ReadonlyOptional(Type.Array(EncodedRevisionInfo)),\n\t\t// TODO#8574: separating `builds` and `refreshers` here means that we encode their `EncodedBuilds.trees` separately.\n\t\t// This can lead to a less efficient wire representation because of duplicated schema/shape information.\n\t\tbuilds: Type.Optional(EncodedBuilds),\n\t\trefreshers: Type.Optional(EncodedBuilds),\n\n\t\t/**\n\t\t * The number of constraints within this changeset that are violated.\n\t\t */\n\t\tviolations: Type.Optional(Type.Number({ minimum: 0, multipleOf: 1 })),\n\n\t\t/** Global no change constraint that gets violated whenever the changeset is rebased */\n\t\tnoChangeConstraint: Type.Optional(EncodedNoChangeConstraint),\n\t},\n\tnoAdditionalProps,\n);\n\nexport type EncodedModularChangesetV3 = Static<typeof EncodedModularChangesetV3>;\n"]}
@@ -2,12 +2,14 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type ChangeAtomId, type ChangesetLocalId, type FieldKey, type FieldKindIdentifier, type RevisionInfo } from "../../core/index.js";
5
+ import { type ChangeAtomId, type ChangeAtomIdRangeMap, type ChangesetLocalId, type EditorOptions, type FieldKey, type FieldKindIdentifier, type RevisionInfo } from "../../core/index.js";
6
6
  import { RangeMap, type Brand } from "../../util/index.js";
7
7
  import type { ChangeAtomIdBTree } from "../changeAtomIdBTree.js";
8
8
  import type { TreeChunk } from "../chunked-forest/index.js";
9
- import type { CrossFieldTarget } from "./crossFieldQueries.js";
9
+ import type { NodeMoveType } from "./crossFieldQueries.js";
10
+ export type RebaseVersion = 1 | 2;
10
11
  export interface ModularChangeset extends HasFieldChanges {
12
+ readonly rebaseVersion: RebaseVersion;
11
13
  /**
12
14
  * The numerically highest `ChangesetLocalId` used in this changeset.
13
15
  * If undefined then this changeset contains no IDs.
@@ -24,10 +26,12 @@ export interface ModularChangeset extends HasFieldChanges {
24
26
  * Maps from this changeset's canonical ID for a node (see comment on node aliases) to the changes for that node.
25
27
  */
26
28
  readonly nodeChanges: ChangeAtomIdBTree<NodeChangeset>;
29
+ readonly rootNodes: RootNodeTable;
27
30
  /**
28
- * Maps from this changeset's canonical ID for a node to the ID for the field which contains that node.
31
+ * Maps from this changeset's canonical ID for a node to the ID for the field which contains that node,
32
+ * or the detach ID, if this node is detached.
29
33
  */
30
- readonly nodeToParent: ChangeAtomIdBTree<FieldId>;
34
+ readonly nodeToParent: ChangeAtomIdBTree<NodeLocation>;
31
35
  /**
32
36
  * Maps from a node ID to another ID for the same node.
33
37
  * If a node ID used in this changeset has no entry in this table, then it is the canonical ID for that node.
@@ -59,10 +63,27 @@ export interface ModularChangeset extends HasFieldChanges {
59
63
  readonly destroys?: ChangeAtomIdBTree<number>;
60
64
  readonly refreshers?: ChangeAtomIdBTree<TreeChunk>;
61
65
  }
62
- export type CrossFieldKeyTable = RangeMap<CrossFieldKey, FieldId>;
63
- export declare function newCrossFieldKeyTable(): CrossFieldKeyTable;
66
+ export interface RootNodeTable {
67
+ readonly oldToNewId: ChangeAtomIdRangeMap<ChangeAtomId>;
68
+ readonly newToOldId: ChangeAtomIdRangeMap<ChangeAtomId>;
69
+ readonly nodeChanges: ChangeAtomIdBTree<NodeId>;
70
+ /**
71
+ * Maps from input context detach ID to the field where the node was last attached.
72
+ * There should be an entry for every detach ID referenced in `oldToNewId` or `nodeChanges`.
73
+ */
74
+ readonly detachLocations: ChangeAtomIdRangeMap<FieldId>;
75
+ /**
76
+ * Maps from the output root ID of a node to the output detach location of that node.
77
+ * This is only guaranteed to contain entries for nodes which have an output detach location
78
+ * which is different from their location in the input context.
79
+ */
80
+ readonly outputDetachLocations: ChangeAtomIdRangeMap<FieldId>;
81
+ }
82
+ export type CrossFieldRangeTable<T> = RangeMap<CrossFieldKey, T>;
83
+ export type CrossFieldKeyTable = CrossFieldRangeTable<FieldId>;
84
+ export declare function newCrossFieldRangeTable<V>(): CrossFieldRangeTable<V>;
64
85
  export interface CrossFieldKey extends ChangeAtomId {
65
- readonly target: CrossFieldTarget;
86
+ readonly target: NodeMoveType;
66
87
  }
67
88
  export interface CrossFieldKeyRange {
68
89
  readonly key: CrossFieldKey;
@@ -72,6 +93,21 @@ export interface FieldId {
72
93
  readonly nodeId: NodeId | undefined;
73
94
  readonly field: FieldKey;
74
95
  }
96
+ export interface FieldParent {
97
+ readonly field: FieldId;
98
+ readonly root?: undefined;
99
+ }
100
+ export interface RootParent {
101
+ readonly field?: undefined;
102
+ readonly root: ChangeAtomId;
103
+ }
104
+ export type NodeLocation = FieldParent | RootParent;
105
+ export interface DetachLocation {
106
+ readonly field: FieldId;
107
+ readonly atomId: ChangeAtomId | undefined;
108
+ }
109
+ /**
110
+ */
75
111
  export interface NodeExistsConstraint {
76
112
  violated: boolean;
77
113
  }
@@ -86,13 +122,13 @@ export interface NoChangeConstraint {
86
122
  */
87
123
  export interface NodeChangeset extends HasFieldChanges {
88
124
  /** Keeps track of whether node exists constraint has been violated by this change */
89
- nodeExistsConstraint?: NodeExistsConstraint;
125
+ readonly nodeExistsConstraint?: NodeExistsConstraint;
90
126
  /** Keeps track of whether node exists constraint will be violated when this change is reverted */
91
- nodeExistsConstraintOnRevert?: NodeExistsConstraint;
127
+ readonly nodeExistsConstraintOnRevert?: NodeExistsConstraint;
92
128
  }
93
129
  export type NodeId = ChangeAtomId;
94
130
  export interface HasFieldChanges {
95
- fieldChanges?: FieldChangeMap;
131
+ readonly fieldChanges?: FieldChangeMap;
96
132
  }
97
133
  export type FieldChangeMap = Map<FieldKey, FieldChange>;
98
134
  export interface FieldChange {
@@ -100,4 +136,7 @@ export interface FieldChange {
100
136
  change: FieldChangeset;
101
137
  }
102
138
  export type FieldChangeset = Brand<unknown, "FieldChangeset">;
139
+ export interface ModularEditorOptions extends EditorOptions {
140
+ readonly rebaseVersionOverride?: RebaseVersion;
141
+ }
103
142
  //# sourceMappingURL=modularChangeTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"modularChangeTypes.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAS,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACxD;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,gBAAgB,CAAC;IAClC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAC7C,QAAQ,CAAC,YAAY,EAAE,cAAc,CAAC;IAEtC;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;IAEvD;;OAEG;IAEH,QAAQ,CAAC,YAAY,EAAE,iBAAiB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AC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,eAAe;IACrD,qFAAqF;IACrF,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,kGAAkG;IAClG,4BAA4B,CAAC,EAAE,oBAAoB,CAAC;CACpD;AAED,MAAM,MAAM,MAAM,GAAG,YAAY,CAAC;AAElC,MAAM,WAAW,eAAe;IAC/B,YAAY,CAAC,EAAE,cAAc,CAAC;CAC9B;AAED,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAExD,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IACxC,MAAM,EAAE,cAAc,CAAC;CACvB;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"modularChangeTypes.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAS,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,CAAC;AAElC,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACxD,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IAEtC;;;OAGG;IACH,QA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,kBAAkB;IAClC,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,eAAe;IACrD,qFAAqF;IACrF,QAAQ,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAErD,kGAAkG;IAClG,QAAQ,CAAC,4BAA4B,CAAC,EAAE,oBAAoB,CAAC;CAC7D;AAED,MAAM,MAAM,MAAM,GAAG,YAAY,CAAC;AAElC,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,cAAc,CAAC;CACvC;AAED,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAExD,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IACxC,MAAM,EAAE,cAAc,CAAC;CACvB;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;AAE9D,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IAC1D,QAAQ,CAAC,qBAAqB,CAAC,EAAE,aAAa,CAAC;CAC/C"}
@@ -4,13 +4,13 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.newCrossFieldKeyTable = void 0;
7
+ exports.newCrossFieldRangeTable = void 0;
8
8
  const index_js_1 = require("../../core/index.js");
9
9
  const index_js_2 = require("../../util/index.js");
10
- function newCrossFieldKeyTable() {
10
+ function newCrossFieldRangeTable() {
11
11
  return new index_js_2.RangeMap(offsetCrossFieldKey, subtractCrossFieldKeys);
12
12
  }
13
- exports.newCrossFieldKeyTable = newCrossFieldKeyTable;
13
+ exports.newCrossFieldRangeTable = newCrossFieldRangeTable;
14
14
  function offsetCrossFieldKey(key, offset) {
15
15
  return {
16
16
  ...key,
@@ -1 +1 @@
1
- {"version":3,"file":"modularChangeTypes.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAO6B;AAC7B,kDAAkE;AAiElE,SAAgB,qBAAqB;IACpC,OAAO,IAAI,mBAAQ,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,CAAC;AAClE,CAAC;AAFD,sDAEC;AAED,SAAS,mBAAmB,CAAC,GAAkB,EAAE,MAAc;IAC9D,OAAO;QACN,GAAG,GAAG;QACN,OAAO,EAAE,IAAA,gBAAK,EAAC,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;KACpC,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,CAAgB,EAAE,CAAgB;IACjE,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,SAAS,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAC7C,CAAC;IAED,OAAO,IAAA,gCAAqB,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tsubtractChangeAtomIds,\n\ttype ChangeAtomId,\n\ttype ChangesetLocalId,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype RevisionInfo,\n} from \"../../core/index.js\";\nimport { brand, RangeMap, type Brand } from \"../../util/index.js\";\nimport type { ChangeAtomIdBTree } from \"../changeAtomIdBTree.js\";\nimport type { TreeChunk } from \"../chunked-forest/index.js\";\n\nimport type { CrossFieldTarget } from \"./crossFieldQueries.js\";\n\nexport interface ModularChangeset extends HasFieldChanges {\n\t/**\n\t * The numerically highest `ChangesetLocalId` used in this changeset.\n\t * If undefined then this changeset contains no IDs.\n\t */\n\treadonly maxId?: ChangesetLocalId;\n\t/**\n\t * The revisions included in this changeset, ordered temporally (oldest to newest).\n\t * Undefined for anonymous changesets.\n\t * Should never be empty.\n\t */\n\treadonly revisions?: readonly RevisionInfo[];\n\treadonly fieldChanges: FieldChangeMap;\n\n\t/**\n\t * Maps from this changeset's canonical ID for a node (see comment on node aliases) to the changes for that node.\n\t */\n\treadonly nodeChanges: ChangeAtomIdBTree<NodeChangeset>;\n\n\t/**\n\t * Maps from this changeset's canonical ID for a node to the ID for the field which contains that node.\n\t */\n\t// TODO: Should this be merged with `nodeChanges`?\n\treadonly nodeToParent: ChangeAtomIdBTree<FieldId>;\n\n\t/**\n\t * Maps from a node ID to another ID for the same node.\n\t * If a node ID used in this changeset has no entry in this table, then it is the canonical ID for that node.\n\t * The aliases form a set of trees, where the root of each tree is a canonical ID.\n\t *\n\t * When composing changesets with different canonical IDs for the same node,\n\t * one of those IDs becomes the canonical ID for the composition, while the other is added to this table as an alias.\n\t *\n\t * Node aliases are preserved when composing changesets so we can avoid having to find and update all changed node IDs\n\t * in the field IDs in nodeToParent and crossFieldKeys.\n\t */\n\treadonly nodeAliases: ChangeAtomIdBTree<NodeId>;\n\treadonly crossFieldKeys: CrossFieldKeyTable;\n\t/**\n\t * The number of constraint violations that apply to the input context of the changeset, i.e., before this change is applied.\n\t * If this count is greater than 0, it will prevent the changeset from being applied.\n\t */\n\treadonly constraintViolationCount?: number;\n\t/** Constraint that the document must be in the same state before this change is applied as it was before this change was authored */\n\treadonly noChangeConstraint?: NoChangeConstraint;\n\t/** Constraint that the document must be in the same state before the revert of this change is applied as it was after this change was applied */\n\treadonly noChangeConstraintOnRevert?: NoChangeConstraint;\n\t/**\n\t * The number of constraint violations that apply to the revert of the changeset. If this count is greater than 0, it will\n\t * prevent the changeset from being reverted or undone.\n\t */\n\treadonly constraintViolationCountOnRevert?: number;\n\treadonly builds?: ChangeAtomIdBTree<TreeChunk>;\n\treadonly destroys?: ChangeAtomIdBTree<number>;\n\treadonly refreshers?: ChangeAtomIdBTree<TreeChunk>;\n}\n\nexport type CrossFieldKeyTable = RangeMap<CrossFieldKey, FieldId>;\n\nexport function newCrossFieldKeyTable(): CrossFieldKeyTable {\n\treturn new RangeMap(offsetCrossFieldKey, subtractCrossFieldKeys);\n}\n\nfunction offsetCrossFieldKey(key: CrossFieldKey, offset: number): CrossFieldKey {\n\treturn {\n\t\t...key,\n\t\tlocalId: brand(key.localId + offset),\n\t};\n}\n\nfunction subtractCrossFieldKeys(a: CrossFieldKey, b: CrossFieldKey): number {\n\tconst cmpTarget = a.target - b.target;\n\tif (cmpTarget !== 0) {\n\t\treturn cmpTarget * Number.POSITIVE_INFINITY;\n\t}\n\n\treturn subtractChangeAtomIds(a, b);\n}\n\nexport interface CrossFieldKey extends ChangeAtomId {\n\treadonly target: CrossFieldTarget;\n}\n\nexport interface CrossFieldKeyRange {\n\treadonly key: CrossFieldKey;\n\treadonly count: number;\n}\n\nexport interface FieldId {\n\treadonly nodeId: NodeId | undefined;\n\treadonly field: FieldKey;\n}\n\nexport interface NodeExistsConstraint {\n\tviolated: boolean;\n}\n\n/**\n * A constraint that is violated whenever the state of the document is different from when the change was authored.\n */\nexport interface NoChangeConstraint {\n\tviolated: boolean;\n}\n\n/**\n * Changeset for a subtree rooted at a specific node.\n */\nexport interface NodeChangeset extends HasFieldChanges {\n\t/** Keeps track of whether node exists constraint has been violated by this change */\n\tnodeExistsConstraint?: NodeExistsConstraint;\n\t/** Keeps track of whether node exists constraint will be violated when this change is reverted */\n\tnodeExistsConstraintOnRevert?: NodeExistsConstraint;\n}\n\nexport type NodeId = ChangeAtomId;\n\nexport interface HasFieldChanges {\n\tfieldChanges?: FieldChangeMap;\n}\n\nexport type FieldChangeMap = Map<FieldKey, FieldChange>;\n\nexport interface FieldChange {\n\treadonly fieldKind: FieldKindIdentifier;\n\tchange: FieldChangeset;\n}\n\nexport type FieldChangeset = Brand<unknown, \"FieldChangeset\">;\n"]}
1
+ {"version":3,"file":"modularChangeTypes.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAS6B;AAC7B,kDAAkE;AA4FlE,SAAgB,uBAAuB;IACtC,OAAO,IAAI,mBAAQ,CAAmB,mBAAmB,EAAE,sBAAsB,CAAC,CAAC;AACpF,CAAC;AAFD,0DAEC;AAED,SAAS,mBAAmB,CAAC,GAAkB,EAAE,MAAc;IAC9D,OAAO;QACN,GAAG,GAAG;QACN,OAAO,EAAE,IAAA,gBAAK,EAAC,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;KACpC,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,CAAgB,EAAE,CAAgB;IACjE,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,SAAS,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAC7C,CAAC;IAED,OAAO,IAAA,gCAAqB,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tsubtractChangeAtomIds,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdRangeMap,\n\ttype ChangesetLocalId,\n\ttype EditorOptions,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype RevisionInfo,\n} from \"../../core/index.js\";\nimport { brand, RangeMap, type Brand } from \"../../util/index.js\";\nimport type { ChangeAtomIdBTree } from \"../changeAtomIdBTree.js\";\nimport type { TreeChunk } from \"../chunked-forest/index.js\";\n\nimport type { NodeMoveType } from \"./crossFieldQueries.js\";\n\nexport type RebaseVersion = 1 | 2;\n\nexport interface ModularChangeset extends HasFieldChanges {\n\treadonly rebaseVersion: RebaseVersion;\n\n\t/**\n\t * The numerically highest `ChangesetLocalId` used in this changeset.\n\t * If undefined then this changeset contains no IDs.\n\t */\n\treadonly maxId?: ChangesetLocalId;\n\t/**\n\t * The revisions included in this changeset, ordered temporally (oldest to newest).\n\t * Undefined for anonymous changesets.\n\t * Should never be empty.\n\t */\n\treadonly revisions?: readonly RevisionInfo[];\n\treadonly fieldChanges: FieldChangeMap;\n\n\t/**\n\t * Maps from this changeset's canonical ID for a node (see comment on node aliases) to the changes for that node.\n\t */\n\treadonly nodeChanges: ChangeAtomIdBTree<NodeChangeset>;\n\treadonly rootNodes: RootNodeTable;\n\n\t/**\n\t * Maps from this changeset's canonical ID for a node to the ID for the field which contains that node,\n\t * or the detach ID, if this node is detached.\n\t */\n\t// TODO: Should this be merged with `nodeChanges`?\n\treadonly nodeToParent: ChangeAtomIdBTree<NodeLocation>;\n\n\t/**\n\t * Maps from a node ID to another ID for the same node.\n\t * If a node ID used in this changeset has no entry in this table, then it is the canonical ID for that node.\n\t * The aliases form a set of trees, where the root of each tree is a canonical ID.\n\t *\n\t * When composing changesets with different canonical IDs for the same node,\n\t * one of those IDs becomes the canonical ID for the composition, while the other is added to this table as an alias.\n\t *\n\t * Node aliases are preserved when composing changesets so we can avoid having to find and update all changed node IDs\n\t * in the field IDs in nodeToParent and crossFieldKeys.\n\t */\n\treadonly nodeAliases: ChangeAtomIdBTree<NodeId>;\n\treadonly crossFieldKeys: CrossFieldKeyTable;\n\t/**\n\t * The number of constraint violations that apply to the input context of the changeset, i.e., before this change is applied.\n\t * If this count is greater than 0, it will prevent the changeset from being applied.\n\t */\n\treadonly constraintViolationCount?: number;\n\t/** Constraint that the document must be in the same state before this change is applied as it was before this change was authored */\n\treadonly noChangeConstraint?: NoChangeConstraint;\n\t/** Constraint that the document must be in the same state before the revert of this change is applied as it was after this change was applied */\n\treadonly noChangeConstraintOnRevert?: NoChangeConstraint;\n\t/**\n\t * The number of constraint violations that apply to the revert of the changeset. If this count is greater than 0, it will\n\t * prevent the changeset from being reverted or undone.\n\t */\n\treadonly constraintViolationCountOnRevert?: number;\n\treadonly builds?: ChangeAtomIdBTree<TreeChunk>;\n\treadonly destroys?: ChangeAtomIdBTree<number>;\n\treadonly refreshers?: ChangeAtomIdBTree<TreeChunk>;\n}\n\nexport interface RootNodeTable {\n\t// TODO: Include builds, destroys, refreshers, and field changes\n\treadonly oldToNewId: ChangeAtomIdRangeMap<ChangeAtomId>;\n\treadonly newToOldId: ChangeAtomIdRangeMap<ChangeAtomId>;\n\treadonly nodeChanges: ChangeAtomIdBTree<NodeId>;\n\n\t/**\n\t * Maps from input context detach ID to the field where the node was last attached.\n\t * There should be an entry for every detach ID referenced in `oldToNewId` or `nodeChanges`.\n\t */\n\treadonly detachLocations: ChangeAtomIdRangeMap<FieldId>;\n\n\t/**\n\t * Maps from the output root ID of a node to the output detach location of that node.\n\t * This is only guaranteed to contain entries for nodes which have an output detach location\n\t * which is different from their location in the input context.\n\t */\n\treadonly outputDetachLocations: ChangeAtomIdRangeMap<FieldId>;\n}\n\nexport type CrossFieldRangeTable<T> = RangeMap<CrossFieldKey, T>;\nexport type CrossFieldKeyTable = CrossFieldRangeTable<FieldId>;\n\nexport function newCrossFieldRangeTable<V>(): CrossFieldRangeTable<V> {\n\treturn new RangeMap<CrossFieldKey, V>(offsetCrossFieldKey, subtractCrossFieldKeys);\n}\n\nfunction offsetCrossFieldKey(key: CrossFieldKey, offset: number): CrossFieldKey {\n\treturn {\n\t\t...key,\n\t\tlocalId: brand(key.localId + offset),\n\t};\n}\n\nfunction subtractCrossFieldKeys(a: CrossFieldKey, b: CrossFieldKey): number {\n\tconst cmpTarget = a.target - b.target;\n\tif (cmpTarget !== 0) {\n\t\treturn cmpTarget * Number.POSITIVE_INFINITY;\n\t}\n\n\treturn subtractChangeAtomIds(a, b);\n}\n\nexport interface CrossFieldKey extends ChangeAtomId {\n\treadonly target: NodeMoveType;\n}\n\nexport interface CrossFieldKeyRange {\n\treadonly key: CrossFieldKey;\n\treadonly count: number;\n}\n\nexport interface FieldId {\n\treadonly nodeId: NodeId | undefined;\n\treadonly field: FieldKey;\n}\n\nexport interface FieldParent {\n\treadonly field: FieldId;\n\treadonly root?: undefined;\n}\n\nexport interface RootParent {\n\treadonly field?: undefined;\n\treadonly root: ChangeAtomId;\n}\n\nexport type NodeLocation = FieldParent | RootParent;\nexport interface DetachLocation {\n\treadonly field: FieldId;\n\treadonly atomId: ChangeAtomId | undefined;\n}\n\n/**\n */\nexport interface NodeExistsConstraint {\n\tviolated: boolean;\n}\n\n/**\n * A constraint that is violated whenever the state of the document is different from when the change was authored.\n */\nexport interface NoChangeConstraint {\n\tviolated: boolean;\n}\n\n/**\n * Changeset for a subtree rooted at a specific node.\n */\nexport interface NodeChangeset extends HasFieldChanges {\n\t/** Keeps track of whether node exists constraint has been violated by this change */\n\treadonly nodeExistsConstraint?: NodeExistsConstraint;\n\n\t/** Keeps track of whether node exists constraint will be violated when this change is reverted */\n\treadonly nodeExistsConstraintOnRevert?: NodeExistsConstraint;\n}\n\nexport type NodeId = ChangeAtomId;\n\nexport interface HasFieldChanges {\n\treadonly fieldChanges?: FieldChangeMap;\n}\n\nexport type FieldChangeMap = Map<FieldKey, FieldChange>;\n\nexport interface FieldChange {\n\treadonly fieldKind: FieldKindIdentifier;\n\tchange: FieldChangeset;\n}\n\nexport type FieldChangeset = Brand<unknown, \"FieldChangeset\">;\n\nexport interface ModularEditorOptions extends EditorOptions {\n\treadonly rebaseVersionOverride?: RebaseVersion;\n}\n"]}
@@ -2,55 +2,36 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type ChangeAtomId, Multiplicity, type RevisionTag } from "../../core/index.js";
5
+ import { type ChangeAtomId, type DeltaFieldChanges, Multiplicity } from "../../core/index.js";
6
6
  import { optionalIdentifier } from "../fieldKindIdentifiers.js";
7
- import { type FieldChangeHandler, type FieldChangeRebaser, type FieldEditor, type ToDelta, type FieldChangeDelta, FlexFieldKind } from "../modular-schema/index.js";
8
- import type { OptionalChangeset, RegisterId } from "./optionalFieldChangeTypes.js";
9
- export interface IRegisterMap<T> {
10
- set(id: RegisterId, childChange: T): void;
11
- get(id: RegisterId): T | undefined;
12
- delete(id: RegisterId): boolean;
13
- keys(): Iterable<RegisterId>;
14
- values(): Iterable<T>;
15
- entries(): Iterable<[RegisterId, T]>;
16
- readonly size: number;
17
- }
18
- export declare class RegisterMap<T> implements IRegisterMap<T> {
19
- private readonly nestedMapData;
20
- clone(): RegisterMap<T>;
21
- set(id: RegisterId, childChange: T): void;
22
- get(id: RegisterId): T | undefined;
23
- has(id: RegisterId): boolean;
24
- delete(id: RegisterId): boolean;
25
- keys(): Iterable<RegisterId>;
26
- values(): Iterable<T>;
27
- entries(): Iterable<[RegisterId, T]>;
28
- get size(): number;
29
- }
7
+ import { type FieldChangeHandler, type FieldChangeRebaser, type FieldEditor, type ToDelta, FlexFieldKind } from "../modular-schema/index.js";
8
+ import type { OptionalChangeset } from "./optionalFieldChangeTypes.js";
30
9
  export declare const optionalChangeRebaser: FieldChangeRebaser<OptionalChangeset>;
31
- export declare function taggedRegister(id: RegisterId, revision: RevisionTag | undefined): RegisterId;
32
10
  export interface OptionalFieldEditor extends FieldEditor<OptionalChangeset> {
33
11
  /**
34
12
  * Creates a change which will replace the content already in the field (if any at the time the change applies)
35
13
  * with new content.
36
14
  * The content in the field will be moved to the `ids.detach` register.
37
15
  * The content in the `ids.detach` register will be moved to into the field.
38
- * @param wasEmpty - whether the field is empty when creating this change
39
- * @param ids - the "fill" and "detach" ids associated with the change.
16
+ * @param isEmpty - whether the field is empty when creating this change
17
+ * @param ids - the ids associated with the change.
40
18
  */
41
- set(wasEmpty: boolean, ids: {
19
+ set(isEmpty: boolean, ids: {
20
+ /** The ID of the node to attach in the field. */
42
21
  fill: ChangeAtomId;
22
+ /** The ID to assign to whichever node (if any) is detached from the field when the change applies. */
43
23
  detach: ChangeAtomId;
44
24
  }): OptionalChangeset;
45
25
  /**
46
26
  * Creates a change which clears the field's contents (if any).
47
- * @param wasEmpty - whether the field is empty when creating this change
48
- * @param detachId - the ID of the register that existing field content (if any) will be moved to.
27
+ * @param isEmpty - whether the field is empty when creating this change
28
+ * @param detachId - the ID to assign to whichever node (if any) is detached from the field when the change applies.
49
29
  */
50
- clear(wasEmpty: boolean, detachId: ChangeAtomId): OptionalChangeset;
30
+ clear(isEmpty: boolean, detachId: ChangeAtomId): OptionalChangeset;
51
31
  }
52
32
  export declare const optionalFieldEditor: OptionalFieldEditor;
53
- export declare function optionalFieldIntoDelta(change: OptionalChangeset, deltaFromChild: ToDelta): FieldChangeDelta;
33
+ export declare function optionalFieldIntoDelta(change: OptionalChangeset, deltaFromChild: ToDelta): DeltaFieldChanges;
34
+ export declare function optionalOrRequiredFieldIntoDelta(allowReattach: boolean, change: OptionalChangeset, deltaFromChild: ToDelta): DeltaFieldChanges;
54
35
  export declare const optionalChangeHandler: FieldChangeHandler<OptionalChangeset, OptionalFieldEditor>;
55
36
  interface Optional extends FlexFieldKind<OptionalFieldEditor, typeof optionalIdentifier, Multiplicity.Optional> {
56
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"optionalField.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/optionalField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,YAAY,EAMjB,YAAY,EAEZ,KAAK,WAAW,EAKhB,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EACN,kBAAkB,EAGlB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAOhB,KAAK,OAAO,EAEZ,KAAK,gBAAgB,EACrB,aAAa,EACb,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAGX,iBAAiB,EACjB,UAAU,EAEV,MAAM,+BAA+B,CAAC;AAGvC,MAAM,WAAW,YAAY,CAAC,CAAC;IAC9B,GAAG,CAAC,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC;IAC1C,GAAG,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,GAAG,SAAS,CAAC;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B,GACC,iBAAiB,CAAC;IAErB;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,GAAG,iBAAiB,CAAC;CACpE;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAyCjC,CAAC;AAEF,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,iBAAiB,EACzB,cAAc,EAAE,OAAO,GACrB,gBAAgB,CAkDlB;AAED,eAAO,MAAM,qBAAqB,EAAE,kBAAkB,CACrD,iBAAiB,EACjB,mBAAmB,CAkBnB,CAAC;AAwDF,UAAU,QACT,SAAQ,aAAa,CACpB,mBAAmB,EACnB,OAAO,kBAAkB,EACzB,YAAY,CAAC,QAAQ,CACrB;CAAG;AAEL;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,QAWtB,CAAC"}
1
+ {"version":3,"file":"optionalField.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/optionalField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,YAAY,EAEjB,KAAK,iBAAiB,EAEtB,YAAY,EAMZ,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACN,kBAAkB,EAGlB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAKhB,KAAK,OAAO,EASZ,aAAa,EACb,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,iBAAiB,EAAW,MAAM,+BAA+B,CAAC;AAGhF,eAAO,MAAM,qBAAqB,EAAE,kBAAkB,CAAC,iBAAiB,CAsLvE,CAAC;AA2LF,MAAM,WAAW,mBAAoB,SAAQ,WAAW,CAAC,iBAAiB,CAAC;IAC1E;;;;;;;OAOG;IACH,GAAG,CACF,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE;QACJ,iDAAiD;QACjD,IAAI,EAAE,YAAY,CAAC;QACnB,sGAAsG;QACtG,MAAM,EAAE,Y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