@fluidframework/tree 2.101.1 → 2.103.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 (609) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/api-report/tree.alpha.api.md +19 -0
  3. package/dist/codec/codec.d.ts +22 -53
  4. package/dist/codec/codec.d.ts.map +1 -1
  5. package/dist/codec/codec.js +7 -44
  6. package/dist/codec/codec.js.map +1 -1
  7. package/dist/codec/index.d.ts +1 -1
  8. package/dist/codec/index.d.ts.map +1 -1
  9. package/dist/codec/index.js +2 -2
  10. package/dist/codec/index.js.map +1 -1
  11. package/dist/codec/versioned/codec.d.ts +56 -28
  12. package/dist/codec/versioned/codec.d.ts.map +1 -1
  13. package/dist/codec/versioned/codec.js +29 -12
  14. package/dist/codec/versioned/codec.js.map +1 -1
  15. package/dist/codec/versioned/format.d.ts +5 -4
  16. package/dist/codec/versioned/format.d.ts.map +1 -1
  17. package/dist/codec/versioned/format.js +26 -3
  18. package/dist/codec/versioned/format.js.map +1 -1
  19. package/dist/codec/versioned/index.d.ts +1 -1
  20. package/dist/codec/versioned/index.d.ts.map +1 -1
  21. package/dist/codec/versioned/index.js +2 -2
  22. package/dist/codec/versioned/index.js.map +1 -1
  23. package/dist/core/rebase/types.d.ts +4 -3
  24. package/dist/core/rebase/types.d.ts.map +1 -1
  25. package/dist/core/rebase/types.js +27 -4
  26. package/dist/core/rebase/types.js.map +1 -1
  27. package/dist/core/schema-stored/formatV1.d.ts +16 -15
  28. package/dist/core/schema-stored/formatV1.d.ts.map +1 -1
  29. package/dist/core/schema-stored/formatV1.js +31 -8
  30. package/dist/core/schema-stored/formatV1.js.map +1 -1
  31. package/dist/core/schema-stored/formatV2.d.ts +29 -28
  32. package/dist/core/schema-stored/formatV2.d.ts.map +1 -1
  33. package/dist/core/schema-stored/formatV2.js +33 -10
  34. package/dist/core/schema-stored/formatV2.js.map +1 -1
  35. package/dist/core/tree/deltaUtil.d.ts +2 -2
  36. package/dist/core/tree/deltaUtil.js +2 -2
  37. package/dist/core/tree/deltaUtil.js.map +1 -1
  38. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  39. package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
  40. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  41. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  42. package/dist/core/tree/detachedFieldIndexCodecV2.js +4 -2
  43. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  44. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +3 -3
  45. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  46. package/dist/core/tree/detachedFieldIndexCodecs.js +1 -1
  47. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  48. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +11 -10
  49. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  50. package/dist/core/tree/detachedFieldIndexFormatCommon.js +33 -10
  51. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  52. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +7 -6
  53. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  54. package/dist/core/tree/detachedFieldIndexFormatV2.js +25 -2
  55. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  56. package/dist/core/tree/persistedTreeTextFormat.d.ts +19 -18
  57. package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  58. package/dist/core/tree/persistedTreeTextFormat.js +33 -10
  59. package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
  60. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +38 -1
  61. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  62. package/dist/feature-libraries/chunked-forest/chunkTree.js +63 -5
  63. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  64. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  65. package/dist/feature-libraries/chunked-forest/chunkedForest.js +18 -4
  66. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  67. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +34 -2
  68. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  69. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +106 -3
  70. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  71. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +5 -5
  72. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  73. package/dist/feature-libraries/chunked-forest/codec/codecs.js +2 -2
  74. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  75. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +7 -7
  76. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  77. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +13 -12
  79. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
  80. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js +36 -13
  81. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
  82. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +36 -35
  83. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -1
  84. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +41 -18
  85. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -1
  86. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +35 -14
  87. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -1
  88. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +35 -6
  89. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -1
  90. package/dist/feature-libraries/chunked-forest/codec/format/formatVText.d.ts +106 -0
  91. package/dist/feature-libraries/chunked-forest/codec/format/formatVText.d.ts.map +1 -0
  92. package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js +67 -0
  93. package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js.map +1 -0
  94. package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts +2 -1
  95. package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -1
  96. package/dist/feature-libraries/chunked-forest/codec/format/index.js +5 -1
  97. package/dist/feature-libraries/chunked-forest/codec/format/index.js.map +1 -1
  98. package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts +38 -4
  99. package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -1
  100. package/dist/feature-libraries/chunked-forest/codec/format/versions.js +7 -1
  101. package/dist/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -1
  102. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
  103. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  104. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +1 -2
  105. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  106. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +66 -14
  107. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  108. package/dist/feature-libraries/chunked-forest/uniformChunk.js +101 -36
  109. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  110. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  111. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +36 -14
  112. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  113. package/dist/feature-libraries/forest-summary/codec.d.ts +5 -4
  114. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  115. package/dist/feature-libraries/forest-summary/codec.js +2 -2
  116. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  117. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +6 -5
  118. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  119. package/dist/feature-libraries/forest-summary/formatCommon.js +26 -3
  120. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  121. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +4 -3
  122. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  123. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js +26 -3
  124. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  125. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +45 -44
  126. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  127. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +48 -25
  128. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  129. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +23 -22
  130. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  131. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +29 -6
  132. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  133. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +1 -1
  134. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  135. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  136. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +9 -8
  137. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  138. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +31 -8
  139. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
  140. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +14 -13
  141. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  142. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +34 -11
  143. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
  144. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +5 -4
  145. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  146. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js +25 -2
  147. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  148. package/dist/feature-libraries/schema-index/codec.d.ts +2 -2
  149. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  150. package/dist/feature-libraries/schema-index/codec.js +1 -1
  151. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  152. package/dist/feature-libraries/schema-index/formatV1.d.ts +15 -14
  153. package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  154. package/dist/feature-libraries/schema-index/formatV1.js +27 -4
  155. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
  156. package/dist/feature-libraries/schema-index/formatV2.d.ts +20 -19
  157. package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
  158. package/dist/feature-libraries/schema-index/formatV2.js +27 -4
  159. package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
  160. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  161. package/dist/feature-libraries/sequence-field/compose.js +1 -3
  162. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  163. package/dist/feature-libraries/sequence-field/formatV1.d.ts +283 -282
  164. package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  165. package/dist/feature-libraries/sequence-field/formatV1.js +63 -40
  166. package/dist/feature-libraries/sequence-field/formatV1.js.map +1 -1
  167. package/dist/feature-libraries/sequence-field/formatV2.d.ts +180 -179
  168. package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  169. package/dist/feature-libraries/sequence-field/formatV2.js +55 -32
  170. package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
  171. package/dist/feature-libraries/sequence-field/formatV3.d.ts +126 -125
  172. package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  173. package/dist/feature-libraries/sequence-field/formatV3.js +27 -4
  174. package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -1
  175. package/dist/index.d.ts +1 -1
  176. package/dist/index.d.ts.map +1 -1
  177. package/dist/index.js +3 -1
  178. package/dist/index.js.map +1 -1
  179. package/dist/packageVersion.d.ts +1 -1
  180. package/dist/packageVersion.js +1 -1
  181. package/dist/packageVersion.js.map +1 -1
  182. package/dist/shared-tree/isAuditableFromOutcome.d.ts +20 -0
  183. package/dist/shared-tree/isAuditableFromOutcome.d.ts.map +1 -0
  184. package/dist/shared-tree/isAuditableFromOutcome.js +36 -0
  185. package/dist/shared-tree/isAuditableFromOutcome.js.map +1 -0
  186. package/dist/shared-tree/sharedTree.d.ts +2 -2
  187. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  188. package/dist/shared-tree/sharedTree.js.map +1 -1
  189. package/dist/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  190. package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  191. package/dist/shared-tree/sharedTreeChangeFormat.js +28 -5
  192. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  193. package/dist/shared-tree/treeCheckout.d.ts +5 -3
  194. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  195. package/dist/shared-tree/treeCheckout.js +37 -8
  196. package/dist/shared-tree/treeCheckout.js.map +1 -1
  197. package/dist/shared-tree-core/editManager.d.ts +2 -2
  198. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  199. package/dist/shared-tree-core/editManager.js.map +1 -1
  200. package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -3
  201. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  202. package/dist/shared-tree-core/editManagerCodecs.js +2 -2
  203. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  204. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +35 -34
  205. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  206. package/dist/shared-tree-core/editManagerFormatCommons.js +39 -16
  207. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  208. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +15 -15
  209. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  210. package/dist/shared-tree-core/editManagerFormatV1toV4.js +33 -10
  211. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  212. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +40 -40
  213. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  214. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +27 -4
  215. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  216. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  217. package/dist/shared-tree-core/messageCodecVSharedBranches.js +25 -2
  218. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  219. package/dist/shared-tree-core/messageCodecs.d.ts +3 -3
  220. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  221. package/dist/shared-tree-core/messageCodecs.js +2 -2
  222. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  223. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +5 -5
  224. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  225. package/dist/shared-tree-core/messageFormatV1ToV4.js +31 -8
  226. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  227. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -7
  228. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  229. package/dist/shared-tree-core/messageFormatVSharedBranches.js +29 -6
  230. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  231. package/dist/simple-tree/core/treeNodeKernel.d.ts +5 -0
  232. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  233. package/dist/simple-tree/core/treeNodeKernel.js +62 -24
  234. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  235. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +121 -120
  236. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  237. package/dist/simple-tree/simpleSchemaFormatV1.js +54 -31
  238. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  239. package/dist/text/codePointUtils.d.ts +48 -0
  240. package/dist/text/codePointUtils.d.ts.map +1 -0
  241. package/dist/text/codePointUtils.js +80 -0
  242. package/dist/text/codePointUtils.js.map +1 -0
  243. package/dist/text/index.d.ts +1 -0
  244. package/dist/text/index.d.ts.map +1 -1
  245. package/dist/text/index.js +4 -1
  246. package/dist/text/index.js.map +1 -1
  247. package/dist/text/textDomain.d.ts +93 -1
  248. package/dist/text/textDomain.d.ts.map +1 -1
  249. package/dist/text/textDomain.js +65 -8
  250. package/dist/text/textDomain.js.map +1 -1
  251. package/dist/text/textDomainFormatted.d.ts +24 -6
  252. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  253. package/dist/text/textDomainFormatted.js +29 -1
  254. package/dist/text/textDomainFormatted.js.map +1 -1
  255. package/dist/treeFactory.d.ts.map +1 -1
  256. package/dist/treeFactory.js +9 -7
  257. package/dist/treeFactory.js.map +1 -1
  258. package/dist/util/breakable.d.ts +7 -1
  259. package/dist/util/breakable.d.ts.map +1 -1
  260. package/dist/util/breakable.js +18 -4
  261. package/dist/util/breakable.js.map +1 -1
  262. package/dist/util/typeboxBrand.d.ts +1 -1
  263. package/dist/util/typeboxBrand.d.ts.map +1 -1
  264. package/dist/util/typeboxBrand.js +26 -3
  265. package/dist/util/typeboxBrand.js.map +1 -1
  266. package/dist/util/utils.d.ts +2 -2
  267. package/dist/util/utils.d.ts.map +1 -1
  268. package/dist/util/utils.js +25 -2
  269. package/dist/util/utils.js.map +1 -1
  270. package/eslint.config.mts +44 -0
  271. package/lib/codec/codec.d.ts +22 -53
  272. package/lib/codec/codec.d.ts.map +1 -1
  273. package/lib/codec/codec.js +7 -44
  274. package/lib/codec/codec.js.map +1 -1
  275. package/lib/codec/index.d.ts +1 -1
  276. package/lib/codec/index.d.ts.map +1 -1
  277. package/lib/codec/index.js +1 -1
  278. package/lib/codec/index.js.map +1 -1
  279. package/lib/codec/versioned/codec.d.ts +56 -28
  280. package/lib/codec/versioned/codec.d.ts.map +1 -1
  281. package/lib/codec/versioned/codec.js +27 -10
  282. package/lib/codec/versioned/codec.js.map +1 -1
  283. package/lib/codec/versioned/format.d.ts +5 -4
  284. package/lib/codec/versioned/format.d.ts.map +1 -1
  285. package/lib/codec/versioned/format.js +1 -1
  286. package/lib/codec/versioned/format.js.map +1 -1
  287. package/lib/codec/versioned/index.d.ts +1 -1
  288. package/lib/codec/versioned/index.d.ts.map +1 -1
  289. package/lib/codec/versioned/index.js +1 -1
  290. package/lib/codec/versioned/index.js.map +1 -1
  291. package/lib/core/rebase/types.d.ts +4 -3
  292. package/lib/core/rebase/types.d.ts.map +1 -1
  293. package/lib/core/rebase/types.js +1 -1
  294. package/lib/core/rebase/types.js.map +1 -1
  295. package/lib/core/schema-stored/formatV1.d.ts +16 -15
  296. package/lib/core/schema-stored/formatV1.d.ts.map +1 -1
  297. package/lib/core/schema-stored/formatV1.js +1 -1
  298. package/lib/core/schema-stored/formatV1.js.map +1 -1
  299. package/lib/core/schema-stored/formatV2.d.ts +29 -28
  300. package/lib/core/schema-stored/formatV2.d.ts.map +1 -1
  301. package/lib/core/schema-stored/formatV2.js +1 -1
  302. package/lib/core/schema-stored/formatV2.js.map +1 -1
  303. package/lib/core/tree/deltaUtil.d.ts +2 -2
  304. package/lib/core/tree/deltaUtil.js +2 -2
  305. package/lib/core/tree/deltaUtil.js.map +1 -1
  306. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  307. package/lib/core/tree/detachedFieldIndexCodecV1.js +3 -2
  308. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  309. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  310. package/lib/core/tree/detachedFieldIndexCodecV2.js +5 -3
  311. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  312. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +3 -3
  313. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  314. package/lib/core/tree/detachedFieldIndexCodecs.js +2 -2
  315. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  316. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +11 -10
  317. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  318. package/lib/core/tree/detachedFieldIndexFormatCommon.js +1 -1
  319. package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  320. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +7 -6
  321. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  322. package/lib/core/tree/detachedFieldIndexFormatV2.js +1 -1
  323. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  324. package/lib/core/tree/persistedTreeTextFormat.d.ts +19 -18
  325. package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  326. package/lib/core/tree/persistedTreeTextFormat.js +1 -1
  327. package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
  328. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +38 -1
  329. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  330. package/lib/feature-libraries/chunked-forest/chunkTree.js +62 -5
  331. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  332. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  333. package/lib/feature-libraries/chunked-forest/chunkedForest.js +20 -6
  334. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  335. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +34 -2
  336. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  337. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +102 -2
  338. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  339. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +5 -5
  340. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  341. package/lib/feature-libraries/chunked-forest/codec/codecs.js +3 -3
  342. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  343. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +7 -7
  344. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  345. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  346. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +13 -12
  347. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
  348. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js +1 -1
  349. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
  350. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +36 -35
  351. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -1
  352. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js +1 -1
  353. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -1
  354. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +35 -14
  355. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -1
  356. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js +9 -3
  357. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -1
  358. package/lib/feature-libraries/chunked-forest/codec/format/formatVText.d.ts +106 -0
  359. package/lib/feature-libraries/chunked-forest/codec/format/formatVText.d.ts.map +1 -0
  360. package/lib/feature-libraries/chunked-forest/codec/format/formatVText.js +41 -0
  361. package/lib/feature-libraries/chunked-forest/codec/format/formatVText.js.map +1 -0
  362. package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts +2 -1
  363. package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -1
  364. package/lib/feature-libraries/chunked-forest/codec/format/index.js +2 -1
  365. package/lib/feature-libraries/chunked-forest/codec/format/index.js.map +1 -1
  366. package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts +38 -4
  367. package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -1
  368. package/lib/feature-libraries/chunked-forest/codec/format/versions.js +6 -0
  369. package/lib/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -1
  370. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
  371. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  372. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +2 -3
  373. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  374. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +66 -14
  375. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  376. package/lib/feature-libraries/chunked-forest/uniformChunk.js +101 -36
  377. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  378. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  379. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +36 -14
  380. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  381. package/lib/feature-libraries/forest-summary/codec.d.ts +5 -4
  382. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  383. package/lib/feature-libraries/forest-summary/codec.js +3 -3
  384. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  385. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +6 -5
  386. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  387. package/lib/feature-libraries/forest-summary/formatCommon.js +1 -1
  388. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  389. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +4 -3
  390. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  391. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js +1 -1
  392. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  393. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +45 -44
  394. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  395. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js +1 -1
  396. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  397. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +23 -22
  398. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  399. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +1 -1
  400. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  401. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +1 -1
  402. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  403. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  404. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +9 -8
  405. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  406. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +1 -1
  407. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
  408. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +14 -13
  409. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  410. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +1 -1
  411. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
  412. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +5 -4
  413. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  414. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +1 -1
  415. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  416. package/lib/feature-libraries/schema-index/codec.d.ts +2 -2
  417. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  418. package/lib/feature-libraries/schema-index/codec.js +2 -2
  419. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  420. package/lib/feature-libraries/schema-index/formatV1.d.ts +15 -14
  421. package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  422. package/lib/feature-libraries/schema-index/formatV1.js +1 -1
  423. package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
  424. package/lib/feature-libraries/schema-index/formatV2.d.ts +20 -19
  425. package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
  426. package/lib/feature-libraries/schema-index/formatV2.js +1 -1
  427. package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
  428. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  429. package/lib/feature-libraries/sequence-field/compose.js +1 -3
  430. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  431. package/lib/feature-libraries/sequence-field/formatV1.d.ts +283 -282
  432. package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  433. package/lib/feature-libraries/sequence-field/formatV1.js +1 -1
  434. package/lib/feature-libraries/sequence-field/formatV1.js.map +1 -1
  435. package/lib/feature-libraries/sequence-field/formatV2.d.ts +180 -179
  436. package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  437. package/lib/feature-libraries/sequence-field/formatV2.js +1 -1
  438. package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
  439. package/lib/feature-libraries/sequence-field/formatV3.d.ts +126 -125
  440. package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  441. package/lib/feature-libraries/sequence-field/formatV3.js +1 -1
  442. package/lib/feature-libraries/sequence-field/formatV3.js.map +1 -1
  443. package/lib/index.d.ts +1 -1
  444. package/lib/index.d.ts.map +1 -1
  445. package/lib/index.js +1 -1
  446. package/lib/index.js.map +1 -1
  447. package/lib/packageVersion.d.ts +1 -1
  448. package/lib/packageVersion.js +1 -1
  449. package/lib/packageVersion.js.map +1 -1
  450. package/lib/shared-tree/isAuditableFromOutcome.d.ts +20 -0
  451. package/lib/shared-tree/isAuditableFromOutcome.d.ts.map +1 -0
  452. package/lib/shared-tree/isAuditableFromOutcome.js +32 -0
  453. package/lib/shared-tree/isAuditableFromOutcome.js.map +1 -0
  454. package/lib/shared-tree/sharedTree.d.ts +2 -2
  455. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  456. package/lib/shared-tree/sharedTree.js +1 -1
  457. package/lib/shared-tree/sharedTree.js.map +1 -1
  458. package/lib/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  459. package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  460. package/lib/shared-tree/sharedTreeChangeFormat.js +1 -1
  461. package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  462. package/lib/shared-tree/treeCheckout.d.ts +5 -3
  463. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  464. package/lib/shared-tree/treeCheckout.js +38 -9
  465. package/lib/shared-tree/treeCheckout.js.map +1 -1
  466. package/lib/shared-tree-core/editManager.d.ts +2 -2
  467. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  468. package/lib/shared-tree-core/editManager.js.map +1 -1
  469. package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -3
  470. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  471. package/lib/shared-tree-core/editManagerCodecs.js +3 -3
  472. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  473. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +35 -34
  474. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  475. package/lib/shared-tree-core/editManagerFormatCommons.js +1 -1
  476. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  477. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +15 -15
  478. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  479. package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -1
  480. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  481. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +40 -40
  482. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  483. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
  484. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  485. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  486. package/lib/shared-tree-core/messageCodecVSharedBranches.js +1 -1
  487. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  488. package/lib/shared-tree-core/messageCodecs.d.ts +3 -3
  489. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  490. package/lib/shared-tree-core/messageCodecs.js +3 -3
  491. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  492. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +5 -5
  493. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  494. package/lib/shared-tree-core/messageFormatV1ToV4.js +1 -1
  495. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  496. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -7
  497. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  498. package/lib/shared-tree-core/messageFormatVSharedBranches.js +1 -1
  499. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  500. package/lib/simple-tree/core/treeNodeKernel.d.ts +5 -0
  501. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  502. package/lib/simple-tree/core/treeNodeKernel.js +60 -23
  503. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  504. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +121 -120
  505. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  506. package/lib/simple-tree/simpleSchemaFormatV1.js +1 -1
  507. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  508. package/lib/text/codePointUtils.d.ts +48 -0
  509. package/lib/text/codePointUtils.d.ts.map +1 -0
  510. package/lib/text/codePointUtils.js +75 -0
  511. package/lib/text/codePointUtils.js.map +1 -0
  512. package/lib/text/index.d.ts +1 -0
  513. package/lib/text/index.d.ts.map +1 -1
  514. package/lib/text/index.js +1 -0
  515. package/lib/text/index.js.map +1 -1
  516. package/lib/text/textDomain.d.ts +93 -1
  517. package/lib/text/textDomain.d.ts.map +1 -1
  518. package/lib/text/textDomain.js +56 -0
  519. package/lib/text/textDomain.js.map +1 -1
  520. package/lib/text/textDomainFormatted.d.ts +24 -6
  521. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  522. package/lib/text/textDomainFormatted.js +30 -2
  523. package/lib/text/textDomainFormatted.js.map +1 -1
  524. package/lib/treeFactory.d.ts.map +1 -1
  525. package/lib/treeFactory.js +2 -0
  526. package/lib/treeFactory.js.map +1 -1
  527. package/lib/util/breakable.d.ts +7 -1
  528. package/lib/util/breakable.d.ts.map +1 -1
  529. package/lib/util/breakable.js +18 -4
  530. package/lib/util/breakable.js.map +1 -1
  531. package/lib/util/typeboxBrand.d.ts +1 -1
  532. package/lib/util/typeboxBrand.d.ts.map +1 -1
  533. package/lib/util/typeboxBrand.js +1 -1
  534. package/lib/util/typeboxBrand.js.map +1 -1
  535. package/lib/util/utils.d.ts +2 -2
  536. package/lib/util/utils.d.ts.map +1 -1
  537. package/lib/util/utils.js +1 -1
  538. package/lib/util/utils.js.map +1 -1
  539. package/package.json +24 -24
  540. package/src/codec/codec.ts +82 -73
  541. package/src/codec/index.ts +2 -1
  542. package/src/codec/versioned/codec.ts +173 -73
  543. package/src/codec/versioned/format.ts +2 -1
  544. package/src/codec/versioned/index.ts +2 -1
  545. package/src/core/rebase/types.ts +1 -1
  546. package/src/core/schema-stored/formatV1.ts +2 -1
  547. package/src/core/schema-stored/formatV2.ts +2 -1
  548. package/src/core/tree/deltaUtil.ts +2 -2
  549. package/src/core/tree/detachedFieldIndexCodecV1.ts +3 -2
  550. package/src/core/tree/detachedFieldIndexCodecV2.ts +5 -3
  551. package/src/core/tree/detachedFieldIndexCodecs.ts +2 -2
  552. package/src/core/tree/detachedFieldIndexFormatCommon.ts +2 -1
  553. package/src/core/tree/detachedFieldIndexFormatV2.ts +2 -1
  554. package/src/core/tree/persistedTreeTextFormat.ts +2 -1
  555. package/src/feature-libraries/chunked-forest/chunkTree.ts +88 -3
  556. package/src/feature-libraries/chunked-forest/chunkedForest.ts +27 -7
  557. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +143 -7
  558. package/src/feature-libraries/chunked-forest/codec/codecs.ts +30 -28
  559. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +7 -7
  560. package/src/feature-libraries/chunked-forest/codec/format/formatGeneric.ts +2 -1
  561. package/src/feature-libraries/chunked-forest/codec/format/formatV1.ts +2 -1
  562. package/src/feature-libraries/chunked-forest/codec/format/formatV2.ts +13 -8
  563. package/src/feature-libraries/chunked-forest/codec/format/formatVText.ts +84 -0
  564. package/src/feature-libraries/chunked-forest/codec/format/index.ts +6 -1
  565. package/src/feature-libraries/chunked-forest/codec/format/versions.ts +25 -4
  566. package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +14 -18
  567. package/src/feature-libraries/chunked-forest/uniformChunk.ts +131 -44
  568. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +36 -14
  569. package/src/feature-libraries/forest-summary/codec.ts +9 -4
  570. package/src/feature-libraries/forest-summary/formatCommon.ts +2 -1
  571. package/src/feature-libraries/modular-schema/genericFieldKindFormat.ts +2 -1
  572. package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +2 -1
  573. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +2 -1
  574. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +1 -1
  575. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV1.ts +2 -1
  576. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV2.ts +2 -1
  577. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +2 -1
  578. package/src/feature-libraries/schema-index/codec.ts +2 -5
  579. package/src/feature-libraries/schema-index/formatV1.ts +2 -1
  580. package/src/feature-libraries/schema-index/formatV2.ts +2 -1
  581. package/src/feature-libraries/sequence-field/compose.ts +1 -4
  582. package/src/feature-libraries/sequence-field/formatV1.ts +2 -1
  583. package/src/feature-libraries/sequence-field/formatV2.ts +2 -1
  584. package/src/feature-libraries/sequence-field/formatV3.ts +2 -1
  585. package/src/index.ts +6 -1
  586. package/src/packageVersion.ts +1 -1
  587. package/src/shared-tree/isAuditableFromOutcome.ts +34 -0
  588. package/src/shared-tree/sharedTree.ts +2 -5
  589. package/src/shared-tree/sharedTreeChangeFormat.ts +2 -1
  590. package/src/shared-tree/treeCheckout.ts +55 -15
  591. package/src/shared-tree-core/editManager.ts +2 -2
  592. package/src/shared-tree-core/editManagerCodecs.ts +4 -6
  593. package/src/shared-tree-core/editManagerFormatCommons.ts +2 -1
  594. package/src/shared-tree-core/editManagerFormatV1toV4.ts +2 -1
  595. package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +2 -1
  596. package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -1
  597. package/src/shared-tree-core/messageCodecs.ts +4 -4
  598. package/src/shared-tree-core/messageFormatV1ToV4.ts +2 -1
  599. package/src/shared-tree-core/messageFormatVSharedBranches.ts +2 -1
  600. package/src/simple-tree/core/treeNodeKernel.ts +66 -28
  601. package/src/simple-tree/simpleSchemaFormatV1.ts +2 -1
  602. package/src/text/codePointUtils.ts +81 -0
  603. package/src/text/index.ts +1 -0
  604. package/src/text/textDomain.ts +155 -2
  605. package/src/text/textDomainFormatted.ts +73 -2
  606. package/src/treeFactory.ts +5 -0
  607. package/src/util/breakable.ts +27 -6
  608. package/src/util/typeboxBrand.ts +2 -1
  609. package/src/util/utils.ts +2 -1
