@fluidframework/tree 2.74.0-365691 → 2.74.0-368706

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 (1243) hide show
  1. package/.vscode/settings.json +2 -2
  2. package/api-report/tree.alpha.api.md +119 -85
  3. package/api-report/tree.beta.api.md +0 -1
  4. package/api-report/tree.legacy.beta.api.md +0 -1
  5. package/api-report/tree.legacy.public.api.md +0 -1
  6. package/api-report/tree.public.api.md +0 -1
  7. package/dist/alpha.d.ts +3 -2
  8. package/dist/codec/codec.d.ts +14 -1
  9. package/dist/codec/codec.d.ts.map +1 -1
  10. package/dist/codec/codec.js +11 -0
  11. package/dist/codec/codec.js.map +1 -1
  12. package/dist/codec/versioned/codec.d.ts +1 -1
  13. package/dist/codec/versioned/codec.d.ts.map +1 -1
  14. package/dist/codec/versioned/codec.js.map +1 -1
  15. package/dist/codec/versioned/format.d.ts +4 -1
  16. package/dist/codec/versioned/format.d.ts.map +1 -1
  17. package/dist/codec/versioned/format.js +4 -1
  18. package/dist/codec/versioned/format.js.map +1 -1
  19. package/dist/core/change-family/changeFamily.d.ts +4 -1
  20. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  21. package/dist/core/change-family/changeFamily.js.map +1 -1
  22. package/dist/core/change-family/index.d.ts +1 -1
  23. package/dist/core/change-family/index.d.ts.map +1 -1
  24. package/dist/core/change-family/index.js.map +1 -1
  25. package/dist/core/index.d.ts +3 -3
  26. package/dist/core/index.d.ts.map +1 -1
  27. package/dist/core/index.js +7 -4
  28. package/dist/core/index.js.map +1 -1
  29. package/dist/core/rebase/changeRebaser.d.ts +6 -1
  30. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  31. package/dist/core/rebase/changeRebaser.js.map +1 -1
  32. package/dist/core/rebase/index.d.ts +1 -1
  33. package/dist/core/rebase/index.d.ts.map +1 -1
  34. package/dist/core/rebase/index.js +2 -1
  35. package/dist/core/rebase/index.js.map +1 -1
  36. package/dist/core/rebase/types.d.ts +2 -1
  37. package/dist/core/rebase/types.d.ts.map +1 -1
  38. package/dist/core/rebase/types.js +5 -1
  39. package/dist/core/rebase/types.js.map +1 -1
  40. package/dist/core/rebase/utils.d.ts.map +1 -1
  41. package/dist/core/rebase/utils.js +25 -7
  42. package/dist/core/rebase/utils.js.map +1 -1
  43. package/dist/core/tree/detachedFieldIndex.d.ts +40 -13
  44. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  45. package/dist/core/tree/detachedFieldIndex.js +21 -12
  46. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  47. package/dist/core/tree/index.d.ts +4 -3
  48. package/dist/core/tree/index.d.ts.map +1 -1
  49. package/dist/core/tree/index.js +6 -2
  50. package/dist/core/tree/index.js.map +1 -1
  51. package/dist/core/tree/pathTree.d.ts +11 -3
  52. package/dist/core/tree/pathTree.d.ts.map +1 -1
  53. package/dist/core/tree/pathTree.js +14 -2
  54. package/dist/core/tree/pathTree.js.map +1 -1
  55. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  56. package/dist/feature-libraries/chunked-forest/basicChunk.js +7 -0
  57. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  58. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  59. package/dist/feature-libraries/chunked-forest/chunkTree.js +4 -1
  60. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
  62. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  65. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  66. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +90 -42
  67. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  68. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +234 -69
  69. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  70. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
  71. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  72. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +33 -28
  73. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  74. package/dist/feature-libraries/default-schema/index.d.ts +2 -1
  75. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  76. package/dist/feature-libraries/default-schema/index.js +4 -2
  77. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  78. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +36 -0
  79. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  80. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +126 -0
  81. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  82. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  83. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  84. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  85. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  86. package/dist/feature-libraries/deltaUtils.d.ts +1 -0
  87. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  88. package/dist/feature-libraries/deltaUtils.js +6 -1
  89. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  90. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  91. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  92. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +41 -11
  93. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  94. package/dist/feature-libraries/flex-tree/context.d.ts +9 -0
  95. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  96. package/dist/feature-libraries/flex-tree/context.js +6 -0
  97. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  98. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  99. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  100. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  101. package/dist/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  102. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  103. package/dist/feature-libraries/flex-tree/lazyField.js +37 -8
  104. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  105. package/dist/feature-libraries/forest-summary/codec.d.ts +2 -2
  106. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  107. package/dist/feature-libraries/forest-summary/codec.js +4 -4
  108. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  109. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
  110. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  111. package/dist/feature-libraries/forest-summary/forestSummarizer.js +21 -26
  112. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  113. package/dist/feature-libraries/forest-summary/format.d.ts +41 -5
  114. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  115. package/dist/feature-libraries/forest-summary/format.js +7 -7
  116. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  117. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
  118. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  119. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +16 -29
  120. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  121. package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
  122. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  123. package/dist/feature-libraries/forest-summary/index.js +3 -2
  124. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  125. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
  126. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  127. package/dist/feature-libraries/forest-summary/summaryTypes.js +57 -0
  128. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  129. package/dist/feature-libraries/index.d.ts +4 -4
  130. package/dist/feature-libraries/index.d.ts.map +1 -1
  131. package/dist/feature-libraries/index.js +7 -3
  132. package/dist/feature-libraries/index.js.map +1 -1
  133. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  134. package/dist/feature-libraries/mapTreeCursor.js +1 -0
  135. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  136. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  137. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  138. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  139. package/dist/feature-libraries/modular-schema/comparison.d.ts +18 -2
  140. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  141. package/dist/feature-libraries/modular-schema/comparison.js +54 -3
  142. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  143. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  144. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  145. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -7
  146. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  147. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -52
  148. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  149. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  150. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  151. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  152. package/dist/feature-libraries/modular-schema/fieldKind.js +0 -21
  153. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  154. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  155. package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -10
  156. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  157. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +2 -2
  158. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  159. package/dist/feature-libraries/modular-schema/index.d.ts +5 -5
  160. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  161. package/dist/feature-libraries/modular-schema/index.js +12 -8
  162. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  163. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
  164. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
  165. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +388 -0
  166. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
  167. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
  168. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
  169. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +413 -0
  170. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
  171. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  172. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  173. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +8 -284
  174. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  175. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +48 -15
  176. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  177. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1298 -465
  178. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  179. package/dist/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
  180. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
  181. package/dist/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +5 -5
  182. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
  183. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
  184. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
  185. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +32 -0
  186. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
  187. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
  188. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  189. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +24 -3
  190. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  191. package/dist/feature-libraries/optional-field/index.d.ts +2 -2
  192. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  193. package/dist/feature-libraries/optional-field/index.js +1 -2
  194. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  195. package/dist/feature-libraries/optional-field/optionalField.d.ts +5 -26
  196. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  197. package/dist/feature-libraries/optional-field/optionalField.js +217 -451
  198. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  199. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  200. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  201. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  202. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  203. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  204. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +57 -28
  205. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  206. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  207. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  208. package/dist/feature-libraries/schema-index/schemaSummarizer.js +42 -16
  209. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  210. package/dist/feature-libraries/sequence-field/compose.d.ts +6 -7
  211. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  212. package/dist/feature-libraries/sequence-field/compose.js +80 -256
  213. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  214. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  215. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  216. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  217. package/dist/feature-libraries/sequence-field/index.d.ts +2 -3
  218. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  219. package/dist/feature-libraries/sequence-field/index.js +1 -3
  220. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  221. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  222. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  223. package/dist/feature-libraries/sequence-field/invert.js +65 -167
  224. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  225. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  226. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  227. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  228. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  229. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  230. package/dist/feature-libraries/sequence-field/moveEffectTable.js +7 -86
  231. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  232. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  233. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  234. package/dist/feature-libraries/sequence-field/rebase.js +106 -112
  235. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  236. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  237. package/dist/feature-libraries/sequence-field/replaceRevisions.js +16 -33
  238. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  239. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  240. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  241. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  242. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  243. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  244. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +358 -179
  245. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  246. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  247. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +20 -60
  248. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  249. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  250. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  251. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  252. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  253. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  254. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  255. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
  256. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  257. package/dist/feature-libraries/sequence-field/types.d.ts +30 -59
  258. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  259. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  260. package/dist/feature-libraries/sequence-field/utils.d.ts +15 -24
  261. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  262. package/dist/feature-libraries/sequence-field/utils.js +111 -299
  263. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  264. package/dist/index.d.ts +1 -1
  265. package/dist/index.d.ts.map +1 -1
  266. package/dist/index.js +3 -3
  267. package/dist/index.js.map +1 -1
  268. package/dist/packageVersion.d.ts +1 -1
  269. package/dist/packageVersion.js +1 -1
  270. package/dist/packageVersion.js.map +1 -1
  271. package/dist/shared-tree/independentView.d.ts +1 -1
  272. package/dist/shared-tree/independentView.d.ts.map +1 -1
  273. package/dist/shared-tree/independentView.js.map +1 -1
  274. package/dist/shared-tree/index.d.ts +1 -1
  275. package/dist/shared-tree/index.d.ts.map +1 -1
  276. package/dist/shared-tree/index.js.map +1 -1
  277. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  278. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  279. package/dist/shared-tree/schematizeTree.js +2 -1
  280. package/dist/shared-tree/schematizeTree.js.map +1 -1
  281. package/dist/shared-tree/schematizingTreeView.d.ts +1 -5
  282. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  283. package/dist/shared-tree/schematizingTreeView.js +32 -33
  284. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  285. package/dist/shared-tree/sharedTree.d.ts +11 -5
  286. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  287. package/dist/shared-tree/sharedTree.js +14 -4
  288. package/dist/shared-tree/sharedTree.js.map +1 -1
  289. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  290. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  291. package/dist/shared-tree/sharedTreeChangeCodecs.js +1 -0
  292. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  293. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  294. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  295. package/dist/shared-tree/sharedTreeChangeEnricher.js +25 -11
  296. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  297. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  298. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  299. package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
  300. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  301. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  302. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  303. package/dist/shared-tree/sharedTreeEditBuilder.js +13 -6
  304. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  305. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  306. package/dist/shared-tree/treeAlpha.js +1 -1
  307. package/dist/shared-tree/treeAlpha.js.map +1 -1
  308. package/dist/shared-tree/treeCheckout.d.ts +12 -10
  309. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  310. package/dist/shared-tree/treeCheckout.js +66 -17
  311. package/dist/shared-tree/treeCheckout.js.map +1 -1
  312. package/dist/shared-tree-core/branch.d.ts +3 -2
  313. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  314. package/dist/shared-tree-core/branch.js +4 -3
  315. package/dist/shared-tree-core/branch.js.map +1 -1
  316. package/dist/shared-tree-core/editManager.d.ts +2 -2
  317. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  318. package/dist/shared-tree-core/editManager.js +9 -9
  319. package/dist/shared-tree-core/editManager.js.map +1 -1
  320. package/dist/shared-tree-core/editManagerCodecs.d.ts +4 -0
  321. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  322. package/dist/shared-tree-core/editManagerCodecs.js +16 -6
  323. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  324. package/{lib/shared-tree-core/editManagerCodecsV5.d.ts → dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  325. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  326. package/dist/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +7 -7
  327. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  328. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
  329. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  330. package/dist/shared-tree-core/editManagerFormatCommons.js +22 -7
  331. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  332. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  333. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  334. package/dist/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  335. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  336. package/dist/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  337. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  338. package/dist/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  339. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  340. package/dist/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  341. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  342. package/dist/shared-tree-core/editManagerSummarizer.js +41 -13
  343. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  344. package/dist/shared-tree-core/index.d.ts +5 -3
  345. package/dist/shared-tree-core/index.d.ts.map +1 -1
  346. package/dist/shared-tree-core/index.js +8 -1
  347. package/dist/shared-tree-core/index.js.map +1 -1
  348. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  349. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  350. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  351. package/{lib/shared-tree-core/messageCodecV5.d.ts → dist/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  352. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  353. package/dist/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +6 -6
  354. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  355. package/dist/shared-tree-core/messageCodecs.d.ts +4 -0
  356. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  357. package/dist/shared-tree-core/messageCodecs.js +16 -6
  358. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  359. package/dist/shared-tree-core/messageFormat.d.ts +20 -6
  360. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  361. package/dist/shared-tree-core/messageFormat.js +22 -7
  362. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  363. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  364. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  365. package/dist/shared-tree-core/messageFormatV1ToV4.js +8 -1
  366. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  367. package/dist/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
  368. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  369. package/dist/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  370. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  371. package/dist/shared-tree-core/sharedTreeCore.d.ts +14 -47
  372. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  373. package/dist/shared-tree-core/sharedTreeCore.js +30 -18
  374. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  375. package/dist/shared-tree-core/summaryTypes.d.ts +94 -0
  376. package/dist/shared-tree-core/summaryTypes.d.ts.map +1 -0
  377. package/dist/shared-tree-core/summaryTypes.js +47 -0
  378. package/dist/shared-tree-core/summaryTypes.js.map +1 -0
  379. package/dist/shared-tree-core/versionedSummarizer.d.ts +67 -0
  380. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  381. package/dist/shared-tree-core/versionedSummarizer.js +63 -0
  382. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -0
  383. package/dist/simple-tree/api/configuration.d.ts +3 -26
  384. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  385. package/dist/simple-tree/api/configuration.js +10 -21
  386. package/dist/simple-tree/api/configuration.js.map +1 -1
  387. package/dist/simple-tree/api/dirtyIndex.d.ts +11 -0
  388. package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  389. package/dist/simple-tree/api/dirtyIndex.js +7 -0
  390. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  391. package/dist/simple-tree/api/discrepancies.d.ts +1 -1
  392. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  393. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  394. package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -3
  395. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  396. package/dist/simple-tree/api/getSimpleSchema.js +9 -3
  397. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  398. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  399. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  400. package/dist/simple-tree/api/incrementalAllowedTypes.js +7 -0
  401. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  402. package/dist/simple-tree/api/index.d.ts +3 -4
  403. package/dist/simple-tree/api/index.d.ts.map +1 -1
  404. package/dist/simple-tree/api/index.js +4 -5
  405. package/dist/simple-tree/api/index.js.map +1 -1
  406. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  407. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  408. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  409. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  410. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  411. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  412. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  413. package/dist/simple-tree/api/schemaFactoryRecursive.js +0 -1
  414. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  415. package/dist/simple-tree/api/schemaFromSimple.d.ts +6 -1
  416. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  417. package/dist/simple-tree/api/schemaFromSimple.js +5 -0
  418. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  419. package/dist/simple-tree/api/schemaStatics.d.ts +12 -12
  420. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  421. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  422. package/dist/simple-tree/api/simpleSchemaCodec.js +18 -6
  423. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  424. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  425. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  426. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  427. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  428. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  429. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +13 -8
  430. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  431. package/dist/simple-tree/api/typesUnsafe.d.ts +3 -3
  432. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  433. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  434. package/dist/simple-tree/core/allowedTypes.d.ts +2 -2
  435. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  436. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  437. package/dist/simple-tree/core/index.d.ts +1 -1
  438. package/dist/simple-tree/core/index.d.ts.map +1 -1
  439. package/dist/simple-tree/core/index.js +2 -3
  440. package/dist/simple-tree/core/index.js.map +1 -1
  441. package/dist/simple-tree/core/toStored.d.ts +17 -15
  442. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  443. package/dist/simple-tree/core/toStored.js +5 -40
  444. package/dist/simple-tree/core/toStored.js.map +1 -1
  445. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  446. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  447. package/dist/simple-tree/core/unhydratedFlexTree.js +59 -8
  448. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  449. package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
  450. package/dist/simple-tree/core/walkSchema.js +4 -0
  451. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  452. package/dist/simple-tree/createContext.d.ts.map +1 -1
  453. package/dist/simple-tree/createContext.js +20 -5
  454. package/dist/simple-tree/createContext.js.map +1 -1
  455. package/dist/simple-tree/fieldSchema.d.ts +7 -7
  456. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  457. package/dist/simple-tree/fieldSchema.js.map +1 -1
  458. package/dist/simple-tree/index.d.ts +8 -7
  459. package/dist/simple-tree/index.d.ts.map +1 -1
  460. package/dist/simple-tree/index.js +15 -12
  461. package/dist/simple-tree/index.js.map +1 -1
  462. package/dist/simple-tree/leafNodeSchema.d.ts +5 -5
  463. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  464. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  465. package/dist/simple-tree/node-kinds/array/arrayNode.js +5 -3
  466. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  467. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  468. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  469. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  470. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  471. package/dist/simple-tree/node-kinds/common.js +1 -1
  472. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  473. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  474. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
  475. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  476. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  477. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  478. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  479. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  480. package/dist/simple-tree/node-kinds/object/objectNode.js +18 -18
  481. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  482. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  483. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  484. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  485. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  486. package/dist/simple-tree/node-kinds/record/recordNode.js +4 -2
  487. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  488. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  489. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  490. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  491. package/dist/simple-tree/prepareForInsertion.d.ts +54 -47
  492. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  493. package/dist/simple-tree/prepareForInsertion.js +183 -125
  494. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  495. package/dist/simple-tree/simpleSchema.d.ts +55 -23
  496. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  497. package/dist/simple-tree/simpleSchema.js +17 -0
  498. package/dist/simple-tree/simpleSchema.js.map +1 -1
  499. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  500. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  501. package/dist/simple-tree/simpleSchemaFormatV1.js +8 -1
  502. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  503. package/dist/simple-tree/toStoredSchema.d.ts +58 -11
  504. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  505. package/dist/simple-tree/toStoredSchema.js +205 -30
  506. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  507. package/dist/simple-tree/treeSchema.d.ts +23 -0
  508. package/dist/simple-tree/treeSchema.d.ts.map +1 -0
  509. package/dist/simple-tree/treeSchema.js +25 -0
  510. package/dist/simple-tree/treeSchema.js.map +1 -0
  511. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  512. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  513. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +29 -11
  514. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  515. package/dist/tableSchema.d.ts +117 -63
  516. package/dist/tableSchema.d.ts.map +1 -1
  517. package/dist/tableSchema.js +159 -58
  518. package/dist/tableSchema.js.map +1 -1
  519. package/dist/treeFactory.d.ts.map +1 -1
  520. package/dist/treeFactory.js +17 -3
  521. package/dist/treeFactory.js.map +1 -1
  522. package/dist/util/index.d.ts +2 -1
  523. package/dist/util/index.d.ts.map +1 -1
  524. package/dist/util/index.js +4 -1
  525. package/dist/util/index.js.map +1 -1
  526. package/dist/util/rangeMap.d.ts +24 -12
  527. package/dist/util/rangeMap.d.ts.map +1 -1
  528. package/dist/util/rangeMap.js +46 -6
  529. package/dist/util/rangeMap.js.map +1 -1
  530. package/dist/util/readSnapshotBlob.d.ts +13 -0
  531. package/dist/util/readSnapshotBlob.d.ts.map +1 -0
  532. package/dist/util/readSnapshotBlob.js +18 -0
  533. package/dist/util/readSnapshotBlob.js.map +1 -0
  534. package/lib/alpha.d.ts +3 -2
  535. package/lib/codec/codec.d.ts +14 -1
  536. package/lib/codec/codec.d.ts.map +1 -1
  537. package/lib/codec/codec.js +11 -0
  538. package/lib/codec/codec.js.map +1 -1
  539. package/lib/codec/versioned/codec.d.ts +1 -1
  540. package/lib/codec/versioned/codec.d.ts.map +1 -1
  541. package/lib/codec/versioned/codec.js.map +1 -1
  542. package/lib/codec/versioned/format.d.ts +4 -1
  543. package/lib/codec/versioned/format.d.ts.map +1 -1
  544. package/lib/codec/versioned/format.js +4 -1
  545. package/lib/codec/versioned/format.js.map +1 -1
  546. package/lib/core/change-family/changeFamily.d.ts +4 -1
  547. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  548. package/lib/core/change-family/changeFamily.js.map +1 -1
  549. package/lib/core/change-family/index.d.ts +1 -1
  550. package/lib/core/change-family/index.d.ts.map +1 -1
  551. package/lib/core/change-family/index.js.map +1 -1
  552. package/lib/core/index.d.ts +3 -3
  553. package/lib/core/index.d.ts.map +1 -1
  554. package/lib/core/index.js +2 -2
  555. package/lib/core/index.js.map +1 -1
  556. package/lib/core/rebase/changeRebaser.d.ts +6 -1
  557. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  558. package/lib/core/rebase/changeRebaser.js.map +1 -1
  559. package/lib/core/rebase/index.d.ts +1 -1
  560. package/lib/core/rebase/index.d.ts.map +1 -1
  561. package/lib/core/rebase/index.js +1 -1
  562. package/lib/core/rebase/index.js.map +1 -1
  563. package/lib/core/rebase/types.d.ts +2 -1
  564. package/lib/core/rebase/types.d.ts.map +1 -1
  565. package/lib/core/rebase/types.js +3 -0
  566. package/lib/core/rebase/types.js.map +1 -1
  567. package/lib/core/rebase/utils.d.ts.map +1 -1
  568. package/lib/core/rebase/utils.js +25 -7
  569. package/lib/core/rebase/utils.js.map +1 -1
  570. package/lib/core/tree/detachedFieldIndex.d.ts +40 -13
  571. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  572. package/lib/core/tree/detachedFieldIndex.js +22 -13
  573. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  574. package/lib/core/tree/index.d.ts +4 -3
  575. package/lib/core/tree/index.d.ts.map +1 -1
  576. package/lib/core/tree/index.js +3 -2
  577. package/lib/core/tree/index.js.map +1 -1
  578. package/lib/core/tree/pathTree.d.ts +11 -3
  579. package/lib/core/tree/pathTree.d.ts.map +1 -1
  580. package/lib/core/tree/pathTree.js +12 -1
  581. package/lib/core/tree/pathTree.js.map +1 -1
  582. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  583. package/lib/feature-libraries/chunked-forest/basicChunk.js +8 -1
  584. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  585. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  586. package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -1
  587. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  588. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
  589. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  590. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  591. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  592. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  593. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +90 -42
  594. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  595. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +232 -69
  596. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  597. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
  598. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  599. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +34 -29
  600. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  601. package/lib/feature-libraries/default-schema/index.d.ts +2 -1
  602. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  603. package/lib/feature-libraries/default-schema/index.js +2 -1
  604. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  605. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +36 -0
  606. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  607. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +122 -0
  608. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  609. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  610. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  611. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  612. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  613. package/lib/feature-libraries/deltaUtils.d.ts +1 -0
  614. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  615. package/lib/feature-libraries/deltaUtils.js +5 -1
  616. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  617. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  618. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  619. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +38 -8
  620. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  621. package/lib/feature-libraries/flex-tree/context.d.ts +9 -0
  622. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  623. package/lib/feature-libraries/flex-tree/context.js +6 -0
  624. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  625. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  626. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  627. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  628. package/lib/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  629. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  630. package/lib/feature-libraries/flex-tree/lazyField.js +38 -9
  631. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  632. package/lib/feature-libraries/forest-summary/codec.d.ts +2 -2
  633. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  634. package/lib/feature-libraries/forest-summary/codec.js +5 -5
  635. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  636. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
  637. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  638. package/lib/feature-libraries/forest-summary/forestSummarizer.js +17 -22
  639. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  640. package/lib/feature-libraries/forest-summary/format.d.ts +41 -5
  641. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  642. package/lib/feature-libraries/forest-summary/format.js +3 -3
  643. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  644. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
  645. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  646. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +13 -26
  647. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  648. package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
  649. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  650. package/lib/feature-libraries/forest-summary/index.js +2 -1
  651. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  652. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
  653. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  654. package/lib/feature-libraries/forest-summary/summaryTypes.js +53 -0
  655. package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  656. package/lib/feature-libraries/index.d.ts +4 -4
  657. package/lib/feature-libraries/index.d.ts.map +1 -1
  658. package/lib/feature-libraries/index.js +3 -3
  659. package/lib/feature-libraries/index.js.map +1 -1
  660. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  661. package/lib/feature-libraries/mapTreeCursor.js +2 -1
  662. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  663. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  664. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  665. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  666. package/lib/feature-libraries/modular-schema/comparison.d.ts +18 -2
  667. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  668. package/lib/feature-libraries/modular-schema/comparison.js +55 -5
  669. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  670. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  671. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  672. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +3 -5
  673. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  674. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -52
  675. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  676. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  677. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  678. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  679. package/lib/feature-libraries/modular-schema/fieldKind.js +0 -21
  680. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  681. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  682. package/lib/feature-libraries/modular-schema/genericFieldKind.js +7 -10
  683. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  684. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -1
  685. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  686. package/lib/feature-libraries/modular-schema/index.d.ts +5 -5
  687. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  688. package/lib/feature-libraries/modular-schema/index.js +4 -3
  689. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  690. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
  691. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
  692. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +384 -0
  693. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
  694. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
  695. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
  696. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +409 -0
  697. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
  698. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  699. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  700. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +9 -285
  701. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  702. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +48 -15
  703. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  704. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1284 -458
  705. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  706. package/lib/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
  707. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
  708. package/lib/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +2 -2
  709. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
  710. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
  711. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
  712. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +29 -0
  713. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
  714. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
  715. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  716. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +20 -2
  717. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  718. package/lib/feature-libraries/optional-field/index.d.ts +2 -2
  719. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  720. package/lib/feature-libraries/optional-field/index.js +1 -1
  721. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  722. package/lib/feature-libraries/optional-field/optionalField.d.ts +5 -26
  723. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  724. package/lib/feature-libraries/optional-field/optionalField.js +217 -449
  725. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  726. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  727. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  728. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  729. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  730. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  731. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +55 -26
  732. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  733. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  734. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  735. package/lib/feature-libraries/schema-index/schemaSummarizer.js +38 -12
  736. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  737. package/lib/feature-libraries/sequence-field/compose.d.ts +6 -7
  738. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  739. package/lib/feature-libraries/sequence-field/compose.js +82 -258
  740. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  741. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  742. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  743. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  744. package/lib/feature-libraries/sequence-field/index.d.ts +2 -3
  745. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  746. package/lib/feature-libraries/sequence-field/index.js +0 -1
  747. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  748. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  749. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  750. package/lib/feature-libraries/sequence-field/invert.js +67 -169
  751. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  752. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  753. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  754. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  755. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  756. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  757. package/lib/feature-libraries/sequence-field/moveEffectTable.js +6 -80
  758. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  759. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  760. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  761. package/lib/feature-libraries/sequence-field/rebase.js +108 -114
  762. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  763. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  764. package/lib/feature-libraries/sequence-field/replaceRevisions.js +16 -33
  765. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  766. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  767. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  768. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  769. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  770. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  771. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +350 -175
  772. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  773. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  774. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +21 -61
  775. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  776. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  777. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  778. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  779. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  780. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  781. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  782. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
  783. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  784. package/lib/feature-libraries/sequence-field/types.d.ts +30 -59
  785. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  786. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  787. package/lib/feature-libraries/sequence-field/utils.d.ts +15 -24
  788. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  789. package/lib/feature-libraries/sequence-field/utils.js +107 -292
  790. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  791. package/lib/index.d.ts +1 -1
  792. package/lib/index.d.ts.map +1 -1
  793. package/lib/index.js +1 -1
  794. package/lib/index.js.map +1 -1
  795. package/lib/packageVersion.d.ts +1 -1
  796. package/lib/packageVersion.js +1 -1
  797. package/lib/packageVersion.js.map +1 -1
  798. package/lib/shared-tree/independentView.d.ts +1 -1
  799. package/lib/shared-tree/independentView.d.ts.map +1 -1
  800. package/lib/shared-tree/independentView.js.map +1 -1
  801. package/lib/shared-tree/index.d.ts +1 -1
  802. package/lib/shared-tree/index.d.ts.map +1 -1
  803. package/lib/shared-tree/index.js.map +1 -1
  804. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  805. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  806. package/lib/shared-tree/schematizeTree.js +3 -2
  807. package/lib/shared-tree/schematizeTree.js.map +1 -1
  808. package/lib/shared-tree/schematizingTreeView.d.ts +1 -5
  809. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  810. package/lib/shared-tree/schematizingTreeView.js +35 -36
  811. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  812. package/lib/shared-tree/sharedTree.d.ts +11 -5
  813. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  814. package/lib/shared-tree/sharedTree.js +14 -4
  815. package/lib/shared-tree/sharedTree.js.map +1 -1
  816. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  817. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  818. package/lib/shared-tree/sharedTreeChangeCodecs.js +1 -0
  819. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  820. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  821. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  822. package/lib/shared-tree/sharedTreeChangeEnricher.js +25 -11
  823. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  824. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  825. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  826. package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
  827. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  828. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  829. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  830. package/lib/shared-tree/sharedTreeEditBuilder.js +11 -5
  831. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  832. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  833. package/lib/shared-tree/treeAlpha.js +2 -2
  834. package/lib/shared-tree/treeAlpha.js.map +1 -1
  835. package/lib/shared-tree/treeCheckout.d.ts +12 -10
  836. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  837. package/lib/shared-tree/treeCheckout.js +69 -20
  838. package/lib/shared-tree/treeCheckout.js.map +1 -1
  839. package/lib/shared-tree-core/branch.d.ts +3 -2
  840. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  841. package/lib/shared-tree-core/branch.js +4 -3
  842. package/lib/shared-tree-core/branch.js.map +1 -1
  843. package/lib/shared-tree-core/editManager.d.ts +2 -2
  844. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  845. package/lib/shared-tree-core/editManager.js +9 -9
  846. package/lib/shared-tree-core/editManager.js.map +1 -1
  847. package/lib/shared-tree-core/editManagerCodecs.d.ts +4 -0
  848. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  849. package/lib/shared-tree-core/editManagerCodecs.js +14 -5
  850. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  851. package/{dist/shared-tree-core/editManagerCodecsV5.d.ts → lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  852. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  853. package/lib/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +4 -4
  854. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  855. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
  856. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  857. package/lib/shared-tree-core/editManagerFormatCommons.js +22 -7
  858. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  859. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  860. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  861. package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  862. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  863. package/lib/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  864. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  865. package/lib/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  866. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  867. package/lib/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  868. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  869. package/lib/shared-tree-core/editManagerSummarizer.js +39 -11
  870. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  871. package/lib/shared-tree-core/index.d.ts +5 -3
  872. package/lib/shared-tree-core/index.d.ts.map +1 -1
  873. package/lib/shared-tree-core/index.js +4 -2
  874. package/lib/shared-tree-core/index.js.map +1 -1
  875. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  876. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  877. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  878. package/{dist/shared-tree-core/messageCodecV5.d.ts → lib/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  879. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  880. package/lib/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +3 -3
  881. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  882. package/lib/shared-tree-core/messageCodecs.d.ts +4 -0
  883. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  884. package/lib/shared-tree-core/messageCodecs.js +14 -5
  885. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  886. package/lib/shared-tree-core/messageFormat.d.ts +20 -6
  887. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  888. package/lib/shared-tree-core/messageFormat.js +22 -7
  889. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  890. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  891. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  892. package/lib/shared-tree-core/messageFormatV1ToV4.js +8 -1
  893. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  894. package/lib/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
  895. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  896. package/lib/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  897. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  898. package/lib/shared-tree-core/sharedTreeCore.d.ts +14 -47
  899. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  900. package/lib/shared-tree-core/sharedTreeCore.js +28 -16
  901. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  902. package/lib/shared-tree-core/summaryTypes.d.ts +94 -0
  903. package/lib/shared-tree-core/summaryTypes.d.ts.map +1 -0
  904. package/lib/shared-tree-core/summaryTypes.js +43 -0
  905. package/lib/shared-tree-core/summaryTypes.js.map +1 -0
  906. package/lib/shared-tree-core/versionedSummarizer.d.ts +67 -0
  907. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  908. package/lib/shared-tree-core/versionedSummarizer.js +59 -0
  909. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -0
  910. package/lib/simple-tree/api/configuration.d.ts +3 -26
  911. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  912. package/lib/simple-tree/api/configuration.js +14 -25
  913. package/lib/simple-tree/api/configuration.js.map +1 -1
  914. package/lib/simple-tree/api/dirtyIndex.d.ts +11 -0
  915. package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  916. package/lib/simple-tree/api/dirtyIndex.js +7 -0
  917. package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
  918. package/lib/simple-tree/api/discrepancies.d.ts +1 -1
  919. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  920. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  921. package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -3
  922. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  923. package/lib/simple-tree/api/getSimpleSchema.js +9 -3
  924. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
  925. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  926. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  927. package/lib/simple-tree/api/incrementalAllowedTypes.js +8 -1
  928. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  929. package/lib/simple-tree/api/index.d.ts +3 -4
  930. package/lib/simple-tree/api/index.d.ts.map +1 -1
  931. package/lib/simple-tree/api/index.js +2 -3
  932. package/lib/simple-tree/api/index.js.map +1 -1
  933. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  934. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  935. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  936. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  937. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  938. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  939. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  940. package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -1
  941. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  942. package/lib/simple-tree/api/schemaFromSimple.d.ts +6 -1
  943. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  944. package/lib/simple-tree/api/schemaFromSimple.js +5 -0
  945. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  946. package/lib/simple-tree/api/schemaStatics.d.ts +12 -12
  947. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  948. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  949. package/lib/simple-tree/api/simpleSchemaCodec.js +15 -3
  950. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  951. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  952. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  953. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  954. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  955. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  956. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +15 -10
  957. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  958. package/lib/simple-tree/api/typesUnsafe.d.ts +3 -3
  959. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  960. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  961. package/lib/simple-tree/core/allowedTypes.d.ts +2 -2
  962. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  963. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  964. package/lib/simple-tree/core/index.d.ts +1 -1
  965. package/lib/simple-tree/core/index.d.ts.map +1 -1
  966. package/lib/simple-tree/core/index.js +1 -1
  967. package/lib/simple-tree/core/index.js.map +1 -1
  968. package/lib/simple-tree/core/toStored.d.ts +17 -15
  969. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  970. package/lib/simple-tree/core/toStored.js +4 -37
  971. package/lib/simple-tree/core/toStored.js.map +1 -1
  972. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  973. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  974. package/lib/simple-tree/core/unhydratedFlexTree.js +58 -8
  975. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  976. package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
  977. package/lib/simple-tree/core/walkSchema.js +5 -1
  978. package/lib/simple-tree/core/walkSchema.js.map +1 -1
  979. package/lib/simple-tree/createContext.d.ts.map +1 -1
  980. package/lib/simple-tree/createContext.js +20 -5
  981. package/lib/simple-tree/createContext.js.map +1 -1
  982. package/lib/simple-tree/fieldSchema.d.ts +7 -7
  983. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  984. package/lib/simple-tree/fieldSchema.js.map +1 -1
  985. package/lib/simple-tree/index.d.ts +8 -7
  986. package/lib/simple-tree/index.d.ts.map +1 -1
  987. package/lib/simple-tree/index.js +6 -5
  988. package/lib/simple-tree/index.js.map +1 -1
  989. package/lib/simple-tree/leafNodeSchema.d.ts +5 -5
  990. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  991. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  992. package/lib/simple-tree/node-kinds/array/arrayNode.js +6 -4
  993. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  994. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  995. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  996. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  997. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  998. package/lib/simple-tree/node-kinds/common.js +2 -2
  999. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  1000. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  1001. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  1002. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  1003. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  1004. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  1005. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  1006. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  1007. package/lib/simple-tree/node-kinds/object/objectNode.js +19 -19
  1008. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  1009. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  1010. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  1011. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  1012. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  1013. package/lib/simple-tree/node-kinds/record/recordNode.js +4 -2
  1014. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  1015. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  1016. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  1017. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  1018. package/lib/simple-tree/prepareForInsertion.d.ts +54 -47
  1019. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  1020. package/lib/simple-tree/prepareForInsertion.js +183 -124
  1021. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  1022. package/lib/simple-tree/simpleSchema.d.ts +55 -23
  1023. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  1024. package/lib/simple-tree/simpleSchema.js +16 -1
  1025. package/lib/simple-tree/simpleSchema.js.map +1 -1
  1026. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  1027. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  1028. package/lib/simple-tree/simpleSchemaFormatV1.js +8 -1
  1029. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  1030. package/lib/simple-tree/toStoredSchema.d.ts +58 -11
  1031. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  1032. package/lib/simple-tree/toStoredSchema.js +204 -31
  1033. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  1034. package/lib/simple-tree/treeSchema.d.ts +23 -0
  1035. package/lib/simple-tree/treeSchema.d.ts.map +1 -0
  1036. package/lib/simple-tree/treeSchema.js +21 -0
  1037. package/lib/simple-tree/treeSchema.js.map +1 -0
  1038. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  1039. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  1040. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +26 -9
  1041. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  1042. package/lib/tableSchema.d.ts +117 -63
  1043. package/lib/tableSchema.d.ts.map +1 -1
  1044. package/lib/tableSchema.js +160 -59
  1045. package/lib/tableSchema.js.map +1 -1
  1046. package/lib/treeFactory.d.ts.map +1 -1
  1047. package/lib/treeFactory.js +18 -4
  1048. package/lib/treeFactory.js.map +1 -1
  1049. package/lib/util/index.d.ts +2 -1
  1050. package/lib/util/index.d.ts.map +1 -1
  1051. package/lib/util/index.js +2 -1
  1052. package/lib/util/index.js.map +1 -1
  1053. package/lib/util/rangeMap.d.ts +24 -12
  1054. package/lib/util/rangeMap.d.ts.map +1 -1
  1055. package/lib/util/rangeMap.js +44 -5
  1056. package/lib/util/rangeMap.js.map +1 -1
  1057. package/lib/util/readSnapshotBlob.d.ts +13 -0
  1058. package/lib/util/readSnapshotBlob.d.ts.map +1 -0
  1059. package/lib/util/readSnapshotBlob.js +14 -0
  1060. package/lib/util/readSnapshotBlob.js.map +1 -0
  1061. package/package.json +21 -21
  1062. package/src/codec/codec.ts +15 -1
  1063. package/src/codec/versioned/codec.ts +1 -1
  1064. package/src/codec/versioned/format.ts +4 -1
  1065. package/src/core/change-family/changeFamily.ts +5 -0
  1066. package/src/core/change-family/index.ts +1 -0
  1067. package/src/core/index.ts +7 -2
  1068. package/src/core/rebase/changeRebaser.ts +6 -1
  1069. package/src/core/rebase/index.ts +1 -0
  1070. package/src/core/rebase/types.ts +8 -1
  1071. package/src/core/rebase/utils.ts +31 -7
  1072. package/src/core/tree/detachedFieldIndex.ts +71 -14
  1073. package/src/core/tree/index.ts +9 -3
  1074. package/src/core/tree/pathTree.ts +16 -4
  1075. package/src/feature-libraries/chunked-forest/basicChunk.ts +7 -1
  1076. package/src/feature-libraries/chunked-forest/chunkTree.ts +6 -1
  1077. package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +15 -7
  1078. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
  1079. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +393 -127
  1080. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +35 -38
  1081. package/src/feature-libraries/default-schema/index.ts +16 -5
  1082. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +180 -0
  1083. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +35 -9
  1084. package/src/feature-libraries/deltaUtils.ts +6 -1
  1085. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +62 -15
  1086. package/src/feature-libraries/flex-tree/context.ts +17 -0
  1087. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +7 -8
  1088. package/src/feature-libraries/flex-tree/lazyField.ts +66 -24
  1089. package/src/feature-libraries/forest-summary/codec.ts +8 -8
  1090. package/src/feature-libraries/forest-summary/forestSummarizer.ts +45 -37
  1091. package/src/feature-libraries/forest-summary/format.ts +4 -4
  1092. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +23 -39
  1093. package/src/feature-libraries/forest-summary/index.ts +2 -1
  1094. package/src/feature-libraries/forest-summary/summaryTypes.ts +61 -0
  1095. package/src/feature-libraries/index.ts +22 -9
  1096. package/src/feature-libraries/mapTreeCursor.ts +2 -1
  1097. package/src/feature-libraries/mitigatedChangeFamily.ts +3 -1
  1098. package/src/feature-libraries/modular-schema/comparison.ts +63 -5
  1099. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +142 -44
  1100. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +36 -57
  1101. package/src/feature-libraries/modular-schema/fieldKind.ts +24 -40
  1102. package/src/feature-libraries/modular-schema/genericFieldKind.ts +10 -19
  1103. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -1
  1104. package/src/feature-libraries/modular-schema/index.ts +21 -15
  1105. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +732 -0
  1106. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +790 -0
  1107. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +29 -499
  1108. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2542 -742
  1109. package/src/feature-libraries/modular-schema/{modularChangeFormat.ts → modularChangeFormatV1.ts} +2 -1
  1110. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +62 -0
  1111. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +98 -10
  1112. package/src/feature-libraries/optional-field/index.ts +1 -3
  1113. package/src/feature-libraries/optional-field/optionalField.ts +317 -574
  1114. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +24 -38
  1115. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
  1116. package/src/feature-libraries/schema-index/schemaSummarizer.ts +59 -18
  1117. package/src/feature-libraries/sequence-field/compose.ts +134 -519
  1118. package/src/feature-libraries/sequence-field/helperTypes.ts +34 -19
  1119. package/src/feature-libraries/sequence-field/index.ts +0 -9
  1120. package/src/feature-libraries/sequence-field/invert.ts +103 -228
  1121. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1122. package/src/feature-libraries/sequence-field/moveEffectTable.ts +8 -191
  1123. package/src/feature-libraries/sequence-field/rebase.ts +168 -203
  1124. package/src/feature-libraries/sequence-field/replaceRevisions.ts +31 -52
  1125. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +0 -2
  1126. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +643 -220
  1127. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +56 -68
  1128. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +25 -27
  1129. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +19 -129
  1130. package/src/feature-libraries/sequence-field/types.ts +34 -64
  1131. package/src/feature-libraries/sequence-field/utils.ts +133 -346
  1132. package/src/index.ts +3 -2
  1133. package/src/packageVersion.ts +1 -1
  1134. package/src/shared-tree/independentView.ts +1 -1
  1135. package/src/shared-tree/index.ts +3 -2
  1136. package/src/shared-tree/schematizeTree.ts +21 -8
  1137. package/src/shared-tree/schematizingTreeView.ts +50 -68
  1138. package/src/shared-tree/sharedTree.ts +39 -12
  1139. package/src/shared-tree/sharedTreeChangeCodecs.ts +5 -1
  1140. package/src/shared-tree/sharedTreeChangeEnricher.ts +31 -11
  1141. package/src/shared-tree/sharedTreeChangeFamily.ts +7 -4
  1142. package/src/shared-tree/sharedTreeEditBuilder.ts +46 -12
  1143. package/src/shared-tree/treeAlpha.ts +2 -3
  1144. package/src/shared-tree/treeCheckout.ts +104 -31
  1145. package/src/shared-tree-core/branch.ts +8 -2
  1146. package/src/shared-tree-core/editManager.ts +16 -2
  1147. package/src/shared-tree-core/editManagerCodecs.ts +17 -5
  1148. package/src/shared-tree-core/{editManagerCodecsV5.ts → editManagerCodecsVSharedBranches.ts} +3 -3
  1149. package/src/shared-tree-core/editManagerFormatCommons.ts +22 -7
  1150. package/src/shared-tree-core/editManagerFormatV1toV4.ts +3 -1
  1151. package/src/shared-tree-core/{editManagerFormatV5.ts → editManagerFormatVSharedBranches.ts} +2 -2
  1152. package/src/shared-tree-core/editManagerSummarizer.ts +58 -16
  1153. package/src/shared-tree-core/index.ts +11 -3
  1154. package/src/shared-tree-core/messageCodecV1ToV4.ts +2 -1
  1155. package/src/shared-tree-core/{messageCodecV5.ts → messageCodecVSharedBranches.ts} +3 -3
  1156. package/src/shared-tree-core/messageCodecs.ts +17 -5
  1157. package/src/shared-tree-core/messageFormat.ts +22 -7
  1158. package/src/shared-tree-core/messageFormatV1ToV4.ts +16 -2
  1159. package/src/shared-tree-core/{messageFormatV5.ts → messageFormatVSharedBranches.ts} +4 -6
  1160. package/src/shared-tree-core/sharedTreeCore.ts +67 -76
  1161. package/src/shared-tree-core/summaryTypes.ts +122 -0
  1162. package/src/shared-tree-core/versionedSummarizer.ts +107 -0
  1163. package/src/simple-tree/api/configuration.ts +21 -68
  1164. package/src/simple-tree/api/dirtyIndex.ts +11 -0
  1165. package/src/simple-tree/api/discrepancies.ts +1 -1
  1166. package/src/simple-tree/api/getSimpleSchema.ts +13 -6
  1167. package/src/simple-tree/api/incrementalAllowedTypes.ts +15 -3
  1168. package/src/simple-tree/api/index.ts +3 -4
  1169. package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
  1170. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
  1171. package/src/simple-tree/api/schemaFactoryRecursive.ts +0 -2
  1172. package/src/simple-tree/api/schemaFromSimple.ts +11 -5
  1173. package/src/simple-tree/api/simpleSchemaCodec.ts +17 -3
  1174. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
  1175. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +18 -10
  1176. package/src/simple-tree/api/typesUnsafe.ts +7 -3
  1177. package/src/simple-tree/core/allowedTypes.ts +3 -3
  1178. package/src/simple-tree/core/index.ts +2 -2
  1179. package/src/simple-tree/core/toStored.ts +22 -55
  1180. package/src/simple-tree/core/unhydratedFlexTree.ts +87 -36
  1181. package/src/simple-tree/core/walkSchema.ts +6 -0
  1182. package/src/simple-tree/createContext.ts +26 -11
  1183. package/src/simple-tree/fieldSchema.ts +16 -7
  1184. package/src/simple-tree/index.ts +12 -11
  1185. package/src/simple-tree/node-kinds/array/arrayNode.ts +12 -7
  1186. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +3 -3
  1187. package/src/simple-tree/node-kinds/common.ts +2 -5
  1188. package/src/simple-tree/node-kinds/map/mapNode.ts +9 -6
  1189. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +3 -3
  1190. package/src/simple-tree/node-kinds/object/objectNode.ts +26 -26
  1191. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -2
  1192. package/src/simple-tree/node-kinds/record/recordNode.ts +15 -11
  1193. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +3 -3
  1194. package/src/simple-tree/prepareForInsertion.ts +343 -200
  1195. package/src/simple-tree/simpleSchema.ts +79 -32
  1196. package/src/simple-tree/simpleSchemaFormatV1.ts +9 -1
  1197. package/src/simple-tree/toStoredSchema.ts +319 -61
  1198. package/src/simple-tree/treeSchema.ts +54 -0
  1199. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +42 -14
  1200. package/src/tableSchema.ts +485 -166
  1201. package/src/treeFactory.ts +19 -5
  1202. package/src/util/index.ts +5 -0
  1203. package/src/util/rangeMap.ts +72 -18
  1204. package/src/util/readSnapshotBlob.ts +23 -0
  1205. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
  1206. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
  1207. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  1208. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  1209. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -50
  1210. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  1211. package/dist/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  1212. package/dist/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  1213. package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  1214. package/dist/shared-tree-core/editManagerFormatV5.js.map +0 -1
  1215. package/dist/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  1216. package/dist/shared-tree-core/messageCodecV5.js.map +0 -1
  1217. package/dist/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  1218. package/dist/shared-tree-core/messageFormatV5.js.map +0 -1
  1219. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  1220. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  1221. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +0 -177
  1222. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  1223. package/docs/main/sequence-field/move-composition.md +0 -46
  1224. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
  1225. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
  1226. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  1227. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  1228. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -46
  1229. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  1230. package/lib/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  1231. package/lib/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  1232. package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  1233. package/lib/shared-tree-core/editManagerFormatV5.js.map +0 -1
  1234. package/lib/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  1235. package/lib/shared-tree-core/messageCodecV5.js.map +0 -1
  1236. package/lib/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  1237. package/lib/shared-tree-core/messageFormatV5.js.map +0 -1
  1238. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  1239. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  1240. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +0 -171
  1241. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  1242. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
  1243. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +0 -209
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { fail } from "@fluidframework/core-utils/internal";
6
6
  import { forbiddenFieldKindIdentifier, Multiplicity, } from "../../core/index.js";
7
- import { FlexFieldKind, allowsTreeSchemaIdentifierSuperset, referenceFreeFieldChangeRebaser, } from "../modular-schema/index.js";
7
+ import { FlexFieldKind, referenceFreeFieldChangeRebaser, } from "../modular-schema/index.js";
8
8
  import { optionalChangeHandler, optionalFieldEditor, } from "../optional-field/index.js";
9
9
  import { sequenceFieldChangeHandler, } from "../sequence-field/index.js";
10
10
  import { noChangeCodecFamily } from "./noChangeCodecs.js";
@@ -21,21 +21,26 @@ export const noChangeHandler = {
21
21
  }),
22
22
  codecsFactory: () => noChangeCodecFamily,
23
23
  editor: { buildChildChanges: () => fail(0xb0d /* Child changes not supported */) },
24
- intoDelta: (change, deltaFromChild) => ({}),
25
- relevantRemovedRoots: (change) => [],
24
+ intoDelta: (change, deltaFromChild) => [],
26
25
  isEmpty: (change) => true,
27
26
  getNestedChanges: (change) => [],
28
27
  createEmpty: () => 0,
29
28
  getCrossFieldKeys: () => [],
30
29
  };
31
30
  const optionalIdentifier = brandConst("Optional")();
31
+ const requiredIdentifier = brandConst("Value")();
32
+ const sequenceIdentifier = brandConst("Sequence")();
33
+ const identifierFieldIdentifier = brandConst("Identifier")();
32
34
  /**
33
35
  * 0 or 1 items.
34
36
  */
35
37
  export const optional = new FlexFieldKind(optionalIdentifier, Multiplicity.Optional, {
36
38
  changeHandler: optionalChangeHandler,
37
- allowsTreeSupersetOf: (types, other) => (other.kind === sequence.identifier || other.kind === optionalIdentifier) &&
38
- allowsTreeSchemaIdentifierSuperset(types, other.types),
39
+ allowMonotonicUpgradeFrom: new Set([
40
+ identifierFieldIdentifier,
41
+ requiredIdentifier,
42
+ forbiddenFieldKindIdentifier,
43
+ ]),
39
44
  });
40
45
  export const requiredFieldEditor = {
41
46
  ...optionalFieldEditor,
@@ -45,45 +50,36 @@ export const requiredFieldChangeHandler = {
45
50
  ...optionalChangeHandler,
46
51
  editor: requiredFieldEditor,
47
52
  };
48
- const requiredIdentifier = brandConst("Value")();
49
53
  /**
50
54
  * Exactly one item.
51
55
  */
52
56
  export const required = new FlexFieldKind(requiredIdentifier, Multiplicity.Single, {
53
57
  changeHandler: requiredFieldChangeHandler,
54
- allowsTreeSupersetOf: (types, other) =>
55
- // By omitting Identifier here,
56
- // this is making a policy choice that a schema upgrade cannot be done from required to identifier.
57
- // Since an identifier can be upgraded into a required field,
58
- // preventing the inverse helps ensure that schema upgrades are monotonic.
59
- // Which direction is allowed is a subjective policy choice.
60
- (other.kind === sequence.identifier ||
61
- other.kind === requiredIdentifier ||
62
- other.kind === optional.identifier) &&
63
- allowsTreeSchemaIdentifierSuperset(types, other.types),
58
+ allowMonotonicUpgradeFrom: new Set([identifierFieldIdentifier]),
64
59
  });
65
- const sequenceIdentifier = brandConst("Sequence")();
66
60
  /**
67
61
  * 0 or more items.
68
62
  */
69
63
  export const sequence = new FlexFieldKind(sequenceIdentifier, Multiplicity.Sequence, {
70
64
  changeHandler: sequenceFieldChangeHandler,
71
- allowsTreeSupersetOf: (types, other) => other.kind === sequenceIdentifier &&
72
- allowsTreeSchemaIdentifierSuperset(types, other.types),
65
+ allowMonotonicUpgradeFrom: new Set([
66
+ required.identifier,
67
+ optional.identifier,
68
+ identifierFieldIdentifier,
69
+ forbiddenFieldKindIdentifier,
70
+ ]),
73
71
  });
74
- const identifierFieldIdentifier = brandConst("Identifier")();
75
72
  /**
76
73
  * Exactly one identifier.
77
74
  */
78
75
  export const identifier = new FlexFieldKind(identifierFieldIdentifier, Multiplicity.Single, {
79
76
  changeHandler: noChangeHandler,
80
- allowsTreeSupersetOf: (types, other) =>
81
- // Allows upgrading from identifier to required: which way this upgrade is allowed to go is a subjective policy choice.
82
- (other.kind === sequence.identifier ||
83
- other.kind === requiredIdentifier ||
84
- other.kind === optional.identifier ||
85
- other.kind === identifierFieldIdentifier) &&
86
- allowsTreeSchemaIdentifierSuperset(types, other.types),
77
+ // By omitting required here,
78
+ // this is making a policy choice that a schema upgrade cannot be done from required to identifier.
79
+ // Since an identifier can be upgraded into a required field,
80
+ // preventing the inverse helps ensure that schema upgrades are monotonic.
81
+ // Which direction is allowed is a subjective policy choice.
82
+ allowMonotonicUpgradeFrom: new Set([]),
87
83
  });
88
84
  /**
89
85
  * Exactly 0 items.
@@ -115,8 +111,7 @@ export const identifier = new FlexFieldKind(identifierFieldIdentifier, Multiplic
115
111
  */
116
112
  export const forbidden = new FlexFieldKind(forbiddenFieldKindIdentifier, Multiplicity.Forbidden, {
117
113
  changeHandler: noChangeHandler,
118
- // All multiplicities other than Value support empty.
119
- allowsTreeSupersetOf: (types, other) => fieldKinds.get(other.kind)?.multiplicity !== Multiplicity.Single,
114
+ allowMonotonicUpgradeFrom: new Set(),
120
115
  });
121
116
  export const fieldKindConfigurations = new Map([
122
117
  [
@@ -139,6 +134,16 @@ export const fieldKindConfigurations = new Map([
139
134
  [identifier.identifier, { kind: identifier, formatVersion: 1 }],
140
135
  ]),
141
136
  ],
137
+ [
138
+ brand(101), // Detached roots
139
+ new Map([
140
+ [required.identifier, { kind: required, formatVersion: 2 }],
141
+ [optional.identifier, { kind: optional, formatVersion: 2 }],
142
+ [sequence.identifier, { kind: sequence, formatVersion: 2 }],
143
+ [forbidden.identifier, { kind: forbidden, formatVersion: 1 }],
144
+ [identifier.identifier, { kind: identifier, formatVersion: 1 }],
145
+ ]),
146
+ ],
142
147
  ]);
143
148
  export function getCodecTreeForModularChangeFormat(version) {
144
149
  const dependencies = fieldKindConfigurations.get(version) ?? fail(0xc7c /* Unknown modular change format */);
@@ -1 +1 @@
1
- {"version":3,"file":"defaultFieldKinds.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultFieldKinds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAE3D,OAAO,EAIN,4BAA4B,EAC5B,YAAY,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAMN,aAAa,EAGb,kCAAkC,EAClC,+BAA+B,GAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGN,qBAAqB,EACrB,mBAAmB,GACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,0BAA0B,GAE1B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAc,MAAM,qBAAqB,CAAC;AAEpE;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAA0B;IACrD,OAAO,EAAE,+BAA+B,CAAC;QACxC,OAAO,EAAE,CAAC,OAAU,EAAE,OAAU,EAAE,EAAE,CAAC,CAAC;QACtC,MAAM,EAAE,CAAC,OAAU,EAAE,EAAE,CAAC,CAAC;QACzB,MAAM,EAAE,CAAC,MAAS,EAAE,IAAO,EAAE,EAAE,CAAC,CAAC;QACjC,IAAI,EAAE,CAAC,OAAU,EAAE,EAAE,CAAC,CAAC;KACvB,CAAC;IACF,aAAa,EAAE,GAAG,EAAE,CAAC,mBAAmB;IACxC,MAAM,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,iCAAiC,CAAC,EAAE;IAClF,SAAS,EAAE,CAAC,MAAM,EAAE,cAAuB,EAAoB,EAAE,CAAC,CAAC,EAAE,CAAC;IACtE,oBAAoB,EAAE,CAAC,MAAM,EAAiC,EA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Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype DeltaDetachedNodeId,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity,\n} from \"../../core/index.js\";\nimport {\n\ttype FieldChangeDelta,\n\ttype FieldChangeHandler,\n\ttype FieldEditor,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\ttype ToDelta,\n\tallowsTreeSchemaIdentifierSuperset,\n\treferenceFreeFieldChangeRebaser,\n} from \"../modular-schema/index.js\";\nimport {\n\ttype OptionalChangeset,\n\ttype OptionalFieldEditor,\n\toptionalChangeHandler,\n\toptionalFieldEditor,\n} from \"../optional-field/index.js\";\nimport {\n\tsequenceFieldChangeHandler,\n\ttype SequenceFieldEditor,\n} from \"../sequence-field/index.js\";\n\nimport { noChangeCodecFamily } from \"./noChangeCodecs.js\";\nimport type { CodecTree } from \"../../codec/index.js\";\nimport { brand, brandConst, type Brand } from \"../../util/index.js\";\n\n/**\n * ChangeHandler that only handles no-op / identity changes.\n */\nexport const noChangeHandler: FieldChangeHandler<0> = {\n\trebaser: referenceFreeFieldChangeRebaser({\n\t\tcompose: (change1: 0, change2: 0) => 0,\n\t\tinvert: (changes: 0) => 0,\n\t\trebase: (change: 0, over: 0) => 0,\n\t\tmute: (changes: 0) => 0,\n\t}),\n\tcodecsFactory: () => noChangeCodecFamily,\n\teditor: { buildChildChanges: () => fail(0xb0d /* Child changes not supported */) },\n\tintoDelta: (change, deltaFromChild: ToDelta): FieldChangeDelta => ({}),\n\trelevantRemovedRoots: (change): Iterable<DeltaDetachedNodeId> => [],\n\tisEmpty: (change: 0) => true,\n\tgetNestedChanges: (change: 0) => [],\n\tcreateEmpty: () => 0,\n\tgetCrossFieldKeys: () => [],\n};\n\n/**\n * {@link FieldEditor} for required fields (always contain exactly 1 child).\n * @remarks\n * This shares code with optional fields, since they are the same edit wise except setting to empty is not allowed,\n * and the content is always assumed to not be empty.\n * This means the actual edits implemented for optional fields are sufficient to support required fields\n * which is why this is defined and implemented in terms of optional fields.\n */\nexport interface RequiredFieldEditor extends FieldEditor<OptionalChangeset> {\n\t/**\n\t * Creates a change which replaces the current value of the field with `newValue`.\n\t * @param ids - The ids for the fill and detach fields.\n\t */\n\tset(ids: { fill: ChangeAtomId; detach: ChangeAtomId }): OptionalChangeset;\n}\n\nconst optionalIdentifier = brandConst(\"Optional\")<FieldKindIdentifier>();\n\n/**\n * 0 or 1 items.\n */\nexport const optional = new FlexFieldKind(optionalIdentifier, Multiplicity.Optional, {\n\tchangeHandler: optionalChangeHandler,\n\tallowsTreeSupersetOf: (types, other) =>\n\t\t(other.kind === sequence.identifier || other.kind === optionalIdentifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n});\n\nexport const requiredFieldEditor: RequiredFieldEditor = {\n\t...optionalFieldEditor,\n\tset: (ids: {\n\t\tfill: ChangeAtomId;\n\t\tdetach: ChangeAtomId;\n\t}): OptionalChangeset => optionalFieldEditor.set(false, ids),\n};\n\nexport const requiredFieldChangeHandler: FieldChangeHandler<\n\tOptionalChangeset,\n\tRequiredFieldEditor\n> = {\n\t...optionalChangeHandler,\n\teditor: requiredFieldEditor,\n};\n\nconst requiredIdentifier = brandConst(\"Value\")<FieldKindIdentifier>();\n\n/**\n * Exactly one item.\n */\nexport const required = new FlexFieldKind(requiredIdentifier, Multiplicity.Single, {\n\tchangeHandler: requiredFieldChangeHandler,\n\tallowsTreeSupersetOf: (types, other) =>\n\t\t// By omitting Identifier here,\n\t\t// this is making a policy choice that a schema upgrade cannot be done from required to identifier.\n\t\t// Since an identifier can be upgraded into a required field,\n\t\t// preventing the inverse helps ensure that schema upgrades are monotonic.\n\t\t// Which direction is allowed is a subjective policy choice.\n\t\t(other.kind === sequence.identifier ||\n\t\t\tother.kind === requiredIdentifier ||\n\t\t\tother.kind === optional.identifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n});\n\nconst sequenceIdentifier = brandConst(\"Sequence\")<FieldKindIdentifier>();\n\n/**\n * 0 or more items.\n */\nexport const sequence = new FlexFieldKind(sequenceIdentifier, Multiplicity.Sequence, {\n\tchangeHandler: sequenceFieldChangeHandler,\n\tallowsTreeSupersetOf: (types, other) =>\n\t\tother.kind === sequenceIdentifier &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n});\n\nconst identifierFieldIdentifier = brandConst(\"Identifier\")<FieldKindIdentifier>();\n\n/**\n * Exactly one identifier.\n */\nexport const identifier = new FlexFieldKind(identifierFieldIdentifier, Multiplicity.Single, {\n\tchangeHandler: noChangeHandler,\n\tallowsTreeSupersetOf: (types, other) =>\n\t\t// Allows upgrading from identifier to required: which way this upgrade is allowed to go is a subjective policy choice.\n\t\t(other.kind === sequence.identifier ||\n\t\t\tother.kind === requiredIdentifier ||\n\t\t\tother.kind === optional.identifier ||\n\t\t\tother.kind === identifierFieldIdentifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n});\n\n/**\n * Exactly 0 items.\n *\n * Using Forbidden makes what types are listed for allowed in a field irrelevant\n * since the field will never have values in it.\n *\n * Using Forbidden is equivalent to picking a kind that permits empty (like sequence or optional)\n * and having no allowed types (or only never types).\n * Because of this, its possible to express everything constraint wise without Forbidden,\n * but using Forbidden can be more semantically clear than optional with no allowed types.\n *\n * For view schema, this can be useful if you need to:\n * - run a specific out of schema handler when a field is present,\n * but otherwise are ignoring or tolerating (ex: via extra fields) unmentioned fields.\n * - prevent a specific field from being used as an extra field\n * (perhaps for some past of future compatibility reason)\n * - keep a field in a schema for metadata purposes\n * (ex: for improved error messaging, error handling or documentation)\n * that is not used in this specific version of the schema (ex: to document what it was or will be used for).\n *\n * For stored schema, this can be useful if you need to:\n * - have a field which can have its schema updated to Optional or Sequence of any type.\n * - to exclude a field from extra fields\n * - for the schema system to use as a default for fields which aren't declared\n * (ex: when updating a field that did not exist into one that does)\n *\n * See {@link emptyField} for a constant, reusable field using Forbidden.\n */\nexport const forbidden = new FlexFieldKind(\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity.Forbidden,\n\t{\n\t\tchangeHandler: noChangeHandler,\n\t\t// All multiplicities other than Value support empty.\n\t\tallowsTreeSupersetOf: (types, other) =>\n\t\t\tfieldKinds.get(other.kind)?.multiplicity !== Multiplicity.Single,\n\t},\n);\n\nexport const fieldKindConfigurations: ReadonlyMap<\n\tModularChangeFormatVersion,\n\tFieldKindConfiguration\n> = new Map([\n\t[\n\t\tbrand(3),\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 2 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\tbrand(4),\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 3 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n]);\n\nexport type ModularChangeFormatVersion = Brand<3 | 4, \"ModularChangeFormatVersion\">;\nexport function getCodecTreeForModularChangeFormat(\n\tversion: ModularChangeFormatVersion,\n): CodecTree {\n\tconst dependencies =\n\t\tfieldKindConfigurations.get(version) ?? fail(0xc7c /* Unknown modular change format */);\n\tconst children: CodecTree[] = Array.from(dependencies.entries()).map(\n\t\t([key, { formatVersion }]) => ({\n\t\t\tname: `FieldKind:${key}`,\n\t\t\tversion: formatVersion,\n\t\t}),\n\t);\n\treturn {\n\t\tname: \"ModularChange\",\n\t\tversion,\n\t\tchildren,\n\t};\n}\n\n/**\n * All supported field kinds.\n *\n * @privateRemarks\n * Before making a SharedTree format change which impacts which set of field kinds are allowed,\n * code which uses this should be audited for compatibility considerations.\n */\nexport const fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind> = new Map(\n\t[required, optional, sequence, identifier, forbidden].map((s) => [s.identifier, s]),\n);\n\n// Create named Aliases for nicer intellisense.\n\n// TODO: Find a way to make docs like {@inheritDoc required} work in vscode.\n// TODO: ensure thy work in generated docs.\n// TODO: add these comments to the rest of the cases below.\nexport interface Required\n\textends FlexFieldKind<RequiredFieldEditor, typeof requiredIdentifier, Multiplicity.Single> {}\nexport interface Optional\n\textends FlexFieldKind<\n\t\tOptionalFieldEditor,\n\t\ttypeof optionalIdentifier,\n\t\tMultiplicity.Optional\n\t> {}\nexport interface Sequence\n\textends FlexFieldKind<\n\t\tSequenceFieldEditor,\n\t\ttypeof sequenceIdentifier,\n\t\tMultiplicity.Sequence\n\t> {}\nexport interface Identifier\n\textends FlexFieldKind<\n\t\tFieldEditor<0>,\n\t\ttypeof identifierFieldIdentifier,\n\t\tMultiplicity.Single\n\t> {}\nexport interface Forbidden\n\textends FlexFieldKind<\n\t\tFieldEditor<0>,\n\t\ttypeof forbiddenFieldKindIdentifier,\n\t\tMultiplicity.Forbidden\n\t> {}\n\n/**\n * Default FieldKinds with their editor types erased.\n */\nexport const FieldKinds: {\n\t// TODO: inheritDoc for these somehow\n\treadonly required: Required;\n\treadonly optional: Optional;\n\treadonly sequence: Sequence;\n\treadonly identifier: Identifier;\n\treadonly forbidden: Forbidden;\n} = { required, optional, sequence, identifier, forbidden };\n\n/**\n * FullSchemaPolicy with the default field kinds.\n */\nexport const defaultSchemaPolicy: FullSchemaPolicy = {\n\tfieldKinds,\n};\n"]}
1
+ {"version":3,"file":"defaultFieldKinds.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/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AAmC,CAAC,CAAC;IACzF,MAAM,QAAQ,GAAgB,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CACnE,CAAC,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9B,IAAI,EAAE,aAAa,GAAG,EAAE;QACxB,OAAO,EAAE,aAAa;KACtB,CAAC,CACF,CAAC;IACF,OAAO;QACN,IAAI,EAAE,eAAe;QACrB,OAAO;QACP,QAAQ;KACR,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAoD,IAAI,GAAG,CACjF,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CACnF,CAAC;AAkCF;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAOnB,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AAE5D;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAqB;IACpD,UAAU;CACV,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype DeltaFieldChanges,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity,\n} from \"../../core/index.js\";\nimport {\n\ttype FieldChangeHandler,\n\ttype FieldEditor,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\ttype ToDelta,\n\treferenceFreeFieldChangeRebaser,\n} from \"../modular-schema/index.js\";\nimport {\n\ttype OptionalChangeset,\n\ttype OptionalFieldEditor,\n\toptionalChangeHandler,\n\toptionalFieldEditor,\n} from \"../optional-field/index.js\";\nimport {\n\tsequenceFieldChangeHandler,\n\ttype SequenceFieldEditor,\n} from \"../sequence-field/index.js\";\n\nimport { noChangeCodecFamily } from \"./noChangeCodecs.js\";\nimport type { CodecTree } from \"../../codec/index.js\";\nimport { brand, brandConst, type Brand } from \"../../util/index.js\";\n\n/**\n * ChangeHandler that only handles no-op / identity changes.\n */\nexport const noChangeHandler: FieldChangeHandler<0> = {\n\trebaser: referenceFreeFieldChangeRebaser({\n\t\tcompose: (change1: 0, change2: 0) => 0,\n\t\tinvert: (changes: 0) => 0,\n\t\trebase: (change: 0, over: 0) => 0,\n\t\tmute: (changes: 0) => 0,\n\t}),\n\tcodecsFactory: () => noChangeCodecFamily,\n\teditor: { buildChildChanges: () => fail(0xb0d /* Child changes not supported */) },\n\tintoDelta: (change, deltaFromChild: ToDelta): DeltaFieldChanges => [],\n\tisEmpty: (change: 0) => true,\n\tgetNestedChanges: (change: 0) => [],\n\tcreateEmpty: () => 0,\n\tgetCrossFieldKeys: () => [],\n};\n\n/**\n * {@link FieldEditor} for required fields (always contain exactly 1 child).\n * @remarks\n * This shares code with optional fields, since they are the same edit wise except setting to empty is not allowed,\n * and the content is always assumed to not be empty.\n * This means the actual edits implemented for optional fields are sufficient to support required fields\n * which is why this is defined and implemented in terms of optional fields.\n */\nexport interface RequiredFieldEditor extends FieldEditor<OptionalChangeset> {\n\t/**\n\t * Creates a change which replaces the current value of the field with `newValue`.\n\t * @param ids - The ids for the fill and detach fields.\n\t */\n\tset(ids: { fill: ChangeAtomId; detach: ChangeAtomId }): OptionalChangeset;\n}\n\nconst optionalIdentifier = brandConst(\"Optional\")<FieldKindIdentifier>();\nconst requiredIdentifier = brandConst(\"Value\")<FieldKindIdentifier>();\nconst sequenceIdentifier = brandConst(\"Sequence\")<FieldKindIdentifier>();\nconst identifierFieldIdentifier = brandConst(\"Identifier\")<FieldKindIdentifier>();\n\n/**\n * 0 or 1 items.\n */\nexport const optional = new FlexFieldKind(optionalIdentifier, Multiplicity.Optional, {\n\tchangeHandler: optionalChangeHandler,\n\tallowMonotonicUpgradeFrom: new Set([\n\t\tidentifierFieldIdentifier,\n\t\trequiredIdentifier,\n\t\tforbiddenFieldKindIdentifier,\n\t]),\n});\n\nexport const requiredFieldEditor: RequiredFieldEditor = {\n\t...optionalFieldEditor,\n\tset: (ids: {\n\t\tfill: ChangeAtomId;\n\t\tdetach: ChangeAtomId;\n\t}): OptionalChangeset => optionalFieldEditor.set(false, ids),\n};\n\nexport const requiredFieldChangeHandler: FieldChangeHandler<\n\tOptionalChangeset,\n\tRequiredFieldEditor\n> = {\n\t...optionalChangeHandler,\n\teditor: requiredFieldEditor,\n};\n\n/**\n * Exactly one item.\n */\nexport const required = new FlexFieldKind(requiredIdentifier, Multiplicity.Single, {\n\tchangeHandler: requiredFieldChangeHandler,\n\tallowMonotonicUpgradeFrom: new Set([identifierFieldIdentifier]),\n});\n\n/**\n * 0 or more items.\n */\nexport const sequence = new FlexFieldKind(sequenceIdentifier, Multiplicity.Sequence, {\n\tchangeHandler: sequenceFieldChangeHandler,\n\tallowMonotonicUpgradeFrom: new Set([\n\t\trequired.identifier,\n\t\toptional.identifier,\n\t\tidentifierFieldIdentifier,\n\t\tforbiddenFieldKindIdentifier,\n\t]),\n});\n\n/**\n * Exactly one identifier.\n */\nexport const identifier = new FlexFieldKind(identifierFieldIdentifier, Multiplicity.Single, {\n\tchangeHandler: noChangeHandler,\n\t// By omitting required here,\n\t// this is making a policy choice that a schema upgrade cannot be done from required to identifier.\n\t// Since an identifier can be upgraded into a required field,\n\t// preventing the inverse helps ensure that schema upgrades are monotonic.\n\t// Which direction is allowed is a subjective policy choice.\n\tallowMonotonicUpgradeFrom: new Set([]),\n});\n\n/**\n * Exactly 0 items.\n *\n * Using Forbidden makes what types are listed for allowed in a field irrelevant\n * since the field will never have values in it.\n *\n * Using Forbidden is equivalent to picking a kind that permits empty (like sequence or optional)\n * and having no allowed types (or only never types).\n * Because of this, its possible to express everything constraint wise without Forbidden,\n * but using Forbidden can be more semantically clear than optional with no allowed types.\n *\n * For view schema, this can be useful if you need to:\n * - run a specific out of schema handler when a field is present,\n * but otherwise are ignoring or tolerating (ex: via extra fields) unmentioned fields.\n * - prevent a specific field from being used as an extra field\n * (perhaps for some past of future compatibility reason)\n * - keep a field in a schema for metadata purposes\n * (ex: for improved error messaging, error handling or documentation)\n * that is not used in this specific version of the schema (ex: to document what it was or will be used for).\n *\n * For stored schema, this can be useful if you need to:\n * - have a field which can have its schema updated to Optional or Sequence of any type.\n * - to exclude a field from extra fields\n * - for the schema system to use as a default for fields which aren't declared\n * (ex: when updating a field that did not exist into one that does)\n *\n * See {@link emptyField} for a constant, reusable field using Forbidden.\n */\nexport const forbidden = new FlexFieldKind(\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity.Forbidden,\n\t{\n\t\tchangeHandler: noChangeHandler,\n\t\tallowMonotonicUpgradeFrom: new Set(),\n\t},\n);\n\nexport const fieldKindConfigurations: ReadonlyMap<\n\tModularChangeFormatVersion,\n\tFieldKindConfiguration\n> = new Map([\n\t[\n\t\tbrand(3),\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 2 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\tbrand(4),\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 3 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\tbrand(101), // Detached roots\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 2 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n]);\n\nexport type ModularChangeFormatVersion = Brand<3 | 4 | 101, \"ModularChangeFormatVersion\">;\nexport function getCodecTreeForModularChangeFormat(\n\tversion: ModularChangeFormatVersion,\n): CodecTree {\n\tconst dependencies =\n\t\tfieldKindConfigurations.get(version) ?? fail(0xc7c /* Unknown modular change format */);\n\tconst children: CodecTree[] = Array.from(dependencies.entries()).map(\n\t\t([key, { formatVersion }]) => ({\n\t\t\tname: `FieldKind:${key}`,\n\t\t\tversion: formatVersion,\n\t\t}),\n\t);\n\treturn {\n\t\tname: \"ModularChange\",\n\t\tversion,\n\t\tchildren,\n\t};\n}\n\n/**\n * All supported field kinds.\n *\n * @privateRemarks\n * Before making a SharedTree format change which impacts which set of field kinds are allowed,\n * code which uses this should be audited for compatibility considerations.\n */\nexport const fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind> = new Map(\n\t[required, optional, sequence, identifier, forbidden].map((s) => [s.identifier, s]),\n);\n\n// Create named Aliases for nicer intellisense.\n\n// TODO: Find a way to make docs like {@inheritDoc required} work in vscode.\n// TODO: ensure thy work in generated docs.\n// TODO: add these comments to the rest of the cases below.\nexport interface Required\n\textends FlexFieldKind<RequiredFieldEditor, typeof requiredIdentifier, Multiplicity.Single> {}\nexport interface Optional\n\textends FlexFieldKind<\n\t\tOptionalFieldEditor,\n\t\ttypeof optionalIdentifier,\n\t\tMultiplicity.Optional\n\t> {}\nexport interface Sequence\n\textends FlexFieldKind<\n\t\tSequenceFieldEditor,\n\t\ttypeof sequenceIdentifier,\n\t\tMultiplicity.Sequence\n\t> {}\nexport interface Identifier\n\textends FlexFieldKind<\n\t\tFieldEditor<0>,\n\t\ttypeof identifierFieldIdentifier,\n\t\tMultiplicity.Single\n\t> {}\nexport interface Forbidden\n\textends FlexFieldKind<\n\t\tFieldEditor<0>,\n\t\ttypeof forbiddenFieldKindIdentifier,\n\t\tMultiplicity.Forbidden\n\t> {}\n\n/**\n * Default FieldKinds with their editor types erased.\n */\nexport const FieldKinds: {\n\t// TODO: inheritDoc for these somehow\n\treadonly required: Required;\n\treadonly optional: Optional;\n\treadonly sequence: Sequence;\n\treadonly identifier: Identifier;\n\treadonly forbidden: Forbidden;\n} = { required, optional, sequence, identifier, forbidden };\n\n/**\n * FullSchemaPolicy with the default field kinds.\n */\nexport const defaultSchemaPolicy: FullSchemaPolicy = {\n\tfieldKinds,\n};\n"]}
@@ -3,6 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export { FieldKinds, type Required, type Optional, type Sequence, type Identifier, type Forbidden, fieldKinds, fieldKindConfigurations, getCodecTreeForModularChangeFormat, type ModularChangeFormatVersion, defaultSchemaPolicy, } from "./defaultFieldKinds.js";
6
- export { type DefaultChangeset, DefaultChangeFamily, DefaultEditBuilder, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, intoDelta, relevantRemovedRoots, } from "./defaultEditBuilder.js";
6
+ export { type DefaultChangeset, type DetachedRootIds, type DetachedRootIdRange, DefaultChangeFamily, type IdBasedChangeFamilyDataEditor, DefaultIdBasedDataEditor, type DataEditor, type RequiredFieldEditor, type OptionalFieldEditor, type SequenceFieldEditor, intoDelta, relevantRemovedRoots, } from "./defaultEditBuilder.js";
7
+ export { type DetachedRootLocation, type DetachedRootsLocation, type Locator, LocationBasedDataEditor, type ILocationBasedDataEditor, } from "./locationBasedEditBuilder.js";
7
8
  export { MappedEditBuilder } from "./mappedEditBuilder.js";
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,SAAS,EACd,UAAU,EACV,uBAAuB,EACvB,kCAAkC,EAClC,KAAK,0BAA0B,EAC/B,mBAAmB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,SAAS,EACT,oBAAoB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,SAAS,EACd,UAAU,EACV,uBAAuB,EACvB,kCAAkC,EAClC,KAAK,0BAA0B,EAC/B,mBAAmB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,mBAAmB,EACnB,KAAK,6BAA6B,EAClC,wBAAwB,EACxB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,SAAS,EACT,oBAAoB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,OAAO,EACZ,uBAAuB,EACvB,KAAK,wBAAwB,GAC7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -3,6 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export { FieldKinds, fieldKinds, fieldKindConfigurations, getCodecTreeForModularChangeFormat, defaultSchemaPolicy, } from "./defaultFieldKinds.js";
6
- export { DefaultChangeFamily, DefaultEditBuilder, intoDelta, relevantRemovedRoots, } from "./defaultEditBuilder.js";
6
+ export { DefaultChangeFamily, DefaultIdBasedDataEditor, intoDelta, relevantRemovedRoots, } from "./defaultEditBuilder.js";
7
+ export { LocationBasedDataEditor, } from "./locationBasedEditBuilder.js";
7
8
  export { MappedEditBuilder } from "./mappedEditBuilder.js";
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EAMV,UAAU,EACV,uBAAuB,EACvB,kCAAkC,EAElC,mBAAmB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAEN,mBAAmB,EACnB,kBAAkB,EAKlB,SAAS,EACT,oBAAoB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tgetCodecTreeForModularChangeFormat,\n\ttype ModularChangeFormatVersion,\n\tdefaultSchemaPolicy,\n} from \"./defaultFieldKinds.js\";\n\nexport {\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tintoDelta,\n\trelevantRemovedRoots,\n} from \"./defaultEditBuilder.js\";\n\nexport { MappedEditBuilder } from \"./mappedEditBuilder.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EAMV,UAAU,EACV,uBAAuB,EACvB,kCAAkC,EAElC,mBAAmB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAIN,mBAAmB,EAEnB,wBAAwB,EAKxB,SAAS,EACT,oBAAoB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAIN,uBAAuB,GAEvB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tgetCodecTreeForModularChangeFormat,\n\ttype ModularChangeFormatVersion,\n\tdefaultSchemaPolicy,\n} from \"./defaultFieldKinds.js\";\n\nexport {\n\ttype DefaultChangeset,\n\ttype DetachedRootIds,\n\ttype DetachedRootIdRange,\n\tDefaultChangeFamily,\n\ttype IdBasedChangeFamilyDataEditor,\n\tDefaultIdBasedDataEditor,\n\ttype DataEditor,\n\ttype RequiredFieldEditor,\n\ttype OptionalFieldEditor,\n\ttype SequenceFieldEditor,\n\tintoDelta,\n\trelevantRemovedRoots,\n} from \"./defaultEditBuilder.js\";\n\nexport {\n\ttype DetachedRootLocation,\n\ttype DetachedRootsLocation,\n\ttype Locator,\n\tLocationBasedDataEditor,\n\ttype ILocationBasedDataEditor,\n} from \"./locationBasedEditBuilder.js\";\n\nexport { MappedEditBuilder } from \"./mappedEditBuilder.js\";\n"]}
@@ -0,0 +1,36 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { type ChangeAtomId, type FieldKey, type FieldUpPath, type UpPath, type TreeChunk } from "../../core/index.js";
6
+ import type { DetachedRootIds, DataEditor, OptionalFieldEditor, RequiredFieldEditor, SequenceFieldEditor } from "./defaultEditBuilder.js";
7
+ export type DetachedRootLocation = FieldKey;
8
+ export type DetachedRootsLocation = readonly DetachedRootRangeLocation[];
9
+ export interface DetachedRootRangeLocation {
10
+ readonly field: FieldKey;
11
+ readonly count: number;
12
+ }
13
+ export interface Locator {
14
+ locationFromId(id: ChangeAtomId): DetachedRootLocation;
15
+ idFromLocation(id: DetachedRootLocation): ChangeAtomId;
16
+ locationsFromIdRanges(id: DetachedRootIds): DetachedRootsLocation;
17
+ idRangesFromLocations(id: DetachedRootsLocation): DetachedRootIds;
18
+ }
19
+ export type ILocationBasedDataEditor = DataEditor<TreeChunk, DetachedRootLocation, DetachedRootsLocation>;
20
+ /**
21
+ * Implementation of {@link DataEditor} based on the default set of supported field kinds.
22
+ * @sealed
23
+ */
24
+ export declare class LocationBasedDataEditor implements DataEditor<TreeChunk, DetachedRootLocation, DetachedRootsLocation> {
25
+ private readonly idBasedEditor;
26
+ private readonly locator;
27
+ constructor(idBasedEditor: DataEditor<TreeChunk, ChangeAtomId, DetachedRootIds>, locator: Locator);
28
+ addNodeExistsConstraint(path: UpPath): void;
29
+ addNodeExistsConstraintOnRevert(path: UpPath): void;
30
+ buildRoots(content: TreeChunk): DetachedRootsLocation;
31
+ valueField(field: FieldUpPath): RequiredFieldEditor<TreeChunk, DetachedRootLocation>;
32
+ optionalField(field: FieldUpPath): OptionalFieldEditor<TreeChunk, DetachedRootLocation>;
33
+ move(sourceField: FieldUpPath, sourceIndex: number, count: number, destinationField: FieldUpPath, destIndex: number): void;
34
+ sequenceField(field: FieldUpPath): SequenceFieldEditor<TreeChunk, DetachedRootsLocation>;
35
+ }
36
+ //# sourceMappingURL=locationBasedEditBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locationBasedEditBuilder.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/locationBasedEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EAKd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EACX,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AAC5C,MAAM,MAAM,qBAAqB,GAAG,SAAS,yBAAyB,EAAE,CAAC;AACzE,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,OAAO;IACvB,cAAc,CAAC,EAAE,EAAE,YAAY,GAAG,oBAAoB,CAAC;IACvD,cAAc,CAAC,EAAE,EAAE,oBAAoB,GAAG,YAAY,CAAC;IACvD,qBAAqB,CAAC,EAAE,EAAE,eAAe,GAAG,qBAAqB,CAAC;IAClE,qBAAqB,CAAC,EAAE,EAAE,qBAAqB,GAAG,eAAe,CAAC;CAClE;AAED,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAChD,SAAS,EACT,oBAAoB,EACpB,qBAAqB,CACrB,CAAC;AAEF;;;GAGG;AACH,qBAAa,uBACZ,YAAW,UAAU,CAAC,SAAS,EAAE,oBAAoB,EAAE,qBAAqB,CAAC;IAG5E,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,aAAa,EAAE,UAAU,CAAC,SAAS,EAAE,YAAY,EAAE,eAAe,CAAC,EACnE,OAAO,EAAE,OAAO;IAG3B,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK3C,+BAA+B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKnD,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,qBAAqB;IAMrD,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,mBAAmB,CAAC,SAAS,EAAE,oBAAoB,CAAC;IAgBpF,aAAa,CACnB,KAAK,EAAE,WAAW,GAChB,mBAAmB,CAAC,SAAS,EAAE,oBAAoB,CAAC;IAuBhD,IAAI,CACV,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,WAAW,EAC7B,SAAS,EAAE,MAAM,GACf,IAAI;IAMA,aAAa,CACnB,KAAK,EAAE,WAAW,GAChB,mBAAmB,CAAC,SAAS,EAAE,qBAAqB,CAAC;CAkBxD"}
@@ -0,0 +1,122 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { UsageError } from "@fluidframework/telemetry-utils/internal";
6
+ import { rootFieldKey, makeDetachedNodeId, } from "../../core/index.js";
7
+ /**
8
+ * Implementation of {@link DataEditor} based on the default set of supported field kinds.
9
+ * @sealed
10
+ */
11
+ export class LocationBasedDataEditor {
12
+ constructor(idBasedEditor, locator) {
13
+ this.idBasedEditor = idBasedEditor;
14
+ this.locator = locator;
15
+ }
16
+ addNodeExistsConstraint(path) {
17
+ const normal = normalizeUpPath(path, this.locator);
18
+ this.idBasedEditor.addNodeExistsConstraint(normal);
19
+ }
20
+ addNodeExistsConstraintOnRevert(path) {
21
+ const normal = normalizeUpPath(path, this.locator);
22
+ this.idBasedEditor.addNodeExistsConstraintOnRevert(normal);
23
+ }
24
+ buildRoots(content) {
25
+ const roots = this.idBasedEditor.buildRoots(content);
26
+ const locations = this.locator.locationsFromIdRanges(roots);
27
+ return locations;
28
+ }
29
+ valueField(field) {
30
+ const normal = normalizeFieldUpPath(field, this.locator);
31
+ const lowLevelEditor = this.idBasedEditor.valueField(normal);
32
+ const locator = this.locator;
33
+ const editBuilder = {
34
+ set: (newContent) => {
35
+ lowLevelEditor.set(newContent);
36
+ },
37
+ attach: (newContent) => {
38
+ const changeAtom = locator.idFromLocation(newContent);
39
+ lowLevelEditor.attach(changeAtom);
40
+ },
41
+ };
42
+ return editBuilder;
43
+ }
44
+ optionalField(field) {
45
+ const normal = normalizeFieldUpPath(field, this.locator);
46
+ const lowLevelEditor = this.idBasedEditor.optionalField(normal);
47
+ const locator = this.locator;
48
+ const editBuilder = {
49
+ set: (newContent, wasEmpty) => {
50
+ lowLevelEditor.set(newContent, wasEmpty);
51
+ },
52
+ attach: (newContent, wasEmpty) => {
53
+ if (newContent === undefined) {
54
+ editBuilder.clear(wasEmpty);
55
+ return;
56
+ }
57
+ const changeAtom = locator.idFromLocation(newContent);
58
+ lowLevelEditor.attach(changeAtom, wasEmpty);
59
+ },
60
+ clear: (wasEmpty) => {
61
+ lowLevelEditor.clear(wasEmpty);
62
+ },
63
+ };
64
+ return editBuilder;
65
+ }
66
+ move(sourceField, sourceIndex, count, destinationField, destIndex) {
67
+ const normalSource = normalizeFieldUpPath(sourceField, this.locator);
68
+ const normalDestination = normalizeFieldUpPath(destinationField, this.locator);
69
+ this.idBasedEditor.move(normalSource, sourceIndex, count, normalDestination, destIndex);
70
+ }
71
+ sequenceField(field) {
72
+ const normal = normalizeFieldUpPath(field, this.locator);
73
+ const lowLevelEditor = this.idBasedEditor.sequenceField(normal);
74
+ const locator = this.locator;
75
+ const editBuilder = {
76
+ insert: (index, content) => {
77
+ lowLevelEditor.insert(index, content);
78
+ },
79
+ attach: (index, newContent) => {
80
+ const range = locator.idRangesFromLocations(newContent);
81
+ lowLevelEditor.attach(index, range);
82
+ },
83
+ remove: (index, count) => {
84
+ lowLevelEditor.remove(index, count);
85
+ },
86
+ };
87
+ return editBuilder;
88
+ }
89
+ }
90
+ function normalizeUpPath(path, locator) {
91
+ if (path.parent === undefined) {
92
+ if (path.parentField === rootFieldKey) {
93
+ return { ...path, parent: undefined, detachedNodeId: undefined };
94
+ }
95
+ else {
96
+ const nodeId = locator.idFromLocation(path.parentField);
97
+ const detachedNodeId = makeDetachedNodeId(nodeId.revision, nodeId.localId);
98
+ return { ...path, parent: undefined, detachedNodeId };
99
+ }
100
+ }
101
+ else {
102
+ return {
103
+ parent: normalizeUpPath(path.parent, locator),
104
+ parentField: path.parentField,
105
+ parentIndex: path.parentIndex,
106
+ };
107
+ }
108
+ }
109
+ function normalizeFieldUpPath(path, locator) {
110
+ if (path.parent === undefined) {
111
+ if (path.field === rootFieldKey) {
112
+ return { parent: undefined, field: rootFieldKey };
113
+ }
114
+ else {
115
+ throw new UsageError("Editing only allowed on the root field or on fields under nodes with TreeStatus.InDocument or TreeStatus.Removed status");
116
+ }
117
+ }
118
+ else {
119
+ return { parent: normalizeUpPath(path.parent, locator), field: path.field };
120
+ }
121
+ }
122
+ //# sourceMappingURL=locationBasedEditBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locationBasedEditBuilder.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/locationBasedEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAQN,YAAY,EACZ,kBAAkB,GAClB,MAAM,qBAAqB,CAAC;AA8B7B;;;GAGG;AACH,MAAM,OAAO,uBAAuB;IAGnC,YACkB,aAAmE,EACnE,OAAgB;QADhB,kBAAa,GAAb,aAAa,CAAsD;QACnE,YAAO,GAAP,OAAO,CAAS;IAC/B,CAAC;IAEG,u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M,CAAC;QACP,OAAO;YACN,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;YAC7C,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;SAC7B,CAAC;IACH,CAAC;AACF,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAiB,EAAE,OAAgB;IAChE,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,KAAK,KAAK,YAAY,EAAE,CAAC;YACjC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;QACnD,CAAC;aAAM,CAAC;YACP,MAAM,IAAI,UAAU,CACnB,yHAAyH,CACzH,CAAC;QACH,CAAC;IACF,CAAC;SAAM,CAAC;QACP,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IAC7E,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport {\n\ttype ChangeAtomId,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype UpPath,\n\ttype TreeChunk,\n\ttype NormalizedUpPath,\n\ttype NormalizedFieldUpPath,\n\trootFieldKey,\n\tmakeDetachedNodeId,\n} from \"../../core/index.js\";\n\nimport type {\n\tDetachedRootIds,\n\tDataEditor,\n\tOptionalFieldEditor,\n\tRequiredFieldEditor,\n\tSequenceFieldEditor,\n} from \"./defaultEditBuilder.js\";\n\nexport type DetachedRootLocation = FieldKey;\nexport type DetachedRootsLocation = readonly DetachedRootRangeLocation[];\nexport interface DetachedRootRangeLocation {\n\treadonly field: FieldKey;\n\treadonly count: number;\n}\n\nexport interface Locator {\n\tlocationFromId(id: ChangeAtomId): DetachedRootLocation;\n\tidFromLocation(id: DetachedRootLocation): ChangeAtomId;\n\tlocationsFromIdRanges(id: DetachedRootIds): DetachedRootsLocation;\n\tidRangesFromLocations(id: DetachedRootsLocation): DetachedRootIds;\n}\n\nexport type ILocationBasedDataEditor = DataEditor<\n\tTreeChunk,\n\tDetachedRootLocation,\n\tDetachedRootsLocation\n>;\n\n/**\n * Implementation of {@link DataEditor} based on the default set of supported field kinds.\n * @sealed\n */\nexport class LocationBasedDataEditor\n\timplements DataEditor<TreeChunk, DetachedRootLocation, DetachedRootsLocation>\n{\n\tpublic constructor(\n\t\tprivate readonly idBasedEditor: DataEditor<TreeChunk, ChangeAtomId, DetachedRootIds>,\n\t\tprivate readonly locator: Locator,\n\t) {}\n\n\tpublic addNodeExistsConstraint(path: UpPath): void {\n\t\tconst normal = normalizeUpPath(path, this.locator);\n\t\tthis.idBasedEditor.addNodeExistsConstraint(normal);\n\t}\n\n\tpublic addNodeExistsConstraintOnRevert(path: UpPath): void {\n\t\tconst normal = normalizeUpPath(path, this.locator);\n\t\tthis.idBasedEditor.addNodeExistsConstraintOnRevert(normal);\n\t}\n\n\tpublic buildRoots(content: TreeChunk): DetachedRootsLocation {\n\t\tconst roots = this.idBasedEditor.buildRoots(content);\n\t\tconst locations = this.locator.locationsFromIdRanges(roots);\n\t\treturn locations;\n\t}\n\n\tpublic valueField(field: FieldUpPath): RequiredFieldEditor<TreeChunk, DetachedRootLocation> {\n\t\tconst normal = normalizeFieldUpPath(field, this.locator);\n\t\tconst lowLevelEditor = this.idBasedEditor.valueField(normal);\n\t\tconst locator = this.locator;\n\t\tconst editBuilder = {\n\t\t\tset: (newContent: TreeChunk): void => {\n\t\t\t\tlowLevelEditor.set(newContent);\n\t\t\t},\n\t\t\tattach: (newContent: DetachedRootLocation): void => {\n\t\t\t\tconst changeAtom = locator.idFromLocation(newContent);\n\t\t\t\tlowLevelEditor.attach(changeAtom);\n\t\t\t},\n\t\t};\n\t\treturn editBuilder;\n\t}\n\n\tpublic optionalField(\n\t\tfield: FieldUpPath,\n\t): OptionalFieldEditor<TreeChunk, DetachedRootLocation> {\n\t\tconst normal = normalizeFieldUpPath(field, this.locator);\n\t\tconst lowLevelEditor = this.idBasedEditor.optionalField(normal);\n\t\tconst locator = this.locator;\n\t\tconst editBuilder = {\n\t\t\tset: (newContent: TreeChunk | undefined, wasEmpty: boolean): void => {\n\t\t\t\tlowLevelEditor.set(newContent, wasEmpty);\n\t\t\t},\n\t\t\tattach: (newContent: DetachedRootLocation | undefined, wasEmpty: boolean): void => {\n\t\t\t\tif (newContent === undefined) {\n\t\t\t\t\teditBuilder.clear(wasEmpty);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst changeAtom = locator.idFromLocation(newContent);\n\t\t\t\tlowLevelEditor.attach(changeAtom, wasEmpty);\n\t\t\t},\n\t\t\tclear: (wasEmpty: boolean): void => {\n\t\t\t\tlowLevelEditor.clear(wasEmpty);\n\t\t\t},\n\t\t};\n\t\treturn editBuilder;\n\t}\n\n\tpublic move(\n\t\tsourceField: FieldUpPath,\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestinationField: FieldUpPath,\n\t\tdestIndex: number,\n\t): void {\n\t\tconst normalSource = normalizeFieldUpPath(sourceField, this.locator);\n\t\tconst normalDestination = normalizeFieldUpPath(destinationField, this.locator);\n\t\tthis.idBasedEditor.move(normalSource, sourceIndex, count, normalDestination, destIndex);\n\t}\n\n\tpublic sequenceField(\n\t\tfield: FieldUpPath,\n\t): SequenceFieldEditor<TreeChunk, DetachedRootsLocation> {\n\t\tconst normal = normalizeFieldUpPath(field, this.locator);\n\t\tconst lowLevelEditor = this.idBasedEditor.sequenceField(normal);\n\t\tconst locator = this.locator;\n\t\tconst editBuilder = {\n\t\t\tinsert: (index: number, content: TreeChunk): void => {\n\t\t\t\tlowLevelEditor.insert(index, content);\n\t\t\t},\n\t\t\tattach: (index: number, newContent: DetachedRootsLocation): void => {\n\t\t\t\tconst range = locator.idRangesFromLocations(newContent);\n\t\t\t\tlowLevelEditor.attach(index, range);\n\t\t\t},\n\t\t\tremove: (index: number, count: number): void => {\n\t\t\t\tlowLevelEditor.remove(index, count);\n\t\t\t},\n\t\t};\n\t\treturn editBuilder;\n\t}\n}\n\nfunction normalizeUpPath(path: UpPath, locator: Locator): NormalizedUpPath {\n\tif (path.parent === undefined) {\n\t\tif (path.parentField === rootFieldKey) {\n\t\t\treturn { ...path, parent: undefined, detachedNodeId: undefined };\n\t\t} else {\n\t\t\tconst nodeId = locator.idFromLocation(path.parentField);\n\t\t\tconst detachedNodeId = makeDetachedNodeId(nodeId.revision, nodeId.localId);\n\t\t\treturn { ...path, parent: undefined, detachedNodeId };\n\t\t}\n\t} else {\n\t\treturn {\n\t\t\tparent: normalizeUpPath(path.parent, locator),\n\t\t\tparentField: path.parentField,\n\t\t\tparentIndex: path.parentIndex,\n\t\t};\n\t}\n}\n\nfunction normalizeFieldUpPath(path: FieldUpPath, locator: Locator): NormalizedFieldUpPath {\n\tif (path.parent === undefined) {\n\t\tif (path.field === rootFieldKey) {\n\t\t\treturn { parent: undefined, field: rootFieldKey };\n\t\t} else {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Editing only allowed on the root field or on fields under nodes with TreeStatus.InDocument or TreeStatus.Removed status\",\n\t\t\t);\n\t\t}\n\t} else {\n\t\treturn { parent: normalizeUpPath(path.parent, locator), field: path.field };\n\t}\n}\n"]}
@@ -3,17 +3,18 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { NormalizedFieldUpPath, NormalizedUpPath } from "../../core/index.js";
6
- import type { IDefaultEditBuilder, OptionalFieldEditBuilder, SequenceFieldEditBuilder, ValueFieldEditBuilder } from "./defaultEditBuilder.js";
6
+ import type { DataEditor, OptionalFieldEditor, SequenceFieldEditor, RequiredFieldEditor } from "./defaultEditBuilder.js";
7
7
  /**
8
8
  * An IDefaultEditBuilder implementation based on another IDefaultEditBuilder that uses a different content type for insertions.
9
9
  */
