@fluidframework/tree 2.1.0 → 2.3.0-288113

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 (1464) hide show
  1. package/.mocharc.customBenchmarks.cjs +33 -0
  2. package/CHANGELOG.md +297 -0
  3. package/README.md +34 -4
  4. package/api-extractor.json +17 -0
  5. package/api-report/tree.alpha.api.md +158 -28
  6. package/api-report/tree.beta.api.md +59 -28
  7. package/api-report/tree.public.api.md +59 -28
  8. package/dist/beta.d.ts +4 -1
  9. package/dist/codec/discriminatedUnions.d.ts +11 -5
  10. package/dist/codec/discriminatedUnions.d.ts.map +1 -1
  11. package/dist/codec/discriminatedUnions.js.map +1 -1
  12. package/dist/codec/index.d.ts +1 -1
  13. package/dist/codec/index.d.ts.map +1 -1
  14. package/dist/codec/index.js.map +1 -1
  15. package/dist/core/forest/editableForest.d.ts +1 -5
  16. package/dist/core/forest/editableForest.d.ts.map +1 -1
  17. package/dist/core/forest/editableForest.js.map +1 -1
  18. package/dist/core/forest/forest.d.ts +0 -6
  19. package/dist/core/forest/forest.d.ts.map +1 -1
  20. package/dist/core/forest/forest.js +0 -2
  21. package/dist/core/forest/forest.js.map +1 -1
  22. package/dist/core/index.d.ts +2 -2
  23. package/dist/core/index.d.ts.map +1 -1
  24. package/dist/core/index.js +3 -4
  25. package/dist/core/index.js.map +1 -1
  26. package/dist/core/rebase/changeRebaser.d.ts +0 -4
  27. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  28. package/dist/core/rebase/changeRebaser.js.map +1 -1
  29. package/dist/core/rebase/index.d.ts +1 -1
  30. package/dist/core/rebase/index.d.ts.map +1 -1
  31. package/dist/core/rebase/index.js +1 -3
  32. package/dist/core/rebase/index.js.map +1 -1
  33. package/dist/core/rebase/types.d.ts +1 -8
  34. package/dist/core/rebase/types.d.ts.map +1 -1
  35. package/dist/core/rebase/types.js +1 -9
  36. package/dist/core/rebase/types.js.map +1 -1
  37. package/dist/core/rebase/utils.d.ts +0 -1
  38. package/dist/core/rebase/utils.d.ts.map +1 -1
  39. package/dist/core/rebase/utils.js +12 -7
  40. package/dist/core/rebase/utils.js.map +1 -1
  41. package/dist/core/schema-stored/multiplicity.d.ts +0 -1
  42. package/dist/core/schema-stored/multiplicity.d.ts.map +1 -1
  43. package/dist/core/schema-stored/multiplicity.js +0 -1
  44. package/dist/core/schema-stored/multiplicity.js.map +1 -1
  45. package/dist/core/schema-stored/schema.d.ts +0 -7
  46. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  47. package/dist/core/schema-stored/schema.js +0 -4
  48. package/dist/core/schema-stored/schema.js.map +1 -1
  49. package/dist/core/schema-stored/storedSchemaRepository.d.ts +0 -3
  50. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  51. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  52. package/dist/core/schema-view/view.d.ts +0 -3
  53. package/dist/core/schema-view/view.d.ts.map +1 -1
  54. package/dist/core/schema-view/view.js +0 -1
  55. package/dist/core/schema-view/view.js.map +1 -1
  56. package/dist/core/tree/anchorSet.d.ts +4 -16
  57. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  58. package/dist/core/tree/anchorSet.js +12 -5
  59. package/dist/core/tree/anchorSet.js.map +1 -1
  60. package/dist/core/tree/cursor.d.ts +1 -6
  61. package/dist/core/tree/cursor.d.ts.map +1 -1
  62. package/dist/core/tree/cursor.js +0 -2
  63. package/dist/core/tree/cursor.js.map +1 -1
  64. package/dist/core/tree/delta.d.ts +0 -11
  65. package/dist/core/tree/delta.d.ts.map +1 -1
  66. package/dist/core/tree/delta.js.map +1 -1
  67. package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
  68. package/dist/core/tree/detachedFieldIndexCodec.js +3 -2
  69. package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
  70. package/dist/core/tree/detachedFieldIndexTypes.d.ts +0 -1
  71. package/dist/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  72. package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
  73. package/dist/core/tree/index.d.ts +1 -1
  74. package/dist/core/tree/index.d.ts.map +1 -1
  75. package/dist/core/tree/index.js +3 -1
  76. package/dist/core/tree/index.js.map +1 -1
  77. package/dist/core/tree/mapTree.d.ts +20 -4
  78. package/dist/core/tree/mapTree.d.ts.map +1 -1
  79. package/dist/core/tree/mapTree.js +29 -0
  80. package/dist/core/tree/mapTree.js.map +1 -1
  81. package/dist/core/tree/pathTree.d.ts +0 -11
  82. package/dist/core/tree/pathTree.d.ts.map +1 -1
  83. package/dist/core/tree/pathTree.js.map +1 -1
  84. package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
  85. package/dist/core/tree/treeTextFormat.js +3 -2
  86. package/dist/core/tree/treeTextFormat.js.map +1 -1
  87. package/dist/core/tree/types.d.ts +0 -11
  88. package/dist/core/tree/types.d.ts.map +1 -1
  89. package/dist/core/tree/types.js +0 -4
  90. package/dist/core/tree/types.js.map +1 -1
  91. package/dist/core/tree/visitDelta.d.ts +0 -1
  92. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  93. package/dist/core/tree/visitDelta.js +2 -2
  94. package/dist/core/tree/visitDelta.js.map +1 -1
  95. package/dist/core/tree/visitPath.d.ts +0 -2
  96. package/dist/core/tree/visitPath.d.ts.map +1 -1
  97. package/dist/core/tree/visitPath.js.map +1 -1
  98. package/dist/core/tree/visitorUtils.d.ts +0 -1
  99. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  100. package/dist/core/tree/visitorUtils.js.map +1 -1
  101. package/dist/domains/index.d.ts +1 -1
  102. package/dist/domains/index.d.ts.map +1 -1
  103. package/dist/domains/index.js +2 -1
  104. package/dist/domains/index.js.map +1 -1
  105. package/dist/domains/json/index.d.ts +1 -1
  106. package/dist/domains/json/index.d.ts.map +1 -1
  107. package/dist/domains/json/index.js +2 -1
  108. package/dist/domains/json/index.js.map +1 -1
  109. package/dist/domains/json/jsonCursor.d.ts +36 -2
  110. package/dist/domains/json/jsonCursor.d.ts.map +1 -1
  111. package/dist/domains/json/jsonCursor.js +76 -5
  112. package/dist/domains/json/jsonCursor.js.map +1 -1
  113. package/dist/domains/json/jsonDomainSchema.d.ts +13 -3
  114. package/dist/domains/json/jsonDomainSchema.d.ts.map +1 -1
  115. package/dist/domains/json/jsonDomainSchema.js +12 -4
  116. package/dist/domains/json/jsonDomainSchema.js.map +1 -1
  117. package/dist/domains/leafDomain.d.ts +0 -1
  118. package/dist/domains/leafDomain.d.ts.map +1 -1
  119. package/dist/domains/leafDomain.js +0 -1
  120. package/dist/domains/leafDomain.js.map +1 -1
  121. package/dist/domains/schemaBuilder.d.ts +1 -7
  122. package/dist/domains/schemaBuilder.d.ts.map +1 -1
  123. package/dist/domains/schemaBuilder.js +0 -10
  124. package/dist/domains/schemaBuilder.js.map +1 -1
  125. package/dist/events/events.d.ts +7 -5
  126. package/dist/events/events.d.ts.map +1 -1
  127. package/dist/events/events.js +5 -3
  128. package/dist/events/events.js.map +1 -1
  129. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  130. package/dist/feature-libraries/chunked-forest/basicChunk.js +8 -3
  131. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  132. package/dist/feature-libraries/chunked-forest/chunk.d.ts +1 -1
  133. package/dist/feature-libraries/chunked-forest/chunk.d.ts.map +1 -1
  134. package/dist/feature-libraries/chunked-forest/chunk.js.map +1 -1
  135. package/dist/feature-libraries/chunked-forest/chunkTree.js +3 -3
  136. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  137. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  138. package/dist/feature-libraries/chunked-forest/chunkedForest.js +7 -5
  139. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  140. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +1 -1
  141. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  142. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  143. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +8 -5
  144. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  145. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  146. package/dist/feature-libraries/chunked-forest/uniformChunk.js +5 -3
  147. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  148. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +12 -24
  149. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  150. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +9 -19
  151. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  152. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -6
  153. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  154. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +11 -1
  155. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  156. package/dist/feature-libraries/default-schema/defaultSchema.d.ts +0 -1
  157. package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  158. package/dist/feature-libraries/default-schema/defaultSchema.js +0 -1
  159. package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  160. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  161. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  162. package/dist/feature-libraries/default-schema/index.js +2 -1
  163. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  164. package/dist/feature-libraries/default-schema/schemaChecker.d.ts +6 -0
  165. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  166. package/dist/feature-libraries/default-schema/schemaChecker.js +6 -0
  167. package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  168. package/dist/feature-libraries/editableTreeBinder.d.ts +0 -67
  169. package/dist/feature-libraries/editableTreeBinder.d.ts.map +1 -1
  170. package/dist/feature-libraries/editableTreeBinder.js +5 -24
  171. package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
  172. package/dist/feature-libraries/fieldGenerator.d.ts +0 -3
  173. package/dist/feature-libraries/fieldGenerator.d.ts.map +1 -1
  174. package/dist/feature-libraries/fieldGenerator.js +0 -1
  175. package/dist/feature-libraries/fieldGenerator.js.map +1 -1
  176. package/dist/feature-libraries/flex-map-tree/index.d.ts +1 -1
  177. package/dist/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
  178. package/dist/feature-libraries/flex-map-tree/index.js +2 -2
  179. package/dist/feature-libraries/flex-map-tree/index.js.map +1 -1
  180. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +57 -51
  181. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  182. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +171 -180
  183. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  184. package/dist/feature-libraries/flex-tree/context.d.ts +0 -1
  185. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  186. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  187. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +17 -373
  188. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  189. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +1 -34
  190. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  191. package/dist/feature-libraries/flex-tree/index.d.ts +2 -2
  192. package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
  193. package/dist/feature-libraries/flex-tree/index.js +1 -3
  194. package/dist/feature-libraries/flex-tree/index.js.map +1 -1
  195. package/dist/feature-libraries/flex-tree/lazyField.d.ts +9 -27
  196. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  197. package/dist/feature-libraries/flex-tree/lazyField.js +26 -102
  198. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  199. package/dist/feature-libraries/flex-tree/lazyNode.d.ts +3 -18
  200. package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  201. package/dist/feature-libraries/flex-tree/lazyNode.js +2 -126
  202. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  203. package/dist/feature-libraries/flex-tree/treeEvents.d.ts +0 -2
  204. package/dist/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
  205. package/dist/feature-libraries/flex-tree/treeEvents.js.map +1 -1
  206. package/dist/feature-libraries/flex-tree/utilities.d.ts +2 -1
  207. package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  208. package/dist/feature-libraries/flex-tree/utilities.js +4 -0
  209. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  210. package/dist/feature-libraries/forest-summary/codec.js +2 -2
  211. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  212. package/dist/feature-libraries/index.d.ts +6 -8
  213. package/dist/feature-libraries/index.d.ts.map +1 -1
  214. package/dist/feature-libraries/index.js +7 -20
  215. package/dist/feature-libraries/index.js.map +1 -1
  216. package/dist/feature-libraries/mapTreeCursor.d.ts +6 -2
  217. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  218. package/dist/feature-libraries/mapTreeCursor.js +9 -1
  219. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  220. package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts +0 -4
  221. package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts.map +1 -1
  222. package/dist/feature-libraries/memoizedIdRangeAllocator.js +0 -1
  223. package/dist/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
  224. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +0 -2
  225. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  226. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +0 -1
  227. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  228. package/dist/feature-libraries/modular-schema/discrepancies.d.ts +18 -0
  229. package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
  230. package/dist/feature-libraries/modular-schema/discrepancies.js +105 -2
  231. package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
  232. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +0 -8
  233. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  234. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +0 -1
  235. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  236. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +1 -3
  237. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  238. package/dist/feature-libraries/modular-schema/fieldKind.js +1 -2
  239. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  240. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -2
  241. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  242. package/dist/feature-libraries/modular-schema/genericFieldKind.js +57 -85
  243. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  244. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +1 -1
  245. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  246. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +5 -8
  247. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  248. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts +3 -14
  249. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
  250. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js +6 -0
  251. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  252. package/dist/feature-libraries/modular-schema/index.d.ts +2 -2
  253. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  254. package/dist/feature-libraries/modular-schema/index.js +2 -1
  255. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  256. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  257. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +39 -22
  258. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  259. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +9 -8
  260. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  261. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +192 -228
  262. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  263. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +8 -14
  264. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  265. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  266. package/dist/feature-libraries/node-key/nodeKey.d.ts +0 -4
  267. package/dist/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
  268. package/dist/feature-libraries/node-key/nodeKey.js +0 -2
  269. package/dist/feature-libraries/node-key/nodeKey.js.map +1 -1
  270. package/dist/feature-libraries/node-key/nodeKeyManager.d.ts +0 -1
  271. package/dist/feature-libraries/node-key/nodeKeyManager.d.ts.map +1 -1
  272. package/dist/feature-libraries/node-key/nodeKeyManager.js.map +1 -1
  273. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  274. package/dist/feature-libraries/object-forest/objectForest.js +1 -10
  275. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  276. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
  277. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  278. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
  279. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  280. package/dist/feature-libraries/schemaBuilderBase.d.ts +2 -28
  281. package/dist/feature-libraries/schemaBuilderBase.d.ts.map +1 -1
  282. package/dist/feature-libraries/schemaBuilderBase.js +1 -27
  283. package/dist/feature-libraries/schemaBuilderBase.js.map +1 -1
  284. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  285. package/dist/feature-libraries/sequence-field/compose.js +24 -21
  286. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  287. package/dist/feature-libraries/sequence-field/formatV2.d.ts +3 -3
  288. package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  289. package/dist/feature-libraries/sequence-field/formatV2.js +7 -6
  290. package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
  291. package/dist/feature-libraries/sequence-field/formatV3.d.ts +195 -0
  292. package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -0
  293. package/dist/feature-libraries/sequence-field/formatV3.js +23 -0
  294. package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -0
  295. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +11 -0
  296. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  297. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  298. package/dist/feature-libraries/sequence-field/index.d.ts +1 -1
  299. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  300. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  301. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  302. package/dist/feature-libraries/sequence-field/invert.js +21 -13
  303. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  304. package/dist/feature-libraries/sequence-field/markQueue.js +1 -1
  305. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  306. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +2 -2
  307. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  308. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  309. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  310. package/dist/feature-libraries/sequence-field/rebase.js +24 -6
  311. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  312. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  313. package/dist/feature-libraries/sequence-field/replaceRevisions.js +16 -3
  314. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  315. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
  316. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +38 -4
  317. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
  318. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -1
  319. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  320. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +54 -9
  321. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  322. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +11 -0
  323. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -0
  324. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +85 -0
  325. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -0
  326. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  327. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js +2 -0
  328. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  329. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  330. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +4 -1
  331. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  332. package/dist/feature-libraries/sequence-field/types.d.ts +23 -4
  333. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  334. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  335. package/dist/feature-libraries/sequence-field/utils.d.ts +5 -4
  336. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  337. package/dist/feature-libraries/sequence-field/utils.js +70 -42
  338. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  339. package/dist/feature-libraries/storedToViewSchema.d.ts +0 -1
  340. package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  341. package/dist/feature-libraries/storedToViewSchema.js +0 -1
  342. package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
  343. package/dist/feature-libraries/treeCursorUtils.d.ts +0 -6
  344. package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  345. package/dist/feature-libraries/treeCursorUtils.js +8 -6
  346. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  347. package/dist/feature-libraries/treeTextCursor.d.ts +0 -2
  348. package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
  349. package/dist/feature-libraries/treeTextCursor.js +0 -2
  350. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  351. package/dist/feature-libraries/typed-schema/flexList.d.ts +0 -3
  352. package/dist/feature-libraries/typed-schema/flexList.d.ts.map +1 -1
  353. package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
  354. package/dist/feature-libraries/typed-schema/index.d.ts +1 -1
  355. package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
  356. package/dist/feature-libraries/typed-schema/index.js +1 -3
  357. package/dist/feature-libraries/typed-schema/index.js.map +1 -1
  358. package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  359. package/dist/feature-libraries/typed-schema/schemaCollection.js +0 -4
  360. package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  361. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +2 -41
  362. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  363. package/dist/feature-libraries/typed-schema/typedTreeSchema.js +1 -40
  364. package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  365. package/dist/feature-libraries/typed-schema/view.d.ts +0 -1
  366. package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
  367. package/dist/feature-libraries/typed-schema/view.js.map +1 -1
  368. package/dist/index.d.ts +8 -9
  369. package/dist/index.d.ts.map +1 -1
  370. package/dist/index.js +36 -90
  371. package/dist/index.js.map +1 -1
  372. package/dist/internalTypes.d.ts +1 -1
  373. package/dist/internalTypes.d.ts.map +1 -1
  374. package/dist/internalTypes.js.map +1 -1
  375. package/dist/packageVersion.d.ts +1 -1
  376. package/dist/packageVersion.d.ts.map +1 -1
  377. package/dist/packageVersion.js +1 -1
  378. package/dist/packageVersion.js.map +1 -1
  379. package/dist/public.d.ts +4 -1
  380. package/dist/shared-tree/schematizeTree.d.ts +2 -11
  381. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  382. package/dist/shared-tree/schematizeTree.js +13 -2
  383. package/dist/shared-tree/schematizeTree.js.map +1 -1
  384. package/dist/shared-tree/schematizingTreeView.d.ts +4 -4
  385. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  386. package/dist/shared-tree/schematizingTreeView.js +2 -2
  387. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  388. package/dist/shared-tree/sharedTree.d.ts +4 -17
  389. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  390. package/dist/shared-tree/sharedTree.js +4 -8
  391. package/dist/shared-tree/sharedTree.js.map +1 -1
  392. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  393. package/dist/shared-tree/sharedTreeChangeCodecs.js +4 -0
  394. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  395. package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
  396. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  397. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +0 -2
  398. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  399. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  400. package/dist/shared-tree/treeApi.js +2 -2
  401. package/dist/shared-tree/treeApi.js.map +1 -1
  402. package/dist/shared-tree/treeCheckout.d.ts +0 -5
  403. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  404. package/dist/shared-tree/treeCheckout.js +5 -3
  405. package/dist/shared-tree/treeCheckout.js.map +1 -1
  406. package/dist/shared-tree/treeView.d.ts +3 -6
  407. package/dist/shared-tree/treeView.d.ts.map +1 -1
  408. package/dist/shared-tree/treeView.js.map +1 -1
  409. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  410. package/dist/shared-tree-core/branch.js +11 -6
  411. package/dist/shared-tree-core/branch.js.map +1 -1
  412. package/dist/shared-tree-core/defaultResubmitMachine.js +3 -3
  413. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  414. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  415. package/dist/shared-tree-core/editManagerCodecs.js +1 -0
  416. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  417. package/dist/shared-tree-core/editManagerFormat.d.ts +2 -2
  418. package/dist/shared-tree-core/editManagerFormat.d.ts.map +1 -1
  419. package/dist/shared-tree-core/editManagerFormat.js +6 -1
  420. package/dist/shared-tree-core/editManagerFormat.js.map +1 -1
  421. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  422. package/dist/shared-tree-core/messageCodecs.js +1 -0
  423. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  424. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  425. package/dist/shared-tree-core/sharedTreeCore.js +3 -1
  426. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  427. package/dist/simple-tree/api/create.d.ts +54 -0
  428. package/dist/simple-tree/api/create.d.ts.map +1 -0
  429. package/dist/simple-tree/api/create.js +99 -0
  430. package/dist/simple-tree/api/create.js.map +1 -0
  431. package/dist/simple-tree/api/index.d.ts +12 -0
  432. package/dist/simple-tree/api/index.d.ts.map +1 -0
  433. package/dist/simple-tree/api/index.js +28 -0
  434. package/dist/simple-tree/api/index.js.map +1 -0
  435. package/{lib/simple-tree → dist/simple-tree/api}/schemaCreationUtilities.d.ts +7 -4
  436. package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -0
  437. package/dist/simple-tree/{schemaCreationUtilities.js → api/schemaCreationUtilities.js} +1 -1
  438. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -0
  439. package/dist/simple-tree/{schemaFactory.d.ts → api/schemaFactory.d.ts} +15 -14
  440. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -0
  441. package/dist/simple-tree/{schemaFactory.js → api/schemaFactory.js} +10 -9
  442. package/dist/simple-tree/api/schemaFactory.js.map +1 -0
  443. package/{lib/simple-tree → dist/simple-tree/api}/schemaFactoryRecursive.d.ts +40 -7
  444. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -0
  445. package/dist/simple-tree/{schemaFactoryRecursive.js → api/schemaFactoryRecursive.js} +1 -1
  446. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -0
  447. package/dist/simple-tree/api/testRecursiveDomain.d.ts +62 -0
  448. package/dist/simple-tree/api/testRecursiveDomain.d.ts.map +1 -0
  449. package/dist/simple-tree/api/testRecursiveDomain.js.map +1 -0
  450. package/{lib/simple-tree → dist/simple-tree/api}/tree.d.ts +111 -20
  451. package/dist/simple-tree/api/tree.d.ts.map +1 -0
  452. package/dist/simple-tree/api/tree.js +173 -0
  453. package/dist/simple-tree/api/tree.js.map +1 -0
  454. package/dist/simple-tree/{treeNodeApi.d.ts → api/treeNodeApi.d.ts} +7 -6
  455. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -0
  456. package/dist/simple-tree/{treeNodeApi.js → api/treeNodeApi.js} +57 -21
  457. package/dist/simple-tree/api/treeNodeApi.js.map +1 -0
  458. package/dist/simple-tree/api/verboseTree.d.ts +136 -0
  459. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -0
  460. package/dist/simple-tree/api/verboseTree.js +220 -0
  461. package/dist/simple-tree/api/verboseTree.js.map +1 -0
  462. package/dist/simple-tree/arrayNode.d.ts +3 -3
  463. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  464. package/dist/simple-tree/arrayNode.js +72 -85
  465. package/dist/simple-tree/arrayNode.js.map +1 -1
  466. package/dist/simple-tree/core/index.d.ts +10 -0
  467. package/dist/simple-tree/core/index.d.ts.map +1 -0
  468. package/dist/simple-tree/core/index.js +27 -0
  469. package/dist/simple-tree/core/index.js.map +1 -0
  470. package/{lib/simple-tree → dist/simple-tree/core}/schemaCaching.d.ts +2 -9
  471. package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -0
  472. package/dist/simple-tree/{schemaCaching.js → core/schemaCaching.js} +2 -23
  473. package/dist/simple-tree/core/schemaCaching.js.map +1 -0
  474. package/dist/simple-tree/core/treeNodeKernel.d.ts +70 -0
  475. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -0
  476. package/dist/simple-tree/core/treeNodeKernel.js +164 -0
  477. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -0
  478. package/dist/simple-tree/core/treeNodeSchema.d.ts +149 -0
  479. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -0
  480. package/dist/simple-tree/core/treeNodeSchema.js +35 -0
  481. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -0
  482. package/{lib/simple-tree → dist/simple-tree/core}/types.d.ts +50 -79
  483. package/dist/simple-tree/core/types.d.ts.map +1 -0
  484. package/dist/simple-tree/core/types.js +117 -0
  485. package/dist/simple-tree/core/types.js.map +1 -0
  486. package/dist/simple-tree/core/withType.d.ts +82 -0
  487. package/dist/simple-tree/core/withType.d.ts.map +1 -0
  488. package/dist/simple-tree/core/withType.js +39 -0
  489. package/dist/simple-tree/core/withType.js.map +1 -0
  490. package/dist/simple-tree/getJsonSchema.d.ts +55 -0
  491. package/dist/simple-tree/getJsonSchema.d.ts.map +1 -0
  492. package/dist/simple-tree/getJsonSchema.js +69 -0
  493. package/dist/simple-tree/getJsonSchema.js.map +1 -0
  494. package/dist/simple-tree/getSimpleFieldSchema.d.ts +14 -0
  495. package/dist/simple-tree/getSimpleFieldSchema.d.ts.map +1 -0
  496. package/dist/simple-tree/getSimpleFieldSchema.js +29 -0
  497. package/dist/simple-tree/getSimpleFieldSchema.js.map +1 -0
  498. package/dist/simple-tree/getSimpleSchema.d.ts +58 -0
  499. package/dist/simple-tree/getSimpleSchema.d.ts.map +1 -0
  500. package/dist/simple-tree/getSimpleSchema.js +68 -0
  501. package/dist/simple-tree/getSimpleSchema.js.map +1 -0
  502. package/dist/simple-tree/index.d.ts +12 -13
  503. package/dist/simple-tree/index.d.ts.map +1 -1
  504. package/dist/simple-tree/index.js +26 -23
  505. package/dist/simple-tree/index.js.map +1 -1
  506. package/dist/simple-tree/jsonSchema.d.ts +206 -0
  507. package/dist/simple-tree/jsonSchema.d.ts.map +1 -0
  508. package/dist/{feature-libraries/schema-aware/index.js → simple-tree/jsonSchema.js} +1 -1
  509. package/dist/simple-tree/jsonSchema.js.map +1 -0
  510. package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
  511. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  512. package/dist/simple-tree/leafNodeSchema.js +3 -4
  513. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  514. package/dist/simple-tree/mapNode.d.ts +9 -3
  515. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  516. package/dist/simple-tree/mapNode.js +33 -35
  517. package/dist/simple-tree/mapNode.js.map +1 -1
  518. package/dist/simple-tree/objectNode.d.ts +18 -16
  519. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  520. package/dist/simple-tree/objectNode.js +43 -44
  521. package/dist/simple-tree/objectNode.js.map +1 -1
  522. package/dist/simple-tree/objectNodeTypes.d.ts +38 -0
  523. package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -0
  524. package/dist/simple-tree/objectNodeTypes.js +19 -0
  525. package/dist/simple-tree/objectNodeTypes.js.map +1 -0
  526. package/dist/simple-tree/proxies.d.ts +6 -25
  527. package/dist/simple-tree/proxies.d.ts.map +1 -1
  528. package/dist/simple-tree/proxies.js +50 -63
  529. package/dist/simple-tree/proxies.js.map +1 -1
  530. package/dist/simple-tree/proxyBinding.d.ts +45 -22
  531. package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
  532. package/dist/simple-tree/proxyBinding.js +94 -59
  533. package/dist/simple-tree/proxyBinding.js.map +1 -1
  534. package/dist/simple-tree/schemaTypes.d.ts +10 -159
  535. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  536. package/dist/simple-tree/schemaTypes.js +11 -42
  537. package/dist/simple-tree/schemaTypes.js.map +1 -1
  538. package/dist/simple-tree/simpleSchema.d.ts +124 -0
  539. package/dist/simple-tree/simpleSchema.d.ts.map +1 -0
  540. package/dist/{feature-libraries/schema-aware/schemaAware.js → simple-tree/simpleSchema.js} +1 -1
  541. package/dist/simple-tree/simpleSchema.js.map +1 -0
  542. package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts +12 -0
  543. package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts.map +1 -0
  544. package/dist/simple-tree/simpleSchemaToJsonSchema.js +146 -0
  545. package/dist/simple-tree/simpleSchemaToJsonSchema.js.map +1 -0
  546. package/dist/simple-tree/toFlexSchema.d.ts +4 -12
  547. package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
  548. package/dist/simple-tree/toFlexSchema.js +42 -52
  549. package/dist/simple-tree/toFlexSchema.js.map +1 -1
  550. package/dist/simple-tree/toMapTree.d.ts +39 -39
  551. package/dist/simple-tree/toMapTree.d.ts.map +1 -1
  552. package/dist/simple-tree/toMapTree.js +227 -171
  553. package/dist/simple-tree/toMapTree.js.map +1 -1
  554. package/dist/simple-tree/treeNodeValid.d.ts +74 -0
  555. package/dist/simple-tree/treeNodeValid.d.ts.map +1 -0
  556. package/dist/simple-tree/{types.js → treeNodeValid.js} +18 -111
  557. package/dist/simple-tree/treeNodeValid.js.map +1 -0
  558. package/dist/simple-tree/typesUnsafe.d.ts +35 -4
  559. package/dist/simple-tree/typesUnsafe.d.ts.map +1 -1
  560. package/dist/simple-tree/typesUnsafe.js.map +1 -1
  561. package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts +11 -0
  562. package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts.map +1 -0
  563. package/dist/simple-tree/viewSchemaToSimpleSchema.js +171 -0
  564. package/dist/simple-tree/viewSchemaToSimpleSchema.js.map +1 -0
  565. package/dist/util/brand.d.ts +0 -3
  566. package/dist/util/brand.d.ts.map +1 -1
  567. package/dist/util/brand.js +1 -2
  568. package/dist/util/brand.js.map +1 -1
  569. package/dist/util/brandedMap.d.ts +0 -5
  570. package/dist/util/brandedMap.d.ts.map +1 -1
  571. package/dist/util/brandedMap.js +0 -1
  572. package/dist/util/brandedMap.js.map +1 -1
  573. package/dist/util/idAllocator.d.ts +0 -2
  574. package/dist/util/idAllocator.d.ts.map +1 -1
  575. package/dist/util/idAllocator.js +0 -1
  576. package/dist/util/idAllocator.js.map +1 -1
  577. package/dist/util/index.d.ts +2 -2
  578. package/dist/util/index.d.ts.map +1 -1
  579. package/dist/util/index.js +4 -2
  580. package/dist/util/index.js.map +1 -1
  581. package/dist/util/nestedMap.d.ts +5 -19
  582. package/dist/util/nestedMap.d.ts.map +1 -1
  583. package/dist/util/nestedMap.js +17 -17
  584. package/dist/util/nestedMap.js.map +1 -1
  585. package/dist/util/opaque.d.ts +0 -4
  586. package/dist/util/opaque.d.ts.map +1 -1
  587. package/dist/util/opaque.js +0 -2
  588. package/dist/util/opaque.js.map +1 -1
  589. package/dist/util/rangeMap.d.ts +0 -2
  590. package/dist/util/rangeMap.d.ts.map +1 -1
  591. package/dist/util/rangeMap.js +4 -3
  592. package/dist/util/rangeMap.js.map +1 -1
  593. package/dist/util/transactionResult.d.ts +0 -1
  594. package/dist/util/transactionResult.d.ts.map +1 -1
  595. package/dist/util/transactionResult.js +0 -1
  596. package/dist/util/transactionResult.js.map +1 -1
  597. package/dist/util/typeCheck.d.ts +2 -20
  598. package/dist/util/typeCheck.d.ts.map +1 -1
  599. package/dist/util/typeCheck.js.map +1 -1
  600. package/dist/util/typeCheckTests.d.ts +4 -4
  601. package/dist/util/typeCheckTests.d.ts.map +1 -1
  602. package/dist/util/typeCheckTests.js.map +1 -1
  603. package/dist/util/typeUtils.d.ts +0 -7
  604. package/dist/util/typeUtils.d.ts.map +1 -1
  605. package/dist/util/typeUtils.js.map +1 -1
  606. package/dist/util/utils.d.ts +6 -8
  607. package/dist/util/utils.d.ts.map +1 -1
  608. package/dist/util/utils.js +14 -5
  609. package/dist/util/utils.js.map +1 -1
  610. package/lib/beta.d.ts +4 -1
  611. package/lib/codec/discriminatedUnions.d.ts +11 -5
  612. package/lib/codec/discriminatedUnions.d.ts.map +1 -1
  613. package/lib/codec/discriminatedUnions.js.map +1 -1
  614. package/lib/codec/index.d.ts +1 -1
  615. package/lib/codec/index.d.ts.map +1 -1
  616. package/lib/codec/index.js +1 -1
  617. package/lib/codec/index.js.map +1 -1
  618. package/lib/core/forest/editableForest.d.ts +1 -5
  619. package/lib/core/forest/editableForest.d.ts.map +1 -1
  620. package/lib/core/forest/editableForest.js.map +1 -1
  621. package/lib/core/forest/forest.d.ts +0 -6
  622. package/lib/core/forest/forest.d.ts.map +1 -1
  623. package/lib/core/forest/forest.js +0 -2
  624. package/lib/core/forest/forest.js.map +1 -1
  625. package/lib/core/index.d.ts +2 -2
  626. package/lib/core/index.d.ts.map +1 -1
  627. package/lib/core/index.js +2 -2
  628. package/lib/core/index.js.map +1 -1
  629. package/lib/core/rebase/changeRebaser.d.ts +0 -4
  630. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  631. package/lib/core/rebase/changeRebaser.js.map +1 -1
  632. package/lib/core/rebase/index.d.ts +1 -1
  633. package/lib/core/rebase/index.d.ts.map +1 -1
  634. package/lib/core/rebase/index.js +1 -1
  635. package/lib/core/rebase/index.js.map +1 -1
  636. package/lib/core/rebase/types.d.ts +1 -8
  637. package/lib/core/rebase/types.d.ts.map +1 -1
  638. package/lib/core/rebase/types.js +1 -7
  639. package/lib/core/rebase/types.js.map +1 -1
  640. package/lib/core/rebase/utils.d.ts +0 -1
  641. package/lib/core/rebase/utils.d.ts.map +1 -1
  642. package/lib/core/rebase/utils.js +13 -8
  643. package/lib/core/rebase/utils.js.map +1 -1
  644. package/lib/core/schema-stored/multiplicity.d.ts +0 -1
  645. package/lib/core/schema-stored/multiplicity.d.ts.map +1 -1
  646. package/lib/core/schema-stored/multiplicity.js +0 -1
  647. package/lib/core/schema-stored/multiplicity.js.map +1 -1
  648. package/lib/core/schema-stored/schema.d.ts +0 -7
  649. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  650. package/lib/core/schema-stored/schema.js +0 -4
  651. package/lib/core/schema-stored/schema.js.map +1 -1
  652. package/lib/core/schema-stored/storedSchemaRepository.d.ts +0 -3
  653. package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  654. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  655. package/lib/core/schema-view/view.d.ts +0 -3
  656. package/lib/core/schema-view/view.d.ts.map +1 -1
  657. package/lib/core/schema-view/view.js +0 -1
  658. package/lib/core/schema-view/view.js.map +1 -1
  659. package/lib/core/tree/anchorSet.d.ts +4 -16
  660. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  661. package/lib/core/tree/anchorSet.js +12 -5
  662. package/lib/core/tree/anchorSet.js.map +1 -1
  663. package/lib/core/tree/cursor.d.ts +1 -6
  664. package/lib/core/tree/cursor.d.ts.map +1 -1
  665. package/lib/core/tree/cursor.js +0 -2
  666. package/lib/core/tree/cursor.js.map +1 -1
  667. package/lib/core/tree/delta.d.ts +0 -11
  668. package/lib/core/tree/delta.d.ts.map +1 -1
  669. package/lib/core/tree/delta.js.map +1 -1
  670. package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
  671. package/lib/core/tree/detachedFieldIndexCodec.js +4 -3
  672. package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
  673. package/lib/core/tree/detachedFieldIndexTypes.d.ts +0 -1
  674. package/lib/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  675. package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
  676. package/lib/core/tree/index.d.ts +1 -1
  677. package/lib/core/tree/index.d.ts.map +1 -1
  678. package/lib/core/tree/index.js +1 -0
  679. package/lib/core/tree/index.js.map +1 -1
  680. package/lib/core/tree/mapTree.d.ts +20 -4
  681. package/lib/core/tree/mapTree.d.ts.map +1 -1
  682. package/lib/core/tree/mapTree.js +27 -1
  683. package/lib/core/tree/mapTree.js.map +1 -1
  684. package/lib/core/tree/pathTree.d.ts +0 -11
  685. package/lib/core/tree/pathTree.d.ts.map +1 -1
  686. package/lib/core/tree/pathTree.js.map +1 -1
  687. package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
  688. package/lib/core/tree/treeTextFormat.js +3 -2
  689. package/lib/core/tree/treeTextFormat.js.map +1 -1
  690. package/lib/core/tree/types.d.ts +0 -11
  691. package/lib/core/tree/types.d.ts.map +1 -1
  692. package/lib/core/tree/types.js +0 -4
  693. package/lib/core/tree/types.js.map +1 -1
  694. package/lib/core/tree/visitDelta.d.ts +0 -1
  695. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  696. package/lib/core/tree/visitDelta.js +2 -2
  697. package/lib/core/tree/visitDelta.js.map +1 -1
  698. package/lib/core/tree/visitPath.d.ts +0 -2
  699. package/lib/core/tree/visitPath.d.ts.map +1 -1
  700. package/lib/core/tree/visitPath.js.map +1 -1
  701. package/lib/core/tree/visitorUtils.d.ts +0 -1
  702. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  703. package/lib/core/tree/visitorUtils.js.map +1 -1
  704. package/lib/domains/index.d.ts +1 -1
  705. package/lib/domains/index.d.ts.map +1 -1
  706. package/lib/domains/index.js +1 -1
  707. package/lib/domains/index.js.map +1 -1
  708. package/lib/domains/json/index.d.ts +1 -1
  709. package/lib/domains/json/index.d.ts.map +1 -1
  710. package/lib/domains/json/index.js +1 -1
  711. package/lib/domains/json/index.js.map +1 -1
  712. package/lib/domains/json/jsonCursor.d.ts +36 -2
  713. package/lib/domains/json/jsonCursor.d.ts.map +1 -1
  714. package/lib/domains/json/jsonCursor.js +76 -5
  715. package/lib/domains/json/jsonCursor.js.map +1 -1
  716. package/lib/domains/json/jsonDomainSchema.d.ts +13 -3
  717. package/lib/domains/json/jsonDomainSchema.d.ts.map +1 -1
  718. package/lib/domains/json/jsonDomainSchema.js +9 -1
  719. package/lib/domains/json/jsonDomainSchema.js.map +1 -1
  720. package/lib/domains/leafDomain.d.ts +0 -1
  721. package/lib/domains/leafDomain.d.ts.map +1 -1
  722. package/lib/domains/leafDomain.js +0 -1
  723. package/lib/domains/leafDomain.js.map +1 -1
  724. package/lib/domains/schemaBuilder.d.ts +1 -7
  725. package/lib/domains/schemaBuilder.d.ts.map +1 -1
  726. package/lib/domains/schemaBuilder.js +1 -11
  727. package/lib/domains/schemaBuilder.js.map +1 -1
  728. package/lib/events/events.d.ts +7 -5
  729. package/lib/events/events.d.ts.map +1 -1
  730. package/lib/events/events.js +5 -3
  731. package/lib/events/events.js.map +1 -1
  732. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  733. package/lib/feature-libraries/chunked-forest/basicChunk.js +9 -4
  734. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  735. package/lib/feature-libraries/chunked-forest/chunk.d.ts +1 -1
  736. package/lib/feature-libraries/chunked-forest/chunk.d.ts.map +1 -1
  737. package/lib/feature-libraries/chunked-forest/chunk.js.map +1 -1
  738. package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -4
  739. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  740. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  741. package/lib/feature-libraries/chunked-forest/chunkedForest.js +8 -6
  742. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  743. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +2 -2
  744. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  745. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  746. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +9 -6
  747. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  748. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  749. package/lib/feature-libraries/chunked-forest/uniformChunk.js +6 -4
  750. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  751. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +12 -24
  752. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  753. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -16
  754. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  755. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -6
  756. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  757. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +11 -1
  758. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  759. package/lib/feature-libraries/default-schema/defaultSchema.d.ts +0 -1
  760. package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  761. package/lib/feature-libraries/default-schema/defaultSchema.js +0 -1
  762. package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  763. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  764. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  765. package/lib/feature-libraries/default-schema/index.js +1 -1
  766. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  767. package/lib/feature-libraries/default-schema/schemaChecker.d.ts +6 -0
  768. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  769. package/lib/feature-libraries/default-schema/schemaChecker.js +6 -0
  770. package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  771. package/lib/feature-libraries/editableTreeBinder.d.ts +0 -67
  772. package/lib/feature-libraries/editableTreeBinder.d.ts.map +1 -1
  773. package/lib/feature-libraries/editableTreeBinder.js +6 -25
  774. package/lib/feature-libraries/editableTreeBinder.js.map +1 -1
  775. package/lib/feature-libraries/fieldGenerator.d.ts +0 -3
  776. package/lib/feature-libraries/fieldGenerator.d.ts.map +1 -1
  777. package/lib/feature-libraries/fieldGenerator.js +0 -1
  778. package/lib/feature-libraries/fieldGenerator.js.map +1 -1
  779. package/lib/feature-libraries/flex-map-tree/index.d.ts +1 -1
  780. package/lib/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
  781. package/lib/feature-libraries/flex-map-tree/index.js +1 -1
  782. package/lib/feature-libraries/flex-map-tree/index.js.map +1 -1
  783. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +57 -51
  784. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  785. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +172 -180
  786. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  787. package/lib/feature-libraries/flex-tree/context.d.ts +0 -1
  788. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  789. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  790. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +17 -373
  791. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  792. package/lib/feature-libraries/flex-tree/flexTreeTypes.js +0 -33
  793. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  794. package/lib/feature-libraries/flex-tree/index.d.ts +2 -2
  795. package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
  796. package/lib/feature-libraries/flex-tree/index.js +1 -1
  797. package/lib/feature-libraries/flex-tree/index.js.map +1 -1
  798. package/lib/feature-libraries/flex-tree/lazyField.d.ts +9 -27
  799. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  800. package/lib/feature-libraries/flex-tree/lazyField.js +28 -104
  801. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  802. package/lib/feature-libraries/flex-tree/lazyNode.d.ts +3 -18
  803. package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  804. package/lib/feature-libraries/flex-tree/lazyNode.js +5 -126
  805. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  806. package/lib/feature-libraries/flex-tree/treeEvents.d.ts +0 -2
  807. package/lib/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
  808. package/lib/feature-libraries/flex-tree/treeEvents.js.map +1 -1
  809. package/lib/feature-libraries/flex-tree/utilities.d.ts +2 -1
  810. package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  811. package/lib/feature-libraries/flex-tree/utilities.js +4 -0
  812. package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
  813. package/lib/feature-libraries/forest-summary/codec.js +3 -3
  814. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  815. package/lib/feature-libraries/index.d.ts +6 -8
  816. package/lib/feature-libraries/index.d.ts.map +1 -1
  817. package/lib/feature-libraries/index.js +6 -7
  818. package/lib/feature-libraries/index.js.map +1 -1
  819. package/lib/feature-libraries/mapTreeCursor.d.ts +6 -2
  820. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  821. package/lib/feature-libraries/mapTreeCursor.js +7 -0
  822. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  823. package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts +0 -4
  824. package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts.map +1 -1
  825. package/lib/feature-libraries/memoizedIdRangeAllocator.js +0 -1
  826. package/lib/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
  827. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +0 -2
  828. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  829. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +0 -1
  830. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  831. package/lib/feature-libraries/modular-schema/discrepancies.d.ts +18 -0
  832. package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
  833. package/lib/feature-libraries/modular-schema/discrepancies.js +103 -1
  834. package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
  835. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +0 -8
  836. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  837. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js +0 -1
  838. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  839. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +1 -3
  840. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  841. package/lib/feature-libraries/modular-schema/fieldKind.js +1 -2
  842. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  843. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -2
  844. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  845. package/lib/feature-libraries/modular-schema/genericFieldKind.js +56 -83
  846. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  847. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +1 -1
  848. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  849. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +6 -9
  850. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  851. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts +3 -14
  852. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
  853. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.js +4 -1
  854. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  855. package/lib/feature-libraries/modular-schema/index.d.ts +2 -2
  856. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  857. package/lib/feature-libraries/modular-schema/index.js +1 -1
  858. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  859. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  860. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +42 -25
  861. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  862. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +9 -8
  863. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  864. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +169 -206
  865. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  866. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +8 -14
  867. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  868. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  869. package/lib/feature-libraries/node-key/nodeKey.d.ts +0 -4
  870. package/lib/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
  871. package/lib/feature-libraries/node-key/nodeKey.js +0 -2
  872. package/lib/feature-libraries/node-key/nodeKey.js.map +1 -1
  873. package/lib/feature-libraries/node-key/nodeKeyManager.d.ts +0 -1
  874. package/lib/feature-libraries/node-key/nodeKeyManager.d.ts.map +1 -1
  875. package/lib/feature-libraries/node-key/nodeKeyManager.js.map +1 -1
  876. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  877. package/lib/feature-libraries/object-forest/objectForest.js +2 -11
  878. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  879. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
  880. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  881. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
  882. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  883. package/lib/feature-libraries/schemaBuilderBase.d.ts +2 -28
  884. package/lib/feature-libraries/schemaBuilderBase.d.ts.map +1 -1
  885. package/lib/feature-libraries/schemaBuilderBase.js +2 -28
  886. package/lib/feature-libraries/schemaBuilderBase.js.map +1 -1
  887. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  888. package/lib/feature-libraries/sequence-field/compose.js +25 -22
  889. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  890. package/lib/feature-libraries/sequence-field/formatV2.d.ts +3 -3
  891. package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  892. package/lib/feature-libraries/sequence-field/formatV2.js +3 -3
  893. package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
  894. package/lib/feature-libraries/sequence-field/formatV3.d.ts +195 -0
  895. package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -0
  896. package/lib/feature-libraries/sequence-field/formatV3.js +19 -0
  897. package/lib/feature-libraries/sequence-field/formatV3.js.map +1 -0
  898. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +11 -0
  899. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  900. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  901. package/lib/feature-libraries/sequence-field/index.d.ts +1 -1
  902. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  903. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  904. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  905. package/lib/feature-libraries/sequence-field/invert.js +22 -14
  906. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  907. package/lib/feature-libraries/sequence-field/markQueue.js +2 -2
  908. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  909. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +2 -2
  910. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  911. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  912. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  913. package/lib/feature-libraries/sequence-field/rebase.js +25 -7
  914. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  915. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  916. package/lib/feature-libraries/sequence-field/replaceRevisions.js +16 -3
  917. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  918. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
  919. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +40 -6
  920. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
  921. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -1
  922. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  923. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +55 -11
  924. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  925. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +11 -0
  926. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -0
  927. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +81 -0
  928. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -0
  929. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  930. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js +2 -0
  931. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  932. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  933. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +5 -2
  934. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  935. package/lib/feature-libraries/sequence-field/types.d.ts +23 -4
  936. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  937. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  938. package/lib/feature-libraries/sequence-field/utils.d.ts +5 -4
  939. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  940. package/lib/feature-libraries/sequence-field/utils.js +67 -41
  941. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  942. package/lib/feature-libraries/storedToViewSchema.d.ts +0 -1
  943. package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  944. package/lib/feature-libraries/storedToViewSchema.js +0 -1
  945. package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
  946. package/lib/feature-libraries/treeCursorUtils.d.ts +0 -6
  947. package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  948. package/lib/feature-libraries/treeCursorUtils.js +9 -7
  949. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  950. package/lib/feature-libraries/treeTextCursor.d.ts +0 -2
  951. package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
  952. package/lib/feature-libraries/treeTextCursor.js +0 -2
  953. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  954. package/lib/feature-libraries/typed-schema/flexList.d.ts +0 -3
  955. package/lib/feature-libraries/typed-schema/flexList.d.ts.map +1 -1
  956. package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
  957. package/lib/feature-libraries/typed-schema/index.d.ts +1 -1
  958. package/lib/feature-libraries/typed-schema/index.d.ts.map +1 -1
  959. package/lib/feature-libraries/typed-schema/index.js +1 -1
  960. package/lib/feature-libraries/typed-schema/index.js.map +1 -1
  961. package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  962. package/lib/feature-libraries/typed-schema/schemaCollection.js +1 -5
  963. package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  964. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +2 -41
  965. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  966. package/lib/feature-libraries/typed-schema/typedTreeSchema.js +1 -38
  967. package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  968. package/lib/feature-libraries/typed-schema/view.d.ts +0 -1
  969. package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
  970. package/lib/feature-libraries/typed-schema/view.js.map +1 -1
  971. package/lib/index.d.ts +8 -9
  972. package/lib/index.d.ts.map +1 -1
  973. package/lib/index.js +8 -9
  974. package/lib/index.js.map +1 -1
  975. package/lib/internalTypes.d.ts +1 -1
  976. package/lib/internalTypes.d.ts.map +1 -1
  977. package/lib/internalTypes.js.map +1 -1
  978. package/lib/packageVersion.d.ts +1 -1
  979. package/lib/packageVersion.d.ts.map +1 -1
  980. package/lib/packageVersion.js +1 -1
  981. package/lib/packageVersion.js.map +1 -1
  982. package/lib/public.d.ts +4 -1
  983. package/lib/shared-tree/schematizeTree.d.ts +2 -11
  984. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  985. package/lib/shared-tree/schematizeTree.js +15 -4
  986. package/lib/shared-tree/schematizeTree.js.map +1 -1
  987. package/lib/shared-tree/schematizingTreeView.d.ts +4 -4
  988. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  989. package/lib/shared-tree/schematizingTreeView.js +3 -3
  990. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  991. package/lib/shared-tree/sharedTree.d.ts +4 -17
  992. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  993. package/lib/shared-tree/sharedTree.js +6 -10
  994. package/lib/shared-tree/sharedTree.js.map +1 -1
  995. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  996. package/lib/shared-tree/sharedTreeChangeCodecs.js +4 -0
  997. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  998. package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
  999. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  1000. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +0 -2
  1001. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  1002. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  1003. package/lib/shared-tree/treeApi.js +3 -3
  1004. package/lib/shared-tree/treeApi.js.map +1 -1
  1005. package/lib/shared-tree/treeCheckout.d.ts +0 -5
  1006. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  1007. package/lib/shared-tree/treeCheckout.js +6 -4
  1008. package/lib/shared-tree/treeCheckout.js.map +1 -1
  1009. package/lib/shared-tree/treeView.d.ts +3 -6
  1010. package/lib/shared-tree/treeView.d.ts.map +1 -1
  1011. package/lib/shared-tree/treeView.js.map +1 -1
  1012. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  1013. package/lib/shared-tree-core/branch.js +12 -7
  1014. package/lib/shared-tree-core/branch.js.map +1 -1
  1015. package/lib/shared-tree-core/defaultResubmitMachine.js +4 -4
  1016. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  1017. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  1018. package/lib/shared-tree-core/editManagerCodecs.js +1 -0
  1019. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  1020. package/lib/shared-tree-core/editManagerFormat.d.ts +2 -2
  1021. package/lib/shared-tree-core/editManagerFormat.d.ts.map +1 -1
  1022. package/lib/shared-tree-core/editManagerFormat.js +6 -1
  1023. package/lib/shared-tree-core/editManagerFormat.js.map +1 -1
  1024. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  1025. package/lib/shared-tree-core/messageCodecs.js +1 -0
  1026. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  1027. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  1028. package/lib/shared-tree-core/sharedTreeCore.js +4 -2
  1029. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  1030. package/lib/simple-tree/api/create.d.ts +54 -0
  1031. package/lib/simple-tree/api/create.d.ts.map +1 -0
  1032. package/lib/simple-tree/api/create.js +92 -0
  1033. package/lib/simple-tree/api/create.js.map +1 -0
  1034. package/lib/simple-tree/api/index.d.ts +12 -0
  1035. package/lib/simple-tree/api/index.d.ts.map +1 -0
  1036. package/lib/simple-tree/api/index.js +13 -0
  1037. package/lib/simple-tree/api/index.js.map +1 -0
  1038. package/{dist/simple-tree → lib/simple-tree/api}/schemaCreationUtilities.d.ts +7 -4
  1039. package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -0
  1040. package/lib/simple-tree/{schemaCreationUtilities.js → api/schemaCreationUtilities.js} +1 -1
  1041. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -0
  1042. package/lib/simple-tree/{schemaFactory.d.ts → api/schemaFactory.d.ts} +15 -14
  1043. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -0
  1044. package/lib/simple-tree/{schemaFactory.js → api/schemaFactory.js} +9 -8
  1045. package/lib/simple-tree/api/schemaFactory.js.map +1 -0
  1046. package/{dist/simple-tree → lib/simple-tree/api}/schemaFactoryRecursive.d.ts +40 -7
  1047. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -0
  1048. package/lib/simple-tree/{schemaFactoryRecursive.js → api/schemaFactoryRecursive.js} +1 -1
  1049. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -0
  1050. package/lib/simple-tree/api/testRecursiveDomain.d.ts +62 -0
  1051. package/lib/simple-tree/api/testRecursiveDomain.d.ts.map +1 -0
  1052. package/lib/simple-tree/api/testRecursiveDomain.js.map +1 -0
  1053. package/{dist/simple-tree → lib/simple-tree/api}/tree.d.ts +111 -20
  1054. package/lib/simple-tree/api/tree.d.ts.map +1 -0
  1055. package/lib/simple-tree/api/tree.js +165 -0
  1056. package/lib/simple-tree/api/tree.js.map +1 -0
  1057. package/lib/simple-tree/{treeNodeApi.d.ts → api/treeNodeApi.d.ts} +7 -6
  1058. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -0
  1059. package/lib/simple-tree/{treeNodeApi.js → api/treeNodeApi.js} +55 -19
  1060. package/lib/simple-tree/api/treeNodeApi.js.map +1 -0
  1061. package/lib/simple-tree/api/verboseTree.d.ts +136 -0
  1062. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -0
  1063. package/lib/simple-tree/api/verboseTree.js +213 -0
  1064. package/lib/simple-tree/api/verboseTree.js.map +1 -0
  1065. package/lib/simple-tree/arrayNode.d.ts +3 -3
  1066. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  1067. package/lib/simple-tree/arrayNode.js +59 -70
  1068. package/lib/simple-tree/arrayNode.js.map +1 -1
  1069. package/lib/simple-tree/core/index.d.ts +10 -0
  1070. package/lib/simple-tree/core/index.d.ts.map +1 -0
  1071. package/lib/simple-tree/core/index.js +10 -0
  1072. package/lib/simple-tree/core/index.js.map +1 -0
  1073. package/{dist/simple-tree → lib/simple-tree/core}/schemaCaching.d.ts +2 -9
  1074. package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -0
  1075. package/lib/simple-tree/{schemaCaching.js → core/schemaCaching.js} +1 -21
  1076. package/lib/simple-tree/core/schemaCaching.js.map +1 -0
  1077. package/lib/simple-tree/core/treeNodeKernel.d.ts +70 -0
  1078. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -0
  1079. package/lib/simple-tree/core/treeNodeKernel.js +157 -0
  1080. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -0
  1081. package/lib/simple-tree/core/treeNodeSchema.d.ts +149 -0
  1082. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -0
  1083. package/lib/simple-tree/core/treeNodeSchema.js +32 -0
  1084. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -0
  1085. package/{dist/simple-tree → lib/simple-tree/core}/types.d.ts +50 -79
  1086. package/lib/simple-tree/core/types.d.ts.map +1 -0
  1087. package/lib/simple-tree/core/types.js +111 -0
  1088. package/lib/simple-tree/core/types.js.map +1 -0
  1089. package/lib/simple-tree/core/withType.d.ts +82 -0
  1090. package/lib/simple-tree/core/withType.d.ts.map +1 -0
  1091. package/lib/simple-tree/core/withType.js +36 -0
  1092. package/lib/simple-tree/core/withType.js.map +1 -0
  1093. package/lib/simple-tree/getJsonSchema.d.ts +55 -0
  1094. package/lib/simple-tree/getJsonSchema.d.ts.map +1 -0
  1095. package/lib/simple-tree/getJsonSchema.js +65 -0
  1096. package/lib/simple-tree/getJsonSchema.js.map +1 -0
  1097. package/lib/simple-tree/getSimpleFieldSchema.d.ts +14 -0
  1098. package/lib/simple-tree/getSimpleFieldSchema.d.ts.map +1 -0
  1099. package/lib/simple-tree/getSimpleFieldSchema.js +25 -0
  1100. package/lib/simple-tree/getSimpleFieldSchema.js.map +1 -0
  1101. package/lib/simple-tree/getSimpleSchema.d.ts +58 -0
  1102. package/lib/simple-tree/getSimpleSchema.d.ts.map +1 -0
  1103. package/lib/simple-tree/getSimpleSchema.js +64 -0
  1104. package/lib/simple-tree/getSimpleSchema.js.map +1 -0
  1105. package/lib/simple-tree/index.d.ts +12 -13
  1106. package/lib/simple-tree/index.d.ts.map +1 -1
  1107. package/lib/simple-tree/index.js +8 -11
  1108. package/lib/simple-tree/index.js.map +1 -1
  1109. package/lib/simple-tree/jsonSchema.d.ts +206 -0
  1110. package/lib/simple-tree/jsonSchema.d.ts.map +1 -0
  1111. package/lib/simple-tree/{nodeKeys.js → jsonSchema.js} +1 -1
  1112. package/lib/simple-tree/jsonSchema.js.map +1 -0
  1113. package/lib/simple-tree/leafNodeSchema.d.ts +1 -1
  1114. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  1115. package/lib/simple-tree/leafNodeSchema.js +1 -2
  1116. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  1117. package/lib/simple-tree/mapNode.d.ts +9 -3
  1118. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  1119. package/lib/simple-tree/mapNode.js +36 -36
  1120. package/lib/simple-tree/mapNode.js.map +1 -1
  1121. package/lib/simple-tree/objectNode.d.ts +18 -16
  1122. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  1123. package/lib/simple-tree/objectNode.js +36 -34
  1124. package/lib/simple-tree/objectNode.js.map +1 -1
  1125. package/lib/simple-tree/objectNodeTypes.d.ts +38 -0
  1126. package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -0
  1127. package/lib/simple-tree/objectNodeTypes.js +15 -0
  1128. package/lib/simple-tree/objectNodeTypes.js.map +1 -0
  1129. package/lib/simple-tree/proxies.d.ts +6 -25
  1130. package/lib/simple-tree/proxies.d.ts.map +1 -1
  1131. package/lib/simple-tree/proxies.js +46 -57
  1132. package/lib/simple-tree/proxies.js.map +1 -1
  1133. package/lib/simple-tree/proxyBinding.d.ts +45 -22
  1134. package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
  1135. package/lib/simple-tree/proxyBinding.js +89 -52
  1136. package/lib/simple-tree/proxyBinding.js.map +1 -1
  1137. package/lib/simple-tree/schemaTypes.d.ts +10 -159
  1138. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  1139. package/lib/simple-tree/schemaTypes.js +9 -41
  1140. package/lib/simple-tree/schemaTypes.js.map +1 -1
  1141. package/lib/simple-tree/simpleSchema.d.ts +124 -0
  1142. package/lib/simple-tree/simpleSchema.d.ts.map +1 -0
  1143. package/lib/{feature-libraries/schema-aware/schemaAware.js → simple-tree/simpleSchema.js} +1 -1
  1144. package/lib/simple-tree/simpleSchema.js.map +1 -0
  1145. package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts +12 -0
  1146. package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts.map +1 -0
  1147. package/lib/simple-tree/simpleSchemaToJsonSchema.js +142 -0
  1148. package/lib/simple-tree/simpleSchemaToJsonSchema.js.map +1 -0
  1149. package/lib/simple-tree/toFlexSchema.d.ts +4 -12
  1150. package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
  1151. package/lib/simple-tree/toFlexSchema.js +9 -18
  1152. package/lib/simple-tree/toFlexSchema.js.map +1 -1
  1153. package/lib/simple-tree/toMapTree.d.ts +39 -39
  1154. package/lib/simple-tree/toMapTree.d.ts.map +1 -1
  1155. package/lib/simple-tree/toMapTree.js +214 -158
  1156. package/lib/simple-tree/toMapTree.js.map +1 -1
  1157. package/lib/simple-tree/treeNodeValid.d.ts +74 -0
  1158. package/lib/simple-tree/treeNodeValid.d.ts.map +1 -0
  1159. package/lib/simple-tree/{types.js → treeNodeValid.js} +8 -98
  1160. package/lib/simple-tree/treeNodeValid.js.map +1 -0
  1161. package/lib/simple-tree/typesUnsafe.d.ts +35 -4
  1162. package/lib/simple-tree/typesUnsafe.d.ts.map +1 -1
  1163. package/lib/simple-tree/typesUnsafe.js.map +1 -1
  1164. package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts +11 -0
  1165. package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts.map +1 -0
  1166. package/lib/simple-tree/viewSchemaToSimpleSchema.js +167 -0
  1167. package/lib/simple-tree/viewSchemaToSimpleSchema.js.map +1 -0
  1168. package/lib/util/brand.d.ts +0 -3
  1169. package/lib/util/brand.d.ts.map +1 -1
  1170. package/lib/util/brand.js +1 -2
  1171. package/lib/util/brand.js.map +1 -1
  1172. package/lib/util/brandedMap.d.ts +0 -5
  1173. package/lib/util/brandedMap.d.ts.map +1 -1
  1174. package/lib/util/brandedMap.js +0 -1
  1175. package/lib/util/brandedMap.js.map +1 -1
  1176. package/lib/util/idAllocator.d.ts +0 -2
  1177. package/lib/util/idAllocator.d.ts.map +1 -1
  1178. package/lib/util/idAllocator.js +0 -1
  1179. package/lib/util/idAllocator.js.map +1 -1
  1180. package/lib/util/index.d.ts +2 -2
  1181. package/lib/util/index.d.ts.map +1 -1
  1182. package/lib/util/index.js +2 -2
  1183. package/lib/util/index.js.map +1 -1
  1184. package/lib/util/nestedMap.d.ts +5 -19
  1185. package/lib/util/nestedMap.d.ts.map +1 -1
  1186. package/lib/util/nestedMap.js +15 -16
  1187. package/lib/util/nestedMap.js.map +1 -1
  1188. package/lib/util/opaque.d.ts +0 -4
  1189. package/lib/util/opaque.d.ts.map +1 -1
  1190. package/lib/util/opaque.js +0 -2
  1191. package/lib/util/opaque.js.map +1 -1
  1192. package/lib/util/rangeMap.d.ts +0 -2
  1193. package/lib/util/rangeMap.d.ts.map +1 -1
  1194. package/lib/util/rangeMap.js +4 -3
  1195. package/lib/util/rangeMap.js.map +1 -1
  1196. package/lib/util/transactionResult.d.ts +0 -1
  1197. package/lib/util/transactionResult.d.ts.map +1 -1
  1198. package/lib/util/transactionResult.js +0 -1
  1199. package/lib/util/transactionResult.js.map +1 -1
  1200. package/lib/util/typeCheck.d.ts +2 -20
  1201. package/lib/util/typeCheck.d.ts.map +1 -1
  1202. package/lib/util/typeCheck.js.map +1 -1
  1203. package/lib/util/typeCheckTests.d.ts +4 -4
  1204. package/lib/util/typeCheckTests.d.ts.map +1 -1
  1205. package/lib/util/typeCheckTests.js.map +1 -1
  1206. package/lib/util/typeUtils.d.ts +0 -7
  1207. package/lib/util/typeUtils.d.ts.map +1 -1
  1208. package/lib/util/typeUtils.js.map +1 -1
  1209. package/lib/util/utils.d.ts +6 -8
  1210. package/lib/util/utils.d.ts.map +1 -1
  1211. package/lib/util/utils.js +12 -4
  1212. package/lib/util/utils.js.map +1 -1
  1213. package/package.json +25 -24
  1214. package/src/codec/discriminatedUnions.ts +20 -10
  1215. package/src/codec/index.ts +5 -1
  1216. package/src/core/forest/README.md +4 -2
  1217. package/src/core/forest/editableForest.ts +1 -6
  1218. package/src/core/forest/forest.ts +0 -6
  1219. package/src/core/index.ts +2 -2
  1220. package/src/core/rebase/changeRebaser.ts +0 -4
  1221. package/src/core/rebase/index.ts +0 -2
  1222. package/src/core/rebase/types.ts +1 -23
  1223. package/src/core/rebase/utils.ts +13 -11
  1224. package/src/core/schema-stored/multiplicity.ts +0 -1
  1225. package/src/core/schema-stored/schema.ts +0 -7
  1226. package/src/core/schema-stored/storedSchemaRepository.ts +0 -3
  1227. package/src/core/schema-view/view.ts +0 -3
  1228. package/src/core/tree/anchorSet.ts +27 -26
  1229. package/src/core/tree/cursor.ts +1 -6
  1230. package/src/core/tree/delta.ts +0 -11
  1231. package/src/core/tree/detachedFieldIndexCodec.ts +4 -3
  1232. package/src/core/tree/detachedFieldIndexTypes.ts +0 -1
  1233. package/src/core/tree/index.ts +1 -1
  1234. package/src/core/tree/mapTree.ts +45 -4
  1235. package/src/core/tree/pathTree.ts +0 -11
  1236. package/src/core/tree/treeTextFormat.ts +3 -2
  1237. package/src/core/tree/types.ts +0 -11
  1238. package/src/core/tree/visitDelta.ts +2 -3
  1239. package/src/core/tree/visitPath.ts +0 -2
  1240. package/src/core/tree/visitorUtils.ts +0 -1
  1241. package/src/domains/index.ts +3 -0
  1242. package/src/domains/json/index.ts +7 -1
  1243. package/src/domains/json/jsonCursor.ts +113 -6
  1244. package/src/domains/json/jsonDomainSchema.ts +4 -5
  1245. package/src/domains/leafDomain.ts +0 -1
  1246. package/src/domains/schemaBuilder.ts +0 -22
  1247. package/src/events/events.ts +10 -6
  1248. package/src/feature-libraries/chunked-forest/README.md +9 -1
  1249. package/src/feature-libraries/chunked-forest/basicChunk.ts +14 -9
  1250. package/src/feature-libraries/chunked-forest/chunk.ts +1 -1
  1251. package/src/feature-libraries/chunked-forest/chunkTree.ts +4 -4
  1252. package/src/feature-libraries/chunked-forest/chunkedForest.ts +8 -6
  1253. package/src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts +2 -2
  1254. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +9 -6
  1255. package/src/feature-libraries/chunked-forest/uniformChunk.ts +6 -4
  1256. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +18 -46
  1257. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +11 -6
  1258. package/src/feature-libraries/default-schema/defaultSchema.ts +0 -1
  1259. package/src/feature-libraries/default-schema/index.ts +1 -1
  1260. package/src/feature-libraries/default-schema/schemaChecker.ts +6 -0
  1261. package/src/feature-libraries/editableTreeBinder.ts +6 -78
  1262. package/src/feature-libraries/fieldGenerator.ts +0 -3
  1263. package/src/feature-libraries/flex-map-tree/index.ts +2 -1
  1264. package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +238 -288
  1265. package/src/feature-libraries/flex-tree/context.ts +0 -1
  1266. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +27 -524
  1267. package/src/feature-libraries/flex-tree/index.ts +1 -18
  1268. package/src/feature-libraries/flex-tree/lazyField.ts +38 -214
  1269. package/src/feature-libraries/flex-tree/lazyNode.ts +3 -215
  1270. package/src/feature-libraries/flex-tree/treeEvents.ts +0 -2
  1271. package/src/feature-libraries/flex-tree/utilities.ts +6 -1
  1272. package/src/feature-libraries/forest-summary/codec.ts +3 -3
  1273. package/src/feature-libraries/index.ts +5 -49
  1274. package/src/feature-libraries/mapTreeCursor.ts +13 -4
  1275. package/src/feature-libraries/memoizedIdRangeAllocator.ts +0 -4
  1276. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +0 -2
  1277. package/src/feature-libraries/modular-schema/discrepancies.ts +117 -1
  1278. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +0 -8
  1279. package/src/feature-libraries/modular-schema/fieldKind.ts +1 -3
  1280. package/src/feature-libraries/modular-schema/genericFieldKind.ts +69 -92
  1281. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +7 -14
  1282. package/src/feature-libraries/modular-schema/genericFieldKindTypes.ts +6 -15
  1283. package/src/feature-libraries/modular-schema/index.ts +2 -2
  1284. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +68 -34
  1285. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +330 -336
  1286. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +7 -14
  1287. package/src/feature-libraries/node-key/nodeKey.ts +0 -4
  1288. package/src/feature-libraries/node-key/nodeKeyManager.ts +0 -1
  1289. package/src/feature-libraries/object-forest/objectForest.ts +1 -13
  1290. package/src/feature-libraries/schemaBuilderBase.ts +1 -49
  1291. package/src/feature-libraries/sequence-field/compose.ts +41 -20
  1292. package/src/feature-libraries/sequence-field/formatV2.ts +3 -3
  1293. package/src/feature-libraries/sequence-field/formatV3.ts +65 -0
  1294. package/src/feature-libraries/sequence-field/helperTypes.ts +33 -0
  1295. package/src/feature-libraries/sequence-field/index.ts +1 -0
  1296. package/src/feature-libraries/sequence-field/invert.ts +28 -18
  1297. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1298. package/src/feature-libraries/sequence-field/moveEffectTable.ts +2 -2
  1299. package/src/feature-libraries/sequence-field/rebase.ts +30 -13
  1300. package/src/feature-libraries/sequence-field/replaceRevisions.ts +27 -3
  1301. package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +52 -7
  1302. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +92 -19
  1303. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +134 -0
  1304. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +2 -0
  1305. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +8 -2
  1306. package/src/feature-libraries/sequence-field/types.ts +24 -4
  1307. package/src/feature-libraries/sequence-field/utils.ts +78 -50
  1308. package/src/feature-libraries/storedToViewSchema.ts +0 -1
  1309. package/src/feature-libraries/treeCursorUtils.ts +11 -11
  1310. package/src/feature-libraries/treeTextCursor.ts +0 -2
  1311. package/src/feature-libraries/typed-schema/flexList.ts +0 -3
  1312. package/src/feature-libraries/typed-schema/index.ts +0 -2
  1313. package/src/feature-libraries/typed-schema/schemaCollection.ts +0 -5
  1314. package/src/feature-libraries/typed-schema/typedTreeSchema.ts +2 -68
  1315. package/src/feature-libraries/typed-schema/view.ts +0 -1
  1316. package/src/index.ts +32 -242
  1317. package/src/internalTypes.ts +1 -0
  1318. package/src/packageVersion.ts +1 -1
  1319. package/src/shared-tree/schematizeTree.ts +25 -21
  1320. package/src/shared-tree/schematizingTreeView.ts +6 -6
  1321. package/src/shared-tree/sharedTree.ts +8 -39
  1322. package/src/shared-tree/sharedTreeChangeCodecs.ts +8 -0
  1323. package/src/shared-tree/sharedTreeChangeFamily.ts +3 -3
  1324. package/src/shared-tree/sharedTreeEditBuilder.ts +0 -2
  1325. package/src/shared-tree/treeApi.ts +3 -3
  1326. package/src/shared-tree/treeCheckout.ts +6 -8
  1327. package/src/shared-tree/treeView.ts +3 -6
  1328. package/src/shared-tree-core/branch.ts +20 -8
  1329. package/src/shared-tree-core/defaultResubmitMachine.ts +4 -4
  1330. package/src/shared-tree-core/editManagerCodecs.ts +1 -0
  1331. package/src/shared-tree-core/editManagerFormat.ts +7 -2
  1332. package/src/shared-tree-core/messageCodecs.ts +2 -1
  1333. package/src/shared-tree-core/sharedTreeCore.ts +5 -3
  1334. package/src/simple-tree/ProxyBinding.md +2 -0
  1335. package/src/simple-tree/api/README.md +7 -0
  1336. package/src/simple-tree/api/create.ts +179 -0
  1337. package/src/simple-tree/api/index.ts +36 -0
  1338. package/src/simple-tree/{schemaCreationUtilities.ts → api/schemaCreationUtilities.ts} +13 -5
  1339. package/src/simple-tree/{schemaFactory.ts → api/schemaFactory.ts} +36 -34
  1340. package/src/simple-tree/{schemaFactoryRecursive.ts → api/schemaFactoryRecursive.ts} +47 -10
  1341. package/src/simple-tree/{testRecursiveDomain.ts → api/testRecursiveDomain.ts} +3 -1
  1342. package/src/simple-tree/{tree.ts → api/tree.ts} +246 -34
  1343. package/src/simple-tree/{treeNodeApi.ts → api/treeNodeApi.ts} +84 -41
  1344. package/src/simple-tree/api/verboseTree.ts +415 -0
  1345. package/src/simple-tree/arrayNode.ts +103 -110
  1346. package/src/simple-tree/core/README.md +11 -0
  1347. package/src/simple-tree/core/index.ts +34 -0
  1348. package/src/simple-tree/{schemaCaching.ts → core/schemaCaching.ts} +3 -37
  1349. package/src/simple-tree/core/treeNodeKernel.ts +200 -0
  1350. package/src/simple-tree/core/treeNodeSchema.ts +184 -0
  1351. package/src/simple-tree/core/types.ts +281 -0
  1352. package/src/simple-tree/core/withType.ts +89 -0
  1353. package/src/simple-tree/getJsonSchema.ts +70 -0
  1354. package/src/simple-tree/getSimpleFieldSchema.ts +36 -0
  1355. package/src/simple-tree/getSimpleSchema.ts +69 -0
  1356. package/src/simple-tree/index.ts +59 -33
  1357. package/src/simple-tree/jsonSchema.ts +230 -0
  1358. package/src/simple-tree/leafNodeSchema.ts +6 -3
  1359. package/src/simple-tree/mapNode.ts +56 -55
  1360. package/src/simple-tree/objectNode.ts +66 -90
  1361. package/src/simple-tree/objectNodeTypes.ts +68 -0
  1362. package/src/simple-tree/proxies.ts +52 -68
  1363. package/src/simple-tree/proxyBinding.ts +127 -72
  1364. package/src/simple-tree/schemaTypes.ts +29 -194
  1365. package/src/simple-tree/simpleSchema.ts +138 -0
  1366. package/src/simple-tree/simpleSchemaToJsonSchema.ts +178 -0
  1367. package/src/simple-tree/toFlexSchema.ts +9 -42
  1368. package/src/simple-tree/toMapTree.ts +270 -296
  1369. package/src/simple-tree/{types.ts → treeNodeValid.ts} +16 -232
  1370. package/src/simple-tree/typesUnsafe.ts +51 -5
  1371. package/src/simple-tree/viewSchemaToSimpleSchema.ts +209 -0
  1372. package/src/util/brand.ts +1 -4
  1373. package/src/util/brandedMap.ts +0 -5
  1374. package/src/util/idAllocator.ts +0 -2
  1375. package/src/util/index.ts +2 -0
  1376. package/src/util/nestedMap.ts +23 -20
  1377. package/src/util/opaque.ts +0 -4
  1378. package/src/util/rangeMap.ts +5 -5
  1379. package/src/util/transactionResult.ts +0 -1
  1380. package/src/util/typeCheck.ts +2 -20
  1381. package/src/util/typeCheckTests.ts +4 -4
  1382. package/src/util/typeUtils.ts +0 -7
  1383. package/src/util/utils.ts +13 -8
  1384. package/tsconfig.json +0 -1
  1385. package/dist/feature-libraries/contextuallyTyped.d.ts +0 -209
  1386. package/dist/feature-libraries/contextuallyTyped.d.ts.map +0 -1
  1387. package/dist/feature-libraries/contextuallyTyped.js +0 -328
  1388. package/dist/feature-libraries/contextuallyTyped.js.map +0 -1
  1389. package/dist/feature-libraries/schema-aware/index.d.ts +0 -6
  1390. package/dist/feature-libraries/schema-aware/index.d.ts.map +0 -1
  1391. package/dist/feature-libraries/schema-aware/index.js.map +0 -1
  1392. package/dist/feature-libraries/schema-aware/schemaAware.d.ts +0 -76
  1393. package/dist/feature-libraries/schema-aware/schemaAware.d.ts.map +0 -1
  1394. package/dist/feature-libraries/schema-aware/schemaAware.js.map +0 -1
  1395. package/dist/simple-tree/nodeKeys.d.ts +0 -41
  1396. package/dist/simple-tree/nodeKeys.d.ts.map +0 -1
  1397. package/dist/simple-tree/nodeKeys.js +0 -7
  1398. package/dist/simple-tree/nodeKeys.js.map +0 -1
  1399. package/dist/simple-tree/schemaCaching.d.ts.map +0 -1
  1400. package/dist/simple-tree/schemaCaching.js.map +0 -1
  1401. package/dist/simple-tree/schemaCreationUtilities.d.ts.map +0 -1
  1402. package/dist/simple-tree/schemaCreationUtilities.js.map +0 -1
  1403. package/dist/simple-tree/schemaFactory.d.ts.map +0 -1
  1404. package/dist/simple-tree/schemaFactory.js.map +0 -1
  1405. package/dist/simple-tree/schemaFactoryRecursive.d.ts.map +0 -1
  1406. package/dist/simple-tree/schemaFactoryRecursive.js.map +0 -1
  1407. package/dist/simple-tree/testRecursiveDomain.d.ts +0 -61
  1408. package/dist/simple-tree/testRecursiveDomain.d.ts.map +0 -1
  1409. package/dist/simple-tree/testRecursiveDomain.js.map +0 -1
  1410. package/dist/simple-tree/tree.d.ts.map +0 -1
  1411. package/dist/simple-tree/tree.js +0 -73
  1412. package/dist/simple-tree/tree.js.map +0 -1
  1413. package/dist/simple-tree/treeNodeApi.d.ts.map +0 -1
  1414. package/dist/simple-tree/treeNodeApi.js.map +0 -1
  1415. package/dist/simple-tree/treeNodeKernel.d.ts +0 -26
  1416. package/dist/simple-tree/treeNodeKernel.d.ts.map +0 -1
  1417. package/dist/simple-tree/treeNodeKernel.js +0 -83
  1418. package/dist/simple-tree/treeNodeKernel.js.map +0 -1
  1419. package/dist/simple-tree/types.d.ts.map +0 -1
  1420. package/dist/simple-tree/types.js.map +0 -1
  1421. package/lib/feature-libraries/contextuallyTyped.d.ts +0 -209
  1422. package/lib/feature-libraries/contextuallyTyped.d.ts.map +0 -1
  1423. package/lib/feature-libraries/contextuallyTyped.js +0 -311
  1424. package/lib/feature-libraries/contextuallyTyped.js.map +0 -1
  1425. package/lib/feature-libraries/schema-aware/index.d.ts +0 -6
  1426. package/lib/feature-libraries/schema-aware/index.d.ts.map +0 -1
  1427. package/lib/feature-libraries/schema-aware/index.js +0 -6
  1428. package/lib/feature-libraries/schema-aware/index.js.map +0 -1
  1429. package/lib/feature-libraries/schema-aware/schemaAware.d.ts +0 -76
  1430. package/lib/feature-libraries/schema-aware/schemaAware.d.ts.map +0 -1
  1431. package/lib/feature-libraries/schema-aware/schemaAware.js.map +0 -1
  1432. package/lib/simple-tree/nodeKeys.d.ts +0 -41
  1433. package/lib/simple-tree/nodeKeys.d.ts.map +0 -1
  1434. package/lib/simple-tree/nodeKeys.js.map +0 -1
  1435. package/lib/simple-tree/schemaCaching.d.ts.map +0 -1
  1436. package/lib/simple-tree/schemaCaching.js.map +0 -1
  1437. package/lib/simple-tree/schemaCreationUtilities.d.ts.map +0 -1
  1438. package/lib/simple-tree/schemaCreationUtilities.js.map +0 -1
  1439. package/lib/simple-tree/schemaFactory.d.ts.map +0 -1
  1440. package/lib/simple-tree/schemaFactory.js.map +0 -1
  1441. package/lib/simple-tree/schemaFactoryRecursive.d.ts.map +0 -1
  1442. package/lib/simple-tree/schemaFactoryRecursive.js.map +0 -1
  1443. package/lib/simple-tree/testRecursiveDomain.d.ts +0 -61
  1444. package/lib/simple-tree/testRecursiveDomain.d.ts.map +0 -1
  1445. package/lib/simple-tree/testRecursiveDomain.js.map +0 -1
  1446. package/lib/simple-tree/tree.d.ts.map +0 -1
  1447. package/lib/simple-tree/tree.js +0 -66
  1448. package/lib/simple-tree/tree.js.map +0 -1
  1449. package/lib/simple-tree/treeNodeApi.d.ts.map +0 -1
  1450. package/lib/simple-tree/treeNodeApi.js.map +0 -1
  1451. package/lib/simple-tree/treeNodeKernel.d.ts +0 -26
  1452. package/lib/simple-tree/treeNodeKernel.d.ts.map +0 -1
  1453. package/lib/simple-tree/treeNodeKernel.js +0 -79
  1454. package/lib/simple-tree/treeNodeKernel.js.map +0 -1
  1455. package/lib/simple-tree/types.d.ts.map +0 -1
  1456. package/lib/simple-tree/types.js.map +0 -1
  1457. package/src/feature-libraries/contextuallyTyped.ts +0 -582
  1458. package/src/feature-libraries/schema-aware/README.md +0 -19
  1459. package/src/feature-libraries/schema-aware/index.ts +0 -16
  1460. package/src/feature-libraries/schema-aware/schemaAware.ts +0 -135
  1461. package/src/simple-tree/nodeKeys.ts +0 -42
  1462. package/src/simple-tree/treeNodeKernel.ts +0 -91
  1463. /package/dist/simple-tree/{testRecursiveDomain.js → api/testRecursiveDomain.js} +0 -0
  1464. /package/lib/simple-tree/{testRecursiveDomain.js → api/testRecursiveDomain.js} +0 -0
