@fluidframework/tree 2.43.0 → 2.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (415) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/api-report/tree.alpha.api.md +73 -16
  3. package/api-report/tree.beta.api.md +9 -3
  4. package/api-report/tree.legacy.alpha.api.md +8 -2
  5. package/api-report/tree.legacy.public.api.md +8 -2
  6. package/api-report/tree.public.api.md +8 -2
  7. package/dist/alpha.d.ts +9 -0
  8. package/dist/core/forest/editableForest.d.ts +0 -2
  9. package/dist/core/forest/editableForest.d.ts.map +1 -1
  10. package/dist/core/forest/editableForest.js.map +1 -1
  11. package/dist/core/forest/forest.d.ts +0 -4
  12. package/dist/core/forest/forest.d.ts.map +1 -1
  13. package/dist/core/forest/forest.js +0 -4
  14. package/dist/core/forest/forest.js.map +1 -1
  15. package/dist/core/rebase/changeRebaser.d.ts +0 -6
  16. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  17. package/dist/core/rebase/changeRebaser.js.map +1 -1
  18. package/dist/core/rebase/types.d.ts +0 -2
  19. package/dist/core/rebase/types.d.ts.map +1 -1
  20. package/dist/core/rebase/types.js.map +1 -1
  21. package/dist/core/schema-stored/schema.d.ts +0 -8
  22. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  23. package/dist/core/schema-stored/schema.js +0 -8
  24. package/dist/core/schema-stored/schema.js.map +1 -1
  25. package/dist/core/schema-view/view.d.ts +0 -2
  26. package/dist/core/schema-view/view.d.ts.map +1 -1
  27. package/dist/core/schema-view/view.js.map +1 -1
  28. package/dist/core/tree/cursor.d.ts +0 -2
  29. package/dist/core/tree/cursor.d.ts.map +1 -1
  30. package/dist/core/tree/cursor.js +0 -2
  31. package/dist/core/tree/cursor.js.map +1 -1
  32. package/dist/core/tree/delta.d.ts +0 -2
  33. package/dist/core/tree/delta.d.ts.map +1 -1
  34. package/dist/core/tree/delta.js.map +1 -1
  35. package/dist/core/tree/types.d.ts +0 -4
  36. package/dist/core/tree/types.d.ts.map +1 -1
  37. package/dist/core/tree/types.js +0 -2
  38. package/dist/core/tree/types.js.map +1 -1
  39. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +0 -4
  40. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  41. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  42. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -10
  43. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  44. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  45. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +0 -2
  46. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  47. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +0 -2
  48. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  49. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +0 -2
  50. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  51. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +0 -2
  52. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  53. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +0 -10
  54. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  55. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +0 -2
  56. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  57. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +0 -6
  58. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  59. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  60. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -12
  61. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  62. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  63. package/dist/feature-libraries/sequence-field/types.d.ts +0 -2
  64. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  65. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  66. package/dist/index.d.ts +1 -1
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.js +3 -2
  69. package/dist/index.js.map +1 -1
  70. package/dist/jsonDomainSchema.d.ts +2 -6
  71. package/dist/jsonDomainSchema.d.ts.map +1 -1
  72. package/dist/jsonDomainSchema.js +2 -2
  73. package/dist/jsonDomainSchema.js.map +1 -1
  74. package/dist/packageVersion.d.ts +1 -1
  75. package/dist/packageVersion.js +1 -1
  76. package/dist/packageVersion.js.map +1 -1
  77. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  78. package/dist/shared-tree/treeAlpha.js +3 -1
  79. package/dist/shared-tree/treeAlpha.js.map +1 -1
  80. package/dist/shared-tree-core/defaultResubmitMachine.d.ts +8 -12
  81. package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  82. package/dist/shared-tree-core/defaultResubmitMachine.js +54 -46
  83. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  84. package/dist/shared-tree-core/resubmitMachine.d.ts +6 -0
  85. package/dist/shared-tree-core/resubmitMachine.d.ts.map +1 -1
  86. package/dist/shared-tree-core/resubmitMachine.js.map +1 -1
  87. package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -0
  88. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  89. package/dist/shared-tree-core/sharedTreeCore.js +16 -3
  90. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  91. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  92. package/dist/simple-tree/api/configuration.js +49 -17
  93. package/dist/simple-tree/api/configuration.js.map +1 -1
  94. package/dist/simple-tree/api/customTree.d.ts +1 -1
  95. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  96. package/dist/simple-tree/api/customTree.js +3 -4
  97. package/dist/simple-tree/api/customTree.js.map +1 -1
  98. package/dist/simple-tree/api/index.d.ts +2 -2
  99. package/dist/simple-tree/api/index.d.ts.map +1 -1
  100. package/dist/simple-tree/api/index.js.map +1 -1
  101. package/dist/simple-tree/api/jsonSchema.d.ts +32 -8
  102. package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -1
  103. package/dist/simple-tree/api/jsonSchema.js.map +1 -1
  104. package/dist/simple-tree/api/schemaFactory.d.ts +2 -2
  105. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  106. package/dist/simple-tree/api/schemaFactory.js +1 -1
  107. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  108. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +97 -3
  109. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  110. package/dist/simple-tree/api/schemaFactoryAlpha.js +75 -0
  111. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  112. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +5 -1
  113. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  114. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  115. package/dist/simple-tree/api/schemaFromSimple.js +2 -0
  116. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  117. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  118. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +4 -4
  119. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  120. package/dist/simple-tree/api/treeBeta.d.ts +1 -1
  121. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  122. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  123. package/dist/simple-tree/api/treeNodeApi.js +1 -1
  124. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  125. package/dist/simple-tree/api/typesUnsafe.d.ts +12 -0
  126. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  127. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  128. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  129. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +5 -3
  130. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  131. package/dist/simple-tree/core/index.d.ts +1 -1
  132. package/dist/simple-tree/core/index.d.ts.map +1 -1
  133. package/dist/simple-tree/core/index.js +2 -1
  134. package/dist/simple-tree/core/index.js.map +1 -1
  135. package/dist/simple-tree/core/treeNodeSchema.d.ts +5 -1
  136. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  137. package/dist/simple-tree/core/treeNodeSchema.js +4 -0
  138. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  139. package/dist/simple-tree/index.d.ts +3 -3
  140. package/dist/simple-tree/index.d.ts.map +1 -1
  141. package/dist/simple-tree/index.js +3 -1
  142. package/dist/simple-tree/index.js.map +1 -1
  143. package/dist/simple-tree/node-kinds/index.d.ts +2 -1
  144. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  145. package/dist/simple-tree/node-kinds/index.js +5 -1
  146. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  147. package/dist/simple-tree/node-kinds/object/index.d.ts +1 -1
  148. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  149. package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
  150. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  151. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  152. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +5 -1
  153. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  154. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  155. package/dist/simple-tree/node-kinds/record/index.d.ts +7 -0
  156. package/dist/simple-tree/node-kinds/record/index.d.ts.map +1 -0
  157. package/dist/simple-tree/node-kinds/record/index.js +13 -0
  158. package/dist/simple-tree/node-kinds/record/index.js.map +1 -0
  159. package/dist/simple-tree/node-kinds/record/recordNode.d.ts +39 -0
  160. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -0
  161. package/dist/simple-tree/node-kinds/record/recordNode.js +234 -0
  162. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -0
  163. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +70 -0
  164. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -0
  165. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js +30 -0
  166. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -0
  167. package/dist/simple-tree/simpleSchema.d.ts +16 -1
  168. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  169. package/dist/simple-tree/simpleSchema.js.map +1 -1
  170. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  171. package/dist/simple-tree/toStoredSchema.js +4 -2
  172. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  173. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +1 -1
  174. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  175. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +56 -32
  176. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  177. package/dist/tableSchema.d.ts +7 -2
  178. package/dist/tableSchema.d.ts.map +1 -1
  179. package/dist/tableSchema.js +21 -7
  180. package/dist/tableSchema.js.map +1 -1
  181. package/dist/util/brandedMap.d.ts +0 -2
  182. package/dist/util/brandedMap.d.ts.map +1 -1
  183. package/dist/util/brandedMap.js.map +1 -1
  184. package/docs/main/compatibility.md +15 -1
  185. package/lib/alpha.d.ts +9 -0
  186. package/lib/core/forest/editableForest.d.ts +0 -2
  187. package/lib/core/forest/editableForest.d.ts.map +1 -1
  188. package/lib/core/forest/editableForest.js.map +1 -1
  189. package/lib/core/forest/forest.d.ts +0 -4
  190. package/lib/core/forest/forest.d.ts.map +1 -1
  191. package/lib/core/forest/forest.js +0 -4
  192. package/lib/core/forest/forest.js.map +1 -1
  193. package/lib/core/rebase/changeRebaser.d.ts +0 -6
  194. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  195. package/lib/core/rebase/changeRebaser.js.map +1 -1
  196. package/lib/core/rebase/types.d.ts +0 -2
  197. package/lib/core/rebase/types.d.ts.map +1 -1
  198. package/lib/core/rebase/types.js.map +1 -1
  199. package/lib/core/schema-stored/schema.d.ts +0 -8
  200. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  201. package/lib/core/schema-stored/schema.js +0 -8
  202. package/lib/core/schema-stored/schema.js.map +1 -1
  203. package/lib/core/schema-view/view.d.ts +0 -2
  204. package/lib/core/schema-view/view.d.ts.map +1 -1
  205. package/lib/core/schema-view/view.js.map +1 -1
  206. package/lib/core/tree/cursor.d.ts +0 -2
  207. package/lib/core/tree/cursor.d.ts.map +1 -1
  208. package/lib/core/tree/cursor.js +0 -2
  209. package/lib/core/tree/cursor.js.map +1 -1
  210. package/lib/core/tree/delta.d.ts +0 -2
  211. package/lib/core/tree/delta.d.ts.map +1 -1
  212. package/lib/core/tree/delta.js.map +1 -1
  213. package/lib/core/tree/types.d.ts +0 -4
  214. package/lib/core/tree/types.d.ts.map +1 -1
  215. package/lib/core/tree/types.js +0 -2
  216. package/lib/core/tree/types.js.map +1 -1
  217. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +0 -4
  218. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  219. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  220. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -10
  221. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  222. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  223. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +0 -2
  224. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  225. package/lib/feature-libraries/flex-tree/flexTreeTypes.js +0 -2
  226. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  227. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +0 -2
  228. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  229. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +0 -2
  230. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  231. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +0 -10
  232. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  233. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js +0 -2
  234. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  235. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +0 -6
  236. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  237. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  238. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -12
  239. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  240. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  241. package/lib/feature-libraries/sequence-field/types.d.ts +0 -2
  242. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  243. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  244. package/lib/index.d.ts +1 -1
  245. package/lib/index.d.ts.map +1 -1
  246. package/lib/index.js +1 -1
  247. package/lib/index.js.map +1 -1
  248. package/lib/jsonDomainSchema.d.ts +2 -6
  249. package/lib/jsonDomainSchema.d.ts.map +1 -1
  250. package/lib/jsonDomainSchema.js +3 -3
  251. package/lib/jsonDomainSchema.js.map +1 -1
  252. package/lib/packageVersion.d.ts +1 -1
  253. package/lib/packageVersion.js +1 -1
  254. package/lib/packageVersion.js.map +1 -1
  255. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  256. package/lib/shared-tree/treeAlpha.js +3 -1
  257. package/lib/shared-tree/treeAlpha.js.map +1 -1
  258. package/lib/shared-tree-core/defaultResubmitMachine.d.ts +8 -12
  259. package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  260. package/lib/shared-tree-core/defaultResubmitMachine.js +55 -47
  261. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  262. package/lib/shared-tree-core/resubmitMachine.d.ts +6 -0
  263. package/lib/shared-tree-core/resubmitMachine.d.ts.map +1 -1
  264. package/lib/shared-tree-core/resubmitMachine.js.map +1 -1
  265. package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -0
  266. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  267. package/lib/shared-tree-core/sharedTreeCore.js +16 -3
  268. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  269. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  270. package/lib/simple-tree/api/configuration.js +51 -19
  271. package/lib/simple-tree/api/configuration.js.map +1 -1
  272. package/lib/simple-tree/api/customTree.d.ts +1 -1
  273. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  274. package/lib/simple-tree/api/customTree.js +2 -3
  275. package/lib/simple-tree/api/customTree.js.map +1 -1
  276. package/lib/simple-tree/api/index.d.ts +2 -2
  277. package/lib/simple-tree/api/index.d.ts.map +1 -1
  278. package/lib/simple-tree/api/index.js.map +1 -1
  279. package/lib/simple-tree/api/jsonSchema.d.ts +32 -8
  280. package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -1
  281. package/lib/simple-tree/api/jsonSchema.js.map +1 -1
  282. package/lib/simple-tree/api/schemaFactory.d.ts +2 -2
  283. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  284. package/lib/simple-tree/api/schemaFactory.js +1 -1
  285. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  286. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +97 -3
  287. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  288. package/lib/simple-tree/api/schemaFactoryAlpha.js +77 -2
  289. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  290. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +5 -1
  291. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  292. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  293. package/lib/simple-tree/api/schemaFromSimple.js +2 -0
  294. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  295. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  296. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +5 -5
  297. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  298. package/lib/simple-tree/api/treeBeta.d.ts +1 -1
  299. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  300. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  301. package/lib/simple-tree/api/treeNodeApi.js +2 -2
  302. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  303. package/lib/simple-tree/api/typesUnsafe.d.ts +12 -0
  304. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  305. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  306. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  307. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +6 -4
  308. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  309. package/lib/simple-tree/core/index.d.ts +1 -1
  310. package/lib/simple-tree/core/index.d.ts.map +1 -1
  311. package/lib/simple-tree/core/index.js +1 -1
  312. package/lib/simple-tree/core/index.js.map +1 -1
  313. package/lib/simple-tree/core/treeNodeSchema.d.ts +5 -1
  314. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  315. package/lib/simple-tree/core/treeNodeSchema.js +4 -0
  316. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  317. package/lib/simple-tree/index.d.ts +3 -3
  318. package/lib/simple-tree/index.d.ts.map +1 -1
  319. package/lib/simple-tree/index.js +1 -1
  320. package/lib/simple-tree/index.js.map +1 -1
  321. package/lib/simple-tree/node-kinds/index.d.ts +2 -1
  322. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  323. package/lib/simple-tree/node-kinds/index.js +1 -0
  324. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  325. package/lib/simple-tree/node-kinds/object/index.d.ts +1 -1
  326. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  327. package/lib/simple-tree/node-kinds/object/index.js +1 -1
  328. package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
  329. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  330. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  331. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +5 -1
  332. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  333. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  334. package/lib/simple-tree/node-kinds/record/index.d.ts +7 -0
  335. package/lib/simple-tree/node-kinds/record/index.d.ts.map +1 -0
  336. package/lib/simple-tree/node-kinds/record/index.js +7 -0
  337. package/lib/simple-tree/node-kinds/record/index.js.map +1 -0
  338. package/lib/simple-tree/node-kinds/record/recordNode.d.ts +39 -0
  339. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -0
  340. package/lib/simple-tree/node-kinds/record/recordNode.js +232 -0
  341. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -0
  342. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +70 -0
  343. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -0
  344. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js +26 -0
  345. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -0
  346. package/lib/simple-tree/simpleSchema.d.ts +16 -1
  347. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  348. package/lib/simple-tree/simpleSchema.js.map +1 -1
  349. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  350. package/lib/simple-tree/toStoredSchema.js +4 -2
  351. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  352. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +1 -1
  353. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  354. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +58 -34
  355. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  356. package/lib/tableSchema.d.ts +7 -2
  357. package/lib/tableSchema.d.ts.map +1 -1
  358. package/lib/tableSchema.js +22 -8
  359. package/lib/tableSchema.js.map +1 -1
  360. package/lib/util/brandedMap.d.ts +0 -2
  361. package/lib/util/brandedMap.d.ts.map +1 -1
  362. package/lib/util/brandedMap.js.map +1 -1
  363. package/package.json +34 -22
  364. package/src/core/forest/editableForest.ts +0 -2
  365. package/src/core/forest/forest.ts +0 -4
  366. package/src/core/rebase/changeRebaser.ts +0 -6
  367. package/src/core/rebase/types.ts +0 -2
  368. package/src/core/schema-stored/schema.ts +0 -8
  369. package/src/core/schema-view/view.ts +0 -2
  370. package/src/core/tree/cursor.ts +0 -2
  371. package/src/core/tree/delta.ts +0 -2
  372. package/src/core/tree/types.ts +0 -4
  373. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +0 -4
  374. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +0 -10
  375. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +0 -2
  376. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +0 -2
  377. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +0 -10
  378. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +0 -8
  379. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +0 -12
  380. package/src/feature-libraries/sequence-field/types.ts +0 -2
  381. package/src/index.ts +9 -0
  382. package/src/jsonDomainSchema.ts +3 -3
  383. package/src/packageVersion.ts +1 -1
  384. package/src/shared-tree/treeAlpha.ts +3 -1
  385. package/src/shared-tree-core/defaultResubmitMachine.ts +99 -52
  386. package/src/shared-tree-core/resubmitMachine.ts +7 -0
  387. package/src/shared-tree-core/sharedTreeCore.ts +18 -6
  388. package/src/simple-tree/api/configuration.ts +73 -19
  389. package/src/simple-tree/api/customTree.ts +3 -3
  390. package/src/simple-tree/api/index.ts +3 -0
  391. package/src/simple-tree/api/jsonSchema.ts +35 -8
  392. package/src/simple-tree/api/schemaFactory.ts +5 -13
  393. package/src/simple-tree/api/schemaFactoryAlpha.ts +268 -1
  394. package/src/simple-tree/api/schemaFactoryRecursive.ts +5 -1
  395. package/src/simple-tree/api/schemaFromSimple.ts +6 -0
  396. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +16 -7
  397. package/src/simple-tree/api/treeBeta.ts +2 -2
  398. package/src/simple-tree/api/treeNodeApi.ts +2 -2
  399. package/src/simple-tree/api/typesUnsafe.ts +15 -0
  400. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +14 -6
  401. package/src/simple-tree/core/index.ts +1 -0
  402. package/src/simple-tree/core/treeNodeSchema.ts +8 -4
  403. package/src/simple-tree/index.ts +11 -0
  404. package/src/simple-tree/node-kinds/index.ts +11 -0
  405. package/src/simple-tree/node-kinds/object/index.ts +5 -1
  406. package/src/simple-tree/node-kinds/object/objectNode.ts +3 -2
  407. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -3
  408. package/src/simple-tree/node-kinds/record/index.ts +14 -0
  409. package/src/simple-tree/node-kinds/record/recordNode.ts +410 -0
  410. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +136 -0
  411. package/src/simple-tree/simpleSchema.ts +19 -1
  412. package/src/simple-tree/toStoredSchema.ts +4 -2
  413. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +83 -40
  414. package/src/tableSchema.ts +27 -8
  415. package/src/util/brandedMap.ts +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"delta.js","sourceRoot":"","sources":["../../../src/core/tree/delta.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { RevisionTag } from \"../rebase/index.js\";\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type { TreeChunk } from \"./chunk.js\";\n\n/**\n * This format describes changes that must be applied to a forest in order to update it.\n * Instances of this format are generated based on incoming changesets and consumed by a view layer (e.g., Forest) to\n * update itself.\n *\n * Because this format is only meant for updating document state, it does not fully represent user intentions.\n * For example, if some concurrent edits A and B insert content at the same location, then a Delta that represents\n * represents the state update for edit A would not include information that allows B's insertion to be ordered\n * relative to A's insertion. This format is therefore not fit to be rebased in the face of concurrent changes.\n * Instead this format is used to describe the end product of rebasing user intentions over concurrent edits.\n *\n * This format is self-contained in the following ways:\n *\n * 1. It uses integer indices (offsets, technically) to describe the locations of necessary changes.\n * As such, it does not rely on document nodes being accessible/locatable by ID.\n *\n * 2. This format does not require historical information in order to apply the changes it describes.\n * For example, if a user undoes the deletion of a subtree, then the Delta generated for the undo edit will contain all\n * information necessary to restore that subtree.\n *\n * This format can be generated from any Changeset without having access to the current document state.\n *\n * This format is meant to serve as the lowest common denominator to represent state changes resulting from any kind\n * of operation on any kind of field.\n * This means all such operations must be expressible in terms of this format.\n *\n * Within the above design constrains, this format is designed with the following goals in mind:\n *\n * 1. Make it easy to walk both a document tree and the delta tree to apply the changes described in the delta\n * with a minimum amount of backtracking over the contents of the tree.\n * This a boon for both code simplicity and performance.\n *\n * 2. Make the format terse.\n *\n * 3. Make the format uniform.\n *\n * These goals are reflected in the following design choices (this is very much optional reading for users of this\n * format):\n *\n * 1. All marks that apply to field elements are represented in a single linear structure where marks that affect later\n * elements of the document field appear after marks that affect earlier elements of the document field.\n *\n * If the marks were not ordered in this fashion then a consumer would need to backtrack within the document field.\n *\n * If the marks were represented in multiple such linear structures then it would be necessary to either:\n * - backtrack when iterating over one structure fully, then the next\n * - maintain a pointer within each such linear structure and advance them in lock-step (like in a k-way merge-sort but\n * more fiddly because of the offsets).\n *\n * 2. Nested changes are not inlined within `ProtoNode`s.\n *\n * Inlining them would force the consuming code to detect such changes within the `ProtoNode` and handle them\n * within the context of the content creation.\n * This would be cumbersome because either the code that is responsible for consuming the `ProtoNode` would need to\n * be aware of and have the context to handle such changes, or some caller of that code would need to find and extract such\n * change information ahead to calling that code.\n */\n\n/**\n * Represents the change made to a document.\n * Immutable, therefore safe to retain for async processing.\n */\nexport interface Root<TTrees = ProtoNodes> {\n\t/**\n\t * Changes to apply to the root fields.\n\t */\n\treadonly fields?: FieldMap;\n\t/**\n\t * New detached nodes to be constructed.\n\t * The ordering has no significance.\n\t *\n\t * Build instructions for a root that is undergoing a rename should be listed under the starting name.\n\t * For example, if one wishes to build a tree which is being renamed from ID A to ID B,\n\t * then the build should be listed under ID A.\n\t */\n\treadonly build?: readonly DetachedNodeBuild<TTrees>[];\n\t/**\n\t * New detached nodes to be destroyed.\n\t * The ordering has no significance.\n\t *\n\t * Destruction instructions for a root that is undergoing a rename should be listed under the final name.\n\t * For example, if one wishes to destroy a tree which is being renamed from ID A to ID B,\n\t * then the destruction should be listed under ID B.\n\t */\n\treadonly destroy?: readonly DetachedNodeDestruction[];\n\t/**\n\t * Refreshers for detached nodes that may need to be recreated.\n\t * The ordering has no significance.\n\t */\n\treadonly refreshers?: readonly DetachedNodeBuild<TTrees>[];\n\t/**\n\t * Changes to apply to detached nodes.\n\t * The ordering has no significance.\n\t *\n\t * Nested changes for a root that is undergoing a rename should be listed under the starting name.\n\t * For example, if one wishes to change a tree which is being renamed from ID A to ID B,\n\t * then the changes should be listed under ID A.\n\t */\n\treadonly global?: readonly DetachedNodeChanges[];\n\t/**\n\t * Detached roots whose associated ID needs to be updated.\n\t * The ordering has no significance.\n\t * Note that the renames may need to be performed in a specific order to avoid collisions.\n\t * This ordering problem is left to the consumer of this format.\n\t */\n\treadonly rename?: readonly DetachedNodeRename[];\n}\n\n/**\n * The default representation for a chunk (sub-sequence) of inserted content.\n */\nexport type ProtoNodes = TreeChunk;\n\n/**\n * Represents a change being made to a part of the document tree.\n */\nexport interface Mark {\n\t/**\n\t * The number of nodes affected.\n\t * When `isAttachMark(mark)` is true, this is the number of new nodes being attached.\n\t * When `isAttachMark(mark)` is false, this the number of existing nodes affected.\n\t * Must be 1 when `fields` is populated.\n\t */\n\treadonly count: number;\n\n\t/**\n\t * Modifications to the pre-existing content.\n\t * Must be undefined when `attach` is set but `detach` is not.\n\t */\n\treadonly fields?: FieldMap;\n\n\t/**\n\t * When set, indicates that some pre-existing content is being detached and sent to the given detached field.\n\t */\n\treadonly detach?: DetachedNodeId;\n\n\t/**\n\t * When set, indicates that some content is being attached from the given detached field.\n\t */\n\treadonly attach?: DetachedNodeId;\n}\n\n/**\n * A globally unique ID for a node in a detached field.\n */\nexport interface DetachedNodeId {\n\treadonly major?: RevisionTag;\n\treadonly minor: number;\n}\n\n/**\n */\nexport type FieldMap = ReadonlyMap<FieldKey, FieldChanges>;\n\n/**\n * Represents changes made to a detached node\n */\nexport interface DetachedNodeChanges {\n\treadonly id: DetachedNodeId;\n\treadonly fields: FieldMap;\n}\n\n/**\n * Represents the creation of detached nodes.\n *\n * Tree creation is idempotent: if a tree with the same ID already exists,\n * then this build is ignored in favor of the existing tree.\n */\nexport interface DetachedNodeBuild<TTrees = ProtoNodes> {\n\treadonly id: DetachedNodeId;\n\treadonly trees: TTrees;\n}\n\n/**\n * Represents the destruction of detached nodes\n */\nexport interface DetachedNodeDestruction {\n\treadonly id: DetachedNodeId;\n\treadonly count: number;\n}\n\n/**\n * Represents a detached node being assigned a new `DetachedNodeId`.\n */\nexport interface DetachedNodeRename {\n\treadonly count: number;\n\treadonly oldId: DetachedNodeId;\n\treadonly newId: DetachedNodeId;\n}\n\n/**\n * Represents a list of changes to the nodes in the field.\n * The index of each mark within the range of nodes, before\n * applying any of the changes, is not represented explicitly.\n * It corresponds to the sum of `mark.count` values for all previous marks for which `isAttachMark(mark)` is false.\n */\nexport type FieldChanges = readonly Mark[];\n"]}