@@ -48,14 +48,15 @@ function makeVersionedCodec<
48
48
  TDecoded,
49
49
  TEncoded extends Versioned = VersionedJson,
50
50
  TValidate = TEncoded,
51
- TContext = void,
51
+ TEncodeContext = void,
52
+ TDecodeContext = TEncodeContext,
52
53
  >(
53
54
  supportedVersions: Set<FormatVersion>,
54
55
  { jsonValidator: validator }: ICodecOptions,
55
- inner: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>,
56
- ): IJsonCodec<TDecoded, TEncoded, TValidate, TContext> {
56
+ inner: IJsonCodec<TDecoded, TEncoded, TValidate, TEncodeContext, TDecodeContext>,
57
+ ): IJsonCodec<TDecoded, TEncoded, TValidate, TEncodeContext, TDecodeContext> {
57
58
  const codec = {
58
- encode: (data: TDecoded, context: TContext): TEncoded => {
59
+ encode: (data: TDecoded, context: TEncodeContext): TEncoded => {
59
60
  const encoded = inner.encode(data, context);
60
61
  assert(
61
62
  supportedVersions.has(encoded.version),
@@ -63,7 +64,7 @@ function makeVersionedCodec<
63
64
  );
64
65
  return encoded;
65
66
  },
66
- decode: (data: TValidate, context: TContext): TDecoded => {
67
+ decode: (data: TValidate, context: TDecodeContext): TDecoded => {
67
68
  const versioned = data as Versioned; // Validated by withSchemaValidation
68
69
  if (!supportedVersions.has(versioned.version)) {
69
70
  throw new UsageError(
@@ -96,14 +97,15 @@ function makeVersionedValidatedCodec<
96
97
  TDecoded,
97
98
  TEncoded extends Versioned = VersionedJson,
98
99
  TValidate = TEncoded,
99
- TContext = void,
100
+ TEncodeContext = void,
101
+ TDecodeContext = TEncodeContext,
100
102
  >(
101
103
  options: ICodecOptions,
102
104
  supportedVersions: Set<FormatVersion>,
103
105
  schema: EncodedSchema,
104
- codec: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>,
105
- ): IJsonCodec<TDecoded, TEncoded, TValidate, TContext> &
106
- Pick<CodecAndSchema<TDecoded, TContext>, "schema"> {
106
+ codec: IJsonCodec<TDecoded, TEncoded, TValidate, TEncodeContext, TDecodeContext>,
107
+ ): IJsonCodec<TDecoded, TEncoded, TValidate, TEncodeContext, TDecodeContext> &
108
+ Pick<CodecAndSchema<TDecoded, TEncodeContext, TDecodeContext>, "schema"> {
107
109
  return {
108
110
  ...makeVersionedCodec(
109
111
  supportedVersions,
@@ -119,12 +121,11 @@ function makeVersionedValidatedCodec<
119
121
  */
120
122
  export function makeDiscontinuedCodecAndSchema<
121
123
  TDecoded,
122
- TContext,
123
124
  TFormatVersion extends FormatVersion = FormatVersion,
124
125
  >(
125
126
  discontinuedVersion: TFormatVersion,
126
127
  discontinuedSince: SemanticVersion,
127
- ): CodecVersion<TDecoded, TContext, TFormatVersion> {
128
+ ): CodecVersion<TDecoded, unknown, TFormatVersion, ICodecOptions, unknown> {
128
129
  return {
129
130
  minVersionForCollab: undefined,
130
131
  formatVersion: discontinuedVersion,
@@ -150,9 +151,19 @@ export function makeDiscontinuedCodecAndSchema<
150
151
  * The codec should not perform its own schema validation.
151
152
  * The schema validation gets added when normalizing to {@link NormalizedCodecVersion}.
152
153
  */
153
- export type CodecAndSchema<TDecoded, TContext = void> = {
154
+ export type CodecAndSchema<
155
+ TDecoded,
156
+ TEncodeContext = void,
157
+ TDecodeContext = TEncodeContext,
158
+ > = {
154
159
  readonly schema: TSchema;
155
- } & IJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>;
160
+ } & IJsonCodec<
161
+ TDecoded,
162
+ VersionedJson,
163
+ JsonCompatibleReadOnly,
164
+ TEncodeContext,
165
+ TDecodeContext
166
+ >;
156
167
 
157
168
  /**
158
169
  * A codec alongside its format version and schema.
@@ -183,12 +194,13 @@ export interface CodecVersionBase<
183
194
  */
184
195
  export interface CodecVersion<
185
196
  TDecoded,
186
- TContext,
197
+ TEncodeContext,
187
198
  TFormatVersion extends FormatVersion,
188
199
  TBuildOptions extends ICodecOptions = ICodecOptions,
200
+ TDecodeContext = TEncodeContext,
189
201
  > extends CodecVersionBase<
190
- | CodecAndSchema<TDecoded, TContext>
191
- | ((options: TBuildOptions) => CodecAndSchema<TDecoded, TContext>),
202
+ | CodecAndSchema<TDecoded, TEncodeContext, TDecodeContext>
203
+ | ((options: TBuildOptions) => CodecAndSchema<TDecoded, TEncodeContext, TDecodeContext>),
192
204
  TFormatVersion
193
205
  > {}
194
206
 
@@ -200,21 +212,29 @@ export interface CodecVersion<
200
212
  */
201
213
  export interface NormalizedCodecVersion<
202
214
  TDecoded,
203
- TContext,
215
+ TEncodeContext,
204
216
  TFormatVersion extends FormatVersion,
205
217
  TBuildOptions extends ICodecOptions,
218
+ TDecodeContext = TEncodeContext,
206
219
  > extends CodecVersionBase<
207
- (options: TBuildOptions) => CodecAndSchema<TDecoded, TContext>,
220
+ (options: TBuildOptions) => CodecAndSchema<TDecoded, TEncodeContext, TDecodeContext>,
208
221
  TFormatVersion
209
222
  > {}
210
223
 
211
224
  /**
212
225
  * {@link NormalizedCodecVersion} after applying the build options.
213
226
  * @remarks
214
- * Produced by {@link ClientVersionDispatchingCodecBuilder.applyOptions}.
227
+ * Produced by {@link VersionDispatchingCodecBuilder.applyOptions}.
215
228
  */
216
- interface EvaluatedCodecVersion<TDecoded, TContext, TFormatVersion extends FormatVersion>
217
- extends CodecVersionBase<CodecAndSchema<TDecoded, TContext>, TFormatVersion> {}
229
+ interface EvaluatedCodecVersion<
230
+ TDecoded,
231
+ TEncodeContext,
232
+ TFormatVersion extends FormatVersion,
233
+ TDecodeContext = TEncodeContext,
234
+ > extends CodecVersionBase<
235
+ CodecAndSchema<TDecoded, TEncodeContext, TDecodeContext>,
236
+ TFormatVersion
237
+ > {}
218
238
 
219
239
  /**
220
240
  * Normalize the codec to a single format.
@@ -223,17 +243,34 @@ interface EvaluatedCodecVersion<TDecoded, TContext, TFormatVersion extends Forma
223
243
  */
224
244
  function normalizeCodecVersion<
225
245
  TDecoded,
226
- TContext,
246
+ TEncodeContext,
227
247
  TFormatVersion extends FormatVersion,
228
248
  TBuildOptions extends ICodecOptions,
249
+ TDecodeContext = TEncodeContext,
229
250
  >(
230
- codecVersion: CodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>,
231
- ): NormalizedCodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions> {
232
- const codecBuilder: (options: TBuildOptions) => CodecAndSchema<TDecoded, TContext> =
251
+ codecVersion: CodecVersion<
252
+ TDecoded,
253
+ TEncodeContext,
254
+ TFormatVersion,
255
+ TBuildOptions,
256
+ TDecodeContext
257
+ >,
258
+ ): NormalizedCodecVersion<
259
+ TDecoded,
260
+ TEncodeContext,
261
+ TFormatVersion,
262
+ TBuildOptions,
263
+ TDecodeContext
264
+ > {
265
+ const codecBuilder: (
266
+ options: TBuildOptions,
267
+ ) => CodecAndSchema<TDecoded, TEncodeContext, TDecodeContext> =
233
268
  typeof codecVersion.codec === "function"
234
269
  ? codecVersion.codec
235
- : () => codecVersion.codec as CodecAndSchema<TDecoded, TContext>;
236
- const codec = (options: TBuildOptions): CodecAndSchema<TDecoded, TContext> => {
270
+ : () => codecVersion.codec as CodecAndSchema<TDecoded, TEncodeContext, TDecodeContext>;
271
+ const codec = (
272
+ options: TBuildOptions,
273
+ ): CodecAndSchema<TDecoded, TEncodeContext, TDecodeContext> => {
237
274
  const built = codecBuilder(options);
238
275
  return makeVersionedValidatedCodec(
239
276
  options,
@@ -251,27 +288,59 @@ function normalizeCodecVersion<
251
288
  }
252
289
 
253
290
  /**
254
- * Creates a codec which dispatches to the appropriate member of a codec family based on the `minVersionForCollab` for encode and the
255
- * version number in data it encounters for decode.
291
+ * A codec that can read multiple format versions and write a single selected version.
292
+ * @remarks
293
+ * Produced by {@link VersionDispatchingCodecBuilder.build}.
294
+ *
295
+ * @typeParam TDecoded - The in memory (not encoded) format.
296
+ * @typeParam TEncodeContext - Context type passed to encode operations.
297
+ * @typeParam TFormatVersion - The type of format version identifiers used by this codec.
298
+ * @typeParam TDecodeContext - Context type passed to decode operations. Defaults to `TEncodeContext`.
299
+ */
300
+ export interface VersionDispatchingCodec<
301
+ TDecoded,
302
+ TEncodeContext,
303
+ TFormatVersion extends FormatVersion,
304
+ TDecodeContext = TEncodeContext,
305
+ > extends IJsonCodec<
306
+ TDecoded,
307
+ JsonCompatibleReadOnly,
308
+ JsonCompatibleReadOnly,
309
+ TEncodeContext,
310
+ TDecodeContext
311
+ > {
312
+ /**
313
+ * The format version which this codec writes.
314
+ * @remarks
315
+ * Selected by {@link VersionDispatchingCodecBuilder.build} based on the provided options.
316
+ */
317
+ readonly writeVersion: TFormatVersion;
318
+ }
319
+
320
+ /**
321
+ * Creates a {@link VersionDispatchingCodec} using a {@link CodecVersion} to select the {@link VersionDispatchingCodec.writeVersion}.
256
322
  * @privateRemarks
257
- * This is a two stage builder so the first stage can encapsulate all codec specific details and the second can bring in configuration.
323
+ * This is a two stage builder so the first stage (the static build) can encapsulate all codec specific details and
324
+ * the second (the instance build) can bring in configuration.
258
325
  */
259
- export class ClientVersionDispatchingCodecBuilder<
326
+ export class VersionDispatchingCodecBuilder<
260
327
  TBuildOptions extends ICodecOptions = ICodecOptions,
261
328
  TDecoded = unknown,
262
- TContext = unknown,
329
+ TEncodeContext = unknown,
263
330
  TFormatVersion extends FormatVersion = FormatVersion,
264
331
  TName extends CodecName = string,
332
+ TDecodeContext = TEncodeContext,
265
333
  > {
266
334
  public readonly registry: readonly NormalizedCodecVersion<
267
335
  TDecoded,
268
- TContext,
336
+ TEncodeContext,
269
337
  TFormatVersion,
270
- TBuildOptions
338
+ TBuildOptions,
339
+ TDecodeContext
271
340
  >[];
272
341
 
273
342
  /**
274
- * Use {@link ClientVersionDispatchingCodecBuilder.build} to create an instance of this class.
343
+ * Use {@link VersionDispatchingCodecBuilder.build} to create an instance of this class.
275
344
  * @remarks
276
345
  * Inputs to this are assumed to be constants in the code controlled by the developers of this package,
277
346
  * and constructed at least once during tests.
@@ -286,13 +355,20 @@ export class ClientVersionDispatchingCodecBuilder<
286
355
  /**
287
356
  * The registry of codecs which this builder can use to encode and decode data.
288
357
  */
289
- inputRegistry: readonly CodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>[],
358
+ inputRegistry: readonly CodecVersion<
359
+ TDecoded,
360
+ TEncodeContext,
361
+ TFormatVersion,
362
+ TBuildOptions,
363
+ TDecodeContext
364
+ >[],
290
365
  ) {
291
366
  type Normalized = NormalizedCodecVersion<
292
367
  TDecoded,
293
- TContext,
368
+ TEncodeContext,
294
369
  TFormatVersion,
295
- TBuildOptions
370
+ TBuildOptions,
371
+ TDecodeContext
296
372
  >;
297
373
  const normalizedRegistry: Normalized[] = [];
298
374
  const formats: Set<FormatVersion> = new Set();
@@ -333,14 +409,14 @@ export class ClientVersionDispatchingCodecBuilder<
333
409
  }
334
410
 
335
411
  /**
336
- * Applies the provided options to the codec registry to produce a list of evaluated codecs.
412
+ * Applies `options` to the codec registry to produce a list of evaluated codecs.
337
413
  * @remarks
338
414
  * This is used by build, which is what production code should use.
339
415
  * This is only exposed for testing purposes.
340
416
  */
341
417
  public applyOptions(
342
418
  options: TBuildOptions,
343
- ): EvaluatedCodecVersion<TDecoded, TContext, TFormatVersion>[] {
419
+ ): EvaluatedCodecVersion<TDecoded, TEncodeContext, TFormatVersion, TDecodeContext>[] {
344
420
  return this.registry.map((codec) => ({
345
421
  minVersionForCollab: codec.minVersionForCollab,
346
422
  formatVersion: codec.formatVersion,
@@ -349,26 +425,17 @@ export class ClientVersionDispatchingCodecBuilder<
349
425
  }
350
426
 
351
427
  /**
352
- * Produce a single codec which can read any supported format, and writes a version selected based on the provided options.
428
+ * Builds a complete {@link VersionDispatchingCodec} that can decode all registered versions
429
+ * and encode a version selected by the provided options.
353
430
  */
354
- public build(options: TBuildOptions & CodecWriteOptions): IJsonCodec<
355
- TDecoded,
356
- JsonCompatibleReadOnly,
357
- JsonCompatibleReadOnly,
358
- TContext
359
- > & {
360
- /**
361
- * The format version which this codec writes.
362
- * @remarks
363
- * This is selected based on the provided {@link CodecWriteOptions}.
364
- */
365
- readonly writeVersion: TFormatVersion;
366
- } {
431
+ public build(
432
+ options: TBuildOptions & CodecWriteOptions,
433
+ ): VersionDispatchingCodec<TDecoded, TEncodeContext, TFormatVersion, TDecodeContext> {
367
434
  const [applied, decoder] = this.buildDecoderInternal(options);
368
435
  const writeVersion = getWriteVersion(this.name, options, applied);
369
436
  return {
370
437
  ...decoder,
371
- encode: (data: TDecoded, context: TContext): JsonCompatibleReadOnly => {
438
+ encode: (data: TDecoded, context: TEncodeContext): JsonCompatibleReadOnly => {
372
439
  return writeVersion.codec.encode(data, context);
373
440
  },
374
441
  writeVersion: writeVersion.formatVersion,
@@ -378,21 +445,27 @@ export class ClientVersionDispatchingCodecBuilder<
378
445
  private buildDecoderInternal(
379
446
  options: TBuildOptions,
380
447
  ): [
381
- EvaluatedCodecVersion<TDecoded, TContext, TFormatVersion>[],
448
+ EvaluatedCodecVersion<TDecoded, TEncodeContext, TFormatVersion, TDecodeContext>[],
382
449
  Pick<
383
- IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,
450
+ IJsonCodec<
451
+ TDecoded,
452
+ JsonCompatibleReadOnly,
453
+ JsonCompatibleReadOnly,
454
+ TEncodeContext,
455
+ TDecodeContext
456
+ >,
384
457
  "decode"
385
458
  >,
386
459
  ] {
387
460
  const applied = this.applyOptions(options);
388
461
  const fromFormatVersion = new Map<
389
462
  FormatVersion,
390
- EvaluatedCodecVersion<TDecoded, TContext, TFormatVersion>
463
+ EvaluatedCodecVersion<TDecoded, TEncodeContext, TFormatVersion, TDecodeContext>
391
464
  >(applied.map((codec) => [codec.formatVersion, codec]));
392
465
  return [
393
466
  applied,
394
467
  {
395
- decode: (data: JsonCompatibleReadOnly, context: TContext): TDecoded => {
468
+ decode: (data: JsonCompatibleReadOnly, context: TDecodeContext): TDecoded => {
396
469
  const versioned = data as Partial<Versioned>;
397
470
  const codec = fromFormatVersion.get(versioned.version);
398
471
  if (codec === undefined) {
@@ -408,12 +481,19 @@ The client which encoded this data likely specified an "minVersionForCollab" val
408
481
  }
409
482
 
410
483
  /**
411
- * Produce a single codec which can read any supported format.
484
+ * Builds a decoder-only codec that can decode any supported format without encoding capability.
485
+ *
486
+ * @remarks
487
+ * The returned codec contains only the `decode` method and can be used when only decoding is needed.
488
+ * This is useful for scenarios where reading/decoding versioned data is sufficient.
489
+ *
490
+ * @param options - Build options (typically containing the `jsonValidator`)
491
+ * @returns An object with a `decode` method that can handle any supported format version
412
492
  */
413
493
  public buildDecoder(
414
494
  options: TBuildOptions,
415
495
  ): Pick<
416
- IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,
496
+ VersionDispatchingCodec<TDecoded, TEncodeContext, TFormatVersion, TDecodeContext>,
417
497
  "decode"
418
498
  > {
419
499
  return this.buildDecoderInternal(options)[1];
@@ -429,42 +509,62 @@ The client which encoded this data likely specified an "minVersionForCollab" val
429
509
  }
430
510
 
431
511
  /**
432
- * Builds a ClientVersionDispatchingCodecBuilder from the provided registry.
512
+ * Creates a new VersionDispatchingCodecBuilder from the provided codec registry.
513
+ *
433
514
  * @remarks
434
515
  * This static method infers the types of the builder from the provided registry,
435
516
  * making it easier to create builders without needing to explicitly specify all type parameters.
436
517
  * This gets better type inference than the constructor.
518
+ *
519
+ * @example
520
+ * ```typescript
521
+ * const builder = VersionDispatchingCodecBuilder.build('myCodec', [
522
+ * { minVersionForCollab: lowestMinVersionForCollab, formatVersion: 1, codec: { encode, decode, schema } },
523
+ * { minVersionForCollab: '2.100.0', formatVersion: 2, codec: { encode, decode, schema } },
524
+ * ]);
525
+ * ```
437
526
  */
438
527
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
439
528
  public static build<
440
529
  Name extends CodecName,
441
- Entry extends CodecVersion<unknown, unknown, FormatVersion, never>,
530
+ Entry extends CodecVersion<unknown, unknown, FormatVersion, never, unknown>,
442
531
  >(name: Name, inputRegistry: readonly Entry[]) {
443
532
  type TDecoded2 =
444
- Entry extends CodecVersion<infer D, unknown, FormatVersion, never> ? D : never;
445
- type TContext2 =
446
- Entry extends CodecVersion<unknown, infer C, FormatVersion, never> ? C : never;
533
+ Entry extends CodecVersion<infer D, unknown, FormatVersion, never, unknown> ? D : never;
534
+ type TEncodeContext2 =
535
+ Entry extends CodecVersion<unknown, infer C, FormatVersion, never, unknown> ? C : never;
447
536
  type TFormatVersion2 =
448
- Entry extends CodecVersion<unknown, unknown, infer F, never> ? F : never;
537
+ Entry extends CodecVersion<unknown, unknown, infer F, never, unknown> ? F : never;
449
538
  type TBuildOptions2 =
450
- Entry extends CodecVersion<unknown, unknown, FormatVersion, infer B> ? B : never;
539
+ Entry extends CodecVersion<unknown, unknown, FormatVersion, infer B, unknown>
540
+ ? B
541
+ : never;
542
+ type TDecodeContext2 =
543
+ Entry extends CodecVersion<unknown, unknown, FormatVersion, never, infer D> ? D : never;
544
+
545
+ type ResolvedEncodeContext = unknown extends TEncodeContext2 ? void : TEncodeContext2;
546
+ type ResolvedDecodeContext = unknown extends TDecodeContext2
547
+ ? ResolvedEncodeContext
548
+ : TDecodeContext2;
451
549
 
452
550
  type CodecFinal = CodecVersion<
453
551
  TDecoded2,
454
552
  // If it does not matter what context is provided, undefined is fine, so allow it to be omitted.
455
- unknown extends TContext2 ? void : TContext2,
553
+ ResolvedEncodeContext,
456
554
  TFormatVersion2,
457
- TBuildOptions2
555
+ TBuildOptions2,
556
+ ResolvedDecodeContext
458
557
  >;
459
558
 
460
559
  const input = inputRegistry as readonly unknown[] as readonly CodecFinal[];
461
560
 
462
- const builder = new ClientVersionDispatchingCodecBuilder<
561
+ const builder = new VersionDispatchingCodecBuilder<
463
562
  TBuildOptions2,
464
563
  TDecoded2,
465
- unknown extends TContext2 ? void : TContext2,
564
+ ResolvedEncodeContext,
466
565
  TFormatVersion2,
467
- Name
566
+ Name,
567
+ ResolvedDecodeContext
468
568
  >(name, input);
469
569
  return builder;
470
570
  }
@@ -3,7 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { type Static, Type } from "@sinclair/typebox";
6
+ import * as Type from "@sinclair/typebox";
7
+ import type { Static } from "@sinclair/typebox";
7
8
 
8
9
  /**
9
10
  * A field to use in TypeBox schemas for the version field of a versioned format.
@@ -6,7 +6,8 @@
6
6
  export { Versioned, versionField } from "./format.js";
7
7
  export {
8
8
  makeDiscontinuedCodecAndSchema,
9
- ClientVersionDispatchingCodecBuilder,
9
+ VersionDispatchingCodecBuilder,
10
+ type VersionDispatchingCodec,
10
11
  type CodecVersion,
11
12
  type CodecAndSchema,
12
13
  } from "./codec.js";
@@ -9,7 +9,7 @@ import type {
9
9
  SessionSpaceCompressedId,
10
10
  StableId,
11
11
  } from "@fluidframework/id-compressor";
12
- import { Type } from "@sinclair/typebox";
12
+ import * as Type from "@sinclair/typebox";
13
13
 
14
14
  import {
15
15
  type Brand,
@@ -3,7 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { type ObjectOptions, type Static, Type } from "@sinclair/typebox";
6
+ import * as Type from "@sinclair/typebox";
7
+ import type { ObjectOptions, Static } from "@sinclair/typebox";
7
8
 
8
9
  import { unionOptions } from "../../codec/index.js";
9
10
  import { type Brand, brandedStringType } from "../../util/index.js";
@@ -3,7 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { type ObjectOptions, type Static, Type } from "@sinclair/typebox";
6
+ import type { ObjectOptions, Static } from "@sinclair/typebox";
7
+ import * as Type from "@sinclair/typebox";
7
8
 
8
9
  import { unionOptions } from "../../codec/index.js";
9
10
  import type { JsonCompatibleReadOnlyObject } from "../../util/index.js";
@@ -60,7 +60,7 @@ export function areDetachedNodeIdsEqual(a: DetachedNodeId, b: DetachedNodeId): b
60
60
  }
61
61
 
62
62
  /**
63
- * Returns true if a delta field map contains any changes that would be visible in the document (eg, an insert, move, edit)
63
+ * Returns true if a delta field map contains any changes that would be visible in the document (i.e., a detach or an attach)
64
64
  * @param fields - Delta FieldMap to check for visible changes
65
65
  * @returns True if change map contains any changes that would be visible in the document, false otherwise
66
66
  */
@@ -77,7 +77,7 @@ export function deltaFieldMapHasVisibleChanges(fields: FieldMap | undefined): bo
77
77
  }
78
78
 
79
79
  /**
80
- * Returns true if the given field changes contains any changes that would be visible in the document (eg, an insert, move, edit)
80
+ * Returns true if the given field changes contains any changes that would be visible in the document (i.e., a detach or an attach)
81
81
  * @param fieldChanges - Field changes to check for visible changes
82
82
  * @returns True if the field changes contain any changes that would be visible in the document, false otherwise
83
83
  */
@@ -5,6 +5,7 @@
5
5
 
6
6
  import { assert } from "@fluidframework/core-utils/internal";
7
7
  import type { IIdCompressor } from "@fluidframework/id-compressor";
8
+ import { isFinalId } from "@fluidframework/id-compressor/internal";
8
9
 
9
10
  import type { CodecAndSchema, IJsonCodec } from "../../codec/index.js";
10
11
  import { brand } from "../../util/index.js";
@@ -46,7 +47,7 @@ class MajorCodec implements IJsonCodec<Major, EncodedRevisionTag> {
46
47
  * The assert below will fail in such a scenario. This is addressed in the v2 codec.
47
48
  */
48
49
  assert(
49
- id === "root" || id >= 0,
50
+ id === "root" || isFinalId(id),
50
51
  0x88f /* Expected final id on encode of detached field index revision */,
51
52
  );
52
53
  return id;
@@ -54,7 +55,7 @@ class MajorCodec implements IJsonCodec<Major, EncodedRevisionTag> {
54
55
 
55
56
  public decode(major: EncodedRevisionTag): RevisionTag {
56
57
  assert(
57
- major === "root" || major >= 0,
58
+ major === "root" || isFinalId(major),
58
59
  0x890 /* Expected final id on decode of detached field index revision */,
59
60
  );
60
61
  return this.revisionTagCodec.decode(major, {
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { assert } from "@fluidframework/core-utils/internal";
7
7
  import type { IIdCompressor, StableId } from "@fluidframework/id-compressor";
8
- import { isStableId } from "@fluidframework/id-compressor/internal";
8
+ import { isFinalId, isStableId } from "@fluidframework/id-compressor/internal";
9
9
 
10
10
  import type { CodecAndSchema, IJsonCodec } from "../../codec/index.js";
11
11
  import type { EncodedRevisionTag, RevisionTagCodec, RevisionTag } from "../rebase/index.js";
@@ -25,7 +25,7 @@ class MajorCodec implements IJsonCodec<Major> {
25
25
  assert(major !== undefined, 0xbfb /* Unexpected undefined revision */);
26
26
  const id = this.revisionTagCodec.encode(major);
27
27
 
28
- if (id !== "root" && id < 0) {
28
+ if (id !== "root" && !isFinalId(id)) {
29
29
  /**
30
30
  * This code path handles the case where the major revision is not finalized.
31
31
  * This can happen the SharedTree is being attached to an already attached container.
@@ -39,7 +39,9 @@ class MajorCodec implements IJsonCodec<Major> {
39
39
 
40
40
  public decode(major: EncodedRevisionTag | StableId): RevisionTag {
41
41
  assert(
42
- major === "root" || (typeof major === "string" && isStableId(major)) || major >= 0,
42
+ major === "root" ||
43
+ (typeof major === "string" && isStableId(major)) ||
44
+ (typeof major === "number" && isFinalId(major)),
43
45
  0xbfd /* Expected root, stable, or final compressed id */,
44
46
  );
45
47
  if (typeof major === "string" && isStableId(major)) {
@@ -7,7 +7,7 @@ import type { IIdCompressor } from "@fluidframework/id-compressor";
7
7
  import { lowestMinVersionForCollab } from "@fluidframework/runtime-utils/internal";
8
8
 
9
9
  import {
10
- ClientVersionDispatchingCodecBuilder,
10
+ VersionDispatchingCodecBuilder,
11
11
  FluidClientVersion,
12
12
  type ICodecOptions,
13
13
  } from "../../codec/index.js";
@@ -22,7 +22,7 @@ type BuildData = ICodecOptions & {
22
22
  readonly idCompressor: IIdCompressor;
23
23
  };
24
24
 
25
- export const detachedFieldIndexCodecBuilder = ClientVersionDispatchingCodecBuilder.build(
25
+ export const detachedFieldIndexCodecBuilder = VersionDispatchingCodecBuilder.build(
26
26
  "DetachedFieldIndex",
27
27
  [
28
28
  {
@@ -3,7 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { type Static, type TSchema, Type } from "@sinclair/typebox";
6
+ import * as Type from "@sinclair/typebox";
7
+ import type { Static, TSchema } from "@sinclair/typebox";
7
8
 
8
9
  import { brandedNumberType, strictEnum, type Values } from "../../util/index.js";
9
10
 
@@ -3,7 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { Type, type Static } from "@sinclair/typebox";
6
+ import * as Type from "@sinclair/typebox";
7
+ import type { Static } from "@sinclair/typebox";
7
8
 
8
9
  import { brand } from "../../util/index.js";
9
10
  import { RevisionTagSchema, StableIdSchema } from "../rebase/index.js";
@@ -3,7 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { type Static, type TSchema, Type } from "@sinclair/typebox";
6
+ import * as Type from "@sinclair/typebox";
7
+ import type { Static, TSchema } from "@sinclair/typebox";
7
8
 
8
9
  import { schemaFormatV1 } from "../schema-stored/index.js";
9
10