@fluidframework/tree 2.3.1 → 2.4.0-297027

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 (674) hide show
  1. package/api-report/tree.alpha.api.md +77 -38
  2. package/api-report/tree.beta.api.md +50 -30
  3. package/api-report/tree.legacy.alpha.api.md +50 -30
  4. package/api-report/tree.legacy.public.api.md +50 -30
  5. package/api-report/tree.public.api.md +50 -30
  6. package/dist/alpha.d.ts +7 -0
  7. package/dist/beta.d.ts +4 -0
  8. package/dist/core/index.d.ts +1 -1
  9. package/dist/core/index.d.ts.map +1 -1
  10. package/dist/core/index.js +2 -1
  11. package/dist/core/index.js.map +1 -1
  12. package/dist/core/rebase/index.d.ts +1 -1
  13. package/dist/core/rebase/index.d.ts.map +1 -1
  14. package/dist/core/rebase/index.js +2 -1
  15. package/dist/core/rebase/index.js.map +1 -1
  16. package/dist/core/rebase/types.d.ts +1 -0
  17. package/dist/core/rebase/types.d.ts.map +1 -1
  18. package/dist/core/rebase/types.js +8 -1
  19. package/dist/core/rebase/types.js.map +1 -1
  20. package/dist/core/schema-stored/schema.d.ts +7 -0
  21. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  22. package/dist/core/schema-stored/schema.js +9 -0
  23. package/dist/core/schema-stored/schema.js.map +1 -1
  24. package/dist/core/tree/anchorSet.d.ts +1 -2
  25. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  26. package/dist/core/tree/anchorSet.js +2 -2
  27. package/dist/core/tree/anchorSet.js.map +1 -1
  28. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  29. package/dist/core/tree/detachedFieldIndex.js +13 -2
  30. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  31. package/dist/core/tree/detachedFieldIndexTypes.d.ts +1 -1
  32. package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
  33. package/dist/feature-libraries/editableTreeBinder.d.ts +3 -230
  34. package/dist/feature-libraries/editableTreeBinder.d.ts.map +1 -1
  35. package/dist/feature-libraries/editableTreeBinder.js +1 -539
  36. package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
  37. package/dist/feature-libraries/flex-tree/context.d.ts +7 -14
  38. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  39. package/dist/feature-libraries/flex-tree/context.js +3 -3
  40. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  41. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +2 -16
  42. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  43. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  44. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +2 -3
  45. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  46. package/dist/feature-libraries/flex-tree/lazyEntity.js +1 -2
  47. package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  48. package/dist/feature-libraries/flex-tree/lazyField.d.ts +10 -15
  49. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  50. package/dist/feature-libraries/flex-tree/lazyField.js +18 -20
  51. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  52. package/dist/feature-libraries/flex-tree/lazyNode.d.ts +4 -5
  53. package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  54. package/dist/feature-libraries/flex-tree/lazyNode.js +13 -23
  55. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  56. package/dist/feature-libraries/flex-tree/utilities.js +1 -1
  57. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  58. package/dist/feature-libraries/index.d.ts +4 -7
  59. package/dist/feature-libraries/index.d.ts.map +1 -1
  60. package/dist/feature-libraries/index.js +5 -31
  61. package/dist/feature-libraries/index.js.map +1 -1
  62. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +7 -0
  63. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  64. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +61 -17
  65. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  66. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  67. package/dist/feature-libraries/sequence-field/compose.js +3 -0
  68. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  69. package/dist/feature-libraries/sequence-field/formatV1.d.ts +18 -18
  70. package/dist/feature-libraries/sequence-field/formatV2.d.ts +18 -18
  71. package/dist/feature-libraries/sequence-field/formatV3.d.ts +27 -27
  72. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  73. package/dist/feature-libraries/sequence-field/utils.js +1 -4
  74. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  75. package/dist/feature-libraries/typed-schema/flexList.d.ts +1 -46
  76. package/dist/feature-libraries/typed-schema/flexList.d.ts.map +1 -1
  77. package/dist/feature-libraries/typed-schema/flexList.js +1 -13
  78. package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
  79. package/dist/feature-libraries/typed-schema/index.d.ts +2 -4
  80. package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
  81. package/dist/feature-libraries/typed-schema/index.js +1 -19
  82. package/dist/feature-libraries/typed-schema/index.js.map +1 -1
  83. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +0 -212
  84. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  85. package/dist/feature-libraries/typed-schema/typedTreeSchema.js +0 -266
  86. package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  87. package/dist/index.d.ts +3 -3
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js +2 -1
  90. package/dist/index.js.map +1 -1
  91. package/dist/internalTypes.d.ts +1 -1
  92. package/dist/internalTypes.d.ts.map +1 -1
  93. package/dist/internalTypes.js.map +1 -1
  94. package/dist/legacy.d.ts +4 -0
  95. package/dist/packageVersion.d.ts +1 -1
  96. package/dist/packageVersion.d.ts.map +1 -1
  97. package/dist/packageVersion.js +1 -1
  98. package/dist/packageVersion.js.map +1 -1
  99. package/dist/public.d.ts +4 -0
  100. package/dist/shared-tree/checkoutFlexTreeView.d.ts +3 -3
  101. package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
  102. package/dist/shared-tree/checkoutFlexTreeView.js +1 -1
  103. package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -1
  104. package/dist/shared-tree/index.d.ts +3 -3
  105. package/dist/shared-tree/index.d.ts.map +1 -1
  106. package/dist/shared-tree/index.js +2 -3
  107. package/dist/shared-tree/index.js.map +1 -1
  108. package/dist/shared-tree/schematizeTree.d.ts +1 -40
  109. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  110. package/dist/shared-tree/schematizeTree.js +2 -11
  111. package/dist/shared-tree/schematizeTree.js.map +1 -1
  112. package/dist/shared-tree/schematizingTreeView.d.ts +9 -7
  113. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  114. package/dist/shared-tree/schematizingTreeView.js +19 -8
  115. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  116. package/dist/shared-tree/sharedTree.d.ts +19 -2
  117. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  118. package/dist/shared-tree/sharedTree.js +10 -2
  119. package/dist/shared-tree/sharedTree.js.map +1 -1
  120. package/dist/shared-tree/treeCheckout.d.ts +71 -41
  121. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  122. package/dist/shared-tree/treeCheckout.js +116 -84
  123. package/dist/shared-tree/treeCheckout.js.map +1 -1
  124. package/dist/shared-tree-core/branch.d.ts +8 -11
  125. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  126. package/dist/shared-tree-core/branch.js +12 -15
  127. package/dist/shared-tree-core/branch.js.map +1 -1
  128. package/dist/simple-tree/api/create.d.ts +1 -1
  129. package/dist/simple-tree/api/create.d.ts.map +1 -1
  130. package/dist/simple-tree/api/create.js +11 -13
  131. package/dist/simple-tree/api/create.js.map +1 -1
  132. package/dist/simple-tree/api/getJsonSchema.d.ts +3 -3
  133. package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  134. package/dist/simple-tree/api/getJsonSchema.js +1 -1
  135. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  136. package/dist/simple-tree/api/getSimpleSchema.d.ts +2 -2
  137. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  138. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  139. package/dist/simple-tree/api/index.d.ts +2 -1
  140. package/dist/simple-tree/api/index.d.ts.map +1 -1
  141. package/dist/simple-tree/api/index.js +3 -1
  142. package/dist/simple-tree/api/index.js.map +1 -1
  143. package/dist/simple-tree/api/jsonSchema.d.ts +13 -14
  144. package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -1
  145. package/dist/simple-tree/api/jsonSchema.js.map +1 -1
  146. package/dist/simple-tree/api/schemaFactory.d.ts +14 -8
  147. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  148. package/dist/simple-tree/api/schemaFactory.js +21 -2
  149. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  150. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +3 -3
  151. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  152. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  153. package/dist/simple-tree/api/simpleSchema.d.ts +18 -10
  154. package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -1
  155. package/dist/simple-tree/api/simpleSchema.js.map +1 -1
  156. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  157. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +30 -17
  158. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  159. package/dist/simple-tree/api/tree.d.ts +16 -6
  160. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  161. package/dist/simple-tree/api/tree.js +4 -4
  162. package/dist/simple-tree/api/tree.js.map +1 -1
  163. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  164. package/dist/simple-tree/api/treeNodeApi.js +8 -6
  165. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  166. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  167. package/dist/simple-tree/api/verboseTree.js +6 -10
  168. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  169. package/{lib/feature-libraries/typed-schema → dist/simple-tree/api}/view.d.ts +4 -11
  170. package/dist/simple-tree/api/view.d.ts.map +1 -0
  171. package/dist/{feature-libraries/typed-schema → simple-tree/api}/view.js +9 -9
  172. package/dist/simple-tree/api/view.js.map +1 -0
  173. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +2 -2
  174. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  175. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +11 -1
  176. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  177. package/dist/simple-tree/arrayNode.d.ts +147 -14
  178. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  179. package/dist/simple-tree/arrayNode.js +32 -20
  180. package/dist/simple-tree/arrayNode.js.map +1 -1
  181. package/dist/simple-tree/core/context.d.ts +55 -0
  182. package/dist/simple-tree/core/context.d.ts.map +1 -0
  183. package/dist/simple-tree/core/context.js +60 -0
  184. package/dist/simple-tree/core/context.js.map +1 -0
  185. package/dist/simple-tree/core/getOrCreateNode.d.ts +15 -0
  186. package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -0
  187. package/dist/simple-tree/core/getOrCreateNode.js +36 -0
  188. package/dist/simple-tree/core/getOrCreateNode.js.map +1 -0
  189. package/dist/simple-tree/core/index.d.ts +7 -3
  190. package/dist/simple-tree/core/index.d.ts.map +1 -1
  191. package/dist/simple-tree/core/index.js +16 -7
  192. package/dist/simple-tree/core/index.js.map +1 -1
  193. package/dist/simple-tree/core/schemaCaching.d.ts +5 -13
  194. package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -1
  195. package/dist/simple-tree/core/schemaCaching.js +16 -45
  196. package/dist/simple-tree/core/schemaCaching.js.map +1 -1
  197. package/dist/simple-tree/core/treeNodeKernel.d.ts +29 -7
  198. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  199. package/dist/simple-tree/core/treeNodeKernel.js +94 -58
  200. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  201. package/dist/simple-tree/core/treeNodeSchema.d.ts +24 -0
  202. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  203. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  204. package/dist/simple-tree/core/types.d.ts +0 -5
  205. package/dist/simple-tree/core/types.d.ts.map +1 -1
  206. package/dist/simple-tree/core/types.js.map +1 -1
  207. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +139 -0
  208. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -0
  209. package/dist/{feature-libraries/flex-map-tree/mapTreeNode.js → simple-tree/core/unhydratedFlexTree.js} +112 -132
  210. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -0
  211. package/dist/simple-tree/{walkSchema.d.ts → core/walkSchema.d.ts} +8 -4
  212. package/dist/simple-tree/core/walkSchema.d.ts.map +1 -0
  213. package/dist/simple-tree/core/walkSchema.js +34 -0
  214. package/dist/simple-tree/core/walkSchema.js.map +1 -0
  215. package/dist/simple-tree/createContext.d.ts +11 -0
  216. package/dist/simple-tree/createContext.d.ts.map +1 -0
  217. package/dist/simple-tree/createContext.js +25 -0
  218. package/dist/simple-tree/createContext.js.map +1 -0
  219. package/dist/simple-tree/index.d.ts +4 -5
  220. package/dist/simple-tree/index.d.ts.map +1 -1
  221. package/dist/simple-tree/index.js +7 -7
  222. package/dist/simple-tree/index.js.map +1 -1
  223. package/dist/simple-tree/leafNodeSchema.d.ts +1 -0
  224. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  225. package/dist/simple-tree/leafNodeSchema.js +1 -2
  226. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  227. package/dist/simple-tree/mapNode.d.ts +4 -4
  228. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  229. package/dist/simple-tree/mapNode.js +9 -5
  230. package/dist/simple-tree/mapNode.js.map +1 -1
  231. package/dist/simple-tree/objectNode.d.ts +8 -8
  232. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  233. package/dist/simple-tree/objectNode.js +33 -14
  234. package/dist/simple-tree/objectNode.js.map +1 -1
  235. package/dist/simple-tree/objectNodeTypes.d.ts +7 -3
  236. package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -1
  237. package/dist/simple-tree/objectNodeTypes.js.map +1 -1
  238. package/dist/simple-tree/proxies.d.ts +1 -2
  239. package/dist/simple-tree/proxies.d.ts.map +1 -1
  240. package/dist/simple-tree/proxies.js +6 -22
  241. package/dist/simple-tree/proxies.js.map +1 -1
  242. package/dist/simple-tree/schemaTypes.d.ts +44 -4
  243. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  244. package/dist/simple-tree/schemaTypes.js +10 -0
  245. package/dist/simple-tree/schemaTypes.js.map +1 -1
  246. package/dist/simple-tree/toFlexSchema.d.ts +6 -36
  247. package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
  248. package/dist/simple-tree/toFlexSchema.js +58 -142
  249. package/dist/simple-tree/toFlexSchema.js.map +1 -1
  250. package/dist/simple-tree/toMapTree.d.ts.map +1 -1
  251. package/dist/simple-tree/toMapTree.js +2 -2
  252. package/dist/simple-tree/toMapTree.js.map +1 -1
  253. package/dist/simple-tree/treeNodeValid.d.ts +13 -5
  254. package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
  255. package/dist/simple-tree/treeNodeValid.js +19 -10
  256. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  257. package/dist/simple-tree/typesUnsafe.d.ts +4 -4
  258. package/dist/simple-tree/typesUnsafe.d.ts.map +1 -1
  259. package/dist/simple-tree/typesUnsafe.js.map +1 -1
  260. package/dist/simple-tree/walkFieldSchema.d.ts +11 -0
  261. package/dist/simple-tree/walkFieldSchema.d.ts.map +1 -0
  262. package/dist/simple-tree/walkFieldSchema.js +17 -0
  263. package/dist/simple-tree/walkFieldSchema.js.map +1 -0
  264. package/dist/util/index.d.ts +1 -1
  265. package/dist/util/index.d.ts.map +1 -1
  266. package/dist/util/index.js.map +1 -1
  267. package/dist/util/typeUtils.d.ts +14 -45
  268. package/dist/util/typeUtils.d.ts.map +1 -1
  269. package/dist/util/typeUtils.js.map +1 -1
  270. package/lib/alpha.d.ts +7 -0
  271. package/lib/beta.d.ts +4 -0
  272. package/lib/core/index.d.ts +1 -1
  273. package/lib/core/index.d.ts.map +1 -1
  274. package/lib/core/index.js +1 -1
  275. package/lib/core/index.js.map +1 -1
  276. package/lib/core/rebase/index.d.ts +1 -1
  277. package/lib/core/rebase/index.d.ts.map +1 -1
  278. package/lib/core/rebase/index.js +1 -1
  279. package/lib/core/rebase/index.js.map +1 -1
  280. package/lib/core/rebase/types.d.ts +1 -0
  281. package/lib/core/rebase/types.d.ts.map +1 -1
  282. package/lib/core/rebase/types.js +6 -0
  283. package/lib/core/rebase/types.js.map +1 -1
  284. package/lib/core/schema-stored/schema.d.ts +7 -0
  285. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  286. package/lib/core/schema-stored/schema.js +9 -0
  287. package/lib/core/schema-stored/schema.js.map +1 -1
  288. package/lib/core/tree/anchorSet.d.ts +1 -2
  289. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  290. package/lib/core/tree/anchorSet.js +2 -2
  291. package/lib/core/tree/anchorSet.js.map +1 -1
  292. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  293. package/lib/core/tree/detachedFieldIndex.js +13 -2
  294. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  295. package/lib/core/tree/detachedFieldIndexTypes.d.ts +1 -1
  296. package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
  297. package/lib/feature-libraries/editableTreeBinder.d.ts +3 -230
  298. package/lib/feature-libraries/editableTreeBinder.d.ts.map +1 -1
  299. package/lib/feature-libraries/editableTreeBinder.js +1 -532
  300. package/lib/feature-libraries/editableTreeBinder.js.map +1 -1
  301. package/lib/feature-libraries/flex-tree/context.d.ts +7 -14
  302. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  303. package/lib/feature-libraries/flex-tree/context.js +3 -3
  304. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  305. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +2 -16
  306. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  307. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  308. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +2 -3
  309. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  310. package/lib/feature-libraries/flex-tree/lazyEntity.js +1 -2
  311. package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  312. package/lib/feature-libraries/flex-tree/lazyField.d.ts +10 -15
  313. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  314. package/lib/feature-libraries/flex-tree/lazyField.js +18 -20
  315. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  316. package/lib/feature-libraries/flex-tree/lazyNode.d.ts +4 -5
  317. package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  318. package/lib/feature-libraries/flex-tree/lazyNode.js +13 -23
  319. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  320. package/lib/feature-libraries/flex-tree/utilities.js +1 -1
  321. package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
  322. package/lib/feature-libraries/index.d.ts +4 -7
  323. package/lib/feature-libraries/index.d.ts.map +1 -1
  324. package/lib/feature-libraries/index.js +4 -6
  325. package/lib/feature-libraries/index.js.map +1 -1
  326. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +7 -0
  327. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  328. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +62 -18
  329. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  330. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  331. package/lib/feature-libraries/sequence-field/compose.js +3 -0
  332. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  333. package/lib/feature-libraries/sequence-field/formatV1.d.ts +18 -18
  334. package/lib/feature-libraries/sequence-field/formatV2.d.ts +18 -18
  335. package/lib/feature-libraries/sequence-field/formatV3.d.ts +27 -27
  336. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  337. package/lib/feature-libraries/sequence-field/utils.js +2 -5
  338. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  339. package/lib/feature-libraries/typed-schema/flexList.d.ts +1 -46
  340. package/lib/feature-libraries/typed-schema/flexList.d.ts.map +1 -1
  341. package/lib/feature-libraries/typed-schema/flexList.js +0 -11
  342. package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
  343. package/lib/feature-libraries/typed-schema/index.d.ts +2 -4
  344. package/lib/feature-libraries/typed-schema/index.d.ts.map +1 -1
  345. package/lib/feature-libraries/typed-schema/index.js +0 -3
  346. package/lib/feature-libraries/typed-schema/index.js.map +1 -1
  347. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +0 -212
  348. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  349. package/lib/feature-libraries/typed-schema/typedTreeSchema.js +1 -253
  350. package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  351. package/lib/index.d.ts +3 -3
  352. package/lib/index.d.ts.map +1 -1
  353. package/lib/index.js +1 -1
  354. package/lib/index.js.map +1 -1
  355. package/lib/internalTypes.d.ts +1 -1
  356. package/lib/internalTypes.d.ts.map +1 -1
  357. package/lib/internalTypes.js.map +1 -1
  358. package/lib/legacy.d.ts +4 -0
  359. package/lib/packageVersion.d.ts +1 -1
  360. package/lib/packageVersion.d.ts.map +1 -1
  361. package/lib/packageVersion.js +1 -1
  362. package/lib/packageVersion.js.map +1 -1
  363. package/lib/public.d.ts +4 -0
  364. package/lib/shared-tree/checkoutFlexTreeView.d.ts +3 -3
  365. package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
  366. package/lib/shared-tree/checkoutFlexTreeView.js +1 -1
  367. package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -1
  368. package/lib/shared-tree/index.d.ts +3 -3
  369. package/lib/shared-tree/index.d.ts.map +1 -1
  370. package/lib/shared-tree/index.js +1 -2
  371. package/lib/shared-tree/index.js.map +1 -1
  372. package/lib/shared-tree/schematizeTree.d.ts +1 -40
  373. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  374. package/lib/shared-tree/schematizeTree.js +1 -9
  375. package/lib/shared-tree/schematizeTree.js.map +1 -1
  376. package/lib/shared-tree/schematizingTreeView.d.ts +9 -7
  377. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  378. package/lib/shared-tree/schematizingTreeView.js +22 -11
  379. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  380. package/lib/shared-tree/sharedTree.d.ts +19 -2
  381. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  382. package/lib/shared-tree/sharedTree.js +10 -3
  383. package/lib/shared-tree/sharedTree.js.map +1 -1
  384. package/lib/shared-tree/treeCheckout.d.ts +71 -41
  385. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  386. package/lib/shared-tree/treeCheckout.js +118 -86
  387. package/lib/shared-tree/treeCheckout.js.map +1 -1
  388. package/lib/shared-tree-core/branch.d.ts +8 -11
  389. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  390. package/lib/shared-tree-core/branch.js +12 -15
  391. package/lib/shared-tree-core/branch.js.map +1 -1
  392. package/lib/simple-tree/api/create.d.ts +1 -1
  393. package/lib/simple-tree/api/create.d.ts.map +1 -1
  394. package/lib/simple-tree/api/create.js +14 -16
  395. package/lib/simple-tree/api/create.js.map +1 -1
  396. package/lib/simple-tree/api/getJsonSchema.d.ts +3 -3
  397. package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  398. package/lib/simple-tree/api/getJsonSchema.js +1 -1
  399. package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
  400. package/lib/simple-tree/api/getSimpleSchema.d.ts +2 -2
  401. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  402. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
  403. package/lib/simple-tree/api/index.d.ts +2 -1
  404. package/lib/simple-tree/api/index.d.ts.map +1 -1
  405. package/lib/simple-tree/api/index.js +1 -0
  406. package/lib/simple-tree/api/index.js.map +1 -1
  407. package/lib/simple-tree/api/jsonSchema.d.ts +13 -14
  408. package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -1
  409. package/lib/simple-tree/api/jsonSchema.js.map +1 -1
  410. package/lib/simple-tree/api/schemaFactory.d.ts +14 -8
  411. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  412. package/lib/simple-tree/api/schemaFactory.js +21 -2
  413. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  414. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +3 -3
  415. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  416. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  417. package/lib/simple-tree/api/simpleSchema.d.ts +18 -10
  418. package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -1
  419. package/lib/simple-tree/api/simpleSchema.js.map +1 -1
  420. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  421. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +31 -18
  422. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  423. package/lib/simple-tree/api/tree.d.ts +16 -6
  424. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  425. package/lib/simple-tree/api/tree.js +4 -4
  426. package/lib/simple-tree/api/tree.js.map +1 -1
  427. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  428. package/lib/simple-tree/api/treeNodeApi.js +10 -8
  429. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  430. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  431. package/lib/simple-tree/api/verboseTree.js +6 -10
  432. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  433. package/{dist/feature-libraries/typed-schema → lib/simple-tree/api}/view.d.ts +4 -11
  434. package/lib/simple-tree/api/view.d.ts.map +1 -0
  435. package/lib/{feature-libraries/typed-schema → simple-tree/api}/view.js +9 -9
  436. package/lib/simple-tree/api/view.js.map +1 -0
  437. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +2 -2
  438. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  439. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +11 -1
  440. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  441. package/lib/simple-tree/arrayNode.d.ts +147 -14
  442. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  443. package/lib/simple-tree/arrayNode.js +37 -25
  444. package/lib/simple-tree/arrayNode.js.map +1 -1
  445. package/lib/simple-tree/core/context.d.ts +55 -0
  446. package/lib/simple-tree/core/context.d.ts.map +1 -0
  447. package/lib/simple-tree/core/context.js +55 -0
  448. package/lib/simple-tree/core/context.js.map +1 -0
  449. package/lib/simple-tree/core/getOrCreateNode.d.ts +15 -0
  450. package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -0
  451. package/lib/simple-tree/core/getOrCreateNode.js +32 -0
  452. package/lib/simple-tree/core/getOrCreateNode.js.map +1 -0
  453. package/lib/simple-tree/core/index.d.ts +7 -3
  454. package/lib/simple-tree/core/index.d.ts.map +1 -1
  455. package/lib/simple-tree/core/index.js +6 -2
  456. package/lib/simple-tree/core/index.js.map +1 -1
  457. package/lib/simple-tree/core/schemaCaching.d.ts +5 -13
  458. package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -1
  459. package/lib/simple-tree/core/schemaCaching.js +13 -39
  460. package/lib/simple-tree/core/schemaCaching.js.map +1 -1
  461. package/lib/simple-tree/core/treeNodeKernel.d.ts +29 -7
  462. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  463. package/lib/simple-tree/core/treeNodeKernel.js +89 -54
  464. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  465. package/lib/simple-tree/core/treeNodeSchema.d.ts +24 -0
  466. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  467. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  468. package/lib/simple-tree/core/types.d.ts +0 -5
  469. package/lib/simple-tree/core/types.d.ts.map +1 -1
  470. package/lib/simple-tree/core/types.js.map +1 -1
  471. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +139 -0
  472. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -0
  473. package/lib/{feature-libraries/flex-map-tree/mapTreeNode.js → simple-tree/core/unhydratedFlexTree.js} +110 -128
  474. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -0
  475. package/lib/simple-tree/{walkSchema.d.ts → core/walkSchema.d.ts} +8 -4
  476. package/lib/simple-tree/core/walkSchema.d.ts.map +1 -0
  477. package/lib/simple-tree/core/walkSchema.js +29 -0
  478. package/lib/simple-tree/core/walkSchema.js.map +1 -0
  479. package/lib/simple-tree/createContext.d.ts +11 -0
  480. package/lib/simple-tree/createContext.d.ts.map +1 -0
  481. package/lib/simple-tree/createContext.js +21 -0
  482. package/lib/simple-tree/createContext.js.map +1 -0
  483. package/lib/simple-tree/index.d.ts +4 -5
  484. package/lib/simple-tree/index.d.ts.map +1 -1
  485. package/lib/simple-tree/index.js +3 -4
  486. package/lib/simple-tree/index.js.map +1 -1
  487. package/lib/simple-tree/leafNodeSchema.d.ts +1 -0
  488. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  489. package/lib/simple-tree/leafNodeSchema.js +3 -4
  490. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  491. package/lib/simple-tree/mapNode.d.ts +4 -4
  492. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  493. package/lib/simple-tree/mapNode.js +12 -8
  494. package/lib/simple-tree/mapNode.js.map +1 -1
  495. package/lib/simple-tree/objectNode.d.ts +8 -8
  496. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  497. package/lib/simple-tree/objectNode.js +36 -17
  498. package/lib/simple-tree/objectNode.js.map +1 -1
  499. package/lib/simple-tree/objectNodeTypes.d.ts +7 -3
  500. package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -1
  501. package/lib/simple-tree/objectNodeTypes.js.map +1 -1
  502. package/lib/simple-tree/proxies.d.ts +1 -2
  503. package/lib/simple-tree/proxies.d.ts.map +1 -1
  504. package/lib/simple-tree/proxies.js +7 -22
  505. package/lib/simple-tree/proxies.js.map +1 -1
  506. package/lib/simple-tree/schemaTypes.d.ts +44 -4
  507. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  508. package/lib/simple-tree/schemaTypes.js +10 -0
  509. package/lib/simple-tree/schemaTypes.js.map +1 -1
  510. package/lib/simple-tree/toFlexSchema.d.ts +6 -36
  511. package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
  512. package/lib/simple-tree/toFlexSchema.js +61 -142
  513. package/lib/simple-tree/toFlexSchema.js.map +1 -1
  514. package/lib/simple-tree/toMapTree.d.ts.map +1 -1
  515. package/lib/simple-tree/toMapTree.js +4 -4
  516. package/lib/simple-tree/toMapTree.js.map +1 -1
  517. package/lib/simple-tree/treeNodeValid.d.ts +13 -5
  518. package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
  519. package/lib/simple-tree/treeNodeValid.js +21 -12
  520. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  521. package/lib/simple-tree/typesUnsafe.d.ts +4 -4
  522. package/lib/simple-tree/typesUnsafe.d.ts.map +1 -1
  523. package/lib/simple-tree/typesUnsafe.js.map +1 -1
  524. package/lib/simple-tree/walkFieldSchema.d.ts +11 -0
  525. package/lib/simple-tree/walkFieldSchema.d.ts.map +1 -0
  526. package/lib/simple-tree/walkFieldSchema.js +13 -0
  527. package/lib/simple-tree/walkFieldSchema.js.map +1 -0
  528. package/lib/util/index.d.ts +1 -1
  529. package/lib/util/index.d.ts.map +1 -1
  530. package/lib/util/index.js.map +1 -1
  531. package/lib/util/typeUtils.d.ts +14 -45
  532. package/lib/util/typeUtils.d.ts.map +1 -1
  533. package/lib/util/typeUtils.js.map +1 -1
  534. package/package.json +41 -22
  535. package/src/core/index.ts +1 -0
  536. package/src/core/rebase/index.ts +1 -0
  537. package/src/core/rebase/types.ts +11 -0
  538. package/src/core/schema-stored/schema.ts +18 -0
  539. package/src/core/tree/anchorSet.ts +3 -4
  540. package/src/core/tree/detachedFieldIndex.ts +14 -3
  541. package/src/core/tree/detachedFieldIndexTypes.ts +1 -1
  542. package/src/feature-libraries/editableTreeBinder.ts +2 -915
  543. package/src/feature-libraries/flex-tree/context.ts +7 -20
  544. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +2 -18
  545. package/src/feature-libraries/flex-tree/lazyEntity.ts +1 -4
  546. package/src/feature-libraries/flex-tree/lazyField.ts +22 -78
  547. package/src/feature-libraries/flex-tree/lazyNode.ts +24 -39
  548. package/src/feature-libraries/flex-tree/utilities.ts +1 -1
  549. package/src/feature-libraries/index.ts +3 -71
  550. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +97 -10
  551. package/src/feature-libraries/sequence-field/compose.ts +3 -0
  552. package/src/feature-libraries/sequence-field/utils.ts +2 -4
  553. package/src/feature-libraries/typed-schema/flexList.ts +3 -84
  554. package/src/feature-libraries/typed-schema/index.ts +1 -33
  555. package/src/feature-libraries/typed-schema/typedTreeSchema.ts +0 -458
  556. package/src/index.ts +7 -0
  557. package/src/internalTypes.ts +0 -1
  558. package/src/packageVersion.ts +1 -1
  559. package/src/shared-tree/checkoutFlexTreeView.ts +3 -3
  560. package/src/shared-tree/index.ts +4 -8
  561. package/src/shared-tree/schematizeTree.ts +2 -56
  562. package/src/shared-tree/schematizingTreeView.ts +38 -15
  563. package/src/shared-tree/sharedTree.ts +36 -8
  564. package/src/shared-tree/treeCheckout.ts +225 -128
  565. package/src/shared-tree-core/branch.ts +15 -26
  566. package/src/simple-tree/api/create.ts +18 -20
  567. package/src/simple-tree/api/getJsonSchema.ts +3 -3
  568. package/src/simple-tree/api/getSimpleSchema.ts +2 -2
  569. package/src/simple-tree/api/index.ts +2 -0
  570. package/src/simple-tree/api/jsonSchema.ts +19 -17
  571. package/src/simple-tree/api/schemaFactory.ts +53 -18
  572. package/src/simple-tree/api/schemaFactoryRecursive.ts +3 -6
  573. package/src/simple-tree/api/simpleSchema.ts +20 -10
  574. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +40 -19
  575. package/src/simple-tree/api/tree.ts +20 -9
  576. package/src/simple-tree/api/treeNodeApi.ts +12 -10
  577. package/src/simple-tree/api/verboseTree.ts +6 -12
  578. package/src/{feature-libraries/typed-schema → simple-tree/api}/view.ts +9 -22
  579. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +18 -4
  580. package/src/simple-tree/arrayNode.ts +202 -53
  581. package/src/simple-tree/core/context.ts +78 -0
  582. package/src/simple-tree/core/getOrCreateNode.ts +38 -0
  583. package/src/simple-tree/core/index.ts +11 -7
  584. package/src/simple-tree/core/schemaCaching.ts +13 -50
  585. package/src/simple-tree/core/treeNodeKernel.ts +117 -78
  586. package/src/simple-tree/core/treeNodeSchema.ts +35 -1
  587. package/src/simple-tree/core/types.ts +0 -5
  588. package/src/{feature-libraries/flex-map-tree/mapTreeNode.ts → simple-tree/core/unhydratedFlexTree.ts} +167 -210
  589. package/src/simple-tree/{walkSchema.ts → core/walkSchema.ts} +12 -34
  590. package/src/simple-tree/createContext.ts +24 -0
  591. package/src/simple-tree/index.ts +6 -2
  592. package/src/simple-tree/leafNodeSchema.ts +3 -9
  593. package/src/simple-tree/mapNode.ts +20 -17
  594. package/src/simple-tree/objectNode.ts +63 -38
  595. package/src/simple-tree/objectNodeTypes.ts +8 -5
  596. package/src/simple-tree/proxies.ts +8 -26
  597. package/src/simple-tree/schemaTypes.ts +55 -5
  598. package/src/simple-tree/toFlexSchema.ts +71 -204
  599. package/src/simple-tree/toMapTree.ts +5 -5
  600. package/src/simple-tree/treeNodeValid.ts +28 -22
  601. package/src/simple-tree/typesUnsafe.ts +4 -4
  602. package/src/simple-tree/walkFieldSchema.ts +19 -0
  603. package/src/util/index.ts +1 -5
  604. package/src/util/typeUtils.ts +14 -56
  605. package/dist/feature-libraries/fieldGenerator.d.ts +0 -43
  606. package/dist/feature-libraries/fieldGenerator.d.ts.map +0 -1
  607. package/dist/feature-libraries/fieldGenerator.js +0 -13
  608. package/dist/feature-libraries/fieldGenerator.js.map +0 -1
  609. package/dist/feature-libraries/flex-map-tree/index.d.ts +0 -6
  610. package/dist/feature-libraries/flex-map-tree/index.d.ts.map +0 -1
  611. package/dist/feature-libraries/flex-map-tree/index.js +0 -14
  612. package/dist/feature-libraries/flex-map-tree/index.js.map +0 -1
  613. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +0 -157
  614. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +0 -1
  615. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +0 -1
  616. package/dist/feature-libraries/storedToViewSchema.d.ts +0 -17
  617. package/dist/feature-libraries/storedToViewSchema.d.ts.map +0 -1
  618. package/dist/feature-libraries/storedToViewSchema.js +0 -67
  619. package/dist/feature-libraries/storedToViewSchema.js.map +0 -1
  620. package/dist/feature-libraries/typed-schema/schemaCollection.d.ts +0 -58
  621. package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +0 -1
  622. package/dist/feature-libraries/typed-schema/schemaCollection.js +0 -160
  623. package/dist/feature-libraries/typed-schema/schemaCollection.js.map +0 -1
  624. package/dist/feature-libraries/typed-schema/typeUtils.d.ts +0 -15
  625. package/dist/feature-libraries/typed-schema/typeUtils.d.ts.map +0 -1
  626. package/dist/feature-libraries/typed-schema/typeUtils.js +0 -14
  627. package/dist/feature-libraries/typed-schema/typeUtils.js.map +0 -1
  628. package/dist/feature-libraries/typed-schema/view.d.ts.map +0 -1
  629. package/dist/feature-libraries/typed-schema/view.js.map +0 -1
  630. package/dist/simple-tree/getSimpleFieldSchema.d.ts +0 -14
  631. package/dist/simple-tree/getSimpleFieldSchema.d.ts.map +0 -1
  632. package/dist/simple-tree/getSimpleFieldSchema.js +0 -29
  633. package/dist/simple-tree/getSimpleFieldSchema.js.map +0 -1
  634. package/dist/simple-tree/walkSchema.d.ts.map +0 -1
  635. package/dist/simple-tree/walkSchema.js +0 -49
  636. package/dist/simple-tree/walkSchema.js.map +0 -1
  637. package/lib/feature-libraries/fieldGenerator.d.ts +0 -43
  638. package/lib/feature-libraries/fieldGenerator.d.ts.map +0 -1
  639. package/lib/feature-libraries/fieldGenerator.js +0 -12
  640. package/lib/feature-libraries/fieldGenerator.js.map +0 -1
  641. package/lib/feature-libraries/flex-map-tree/index.d.ts +0 -6
  642. package/lib/feature-libraries/flex-map-tree/index.d.ts.map +0 -1
  643. package/lib/feature-libraries/flex-map-tree/index.js +0 -6
  644. package/lib/feature-libraries/flex-map-tree/index.js.map +0 -1
  645. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +0 -157
  646. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +0 -1
  647. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +0 -1
  648. package/lib/feature-libraries/storedToViewSchema.d.ts +0 -17
  649. package/lib/feature-libraries/storedToViewSchema.d.ts.map +0 -1
  650. package/lib/feature-libraries/storedToViewSchema.js +0 -62
  651. package/lib/feature-libraries/storedToViewSchema.js.map +0 -1
  652. package/lib/feature-libraries/typed-schema/schemaCollection.d.ts +0 -58
  653. package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +0 -1
  654. package/lib/feature-libraries/typed-schema/schemaCollection.js +0 -153
  655. package/lib/feature-libraries/typed-schema/schemaCollection.js.map +0 -1
  656. package/lib/feature-libraries/typed-schema/typeUtils.d.ts +0 -15
  657. package/lib/feature-libraries/typed-schema/typeUtils.d.ts.map +0 -1
  658. package/lib/feature-libraries/typed-schema/typeUtils.js +0 -10
  659. package/lib/feature-libraries/typed-schema/typeUtils.js.map +0 -1
  660. package/lib/feature-libraries/typed-schema/view.d.ts.map +0 -1
  661. package/lib/feature-libraries/typed-schema/view.js.map +0 -1
  662. package/lib/simple-tree/getSimpleFieldSchema.d.ts +0 -14
  663. package/lib/simple-tree/getSimpleFieldSchema.d.ts.map +0 -1
  664. package/lib/simple-tree/getSimpleFieldSchema.js +0 -25
  665. package/lib/simple-tree/getSimpleFieldSchema.js.map +0 -1
  666. package/lib/simple-tree/walkSchema.d.ts.map +0 -1
  667. package/lib/simple-tree/walkSchema.js +0 -43
  668. package/lib/simple-tree/walkSchema.js.map +0 -1
  669. package/src/feature-libraries/fieldGenerator.ts +0 -47
  670. package/src/feature-libraries/flex-map-tree/index.ts +0 -14
  671. package/src/feature-libraries/storedToViewSchema.ts +0 -100
  672. package/src/feature-libraries/typed-schema/schemaCollection.ts +0 -254
  673. package/src/feature-libraries/typed-schema/typeUtils.ts +0 -29
  674. package/src/simple-tree/getSimpleFieldSchema.ts +0 -36
