@fluidframework/tree 2.80.0 → 2.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1138) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/api-report/tree.alpha.api.md +42 -7
  3. package/dist/alpha.d.ts +5 -0
  4. package/dist/codec/codec.d.ts +2 -2
  5. package/dist/codec/codec.d.ts.map +1 -1
  6. package/dist/codec/codec.js +8 -8
  7. package/dist/codec/codec.js.map +1 -1
  8. package/dist/codec/versioned/codec.d.ts +1 -1
  9. package/dist/codec/versioned/codec.d.ts.map +1 -1
  10. package/dist/codec/versioned/codec.js +12 -12
  11. package/dist/codec/versioned/codec.js.map +1 -1
  12. package/dist/core/index.d.ts +1 -1
  13. package/dist/core/index.d.ts.map +1 -1
  14. package/dist/core/index.js.map +1 -1
  15. package/dist/core/rebase/index.d.ts +1 -1
  16. package/dist/core/rebase/index.d.ts.map +1 -1
  17. package/dist/core/rebase/index.js.map +1 -1
  18. package/dist/core/rebase/types.d.ts +44 -7
  19. package/dist/core/rebase/types.d.ts.map +1 -1
  20. package/dist/core/rebase/types.js.map +1 -1
  21. package/dist/core/rebase/utils.d.ts.map +1 -1
  22. package/dist/core/rebase/utils.js +5 -1
  23. package/dist/core/rebase/utils.js.map +1 -1
  24. package/dist/core/schema-stored/formatV2.d.ts.map +1 -1
  25. package/dist/core/schema-stored/formatV2.js +4 -4
  26. package/dist/core/schema-stored/formatV2.js.map +1 -1
  27. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  28. package/dist/core/tree/anchorSet.js +2 -1
  29. package/dist/core/tree/anchorSet.js.map +1 -1
  30. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  31. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  32. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +1 -1
  33. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  34. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  35. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  36. package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -3
  37. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  38. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  39. package/dist/core/tree/detachedFieldIndexCodecV2.js +2 -2
  40. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  41. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  42. package/dist/core/tree/detachedFieldIndexFormatV1.js +3 -3
  43. package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  44. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  45. package/dist/core/tree/detachedFieldIndexFormatV2.js +4 -4
  46. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  47. package/dist/core/tree/visitDelta.d.ts +1 -1
  48. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  49. package/dist/core/tree/visitDelta.js +3 -2
  50. package/dist/core/tree/visitDelta.js.map +1 -1
  51. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  52. package/dist/core/tree/visitorUtils.js +59 -19
  53. package/dist/core/tree/visitorUtils.js.map +1 -1
  54. package/dist/feature-libraries/changeAtomIdBTree.d.ts +6 -1
  55. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  56. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
  58. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  59. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  60. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/chunkedForest.js +3 -1
  62. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  65. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  66. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  67. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  68. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  69. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -1
  70. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  71. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  72. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  73. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  74. package/dist/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  75. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  76. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
  77. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -0
  79. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  80. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  81. package/dist/feature-libraries/chunked-forest/codec/format.js +1 -1
  82. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  83. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  84. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  85. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  86. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  87. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +2 -2
  88. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  89. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  90. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +17 -15
  91. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  92. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +10 -52
  93. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  94. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +23 -64
  95. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  96. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  97. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  98. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  99. package/dist/feature-libraries/fieldKindIdentifiers.d.ts +9 -0
  100. package/dist/feature-libraries/fieldKindIdentifiers.d.ts.map +1 -0
  101. package/dist/feature-libraries/fieldKindIdentifiers.js +16 -0
  102. package/dist/feature-libraries/fieldKindIdentifiers.js.map +1 -0
  103. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  104. package/dist/feature-libraries/flex-tree/lazyField.js +8 -8
  105. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  106. package/dist/feature-libraries/flex-tree/observer.d.ts +1 -1
  107. package/dist/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  108. package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
  109. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  110. package/dist/feature-libraries/forest-summary/codec.js +1 -1
  111. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  112. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  113. package/dist/feature-libraries/forest-summary/forestSummarizer.js +6 -4
  114. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  115. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  116. package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -1
  117. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  118. package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -1
  119. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +4 -4
  120. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  121. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +2 -2
  122. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  123. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
  124. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  125. package/dist/feature-libraries/index.d.ts +1 -1
  126. package/dist/feature-libraries/index.d.ts.map +1 -1
  127. package/dist/feature-libraries/index.js.map +1 -1
  128. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  129. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  130. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  131. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  132. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -1
  133. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  134. package/dist/feature-libraries/modular-schema/genericFieldKind.js +2 -2
  135. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  136. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
  137. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  138. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -0
  139. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  140. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  141. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  142. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  143. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  144. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +1 -1
  145. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  146. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -2
  147. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  148. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +52 -43
  149. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  150. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +3 -3
  151. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  152. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  153. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  154. package/dist/feature-libraries/object-forest/objectForest.js +5 -3
  155. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  156. package/dist/feature-libraries/optional-field/index.d.ts +3 -3
  157. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  158. package/dist/feature-libraries/optional-field/index.js +4 -8
  159. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  160. package/dist/feature-libraries/optional-field/optionalField.d.ts +10 -2
  161. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  162. package/dist/feature-libraries/optional-field/optionalField.js +13 -1
  163. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  164. package/dist/feature-libraries/optional-field/requiredField.d.ts +36 -0
  165. package/dist/feature-libraries/optional-field/requiredField.d.ts.map +1 -0
  166. package/dist/feature-libraries/optional-field/requiredField.js +27 -0
  167. package/dist/feature-libraries/optional-field/requiredField.js.map +1 -0
  168. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +1 -1
  169. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  170. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +7 -7
  171. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  172. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  173. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  174. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
  175. package/dist/feature-libraries/schemaChecker.js +1 -1
  176. package/dist/feature-libraries/schemaChecker.js.map +1 -1
  177. package/dist/feature-libraries/sequence-field/index.d.ts +2 -14
  178. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  179. package/dist/feature-libraries/sequence-field/index.js +3 -30
  180. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  181. package/dist/feature-libraries/sequence-field/rebase.js +1 -1
  182. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  183. package/dist/feature-libraries/sequence-field/sequenceKind.d.ts +16 -0
  184. package/dist/feature-libraries/sequence-field/sequenceKind.d.ts.map +1 -0
  185. package/dist/feature-libraries/sequence-field/sequenceKind.js +24 -0
  186. package/dist/feature-libraries/sequence-field/sequenceKind.js.map +1 -0
  187. package/dist/index.d.ts +3 -2
  188. package/dist/index.d.ts.map +1 -1
  189. package/dist/index.js +5 -1
  190. package/dist/index.js.map +1 -1
  191. package/dist/packageVersion.d.ts +1 -1
  192. package/dist/packageVersion.js +1 -1
  193. package/dist/packageVersion.js.map +1 -1
  194. package/dist/shared-tree/independentView.d.ts.map +1 -1
  195. package/dist/shared-tree/independentView.js +7 -7
  196. package/dist/shared-tree/independentView.js.map +1 -1
  197. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  198. package/dist/shared-tree/schematizingTreeView.js +12 -10
  199. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  200. package/dist/shared-tree/sharedTree.d.ts +2 -2
  201. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  202. package/dist/shared-tree/sharedTree.js +6 -33
  203. package/dist/shared-tree/sharedTree.js.map +1 -1
  204. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  205. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  206. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +31 -24
  207. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  208. package/dist/shared-tree/sharedTreeChangeEnricher.js +75 -58
  209. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  210. package/dist/shared-tree/tree.d.ts.map +1 -1
  211. package/dist/shared-tree/tree.js +14 -14
  212. package/dist/shared-tree/tree.js.map +1 -1
  213. package/dist/shared-tree/treeAlpha.d.ts +1 -1
  214. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  215. package/dist/shared-tree/treeAlpha.js +77 -77
  216. package/dist/shared-tree/treeAlpha.js.map +1 -1
  217. package/dist/shared-tree/treeCheckout.d.ts +21 -6
  218. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  219. package/dist/shared-tree/treeCheckout.js +93 -37
  220. package/dist/shared-tree/treeCheckout.js.map +1 -1
  221. package/dist/shared-tree-core/branch.d.ts +1 -1
  222. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  223. package/dist/shared-tree-core/branch.js +5 -1
  224. package/dist/shared-tree-core/branch.js.map +1 -1
  225. package/dist/shared-tree-core/branchCommitEnricher.d.ts +18 -31
  226. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  227. package/dist/shared-tree-core/branchCommitEnricher.js +24 -76
  228. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  229. package/dist/shared-tree-core/branchIdCodec.d.ts.map +1 -1
  230. package/dist/shared-tree-core/branchIdCodec.js.map +1 -1
  231. package/dist/shared-tree-core/changeEnricher.d.ts +8 -43
  232. package/dist/shared-tree-core/changeEnricher.d.ts.map +1 -1
  233. package/dist/shared-tree-core/changeEnricher.js +0 -13
  234. package/dist/shared-tree-core/changeEnricher.js.map +1 -1
  235. package/dist/shared-tree-core/defaultResubmitMachine.d.ts +4 -12
  236. package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  237. package/dist/shared-tree-core/defaultResubmitMachine.js +26 -36
  238. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  239. package/dist/shared-tree-core/editManager.d.ts +1 -1
  240. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  241. package/dist/shared-tree-core/editManager.js +13 -7
  242. package/dist/shared-tree-core/editManager.js.map +1 -1
  243. package/dist/shared-tree-core/editManagerCodecs.d.ts +1 -1
  244. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  245. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  246. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  247. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  248. package/dist/shared-tree-core/editManagerCodecsCommons.js +1 -2
  249. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  250. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  251. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  252. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  253. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  254. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  255. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  256. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  257. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  258. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  259. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  260. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
  261. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  262. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
  263. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  264. package/dist/shared-tree-core/index.d.ts +2 -2
  265. package/dist/shared-tree-core/index.d.ts.map +1 -1
  266. package/dist/shared-tree-core/index.js +1 -3
  267. package/dist/shared-tree-core/index.js.map +1 -1
  268. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  269. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  270. package/dist/shared-tree-core/messageCodecV1ToV4.js +1 -1
  271. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  272. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts +1 -1
  273. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  274. package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -2
  275. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  276. package/dist/shared-tree-core/messageCodecs.d.ts +2 -2
  277. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  278. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  279. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  280. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  281. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  282. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  283. package/dist/shared-tree-core/messageTypes.d.ts.map +1 -1
  284. package/dist/shared-tree-core/messageTypes.js.map +1 -1
  285. package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -4
  286. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  287. package/dist/shared-tree-core/sharedTreeCore.js +13 -13
  288. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  289. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  290. package/dist/shared-tree-core/versionedSummarizer.js +1 -1
  291. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
  292. package/dist/simple-tree/api/configuration.d.ts +2 -2
  293. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  294. package/dist/simple-tree/api/configuration.js +14 -14
  295. package/dist/simple-tree/api/configuration.js.map +1 -1
  296. package/dist/simple-tree/api/create.d.ts +1 -1
  297. package/dist/simple-tree/api/create.d.ts.map +1 -1
  298. package/dist/simple-tree/api/create.js +7 -7
  299. package/dist/simple-tree/api/create.js.map +1 -1
  300. package/dist/simple-tree/api/dirtyIndex.d.ts +1 -1
  301. package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  302. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  303. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  304. package/dist/simple-tree/api/discrepancies.js +23 -23
  305. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  306. package/dist/simple-tree/api/getJsonSchema.d.ts +1 -1
  307. package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  308. package/dist/simple-tree/api/getJsonSchema.js +1 -1
  309. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  310. package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
  311. package/dist/simple-tree/api/identifierIndex.d.ts.map +1 -1
  312. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  313. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  314. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  315. package/dist/simple-tree/api/incrementalAllowedTypes.js +6 -6
  316. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  317. package/dist/simple-tree/api/index.d.ts +1 -1
  318. package/dist/simple-tree/api/index.d.ts.map +1 -1
  319. package/dist/simple-tree/api/index.js +2 -1
  320. package/dist/simple-tree/api/index.js.map +1 -1
  321. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  322. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  323. package/dist/simple-tree/api/schemaCompatibilityTester.js +1 -1
  324. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  325. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +2 -2
  326. package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  327. package/dist/simple-tree/api/schemaCreationUtilities.js +7 -7
  328. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  329. package/dist/simple-tree/api/schemaFactory.d.ts +2 -2
  330. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  331. package/dist/simple-tree/api/schemaFactory.js +7 -7
  332. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  333. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +6 -6
  334. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  335. package/dist/simple-tree/api/schemaFactoryAlpha.js +2 -2
  336. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  337. package/dist/simple-tree/api/schemaFactoryBeta.d.ts +2 -2
  338. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  339. package/dist/simple-tree/api/schemaFactoryBeta.js +2 -1
  340. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  341. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
  342. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  343. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  344. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  345. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  346. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  347. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  348. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +1 -1
  349. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  350. package/dist/simple-tree/api/simpleSchemaCodec.js +17 -17
  351. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  352. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +2 -2
  353. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  354. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +6 -6
  355. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  356. package/dist/simple-tree/api/simpleTreeIndex.d.ts +1 -1
  357. package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  358. package/dist/simple-tree/api/simpleTreeIndex.js +1 -1
  359. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  360. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
  361. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  362. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +298 -2
  363. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  364. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  365. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  366. package/dist/simple-tree/api/tree.d.ts +5 -3
  367. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  368. package/dist/simple-tree/api/tree.js.map +1 -1
  369. package/dist/simple-tree/api/treeBeta.d.ts +1 -1
  370. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  371. package/dist/simple-tree/api/treeBeta.js +2 -2
  372. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  373. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  374. package/dist/simple-tree/api/treeNodeApi.js +4 -4
  375. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  376. package/dist/simple-tree/api/typesUnsafe.d.ts +1 -1
  377. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  378. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  379. package/dist/simple-tree/api/verboseTree.d.ts +1 -1
  380. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  381. package/dist/simple-tree/api/verboseTree.js +22 -22
  382. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  383. package/dist/simple-tree/core/allowedTypes.d.ts +1 -1
  384. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  385. package/dist/simple-tree/core/allowedTypes.js +7 -7
  386. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  387. package/dist/simple-tree/core/context.d.ts.map +1 -1
  388. package/dist/simple-tree/core/context.js.map +1 -1
  389. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  390. package/dist/simple-tree/core/treeNode.js +1 -1
  391. package/dist/simple-tree/core/treeNode.js.map +1 -1
  392. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  393. package/dist/simple-tree/core/treeNodeKernel.js +7 -5
  394. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  395. package/dist/simple-tree/core/treeNodeSchema.d.ts +5 -5
  396. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  397. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  398. package/dist/simple-tree/core/treeNodeValid.d.ts +3 -3
  399. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  400. package/dist/simple-tree/core/treeNodeValid.js +2 -2
  401. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  402. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
  403. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  404. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  405. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  406. package/dist/simple-tree/core/withType.js.map +1 -1
  407. package/dist/simple-tree/createContext.d.ts.map +1 -1
  408. package/dist/simple-tree/createContext.js.map +1 -1
  409. package/dist/simple-tree/fieldSchema.d.ts +1 -1
  410. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  411. package/dist/simple-tree/fieldSchema.js.map +1 -1
  412. package/dist/simple-tree/index.d.ts +1 -1
  413. package/dist/simple-tree/index.d.ts.map +1 -1
  414. package/dist/simple-tree/index.js +3 -2
  415. package/dist/simple-tree/index.js.map +1 -1
  416. package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
  417. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  418. package/dist/simple-tree/leafNodeSchema.js +15 -15
  419. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  420. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +1 -1
  421. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  422. package/dist/simple-tree/node-kinds/array/arrayNode.js +46 -46
  423. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  424. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +1 -1
  425. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  426. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  427. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  428. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  429. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +2 -2
  430. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  431. package/dist/simple-tree/node-kinds/map/mapNode.js +24 -24
  432. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  433. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +1 -1
  434. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  435. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  436. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +2 -2
  437. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  438. package/dist/simple-tree/node-kinds/object/objectNode.js +9 -9
  439. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  440. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +3 -3
  441. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  442. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  443. package/dist/simple-tree/node-kinds/record/recordNode.d.ts +1 -1
  444. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  445. package/dist/simple-tree/node-kinds/record/recordNode.js +34 -34
  446. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  447. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +1 -1
  448. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  449. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  450. package/dist/simple-tree/prepareForInsertion.d.ts +2 -2
  451. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  452. package/dist/simple-tree/prepareForInsertion.js +13 -13
  453. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  454. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  455. package/dist/simple-tree/simpleSchema.js.map +1 -1
  456. package/dist/simple-tree/treeSchema.d.ts.map +1 -1
  457. package/dist/simple-tree/treeSchema.js.map +1 -1
  458. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +1 -1
  459. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  460. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +10 -10
  461. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  462. package/dist/tableSchema.d.ts.map +1 -1
  463. package/dist/tableSchema.js +22 -21
  464. package/dist/tableSchema.js.map +1 -1
  465. package/dist/text/index.d.ts +7 -0
  466. package/dist/text/index.d.ts.map +1 -0
  467. package/dist/text/index.js +12 -0
  468. package/dist/text/index.js.map +1 -0
  469. package/dist/text/textDomain.d.ts +146 -0
  470. package/dist/text/textDomain.d.ts.map +1 -0
  471. package/dist/text/textDomain.js +122 -0
  472. package/dist/text/textDomain.js.map +1 -0
  473. package/dist/text/textDomainFormatted.d.ts +572 -0
  474. package/dist/text/textDomainFormatted.d.ts.map +1 -0
  475. package/dist/text/textDomainFormatted.js +183 -0
  476. package/dist/text/textDomainFormatted.js.map +1 -0
  477. package/dist/treeFactory.d.ts.map +1 -1
  478. package/dist/treeFactory.js +9 -9
  479. package/dist/treeFactory.js.map +1 -1
  480. package/dist/util/bTreeUtils.d.ts +12 -4
  481. package/dist/util/bTreeUtils.d.ts.map +1 -1
  482. package/dist/util/bTreeUtils.js +14 -18
  483. package/dist/util/bTreeUtils.js.map +1 -1
  484. package/dist/util/nestedMap.js +12 -12
  485. package/dist/util/nestedMap.js.map +1 -1
  486. package/dist/util/readSnapshotBlob.d.ts +1 -1
  487. package/dist/util/readSnapshotBlob.d.ts.map +1 -1
  488. package/dist/util/readSnapshotBlob.js.map +1 -1
  489. package/docs/user-facing/merge-semantics.md +3 -2
  490. package/eslint.config.mts +8 -36
  491. package/lib/alpha.d.ts +5 -0
  492. package/lib/codec/codec.d.ts +2 -2
  493. package/lib/codec/codec.d.ts.map +1 -1
  494. package/lib/codec/codec.js +1 -1
  495. package/lib/codec/codec.js.map +1 -1
  496. package/lib/codec/versioned/codec.d.ts +1 -1
  497. package/lib/codec/versioned/codec.d.ts.map +1 -1
  498. package/lib/codec/versioned/codec.js +2 -2
  499. package/lib/codec/versioned/codec.js.map +1 -1
  500. package/lib/core/index.d.ts +1 -1
  501. package/lib/core/index.d.ts.map +1 -1
  502. package/lib/core/index.js.map +1 -1
  503. package/lib/core/rebase/index.d.ts +1 -1
  504. package/lib/core/rebase/index.d.ts.map +1 -1
  505. package/lib/core/rebase/index.js.map +1 -1
  506. package/lib/core/rebase/types.d.ts +44 -7
  507. package/lib/core/rebase/types.d.ts.map +1 -1
  508. package/lib/core/rebase/types.js.map +1 -1
  509. package/lib/core/rebase/utils.d.ts.map +1 -1
  510. package/lib/core/rebase/utils.js +5 -1
  511. package/lib/core/rebase/utils.js.map +1 -1
  512. package/lib/core/schema-stored/formatV2.d.ts.map +1 -1
  513. package/lib/core/schema-stored/formatV2.js +1 -1
  514. package/lib/core/schema-stored/formatV2.js.map +1 -1
  515. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  516. package/lib/core/tree/anchorSet.js +2 -1
  517. package/lib/core/tree/anchorSet.js.map +1 -1
  518. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  519. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  520. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +1 -1
  521. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  522. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  523. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  524. package/lib/core/tree/detachedFieldIndexCodecV1.js +1 -1
  525. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  526. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  527. package/lib/core/tree/detachedFieldIndexCodecV2.js +2 -2
  528. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  529. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  530. package/lib/core/tree/detachedFieldIndexFormatV1.js +2 -2
  531. package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  532. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  533. package/lib/core/tree/detachedFieldIndexFormatV2.js +2 -2
  534. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  535. package/lib/core/tree/visitDelta.d.ts +1 -1
  536. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  537. package/lib/core/tree/visitDelta.js +3 -2
  538. package/lib/core/tree/visitDelta.js.map +1 -1
  539. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  540. package/lib/core/tree/visitorUtils.js +59 -19
  541. package/lib/core/tree/visitorUtils.js.map +1 -1
  542. package/lib/feature-libraries/changeAtomIdBTree.d.ts +6 -1
  543. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  544. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
  545. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
  546. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  547. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  548. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  549. package/lib/feature-libraries/chunked-forest/chunkedForest.js +3 -1
  550. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  551. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  552. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  553. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  554. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  555. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  556. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  557. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -1
  558. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  559. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  560. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  561. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  562. package/lib/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  563. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  564. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
  565. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  566. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -0
  567. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  568. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  569. package/lib/feature-libraries/chunked-forest/codec/format.js +1 -1
  570. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  571. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  572. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  573. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  574. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  575. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +2 -2
  576. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  577. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  578. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +5 -3
  579. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  580. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +10 -52
  581. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  582. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +4 -45
  583. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  584. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  585. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  586. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  587. package/lib/feature-libraries/fieldKindIdentifiers.d.ts +9 -0
  588. package/lib/feature-libraries/fieldKindIdentifiers.d.ts.map +1 -0
  589. package/lib/feature-libraries/fieldKindIdentifiers.js +13 -0
  590. package/lib/feature-libraries/fieldKindIdentifiers.js.map +1 -0
  591. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  592. package/lib/feature-libraries/flex-tree/lazyField.js +1 -1
  593. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  594. package/lib/feature-libraries/flex-tree/observer.d.ts +1 -1
  595. package/lib/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  596. package/lib/feature-libraries/flex-tree/observer.js.map +1 -1
  597. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  598. package/lib/feature-libraries/forest-summary/codec.js +1 -1
  599. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  600. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  601. package/lib/feature-libraries/forest-summary/forestSummarizer.js +6 -4
  602. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  603. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  604. package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -1
  605. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  606. package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -1
  607. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +4 -4
  608. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  609. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +2 -2
  610. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  611. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
  612. package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  613. package/lib/feature-libraries/index.d.ts +1 -1
  614. package/lib/feature-libraries/index.d.ts.map +1 -1
  615. package/lib/feature-libraries/index.js.map +1 -1
  616. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  617. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  618. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  619. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  620. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -1
  621. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  622. package/lib/feature-libraries/modular-schema/genericFieldKind.js +2 -2
  623. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  624. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
  625. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  626. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -0
  627. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  628. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  629. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  630. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  631. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  632. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +1 -1
  633. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  634. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -2
  635. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  636. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +52 -43
  637. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  638. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +3 -3
  639. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  640. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  641. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  642. package/lib/feature-libraries/object-forest/objectForest.js +5 -3
  643. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  644. package/lib/feature-libraries/optional-field/index.d.ts +3 -3
  645. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  646. package/lib/feature-libraries/optional-field/index.js +2 -2
  647. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  648. package/lib/feature-libraries/optional-field/optionalField.d.ts +10 -2
  649. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  650. package/lib/feature-libraries/optional-field/optionalField.js +14 -2
  651. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  652. package/lib/feature-libraries/optional-field/requiredField.d.ts +36 -0
  653. package/lib/feature-libraries/optional-field/requiredField.d.ts.map +1 -0
  654. package/lib/feature-libraries/optional-field/requiredField.js +24 -0
  655. package/lib/feature-libraries/optional-field/requiredField.js.map +1 -0
  656. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +1 -1
  657. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  658. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +1 -1
  659. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  660. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  661. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  662. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
  663. package/lib/feature-libraries/schemaChecker.js +1 -1
  664. package/lib/feature-libraries/schemaChecker.js.map +1 -1
  665. package/lib/feature-libraries/sequence-field/index.d.ts +2 -14
  666. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  667. package/lib/feature-libraries/sequence-field/index.js +1 -13
  668. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  669. package/lib/feature-libraries/sequence-field/rebase.js +1 -1
  670. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  671. package/lib/feature-libraries/sequence-field/sequenceKind.d.ts +16 -0
  672. package/lib/feature-libraries/sequence-field/sequenceKind.d.ts.map +1 -0
  673. package/lib/feature-libraries/sequence-field/sequenceKind.js +21 -0
  674. package/lib/feature-libraries/sequence-field/sequenceKind.js.map +1 -0
  675. package/lib/index.d.ts +3 -2
  676. package/lib/index.d.ts.map +1 -1
  677. package/lib/index.js +2 -1
  678. package/lib/index.js.map +1 -1
  679. package/lib/packageVersion.d.ts +1 -1
  680. package/lib/packageVersion.js +1 -1
  681. package/lib/packageVersion.js.map +1 -1
  682. package/lib/shared-tree/independentView.d.ts.map +1 -1
  683. package/lib/shared-tree/independentView.js +3 -3
  684. package/lib/shared-tree/independentView.js.map +1 -1
  685. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  686. package/lib/shared-tree/schematizingTreeView.js +12 -10
  687. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  688. package/lib/shared-tree/sharedTree.d.ts +2 -2
  689. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  690. package/lib/shared-tree/sharedTree.js +6 -33
  691. package/lib/shared-tree/sharedTree.js.map +1 -1
  692. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  693. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  694. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +31 -24
  695. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  696. package/lib/shared-tree/sharedTreeChangeEnricher.js +73 -55
  697. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  698. package/lib/shared-tree/tree.d.ts.map +1 -1
  699. package/lib/shared-tree/tree.js +7 -7
  700. package/lib/shared-tree/tree.js.map +1 -1
  701. package/lib/shared-tree/treeAlpha.d.ts +1 -1
  702. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  703. package/lib/shared-tree/treeAlpha.js +3 -3
  704. package/lib/shared-tree/treeAlpha.js.map +1 -1
  705. package/lib/shared-tree/treeCheckout.d.ts +21 -6
  706. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  707. package/lib/shared-tree/treeCheckout.js +67 -11
  708. package/lib/shared-tree/treeCheckout.js.map +1 -1
  709. package/lib/shared-tree-core/branch.d.ts +1 -1
  710. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  711. package/lib/shared-tree-core/branch.js +5 -1
  712. package/lib/shared-tree-core/branch.js.map +1 -1
  713. package/lib/shared-tree-core/branchCommitEnricher.d.ts +18 -31
  714. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  715. package/lib/shared-tree-core/branchCommitEnricher.js +24 -76
  716. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  717. package/lib/shared-tree-core/branchIdCodec.d.ts.map +1 -1
  718. package/lib/shared-tree-core/branchIdCodec.js.map +1 -1
  719. package/lib/shared-tree-core/changeEnricher.d.ts +8 -43
  720. package/lib/shared-tree-core/changeEnricher.d.ts.map +1 -1
  721. package/lib/shared-tree-core/changeEnricher.js +1 -11
  722. package/lib/shared-tree-core/changeEnricher.js.map +1 -1
  723. package/lib/shared-tree-core/defaultResubmitMachine.d.ts +4 -12
  724. package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  725. package/lib/shared-tree-core/defaultResubmitMachine.js +28 -38
  726. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  727. package/lib/shared-tree-core/editManager.d.ts +1 -1
  728. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  729. package/lib/shared-tree-core/editManager.js +13 -7
  730. package/lib/shared-tree-core/editManager.js.map +1 -1
  731. package/lib/shared-tree-core/editManagerCodecs.d.ts +1 -1
  732. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  733. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  734. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  735. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  736. package/lib/shared-tree-core/editManagerCodecsCommons.js +1 -2
  737. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  738. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  739. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  740. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  741. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  742. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  743. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  744. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  745. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  746. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  747. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  748. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
  749. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  750. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
  751. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  752. package/lib/shared-tree-core/index.d.ts +2 -2
  753. package/lib/shared-tree-core/index.d.ts.map +1 -1
  754. package/lib/shared-tree-core/index.js +0 -1
  755. package/lib/shared-tree-core/index.js.map +1 -1
  756. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  757. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  758. package/lib/shared-tree-core/messageCodecV1ToV4.js +1 -1
  759. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  760. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts +1 -1
  761. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  762. package/lib/shared-tree-core/messageCodecVSharedBranches.js +2 -2
  763. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  764. package/lib/shared-tree-core/messageCodecs.d.ts +2 -2
  765. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  766. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  767. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  768. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  769. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  770. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  771. package/lib/shared-tree-core/messageTypes.d.ts.map +1 -1
  772. package/lib/shared-tree-core/messageTypes.js.map +1 -1
  773. package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -4
  774. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  775. package/lib/shared-tree-core/sharedTreeCore.js +14 -14
  776. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  777. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  778. package/lib/shared-tree-core/versionedSummarizer.js +1 -1
  779. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
  780. package/lib/simple-tree/api/configuration.d.ts +2 -2
  781. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  782. package/lib/simple-tree/api/configuration.js +4 -4
  783. package/lib/simple-tree/api/configuration.js.map +1 -1
  784. package/lib/simple-tree/api/create.d.ts +1 -1
  785. package/lib/simple-tree/api/create.d.ts.map +1 -1
  786. package/lib/simple-tree/api/create.js +1 -1
  787. package/lib/simple-tree/api/create.js.map +1 -1
  788. package/lib/simple-tree/api/dirtyIndex.d.ts +1 -1
  789. package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  790. package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
  791. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  792. package/lib/simple-tree/api/discrepancies.js +3 -3
  793. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  794. package/lib/simple-tree/api/getJsonSchema.d.ts +1 -1
  795. package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  796. package/lib/simple-tree/api/getJsonSchema.js +1 -1
  797. package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
  798. package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
  799. package/lib/simple-tree/api/identifierIndex.d.ts.map +1 -1
  800. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  801. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  802. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  803. package/lib/simple-tree/api/incrementalAllowedTypes.js +3 -3
  804. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  805. package/lib/simple-tree/api/index.d.ts +1 -1
  806. package/lib/simple-tree/api/index.d.ts.map +1 -1
  807. package/lib/simple-tree/api/index.js +1 -1
  808. package/lib/simple-tree/api/index.js.map +1 -1
  809. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  810. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  811. package/lib/simple-tree/api/schemaCompatibilityTester.js +1 -1
  812. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  813. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +2 -2
  814. package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  815. package/lib/simple-tree/api/schemaCreationUtilities.js +1 -1
  816. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  817. package/lib/simple-tree/api/schemaFactory.d.ts +2 -2
  818. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  819. package/lib/simple-tree/api/schemaFactory.js +2 -2
  820. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  821. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +6 -6
  822. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  823. package/lib/simple-tree/api/schemaFactoryAlpha.js +2 -2
  824. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  825. package/lib/simple-tree/api/schemaFactoryBeta.d.ts +2 -2
  826. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  827. package/lib/simple-tree/api/schemaFactoryBeta.js +2 -1
  828. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  829. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
  830. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  831. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  832. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  833. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  834. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  835. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  836. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +1 -1
  837. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  838. package/lib/simple-tree/api/simpleSchemaCodec.js +3 -3
  839. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  840. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +2 -2
  841. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  842. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +6 -6
  843. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  844. package/lib/simple-tree/api/simpleTreeIndex.d.ts +1 -1
  845. package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  846. package/lib/simple-tree/api/simpleTreeIndex.js +1 -1
  847. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  848. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
  849. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  850. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +271 -1
  851. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  852. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  853. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  854. package/lib/simple-tree/api/tree.d.ts +5 -3
  855. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  856. package/lib/simple-tree/api/tree.js.map +1 -1
  857. package/lib/simple-tree/api/treeBeta.d.ts +1 -1
  858. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  859. package/lib/simple-tree/api/treeBeta.js +2 -2
  860. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  861. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  862. package/lib/simple-tree/api/treeNodeApi.js +4 -4
  863. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  864. package/lib/simple-tree/api/typesUnsafe.d.ts +1 -1
  865. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  866. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  867. package/lib/simple-tree/api/verboseTree.d.ts +1 -1
  868. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  869. package/lib/simple-tree/api/verboseTree.js +3 -3
  870. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  871. package/lib/simple-tree/core/allowedTypes.d.ts +1 -1
  872. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  873. package/lib/simple-tree/core/allowedTypes.js +2 -2
  874. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  875. package/lib/simple-tree/core/context.d.ts.map +1 -1
  876. package/lib/simple-tree/core/context.js.map +1 -1
  877. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  878. package/lib/simple-tree/core/treeNode.js +1 -1
  879. package/lib/simple-tree/core/treeNode.js.map +1 -1
  880. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  881. package/lib/simple-tree/core/treeNodeKernel.js +7 -5
  882. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  883. package/lib/simple-tree/core/treeNodeSchema.d.ts +5 -5
  884. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  885. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  886. package/lib/simple-tree/core/treeNodeValid.d.ts +3 -3
  887. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  888. package/lib/simple-tree/core/treeNodeValid.js +2 -2
  889. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  890. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
  891. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  892. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  893. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  894. package/lib/simple-tree/core/withType.js.map +1 -1
  895. package/lib/simple-tree/createContext.d.ts.map +1 -1
  896. package/lib/simple-tree/createContext.js.map +1 -1
  897. package/lib/simple-tree/fieldSchema.d.ts +1 -1
  898. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  899. package/lib/simple-tree/fieldSchema.js.map +1 -1
  900. package/lib/simple-tree/index.d.ts +1 -1
  901. package/lib/simple-tree/index.d.ts.map +1 -1
  902. package/lib/simple-tree/index.js +1 -1
  903. package/lib/simple-tree/index.js.map +1 -1
  904. package/lib/simple-tree/leafNodeSchema.d.ts +1 -1
  905. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  906. package/lib/simple-tree/leafNodeSchema.js +2 -2
  907. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  908. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +1 -1
  909. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  910. package/lib/simple-tree/node-kinds/array/arrayNode.js +5 -5
  911. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  912. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +1 -1
  913. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  914. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  915. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  916. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  917. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +2 -2
  918. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  919. package/lib/simple-tree/node-kinds/map/mapNode.js +6 -6
  920. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  921. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +1 -1
  922. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  923. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  924. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +2 -2
  925. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  926. package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
  927. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  928. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +3 -3
  929. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  930. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  931. package/lib/simple-tree/node-kinds/record/recordNode.d.ts +1 -1
  932. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  933. package/lib/simple-tree/node-kinds/record/recordNode.js +4 -4
  934. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  935. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +1 -1
  936. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  937. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  938. package/lib/simple-tree/prepareForInsertion.d.ts +2 -2
  939. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  940. package/lib/simple-tree/prepareForInsertion.js +4 -4
  941. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  942. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  943. package/lib/simple-tree/simpleSchema.js.map +1 -1
  944. package/lib/simple-tree/treeSchema.d.ts.map +1 -1
  945. package/lib/simple-tree/treeSchema.js.map +1 -1
  946. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +1 -1
  947. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  948. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +2 -2
  949. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  950. package/lib/tableSchema.d.ts.map +1 -1
  951. package/lib/tableSchema.js +2 -1
  952. package/lib/tableSchema.js.map +1 -1
  953. package/lib/text/index.d.ts +7 -0
  954. package/lib/text/index.d.ts.map +1 -0
  955. package/lib/text/index.js +7 -0
  956. package/lib/text/index.js.map +1 -0
  957. package/lib/text/textDomain.d.ts +146 -0
  958. package/lib/text/textDomain.d.ts.map +1 -0
  959. package/lib/text/textDomain.js +118 -0
  960. package/lib/text/textDomain.js.map +1 -0
  961. package/lib/text/textDomainFormatted.d.ts +572 -0
  962. package/lib/text/textDomainFormatted.d.ts.map +1 -0
  963. package/lib/text/textDomainFormatted.js +180 -0
  964. package/lib/text/textDomainFormatted.js.map +1 -0
  965. package/lib/treeFactory.d.ts.map +1 -1
  966. package/lib/treeFactory.js +2 -2
  967. package/lib/treeFactory.js.map +1 -1
  968. package/lib/util/bTreeUtils.d.ts +12 -4
  969. package/lib/util/bTreeUtils.d.ts.map +1 -1
  970. package/lib/util/bTreeUtils.js +15 -19
  971. package/lib/util/bTreeUtils.js.map +1 -1
  972. package/lib/util/nestedMap.js +12 -12
  973. package/lib/util/nestedMap.js.map +1 -1
  974. package/lib/util/readSnapshotBlob.d.ts +1 -1
  975. package/lib/util/readSnapshotBlob.d.ts.map +1 -1
  976. package/lib/util/readSnapshotBlob.js.map +1 -1
  977. package/package.json +25 -25
  978. package/src/codec/codec.ts +10 -7
  979. package/src/codec/versioned/codec.ts +3 -3
  980. package/src/core/index.ts +2 -0
  981. package/src/core/rebase/index.ts +2 -0
  982. package/src/core/rebase/types.ts +57 -20
  983. package/src/core/rebase/utils.ts +8 -4
  984. package/src/core/schema-stored/formatV2.ts +2 -1
  985. package/src/core/tree/anchorSet.ts +2 -1
  986. package/src/core/tree/detachedFieldIndex.ts +1 -1
  987. package/src/core/tree/detachedFieldIndexCodecCommon.ts +2 -1
  988. package/src/core/tree/detachedFieldIndexCodecV1.ts +2 -2
  989. package/src/core/tree/detachedFieldIndexCodecV2.ts +3 -3
  990. package/src/core/tree/detachedFieldIndexFormatV1.ts +3 -2
  991. package/src/core/tree/detachedFieldIndexFormatV2.ts +3 -2
  992. package/src/core/tree/visitDelta.ts +8 -5
  993. package/src/core/tree/visitorUtils.ts +57 -20
  994. package/src/feature-libraries/changeAtomIdBTree.ts +9 -1
  995. package/src/feature-libraries/chunked-forest/chunkTree.ts +1 -1
  996. package/src/feature-libraries/chunked-forest/chunkedForest.ts +3 -1
  997. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +1 -1
  998. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
  999. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -1
  1000. package/src/feature-libraries/chunked-forest/codec/codecs.ts +2 -2
  1001. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +2 -1
  1002. package/src/feature-libraries/chunked-forest/codec/format.ts +1 -1
  1003. package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +1 -0
  1004. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +3 -3
  1005. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +5 -10
  1006. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +22 -110
  1007. package/src/feature-libraries/default-schema/index.ts +0 -5
  1008. package/src/feature-libraries/fieldKindIdentifiers.ts +16 -0
  1009. package/src/feature-libraries/flex-tree/lazyField.ts +1 -1
  1010. package/src/feature-libraries/flex-tree/observer.ts +3 -1
  1011. package/src/feature-libraries/forest-summary/codec.ts +1 -1
  1012. package/src/feature-libraries/forest-summary/forestSummarizer.ts +9 -7
  1013. package/src/feature-libraries/forest-summary/formatV1.ts +1 -0
  1014. package/src/feature-libraries/forest-summary/formatV2.ts +1 -0
  1015. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +9 -7
  1016. package/src/feature-libraries/forest-summary/summaryTypes.ts +1 -0
  1017. package/src/feature-libraries/index.ts +0 -5
  1018. package/src/feature-libraries/mapTreeCursor.ts +1 -1
  1019. package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +1 -0
  1020. package/src/feature-libraries/modular-schema/genericFieldKind.ts +2 -2
  1021. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +3 -1
  1022. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +2 -2
  1023. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +3 -2
  1024. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +83 -74
  1025. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +3 -3
  1026. package/src/feature-libraries/object-forest/objectForest.ts +5 -3
  1027. package/src/feature-libraries/optional-field/index.ts +6 -8
  1028. package/src/feature-libraries/optional-field/optionalField.ts +31 -0
  1029. package/src/feature-libraries/optional-field/requiredField.ts +62 -0
  1030. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +1 -1
  1031. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +1 -0
  1032. package/src/feature-libraries/schemaChecker.ts +3 -2
  1033. package/src/feature-libraries/sequence-field/index.ts +2 -51
  1034. package/src/feature-libraries/sequence-field/rebase.ts +1 -1
  1035. package/src/feature-libraries/sequence-field/sequenceKind.ts +40 -0
  1036. package/src/index.ts +7 -0
  1037. package/src/packageVersion.ts +1 -1
  1038. package/src/shared-tree/independentView.ts +4 -3
  1039. package/src/shared-tree/schematizingTreeView.ts +17 -13
  1040. package/src/shared-tree/sharedTree.ts +9 -46
  1041. package/src/shared-tree/sharedTreeChangeCodecs.ts +1 -0
  1042. package/src/shared-tree/sharedTreeChangeEnricher.ts +87 -66
  1043. package/src/shared-tree/tree.ts +10 -10
  1044. package/src/shared-tree/treeAlpha.ts +26 -25
  1045. package/src/shared-tree/treeCheckout.ts +119 -23
  1046. package/src/shared-tree-core/branch.ts +9 -5
  1047. package/src/shared-tree-core/branchCommitEnricher.ts +25 -77
  1048. package/src/shared-tree-core/branchIdCodec.ts +1 -0
  1049. package/src/shared-tree-core/changeEnricher.ts +8 -52
  1050. package/src/shared-tree-core/defaultResubmitMachine.ts +39 -51
  1051. package/src/shared-tree-core/editManager.ts +32 -32
  1052. package/src/shared-tree-core/editManagerCodecs.ts +2 -2
  1053. package/src/shared-tree-core/editManagerCodecsCommons.ts +7 -6
  1054. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +1 -1
  1055. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -2
  1056. package/src/shared-tree-core/editManagerFormatCommons.ts +1 -0
  1057. package/src/shared-tree-core/editManagerFormatV1toV4.ts +1 -0
  1058. package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +3 -2
  1059. package/src/shared-tree-core/index.ts +2 -5
  1060. package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -3
  1061. package/src/shared-tree-core/messageCodecVSharedBranches.ts +4 -4
  1062. package/src/shared-tree-core/messageCodecs.ts +2 -2
  1063. package/src/shared-tree-core/messageFormatV1ToV4.ts +1 -0
  1064. package/src/shared-tree-core/messageFormatVSharedBranches.ts +1 -0
  1065. package/src/shared-tree-core/messageTypes.ts +1 -0
  1066. package/src/shared-tree-core/sharedTreeCore.ts +27 -28
  1067. package/src/shared-tree-core/versionedSummarizer.ts +3 -1
  1068. package/src/simple-tree/api/configuration.ts +9 -9
  1069. package/src/simple-tree/api/create.ts +7 -6
  1070. package/src/simple-tree/api/dirtyIndex.ts +4 -2
  1071. package/src/simple-tree/api/discrepancies.ts +9 -8
  1072. package/src/simple-tree/api/getJsonSchema.ts +4 -3
  1073. package/src/simple-tree/api/identifierIndex.ts +4 -2
  1074. package/src/simple-tree/api/incrementalAllowedTypes.ts +6 -5
  1075. package/src/simple-tree/api/index.ts +3 -0
  1076. package/src/simple-tree/api/schemaCompatibilityTester.ts +3 -3
  1077. package/src/simple-tree/api/schemaCreationUtilities.ts +4 -3
  1078. package/src/simple-tree/api/schemaFactory.ts +16 -17
  1079. package/src/simple-tree/api/schemaFactoryAlpha.ts +22 -22
  1080. package/src/simple-tree/api/schemaFactoryBeta.ts +18 -16
  1081. package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -1
  1082. package/src/simple-tree/api/schemaFromSimple.ts +1 -1
  1083. package/src/simple-tree/api/schemaStatics.ts +2 -0
  1084. package/src/simple-tree/api/simpleSchemaCodec.ts +12 -11
  1085. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +24 -22
  1086. package/src/simple-tree/api/simpleTreeIndex.ts +6 -4
  1087. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +504 -1
  1088. package/src/simple-tree/api/storedSchema.ts +2 -1
  1089. package/src/simple-tree/api/tree.ts +5 -3
  1090. package/src/simple-tree/api/treeBeta.ts +3 -3
  1091. package/src/simple-tree/api/treeNodeApi.ts +14 -13
  1092. package/src/simple-tree/api/typesUnsafe.ts +7 -8
  1093. package/src/simple-tree/api/verboseTree.ts +6 -5
  1094. package/src/simple-tree/core/allowedTypes.ts +4 -4
  1095. package/src/simple-tree/core/context.ts +1 -1
  1096. package/src/simple-tree/core/treeNode.ts +1 -1
  1097. package/src/simple-tree/core/treeNodeKernel.ts +7 -5
  1098. package/src/simple-tree/core/treeNodeSchema.ts +7 -6
  1099. package/src/simple-tree/core/treeNodeValid.ts +9 -9
  1100. package/src/simple-tree/core/unhydratedFlexTree.ts +1 -1
  1101. package/src/simple-tree/core/withType.ts +3 -2
  1102. package/src/simple-tree/createContext.ts +1 -0
  1103. package/src/simple-tree/fieldSchema.ts +1 -2
  1104. package/src/simple-tree/index.ts +3 -0
  1105. package/src/simple-tree/leafNodeSchema.ts +3 -3
  1106. package/src/simple-tree/node-kinds/array/arrayNode.ts +17 -16
  1107. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +2 -2
  1108. package/src/simple-tree/node-kinds/common.ts +1 -1
  1109. package/src/simple-tree/node-kinds/map/mapNode.ts +16 -15
  1110. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +2 -2
  1111. package/src/simple-tree/node-kinds/object/objectNode.ts +11 -11
  1112. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +8 -7
  1113. package/src/simple-tree/node-kinds/record/recordNode.ts +12 -12
  1114. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +1 -2
  1115. package/src/simple-tree/prepareForInsertion.ts +10 -8
  1116. package/src/simple-tree/simpleSchema.ts +1 -0
  1117. package/src/simple-tree/treeSchema.ts +1 -0
  1118. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +2 -2
  1119. package/src/tableSchema.ts +3 -1
  1120. package/src/text/README.md +8 -0
  1121. package/src/text/index.ts +7 -0
  1122. package/src/text/textDomain.ts +199 -0
  1123. package/src/text/textDomainFormatted.ts +309 -0
  1124. package/src/treeFactory.ts +4 -4
  1125. package/src/util/bTreeUtils.ts +33 -22
  1126. package/src/util/nestedMap.ts +12 -12
  1127. package/src/util/readSnapshotBlob.ts +4 -2
  1128. package/.eslintrc.cjs +0 -125
  1129. package/assertTagging.config.mjs +0 -14
  1130. package/dist/shared-tree-core/transactionEnricher.d.ts +0 -23
  1131. package/dist/shared-tree-core/transactionEnricher.d.ts.map +0 -1
  1132. package/dist/shared-tree-core/transactionEnricher.js +0 -74
  1133. package/dist/shared-tree-core/transactionEnricher.js.map +0 -1
  1134. package/lib/shared-tree-core/transactionEnricher.d.ts +0 -23
  1135. package/lib/shared-tree-core/transactionEnricher.d.ts.map +0 -1
  1136. package/lib/shared-tree-core/transactionEnricher.js +0 -70
  1137. package/lib/shared-tree-core/transactionEnricher.js.map +0 -1
  1138. package/src/shared-tree-core/transactionEnricher.ts +0 -74