10
- export declare class MappedEditBuilder<TBase, TAdapted> implements IDefaultEditBuilder<TAdapted> {
10
+ export declare class MappedEditBuilder<TBase, TAdapted, TDetachedRoot, TDetachedRoots> implements DataEditor<TAdapted, TDetachedRoot, TDetachedRoots> {
11
11
  private readonly baseBuilder;
12
12
  private readonly mapDelegate;
13
- constructor(baseBuilder: IDefaultEditBuilder<TBase>, mapDelegate: (input: TAdapted) => TBase);
14
- valueField(field: NormalizedFieldUpPath): ValueFieldEditBuilder<TAdapted>;
15
- optionalField(field: NormalizedFieldUpPath): OptionalFieldEditBuilder<TAdapted>;
16
- sequenceField(field: NormalizedFieldUpPath): SequenceFieldEditBuilder<TAdapted>;
13
+ constructor(baseBuilder: DataEditor<TBase, TDetachedRoot, TDetachedRoots>, mapDelegate: (input: TAdapted) => TBase);
14
+ buildRoots(content: TAdapted): TDetachedRoots;
15
+ valueField(field: NormalizedFieldUpPath): RequiredFieldEditor<TAdapted, TDetachedRoot>;
16
+ optionalField(field: NormalizedFieldUpPath): OptionalFieldEditor<TAdapted, TDetachedRoot>;
17
+ sequenceField(field: NormalizedFieldUpPath): SequenceFieldEditor<TAdapted, TDetachedRoots>;
17
18
  move(sourceField: NormalizedFieldUpPath, sourceIndex: number, count: number, destinationField: NormalizedFieldUpPath, destinationIndex: number): void;
18
19
  addNodeExistsConstraint(path: NormalizedUpPath): void;
19
20
  addNodeExistsConstraintOnRevert(path: NormalizedUpPath): void;
@@ -1 +1 @@
1
- {"version":3,"file":"mappedEditBuilder.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/mappedEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,KAAK,EACX,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,qBAAa,iBAAiB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AC,WAAW;gBADX,WAAW,EAAE,UAAU,CAAC,KAAK,EAAE,aAAa,EAAE,cAAc,CAAC,EAC7D,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,KAAK;IAGlD,UAAU,CAAC,OAAO,EAAE,QAAQ,GAAG,cAAc;IAI7C,UAAU,CAChB,KAAK,EAAE,qBAAqB,GAC1B,mBAAmB,CAAC,QAAQ,EAAE,aAAa,CAAC;IAaxC,aAAa,CACnB,KAAK,EAAE,qBAAqB,GAC1B,mBAAmB,CAAC,QAAQ,EAAE,aAAa,CAAC;IAgBxC,aAAa,CACnB,KAAK,EAAE,qBAAqB,GAC1B,mBAAmB,CAAC,QAAQ,EAAE,cAAc,CAAC;IAezC,IAAI,CACV,WAAW,EAAE,qBAAqB,EAClC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,qBAAqB,EACvC,gBAAgB,EAAE,MAAM,GACtB,IAAI;IAGA,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAGrD,+BAA+B,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;CAGpE"}
@@ -10,6 +10,9 @@ export class MappedEditBuilder {
10
10
  this.baseBuilder = baseBuilder;
11
11
  this.mapDelegate = mapDelegate;
12
12
  }
13
+ buildRoots(content) {
14
+ return this.baseBuilder.buildRoots(this.mapDelegate(content));
15
+ }
13
16
  valueField(field) {
14
17
  const baseField = this.baseBuilder.valueField(field);
15
18
  return {
@@ -17,6 +20,9 @@ export class MappedEditBuilder {
17
20
  const mappedContent = this.mapDelegate(newContent);
18
21
  baseField.set(mappedContent);
19
22
  },
23
+ attach: (content) => {
24
+ baseField.attach(content);
25
+ },
20
26
  };
21
27
  }
22
28
  optionalField(field) {
@@ -26,6 +32,12 @@ export class MappedEditBuilder {
26
32
  const mappedContent = newContent === undefined ? undefined : this.mapDelegate(newContent);
27
33
  baseField.set(mappedContent, wasEmpty);
28
34
  },
35
+ attach: (content, wasEmpty) => {
36
+ baseField.attach(content, wasEmpty);
37
+ },
38
+ clear(wasEmpty) {
39
+ baseField.clear(wasEmpty);
40
+ },
29
41
  };
30
42
  }
31
43
  sequenceField(field) {
@@ -38,6 +50,9 @@ export class MappedEditBuilder {
38
50
  remove: (index, count) => {
39
51
  baseField.remove(index, count);
40
52
  },
53
+ attach: (index, detachedContent) => {
54
+ baseField.attach(index, detachedContent);
55
+ },
41
56
  };
42
57
  }
43
58
  move(sourceField, sourceIndex, count, destinationField, destinationIndex) {
@@ -1 +1 @@
1
- {"version":3,"file":"mappedEditBuilder.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/mappedEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAC7B,YACkB,WAAuC,EACvC,WAAuC;QADvC,gBAAW,GAAX,WAAW,CAA4B;QACvC,gBAAW,GAAX,WAAW,CAA4B;IACtD,CAAC;IACG,UAAU,CAAC,KAA4B;QAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACrD,OAAO;YACN,GAAG,EAAE,CAAC,UAAoB,EAAQ,EAAE;gBACnC,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;gBACnD,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YAC9B,CAAC;SACD,CAAC;IACH,CAAC;IACM,aAAa,CAAC,KAA4B;QAChD,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACxD,OAAO;YACN,GAAG,EAAE,CAAC,UAAgC,EAAE,QAAiB,EAAQ,EAAE;gBAClE,MAAM,aAAa,GAClB,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;gBACrE,SAAS,CAAC,GAAG,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;YACxC,CAAC;SACD,CAAC;IACH,CAAC;IACM,aAAa,CAAC,KAA4B;QAChD,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACxD,OAAO;YACN,MAAM,EAAE,CAAC,KAAa,EAAE,OAAiB,EAAQ,EAAE;gBAClD,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAChD,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;YACxC,CAAC;YACD,MAAM,EAAE,CAAC,KAAa,EAAE,KAAa,EAAQ,EAAE;gBAC9C,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAChC,CAAC;SACD,CAAC;IACH,CAAC;IACM,IAAI,CACV,WAAkC,EAClC,WAAmB,EACnB,KAAa,EACb,gBAAuC,EACvC,gBAAwB;QAExB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;IAC5F,CAAC;IACM,uBAAuB,CAAC,IAAsB;QACpD,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IACM,+BAA+B,CAAC,IAAsB;QAC5D,IAAI,CAAC,WAAW,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { NormalizedFieldUpPath, NormalizedUpPath } from \"../../core/index.js\";\n\nimport type {\n\tIDefaultEditBuilder,\n\tOptionalFieldEditBuilder,\n\tSequenceFieldEditBuilder,\n\tValueFieldEditBuilder,\n} from \"./defaultEditBuilder.js\";\n\n/**\n * An IDefaultEditBuilder implementation based on another IDefaultEditBuilder that uses a different content type for insertions.\n */\nexport class MappedEditBuilder<TBase, TAdapted> implements IDefaultEditBuilder<TAdapted> {\n\tpublic constructor(\n\t\tprivate readonly baseBuilder: IDefaultEditBuilder<TBase>,\n\t\tprivate readonly mapDelegate: (input: TAdapted) => TBase,\n\t) {}\n\tpublic valueField(field: NormalizedFieldUpPath): ValueFieldEditBuilder<TAdapted> {\n\t\tconst baseField = this.baseBuilder.valueField(field);\n\t\treturn {\n\t\t\tset: (newContent: TAdapted): void => {\n\t\t\t\tconst mappedContent = this.mapDelegate(newContent);\n\t\t\t\tbaseField.set(mappedContent);\n\t\t\t},\n\t\t};\n\t}\n\tpublic optionalField(field: NormalizedFieldUpPath): OptionalFieldEditBuilder<TAdapted> {\n\t\tconst baseField = this.baseBuilder.optionalField(field);\n\t\treturn {\n\t\t\tset: (newContent: TAdapted | undefined, wasEmpty: boolean): void => {\n\t\t\t\tconst mappedContent =\n\t\t\t\t\tnewContent === undefined ? undefined : this.mapDelegate(newContent);\n\t\t\t\tbaseField.set(mappedContent, wasEmpty);\n\t\t\t},\n\t\t};\n\t}\n\tpublic sequenceField(field: NormalizedFieldUpPath): SequenceFieldEditBuilder<TAdapted> {\n\t\tconst baseField = this.baseBuilder.sequenceField(field);\n\t\treturn {\n\t\t\tinsert: (index: number, content: TAdapted): void => {\n\t\t\t\tconst mappedContent = this.mapDelegate(content);\n\t\t\t\tbaseField.insert(index, mappedContent);\n\t\t\t},\n\t\t\tremove: (index: number, count: number): void => {\n\t\t\t\tbaseField.remove(index, count);\n\t\t\t},\n\t\t};\n\t}\n\tpublic move(\n\t\tsourceField: NormalizedFieldUpPath,\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestinationField: NormalizedFieldUpPath,\n\t\tdestinationIndex: number,\n\t): void {\n\t\tthis.baseBuilder.move(sourceField, sourceIndex, count, destinationField, destinationIndex);\n\t}\n\tpublic addNodeExistsConstraint(path: NormalizedUpPath): void {\n\t\tthis.baseBuilder.addNodeExistsConstraint(path);\n\t}\n\tpublic addNodeExistsConstraintOnRevert(path: NormalizedUpPath): void {\n\t\tthis.baseBuilder.addNodeExistsConstraintOnRevert(path);\n\t}\n}\n"]}
1
+ {"version":3,"file":"mappedEditBuilder.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/mappedEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAG7B,YACkB,WAA6D,EAC7D,WAAuC;QADvC,gBAAW,GAAX,WAAW,CAAkD;QAC7D,gBAAW,GAAX,WAAW,CAA4B;IACtD,CAAC;IAEG,UAAU,CAAC,OAAiB;QAClC,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/D,CAAC;IAEM,UAAU,CAChB,KAA4B;QAE5B,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACrD,OAAO;YACN,GAAG,EAAE,CAAC,UAAoB,EAAQ,EAAE;gBACnC,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;gBACnD,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YAC9B,CAAC;YACD,MAAM,EAAE,CAAC,OAAsB,EAAQ,EAAE;gBACxC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;SACD,CAAC;IACH,CAAC;IAEM,aAAa,CACnB,KAA4B;QAE5B,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACxD,OAAO;YACN,GAAG,EAAE,CAAC,UAAgC,EAAE,QAAiB,EAAQ,EAAE;gBAClE,MAAM,aAAa,GAClB,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;gBACrE,SAA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,IAAI,CAAC,WAAW,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { NormalizedFieldUpPath, NormalizedUpPath } from \"../../core/index.js\";\n\nimport type {\n\tDataEditor,\n\tOptionalFieldEditor,\n\tSequenceFieldEditor,\n\tRequiredFieldEditor,\n} from \"./defaultEditBuilder.js\";\n\n/**\n * An IDefaultEditBuilder implementation based on another IDefaultEditBuilder that uses a different content type for insertions.\n */\nexport class MappedEditBuilder<TBase, TAdapted, TDetachedRoot, TDetachedRoots>\n\timplements DataEditor<TAdapted, TDetachedRoot, TDetachedRoots>\n{\n\tpublic constructor(\n\t\tprivate readonly baseBuilder: DataEditor<TBase, TDetachedRoot, TDetachedRoots>,\n\t\tprivate readonly mapDelegate: (input: TAdapted) => TBase,\n\t) {}\n\n\tpublic buildRoots(content: TAdapted): TDetachedRoots {\n\t\treturn this.baseBuilder.buildRoots(this.mapDelegate(content));\n\t}\n\n\tpublic valueField(\n\t\tfield: NormalizedFieldUpPath,\n\t): RequiredFieldEditor<TAdapted, TDetachedRoot> {\n\t\tconst baseField = this.baseBuilder.valueField(field);\n\t\treturn {\n\t\t\tset: (newContent: TAdapted): void => {\n\t\t\t\tconst mappedContent = this.mapDelegate(newContent);\n\t\t\t\tbaseField.set(mappedContent);\n\t\t\t},\n\t\t\tattach: (content: TDetachedRoot): void => {\n\t\t\t\tbaseField.attach(content);\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic optionalField(\n\t\tfield: NormalizedFieldUpPath,\n\t): OptionalFieldEditor<TAdapted, TDetachedRoot> {\n\t\tconst baseField = this.baseBuilder.optionalField(field);\n\t\treturn {\n\t\t\tset: (newContent: TAdapted | undefined, wasEmpty: boolean): void => {\n\t\t\t\tconst mappedContent =\n\t\t\t\t\tnewContent === undefined ? undefined : this.mapDelegate(newContent);\n\t\t\t\tbaseField.set(mappedContent, wasEmpty);\n\t\t\t},\n\t\t\tattach: (content, wasEmpty: boolean): void => {\n\t\t\t\tbaseField.attach(content, wasEmpty);\n\t\t\t},\n\t\t\tclear(wasEmpty: boolean): void {\n\t\t\t\tbaseField.clear(wasEmpty);\n\t\t\t},\n\t\t};\n\t}\n\tpublic sequenceField(\n\t\tfield: NormalizedFieldUpPath,\n\t): SequenceFieldEditor<TAdapted, TDetachedRoots> {\n\t\tconst baseField = this.baseBuilder.sequenceField(field);\n\t\treturn {\n\t\t\tinsert: (index: number, content: TAdapted): void => {\n\t\t\t\tconst mappedContent = this.mapDelegate(content);\n\t\t\t\tbaseField.insert(index, mappedContent);\n\t\t\t},\n\t\t\tremove: (index: number, count: number): void => {\n\t\t\t\tbaseField.remove(index, count);\n\t\t\t},\n\t\t\tattach: (index: number, detachedContent: TDetachedRoots): void => {\n\t\t\t\tbaseField.attach(index, detachedContent);\n\t\t\t},\n\t\t};\n\t}\n\tpublic move(\n\t\tsourceField: NormalizedFieldUpPath,\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestinationField: NormalizedFieldUpPath,\n\t\tdestinationIndex: number,\n\t): void {\n\t\tthis.baseBuilder.move(sourceField, sourceIndex, count, destinationField, destinationIndex);\n\t}\n\tpublic addNodeExistsConstraint(path: NormalizedUpPath): void {\n\t\tthis.baseBuilder.addNodeExistsConstraint(path);\n\t}\n\tpublic addNodeExistsConstraintOnRevert(path: NormalizedUpPath): void {\n\t\tthis.baseBuilder.addNodeExistsConstraintOnRevert(path);\n\t}\n}\n"]}
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import { type ChangeAtomId, type DeltaDetachedNodeId, type DeltaRoot } from "../core/index.js";
6
6
  export declare function nodeIdFromChangeAtom(changeAtom: ChangeAtomId): DeltaDetachedNodeId;