@@ -1 +1 @@
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,qBAAqB,EACrB,gBAAgB,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAgB,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACh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C,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\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\tif (a === undefined || b === undefined) {\n\t\treturn a === b;\n\t}\n\treturn areEqualChangeAtomIds(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,GAGhB,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EAeN,YAAY,GAIZ,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,OAAO,CAAC,MAAiB;IACxC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC3D,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;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H,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"]}
@@ -23,14 +23,10 @@ export declare function markEager<T>(t: T): T;
23
23
  * @system @public
24
24
  */
25
25
  export type FlexList<Item = unknown> = readonly LazyItem<Item>[];
26
- /**
27
- * Given a `FlexList` of eager and lazy items, return an equivalent list where all items are lazy.
28
- */
29
- export declare function normalizeFlexListLazy<List extends FlexList>(t: List): FlexListToLazyArray<List>;
30
26
  /**
31
27
  * Given a `FlexList` of eager and lazy items, return an equivalent list where all items are eager.
32
28
  */
33
- export declare function normalizeFlexListEager<List extends FlexList>(t: List): FlexListToNonLazyArray<List>;
29
+ export declare function normalizeFlexListEager<T>(t: FlexList<T>): T[];
34
30
  /**
35
31
  * An "eager" or "lazy" Item in a `FlexList`.
36
32
  * Lazy items are wrapped in a function to allow referring to themselves before they are declared.
@@ -38,55 +34,14 @@ export declare function normalizeFlexListEager<List extends FlexList>(t: List):
38
34
  * @public
39
35
  */
40
36
  export type LazyItem<Item = unknown> = Item | (() => Item);
41
- /**
42
- */
43
- export type NormalizedFlexList<Item> = readonly Item[];
44
- export type NormalizedLazyFlexList<Item> = (() => Item)[];
45
37
  /**
46
38
  * Get the `Item` type from a `LazyItem<Item>`.
47
39
  * @system @public
48
40
  */
49
41
  export type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result ? Result : Item;
50
- /**
51
- */
52
- export type ExtractListItemType<List extends FlexList> = List extends FlexList<infer Item> ? Item : unknown;
53
- export type NormalizeLazyItem<List extends LazyItem> = List extends () => unknown ? List : () => List;
54
- /**
55
- * Normalize FlexList type to a non-lazy array.
56
- */
57
- export type FlexListToNonLazyArray<List extends FlexList> = ArrayHasFixedLength<List> extends true ? ConstantFlexListToNonLazyArray<List> : NormalizedFlexList<ExtractListItemType<List>>;
58
42
  /**
59
43
  * Normalize FlexList type to a union.
60
44
  * @system @public
61
45
  */
62
46
  export type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;
63
- /**
64
- * Normalize FlexList type to a non-lazy array.
65
- */
66
- export type ConstantFlexListToNonLazyArray<List extends FlexList> = List extends readonly [
67
- infer Head,
68
- ...infer Tail
69
- ] ? [ExtractItemType<Head>, ...ConstantFlexListToNonLazyArray<Tail>] : [];
70
- /**
71
- * Detect if an array is a Tuple (fixed length) or unknown length.
72
- *
73
- * Types which many have one of multiple fixed lengths (like `[] | [0]`) count as having a fixed length.
74
- *
75
- * @remarks
76
- * Type operations designed to work on tuples can often behave very badly on regular arrays.
77
- * For example recursive patterns for processing them often just return the base case,
78
- * losing all the type information.
79
- */
80
- export type ArrayHasFixedLength<List extends readonly unknown[]> = number extends List["length"] ? false : true;
81
- /**
82
- * Normalize FlexList type to a lazy array.
83
- */
84
- export type FlexListToLazyArray<List extends FlexList> = ArrayHasFixedLength<List> extends true ? ConstantFlexListToLazyArray<List> : NormalizedLazyFlexList<ExtractListItemType<List>>;
85
- /**
86
- * Normalize FlexList type to a lazy array.
87
- */
88
- export type ConstantFlexListToLazyArray<List extends FlexList> = List extends readonly [
89
- infer Head,
90
- ...infer Tail
91
- ] ? [NormalizeLazyItem<Head>, ...ConstantFlexListToLazyArray<Tail>] : [];
92
47
  //# sourceMappingURL=flexList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"flexList.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/flexList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,gFAAgF;AAChF,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,MAAM,IAAI,CAErE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CASpC;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,CAAC,IAAI,GA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AM,QAAQ,CAAC,IAAI,GAAG,OAAO,IAAI,SAAS,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;AAEjE;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAQ7D;AAED;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,CAAC,IAAI,GAAG,OAAO,IAAI,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,IAAI,SAAS,QAAQ,IAAI,IAAI,SAAS,MAAM,MAAM,MAAM,GACjF,MAAM,GACN,IAAI,CAAC;AAER;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,KAAK,SAAS,QAAQ,IAAI,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC"}
@@ -25,17 +25,6 @@ export function markEager(t) {
25
25
  })