@@ -1 +1 @@
1
- {"version":3,"file":"optionalField.js","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/optionalField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EASN,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,GACZ,MAAM,qBAAqB,CAAC;AAC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E,KAAK,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YAC9C,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;YAC7B,MAAM,oBAAoB,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC;QACD,KAAK,CAAC,CAAC,6BAA6B,CAAC,WAAW,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC;IACzC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACjF,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;AACF,CAAC","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\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\ttype ChangesetLocalId,\n\ttype DeltaDetachedNodeChanges,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaMark,\n\ttype RevisionReplacer,\n\ttype RevisionTag,\n\tareEqualChangeAtomIds,\n\tmakeChangeAtomId,\n\ttaggedAtomId,\n} from \"../../core/index.js\";\nimport {\n\ttype IdAllocator,\n\ttype Mutable,\n\tSizedNestedMap,\n\tdeleteFromNestedMap,\n\tsetInNestedMap,\n\ttryGetFromNestedMap,\n} from \"../../util/index.js\";\nimport { nodeIdFromChangeAtom } from \"../deltaUtils.js\";\nimport {\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype NodeChangeComposer,\n\ttype NodeChangePruner,\n\ttype NodeChangeRebaser,\n\tNodeAttachState,\n\ttype NodeId,\n\ttype RelevantRemovedRootsFromChild,\n\ttype ToDelta,\n\ttype NestedChangesIndices,\n\ttype FieldChangeDelta,\n} from \"../modular-schema/index.js\";\n\nimport type {\n\tChildChange,\n\tMove,\n\tOptionalChangeset,\n\tRegisterId,\n\tReplace,\n} from \"./optionalFieldChangeTypes.js\";\nimport { makeOptionalFieldCodecFamily } from \"./optionalFieldCodecs.js\";\n\nexport interface IRegisterMap<T> {\n\tset(id: RegisterId, childChange: T): void;\n\tget(id: RegisterId): T | undefined;\n\tdelete(id: RegisterId): boolean;\n\tkeys(): Iterable<RegisterId>;\n\tvalues(): Iterable<T>;\n\tentries(): Iterable<[RegisterId, T]>;\n\treadonly size: number;\n}\n\nexport class RegisterMap<T> implements IRegisterMap<T> {\n\tprivate readonly nestedMapData = new SizedNestedMap<\n\t\tChangesetLocalId | \"self\",\n\t\tRevisionTag | undefined,\n\t\tT\n\t>();\n\n\tpublic clone(): RegisterMap<T> {\n\t\tconst clone = new RegisterMap<T>();\n\t\tfor (const [id, t] of this.entries()) {\n\t\t\tclone.set(id, t);\n\t\t}\n\t\treturn clone;\n\t}\n\n\tpublic set(id: RegisterId, childChange: T): void {\n\t\tif (id === \"self\") {\n\t\t\tthis.nestedMapData.set(\"self\", undefined, childChange);\n\t\t} else {\n\t\t\tthis.nestedMapData.set(id.localId, id.revision, childChange);\n\t\t}\n\t}\n\n\tpublic get(id: RegisterId): T | undefined {\n\t\treturn id === \"self\"\n\t\t\t? this.nestedMapData.tryGet(id, undefined)\n\t\t\t: this.nestedMapData.tryGet(id.localId, id.revision);\n\t}\n\n\tpublic has(id: RegisterId): boolean {\n\t\treturn this.get(id) !== undefined;\n\t}\n\n\tpublic delete(id: RegisterId): boolean {\n\t\treturn id === \"self\"\n\t\t\t? this.nestedMapData.delete(\"self\", undefined)\n\t\t\t: this.nestedMapData.delete(id.localId, id.revision);\n\t}\n\n\tpublic keys(): Iterable<RegisterId> {\n\t\tconst changeIds: RegisterId[] = [];\n\t\tfor (const [localId, nestedMap] of this.nestedMapData) {\n\t\t\tif (localId === \"self\") {\n\t\t\t\tchangeIds.push(\"self\");\n\t\t\t} else {\n\t\t\t\tfor (const [revisionTag, _] of nestedMap) {\n\t\t\t\t\tchangeIds.push(\n\t\t\t\t\t\trevisionTag === undefined ? { localId } : { localId, revision: revisionTag },\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn changeIds;\n\t}\n\tpublic values(): Iterable<T> {\n\t\treturn this.nestedMapData.values();\n\t}\n\tpublic entries(): Iterable<[RegisterId, T]> {\n\t\tconst entries: [RegisterId, T][] = [];\n\t\tfor (const changeId of this.keys()) {\n\t\t\tif (changeId === \"self\") {\n\t\t\t\tconst entry = this.nestedMapData.tryGet(\"self\", undefined);\n\t\t\t\tassert(\n\t\t\t\t\tentry !== undefined,\n\t\t\t\t\t0x770 /* Entry should not be undefined when iterating keys. */,\n\t\t\t\t);\n\t\t\t\tentries.push([\"self\", entry]);\n\t\t\t} else {\n\t\t\t\tconst entry = this.nestedMapData.tryGet(changeId.localId, changeId.revision);\n\t\t\t\tassert(\n\t\t\t\t\tentry !== undefined,\n\t\t\t\t\t0x771 /* Entry should not be undefined when iterating keys. */,\n\t\t\t\t);\n\t\t\t\tentries.push([changeId, entry]);\n\t\t\t}\n\t\t}\n\n\t\treturn entries;\n\t}\n\tpublic get size(): number {\n\t\treturn this.nestedMapData.size;\n\t}\n}\n\nexport const optionalChangeRebaser: FieldChangeRebaser<OptionalChangeset> = {\n\tcompose: (\n\t\tchange1: OptionalChangeset,\n\t\tchange2: OptionalChangeset,\n\t\tcomposeChild: NodeChangeComposer,\n\t): OptionalChangeset => {\n\t\tconst { srcToDst, dstToSrc } = getBidirectionalMaps(change1.moves);\n\t\tconst change1FieldSrc = change1.valueReplace?.src;\n\t\tconst change1FieldDst = getEffectfulDst(change1.valueReplace);\n\n\t\tconst change2FieldSrc = change2.valueReplace?.src;\n\t\tlet composedFieldSrc: RegisterId | undefined;\n\t\tif (change2FieldSrc !== undefined) {\n\t\t\tif (change2FieldSrc === \"self\") {\n\t\t\t\tcomposedFieldSrc = change1FieldSrc ?? change2FieldSrc;\n\t\t\t} else if (\n\t\t\t\tchange1FieldDst !== undefined &&\n\t\t\t\tareEqualRegisterIds(change1FieldDst, change2FieldSrc)\n\t\t\t) {\n\t\t\t\tcomposedFieldSrc = \"self\";\n\t\t\t} else {\n\t\t\t\tcomposedFieldSrc =\n\t\t\t\t\ttryGetFromNestedMap(dstToSrc, change2FieldSrc.revision, change2FieldSrc.localId) ??\n\t\t\t\t\tchange2FieldSrc;\n\t\t\t}\n\t\t} else if (change1FieldSrc !== undefined && change2.valueReplace === undefined) {\n\t\t\tcomposedFieldSrc = change1FieldSrc;\n\t\t}\n\n\t\tconst childChanges2ByOriginalId = new RegisterMap<NodeId>();\n\t\tfor (const [id, change] of change2.childChanges) {\n\t\t\tif (id === \"self\") {\n\t\t\t\tif (change1FieldSrc === undefined) {\n\t\t\t\t\tchildChanges2ByOriginalId.set(\"self\", change);\n\t\t\t\t} else {\n\t\t\t\t\tchildChanges2ByOriginalId.set(change1FieldSrc, change);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (change1FieldDst !== undefined && areEqualChangeAtomIds(change1FieldDst, id)) {\n\t\t\t\t\tchildChanges2ByOriginalId.set(\"self\", change);\n\t\t\t\t} else {\n\t\t\t\t\tconst originalId = tryGetFromNestedMap(dstToSrc, id.revision, id.localId);\n\t\t\t\t\tchildChanges2ByOriginalId.set(originalId ?? id, change);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst composedMoves: Move[] = [];\n\t\tconst composedChildChanges: ChildChange[] = [];\n\t\tconst composed: Mutable<OptionalChangeset> = {\n\t\t\tmoves: composedMoves,\n\t\t\tchildChanges: composedChildChanges,\n\t\t};\n\n\t\tfor (const [id, childChange1] of change1.childChanges) {\n\t\t\tconst childChange2 = childChanges2ByOriginalId.get(id);\n\t\t\tcomposedChildChanges.push([id, composeChild(childChange1, childChange2)]);\n\t\t\tchildChanges2ByOriginalId.delete(id);\n\t\t}\n\n\t\tfor (const [id, childChange2] of childChanges2ByOriginalId.entries()) {\n\t\t\tcomposedChildChanges.push([id, composeChild(undefined, childChange2)]);\n\t\t}\n\n\t\tfor (const [leg2Src, leg2Dst] of change2.moves) {\n\t\t\tconst leg1Src = tryGetFromNestedMap(dstToSrc, leg2Src.revision, leg2Src.localId);\n\t\t\tif (leg1Src !== undefined) {\n\t\t\t\tcomposedMoves.push([leg1Src, leg2Dst]);\n\t\t\t\tdeleteFromNestedMap(srcToDst, leg1Src.revision, leg1Src.localId);\n\t\t\t\tdeleteFromNestedMap(dstToSrc, leg2Src.revision, leg2Src.localId);\n\t\t\t} else if (\n\t\t\t\tchange1FieldDst === undefined ||\n\t\t\t\t!areEqualChangeAtomIds(change1FieldDst, leg2Src)\n\t\t\t) {\n\t\t\t\tcomposedMoves.push([leg2Src, leg2Dst]);\n\t\t\t}\n\t\t}\n\n\t\tfor (const [revision, innerMap] of srcToDst.entries()) {\n\t\t\tfor (const [localId, dst] of innerMap.entries()) {\n\t\t\t\tconst src = makeChangeAtomId(localId, revision);\n\t\t\t\tif (composedFieldSrc === undefined || !areEqualRegisterIds(src, composedFieldSrc)) {\n\t\t\t\t\tcomposedMoves.push([src, dst]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tchange1FieldSrc !== undefined &&\n\t\t\tchange1FieldSrc !== \"self\" &&\n\t\t\tchange2.valueReplace !== undefined\n\t\t) {\n\t\t\tconst change2FieldDst = change2.valueReplace.dst;\n\t\t\tif (\n\t\t\t\tisReplaceEffectful(change2.valueReplace) &&\n\t\t\t\t!areEqualChangeAtomIds(change1FieldSrc, change2FieldDst)\n\t\t\t) {\n\t\t\t\tcomposedMoves.push([change1FieldSrc, change2FieldDst]);\n\t\t\t}\n\t\t}\n\n\t\tconst firstChange = change1.valueReplace ?? change2.valueReplace;\n\t\tif (firstChange === undefined) {\n\t\t\treturn composed;\n\t\t}\n\n\t\tconst replace: Mutable<Replace> = {\n\t\t\tisEmpty: firstChange.isEmpty,\n\t\t\tdst: getComposedReplaceDst(change1.valueReplace, change2),\n\t\t};\n\t\tif (composedFieldSrc !== undefined) {\n\t\t\treplace.src = composedFieldSrc;\n\t\t}\n\t\tcomposed.valueReplace = replace;\n\t\treturn composed;\n\t},\n\n\tinvert: (\n\t\tchange: OptionalChangeset,\n\t\tisRollback: boolean,\n\t\tgenId: IdAllocator<ChangesetLocalId>,\n\t\trevision: RevisionTag | undefined,\n\t): OptionalChangeset => {\n\t\tconst { moves, childChanges, valueReplace } = change;\n\n\t\tconst invertIdMap = new RegisterMap<RegisterId>();\n\t\tconst invertedMoves: Move[] = [];\n\t\tfor (const [src, dst] of moves) {\n\t\t\tinvertIdMap.set(src, dst);\n\t\t\tinvertedMoves.push([dst, src]);\n\t\t}\n\t\tif (valueReplace !== undefined) {\n\t\t\tconst effectfulDst = getEffectfulDst(valueReplace);\n\t\t\tif (effectfulDst !== undefined) {\n\t\t\t\tinvertIdMap.set(\"self\", valueReplace.dst);\n\t\t\t}\n\t\t\tif (valueReplace.src !== undefined) {\n\t\t\t\tinvertIdMap.set(valueReplace.src, \"self\");\n\t\t\t}\n\t\t}\n\n\t\tconst inverted: Mutable<OptionalChangeset> = {\n\t\t\tmoves: invertedMoves,\n\t\t\tchildChanges: childChanges.map(([id, childChange]) => {\n\t\t\t\treturn [invertIdMap.get(id) ?? id, childChange];\n\t\t\t}),\n\t\t};\n\n\t\tif (valueReplace !== undefined) {\n\t\t\tif (isReplaceEffectful(valueReplace)) {\n\t\t\t\tconst replace: Mutable<Replace> =\n\t\t\t\t\tvalueReplace.src === undefined\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tisEmpty: true,\n\t\t\t\t\t\t\t\tdst: makeChangeAtomId(genId.allocate(), revision),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tisEmpty: false,\n\t\t\t\t\t\t\t\tdst: isRollback\n\t\t\t\t\t\t\t\t\t? valueReplace.src\n\t\t\t\t\t\t\t\t\t: makeChangeAtomId(genId.allocate(), revision),\n\t\t\t\t\t\t\t};\n\t\t\t\tif (valueReplace.isEmpty === false) {\n\t\t\t\t\treplace.src = valueReplace.dst;\n\t\t\t\t}\n\t\t\t\tinverted.valueReplace = replace;\n\t\t\t} else if (!isRollback && valueReplace.src === \"self\") {\n\t\t\t\tinverted.valueReplace = {\n\t\t\t\t\tisEmpty: false,\n\t\t\t\t\tsrc: \"self\",\n\t\t\t\t\tdst: makeChangeAtomId(genId.allocate(), revision),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn inverted;\n\t},\n\n\trebase: (\n\t\tchange: OptionalChangeset,\n\t\toverChange: OptionalChangeset,\n\t\trebaseChild: NodeChangeRebaser,\n\t): OptionalChangeset => {\n\t\tconst { moves, childChanges, valueReplace: field } = change;\n\n\t\t// TODO: avoid computing the dstToSrc map if it's not needed.\n\t\t// TODO: de-dupe overSrcToDst and forwardMap\n\t\tconst { srcToDst: overSrcToDst } = getBidirectionalMaps(overChange.moves);\n\n\t\tconst forwardMap = new RegisterMap<RegisterId>();\n\t\tfor (const [src, dst] of overChange.moves) {\n\t\t\tforwardMap.set(src, dst);\n\t\t}\n\t\tif (overChange.valueReplace !== undefined) {\n\t\t\tconst effectfulDst = getEffectfulDst(overChange.valueReplace);\n\t\t\tif (effectfulDst !== undefined) {\n\t\t\t\tforwardMap.set(\"self\", overChange.valueReplace.dst);\n\t\t\t}\n\t\t\tif (overChange.valueReplace.src !== undefined) {\n\t\t\t\tforwardMap.set(overChange.valueReplace.src, \"self\");\n\t\t\t}\n\t\t}\n\n\t\tconst rebasedMoves: Move[] = [];\n\t\tfor (const [src, dst] of moves) {\n\t\t\tconst newDst = tryGetFromNestedMap(overSrcToDst, src.revision, src.localId);\n\t\t\trebasedMoves.push([src, newDst ?? dst]);\n\t\t}\n\n\t\tconst overChildChangesBySrc = new RegisterMap<NodeId>();\n\t\tfor (const [id, childChange] of overChange.childChanges) {\n\t\t\toverChildChangesBySrc.set(id, childChange);\n\t\t}\n\n\t\tconst rebasedChildChanges: ChildChange[] = [];\n\t\tfor (const [id, childChange] of childChanges) {\n\t\t\tconst overChildChange = overChildChangesBySrc.get(id);\n\t\t\tif (overChildChange !== undefined) {\n\t\t\t\toverChildChangesBySrc.delete(id);\n\t\t\t}\n\n\t\t\tconst rebasedId = forwardMap.get(id) ?? id;\n\t\t\tconst rebasedChildChange = rebaseChild(\n\t\t\t\tchildChange,\n\t\t\t\toverChildChange,\n\t\t\t\trebasedId === \"self\" ? NodeAttachState.Attached : NodeAttachState.Detached,\n\t\t\t);\n\t\t\tif (rebasedChildChange !== undefined) {\n\t\t\t\trebasedChildChanges.push([rebasedId, rebasedChildChange]);\n\t\t\t}\n\t\t}\n\n\t\tfor (const [id, overChildChange] of overChildChangesBySrc.entries()) {\n\t\t\tconst rebasedId = forwardMap.get(id) ?? id;\n\t\t\tconst rebasedChildChange = rebaseChild(\n\t\t\t\tundefined,\n\t\t\t\toverChildChange,\n\t\t\t\trebasedId === \"self\" ? NodeAttachState.Attached : NodeAttachState.Detached,\n\t\t\t);\n\t\t\tif (rebasedChildChange !== undefined) {\n\t\t\t\trebasedChildChanges.push([rebasedId, rebasedChildChange]);\n\t\t\t}\n\t\t}\n\n\t\tconst rebased: Mutable<OptionalChangeset> = {\n\t\t\tmoves: rebasedMoves,\n\t\t\tchildChanges: rebasedChildChanges,\n\t\t};\n\n\t\tif (field !== undefined) {\n\t\t\tconst replace: Mutable<Replace> = {\n\t\t\t\tisEmpty:\n\t\t\t\t\toverChange.valueReplace === undefined\n\t\t\t\t\t\t? field.isEmpty\n\t\t\t\t\t\t: overChange.valueReplace.src === undefined,\n\t\t\t\tdst: field.dst,\n\t\t\t};\n\t\t\tif (field.src !== undefined) {\n\t\t\t\treplace.src = forwardMap.get(field.src) ?? field.src;\n\t\t\t}\n\t\t\trebased.valueReplace = replace;\n\t\t}\n\n\t\treturn rebased;\n\t},\n\n\tprune: (change: OptionalChangeset, pruneChild: NodeChangePruner): OptionalChangeset => {\n\t\tconst childChanges: ChildChange[] = [];\n\t\tconst prunedChange: Mutable<OptionalChangeset> = {\n\t\t\tmoves: change.moves,\n\t\t\tchildChanges,\n\t\t};\n\t\tif (change.valueReplace !== undefined) {\n\t\t\tprunedChange.valueReplace = change.valueReplace;\n\t\t}\n\n\t\tfor (const [id, childChange] of change.childChanges) {\n\t\t\tconst prunedChildChange = pruneChild(childChange);\n\t\t\tif (prunedChildChange !== undefined) {\n\t\t\t\tchildChanges.push([id, prunedChildChange]);\n\t\t\t}\n\t\t}\n\n\t\treturn prunedChange;\n\t},\n\n\treplaceRevisions: (\n\t\tchange: OptionalChangeset,\n\t\treplacer: RevisionReplacer,\n\t): OptionalChangeset => {\n\t\tconst valueReplace = replaceReplaceRevisions(change.valueReplace, replacer);\n\n\t\tconst childChanges: ChildChange[] = [];\n\t\tfor (const [id, childChange] of change.childChanges) {\n\t\t\tchildChanges.push([\n\t\t\t\treplaceRegisterRevisions(id, replacer),\n\t\t\t\treplacer.getUpdatedAtomId(childChange),\n\t\t\t]);\n\t\t}\n\n\t\tconst moves: Move[] = [];\n\t\tfor (const [src, dst] of change.moves) {\n\t\t\tmoves.push([replacer.getUpdatedAtomId(src), replacer.getUpdatedAtomId(dst)]);\n\t\t}\n\n\t\tconst updated: Mutable<OptionalChangeset> = { childChanges, moves };\n\t\tif (valueReplace !== undefined) {\n\t\t\tupdated.valueReplace = valueReplace;\n\t\t}\n\n\t\treturn updated;\n\t},\n\n\tmute: (change: OptionalChangeset): OptionalChangeset => {\n\t\treturn { childChanges: change.childChanges, moves: [] };\n\t},\n};\n\nfunction replaceReplaceRevisions(\n\treplace: Replace | undefined,\n\treplacer: RevisionReplacer,\n): Replace | undefined {\n\tif (replace === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst updated: Mutable<Replace> = {\n\t\t...replace,\n\t\tdst: replacer.getUpdatedAtomId(replace.dst),\n\t};\n\n\tif (replace.src !== undefined) {\n\t\tupdated.src = replaceRegisterRevisions(replace.src, replacer);\n\t}\n\n\treturn updated;\n}\n\nfunction replaceRegisterRevisions(\n\tregister: RegisterId,\n\treplacer: RevisionReplacer,\n): RegisterId {\n\treturn register === \"self\" ? register : replacer.getUpdatedAtomId(register);\n}\n\nfunction getComposedReplaceDst(\n\tchange1: Replace | undefined,\n\tchange2: OptionalChangeset,\n): ChangeAtomId {\n\tconst dst1 = change1?.dst;\n\tif (change2.valueReplace === undefined) {\n\t\tassert(dst1 !== undefined, 0x8ce /* Both replace replaces should not be undefined */);\n\t\treturn getIdAfterMoves(dst1, change2.moves);\n\t}\n\n\tif (\n\t\tdst1 === undefined ||\n\t\tchange1?.src === \"self\" ||\n\t\t(change2.valueReplace.src !== undefined &&\n\t\t\tareEqualRegisterIds(change2.valueReplace.src, dst1))\n\t) {\n\t\tassert(\n\t\t\tchange2.valueReplace !== undefined,\n\t\t\t0x8cf /* Both replace replaces should not be undefined */,\n\t\t);\n\t\treturn change2.valueReplace.dst;\n\t} else {\n\t\treturn getIdAfterMoves(dst1, change2.moves);\n\t}\n}\n\nfunction getIdAfterMoves(id: ChangeAtomId, moves: readonly Move[]): ChangeAtomId {\n\tfor (const [src, dst] of moves) {\n\t\tif (areEqualChangeAtomIds(id, src)) {\n\t\t\treturn dst;\n\t\t}\n\t}\n\treturn id;\n}\n\nfunction areEqualRegisterIds(id1: RegisterId, id2: RegisterId): boolean {\n\treturn id1 === \"self\" || id2 === \"self\" ? id1 === id2 : areEqualChangeAtomIds(id1, id2);\n}\n\nfunction areEqualRegisterIdsOpt(\n\tid1: RegisterId | undefined,\n\tid2: RegisterId | undefined,\n): boolean {\n\tif (id1 === undefined || id2 === undefined) {\n\t\treturn id1 === id2;\n\t}\n\treturn areEqualRegisterIds(id1, id2);\n}\n\nfunction getBidirectionalMaps(moves: OptionalChangeset[\"moves\"]): {\n\tsrcToDst: ChangeAtomIdMap<ChangeAtomId>;\n\tdstToSrc: ChangeAtomIdMap<ChangeAtomId>;\n} {\n\tconst srcToDst: ChangeAtomIdMap<ChangeAtomId> = new Map();\n\tconst dstToSrc: ChangeAtomIdMap<ChangeAtomId> = new Map();\n\tfor (const [src, dst] of moves) {\n\t\tsetInNestedMap(srcToDst, src.revision, src.localId, dst);\n\t\tsetInNestedMap(dstToSrc, dst.revision, dst.localId, src);\n\t}\n\treturn { srcToDst, dstToSrc };\n}\n\ntype EffectfulReplace =\n\t| {\n\t\t\tisEmpty: true;\n\t\t\tsrc?: ChangeAtomId;\n\t\t\tdst: ChangeAtomId;\n\t }\n\t| {\n\t\t\tisEmpty: boolean;\n\t\t\tsrc: ChangeAtomId;\n\t\t\tdst: ChangeAtomId;\n\t };\n\nfunction isReplaceEffectful(replace: Replace): replace is EffectfulReplace {\n\tif (replace.src === \"self\") {\n\t\treturn false;\n\t}\n\treturn !replace.isEmpty || replace.src !== undefined;\n}\n\nfunction getEffectfulDst(replace: Replace | undefined): ChangeAtomId | undefined {\n\treturn replace === undefined || replace.isEmpty || replace.src === \"self\"\n\t\t? undefined\n\t\t: replace.dst;\n}\n\nexport function taggedRegister(id: RegisterId, revision: RevisionTag | undefined): RegisterId {\n\tif (id === \"self\") {\n\t\treturn id;\n\t}\n\n\treturn taggedAtomId(id, revision);\n}\n\nexport interface OptionalFieldEditor extends FieldEditor<OptionalChangeset> {\n\t/**\n\t * Creates a change which will replace the content already in the field (if any at the time the change applies)\n\t * with new content.\n\t * The content in the field will be moved to the `ids.detach` register.\n\t * The content in the `ids.detach` register will be moved to into the field.\n\t * @param wasEmpty - whether the field is empty when creating this change\n\t * @param ids - the \"fill\" and \"detach\" ids associated with the change.\n\t */\n\tset(\n\t\twasEmpty: boolean,\n\t\tids: {\n\t\t\tfill: ChangeAtomId;\n\t\t\tdetach: ChangeAtomId;\n\t\t},\n\t): OptionalChangeset;\n\n\t/**\n\t * Creates a change which clears the field's contents (if any).\n\t * @param wasEmpty - whether the field is empty when creating this change\n\t * @param detachId - the ID of the register that existing field content (if any) will be moved to.\n\t */\n\tclear(wasEmpty: boolean, detachId: ChangeAtomId): OptionalChangeset;\n}\n\nexport const optionalFieldEditor: OptionalFieldEditor = {\n\tset: (\n\t\twasEmpty: boolean,\n\t\tids: {\n\t\t\tfill: ChangeAtomId;\n\t\t\t// Should be interpreted as a set of an empty field if undefined.\n\t\t\tdetach: ChangeAtomId;\n\t\t},\n\t): OptionalChangeset => ({\n\t\tmoves: [],\n\t\tchildChanges: [],\n\t\tvalueReplace: {\n\t\t\tisEmpty: wasEmpty,\n\t\t\tsrc: ids.fill,\n\t\t\tdst: ids.detach,\n\t\t},\n\t}),\n\n\tclear: (wasEmpty: boolean, detachId: ChangeAtomId): OptionalChangeset => ({\n\t\tmoves: [],\n\t\tchildChanges: [],\n\t\tvalueReplace: {\n\t\t\tisEmpty: wasEmpty,\n\t\t\tdst: detachId,\n\t\t},\n\t}),\n\n\tbuildChildChanges: (changes: Iterable<[number, NodeId]>): OptionalChangeset => {\n\t\tconst childChanges: ChildChange[] = Array.from(changes, ([index, childChange]) => {\n\t\t\tassert(index === 0, 0x404 /* Optional fields only support a single child node */);\n\t\t\treturn [\"self\", childChange];\n\t\t});\n\t\tassert(\n\t\t\tchildChanges.length <= 1,\n\t\t\t0xabd /* Optional fields only support a single child node */,\n\t\t);\n\t\treturn {\n\t\t\tmoves: [],\n\t\t\tchildChanges,\n\t\t};\n\t},\n};\n\nexport function optionalFieldIntoDelta(\n\tchange: OptionalChangeset,\n\tdeltaFromChild: ToDelta,\n): FieldChangeDelta {\n\tconst delta: Mutable<FieldChangeDelta> = {};\n\n\tlet markIsANoop = true;\n\tconst mark: Mutable<DeltaMark> = { count: 1 };\n\n\tif (change.valueReplace !== undefined && isReplaceEffectful(change.valueReplace)) {\n\t\tif (!change.valueReplace.isEmpty) {\n\t\t\tmark.detach = nodeIdFromChangeAtom(change.valueReplace.dst);\n\t\t}\n\t\tif (change.valueReplace.src !== undefined) {\n\t\t\tmark.attach = nodeIdFromChangeAtom(change.valueReplace.src);\n\t\t}\n\t\tmarkIsANoop = false;\n\t}\n\n\tif (change.moves.length > 0) {\n\t\tdelta.rename = change.moves.map(([src, dst]) => ({\n\t\t\tcount: 1,\n\t\t\toldId: nodeIdFromChangeAtom(src),\n\t\t\tnewId: nodeIdFromChangeAtom(dst),\n\t\t}));\n\t}\n\n\tif (change.childChanges.length > 0) {\n\t\tconst globals: DeltaDetachedNodeChanges[] = [];\n\t\tfor (const [id, childChange] of change.childChanges) {\n\t\t\tconst childDelta = deltaFromChild(childChange);\n\t\t\tif (id === \"self\") {\n\t\t\t\tmark.fields = childDelta;\n\t\t\t\tmarkIsANoop = false;\n\t\t\t} else {\n\t\t\t\tconst fields = childDelta;\n\t\t\t\tglobals.push({\n\t\t\t\t\tid: { major: id.revision, minor: id.localId },\n\t\t\t\t\tfields,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (globals.length > 0) {\n\t\t\tdelta.global = globals;\n\t\t}\n\t}\n\n\tif (!markIsANoop) {\n\t\tdelta.local = [mark];\n\t}\n\n\treturn delta;\n}\n\nexport const optionalChangeHandler: FieldChangeHandler<\n\tOptionalChangeset,\n\tOptionalFieldEditor\n> = {\n\trebaser: optionalChangeRebaser,\n\tcodecsFactory: makeOptionalFieldCodecFamily,\n\teditor: optionalFieldEditor,\n\n\tintoDelta: optionalFieldIntoDelta,\n\trelevantRemovedRoots,\n\n\tisEmpty: (change: OptionalChangeset) =>\n\t\tchange.childChanges.length === 0 &&\n\t\tchange.moves.length === 0 &&\n\t\tchange.valueReplace === undefined,\n\n\tgetNestedChanges,\n\n\tcreateEmpty: () => ({ moves: [], childChanges: [] }),\n\tgetCrossFieldKeys: (_change) => [],\n};\n\nfunction getNestedChanges(change: OptionalChangeset): NestedChangesIndices {\n\t// True iff the content of the field changes in some way\n\tconst isFieldContentChanged =\n\t\tchange.valueReplace !== undefined && change.valueReplace.src !== \"self\";\n\n\t// The node that is moved into the field (if any).\n\tconst nodeMovedIntoField = change.valueReplace?.src;\n\n\treturn change.childChanges.map(([register, nodeId]) => {\n\t\t// The node is removed in the input context iif register is not self.\n\t\tconst inputIndex = register === \"self\" ? 0 : undefined;\n\t\tconst outputIndex =\n\t\t\tregister === \"self\"\n\t\t\t\t? // If the node starts out as not-removed, it is removed in the output context iff the field content is changed\n\t\t\t\t\tisFieldContentChanged\n\t\t\t\t\t? undefined\n\t\t\t\t\t: 0\n\t\t\t\t: // If the node starts out as removed, then it remains removed in the output context iff it is not the node that is moved into the field\n\t\t\t\t\tareEqualRegisterIdsOpt(register, nodeMovedIntoField)\n\t\t\t\t\t? 0\n\t\t\t\t\t: undefined;\n\t\treturn [nodeId, inputIndex, outputIndex];\n\t});\n}\n\nfunction* relevantRemovedRoots(\n\tchange: OptionalChangeset,\n\trelevantRemovedRootsFromChild: RelevantRemovedRootsFromChild,\n): Iterable<DeltaDetachedNodeId> {\n\tconst alreadyYielded = new RegisterMap<boolean>();\n\n\tfor (const [src] of change.moves) {\n\t\tif (!alreadyYielded.has(src)) {\n\t\t\talreadyYielded.set(src, true);\n\t\t\tyield nodeIdFromChangeAtom(src);\n\t\t}\n\t}\n\n\tfor (const [id, childChange] of change.childChanges) {\n\t\t// Child changes make the tree they apply to relevant unless that tree existed in the starting context of\n\t\t// of this change.\n\t\tif (id !== \"self\" && !alreadyYielded.has(id)) {\n\t\t\talreadyYielded.set(id, true);\n\t\t\tyield nodeIdFromChangeAtom(id);\n\t\t}\n\t\tyield* relevantRemovedRootsFromChild(childChange);\n\t}\n\n\tconst selfSrc = change.valueReplace?.src;\n\tif (selfSrc !== undefined && selfSrc !== \"self\" && !alreadyYielded.has(selfSrc)) {\n\t\tyield nodeIdFromChangeAtom(selfSrc);\n\t}\n}\n"]}
1
+ {"version":3,"file":"optionalField.js","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/optionalField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAON,YAAY,EAGZ,qBAAqB,EACrB,4BAA4B,EAC5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CAAC;IACF,CAAC;IAED,KAAK,MAAM,CAAC,EAAE,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;QACrD,yGAAyG;QACzG,kBAAkB;QAClB,IAAI,EAAE,KAAK,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YAC9C,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;YAC7B,MAAM,oBAAoB,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC;QACD,KAAK,CAAC,CAAC,6BAA6B,CAAC,WAAW,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC;IACzC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACjF,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;AACF,CAAC;AASD;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAa,IAAI,aAAa,CAClD,kBAAkB,EAClB,YAAY,CAAC,QAAQ,EACrB;IACC,aAAa,EAAE,qBAAqB;IACpC,yBAAyB,EAAE,IAAI,GAAG,CAAC;QAClC,yBAAyB;QACzB,kBAAkB;QAClB,4BAA4B;KAC5B,CAAC;CACF,CACD,CAAC","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\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\ttype ChangesetLocalId,\n\ttype DeltaDetachedNodeChanges,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaMark,\n\tMultiplicity,\n\ttype RevisionReplacer,\n\ttype RevisionTag,\n\tareEqualChangeAtomIds,\n\tforbiddenFieldKindIdentifier,\n\tmakeChangeAtomId,\n\ttaggedAtomId,\n} from \"../../core/index.js\";\nimport {\n\ttype IdAllocator,\n\ttype Mutable,\n\tSizedNestedMap,\n\tdeleteFromNestedMap,\n\tsetInNestedMap,\n\ttryGetFromNestedMap,\n} from \"../../util/index.js\";\nimport { nodeIdFromChangeAtom } from \"../deltaUtils.js\";\nimport {\n\toptionalIdentifier,\n\tidentifierFieldIdentifier,\n\trequiredIdentifier,\n} from \"../fieldKindIdentifiers.js\";\nimport {\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype NodeChangeComposer,\n\ttype NodeChangePruner,\n\ttype NodeChangeRebaser,\n\tNodeAttachState,\n\ttype NodeId,\n\ttype RelevantRemovedRootsFromChild,\n\ttype ToDelta,\n\ttype NestedChangesIndices,\n\ttype FieldChangeDelta,\n\tFlexFieldKind,\n} from \"../modular-schema/index.js\";\n\nimport type {\n\tChildChange,\n\tMove,\n\tOptionalChangeset,\n\tRegisterId,\n\tReplace,\n} from \"./optionalFieldChangeTypes.js\";\nimport { makeOptionalFieldCodecFamily } from \"./optionalFieldCodecs.js\";\n\nexport interface IRegisterMap<T> {\n\tset(id: RegisterId, childChange: T): void;\n\tget(id: RegisterId): T | undefined;\n\tdelete(id: RegisterId): boolean;\n\tkeys(): Iterable<RegisterId>;\n\tvalues(): Iterable<T>;\n\tentries(): Iterable<[RegisterId, T]>;\n\treadonly size: number;\n}\n\nexport class RegisterMap<T> implements IRegisterMap<T> {\n\tprivate readonly nestedMapData = new SizedNestedMap<\n\t\tChangesetLocalId | \"self\",\n\t\tRevisionTag | undefined,\n\t\tT\n\t>();\n\n\tpublic clone(): RegisterMap<T> {\n\t\tconst clone = new RegisterMap<T>();\n\t\tfor (const [id, t] of this.entries()) {\n\t\t\tclone.set(id, t);\n\t\t}\n\t\treturn clone;\n\t}\n\n\tpublic set(id: RegisterId, childChange: T): void {\n\t\tif (id === \"self\") {\n\t\t\tthis.nestedMapData.set(\"self\", undefined, childChange);\n\t\t} else {\n\t\t\tthis.nestedMapData.set(id.localId, id.revision, childChange);\n\t\t}\n\t}\n\n\tpublic get(id: RegisterId): T | undefined {\n\t\treturn id === \"self\"\n\t\t\t? this.nestedMapData.tryGet(id, undefined)\n\t\t\t: this.nestedMapData.tryGet(id.localId, id.revision);\n\t}\n\n\tpublic has(id: RegisterId): boolean {\n\t\treturn this.get(id) !== undefined;\n\t}\n\n\tpublic delete(id: RegisterId): boolean {\n\t\treturn id === \"self\"\n\t\t\t? this.nestedMapData.delete(\"self\", undefined)\n\t\t\t: this.nestedMapData.delete(id.localId, id.revision);\n\t}\n\n\tpublic keys(): Iterable<RegisterId> {\n\t\tconst changeIds: RegisterId[] = [];\n\t\tfor (const [localId, nestedMap] of this.nestedMapData) {\n\t\t\tif (localId === \"self\") {\n\t\t\t\tchangeIds.push(\"self\");\n\t\t\t} else {\n\t\t\t\tfor (const [revisionTag, _] of nestedMap) {\n\t\t\t\t\tchangeIds.push(\n\t\t\t\t\t\trevisionTag === undefined ? { localId } : { localId, revision: revisionTag },\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn changeIds;\n\t}\n\tpublic values(): Iterable<T> {\n\t\treturn this.nestedMapData.values();\n\t}\n\tpublic entries(): Iterable<[RegisterId, T]> {\n\t\tconst entries: [RegisterId, T][] = [];\n\t\tfor (const changeId of this.keys()) {\n\t\t\tif (changeId === \"self\") {\n\t\t\t\tconst entry = this.nestedMapData.tryGet(\"self\", undefined);\n\t\t\t\tassert(\n\t\t\t\t\tentry !== undefined,\n\t\t\t\t\t0x770 /* Entry should not be undefined when iterating keys. */,\n\t\t\t\t);\n\t\t\t\tentries.push([\"self\", entry]);\n\t\t\t} else {\n\t\t\t\tconst entry = this.nestedMapData.tryGet(changeId.localId, changeId.revision);\n\t\t\t\tassert(\n\t\t\t\t\tentry !== undefined,\n\t\t\t\t\t0x771 /* Entry should not be undefined when iterating keys. */,\n\t\t\t\t);\n\t\t\t\tentries.push([changeId, entry]);\n\t\t\t}\n\t\t}\n\n\t\treturn entries;\n\t}\n\tpublic get size(): number {\n\t\treturn this.nestedMapData.size;\n\t}\n}\n\nexport const optionalChangeRebaser: FieldChangeRebaser<OptionalChangeset> = {\n\tcompose: (\n\t\tchange1: OptionalChangeset,\n\t\tchange2: OptionalChangeset,\n\t\tcomposeChild: NodeChangeComposer,\n\t): OptionalChangeset => {\n\t\tconst { srcToDst, dstToSrc } = getBidirectionalMaps(change1.moves);\n\t\tconst change1FieldSrc = change1.valueReplace?.src;\n\t\tconst change1FieldDst = getEffectfulDst(change1.valueReplace);\n\n\t\tconst change2FieldSrc = change2.valueReplace?.src;\n\t\tlet composedFieldSrc: RegisterId | undefined;\n\t\tif (change2FieldSrc !== undefined) {\n\t\t\tif (change2FieldSrc === \"self\") {\n\t\t\t\tcomposedFieldSrc = change1FieldSrc ?? change2FieldSrc;\n\t\t\t} else if (\n\t\t\t\tchange1FieldDst !== undefined &&\n\t\t\t\tareEqualRegisterIds(change1FieldDst, change2FieldSrc)\n\t\t\t) {\n\t\t\t\tcomposedFieldSrc = \"self\";\n\t\t\t} else {\n\t\t\t\tcomposedFieldSrc =\n\t\t\t\t\ttryGetFromNestedMap(dstToSrc, change2FieldSrc.revision, change2FieldSrc.localId) ??\n\t\t\t\t\tchange2FieldSrc;\n\t\t\t}\n\t\t} else if (change1FieldSrc !== undefined && change2.valueReplace === undefined) {\n\t\t\tcomposedFieldSrc = change1FieldSrc;\n\t\t}\n\n\t\tconst childChanges2ByOriginalId = new RegisterMap<NodeId>();\n\t\tfor (const [id, change] of change2.childChanges) {\n\t\t\tif (id === \"self\") {\n\t\t\t\tif (change1FieldSrc === undefined) {\n\t\t\t\t\tchildChanges2ByOriginalId.set(\"self\", change);\n\t\t\t\t} else {\n\t\t\t\t\tchildChanges2ByOriginalId.set(change1FieldSrc, change);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (change1FieldDst !== undefined && areEqualChangeAtomIds(change1FieldDst, id)) {\n\t\t\t\t\tchildChanges2ByOriginalId.set(\"self\", change);\n\t\t\t\t} else {\n\t\t\t\t\tconst originalId = tryGetFromNestedMap(dstToSrc, id.revision, id.localId);\n\t\t\t\t\tchildChanges2ByOriginalId.set(originalId ?? id, change);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst composedMoves: Move[] = [];\n\t\tconst composedChildChanges: ChildChange[] = [];\n\t\tconst composed: Mutable<OptionalChangeset> = {\n\t\t\tmoves: composedMoves,\n\t\t\tchildChanges: composedChildChanges,\n\t\t};\n\n\t\tfor (const [id, childChange1] of change1.childChanges) {\n\t\t\tconst childChange2 = childChanges2ByOriginalId.get(id);\n\t\t\tcomposedChildChanges.push([id, composeChild(childChange1, childChange2)]);\n\t\t\tchildChanges2ByOriginalId.delete(id);\n\t\t}\n\n\t\tfor (const [id, childChange2] of childChanges2ByOriginalId.entries()) {\n\t\t\tcomposedChildChanges.push([id, composeChild(undefined, childChange2)]);\n\t\t}\n\n\t\tfor (const [leg2Src, leg2Dst] of change2.moves) {\n\t\t\tconst leg1Src = tryGetFromNestedMap(dstToSrc, leg2Src.revision, leg2Src.localId);\n\t\t\tif (leg1Src !== undefined) {\n\t\t\t\tcomposedMoves.push([leg1Src, leg2Dst]);\n\t\t\t\tdeleteFromNestedMap(srcToDst, leg1Src.revision, leg1Src.localId);\n\t\t\t\tdeleteFromNestedMap(dstToSrc, leg2Src.revision, leg2Src.localId);\n\t\t\t} else if (\n\t\t\t\tchange1FieldDst === undefined ||\n\t\t\t\t!areEqualChangeAtomIds(change1FieldDst, leg2Src)\n\t\t\t) {\n\t\t\t\tcomposedMoves.push([leg2Src, leg2Dst]);\n\t\t\t}\n\t\t}\n\n\t\tfor (const [revision, innerMap] of srcToDst.entries()) {\n\t\t\tfor (const [localId, dst] of innerMap.entries()) {\n\t\t\t\tconst src = makeChangeAtomId(localId, revision);\n\t\t\t\tif (composedFieldSrc === undefined || !areEqualRegisterIds(src, composedFieldSrc)) {\n\t\t\t\t\tcomposedMoves.push([src, dst]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tchange1FieldSrc !== undefined &&\n\t\t\tchange1FieldSrc !== \"self\" &&\n\t\t\tchange2.valueReplace !== undefined\n\t\t) {\n\t\t\tconst change2FieldDst = change2.valueReplace.dst;\n\t\t\tif (\n\t\t\t\tisReplaceEffectful(change2.valueReplace) &&\n\t\t\t\t!areEqualChangeAtomIds(change1FieldSrc, change2FieldDst)\n\t\t\t) {\n\t\t\t\tcomposedMoves.push([change1FieldSrc, change2FieldDst]);\n\t\t\t}\n\t\t}\n\n\t\tconst firstChange = change1.valueReplace ?? change2.valueReplace;\n\t\tif (firstChange === undefined) {\n\t\t\treturn composed;\n\t\t}\n\n\t\tconst replace: Mutable<Replace> = {\n\t\t\tisEmpty: firstChange.isEmpty,\n\t\t\tdst: getComposedReplaceDst(change1.valueReplace, change2),\n\t\t};\n\t\tif (composedFieldSrc !== undefined) {\n\t\t\treplace.src = composedFieldSrc;\n\t\t}\n\t\tcomposed.valueReplace = replace;\n\t\treturn composed;\n\t},\n\n\tinvert: (\n\t\tchange: OptionalChangeset,\n\t\tisRollback: boolean,\n\t\tgenId: IdAllocator<ChangesetLocalId>,\n\t\trevision: RevisionTag | undefined,\n\t): OptionalChangeset => {\n\t\tconst { moves, childChanges, valueReplace } = change;\n\n\t\tconst invertIdMap = new RegisterMap<RegisterId>();\n\t\tconst invertedMoves: Move[] = [];\n\t\tfor (const [src, dst] of moves) {\n\t\t\tinvertIdMap.set(src, dst);\n\t\t\tinvertedMoves.push([dst, src]);\n\t\t}\n\t\tif (valueReplace !== undefined) {\n\t\t\tconst effectfulDst = getEffectfulDst(valueReplace);\n\t\t\tif (effectfulDst !== undefined) {\n\t\t\t\tinvertIdMap.set(\"self\", valueReplace.dst);\n\t\t\t}\n\t\t\tif (valueReplace.src !== undefined) {\n\t\t\t\tinvertIdMap.set(valueReplace.src, \"self\");\n\t\t\t}\n\t\t}\n\n\t\tconst inverted: Mutable<OptionalChangeset> = {\n\t\t\tmoves: invertedMoves,\n\t\t\tchildChanges: childChanges.map(([id, childChange]) => {\n\t\t\t\treturn [invertIdMap.get(id) ?? id, childChange];\n\t\t\t}),\n\t\t};\n\n\t\tif (valueReplace !== undefined) {\n\t\t\tif (isReplaceEffectful(valueReplace)) {\n\t\t\t\tconst replace: Mutable<Replace> =\n\t\t\t\t\tvalueReplace.src === undefined\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tisEmpty: true,\n\t\t\t\t\t\t\t\tdst: makeChangeAtomId(genId.allocate(), revision),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tisEmpty: false,\n\t\t\t\t\t\t\t\tdst: isRollback\n\t\t\t\t\t\t\t\t\t? valueReplace.src\n\t\t\t\t\t\t\t\t\t: makeChangeAtomId(genId.allocate(), revision),\n\t\t\t\t\t\t\t};\n\t\t\t\tif (valueReplace.isEmpty === false) {\n\t\t\t\t\treplace.src = valueReplace.dst;\n\t\t\t\t}\n\t\t\t\tinverted.valueReplace = replace;\n\t\t\t} else if (!isRollback && valueReplace.src === \"self\") {\n\t\t\t\tinverted.valueReplace = {\n\t\t\t\t\tisEmpty: false,\n\t\t\t\t\tsrc: \"self\",\n\t\t\t\t\tdst: makeChangeAtomId(genId.allocate(), revision),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn inverted;\n\t},\n\n\trebase: (\n\t\tchange: OptionalChangeset,\n\t\toverChange: OptionalChangeset,\n\t\trebaseChild: NodeChangeRebaser,\n\t): OptionalChangeset => {\n\t\tconst { moves, childChanges, valueReplace: field } = change;\n\n\t\t// TODO: avoid computing the dstToSrc map if it's not needed.\n\t\t// TODO: de-dupe overSrcToDst and forwardMap\n\t\tconst { srcToDst: overSrcToDst } = getBidirectionalMaps(overChange.moves);\n\n\t\tconst forwardMap = new RegisterMap<RegisterId>();\n\t\tfor (const [src, dst] of overChange.moves) {\n\t\t\tforwardMap.set(src, dst);\n\t\t}\n\t\tif (overChange.valueReplace !== undefined) {\n\t\t\tconst effectfulDst = getEffectfulDst(overChange.valueReplace);\n\t\t\tif (effectfulDst !== undefined) {\n\t\t\t\tforwardMap.set(\"self\", overChange.valueReplace.dst);\n\t\t\t}\n\t\t\tif (overChange.valueReplace.src !== undefined) {\n\t\t\t\tforwardMap.set(overChange.valueReplace.src, \"self\");\n\t\t\t}\n\t\t}\n\n\t\tconst rebasedMoves: Move[] = [];\n\t\tfor (const [src, dst] of moves) {\n\t\t\tconst newDst = tryGetFromNestedMap(overSrcToDst, src.revision, src.localId);\n\t\t\trebasedMoves.push([src, newDst ?? dst]);\n\t\t}\n\n\t\tconst overChildChangesBySrc = new RegisterMap<NodeId>();\n\t\tfor (const [id, childChange] of overChange.childChanges) {\n\t\t\toverChildChangesBySrc.set(id, childChange);\n\t\t}\n\n\t\tconst rebasedChildChanges: ChildChange[] = [];\n\t\tfor (const [id, childChange] of childChanges) {\n\t\t\tconst overChildChange = overChildChangesBySrc.get(id);\n\t\t\tif (overChildChange !== undefined) {\n\t\t\t\toverChildChangesBySrc.delete(id);\n\t\t\t}\n\n\t\t\tconst rebasedId = forwardMap.get(id) ?? id;\n\t\t\tconst rebasedChildChange = rebaseChild(\n\t\t\t\tchildChange,\n\t\t\t\toverChildChange,\n\t\t\t\trebasedId === \"self\" ? NodeAttachState.Attached : NodeAttachState.Detached,\n\t\t\t);\n\t\t\tif (rebasedChildChange !== undefined) {\n\t\t\t\trebasedChildChanges.push([rebasedId, rebasedChildChange]);\n\t\t\t}\n\t\t}\n\n\t\tfor (const [id, overChildChange] of overChildChangesBySrc.entries()) {\n\t\t\tconst rebasedId = forwardMap.get(id) ?? id;\n\t\t\tconst rebasedChildChange = rebaseChild(\n\t\t\t\tundefined,\n\t\t\t\toverChildChange,\n\t\t\t\trebasedId === \"self\" ? NodeAttachState.Attached : NodeAttachState.Detached,\n\t\t\t);\n\t\t\tif (rebasedChildChange !== undefined) {\n\t\t\t\trebasedChildChanges.push([rebasedId, rebasedChildChange]);\n\t\t\t}\n\t\t}\n\n\t\tconst rebased: Mutable<OptionalChangeset> = {\n\t\t\tmoves: rebasedMoves,\n\t\t\tchildChanges: rebasedChildChanges,\n\t\t};\n\n\t\tif (field !== undefined) {\n\t\t\tconst replace: Mutable<Replace> = {\n\t\t\t\tisEmpty:\n\t\t\t\t\toverChange.valueReplace === undefined\n\t\t\t\t\t\t? field.isEmpty\n\t\t\t\t\t\t: overChange.valueReplace.src === undefined,\n\t\t\t\tdst: field.dst,\n\t\t\t};\n\t\t\tif (field.src !== undefined) {\n\t\t\t\treplace.src = forwardMap.get(field.src) ?? field.src;\n\t\t\t}\n\t\t\trebased.valueReplace = replace;\n\t\t}\n\n\t\treturn rebased;\n\t},\n\n\tprune: (change: OptionalChangeset, pruneChild: NodeChangePruner): OptionalChangeset => {\n\t\tconst childChanges: ChildChange[] = [];\n\t\tconst prunedChange: Mutable<OptionalChangeset> = {\n\t\t\tmoves: change.moves,\n\t\t\tchildChanges,\n\t\t};\n\t\tif (change.valueReplace !== undefined) {\n\t\t\tprunedChange.valueReplace = change.valueReplace;\n\t\t}\n\n\t\tfor (const [id, childChange] of change.childChanges) {\n\t\t\tconst prunedChildChange = pruneChild(childChange);\n\t\t\tif (prunedChildChange !== undefined) {\n\t\t\t\tchildChanges.push([id, prunedChildChange]);\n\t\t\t}\n\t\t}\n\n\t\treturn prunedChange;\n\t},\n\n\treplaceRevisions: (\n\t\tchange: OptionalChangeset,\n\t\treplacer: RevisionReplacer,\n\t): OptionalChangeset => {\n\t\tconst valueReplace = replaceReplaceRevisions(change.valueReplace, replacer);\n\n\t\tconst childChanges: ChildChange[] = [];\n\t\tfor (const [id, childChange] of change.childChanges) {\n\t\t\tchildChanges.push([\n\t\t\t\treplaceRegisterRevisions(id, replacer),\n\t\t\t\treplacer.getUpdatedAtomId(childChange),\n\t\t\t]);\n\t\t}\n\n\t\tconst moves: Move[] = [];\n\t\tfor (const [src, dst] of change.moves) {\n\t\t\tmoves.push([replacer.getUpdatedAtomId(src), replacer.getUpdatedAtomId(dst)]);\n\t\t}\n\n\t\tconst updated: Mutable<OptionalChangeset> = { childChanges, moves };\n\t\tif (valueReplace !== undefined) {\n\t\t\tupdated.valueReplace = valueReplace;\n\t\t}\n\n\t\treturn updated;\n\t},\n\n\tmute: (change: OptionalChangeset): OptionalChangeset => {\n\t\treturn { childChanges: change.childChanges, moves: [] };\n\t},\n};\n\nfunction replaceReplaceRevisions(\n\treplace: Replace | undefined,\n\treplacer: RevisionReplacer,\n): Replace | undefined {\n\tif (replace === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst updated: Mutable<Replace> = {\n\t\t...replace,\n\t\tdst: replacer.getUpdatedAtomId(replace.dst),\n\t};\n\n\tif (replace.src !== undefined) {\n\t\tupdated.src = replaceRegisterRevisions(replace.src, replacer);\n\t}\n\n\treturn updated;\n}\n\nfunction replaceRegisterRevisions(\n\tregister: RegisterId,\n\treplacer: RevisionReplacer,\n): RegisterId {\n\treturn register === \"self\" ? register : replacer.getUpdatedAtomId(register);\n}\n\nfunction getComposedReplaceDst(\n\tchange1: Replace | undefined,\n\tchange2: OptionalChangeset,\n): ChangeAtomId {\n\tconst dst1 = change1?.dst;\n\tif (change2.valueReplace === undefined) {\n\t\tassert(dst1 !== undefined, 0x8ce /* Both replace replaces should not be undefined */);\n\t\treturn getIdAfterMoves(dst1, change2.moves);\n\t}\n\n\tif (\n\t\tdst1 === undefined ||\n\t\tchange1?.src === \"self\" ||\n\t\t(change2.valueReplace.src !== undefined &&\n\t\t\tareEqualRegisterIds(change2.valueReplace.src, dst1))\n\t) {\n\t\tassert(\n\t\t\tchange2.valueReplace !== undefined,\n\t\t\t0x8cf /* Both replace replaces should not be undefined */,\n\t\t);\n\t\treturn change2.valueReplace.dst;\n\t} else {\n\t\treturn getIdAfterMoves(dst1, change2.moves);\n\t}\n}\n\nfunction getIdAfterMoves(id: ChangeAtomId, moves: readonly Move[]): ChangeAtomId {\n\tfor (const [src, dst] of moves) {\n\t\tif (areEqualChangeAtomIds(id, src)) {\n\t\t\treturn dst;\n\t\t}\n\t}\n\treturn id;\n}\n\nfunction areEqualRegisterIds(id1: RegisterId, id2: RegisterId): boolean {\n\treturn id1 === \"self\" || id2 === \"self\" ? id1 === id2 : areEqualChangeAtomIds(id1, id2);\n}\n\nfunction areEqualRegisterIdsOpt(\n\tid1: RegisterId | undefined,\n\tid2: RegisterId | undefined,\n): boolean {\n\tif (id1 === undefined || id2 === undefined) {\n\t\treturn id1 === id2;\n\t}\n\treturn areEqualRegisterIds(id1, id2);\n}\n\nfunction getBidirectionalMaps(moves: OptionalChangeset[\"moves\"]): {\n\tsrcToDst: ChangeAtomIdMap<ChangeAtomId>;\n\tdstToSrc: ChangeAtomIdMap<ChangeAtomId>;\n} {\n\tconst srcToDst: ChangeAtomIdMap<ChangeAtomId> = new Map();\n\tconst dstToSrc: ChangeAtomIdMap<ChangeAtomId> = new Map();\n\tfor (const [src, dst] of moves) {\n\t\tsetInNestedMap(srcToDst, src.revision, src.localId, dst);\n\t\tsetInNestedMap(dstToSrc, dst.revision, dst.localId, src);\n\t}\n\treturn { srcToDst, dstToSrc };\n}\n\ntype EffectfulReplace =\n\t| {\n\t\t\tisEmpty: true;\n\t\t\tsrc?: ChangeAtomId;\n\t\t\tdst: ChangeAtomId;\n\t }\n\t| {\n\t\t\tisEmpty: boolean;\n\t\t\tsrc: ChangeAtomId;\n\t\t\tdst: ChangeAtomId;\n\t };\n\nfunction isReplaceEffectful(replace: Replace): replace is EffectfulReplace {\n\tif (replace.src === \"self\") {\n\t\treturn false;\n\t}\n\treturn !replace.isEmpty || replace.src !== undefined;\n}\n\nfunction getEffectfulDst(replace: Replace | undefined): ChangeAtomId | undefined {\n\treturn replace === undefined || replace.isEmpty || replace.src === \"self\"\n\t\t? undefined\n\t\t: replace.dst;\n}\n\nexport function taggedRegister(id: RegisterId, revision: RevisionTag | undefined): RegisterId {\n\tif (id === \"self\") {\n\t\treturn id;\n\t}\n\n\treturn taggedAtomId(id, revision);\n}\n\nexport interface OptionalFieldEditor extends FieldEditor<OptionalChangeset> {\n\t/**\n\t * Creates a change which will replace the content already in the field (if any at the time the change applies)\n\t * with new content.\n\t * The content in the field will be moved to the `ids.detach` register.\n\t * The content in the `ids.detach` register will be moved to into the field.\n\t * @param wasEmpty - whether the field is empty when creating this change\n\t * @param ids - the \"fill\" and \"detach\" ids associated with the change.\n\t */\n\tset(\n\t\twasEmpty: boolean,\n\t\tids: {\n\t\t\tfill: ChangeAtomId;\n\t\t\tdetach: ChangeAtomId;\n\t\t},\n\t): OptionalChangeset;\n\n\t/**\n\t * Creates a change which clears the field's contents (if any).\n\t * @param wasEmpty - whether the field is empty when creating this change\n\t * @param detachId - the ID of the register that existing field content (if any) will be moved to.\n\t */\n\tclear(wasEmpty: boolean, detachId: ChangeAtomId): OptionalChangeset;\n}\n\nexport const optionalFieldEditor: OptionalFieldEditor = {\n\tset: (\n\t\twasEmpty: boolean,\n\t\tids: {\n\t\t\tfill: ChangeAtomId;\n\t\t\t// Should be interpreted as a set of an empty field if undefined.\n\t\t\tdetach: ChangeAtomId;\n\t\t},\n\t): OptionalChangeset => ({\n\t\tmoves: [],\n\t\tchildChanges: [],\n\t\tvalueReplace: {\n\t\t\tisEmpty: wasEmpty,\n\t\t\tsrc: ids.fill,\n\t\t\tdst: ids.detach,\n\t\t},\n\t}),\n\n\tclear: (wasEmpty: boolean, detachId: ChangeAtomId): OptionalChangeset => ({\n\t\tmoves: [],\n\t\tchildChanges: [],\n\t\tvalueReplace: {\n\t\t\tisEmpty: wasEmpty,\n\t\t\tdst: detachId,\n\t\t},\n\t}),\n\n\tbuildChildChanges: (changes: Iterable<[number, NodeId]>): OptionalChangeset => {\n\t\tconst childChanges: ChildChange[] = Array.from(changes, ([index, childChange]) => {\n\t\t\tassert(index === 0, 0x404 /* Optional fields only support a single child node */);\n\t\t\treturn [\"self\", childChange];\n\t\t});\n\t\tassert(\n\t\t\tchildChanges.length <= 1,\n\t\t\t0xabd /* Optional fields only support a single child node */,\n\t\t);\n\t\treturn {\n\t\t\tmoves: [],\n\t\t\tchildChanges,\n\t\t};\n\t},\n};\n\nexport function optionalFieldIntoDelta(\n\tchange: OptionalChangeset,\n\tdeltaFromChild: ToDelta,\n): FieldChangeDelta {\n\tconst delta: Mutable<FieldChangeDelta> = {};\n\n\tlet markIsANoop = true;\n\tconst mark: Mutable<DeltaMark> = { count: 1 };\n\n\tif (change.valueReplace !== undefined && isReplaceEffectful(change.valueReplace)) {\n\t\tif (!change.valueReplace.isEmpty) {\n\t\t\tmark.detach = nodeIdFromChangeAtom(change.valueReplace.dst);\n\t\t}\n\t\tif (change.valueReplace.src !== undefined) {\n\t\t\tmark.attach = nodeIdFromChangeAtom(change.valueReplace.src);\n\t\t}\n\t\tmarkIsANoop = false;\n\t}\n\n\tif (change.moves.length > 0) {\n\t\tdelta.rename = change.moves.map(([src, dst]) => ({\n\t\t\tcount: 1,\n\t\t\toldId: nodeIdFromChangeAtom(src),\n\t\t\tnewId: nodeIdFromChangeAtom(dst),\n\t\t}));\n\t}\n\n\tif (change.childChanges.length > 0) {\n\t\tconst globals: DeltaDetachedNodeChanges[] = [];\n\t\tfor (const [id, childChange] of change.childChanges) {\n\t\t\tconst childDelta = deltaFromChild(childChange);\n\t\t\tif (id === \"self\") {\n\t\t\t\tmark.fields = childDelta;\n\t\t\t\tmarkIsANoop = false;\n\t\t\t} else {\n\t\t\t\tconst fields = childDelta;\n\t\t\t\tglobals.push({\n\t\t\t\t\tid: { major: id.revision, minor: id.localId },\n\t\t\t\t\tfields,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (globals.length > 0) {\n\t\t\tdelta.global = globals;\n\t\t}\n\t}\n\n\tif (!markIsANoop) {\n\t\tdelta.local = [mark];\n\t}\n\n\treturn delta;\n}\n\nexport const optionalChangeHandler: FieldChangeHandler<\n\tOptionalChangeset,\n\tOptionalFieldEditor\n> = {\n\trebaser: optionalChangeRebaser,\n\tcodecsFactory: makeOptionalFieldCodecFamily,\n\teditor: optionalFieldEditor,\n\n\tintoDelta: optionalFieldIntoDelta,\n\trelevantRemovedRoots,\n\n\tisEmpty: (change: OptionalChangeset) =>\n\t\tchange.childChanges.length === 0 &&\n\t\tchange.moves.length === 0 &&\n\t\tchange.valueReplace === undefined,\n\n\tgetNestedChanges,\n\n\tcreateEmpty: () => ({ moves: [], childChanges: [] }),\n\tgetCrossFieldKeys: (_change) => [],\n};\n\nfunction getNestedChanges(change: OptionalChangeset): NestedChangesIndices {\n\t// True iff the content of the field changes in some way\n\tconst isFieldContentChanged =\n\t\tchange.valueReplace !== undefined && change.valueReplace.src !== \"self\";\n\n\t// The node that is moved into the field (if any).\n\tconst nodeMovedIntoField = change.valueReplace?.src;\n\n\treturn change.childChanges.map(([register, nodeId]) => {\n\t\t// The node is removed in the input context iif register is not self.\n\t\tconst inputIndex = register === \"self\" ? 0 : undefined;\n\t\tconst outputIndex =\n\t\t\tregister === \"self\"\n\t\t\t\t? // If the node starts out as not-removed, it is removed in the output context iff the field content is changed\n\t\t\t\t\tisFieldContentChanged\n\t\t\t\t\t? undefined\n\t\t\t\t\t: 0\n\t\t\t\t: // If the node starts out as removed, then it remains removed in the output context iff it is not the node that is moved into the field\n\t\t\t\t\tareEqualRegisterIdsOpt(register, nodeMovedIntoField)\n\t\t\t\t\t? 0\n\t\t\t\t\t: undefined;\n\t\treturn [nodeId, inputIndex, outputIndex];\n\t});\n}\n\nfunction* relevantRemovedRoots(\n\tchange: OptionalChangeset,\n\trelevantRemovedRootsFromChild: RelevantRemovedRootsFromChild,\n): Iterable<DeltaDetachedNodeId> {\n\tconst alreadyYielded = new RegisterMap<boolean>();\n\n\tfor (const [src] of change.moves) {\n\t\tif (!alreadyYielded.has(src)) {\n\t\t\talreadyYielded.set(src, true);\n\t\t\tyield nodeIdFromChangeAtom(src);\n\t\t}\n\t}\n\n\tfor (const [id, childChange] of change.childChanges) {\n\t\t// Child changes make the tree they apply to relevant unless that tree existed in the starting context of\n\t\t// of this change.\n\t\tif (id !== \"self\" && !alreadyYielded.has(id)) {\n\t\t\talreadyYielded.set(id, true);\n\t\t\tyield nodeIdFromChangeAtom(id);\n\t\t}\n\t\tyield* relevantRemovedRootsFromChild(childChange);\n\t}\n\n\tconst selfSrc = change.valueReplace?.src;\n\tif (selfSrc !== undefined && selfSrc !== \"self\" && !alreadyYielded.has(selfSrc)) {\n\t\tyield nodeIdFromChangeAtom(selfSrc);\n\t}\n}\n\ninterface Optional\n\textends FlexFieldKind<\n\t\tOptionalFieldEditor,\n\t\ttypeof optionalIdentifier,\n\t\tMultiplicity.Optional\n\t> {}\n\n/**\n * 0 or 1 items.\n */\nexport const optional: Optional = new FlexFieldKind(\n\toptionalIdentifier,\n\tMultiplicity.Optional,\n\t{\n\t\tchangeHandler: optionalChangeHandler,\n\t\tallowMonotonicUpgradeFrom: new Set([\n\t\t\tidentifierFieldIdentifier,\n\t\t\trequiredIdentifier,\n\t\t\tforbiddenFieldKindIdentifier,\n\t\t]),\n\t},\n);\n"]}
@@ -0,0 +1,36 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { type ChangeAtomId, Multiplicity } from "../../core/index.js";
6
+ import { requiredIdentifier } from "../fieldKindIdentifiers.js";
7
+ import { type FieldEditor, type FieldChangeHandler, FlexFieldKind } from "../modular-schema/index.js";
8
+ import type { OptionalChangeset } from "./optionalFieldChangeTypes.js";
9
+ /**
10
+ * {@link FieldEditor} for required fields (always contain exactly 1 child).
11
+ * @remarks
12
+ * This shares code with optional fields, since they are the same edit wise except setting to empty is not allowed,
13
+ * and the content is always assumed to not be empty.
14
+ * This means the actual edits implemented for optional fields are sufficient to support required fields
15
+ * which is why this is defined and implemented in terms of optional fields.
16
+ */
17
+ export interface RequiredFieldEditor extends FieldEditor<OptionalChangeset> {
18
+ /**
19
+ * Creates a change which replaces the current value of the field with `newValue`.
20
+ * @param ids - The ids for the fill and detach fields.
21
+ */
22
+ set(ids: {
23
+ fill: ChangeAtomId;
24
+ detach: ChangeAtomId;
25
+ }): OptionalChangeset;
26
+ }
27
+ export declare const requiredFieldEditor: RequiredFieldEditor;
28
+ export declare const requiredFieldChangeHandler: FieldChangeHandler<OptionalChangeset, RequiredFieldEditor>;
29
+ interface Required extends FlexFieldKind<RequiredFieldEditor, typeof requiredIdentifier, Multiplicity.Single> {
30
+ }
31
+ /**
32
+ * Exactly one item.
33
+ */
34
+ export declare const required: Required;
35
+ export {};
36
+ //# sourceMappingURL=requiredField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requiredField.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/requiredField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAA6B,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EACN,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,aAAa,EACb,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAMvE;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAoB,SAAQ,WAAW,CAAC,iBAAiB,CAAC;IAC1E;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,YAAY,CAAA;KAAE,GAAG,iBAAiB,CAAC;CAC1E;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAMjC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,kBAAkB,CAC1D,iBAAiB,EACjB,mBAAmB,CAInB,CAAC;AAEF,UAAU,QACT,SAAQ,aAAa,CAAC,mBAAmB,EAAE,OAAO,kBAAkB,EAAE,YAAY,CAAC,MAAM,CAAC;CAAG;AAE9F;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,QAGrB,CAAC"}
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { Multiplicity } from "../../core/index.js";
6
+ import { requiredIdentifier, identifierFieldIdentifier } from "../fieldKindIdentifiers.js";
7
+ import { FlexFieldKind, } from "../modular-schema/index.js";
8
+ import { optionalChangeHandler, optionalFieldEditor } from "./optionalField.js";
9
+ export const requiredFieldEditor = {
10
+ ...optionalFieldEditor,
11
+ set: (ids) => optionalFieldEditor.set(false, ids),
12
+ };
13
+ export const requiredFieldChangeHandler = {
14
+ ...optionalChangeHandler,
15
+ editor: requiredFieldEditor,
16
+ };
17
+ /**
18
+ * Exactly one item.
19
+ */
20
+ export const required = new FlexFieldKind(requiredIdentifier, Multiplicity.Single, {
21
+ changeHandler: requiredFieldChangeHandler,
22
+ allowMonotonicUpgradeFrom: new Set([identifierFieldIdentifier]),
23
+ });
24
+ //# sourceMappingURL=requiredField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requiredField.js","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/requiredField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAqB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAGN,aAAa,GACb,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAuBhF,MAAM,CAAC,MAAM,mBAAmB,GAAwB;IACvD,GAAG,mBAAmB;IACtB,GAAG,EAAE,CAAC,GAGL,EAAqB,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC;CAC5D,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAGnC;IACH,GAAG,qBAAqB;IACxB,MAAM,EAAE,mBAAmB;CAC3B,CAAC;AAKF;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAa,IAAI,aAAa,CAAC,kBAAkB,EAAE,YAAY,CAAC,MAAM,EAAE;IAC5F,aAAa,EAAE,0BAA0B;IACzC,yBAAyB,EAAE,IAAI,GAAG,CAAC,CAAC,yBAAyB,CAAC,CAAC;CAC/D,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ChangeAtomId, Multiplicity } from \"../../core/index.js\";\nimport { requiredIdentifier, identifierFieldIdentifier } from \"../fieldKindIdentifiers.js\";\nimport {\n\ttype FieldEditor,\n\ttype FieldChangeHandler,\n\tFlexFieldKind,\n} from \"../modular-schema/index.js\";\n\nimport { optionalChangeHandler, optionalFieldEditor } from \"./optionalField.js\";\nimport type { OptionalChangeset } from \"./optionalFieldChangeTypes.js\";\n\n// Required fields are a restricted version of optional fields that must always contain a value.\n// Because of this, the implementation of required fields lives here, inside optional.\n// This avoids having to export optional field implementation details which are only used by required.\n\n/**\n * {@link FieldEditor} for required fields (always contain exactly 1 child).\n * @remarks\n * This shares code with optional fields, since they are the same edit wise except setting to empty is not allowed,\n * and the content is always assumed to not be empty.\n * This means the actual edits implemented for optional fields are sufficient to support required fields\n * which is why this is defined and implemented in terms of optional fields.\n */\nexport interface RequiredFieldEditor extends FieldEditor<OptionalChangeset> {\n\t/**\n\t * Creates a change which replaces the current value of the field with `newValue`.\n\t * @param ids - The ids for the fill and detach fields.\n\t */\n\tset(ids: { fill: ChangeAtomId; detach: ChangeAtomId }): OptionalChangeset;\n}\n\nexport const requiredFieldEditor: RequiredFieldEditor = {\n\t...optionalFieldEditor,\n\tset: (ids: {\n\t\tfill: ChangeAtomId;\n\t\tdetach: ChangeAtomId;\n\t}): OptionalChangeset => optionalFieldEditor.set(false, ids),\n};\n\nexport const requiredFieldChangeHandler: FieldChangeHandler<\n\tOptionalChangeset,\n\tRequiredFieldEditor\n> = {\n\t...optionalChangeHandler,\n\teditor: requiredFieldEditor,\n};\n\ninterface Required\n\textends FlexFieldKind<RequiredFieldEditor, typeof requiredIdentifier, Multiplicity.Single> {}\n\n/**\n * Exactly one item.\n */\nexport const required: Required = new FlexFieldKind(requiredIdentifier, Multiplicity.Single, {\n\tchangeHandler: requiredFieldChangeHandler,\n\tallowMonotonicUpgradeFrom: new Set([identifierFieldIdentifier]),\n});\n"]}
@@ -4,8 +4,8 @@
4
4
  */