7
+ export declare function changeAtomFromDetachedNodeId(changeAtom: DeltaDetachedNodeId): ChangeAtomId;
7
8
  /**
8
9
  * Converts a `Delta.Root` whose tree content is represented with by `TIn` instances
9
10
  * into a `Delta.Root`whose tree content is represented with by `TOut` instances.
@@ -1 +1 @@
1
- {"version":3,"file":"deltaUtils.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/deltaUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EAEd,MAAM,kBAAkB,CAAC;AAG1B,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,YAAY,GAAG,mBAAmB,CAElF;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,IAAI,EACvC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,EACpB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GACvB,SAAS,CAAC,IAAI,CAAC,CAyBjB"}
1
+ {"version":3,"file":"deltaUtils.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/deltaUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EAGd,MAAM,kBAAkB,CAAC;AAG1B,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,YAAY,GAAG,mBAAmB,CAElF;AAED,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,mBAAmB,GAAG,YAAY,CAE1F;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,IAAI,EACvC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,EACpB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GACvB,SAAS,CAAC,IAAI,CAAC,CAyBjB"}
@@ -2,10 +2,14 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { makeDetachedNodeId, } from "../core/index.js";
5
+ import { makeChangeAtomId, makeDetachedNodeId, } from "../core/index.js";
6
+ import { brand } from "../util/index.js";
6
7
  export function nodeIdFromChangeAtom(changeAtom) {
7
8
  return makeDetachedNodeId(changeAtom.revision, changeAtom.localId);
8
9
  }
10
+ export function changeAtomFromDetachedNodeId(changeAtom) {
11
+ return makeChangeAtomId(brand(changeAtom.minor), changeAtom.major);
12
+ }
9
13
  /**
10
14
  * Converts a `Delta.Root` whose tree content is represented with by `TIn` instances
11
15
  * into a `Delta.Root`whose tree content is represented with by `TOut` instances.
@@ -1 +1 @@
1
- {"version":3,"file":"deltaUtils.js","sourceRoot":"","sources":["../../src/feature-libraries/deltaUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIN,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,UAAU,oBAAoB,CAAC,UAAwB;IAC5D,OAAO,kBAAkB,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;AACpE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAC7B,IAAoB,EACpB,IAAyB;IAEzB,MAAM,GAAG,GAA6B,EAAE,CAAC;IACzC,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC1B,CAAC;IACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC9B,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;YAC9C,EAAE;YACF,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC;SAClB,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;YACjD,EAAE;YACF,MAAM;SACN,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;YAC1D,KAAK;YACL,KAAK;YACL,KAAK;SACL,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype ChangeAtomId,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaRoot,\n\tmakeDetachedNodeId,\n} from \"../core/index.js\";\nimport type { Mutable } from \"../util/index.js\";\n\nexport function nodeIdFromChangeAtom(changeAtom: ChangeAtomId): DeltaDetachedNodeId {\n\treturn makeDetachedNodeId(changeAtom.revision, changeAtom.localId);\n}\n\n/**\n * Converts a `Delta.Root` whose tree content is represented with by `TIn` instances\n * into a `Delta.Root`whose tree content is represented with by `TOut` instances.\n *\n * This function is useful for converting `Delta`s that represent tree content with cursors\n * into `Delta`s that represent tree content with a deep-comparable representation of the content.\n * See {@link assertDeltaEqual}.\n * @param root - The delta to convert. Not mutated.\n * @param func - The functions used to map tree content.\n */\nexport function mapRootChanges<TIn, TOut>(\n\troot: DeltaRoot<TIn>,\n\tfunc: (tree: TIn) => TOut,\n): DeltaRoot<TOut> {\n\tconst out: Mutable<DeltaRoot<TOut>> = {};\n\tif (root.fields !== undefined) {\n\t\tout.fields = root.fields;\n\t}\n\tif (root.build !== undefined) {\n\t\tout.build = root.build.map(({ id, trees }) => ({\n\t\t\tid,\n\t\t\ttrees: func(trees),\n\t\t}));\n\t}\n\tif (root.global !== undefined) {\n\t\tout.global = root.global.map(({ id, fields }) => ({\n\t\t\tid,\n\t\t\tfields,\n\t\t}));\n\t}\n\tif (root.rename !== undefined) {\n\t\tout.rename = root.rename.map(({ count, oldId, newId }) => ({\n\t\t\tcount,\n\t\t\toldId,\n\t\t\tnewId,\n\t\t}));\n\t}\n\treturn out;\n}\n"]}
1
+ {"version":3,"file":"deltaUtils.js","sourceRoot":"","sources":["../../src/feature-libraries/deltaUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIN,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAgB,MAAM,kBAAkB,CAAC;AAEvD,MAAM,UAAU,oBAAoB,CAAC,UAAwB;IAC5D,OAAO,kBAAkB,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,UAA+B;IAC3E,OAAO,gBAAgB,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;AACpE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAC7B,IAAoB,EACpB,IAAyB;IAEzB,MAAM,GAAG,GAA6B,EAAE,CAAC;IACzC,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC1B,CAAC;IACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC9B,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;YAC9C,EAAE;YACF,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC;SAClB,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;YACjD,EAAE;YACF,MAAM;SACN,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;YAC1D,KAAK;YACL,KAAK;YACL,KAAK;SACL,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype ChangeAtomId,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaRoot,\n\tmakeChangeAtomId,\n\tmakeDetachedNodeId,\n} from \"../core/index.js\";\nimport { brand, type Mutable } from \"../util/index.js\";\n\nexport function nodeIdFromChangeAtom(changeAtom: ChangeAtomId): DeltaDetachedNodeId {\n\treturn makeDetachedNodeId(changeAtom.revision, changeAtom.localId);\n}\n\nexport function changeAtomFromDetachedNodeId(changeAtom: DeltaDetachedNodeId): ChangeAtomId {\n\treturn makeChangeAtomId(brand(changeAtom.minor), changeAtom.major);\n}\n\n/**\n * Converts a `Delta.Root` whose tree content is represented with by `TIn` instances\n * into a `Delta.Root`whose tree content is represented with by `TOut` instances.\n *\n * This function is useful for converting `Delta`s that represent tree content with cursors\n * into `Delta`s that represent tree content with a deep-comparable representation of the content.\n * See {@link assertDeltaEqual}.\n * @param root - The delta to convert. Not mutated.\n * @param func - The functions used to map tree content.\n */\nexport function mapRootChanges<TIn, TOut>(\n\troot: DeltaRoot<TIn>,\n\tfunc: (tree: TIn) => TOut,\n): DeltaRoot<TOut> {\n\tconst out: Mutable<DeltaRoot<TOut>> = {};\n\tif (root.fields !== undefined) {\n\t\tout.fields = root.fields;\n\t}\n\tif (root.build !== undefined) {\n\t\tout.build = root.build.map(({ id, trees }) => ({\n\t\t\tid,\n\t\t\ttrees: func(trees),\n\t\t}));\n\t}\n\tif (root.global !== undefined) {\n\t\tout.global = root.global.map(({ id, fields }) => ({\n\t\t\tid,\n\t\t\tfields,\n\t\t}));\n\t}\n\tif (root.rename !== undefined) {\n\t\tout.rename = root.rename.map(({ count, oldId, newId }) => ({\n\t\t\tcount,\n\t\t\toldId,\n\t\t\tnewId,\n\t\t}));\n\t}\n\treturn out;\n}\n"]}