26
26
  : t;
27
27
  }
28
- /**
29
- * Given a `FlexList` of eager and lazy items, return an equivalent list where all items are lazy.
30
- */
31
- export function normalizeFlexListLazy(t) {
32
- return t.map((value) => {
33
- if (isLazy(value)) {
34
- return value;
35
- }
36
- return () => value;
37
- });
38
- }
39
28
  /**
40
29
  * Given a `FlexList` of eager and lazy items, return an equivalent list where all items are eager.
41
30
  */
@@ -1 +1 @@
1
- {"version":3,"file":"flexList.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/flexList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,iDAAiD;AACjD,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAU/C,gFAAgF;AAChF,MAAM,UAAU,MAAM,CAAO,IAAoB;IAChD,OAAO,OAAO,IAAI,KAAK,UAAU,IAAK,IAA6B,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;AAC7F,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAI,CAAI;IAChC,OAAO,MAAM,CAAC,CAAC,CAAC;QACf,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE;YACxC,KAAK,EAAE,IAAI;YACX,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,KAAK;SACf,CAAC;QACH,CAAC,CAAC,CAAC,CAAC;AACN,CAAC;AAcD;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACpC,CAAO;IAEP,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,KAAe,EAAE,EAAE;QAChC,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACnB,OAAO,KAAK,CAAC;QACd,CAAC;QACD,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC;IACpB,CAAC,CAA8B,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACrC,CAAO;IAEP,MAAM,IAAI,GAAuB,CAAC,CAAC,GAAG,CAAC,CAAC,KAAe,EAAE,EAAE;QAC1D,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACnB,OAAO,KAAK,EAAE,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;IACH,OAAO,IAAoC,CAAC;AAC7C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/** A symbol used to identify a `MarkedEager`. */\nconst flexListEager = Symbol(\"FlexList Eager\");\n\n/**\n * An object that has been marked as eager (as opposed to lazy) when used as an item in a `FlexList`.\n * It will be considered to be an eager item in a `FlexList` even if it is a function.\n */\ninterface MarkedEager {\n\t[flexListEager]: true;\n}\n\n/** Returns true iff the given item is a function and is not a `MarkedEager`. */\nexport function isLazy<Item>(item: LazyItem<Item>): item is () => Item {\n\treturn typeof item === \"function\" && (item as Partial<MarkedEager>)[flexListEager] !== true;\n}\n\n/**\n * Mark the given object as an eager item in a `FlexList`.\n * @remarks\n * This only has an effect on function objects that would otherwise be considered to be lazy items in a `FlexList`.\n * @param t - The object to mark as eager.\n * @returns `t`, marked as eager if applicable.\n */\nexport function markEager<T>(t: T): T {\n\treturn isLazy(t)\n\t\t? Object.defineProperty(t, flexListEager, {\n\t\t\t\tvalue: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\twritable: false,\n\t\t\t})\n\t\t: t;\n}\n\n/**\n * A flexible way to list values.\n * Each item in the list can either be an \"eager\" **value** or a \"lazy\" **function that returns a value** (the latter allows cyclic references to work).\n * @privateRemarks\n * By default, items that are of type `\"function\"` will be considered lazy and all other items will be considered eager.\n * To force a `\"function\"` item to be treated as an eager item, call `markEager` before putting it in the list.\n * This is necessary e.g. when the eager list items are function types and the lazy items are functions that _return_ function types.\n * `FlexList`s are processed by `normalizeFlexList` and `normalizeFlexListEager`.\n * @system @public\n */\nexport type FlexList<Item = unknown> = readonly LazyItem<Item>[];\n\n/**\n * Given a `FlexList` of eager and lazy items, return an equivalent list where all items are lazy.\n */\nexport function normalizeFlexListLazy<List extends FlexList>(\n\tt: List,\n): FlexListToLazyArray<List> {\n\treturn t.map((value: LazyItem) => {\n\t\tif (isLazy(value)) {\n\t\t\treturn value;\n\t\t}\n\t\treturn () => value;\n\t}) as FlexListToLazyArray<List>;\n}\n\n/**\n * Given a `FlexList` of eager and lazy items, return an equivalent list where all items are eager.\n */\nexport function normalizeFlexListEager<List extends FlexList>(\n\tt: List,\n): FlexListToNonLazyArray<List> {\n\tconst data: readonly unknown[] = t.map((value: LazyItem) => {\n\t\tif (isLazy(value)) {\n\t\t\treturn value();\n\t\t}\n\t\treturn value;\n\t});\n\treturn data as FlexListToNonLazyArray<List>;\n}\n\n/**\n * An \"eager\" or \"lazy\" Item in a `FlexList`.\n * Lazy items are wrapped in a function to allow referring to themselves before they are declared.\n * This makes recursive and co-recursive items possible.\n * @public\n */\nexport type LazyItem<Item = unknown> = Item | (() => Item);\n\n/**\n */\nexport type NormalizedFlexList<Item> = readonly Item[];\n\nexport type NormalizedLazyFlexList<Item> = (() => Item)[];\n\n/**\n * Get the `Item` type from a `LazyItem<Item>`.\n * @system @public\n */\nexport type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result\n\t? Result\n\t: Item;\n\n/**\n */\nexport type ExtractListItemType<List extends FlexList> = List extends FlexList<infer Item>\n\t? Item\n\t: unknown;\n\nexport type NormalizeLazyItem<List extends LazyItem> = List extends () => unknown\n\t? List\n\t: () => List;\n\n/**\n * Normalize FlexList type to a non-lazy array.\n */\nexport type FlexListToNonLazyArray<List extends FlexList> =\n\tArrayHasFixedLength<List> extends true\n\t\t? ConstantFlexListToNonLazyArray<List>\n\t\t: NormalizedFlexList<ExtractListItemType<List>>;\n\n/**\n * Normalize FlexList type to a union.\n * @system @public\n */\nexport type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;\n\n/**\n * Normalize FlexList type to a non-lazy array.\n */\nexport type ConstantFlexListToNonLazyArray<List extends FlexList> = List extends readonly [\n\tinfer Head,\n\t...infer Tail,\n]\n\t? [ExtractItemType<Head>, ...ConstantFlexListToNonLazyArray<Tail>]\n\t: [];\n\n/**\n * Detect if an array is a Tuple (fixed length) or unknown length.\n *\n * Types which many have one of multiple fixed lengths (like `[] | [0]`) count as having a fixed length.\n *\n * @remarks\n * Type operations designed to work on tuples can often behave very badly on regular arrays.\n * For example recursive patterns for processing them often just return the base case,\n * losing all the type information.\n */\n// This works by determining if the length is `number` (and not a specific number).\nexport type ArrayHasFixedLength<List extends readonly unknown[]> =\n\tnumber extends List[\"length\"] ? false : true;\n\n/**\n * Normalize FlexList type to a lazy array.\n */\nexport type FlexListToLazyArray<List extends FlexList> = ArrayHasFixedLength<List> extends true\n\t? ConstantFlexListToLazyArray<List>\n\t: NormalizedLazyFlexList<ExtractListItemType<List>>;\n\n/**\n * Normalize FlexList type to a lazy array.\n */\nexport type ConstantFlexListToLazyArray<List extends FlexList> = List extends readonly [\n\tinfer Head,\n\t...infer Tail,\n]\n\t? [NormalizeLazyItem<Head>, ...ConstantFlexListToLazyArray<Tail>]\n\t: [];\n"]}
1
+ {"version":3,"file":"flexList.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/flexList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,iDAAiD;AACjD,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAU/C,gFAAgF;AAChF,MAAM,UAAU,MAAM,CAAO,IAAoB;IAChD,OAAO,OAAO,IAAI,KAAK,UAAU,IAAK,IAA6B,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;AAC7F,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAI,CAAI;IAChC,OAAO,MAAM,CAAC,CAAC,CAAC;QACf,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE;YACxC,KAAK,EAAE,IAAI;YACX,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,KAAK;SACf,CAAC;QACH,CAAC,CAAC,CAAC,CAAC;AACN,CAAC;AAcD;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAI,CAAc;IACvD,MAAM,IAAI,GAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,KAAkB,EAAE,EAAE;QAC9C,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACnB,OAAO,KAAK,EAAE,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/** A symbol used to identify a `MarkedEager`. */\nconst flexListEager = Symbol(\"FlexList Eager\");\n\n/**\n * An object that has been marked as eager (as opposed to lazy) when used as an item in a `FlexList`.\n * It will be considered to be an eager item in a `FlexList` even if it is a function.\n */\ninterface MarkedEager {\n\t[flexListEager]: true;\n}\n\n/** Returns true iff the given item is a function and is not a `MarkedEager`. */\nexport function isLazy<Item>(item: LazyItem<Item>): item is () => Item {\n\treturn typeof item === \"function\" && (item as Partial<MarkedEager>)[flexListEager] !== true;\n}\n\n/**\n * Mark the given object as an eager item in a `FlexList`.\n * @remarks\n * This only has an effect on function objects that would otherwise be considered to be lazy items in a `FlexList`.\n * @param t - The object to mark as eager.\n * @returns `t`, marked as eager if applicable.\n */\nexport function markEager<T>(t: T): T {\n\treturn isLazy(t)\n\t\t? Object.defineProperty(t, flexListEager, {\n\t\t\t\tvalue: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\twritable: false,\n\t\t\t})\n\t\t: t;\n}\n\n/**\n * A flexible way to list values.\n * Each item in the list can either be an \"eager\" **value** or a \"lazy\" **function that returns a value** (the latter allows cyclic references to work).\n * @privateRemarks\n * By default, items that are of type `\"function\"` will be considered lazy and all other items will be considered eager.\n * To force a `\"function\"` item to be treated as an eager item, call `markEager` before putting it in the list.\n * This is necessary e.g. when the eager list items are function types and the lazy items are functions that _return_ function types.\n * `FlexList`s are processed by `normalizeFlexList` and `normalizeFlexListEager`.\n * @system @public\n */\nexport type FlexList<Item = unknown> = readonly LazyItem<Item>[];\n\n/**\n * Given a `FlexList` of eager and lazy items, return an equivalent list where all items are eager.\n */\nexport function normalizeFlexListEager<T>(t: FlexList<T>): T[] {\n\tconst data: T[] = t.map((value: LazyItem<T>) => {\n\t\tif (isLazy(value)) {\n\t\t\treturn value();\n\t\t}\n\t\treturn value;\n\t});\n\treturn data;\n}\n\n/**\n * An \"eager\" or \"lazy\" Item in a `FlexList`.\n * Lazy items are wrapped in a function to allow referring to themselves before they are declared.\n * This makes recursive and co-recursive items possible.\n * @public\n */\nexport type LazyItem<Item = unknown> = Item | (() => Item);\n\n/**\n * Get the `Item` type from a `LazyItem<Item>`.\n * @system @public\n */\nexport type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result\n\t? Result\n\t: Item;\n\n/**\n * Normalize FlexList type to a union.\n * @system @public\n */\nexport type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;\n"]}
@@ -2,8 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { type FlexTreeNodeSchema, FlexFieldSchema, allowedTypesToTypeSet, type FlexAllowedTypes, type LazyTreeNodeSchema, LeafNodeSchema, FlexMapNodeSchema, FlexObjectNodeSchema, type FlexTreeSchema, type Unenforced, type AllowedTypeSet, type FlexMapFieldSchema, type SchemaCollection, TreeNodeSchemaBase, type FlexObjectNodeFields, schemaIsLeaf, schemaIsMap, schemaIsObjectNode, intoStoredSchema, allowedTypesSchemaSet, intoStoredSchemaCollection, } from "./typedTreeSchema.js";
6
- export { ViewSchema } from "./view.js";
7
- export { type SchemaLibraryData, type SchemaLintConfiguration, aggregateSchemaLibraries, schemaLintDefault, } from "./schemaCollection.js";
8
- export { type FlexList, markEager, type LazyItem, isLazy, type NormalizeLazyItem, type FlexListToUnion, type ExtractItemType, normalizeFlexListEager, } from "./flexList.js";
5
+ export { type Unenforced } from "./typedTreeSchema.js";
6
+ export { type FlexList, markEager, type LazyItem, isLazy, type FlexListToUnion, type ExtractItemType, normalizeFlexListEager, } from "./flexList.js";
9
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,kBAAkB,EACvB,eAAe,EACf,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,wBAAwB,EACxB,iBAAiB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACN,KAAK,QAAQ,EACb,SAAS,EACT,KAAK,QAAQ,EACb,MAAM,EACN,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,sBAAsB,GACtB,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EACN,KAAK,QAAQ,EACb,SAAS,EACT,KAAK,QAAQ,EACb,MAAM,EACN,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,sBAAsB,GACtB,MAAM,eAAe,CAAC"}
@@ -2,8 +2,5 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { FlexFieldSchema, allowedTypesToTypeSet, LeafNodeSchema, FlexMapNodeSchema, FlexObjectNodeSchema, TreeNodeSchemaBase, schemaIsLeaf, schemaIsMap, schemaIsObjectNode, intoStoredSchema, allowedTypesSchemaSet, intoStoredSchemaCollection, } from "./typedTreeSchema.js";
6
- export { ViewSchema } from "./view.js";
7
- export { aggregateSchemaLibraries, schemaLintDefault, } from "./schemaCollection.js";
8
5
  export { markEager, isLazy, normalizeFlexListEager, } from "./flexList.js";