1
+ {"version":3,"file":"delta.js","sourceRoot":"","sources":["../../../src/core/tree/delta.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { RevisionTag } from \"../rebase/index.js\";\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type { TreeChunk } from \"./chunk.js\";\n\n/**\n * This format describes changes that must be applied to a forest in order to update it.\n * Instances of this format are generated based on incoming changesets and consumed by a view layer (e.g., Forest) to\n * update itself.\n *\n * Because this format is only meant for updating document state, it does not fully represent user intentions.\n * For example, if some concurrent edits A and B insert content at the same location, then a Delta that represents\n * represents the state update for edit A would not include information that allows B's insertion to be ordered\n * relative to A's insertion. This format is therefore not fit to be rebased in the face of concurrent changes.\n * Instead this format is used to describe the end product of rebasing user intentions over concurrent edits.\n *\n * This format is self-contained in the following ways:\n *\n * 1. It uses integer indices (offsets, technically) to describe the locations of necessary changes.\n * As such, it does not rely on document nodes being accessible/locatable by ID.\n *\n * 2. This format does not require historical information in order to apply the changes it describes.\n * For example, if a user undoes the deletion of a subtree, then the Delta generated for the undo edit will contain all\n * information necessary to restore that subtree.\n *\n * This format can be generated from any Changeset without having access to the current document state.\n *\n * This format is meant to serve as the lowest common denominator to represent state changes resulting from any kind\n * of operation on any kind of field.\n * This means all such operations must be expressible in terms of this format.\n *\n * Within the above design constrains, this format is designed with the following goals in mind:\n *\n * 1. Make it easy to walk both a document tree and the delta tree to apply the changes described in the delta\n * with a minimum amount of backtracking over the contents of the tree.\n * This a boon for both code simplicity and performance.\n *\n * 2. Make the format terse.\n *\n * 3. Make the format uniform.\n *\n * These goals are reflected in the following design choices (this is very much optional reading for users of this\n * format):\n *\n * 1. All marks that apply to field elements are represented in a single linear structure where marks that affect later\n * elements of the document field appear after marks that affect earlier elements of the document field.\n *\n * If the marks were not ordered in this fashion then a consumer would need to backtrack within the document field.\n *\n * If the marks were represented in multiple such linear structures then it would be necessary to either:\n * - backtrack when iterating over one structure fully, then the next\n * - maintain a pointer within each such linear structure and advance them in lock-step (like in a k-way merge-sort but\n * more fiddly because of the offsets).\n *\n * 2. Nested changes are not inlined within `ProtoNode`s.\n *\n * Inlining them would force the consuming code to detect such changes within the `ProtoNode` and handle them\n * within the context of the content creation.\n * This would be cumbersome because either the code that is responsible for consuming the `ProtoNode` would need to\n * be aware of and have the context to handle such changes, or some caller of that code would need to find and extract such\n * change information ahead to calling that code.\n */\n\n/**\n * Represents the change made to a document.\n * Immutable, therefore safe to retain for async processing.\n */\nexport interface Root<TTrees = ProtoNodes> {\n\t/**\n\t * Changes to apply to the root fields.\n\t */\n\treadonly fields?: FieldMap;\n\t/**\n\t * New detached nodes to be constructed.\n\t * The ordering has no significance.\n\t *\n\t * Build instructions for a root that is undergoing a rename should be listed under the starting name.\n\t * For example, if one wishes to build a tree which is being renamed from ID A to ID B,\n\t * then the build should be listed under ID A.\n\t */\n\treadonly build?: readonly DetachedNodeBuild<TTrees>[];\n\t/**\n\t * New detached nodes to be destroyed.\n\t * The ordering has no significance.\n\t *\n\t * Destruction instructions for a root that is undergoing a rename should be listed under the final name.\n\t * For example, if one wishes to destroy a tree which is being renamed from ID A to ID B,\n\t * then the destruction should be listed under ID B.\n\t */\n\treadonly destroy?: readonly DetachedNodeDestruction[];\n\t/**\n\t * Refreshers for detached nodes that may need to be recreated.\n\t * The ordering has no significance.\n\t */\n\treadonly refreshers?: readonly DetachedNodeBuild<TTrees>[];\n\t/**\n\t * Changes to apply to detached nodes.\n\t * The ordering has no significance.\n\t *\n\t * Nested changes for a root that is undergoing a rename should be listed under the starting name.\n\t * For example, if one wishes to change a tree which is being renamed from ID A to ID B,\n\t * then the changes should be listed under ID A.\n\t */\n\treadonly global?: readonly DetachedNodeChanges[];\n\t/**\n\t * Detached roots whose associated ID needs to be updated.\n\t * The ordering has no significance.\n\t * Note that the renames may need to be performed in a specific order to avoid collisions.\n\t * This ordering problem is left to the consumer of this format.\n\t */\n\treadonly rename?: readonly DetachedNodeRename[];\n}\n\n/**\n * The default representation for a chunk (sub-sequence) of inserted content.\n */\nexport type ProtoNodes = TreeChunk;\n\n/**\n * Represents a change being made to a part of the document tree.\n */\nexport interface Mark {\n\t/**\n\t * The number of nodes affected.\n\t * When `isAttachMark(mark)` is true, this is the number of new nodes being attached.\n\t * When `isAttachMark(mark)` is false, this the number of existing nodes affected.\n\t * Must be 1 when `fields` is populated.\n\t */\n\treadonly count: number;\n\n\t/**\n\t * Modifications to the pre-existing content.\n\t * Must be undefined when `attach` is set but `detach` is not.\n\t */\n\treadonly fields?: FieldMap;\n\n\t/**\n\t * When set, indicates that some pre-existing content is being detached and sent to the given detached field.\n\t */\n\treadonly detach?: DetachedNodeId;\n\n\t/**\n\t * When set, indicates that some content is being attached from the given detached field.\n\t */\n\treadonly attach?: DetachedNodeId;\n}\n\n/**\n * A globally unique ID for a node in a detached field.\n */\nexport interface DetachedNodeId {\n\treadonly major?: RevisionTag;\n\treadonly minor: number;\n}\n\nexport type FieldMap = ReadonlyMap<FieldKey, FieldChanges>;\n\n/**\n * Represents changes made to a detached node\n */\nexport interface DetachedNodeChanges {\n\treadonly id: DetachedNodeId;\n\treadonly fields: FieldMap;\n}\n\n/**\n * Represents the creation of detached nodes.\n *\n * Tree creation is idempotent: if a tree with the same ID already exists,\n * then this build is ignored in favor of the existing tree.\n */\nexport interface DetachedNodeBuild<TTrees = ProtoNodes> {\n\treadonly id: DetachedNodeId;\n\treadonly trees: TTrees;\n}\n\n/**\n * Represents the destruction of detached nodes\n */\nexport interface DetachedNodeDestruction {\n\treadonly id: DetachedNodeId;\n\treadonly count: number;\n}\n\n/**\n * Represents a detached node being assigned a new `DetachedNodeId`.\n */\nexport interface DetachedNodeRename {\n\treadonly count: number;\n\treadonly oldId: DetachedNodeId;\n\treadonly newId: DetachedNodeId;\n}\n\n/**\n * Represents a list of changes to the nodes in the field.\n * The index of each mark within the range of nodes, before\n * applying any of the changes, is not represented explicitly.\n * It corresponds to the sum of `mark.count` values for all previous marks for which `isAttachMark(mark)` is false.\n */\nexport type FieldChanges = readonly Mark[];\n"]}
@@ -5,8 +5,6 @@
5
5
  import type { IFluidHandle } from "@fluidframework/core-interfaces";
6
6
  import { type Brand, type Opaque, type _InlineTrick } from "../../util/index.js";
7
7
  import type { FieldKey, TreeNodeSchemaIdentifier, ValueSchema } from "../schema-stored/index.js";
8
- /**
9
- */
10
8
  export type TreeType = TreeNodeSchemaIdentifier;
11
9
  /**
12
10
  * The empty key ("") is used for unnamed relationships, such as the indexer
@@ -27,8 +25,6 @@ export declare const EmptyKey: FieldKey;
27
25
  * it likely should be namespaced or a UUID to avoid risk of collisions.
28
26
  */
29
27
  export declare const rootFieldKey: FieldKey;
30
- /**
31
- */
32
28
  export declare const rootField: DetachedField;
33
29
  /**
34
30
  * Location of a tree relative to is parent container (which can be a tree or forest).
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/tree/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EACN,KAAK,KAAK,EACV,KAAK,MAAM,EAGX,KAAK,YAAY,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACX,QAAQ,EACR,wBAAwB,EACxB,WAAW,EACX,MAAM,2BAA2B,CAAC;AAEnC;GACG;AACH,MAAM,MAAM,QAAQ,GAAG,wBAAwB,CAAC;AAEhD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ,EAAE,QAAoB,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MA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oBAAoB,CAAC,CAAC;CAAG;AAErF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,GAAG,QAAQ,CAEjE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,QAAQ,GAAG,aAAa,CAE/D;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,IAAI;IAClE;QACC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAC7B,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAC7B,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAC/B,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC;QAExC,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;KACzB,CAAC,OAAO,CAAC;CACV,CAAC,YAAY,CAAC,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACxB;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAE3B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;CACxC;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,wBAElC,CAAC"}
@@ -25,8 +25,6 @@ exports.EmptyKey = (0, index_js_1.brand)("");
25
25
  * it likely should be namespaced or a UUID to avoid risk of collisions.
26
26
  */
27
27
  exports.rootFieldKey = (0, index_js_1.brand)("rootFieldKey");
28
- /**
29
- */
30
28
  exports.rootField = keyAsDetachedField(exports.rootFieldKey);
