@fluidframework/tree 2.11.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (704) hide show
  1. package/CHANGELOG.md +140 -0
  2. package/api-report/tree.alpha.api.md +88 -12
  3. package/api-report/tree.beta.api.md +23 -11
  4. package/api-report/tree.legacy.alpha.api.md +23 -11
  5. package/api-report/tree.legacy.public.api.md +23 -11
  6. package/api-report/tree.public.api.md +23 -11
  7. package/dist/alpha.d.ts +11 -0
  8. package/dist/beta.d.ts +2 -0
  9. package/dist/core/index.d.ts +2 -2
  10. package/dist/core/index.d.ts.map +1 -1
  11. package/dist/core/index.js +5 -3
  12. package/dist/core/index.js.map +1 -1
  13. package/dist/core/rebase/utils.d.ts.map +1 -1
  14. package/dist/core/rebase/utils.js +2 -9
  15. package/dist/core/rebase/utils.js.map +1 -1
  16. package/dist/core/schema-stored/format.d.ts +0 -3
  17. package/dist/core/schema-stored/format.d.ts.map +1 -1
  18. package/dist/core/schema-stored/format.js.map +1 -1
  19. package/dist/core/schema-stored/schema.d.ts +12 -10
  20. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  21. package/dist/core/schema-stored/schema.js +3 -5
  22. package/dist/core/schema-stored/schema.js.map +1 -1
  23. package/dist/core/schema-view/index.d.ts +1 -1
  24. package/dist/core/schema-view/index.d.ts.map +1 -1
  25. package/dist/core/schema-view/index.js +1 -2
  26. package/dist/core/schema-view/index.js.map +1 -1
  27. package/dist/core/schema-view/view.d.ts +0 -7
  28. package/dist/core/schema-view/view.d.ts.map +1 -1
  29. package/dist/core/schema-view/view.js +1 -12
  30. package/dist/core/schema-view/view.js.map +1 -1
  31. package/dist/{feature-libraries/chunked-forest → core/tree}/chunk.d.ts +2 -1
  32. package/dist/core/tree/chunk.d.ts.map +1 -0
  33. package/dist/{feature-libraries/chunked-forest → core/tree}/chunk.js +2 -2
  34. package/dist/core/tree/chunk.js.map +1 -0
  35. package/dist/core/tree/index.d.ts +1 -0
  36. package/dist/core/tree/index.d.ts.map +1 -1
  37. package/dist/core/tree/index.js +5 -1
  38. package/dist/core/tree/index.js.map +1 -1
  39. package/dist/core/tree/treeTextFormat.d.ts +0 -5
  40. package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
  41. package/dist/core/tree/treeTextFormat.js.map +1 -1
  42. package/dist/core/tree/types.d.ts +0 -5
  43. package/dist/core/tree/types.d.ts.map +1 -1
  44. package/dist/core/tree/types.js +0 -1
  45. package/dist/core/tree/types.js.map +1 -1
  46. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts +1 -2
  47. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  48. package/dist/feature-libraries/chunked-forest/basicChunk.js +14 -14
  49. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  50. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +1 -2
  51. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  52. package/dist/feature-libraries/chunked-forest/chunkTree.js +2 -3
  53. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  54. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +1 -2
  55. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  56. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +1 -2
  58. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
  59. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  60. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -2
  61. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  62. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  65. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  66. package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
  67. package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
  68. package/dist/feature-libraries/chunked-forest/emptyChunk.js +2 -3
  69. package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  70. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  71. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  72. package/dist/feature-libraries/chunked-forest/index.js +5 -5
  73. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  74. package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
  75. package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
  76. package/dist/feature-libraries/chunked-forest/sequenceChunk.js +2 -2
  77. package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -2
  79. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  80. package/dist/feature-libraries/chunked-forest/uniformChunk.js +13 -13
  81. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  82. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +10 -0
  83. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  84. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +3 -0
  85. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  86. package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  87. package/dist/feature-libraries/default-schema/defaultSchema.js +1 -0
  88. package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  89. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  90. package/dist/feature-libraries/default-schema/schemaChecker.js +2 -1
  91. package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  92. package/dist/feature-libraries/index.d.ts +1 -2
  93. package/dist/feature-libraries/index.d.ts.map +1 -1
  94. package/dist/feature-libraries/index.js +6 -4
  95. package/dist/feature-libraries/index.js.map +1 -1
  96. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +8 -1
  97. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  98. package/dist/feature-libraries/indexing/anchorTreeIndex.js +31 -5
  99. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  100. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +1 -1
  101. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  102. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +8 -2
  103. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  104. package/dist/feature-libraries/modular-schema/discrepancies.d.ts +84 -24
  105. package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
  106. package/dist/feature-libraries/modular-schema/discrepancies.js +32 -33
  107. package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
  108. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +12 -5
  109. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  110. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  111. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  112. package/dist/feature-libraries/modular-schema/genericFieldKind.js +2 -1
  113. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  114. package/dist/feature-libraries/modular-schema/index.d.ts +2 -2
  115. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  116. package/dist/feature-libraries/modular-schema/index.js +5 -1
  117. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  118. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +0 -1
  119. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  120. package/dist/feature-libraries/modular-schema/isNeverTree.js +0 -1
  121. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  122. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -0
  123. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  124. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +89 -25
  125. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  126. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +12 -0
  127. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  128. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  129. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  130. package/dist/feature-libraries/optional-field/optionalField.js +24 -4
  131. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  132. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
  133. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  134. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
  135. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  136. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +12 -12
  137. package/dist/feature-libraries/sequence-field/formatV1.d.ts +99 -99
  138. package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  139. package/dist/feature-libraries/sequence-field/formatV2.d.ts +76 -76
  140. package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  141. package/dist/feature-libraries/sequence-field/formatV3.d.ts +54 -54
  142. package/dist/feature-libraries/sequence-field/types.d.ts +0 -1
  143. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  144. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  145. package/dist/feature-libraries/sequence-field/utils.d.ts +2 -2
  146. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  147. package/dist/feature-libraries/sequence-field/utils.js +14 -5
  148. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  149. package/dist/index.d.ts +4 -5
  150. package/dist/index.d.ts.map +1 -1
  151. package/dist/index.js +2 -14
  152. package/dist/index.js.map +1 -1
  153. package/dist/legacy.d.ts +2 -0
  154. package/dist/packageVersion.d.ts +1 -1
  155. package/dist/packageVersion.js +1 -1
  156. package/dist/packageVersion.js.map +1 -1
  157. package/dist/public.d.ts +2 -0
  158. package/dist/shared-tree/index.d.ts +3 -2
  159. package/dist/shared-tree/index.d.ts.map +1 -1
  160. package/dist/shared-tree/index.js +2 -1
  161. package/dist/shared-tree/index.js.map +1 -1
  162. package/dist/shared-tree/schematizeTree.d.ts +1 -1
  163. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  164. package/dist/shared-tree/schematizeTree.js +6 -6
  165. package/dist/shared-tree/schematizeTree.js.map +1 -1
  166. package/dist/shared-tree/schematizingTreeView.d.ts +10 -1
  167. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  168. package/dist/shared-tree/schematizingTreeView.js +51 -12
  169. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  170. package/dist/shared-tree/sharedTree.d.ts +31 -10
  171. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  172. package/dist/shared-tree/sharedTree.js +106 -15
  173. package/dist/shared-tree/sharedTree.js.map +1 -1
  174. package/dist/shared-tree/transactionTypes.d.ts +105 -0
  175. package/dist/shared-tree/transactionTypes.d.ts.map +1 -0
  176. package/dist/shared-tree/transactionTypes.js +13 -0
  177. package/dist/shared-tree/transactionTypes.js.map +1 -0
  178. package/dist/shared-tree/treeApi.d.ts +1 -25
  179. package/dist/shared-tree/treeApi.d.ts.map +1 -1
  180. package/dist/shared-tree/treeApi.js +4 -8
  181. package/dist/shared-tree/treeApi.js.map +1 -1
  182. package/dist/shared-tree/treeCheckout.d.ts +39 -13
  183. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  184. package/dist/shared-tree/treeCheckout.js +275 -128
  185. package/dist/shared-tree/treeCheckout.js.map +1 -1
  186. package/dist/shared-tree-core/branch.d.ts +13 -35
  187. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  188. package/dist/shared-tree-core/branch.js +12 -77
  189. package/dist/shared-tree-core/branch.js.map +1 -1
  190. package/dist/shared-tree-core/branchCommitEnricher.d.ts +7 -1
  191. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  192. package/dist/shared-tree-core/branchCommitEnricher.js +16 -18
  193. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  194. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  195. package/dist/shared-tree-core/editManager.js +2 -2
  196. package/dist/shared-tree-core/editManager.js.map +1 -1
  197. package/dist/shared-tree-core/index.d.ts +3 -3
  198. package/dist/shared-tree-core/index.d.ts.map +1 -1
  199. package/dist/shared-tree-core/index.js +2 -2
  200. package/dist/shared-tree-core/index.js.map +1 -1
  201. package/dist/shared-tree-core/sharedTreeCore.d.ts +2 -9
  202. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  203. package/dist/shared-tree-core/sharedTreeCore.js +4 -16
  204. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  205. package/dist/shared-tree-core/transaction.d.ts +38 -0
  206. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  207. package/dist/shared-tree-core/transaction.js +118 -6
  208. package/dist/shared-tree-core/transaction.js.map +1 -1
  209. package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
  210. package/dist/simple-tree/api/conciseTree.js +1 -1
  211. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  212. package/dist/simple-tree/api/create.d.ts.map +1 -1
  213. package/dist/simple-tree/api/create.js +5 -1
  214. package/dist/simple-tree/api/create.js.map +1 -1
  215. package/dist/simple-tree/api/customTree.d.ts +14 -2
  216. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  217. package/dist/simple-tree/api/customTree.js +53 -3
  218. package/dist/simple-tree/api/customTree.js.map +1 -1
  219. package/dist/simple-tree/api/index.d.ts +3 -2
  220. package/dist/simple-tree/api/index.d.ts.map +1 -1
  221. package/dist/simple-tree/api/index.js +6 -1
  222. package/dist/simple-tree/api/index.js.map +1 -1
  223. package/dist/simple-tree/api/jsonSchema.d.ts +6 -0
  224. package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -1
  225. package/dist/simple-tree/api/jsonSchema.js.map +1 -1
  226. package/dist/simple-tree/api/schemaFactory.d.ts +65 -8
  227. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  228. package/dist/simple-tree/api/schemaFactory.js +10 -4
  229. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  230. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +83 -0
  231. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -0
  232. package/dist/simple-tree/api/schemaFactoryAlpha.js +90 -0
  233. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -0
  234. package/dist/simple-tree/api/simpleSchema.d.ts +8 -2
  235. package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -1
  236. package/dist/simple-tree/api/simpleSchema.js.map +1 -1
  237. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +13 -10
  238. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  239. package/dist/simple-tree/api/simpleTreeIndex.js +3 -1
  240. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  241. package/dist/simple-tree/api/storedSchema.d.ts +4 -4
  242. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  243. package/dist/simple-tree/api/storedSchema.js +8 -21
  244. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  245. package/dist/simple-tree/api/testRecursiveDomain.d.ts +5 -5
  246. package/dist/simple-tree/api/tree.d.ts +61 -0
  247. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  248. package/dist/simple-tree/api/tree.js.map +1 -1
  249. package/dist/simple-tree/api/verboseTree.js +1 -1
  250. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  251. package/dist/simple-tree/api/view.d.ts +14 -9
  252. package/dist/simple-tree/api/view.d.ts.map +1 -1
  253. package/dist/simple-tree/api/view.js +129 -40
  254. package/dist/simple-tree/api/view.js.map +1 -1
  255. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  256. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +11 -11
  257. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  258. package/dist/simple-tree/arrayNode.d.ts +2 -2
  259. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  260. package/dist/simple-tree/arrayNode.js +2 -1
  261. package/dist/simple-tree/arrayNode.js.map +1 -1
  262. package/dist/simple-tree/core/treeNodeSchema.d.ts +10 -6
  263. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  264. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  265. package/dist/simple-tree/index.d.ts +3 -3
  266. package/dist/simple-tree/index.d.ts.map +1 -1
  267. package/dist/simple-tree/index.js +6 -2
  268. package/dist/simple-tree/index.js.map +1 -1
  269. package/dist/simple-tree/leafNodeSchema.d.ts +5 -20
  270. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  271. package/dist/simple-tree/leafNodeSchema.js +0 -15
  272. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  273. package/dist/simple-tree/mapNode.d.ts +2 -2
  274. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  275. package/dist/simple-tree/mapNode.js +2 -1
  276. package/dist/simple-tree/mapNode.js.map +1 -1
  277. package/dist/simple-tree/objectNode.d.ts +9 -4
  278. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  279. package/dist/simple-tree/objectNode.js +19 -2
  280. package/dist/simple-tree/objectNode.js.map +1 -1
  281. package/dist/simple-tree/objectNodeTypes.d.ts +6 -2
  282. package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -1
  283. package/dist/simple-tree/objectNodeTypes.js.map +1 -1
  284. package/dist/simple-tree/schemaTypes.d.ts +51 -3
  285. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  286. package/dist/simple-tree/schemaTypes.js.map +1 -1
  287. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  288. package/dist/simple-tree/toStoredSchema.js +18 -13
  289. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  290. package/dist/util/brand.d.ts +0 -2
  291. package/dist/util/brand.d.ts.map +1 -1
  292. package/dist/util/brand.js +0 -1
  293. package/dist/util/brand.js.map +1 -1
  294. package/dist/util/index.d.ts +2 -2
  295. package/dist/util/index.d.ts.map +1 -1
  296. package/dist/util/index.js +4 -5
  297. package/dist/util/index.js.map +1 -1
  298. package/dist/util/rangeMap.d.ts +72 -42
  299. package/dist/util/rangeMap.d.ts.map +1 -1
  300. package/dist/util/rangeMap.js +161 -151
  301. package/dist/util/rangeMap.js.map +1 -1
  302. package/dist/util/typeCheck.d.ts +0 -2
  303. package/dist/util/typeCheck.d.ts.map +1 -1
  304. package/dist/util/typeCheck.js.map +1 -1
  305. package/dist/util/utils.d.ts +35 -1
  306. package/dist/util/utils.d.ts.map +1 -1
  307. package/dist/util/utils.js +32 -1
  308. package/dist/util/utils.js.map +1 -1
  309. package/lib/alpha.d.ts +11 -0
  310. package/lib/beta.d.ts +2 -0
  311. package/lib/core/index.d.ts +2 -2
  312. package/lib/core/index.d.ts.map +1 -1
  313. package/lib/core/index.js +2 -2
  314. package/lib/core/index.js.map +1 -1
  315. package/lib/core/rebase/utils.d.ts.map +1 -1
  316. package/lib/core/rebase/utils.js +3 -10
  317. package/lib/core/rebase/utils.js.map +1 -1
  318. package/lib/core/schema-stored/format.d.ts +0 -3
  319. package/lib/core/schema-stored/format.d.ts.map +1 -1
  320. package/lib/core/schema-stored/format.js.map +1 -1
  321. package/lib/core/schema-stored/schema.d.ts +12 -10
  322. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  323. package/lib/core/schema-stored/schema.js +3 -5
  324. package/lib/core/schema-stored/schema.js.map +1 -1
  325. package/lib/core/schema-view/index.d.ts +1 -1
  326. package/lib/core/schema-view/index.d.ts.map +1 -1
  327. package/lib/core/schema-view/index.js +1 -1
  328. package/lib/core/schema-view/index.js.map +1 -1
  329. package/lib/core/schema-view/view.d.ts +0 -7
  330. package/lib/core/schema-view/view.d.ts.map +1 -1
  331. package/lib/core/schema-view/view.js +0 -11
  332. package/lib/core/schema-view/view.js.map +1 -1
  333. package/lib/{feature-libraries/chunked-forest → core/tree}/chunk.d.ts +2 -1
  334. package/lib/core/tree/chunk.d.ts.map +1 -0
  335. package/lib/{feature-libraries/chunked-forest → core/tree}/chunk.js +1 -1
  336. package/lib/core/tree/chunk.js.map +1 -0
  337. package/lib/core/tree/index.d.ts +1 -0
  338. package/lib/core/tree/index.d.ts.map +1 -1
  339. package/lib/core/tree/index.js +1 -0
  340. package/lib/core/tree/index.js.map +1 -1
  341. package/lib/core/tree/treeTextFormat.d.ts +0 -5
  342. package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
  343. package/lib/core/tree/treeTextFormat.js.map +1 -1
  344. package/lib/core/tree/types.d.ts +0 -5
  345. package/lib/core/tree/types.d.ts.map +1 -1
  346. package/lib/core/tree/types.js +0 -1
  347. package/lib/core/tree/types.js.map +1 -1
  348. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts +1 -2
  349. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  350. package/lib/feature-libraries/chunked-forest/basicChunk.js +1 -1
  351. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  352. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +1 -2
  353. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  354. package/lib/feature-libraries/chunked-forest/chunkTree.js +1 -2
  355. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  356. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +1 -2
  357. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  358. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  359. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +1 -2
  360. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
  361. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  362. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -2
  363. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  364. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  365. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  366. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  367. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  368. package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
  369. package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
  370. package/lib/feature-libraries/chunked-forest/emptyChunk.js +1 -2
  371. package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  372. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  373. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  374. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  375. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  376. package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
  377. package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
  378. package/lib/feature-libraries/chunked-forest/sequenceChunk.js +1 -1
  379. package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  380. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -2
  381. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  382. package/lib/feature-libraries/chunked-forest/uniformChunk.js +1 -1
  383. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  384. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +10 -0
  385. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  386. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +3 -0
  387. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  388. package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  389. package/lib/feature-libraries/default-schema/defaultSchema.js +1 -0
  390. package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  391. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  392. package/lib/feature-libraries/default-schema/schemaChecker.js +2 -1
  393. package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  394. package/lib/feature-libraries/index.d.ts +1 -2
  395. package/lib/feature-libraries/index.d.ts.map +1 -1
  396. package/lib/feature-libraries/index.js +1 -2
  397. package/lib/feature-libraries/index.js.map +1 -1
  398. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +8 -1
  399. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  400. package/lib/feature-libraries/indexing/anchorTreeIndex.js +31 -5
  401. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  402. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +1 -1
  403. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  404. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +9 -3
  405. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  406. package/lib/feature-libraries/modular-schema/discrepancies.d.ts +84 -24
  407. package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
  408. package/lib/feature-libraries/modular-schema/discrepancies.js +25 -28
  409. package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
  410. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +12 -5
  411. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  412. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  413. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  414. package/lib/feature-libraries/modular-schema/genericFieldKind.js +2 -1
  415. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  416. package/lib/feature-libraries/modular-schema/index.d.ts +2 -2
  417. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  418. package/lib/feature-libraries/modular-schema/index.js +1 -1
  419. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  420. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +0 -1
  421. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  422. package/lib/feature-libraries/modular-schema/isNeverTree.js +0 -1
  423. package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  424. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -0
  425. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  426. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +89 -25
  427. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  428. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +12 -0
  429. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  430. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  431. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  432. package/lib/feature-libraries/optional-field/optionalField.js +24 -4
  433. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  434. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
  435. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  436. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
  437. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  438. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +12 -12
  439. package/lib/feature-libraries/sequence-field/formatV1.d.ts +99 -99
  440. package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  441. package/lib/feature-libraries/sequence-field/formatV2.d.ts +76 -76
  442. package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  443. package/lib/feature-libraries/sequence-field/formatV3.d.ts +54 -54
  444. package/lib/feature-libraries/sequence-field/types.d.ts +0 -1
  445. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  446. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  447. package/lib/feature-libraries/sequence-field/utils.d.ts +2 -2
  448. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  449. package/lib/feature-libraries/sequence-field/utils.js +14 -5
  450. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  451. package/lib/index.d.ts +4 -5
  452. package/lib/index.d.ts.map +1 -1
  453. package/lib/index.js +3 -4
  454. package/lib/index.js.map +1 -1
  455. package/lib/legacy.d.ts +2 -0
  456. package/lib/packageVersion.d.ts +1 -1
  457. package/lib/packageVersion.js +1 -1
  458. package/lib/packageVersion.js.map +1 -1
  459. package/lib/public.d.ts +2 -0
  460. package/lib/shared-tree/index.d.ts +3 -2
  461. package/lib/shared-tree/index.d.ts.map +1 -1
  462. package/lib/shared-tree/index.js +2 -1
  463. package/lib/shared-tree/index.js.map +1 -1
  464. package/lib/shared-tree/schematizeTree.d.ts +1 -1
  465. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  466. package/lib/shared-tree/schematizeTree.js +7 -7
  467. package/lib/shared-tree/schematizeTree.js.map +1 -1
  468. package/lib/shared-tree/schematizingTreeView.d.ts +10 -1
  469. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  470. package/lib/shared-tree/schematizingTreeView.js +56 -17
  471. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  472. package/lib/shared-tree/sharedTree.d.ts +31 -10
  473. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  474. package/lib/shared-tree/sharedTree.js +107 -16
  475. package/lib/shared-tree/sharedTree.js.map +1 -1
  476. package/lib/shared-tree/transactionTypes.d.ts +105 -0
  477. package/lib/shared-tree/transactionTypes.d.ts.map +1 -0
  478. package/lib/shared-tree/transactionTypes.js +10 -0
  479. package/lib/shared-tree/transactionTypes.js.map +1 -0
  480. package/lib/shared-tree/treeApi.d.ts +1 -25
  481. package/lib/shared-tree/treeApi.d.ts.map +1 -1
  482. package/lib/shared-tree/treeApi.js +1 -5
  483. package/lib/shared-tree/treeApi.js.map +1 -1
  484. package/lib/shared-tree/treeCheckout.d.ts +39 -13
  485. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  486. package/lib/shared-tree/treeCheckout.js +277 -130
  487. package/lib/shared-tree/treeCheckout.js.map +1 -1
  488. package/lib/shared-tree-core/branch.d.ts +13 -35
  489. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  490. package/lib/shared-tree-core/branch.js +12 -76
  491. package/lib/shared-tree-core/branch.js.map +1 -1
  492. package/lib/shared-tree-core/branchCommitEnricher.d.ts +7 -1
  493. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  494. package/lib/shared-tree-core/branchCommitEnricher.js +16 -18
  495. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  496. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  497. package/lib/shared-tree-core/editManager.js +3 -3
  498. package/lib/shared-tree-core/editManager.js.map +1 -1
  499. package/lib/shared-tree-core/index.d.ts +3 -3
  500. package/lib/shared-tree-core/index.d.ts.map +1 -1
  501. package/lib/shared-tree-core/index.js +2 -2
  502. package/lib/shared-tree-core/index.js.map +1 -1
  503. package/lib/shared-tree-core/sharedTreeCore.d.ts +2 -9
  504. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  505. package/lib/shared-tree-core/sharedTreeCore.js +4 -16
  506. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  507. package/lib/shared-tree-core/transaction.d.ts +38 -0
  508. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  509. package/lib/shared-tree-core/transaction.js +112 -1
  510. package/lib/shared-tree-core/transaction.js.map +1 -1
  511. package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
  512. package/lib/simple-tree/api/conciseTree.js +2 -2
  513. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  514. package/lib/simple-tree/api/create.d.ts.map +1 -1
  515. package/lib/simple-tree/api/create.js +5 -1
  516. package/lib/simple-tree/api/create.js.map +1 -1
  517. package/lib/simple-tree/api/customTree.d.ts +14 -2
  518. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  519. package/lib/simple-tree/api/customTree.js +50 -2
  520. package/lib/simple-tree/api/customTree.js.map +1 -1
  521. package/lib/simple-tree/api/index.d.ts +3 -2
  522. package/lib/simple-tree/api/index.d.ts.map +1 -1
  523. package/lib/simple-tree/api/index.js +3 -1
  524. package/lib/simple-tree/api/index.js.map +1 -1
  525. package/lib/simple-tree/api/jsonSchema.d.ts +6 -0
  526. package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -1
  527. package/lib/simple-tree/api/jsonSchema.js.map +1 -1
  528. package/lib/simple-tree/api/schemaFactory.d.ts +65 -8
  529. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  530. package/lib/simple-tree/api/schemaFactory.js +9 -3
  531. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  532. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +83 -0
  533. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -0
  534. package/lib/simple-tree/api/schemaFactoryAlpha.js +86 -0
  535. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -0
  536. package/lib/simple-tree/api/simpleSchema.d.ts +8 -2
  537. package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -1
  538. package/lib/simple-tree/api/simpleSchema.js.map +1 -1
  539. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +14 -11
  540. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  541. package/lib/simple-tree/api/simpleTreeIndex.js +3 -1
  542. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  543. package/lib/simple-tree/api/storedSchema.d.ts +4 -4
  544. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  545. package/lib/simple-tree/api/storedSchema.js +5 -18
  546. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  547. package/lib/simple-tree/api/testRecursiveDomain.d.ts +5 -5
  548. package/lib/simple-tree/api/tree.d.ts +61 -0
  549. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  550. package/lib/simple-tree/api/tree.js.map +1 -1
  551. package/lib/simple-tree/api/verboseTree.js +2 -2
  552. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  553. package/lib/simple-tree/api/view.d.ts +14 -9
  554. package/lib/simple-tree/api/view.d.ts.map +1 -1
  555. package/lib/simple-tree/api/view.js +131 -42
  556. package/lib/simple-tree/api/view.js.map +1 -1
  557. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  558. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +12 -12
  559. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  560. package/lib/simple-tree/arrayNode.d.ts +2 -2
  561. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  562. package/lib/simple-tree/arrayNode.js +2 -1
  563. package/lib/simple-tree/arrayNode.js.map +1 -1
  564. package/lib/simple-tree/core/treeNodeSchema.d.ts +10 -6
  565. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  566. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  567. package/lib/simple-tree/index.d.ts +3 -3
  568. package/lib/simple-tree/index.d.ts.map +1 -1
  569. package/lib/simple-tree/index.js +2 -2
  570. package/lib/simple-tree/index.js.map +1 -1
  571. package/lib/simple-tree/leafNodeSchema.d.ts +5 -20
  572. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  573. package/lib/simple-tree/leafNodeSchema.js +0 -15
  574. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  575. package/lib/simple-tree/mapNode.d.ts +2 -2
  576. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  577. package/lib/simple-tree/mapNode.js +2 -1
  578. package/lib/simple-tree/mapNode.js.map +1 -1
  579. package/lib/simple-tree/objectNode.d.ts +9 -4
  580. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  581. package/lib/simple-tree/objectNode.js +17 -1
  582. package/lib/simple-tree/objectNode.js.map +1 -1
  583. package/lib/simple-tree/objectNodeTypes.d.ts +6 -2
  584. package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -1
  585. package/lib/simple-tree/objectNodeTypes.js.map +1 -1
  586. package/lib/simple-tree/schemaTypes.d.ts +51 -3
  587. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  588. package/lib/simple-tree/schemaTypes.js.map +1 -1
  589. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  590. package/lib/simple-tree/toStoredSchema.js +19 -14
  591. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  592. package/lib/util/brand.d.ts +0 -2
  593. package/lib/util/brand.d.ts.map +1 -1
  594. package/lib/util/brand.js +0 -1
  595. package/lib/util/brand.js.map +1 -1
  596. package/lib/util/index.d.ts +2 -2
  597. package/lib/util/index.d.ts.map +1 -1
  598. package/lib/util/index.js +2 -2
  599. package/lib/util/index.js.map +1 -1
  600. package/lib/util/rangeMap.d.ts +72 -42
  601. package/lib/util/rangeMap.d.ts.map +1 -1
  602. package/lib/util/rangeMap.js +159 -146
  603. package/lib/util/rangeMap.js.map +1 -1
  604. package/lib/util/typeCheck.d.ts +0 -2
  605. package/lib/util/typeCheck.d.ts.map +1 -1
  606. package/lib/util/typeCheck.js.map +1 -1
  607. package/lib/util/utils.d.ts +35 -1
  608. package/lib/util/utils.d.ts.map +1 -1
  609. package/lib/util/utils.js +29 -0
  610. package/lib/util/utils.js.map +1 -1
  611. package/package.json +23 -23
  612. package/src/core/index.ts +5 -1
  613. package/src/core/rebase/utils.ts +17 -20
  614. package/src/core/schema-stored/format.ts +0 -3
  615. package/src/core/schema-stored/schema.ts +13 -10
  616. package/src/core/schema-view/index.ts +0 -1
  617. package/src/core/schema-view/view.ts +0 -11
  618. package/src/{feature-libraries/chunked-forest → core/tree}/chunk.ts +4 -4
  619. package/src/core/tree/index.ts +8 -0
  620. package/src/core/tree/treeTextFormat.ts +0 -5
  621. package/src/core/tree/types.ts +0 -5
  622. package/src/feature-libraries/chunked-forest/basicChunk.ts +4 -2
  623. package/src/feature-libraries/chunked-forest/chunkTree.ts +2 -1
  624. package/src/feature-libraries/chunked-forest/chunkedForest.ts +2 -1
  625. package/src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts +1 -2
  626. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +6 -2
  627. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
  628. package/src/feature-libraries/chunked-forest/emptyChunk.ts +4 -2
  629. package/src/feature-libraries/chunked-forest/index.ts +1 -1
  630. package/src/feature-libraries/chunked-forest/sequenceChunk.ts +1 -1
  631. package/src/feature-libraries/chunked-forest/uniformChunk.ts +4 -1
  632. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +14 -1
  633. package/src/feature-libraries/default-schema/defaultSchema.ts +1 -0
  634. package/src/feature-libraries/default-schema/schemaChecker.ts +4 -1
  635. package/src/feature-libraries/index.ts +13 -1
  636. package/src/feature-libraries/indexing/anchorTreeIndex.ts +34 -5
  637. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +9 -9
  638. package/src/feature-libraries/modular-schema/discrepancies.ts +76 -38
  639. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +13 -9
  640. package/src/feature-libraries/modular-schema/genericFieldKind.ts +4 -2
  641. package/src/feature-libraries/modular-schema/index.ts +14 -0
  642. package/src/feature-libraries/modular-schema/isNeverTree.ts +0 -2
  643. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +124 -31
  644. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +12 -0
  645. package/src/feature-libraries/optional-field/optionalField.ts +34 -5
  646. package/src/feature-libraries/sequence-field/types.ts +0 -1
  647. package/src/feature-libraries/sequence-field/utils.ts +18 -7
  648. package/src/index.ts +12 -29
  649. package/src/packageVersion.ts +1 -1
  650. package/src/shared-tree/index.ts +13 -2
  651. package/src/shared-tree/schematizeTree.ts +6 -10
  652. package/src/shared-tree/schematizingTreeView.ts +102 -23
  653. package/src/shared-tree/sharedTree.ts +181 -44
  654. package/src/shared-tree/transactionTypes.ts +125 -0
  655. package/src/shared-tree/treeApi.ts +1 -28
  656. package/src/shared-tree/treeCheckout.ts +358 -175
  657. package/src/shared-tree-core/branch.ts +29 -122
  658. package/src/shared-tree-core/branchCommitEnricher.ts +19 -20
  659. package/src/shared-tree-core/editManager.ts +3 -8
  660. package/src/shared-tree-core/index.ts +2 -1
  661. package/src/shared-tree-core/sharedTreeCore.ts +8 -19
  662. package/src/shared-tree-core/transaction.ts +145 -0
  663. package/src/simple-tree/api/conciseTree.ts +2 -2
  664. package/src/simple-tree/api/create.ts +5 -1
  665. package/src/simple-tree/api/customTree.ts +69 -1
  666. package/src/simple-tree/api/index.ts +13 -2
  667. package/src/simple-tree/api/jsonSchema.ts +7 -0
  668. package/src/simple-tree/api/schemaFactory.ts +91 -3
  669. package/src/simple-tree/api/schemaFactoryAlpha.ts +253 -0
  670. package/src/simple-tree/api/simpleSchema.ts +9 -2
  671. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +22 -12
  672. package/src/simple-tree/api/simpleTreeIndex.ts +2 -0
  673. package/src/simple-tree/api/storedSchema.ts +7 -22
  674. package/src/simple-tree/api/tree.ts +78 -0
  675. package/src/simple-tree/api/verboseTree.ts +2 -2
  676. package/src/simple-tree/api/view.ts +197 -51
  677. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +19 -13
  678. package/src/simple-tree/arrayNode.ts +7 -1
  679. package/src/simple-tree/core/treeNodeSchema.ts +51 -7
  680. package/src/simple-tree/index.ts +9 -0
  681. package/src/simple-tree/leafNodeSchema.ts +0 -19
  682. package/src/simple-tree/mapNode.ts +7 -1
  683. package/src/simple-tree/objectNode.ts +33 -3
  684. package/src/simple-tree/objectNodeTypes.ts +9 -1
  685. package/src/simple-tree/schemaTypes.ts +57 -3
  686. package/src/simple-tree/toStoredSchema.ts +25 -19
  687. package/src/util/brand.ts +0 -2
  688. package/src/util/index.ts +3 -6
  689. package/src/util/rangeMap.ts +199 -189
  690. package/src/util/typeCheck.ts +0 -2
  691. package/src/util/utils.ts +73 -1
  692. package/dist/feature-libraries/chunked-forest/chunk.d.ts.map +0 -1
  693. package/dist/feature-libraries/chunked-forest/chunk.js.map +0 -1
  694. package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts +0 -38
  695. package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts.map +0 -1
  696. package/dist/feature-libraries/memoizedIdRangeAllocator.js +0 -74
  697. package/dist/feature-libraries/memoizedIdRangeAllocator.js.map +0 -1
  698. package/lib/feature-libraries/chunked-forest/chunk.d.ts.map +0 -1
  699. package/lib/feature-libraries/chunked-forest/chunk.js.map +0 -1
  700. package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts +0 -38
  701. package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts.map +0 -1
  702. package/lib/feature-libraries/memoizedIdRangeAllocator.js +0 -71
  703. package/lib/feature-libraries/memoizedIdRangeAllocator.js.map +0 -1
  704. package/src/feature-libraries/memoizedIdRangeAllocator.ts +0 -112
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../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AClD,MAAM,IAAI,GAAyB,EAAE,CAAC;IACtC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,GAAG,8BAA8B,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,8BAA8B,CACtC,MAAkB,EAClB,KAAa;IAEb,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,QAAQ;YACZ,2FAA2F;YAC3F,mDAAmD;YACnD,OAAO;gBACN,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC;gBAC5D,CAAC,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC;aACjE,CAAC;QACH,KAAK,SAAS;YACb,OAAO,CAAC,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;QACvE,KAAK,QAAQ;YACZ,OAAO,CAAC,CAAC,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;QAC5E,KAAK,iBAAiB;YACrB,OAAO;gBACN,GAAG,8BAA8B,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;gBACvD,GAAG,8BAA8B,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;aACvD,CAAC;QACH;YACC,OAAO,EAAE,CAAC;IACZ,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype ChangesetLocalId,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\tareEqualChangeAtomIdOpts,\n\tareEqualChangeAtomIds,\n\tmakeChangeAtomId,\n} from \"../../core/index.js\";\nimport { type Mutable, brand, fail } from \"../../util/index.js\";\nimport {\n\tCrossFieldTarget,\n\ttype NodeId,\n\ttype CrossFieldKeyRange,\n} from \"../modular-schema/index.js\";\n\nimport type {\n\tCellRename,\n\tDetachOfRemovedNodes,\n\tEmptyInputCellMark,\n\tMoveMarkEffect,\n} from \"./helperTypes.js\";\nimport {\n\ttype Attach,\n\ttype AttachAndDetach,\n\ttype CellId,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype DetachFields,\n\ttype HasRevisionTag,\n\ttype Insert,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MoveIn,\n\ttype MoveOut,\n\ttype NoopMark,\n\tNoopMarkType,\n\ttype Remove,\n\ttype CellCount,\n\ttype Rename,\n} from \"./types.js\";\n\nexport function isEmpty(change: Changeset): boolean {\n\tfor (const mark of change) {\n\t\tif (mark.changes !== undefined || mark.type !== undefined) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function createEmpty(): Changeset {\n\treturn [];\n}\n\nexport function getNestedChanges(change: Changeset): [NodeId, number | undefined][] {\n\tconst output: [NodeId, number | undefined][] = [];\n\tlet index = 0;\n\tfor (const { changes, cellId, count } of change) {\n\t\tif (changes !== undefined) {\n\t\t\toutput.push([changes, cellId === undefined ? index : undefined]);\n\t\t}\n\t\tif (cellId === undefined) {\n\t\t\tindex += count;\n\t\t}\n\t}\n\treturn output;\n}\n\nexport function isNewAttach(mark: Mark, revision?: RevisionTag): boolean {\n\treturn isNewAttachEffect(mark, mark.cellId, revision);\n}\n\nexport function isNewAttachEffect(\n\teffect: MarkEffect,\n\tcellId: CellId | undefined,\n\trevision?: RevisionTag,\n): boolean {\n\treturn (\n\t\t(isAttach(effect) &&\n\t\t\tcellId !== undefined &&\n\t\t\t(effect.revision ?? revision) === (cellId.revision ?? revision)) ||\n\t\t(isAttachAndDetachEffect(effect) && isNewAttachEffect(effect.attach, cellId, revision))\n\t);\n}\n\nexport function isRename(mark: MarkEffect): mark is Rename {\n\treturn mark.type === \"Rename\";\n}\n\nexport function isInsert(mark: MarkEffect): mark is Insert {\n\treturn mark.type === \"Insert\";\n}\n\nexport function isAttach(effect: MarkEffect): effect is Attach {\n\treturn effect.type === \"Insert\" || effect.type === \"MoveIn\";\n}\n\nexport function isReattach(mark: Mark): boolean {\n\treturn isReattachEffect(mark, mark.cellId);\n}\n\nexport function isReattachEffect(effect: MarkEffect, cellId: CellId | undefined): boolean {\n\treturn isAttach(effect) && !isNewAttachEffect(effect, cellId);\n}\n\nexport function isActiveReattach(\n\tmark: Mark,\n): mark is CellMark<Insert> & { conflictsWith?: undefined } {\n\treturn isAttach(mark) && isReattachEffect(mark, mark.cellId) && mark.cellId !== undefined;\n}\n\nexport function areEqualCellIds(a: CellId | undefined, b: CellId | undefined): boolean {\n\treturn areEqualChangeAtomIdOpts(a, b);\n}\n\nexport function getInputCellId(mark: Mark): CellId | undefined {\n\treturn mark.cellId;\n}\n\nexport function getOutputCellId(mark: Mark): CellId | undefined {\n\tif (isDetach(mark) || isRename(mark)) {\n\t\treturn getDetachOutputCellId(mark);\n\t} else if (markFillsCells(mark)) {\n\t\treturn undefined;\n\t} else if (isAttachAndDetachEffect(mark)) {\n\t\treturn getDetachOutputCellId(mark.detach);\n\t}\n\n\treturn getInputCellId(mark);\n}\n\nexport function cellSourcesFromMarks(\n\tmarks: readonly Mark[],\n\tcontextGetter: typeof getInputCellId | typeof getOutputCellId,\n): Set<RevisionTag | undefined> {\n\tconst set = new Set<RevisionTag | undefined>();\n\tfor (const mark of marks) {\n\t\tconst cell = contextGetter(mark);\n\t\tif (cell !== undefined) {\n\t\t\tset.add(cell.revision);\n\t\t}\n\t}\n\treturn set;\n}\n\nexport enum CellOrder {\n\tSameCell,\n\tOldThenNew,\n\tNewThenOld,\n}\n\n/**\n * Determines the order of two cells from two changesets.\n *\n * This function makes the following assumptions:\n * 1. The cells represent the same context.\n * 2. `oldMarkCell` is from a mark in a changeset that is older than the changeset that contains the mark that\n * `newMarkCell` is from.\n * 3. In terms of sequence index, all cells located before A are also located before B,\n * and all cells located before B are also located before A.\n * 4. If a changeset has a mark/tombstone that describes a cell named in some revision R,\n * then that changeset must contain marks/tombstones for all cells named in R as well as all cells named in later\n * revisions up to its own.\n * 5. If a changeset foo is rebased over a changeset bar, then the rebased version of foo must contain tombstones or\n * marks for all cells referenced or named in bar. It has yet to be determined whether this assumption is necessary\n * for the logic below.\n *\n * @param oldMarkCell - The cell referenced or named by a mark or tombstone from the older changeset.\n * @param newMarkCell - The cell referenced or named by a mark or tombstone from the newer changeset.\n * @param oldChangeKnowledge - The set of revisions that the older changeset has cell representations for.\n * @param newChangeKnowledge - The set of revisions that the newer changeset has cell representations for.\n * @param metadata - Revision metadata for the operation being carried out.\n * @returns a {@link CellOrder} which describes how the cells are ordered relative to one-another.\n */\nexport function compareCellPositionsUsingTombstones(\n\toldMarkCell: ChangeAtomId,\n\tnewMarkCell: ChangeAtomId,\n\toldChangeKnowledge: ReadonlySet<RevisionTag | undefined>,\n\tnewChangeKnowledge: ReadonlySet<RevisionTag | undefined>,\n\tmetadata: RevisionMetadataSource,\n): CellOrder {\n\tif (areEqualChangeAtomIds(oldMarkCell, newMarkCell)) {\n\t\treturn CellOrder.SameCell;\n\t}\n\tconst oldChangeKnowsOfNewMarkCellRevision = oldChangeKnowledge.has(newMarkCell.revision);\n\tconst newChangeKnowsOfOldMarkCellRevision = newChangeKnowledge.has(oldMarkCell.revision);\n\tif (oldChangeKnowsOfNewMarkCellRevision && newChangeKnowsOfOldMarkCellRevision) {\n\t\t// If both changesets know of both cells, but we've been asked to compare different cells,\n\t\t// Then either the changesets they originate from do not represent the same context,\n\t\t// or the ordering of their cells in inconsistent.\n\t\t// The only exception to this is when we're composing anonymous changesets in a transaction.\n\t\tassert(\n\t\t\toldMarkCell.revision === undefined && newMarkCell.revision === undefined,\n\t\t\t0x8a0 /* Inconsistent cell ordering */,\n\t\t);\n\t\t// We are composing anonymous changesets in a transaction. The new changeset is creating a cell in a gap\n\t\t// where the old changeset knows of some now empty cell. We order the new cell relative to the old cell in a\n\t\t// way that is consistent with its tie-breaking behavior should the old cell be concurrently re-filled.\n\t\t// Since only tie-break left is supported at the moment, the new cell comes first.\n\t\treturn CellOrder.NewThenOld;\n\t}\n\tif (newChangeKnowsOfOldMarkCellRevision) {\n\t\t// The changeset that contains `newMarkCell` has tombstones for the revision that created `oldMarkCell`,\n\t\t// so a tombstone/mark matching `oldMarkCell` must occur later in the newer changeset.\n\t\treturn CellOrder.NewThenOld;\n\t} else if (oldChangeKnowsOfNewMarkCellRevision) {\n\t\t// The changeset that contains `oldMarkCell` has tombstones for revision that created `newMarkCell`,\n\t\t// so a tombstone/mark matching `newMarkCell` must occur later in the older changeset.\n\t\treturn CellOrder.OldThenNew;\n\t} else {\n\t\t// These cells are only ordered through tie-breaking.\n\t\t// Since tie-breaking is hard-coded to \"merge left\", the younger cell comes first.\n\n\t\t// In the context of compose, an undefined revision means we are composing anonymous changesets into\n\t\t// a transaction, which means the cell from the newer changeset is younger.\n\t\tif (newMarkCell.revision === undefined) {\n\t\t\treturn CellOrder.NewThenOld;\n\t\t}\n\t\t// The only case where the old mark cell should have no revision is when composing anonymous changesets\n\t\t// into a transaction, in which case the new mark cell should also have no revision, which is handled above.\n\t\t// In all other cases, the old mark cell should have a revision.\n\t\tassert(\n\t\t\toldMarkCell.revision !== undefined,\n\t\t\t0x8a1 /* Old mark cell should have a revision */,\n\t\t);\n\n\t\t// Note that these indices are for ordering the revisions in which the cells were named, not the revisions\n\t\t// of the changesets in which the marks targeting these cells appear.\n\t\tconst oldCellRevisionIndex = metadata.getIndex(oldMarkCell.revision);\n\t\tconst newCellRevisionIndex = metadata.getIndex(newMarkCell.revision);\n\n\t\t// If the metadata defines an ordering for the revisions then the cell from the newer revision comes first.\n\t\tif (newCellRevisionIndex !== undefined && oldCellRevisionIndex !== undefined) {\n\t\t\treturn newCellRevisionIndex > oldCellRevisionIndex\n\t\t\t\t? CellOrder.NewThenOld\n\t\t\t\t: CellOrder.OldThenNew;\n\t\t}\n\n\t\tif (newCellRevisionIndex === undefined && oldCellRevisionIndex === undefined) {\n\t\t\t// While it is possible for both marks to refer to cells that were named in revisions that are outside\n\t\t\t// the scope of the metadata, such a scenario should be handled above due to the fact that one of the two\n\t\t\t// changesets should have tombstones or marks for both cells.\n\t\t\t//\n\t\t\t// To see this in the context of rebase, we must consider the lowest common ancestor (LCA) of each change's\n\t\t\t// original (i.e., unrebased) edit with the head of the branch they will both reside on after the rebase.\n\t\t\t// ...─(Ti)─...─(Tj)─...─(old')─(new') <- branch both change will reside on after rebase\n\t\t\t// | └─...─(new)\n\t\t\t// └─...─(old)\n\t\t\t// In the diagram above we can see that by the time `new` is being rebased over `old`, both changesets have\n\t\t\t// been rebased over, and therefore have cell information for, changes `Tj` onwards. This means that one of\n\t\t\t// The two changesets (the `old` one in the diagram above) will have tombstones or marks for any cells that\n\t\t\t// `new` refers to so long as those cells were not created on `new`'s branch.\n\t\t\t// Note that the change that contains the superset of cells (again, ignoring cells created on the other\n\t\t\t// change's branch) is not always the older change. Consider the following scenario:\n\t\t\t// ...─(Ti)─...─(Tj)─...─(old')─(new')\n\t\t\t// | └─...─(old)\n\t\t\t// └─...─(new)\n\t\t\t//\n\t\t\t// The same scenario can arise in the context of compose (just consider composing `old'` and `new'` from\n\t\t\t// the examples above) with the same resolution.\n\t\t\tassert(false, 0x8a2 /* Invalid cell ordering scenario */);\n\t\t}\n\n\t\t// The absence of metadata for a cell with a defined revision means that the cell is from a revision that\n\t\t// predates the edits that are within the scope of the metadata. Such a cell is therefore older than the one\n\t\t// for which we do have metadata.\n\t\treturn oldCellRevisionIndex === undefined ? CellOrder.NewThenOld : CellOrder.OldThenNew;\n\t}\n}\n\n/**\n * @returns the ID of the cell in the output context of the given detach `mark`.\n */\nexport function getDetachOutputCellId(mark: Detach | Rename): ChangeAtomId {\n\tif (isRename(mark)) {\n\t\treturn mark.idOverride;\n\t}\n\tif (mark.idOverride !== undefined) {\n\t\treturn mark.idOverride;\n\t}\n\treturn mark.revision === undefined\n\t\t? { localId: mark.id }\n\t\t: { revision: mark.revision, localId: mark.id };\n}\n\n/**\n * @returns the ID of the detached node in the output context of the given detach `mark`.\n */\nexport function getDetachedNodeId(mark: Detach | Rename): ChangeAtomId {\n\tswitch (mark.type) {\n\t\tcase \"Rename\":\n\t\tcase \"Remove\": {\n\t\t\treturn getDetachOutputCellId(mark);\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\treturn makeChangeAtomId(mark.id, mark.revision);\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(mark);\n\t}\n}\n\n/**\n * Preserves the semantics of the given `mark` but repackages it into a `DetachOfRemovedNodes` when possible.\n */\nexport function normalizeCellRename(\n\tcellId: CellId,\n\tcount: CellCount,\n\tattach: Attach,\n\tdetach: Detach,\n): CellMark<AttachAndDetach | DetachOfRemovedNodes | Rename | NoopMark> {\n\tif (attach.type === \"MoveIn\") {\n\t\tif (detach.type === \"MoveOut\") {\n\t\t\tconst outputId = getDetachOutputCellId(detach);\n\t\t\t// Note that the output ID may be the same as the cellId. In such a scenario,\n\t\t\t// we output an (impact-less) Rename mark anyway (as opposed to a Skip)\n\t\t\t// because the resulting Rename may be rebased over other changes that rename the input cell,\n\t\t\t// eventually leading to an impactful rename.\n\t\t\treturn {\n\t\t\t\ttype: \"Rename\",\n\t\t\t\tcount,\n\t\t\t\tcellId,\n\t\t\t\tidOverride: outputId,\n\t\t\t};\n\t\t}\n\t} else {\n\t\t// Normalization: when the attach is an insert/revive, we rely on the implicit reviving semantics of the\n\t\t// detach instead of using an explicit revive effect in an AttachAndDetach\n\t\treturn {\n\t\t\t...detach,\n\t\t\tcount,\n\t\t\tcellId,\n\t\t};\n\t}\n\treturn {\n\t\ttype: \"AttachAndDetach\",\n\t\tattach,\n\t\tdetach,\n\t\tcount,\n\t\tcellId,\n\t};\n}\n\n/**\n * Preserves the semantics of the given `mark` but repackages it into an `AttachAndDetach` mark if it is not already one.\n */\nexport function asAttachAndDetach(mark: CellMark<CellRename>): CellMark<AttachAndDetach> {\n\tif (mark.type === \"AttachAndDetach\") {\n\t\treturn mark;\n\t}\n\tconst { cellId, count, changes, revision, ...effect } = mark;\n\tconst attachAndDetach: CellMark<AttachAndDetach | Detach> = {\n\t\ttype: \"AttachAndDetach\",\n\t\tcount,\n\t\tcellId,\n\t\tattach: {\n\t\t\ttype: \"Insert\",\n\t\t\tid: mark.id,\n\t\t},\n\t\tdetach: effect,\n\t};\n\tif (changes !== undefined) {\n\t\tattachAndDetach.changes = changes;\n\t}\n\tif (revision !== undefined) {\n\t\tattachAndDetach.attach.revision = revision;\n\t\tattachAndDetach.detach.revision = revision;\n\t}\n\treturn attachAndDetach;\n}\n\nexport function cloneMark<TMark extends Mark>(mark: TMark): TMark {\n\tconst clone: TMark = { ...cloneMarkEffect(mark), count: mark.count };\n\n\tif (mark.cellId !== undefined) {\n\t\tclone.cellId = cloneCellId(mark.cellId);\n\t}\n\treturn clone;\n}\n\nexport function cloneMarkEffect<TEffect extends MarkEffect>(effect: TEffect): TEffect {\n\tconst clone = { ...effect };\n\tif (clone.type === \"AttachAndDetach\") {\n\t\tclone.attach = cloneMarkEffect(clone.attach);\n\t\tclone.detach = cloneMarkEffect(clone.detach);\n\t}\n\treturn clone;\n}\n\nexport function cloneCellId(id: CellId): CellId {\n\tconst cloned = { ...id };\n\treturn cloned;\n}\n\n/**\n * @param mark - The mark to get the length of.\n * @param ignorePairing - When true, the length of a paired mark (e.g. MoveIn/MoveOut) whose matching mark is not active\n * will be treated the same as if the matching mark were active.\n * @returns The number of nodes within the output context of the mark.\n */\nexport function getOutputLength(mark: Mark, ignorePairing: boolean = false): number {\n\treturn areOutputCellsEmpty(mark) ? 0 : mark.count;\n}\n\n/**\n * @param mark - The mark to get the length of.\n * @returns The number of nodes within the input context of the mark.\n */\nexport function getInputLength(mark: Mark): number {\n\treturn areInputCellsEmpty(mark) ? 0 : mark.count;\n}\n\nexport function markEmptiesCells(mark: Mark): boolean {\n\treturn !areInputCellsEmpty(mark) && areOutputCellsEmpty(mark);\n}\n\nexport function markFillsCells(mark: Mark): boolean {\n\treturn areInputCellsEmpty(mark) && !areOutputCellsEmpty(mark);\n}\n\nexport function markHasCellEffect(mark: Mark): boolean {\n\treturn areInputCellsEmpty(mark) !== areOutputCellsEmpty(mark);\n}\n\nexport function isAttachAndDetachEffect(effect: MarkEffect): effect is AttachAndDetach {\n\treturn effect.type === \"AttachAndDetach\";\n}\n\nexport function isDetachOfRemovedNodes(mark: Mark): mark is CellMark<DetachOfRemovedNodes> {\n\treturn isDetach(mark) && mark.cellId !== undefined;\n}\n\nexport function isImpactfulCellRename(mark: Mark): mark is CellMark<CellRename> {\n\treturn (isAttachAndDetachEffect(mark) || isDetachOfRemovedNodes(mark)) && isImpactful(mark);\n}\n\nexport function areInputCellsEmpty(mark: Mark): mark is EmptyInputCellMark {\n\treturn mark.cellId !== undefined;\n}\n\nexport function areOutputCellsEmpty(mark: Mark): boolean {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn mark.cellId !== undefined;\n\t\tcase \"Remove\":\n\t\tcase \"Rename\":\n\t\tcase \"MoveOut\":\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn true;\n\t\tcase \"MoveIn\":\n\t\tcase \"Insert\":\n\t\t\treturn false;\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\n/**\n * Creates a mark that is equivalent to the given `mark` but with effects removed if those have no impact in the input\n * context of that mark.\n *\n * @param mark - The mark to settle. Never mutated.\n * @returns either the original mark or a shallow clone of it with effects stripped out.\n */\nexport function settleMark(mark: Mark): Mark {\n\tif (isImpactful(mark)) {\n\t\treturn mark;\n\t}\n\treturn omitMarkEffect(mark);\n}\n\n/**\n * @returns true, iff the given `mark` would have impact on the field when applied.\n * Ignores the impact of nested changes.\n * CellRename effects are considered impactful if they actually change the ID of the cells.\n */\nexport function isImpactful(mark: Mark): boolean {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn false;\n\t\tcase \"Rename\":\n\t\t\treturn true;\n\t\tcase \"Remove\": {\n\t\t\tconst inputId = getInputCellId(mark);\n\t\t\tif (inputId === undefined) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst outputId = getOutputCellId(mark);\n\t\t\tassert(outputId !== undefined, 0x824 /* Remove marks must have an output cell ID */);\n\t\t\treturn !areEqualChangeAtomIds(inputId, outputId);\n\t\t}\n\t\tcase \"AttachAndDetach\":\n\t\tcase \"MoveOut\":\n\t\t\treturn true;\n\t\tcase \"MoveIn\":\n\t\t\t// MoveIn marks always target an empty cell.\n\t\t\tassert(mark.cellId !== undefined, 0x825 /* MoveIn marks should target empty cells */);\n\t\t\treturn true;\n\t\tcase \"Insert\":\n\t\t\t// A Revive has no impact if the nodes are already in the document.\n\t\t\treturn mark.cellId !== undefined;\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nexport function isTombstone(mark: Mark): mark is CellMark<NoopMark> & { cellId: CellId } {\n\treturn mark.type === NoopMarkType && mark.cellId !== undefined && mark.changes === undefined;\n}\n\nexport function isNoopMark(mark: Mark): mark is CellMark<NoopMark> {\n\treturn mark.type === NoopMarkType;\n}\n\nexport function areOverlappingIdRanges(\n\tid1: ChangesetLocalId,\n\tcount1: number,\n\tid2: ChangesetLocalId,\n\tcount2: number,\n): boolean {\n\tconst lastId1 = (id1 as number) + count1 - 1;\n\tconst lastId2 = (id2 as number) + count2 - 1;\n\treturn (id2 <= id1 && id1 <= lastId2) || (id1 <= id2 && id2 <= lastId1);\n}\n\nexport function compareCellsFromSameRevision(\n\tcell1: CellId,\n\tcount1: number,\n\tcell2: CellId,\n\tcount2: number,\n): number | undefined {\n\tassert(\n\t\tcell1.revision === cell2.revision,\n\t\t0x85b /* Expected cells to have the same revision */,\n\t);\n\tif (areOverlappingIdRanges(cell1.localId, count1, cell2.localId, count2)) {\n\t\treturn cell1.localId - cell2.localId;\n\t}\n\treturn undefined;\n}\n\nexport function isDetach(mark: MarkEffect | undefined): mark is Detach {\n\tconst type = mark?.type;\n\treturn type === \"Remove\" || type === \"MoveOut\";\n}\n\nexport function isRemoveMark(mark: Mark | undefined): mark is CellMark<Remove> {\n\treturn mark?.type === \"Remove\";\n}\n\nfunction areMergeableChangeAtoms(\n\tlhs: ChangeAtomId | undefined,\n\tlhsCount: number,\n\trhs: ChangeAtomId | undefined,\n): boolean {\n\tif (lhs === undefined || rhs === undefined) {\n\t\treturn lhs === undefined && rhs === undefined;\n\t}\n\n\treturn (\n\t\tlhs.revision === rhs.revision && areAdjacentIdRanges(lhs.localId, lhsCount, rhs.localId)\n\t);\n}\n\nfunction areAdjacentIdRanges(\n\tfirstStart: ChangesetLocalId,\n\tfirstLength: number,\n\tsecondStart: ChangesetLocalId,\n): boolean {\n\treturn (firstStart as number) + firstLength === secondStart;\n}\n\nfunction haveMergeableIdOverrides(\n\tlhs: DetachFields,\n\tlhsCount: number,\n\trhs: DetachFields,\n): boolean {\n\tif (lhs.idOverride !== undefined && rhs.idOverride !== undefined) {\n\t\treturn areMergeableCellIds(lhs.idOverride, lhsCount, rhs.idOverride);\n\t}\n\treturn (lhs.idOverride === undefined) === (rhs.idOverride === undefined);\n}\n\nfunction areMergeableCellIds(\n\tlhs: CellId | undefined,\n\tlhsCount: number,\n\trhs: CellId | undefined,\n): boolean {\n\treturn areMergeableChangeAtoms(lhs, lhsCount, rhs);\n}\n\n/**\n * Attempts to extend `lhs` to include the effects of `rhs`.\n * @param lhs - The mark to extend.\n * @param rhs - The effect so extend `rhs` with.\n * @returns `lhs` iff the function was able to mutate `lhs` to include the effects of `rhs`.\n * When `undefined` is returned, `lhs` is left untouched.\n */\nexport function tryMergeMarks(lhs: Mark, rhs: Readonly<Mark>): Mark | undefined {\n\tif (rhs.type !== lhs.type) {\n\t\treturn undefined;\n\t}\n\n\tif (!areMergeableCellIds(lhs.cellId, lhs.count, rhs.cellId)) {\n\t\treturn undefined;\n\t}\n\n\tif (rhs.changes !== undefined || lhs.changes !== undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst mergedEffect = tryMergeEffects(lhs, rhs, lhs.count);\n\tif (mergedEffect === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn { ...lhs, ...mergedEffect, count: lhs.count + rhs.count };\n}\n\nfunction tryMergeEffects(\n\tlhs: MarkEffect,\n\trhs: MarkEffect,\n\tlhsCount: number,\n): MarkEffect | undefined {\n\tif (lhs.type !== rhs.type) {\n\t\treturn undefined;\n\t}\n\n\tif (rhs.type === NoopMarkType) {\n\t\treturn lhs;\n\t}\n\n\tif (rhs.type === \"AttachAndDetach\") {\n\t\tconst lhsAttachAndDetach = lhs as AttachAndDetach;\n\t\tconst attach = tryMergeEffects(lhsAttachAndDetach.attach, rhs.attach, lhsCount);\n\t\tconst detach = tryMergeEffects(lhsAttachAndDetach.detach, rhs.detach, lhsCount);\n\t\tif (attach === undefined || detach === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tassert(\n\t\t\tisAttach(attach) && isDetach(detach),\n\t\t\t0x826 /* Merged marks should be same type as input marks */,\n\t\t);\n\t\treturn { ...lhsAttachAndDetach, attach, detach };\n\t}\n\n\tif (\n\t\t(lhs as Partial<HasRevisionTag>).revision !== (rhs as Partial<HasRevisionTag>).revision\n\t) {\n\t\treturn undefined;\n\t}\n\n\tif (isDetach(lhs) && isDetach(rhs) && !haveMergeableIdOverrides(lhs, lhsCount, rhs)) {\n\t\treturn undefined;\n\t}\n\n\tconst type = rhs.type;\n\tswitch (type) {\n\t\tcase \"MoveIn\": {\n\t\t\tconst lhsMoveIn = lhs as MoveIn;\n\t\t\tif (\n\t\t\t\t(lhsMoveIn.id as number) + lhsCount === rhs.id &&\n\t\t\t\tareMergeableChangeAtoms(lhsMoveIn.finalEndpoint, lhsCount, rhs.finalEndpoint)\n\t\t\t) {\n\t\t\t\treturn lhsMoveIn;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tconst lhsDetach = lhs as Remove;\n\t\t\tif (\n\t\t\t\t(lhsDetach.id as number) + lhsCount === rhs.id &&\n\t\t\t\thaveMergeableIdOverrides(lhsDetach, lhsCount, rhs)\n\t\t\t) {\n\t\t\t\treturn lhsDetach;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Rename\": {\n\t\t\tconst lhsDetach = lhs as Rename;\n\t\t\tif (haveMergeableIdOverrides(lhsDetach, lhsCount, rhs)) {\n\t\t\t\treturn lhsDetach;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\tconst lhsMoveOut = lhs as MoveOut;\n\t\t\tif (\n\t\t\t\t(lhsMoveOut.id as number) + lhsCount === rhs.id &&\n\t\t\t\thaveMergeableIdOverrides(lhsMoveOut, lhsCount, rhs) &&\n\t\t\t\tareMergeableChangeAtoms(lhsMoveOut.finalEndpoint, lhsCount, rhs.finalEndpoint)\n\t\t\t) {\n\t\t\t\treturn lhsMoveOut;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Insert\": {\n\t\t\tconst lhsInsert = lhs as Insert;\n\t\t\tif ((lhsInsert.id as number) + lhsCount === rhs.id) {\n\t\t\t\treturn lhsInsert;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Splits the `mark` into two marks such that the first returned mark has length `length`.\n * @param mark - The mark to split.\n * @param revision - The revision of the changeset the mark is part of.\n * @param length - The desired length for the first of the two returned marks.\n * @param genId - An ID allocator\n * @param moveEffects - The table in which to record splitting of move marks\n * @param recordMoveEffect - Whether when splitting a move an entry should be added to `moveEffects` indicating that the mark should be split (in case we process this mark again).\n * An entry is always added to `moveEffects` indicating that the opposite end of the move should be split.\n * @returns A pair of marks equivalent to the original `mark`\n * such that the first returned mark has input length `length`.\n */\nexport function splitMark<TMark extends Mark>(mark: TMark, length: number): [TMark, TMark] {\n\tconst markLength = mark.count;\n\tconst remainder = markLength - length;\n\tif (length < 1 || remainder < 1) {\n\t\tfail(\"Unable to split mark due to lengths\");\n\t}\n\n\tconst [effect1, effect2] = splitMarkEffect(mark, length);\n\tconst mark1 = { ...mark, ...effect1, count: length };\n\tconst mark2 = { ...mark, ...effect2, count: remainder };\n\tif (mark2.cellId !== undefined) {\n\t\tmark2.cellId = splitDetachEvent(mark2.cellId, length);\n\t}\n\n\treturn [mark1, mark2];\n}\n\nexport function splitMarkEffect<TEffect extends MarkEffect>(\n\teffect: TEffect,\n\tlength: number,\n): [TEffect, TEffect] {\n\tconst type = effect.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn [effect, effect];\n\t\tcase \"Insert\": {\n\t\t\tconst effect1: TEffect = {\n\t\t\t\t...effect,\n\t\t\t};\n\t\t\tconst effect2: TEffect = {\n\t\t\t\t...effect,\n\t\t\t\tid: (effect.id as number) + length,\n\t\t\t};\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"MoveIn\": {\n\t\t\tconst effect2: TEffect = { ...effect, id: (effect.id as number) + length };\n\t\t\tconst move2 = effect2 as MoveIn;\n\t\t\tif (move2.finalEndpoint !== undefined) {\n\t\t\t\tmove2.finalEndpoint = splitDetachEvent(move2.finalEndpoint, length);\n\t\t\t}\n\t\t\treturn [effect, effect2];\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tconst effect1 = { ...effect };\n\t\t\tconst id2: ChangesetLocalId = brand((effect.id as number) + length);\n\t\t\tconst effect2 = { ...effect, id: id2 };\n\t\t\tconst effect2Remove = effect2 as Mutable<Remove>;\n\t\t\tif (effect2Remove.idOverride !== undefined) {\n\t\t\t\teffect2Remove.idOverride = splitDetachEvent(effect2Remove.idOverride, length);\n\t\t\t}\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"Rename\": {\n\t\t\tconst effect1 = { ...effect };\n\t\t\tconst effect2 = { ...effect };\n\t\t\tconst effect2Rename = effect2 as Mutable<Rename>;\n\t\t\tif (effect2Rename.idOverride !== undefined) {\n\t\t\t\teffect2Rename.idOverride = splitDetachEvent(effect2Rename.idOverride, length);\n\t\t\t}\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\tconst effect2 = {\n\t\t\t\t...effect,\n\t\t\t\tid: (effect.id as number) + length,\n\t\t\t};\n\n\t\t\tconst return2 = effect2 as Mutable<MoveOut>;\n\n\t\t\tif (return2.idOverride !== undefined) {\n\t\t\t\treturn2.idOverride = splitDetachEvent(return2.idOverride, length);\n\t\t\t}\n\n\t\t\tif (return2.finalEndpoint !== undefined) {\n\t\t\t\treturn2.finalEndpoint = splitDetachEvent(return2.finalEndpoint, length);\n\t\t\t}\n\t\t\treturn [effect, effect2];\n\t\t}\n\t\tcase \"AttachAndDetach\": {\n\t\t\tconst [attach1, attach2] = splitMarkEffect(effect.attach, length);\n\t\t\tconst [detach1, detach2] = splitMarkEffect(effect.detach, length);\n\t\t\tconst effect1 = {\n\t\t\t\t...effect,\n\t\t\t\tattach: attach1,\n\t\t\t\tdetach: detach1,\n\t\t\t};\n\n\t\t\tconst effect2 = {\n\t\t\t\t...effect,\n\t\t\t\tattach: attach2,\n\t\t\t\tdetach: detach2,\n\t\t\t};\n\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nfunction splitDetachEvent(detachEvent: CellId, length: number): CellId {\n\treturn { ...detachEvent, localId: brand((detachEvent.localId as number) + length) };\n}\n\n// TODO: Refactor MarkEffect into a field of CellMark so this function isn't necessary.\nexport function extractMarkEffect<TEffect extends MarkEffect>(\n\tmark: CellMark<TEffect>,\n): TEffect {\n\tconst { cellId: _cellId, count: _count, changes: _changes, ...effect } = mark;\n\treturn effect as unknown as TEffect;\n}\n\n// TODO: Refactor MarkEffect into a field of CellMark so this function isn't necessary.\nexport function omitMarkEffect(mark: CellMark<unknown>): CellMark<NoopMark> {\n\tconst { cellId, count, changes } = mark;\n\tconst noopMark: CellMark<NoopMark> = { count };\n\tif (cellId !== undefined) {\n\t\tnoopMark.cellId = cellId;\n\t}\n\tif (changes !== undefined) {\n\t\tnoopMark.changes = changes;\n\t}\n\treturn noopMark;\n}\n\nexport function withNodeChange<TMark extends CellMark<TKind>, TKind extends MarkEffect>(\n\tmark: TMark,\n\tchanges: NodeId | undefined,\n): TMark {\n\tconst newMark = { ...mark };\n\tif (changes !== undefined) {\n\t\tnewMark.changes = changes;\n\t} else {\n\t\tdelete newMark.changes;\n\t}\n\treturn newMark;\n}\n\nexport function withRevision<TMark extends Mark>(\n\tmark: TMark,\n\trevision: RevisionTag | undefined,\n): TMark {\n\tif (revision === undefined) {\n\t\treturn mark;\n\t}\n\n\tconst cloned = cloneMark(mark);\n\taddRevision(cloned, revision);\n\tif (\n\t\tcloned.cellId !== undefined &&\n\t\tcloned.cellId.revision === undefined &&\n\t\trevision !== undefined\n\t) {\n\t\t(cloned.cellId as Mutable<CellId>).revision = revision;\n\t}\n\treturn cloned;\n}\n\nfunction addRevision(effect: MarkEffect, revision: RevisionTag): void {\n\tif (effect.type === NoopMarkType || isRename(effect)) {\n\t\treturn;\n\t}\n\n\tif (effect.type === \"AttachAndDetach\") {\n\t\taddRevision(effect.attach, revision);\n\t\taddRevision(effect.detach, revision);\n\t\treturn;\n\t}\n\n\tassert(\n\t\teffect.revision === undefined || effect.revision === revision,\n\t\t0x829 /* Should not overwrite mark revision */,\n\t);\n\teffect.revision = revision;\n}\n\nexport function getEndpoint(effect: MoveMarkEffect): ChangeAtomId {\n\treturn effect.finalEndpoint ?? { revision: effect.revision, localId: effect.id };\n}\n\nexport function getCrossFieldKeys(change: Changeset): CrossFieldKeyRange[] {\n\tconst keys: CrossFieldKeyRange[] = [];\n\tfor (const mark of change) {\n\t\tkeys.push(...getCrossFieldKeysForMarkEffect(mark, mark.count));\n\t}\n\n\treturn keys;\n}\n\nfunction getCrossFieldKeysForMarkEffect(\n\teffect: MarkEffect,\n\tcount: number,\n): CrossFieldKeyRange[] {\n\tswitch (effect.type) {\n\t\tcase \"Insert\":\n\t\t\t// An insert behaves like a move where the source and destination are at the same location.\n\t\t\t// An insert can become a move when after rebasing.\n\t\t\treturn [\n\t\t\t\t[CrossFieldTarget.Source, effect.revision, effect.id, count],\n\t\t\t\t[CrossFieldTarget.Destination, effect.revision, effect.id, count],\n\t\t\t];\n\t\tcase \"MoveOut\":\n\t\t\treturn [[CrossFieldTarget.Source, effect.revision, effect.id, count]];\n\t\tcase \"MoveIn\":\n\t\t\treturn [[CrossFieldTarget.Destination, effect.revision, effect.id, count]];\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn [\n\t\t\t\t...getCrossFieldKeysForMarkEffect(effect.attach, count),\n\t\t\t\t...getCrossFieldKeysForMarkEffect(effect.detach, count),\n\t\t\t];\n\t\tdefault:\n\t\t\treturn [];\n\t}\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EAKN,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAgB,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACN,gBAAgB,GAIhB,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EAeN,YAAY,GAIZ,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,OAAO,CAAC,MAAiB;IACxC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CA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IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,8BAA8B,CACtC,MAAkB,EAClB,KAAa;IAEb,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,QAAQ;YACZ,2FAA2F;YAC3F,mDAAmD;YACnD,OAAO;gBACN,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC;gBAC5D,CAAC,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC;aACjE,CAAC;QACH,KAAK,SAAS;YACb,OAAO,CAAC,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;QACvE,KAAK,QAAQ;YACZ,OAAO,CAAC,CAAC,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;QAC5E,KAAK,iBAAiB;YACrB,OAAO;gBACN,GAAG,8BAA8B,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;gBACvD,GAAG,8BAA8B,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;aACvD,CAAC;QACH;YACC,OAAO,EAAE,CAAC;IACZ,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype ChangesetLocalId,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\tareEqualChangeAtomIdOpts,\n\tareEqualChangeAtomIds,\n\tmakeChangeAtomId,\n} from \"../../core/index.js\";\nimport { type Mutable, brand, fail } from \"../../util/index.js\";\nimport {\n\tCrossFieldTarget,\n\ttype NodeId,\n\ttype CrossFieldKeyRange,\n\ttype NestedChangesIndices,\n} from \"../modular-schema/index.js\";\n\nimport type {\n\tCellRename,\n\tDetachOfRemovedNodes,\n\tEmptyInputCellMark,\n\tMoveMarkEffect,\n} from \"./helperTypes.js\";\nimport {\n\ttype Attach,\n\ttype AttachAndDetach,\n\ttype CellId,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype DetachFields,\n\ttype HasRevisionTag,\n\ttype Insert,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MoveIn,\n\ttype MoveOut,\n\ttype NoopMark,\n\tNoopMarkType,\n\ttype Remove,\n\ttype CellCount,\n\ttype Rename,\n} from \"./types.js\";\n\nexport function isEmpty(change: Changeset): boolean {\n\tfor (const mark of change) {\n\t\tif (mark.changes !== undefined || mark.type !== undefined) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function createEmpty(): Changeset {\n\treturn [];\n}\n\nexport function getNestedChanges(change: Changeset): NestedChangesIndices {\n\tconst output: NestedChangesIndices = [];\n\tlet inputIndex = 0;\n\tlet outputIndex = 0;\n\tfor (const mark of change) {\n\t\tconst { changes, count } = mark;\n\t\tif (changes !== undefined) {\n\t\t\toutput.push([\n\t\t\t\tchanges,\n\t\t\t\t!areInputCellsEmpty(mark) ? inputIndex : undefined /* inputIndex */,\n\t\t\t\t!areOutputCellsEmpty(mark) ? outputIndex : undefined /* outputIndex */,\n\t\t\t]);\n\t\t}\n\t\tif (!areInputCellsEmpty(mark)) {\n\t\t\tinputIndex += count;\n\t\t}\n\n\t\tif (!areOutputCellsEmpty(mark)) {\n\t\t\toutputIndex += count;\n\t\t}\n\t}\n\treturn output;\n}\n\nexport function isNewAttach(mark: Mark, revision?: RevisionTag): boolean {\n\treturn isNewAttachEffect(mark, mark.cellId, revision);\n}\n\nexport function isNewAttachEffect(\n\teffect: MarkEffect,\n\tcellId: CellId | undefined,\n\trevision?: RevisionTag,\n): boolean {\n\treturn (\n\t\t(isAttach(effect) &&\n\t\t\tcellId !== undefined &&\n\t\t\t(effect.revision ?? revision) === (cellId.revision ?? revision)) ||\n\t\t(isAttachAndDetachEffect(effect) && isNewAttachEffect(effect.attach, cellId, revision))\n\t);\n}\n\nexport function isRename(mark: MarkEffect): mark is Rename {\n\treturn mark.type === \"Rename\";\n}\n\nexport function isInsert(mark: MarkEffect): mark is Insert {\n\treturn mark.type === \"Insert\";\n}\n\nexport function isAttach(effect: MarkEffect): effect is Attach {\n\treturn effect.type === \"Insert\" || effect.type === \"MoveIn\";\n}\n\nexport function isReattach(mark: Mark): boolean {\n\treturn isReattachEffect(mark, mark.cellId);\n}\n\nexport function isReattachEffect(effect: MarkEffect, cellId: CellId | undefined): boolean {\n\treturn isAttach(effect) && !isNewAttachEffect(effect, cellId);\n}\n\nexport function isActiveReattach(\n\tmark: Mark,\n): mark is CellMark<Insert> & { conflictsWith?: undefined } {\n\treturn isAttach(mark) && isReattachEffect(mark, mark.cellId) && mark.cellId !== undefined;\n}\n\nexport function areEqualCellIds(a: CellId | undefined, b: CellId | undefined): boolean {\n\treturn areEqualChangeAtomIdOpts(a, b);\n}\n\nexport function getInputCellId(mark: Mark): CellId | undefined {\n\treturn mark.cellId;\n}\n\nexport function getOutputCellId(mark: Mark): CellId | undefined {\n\tif (isDetach(mark) || isRename(mark)) {\n\t\treturn getDetachOutputCellId(mark);\n\t} else if (markFillsCells(mark)) {\n\t\treturn undefined;\n\t} else if (isAttachAndDetachEffect(mark)) {\n\t\treturn getDetachOutputCellId(mark.detach);\n\t}\n\n\treturn getInputCellId(mark);\n}\n\nexport function cellSourcesFromMarks(\n\tmarks: readonly Mark[],\n\tcontextGetter: typeof getInputCellId | typeof getOutputCellId,\n): Set<RevisionTag | undefined> {\n\tconst set = new Set<RevisionTag | undefined>();\n\tfor (const mark of marks) {\n\t\tconst cell = contextGetter(mark);\n\t\tif (cell !== undefined) {\n\t\t\tset.add(cell.revision);\n\t\t}\n\t}\n\treturn set;\n}\n\nexport enum CellOrder {\n\tSameCell,\n\tOldThenNew,\n\tNewThenOld,\n}\n\n/**\n * Determines the order of two cells from two changesets.\n *\n * This function makes the following assumptions:\n * 1. The cells represent the same context.\n * 2. `oldMarkCell` is from a mark in a changeset that is older than the changeset that contains the mark that\n * `newMarkCell` is from.\n * 3. In terms of sequence index, all cells located before A are also located before B,\n * and all cells located before B are also located before A.\n * 4. If a changeset has a mark/tombstone that describes a cell named in some revision R,\n * then that changeset must contain marks/tombstones for all cells named in R as well as all cells named in later\n * revisions up to its own.\n * 5. If a changeset foo is rebased over a changeset bar, then the rebased version of foo must contain tombstones or\n * marks for all cells referenced or named in bar. It has yet to be determined whether this assumption is necessary\n * for the logic below.\n *\n * @param oldMarkCell - The cell referenced or named by a mark or tombstone from the older changeset.\n * @param newMarkCell - The cell referenced or named by a mark or tombstone from the newer changeset.\n * @param oldChangeKnowledge - The set of revisions that the older changeset has cell representations for.\n * @param newChangeKnowledge - The set of revisions that the newer changeset has cell representations for.\n * @param metadata - Revision metadata for the operation being carried out.\n * @returns a {@link CellOrder} which describes how the cells are ordered relative to one-another.\n */\nexport function compareCellPositionsUsingTombstones(\n\toldMarkCell: ChangeAtomId,\n\tnewMarkCell: ChangeAtomId,\n\toldChangeKnowledge: ReadonlySet<RevisionTag | undefined>,\n\tnewChangeKnowledge: ReadonlySet<RevisionTag | undefined>,\n\tmetadata: RevisionMetadataSource,\n): CellOrder {\n\tif (areEqualChangeAtomIds(oldMarkCell, newMarkCell)) {\n\t\treturn CellOrder.SameCell;\n\t}\n\tconst oldChangeKnowsOfNewMarkCellRevision = oldChangeKnowledge.has(newMarkCell.revision);\n\tconst newChangeKnowsOfOldMarkCellRevision = newChangeKnowledge.has(oldMarkCell.revision);\n\tif (oldChangeKnowsOfNewMarkCellRevision && newChangeKnowsOfOldMarkCellRevision) {\n\t\t// If both changesets know of both cells, but we've been asked to compare different cells,\n\t\t// Then either the changesets they originate from do not represent the same context,\n\t\t// or the ordering of their cells in inconsistent.\n\t\t// The only exception to this is when we're composing anonymous changesets in a transaction.\n\t\tassert(\n\t\t\toldMarkCell.revision === undefined && newMarkCell.revision === undefined,\n\t\t\t0x8a0 /* Inconsistent cell ordering */,\n\t\t);\n\t\t// We are composing anonymous changesets in a transaction. The new changeset is creating a cell in a gap\n\t\t// where the old changeset knows of some now empty cell. We order the new cell relative to the old cell in a\n\t\t// way that is consistent with its tie-breaking behavior should the old cell be concurrently re-filled.\n\t\t// Since only tie-break left is supported at the moment, the new cell comes first.\n\t\treturn CellOrder.NewThenOld;\n\t}\n\tif (newChangeKnowsOfOldMarkCellRevision) {\n\t\t// The changeset that contains `newMarkCell` has tombstones for the revision that created `oldMarkCell`,\n\t\t// so a tombstone/mark matching `oldMarkCell` must occur later in the newer changeset.\n\t\treturn CellOrder.NewThenOld;\n\t} else if (oldChangeKnowsOfNewMarkCellRevision) {\n\t\t// The changeset that contains `oldMarkCell` has tombstones for revision that created `newMarkCell`,\n\t\t// so a tombstone/mark matching `newMarkCell` must occur later in the older changeset.\n\t\treturn CellOrder.OldThenNew;\n\t} else {\n\t\t// These cells are only ordered through tie-breaking.\n\t\t// Since tie-breaking is hard-coded to \"merge left\", the younger cell comes first.\n\n\t\t// In the context of compose, an undefined revision means we are composing anonymous changesets into\n\t\t// a transaction, which means the cell from the newer changeset is younger.\n\t\tif (newMarkCell.revision === undefined) {\n\t\t\treturn CellOrder.NewThenOld;\n\t\t}\n\t\t// The only case where the old mark cell should have no revision is when composing anonymous changesets\n\t\t// into a transaction, in which case the new mark cell should also have no revision, which is handled above.\n\t\t// In all other cases, the old mark cell should have a revision.\n\t\tassert(\n\t\t\toldMarkCell.revision !== undefined,\n\t\t\t0x8a1 /* Old mark cell should have a revision */,\n\t\t);\n\n\t\t// Note that these indices are for ordering the revisions in which the cells were named, not the revisions\n\t\t// of the changesets in which the marks targeting these cells appear.\n\t\tconst oldCellRevisionIndex = metadata.getIndex(oldMarkCell.revision);\n\t\tconst newCellRevisionIndex = metadata.getIndex(newMarkCell.revision);\n\n\t\t// If the metadata defines an ordering for the revisions then the cell from the newer revision comes first.\n\t\tif (newCellRevisionIndex !== undefined && oldCellRevisionIndex !== undefined) {\n\t\t\treturn newCellRevisionIndex > oldCellRevisionIndex\n\t\t\t\t? CellOrder.NewThenOld\n\t\t\t\t: CellOrder.OldThenNew;\n\t\t}\n\n\t\tif (newCellRevisionIndex === undefined && oldCellRevisionIndex === undefined) {\n\t\t\t// While it is possible for both marks to refer to cells that were named in revisions that are outside\n\t\t\t// the scope of the metadata, such a scenario should be handled above due to the fact that one of the two\n\t\t\t// changesets should have tombstones or marks for both cells.\n\t\t\t//\n\t\t\t// To see this in the context of rebase, we must consider the lowest common ancestor (LCA) of each change's\n\t\t\t// original (i.e., unrebased) edit with the head of the branch they will both reside on after the rebase.\n\t\t\t// ...─(Ti)─...─(Tj)─...─(old')─(new') <- branch both change will reside on after rebase\n\t\t\t// | └─...─(new)\n\t\t\t// └─...─(old)\n\t\t\t// In the diagram above we can see that by the time `new` is being rebased over `old`, both changesets have\n\t\t\t// been rebased over, and therefore have cell information for, changes `Tj` onwards. This means that one of\n\t\t\t// The two changesets (the `old` one in the diagram above) will have tombstones or marks for any cells that\n\t\t\t// `new` refers to so long as those cells were not created on `new`'s branch.\n\t\t\t// Note that the change that contains the superset of cells (again, ignoring cells created on the other\n\t\t\t// change's branch) is not always the older change. Consider the following scenario:\n\t\t\t// ...─(Ti)─...─(Tj)─...─(old')─(new')\n\t\t\t// | └─...─(old)\n\t\t\t// └─...─(new)\n\t\t\t//\n\t\t\t// The same scenario can arise in the context of compose (just consider composing `old'` and `new'` from\n\t\t\t// the examples above) with the same resolution.\n\t\t\tassert(false, 0x8a2 /* Invalid cell ordering scenario */);\n\t\t}\n\n\t\t// The absence of metadata for a cell with a defined revision means that the cell is from a revision that\n\t\t// predates the edits that are within the scope of the metadata. Such a cell is therefore older than the one\n\t\t// for which we do have metadata.\n\t\treturn oldCellRevisionIndex === undefined ? CellOrder.NewThenOld : CellOrder.OldThenNew;\n\t}\n}\n\n/**\n * @returns the ID of the cell in the output context of the given detach `mark`.\n */\nexport function getDetachOutputCellId(mark: Detach | Rename): ChangeAtomId {\n\tif (isRename(mark)) {\n\t\treturn mark.idOverride;\n\t}\n\tif (mark.idOverride !== undefined) {\n\t\treturn mark.idOverride;\n\t}\n\treturn mark.revision === undefined\n\t\t? { localId: mark.id }\n\t\t: { revision: mark.revision, localId: mark.id };\n}\n\n/**\n * @returns the ID of the detached node in the output context of the given detach `mark`.\n */\nexport function getDetachedNodeId(mark: Detach | Rename): ChangeAtomId {\n\tswitch (mark.type) {\n\t\tcase \"Rename\":\n\t\tcase \"Remove\": {\n\t\t\treturn getDetachOutputCellId(mark);\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\treturn makeChangeAtomId(mark.id, mark.revision);\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(mark);\n\t}\n}\n\n/**\n * Preserves the semantics of the given `mark` but repackages it into a `DetachOfRemovedNodes` when possible.\n */\nexport function normalizeCellRename(\n\tcellId: CellId,\n\tcount: CellCount,\n\tattach: Attach,\n\tdetach: Detach,\n): CellMark<AttachAndDetach | DetachOfRemovedNodes | Rename | NoopMark> {\n\tif (attach.type === \"MoveIn\") {\n\t\tif (detach.type === \"MoveOut\") {\n\t\t\tconst outputId = getDetachOutputCellId(detach);\n\t\t\t// Note that the output ID may be the same as the cellId. In such a scenario,\n\t\t\t// we output an (impact-less) Rename mark anyway (as opposed to a Skip)\n\t\t\t// because the resulting Rename may be rebased over other changes that rename the input cell,\n\t\t\t// eventually leading to an impactful rename.\n\t\t\treturn {\n\t\t\t\ttype: \"Rename\",\n\t\t\t\tcount,\n\t\t\t\tcellId,\n\t\t\t\tidOverride: outputId,\n\t\t\t};\n\t\t}\n\t} else {\n\t\t// Normalization: when the attach is an insert/revive, we rely on the implicit reviving semantics of the\n\t\t// detach instead of using an explicit revive effect in an AttachAndDetach\n\t\treturn {\n\t\t\t...detach,\n\t\t\tcount,\n\t\t\tcellId,\n\t\t};\n\t}\n\treturn {\n\t\ttype: \"AttachAndDetach\",\n\t\tattach,\n\t\tdetach,\n\t\tcount,\n\t\tcellId,\n\t};\n}\n\n/**\n * Preserves the semantics of the given `mark` but repackages it into an `AttachAndDetach` mark if it is not already one.\n */\nexport function asAttachAndDetach(mark: CellMark<CellRename>): CellMark<AttachAndDetach> {\n\tif (mark.type === \"AttachAndDetach\") {\n\t\treturn mark;\n\t}\n\tconst { cellId, count, changes, revision, ...effect } = mark;\n\tconst attachAndDetach: CellMark<AttachAndDetach | Detach> = {\n\t\ttype: \"AttachAndDetach\",\n\t\tcount,\n\t\tcellId,\n\t\tattach: {\n\t\t\ttype: \"Insert\",\n\t\t\tid: mark.id,\n\t\t},\n\t\tdetach: effect,\n\t};\n\tif (changes !== undefined) {\n\t\tattachAndDetach.changes = changes;\n\t}\n\tif (revision !== undefined) {\n\t\tattachAndDetach.attach.revision = revision;\n\t\tattachAndDetach.detach.revision = revision;\n\t}\n\treturn attachAndDetach;\n}\n\nexport function cloneMark<TMark extends Mark>(mark: TMark): TMark {\n\tconst clone: TMark = { ...cloneMarkEffect(mark), count: mark.count };\n\n\tif (mark.cellId !== undefined) {\n\t\tclone.cellId = cloneCellId(mark.cellId);\n\t}\n\treturn clone;\n}\n\nexport function cloneMarkEffect<TEffect extends MarkEffect>(effect: TEffect): TEffect {\n\tconst clone = { ...effect };\n\tif (clone.type === \"AttachAndDetach\") {\n\t\tclone.attach = cloneMarkEffect(clone.attach);\n\t\tclone.detach = cloneMarkEffect(clone.detach);\n\t}\n\treturn clone;\n}\n\nexport function cloneCellId(id: CellId): CellId {\n\tconst cloned = { ...id };\n\treturn cloned;\n}\n\n/**\n * @param mark - The mark to get the length of.\n * @param ignorePairing - When true, the length of a paired mark (e.g. MoveIn/MoveOut) whose matching mark is not active\n * will be treated the same as if the matching mark were active.\n * @returns The number of nodes within the output context of the mark.\n */\nexport function getOutputLength(mark: Mark, ignorePairing: boolean = false): number {\n\treturn areOutputCellsEmpty(mark) ? 0 : mark.count;\n}\n\n/**\n * @param mark - The mark to get the length of.\n * @returns The number of nodes within the input context of the mark.\n */\nexport function getInputLength(mark: Mark): number {\n\treturn areInputCellsEmpty(mark) ? 0 : mark.count;\n}\n\nexport function markEmptiesCells(mark: Mark): boolean {\n\treturn !areInputCellsEmpty(mark) && areOutputCellsEmpty(mark);\n}\n\nexport function markFillsCells(mark: Mark): boolean {\n\treturn areInputCellsEmpty(mark) && !areOutputCellsEmpty(mark);\n}\n\nexport function markHasCellEffect(mark: Mark): boolean {\n\treturn areInputCellsEmpty(mark) !== areOutputCellsEmpty(mark);\n}\n\nexport function isAttachAndDetachEffect(effect: MarkEffect): effect is AttachAndDetach {\n\treturn effect.type === \"AttachAndDetach\";\n}\n\nexport function isDetachOfRemovedNodes(mark: Mark): mark is CellMark<DetachOfRemovedNodes> {\n\treturn isDetach(mark) && mark.cellId !== undefined;\n}\n\nexport function isImpactfulCellRename(mark: Mark): mark is CellMark<CellRename> {\n\treturn (isAttachAndDetachEffect(mark) || isDetachOfRemovedNodes(mark)) && isImpactful(mark);\n}\n\nexport function areInputCellsEmpty(mark: Mark): mark is EmptyInputCellMark {\n\treturn mark.cellId !== undefined;\n}\n\nexport function areOutputCellsEmpty(mark: Mark): boolean {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn mark.cellId !== undefined;\n\t\tcase \"Remove\":\n\t\tcase \"Rename\":\n\t\tcase \"MoveOut\":\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn true;\n\t\tcase \"MoveIn\":\n\t\tcase \"Insert\":\n\t\t\treturn false;\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\n/**\n * Creates a mark that is equivalent to the given `mark` but with effects removed if those have no impact in the input\n * context of that mark.\n *\n * @param mark - The mark to settle. Never mutated.\n * @returns either the original mark or a shallow clone of it with effects stripped out.\n */\nexport function settleMark(mark: Mark): Mark {\n\tif (isImpactful(mark)) {\n\t\treturn mark;\n\t}\n\treturn omitMarkEffect(mark);\n}\n\n/**\n * @returns true, iff the given `mark` would have impact on the field when applied.\n * Ignores the impact of nested changes.\n * CellRename effects are considered impactful if they actually change the ID of the cells.\n */\nexport function isImpactful(mark: Mark): boolean {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn false;\n\t\tcase \"Rename\":\n\t\t\treturn true;\n\t\tcase \"Remove\": {\n\t\t\tconst inputId = getInputCellId(mark);\n\t\t\tif (inputId === undefined) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst outputId = getOutputCellId(mark);\n\t\t\tassert(outputId !== undefined, 0x824 /* Remove marks must have an output cell ID */);\n\t\t\treturn !areEqualChangeAtomIds(inputId, outputId);\n\t\t}\n\t\tcase \"AttachAndDetach\":\n\t\tcase \"MoveOut\":\n\t\t\treturn true;\n\t\tcase \"MoveIn\":\n\t\t\t// MoveIn marks always target an empty cell.\n\t\t\tassert(mark.cellId !== undefined, 0x825 /* MoveIn marks should target empty cells */);\n\t\t\treturn true;\n\t\tcase \"Insert\":\n\t\t\t// A Revive has no impact if the nodes are already in the document.\n\t\t\treturn mark.cellId !== undefined;\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nexport function isTombstone(mark: Mark): mark is CellMark<NoopMark> & { cellId: CellId } {\n\treturn mark.type === NoopMarkType && mark.cellId !== undefined && mark.changes === undefined;\n}\n\nexport function isNoopMark(mark: Mark): mark is CellMark<NoopMark> {\n\treturn mark.type === NoopMarkType;\n}\n\nexport function areOverlappingIdRanges(\n\tid1: ChangesetLocalId,\n\tcount1: number,\n\tid2: ChangesetLocalId,\n\tcount2: number,\n): boolean {\n\tconst lastId1 = (id1 as number) + count1 - 1;\n\tconst lastId2 = (id2 as number) + count2 - 1;\n\treturn (id2 <= id1 && id1 <= lastId2) || (id1 <= id2 && id2 <= lastId1);\n}\n\nexport function compareCellsFromSameRevision(\n\tcell1: CellId,\n\tcount1: number,\n\tcell2: CellId,\n\tcount2: number,\n): number | undefined {\n\tassert(\n\t\tcell1.revision === cell2.revision,\n\t\t0x85b /* Expected cells to have the same revision */,\n\t);\n\tif (areOverlappingIdRanges(cell1.localId, count1, cell2.localId, count2)) {\n\t\treturn cell1.localId - cell2.localId;\n\t}\n\treturn undefined;\n}\n\nexport function isDetach(mark: MarkEffect | undefined): mark is Detach {\n\tconst type = mark?.type;\n\treturn type === \"Remove\" || type === \"MoveOut\";\n}\n\nexport function isRemoveMark(mark: Mark | undefined): mark is CellMark<Remove> {\n\treturn mark?.type === \"Remove\";\n}\n\nfunction areMergeableChangeAtoms(\n\tlhs: ChangeAtomId | undefined,\n\tlhsCount: number,\n\trhs: ChangeAtomId | undefined,\n): boolean {\n\tif (lhs === undefined || rhs === undefined) {\n\t\treturn lhs === undefined && rhs === undefined;\n\t}\n\n\treturn (\n\t\tlhs.revision === rhs.revision && areAdjacentIdRanges(lhs.localId, lhsCount, rhs.localId)\n\t);\n}\n\nfunction areAdjacentIdRanges(\n\tfirstStart: ChangesetLocalId,\n\tfirstLength: number,\n\tsecondStart: ChangesetLocalId,\n): boolean {\n\treturn (firstStart as number) + firstLength === secondStart;\n}\n\nfunction haveMergeableIdOverrides(\n\tlhs: DetachFields,\n\tlhsCount: number,\n\trhs: DetachFields,\n): boolean {\n\tif (lhs.idOverride !== undefined && rhs.idOverride !== undefined) {\n\t\treturn areMergeableCellIds(lhs.idOverride, lhsCount, rhs.idOverride);\n\t}\n\treturn (lhs.idOverride === undefined) === (rhs.idOverride === undefined);\n}\n\nfunction areMergeableCellIds(\n\tlhs: CellId | undefined,\n\tlhsCount: number,\n\trhs: CellId | undefined,\n): boolean {\n\treturn areMergeableChangeAtoms(lhs, lhsCount, rhs);\n}\n\n/**\n * Attempts to extend `lhs` to include the effects of `rhs`.\n * @param lhs - The mark to extend.\n * @param rhs - The effect so extend `rhs` with.\n * @returns `lhs` iff the function was able to mutate `lhs` to include the effects of `rhs`.\n * When `undefined` is returned, `lhs` is left untouched.\n */\nexport function tryMergeMarks(lhs: Mark, rhs: Readonly<Mark>): Mark | undefined {\n\tif (rhs.type !== lhs.type) {\n\t\treturn undefined;\n\t}\n\n\tif (!areMergeableCellIds(lhs.cellId, lhs.count, rhs.cellId)) {\n\t\treturn undefined;\n\t}\n\n\tif (rhs.changes !== undefined || lhs.changes !== undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst mergedEffect = tryMergeEffects(lhs, rhs, lhs.count);\n\tif (mergedEffect === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn { ...lhs, ...mergedEffect, count: lhs.count + rhs.count };\n}\n\nfunction tryMergeEffects(\n\tlhs: MarkEffect,\n\trhs: MarkEffect,\n\tlhsCount: number,\n): MarkEffect | undefined {\n\tif (lhs.type !== rhs.type) {\n\t\treturn undefined;\n\t}\n\n\tif (rhs.type === NoopMarkType) {\n\t\treturn lhs;\n\t}\n\n\tif (rhs.type === \"AttachAndDetach\") {\n\t\tconst lhsAttachAndDetach = lhs as AttachAndDetach;\n\t\tconst attach = tryMergeEffects(lhsAttachAndDetach.attach, rhs.attach, lhsCount);\n\t\tconst detach = tryMergeEffects(lhsAttachAndDetach.detach, rhs.detach, lhsCount);\n\t\tif (attach === undefined || detach === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tassert(\n\t\t\tisAttach(attach) && isDetach(detach),\n\t\t\t0x826 /* Merged marks should be same type as input marks */,\n\t\t);\n\t\treturn { ...lhsAttachAndDetach, attach, detach };\n\t}\n\n\tif (\n\t\t(lhs as Partial<HasRevisionTag>).revision !== (rhs as Partial<HasRevisionTag>).revision\n\t) {\n\t\treturn undefined;\n\t}\n\n\tif (isDetach(lhs) && isDetach(rhs) && !haveMergeableIdOverrides(lhs, lhsCount, rhs)) {\n\t\treturn undefined;\n\t}\n\n\tconst type = rhs.type;\n\tswitch (type) {\n\t\tcase \"MoveIn\": {\n\t\t\tconst lhsMoveIn = lhs as MoveIn;\n\t\t\tif (\n\t\t\t\t(lhsMoveIn.id as number) + lhsCount === rhs.id &&\n\t\t\t\tareMergeableChangeAtoms(lhsMoveIn.finalEndpoint, lhsCount, rhs.finalEndpoint)\n\t\t\t) {\n\t\t\t\treturn lhsMoveIn;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tconst lhsDetach = lhs as Remove;\n\t\t\tif (\n\t\t\t\t(lhsDetach.id as number) + lhsCount === rhs.id &&\n\t\t\t\thaveMergeableIdOverrides(lhsDetach, lhsCount, rhs)\n\t\t\t) {\n\t\t\t\treturn lhsDetach;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Rename\": {\n\t\t\tconst lhsDetach = lhs as Rename;\n\t\t\tif (haveMergeableIdOverrides(lhsDetach, lhsCount, rhs)) {\n\t\t\t\treturn lhsDetach;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\tconst lhsMoveOut = lhs as MoveOut;\n\t\t\tif (\n\t\t\t\t(lhsMoveOut.id as number) + lhsCount === rhs.id &&\n\t\t\t\thaveMergeableIdOverrides(lhsMoveOut, lhsCount, rhs) &&\n\t\t\t\tareMergeableChangeAtoms(lhsMoveOut.finalEndpoint, lhsCount, rhs.finalEndpoint)\n\t\t\t) {\n\t\t\t\treturn lhsMoveOut;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Insert\": {\n\t\t\tconst lhsInsert = lhs as Insert;\n\t\t\tif ((lhsInsert.id as number) + lhsCount === rhs.id) {\n\t\t\t\treturn lhsInsert;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Splits the `mark` into two marks such that the first returned mark has length `length`.\n * @param mark - The mark to split.\n * @param revision - The revision of the changeset the mark is part of.\n * @param length - The desired length for the first of the two returned marks.\n * @param genId - An ID allocator\n * @param moveEffects - The table in which to record splitting of move marks\n * @param recordMoveEffect - Whether when splitting a move an entry should be added to `moveEffects` indicating that the mark should be split (in case we process this mark again).\n * An entry is always added to `moveEffects` indicating that the opposite end of the move should be split.\n * @returns A pair of marks equivalent to the original `mark`\n * such that the first returned mark has input length `length`.\n */\nexport function splitMark<TMark extends Mark>(mark: TMark, length: number): [TMark, TMark] {\n\tconst markLength = mark.count;\n\tconst remainder = markLength - length;\n\tif (length < 1 || remainder < 1) {\n\t\tfail(\"Unable to split mark due to lengths\");\n\t}\n\n\tconst [effect1, effect2] = splitMarkEffect(mark, length);\n\tconst mark1 = { ...mark, ...effect1, count: length };\n\tconst mark2 = { ...mark, ...effect2, count: remainder };\n\tif (mark2.cellId !== undefined) {\n\t\tmark2.cellId = splitDetachEvent(mark2.cellId, length);\n\t}\n\n\treturn [mark1, mark2];\n}\n\nexport function splitMarkEffect<TEffect extends MarkEffect>(\n\teffect: TEffect,\n\tlength: number,\n): [TEffect, TEffect] {\n\tconst type = effect.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn [effect, effect];\n\t\tcase \"Insert\": {\n\t\t\tconst effect1: TEffect = {\n\t\t\t\t...effect,\n\t\t\t};\n\t\t\tconst effect2: TEffect = {\n\t\t\t\t...effect,\n\t\t\t\tid: (effect.id as number) + length,\n\t\t\t};\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"MoveIn\": {\n\t\t\tconst effect2: TEffect = { ...effect, id: (effect.id as number) + length };\n\t\t\tconst move2 = effect2 as MoveIn;\n\t\t\tif (move2.finalEndpoint !== undefined) {\n\t\t\t\tmove2.finalEndpoint = splitDetachEvent(move2.finalEndpoint, length);\n\t\t\t}\n\t\t\treturn [effect, effect2];\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tconst effect1 = { ...effect };\n\t\t\tconst id2: ChangesetLocalId = brand((effect.id as number) + length);\n\t\t\tconst effect2 = { ...effect, id: id2 };\n\t\t\tconst effect2Remove = effect2 as Mutable<Remove>;\n\t\t\tif (effect2Remove.idOverride !== undefined) {\n\t\t\t\teffect2Remove.idOverride = splitDetachEvent(effect2Remove.idOverride, length);\n\t\t\t}\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"Rename\": {\n\t\t\tconst effect1 = { ...effect };\n\t\t\tconst effect2 = { ...effect };\n\t\t\tconst effect2Rename = effect2 as Mutable<Rename>;\n\t\t\tif (effect2Rename.idOverride !== undefined) {\n\t\t\t\teffect2Rename.idOverride = splitDetachEvent(effect2Rename.idOverride, length);\n\t\t\t}\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\tconst effect2 = {\n\t\t\t\t...effect,\n\t\t\t\tid: (effect.id as number) + length,\n\t\t\t};\n\n\t\t\tconst return2 = effect2 as Mutable<MoveOut>;\n\n\t\t\tif (return2.idOverride !== undefined) {\n\t\t\t\treturn2.idOverride = splitDetachEvent(return2.idOverride, length);\n\t\t\t}\n\n\t\t\tif (return2.finalEndpoint !== undefined) {\n\t\t\t\treturn2.finalEndpoint = splitDetachEvent(return2.finalEndpoint, length);\n\t\t\t}\n\t\t\treturn [effect, effect2];\n\t\t}\n\t\tcase \"AttachAndDetach\": {\n\t\t\tconst [attach1, attach2] = splitMarkEffect(effect.attach, length);\n\t\t\tconst [detach1, detach2] = splitMarkEffect(effect.detach, length);\n\t\t\tconst effect1 = {\n\t\t\t\t...effect,\n\t\t\t\tattach: attach1,\n\t\t\t\tdetach: detach1,\n\t\t\t};\n\n\t\t\tconst effect2 = {\n\t\t\t\t...effect,\n\t\t\t\tattach: attach2,\n\t\t\t\tdetach: detach2,\n\t\t\t};\n\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nfunction splitDetachEvent(detachEvent: CellId, length: number): CellId {\n\treturn { ...detachEvent, localId: brand((detachEvent.localId as number) + length) };\n}\n\n// TODO: Refactor MarkEffect into a field of CellMark so this function isn't necessary.\nexport function extractMarkEffect<TEffect extends MarkEffect>(\n\tmark: CellMark<TEffect>,\n): TEffect {\n\tconst { cellId: _cellId, count: _count, changes: _changes, ...effect } = mark;\n\treturn effect as unknown as TEffect;\n}\n\n// TODO: Refactor MarkEffect into a field of CellMark so this function isn't necessary.\nexport function omitMarkEffect(mark: CellMark<unknown>): CellMark<NoopMark> {\n\tconst { cellId, count, changes } = mark;\n\tconst noopMark: CellMark<NoopMark> = { count };\n\tif (cellId !== undefined) {\n\t\tnoopMark.cellId = cellId;\n\t}\n\tif (changes !== undefined) {\n\t\tnoopMark.changes = changes;\n\t}\n\treturn noopMark;\n}\n\nexport function withNodeChange<TMark extends CellMark<TKind>, TKind extends MarkEffect>(\n\tmark: TMark,\n\tchanges: NodeId | undefined,\n): TMark {\n\tconst newMark = { ...mark };\n\tif (changes !== undefined) {\n\t\tnewMark.changes = changes;\n\t} else {\n\t\tdelete newMark.changes;\n\t}\n\treturn newMark;\n}\n\nexport function withRevision<TMark extends Mark>(\n\tmark: TMark,\n\trevision: RevisionTag | undefined,\n): TMark {\n\tif (revision === undefined) {\n\t\treturn mark;\n\t}\n\n\tconst cloned = cloneMark(mark);\n\taddRevision(cloned, revision);\n\tif (\n\t\tcloned.cellId !== undefined &&\n\t\tcloned.cellId.revision === undefined &&\n\t\trevision !== undefined\n\t) {\n\t\t(cloned.cellId as Mutable<CellId>).revision = revision;\n\t}\n\treturn cloned;\n}\n\nfunction addRevision(effect: MarkEffect, revision: RevisionTag): void {\n\tif (effect.type === NoopMarkType || isRename(effect)) {\n\t\treturn;\n\t}\n\n\tif (effect.type === \"AttachAndDetach\") {\n\t\taddRevision(effect.attach, revision);\n\t\taddRevision(effect.detach, revision);\n\t\treturn;\n\t}\n\n\tassert(\n\t\teffect.revision === undefined || effect.revision === revision,\n\t\t0x829 /* Should not overwrite mark revision */,\n\t);\n\teffect.revision = revision;\n}\n\nexport function getEndpoint(effect: MoveMarkEffect): ChangeAtomId {\n\treturn effect.finalEndpoint ?? { revision: effect.revision, localId: effect.id };\n}\n\nexport function getCrossFieldKeys(change: Changeset): CrossFieldKeyRange[] {\n\tconst keys: CrossFieldKeyRange[] = [];\n\tfor (const mark of change) {\n\t\tkeys.push(...getCrossFieldKeysForMarkEffect(mark, mark.count));\n\t}\n\n\treturn keys;\n}\n\nfunction getCrossFieldKeysForMarkEffect(\n\teffect: MarkEffect,\n\tcount: number,\n): CrossFieldKeyRange[] {\n\tswitch (effect.type) {\n\t\tcase \"Insert\":\n\t\t\t// An insert behaves like a move where the source and destination are at the same location.\n\t\t\t// An insert can become a move when after rebasing.\n\t\t\treturn [\n\t\t\t\t[CrossFieldTarget.Source, effect.revision, effect.id, count],\n\t\t\t\t[CrossFieldTarget.Destination, effect.revision, effect.id, count],\n\t\t\t];\n\t\tcase \"MoveOut\":\n\t\t\treturn [[CrossFieldTarget.Source, effect.revision, effect.id, count]];\n\t\tcase \"MoveIn\":\n\t\t\treturn [[CrossFieldTarget.Destination, effect.revision, effect.id, count]];\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn [\n\t\t\t\t...getCrossFieldKeysForMarkEffect(effect.attach, count),\n\t\t\t\t...getCrossFieldKeysForMarkEffect(effect.detach, count),\n\t\t\t];\n\t\tdefault:\n\t\t\treturn [];\n\t}\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -2,17 +2,16 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { EmptyKey, type FieldKey, type TreeValue, type FieldMapObject, type NodeData, type GenericTreeNode, type JsonableTree, type GenericFieldsNode, type TreeNodeSchemaIdentifier, type TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, type FieldKindIdentifier, type TreeTypeSet, type TreeStoredSchema, type Revertible, CommitKind, RevertibleStatus, type CommitMetadata, type StoredSchemaCollection, type ErasedTreeNodeSchemaDataFormat, ObjectNodeStoredSchema, MapNodeStoredSchema, LeafNodeStoredSchema, type RevertibleFactory, type RevertibleAlphaFactory, type RevertibleAlpha, } from "./core/index.js";
6
- export { type Brand } from "./util/index.js";
5
+ export { ValueSchema, type Revertible, CommitKind, RevertibleStatus, type CommitMetadata, type RevertibleFactory, type RevertibleAlphaFactory, type RevertibleAlpha, } from "./core/index.js";
7
6
  export type { Listeners, IsListener, Listenable, Off, } from "@fluidframework/core-interfaces";