5
5
  import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
6
6
  import { type CodecTree, type CodecWriteOptions, type ICodecFamily, type IJsonCodec } from "../../codec/index.js";
7
- import type { SchemaChange } from "./schemaChangeTypes.js";
8
7
  import { SchemaFormatVersion } from "../../core/index.js";
8
+ import type { SchemaChange } from "./schemaChangeTypes.js";
9
9
  /**
10
10
  * Create a family of schema change codecs.
11
11
  * @param options - Specifies common codec options, including which `validator` to use.
@@ -1 +1 @@
1
- {"version":3,"file":"schemaChangeCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAE5F,OAAO,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,UAAU,EAIf,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,iBAAiB,GACxB,YAAY,CAAC,YAAY,CAAC,CAoB5B;AAED,wBAAgB,iCAAiC,CAChD,OAAO,EAAE,mBAAmB,EAC5B,aAAa,EAAE,uBAAuB,GACpC,SAAS,CAMX;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,iBAAiB,EAC1B,YAAY,EAAE,mBAAmB,GAC/B,UAAU,CAAC,YAAY,CAAC,CAG1B"}
1
+ {"version":3,"file":"schemaChangeCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAE5F,OAAO,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,UAAU,EAIf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAI1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,iBAAiB,GACxB,YAAY,CAAC,YAAY,CAAC,CAoB5B;AAED,wBAAgB,iCAAiC,CAChD,OAAO,EAAE,mBAAmB,EAC5B,aAAa,EAAE,uBAAuB,GACpC,SAAS,CAMX;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,iBAAiB,EAC1B,YAAY,EAAE,mBAAmB,GAC/B,UAAU,CAAC,YAAY,CAAC,CAG1B"}
@@ -4,9 +4,9 @@
4
4
  */