31
29
  /**
32
30
  * Some code abstracts the root as a node with detached fields as its fields.
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/tree/types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,kDAM6B;AAW7B;;;;;;;;;;;GAWG;AACU,QAAA,QAAQ,GAAa,IAAA,gBAAK,EAAC,EAAE,CAAC,CAAC;AAE5C;;;;GAIG;AACU,QAAA,YAAY,GAAa,IAAA,gBAAK,EAAC,cAAc,CAAC,CAAC;AAE5D;GACG;AACU,QAAA,SAAS,GAAG,kBAAkB,CAAC,oBAAY,CAAC,CAAC;AAqC1D;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,KAAoB;IACtD,OAAO,IAAA,gBAAK,EAAC,IAAA,4BAAiB,EAAC,KAAK,CAAC,CAAC,CAAC;AACxC,CAAC;AAFD,gDAEC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,GAAa;IAC/C,OAAO,IAAA,gBAAK,EAAC,GAAG,CAAC,CAAC;AACnB,CAAC;AAFD,gDAEC;AAsDD;;GAEG;AACU,QAAA,oBAAoB,GAA6B,IAAA,gBAAK,EAClE,0CAA0C,CAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\n\nimport {\n\ttype Brand,\n\ttype Opaque,\n\tbrand,\n\textractFromOpaque,\n\ttype _InlineTrick,\n} from \"../../util/index.js\";\nimport type {\n\tFieldKey,\n\tTreeNodeSchemaIdentifier,\n\tValueSchema,\n} from \"../schema-stored/index.js\";\n\n/**\n */\nexport type TreeType = TreeNodeSchemaIdentifier;\n\n/**\n * The empty key (\"\") is used for unnamed relationships, such as the indexer\n * of an explicit array node.\n *\n * This key is a hint that this field is the primary function of the node,\n * and in some abstractions the APIs for this field should be inlined onto the node.\n *\n * TODO:\n * This has to be a FieldKey since different nodes will have different TreeFieldStoredSchema for it.\n * This makes it prone to collisions and suggests\n * that this intention may be better conveyed by metadata on the ITreeSchema.\n */\nexport const EmptyKey: FieldKey = brand(\"\");\n\n/**\n * FieldKey to use for the root of documents in places that need to refer to detached sequences or the root.\n * TODO: if we do want to standardize on a single value for this,\n * it likely should be namespaced or a UUID to avoid risk of collisions.\n */\nexport const rootFieldKey: FieldKey = brand(\"rootFieldKey\");\n\n/**\n */\nexport const rootField = keyAsDetachedField(rootFieldKey);\n\n/**\n * Location of a tree relative to is parent container (which can be a tree or forest).\n */\nexport interface ChildLocation {\n\treadonly container: ChildCollection;\n\treadonly index: number;\n}\n\n/**\n * Wrapper around DetachedField that can be detected at runtime.\n */\nexport interface RootField {\n\treadonly key: DetachedField;\n}\n\n/**\n * Identifier for a child collection, either on a node/tree or at the root of a forest.\n */\nexport type ChildCollection = FieldKey | RootField;\n\n// TODO: its not clear how much DetachedField belongs here in tree,\n// but for now as its needed in Rebase and Forest,\n// it makes sense to have it here for reasoning about the roots of trees.\n/**\n * A root in the forest.\n *\n * The range is a \"container\" like a field:\n * any additional content inserted before or after contents of this range will be included in the range.\n * This also means that moving the content from this range elsewhere will leave this range valid, but empty.\n *\n * In some APIs DetachedFields are used as FieldKeys on a special implicit root node\n * to simplify the APIs and implementation.\n */\nexport interface DetachedField extends Opaque<Brand<string, \"tree.DetachedField\">> {}\n\n/**\n * Some code abstracts the root as a node with detached fields as its fields.\n * This maps detached field to field keys for thus use.\n *\n * @returns `field` as a {@link FieldKey} usable on a special root node serving as a parent of detached fields.\n */\nexport function detachedFieldAsKey(field: DetachedField): FieldKey {\n\treturn brand(extractFromOpaque(field));\n}\n\n/**\n * The inverse of {@link detachedFieldAsKey}.\n * Thus must only be used on {@link FieldKey}s which were produced via {@link detachedFieldAsKey},\n * and with the same scope (ex: forest) as the detachedFieldAsKey was originally from.\n */\nexport function keyAsDetachedField(key: FieldKey): DetachedField {\n\treturn brand(key);\n}\n\n/**\n * TODO: integrate this into Schema. Decide how to persist them (need stable Id?). Maybe allow updating field kinds?.\n * TODO: make families of changes per field kind. Build editing APIs from that.\n * TODO: factor ChangeRebaser implementations to support adding new field kinds.\n */\nexport interface FieldKind {\n\treadonly name: string;\n\treadonly description: string;\n\treadonly minimumChildren: number;\n\treadonly maximumChildren: number;\n}\n\n/**\n * Value that may be stored on a leaf node.\n */\nexport type TreeValue<TSchema extends ValueSchema = ValueSchema> = [\n\t{\n\t\t[ValueSchema.Number]: number;\n\t\t[ValueSchema.String]: string;\n\t\t[ValueSchema.Boolean]: boolean;\n\t\t[ValueSchema.FluidHandle]: IFluidHandle;\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\t[ValueSchema.Null]: null;\n\t}[TSchema],\n][_InlineTrick];\n\n/**\n * Value stored on a node.\n */\nexport type Value = undefined | TreeValue;\n\n/**\n * The fields required by a node in a tree.\n *\n * @privateRemarks A forked version of this type is used in `persistedTreeTextFormat.ts`.\n * Changes to this type might necessitate changes to `EncodedNodeData` or codecs.\n * See persistedTreeTextFormat's module documentation for more details.\n */\nexport interface NodeData {\n\t/**\n\t * A payload of arbitrary serializable data.\n\t */\n\treadonly value?: TreeValue;\n\n\t/**\n\t * The meaning of this node.\n\t * Provides contexts/semantics for this node and its content.\n\t * Typically used to associate a node with metadata (including a schema) and source code (types, behaviors, etc).\n\t */\n\treadonly type: TreeNodeSchemaIdentifier;\n}\n\n/**\n * Use this type to indicate that a node sits above the detached fields, and thus is not a real node and who's type should not matter.\n */\nexport const aboveRootPlaceholder: TreeNodeSchemaIdentifier = brand(\n\t\"com.fluidframework.placeholder.aboveRoot\",\n);\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/tree/types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,kDAM6B;AAS7B;;;;;;;;;;;GAWG;AACU,QAAA,QAAQ,GAAa,IAAA,gBAAK,EAAC,EAAE,CAAC,CAAC;AAE5C;;;;GAIG;AACU,QAAA,YAAY,GAAa,IAAA,gBAAK,EAAC,cAAc,CAAC,CAAC;AAE/C,QAAA,SAAS,GAAG,kBAAkB,CAAC,oBAAY,CAAC,CAAC;AAqC1D;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,KAAoB;IACtD,OAAO,IAAA,gBAAK,EAAC,IAAA,4BAAiB,EAAC,KAAK,CAAC,CAAC,CAAC;AACxC,CAAC;AAFD,gDAEC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,GAAa;IAC/C,OAAO,IAAA,gBAAK,EAAC,GAAG,CAAC,CAAC;AACnB,CAAC;AAFD,gDAEC;AAsDD;;GAEG;AACU,QAAA,oBAAoB,GAA6B,IAAA,gBAAK,EAClE,0CAA0C,CAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\n\nimport {\n\ttype Brand,\n\ttype Opaque,\n\tbrand,\n\textractFromOpaque,\n\ttype _InlineTrick,\n} from \"../../util/index.js\";\nimport type {\n\tFieldKey,\n\tTreeNodeSchemaIdentifier,\n\tValueSchema,\n} from \"../schema-stored/index.js\";\n\nexport type TreeType = TreeNodeSchemaIdentifier;\n\n/**\n * The empty key (\"\") is used for unnamed relationships, such as the indexer\n * of an explicit array node.\n *\n * This key is a hint that this field is the primary function of the node,\n * and in some abstractions the APIs for this field should be inlined onto the node.\n *\n * TODO:\n * This has to be a FieldKey since different nodes will have different TreeFieldStoredSchema for it.\n * This makes it prone to collisions and suggests\n * that this intention may be better conveyed by metadata on the ITreeSchema.\n */\nexport const EmptyKey: FieldKey = brand(\"\");\n\n/**\n * FieldKey to use for the root of documents in places that need to refer to detached sequences or the root.\n * TODO: if we do want to standardize on a single value for this,\n * it likely should be namespaced or a UUID to avoid risk of collisions.\n */\nexport const rootFieldKey: FieldKey = brand(\"rootFieldKey\");\n\nexport const rootField = keyAsDetachedField(rootFieldKey);\n\n/**\n * Location of a tree relative to is parent container (which can be a tree or forest).\n */\nexport interface ChildLocation {\n\treadonly container: ChildCollection;\n\treadonly index: number;\n}\n\n/**\n * Wrapper around DetachedField that can be detected at runtime.\n */\nexport interface RootField {\n\treadonly key: DetachedField;\n}\n\n/**\n * Identifier for a child collection, either on a node/tree or at the root of a forest.\n */\nexport type ChildCollection = FieldKey | RootField;\n\n// TODO: its not clear how much DetachedField belongs here in tree,\n// but for now as its needed in Rebase and Forest,\n// it makes sense to have it here for reasoning about the roots of trees.\n/**\n * A root in the forest.\n *\n * The range is a \"container\" like a field:\n * any additional content inserted before or after contents of this range will be included in the range.\n * This also means that moving the content from this range elsewhere will leave this range valid, but empty.\n *\n * In some APIs DetachedFields are used as FieldKeys on a special implicit root node\n * to simplify the APIs and implementation.\n */\nexport interface DetachedField extends Opaque<Brand<string, \"tree.DetachedField\">> {}\n\n/**\n * Some code abstracts the root as a node with detached fields as its fields.\n * This maps detached field to field keys for thus use.\n *\n * @returns `field` as a {@link FieldKey} usable on a special root node serving as a parent of detached fields.\n */\nexport function detachedFieldAsKey(field: DetachedField): FieldKey {\n\treturn brand(extractFromOpaque(field));\n}\n\n/**\n * The inverse of {@link detachedFieldAsKey}.\n * Thus must only be used on {@link FieldKey}s which were produced via {@link detachedFieldAsKey},\n * and with the same scope (ex: forest) as the detachedFieldAsKey was originally from.\n */\nexport function keyAsDetachedField(key: FieldKey): DetachedField {\n\treturn brand(key);\n}\n\n/**\n * TODO: integrate this into Schema. Decide how to persist them (need stable Id?). Maybe allow updating field kinds?.\n * TODO: make families of changes per field kind. Build editing APIs from that.\n * TODO: factor ChangeRebaser implementations to support adding new field kinds.\n */\nexport interface FieldKind {\n\treadonly name: string;\n\treadonly description: string;\n\treadonly minimumChildren: number;\n\treadonly maximumChildren: number;\n}\n\n/**\n * Value that may be stored on a leaf node.\n */\nexport type TreeValue<TSchema extends ValueSchema = ValueSchema> = [\n\t{\n\t\t[ValueSchema.Number]: number;\n\t\t[ValueSchema.String]: string;\n\t\t[ValueSchema.Boolean]: boolean;\n\t\t[ValueSchema.FluidHandle]: IFluidHandle;\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\t[ValueSchema.Null]: null;\n\t}[TSchema],\n][_InlineTrick];\n\n/**\n * Value stored on a node.\n */\nexport type Value = undefined | TreeValue;\n\n/**\n * The fields required by a node in a tree.\n *\n * @privateRemarks A forked version of this type is used in `persistedTreeTextFormat.ts`.\n * Changes to this type might necessitate changes to `EncodedNodeData` or codecs.\n * See persistedTreeTextFormat's module documentation for more details.\n */\nexport interface NodeData {\n\t/**\n\t * A payload of arbitrary serializable data.\n\t */\n\treadonly value?: TreeValue;\n\n\t/**\n\t * The meaning of this node.\n\t * Provides contexts/semantics for this node and its content.\n\t * Typically used to associate a node with metadata (including a schema) and source code (types, behaviors, etc).\n\t */\n\treadonly type: TreeNodeSchemaIdentifier;\n}\n\n/**\n * Use this type to indicate that a node sits above the detached fields, and thus is not a real node and who's type should not matter.\n */\nexport const aboveRootPlaceholder: TreeNodeSchemaIdentifier = brand(\n\t\"com.fluidframework.placeholder.aboveRoot\",\n);\n"]}
@@ -112,8 +112,6 @@ export declare class DefaultEditBuilder implements ChangeFamilyEditor, IDefaultE
112
112
  move(sourceField: FieldUpPath, sourceIndex: number, count: number, destinationField: FieldUpPath, destIndex: number): void;
113
113
  sequenceField(field: FieldUpPath): SequenceFieldEditBuilder<TreeChunk>;
114
114
  }
115
- /**
116
- */
117
115
  export interface ValueFieldEditBuilder<TContent> {
118
116
  /**
119
117
  * Issues a change which replaces the current newContent of the field with `newContent`.
@@ -122,8 +120,6 @@ export interface ValueFieldEditBuilder<TContent> {
122
120
  */
123
121
  set(newContent: TContent): void;
124
122
  }