8
7
  export { TreeStatus, TreeCompressionStrategy, type TreeIndex, type TreeIndexKey, type TreeIndexNodes, } from "./feature-libraries/index.js";
9
- export { type ISharedTree, type SharedTreeOptions, ForestType, type SharedTreeContentSnapshot, type SharedTreeFormatOptions, SharedTreeFormatVersion, Tree, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransaction, rollback, type ForestOptions, getBranch, type BranchableTree, type TreeBranchFork, independentInitializedView, type ViewContent, TreeAlpha, independentView, } from "./shared-tree/index.js";
10
- export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ViewableTree, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type FieldSchemaMetadata, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type InternalTreeNode, type WithType, type NodeChangedData, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type TreeObjectNodeUnsafe, type InsertableTreeNodeFromImplicitAllowedTypesUnsafe, type TreeArrayNodeUnsafe, type TreeMapNodeUnsafe, type InsertableObjectFromSchemaRecordUnsafe, type InsertableTreeFieldFromImplicitFieldUnsafe, type FieldSchemaUnsafe, type TreeNodeSchemaClassUnsafe, type InsertableTreeNodeFromAllowedTypesUnsafe, type typeSchemaSymbol, type TreeNodeSchemaNonClass, type ValidateRecursiveSchema, type FixRecursiveArraySchema, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, adaptEnum, enumFromStrings, singletonSchema, type UnsafeUnknownSchema, type TreeViewAlpha, type InsertableField, type Insertable, type InsertableContent, type FactoryContent, type FactoryContentObject, type ReadableField, type ReadSchema, test_RecursiveObject, test_RecursiveObject_base, test_RecursiveObjectPojoMode, TreeBeta, type TreeChangeEventsBeta, type VerboseTreeNode, type EncodeOptions, type ParseOptions, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, type JsonTreeSchema, type JsonSchemaId, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonLeafNodeSchema, type JsonMapNodeSchema, type JsonArrayNodeSchema, type JsonObjectNodeSchema, type JsonFieldSchema, type JsonSchemaRef, type JsonRefPath, type JsonSchemaType, type JsonLeafSchemaType, getJsonSchema, type LazyItem, type Unenforced, type SimpleNodeSchemaBase, type SimpleTreeSchema, type SimpleNodeSchema, type SimpleFieldSchema, type SimpleLeafNodeSchema, type SimpleMapNodeSchema, type SimpleArrayNodeSchema, type SimpleObjectNodeSchema, normalizeAllowedTypes, getSimpleSchema, numberSchema, stringSchema, booleanSchema, handleSchema, nullSchema, type ReadonlyArrayNode, type InsertableTreeNodeFromAllowedTypes, type Input, type TreeBranch, type TreeBranchEvents, asTreeViewAlpha, } from "./simple-tree/index.js";
8
+ export { type ITreeInternal, type SharedTreeOptions, ForestType, type SharedTreeFormatOptions, SharedTreeFormatVersion, Tree, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransaction, rollback, type ForestOptions, getBranch, type BranchableTree, type TreeBranchFork, independentInitializedView, type ViewContent, TreeAlpha, independentView, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, } from "./shared-tree/index.js";
9
+ export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ViewableTree, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, SchemaFactoryAlpha, type SchemaFactoryObjectOptions, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type FieldSchemaMetadata, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type InternalTreeNode, type WithType, type NodeChangedData, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type TreeObjectNodeUnsafe, type InsertableTreeNodeFromImplicitAllowedTypesUnsafe, type TreeArrayNodeUnsafe, type TreeMapNodeUnsafe, type InsertableObjectFromSchemaRecordUnsafe, type InsertableTreeFieldFromImplicitFieldUnsafe, type FieldSchemaUnsafe, type TreeNodeSchemaClassUnsafe, type InsertableTreeNodeFromAllowedTypesUnsafe, type typeSchemaSymbol, type TreeNodeSchemaNonClass, type ValidateRecursiveSchema, type FixRecursiveArraySchema, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, adaptEnum, enumFromStrings, singletonSchema, type UnsafeUnknownSchema, type TreeViewAlpha, type InsertableField, type Insertable, type InsertableContent, type FactoryContent, type FactoryContentObject, type ReadableField, type ReadSchema, test_RecursiveObject, test_RecursiveObject_base, test_RecursiveObjectPojoMode, TreeBeta, type TreeChangeEventsBeta, type VerboseTreeNode, type EncodeOptions, type ParseOptions, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, type JsonTreeSchema, type JsonSchemaId, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonLeafNodeSchema, type JsonMapNodeSchema, type JsonArrayNodeSchema, type JsonObjectNodeSchema, type JsonFieldSchema, type JsonSchemaRef, type JsonRefPath, type JsonSchemaType, type JsonLeafSchemaType, getJsonSchema, type LazyItem, type Unenforced, type SimpleNodeSchemaBase, type SimpleTreeSchema, type SimpleNodeSchema, type SimpleFieldSchema, type SimpleLeafNodeSchema, type SimpleMapNodeSchema, type SimpleArrayNodeSchema, type SimpleObjectNodeSchema, normalizeAllowedTypes, getSimpleSchema, type ReadonlyArrayNode, type InsertableTreeNodeFromAllowedTypes, type Input, type TreeBranch, type TreeBranchEvents, asTreeViewAlpha, type NodeSchemaOptions, type NodeSchemaMetadata, } from "./simple-tree/index.js";
11
10
  export { SharedTree, configuredSharedTree, } from "./treeFactory.js";