9
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,eAAe,EACf,qBAAqB,EAGrB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EAMpB,kBAAkB,EAElB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAGN,wBAAwB,EACxB,iBAAiB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAEN,SAAS,EAET,MAAM,EAIN,sBAAsB,GACtB,MAAM,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype FlexTreeNodeSchema,\n\tFlexFieldSchema,\n\tallowedTypesToTypeSet,\n\ttype FlexAllowedTypes,\n\ttype LazyTreeNodeSchema,\n\tLeafNodeSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\ttype FlexTreeSchema,\n\ttype Unenforced,\n\ttype AllowedTypeSet,\n\ttype FlexMapFieldSchema,\n\ttype SchemaCollection,\n\tTreeNodeSchemaBase,\n\ttype FlexObjectNodeFields,\n\tschemaIsLeaf,\n\tschemaIsMap,\n\tschemaIsObjectNode,\n\tintoStoredSchema,\n\tallowedTypesSchemaSet,\n\tintoStoredSchemaCollection,\n} from \"./typedTreeSchema.js\";\n\nexport { ViewSchema } from \"./view.js\";\n\nexport {\n\ttype SchemaLibraryData,\n\ttype SchemaLintConfiguration,\n\taggregateSchemaLibraries,\n\tschemaLintDefault,\n} from \"./schemaCollection.js\";\n\nexport {\n\ttype FlexList,\n\tmarkEager,\n\ttype LazyItem,\n\tisLazy,\n\ttype NormalizeLazyItem,\n\ttype FlexListToUnion,\n\ttype ExtractItemType,\n\tnormalizeFlexListEager,\n} from \"./flexList.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,SAAS,EAET,MAAM,EAGN,sBAAsB,GACtB,MAAM,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { type Unenforced } from \"./typedTreeSchema.js\";\n\nexport {\n\ttype FlexList,\n\tmarkEager,\n\ttype LazyItem,\n\tisLazy,\n\ttype FlexListToUnion,\n\ttype ExtractItemType,\n\tnormalizeFlexListEager,\n} from \"./flexList.js\";\n"]}