125
- /**
126
- */
127
123
  export interface OptionalFieldEditBuilder<TContent> {
128
124
  /**
129
125
  * Issues a change which replaces the current newContent of the field with `newContent`
@@ -1 +1 @@
1
- {"version":3,"file":"defaultEditBuilder.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAEN,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,MAAM,EAGX,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAKN,KAAK,gBAAgB,EAIrB,MAAM,4BAA4B,CAAC;AAWpC,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAEhD;;;;GAIG;AACH,qBAAa,mBACZ,YAAW,YAAY,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;IAE7D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsB;gBAEjC,MAAM,EAAE,YAAY,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;IAIhF,IAAW,OAAO,IAAI,aAAa,CAAC,gBAAgB,CAAC,CAEpD;IAED,IAAW,MAAM,IAAI,YAAY,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAEzE;IAEM,WAAW,CACjB,eAAe,EAAE,MAAM,WAAW,EAClC,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,gBAAgB,CAAC,KAAK,IAAI,GAC9D,kBAAkB;CAGrB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAEjF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,gBAAgB,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAE5F;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0BhE,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,wBAAwB,CAAC,SAAS,CAAC;IAmCtE,IAAI,CACV,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,WAAW,EAC7B,SAAS,EAAE,MAAM,GACf,IAAI;IAoGA,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,wBAAwB,CAAC,SAAS,CAAC;CAsC7E;AAED;GACG;AACH,MAAM,WAAW,qBAAqB,CAAC,QAAQ;IAC9C;;;;OAIG;IACH,GAAG,CAAC,UAAU,EAAE,QAAQ,GAAG,IAAI,CAAC;CAChC;AAED;GACG;AACH,MAAM,WAAW,wBAAwB,CAAC,QAAQ;IACjD;;;;;OAKG;IACH,GAAG,CAAC,UAAU,EAAE,QAAQ,GAAG,SAAS,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/D;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAClE;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,GAAG,IAAI,CAAC;IAElD;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC/C"}
1
+ {"version":3,"file":"defaultEditBuilder.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAEN,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,WAAW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AAE,QAAQ,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,wBAAwB,CAAC,QAAQ;IACjD;;;;;OAKG;IACH,GAAG,CAAC,UAAU,EAAE,QAAQ,GAAG,SAAS,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/D;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAClE;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,GAAG,IAAI,CAAC;IAElD;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaultEditBuilder.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultEditBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA0D;AAC1D,uEAAsE;AAGtE,kDAiB6B;AAC7B,kDAA4C;AAC5C,yDASoC;AAIpC,iEAKgC;AAIhC;;;;GAIG;AACH,MAAa,mBAAmB;IAK/B,YAAmB,MAA6D;QAC/E,IAAI,CAAC,aAAa,GAAG,IAAI,8BAAmB,CAAC,iCAAU,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;IACnC,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;IAClC,CAAC;IAEM,WAAW,CACjB,eAAkC,EAClC,cAAgE;QAEhE,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC;IACtE,CAAC;CACD;AAvBD,kDAuBC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,YAA4C;IACrE,OAAO,IAAA,oBAAgB,EAAC,YAAY,EAAE,iCAAU,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,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,CAAC,CAChE,CAAC;gBACF,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,KAAK,EAAE,+BAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;YAChF,CAAC;SACD,CAAC;IACH,CAAC;CACD;AAvOD,gDAuOC;AA4CD;;GAEG;AACH,SAAS,qBAAqB,CAAC,KAAwB,EAAE,KAAwB;IAChF,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtD,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,OAAO,WAAW,GAAG,QAAQ,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,IAAA,cAAG,GAAE,CAAC;QAC/C,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,IAAA,cAAG,GAAE,CAAC;QAC/C,IAAI,UAAU,KAAK,UAAU,EAAE,CAAC;YAC/B,IACC,UAAU,CAAC,WAAW,KAAK,UAAU,CAAC,WAAW;gBACjD,UAAU,CAAC,WAAW,KAAK,UAAU,CAAC,WAAW,EAChD,CAAC;gBACF,MAAM;YACP,CAAC;QACF,CAAC;QACD,WAAW,IAAI,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { oob } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { ICodecFamily } from \"../../codec/index.js\";\nimport {\n\ttype ChangeAtomId,\n\ttype ChangeEncodingContext,\n\ttype ChangeFamily,\n\ttype ChangeFamilyEditor,\n\ttype ChangeRebaser,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaRoot,\n\ttype FieldUpPath,\n\ttype NormalizedFieldUpPath,\n\ttype NormalizedUpPath,\n\ttype RevisionTag,\n\ttype TaggedChange,\n\ttype TreeChunk,\n\ttype UpPath,\n\tcompareFieldUpPaths,\n\ttopDownPath,\n} from \"../../core/index.js\";\nimport { brand } from \"../../util/index.js\";\nimport {\n\ttype EditDescription,\n\ttype FieldChangeset,\n\ttype FieldEditDescription,\n\tModularChangeFamily,\n\ttype ModularChangeset,\n\tModularEditBuilder,\n\tintoDelta as intoModularDelta,\n\trelevantRemovedRoots as relevantModularRemovedRoots,\n} from \"../modular-schema/index.js\";\nimport type { OptionalChangeset } from \"../optional-field/index.js\";\nimport type { CellId } from \"../sequence-field/index.js\";\n\nimport {\n\tfieldKinds,\n\toptional,\n\tsequence,\n\trequired as valueFieldKind,\n} from \"./defaultFieldKinds.js\";\n\nexport type DefaultChangeset = ModularChangeset;\n\n/**\n * Implementation of {@link ChangeFamily} based on the default set of supported field kinds.\n *\n * @sealed\n */\nexport class DefaultChangeFamily\n\timplements ChangeFamily<DefaultEditBuilder, DefaultChangeset>\n{\n\tprivate readonly modularFamily: ModularChangeFamily;\n\n\tpublic constructor(codecs: ICodecFamily<ModularChangeset, ChangeEncodingContext>) {\n\t\tthis.modularFamily = new ModularChangeFamily(fieldKinds, codecs);\n\t}\n\n\tpublic get rebaser(): ChangeRebaser<DefaultChangeset> {\n\t\treturn this.modularFamily.rebaser;\n\t}\n\n\tpublic get codecs(): ICodecFamily<DefaultChangeset, ChangeEncodingContext> {\n\t\treturn this.modularFamily.codecs;\n\t}\n\n\tpublic buildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<DefaultChangeset>) => void,\n\t): DefaultEditBuilder {\n\t\treturn new DefaultEditBuilder(this, mintRevisionTag, changeReceiver);\n\t}\n}\n\n/**\n * @param change - The change to convert into a delta.\n */\nexport function intoDelta(taggedChange: TaggedChange<ModularChangeset>): DeltaRoot {\n\treturn intoModularDelta(taggedChange, fieldKinds);\n}\n\n/**\n * Returns the set of removed roots that should be in memory for the given change to be applied.\n * A removed root is relevant if any of the following is true:\n * - It is being inserted\n * - It is being restored\n * - It is being edited\n * - The ID it is associated with is being changed\n *\n * May be conservative by returning more removed roots than strictly necessary.\n *\n * Will never return IDs for non-root trees, even if they are removed.\n *\n * @param change - The change to be applied.\n */\nexport function relevantRemovedRoots(change: ModularChangeset): Iterable<DeltaDetachedNodeId> {\n\treturn relevantModularRemovedRoots(change, fieldKinds);\n}\n\n/**\n * Default editor for transactional tree data changes.\n * @privateRemarks\n * When taking into account not just the content of the tree,\n * but also how the merge identities (and thus anchors, flex-tree and simple-tree nodes) of nodes before and after the edits correspond,\n * some edits are currently impossible to express.\n * Examples of these non-expressible edits include:\n *\n * - Changing the type of a node while keeping its merge identity.\n * - Changing the value of a leaf while keeping its merge identity.\n * - Swapping subtrees between two value fields.\n * - Replacing a node in the middle of a tree while reusing some of the old nodes decedents that were under value fields.\n *\n * At some point it will likely be worth supporting at least some of these, possibly using a mechanism that could support all of them if desired.\n * If/when such a mechanism becomes available, an evaluation should be done to determine if any existing editing operations should be changed to leverage it\n * (Possibly by adding opt ins at the view schema layer).\n */\nexport interface IDefaultEditBuilder<TContent = TreeChunk> {\n\t/**\n\t * @param field - the value field which is being edited under the parent node\n\t * @returns An object with methods to edit the given field of the given parent.\n\t * The returned object can be used (i.e., have its methods called) multiple times but its lifetime\n\t * is bounded by the lifetime of this edit builder.\n\t */\n\tvalueField(field: NormalizedFieldUpPath): ValueFieldEditBuilder<TContent>;\n\n\t/**\n\t * @param field - the optional field which is being edited under the parent node\n\t * @returns An object with methods to edit the given field of the given parent.\n\t * The returned object can be used (i.e., have its methods called) multiple times but its lifetime\n\t * is bounded by the lifetime of this edit builder.\n\t */\n\toptionalField(field: NormalizedFieldUpPath): OptionalFieldEditBuilder<TContent>;\n\n\t/**\n\t * @param field - the sequence field which is being edited under the parent node\n\t *\n\t * @returns An object with methods to edit the given field of the given parent.\n\t * The returned object can be used (i.e., have its methods called) multiple times but its lifetime\n\t * is bounded by the lifetime of this edit builder.\n\t */\n\tsequenceField(field: NormalizedFieldUpPath): SequenceFieldEditBuilder<TContent>;\n\n\t/**\n\t * Moves a subsequence from one sequence field to another sequence field.\n\t *\n\t * Note that the `destinationIndex` is interpreted based on the state of the sequence *before* the move operation.\n\t * For example, `move(field, 0, 1, field, 2)` changes `[A, B, C]` to `[B, A, C]`.\n\t */\n\tmove(\n\t\tsourceField: NormalizedFieldUpPath,\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestinationField: NormalizedFieldUpPath,\n\t\tdestinationIndex: number,\n\t): void;\n\n\t/**\n\t * Add a constraint that the node at the given path must exist.\n\t * @param path - The path to the node that must exist.\n\t */\n\taddNodeExistsConstraint(path: NormalizedUpPath): void;\n\n\t/**\n\t * Add a constraint that the node at the given path must exist when reverting a change.\n\t * @param path - The path to the node that must exist when reverting a change.\n\t */\n\taddNodeExistsConstraintOnRevert(path: NormalizedUpPath): void;\n}\n\n/**\n * Implementation of {@link IDefaultEditBuilder} based on the default set of supported field kinds.\n * @sealed\n */\nexport class DefaultEditBuilder implements ChangeFamilyEditor, IDefaultEditBuilder {\n\tprivate readonly modularBuilder: ModularEditBuilder;\n\n\tpublic constructor(\n\t\tfamily: ChangeFamily<ChangeFamilyEditor, DefaultChangeset>,\n\t\tprivate readonly mintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<DefaultChangeset>) => void,\n\t) {\n\t\tthis.modularBuilder = new ModularEditBuilder(family, fieldKinds, changeReceiver);\n\t}\n\n\tpublic enterTransaction(): void {\n\t\tthis.modularBuilder.enterTransaction();\n\t}\n\tpublic exitTransaction(): void {\n\t\tthis.modularBuilder.exitTransaction();\n\t}\n\n\tpublic addNodeExistsConstraint(path: UpPath): void {\n\t\tthis.modularBuilder.addNodeExistsConstraint(path, this.mintRevisionTag());\n\t}\n\n\tpublic addNodeExistsConstraintOnRevert(path: UpPath): void {\n\t\tthis.modularBuilder.addNodeExistsConstraintOnRevert(path, this.mintRevisionTag());\n\t}\n\n\tpublic valueField(field: FieldUpPath): ValueFieldEditBuilder<TreeChunk> {\n\t\treturn {\n\t\t\tset: (newContent: TreeChunk): void => {\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst fill: ChangeAtomId = { localId: this.modularBuilder.generateId(), revision };\n\t\t\t\tconst detach: ChangeAtomId = { localId: this.modularBuilder.generateId(), revision };\n\t\t\t\tconst build = this.modularBuilder.buildTrees(fill.localId, newContent, revision);\n\t\t\t\tconst change: FieldChangeset = brand(\n\t\t\t\t\tvalueFieldKind.changeHandler.editor.set({\n\t\t\t\t\t\tfill,\n\t\t\t\t\t\tdetach,\n\t\t\t\t\t}),\n\t\t\t\t);\n\n\t\t\t\tconst edit: FieldEditDescription = {\n\t\t\t\t\ttype: \"field\",\n\t\t\t\t\tfield,\n\t\t\t\t\tfieldKind: valueFieldKind.identifier,\n\t\t\t\t\tchange,\n\t\t\t\t\trevision,\n\t\t\t\t};\n\t\t\t\tthis.modularBuilder.submitChanges([build, edit], revision);\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic optionalField(field: FieldUpPath): OptionalFieldEditBuilder<TreeChunk> {\n\t\treturn {\n\t\t\tset: (newContent: TreeChunk | undefined, wasEmpty: boolean): void => {\n\t\t\t\tconst edits: EditDescription[] = [];\n\t\t\t\tlet optionalChange: OptionalChangeset;\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst detach: ChangeAtomId = { localId: this.modularBuilder.generateId(), revision };\n\t\t\t\tif (newContent !== undefined) {\n\t\t\t\t\tconst fill: ChangeAtomId = { localId: this.modularBuilder.generateId(), revision };\n\t\t\t\t\tconst build = this.modularBuilder.buildTrees(fill.localId, newContent, revision);\n\t\t\t\t\tedits.push(build);\n\n\t\t\t\t\toptionalChange = optional.changeHandler.editor.set(wasEmpty, {\n\t\t\t\t\t\tfill,\n\t\t\t\t\t\tdetach,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\toptionalChange = optional.changeHandler.editor.clear(wasEmpty, detach);\n\t\t\t\t}\n\n\t\t\t\tconst change: FieldChangeset = brand(optionalChange);\n\t\t\t\tconst edit: FieldEditDescription = {\n\t\t\t\t\ttype: \"field\",\n\t\t\t\t\tfield,\n\t\t\t\t\tfieldKind: optional.identifier,\n\t\t\t\t\tchange,\n\t\t\t\t\trevision,\n\t\t\t\t};\n\t\t\t\tedits.push(edit);\n\n\t\t\t\tthis.modularBuilder.submitChanges(edits, revision);\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic move(\n\t\tsourceField: FieldUpPath,\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestinationField: FieldUpPath,\n\t\tdestIndex: number,\n\t): void {\n\t\tif (count === 0) {\n\t\t\treturn;\n\t\t} else if (count < 0 || !Number.isSafeInteger(count)) {\n\t\t\tthrow new UsageError(`Expected non-negative integer count, got ${count}.`);\n\t\t}\n\t\tconst revision = this.mintRevisionTag();\n\t\tconst detachCellId = this.modularBuilder.generateId(count);\n\t\tconst attachCellId: CellId = { localId: this.modularBuilder.generateId(count), revision };\n\t\tif (compareFieldUpPaths(sourceField, destinationField)) {\n\t\t\tconst change = sequence.changeHandler.editor.move(\n\t\t\t\tsourceIndex,\n\t\t\t\tcount,\n\t\t\t\tdestIndex,\n\t\t\t\tdetachCellId,\n\t\t\t\tattachCellId,\n\t\t\t\trevision,\n\t\t\t);\n\t\t\tthis.modularBuilder.submitChange(\n\t\t\t\tsourceField,\n\t\t\t\tsequence.identifier,\n\t\t\t\tbrand(change),\n\t\t\t\trevision,\n\t\t\t);\n\t\t} else {\n\t\t\tconst detachPath = topDownPath(sourceField.parent);\n\t\t\tconst attachPath = topDownPath(destinationField.parent);\n\t\t\tconst sharedDepth = getSharedPrefixLength(detachPath, attachPath);\n\t\t\tlet adjustedAttachField = destinationField;\n\t\t\t// After the above loop, `sharedDepth` is the number of elements, starting from the root,\n\t\t\t// that both paths have in common.\n\t\t\tif (sharedDepth === detachPath.length) {\n\t\t\t\tconst attachField = attachPath[sharedDepth]?.parentField ?? destinationField.field;\n\t\t\t\tif (attachField === sourceField.field) {\n\t\t\t\t\t// The detach occurs in an ancestor field of the field where the attach occurs.\n\t\t\t\t\tlet attachAncestorIndex = attachPath[sharedDepth]?.parentIndex ?? sourceIndex;\n\t\t\t\t\tif (attachAncestorIndex < sourceIndex) {\n\t\t\t\t\t\t// The attach path runs through a node located before the detached nodes.\n\t\t\t\t\t\t// No need to adjust the attach path.\n\t\t\t\t\t} else if (sourceIndex + count <= attachAncestorIndex) {\n\t\t\t\t\t\t// The attach path runs through a node located after the detached nodes.\n\t\t\t\t\t\t// adjust the index for the node at that depth of the path, so that it is interpreted correctly\n\t\t\t\t\t\t// in the composition performed by `submitChanges`.\n\t\t\t\t\t\tattachAncestorIndex -= count;\n\t\t\t\t\t\tlet parent: UpPath | undefined = attachPath[sharedDepth - 1];\n\t\t\t\t\t\tconst parentField = attachPath[sharedDepth] ?? oob();\n\t\t\t\t\t\tparent = {\n\t\t\t\t\t\t\tparent,\n\t\t\t\t\t\t\tparentIndex: attachAncestorIndex,\n\t\t\t\t\t\t\tparentField: parentField.parentField,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (let i = sharedDepth + 1; i < attachPath.length; i += 1) {\n\t\t\t\t\t\t\tparent = {\n\t\t\t\t\t\t\t\t...(attachPath[i] ?? oob()),\n\t\t\t\t\t\t\t\tparent,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tadjustedAttachField = { parent, field: destinationField.field };\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\"Invalid move operation: the destination is located under one of the moved elements. Consider using the Tree.contains API to detect this.\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst moveOut = sequence.changeHandler.editor.moveOut(\n\t\t\t\tsourceIndex,\n\t\t\t\tcount,\n\t\t\t\tdetachCellId,\n\t\t\t\trevision,\n\t\t\t);\n\t\t\tconst moveIn = sequence.changeHandler.editor.moveIn(\n\t\t\t\tdestIndex,\n\t\t\t\tcount,\n\t\t\t\tdetachCellId,\n\t\t\t\tattachCellId,\n\t\t\t\trevision,\n\t\t\t);\n\t\t\tthis.modularBuilder.submitChanges(\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"field\",\n\t\t\t\t\t\tfield: sourceField,\n\t\t\t\t\t\tfieldKind: sequence.identifier,\n\t\t\t\t\t\tchange: brand(moveOut),\n\t\t\t\t\t\trevision,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"field\",\n\t\t\t\t\t\tfield: adjustedAttachField,\n\t\t\t\t\t\tfieldKind: sequence.identifier,\n\t\t\t\t\t\tchange: brand(moveIn),\n\t\t\t\t\t\trevision,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\trevision,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic sequenceField(field: FieldUpPath): SequenceFieldEditBuilder<TreeChunk> {\n\t\treturn {\n\t\t\tinsert: (index: number, content: TreeChunk): void => {\n\t\t\t\tconst length = content.topLevelLength;\n\t\t\t\tif (length === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst firstId: CellId = { localId: this.modularBuilder.generateId(length), revision };\n\t\t\t\tconst build = this.modularBuilder.buildTrees(firstId.localId, content, revision);\n\t\t\t\tconst change: FieldChangeset = brand(\n\t\t\t\t\tsequence.changeHandler.editor.insert(index, length, firstId, revision),\n\t\t\t\t);\n\t\t\t\tconst attach: FieldEditDescription = {\n\t\t\t\t\ttype: \"field\",\n\t\t\t\t\tfield,\n\t\t\t\t\tfieldKind: sequence.identifier,\n\t\t\t\t\tchange,\n\t\t\t\t\trevision,\n\t\t\t\t};\n\t\t\t\t// The changes have to be submitted together, otherwise they will be assigned different revisions,\n\t\t\t\t// which will prevent the build ID and the insert ID from matching.\n\t\t\t\tthis.modularBuilder.submitChanges([build, attach], revision);\n\t\t\t},\n\t\t\tremove: (index: number, count: number): void => {\n\t\t\t\tif (count === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst id = this.modularBuilder.generateId(count);\n\t\t\t\tconst change: FieldChangeset = brand(\n\t\t\t\t\tsequence.changeHandler.editor.remove(index, count, id, revision),\n\t\t\t\t);\n\t\t\t\tthis.modularBuilder.submitChange(field, sequence.identifier, change, revision);\n\t\t\t},\n\t\t};\n\t}\n}\n\n/**\n */\nexport interface ValueFieldEditBuilder<TContent> {\n\t/**\n\t * Issues a change which replaces the current newContent of the field with `newContent`.\n\t * @param newContent - the new content for the field.\n\t * The cursor can be in either Field or Node mode and must represent exactly one node.\n\t */\n\tset(newContent: TContent): void;\n}\n\n/**\n */\nexport interface OptionalFieldEditBuilder<TContent> {\n\t/**\n\t * Issues a change which replaces the current newContent of the field with `newContent`\n\t * @param newContent - the new content for the field.\n\t * If provided, the cursor can be in either Field or Node mode and must represent exactly one node.\n\t * @param wasEmpty - whether the field is empty when creating this change\n\t */\n\tset(newContent: TContent | undefined, wasEmpty: boolean): void;\n}\n\n/**\n * Edit builder for the sequence field kind.\n */\nexport interface SequenceFieldEditBuilder<TContent, TRemoved = void> {\n\t/**\n\t * Issues a change which inserts the `newContent` at the given `index`.\n\t * @param index - the index at which to insert the `newContent`.\n\t * @param newContent - the new content to be inserted in the field. Cursor can be in either Field or Node mode.\n\t */\n\tinsert(index: number, newContent: TContent): void;\n\n\t/**\n\t * Issues a change which removes `count` elements starting at the given `index`.\n\t * @param index - The index of the first removed element.\n\t * @param count - The number of elements to remove.\n\t */\n\tremove(index: number, count: number): TRemoved;\n}\n\n/**\n * Gets the number of path elements that both paths share, starting at index 0.\n */\nfunction getSharedPrefixLength(pathA: readonly UpPath[], pathB: readonly UpPath[]): number {\n\tconst minDepth = Math.min(pathA.length, pathB.length);\n\tlet sharedDepth = 0;\n\twhile (sharedDepth < minDepth) {\n\t\tconst detachStep = pathA[sharedDepth] ?? oob();\n\t\tconst attachStep = pathB[sharedDepth] ?? oob();\n\t\tif (detachStep !== attachStep) {\n\t\t\tif (\n\t\t\t\tdetachStep.parentField !== attachStep.parentField ||\n\t\t\t\tdetachStep.parentIndex !== attachStep.parentIndex\n\t\t\t) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tsharedDepth += 1;\n\t}\n\treturn sharedDepth;\n}\n"]}
1
+ {"version":3,"file":"defaultEditBuilder.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultEditBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA0D;AAC1D,uEAAsE;AAGtE,kDAiB6B;AAC7B,kDAA4C;AAC5C,yDASoC;AAIpC,iEAKgC;AAIhC;;;;GAIG;AACH,MAAa,mBAAmB;IAK/B,YAAmB,MAA6D;QAC/E,IAAI,CAAC,aAAa,GAAG,IAAI,8BAAmB,CAAC,iCAAU,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;IACnC,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;IAClC,CAAC;IAEM,WAAW,CACjB,eAAkC,EAClC,cAAgE;QAEhE,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC;IACtE,CAAC;CACD;AAvBD,kDAuBC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,YAA4C;IACrE,OAAO,IAAA,oBAAgB,EAAC,YAAY,EAAE,iCAAU,CAAC,CAAC;AACnD,CAAC;AAFD,8BAEC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,oBAAoB,CAAC,MAAwB;IAC5D,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,cAAc,CAAC,YAAY,CAAC,KAAK,EAAE,+BAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;YAChF,CAAC;SACD,CAAC;IACH,CAAC;CACD;AAvOD,gDAuOC;AAwCD;;GAEG;AACH,SAAS,qBAAqB,CAAC,KAAwB,EAAE,KAAwB;IAChF,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtD,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,OAAO,WAAW,GAAG,QAAQ,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,IAAA,cAAG,GAAE,CAAC;QAC/C,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,IAAA,cAAG,GAAE,CAAC;QAC/C,IAAI,UAAU,KAAK,UAAU,EAAE,CAAC;YAC/B,IACC,UAAU,CAAC,WAAW,KAAK,UAAU,CAAC,WAAW;gBACjD,UAAU,CAAC,WAAW,KAAK,UAAU,CAAC,WAAW,EAChD,CAAC;gBACF,MAAM;YACP,CAAC;QACF,CAAC;QACD,WAAW,IAAI,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { oob } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { ICodecFamily } from \"../../codec/index.js\";\nimport {\n\ttype ChangeAtomId,\n\ttype ChangeEncodingContext,\n\ttype ChangeFamily,\n\ttype ChangeFamilyEditor,\n\ttype ChangeRebaser,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaRoot,\n\ttype FieldUpPath,\n\ttype NormalizedFieldUpPath,\n\ttype NormalizedUpPath,\n\ttype RevisionTag,\n\ttype TaggedChange,\n\ttype TreeChunk,\n\ttype UpPath,\n\tcompareFieldUpPaths,\n\ttopDownPath,\n} from \"../../core/index.js\";\nimport { brand } from \"../../util/index.js\";\nimport {\n\ttype EditDescription,\n\ttype FieldChangeset,\n\ttype FieldEditDescription,\n\tModularChangeFamily,\n\ttype ModularChangeset,\n\tModularEditBuilder,\n\tintoDelta as intoModularDelta,\n\trelevantRemovedRoots as relevantModularRemovedRoots,\n} from \"../modular-schema/index.js\";\nimport type { OptionalChangeset } from \"../optional-field/index.js\";\nimport type { CellId } from \"../sequence-field/index.js\";\n\nimport {\n\tfieldKinds,\n\toptional,\n\tsequence,\n\trequired as valueFieldKind,\n} from \"./defaultFieldKinds.js\";\n\nexport type DefaultChangeset = ModularChangeset;\n\n/**\n * Implementation of {@link ChangeFamily} based on the default set of supported field kinds.\n *\n * @sealed\n */\nexport class DefaultChangeFamily\n\timplements ChangeFamily<DefaultEditBuilder, DefaultChangeset>\n{\n\tprivate readonly modularFamily: ModularChangeFamily;\n\n\tpublic constructor(codecs: ICodecFamily<ModularChangeset, ChangeEncodingContext>) {\n\t\tthis.modularFamily = new ModularChangeFamily(fieldKinds, codecs);\n\t}\n\n\tpublic get rebaser(): ChangeRebaser<DefaultChangeset> {\n\t\treturn this.modularFamily.rebaser;\n\t}\n\n\tpublic get codecs(): ICodecFamily<DefaultChangeset, ChangeEncodingContext> {\n\t\treturn this.modularFamily.codecs;\n\t}\n\n\tpublic buildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<DefaultChangeset>) => void,\n\t): DefaultEditBuilder {\n\t\treturn new DefaultEditBuilder(this, mintRevisionTag, changeReceiver);\n\t}\n}\n\n/**\n * @param change - The change to convert into a delta.\n */\nexport function intoDelta(taggedChange: TaggedChange<ModularChangeset>): DeltaRoot {\n\treturn intoModularDelta(taggedChange, fieldKinds);\n}\n\n/**\n * Returns the set of removed roots that should be in memory for the given change to be applied.\n * A removed root is relevant if any of the following is true:\n * - It is being inserted\n * - It is being restored\n * - It is being edited\n * - The ID it is associated with is being changed\n *\n * May be conservative by returning more removed roots than strictly necessary.\n *\n * Will never return IDs for non-root trees, even if they are removed.\n *\n * @param change - The change to be applied.\n */\nexport function relevantRemovedRoots(change: ModularChangeset): Iterable<DeltaDetachedNodeId> {\n\treturn relevantModularRemovedRoots(change, fieldKinds);\n}\n\n/**\n * Default editor for transactional tree data changes.\n * @privateRemarks\n * When taking into account not just the content of the tree,\n * but also how the merge identities (and thus anchors, flex-tree and simple-tree nodes) of nodes before and after the edits correspond,\n * some edits are currently impossible to express.\n * Examples of these non-expressible edits include:\n *\n * - Changing the type of a node while keeping its merge identity.\n * - Changing the value of a leaf while keeping its merge identity.\n * - Swapping subtrees between two value fields.\n * - Replacing a node in the middle of a tree while reusing some of the old nodes decedents that were under value fields.\n *\n * At some point it will likely be worth supporting at least some of these, possibly using a mechanism that could support all of them if desired.\n * If/when such a mechanism becomes available, an evaluation should be done to determine if any existing editing operations should be changed to leverage it\n * (Possibly by adding opt ins at the view schema layer).\n */\nexport interface IDefaultEditBuilder<TContent = TreeChunk> {\n\t/**\n\t * @param field - the value field which is being edited under the parent node\n\t * @returns An object with methods to edit the given field of the given parent.\n\t * The returned object can be used (i.e., have its methods called) multiple times but its lifetime\n\t * is bounded by the lifetime of this edit builder.\n\t */\n\tvalueField(field: NormalizedFieldUpPath): ValueFieldEditBuilder<TContent>;\n\n\t/**\n\t * @param field - the optional field which is being edited under the parent node\n\t * @returns An object with methods to edit the given field of the given parent.\n\t * The returned object can be used (i.e., have its methods called) multiple times but its lifetime\n\t * is bounded by the lifetime of this edit builder.\n\t */\n\toptionalField(field: NormalizedFieldUpPath): OptionalFieldEditBuilder<TContent>;\n\n\t/**\n\t * @param field - the sequence field which is being edited under the parent node\n\t *\n\t * @returns An object with methods to edit the given field of the given parent.\n\t * The returned object can be used (i.e., have its methods called) multiple times but its lifetime\n\t * is bounded by the lifetime of this edit builder.\n\t */\n\tsequenceField(field: NormalizedFieldUpPath): SequenceFieldEditBuilder<TContent>;\n\n\t/**\n\t * Moves a subsequence from one sequence field to another sequence field.\n\t *\n\t * Note that the `destinationIndex` is interpreted based on the state of the sequence *before* the move operation.\n\t * For example, `move(field, 0, 1, field, 2)` changes `[A, B, C]` to `[B, A, C]`.\n\t */\n\tmove(\n\t\tsourceField: NormalizedFieldUpPath,\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestinationField: NormalizedFieldUpPath,\n\t\tdestinationIndex: number,\n\t): void;\n\n\t/**\n\t * Add a constraint that the node at the given path must exist.\n\t * @param path - The path to the node that must exist.\n\t */\n\taddNodeExistsConstraint(path: NormalizedUpPath): void;\n\n\t/**\n\t * Add a constraint that the node at the given path must exist when reverting a change.\n\t * @param path - The path to the node that must exist when reverting a change.\n\t */\n\taddNodeExistsConstraintOnRevert(path: NormalizedUpPath): void;\n}\n\n/**\n * Implementation of {@link IDefaultEditBuilder} based on the default set of supported field kinds.\n * @sealed\n */\nexport class DefaultEditBuilder implements ChangeFamilyEditor, IDefaultEditBuilder {\n\tprivate readonly modularBuilder: ModularEditBuilder;\n\n\tpublic constructor(\n\t\tfamily: ChangeFamily<ChangeFamilyEditor, DefaultChangeset>,\n\t\tprivate readonly mintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<DefaultChangeset>) => void,\n\t) {\n\t\tthis.modularBuilder = new ModularEditBuilder(family, fieldKinds, changeReceiver);\n\t}\n\n\tpublic enterTransaction(): void {\n\t\tthis.modularBuilder.enterTransaction();\n\t}\n\tpublic exitTransaction(): void {\n\t\tthis.modularBuilder.exitTransaction();\n\t}\n\n\tpublic addNodeExistsConstraint(path: UpPath): void {\n\t\tthis.modularBuilder.addNodeExistsConstraint(path, this.mintRevisionTag());\n\t}\n\n\tpublic addNodeExistsConstraintOnRevert(path: UpPath): void {\n\t\tthis.modularBuilder.addNodeExistsConstraintOnRevert(path, this.mintRevisionTag());\n\t}\n\n\tpublic valueField(field: FieldUpPath): ValueFieldEditBuilder<TreeChunk> {\n\t\treturn {\n\t\t\tset: (newContent: TreeChunk): void => {\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst fill: ChangeAtomId = { localId: this.modularBuilder.generateId(), revision };\n\t\t\t\tconst detach: ChangeAtomId = { localId: this.modularBuilder.generateId(), revision };\n\t\t\t\tconst build = this.modularBuilder.buildTrees(fill.localId, newContent, revision);\n\t\t\t\tconst change: FieldChangeset = brand(\n\t\t\t\t\tvalueFieldKind.changeHandler.editor.set({\n\t\t\t\t\t\tfill,\n\t\t\t\t\t\tdetach,\n\t\t\t\t\t}),\n\t\t\t\t);\n\n\t\t\t\tconst edit: FieldEditDescription = {\n\t\t\t\t\ttype: \"field\",\n\t\t\t\t\tfield,\n\t\t\t\t\tfieldKind: valueFieldKind.identifier,\n\t\t\t\t\tchange,\n\t\t\t\t\trevision,\n\t\t\t\t};\n\t\t\t\tthis.modularBuilder.submitChanges([build, edit], revision);\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic optionalField(field: FieldUpPath): OptionalFieldEditBuilder<TreeChunk> {\n\t\treturn {\n\t\t\tset: (newContent: TreeChunk | undefined, wasEmpty: boolean): void => {\n\t\t\t\tconst edits: EditDescription[] = [];\n\t\t\t\tlet optionalChange: OptionalChangeset;\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst detach: ChangeAtomId = { localId: this.modularBuilder.generateId(), revision };\n\t\t\t\tif (newContent !== undefined) {\n\t\t\t\t\tconst fill: ChangeAtomId = { localId: this.modularBuilder.generateId(), revision };\n\t\t\t\t\tconst build = this.modularBuilder.buildTrees(fill.localId, newContent, revision);\n\t\t\t\t\tedits.push(build);\n\n\t\t\t\t\toptionalChange = optional.changeHandler.editor.set(wasEmpty, {\n\t\t\t\t\t\tfill,\n\t\t\t\t\t\tdetach,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\toptionalChange = optional.changeHandler.editor.clear(wasEmpty, detach);\n\t\t\t\t}\n\n\t\t\t\tconst change: FieldChangeset = brand(optionalChange);\n\t\t\t\tconst edit: FieldEditDescription = {\n\t\t\t\t\ttype: \"field\",\n\t\t\t\t\tfield,\n\t\t\t\t\tfieldKind: optional.identifier,\n\t\t\t\t\tchange,\n\t\t\t\t\trevision,\n\t\t\t\t};\n\t\t\t\tedits.push(edit);\n\n\t\t\t\tthis.modularBuilder.submitChanges(edits, revision);\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic move(\n\t\tsourceField: FieldUpPath,\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestinationField: FieldUpPath,\n\t\tdestIndex: number,\n\t): void {\n\t\tif (count === 0) {\n\t\t\treturn;\n\t\t} else if (count < 0 || !Number.isSafeInteger(count)) {\n\t\t\tthrow new UsageError(`Expected non-negative integer count, got ${count}.`);\n\t\t}\n\t\tconst revision = this.mintRevisionTag();\n\t\tconst detachCellId = this.modularBuilder.generateId(count);\n\t\tconst attachCellId: CellId = { localId: this.modularBuilder.generateId(count), revision };\n\t\tif (compareFieldUpPaths(sourceField, destinationField)) {\n\t\t\tconst change = sequence.changeHandler.editor.move(\n\t\t\t\tsourceIndex,\n\t\t\t\tcount,\n\t\t\t\tdestIndex,\n\t\t\t\tdetachCellId,\n\t\t\t\tattachCellId,\n\t\t\t\trevision,\n\t\t\t);\n\t\t\tthis.modularBuilder.submitChange(\n\t\t\t\tsourceField,\n\t\t\t\tsequence.identifier,\n\t\t\t\tbrand(change),\n\t\t\t\trevision,\n\t\t\t);\n\t\t} else {\n\t\t\tconst detachPath = topDownPath(sourceField.parent);\n\t\t\tconst attachPath = topDownPath(destinationField.parent);\n\t\t\tconst sharedDepth = getSharedPrefixLength(detachPath, attachPath);\n\t\t\tlet adjustedAttachField = destinationField;\n\t\t\t// After the above loop, `sharedDepth` is the number of elements, starting from the root,\n\t\t\t// that both paths have in common.\n\t\t\tif (sharedDepth === detachPath.length) {\n\t\t\t\tconst attachField = attachPath[sharedDepth]?.parentField ?? destinationField.field;\n\t\t\t\tif (attachField === sourceField.field) {\n\t\t\t\t\t// The detach occurs in an ancestor field of the field where the attach occurs.\n\t\t\t\t\tlet attachAncestorIndex = attachPath[sharedDepth]?.parentIndex ?? sourceIndex;\n\t\t\t\t\tif (attachAncestorIndex < sourceIndex) {\n\t\t\t\t\t\t// The attach path runs through a node located before the detached nodes.\n\t\t\t\t\t\t// No need to adjust the attach path.\n\t\t\t\t\t} else if (sourceIndex + count <= attachAncestorIndex) {\n\t\t\t\t\t\t// The attach path runs through a node located after the detached nodes.\n\t\t\t\t\t\t// adjust the index for the node at that depth of the path, so that it is interpreted correctly\n\t\t\t\t\t\t// in the composition performed by `submitChanges`.\n\t\t\t\t\t\tattachAncestorIndex -= count;\n\t\t\t\t\t\tlet parent: UpPath | undefined = attachPath[sharedDepth - 1];\n\t\t\t\t\t\tconst parentField = attachPath[sharedDepth] ?? oob();\n\t\t\t\t\t\tparent = {\n\t\t\t\t\t\t\tparent,\n\t\t\t\t\t\t\tparentIndex: attachAncestorIndex,\n\t\t\t\t\t\t\tparentField: parentField.parentField,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (let i = sharedDepth + 1; i < attachPath.length; i += 1) {\n\t\t\t\t\t\t\tparent = {\n\t\t\t\t\t\t\t\t...(attachPath[i] ?? oob()),\n\t\t\t\t\t\t\t\tparent,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tadjustedAttachField = { parent, field: destinationField.field };\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\"Invalid move operation: the destination is located under one of the moved elements. Consider using the Tree.contains API to detect this.\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst moveOut = sequence.changeHandler.editor.moveOut(\n\t\t\t\tsourceIndex,\n\t\t\t\tcount,\n\t\t\t\tdetachCellId,\n\t\t\t\trevision,\n\t\t\t);\n\t\t\tconst moveIn = sequence.changeHandler.editor.moveIn(\n\t\t\t\tdestIndex,\n\t\t\t\tcount,\n\t\t\t\tdetachCellId,\n\t\t\t\tattachCellId,\n\t\t\t\trevision,\n\t\t\t);\n\t\t\tthis.modularBuilder.submitChanges(\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"field\",\n\t\t\t\t\t\tfield: sourceField,\n\t\t\t\t\t\tfieldKind: sequence.identifier,\n\t\t\t\t\t\tchange: brand(moveOut),\n\t\t\t\t\t\trevision,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"field\",\n\t\t\t\t\t\tfield: adjustedAttachField,\n\t\t\t\t\t\tfieldKind: sequence.identifier,\n\t\t\t\t\t\tchange: brand(moveIn),\n\t\t\t\t\t\trevision,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\trevision,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic sequenceField(field: FieldUpPath): SequenceFieldEditBuilder<TreeChunk> {\n\t\treturn {\n\t\t\tinsert: (index: number, content: TreeChunk): void => {\n\t\t\t\tconst length = content.topLevelLength;\n\t\t\t\tif (length === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst firstId: CellId = { localId: this.modularBuilder.generateId(length), revision };\n\t\t\t\tconst build = this.modularBuilder.buildTrees(firstId.localId, content, revision);\n\t\t\t\tconst change: FieldChangeset = brand(\n\t\t\t\t\tsequence.changeHandler.editor.insert(index, length, firstId, revision),\n\t\t\t\t);\n\t\t\t\tconst attach: FieldEditDescription = {\n\t\t\t\t\ttype: \"field\",\n\t\t\t\t\tfield,\n\t\t\t\t\tfieldKind: sequence.identifier,\n\t\t\t\t\tchange,\n\t\t\t\t\trevision,\n\t\t\t\t};\n\t\t\t\t// The changes have to be submitted together, otherwise they will be assigned different revisions,\n\t\t\t\t// which will prevent the build ID and the insert ID from matching.\n\t\t\t\tthis.modularBuilder.submitChanges([build, attach], revision);\n\t\t\t},\n\t\t\tremove: (index: number, count: number): void => {\n\t\t\t\tif (count === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst id = this.modularBuilder.generateId(count);\n\t\t\t\tconst change: FieldChangeset = brand(\n\t\t\t\t\tsequence.changeHandler.editor.remove(index, count, id, revision),\n\t\t\t\t);\n\t\t\t\tthis.modularBuilder.submitChange(field, sequence.identifier, change, revision);\n\t\t\t},\n\t\t};\n\t}\n}\n\nexport interface ValueFieldEditBuilder<TContent> {\n\t/**\n\t * Issues a change which replaces the current newContent of the field with `newContent`.\n\t * @param newContent - the new content for the field.\n\t * The cursor can be in either Field or Node mode and must represent exactly one node.\n\t */\n\tset(newContent: TContent): void;\n}\n\nexport interface OptionalFieldEditBuilder<TContent> {\n\t/**\n\t * Issues a change which replaces the current newContent of the field with `newContent`\n\t * @param newContent - the new content for the field.\n\t * If provided, the cursor can be in either Field or Node mode and must represent exactly one node.\n\t * @param wasEmpty - whether the field is empty when creating this change\n\t */\n\tset(newContent: TContent | undefined, wasEmpty: boolean): void;\n}\n\n/**\n * Edit builder for the sequence field kind.\n */\nexport interface SequenceFieldEditBuilder<TContent, TRemoved = void> {\n\t/**\n\t * Issues a change which inserts the `newContent` at the given `index`.\n\t * @param index - the index at which to insert the `newContent`.\n\t * @param newContent - the new content to be inserted in the field. Cursor can be in either Field or Node mode.\n\t */\n\tinsert(index: number, newContent: TContent): void;\n\n\t/**\n\t * Issues a change which removes `count` elements starting at the given `index`.\n\t * @param index - The index of the first removed element.\n\t * @param count - The number of elements to remove.\n\t */\n\tremove(index: number, count: number): TRemoved;\n}\n\n/**\n * Gets the number of path elements that both paths share, starting at index 0.\n */\nfunction getSharedPrefixLength(pathA: readonly UpPath[], pathB: readonly UpPath[]): number {\n\tconst minDepth = Math.min(pathA.length, pathB.length);\n\tlet sharedDepth = 0;\n\twhile (sharedDepth < minDepth) {\n\t\tconst detachStep = pathA[sharedDepth] ?? oob();\n\t\tconst attachStep = pathB[sharedDepth] ?? oob();\n\t\tif (detachStep !== attachStep) {\n\t\t\tif (\n\t\t\t\tdetachStep.parentField !== attachStep.parentField ||\n\t\t\t\tdetachStep.parentIndex !== attachStep.parentIndex\n\t\t\t) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tsharedDepth += 1;\n\t}\n\treturn sharedDepth;\n}\n"]}
@@ -79,24 +79,14 @@ export declare const fieldKindConfigurations: ReadonlyMap<number, FieldKindConfi
79
79
  * code which uses this should be audited for compatibility considerations.
80
80
  */
81
81
  export declare const fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindWithEditor>;
82
- /**
83
- */
84
82
  export interface Required extends FlexFieldKind<"Value", Multiplicity.Single> {
85
83
  }
86
- /**
87
- */
88
84
  export interface Optional extends FlexFieldKind<"Optional", Multiplicity.Optional> {
89
85
  }
90
- /**
91
- */
92
86
  export interface Sequence extends FlexFieldKind<"Sequence", Multiplicity.Sequence> {
93
87
  }
94
- /**
95
- */
96
88
  export interface Identifier extends FlexFieldKind<"Identifier", Multiplicity.Single> {
97
89
  }
98
- /**
99
- */
100
90
  export interface Forbidden extends FlexFieldKind<typeof forbiddenFieldKindIdentifier, Multiplicity.Forbidden> {
101
91
  }
102
92
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"defaultFieldKinds.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultFieldKinds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,YAAY,EAEjB,KAAK,mBAAmB,EACxB,4BAA4B,EAC5B,YAAY,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEN,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAE3B,mBAAmB,EACnB,KAAK,aAAa,EAIlB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,KAAK,iBAAiB,EAGtB,MAAM,4BAA4B,CAAC;AAKpC;;GAEG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AE,SAAS,CAAC;CAC4B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaultFieldKinds.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultFieldKinds.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAE3D,kDAM6B;AAC7B,yDAWoC;AACpC,yDAIoC;AACpC,yDAAwE;AAExE,2DAA0D;AAE1D;;GAEG;AACU,QAAA,eAAe,GAA0B;IACrD,OAAO,EAAE,IAAA,0CAA+B,EAAC;QACxC,OAAO,EAAE,CAAC,OAAU,EAAE,OAAU,EAAE,EAAE,CAAC,CAAC;QACtC,MAAM,EAAE,CAAC,OAAU,EAAE,EAAE,CAAC,CAAC;QACzB,MAAM,EAAE,CAAC,MAAS,EAAE,IAAO,EAAE,EAAE,CAAC,CAAC;KACjC,CAAC;IACF,aAAa,EAAE,GAAG,EAAE,CAAC,uCAAmB;IACxC,MAAM,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,CAAC,IAAA,eAAI,EAAC,KAAK,CAAC,iCAAiC,CAAC,EAAE;IAClF,SAAS,EAAE,CAAC,MAAM,EAAE,cAAuB,EAAoB,EAAE,CAAC,CAAC,EAAE,CAAC;IACtE,oBAAoB,EAAE,CAAC,MAAM,EAAiC,EAAE,CAAC,EAAE;IACnE,OAAO,EAAE,CAAC,MAAS,EAAE,EAAE,CAAC,IAAI;IAC5B,gBAAgB,EAAE,CAAC,MAAS,EAAE,EAAE,CAAC,EAAE;IACnC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;IACpB,iBAAiB,EAAE,GAAG,EAAE,CAAC,EAAE;CAC3B,CAAC;AAUF,MAAM,kBAAkB,GAAG,UAAU,CAAC;AACtC;;GAEG;AACU,QAAA,QAAQ,GAAG,IAAI,8BAAmB,CAC9C,kBAAkB,EAClB,uBAAY,CAAC,QAAQ,EACrB,gCAAqB,EACrB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAChB,CAAC,KAAK,C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D,CAAC,gBAAQ,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,gBAAQ,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;YAC3D,CAAC,iBAAS,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,iBAAS,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;YAC7D,CAAC,kBAAU,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,kBAAU,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;SAC/D,CAAC;KACF;CACD,CAAC,CAAC;AAEH;;;;;;GAMG;AACU,QAAA,UAAU,GAA0D,IAAI,GAAG,CACvF,CAAC,gBAAQ,EAAE,gBAAQ,EAAE,gBAAQ,EAAE,eAAO,EAAE,kBAAU,EAAE,iBAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAC5F,CAAC;AAwBF;;GAEG;AACU,QAAA,UAAU,GAOnB,EAAE,QAAQ,EAAR,gBAAQ,EAAE,QAAQ,EAAR,gBAAQ,EAAE,QAAQ,EAAR,gBAAQ,EAAE,UAAU,EAAV,kBAAU,EAAE,SAAS,EAAT,iBAAS,EAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype DeltaDetachedNodeId,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity,\n} from \"../../core/index.js\";\nimport {\n\ttype FieldChangeDelta,\n\ttype FieldChangeHandler,\n\ttype FieldEditor,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tFieldKindWithEditor,\n\ttype FlexFieldKind,\n\ttype ToDelta,\n\tallowsTreeSchemaIdentifierSuperset,\n\treferenceFreeFieldChangeRebaser,\n} from \"../modular-schema/index.js\";\nimport {\n\ttype OptionalChangeset,\n\toptionalChangeHandler,\n\toptionalFieldEditor,\n} from \"../optional-field/index.js\";\nimport { sequenceFieldChangeHandler } from \"../sequence-field/index.js\";\n\nimport { noChangeCodecFamily } from \"./noChangeCodecs.js\";\n\n/**\n * ChangeHandler that only handles no-op / identity changes.\n */\nexport const noChangeHandler: FieldChangeHandler<0> = {\n\trebaser: referenceFreeFieldChangeRebaser({\n\t\tcompose: (change1: 0, change2: 0) => 0,\n\t\tinvert: (changes: 0) => 0,\n\t\trebase: (change: 0, over: 0) => 0,\n\t}),\n\tcodecsFactory: () => noChangeCodecFamily,\n\teditor: { buildChildChanges: () => fail(0xb0d /* Child changes not supported */) },\n\tintoDelta: (change, deltaFromChild: ToDelta): FieldChangeDelta => ({}),\n\trelevantRemovedRoots: (change): Iterable<DeltaDetachedNodeId> => [],\n\tisEmpty: (change: 0) => true,\n\tgetNestedChanges: (change: 0) => [],\n\tcreateEmpty: () => 0,\n\tgetCrossFieldKeys: () => [],\n};\n\nexport interface ValueFieldEditor extends FieldEditor<OptionalChangeset> {\n\t/**\n\t * Creates a change which replaces the current value of the field with `newValue`.\n\t * @param ids - The ids for the fill and detach fields.\n\t */\n\tset(ids: { fill: ChangeAtomId; detach: ChangeAtomId }): OptionalChangeset;\n}\n\nconst optionalIdentifier = \"Optional\";\n/**\n * 0 or 1 items.\n */\nexport const optional = new FieldKindWithEditor(\n\toptionalIdentifier,\n\tMultiplicity.Optional,\n\toptionalChangeHandler,\n\t(types, other) =>\n\t\t(other.kind === sequence.identifier || other.kind === optionalIdentifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n\tnew Set([]),\n);\n\nexport const valueFieldEditor: ValueFieldEditor = {\n\t...optionalFieldEditor,\n\tset: (ids: {\n\t\tfill: ChangeAtomId;\n\t\tdetach: ChangeAtomId;\n\t}): OptionalChangeset => optionalFieldEditor.set(false, ids),\n};\n\nexport const valueChangeHandler: FieldChangeHandler<OptionalChangeset, ValueFieldEditor> = {\n\t...optional.changeHandler,\n\teditor: valueFieldEditor,\n};\n\nconst requiredIdentifier = \"Value\";\n\n/**\n * Exactly one item.\n */\nexport const required = new FieldKindWithEditor(\n\trequiredIdentifier,\n\tMultiplicity.Single,\n\tvalueChangeHandler,\n\t(types, other) =>\n\t\t(other.kind === sequence.identifier ||\n\t\t\tother.kind === requiredIdentifier ||\n\t\t\tother.kind === optional.identifier ||\n\t\t\tother.kind === nodeKey.identifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n\tnew Set(),\n);\n\nconst sequenceIdentifier = \"Sequence\";\n\n/**\n * 0 or more items.\n */\nexport const sequence = new FieldKindWithEditor(\n\tsequenceIdentifier,\n\tMultiplicity.Sequence,\n\tsequenceFieldChangeHandler,\n\t(types, other) =>\n\t\tother.kind === sequenceIdentifier &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n\t// TODO: add normalizer/importers for handling ops from other kinds.\n\tnew Set([]),\n);\n\nconst nodeKeyIdentifier = \"NodeKey\";\n\n/**\n * Exactly one identifier.\n */\nexport const nodeKey = new FieldKindWithEditor(\n\tnodeKeyIdentifier,\n\tMultiplicity.Single,\n\tnoChangeHandler,\n\t(types, other) =>\n\t\t(other.kind === sequence.identifier ||\n\t\t\tother.kind === requiredIdentifier ||\n\t\t\tother.kind === optional.identifier ||\n\t\t\tother.kind === nodeKeyIdentifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n\tnew Set(),\n);\n\nconst identifierFieldIdentifier = \"Identifier\";\n\n/**\n * Exactly one identifier.\n */\nexport const identifier = new FieldKindWithEditor(\n\tidentifierFieldIdentifier,\n\tMultiplicity.Single,\n\tnoChangeHandler,\n\t(types, other) =>\n\t\t(other.kind === sequence.identifier ||\n\t\t\tother.kind === requiredIdentifier ||\n\t\t\tother.kind === optional.identifier ||\n\t\t\tother.kind === identifierFieldIdentifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n\tnew Set(),\n);\n\n/**\n * Exactly 0 items.\n *\n * Using Forbidden makes what types are listed for allowed in a field irrelevant\n * since the field will never have values in it.\n *\n * Using Forbidden is equivalent to picking a kind that permits empty (like sequence or optional)\n * and having no allowed types (or only never types).\n * Because of this, its possible to express everything constraint wise without Forbidden,\n * but using Forbidden can be more semantically clear than optional with no allowed types.\n *\n * For view schema, this can be useful if you need to:\n * - run a specific out of schema handler when a field is present,\n * but otherwise are ignoring or tolerating (ex: via extra fields) unmentioned fields.\n * - prevent a specific field from being used as an extra field\n * (perhaps for some past of future compatibility reason)\n * - keep a field in a schema for metadata purposes\n * (ex: for improved error messaging, error handling or documentation)\n * that is not used in this specific version of the schema (ex: to document what it was or will be used for).\n *\n * For stored schema, this can be useful if you need to:\n * - have a field which can have its schema updated to Optional or Sequence of any type.\n * - to exclude a field from extra fields\n * - for the schema system to use as a default for fields which aren't declared\n * (ex: when updating a field that did not exist into one that does)\n *\n * See {@link emptyField} for a constant, reusable field using Forbidden.\n */\nexport const forbidden = new FieldKindWithEditor(\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity.Forbidden,\n\tnoChangeHandler,\n\t// All multiplicities other than Value support empty.\n\t(types, other) => fieldKinds.get(other.kind)?.multiplicity !== Multiplicity.Single,\n\tnew Set(),\n);\n\nexport const fieldKindConfigurations: ReadonlyMap<number, FieldKindConfiguration> = new Map([\n\t[\n\t\t1,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[nodeKey.identifier, { kind: nodeKey, formatVersion: 1 }],\n\t\t\t[required.identifier, { kind: required, formatVersion: 1 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 1 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 1 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\t2,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[nodeKey.identifier, { kind: nodeKey, formatVersion: 1 }],\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 1 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\t3,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[nodeKey.identifier, { kind: nodeKey, formatVersion: 1 }],\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 2 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\t4,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[nodeKey.identifier, { kind: nodeKey, formatVersion: 1 }],\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 3 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n]);\n\n/**\n * All supported field kinds.\n *\n * @privateRemarks\n * Before making a SharedTree format change which impacts which set of field kinds are allowed,\n * code which uses this should be audited for compatibility considerations.\n */\nexport const fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindWithEditor> = new Map(\n\t[required, optional, sequence, nodeKey, identifier, forbidden].map((s) => [s.identifier, s]),\n);\n\n// Create named Aliases for nicer intellisense.\n\n// TODO: Find a way to make docs like {@inheritDoc required} work in vscode.\n// TODO: ensure thy work in generated docs.\n// TODO: add these comments to the rest of the cases below.\n/**\n */\nexport interface Required extends FlexFieldKind<\"Value\", Multiplicity.Single> {}\n/**\n */\nexport interface Optional extends FlexFieldKind<\"Optional\", Multiplicity.Optional> {}\n/**\n */\nexport interface Sequence extends FlexFieldKind<\"Sequence\", Multiplicity.Sequence> {}\n/**\n */\nexport interface Identifier extends FlexFieldKind<\"Identifier\", Multiplicity.Single> {}\n/**\n */\nexport interface Forbidden\n\textends FlexFieldKind<typeof forbiddenFieldKindIdentifier, Multiplicity.Forbidden> {}\n\n/**\n * Default FieldKinds with their editor types erased.\n */\nexport const FieldKinds: {\n\t// TODO: inheritDoc for these somehow\n\treadonly required: Required;\n\treadonly optional: Optional;\n\treadonly sequence: Sequence;\n\treadonly identifier: Identifier;\n\treadonly forbidden: Forbidden;\n} = { required, optional, sequence, identifier, forbidden };\n"]}
1
+ {"version":3,"file":"defaultFieldKinds.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultFieldKinds.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAE3D,kDAM6B;AAC7B,yDAWoC;AACpC,yDAIoC;AACpC,yDAAwE;AAExE,2DAA0D;AAE1D;;GAEG;AACU,QAAA,eAAe,GAA0B;IACrD,OAAO,EAAE,IAAA,0CAA+B,EAAC;QACxC,OAAO,EAAE,CAAC,OAAU,EAAE,OAAU,EAAE,EAAE,CAAC,CAAC;QACtC,MAAM,EAAE,CAAC,OAAU,EAAE,EAAE,CAAC,CAAC;QACzB,MAAM,EAAE,CAAC,MAAS,EAAE,IAAO,EAAE,EAAE,CAAC,CAAC;KACjC,CAAC;IACF,aAAa,EAAE,GAAG,EAAE,CAAC,uCAAmB;IACxC,MAAM,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,CAAC,IAAA,eAAI,EAAC,KAAK,CAAC,iCAAiC,CAAC,EAAE;IAClF,SAAS,EAAE,CAAC,MAAM,EAAE,c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AAE,UAAU,EAAV,kBAAU,EAAE,SAAS,EAAT,iBAAS,EAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype DeltaDetachedNodeId,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity,\n} from \"../../core/index.js\";\nimport {\n\ttype FieldChangeDelta,\n\ttype FieldChangeHandler,\n\ttype FieldEditor,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tFieldKindWithEditor,\n\ttype FlexFieldKind,\n\ttype ToDelta,\n\tallowsTreeSchemaIdentifierSuperset,\n\treferenceFreeFieldChangeRebaser,\n} from \"../modular-schema/index.js\";\nimport {\n\ttype OptionalChangeset,\n\toptionalChangeHandler,\n\toptionalFieldEditor,\n} from \"../optional-field/index.js\";\nimport { sequenceFieldChangeHandler } from \"../sequence-field/index.js\";\n\nimport { noChangeCodecFamily } from \"./noChangeCodecs.js\";\n\n/**\n * ChangeHandler that only handles no-op / identity changes.\n */\nexport const noChangeHandler: FieldChangeHandler<0> = {\n\trebaser: referenceFreeFieldChangeRebaser({\n\t\tcompose: (change1: 0, change2: 0) => 0,\n\t\tinvert: (changes: 0) => 0,\n\t\trebase: (change: 0, over: 0) => 0,\n\t}),\n\tcodecsFactory: () => noChangeCodecFamily,\n\teditor: { buildChildChanges: () => fail(0xb0d /* Child changes not supported */) },\n\tintoDelta: (change, deltaFromChild: ToDelta): FieldChangeDelta => ({}),\n\trelevantRemovedRoots: (change): Iterable<DeltaDetachedNodeId> => [],\n\tisEmpty: (change: 0) => true,\n\tgetNestedChanges: (change: 0) => [],\n\tcreateEmpty: () => 0,\n\tgetCrossFieldKeys: () => [],\n};\n\nexport interface ValueFieldEditor extends FieldEditor<OptionalChangeset> {\n\t/**\n\t * Creates a change which replaces the current value of the field with `newValue`.\n\t * @param ids - The ids for the fill and detach fields.\n\t */\n\tset(ids: { fill: ChangeAtomId; detach: ChangeAtomId }): OptionalChangeset;\n}\n\nconst optionalIdentifier = \"Optional\";\n/**\n * 0 or 1 items.\n */\nexport const optional = new FieldKindWithEditor(\n\toptionalIdentifier,\n\tMultiplicity.Optional,\n\toptionalChangeHandler,\n\t(types, other) =>\n\t\t(other.kind === sequence.identifier || other.kind === optionalIdentifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n\tnew Set([]),\n);\n\nexport const valueFieldEditor: ValueFieldEditor = {\n\t...optionalFieldEditor,\n\tset: (ids: {\n\t\tfill: ChangeAtomId;\n\t\tdetach: ChangeAtomId;\n\t}): OptionalChangeset => optionalFieldEditor.set(false, ids),\n};\n\nexport const valueChangeHandler: FieldChangeHandler<OptionalChangeset, ValueFieldEditor> = {\n\t...optional.changeHandler,\n\teditor: valueFieldEditor,\n};\n\nconst requiredIdentifier = \"Value\";\n\n/**\n * Exactly one item.\n */\nexport const required = new FieldKindWithEditor(\n\trequiredIdentifier,\n\tMultiplicity.Single,\n\tvalueChangeHandler,\n\t(types, other) =>\n\t\t(other.kind === sequence.identifier ||\n\t\t\tother.kind === requiredIdentifier ||\n\t\t\tother.kind === optional.identifier ||\n\t\t\tother.kind === nodeKey.identifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n\tnew Set(),\n);\n\nconst sequenceIdentifier = \"Sequence\";\n\n/**\n * 0 or more items.\n */\nexport const sequence = new FieldKindWithEditor(\n\tsequenceIdentifier,\n\tMultiplicity.Sequence,\n\tsequenceFieldChangeHandler,\n\t(types, other) =>\n\t\tother.kind === sequenceIdentifier &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n\t// TODO: add normalizer/importers for handling ops from other kinds.\n\tnew Set([]),\n);\n\nconst nodeKeyIdentifier = \"NodeKey\";\n\n/**\n * Exactly one identifier.\n */\nexport const nodeKey = new FieldKindWithEditor(\n\tnodeKeyIdentifier,\n\tMultiplicity.Single,\n\tnoChangeHandler,\n\t(types, other) =>\n\t\t(other.kind === sequence.identifier ||\n\t\t\tother.kind === requiredIdentifier ||\n\t\t\tother.kind === optional.identifier ||\n\t\t\tother.kind === nodeKeyIdentifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n\tnew Set(),\n);\n\nconst identifierFieldIdentifier = \"Identifier\";\n\n/**\n * Exactly one identifier.\n */\nexport const identifier = new FieldKindWithEditor(\n\tidentifierFieldIdentifier,\n\tMultiplicity.Single,\n\tnoChangeHandler,\n\t(types, other) =>\n\t\t(other.kind === sequence.identifier ||\n\t\t\tother.kind === requiredIdentifier ||\n\t\t\tother.kind === optional.identifier ||\n\t\t\tother.kind === identifierFieldIdentifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n\tnew Set(),\n);\n\n/**\n * Exactly 0 items.\n *\n * Using Forbidden makes what types are listed for allowed in a field irrelevant\n * since the field will never have values in it.\n *\n * Using Forbidden is equivalent to picking a kind that permits empty (like sequence or optional)\n * and having no allowed types (or only never types).\n * Because of this, its possible to express everything constraint wise without Forbidden,\n * but using Forbidden can be more semantically clear than optional with no allowed types.\n *\n * For view schema, this can be useful if you need to:\n * - run a specific out of schema handler when a field is present,\n * but otherwise are ignoring or tolerating (ex: via extra fields) unmentioned fields.\n * - prevent a specific field from being used as an extra field\n * (perhaps for some past of future compatibility reason)\n * - keep a field in a schema for metadata purposes\n * (ex: for improved error messaging, error handling or documentation)\n * that is not used in this specific version of the schema (ex: to document what it was or will be used for).\n *\n * For stored schema, this can be useful if you need to:\n * - have a field which can have its schema updated to Optional or Sequence of any type.\n * - to exclude a field from extra fields\n * - for the schema system to use as a default for fields which aren't declared\n * (ex: when updating a field that did not exist into one that does)\n *\n * See {@link emptyField} for a constant, reusable field using Forbidden.\n */\nexport const forbidden = new FieldKindWithEditor(\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity.Forbidden,\n\tnoChangeHandler,\n\t// All multiplicities other than Value support empty.\n\t(types, other) => fieldKinds.get(other.kind)?.multiplicity !== Multiplicity.Single,\n\tnew Set(),\n);\n\nexport const fieldKindConfigurations: ReadonlyMap<number, FieldKindConfiguration> = new Map([\n\t[\n\t\t1,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[nodeKey.identifier, { kind: nodeKey, formatVersion: 1 }],\n\t\t\t[required.identifier, { kind: required, formatVersion: 1 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 1 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 1 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\t2,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[nodeKey.identifier, { kind: nodeKey, formatVersion: 1 }],\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 1 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\t3,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[nodeKey.identifier, { kind: nodeKey, formatVersion: 1 }],\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 2 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\t4,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[nodeKey.identifier, { kind: nodeKey, formatVersion: 1 }],\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 3 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n]);\n\n/**\n * All supported field kinds.\n *\n * @privateRemarks\n * Before making a SharedTree format change which impacts which set of field kinds are allowed,\n * code which uses this should be audited for compatibility considerations.\n */\nexport const fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindWithEditor> = new Map(\n\t[required, optional, sequence, nodeKey, identifier, forbidden].map((s) => [s.identifier, s]),\n);\n\n// Create named Aliases for nicer intellisense.\n\n// TODO: Find a way to make docs like {@inheritDoc required} work in vscode.\n// TODO: ensure thy work in generated docs.\n// TODO: add these comments to the rest of the cases below.\nexport interface Required extends FlexFieldKind<\"Value\", Multiplicity.Single> {}\nexport interface Optional extends FlexFieldKind<\"Optional\", Multiplicity.Optional> {}\nexport interface Sequence extends FlexFieldKind<\"Sequence\", Multiplicity.Sequence> {}\nexport interface Identifier extends FlexFieldKind<\"Identifier\", Multiplicity.Single> {}\nexport interface Forbidden\n\textends FlexFieldKind<typeof forbiddenFieldKindIdentifier, Multiplicity.Forbidden> {}\n\n/**\n * Default FieldKinds with their editor types erased.\n */\nexport const FieldKinds: {\n\t// TODO: inheritDoc for these somehow\n\treadonly required: Required;\n\treadonly optional: Optional;\n\treadonly sequence: Sequence;\n\treadonly identifier: Identifier;\n\treadonly forbidden: Forbidden;\n} = { required, optional, sequence, identifier, forbidden };\n"]}
@@ -17,8 +17,6 @@ export declare const flexTreeSlot: import("../../core/index.js").AnchorSlot<Hydr
17
17
  */