12
11
  export { type ICodecOptions, type JsonValidator, type SchemaValidationFunction, FluidClientVersion, } from "./codec/index.js";
13
12
  export { noopValidator } from "./codec/index.js";
14
13
  export { typeboxValidator } from "./external-utilities/index.js";
15
- export { type Covariant, BrandedType, type RestrictiveReadonlyRecord, type RestrictiveStringRecord, type MakeNominal, type IsUnion, type UnionToIntersection, type UnionToTuple, type PopUnion, } from "./util/index.js";
14
+ export { type RestrictiveReadonlyRecord, type RestrictiveStringRecord, type MakeNominal, type IsUnion, type UnionToIntersection, type UnionToTuple, type PopUnion, } from "./util/index.js";
16
15
  import * as InternalTypes from "./internalTypes.js";
17
16
  export {
18
17
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,WAAW,EACX,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,KAA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GED
@@ -2,21 +2,20 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { EmptyKey, ValueSchema, TreeNodeStoredSchema, CommitKind, RevertibleStatus, ObjectNodeStoredSchema, MapNodeStoredSchema, LeafNodeStoredSchema, } from "./core/index.js";
5
+ export { ValueSchema, CommitKind, RevertibleStatus, } from "./core/index.js";
6
6
  export { TreeStatus, TreeCompressionStrategy, } from "./feature-libraries/index.js";
7
7
  export { ForestType, SharedTreeFormatVersion, Tree, rollback, getBranch, independentInitializedView, TreeAlpha, independentView, } from "./shared-tree/index.js";
8
- export { TreeArrayNode, IterableTreeArrayContent, TreeViewConfiguration, SchemaFactory, FieldKind, FieldSchema, NodeKind, createSimpleTreeIndex, createIdentifierIndex,
8
+ export { TreeArrayNode, IterableTreeArrayContent, TreeViewConfiguration, SchemaFactory, SchemaFactoryAlpha, FieldKind, FieldSchema, NodeKind, createSimpleTreeIndex, createIdentifierIndex,
9
9
  // experimental @alpha APIs:
10
10
  adaptEnum, enumFromStrings, singletonSchema,
11
11
  // test recursive schema for checking that d.ts files handles schema correctly
12
12
  test_RecursiveObject, test_RecursiveObject_base, test_RecursiveObjectPojoMode,
13
13
  // Beta APIs
14
- TreeBeta, extractPersistedSchema, comparePersistedSchema, getJsonSchema, normalizeAllowedTypes, getSimpleSchema, numberSchema, stringSchema, booleanSchema, handleSchema, nullSchema, asTreeViewAlpha, } from "./simple-tree/index.js";
14
+ TreeBeta, extractPersistedSchema, comparePersistedSchema, getJsonSchema, normalizeAllowedTypes, getSimpleSchema, asTreeViewAlpha, } from "./simple-tree/index.js";
15
15
  export { SharedTree, configuredSharedTree, } from "./treeFactory.js";
16
16
  export { FluidClientVersion, } from "./codec/index.js";
17
17
  export { noopValidator } from "./codec/index.js";
18
18
  export { typeboxValidator } from "./external-utilities/index.js";
19
- export { BrandedType, } from "./util/index.js";
20
19
  import * as InternalTypes from "./internalTypes.js";
21
20
  export {
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AO;AACN;;;GAGG;AACH,aAAa,GACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tEmptyKey,\n\ttype FieldKey,\n\ttype TreeValue,\n\ttype FieldMapObject,\n\ttype NodeData,\n\ttype GenericTreeNode,\n\ttype JsonableTree,\n\ttype GenericFieldsNode,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype FieldKindIdentifier,\n\ttype TreeTypeSet,\n\ttype TreeStoredSchema,\n\ttype Revertible,\n\tCommitKind,\n\tRevertibleStatus,\n\ttype CommitMetadata,\n\ttype StoredSchemaCollection,\n\ttype ErasedTreeNodeSchemaDataFormat,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tLeafNodeStoredSchema,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./core/index.js\";\nexport { type Brand } from \"./util/index.js\";\n\nexport type {\n\tListeners,\n\tIsListener,\n\tListenable,\n\tOff,\n} from \"@fluidframework/core-interfaces\";\n\nexport {\n\tTreeStatus,\n\tTreeCompressionStrategy,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./feature-libraries/index.js\";\n\nexport {\n\ttype ISharedTree,\n\ttype SharedTreeOptions,\n\tForestType,\n\ttype SharedTreeContentSnapshot,\n\ttype SharedTreeFormatOptions,\n\tSharedTreeFormatVersion,\n\tTree,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransaction,\n\trollback,\n\ttype ForestOptions,\n\tgetBranch,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n\tindependentInitializedView,\n\ttype ViewContent,\n\tTreeAlpha,\n\tindependentView,\n} from \"./shared-tree/index.js\";\n\nexport {\n\tTreeArrayNode,\n\ttype Unhydrated,\n\tIterableTreeArrayContent,\n\tTreeNode,\n\ttype ViewableTree,\n\ttype ITree,\n\ttype TreeNodeSchema,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype ITreeConfigurationOptions,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tSchemaFactory,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeChangeEvents,\n\ttype NodeFromSchema,\n\ttype TreeMapNode,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\tNodeKind,\n\ttype TreeObjectNode,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchemaClass,\n\ttype SchemaCompatibilityStatus,\n\ttype FieldProps,\n\ttype InternalTreeNode,\n\ttype WithType,\n\ttype NodeChangedData,\n\t// Types not really intended for public use, but used in links.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// Error: src/simple-tree/objectNode.ts:72:1 - (ae-unresolved-link) The @link reference could not be resolved: The package \"@fluidframework/tree\" does not have an export \"TreeNodeApi\"\n\ttype TreeNodeApi,\n\ttype TreeNodeSchemaCore,\n\t// Types not really intended for public use, but used in inferred types exposed in the public API.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// error TS2742: The inferred type of 'Inventory' cannot be named without a reference to '../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\n\ttype AllowedTypes,\n\ttype TreeObjectNodeUnsafe,\n\ttype InsertableTreeNodeFromImplicitAllowedTypesUnsafe,\n\ttype TreeArrayNodeUnsafe,\n\ttype TreeMapNodeUnsafe,\n\ttype InsertableObjectFromSchemaRecordUnsafe,\n\ttype InsertableTreeFieldFromImplicitFieldUnsafe,\n\ttype FieldSchemaUnsafe,\n\ttype TreeNodeSchemaClassUnsafe,\n\ttype InsertableTreeNodeFromAllowedTypesUnsafe,\n\t// System types (not in Internal types for various reasons, like doc links or cannot be named errors).\n\ttype typeSchemaSymbol,\n\ttype TreeNodeSchemaNonClass,\n\t// Recursive Schema APIs\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\t// Index APIs\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\t// experimental @alpha APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttype UnsafeUnknownSchema,\n\ttype TreeViewAlpha,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n\ttype ReadableField,\n\ttype ReadSchema,\n\t// test recursive schema for checking that d.ts files handles schema correctly\n\ttest_RecursiveObject,\n\ttest_RecursiveObject_base,\n\ttest_RecursiveObjectPojoMode,\n\t// Beta APIs\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\ttype VerboseTreeNode,\n\ttype EncodeOptions,\n\ttype ParseOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\t// Back to normal types\n\ttype JsonTreeSchema,\n\ttype JsonSchemaId,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonLeafNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonObjectNodeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonSchemaType,\n\ttype JsonLeafSchemaType,\n\tgetJsonSchema,\n\ttype LazyItem,\n\ttype Unenforced,\n\ttype SimpleNodeSchemaBase,\n\ttype SimpleTreeSchema,\n\ttype SimpleNodeSchema,\n\ttype SimpleFieldSchema,\n\ttype SimpleLeafNodeSchema,\n\ttype SimpleMapNodeSchema,\n\ttype SimpleArrayNodeSchema,\n\ttype SimpleObjectNodeSchema,\n\tnormalizeAllowedTypes,\n\tgetSimpleSchema,\n\tnumberSchema,\n\tstringSchema,\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n\ttype ReadonlyArrayNode,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\tasTreeViewAlpha,\n} from \"./simple-tree/index.js\";\nexport {\n\tSharedTree,\n\tconfiguredSharedTree,\n} from \"./treeFactory.js\";\n\nexport {\n\ttype ICodecOptions,\n\ttype JsonValidator,\n\ttype SchemaValidationFunction,\n\tFluidClientVersion,\n} from \"./codec/index.js\";\nexport { noopValidator } from \"./codec/index.js\";\nexport { typeboxValidator } from \"./external-utilities/index.js\";\n\nexport {\n\ttype Covariant,\n\tBrandedType,\n\ttype RestrictiveReadonlyRecord,\n\ttype RestrictiveStringRecord,\n\ttype MakeNominal,\n\ttype IsUnion,\n\ttype UnionToIntersection,\n\ttype UnionToTuple,\n\ttype PopUnion,\n} from \"./util/index.js\";\n\nimport * as InternalTypes from \"./internalTypes.js\";\nexport {\n\t/**\n\t * Contains types used by the API, but which serve mechanical purposes and do not represent semantic concepts.\n\t * They are used internally to implement API aspects, but are not intended for use by external consumers.\n\t */\n\tInternalTypes,\n};\n\n// Internal/System types:\n// These would be put in `internalTypes` except doing so tents to cause errors like:\n// The inferred type of 'NodeMap' cannot be named without a reference to '../../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\nexport type { MapNodeInsertableData } from \"./simple-tree/index.js\";\n\nexport type { JsonCompatible, JsonCompatibleObject } from \"./util/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EAEX,UAAU,EACV,gBAAgB,GAKhB,MAAM,iBAAiB,CAAC;AASzB,OAAO,EACN,UAAU,EACV,uBAAuB,GAIvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAGN,UAAU,EAEV,uBAAuB,EACvB,IAAI,EAIJ,QAAQ,EAER,SAAS,EAGT,0BAA0B,EAE1B,SAAS,EACT,eAAe,GAQf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,aAAa,EAEb,wBAAwB,EAKxB,qBAAqB,EAKrB,aAAa,EACb,kBAAkB,EASlB,SAAS,EACT,WAAW,EAKX,QAAQ,EAoCR,qBAAqB,EACrB,qBAAqB;AACrB,4BAA4B;AAC5B,SAAS,EACT,eAAe,EACf,eAAe;AAUf,8EAA8E;AAC9E,oBAAoB,EACpB,yBAAyB,EACzB,4BAA4B;AAC5B,YAAY;AACZ,QAAQ,EAMR,sBAAsB,EACtB,sBAAsB,EAgBtB,aAAa,EAWb,qBAAqB,EACrB,eAAe,EAMf,eAAe,GAGf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,UAAU,EACV,oBAAoB,GACpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAIN,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAYjE,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO;AACN;;;GAGG;AACH,aAAa,GACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tValueSchema,\n\ttype Revertible,\n\tCommitKind,\n\tRevertibleStatus,\n\ttype CommitMetadata,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./core/index.js\";\n\nexport type {\n\tListeners,\n\tIsListener,\n\tListenable,\n\tOff,\n} from \"@fluidframework/core-interfaces\";\n\nexport {\n\tTreeStatus,\n\tTreeCompressionStrategy,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./feature-libraries/index.js\";\n\nexport {\n\ttype ITreeInternal,\n\ttype SharedTreeOptions,\n\tForestType,\n\ttype SharedTreeFormatOptions,\n\tSharedTreeFormatVersion,\n\tTree,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransaction,\n\trollback,\n\ttype ForestOptions,\n\tgetBranch,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n\tindependentInitializedView,\n\ttype ViewContent,\n\tTreeAlpha,\n\tindependentView,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n} from \"./shared-tree/index.js\";\n\nexport {\n\tTreeArrayNode,\n\ttype Unhydrated,\n\tIterableTreeArrayContent,\n\tTreeNode,\n\ttype ViewableTree,\n\ttype ITree,\n\ttype TreeNodeSchema,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype ITreeConfigurationOptions,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\ttype SchemaFactoryObjectOptions,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeChangeEvents,\n\ttype NodeFromSchema,\n\ttype TreeMapNode,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\tNodeKind,\n\ttype TreeObjectNode,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchemaClass,\n\ttype SchemaCompatibilityStatus,\n\ttype FieldProps,\n\ttype InternalTreeNode,\n\ttype WithType,\n\ttype NodeChangedData,\n\t// Types not really intended for public use, but used in links.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// Error: src/simple-tree/objectNode.ts:72:1 - (ae-unresolved-link) The @link reference could not be resolved: The package \"@fluidframework/tree\" does not have an export \"TreeNodeApi\"\n\ttype TreeNodeApi,\n\ttype TreeNodeSchemaCore,\n\t// Types not really intended for public use, but used in inferred types exposed in the public API.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// error TS2742: The inferred type of 'Inventory' cannot be named without a reference to '../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\n\ttype AllowedTypes,\n\ttype TreeObjectNodeUnsafe,\n\ttype InsertableTreeNodeFromImplicitAllowedTypesUnsafe,\n\ttype TreeArrayNodeUnsafe,\n\ttype TreeMapNodeUnsafe,\n\ttype InsertableObjectFromSchemaRecordUnsafe,\n\ttype InsertableTreeFieldFromImplicitFieldUnsafe,\n\ttype FieldSchemaUnsafe,\n\ttype TreeNodeSchemaClassUnsafe,\n\ttype InsertableTreeNodeFromAllowedTypesUnsafe,\n\t// System types (not in Internal types for various reasons, like doc links or cannot be named errors).\n\ttype typeSchemaSymbol,\n\ttype TreeNodeSchemaNonClass,\n\t// Recursive Schema APIs\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\t// Index APIs\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\t// experimental @alpha APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttype UnsafeUnknownSchema,\n\ttype TreeViewAlpha,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n\ttype ReadableField,\n\ttype ReadSchema,\n\t// test recursive schema for checking that d.ts files handles schema correctly\n\ttest_RecursiveObject,\n\ttest_RecursiveObject_base,\n\ttest_RecursiveObjectPojoMode,\n\t// Beta APIs\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\ttype VerboseTreeNode,\n\ttype EncodeOptions,\n\ttype ParseOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\t// Back to normal types\n\ttype JsonTreeSchema,\n\ttype JsonSchemaId,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonLeafNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonObjectNodeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonSchemaType,\n\ttype JsonLeafSchemaType,\n\tgetJsonSchema,\n\ttype LazyItem,\n\ttype Unenforced,\n\ttype SimpleNodeSchemaBase,\n\ttype SimpleTreeSchema,\n\ttype SimpleNodeSchema,\n\ttype SimpleFieldSchema,\n\ttype SimpleLeafNodeSchema,\n\ttype SimpleMapNodeSchema,\n\ttype SimpleArrayNodeSchema,\n\ttype SimpleObjectNodeSchema,\n\tnormalizeAllowedTypes,\n\tgetSimpleSchema,\n\ttype ReadonlyArrayNode,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\tasTreeViewAlpha,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaMetadata,\n} from \"./simple-tree/index.js\";\nexport {\n\tSharedTree,\n\tconfiguredSharedTree,\n} from \"./treeFactory.js\";\n\nexport {\n\ttype ICodecOptions,\n\ttype JsonValidator,\n\ttype SchemaValidationFunction,\n\tFluidClientVersion,\n} from \"./codec/index.js\";\nexport { noopValidator } from \"./codec/index.js\";\nexport { typeboxValidator } from \"./external-utilities/index.js\";\n\nexport {\n\ttype RestrictiveReadonlyRecord,\n\ttype RestrictiveStringRecord,\n\ttype MakeNominal,\n\ttype IsUnion,\n\ttype UnionToIntersection,\n\ttype UnionToTuple,\n\ttype PopUnion,\n} from \"./util/index.js\";\n\nimport * as InternalTypes from \"./internalTypes.js\";\nexport {\n\t/**\n\t * Contains types used by the API, but which serve mechanical purposes and do not represent semantic concepts.\n\t * They are used internally to implement API aspects, but are not intended for use by external consumers.\n\t */\n\tInternalTypes,\n};\n\n// Internal/System types:\n// These would be put in `internalTypes` except doing so tents to cause errors like:\n// The inferred type of 'NodeMap' cannot be named without a reference to '../../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\nexport type { MapNodeInsertableData } from \"./simple-tree/index.js\";\n\nexport type { JsonCompatible, JsonCompatibleObject } from \"./util/index.js\";\n"]}
package/lib/legacy.d.ts CHANGED
@@ -46,6 +46,8 @@ export {
46
46
  NodeFromSchema,
47
47
  NodeInDocumentConstraint,
48
48
  NodeKind,
49
+ NodeSchemaMetadata,
50
+ NodeSchemaOptions,
49
51
  Off,
50
52
  ReadonlyArrayNode,
51
53
  RestrictiveReadonlyRecord,
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/tree";
8
- export declare const pkgVersion = "2.11.0";
8
+ export declare const pkgVersion = "2.13.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/tree";
8
- export const pkgVersion = "2.11.0";
8
+ export const pkgVersion = "2.13.0";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAC9C,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.11.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAC9C,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.13.0\";\n"]}
package/lib/public.d.ts CHANGED
@@ -46,6 +46,8 @@ export {
46
46
  NodeFromSchema,
47
47
  NodeInDocumentConstraint,
48
48
  NodeKind,
49
+ NodeSchemaMetadata,
50
+ NodeSchemaOptions,
49
51
  Off,
50
52
  ReadonlyArrayNode,
51
53
  RestrictiveReadonlyRecord,
@@ -2,13 +2,14 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { type ISharedTree, SharedTreeFactory, type SharedTreeOptions, SharedTree, getBranch, ForestType, type SharedTreeContentSnapshot, type SharedTreeFormatOptions, SharedTreeFormatVersion, buildConfiguredForest, defaultSharedTreeOptions, type ForestOptions, } from "./sharedTree.js";
5
+ export { type ISharedTree, SharedTreeFactory, type SharedTreeOptions, SharedTree, getBranch, ForestType, type SharedTreeContentSnapshot, type SharedTreeFormatOptions, SharedTreeFormatVersion, buildConfiguredForest, defaultSharedTreeOptions, type ForestOptions, type ITreeInternal, } from "./sharedTree.js";
6
6
  export { createTreeCheckout, TreeCheckout, type ITreeCheckout, type CheckoutEvents, type ITreeCheckoutFork, type BranchableTree, type TreeBranchFork, } from "./treeCheckout.js";
7
7
  export { type TreeStoredContent } from "./schematizeTree.js";
8
8
  export { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
9
9
  export { CheckoutFlexTreeView } from "./checkoutFlexTreeView.js";
10
10
  export type { ISharedTreeEditor, ISchemaEditor } from "./sharedTreeEditBuilder.js";
11
- export { treeApi as Tree, type TreeApi, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransaction, rollback, } from "./treeApi.js";
11
+ export { treeApi as Tree, type TreeApi, type RunTransaction, } from "./treeApi.js";
12
+ export { type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, } from "./transactionTypes.js";
12
13
  export { TreeAlpha } from "./treeApiAlpha.js";
13
14
  export { independentInitializedView, type ViewContent, independentView, } from "./independentView.js";
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,UAAU,EACV,SAAS,EACT,UAAU,EACV,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,aAAa,GAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,MAA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AAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,QAAQ,GACR,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EACN,0BAA0B,EAC1B,KAAK,WAAW,EAChB,eAAe,GACf,MAAM,sBAAsB,CAAC"}
@@ -6,7 +6,8 @@ export { SharedTreeFactory, SharedTree, getBranch, ForestType, SharedTreeFormatV
6
6
  export { createTreeCheckout, TreeCheckout, } from "./treeCheckout.js";
7
7
  export { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
8
8
  export { CheckoutFlexTreeView } from "./checkoutFlexTreeView.js";
9
- export { treeApi as Tree, rollback, } from "./treeApi.js";
9
+ export { treeApi as Tree, } from "./treeApi.js";
10
+ export { rollback, } from "./transactionTypes.js";
10
11
  export { TreeAlpha } from "./treeApiAlpha.js";
11
12
  export { independentInitializedView, independentView, } from "./independentView.js";
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,iBAAiB,EAEjB,UAAU,EACV,SAAS,EACT,UAAU,EAGV,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,GAExB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,kBAAkB,EAClB,YAAY,GAMZ,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE,OAAO,EACN,OAAO,IAAI,IAAI,EAKf,QAAQ,GACR,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EACN,0BAA0B,EAE1B,eAAe,GACf,MAAM,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ISharedTree,\n\tSharedTreeFactory,\n\ttype SharedTreeOptions,\n\tSharedTree,\n\tgetBranch,\n\tForestType,\n\ttype SharedTreeContentSnapshot,\n\ttype SharedTreeFormatOptions,\n\tSharedTreeFormatVersion,\n\tbuildConfiguredForest,\n\tdefaultSharedTreeOptions,\n\ttype ForestOptions,\n} from \"./sharedTree.js\";\n\nexport {\n\tcreateTreeCheckout,\n\tTreeCheckout,\n\ttype ITreeCheckout,\n\ttype CheckoutEvents,\n\ttype ITreeCheckoutFork,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n} from \"./treeCheckout.js\";\n\nexport { type TreeStoredContent } from \"./schematizeTree.js\";\n\nexport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\n\nexport { CheckoutFlexTreeView } from \"./checkoutFlexTreeView.js\";\n\nexport type { ISharedTreeEditor, ISchemaEditor } from \"./sharedTreeEditBuilder.js\";\n\nexport {\n\ttreeApi as Tree,\n\ttype TreeApi,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransaction,\n\trollback,\n} from \"./treeApi.js\";\n\nexport { TreeAlpha } from \"./treeApiAlpha.js\";\n\nexport {\n\tindependentInitializedView,\n\ttype ViewContent,\n\tindependentView,\n} from \"./independentView.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,iBAAiB,EAEjB,UAAU,EACV,SAAS,EACT,UAAU,EAGV,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,GAGxB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,kBAAkB,EAClB,YAAY,GAMZ,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE,OAAO,EACN,OAAO,IAAI,IAAI,GAGf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAUN,QAAQ,GACR,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EACN,0BAA0B,EAE1B,eAAe,GACf,MAAM,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ISharedTree,\n\tSharedTreeFactory,\n\ttype SharedTreeOptions,\n\tSharedTree,\n\tgetBranch,\n\tForestType,\n\ttype SharedTreeContentSnapshot,\n\ttype SharedTreeFormatOptions,\n\tSharedTreeFormatVersion,\n\tbuildConfiguredForest,\n\tdefaultSharedTreeOptions,\n\ttype ForestOptions,\n\ttype ITreeInternal,\n} from \"./sharedTree.js\";\n\nexport {\n\tcreateTreeCheckout,\n\tTreeCheckout,\n\ttype ITreeCheckout,\n\ttype CheckoutEvents,\n\ttype ITreeCheckoutFork,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n} from \"./treeCheckout.js\";\n\nexport { type TreeStoredContent } from \"./schematizeTree.js\";\n\nexport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\n\nexport { CheckoutFlexTreeView } from \"./checkoutFlexTreeView.js\";\n\nexport type { ISharedTreeEditor, ISchemaEditor } from \"./sharedTreeEditBuilder.js\";\n\nexport {\n\ttreeApi as Tree,\n\ttype TreeApi,\n\ttype RunTransaction,\n} from \"./treeApi.js\";\n\nexport {\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n} from \"./transactionTypes.js\";\n\nexport { TreeAlpha } from \"./treeApiAlpha.js\";\n\nexport {\n\tindependentInitializedView,\n\ttype ViewContent,\n\tindependentView,\n} from \"./independentView.js\";\n"]}
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { AllowedUpdateType, type ITreeCursorSynchronous, type TreeStoredSchema } from "../core/index.js";
6
6
  import type { ITreeCheckout } from "./treeCheckout.js";
7
- import type { ViewSchema } from "../simple-tree/index.js";
7
+ import { type ViewSchema } from "../simple-tree/index.js";
8
8
  /**
9
9
  * Modify `storedSchema` and invoke `setInitialTree` when it's time to set the tree content.
10
10
  *
@@ -1 +1 @@
1
- {"version":3,"file":"schematizeTree.d.ts","sourceRoot":"","sources":["../../src/shared-tree/schematizeTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,iBAAiB,EAGjB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EAGrB,MAAM,kBAAkB,CAAC;AAU1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAChC,gBAAgB,EAAE;IACjB,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAC5C,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CAC5C,EACD,SAAS,EAAE,gBAAgB,EAC3B,cAAc,EAAE,MAAM,IAAI,GACxB,IAAI,CA+CN;AAED,oBAAY,UAAU;IACrB;;OAEG;IACH,IAAI,IAAA;IACJ;;OAEG;IACH,UAAU,IAAA;IACV;;OAEG;IACH,gBAAgB,IAAA;IAChB;;OAEG;IACH,YAAY,IAAA;CACZ;AAED,wBAAgB,cAAc,CAC7B,UAAU,EAAE,UAAU,EACtB,0BAA0B,EAAE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U,IAAA;IACV;;OAEG;IACH,gBAAgB,IAAA;IAChB;;OAEG;IACH,YAAY,IAAA;CACZ;AAED,wBAAgB,cAAc,CAC7B,UAAU,EAAE,UAAU,EACtB,0BAA0B,EAAE,iBAAiB,EAC7C,QAAQ,EAAE,aAAa,GACrB,UAAU,CAyBZ;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAG9D;AAoBD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,GAAG,IAAI,CA+BxF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAC3B,UAAU,EAAE,UAAU,EACtB,0BAA0B,EAAE,iBAAiB,EAC7C,QAAQ,EAAE,aAAa,EACvB,WAAW,EAAE,iBAAiB,GAAG,SAAS,GACxC,OAAO,CAiCT;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAElC;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,sBAAsB,EAAE,GAAG,sBAAsB,GAAG,SAAS,CAAC;CAC7F"}
@@ -3,9 +3,10 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
6
- import { AllowedUpdateType, Compatibility, rootFieldKey, schemaDataIsEmpty, } from "../core/index.js";
6
+ import { AllowedUpdateType, rootFieldKey, schemaDataIsEmpty, } from "../core/index.js";
7
7
  import { FieldKinds, allowsRepoSuperset, cursorForMapTreeField, defaultSchemaPolicy, mapTreeFromCursor, } from "../feature-libraries/index.js";
8
8
  import { fail, isReadonlyArray } from "../util/index.js";
9
+ import { toStoredSchema } from "../simple-tree/index.js";
9
10
  /**
10
11
  * Modify `storedSchema` and invoke `setInitialTree` when it's time to set the tree content.
11
12
  *
@@ -76,8 +77,7 @@ export var UpdateType;
76
77
  })(UpdateType || (UpdateType = {}));
77
78
  export function evaluateUpdate(viewSchema, allowedSchemaModifications, checkout) {
78
79
  const compatibility = viewSchema.checkCompatibility(checkout.storedSchema);
79
- if (compatibility.read === Compatibility.Compatible &&
80
- compatibility.write === Compatibility.Compatible) {
80
+ if (compatibility.canUpgrade && compatibility.canView) {
81
81
  // Compatible as is
82
82
  return UpdateType.None;
83
83
  }
@@ -85,12 +85,12 @@ export function evaluateUpdate(viewSchema, allowedSchemaModifications, checkout)
85
85
  if (allowedSchemaModifications & AllowedUpdateType.Initialize && canInitialize(checkout)) {
86
86
  return UpdateType.Initialize;
87
87
  }
88
- if (compatibility.read !== Compatibility.Compatible) {
88
+ if (!compatibility.canUpgrade) {
89
89
  // Existing stored schema permits trees which are incompatible with the view schema, so schema can not be updated
90
90
  return UpdateType.Incompatible;
91
91
  }
92
- assert(compatibility.write === Compatibility.Incompatible, 0x8bd /* unexpected case */);
93
- assert(compatibility.read === Compatibility.Compatible, 0x8be /* unexpected case */);
92
+ assert(!compatibility.canView, 0x8bd /* unexpected case */);
93
+ assert(compatibility.canUpgrade, 0x8be /* unexpected case */);
94
94
  // eslint-disable-next-line no-bitwise
95
95
  return allowedSchemaModifications & AllowedUpdateType.SchemaCompatible
96
96
  ? UpdateType.SchemaCompatible
@@ -177,7 +177,7 @@ export function ensureSchema(viewSchema, allowedSchemaModifications, checkout, t
177
177
  return false;
178
178
  }
179
179
  case UpdateType.SchemaCompatible: {
180
- checkout.updateSchema(viewSchema.schema);
180
+ checkout.updateSchema(toStoredSchema(viewSchema.schema));
181
181
  return true;
182
182
  }
183
183
  case UpdateType.Initialize: {