5
5
  import { assert } from "@fluidframework/core-utils/internal";
6
6
  import { makeCodecFamily, makeVersionDispatchingCodec, withSchemaValidation, } from "../../codec/index.js";
7
+ import { SchemaFormatVersion } from "../../core/index.js";
7
8
  import { makeSchemaCodec, schemaCodecBuilder } from "../schema-index/index.js";
8
9
  import { EncodedSchemaChange } from "./schemaChangeFormat.js";
9
- import { SchemaFormatVersion } from "../../core/index.js";
10
10
  /**
11
11
  * Create a family of schema change codecs.
12
12
  * @param options - Specifies common codec options, including which `validator` to use.
@@ -1 +1 @@
1
- {"version":3,"file":"schemaChangeCodecs.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAG7D,OAAO,EAKN,eAAe,EACf,2BAA2B,EAC3B,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACrC,OAA0B;IAE1B,OAAO,eAAe,CAAC;QACtB,CAAC,mBAAmB,CAAC,EAAE,EAAE,uBAAuB,CAAC,OAAO,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC;QAClF,iIAAiI;QACjI,uGAAuG;QACvG,4FAA4F;QAC5F,4EAA4E;QAC5E,2JAA2J;QAC3J,kGAAkG;QAClG,qKAAqK;QACrK,kGAAkG;QAClG,2GAA2G;QAC3G;YACC,mBAAmB,CAAC,EAAE;YACtB,uBAAuB,CACtB,EAAE,GAAG,OAAO,EAAE,8CAA8C,EAAE,IAAI,EAAE,EACpE,mBAAmB,CAAC,EAAE,CACtB;SACD;KACD,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC,CAChD,OAA4B,EAC5B,aAAsC;IAEtC,OAAO;QACN,IAAI,EAAE,cAAc;QACpB,OAAO;QACP,QAAQ,EAAE,CAAC,kBAAkB,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;KAC1D,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACpC,OAA0B,EAC1B,YAAiC;IAEjC,MAAM,MAAM,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAC/C,OAAO,2BAA2B,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED;;;;;GAKG;AACH,SAAS,uBAAuB,CAC/B,OAA0B,EAC1B,kBAAuC;IAEvC,MAAM,WAAW,GAAG,eAAe,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;IACjE,MAAM,iBAAiB,GAAkD;QACxE,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE;YACxB,MAAM,CACL,CAAC,YAAY,CAAC,SAAS,EACvB,KAAK,CAAC,wDAAwD,CAC9D,CAAC;YACF,OAAO;gBACN,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC;gBAChD,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC;aAChD,CAAC;QACH,CAAC;QACD,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;YACnB,OAAO;gBACN,MAAM,EAAE;oBACP,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;oBACpC,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;iBACpC;gBACD,SAAS,EAAE,KAAK;aAChB,CAAC;QACH,CAAC;QACD,aAAa,EAAE,mBAAmB;KAClC,CAAC;IAEF,OAAO,oBAAoB,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;AAC5F,CAAC","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\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\ttype ICodecFamily,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\tmakeVersionDispatchingCodec,\n\twithSchemaValidation,\n} from \"../../codec/index.js\";\nimport { makeSchemaCodec, schemaCodecBuilder } from \"../schema-index/index.js\";\n\nimport { EncodedSchemaChange } from \"./schemaChangeFormat.js\";\nimport type { SchemaChange } from \"./schemaChangeTypes.js\";\nimport { SchemaFormatVersion } from \"../../core/index.js\";\n\n/**\n * Create a family of schema change codecs.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The composed codec family.\n */\nexport function makeSchemaChangeCodecs(\n\toptions: CodecWriteOptions,\n): ICodecFamily<SchemaChange> {\n\treturn makeCodecFamily([\n\t\t[SchemaFormatVersion.v1, makeSchemaChangeCodecV1(options, SchemaFormatVersion.v1)],\n\t\t// This code (makeSchemaChangeCodecs) is constructing a SchemaFormatVersion.v2 codec, regardless of the requested write version.\n\t\t// It then trusts the user of the produced makeCodecFamily to only select if when it is valid to do so.\n\t\t// This trust is manifests in having to use `allowPossiblyIncompatibleWriteVersionOverrides`\n\t\t// here as it needs to build the v2 codec regardless of if its valid to use.\n\t\t// TODO: There should not be two separate places selecting the write version for this codec. Such cases should instead adopt one of the following patterns:\n\t\t// 1. The outer coded should let the inner one do its own version selection instead of forcing it.\n\t\t// 2. The outer codec should fully handle version selection and embed the inner content directly (referencing its format not codec) and not involve the codec at all.\n\t\t// TODO: fix this up when migrating SchemaChangeCodec to use ClientVersionDispatchingCodecBuilder.\n\t\t// This should probably use pattern 1 above, which will result in this codec having two identical versions.\n\t\t[\n\t\t\tSchemaFormatVersion.v2,\n\t\t\tmakeSchemaChangeCodecV1(\n\t\t\t\t{ ...options, allowPossiblyIncompatibleWriteVersionOverrides: true },\n\t\t\t\tSchemaFormatVersion.v2,\n\t\t\t),\n\t\t],\n\t]);\n}\n\nexport function getCodecTreeForSchemaChangeFormat(\n\tversion: SchemaFormatVersion,\n\tclientVersion: MinimumVersionForCollab,\n): CodecTree {\n\treturn {\n\t\tname: \"SchemaChange\",\n\t\tversion,\n\t\tchildren: [schemaCodecBuilder.getCodecTree(clientVersion)],\n\t};\n}\n\n/**\n * Create a schema change codec.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @param writeVersion - The schema change write version.\n * @returns The composed codec.\n */\nexport function makeSchemaChangeCodec(\n\toptions: CodecWriteOptions,\n\twriteVersion: SchemaFormatVersion,\n): IJsonCodec<SchemaChange> {\n\tconst family = makeSchemaChangeCodecs(options);\n\treturn makeVersionDispatchingCodec(family, { ...options, writeVersion });\n}\n\n/**\n * Compose the change codec using mostly v1 logic.\n * @param options - The codec options.\n * @param schemaWriteVersion - The schema write version.\n * @returns The composed schema change codec.\n */\nfunction makeSchemaChangeCodecV1(\n\toptions: CodecWriteOptions,\n\tschemaWriteVersion: SchemaFormatVersion,\n): IJsonCodec<SchemaChange, EncodedSchemaChange> {\n\tconst schemaCodec = makeSchemaCodec(options, schemaWriteVersion);\n\tconst schemaChangeCodec: IJsonCodec<SchemaChange, EncodedSchemaChange> = {\n\t\tencode: (schemaChange) => {\n\t\t\tassert(\n\t\t\t\t!schemaChange.isInverse,\n\t\t\t\t0x933 /* Inverse schema changes should never be transmitted */,\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tnew: schemaCodec.encode(schemaChange.schema.new),\n\t\t\t\told: schemaCodec.encode(schemaChange.schema.old),\n\t\t\t};\n\t\t},\n\t\tdecode: (encoded) => {\n\t\t\treturn {\n\t\t\t\tschema: {\n\t\t\t\t\tnew: schemaCodec.decode(encoded.new),\n\t\t\t\t\told: schemaCodec.decode(encoded.old),\n\t\t\t\t},\n\t\t\t\tisInverse: false,\n\t\t\t};\n\t\t},\n\t\tencodedSchema: EncodedSchemaChange,\n\t};\n\n\treturn withSchemaValidation(EncodedSchemaChange, schemaChangeCodec, options.jsonValidator);\n}\n"]}
1
+ {"version":3,"file":"schemaChangeCodecs.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAG7D,OA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GAAG,eAAe,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;IACjE,MAAM,iBAAiB,GAAkD;QACxE,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE;YACxB,MAAM,CACL,CAAC,YAAY,CAAC,SAAS,EACvB,KAAK,CAAC,wDAAwD,CAC9D,CAAC;YACF,OAAO;gBACN,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC;gBAChD,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC;aAChD,CAAC;QACH,CAAC;QACD,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;YACnB,OAAO;gBACN,MAAM,EAAE;oBACP,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;oBACpC,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;iBACpC;gBACD,SAAS,EAAE,KAAK;aAChB,CAAC;QACH,CAAC;QACD,aAAa,EAAE,mBAAmB;KAClC,CAAC;IAEF,OAAO,oBAAoB,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;AAC5F,CAAC","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\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\ttype ICodecFamily,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\tmakeVersionDispatchingCodec,\n\twithSchemaValidation,\n} from \"../../codec/index.js\";\nimport { SchemaFormatVersion } from \"../../core/index.js\";\nimport { makeSchemaCodec, schemaCodecBuilder } from \"../schema-index/index.js\";\n\nimport { EncodedSchemaChange } from \"./schemaChangeFormat.js\";\nimport type { SchemaChange } from \"./schemaChangeTypes.js\";\n\n/**\n * Create a family of schema change codecs.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The composed codec family.\n */\nexport function makeSchemaChangeCodecs(\n\toptions: CodecWriteOptions,\n): ICodecFamily<SchemaChange> {\n\treturn makeCodecFamily([\n\t\t[SchemaFormatVersion.v1, makeSchemaChangeCodecV1(options, SchemaFormatVersion.v1)],\n\t\t// This code (makeSchemaChangeCodecs) is constructing a SchemaFormatVersion.v2 codec, regardless of the requested write version.\n\t\t// It then trusts the user of the produced makeCodecFamily to only select if when it is valid to do so.\n\t\t// This trust is manifests in having to use `allowPossiblyIncompatibleWriteVersionOverrides`\n\t\t// here as it needs to build the v2 codec regardless of if its valid to use.\n\t\t// TODO: There should not be two separate places selecting the write version for this codec. Such cases should instead adopt one of the following patterns:\n\t\t// 1. The outer coded should let the inner one do its own version selection instead of forcing it.\n\t\t// 2. The outer codec should fully handle version selection and embed the inner content directly (referencing its format not codec) and not involve the codec at all.\n\t\t// TODO: fix this up when migrating SchemaChangeCodec to use ClientVersionDispatchingCodecBuilder.\n\t\t// This should probably use pattern 1 above, which will result in this codec having two identical versions.\n\t\t[\n\t\t\tSchemaFormatVersion.v2,\n\t\t\tmakeSchemaChangeCodecV1(\n\t\t\t\t{ ...options, allowPossiblyIncompatibleWriteVersionOverrides: true },\n\t\t\t\tSchemaFormatVersion.v2,\n\t\t\t),\n\t\t],\n\t]);\n}\n\nexport function getCodecTreeForSchemaChangeFormat(\n\tversion: SchemaFormatVersion,\n\tclientVersion: MinimumVersionForCollab,\n): CodecTree {\n\treturn {\n\t\tname: \"SchemaChange\",\n\t\tversion,\n\t\tchildren: [schemaCodecBuilder.getCodecTree(clientVersion)],\n\t};\n}\n\n/**\n * Create a schema change codec.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @param writeVersion - The schema change write version.\n * @returns The composed codec.\n */\nexport function makeSchemaChangeCodec(\n\toptions: CodecWriteOptions,\n\twriteVersion: SchemaFormatVersion,\n): IJsonCodec<SchemaChange> {\n\tconst family = makeSchemaChangeCodecs(options);\n\treturn makeVersionDispatchingCodec(family, { ...options, writeVersion });\n}\n\n/**\n * Compose the change codec using mostly v1 logic.\n * @param options - The codec options.\n * @param schemaWriteVersion - The schema write version.\n * @returns The composed schema change codec.\n */\nfunction makeSchemaChangeCodecV1(\n\toptions: CodecWriteOptions,\n\tschemaWriteVersion: SchemaFormatVersion,\n): IJsonCodec<SchemaChange, EncodedSchemaChange> {\n\tconst schemaCodec = makeSchemaCodec(options, schemaWriteVersion);\n\tconst schemaChangeCodec: IJsonCodec<SchemaChange, EncodedSchemaChange> = {\n\t\tencode: (schemaChange) => {\n\t\t\tassert(\n\t\t\t\t!schemaChange.isInverse,\n\t\t\t\t0x933 /* Inverse schema changes should never be transmitted */,\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tnew: schemaCodec.encode(schemaChange.schema.new),\n\t\t\t\told: schemaCodec.encode(schemaChange.schema.old),\n\t\t\t};\n\t\t},\n\t\tdecode: (encoded) => {\n\t\t\treturn {\n\t\t\t\tschema: {\n\t\t\t\t\tnew: schemaCodec.decode(encoded.new),\n\t\t\t\t\told: schemaCodec.decode(encoded.old),\n\t\t\t\t},\n\t\t\t\tisInverse: false,\n\t\t\t};\n\t\t},\n\t\tencodedSchema: EncodedSchemaChange,\n\t};\n\n\treturn withSchemaValidation(EncodedSchemaChange, schemaChangeCodec, options.jsonValidator);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"schemaChangeFormat.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAGtD,eAAO,MAAM,mBAAmB;;;EAG9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"schemaChangeFormat.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAItD,eAAO,MAAM,mBAAmB;;;EAG9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"schemaChangeFormat.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAEnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC9C,GAAG,EAAE,4BAA4B;IACjC,GAAG,EAAE,4BAA4B;CACjC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { JsonCompatibleReadOnlySchema } from \"../../util/index.js\";\n\nexport const EncodedSchemaChange = Type.Object({\n\tnew: JsonCompatibleReadOnlySchema,\n\told: JsonCompatibleReadOnlySchema,\n});\n\nexport type EncodedSchemaChange = Static<typeof EncodedSchemaChange>;\n"]}
1
+ {"version":3,"file":"schemaChangeFormat.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAEnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC9C,GAAG,EAAE,4BAA4B;IACjC,GAAG,EAAE,4BAA4B;CACjC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\n\nimport { JsonCompatibleReadOnlySchema } from \"../../util/index.js\";\n\nexport const EncodedSchemaChange = Type.Object({\n\tnew: JsonCompatibleReadOnlySchema,\n\told: JsonCompatibleReadOnlySchema,\n});\n\nexport type EncodedSchemaChange = Static<typeof EncodedSchemaChange>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"schemaChecker.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/schemaChecker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,KAAK,qBAAqB,EAI1B,YAAY,EACZ,KAAK,eAAe,EACpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAG1F,oBAAY,qBAAqB;IAChC,2BAA2B,IAAA;IAC3B,0BAA0B,IAAA;IAC1B,gCAAgC,IAAA;IAChC,2BAA2B,IAAA;IAC3B,wBAAwB,IAAA;IACxB,qBAAqB,IAAA;IACrB,yBAAyB,IAAA;IACzB,2BAA2B,IAAA;IAC3B,2BAA2B,IAAA;IAC3B,kBAAkB,IAAA;CAClB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,qBAAqB,GAAG,KAAK,CAIzE;AAED,KAAK,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzE;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,YAAY,EACpD,IAAI,EAAE,sBAAsB,EAC5B,eAAe,EAAE,eAAe,EAChC,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,CAAC,GAC1C,CAAC,GAAG,SAAS,CA6Df;AAED;;;;;;GAMG;AACH,wBAAgB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;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,YAAY,EACrD,UAAU,EAAE,uBAAuB,CAAC,sBAAsB,CAAC,EAC3D,MAAM,EAAE,qBAAqB,EAC7B,eAAe,EAAE,eAAe,EAChC,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,CAAC,GAC1C,CAAC,GAAG,SAAS,CA6Bf;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACvC,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,YAAY,GACxB,qBAAqB,GAAG,SAAS,CA4BnC"}
@@ -5,8 +5,8 @@
5
5
  import { unreachableCase, fail } from "@fluidframework/core-utils/internal";
6
6
  import { UsageError } from "@fluidframework/telemetry-utils/internal";
7
7
  import { LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema, Multiplicity, } from "../core/index.js";
8
- import { allowsValue } from "./valueUtilities.js";
9
8
  import { iterableHasSome, mapIterable } from "../util/index.js";
9
+ import { allowsValue } from "./valueUtilities.js";
10
10
  export var SchemaValidationError;
11
11
  (function (SchemaValidationError) {
12
12
  SchemaValidationError[SchemaValidationError["Field_KindNotInSchemaPolicy"] = 0] = "Field_KindNotInSchemaPolicy";
@@ -1 +1 @@
1
- {"version":3,"file":"schemaChecker.js","sourceRoot":"","sources":["../../src/feature-libraries/schemaChecker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAEN,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,YAAY,GAEZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEhE,MAAM,CAAN,IAAY,qBAWX;A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AM,CAAC,CAAC,CAAC;YAC1B,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;gBACvB,OAAO,qBAAqB,CAAC,0BAA0B,CAAC;YACzD,CAAC;iBAAM,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;gBAC9B,OAAO,qBAAqB,CAAC,gCAAgC,CAAC;YAC/D,CAAC;iBAAM,CAAC;gBACP,OAAO,SAAS,CAAC;YAClB,CAAC;QACF,CAAC;QACD,KAAK,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC5B,OAAO,aAAa,GAAG,CAAC;gBACvB,CAAC,CAAC,qBAAqB,CAAC,gCAAgC;gBACxD,CAAC,CAAC,SAAS,CAAC;QACd,CAAC;QACD,KAAK,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC5B,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,KAAK,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;YAC7B,OAAO,aAAa,KAAK,CAAC;gBACzB,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,qBAAqB,CAAC,2BAA2B,CAAC;QACtD,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,eAAe,CAAC,YAAY,CAAC,CAAC;QAC/B,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype TreeFieldStoredSchema,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tMultiplicity,\n\ttype SchemaAndPolicy,\n} from \"../core/index.js\";\nimport { allowsValue } from \"./valueUtilities.js\";\nimport type { MapTreeFieldViewGeneric, MinimalMapTreeNodeView } from \"./mapTreeCursor.js\";\nimport { iterableHasSome, mapIterable } from \"../util/index.js\";\n\nexport enum SchemaValidationError {\n\tField_KindNotInSchemaPolicy,\n\tField_MissingRequiredChild,\n\tField_MultipleChildrenNotAllowed,\n\tField_ChildInForbiddenField,\n\tField_NodeTypeNotAllowed,\n\tLeafNode_InvalidValue,\n\tLeafNode_FieldsNotAllowed,\n\tObjectNode_FieldNotInSchema,\n\tNonLeafNode_ValueNotAllowed,\n\tNode_MissingSchema,\n}\n\n/**\n * Throws a UsageError indicating a tree is out of schema.\n */\nexport function throwOutOfSchema(maybeError: SchemaValidationError): never {\n\tthrow new UsageError(\n\t\t`Tree does not conform to schema: ${SchemaValidationError[maybeError]}`,\n\t);\n}\n\ntype NotUndefined = number | string | boolean | bigint | symbol | object;\n\n/**\n * Deeply checks that the provided node complies with the schema based on its identifier.\n *\n * @param onError - Called with the first error (if any).\n *\n * @returns the return value from `onError` if the node or anything inside of it is out of schema, otherwise `undefined`.\n */\nexport function isNodeInSchema<T extends NotUndefined>(\n\tnode: MinimalMapTreeNodeView,\n\tschemaAndPolicy: SchemaAndPolicy,\n\tonError: (error: SchemaValidationError) => T,\n): T | undefined {\n\t// Validate the schema declared by the node exists\n\tconst schema = schemaAndPolicy.schema.nodeSchema.get(node.type);\n\tif (schema === undefined) {\n\t\treturn onError(SchemaValidationError.Node_MissingSchema);\n\t}\n\n\t// Validate the node is well formed according to its schema\n\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\tif (iterableHasSome(node.fields)) {\n\t\t\treturn onError(SchemaValidationError.LeafNode_FieldsNotAllowed);\n\t\t}\n\t\tif (!allowsValue(schema.leafValue, node.value)) {\n\t\t\treturn onError(SchemaValidationError.LeafNode_InvalidValue);\n\t\t}\n\t} else {\n\t\tif (node.value !== undefined) {\n\t\t\treturn onError(SchemaValidationError.NonLeafNode_ValueNotAllowed);\n\t\t}\n\n\t\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\t\tconst uncheckedFieldsFromNode = new Set(mapIterable(node.fields, ([key, field]) => key));\n\t\t\tfor (const [fieldKey, fieldSchema] of schema.objectNodeFields) {\n\t\t\t\tconst nodeField = node.fields.get(fieldKey) ?? [];\n\t\t\t\tconst fieldInSchemaResult = isFieldInSchema(\n\t\t\t\t\tnodeField,\n\t\t\t\t\tfieldSchema,\n\t\t\t\t\tschemaAndPolicy,\n\t\t\t\t\tonError,\n\t\t\t\t);\n\t\t\t\tif (fieldInSchemaResult !== undefined) {\n\t\t\t\t\treturn fieldInSchemaResult;\n\t\t\t\t}\n\t\t\t\tuncheckedFieldsFromNode.delete(fieldKey);\n\t\t\t}\n\t\t\t// The node has fields that we did not check as part of looking at every field defined in the node's schema.\n\t\t\t// Since this is testing compatibility with a stored schema (not view schema), \"allowUnknownOptionalFields\" does not exist at this layer.\n\t\t\t// Code using this with a stored schema derived from a view schema rather than the document can be problematic because it may be missing unknown fields that the actual document has.\n\t\t\t// Other schema evolution features like \"staged\" allowed types will likely cause similar issues elsewhere in this checker.\n\t\t\tif (uncheckedFieldsFromNode.size > 0) {\n\t\t\t\treturn onError(SchemaValidationError.ObjectNode_FieldNotInSchema);\n\t\t\t}\n\t\t} else if (schema instanceof MapNodeStoredSchema) {\n\t\t\tfor (const [_key, field] of node.fields) {\n\t\t\t\tconst fieldInSchemaResult = isFieldInSchema(\n\t\t\t\t\tfield,\n\t\t\t\t\tschema.mapFields,\n\t\t\t\t\tschemaAndPolicy,\n\t\t\t\t\tonError,\n\t\t\t\t);\n\t\t\t\tif (fieldInSchemaResult !== undefined) {\n\t\t\t\t\treturn fieldInSchemaResult;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfail(0xb0e /* Unknown TreeNodeStoredSchema type */);\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Deeply checks that the nodes comply with the field schema and included schema.\n *\n * @param onError - Called with the first error (if any).\n *\n * @returns the return value from `onError` if the field or anything inside of it is out of schema, otherwise `undefined`.\n */\nexport function isFieldInSchema<T extends NotUndefined>(\n\tchildNodes: MapTreeFieldViewGeneric<MinimalMapTreeNodeView>,\n\tschema: TreeFieldStoredSchema,\n\tschemaAndPolicy: SchemaAndPolicy,\n\tonError: (error: SchemaValidationError) => T,\n): T | undefined {\n\t// Validate that the field kind is handled by the schema policy\n\tconst kind = schemaAndPolicy.policy.fieldKinds.get(schema.kind);\n\tif (kind === undefined) {\n\t\treturn onError(SchemaValidationError.Field_KindNotInSchemaPolicy);\n\t}\n\n\t// Validate that the field doesn't contain more nodes than its type supports\n\t{\n\t\tconst multiplicityCheck = compliesWithMultiplicity(childNodes.length, kind.multiplicity);\n\t\tif (multiplicityCheck !== undefined) {\n\t\t\treturn onError(multiplicityCheck);\n\t\t}\n\t}\n\n\tfor (const node of childNodes) {\n\t\t// Validate the type declared by the node is allowed in this field\n\t\tif (schema.types !== undefined && !schema.types.has(node.type)) {\n\t\t\treturn onError(SchemaValidationError.Field_NodeTypeNotAllowed);\n\t\t}\n\n\t\t// Validate the node complies with the type it declares to be.\n\t\tconst nodeInSchemaResult = isNodeInSchema(node, schemaAndPolicy, onError);\n\t\tif (nodeInSchemaResult !== undefined) {\n\t\t\treturn nodeInSchemaResult;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Validates that a given number of items complies with the specified {@link Multiplicity | multiplicity}.\n * @param numberOfItems - Number of items.\n * @param multiplicity - Kind of multiplicity to validate against.\n * @returns `true` if the specified number of items complies with the specified multiplicity; otherwise, `false`.\n */\nexport function compliesWithMultiplicity(\n\tnumberOfItems: number,\n\tmultiplicity: Multiplicity,\n): SchemaValidationError | undefined {\n\tswitch (multiplicity) {\n\t\tcase Multiplicity.Single: {\n\t\t\tif (numberOfItems < 1) {\n\t\t\t\treturn SchemaValidationError.Field_MissingRequiredChild;\n\t\t\t} else if (numberOfItems > 1) {\n\t\t\t\treturn SchemaValidationError.Field_MultipleChildrenNotAllowed;\n\t\t\t} else {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t\tcase Multiplicity.Optional: {\n\t\t\treturn numberOfItems > 1\n\t\t\t\t? SchemaValidationError.Field_MultipleChildrenNotAllowed\n\t\t\t\t: undefined;\n\t\t}\n\t\tcase Multiplicity.Sequence: {\n\t\t\treturn undefined;\n\t\t}\n\t\tcase Multiplicity.Forbidden: {\n\t\t\treturn numberOfItems === 0\n\t\t\t\t? undefined\n\t\t\t\t: SchemaValidationError.Field_ChildInForbiddenField;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(multiplicity);\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"schemaChecker.js","sourceRoot":"","sources":["../../src/feature-libraries/schemaChecker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAEN,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,YAAY,GAEZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGhE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,CAAN,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAChC,+GAA2B,CAAA;IAC3B,6GAA0B,CAAA;IAC1B,yHAAgC,CAAA;IAChC,+GAA2B,CAAA;IAC3B,yGAAwB,CAAA;IACxB,mGAAqB,CAAA;IACrB,2GAAyB,CAAA;IACzB,+GAA2B,CAAA;IAC3B,+GAA2B,CAAA;IAC3B,6FAAkB,CAAA;AACnB,CAAC,EAXW,qBAAqB,KAArB,qBAAqB,QAWhC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAAiC;IACjE,MAAM,IAAI,UAAU,CACnB,oCAAoC,qBAAqB,CAAC,UAAU,CAAC,EAAE,CACvE,CAAC;AACH,CAAC;AAID;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC7B,IAA4B,EAC5B,eAAgC,EAChC,OAA4C;IAE5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,CAAC;QAClB,CAAC;QACD,KAAK,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;YAC7B,OAAO,aAAa,KAAK,CAAC;gBACzB,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,qBAAqB,CAAC,2BAA2B,CAAC;QACtD,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,eAAe,CAAC,YAAY,CAAC,CAAC;QAC/B,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype TreeFieldStoredSchema,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tMultiplicity,\n\ttype SchemaAndPolicy,\n} from \"../core/index.js\";\nimport { iterableHasSome, mapIterable } from \"../util/index.js\";\n\nimport type { MapTreeFieldViewGeneric, MinimalMapTreeNodeView } from \"./mapTreeCursor.js\";\nimport { allowsValue } from \"./valueUtilities.js\";\n\nexport enum SchemaValidationError {\n\tField_KindNotInSchemaPolicy,\n\tField_MissingRequiredChild,\n\tField_MultipleChildrenNotAllowed,\n\tField_ChildInForbiddenField,\n\tField_NodeTypeNotAllowed,\n\tLeafNode_InvalidValue,\n\tLeafNode_FieldsNotAllowed,\n\tObjectNode_FieldNotInSchema,\n\tNonLeafNode_ValueNotAllowed,\n\tNode_MissingSchema,\n}\n\n/**\n * Throws a UsageError indicating a tree is out of schema.\n */\nexport function throwOutOfSchema(maybeError: SchemaValidationError): never {\n\tthrow new UsageError(\n\t\t`Tree does not conform to schema: ${SchemaValidationError[maybeError]}`,\n\t);\n}\n\ntype NotUndefined = number | string | boolean | bigint | symbol | object;\n\n/**\n * Deeply checks that the provided node complies with the schema based on its identifier.\n *\n * @param onError - Called with the first error (if any).\n *\n * @returns the return value from `onError` if the node or anything inside of it is out of schema, otherwise `undefined`.\n */\nexport function isNodeInSchema<T extends NotUndefined>(\n\tnode: MinimalMapTreeNodeView,\n\tschemaAndPolicy: SchemaAndPolicy,\n\tonError: (error: SchemaValidationError) => T,\n): T | undefined {\n\t// Validate the schema declared by the node exists\n\tconst schema = schemaAndPolicy.schema.nodeSchema.get(node.type);\n\tif (schema === undefined) {\n\t\treturn onError(SchemaValidationError.Node_MissingSchema);\n\t}\n\n\t// Validate the node is well formed according to its schema\n\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\tif (iterableHasSome(node.fields)) {\n\t\t\treturn onError(SchemaValidationError.LeafNode_FieldsNotAllowed);\n\t\t}\n\t\tif (!allowsValue(schema.leafValue, node.value)) {\n\t\t\treturn onError(SchemaValidationError.LeafNode_InvalidValue);\n\t\t}\n\t} else {\n\t\tif (node.value !== undefined) {\n\t\t\treturn onError(SchemaValidationError.NonLeafNode_ValueNotAllowed);\n\t\t}\n\n\t\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\t\tconst uncheckedFieldsFromNode = new Set(mapIterable(node.fields, ([key, field]) => key));\n\t\t\tfor (const [fieldKey, fieldSchema] of schema.objectNodeFields) {\n\t\t\t\tconst nodeField = node.fields.get(fieldKey) ?? [];\n\t\t\t\tconst fieldInSchemaResult = isFieldInSchema(\n\t\t\t\t\tnodeField,\n\t\t\t\t\tfieldSchema,\n\t\t\t\t\tschemaAndPolicy,\n\t\t\t\t\tonError,\n\t\t\t\t);\n\t\t\t\tif (fieldInSchemaResult !== undefined) {\n\t\t\t\t\treturn fieldInSchemaResult;\n\t\t\t\t}\n\t\t\t\tuncheckedFieldsFromNode.delete(fieldKey);\n\t\t\t}\n\t\t\t// The node has fields that we did not check as part of looking at every field defined in the node's schema.\n\t\t\t// Since this is testing compatibility with a stored schema (not view schema), \"allowUnknownOptionalFields\" does not exist at this layer.\n\t\t\t// Code using this with a stored schema derived from a view schema rather than the document can be problematic because it may be missing unknown fields that the actual document has.\n\t\t\t// Other schema evolution features like \"staged\" allowed types will likely cause similar issues elsewhere in this checker.\n\t\t\tif (uncheckedFieldsFromNode.size > 0) {\n\t\t\t\treturn onError(SchemaValidationError.ObjectNode_FieldNotInSchema);\n\t\t\t}\n\t\t} else if (schema instanceof MapNodeStoredSchema) {\n\t\t\tfor (const [_key, field] of node.fields) {\n\t\t\t\tconst fieldInSchemaResult = isFieldInSchema(\n\t\t\t\t\tfield,\n\t\t\t\t\tschema.mapFields,\n\t\t\t\t\tschemaAndPolicy,\n\t\t\t\t\tonError,\n\t\t\t\t);\n\t\t\t\tif (fieldInSchemaResult !== undefined) {\n\t\t\t\t\treturn fieldInSchemaResult;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfail(0xb0e /* Unknown TreeNodeStoredSchema type */);\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Deeply checks that the nodes comply with the field schema and included schema.\n *\n * @param onError - Called with the first error (if any).\n *\n * @returns the return value from `onError` if the field or anything inside of it is out of schema, otherwise `undefined`.\n */\nexport function isFieldInSchema<T extends NotUndefined>(\n\tchildNodes: MapTreeFieldViewGeneric<MinimalMapTreeNodeView>,\n\tschema: TreeFieldStoredSchema,\n\tschemaAndPolicy: SchemaAndPolicy,\n\tonError: (error: SchemaValidationError) => T,\n): T | undefined {\n\t// Validate that the field kind is handled by the schema policy\n\tconst kind = schemaAndPolicy.policy.fieldKinds.get(schema.kind);\n\tif (kind === undefined) {\n\t\treturn onError(SchemaValidationError.Field_KindNotInSchemaPolicy);\n\t}\n\n\t// Validate that the field doesn't contain more nodes than its type supports\n\t{\n\t\tconst multiplicityCheck = compliesWithMultiplicity(childNodes.length, kind.multiplicity);\n\t\tif (multiplicityCheck !== undefined) {\n\t\t\treturn onError(multiplicityCheck);\n\t\t}\n\t}\n\n\tfor (const node of childNodes) {\n\t\t// Validate the type declared by the node is allowed in this field\n\t\tif (schema.types !== undefined && !schema.types.has(node.type)) {\n\t\t\treturn onError(SchemaValidationError.Field_NodeTypeNotAllowed);\n\t\t}\n\n\t\t// Validate the node complies with the type it declares to be.\n\t\tconst nodeInSchemaResult = isNodeInSchema(node, schemaAndPolicy, onError);\n\t\tif (nodeInSchemaResult !== undefined) {\n\t\t\treturn nodeInSchemaResult;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Validates that a given number of items complies with the specified {@link Multiplicity | multiplicity}.\n * @param numberOfItems - Number of items.\n * @param multiplicity - Kind of multiplicity to validate against.\n * @returns `true` if the specified number of items complies with the specified multiplicity; otherwise, `false`.\n */\nexport function compliesWithMultiplicity(\n\tnumberOfItems: number,\n\tmultiplicity: Multiplicity,\n): SchemaValidationError | undefined {\n\tswitch (multiplicity) {\n\t\tcase Multiplicity.Single: {\n\t\t\tif (numberOfItems < 1) {\n\t\t\t\treturn SchemaValidationError.Field_MissingRequiredChild;\n\t\t\t} else if (numberOfItems > 1) {\n\t\t\t\treturn SchemaValidationError.Field_MultipleChildrenNotAllowed;\n\t\t\t} else {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t\tcase Multiplicity.Optional: {\n\t\t\treturn numberOfItems > 1\n\t\t\t\t? SchemaValidationError.Field_MultipleChildrenNotAllowed\n\t\t\t\t: undefined;\n\t\t}\n\t\tcase Multiplicity.Sequence: {\n\t\t\treturn undefined;\n\t\t}\n\t\tcase Multiplicity.Forbidden: {\n\t\t\treturn numberOfItems === 0\n\t\t\t\t? undefined\n\t\t\t\t: SchemaValidationError.Field_ChildInForbiddenField;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(multiplicity);\n\t\t}\n\t}\n}\n"]}
@@ -2,18 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export type { Changeset, Remove, Detach, HasMoveId, HasRevisionTag, Insert, Mark, MarkList, MoveIn, MoveOut, CellCount as NodeCount, MoveId, Attach, NoopMark, CellId, HasMarkFields, CellMark, AttachAndDetach, Rename, } from "./types.js";
6
- export { DetachIdOverrideType } from "./formatV1.js";
7
- export { type SequenceFieldChangeHandler, sequenceFieldChangeHandler, } from "./sequenceFieldChangeHandler.js";
8
- export { type SequenceChangeRebaser, sequenceFieldChangeRebaser, } from "./sequenceFieldChangeRebaser.js";
9
- export { sequenceFieldChangeCodecFactory } from "./sequenceFieldCodecs.js";
10
- export { sequenceFieldToDelta } from "./sequenceFieldToDelta.js";
11
- export { type SequenceFieldEditor, sequenceFieldEditor } from "./sequenceFieldEditor.js";
12
- export { MarkListFactory } from "./markListFactory.js";
13
- export { rebase } from "./rebase.js";
14
- export { invert } from "./invert.js";
15
- export { compose } from "./compose.js";
16
- export { getInputLength, isDetach, cloneMark, extractMarkEffect, } from "./utils.js";
17
- export { isMoveMark, type MoveMark, type MoveEffectTable, type MoveEffect, } from "./moveEffectTable.js";
18
- export { relevantRemovedRoots } from "./relevantRemovedRoots.js";
5
+ export type { CellId } from "./types.js";
6
+ export { sequence } from "./sequenceKind.js";
19
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,SAAS,EACT,cAAc,EACd,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,OAAO,EACP,SAAS,IAAI,SAAS,EACtB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,MAAM,EACN,aAAa,EACb,QAAQ,EACR,eAAe,EACf,MAAM,GACN,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EACN,KAAK,0BAA0B,EAC/B,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,KAAK,qBAAqB,EAC1B,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,KAAK,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACN,cAAc,EACd,QAAQ,EACR,SAAS,EACT,iBAAiB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,UAAU,GACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC"}
@@ -2,17 +2,5 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { DetachIdOverrideType } from "./formatV1.js";
6
- export { sequenceFieldChangeHandler, } from "./sequenceFieldChangeHandler.js";
7
- export { sequenceFieldChangeRebaser, } from "./sequenceFieldChangeRebaser.js";
8
- export { sequenceFieldChangeCodecFactory } from "./sequenceFieldCodecs.js";
9
- export { sequenceFieldToDelta } from "./sequenceFieldToDelta.js";
10
- export { sequenceFieldEditor } from "./sequenceFieldEditor.js";
11
- export { MarkListFactory } from "./markListFactory.js";
12
- export { rebase } from "./rebase.js";
13
- export { invert } from "./invert.js";
14
- export { compose } from "./compose.js";
15
- export { getInputLength, isDetach, cloneMark, extractMarkEffect, } from "./utils.js";
16
- export { isMoveMark, } from "./moveEffectTable.js";
17
- export { relevantRemovedRoots } from "./relevantRemovedRoots.js";
5
+ export { sequence } from "./sequenceKind.js";
18
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAEN,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEN,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAA4B,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACN,cAAc,EACd,QAAQ,EACR,SAAS,EACT,iBAAiB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,UAAU,GAIV,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tChangeset,\n\tRemove,\n\tDetach,\n\tHasMoveId,\n\tHasRevisionTag,\n\tInsert,\n\tMark,\n\tMarkList,\n\tMoveIn,\n\tMoveOut,\n\tCellCount as NodeCount,\n\tMoveId,\n\tAttach,\n\tNoopMark,\n\tCellId,\n\tHasMarkFields,\n\tCellMark,\n\tAttachAndDetach,\n\tRename,\n} from \"./types.js\";\nexport { DetachIdOverrideType } from \"./formatV1.js\";\nexport {\n\ttype SequenceFieldChangeHandler,\n\tsequenceFieldChangeHandler,\n} from \"./sequenceFieldChangeHandler.js\";\nexport {\n\ttype SequenceChangeRebaser,\n\tsequenceFieldChangeRebaser,\n} from \"./sequenceFieldChangeRebaser.js\";\nexport { sequenceFieldChangeCodecFactory } from \"./sequenceFieldCodecs.js\";\nexport { sequenceFieldToDelta } from \"./sequenceFieldToDelta.js\";\nexport { type SequenceFieldEditor, sequenceFieldEditor } from \"./sequenceFieldEditor.js\";\nexport { MarkListFactory } from \"./markListFactory.js\";\nexport { rebase } from \"./rebase.js\";\nexport { invert } from \"./invert.js\";\nexport { compose } from \"./compose.js\";\nexport {\n\tgetInputLength,\n\tisDetach,\n\tcloneMark,\n\textractMarkEffect,\n} from \"./utils.js\";\nexport {\n\tisMoveMark,\n\ttype MoveMark,\n\ttype MoveEffectTable,\n\ttype MoveEffect,\n} from \"./moveEffectTable.js\";\n\nexport { relevantRemovedRoots } from \"./relevantRemovedRoots.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { CellId } from \"./types.js\";\nexport { sequence } from \"./sequenceKind.js\";\n"]}
@@ -176,7 +176,7 @@ function rebaseMarkIgnoreChild(currMark, baseMark, moveEffects) {
176
176
  if (currMark.changes !== undefined) {
177
177
  moveRebasedChanges(currMark.changes, moveEffects, getEndpoint(baseMark));
178
178
  }
179
- rebasedMark = { ...(remains ?? {}), count: baseMark.count };
179
+ rebasedMark = { ...remains, count: baseMark.count };
180
180
  }
181
181
  else {
182
182
  rebasedMark = currMark;