18
18
  export declare const flexTreeMarker: unique symbol;
19
19
  export declare function isFlexTreeNode(t: unknown): t is FlexTreeNode;
20
- /**
21
- */
22
20
  export declare enum FlexTreeEntityKind {
23
21
  Node = 0,
24
22
  Field = 1
@@ -1 +1 @@
1
- {"version":3,"file":"flexTreeTypes.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/flexTreeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EAEd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACX,UAAU,EACV,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACX,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE7E;;;GAGG;AACH,eAAO,MAAM,YAAY,gEAAqC,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,cAAc,eAA2B,CAAC;AAMvD,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,YAAY,CAE5D;AAED;GACG;AACH,oBAAY,kBAAkB;IAC7B,IAAI,IAAA;IACJ,KAAK,IAAA;CACL;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,cAAc;IAC9B;;;OAGG;IACH,QAAQ,CAAC,CAAC,cAAc,CAAC,EAAE,kBAAkB,CAAC;IAE9C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAElC;;;;;OAKG;IACH,YAAY,IAAI,sBAAsB,CAAC;CACvC;AAED;;;GAGG;AACH,oBAAY,UAAU;IACrB;;OAEG;IACH,UAAU,IAAI;IAEd;;OAEG;IACH,OAAO,IAAI;IAEX;;;;;;;;;;;;;;OAcG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ASG;IACH,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,sBAAsB,GAAG,SAAS,CAAC;IAEtD;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;IAEjD;;;OAGG;IACH,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;IAE7E;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,wBAAwB,CAAC,oBAAoB,CAAC,CAAC;CAChE;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC3D,IAAI,OAAO,IAAI,sBAAsB,CAAC;IAEtC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;CAC5D;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC3D,IAAI,OAAO,IAAI,sBAAsB,GAAG,SAAS,CAAC;IAElD,QAAQ,CAAC,MAAM,EAAE,wBAAwB,CAAC,mBAAmB,CAAC,CAAC;CAC/D;AAMD;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,IAAI,SAAS,aAAa,IACxD,IAAI,SAAS,OAAO,UAAU,CAAC,QAAQ,GACpC,qBAAqB,GACrB,IAAI,SAAS,OAAO,UAAU,CAAC,QAAQ,GACtC,qBAAqB,GACrB,IAAI,SAAS,OAAO,UAAU,CAAC,QAAQ,GACtC,qBAAqB,GACrB,aAAa,CAAC;AAIpB;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,YAAY,CAAC"}
@@ -22,8 +22,6 @@ function isFlexTreeNode(t) {
22
22
  return isFlexTreeEntity(t) && t[exports.flexTreeMarker] === FlexTreeEntityKind.Node;
23
23
  }
24
24
  exports.isFlexTreeNode = isFlexTreeNode;
25
- /**
26
- */
27
25
  var FlexTreeEntityKind;
28
26
  (function (FlexTreeEntityKind) {
29
27
  FlexTreeEntityKind[FlexTreeEntityKind["Node"] = 0] = "Node";
@@ -1 +1 @@
1
- {"version":3,"file":"flexTreeTypes.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/flexTreeTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAQ6B;AAiB7B;;;GAGG;AACU,QAAA,YAAY,GAAG,IAAA,qBAAU,GAAwB,CAAC;AAE/D;;GAEG;AACU,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAEvD,SAAS,gBAAgB,CAAC,CAAU;IACnC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,sBAAc,IAAI,CAAC,CAAC;AACnE,CAAC;AAED,SAAgB,cAAc,CAAC,CAAU;IACxC,OAAO,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,sBAAc,CAAC,KAAK,kBAAkB,CAAC,IAAI,CAAC;AAC7E,CAAC;AAFD,wCAEC;AAED;GACG;AACH,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC7B,2DAAI,CAAA;IACJ,6DAAK,CAAA;AACN,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAqCD;;;GAGG;AACH,IAAY,UA+CX;AA/CD,WAAY,UAAU;IACrB;;OAEG;IACH,uDAAc,CAAA;IAEd;;OAEG;IACH,iDAAW,CAAA;IAEX;;;;;;;;;;;;;;OAcG;IACH,iDAAW,CAAA;IAEX;;;;;;;;;;;;;;;;;OAiBG;IACH,yCAAO,CAAA;AACR,CAAC,EA/CW,UAAU,0BAAV,UAAU,QA+CrB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype AnchorNode,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype NormalizedFieldUpPath,\n\ttype TreeValue,\n\tanchorSlot,\n} from \"../../core/index.js\";\nimport type {\n\tFieldKinds,\n\tSequenceFieldEditBuilder,\n\tValueFieldEditBuilder,\n\tOptionalFieldEditBuilder,\n} from \"../default-schema/index.js\";\nimport type {\n\tMapTreeFieldViewGeneric,\n\tMapTreeNodeViewGeneric,\n\tMinimalFieldMap,\n\tMinimalMapTreeNodeView,\n} from \"../mapTreeCursor.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\n\nimport type { FlexTreeContext, FlexTreeHydratedContext } from \"./context.js\";\n\n/**\n * An anchor slot which records the {@link FlexTreeNode} associated with that anchor, if there is one.\n * @remarks This always points to a \"real\" {@link FlexTreeNode} (i.e. a `LazyTreeNode`), never to a \"raw\" node.\n */\nexport const flexTreeSlot = anchorSlot<HydratedFlexTreeNode>();\n\n/**\n * Indicates that an object is a flex tree.\n */\nexport const flexTreeMarker = Symbol(\"flexTreeMarker\");\n\nfunction isFlexTreeEntity(t: unknown): t is FlexTreeEntity {\n\treturn typeof t === \"object\" && t !== null && flexTreeMarker in t;\n}\n\nexport function isFlexTreeNode(t: unknown): t is FlexTreeNode {\n\treturn isFlexTreeEntity(t) && t[flexTreeMarker] === FlexTreeEntityKind.Node;\n}\n\n/**\n */\nexport enum FlexTreeEntityKind {\n\tNode,\n\tField,\n}\n\n/**\n * Part of a tree.\n * Iterates over children.\n *\n * @privateRemarks\n * This exists mainly as a place to share common members between nodes and fields.\n * It is not expected to be useful or common to write code which handles this type directly.\n * If this assumption turns out to be false, and generically processing `UntypedEntity`s is useful,\n * then this interface should probably be extended with some down casting functionality (like `is`).\n *\n * TODO:\n * Design and document iterator invalidation rules and ordering rules.\n * Providing a custom iterator type with place anchor semantics would be a good approach.\n */\nexport interface FlexTreeEntity {\n\t/**\n\t * Indicates that an object is a specific kind of flex tree FlexTreeEntity.\n\t * This makes it possible to both down cast FlexTreeEntities safely as well as validate if an object is or is not a FlexTreeEntity.\n\t */\n\treadonly [flexTreeMarker]: FlexTreeEntityKind;\n\n\t/**\n\t * A common context of FlexTrees.\n\t */\n\treadonly context: FlexTreeContext;\n\n\t/**\n\t * Get a cursor for the underlying data.\n\t * @remarks\n\t * This cursor might be one the node uses in its implementation, and thus must be returned to its original location before using any other APIs to interact with the tree.\n\t * Must not be held onto across edits or any other tree API use.\n\t */\n\tborrowCursor(): ITreeCursorSynchronous;\n}\n\n/**\n * Status of the tree that a particular node belongs to.\n * @public\n */\nexport enum TreeStatus {\n\t/**\n\t * Is parented under the root field.\n\t */\n\tInDocument = 0,\n\n\t/**\n\t * Is not parented under the root field, but can be added back to the original document tree.\n\t */\n\tRemoved = 1,\n\n\t/**\n\t * Is removed and cannot be added back to the original document tree.\n\t * @remarks\n\t * Nodes can enter this state for multiple reasons:\n\t * - The node was removed and nothing (e.g. undo/redo history) kept it from being cleaned up.\n\t * - The {@link TreeView} was disposed or had a schema change which made the tree incompatible.\n\t *\n\t * Deleted nodes' contents should not be observed or edited. This includes functionality exposed via {@link (Tree:variable)},\n\t * with the exception of {@link TreeNodeApi.status}.\n\t *\n\t * @privateRemarks\n\t * There was planned work (AB#17948) to make the first reason a node could become \"Deleted\" impossible,\n\t * at least as an opt in feature,\n\t * by lifetime extending all nodes which are still possible to reach automatically.\n\t */\n\tDeleted = 2,\n\n\t/**\n\t * Is created but has not yet been inserted into the tree.\n\t * @remarks\n\t * See also {@link Unhydrated}.\n\t *\n\t * Nodes in the new state have some limitations:\n\t *\n\t * - Events are not currently triggered for changes. Fixes for this are planned.\n\t *\n\t * - Reading identifiers from nodes which were left unspecified (defaulted) when creating the tree will error.\n\t * This is because allocating unique identifiers in a compressible manner requires knowing which tree the nodes will be inserted into.\n\t *\n\t * - Transactions do not work: transactions apply to a single {@link TreeView}, and `New` nodes are not part of one.\n\t *\n\t * - Automatically generated {@link SchemaFactory.identifier | identifiers} will be less compressible if read.\n\t *\n\t * - {@link TreeIdentifierUtils.getShort} and {@link TreeNodeApi.shortId | Tree.shortId} cannot return their short identifiers.\n\t */\n\tNew = 3,\n}\n\n/**\n * Generic tree node API.\n *\n * Nodes are (shallowly) immutable and have a logical identity, a type and either a value or fields under string keys.\n *\n * This \"logical identity\" is exposed as the object identity: if a node is moved within a document,\n * the same {@link FlexTreeNode} instance will be used in the new location.\n * Similarly, edits applied to a node's sub-tree concurrently with the move of the node will still be applied to its subtree in its new location.\n *\n * @remarks\n * All editing is actually done via {@link FlexTreeField}s: the nodes are immutable other than that they contain mutable fields.\n */\nexport interface FlexTreeNode extends FlexTreeEntity, MapTreeNodeViewGeneric<FlexTreeNode> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Node;\n\n\t/**\n\t * Gets a field of this node, if it is not empty.\n\t */\n\ttryGetField(key: FieldKey): undefined | FlexTreeField;\n\n\t/**\n\t * Get the field for `key`.\n\t * @param key - which entry to look up.\n\t *\n\t * @remarks\n\t * All fields implicitly exist, so `getBoxed` can be called with any key and will always return a field.\n\t * Even if the field is empty, it will still be returned, and can be edited to insert content if allowed by the field kind.\n\t * See {@link FlexTreeNode.tryGetField} for a variant that does not allocate a field in the empty case.\n\t */\n\tgetBoxed(key: FieldKey): FlexTreeField;\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t * @remarks\n\t * The behavior of this at the root (especially removed and unhydrated roots) is currently not very consistent.\n\t * Since very little relies on this, limit what it exposes to reduce the potential impact of inconsistent root handling.\n\t */\n\treadonly parentField: {\n\t\treadonly parent: Pick<FlexTreeField, \"parent\" | \"schema\" | \"key\">;\n\t\treadonly index: number;\n\t};\n\n\t/**\n\t * The non-empty fields on this node.\n\t */\n\treadonly fields: MinimalFieldMap<FlexTreeField>;\n\n\t/**\n\t * The non-empty fields on this node.\n\t */\n\t[Symbol.iterator](): IterableIterator<FlexTreeField>;\n\n\t/**\n\t * Returns an iterable of keys for non-empty fields.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `keys` will yield only the keys of fields which contain one or more nodes.\n\t *\n\t * No guarantees are made regarding the order of the keys returned.\n\t */\n\tkeys(): IterableIterator<FieldKey>;\n\n\t/**\n\t * If true, this node is a {@link HydratedFlexTreeNode}.\n\t *\n\t * If false, this node is unhydrated.\n\t */\n\tisHydrated(): this is HydratedFlexTreeNode;\n}\n\n/**\n * A FlexTreeNode that is hydrated, meaning it is associated with a {@link FlexTreeHydratedContext}.\n */\nexport interface HydratedFlexTreeNode extends FlexTreeNode {\n\t/**\n\t * {@inheritDoc FlexTreeNode.context}\n\t */\n\treadonly context: FlexTreeHydratedContext;\n\n\t/**\n\t * The anchor node associated with this node\n\t *\n\t * @remarks\n\t * The ref count keeping this alive is owned by the FlexTreeNode:\n\t * if holding onto this anchor for longer than the FlexTreeNode might be alive,\n\t * a separate Anchor (and thus ref count) must be allocated to keep it alive.\n\t */\n\treadonly anchorNode: AnchorNode;\n}\n\n/**\n * A collaboratively editable collection of nodes within a {@link FlexTreeEntity}.\n *\n * Fields are inherently part of their parent, and thus cannot be moved.\n * Instead their content can be moved, deleted or created.\n *\n * Editing operations are only valid on trees with the {@link TreeStatus#InDocument} `TreeStatus`.\n *\n * @remarks\n * Fields are used wherever an editable collection of nodes is required.\n * This is required in two places:\n * 1. To hold the children of non-leaf {@link FlexTreeNode}s.\n * 2. As the root of a {@link FlexTreeEntity}.\n *\n * Down-casting (via {@link FlexTreeField.is}) is required to access Schema-Aware APIs, including editing.\n * All content in the tree is accessible without down-casting, but if the schema is known,\n * the schema aware API may be more ergonomic.\n */\nexport interface FlexTreeField extends FlexTreeEntity, MapTreeFieldViewGeneric<FlexTreeNode> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Field;\n\n\t/**\n\t * The number of nodes in this field\n\t */\n\treadonly length: number;\n\n\t/**\n\t * The `FieldKey` this field is under.\n\t * Defines what part of its parent this field makes up.\n\t */\n\treadonly key: FieldKey;\n\n\t/**\n\t * The node which has this field on it under `fieldKey`.\n\t * `undefined` iff this field is a detached field.\n\t */\n\treadonly parent?: FlexTreeNode;\n\n\t/**\n\t * Type guard for narrowing / down-casting to a specific schema.\n\t */\n\tis<TKind extends FlexFieldKind>(kind: TKind): this is FlexTreeTypedField<TKind>;\n\n\t/**\n\t * Gets a node of this field by its index without unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= sequence.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tboxedAt(index: number): FlexTreeNode | undefined;\n\n\t/**\n\t * Gets the FieldUpPath of a field.\n\t */\n\tgetFieldPath(): NormalizedFieldUpPath;\n\n\t/**\n\t * Schema for this entity.\n\t * If well-formed, it must follow this schema.\n\t */\n\treadonly schema: FieldKindIdentifier;\n}\n\n// #region Field Kinds\n\n/**\n * Typed tree for inserting as the content of a field.\n */\nexport type FlexibleFieldContent = readonly FlexibleNodeContent[];\n\n/**\n * Tree for inserting as a node.\n */\nexport type FlexibleNodeContent = MinimalMapTreeNodeView;\n\n/**\n * {@link FlexTreeField} that stores a sequence of children.\n *\n * Sequence fields can contain an ordered sequence any number of {@link FlexTreeNode}s which must be of the {@link FlexAllowedTypes} from the {@link FlexFieldSchema}).\n *\n * @remarks\n * Allows for concurrent editing based on index, adjusting the locations of indexes as needed so they apply to the same logical place in the sequence when rebased and merged.\n *\n * Edits to sequence fields are anchored relative to their surroundings, so concurrent edits can result in the indexes of nodes and edits getting shifted.\n * To hold onto locations in sequence across an edit, use anchors.\n *\n * @privateRemarks\n * TODO:\n * Add anchor API that can actually hold onto locations in a sequence.\n * Currently only nodes can be held onto with anchors, and this does not replicate the behavior implemented for editing.\n */\nexport interface FlexTreeSequenceField extends FlexTreeField {\n\t/**\n\t * Gets a node of this field by its index with unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= array.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tat(index: number): FlexTreeUnknownUnboxed | undefined;\n\n\t/**\n\t * {@inheritdoc FlexTreeField.boxedAt}\n\t */\n\tboxedAt(index: number): FlexTreeNode | undefined;\n\n\t/**\n\t * Calls the provided callback function on each child of this sequence, and returns an array that contains the results.\n\t * @param callbackfn - A function that accepts the child and its index.\n\t */\n\tmap<U>(callbackfn: (value: FlexTreeUnknownUnboxed, index: number) => U): U[];\n\n\t/**\n\t * Get an editor for this sequence.\n\t */\n\treadonly editor: SequenceFieldEditBuilder<FlexibleFieldContent>;\n}\n\n/**\n * Field that stores exactly one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the RequiredField itself will be skipped over and its content will be returned directly.\n */\nexport interface FlexTreeRequiredField extends FlexTreeField {\n\tget content(): FlexTreeUnknownUnboxed;\n\n\treadonly editor: ValueFieldEditBuilder<FlexibleNodeContent>;\n}\n\n/**\n * Field that stores zero or one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the OptionalField itself will be skipped over and its content will be returned directly.\n *\n * @privateRemarks\n * TODO: Document merge semitics\n * TODO: Allow Optional fields to be used with last write wins OR first write wins merge resolution.\n * TODO:\n * Better centralize the documentation about what kinds of merge semantics are available for field kinds.\n * Maybe link editor?\n */\nexport interface FlexTreeOptionalField extends FlexTreeField {\n\tget content(): FlexTreeUnknownUnboxed | undefined;\n\n\treadonly editor: OptionalFieldEditBuilder<FlexibleNodeContent>;\n}\n\n// #endregion\n\n// #region Typed\n\n/**\n * Schema aware specialization of {@link FlexTreeField}.\n */\nexport type FlexTreeTypedField<Kind extends FlexFieldKind> =\n\tKind extends typeof FieldKinds.sequence\n\t\t? FlexTreeSequenceField\n\t\t: Kind extends typeof FieldKinds.required\n\t\t\t? FlexTreeRequiredField\n\t\t\t: Kind extends typeof FieldKinds.optional\n\t\t\t\t? FlexTreeOptionalField\n\t\t\t\t: FlexTreeField;\n\n// #endregion\n\n/**\n * Unboxed tree type for unknown schema cases.\n */\nexport type FlexTreeUnknownUnboxed = TreeValue | FlexTreeNode;\n"]}
1
+ {"version":3,"file":"flexTreeTypes.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/flexTreeTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAQ6B;AAiB7B;;;GAGG;AACU,QAAA,YAAY,GAAG,IAAA,qBAAU,GAAwB,CAAC;AAE/D;;GAEG;AACU,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAEvD,SAAS,gBAAgB,CAAC,CAAU;IACnC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,sBAAc,IAAI,CAAC,CAAC;AACnE,CAAC;AAED,SAAgB,cAAc,CAAC,CAAU;IACxC,OAAO,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,sBAAc,CAAC,KAAK,kBAAkB,CAAC,IAAI,CAAC;AAC7E,CAAC;AAFD,wCAEC;AAED,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC7B,2DAAI,CAAA;IACJ,6DAAK,CAAA;AACN,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAqCD;;;GAGG;AACH,IAAY,UA+CX;AA/CD,WAAY,UAAU;IACrB;;OAEG;IACH,uDAAc,CAAA;IAEd;;OAEG;IACH,iDAAW,CAAA;IAEX;;;;;;;;;;;;;;OAcG;IACH,iDAAW,CAAA;IAEX;;;;;;;;;;;;;;;;;OAiBG;IACH,yCAAO,CAAA;AACR,CAAC,EA/CW,UAAU,0BAAV,UAAU,QA+CrB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype AnchorNode,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype NormalizedFieldUpPath,\n\ttype TreeValue,\n\tanchorSlot,\n} from \"../../core/index.js\";\nimport type {\n\tFieldKinds,\n\tSequenceFieldEditBuilder,\n\tValueFieldEditBuilder,\n\tOptionalFieldEditBuilder,\n} from \"../default-schema/index.js\";\nimport type {\n\tMapTreeFieldViewGeneric,\n\tMapTreeNodeViewGeneric,\n\tMinimalFieldMap,\n\tMinimalMapTreeNodeView,\n} from \"../mapTreeCursor.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\n\nimport type { FlexTreeContext, FlexTreeHydratedContext } from \"./context.js\";\n\n/**\n * An anchor slot which records the {@link FlexTreeNode} associated with that anchor, if there is one.\n * @remarks This always points to a \"real\" {@link FlexTreeNode} (i.e. a `LazyTreeNode`), never to a \"raw\" node.\n */\nexport const flexTreeSlot = anchorSlot<HydratedFlexTreeNode>();\n\n/**\n * Indicates that an object is a flex tree.\n */\nexport const flexTreeMarker = Symbol(\"flexTreeMarker\");\n\nfunction isFlexTreeEntity(t: unknown): t is FlexTreeEntity {\n\treturn typeof t === \"object\" && t !== null && flexTreeMarker in t;\n}\n\nexport function isFlexTreeNode(t: unknown): t is FlexTreeNode {\n\treturn isFlexTreeEntity(t) && t[flexTreeMarker] === FlexTreeEntityKind.Node;\n}\n\nexport enum FlexTreeEntityKind {\n\tNode,\n\tField,\n}\n\n/**\n * Part of a tree.\n * Iterates over children.\n *\n * @privateRemarks\n * This exists mainly as a place to share common members between nodes and fields.\n * It is not expected to be useful or common to write code which handles this type directly.\n * If this assumption turns out to be false, and generically processing `UntypedEntity`s is useful,\n * then this interface should probably be extended with some down casting functionality (like `is`).\n *\n * TODO:\n * Design and document iterator invalidation rules and ordering rules.\n * Providing a custom iterator type with place anchor semantics would be a good approach.\n */\nexport interface FlexTreeEntity {\n\t/**\n\t * Indicates that an object is a specific kind of flex tree FlexTreeEntity.\n\t * This makes it possible to both down cast FlexTreeEntities safely as well as validate if an object is or is not a FlexTreeEntity.\n\t */\n\treadonly [flexTreeMarker]: FlexTreeEntityKind;\n\n\t/**\n\t * A common context of FlexTrees.\n\t */\n\treadonly context: FlexTreeContext;\n\n\t/**\n\t * Get a cursor for the underlying data.\n\t * @remarks\n\t * This cursor might be one the node uses in its implementation, and thus must be returned to its original location before using any other APIs to interact with the tree.\n\t * Must not be held onto across edits or any other tree API use.\n\t */\n\tborrowCursor(): ITreeCursorSynchronous;\n}\n\n/**\n * Status of the tree that a particular node belongs to.\n * @public\n */\nexport enum TreeStatus {\n\t/**\n\t * Is parented under the root field.\n\t */\n\tInDocument = 0,\n\n\t/**\n\t * Is not parented under the root field, but can be added back to the original document tree.\n\t */\n\tRemoved = 1,\n\n\t/**\n\t * Is removed and cannot be added back to the original document tree.\n\t * @remarks\n\t * Nodes can enter this state for multiple reasons:\n\t * - The node was removed and nothing (e.g. undo/redo history) kept it from being cleaned up.\n\t * - The {@link TreeView} was disposed or had a schema change which made the tree incompatible.\n\t *\n\t * Deleted nodes' contents should not be observed or edited. This includes functionality exposed via {@link (Tree:variable)},\n\t * with the exception of {@link TreeNodeApi.status}.\n\t *\n\t * @privateRemarks\n\t * There was planned work (AB#17948) to make the first reason a node could become \"Deleted\" impossible,\n\t * at least as an opt in feature,\n\t * by lifetime extending all nodes which are still possible to reach automatically.\n\t */\n\tDeleted = 2,\n\n\t/**\n\t * Is created but has not yet been inserted into the tree.\n\t * @remarks\n\t * See also {@link Unhydrated}.\n\t *\n\t * Nodes in the new state have some limitations:\n\t *\n\t * - Events are not currently triggered for changes. Fixes for this are planned.\n\t *\n\t * - Reading identifiers from nodes which were left unspecified (defaulted) when creating the tree will error.\n\t * This is because allocating unique identifiers in a compressible manner requires knowing which tree the nodes will be inserted into.\n\t *\n\t * - Transactions do not work: transactions apply to a single {@link TreeView}, and `New` nodes are not part of one.\n\t *\n\t * - Automatically generated {@link SchemaFactory.identifier | identifiers} will be less compressible if read.\n\t *\n\t * - {@link TreeIdentifierUtils.getShort} and {@link TreeNodeApi.shortId | Tree.shortId} cannot return their short identifiers.\n\t */\n\tNew = 3,\n}\n\n/**\n * Generic tree node API.\n *\n * Nodes are (shallowly) immutable and have a logical identity, a type and either a value or fields under string keys.\n *\n * This \"logical identity\" is exposed as the object identity: if a node is moved within a document,\n * the same {@link FlexTreeNode} instance will be used in the new location.\n * Similarly, edits applied to a node's sub-tree concurrently with the move of the node will still be applied to its subtree in its new location.\n *\n * @remarks\n * All editing is actually done via {@link FlexTreeField}s: the nodes are immutable other than that they contain mutable fields.\n */\nexport interface FlexTreeNode extends FlexTreeEntity, MapTreeNodeViewGeneric<FlexTreeNode> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Node;\n\n\t/**\n\t * Gets a field of this node, if it is not empty.\n\t */\n\ttryGetField(key: FieldKey): undefined | FlexTreeField;\n\n\t/**\n\t * Get the field for `key`.\n\t * @param key - which entry to look up.\n\t *\n\t * @remarks\n\t * All fields implicitly exist, so `getBoxed` can be called with any key and will always return a field.\n\t * Even if the field is empty, it will still be returned, and can be edited to insert content if allowed by the field kind.\n\t * See {@link FlexTreeNode.tryGetField} for a variant that does not allocate a field in the empty case.\n\t */\n\tgetBoxed(key: FieldKey): FlexTreeField;\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t * @remarks\n\t * The behavior of this at the root (especially removed and unhydrated roots) is currently not very consistent.\n\t * Since very little relies on this, limit what it exposes to reduce the potential impact of inconsistent root handling.\n\t */\n\treadonly parentField: {\n\t\treadonly parent: Pick<FlexTreeField, \"parent\" | \"schema\" | \"key\">;\n\t\treadonly index: number;\n\t};\n\n\t/**\n\t * The non-empty fields on this node.\n\t */\n\treadonly fields: MinimalFieldMap<FlexTreeField>;\n\n\t/**\n\t * The non-empty fields on this node.\n\t */\n\t[Symbol.iterator](): IterableIterator<FlexTreeField>;\n\n\t/**\n\t * Returns an iterable of keys for non-empty fields.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `keys` will yield only the keys of fields which contain one or more nodes.\n\t *\n\t * No guarantees are made regarding the order of the keys returned.\n\t */\n\tkeys(): IterableIterator<FieldKey>;\n\n\t/**\n\t * If true, this node is a {@link HydratedFlexTreeNode}.\n\t *\n\t * If false, this node is unhydrated.\n\t */\n\tisHydrated(): this is HydratedFlexTreeNode;\n}\n\n/**\n * A FlexTreeNode that is hydrated, meaning it is associated with a {@link FlexTreeHydratedContext}.\n */\nexport interface HydratedFlexTreeNode extends FlexTreeNode {\n\t/**\n\t * {@inheritDoc FlexTreeNode.context}\n\t */\n\treadonly context: FlexTreeHydratedContext;\n\n\t/**\n\t * The anchor node associated with this node\n\t *\n\t * @remarks\n\t * The ref count keeping this alive is owned by the FlexTreeNode:\n\t * if holding onto this anchor for longer than the FlexTreeNode might be alive,\n\t * a separate Anchor (and thus ref count) must be allocated to keep it alive.\n\t */\n\treadonly anchorNode: AnchorNode;\n}\n\n/**\n * A collaboratively editable collection of nodes within a {@link FlexTreeEntity}.\n *\n * Fields are inherently part of their parent, and thus cannot be moved.\n * Instead their content can be moved, deleted or created.\n *\n * Editing operations are only valid on trees with the {@link TreeStatus#InDocument} `TreeStatus`.\n *\n * @remarks\n * Fields are used wherever an editable collection of nodes is required.\n * This is required in two places:\n * 1. To hold the children of non-leaf {@link FlexTreeNode}s.\n * 2. As the root of a {@link FlexTreeEntity}.\n *\n * Down-casting (via {@link FlexTreeField.is}) is required to access Schema-Aware APIs, including editing.\n * All content in the tree is accessible without down-casting, but if the schema is known,\n * the schema aware API may be more ergonomic.\n */\nexport interface FlexTreeField extends FlexTreeEntity, MapTreeFieldViewGeneric<FlexTreeNode> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Field;\n\n\t/**\n\t * The number of nodes in this field\n\t */\n\treadonly length: number;\n\n\t/**\n\t * The `FieldKey` this field is under.\n\t * Defines what part of its parent this field makes up.\n\t */\n\treadonly key: FieldKey;\n\n\t/**\n\t * The node which has this field on it under `fieldKey`.\n\t * `undefined` iff this field is a detached field.\n\t */\n\treadonly parent?: FlexTreeNode;\n\n\t/**\n\t * Type guard for narrowing / down-casting to a specific schema.\n\t */\n\tis<TKind extends FlexFieldKind>(kind: TKind): this is FlexTreeTypedField<TKind>;\n\n\t/**\n\t * Gets a node of this field by its index without unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= sequence.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tboxedAt(index: number): FlexTreeNode | undefined;\n\n\t/**\n\t * Gets the FieldUpPath of a field.\n\t */\n\tgetFieldPath(): NormalizedFieldUpPath;\n\n\t/**\n\t * Schema for this entity.\n\t * If well-formed, it must follow this schema.\n\t */\n\treadonly schema: FieldKindIdentifier;\n}\n\n// #region Field Kinds\n\n/**\n * Typed tree for inserting as the content of a field.\n */\nexport type FlexibleFieldContent = readonly FlexibleNodeContent[];\n\n/**\n * Tree for inserting as a node.\n */\nexport type FlexibleNodeContent = MinimalMapTreeNodeView;\n\n/**\n * {@link FlexTreeField} that stores a sequence of children.\n *\n * Sequence fields can contain an ordered sequence any number of {@link FlexTreeNode}s which must be of the {@link FlexAllowedTypes} from the {@link FlexFieldSchema}).\n *\n * @remarks\n * Allows for concurrent editing based on index, adjusting the locations of indexes as needed so they apply to the same logical place in the sequence when rebased and merged.\n *\n * Edits to sequence fields are anchored relative to their surroundings, so concurrent edits can result in the indexes of nodes and edits getting shifted.\n * To hold onto locations in sequence across an edit, use anchors.\n *\n * @privateRemarks\n * TODO:\n * Add anchor API that can actually hold onto locations in a sequence.\n * Currently only nodes can be held onto with anchors, and this does not replicate the behavior implemented for editing.\n */\nexport interface FlexTreeSequenceField extends FlexTreeField {\n\t/**\n\t * Gets a node of this field by its index with unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= array.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tat(index: number): FlexTreeUnknownUnboxed | undefined;\n\n\t/**\n\t * {@inheritdoc FlexTreeField.boxedAt}\n\t */\n\tboxedAt(index: number): FlexTreeNode | undefined;\n\n\t/**\n\t * Calls the provided callback function on each child of this sequence, and returns an array that contains the results.\n\t * @param callbackfn - A function that accepts the child and its index.\n\t */\n\tmap<U>(callbackfn: (value: FlexTreeUnknownUnboxed, index: number) => U): U[];\n\n\t/**\n\t * Get an editor for this sequence.\n\t */\n\treadonly editor: SequenceFieldEditBuilder<FlexibleFieldContent>;\n}\n\n/**\n * Field that stores exactly one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the RequiredField itself will be skipped over and its content will be returned directly.\n */\nexport interface FlexTreeRequiredField extends FlexTreeField {\n\tget content(): FlexTreeUnknownUnboxed;\n\n\treadonly editor: ValueFieldEditBuilder<FlexibleNodeContent>;\n}\n\n/**\n * Field that stores zero or one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the OptionalField itself will be skipped over and its content will be returned directly.\n *\n * @privateRemarks\n * TODO: Document merge semitics\n * TODO: Allow Optional fields to be used with last write wins OR first write wins merge resolution.\n * TODO:\n * Better centralize the documentation about what kinds of merge semantics are available for field kinds.\n * Maybe link editor?\n */\nexport interface FlexTreeOptionalField extends FlexTreeField {\n\tget content(): FlexTreeUnknownUnboxed | undefined;\n\n\treadonly editor: OptionalFieldEditBuilder<FlexibleNodeContent>;\n}\n\n// #endregion\n\n// #region Typed\n\n/**\n * Schema aware specialization of {@link FlexTreeField}.\n */\nexport type FlexTreeTypedField<Kind extends FlexFieldKind> =\n\tKind extends typeof FieldKinds.sequence\n\t\t? FlexTreeSequenceField\n\t\t: Kind extends typeof FieldKinds.required\n\t\t\t? FlexTreeRequiredField\n\t\t\t: Kind extends typeof FieldKinds.optional\n\t\t\t\t? FlexTreeOptionalField\n\t\t\t\t: FlexTreeField;\n\n// #endregion\n\n/**\n * Unboxed tree type for unknown schema cases.\n */\nexport type FlexTreeUnknownUnboxed = TreeValue | FlexTreeNode;\n"]}
@@ -10,8 +10,6 @@ export type CrossFieldQuerySet = CrossFieldMap<boolean>;
10
10
  export declare function addCrossFieldQuery(set: CrossFieldQuerySet, revision: RevisionTag | undefined, id: ChangesetLocalId, count: number): void;
11
11
  export declare function setInCrossFieldMap<T>(map: CrossFieldMap<T>, revision: RevisionTag | undefined, id: ChangesetLocalId, count: number, value: T): void;
12
12
  export declare function getFirstFromCrossFieldMap<T>(map: CrossFieldMap<T>, revision: RevisionTag | undefined, id: ChangesetLocalId, count: number): RangeQueryResult<ChangeAtomId, T>;
13
- /**
14
- */
15
13
  export declare enum CrossFieldTarget {
16
14
  Source = 0,
17
15
  Destination = 1
@@ -1 +1 @@
1
- {"version":3,"file":"crossFieldQueries.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/crossFieldQueries.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAAC;AACvD,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;AAExD,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,kBAAkB,EACvB,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,EAAE,EAAE,gBAAgB,EACpB,KAAK,EAAE,MAAM,GAC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file":"crossFieldQueries.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/crossFieldQueries.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAAC;AACvD,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;AAExD,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,kBAAkB,EACvB,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,EAAE,EAAE,gBAAgB,EACpB,KAAK,EAAE,MAAM,GACX,IAAI,CAEN;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EACnC,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,EACrB,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,EAAE,EAAE,gBAAgB,EACpB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,CAAC,GACN,IAAI,CAEN;AAED,wBAAgB,yBAAyB,CAAC,CAAC,EAC1C,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,EACrB,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,EAAE,EAAE,gBAAgB,EACpB,KAAK,EAAE,MAAM,GACX,gBAAgB,CAAC,YAAY,EAAE,CAAC,CAAC,CAEnC;AAED,oBAAY,gBAAgB;IAC3B,MAAM,IAAA;IACN,WAAW,IAAA;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,OAAO;IAC7C;;;OAGG;IACH,GAAG,CACF,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,EAAE,EAAE,gBAAgB,EACpB,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,OAAO,GACpB,gBAAgB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAErC;;;;OAIG;IACH,GAAG,CACF,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,EAAE,EAAE,gBAAgB,EACpB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,CAAC,EACX,oBAAoB,EAAE,OAAO,GAC3B,IAAI,CAAC;IAER;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;;OAGG;IACH,OAAO,CACN,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,EAAE,EAAE,gBAAgB,EACpB,KAAK,EAAE,MAAM,GACX,IAAI,CAAC;CACR"}
@@ -17,8 +17,6 @@ function getFirstFromCrossFieldMap(map, revision, id, count) {
17
17
  return map.getFirst({ revision, localId: id }, count);
18
18
  }
19
19
  exports.getFirstFromCrossFieldMap = getFirstFromCrossFieldMap;
20
- /**
21
- */
22
20
  var CrossFieldTarget;
23
21
  (function (CrossFieldTarget) {
24
22
  CrossFieldTarget[CrossFieldTarget["Source"] = 0] = "Source";
@@ -1 +1 @@
1
- {"version":3,"file":"crossFieldQueries.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/crossFieldQueries.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH,SAAgB,kBAAkB,CACjC,GAAuB,EACvB,QAAiC,EACjC,EAAoB,EACpB,KAAa;IAEb,kBAAkB,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC;AAPD,gDAOC;AAED,SAAgB,kBAAkB,CACjC,GAAqB,EACrB,QAAiC,EACjC,EAAoB,EACpB,KAAa,EACb,KAAQ;IAER,GAAG,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC;AARD,gDAQC;AAED,SAAgB,yBAAyB,CACxC,GAAqB,EACrB,QAAiC,EACjC,EAAoB,EACpB,KAAa;IAEb,OAAO,GAAG,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;AACvD,CAAC;AAPD,8DAOC;AAED;GACG;AACH,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC3B,2DAAM,CAAA;IACN,qEAAW,CAAA;AACZ,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tChangeAtomId,\n\tChangeAtomIdRangeMap,\n\tChangesetLocalId,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport type { RangeQueryResult } from \"../../util/index.js\";\n\nimport type { NodeId } from \"./modularChangeTypes.js\";\n\nexport type CrossFieldMap<T> = ChangeAtomIdRangeMap<T>;\nexport type CrossFieldQuerySet = CrossFieldMap<boolean>;\n\nexport function addCrossFieldQuery(\n\tset: CrossFieldQuerySet,\n\trevision: RevisionTag | undefined,\n\tid: ChangesetLocalId,\n\tcount: number,\n): void {\n\tsetInCrossFieldMap(set, revision, id, count, true);\n}\n\nexport function setInCrossFieldMap<T>(\n\tmap: CrossFieldMap<T>,\n\trevision: RevisionTag | undefined,\n\tid: ChangesetLocalId,\n\tcount: number,\n\tvalue: T,\n): void {\n\tmap.set({ revision, localId: id }, count, value);\n}\n\nexport function getFirstFromCrossFieldMap<T>(\n\tmap: CrossFieldMap<T>,\n\trevision: RevisionTag | undefined,\n\tid: ChangesetLocalId,\n\tcount: number,\n): RangeQueryResult<ChangeAtomId, T> {\n\treturn map.getFirst({ revision, localId: id }, count);\n}\n\n/**\n */\nexport enum CrossFieldTarget {\n\tSource,\n\tDestination,\n}\n\n/**\n * Used by {@link FieldChangeHandler} implementations for exchanging information across other fields\n * while rebasing, composing, or inverting a change.\n */\nexport interface CrossFieldManager<T = unknown> {\n\t/**\n\t * Returns the first data range associated with the key of `target`, `revision`, between `id` and `id + count`.\n\t * Calling this records a dependency for the current field on this key if `addDependency` is true.\n\t */\n\tget(\n\t\ttarget: CrossFieldTarget,\n\t\trevision: RevisionTag | undefined,\n\t\tid: ChangesetLocalId,\n\t\tcount: number,\n\t\taddDependency: boolean,\n\t): RangeQueryResult<ChangeAtomId, T>;\n\n\t/**\n\t * Sets the range of keys to `newValue`.\n\t * If `invalidateDependents` is true, all fields which took a dependency on this key will be considered invalidated\n\t * and will be given a chance to address the new data in `amendCompose`, or a second pass of `rebase` or `invert` as appropriate.\n\t */\n\tset(\n\t\ttarget: CrossFieldTarget,\n\t\trevision: RevisionTag | undefined,\n\t\tid: ChangesetLocalId,\n\t\tcount: number,\n\t\tnewValue: T,\n\t\tinvalidateDependents: boolean,\n\t): void;\n\n\t/**\n\t * This must be called whenever a new node is moved into this field as part of the current rebase, compose, or invert.\n\t * Calling this for a node which was already in the field is tolerated.\n\t */\n\tonMoveIn(id: NodeId): void;\n\n\t/**\n\t * This must be called whenever a new cross field key is moved into this field as part of the current rebase or compose.\n\t * Calling this for a key which was already in the field is tolerated.\n\t */\n\tmoveKey(\n\t\ttarget: CrossFieldTarget,\n\t\trevision: RevisionTag | undefined,\n\t\tid: ChangesetLocalId,\n\t\tcount: number,\n\t): void;\n}\n"]}
1
+ {"version":3,"file":"crossFieldQueries.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/crossFieldQueries.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH,SAAgB,kBAAkB,CACjC,GAAuB,EACvB,QAAiC,EACjC,EAAoB,EACpB,KAAa;IAEb,kBAAkB,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC;AAPD,gDAOC;AAED,SAAgB,kBAAkB,CACjC,GAAqB,EACrB,QAAiC,EACjC,EAAoB,EACpB,KAAa,EACb,KAAQ;IAER,GAAG,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC;AARD,gDAQC;AAED,SAAgB,yBAAyB,CACxC,GAAqB,EACrB,QAAiC,EACjC,EAAoB,EACpB,KAAa;IAEb,OAAO,GAAG,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;AACvD,CAAC;AAPD,8DAOC;AAED,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC3B,2DAAM,CAAA;IACN,qEAAW,CAAA;AACZ,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tChangeAtomId,\n\tChangeAtomIdRangeMap,\n\tChangesetLocalId,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport type { RangeQueryResult } from \"../../util/index.js\";\n\nimport type { NodeId } from \"./modularChangeTypes.js\";\n\nexport type CrossFieldMap<T> = ChangeAtomIdRangeMap<T>;\nexport type CrossFieldQuerySet = CrossFieldMap<boolean>;\n\nexport function addCrossFieldQuery(\n\tset: CrossFieldQuerySet,\n\trevision: RevisionTag | undefined,\n\tid: ChangesetLocalId,\n\tcount: number,\n): void {\n\tsetInCrossFieldMap(set, revision, id, count, true);\n}\n\nexport function setInCrossFieldMap<T>(\n\tmap: CrossFieldMap<T>,\n\trevision: RevisionTag | undefined,\n\tid: ChangesetLocalId,\n\tcount: number,\n\tvalue: T,\n): void {\n\tmap.set({ revision, localId: id }, count, value);\n}\n\nexport function getFirstFromCrossFieldMap<T>(\n\tmap: CrossFieldMap<T>,\n\trevision: RevisionTag | undefined,\n\tid: ChangesetLocalId,\n\tcount: number,\n): RangeQueryResult<ChangeAtomId, T> {\n\treturn map.getFirst({ revision, localId: id }, count);\n}\n\nexport enum CrossFieldTarget {\n\tSource,\n\tDestination,\n}\n\n/**\n * Used by {@link FieldChangeHandler} implementations for exchanging information across other fields\n * while rebasing, composing, or inverting a change.\n */\nexport interface CrossFieldManager<T = unknown> {\n\t/**\n\t * Returns the first data range associated with the key of `target`, `revision`, between `id` and `id + count`.\n\t * Calling this records a dependency for the current field on this key if `addDependency` is true.\n\t */\n\tget(\n\t\ttarget: CrossFieldTarget,\n\t\trevision: RevisionTag | undefined,\n\t\tid: ChangesetLocalId,\n\t\tcount: number,\n\t\taddDependency: boolean,\n\t): RangeQueryResult<ChangeAtomId, T>;\n\n\t/**\n\t * Sets the range of keys to `newValue`.\n\t * If `invalidateDependents` is true, all fields which took a dependency on this key will be considered invalidated\n\t * and will be given a chance to address the new data in `amendCompose`, or a second pass of `rebase` or `invert` as appropriate.\n\t */\n\tset(\n\t\ttarget: CrossFieldTarget,\n\t\trevision: RevisionTag | undefined,\n\t\tid: ChangesetLocalId,\n\t\tcount: number,\n\t\tnewValue: T,\n\t\tinvalidateDependents: boolean,\n\t): void;\n\n\t/**\n\t * This must be called whenever a new node is moved into this field as part of the current rebase, compose, or invert.\n\t * Calling this for a node which was already in the field is tolerated.\n\t */\n\tonMoveIn(id: NodeId): void;\n\n\t/**\n\t * This must be called whenever a new cross field key is moved into this field as part of the current rebase or compose.\n\t * Calling this for a key which was already in the field is tolerated.\n\t */\n\tmoveKey(\n\t\ttarget: CrossFieldTarget,\n\t\trevision: RevisionTag | undefined,\n\t\tid: ChangesetLocalId,\n\t\tcount: number,\n\t): void;\n}\n"]}
@@ -137,28 +137,18 @@ export interface FieldEditor<TChangeset> {
137
137
  * The `index` should be `undefined` iff the child node does not exist in the input context (e.g., an inserted node).
138
138
  */
139
139
  export type ToDelta = (child: NodeId) => DeltaFieldMap;
140
- /**
141
- */
142
140
  export type NodeChangeInverter = (change: NodeId) => NodeId;
143
- /**
144
- */
145
141
  export declare enum NodeAttachState {
146
142
  Attached = 0,
147
143
  Detached = 1
148
144
  }
149
- /**
150
- */
151
145
  export type NodeChangeRebaser = (change: NodeId | undefined, baseChange: NodeId | undefined,
152
146
  /**
153
147
  * Whether the node is attached to this field in the output context of the base change.
154
148
  * Defaults to attached if undefined.
155
149
  */
156
150
  state?: NodeAttachState) => NodeId | undefined;
157
- /**
158
- */
159
151
  export type NodeChangeComposer = (change1: NodeId | undefined, change2: NodeId | undefined) => NodeId;
160
- /**
161
- */
162
152
  export type NodeChangePruner = (change: NodeId) => NodeId | undefined;
163
153
  /**
164
154
  * A function that returns the set of removed roots that should be in memory for a given node changeset to be applied.