@@ -1,328 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.normalizeNewFieldContent = exports.applyFieldTypesFromContext = exports.applyTypesFromContext = exports.cursorsForTypedFieldData = exports.cursorsFromContextualData = exports.cursorForTypedData = exports.cursorForTypedTreeData = exports.cursorFromContextualData = exports.isContextuallyTypedNodeDataObject = exports.isArrayLike = exports.arrayLikeMarkerSymbol = exports.getPossibleTypes = exports.getAllowedTypes = exports.getFieldKind = exports.valueSymbol = exports.typeNameSymbol = exports.areCursors = void 0;
8
- const internal_1 = require("@fluidframework/core-utils/internal");
9
- const index_js_1 = require("../core/index.js");
10
- const index_js_2 = require("../util/index.js");
11
- // TODO:
12
- // This module currently is assuming use of default-field-kinds.
13
- // The field kinds should instead come from a view schema registry thats provided somewhere.
14
- const index_js_3 = require("./default-schema/index.js");
15
- const mapTreeCursor_js_1 = require("./mapTreeCursor.js");
16
- const index_js_4 = require("./typed-schema/index.js");
17
- const valueUtilities_js_1 = require("./valueUtilities.js");
18
- /**
19
- * This library defines a tree data format that can infer its types from context.
20
- * It can only be used when the schema is known.
21
- * The format is optimized for ergonomics when the developer knows the schema,
22
- * and needs to declare or navigate trees.
23
- *
24
- * The format defined here is very tolerant to optimize for flexibility of expressing trees:
25
- * APIs exposing data in this format should likely further constrain what is allowed.
26
- * For example guarantee which fields and nodes should be inlined, and that types will be required everywhere.
27
- *
28
- * This is from Flex tree one which has been deleted and should no longer be used!
29
- */
30
- /**
31
- * Check if NewFieldContent is made of {@link ITreeCursor}s.
32
- *
33
- * Useful when APIs want to take in tree data in multiple formats, including cursors.
34
- */
35
- function areCursors(data) {
36
- if ((0, index_js_1.isCursor)(data)) {
37
- return true;
38
- }
39
- if (Array.isArray(data) && data.length >= 0 && (0, index_js_1.isCursor)(data[0])) {
40
- return true;
41
- }
42
- return false;
43
- }
44
- exports.areCursors = areCursors;
45
- /**
46
- * String which identifies this code.
47
- * Targeted at developers: can be used for symbol strings, or other developer targeted strings,
48
- * like error messages.
49
- */
50
- const scope = "contextuallyTyped";
51
- /**
52
- * A symbol for the name of the type of a tree in contexts where string keys are already in use for fields.
53
- * See {@link TreeNodeSchemaIdentifier}.
54
- * @internal
55
- */
56
- exports.typeNameSymbol = Symbol(`${scope}:typeName`);
57
- /**
58
- * A symbol for the value of a tree node in contexts where string keys are already in use for fields.
59
- * @internal
60
- */
61
- exports.valueSymbol = Symbol(`${scope}:value`);
62
- function getFieldKind(fieldSchema) {
63
- // TODO:
64
- // This module currently is assuming use of defaultFieldKinds.
65
- // The field kinds should instead come from a view schema registry thats provided somewhere.
66
- return index_js_3.fieldKinds.get(fieldSchema.kind.identifier) ?? (0, index_js_2.fail)("missing field kind");
67
- }
68
- exports.getFieldKind = getFieldKind;
69
- /**
70
- * @returns all allowed child types for `typeSet`.
71
- */
72
- function getAllowedTypes(schemaData, typeSet) {
73
- // TODO: Performance: avoid the `Any` case being frequent, possibly with caching in the caller of `getPossibleChildTypes`.
74
- return typeSet === index_js_4.Any ? new Set(schemaData.nodeSchema.values()) : typeSet;
75
- }
76
- exports.getAllowedTypes = getAllowedTypes;
77
- /**
78
- * @returns all types, for which the data is schema-compatible.
79
- */
80
- function getPossibleTypes(context, typeSet, data) {
81
- // All types allowed by schema
82
- const allowedTypes = getAllowedTypes(context, typeSet);
83
- const possibleTypes = [];
84
- for (const allowed of allowedTypes) {
85
- if (shallowCompatibilityTest(allowed, data)) {
86
- possibleTypes.push(allowed);
87
- }
88
- }
89
- return possibleTypes;
90
- }
91
- exports.getPossibleTypes = getPossibleTypes;
92
- /**
93
- * A symbol used to define a {@link MarkedArrayLike} interface.
94
- * @internal
95
- */
96
- exports.arrayLikeMarkerSymbol = Symbol("flex-tree:arrayLikeMarker");
97
- /**
98
- * Checks the type of a `ContextuallyTypedNodeData`.
99
- */
100
- function isArrayLike(data) {
101
- if (typeof data !== "object" || data === null) {
102
- return false;
103
- }
104
- return (data[exports.arrayLikeMarkerSymbol] ===
105
- true || Array.isArray(data));
106
- }
107
- exports.isArrayLike = isArrayLike;
108
- /**
109
- * Checks the type of a `ContextuallyTypedNodeData`.
110
- * @internal
111
- */
112
- function isContextuallyTypedNodeDataObject(data) {
113
- return !((0, valueUtilities_js_1.isTreeValue)(data) || isArrayLike(data));
114
- }
115
- exports.isContextuallyTypedNodeDataObject = isContextuallyTypedNodeDataObject;
116
- /**
117
- * Checks if data might be schema-compatible.
118
- *
119
- * @returns false if `data` is incompatible with `type` based on a cheap/shallow check.
120
- *
121
- * Note that this may return true for cases where data is incompatible, but it must not return false in cases where the data is compatible.
122
- */
123
- function shallowCompatibilityTest(schema, data) {
124
- (0, internal_1.assert)(!areCursors(data), 0x6b1 /* cursors cannot be used as contextually typed data. */);
125
- (0, internal_1.assert)(data !== undefined, 0x6b2 /* undefined cannot be used as contextually typed data. Use ContextuallyTypedFieldData. */);
126
- if (schema instanceof index_js_4.LeafNodeSchema) {
127
- // Reject objects with no value from being leaf nodes.
128
- // Note that if allowing IFluidHandles without wrapping them in a leaf node object,
129
- // this (or the above isPrimitiveValue) would have to change.
130
- if ((0, valueUtilities_js_1.isTreeValue)(data)) {
131
- return (0, valueUtilities_js_1.allowsValue)(schema.leafValue, data);
132
- }
133
- if (data[exports.valueSymbol] === undefined) {
134
- return false;
135
- }
136
- }
137
- if ((0, valueUtilities_js_1.isTreeValue)(data)) {
138
- return false;
139
- }
140
- if (isArrayLike(data)) {
141
- if (schema instanceof index_js_4.FlexFieldNodeSchema) {
142
- const field = schema.getFieldSchema();
143
- return field.kind.multiplicity === index_js_1.Multiplicity.Sequence;
144
- }
145
- else {
146
- return false;
147
- }
148
- }
149
- if (data[exports.typeNameSymbol] !== undefined) {
150
- return data[exports.typeNameSymbol] === schema.name;
151
- }
152
- // For now, consider all not explicitly typed objects shallow compatible.
153
- // This will require explicit differentiation in polymorphic cases rather than automatic structural differentiation.
154
- return true;
155
- }
156
- /**
157
- * Construct a tree from ContextuallyTypedNodeData.
158
- *
159
- * TODO: this should probably be refactored into a `try` function which either returns a Cursor or a SchemaError with a path to the error.
160
- * @returns a cursor in Nodes mode for a single node containing the provided data.
161
- * @internal
162
- */
163
- function cursorFromContextualData(context, typeSet, data) {
164
- const mapTree = applyTypesFromContext(context, typeSet, data);
165
- return (0, mapTreeCursor_js_1.cursorForMapTreeNode)(mapTree);
166
- }
167
- exports.cursorFromContextualData = cursorFromContextualData;
168
- /**
169
- * Strongly typed {@link cursorFromContextualData} for a TreeNodeSchema.
170
- * @returns a cursor in Nodes mode for a single node containing the provided data.
171
- * @internal
172
- */
173
- function cursorForTypedTreeData(context, schema, data) {
174
- return cursorFromContextualData(context, new Set([schema]), data);
175
- }
176
- exports.cursorForTypedTreeData = cursorForTypedTreeData;
177
- /**
178
- * Strongly typed {@link cursorFromContextualData} for AllowedTypes.
179
- * @returns a cursor in Nodes mode for a single node containing the provided data.
180
- * @internal
181
- */
182
- function cursorForTypedData(context, schema, data) {
183
- return cursorFromContextualData(context, (0, index_js_4.allowedTypesSchemaSet)(schema), data);
184
- }
185
- exports.cursorForTypedData = cursorForTypedData;
186
- /**
187
- * Construct a tree from ContextuallyTypedNodeData.
188
- * Returns a cursor in Field mode.
189
- *
190
- * TODO: this should probably be refactored into a `try` function which either returns a Cursor or a SchemaError with a path to the error.
191
- */
192
- function cursorsFromContextualData(context, field, data) {
193
- const mapTrees = applyFieldTypesFromContext(context, field, data);
194
- return (0, mapTreeCursor_js_1.cursorForMapTreeField)(mapTrees);
195
- }
196
- exports.cursorsFromContextualData = cursorsFromContextualData;
197
- /**
198
- * Strongly typed {@link cursorsFromContextualData} for a TreeFieldSchema
199
- * @internal
200
- */
201
- function cursorsForTypedFieldData(context, schema, data) {
202
- return cursorsFromContextualData(context, schema, data);
203
- }
204
- exports.cursorsForTypedFieldData = cursorsForTypedFieldData;
205
- /**
206
- * Construct a MapTree from ContextuallyTypedNodeData.
207
- *
208
- * TODO: this should probably be refactored into a `try` function which either returns a MapTree or a SchemaError with a path to the error.
209
- * TODO: test suite.
210
- *
211
- * @remarks
212
- * This version is only exported as a more testable entry point than `cursorFromContextualData` which keeps the use of `MapTree` as an implementation detail.
213
- * This should not be reexported from the parent module.
214
- */
215
- function applyTypesFromContext(context, typeSet, data) {
216
- const possibleTypes = getPossibleTypes(context.schema, typeSet, data);
217
- (0, internal_1.assert)(possibleTypes.length !== 0, 0x4d4 /* data incompatible with all types allowed by the schema */);
218
- (0, internal_1.assert)(possibleTypes.length === 1, 0x4d5 /* data compatible with more than one type allowed by the schema */);
219
- const schema = possibleTypes[0];
220
- if (schema instanceof index_js_4.LeafNodeSchema) {
221
- const value = (0, valueUtilities_js_1.isTreeValue)(data)
222
- ? data
223
- : data[exports.valueSymbol];
224
- (0, internal_1.assert)((0, valueUtilities_js_1.allowsValue)(schema.leafValue, value), 0x4d3 /* unsupported schema for provided primitive */);
225
- return { value, type: schema.name, fields: new Map() };
226
- }
227
- (0, internal_1.assert)(!(0, valueUtilities_js_1.isTreeValue)(data), 0x880 /* leaf value for non leaf */);
228
- if (schema instanceof index_js_4.FlexFieldNodeSchema) {
229
- if (isArrayLike(data)) {
230
- const children = applyFieldTypesFromContext(context, schema.getFieldSchema(), data);
231
- return {
232
- value: undefined,
233
- type: schema.name,
234
- fields: new Map(children.length > 0 ? [[index_js_1.EmptyKey, children]] : []),
235
- };
236
- }
237
- }
238
- (0, internal_1.assert)(!isArrayLike(data), 0x881 /* array for non field node */);
239
- if (schema instanceof index_js_4.FlexMapNodeSchema ||
240
- schema instanceof index_js_4.FlexObjectNodeSchema ||
241
- schema instanceof index_js_4.FlexFieldNodeSchema) {
242
- const fields = new Map();
243
- for (const key of fieldKeysFromData(data)) {
244
- (0, internal_1.assert)(!fields.has(key), 0x6b3 /* Keys should not be duplicated */);
245
- const childSchema = schema.getFieldSchema(key);
246
- const children = applyFieldTypesFromContext(context, childSchema, data[key]);
247
- if (children.length > 0) {
248
- fields.set(key, children);
249
- }
250
- }
251
- if (schema instanceof index_js_4.FlexObjectNodeSchema) {
252
- for (const key of schema.objectNodeFields.keys()) {
253
- if (data[key] === undefined) {
254
- setFieldForKey(key, context, schema, fields);
255
- }
256
- }
257
- }
258
- const value = data[exports.valueSymbol];
259
- (0, internal_1.assert)(value === undefined, 0x4d7 /* provided value not permitted by the schema */);
260
- return { value, type: schema.name, fields };
261
- }
262
- else {
263
- (0, index_js_2.fail)("unexpected node kind");
264
- }
265
- }
266
- exports.applyTypesFromContext = applyTypesFromContext;
267
- function setFieldForKey(key, context, schema, fields) {
268
- const requiredFieldSchema = schema.getFieldSchema(key);
269
- const multiplicity = getFieldKind(requiredFieldSchema).multiplicity;
270
- if (multiplicity === index_js_1.Multiplicity.Single && context.fieldSource !== undefined) {
271
- const fieldGenerator = context.fieldSource(key, requiredFieldSchema.stored);
272
- if (fieldGenerator !== undefined) {
273
- const children = fieldGenerator();
274
- fields.set(key, children);
275
- }
276
- }
277
- }
278
- function fieldKeysFromData(data) {
279
- const keys = Reflect.ownKeys(data).filter((key) => typeof key === "string");
280
- return keys;
281
- }
282
- /**
283
- * Construct a MapTree from ContextuallyTypedNodeData.
284
- *
285
- * TODO: this should probably be refactored into a `try` function which either returns a MapTree or a SchemaError with a path to the error.
286
- * TODO: test suite.
287
- *
288
- * @remarks
289
- * This version is only exported as a more testable entry point than `cursorsFromContextualData` which keeps the use of `MapTree` as an implementation detail.
290
- * This should not be reexported from the parent module.
291
- */
292
- function applyFieldTypesFromContext(context, field, data) {
293
- const multiplicity = getFieldKind(field).multiplicity;
294
- if (data === undefined) {
295
- (0, internal_1.assert)(multiplicity === index_js_1.Multiplicity.Forbidden || multiplicity === index_js_1.Multiplicity.Optional, 0x4d8 /* `undefined` provided for a field that does not support `undefined` */);
296
- return [];
297
- }
298
- if (multiplicity === index_js_1.Multiplicity.Sequence) {
299
- (0, internal_1.assert)(isArrayLike(data), 0x4d9 /* expected array for a sequence field */);
300
- const children = Array.from(data, (child) => applyTypesFromContext(context, field.allowedTypeSet, child));
301
- return children;
302
- }
303
- (0, internal_1.assert)(multiplicity === index_js_1.Multiplicity.Single || multiplicity === index_js_1.Multiplicity.Optional, 0x4da /* single value provided for an unsupported field */);
304
- return [applyTypesFromContext(context, field.allowedTypeSet, data)];
305
- }
306
- exports.applyFieldTypesFromContext = applyFieldTypesFromContext;
307
- /**
308
- * Convert NewFieldContent into ITreeCursorSynchronous.
309
- * The returned cursor will be in Field mode.
310
- */
311
- function normalizeNewFieldContent(context, schema, content) {
312
- if (areCursors(content)) {
313
- if ((0, index_js_2.isReadonlyArray)(content)) {
314
- (0, internal_1.assert)(getFieldKind(schema).multiplicity === index_js_1.Multiplicity.Sequence || content.length === 1, 0x6b8 /* non-sequence fields can not be provided content that is multiple cursors */);
315
- // TODO: is there a better way to get a field cursor from an array of node cursors?
316
- const mapTrees = content.map((c) => (0, mapTreeCursor_js_1.mapTreeFromCursor)(c));
317
- return (0, mapTreeCursor_js_1.cursorForMapTreeField)(mapTrees);
318
- }
319
- if (content.mode === 1 /* CursorLocationType.Fields */) {
320
- return content;
321
- }
322
- // TODO: is there a better way to get a field cursor from a node cursor?
323
- return (0, mapTreeCursor_js_1.cursorForMapTreeField)([(0, mapTreeCursor_js_1.mapTreeFromCursor)(content)]);
324
- }
325
- return cursorsFromContextualData(context, schema, content);
326
- }
327
- exports.normalizeNewFieldContent = normalizeNewFieldContent;
328
- //# sourceMappingURL=contextuallyTyped.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextuallyTyped.js","sourceRoot":"","sources":["../../src/feature-libraries/contextuallyTyped.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,+CAS0B;AAC1B,+CAAyD;AAEzD,QAAQ;AACR,gEAAgE;AAChE,4FAA4F;AAC5F,wDAAuD;AAEvD,yDAI4B;AAO5B,sDAYiC;AACjC,2DAA+D;AAE/D;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH,SAAgB,UAAU,CACzB,IAAqB;IAErB,IAAI,IAAA,mBAAQ,EAAC,IAAI,CAAC,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,IAAA,mBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAZD,gCAYC;AAED;;;;GAIG;AACH,MAAM,KAAK,GAAG,mBAAmB,CAAC;AAElC;;;;GAIG;AACU,QAAA,cAAc,GAAkB,MAAM,CAAC,GAAG,KAAK,WAAW,CAAC,CAAC;AAEzE;;;GAGG;AACU,QAAA,WAAW,GAAkB,MAAM,CAAC,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AAC;YAC1D,OAAO,IAAA,wCAAqB,EAAC,QAAQ,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,OAAO,CAAC,IAAI,sCAA8B,EAAE,CAAC;YAChD,OAAO,OAAO,CAAC;QAChB,CAAC;QACD,wEAAwE;QACxE,OAAO,IAAA,wCAAqB,EAAC,CAAC,IAAA,oCAAiB,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC;AAvBD,4DAuBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\tEmptyKey,\n\ttype FieldKey,\n\ttype ITreeCursorSynchronous,\n\ttype MapTree,\n\ttype Value,\n\tisCursor,\n\tMultiplicity,\n} from \"../core/index.js\";\nimport { fail, isReadonlyArray } from \"../util/index.js\";\n\n// TODO:\n// This module currently is assuming use of default-field-kinds.\n// The field kinds should instead come from a view schema registry thats provided somewhere.\nimport { fieldKinds } from \"./default-schema/index.js\";\nimport type { TreeDataContext } from \"./fieldGenerator.js\";\nimport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n} from \"./mapTreeCursor.js\";\nimport type { FlexFieldKind } from \"./modular-schema/index.js\";\nimport type {\n\tAllowedTypesToFlexInsertableTree,\n\tInsertableFlexField,\n\tInsertableFlexNode,\n} from \"./schema-aware/index.js\";\nimport {\n\ttype AllowedTypeSet,\n\tAny,\n\ttype FlexAllowedTypes,\n\tFlexFieldNodeSchema,\n\ttype FlexFieldSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\ttype FlexTreeNodeSchema,\n\ttype FlexTreeSchema,\n\tLeafNodeSchema,\n\tallowedTypesSchemaSet,\n} from \"./typed-schema/index.js\";\nimport { allowsValue, isTreeValue } from \"./valueUtilities.js\";\n\n/**\n * This library defines a tree data format that can infer its types from context.\n * It can only be used when the schema is known.\n * The format is optimized for ergonomics when the developer knows the schema,\n * and needs to declare or navigate trees.\n *\n * The format defined here is very tolerant to optimize for flexibility of expressing trees:\n * APIs exposing data in this format should likely further constrain what is allowed.\n * For example guarantee which fields and nodes should be inlined, and that types will be required everywhere.\n *\n * This is from Flex tree one which has been deleted and should no longer be used!\n */\n\n/**\n * Check if NewFieldContent is made of {@link ITreeCursor}s.\n *\n * Useful when APIs want to take in tree data in multiple formats, including cursors.\n */\nexport function areCursors(\n\tdata: NewFieldContent,\n): data is ITreeCursorSynchronous | readonly ITreeCursorSynchronous[] {\n\tif (isCursor(data)) {\n\t\treturn true;\n\t}\n\n\tif (Array.isArray(data) && data.length >= 0 && isCursor(data[0])) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * String which identifies this code.\n * Targeted at developers: can be used for symbol strings, or other developer targeted strings,\n * like error messages.\n */\nconst scope = \"contextuallyTyped\";\n\n/**\n * A symbol for the name of the type of a tree in contexts where string keys are already in use for fields.\n * See {@link TreeNodeSchemaIdentifier}.\n * @internal\n */\nexport const typeNameSymbol: unique symbol = Symbol(`${scope}:typeName`);\n\n/**\n * A symbol for the value of a tree node in contexts where string keys are already in use for fields.\n * @internal\n */\nexport const valueSymbol: unique symbol = Symbol(`${scope}:value`);\n\nexport function getFieldKind(fieldSchema: FlexFieldSchema): FlexFieldKind {\n\t// TODO:\n\t// This module currently is assuming use of defaultFieldKinds.\n\t// The field kinds should instead come from a view schema registry thats provided somewhere.\n\treturn fieldKinds.get(fieldSchema.kind.identifier) ?? fail(\"missing field kind\");\n}\n\n/**\n * @returns all allowed child types for `typeSet`.\n */\nexport function getAllowedTypes(\n\tschemaData: FlexTreeSchema,\n\ttypeSet: AllowedTypeSet,\n): ReadonlySet<FlexTreeNodeSchema> {\n\t// TODO: Performance: avoid the `Any` case being frequent, possibly with caching in the caller of `getPossibleChildTypes`.\n\treturn typeSet === Any ? new Set(schemaData.nodeSchema.values()) : typeSet;\n}\n\n/**\n * @returns all types, for which the data is schema-compatible.\n */\nexport function getPossibleTypes(\n\tcontext: FlexTreeSchema,\n\ttypeSet: AllowedTypeSet,\n\tdata: ContextuallyTypedNodeData,\n): FlexTreeNodeSchema[] {\n\t// All types allowed by schema\n\tconst allowedTypes = getAllowedTypes(context, typeSet);\n\n\tconst possibleTypes: FlexTreeNodeSchema[] = [];\n\tfor (const allowed of allowedTypes) {\n\t\tif (shallowCompatibilityTest(allowed, data)) {\n\t\t\tpossibleTypes.push(allowed);\n\t\t}\n\t}\n\treturn possibleTypes;\n}\n\n/**\n * A symbol used to define a {@link MarkedArrayLike} interface.\n * @internal\n */\nexport const arrayLikeMarkerSymbol: unique symbol = Symbol(\"flex-tree:arrayLikeMarker\");\n\n/**\n * Can be used to mark a type which works like an array, but is not compatible with `Array.isArray`.\n * @internal\n */\nexport interface MarkedArrayLike<TGet, TSet extends TGet = TGet>\n\textends ArrayLikeMut<TGet, TSet> {\n\treadonly [arrayLikeMarkerSymbol]: true;\n\t[Symbol.iterator](): IterableIterator<TGet>;\n}\n\n/**\n * Can be used to mark a type which works like an array, but is not compatible with `Array.isArray`.\n * @internal\n */\nexport interface ReadonlyMarkedArrayLike<T> extends ArrayLike<T> {\n\treadonly [arrayLikeMarkerSymbol]: true;\n\t[Symbol.iterator](): IterableIterator<T>;\n}\n\n/**\n * `ArrayLike` numeric indexed access, but writable.\n *\n * @remarks\n * Note that due to language limitations, this also allows reading as TSet.\n * This is why `TSet extends TGet` is required.\n *\n * See https://github.com/microsoft/TypeScript/issues/43826.\n * @internal\n */\nexport interface ArrayLikeMut<TGet, TSet extends TGet = TGet> extends ArrayLike<TGet> {\n\t[n: number]: TSet;\n}\n\n/**\n * Content of a tree which needs external schema information to interpret.\n *\n * This format is intended for concise authoring of tree literals when the schema is statically known.\n *\n * Once schema aware APIs are implemented, they can be used to provide schema specific subsets of this type.\n * @internal\n */\nexport type ContextuallyTypedNodeData =\n\t| ContextuallyTypedNodeDataObject\n\t| number\n\t| string\n\t| boolean\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| readonly ContextuallyTypedNodeData[]\n\t| MarkedArrayLike<ContextuallyTypedNodeData>;\n\n/**\n * Content of a field which needs external schema information to interpret.\n *\n * This format is intended for concise authoring of tree literals when the schema is statically known.\n *\n * Once schema aware APIs are implemented, they can be used to provide schema specific subsets of this type.\n * @internal\n */\nexport type ContextuallyTypedFieldData = ContextuallyTypedNodeData | undefined;\n\n/**\n * Checks the type of a `ContextuallyTypedNodeData`.\n */\nexport function isArrayLike(\n\tdata: ContextuallyTypedFieldData,\n): data is\n\t| readonly ContextuallyTypedNodeData[]\n\t| ReadonlyMarkedArrayLike<ContextuallyTypedNodeData> {\n\tif (typeof data !== \"object\" || data === null) {\n\t\treturn false;\n\t}\n\treturn (\n\t\t(data as Partial<MarkedArrayLike<ContextuallyTypedNodeData>>)[arrayLikeMarkerSymbol] ===\n\t\t\ttrue || Array.isArray(data)\n\t);\n}\n\n/**\n * Checks the type of a `ContextuallyTypedNodeData`.\n * @internal\n */\nexport function isContextuallyTypedNodeDataObject(\n\tdata: ContextuallyTypedNodeData | undefined,\n): data is ContextuallyTypedNodeDataObject {\n\treturn !(isTreeValue(data) || isArrayLike(data));\n}\n\n/**\n * Object case of {@link ContextuallyTypedNodeData}.\n * @internal\n */\nexport interface ContextuallyTypedNodeDataObject {\n\t/**\n\t * Value stored on this node.\n\t */\n\treadonly [valueSymbol]?: Value;\n\n\t/**\n\t * The type of the node.\n\t * If this node is well-formed, it must follow this schema.\n\t */\n\treadonly [typeNameSymbol]?: string;\n\n\t/**\n\t * Fields of this node, indexed by their field keys.\n\t *\n\t * Allow explicit undefined for compatibility with FlexTree, and type-safety on read.\n\t */\n\t// TODO: make sure explicit undefined is actually handled correctly.\n\t[key: FieldKey]: ContextuallyTypedFieldData;\n\n\t/**\n\t * Fields of this node, indexed by their field keys as strings.\n\t *\n\t * Allow unbranded field keys as a convenience for literals.\n\t */\n\t[key: string]: ContextuallyTypedFieldData;\n}\n\n/**\n * Checks if data might be schema-compatible.\n *\n * @returns false if `data` is incompatible with `type` based on a cheap/shallow check.\n *\n * Note that this may return true for cases where data is incompatible, but it must not return false in cases where the data is compatible.\n */\nfunction shallowCompatibilityTest(\n\tschema: FlexTreeNodeSchema,\n\tdata: ContextuallyTypedNodeData,\n): boolean {\n\tassert(!areCursors(data), 0x6b1 /* cursors cannot be used as contextually typed data. */);\n\tassert(\n\t\tdata !== undefined,\n\t\t0x6b2 /* undefined cannot be used as contextually typed data. Use ContextuallyTypedFieldData. */,\n\t);\n\n\tif (schema instanceof LeafNodeSchema) {\n\t\t// Reject objects with no value from being leaf nodes.\n\t\t// Note that if allowing IFluidHandles without wrapping them in a leaf node object,\n\t\t// this (or the above isPrimitiveValue) would have to change.\n\n\t\tif (isTreeValue(data)) {\n\t\t\treturn allowsValue(schema.leafValue, data);\n\t\t}\n\t\tif ((data as ContextuallyTypedNodeDataObject)[valueSymbol] === undefined) {\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (isTreeValue(data)) {\n\t\treturn false;\n\t}\n\tif (isArrayLike(data)) {\n\t\tif (schema instanceof FlexFieldNodeSchema) {\n\t\t\tconst field = schema.getFieldSchema();\n\t\t\treturn field.kind.multiplicity === Multiplicity.Sequence;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (data[typeNameSymbol] !== undefined) {\n\t\treturn data[typeNameSymbol] === schema.name;\n\t}\n\t// For now, consider all not explicitly typed objects shallow compatible.\n\t// This will require explicit differentiation in polymorphic cases rather than automatic structural differentiation.\n\n\treturn true;\n}\n\n/**\n * Construct a tree from ContextuallyTypedNodeData.\n *\n * TODO: this should probably be refactored into a `try` function which either returns a Cursor or a SchemaError with a path to the error.\n * @returns a cursor in Nodes mode for a single node containing the provided data.\n * @internal\n */\nexport function cursorFromContextualData(\n\tcontext: TreeDataContext,\n\ttypeSet: AllowedTypeSet,\n\tdata: ContextuallyTypedNodeData,\n): ITreeCursorSynchronous {\n\tconst mapTree = applyTypesFromContext(context, typeSet, data);\n\treturn cursorForMapTreeNode(mapTree);\n}\n\n/**\n * Strongly typed {@link cursorFromContextualData} for a TreeNodeSchema.\n * @returns a cursor in Nodes mode for a single node containing the provided data.\n * @internal\n */\nexport function cursorForTypedTreeData<T extends FlexTreeNodeSchema>(\n\tcontext: TreeDataContext,\n\tschema: T,\n\tdata: InsertableFlexNode<T>,\n): ITreeCursorSynchronous {\n\treturn cursorFromContextualData(\n\t\tcontext,\n\t\tnew Set([schema]),\n\t\tdata as ContextuallyTypedNodeData,\n\t);\n}\n\n/**\n * Strongly typed {@link cursorFromContextualData} for AllowedTypes.\n * @returns a cursor in Nodes mode for a single node containing the provided data.\n * @internal\n */\nexport function cursorForTypedData<T extends FlexAllowedTypes>(\n\tcontext: TreeDataContext,\n\tschema: T,\n\tdata: AllowedTypesToFlexInsertableTree<T>,\n): ITreeCursorSynchronous {\n\treturn cursorFromContextualData(\n\t\tcontext,\n\t\tallowedTypesSchemaSet(schema),\n\t\tdata as unknown as ContextuallyTypedNodeData,\n\t);\n}\n\n/**\n * Construct a tree from ContextuallyTypedNodeData.\n * Returns a cursor in Field mode.\n *\n * TODO: this should probably be refactored into a `try` function which either returns a Cursor or a SchemaError with a path to the error.\n */\nexport function cursorsFromContextualData(\n\tcontext: TreeDataContext,\n\tfield: FlexFieldSchema,\n\tdata: ContextuallyTypedNodeData | undefined,\n): ITreeCursorSynchronous {\n\tconst mapTrees = applyFieldTypesFromContext(context, field, data);\n\treturn cursorForMapTreeField(mapTrees);\n}\n\n/**\n * Strongly typed {@link cursorsFromContextualData} for a TreeFieldSchema\n * @internal\n */\nexport function cursorsForTypedFieldData<T extends FlexFieldSchema>(\n\tcontext: TreeDataContext,\n\tschema: T,\n\tdata: InsertableFlexField<T>,\n): ITreeCursorSynchronous {\n\treturn cursorsFromContextualData(context, schema, data as ContextuallyTypedNodeData);\n}\n\n/**\n * Construct a MapTree from ContextuallyTypedNodeData.\n *\n * TODO: this should probably be refactored into a `try` function which either returns a MapTree or a SchemaError with a path to the error.\n * TODO: test suite.\n *\n * @remarks\n * This version is only exported as a more testable entry point than `cursorFromContextualData` which keeps the use of `MapTree` as an implementation detail.\n * This should not be reexported from the parent module.\n */\nexport function applyTypesFromContext(\n\tcontext: TreeDataContext,\n\ttypeSet: AllowedTypeSet,\n\tdata: ContextuallyTypedNodeData,\n): MapTree {\n\tconst possibleTypes: FlexTreeNodeSchema[] = getPossibleTypes(context.schema, typeSet, data);\n\n\tassert(\n\t\tpossibleTypes.length !== 0,\n\t\t0x4d4 /* data incompatible with all types allowed by the schema */,\n\t);\n\tassert(\n\t\tpossibleTypes.length === 1,\n\t\t0x4d5 /* data compatible with more than one type allowed by the schema */,\n\t);\n\n\tconst schema = possibleTypes[0];\n\n\tif (schema instanceof LeafNodeSchema) {\n\t\tconst value = isTreeValue(data)\n\t\t\t? data\n\t\t\t: (data as ContextuallyTypedNodeDataObject)[valueSymbol];\n\n\t\tassert(\n\t\t\tallowsValue(schema.leafValue, value),\n\t\t\t0x4d3 /* unsupported schema for provided primitive */,\n\t\t);\n\t\treturn { value, type: schema.name, fields: new Map() };\n\t}\n\tassert(!isTreeValue(data), 0x880 /* leaf value for non leaf */);\n\tif (schema instanceof FlexFieldNodeSchema) {\n\t\tif (isArrayLike(data)) {\n\t\t\tconst children = applyFieldTypesFromContext(context, schema.getFieldSchema(), data);\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\ttype: schema.name,\n\t\t\t\tfields: new Map(children.length > 0 ? [[EmptyKey, children]] : []),\n\t\t\t};\n\t\t}\n\t}\n\tassert(!isArrayLike(data), 0x881 /* array for non field node */);\n\tif (\n\t\tschema instanceof FlexMapNodeSchema ||\n\t\tschema instanceof FlexObjectNodeSchema ||\n\t\tschema instanceof FlexFieldNodeSchema\n\t) {\n\t\tconst fields: Map<FieldKey, MapTree[]> = new Map();\n\t\tfor (const key of fieldKeysFromData(data)) {\n\t\t\tassert(!fields.has(key), 0x6b3 /* Keys should not be duplicated */);\n\t\t\tconst childSchema = schema.getFieldSchema(key);\n\t\t\tconst children = applyFieldTypesFromContext(context, childSchema, data[key]);\n\n\t\t\tif (children.length > 0) {\n\t\t\t\tfields.set(key, children);\n\t\t\t}\n\t\t}\n\n\t\tif (schema instanceof FlexObjectNodeSchema) {\n\t\t\tfor (const key of schema.objectNodeFields.keys()) {\n\t\t\t\tif (data[key] === undefined) {\n\t\t\t\t\tsetFieldForKey(key, context, schema, fields);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst value = data[valueSymbol];\n\t\tassert(value === undefined, 0x4d7 /* provided value not permitted by the schema */);\n\t\treturn { value, type: schema.name, fields };\n\t} else {\n\t\tfail(\"unexpected node kind\");\n\t}\n}\n\nfunction setFieldForKey(\n\tkey: FieldKey,\n\tcontext: TreeDataContext,\n\tschema: FlexTreeNodeSchema,\n\tfields: Map<FieldKey, MapTree[]>,\n): void {\n\tconst requiredFieldSchema = schema.getFieldSchema(key);\n\tconst multiplicity = getFieldKind(requiredFieldSchema).multiplicity;\n\tif (multiplicity === Multiplicity.Single && context.fieldSource !== undefined) {\n\t\tconst fieldGenerator = context.fieldSource(key, requiredFieldSchema.stored);\n\t\tif (fieldGenerator !== undefined) {\n\t\t\tconst children = fieldGenerator();\n\t\t\tfields.set(key, children);\n\t\t}\n\t}\n}\n\nfunction fieldKeysFromData(data: ContextuallyTypedNodeDataObject): FieldKey[] {\n\tconst keys: (string | symbol)[] = Reflect.ownKeys(data).filter(\n\t\t(key) => typeof key === \"string\",\n\t);\n\treturn keys as FieldKey[];\n}\n\n/**\n * Construct a MapTree from ContextuallyTypedNodeData.\n *\n * TODO: this should probably be refactored into a `try` function which either returns a MapTree or a SchemaError with a path to the error.\n * TODO: test suite.\n *\n * @remarks\n * This version is only exported as a more testable entry point than `cursorsFromContextualData` which keeps the use of `MapTree` as an implementation detail.\n * This should not be reexported from the parent module.\n */\nexport function applyFieldTypesFromContext(\n\tcontext: TreeDataContext,\n\tfield: FlexFieldSchema,\n\tdata: ContextuallyTypedFieldData,\n): MapTree[] {\n\tconst multiplicity = getFieldKind(field).multiplicity;\n\tif (data === undefined) {\n\t\tassert(\n\t\t\tmultiplicity === Multiplicity.Forbidden || multiplicity === Multiplicity.Optional,\n\t\t\t0x4d8 /* `undefined` provided for a field that does not support `undefined` */,\n\t\t);\n\t\treturn [];\n\t}\n\tif (multiplicity === Multiplicity.Sequence) {\n\t\tassert(isArrayLike(data), 0x4d9 /* expected array for a sequence field */);\n\t\tconst children = Array.from(data, (child) =>\n\t\t\tapplyTypesFromContext(context, field.allowedTypeSet, child),\n\t\t);\n\t\treturn children;\n\t}\n\tassert(\n\t\tmultiplicity === Multiplicity.Single || multiplicity === Multiplicity.Optional,\n\t\t0x4da /* single value provided for an unsupported field */,\n\t);\n\treturn [applyTypesFromContext(context, field.allowedTypeSet, data)];\n}\n\n/**\n * Content to use for a field.\n *\n * When used, this content will be deeply copied into the tree, and must comply with the schema.\n *\n * The content must follow the {@link Multiplicity} of the {@link FlexFieldKind}:\n * - use a single cursor for an `optional` or `value` field;\n * - use array of cursors for a `sequence` field;\n *\n * TODO: this should allow a field cursor instead of an array of cursors.\n * TODO: Make this generic so a variant of this type that allows placeholders for detached sequences to consume.\n * @internal\n */\nexport type NewFieldContent =\n\t| ITreeCursorSynchronous\n\t| readonly ITreeCursorSynchronous[]\n\t| ContextuallyTypedFieldData;\n\n/**\n * Convert NewFieldContent into ITreeCursorSynchronous.\n * The returned cursor will be in Field mode.\n */\nexport function normalizeNewFieldContent(\n\tcontext: TreeDataContext,\n\tschema: FlexFieldSchema,\n\tcontent: NewFieldContent,\n): ITreeCursorSynchronous {\n\tif (areCursors(content)) {\n\t\tif (isReadonlyArray(content)) {\n\t\t\tassert(\n\t\t\t\tgetFieldKind(schema).multiplicity === Multiplicity.Sequence || content.length === 1,\n\t\t\t\t0x6b8 /* non-sequence fields can not be provided content that is multiple cursors */,\n\t\t\t);\n\t\t\t// TODO: is there a better way to get a field cursor from an array of node cursors?\n\t\t\tconst mapTrees = content.map((c) => mapTreeFromCursor(c));\n\t\t\treturn cursorForMapTreeField(mapTrees);\n\t\t}\n\t\tif (content.mode === CursorLocationType.Fields) {\n\t\t\treturn content;\n\t\t}\n\t\t// TODO: is there a better way to get a field cursor from a node cursor?\n\t\treturn cursorForMapTreeField([mapTreeFromCursor(content)]);\n\t}\n\n\treturn cursorsFromContextualData(context, schema, content);\n}\n"]}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export type { InsertableFlexNode, InsertableFlexField, AllowedTypesToFlexInsertableTree, ApplyMultiplicity, CollectOptions, TypedFields, UnbrandedName, EmptyObject, } from "./schemaAware.js";
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-aware/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,kBAAkB,EAClB,mBAAmB,EACnB,gCAAgC,EAChC,iBAAiB,EAEjB,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,GACX,MAAM,kBAAkB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-aware/index.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tInsertableFlexNode,\n\tInsertableFlexField,\n\tAllowedTypesToFlexInsertableTree,\n\tApplyMultiplicity,\n\t// Internal\n\tCollectOptions,\n\tTypedFields,\n\tUnbrandedName,\n\tEmptyObject,\n} from \"./schemaAware.js\";\n"]}
@@ -1,76 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import type { TreeNodeSchemaIdentifier, TreeValue, ValueSchema, Multiplicity } from "../../core/index.js";
6
- import type { Assume, FlattenKeys, _InlineTrick } from "../../util/index.js";
7
- import type { ContextuallyTypedNodeData, typeNameSymbol, valueSymbol } from "../contextuallyTyped.js";
8
- import type { FlexAllowedTypes, FlexFieldNodeSchema, FlexFieldSchema, FlexListToUnion, FlexMapNodeSchema, FlexObjectNodeFields, FlexObjectNodeSchema, FlexTreeNodeSchema, LazyItem, LeafNodeSchema } from "../typed-schema/index.js";
9
- /**
10
- * Empty Object for use in type computations that should contribute no fields when `&`ed with another type.
11
- * @internal
12
- */
13
- export type EmptyObject = {};
14
- /**
15
- * Collects the various parts of the API together.
16
- * @internal
17
- */
18
- export type CollectOptions<TTypedFields, TValueSchema extends ValueSchema | undefined, TName> = TValueSchema extends undefined ? FlattenKeys<{
19
- [typeNameSymbol]?: UnbrandedName<TName>;
20
- } & (TValueSchema extends ValueSchema ? {
21
- [valueSymbol]: TreeValue<TValueSchema>;
22
- } : EmptyObject)> & TTypedFields : TValueSchema extends ValueSchema ? TreeValue<TValueSchema> : undefined;
23
- /**
24
- * Remove type brand from name.
25
- * @internal
26
- */
27
- export type UnbrandedName<TName> = [
28
- TName extends TreeNodeSchemaIdentifier<infer S> ? S : string
29
- ][_InlineTrick];
30
- /**
31
- * `{ [key: string]: FieldSchemaTypeInfo }` to `{ [key: string]: TypedTree }`
32
- *
33
- * In Editable mode, unwraps the fields.
34
- * @internal
35
- */
36
- export type TypedFields<TFields extends undefined | {
37
- readonly [key: string]: FlexFieldSchema;
38
- }> = [
39
- TFields extends {
40
- [key: string]: FlexFieldSchema;
41
- } ? {
42
- -readonly [key in keyof TFields]: InsertableFlexField<TFields[key]>;
43
- } : EmptyObject
44
- ][_InlineTrick];
45
- /**
46
- * `TreeFieldSchema` to `TypedField`. May unwrap to child depending on FieldKind.
47
- * @internal
48
- */
49
- export type InsertableFlexField<TField extends FlexFieldSchema> = [
50
- ApplyMultiplicity<TField["kind"]["multiplicity"], AllowedTypesToFlexInsertableTree<TField["allowedTypes"]>>
51
- ][_InlineTrick];
52
- /**
53
- * Adjusts the API for a field based on its Multiplicity.
54
- * @internal
55
- */
56
- export type ApplyMultiplicity<TMultiplicity extends Multiplicity, TypedChild> = {
57
- [Multiplicity.Forbidden]: undefined;
58
- [Multiplicity.Optional]: undefined | TypedChild;
59
- [Multiplicity.Sequence]: TypedChild[];
60
- [Multiplicity.Single]: TypedChild;
61
- }[TMultiplicity];
62
- /**
63
- * Takes in `AllowedTypes` and returns a TypedTree union.
64
- * @internal
65
- */
66
- export type AllowedTypesToFlexInsertableTree<T extends FlexAllowedTypes> = [
67
- T extends readonly LazyItem<FlexTreeNodeSchema>[] ? InsertableFlexNode<Assume<FlexListToUnion<T>, FlexTreeNodeSchema>> : ContextuallyTypedNodeData
68
- ][_InlineTrick];
69
- /**
70
- * Generate a schema aware API for a single tree schema.
71
- * @internal
72
- */
73
- export type InsertableFlexNode<TSchema extends FlexTreeNodeSchema> = FlattenKeys<CollectOptions<TSchema extends FlexObjectNodeSchema<string, infer TFields extends FlexObjectNodeFields> ? TypedFields<TFields> : TSchema extends FlexFieldNodeSchema<string, infer TField extends FlexFieldSchema> ? InsertableFlexField<TField> : TSchema extends FlexMapNodeSchema<string, infer TField extends FlexFieldSchema> ? {
74
- readonly [P in string]: InsertableFlexField<TField>;
75
- } : EmptyObject, TSchema extends LeafNodeSchema<string, infer TValueSchema extends ValueSchema> ? TValueSchema : undefined, TSchema["name"]>>;
76
- //# sourceMappingURL=schemaAware.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemaAware.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-aware/schemaAware.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,wBAAwB,EACxB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,MAAM,qBAAqB,CAAC;AA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CAAC,GAC3B,OAAO,SAAS,iBAAiB,CAAC,MAAM,EAAE,MAAM,MAAM,SAAS,eAAe,CAAC,GAC9E;IACA,QAAQ,EAAE,CAAC,IAAI,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;CACnD,GACA,WAAW,EAChB,OAAO,SAAS,cAAc,CAAC,MAAM,EAAE,MAAM,YAAY,SAAS,WAAW,CAAC,GAC3E,YAAY,GACZ,SAAS,EACZ,OAAO,CAAC,MAAM,CAAC,CACf,CACD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemaAware.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-aware/schemaAware.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 {\n\tTreeNodeSchemaIdentifier,\n\tTreeValue,\n\tValueSchema,\n\tMultiplicity,\n} from \"../../core/index.js\";\nimport type { Assume, FlattenKeys, _InlineTrick } from \"../../util/index.js\";\nimport type {\n\tContextuallyTypedNodeData,\n\ttypeNameSymbol,\n\tvalueSymbol,\n} from \"../contextuallyTyped.js\";\nimport type {\n\tFlexAllowedTypes,\n\tFlexFieldNodeSchema,\n\tFlexFieldSchema,\n\tFlexListToUnion,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeFields,\n\tFlexObjectNodeSchema,\n\tFlexTreeNodeSchema,\n\tLazyItem,\n\tLeafNodeSchema,\n} from \"../typed-schema/index.js\";\n\n/**\n * Empty Object for use in type computations that should contribute no fields when `&`ed with another type.\n * @internal\n */\n// Using {} instead of interface {} or Record<string, never> for empty object here produces better IntelliSense in the generated types than `Record<string, never>` recommended by the linter.\n// Making this a type instead of an interface prevents it from showing up in IntelliSense, and also avoids breaking the typing somehow.\n// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/consistent-type-definitions\nexport type EmptyObject = {};\n\n/**\n * Collects the various parts of the API together.\n * @internal\n */\nexport type CollectOptions<\n\tTTypedFields,\n\tTValueSchema extends ValueSchema | undefined,\n\tTName,\n> = TValueSchema extends undefined\n\t? FlattenKeys<\n\t\t\t{ [typeNameSymbol]?: UnbrandedName<TName> } & (TValueSchema extends ValueSchema\n\t\t\t\t? { [valueSymbol]: TreeValue<TValueSchema> }\n\t\t\t\t: EmptyObject)\n\t\t> &\n\t\t\tTTypedFields\n\t: TValueSchema extends ValueSchema\n\t\t? TreeValue<TValueSchema>\n\t\t: undefined;\n\n/**\n * Remove type brand from name.\n * @internal\n */\nexport type UnbrandedName<TName> = [\n\tTName extends TreeNodeSchemaIdentifier<infer S> ? S : string,\n][_InlineTrick];\n\n/**\n * `{ [key: string]: FieldSchemaTypeInfo }` to `{ [key: string]: TypedTree }`\n *\n * In Editable mode, unwraps the fields.\n * @internal\n */\nexport type TypedFields<\n\tTFields extends undefined | { readonly [key: string]: FlexFieldSchema },\n> = [\n\tTFields extends { [key: string]: FlexFieldSchema }\n\t\t? {\n\t\t\t\t-readonly [key in keyof TFields]: InsertableFlexField<TFields[key]>;\n\t\t\t}\n\t\t: EmptyObject,\n][_InlineTrick];\n\n/**\n * `TreeFieldSchema` to `TypedField`. May unwrap to child depending on FieldKind.\n * @internal\n */\nexport type InsertableFlexField<TField extends FlexFieldSchema> = [\n\tApplyMultiplicity<\n\t\tTField[\"kind\"][\"multiplicity\"],\n\t\tAllowedTypesToFlexInsertableTree<TField[\"allowedTypes\"]>\n\t>,\n][_InlineTrick];\n\n/**\n * Adjusts the API for a field based on its Multiplicity.\n * @internal\n */\nexport type ApplyMultiplicity<TMultiplicity extends Multiplicity, TypedChild> = {\n\t[Multiplicity.Forbidden]: undefined;\n\t[Multiplicity.Optional]: undefined | TypedChild;\n\t[Multiplicity.Sequence]: TypedChild[];\n\t[Multiplicity.Single]: TypedChild;\n}[TMultiplicity];\n\n/**\n * Takes in `AllowedTypes` and returns a TypedTree union.\n * @internal\n */\nexport type AllowedTypesToFlexInsertableTree<T extends FlexAllowedTypes> = [\n\tT extends readonly LazyItem<FlexTreeNodeSchema>[]\n\t\t? InsertableFlexNode<Assume<FlexListToUnion<T>, FlexTreeNodeSchema>>\n\t\t: ContextuallyTypedNodeData,\n][_InlineTrick];\n\n/**\n * Generate a schema aware API for a single tree schema.\n * @internal\n */\nexport type InsertableFlexNode<TSchema extends FlexTreeNodeSchema> = FlattenKeys<\n\tCollectOptions<\n\t\tTSchema extends FlexObjectNodeSchema<string, infer TFields extends FlexObjectNodeFields>\n\t\t\t? TypedFields<TFields>\n\t\t\t: TSchema extends FlexFieldNodeSchema<string, infer TField extends FlexFieldSchema>\n\t\t\t\t? InsertableFlexField<TField>\n\t\t\t\t: TSchema extends FlexMapNodeSchema<string, infer TField extends FlexFieldSchema>\n\t\t\t\t\t? {\n\t\t\t\t\t\t\treadonly [P in string]: InsertableFlexField<TField>;\n\t\t\t\t\t\t}\n\t\t\t\t\t: EmptyObject,\n\t\tTSchema extends LeafNodeSchema<string, infer TValueSchema extends ValueSchema>\n\t\t\t? TValueSchema\n\t\t\t: undefined,\n\t\tTSchema[\"name\"]\n\t>\n>;\n"]}
@@ -1,41 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import type { LocalNodeKey, StableNodeKey } from "../feature-libraries/index.js";
6
- import type { TreeNode } from "./types.js";
7
- /**
8
- * A collection of utilities for managing {@link StableNodeKey}s.
9
- * A node key can be assigned to a node and allows that node to be easily retrieved from the tree at a later time. (see `nodeKey.map`).
10
- * @remarks {@link LocalNodeKey}s are put on {@link FlexTreeObjectNode}s via a special field.
11
- * A node with a node key in its schema must always have a node key.
12
- * TODO: A node key index leveraging this {@link NodeKeys} interface should be implemented for the simple tree layer.
13
- * @internal
14
- */
15
- export interface NodeKeys {
16
- /**
17
- * Create a new {@link LocalNodeKey} which can be used as the key for a node in the tree.
18
- */
19
- generate(): LocalNodeKey;
20
- /**
21
- * Convert the given {@link LocalNodeKey} into a UUID that can be serialized.
22
- * @param key - the key to convert
23
- */
24
- stabilize(key: LocalNodeKey): StableNodeKey;
25
- /**
26
- * Convert a {@link StableNodeKey} back into its {@link LocalNodeKey} form.
27
- * @param key - the key to convert
28
- */
29
- localize(key: StableNodeKey): LocalNodeKey;
30
- /**
31
- * Attempts to recompress a string key back into its {@link LocalNodeKey} form.
32
- * @param key - The key to convert.
33
- * @returns The {@link LocalNodeKey} associated with `key` or undefined if the key was not generated by any session known to this compressor.
34
- */
35
- tryLocalize(key: string): LocalNodeKey | undefined;
36
- /**
37
- * A map of all {@link LocalNodeKey}s in the document to their corresponding nodes.
38
- */
39
- readonly map: ReadonlyMap<LocalNodeKey, TreeNode>;
40
- }
41
- //# sourceMappingURL=nodeKeys.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nodeKeys.d.ts","sourceRoot":"","sources":["../../src/simple-tree/nodeKeys.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,WAAW,QAAQ;IACxB;;OAEG;IACH,QAAQ,IAAI,YAAY,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,GAAG,EAAE,YAAY,GAAG,aAAa,CAAC;IAC5C;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,YAAY,CAAC;IAC3C;;;;OAIG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;IACnD;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;CAClD"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- //# sourceMappingURL=nodeKeys.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nodeKeys.js","sourceRoot":"","sources":["../../src/simple-tree/nodeKeys.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 { LocalNodeKey, StableNodeKey } from \"../feature-libraries/index.js\";\nimport type { TreeNode } from \"./types.js\";\n\n/**\n * A collection of utilities for managing {@link StableNodeKey}s.\n * A node key can be assigned to a node and allows that node to be easily retrieved from the tree at a later time. (see `nodeKey.map`).\n * @remarks {@link LocalNodeKey}s are put on {@link FlexTreeObjectNode}s via a special field.\n * A node with a node key in its schema must always have a node key.\n * TODO: A node key index leveraging this {@link NodeKeys} interface should be implemented for the simple tree layer.\n * @internal\n */\nexport interface NodeKeys {\n\t/**\n\t * Create a new {@link LocalNodeKey} which can be used as the key for a node in the tree.\n\t */\n\tgenerate(): LocalNodeKey;\n\t/**\n\t * Convert the given {@link LocalNodeKey} into a UUID that can be serialized.\n\t * @param key - the key to convert\n\t */\n\tstabilize(key: LocalNodeKey): StableNodeKey;\n\t/**\n\t * Convert a {@link StableNodeKey} back into its {@link LocalNodeKey} form.\n\t * @param key - the key to convert\n\t */\n\tlocalize(key: StableNodeKey): LocalNodeKey;\n\t/**\n\t * Attempts to recompress a string key back into its {@link LocalNodeKey} form.\n\t * @param key - The key to convert.\n\t * @returns The {@link LocalNodeKey} associated with `key` or undefined if the key was not generated by any session known to this compressor.\n\t */\n\ttryLocalize(key: string): LocalNodeKey | undefined;\n\t/**\n\t * A map of all {@link LocalNodeKey}s in the document to their corresponding nodes.\n\t */\n\treadonly map: ReadonlyMap<LocalNodeKey, TreeNode>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemaCaching.d.ts","sourceRoot":"","sources":["../../src/simple-tree/schemaCaching.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA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,IAAI,MAAM,CAAC,EAAE,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAChF,IAAA,iBAAM,EAAC,CAAC,CAAC,sBAAsB,IAAI,IAAI,CAAC,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAClF,8DAA8D;IAC7D,MAAc,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;IACzC,8DAA8D;IAC7D,IAAY,CAAC,sBAAsB,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AAVD,oEAUC;AAED;;;GAGG;AACH,SAAgB,sBAAsB,CACrC,UAA8B;IAE9B,IAAI,sBAAsB,IAAI,UAAU,EAAE,CAAC;QAC1C,OAAO,UAAU,CAAC,sBAAsB,CAAmB,CAAC;IAC7D,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAPD,wDAOC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,UAA8B;IACjE,OAAO,sBAAsB,CAAC,UAAU,CAAC,IAAI,IAAA,eAAI,EAAC,uBAAuB,CAAC,CAAC;AAC5E,CAAC;AAFD,kDAEC;AAED;;;;;GAKG;AACH,SAAgB,oBAAoB,CACnC,UAA2B,EAC3B,oBAAyC;IAEzC,IAAI,uBAAuB,IAAI,UAAU,EAAE,CAAC;QAC3C,OAAO,UAAU,CAAC,uBAAuB,CAAgB,CAAC;IAC3D,CAAC;IAED,MAAM,WAAW,GAAG,IAAA,qCAAoB,EAAC,oBAAoB,CAAC,CAAC;IAC/D,8DAA8D;IAC7D,UAAkB,CAAC,uBAAuB,CAAC,GAAG,WAAW,CAAC;IAC3D,OAAO,WAAW,CAAC;AACpB,CAAC;AAZD,oDAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type {\n\tFlexFieldSchema,\n\tFlexTreeNodeSchema,\n\tTreeNodeSchemaBase,\n} from \"../feature-libraries/index.js\";\nimport { fail } from \"../util/index.js\";\n\nimport {\n\ttype FieldSchema,\n\ttype ImplicitFieldSchema,\n\ttype TreeNodeSchema,\n\tnormalizeFieldSchema,\n} from \"./schemaTypes.js\";\n\n/**\n * A symbol for storing FlexTreeSchema on TreeNodeSchema.\n * Eagerly set on leaves, and lazily set for other cases.\n */\nconst flexSchemaSymbol: unique symbol = Symbol(`flexSchema`);\n\n/**\n * A symbol for storing TreeNodeSchema on FlexTreeNode's schema.\n */\nconst simpleNodeSchemaSymbol: unique symbol = Symbol(`simpleNodeSchema`);\n\n/**\n * A symbol for storing {@link FieldSchema}s on a {@link FlexFieldSchema}.\n */\nconst simpleFieldSchemaSymbol: unique symbol = Symbol(`simpleFieldSchema`);\n\nexport function cachedFlexSchemaFromClassSchema(\n\tschema: TreeNodeSchema,\n): TreeNodeSchemaBase | undefined {\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treturn (schema as any)[flexSchemaSymbol] as TreeNodeSchemaBase | undefined;\n}\n\nexport function setFlexSchemaFromClassSchema(\n\tsimple: TreeNodeSchema,\n\tflex: TreeNodeSchemaBase,\n): void {\n\tassert(!(flexSchemaSymbol in simple), 0x91f /* simple schema already marked */);\n\tassert(!(simpleNodeSchemaSymbol in flex), 0x920 /* flex schema already marked */);\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(simple as any)[flexSchemaSymbol] = flex;\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(flex as any)[simpleNodeSchemaSymbol] = simple;\n}\n\n/**\n * Gets the {@link TreeNodeSchema} cached on the provided {@link FlexTreeNodeSchema | flexSchema}.\n * Returns `undefined` if no cached value is found.\n */\nexport function tryGetSimpleNodeSchema(\n\tflexSchema: FlexTreeNodeSchema,\n): TreeNodeSchema | undefined {\n\tif (simpleNodeSchemaSymbol in flexSchema) {\n\t\treturn flexSchema[simpleNodeSchemaSymbol] as TreeNodeSchema;\n\t}\n\treturn undefined;\n}\n\n/**\n * Gets the {@link TreeNodeSchema} cached on the provided {@link FlexTreeNodeSchema | flexSchema}.\n * Fails if no cached value is found.\n */\nexport function getSimpleNodeSchema(flexSchema: FlexTreeNodeSchema): TreeNodeSchema {\n\treturn tryGetSimpleNodeSchema(flexSchema) ?? fail(\"missing simple schema\");\n}\n\n/**\n * Gets the {@link FieldSchema} which corresponds with the provided {@link FlexFieldSchema | flexSchema}.\n * Caches the result on the provided `flexSchema` for future access.\n * @param flexSchema - The flex schema on which the result will be cached.\n * @param implicitSimpleSchema - The allowed types from which the `FieldSchema` will be derived.\n */\nexport function getSimpleFieldSchema(\n\tflexSchema: FlexFieldSchema,\n\timplicitSimpleSchema: ImplicitFieldSchema,\n): FieldSchema {\n\tif (simpleFieldSchemaSymbol in flexSchema) {\n\t\treturn flexSchema[simpleFieldSchemaSymbol] as FieldSchema;\n\t}\n\n\tconst fieldSchema = normalizeFieldSchema(implicitSimpleSchema);\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(flexSchema as any)[simpleFieldSchemaSymbol] = fieldSchema;\n\treturn fieldSchema;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemaCreationUtilities.d.ts","sourceRoot":"","sources":["../../src/simple-tree/schemaCreationUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAGjE,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,EAAkB,QAAQ,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAEX,sBAAsB,EACtB,MAAM,iBAAiB,CAAC;AAEzB;;;;;;GAMG;AAGH,wBAAgB,eAAe,CAAC,MAAM,SAAS,MAAM,EAAE,KAAK,SAAS,MAAM,GAAG,MAAM,EACnF,OAAO,EAAE,aAAa,CAA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QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,IAAI;SACX,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACvC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { EmptyObject } from \"../feature-libraries/index.js\";\nimport { fail } from \"../util/index.js\";\n\nimport type { SchemaFactory, ScopedSchemaName } from \"./schemaFactory.js\";\nimport type { NodeFromSchema, NodeKind, TreeNodeSchemaClass } from \"./schemaTypes.js\";\nimport type { TreeNode } from \"./types.js\";\nimport type {\n\tInsertableObjectFromSchemaRecord,\n\tObjectFromSchemaRecord,\n} from \"./objectNode.js\";\n\n/**\n * Create a schema for a node with no state.\n * @remarks\n * This is commonly used in unions when the only information needed is which kind of node the value is.\n * Enums are a common example of this pattern.\n * @internal\n */\n// Return type is intentionally derived.\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function singletonSchema<TScope extends string, TName extends string | number>(\n\tfactory: SchemaFactory<TScope, TName>,\n\tname: TName,\n) {\n\tclass SingletonSchema extends factory.object(name, {}) {\n\t\tpublic constructor(data?: EmptyObject) {\n\t\t\tsuper(data ?? {});\n\t\t}\n\t\tpublic get value(): TName {\n\t\t\treturn name;\n\t\t}\n\t}\n\n\ttype NodeType = object &\n\t\tTreeNode &\n\t\tObjectFromSchemaRecord<EmptyObject> & { readonly value: TName };\n\n\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t// for the private brand field of TreeNode.\n\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t// This is avoided by doing this type conversion.\n\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\tconst toReturn: TreeNodeSchemaClass<\n\t\tScopedSchemaName<TScope, TName>,\n\t\tNodeKind.Object,\n\t\tNodeType,\n\t\tobject & InsertableObjectFromSchemaRecord<EmptyObject>,\n\t\ttrue\n\t> &\n\t\t(new () => NodeType) = SingletonSchema;\n\n\treturn toReturn;\n}\n\n/**\n * Converts an enum into a collection of schema which can be used in a union.\n * @remarks\n * Currently only supports `string` enums.\n * @example\n * ```typescript\n * enum Mode {\n * \ta = \"A\",\n * \tb = \"B\",\n * }\n * const ModeNodes = adaptEnum(schema, Mode);\n * type ModeNodes = NodeFromSchema<(typeof ModeNodes)[keyof typeof ModeNodes]>;\n * const nodeFromString: ModeNodes = ModeNodes(Mode.a);\n * const nodeFromSchema: ModeNodes = new ModeNodes.a();\n * const nameFromNode: Mode = nodeFromSchema.value;\n * class Parent extends schemaFactory.object(\"Parent\", {\n * \tmode: typedObjectValues(ModeNodes),\n * }) {}\n * ```\n * @privateRemarks\n * TODO:\n * Extends this to support numeric enums.\n * Maybe require an explicit nested scope to group them under, or at least a warning about collisions.\n * Maybe just provide `SchemaFactory.nested` to east creating nested scopes?\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function adaptEnum<TScope extends string, const TEnum extends Record<string, string>>(\n\tfactory: SchemaFactory<TScope>,\n\tmembers: TEnum,\n) {\n\ttype Values = TEnum[keyof TEnum];\n\tconst values = Object.values(members) as Values[];\n\tconst inverse = new Map(Object.entries(members).map(([key, value]) => [value, key])) as Map<\n\t\tValues,\n\t\tkeyof TEnum\n\t>;\n\n\tif (inverse.size !== values.length) {\n\t\tthrow new UsageError(\"All members of enums must have distinct values.\");\n\t}\n\n\ttype TOut = {\n\t\treadonly [Property in keyof TEnum]: ReturnType<\n\t\t\ttypeof singletonSchema<TScope, TEnum[Property]>\n\t\t>;\n\t};\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tconst factoryOut = <TValue extends Values>(value: TValue) => {\n\t\treturn new out[inverse.get(value) ?? fail(\"missing enum value\")]({}) as NodeFromSchema<\n\t\t\tReturnType<typeof singletonSchema<TScope, TValue>>\n\t\t>;\n\t};\n\tconst out = factoryOut as typeof factoryOut & TOut;\n\tfor (const [key, value] of Object.entries(members)) {\n\t\tObject.defineProperty(out, key, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\twritable: false,\n\t\t\tvalue: singletonSchema(factory, value),\n\t\t});\n\t}\n\n\treturn out;\n}\n\n/**\n * `Object.values`, but with more specific types.\n * @internal\n */\nexport function typedObjectValues<TKey extends string, TValues>(\n\tobject: Record<TKey, TValues>,\n): TValues[] {\n\treturn Object.values(object);\n}\n\n/**\n * Converts an array of distinct strings into a collection of schema which can be used like an enum style union.\n * @remarks\n * The returned collection is also a function which can be used to convert strings into {@link Unhydrated} nodes in the union.\n * Each node type has a `.value` getter which returns the associated string.\n *\n * The produced nodes use the provided strings as their `name`, and don't store any data beyond that.\n * @example\n * ```typescript\n * const Mode = enumFromStrings(schemaFactory, [\"Fun\", \"Cool\"]);\n * type Mode = NodeFromSchema<(typeof Mode)[keyof typeof Mode]>;\n * const nodeFromString: Mode = Mode(\"Fun\");\n * const nodeFromSchema: Mode = new Mode.Fun();\n * const nameFromNode = nodeFromSchema.value;\n *\n * class Parent extends schemaFactory.object(\"Parent\", { mode: typedObjectValues(Mode) }) {}\n * ```\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function enumFromStrings<TScope extends string, const Members extends string>(\n\tfactory: SchemaFactory<TScope>,\n\tmembers: readonly Members[],\n) {\n\tconst names = new Set(members);\n\tif (names.size !== members.length) {\n\t\tthrow new UsageError(\"All members of enums must have distinct names\");\n\t}\n\n\ttype TOut = Record<Members, ReturnType<typeof singletonSchema<TScope, Members>>>;\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tconst factoryOut = <TValue extends Members>(value: TValue) => {\n\t\treturn new out[value]({}) as NodeFromSchema<\n\t\t\tReturnType<typeof singletonSchema<TScope, TValue>>\n\t\t>;\n\t};\n\tconst out = factoryOut as typeof factoryOut & TOut;\n\tfor (const name of members) {\n\t\tObject.defineProperty(out, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\twritable: false,\n\t\t\tvalue: singletonSchema(factory, name),\n\t\t});\n\t}\n\n\treturn out;\n}\n\n// TODO: Why does this one generate an invalid d.ts file if exported?\n// Tracked by https://github.com/microsoft/TypeScript/issues/58688\n// TODO: replace enumFromStrings above with this simpler implementation when the TypeScript bug is resolved.\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction _enumFromStrings2<TScope extends string, const Members extends readonly string[]>(\n\tfactory: SchemaFactory<TScope>,\n\tmembers: Members,\n) {\n\tconst enumObject: {\n\t\t[key in keyof Members as Members[key] extends string\n\t\t\t? Members[key]\n\t\t\t: string]: Members[key] extends string ? Members[key] : string;\n\t} = Object.create(null);\n\tfor (const name of members) {\n\t\tObject.defineProperty(enumObject, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\twritable: false,\n\t\t\tvalue: name,\n\t\t});\n\t}\n\n\treturn adaptEnum(factory, enumObject);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemaFactory.d.ts","sourceRoot":"","sources":["../../src/simple-tree/schemaFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,YAAY,IAAI,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAIpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAuB,KAAK,UAAU,EAAU,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EACN,KAAK,yBAAyB,EAG9B,MAAM,kBAAkB,CAAC;AAU1B,OAAO,EACN,SAAS,EACT,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,0CAA0C,EAC/C,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,UAAU,EAIf,MAAM,kBA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