@fluidframework/tree 2.113.1 → 2.115.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 (660) hide show
  1. package/CHANGELOG.md +289 -0
  2. package/api-report/tree.alpha.api.md +127 -39
  3. package/dist/core/change-family/changeFamily.d.ts +15 -4
  4. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  5. package/dist/core/change-family/changeFamily.js.map +1 -1
  6. package/dist/core/change-family/editBuilder.d.ts +2 -3
  7. package/dist/core/change-family/editBuilder.d.ts.map +1 -1
  8. package/dist/core/change-family/editBuilder.js +1 -2
  9. package/dist/core/change-family/editBuilder.js.map +1 -1
  10. package/dist/core/change-family/index.d.ts +1 -1
  11. package/dist/core/change-family/index.d.ts.map +1 -1
  12. package/dist/core/change-family/index.js.map +1 -1
  13. package/dist/core/index.d.ts +4 -3
  14. package/dist/core/index.d.ts.map +1 -1
  15. package/dist/core/index.js +3 -2
  16. package/dist/core/index.js.map +1 -1
  17. package/dist/core/rebase/index.d.ts +1 -1
  18. package/dist/core/rebase/index.d.ts.map +1 -1
  19. package/dist/core/rebase/index.js +2 -1
  20. package/dist/core/rebase/index.js.map +1 -1
  21. package/dist/core/rebase/types.d.ts +110 -0
  22. package/dist/core/rebase/types.d.ts.map +1 -1
  23. package/dist/core/rebase/types.js +47 -1
  24. package/dist/core/rebase/types.js.map +1 -1
  25. package/dist/core/tree/delta.d.ts +62 -16
  26. package/dist/core/tree/delta.d.ts.map +1 -1
  27. package/dist/core/tree/delta.js.map +1 -1
  28. package/dist/core/tree/detachedFieldIndex.d.ts +7 -13
  29. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  30. package/dist/core/tree/detachedFieldIndex.js +32 -46
  31. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  32. package/dist/core/tree/index.d.ts +1 -0
  33. package/dist/core/tree/index.d.ts.map +1 -1
  34. package/dist/core/tree/index.js.map +1 -1
  35. package/dist/core/tree/visitorUtils.d.ts +2 -4
  36. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  37. package/dist/core/tree/visitorUtils.js +2 -2
  38. package/dist/core/tree/visitorUtils.js.map +1 -1
  39. package/dist/entrypoints/alpha.d.ts +1 -1
  40. package/dist/entrypoints/alpha.d.ts.map +1 -1
  41. package/dist/entrypoints/alpha.js +8 -3
  42. package/dist/entrypoints/alpha.js.map +1 -1
  43. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +9 -6
  44. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  45. package/dist/feature-libraries/chunked-forest/codec/codecs.js +16 -13
  46. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  47. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  48. package/dist/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  49. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  50. package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  51. package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  52. package/dist/feature-libraries/comparison-forest/comparisonForest.js +98 -0
  53. package/dist/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  54. package/dist/feature-libraries/comparison-forest/index.d.ts +6 -0
  55. package/dist/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  56. package/dist/feature-libraries/comparison-forest/index.js +10 -0
  57. package/dist/feature-libraries/comparison-forest/index.js.map +1 -0
  58. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  59. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  60. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  61. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  62. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  63. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  64. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  65. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  66. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  67. package/dist/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  68. package/dist/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  69. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  70. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  71. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +18 -6
  72. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  73. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  74. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  75. package/dist/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  76. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  77. package/dist/feature-libraries/index.d.ts +4 -3
  78. package/dist/feature-libraries/index.d.ts.map +1 -1
  79. package/dist/feature-libraries/index.js +77 -72
  80. package/dist/feature-libraries/index.js.map +1 -1
  81. package/dist/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  82. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  83. package/dist/feature-libraries/mitigatedChangeFamily.js +12 -0
  84. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  85. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  86. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  87. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  88. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  89. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  90. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  91. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  92. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  93. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  94. package/dist/feature-libraries/modular-schema/invert.d.ts +15 -0
  95. package/dist/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  96. package/dist/feature-libraries/modular-schema/invert.js +159 -0
  97. package/dist/feature-libraries/modular-schema/invert.js.map +1 -0
  98. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  99. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  100. package/dist/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  101. package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  102. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  103. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  104. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  105. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  106. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  107. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  108. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  109. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  110. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  111. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  112. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  113. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  114. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +53 -406
  115. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  116. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  117. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  118. package/dist/feature-libraries/modular-schema/modularChangeUtils.js +205 -0
  119. package/dist/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  120. package/dist/feature-libraries/modular-schema/prune.d.ts +10 -0
  121. package/dist/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  122. package/dist/feature-libraries/modular-schema/prune.js +49 -0
  123. package/dist/feature-libraries/modular-schema/prune.js.map +1 -0
  124. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  125. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  126. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  127. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  128. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  129. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  130. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  131. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  132. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  133. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  134. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  135. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  136. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  137. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  138. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  139. package/dist/feature-libraries/treeTextCursor.d.ts +15 -0
  140. package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
  141. package/dist/feature-libraries/treeTextCursor.js +64 -1
  142. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  143. package/dist/index.d.ts +6 -4
  144. package/dist/index.d.ts.map +1 -1
  145. package/dist/index.js +10 -5
  146. package/dist/index.js.map +1 -1
  147. package/dist/packageVersion.d.ts +1 -1
  148. package/dist/packageVersion.js +1 -1
  149. package/dist/packageVersion.js.map +1 -1
  150. package/dist/shared-tree/serializedChange.d.ts +2 -2
  151. package/dist/shared-tree/serializedChange.d.ts.map +1 -1
  152. package/dist/shared-tree/serializedChange.js.map +1 -1
  153. package/dist/shared-tree/sharedTree.d.ts +11 -3
  154. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  155. package/dist/shared-tree/sharedTree.js +9 -7
  156. package/dist/shared-tree/sharedTree.js.map +1 -1
  157. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  158. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  159. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  160. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  161. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  162. package/dist/shared-tree/sharedTreeChangeFamily.js +57 -1
  163. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  164. package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
  165. package/dist/shared-tree/transactionMinimize.js +2 -2
  166. package/dist/shared-tree/transactionMinimize.js.map +1 -1
  167. package/dist/shared-tree/transactionPostProcessor.d.ts +2 -1
  168. package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  169. package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
  170. package/dist/shared-tree/treeCheckout.d.ts +13 -7
  171. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  172. package/dist/shared-tree/treeCheckout.js +59 -13
  173. package/dist/shared-tree/treeCheckout.js.map +1 -1
  174. package/dist/shared-tree-core/branch.d.ts +24 -9
  175. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  176. package/dist/shared-tree-core/branch.js +7 -0
  177. package/dist/shared-tree-core/branch.js.map +1 -1
  178. package/dist/shared-tree-core/editManager.d.ts +4 -4
  179. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  180. package/dist/shared-tree-core/editManager.js +2 -0
  181. package/dist/shared-tree-core/editManager.js.map +1 -1
  182. package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -14
  183. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  184. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  185. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  186. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  187. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  188. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  189. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  190. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  191. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  192. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  193. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  194. package/dist/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  195. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  196. package/dist/shared-tree-core/editManagerSummarizer.js +0 -1
  197. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  198. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  199. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  200. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  201. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  202. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  203. package/dist/shared-tree-core/messageCodecs.d.ts +8 -1
  204. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  205. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  206. package/dist/shared-tree-core/sharedTreeCore.d.ts +5 -5
  207. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  208. package/dist/shared-tree-core/sharedTreeCore.js +1 -1
  209. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  210. package/dist/shared-tree-core/transaction.d.ts +10 -10
  211. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  212. package/dist/shared-tree-core/transaction.js +6 -3
  213. package/dist/shared-tree-core/transaction.js.map +1 -1
  214. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  215. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  216. package/dist/simple-tree/api/eraseSchemaDetails.js +15 -0
  217. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  218. package/dist/simple-tree/api/index.d.ts +1 -1
  219. package/dist/simple-tree/api/index.d.ts.map +1 -1
  220. package/dist/simple-tree/api/index.js +2 -3
  221. package/dist/simple-tree/api/index.js.map +1 -1
  222. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +3 -3
  223. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  224. package/dist/simple-tree/api/schemaStatics.d.ts +6 -7
  225. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  226. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  227. package/dist/simple-tree/api/treeNodeApi.d.ts +20 -24
  228. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  229. package/dist/simple-tree/api/treeNodeApi.js +48 -49
  230. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  231. package/dist/simple-tree/core/treeNode.d.ts +5 -6
  232. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  233. package/dist/simple-tree/core/treeNode.js +2 -4
  234. package/dist/simple-tree/core/treeNode.js.map +1 -1
  235. package/dist/simple-tree/core/withType.d.ts +20 -7
  236. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  237. package/dist/simple-tree/core/withType.js +4 -7
  238. package/dist/simple-tree/core/withType.js.map +1 -1
  239. package/dist/simple-tree/index.d.ts +2 -2
  240. package/dist/simple-tree/index.d.ts.map +1 -1
  241. package/dist/simple-tree/index.js +3 -4
  242. package/dist/simple-tree/index.js.map +1 -1
  243. package/dist/simple-tree/leafNodeSchema.d.ts +6 -1
  244. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  245. package/dist/simple-tree/leafNodeSchema.js +0 -1
  246. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  247. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +53 -5
  248. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  249. package/dist/simple-tree/node-kinds/array/arrayNode.js +91 -10
  250. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  251. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +90 -0
  252. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  253. package/dist/simple-tree/node-kinds/map/mapNode.js +26 -1
  254. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  255. package/dist/simple-tree/node-kinds/object/objectNode.js +2 -2
  256. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  257. package/dist/simple-tree/node-kinds/record/recordNode.js +2 -2
  258. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  259. package/dist/text/codePointUtils.d.ts +2 -2
  260. package/dist/text/codePointUtils.js +2 -2
  261. package/dist/text/codePointUtils.js.map +1 -1
  262. package/dist/text/index.d.ts +3 -3
  263. package/dist/text/index.d.ts.map +1 -1
  264. package/dist/text/index.js +4 -4
  265. package/dist/text/index.js.map +1 -1
  266. package/dist/text/textDomain.d.ts +30 -18
  267. package/dist/text/textDomain.d.ts.map +1 -1
  268. package/dist/text/textDomain.js +44 -23
  269. package/dist/text/textDomain.js.map +1 -1
  270. package/dist/text/textDomainFormatted.d.ts +180 -82
  271. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  272. package/dist/text/textDomainFormatted.js +164 -84
  273. package/dist/text/textDomainFormatted.js.map +1 -1
  274. package/dist/text/textDomainFormattedDefault.d.ts +48 -25
  275. package/dist/text/textDomainFormattedDefault.d.ts.map +1 -1
  276. package/dist/text/textDomainFormattedDefault.js +24 -19
  277. package/dist/text/textDomainFormattedDefault.js.map +1 -1
  278. package/dist/treeDataStore.d.ts +49 -0
  279. package/dist/treeDataStore.d.ts.map +1 -0
  280. package/dist/treeDataStore.js +57 -0
  281. package/dist/treeDataStore.js.map +1 -0
  282. package/dist/treeFactory.d.ts +8 -3
  283. package/dist/treeFactory.d.ts.map +1 -1
  284. package/dist/treeFactory.js +6 -1
  285. package/dist/treeFactory.js.map +1 -1
  286. package/dist/util/compressedIds.d.ts +22 -2
  287. package/dist/util/compressedIds.d.ts.map +1 -1
  288. package/dist/util/compressedIds.js +22 -1
  289. package/dist/util/compressedIds.js.map +1 -1
  290. package/lib/core/change-family/changeFamily.d.ts +15 -4
  291. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  292. package/lib/core/change-family/changeFamily.js.map +1 -1
  293. package/lib/core/change-family/editBuilder.d.ts +2 -3
  294. package/lib/core/change-family/editBuilder.d.ts.map +1 -1
  295. package/lib/core/change-family/editBuilder.js +1 -2
  296. package/lib/core/change-family/editBuilder.js.map +1 -1
  297. package/lib/core/change-family/index.d.ts +1 -1
  298. package/lib/core/change-family/index.d.ts.map +1 -1
  299. package/lib/core/change-family/index.js.map +1 -1
  300. package/lib/core/index.d.ts +4 -3
  301. package/lib/core/index.d.ts.map +1 -1
  302. package/lib/core/index.js +2 -2
  303. package/lib/core/index.js.map +1 -1
  304. package/lib/core/rebase/index.d.ts +1 -1
  305. package/lib/core/rebase/index.d.ts.map +1 -1
  306. package/lib/core/rebase/index.js +1 -1
  307. package/lib/core/rebase/index.js.map +1 -1
  308. package/lib/core/rebase/types.d.ts +110 -0
  309. package/lib/core/rebase/types.d.ts.map +1 -1
  310. package/lib/core/rebase/types.js +46 -0
  311. package/lib/core/rebase/types.js.map +1 -1
  312. package/lib/core/tree/delta.d.ts +62 -16
  313. package/lib/core/tree/delta.d.ts.map +1 -1
  314. package/lib/core/tree/delta.js.map +1 -1
  315. package/lib/core/tree/detachedFieldIndex.d.ts +7 -13
  316. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  317. package/lib/core/tree/detachedFieldIndex.js +7 -21
  318. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  319. package/lib/core/tree/index.d.ts +1 -0
  320. package/lib/core/tree/index.d.ts.map +1 -1
  321. package/lib/core/tree/index.js.map +1 -1
  322. package/lib/core/tree/visitorUtils.d.ts +2 -4
  323. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  324. package/lib/core/tree/visitorUtils.js +2 -2
  325. package/lib/core/tree/visitorUtils.js.map +1 -1
  326. package/lib/entrypoints/alpha.d.ts +1 -1
  327. package/lib/entrypoints/alpha.d.ts.map +1 -1
  328. package/lib/entrypoints/alpha.js +1 -1
  329. package/lib/entrypoints/alpha.js.map +1 -1
  330. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +9 -6
  331. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  332. package/lib/feature-libraries/chunked-forest/codec/codecs.js +16 -13
  333. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  334. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  335. package/lib/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  336. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  337. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  338. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  339. package/lib/feature-libraries/comparison-forest/comparisonForest.js +94 -0
  340. package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  341. package/lib/feature-libraries/comparison-forest/index.d.ts +6 -0
  342. package/lib/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  343. package/lib/feature-libraries/comparison-forest/index.js +6 -0
  344. package/lib/feature-libraries/comparison-forest/index.js.map +1 -0
  345. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  346. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  347. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  348. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  349. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  350. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  351. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  352. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  353. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  354. package/lib/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  355. package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  356. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  357. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  358. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +16 -4
  359. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  360. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  361. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  362. package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  363. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  364. package/lib/feature-libraries/index.d.ts +4 -3
  365. package/lib/feature-libraries/index.d.ts.map +1 -1
  366. package/lib/feature-libraries/index.js +2 -1
  367. package/lib/feature-libraries/index.js.map +1 -1
  368. package/lib/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  369. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  370. package/lib/feature-libraries/mitigatedChangeFamily.js +12 -0
  371. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  372. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  373. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  374. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  375. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  376. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  377. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  378. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  379. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  380. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  381. package/lib/feature-libraries/modular-schema/invert.d.ts +15 -0
  382. package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  383. package/lib/feature-libraries/modular-schema/invert.js +155 -0
  384. package/lib/feature-libraries/modular-schema/invert.js.map +1 -0
  385. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  386. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  387. package/lib/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  388. package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  389. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  390. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  391. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  392. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  393. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  394. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  395. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  396. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  397. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  398. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  399. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  400. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  401. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +16 -367
  402. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  403. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  404. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  405. package/lib/feature-libraries/modular-schema/modularChangeUtils.js +192 -0
  406. package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  407. package/lib/feature-libraries/modular-schema/prune.d.ts +10 -0
  408. package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  409. package/lib/feature-libraries/modular-schema/prune.js +45 -0
  410. package/lib/feature-libraries/modular-schema/prune.js.map +1 -0
  411. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  412. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  413. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  414. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  415. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  416. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  417. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  418. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  419. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  420. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  421. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  422. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  423. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  424. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  425. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  426. package/lib/feature-libraries/treeTextCursor.d.ts +15 -0
  427. package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
  428. package/lib/feature-libraries/treeTextCursor.js +62 -1
  429. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  430. package/lib/index.d.ts +6 -4
  431. package/lib/index.d.ts.map +1 -1
  432. package/lib/index.js +4 -3
  433. package/lib/index.js.map +1 -1
  434. package/lib/packageVersion.d.ts +1 -1
  435. package/lib/packageVersion.js +1 -1
  436. package/lib/packageVersion.js.map +1 -1
  437. package/lib/shared-tree/serializedChange.d.ts +2 -2
  438. package/lib/shared-tree/serializedChange.d.ts.map +1 -1
  439. package/lib/shared-tree/serializedChange.js.map +1 -1
  440. package/lib/shared-tree/sharedTree.d.ts +11 -3
  441. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  442. package/lib/shared-tree/sharedTree.js +10 -8
  443. package/lib/shared-tree/sharedTree.js.map +1 -1
  444. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  445. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  446. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  447. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  448. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  449. package/lib/shared-tree/sharedTreeChangeFamily.js +55 -0
  450. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  451. package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
  452. package/lib/shared-tree/transactionMinimize.js +3 -3
  453. package/lib/shared-tree/transactionMinimize.js.map +1 -1
  454. package/lib/shared-tree/transactionPostProcessor.d.ts +2 -1
  455. package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  456. package/lib/shared-tree/transactionPostProcessor.js.map +1 -1
  457. package/lib/shared-tree/treeCheckout.d.ts +13 -7
  458. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  459. package/lib/shared-tree/treeCheckout.js +61 -15
  460. package/lib/shared-tree/treeCheckout.js.map +1 -1
  461. package/lib/shared-tree-core/branch.d.ts +24 -9
  462. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  463. package/lib/shared-tree-core/branch.js +7 -0
  464. package/lib/shared-tree-core/branch.js.map +1 -1
  465. package/lib/shared-tree-core/editManager.d.ts +4 -4
  466. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  467. package/lib/shared-tree-core/editManager.js +2 -0
  468. package/lib/shared-tree-core/editManager.js.map +1 -1
  469. package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -14
  470. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  471. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  472. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  473. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  474. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  475. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  476. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  477. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  478. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  479. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  480. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  481. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  482. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  483. package/lib/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  484. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  485. package/lib/shared-tree-core/editManagerSummarizer.js +0 -1
  486. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  487. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  488. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  489. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  490. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  491. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  492. package/lib/shared-tree-core/messageCodecs.d.ts +8 -1
  493. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  494. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  495. package/lib/shared-tree-core/sharedTreeCore.d.ts +5 -5
  496. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  497. package/lib/shared-tree-core/sharedTreeCore.js +1 -1
  498. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  499. package/lib/shared-tree-core/transaction.d.ts +10 -10
  500. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  501. package/lib/shared-tree-core/transaction.js +6 -3
  502. package/lib/shared-tree-core/transaction.js.map +1 -1
  503. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  504. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  505. package/lib/simple-tree/api/eraseSchemaDetails.js +15 -0
  506. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  507. package/lib/simple-tree/api/index.d.ts +1 -1
  508. package/lib/simple-tree/api/index.d.ts.map +1 -1
  509. package/lib/simple-tree/api/index.js +1 -1
  510. package/lib/simple-tree/api/index.js.map +1 -1
  511. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +3 -3
  512. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  513. package/lib/simple-tree/api/schemaStatics.d.ts +6 -7
  514. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  515. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  516. package/lib/simple-tree/api/treeNodeApi.d.ts +20 -24
  517. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  518. package/lib/simple-tree/api/treeNodeApi.js +46 -46
  519. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  520. package/lib/simple-tree/core/treeNode.d.ts +5 -6
  521. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  522. package/lib/simple-tree/core/treeNode.js +2 -4
  523. package/lib/simple-tree/core/treeNode.js.map +1 -1
  524. package/lib/simple-tree/core/withType.d.ts +20 -7
  525. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  526. package/lib/simple-tree/core/withType.js +4 -7
  527. package/lib/simple-tree/core/withType.js.map +1 -1
  528. package/lib/simple-tree/index.d.ts +2 -2
  529. package/lib/simple-tree/index.d.ts.map +1 -1
  530. package/lib/simple-tree/index.js +1 -1
  531. package/lib/simple-tree/index.js.map +1 -1
  532. package/lib/simple-tree/leafNodeSchema.d.ts +6 -1
  533. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  534. package/lib/simple-tree/leafNodeSchema.js +0 -1
  535. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  536. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +53 -5
  537. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  538. package/lib/simple-tree/node-kinds/array/arrayNode.js +93 -12
  539. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  540. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +90 -0
  541. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  542. package/lib/simple-tree/node-kinds/map/mapNode.js +27 -2
  543. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  544. package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
  545. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  546. package/lib/simple-tree/node-kinds/record/recordNode.js +3 -3
  547. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  548. package/lib/text/codePointUtils.d.ts +2 -2
  549. package/lib/text/codePointUtils.js +2 -2
  550. package/lib/text/codePointUtils.js.map +1 -1
  551. package/lib/text/index.d.ts +3 -3
  552. package/lib/text/index.d.ts.map +1 -1
  553. package/lib/text/index.js +3 -3
  554. package/lib/text/index.js.map +1 -1
  555. package/lib/text/textDomain.d.ts +30 -18
  556. package/lib/text/textDomain.d.ts.map +1 -1
  557. package/lib/text/textDomain.js +41 -22
  558. package/lib/text/textDomain.js.map +1 -1
  559. package/lib/text/textDomainFormatted.d.ts +180 -82
  560. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  561. package/lib/text/textDomainFormatted.js +165 -86
  562. package/lib/text/textDomainFormatted.js.map +1 -1
  563. package/lib/text/textDomainFormattedDefault.d.ts +48 -25
  564. package/lib/text/textDomainFormattedDefault.d.ts.map +1 -1
  565. package/lib/text/textDomainFormattedDefault.js +25 -20
  566. package/lib/text/textDomainFormattedDefault.js.map +1 -1
  567. package/lib/treeDataStore.d.ts +49 -0
  568. package/lib/treeDataStore.d.ts.map +1 -0
  569. package/lib/treeDataStore.js +52 -0
  570. package/lib/treeDataStore.js.map +1 -0
  571. package/lib/treeFactory.d.ts +8 -3
  572. package/lib/treeFactory.d.ts.map +1 -1
  573. package/lib/treeFactory.js +5 -0
  574. package/lib/treeFactory.js.map +1 -1
  575. package/lib/util/compressedIds.d.ts +22 -2
  576. package/lib/util/compressedIds.d.ts.map +1 -1
  577. package/lib/util/compressedIds.js +22 -1
  578. package/lib/util/compressedIds.js.map +1 -1
  579. package/package.json +32 -24
  580. package/src/core/change-family/changeFamily.ts +32 -4
  581. package/src/core/change-family/editBuilder.ts +1 -2
  582. package/src/core/change-family/index.ts +2 -0
  583. package/src/core/index.ts +11 -6
  584. package/src/core/rebase/index.ts +2 -0
  585. package/src/core/rebase/types.ts +113 -0
  586. package/src/core/tree/delta.ts +62 -16
  587. package/src/core/tree/detachedFieldIndex.ts +7 -38
  588. package/src/core/tree/index.ts +2 -0
  589. package/src/core/tree/visitorUtils.ts +3 -17
  590. package/src/entrypoints/alpha.ts +9 -1
  591. package/src/feature-libraries/chunked-forest/codec/codecs.ts +17 -14
  592. package/src/feature-libraries/chunked-forest/uniformChunk.ts +11 -1
  593. package/src/feature-libraries/comparison-forest/comparisonForest.ts +140 -0
  594. package/src/feature-libraries/comparison-forest/index.ts +6 -0
  595. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +20 -6
  596. package/src/feature-libraries/default-schema/index.ts +1 -0
  597. package/src/feature-libraries/default-schema/noChangeCodecs.ts +11 -3
  598. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +33 -5
  599. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -3
  600. package/src/feature-libraries/index.ts +5 -0
  601. package/src/feature-libraries/mitigatedChangeFamily.ts +21 -3
  602. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +10 -1
  603. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +9 -4
  604. package/src/feature-libraries/modular-schema/index.ts +1 -0
  605. package/src/feature-libraries/modular-schema/invert.ts +338 -0
  606. package/src/feature-libraries/modular-schema/minimizeModularChange.ts +3 -5
  607. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +16 -13
  608. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +3 -1
  609. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +2 -1
  610. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +45 -644
  611. package/src/feature-libraries/modular-schema/modularChangeUtils.ts +340 -0
  612. package/src/feature-libraries/modular-schema/prune.ts +69 -0
  613. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +4 -2
  614. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -2
  615. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +4 -2
  616. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +4 -2
  617. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +6 -3
  618. package/src/feature-libraries/treeTextCursor.ts +66 -1
  619. package/src/index.ts +11 -4
  620. package/src/packageVersion.ts +1 -1
  621. package/src/shared-tree/serializedChange.ts +2 -2
  622. package/src/shared-tree/sharedTree.ts +40 -15
  623. package/src/shared-tree/sharedTreeChangeCodecs.ts +11 -3
  624. package/src/shared-tree/sharedTreeChangeFamily.ts +77 -2
  625. package/src/shared-tree/transactionMinimize.ts +7 -3
  626. package/src/shared-tree/transactionPostProcessor.ts +5 -1
  627. package/src/shared-tree/treeCheckout.ts +136 -30
  628. package/src/shared-tree-core/branch.ts +41 -12
  629. package/src/shared-tree-core/editManager.ts +46 -25
  630. package/src/shared-tree-core/editManagerCodecs.ts +9 -21
  631. package/src/shared-tree-core/editManagerCodecsCommons.ts +14 -2
  632. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +18 -21
  633. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +18 -20
  634. package/src/shared-tree-core/editManagerSummarizer.ts +9 -6
  635. package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -3
  636. package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -2
  637. package/src/shared-tree-core/messageCodecs.ts +12 -2
  638. package/src/shared-tree-core/sharedTreeCore.ts +16 -7
  639. package/src/shared-tree-core/transaction.ts +47 -25
  640. package/src/simple-tree/api/eraseSchemaDetails.ts +15 -0
  641. package/src/simple-tree/api/index.ts +0 -1
  642. package/src/simple-tree/api/schemaStatics.ts +2 -2
  643. package/src/simple-tree/api/treeNodeApi.ts +64 -48
  644. package/src/simple-tree/core/treeNode.ts +13 -10
  645. package/src/simple-tree/core/withType.ts +20 -7
  646. package/src/simple-tree/index.ts +1 -2
  647. package/src/simple-tree/leafNodeSchema.ts +6 -1
  648. package/src/simple-tree/node-kinds/array/arrayNode.ts +130 -16
  649. package/src/simple-tree/node-kinds/map/mapNode.ts +137 -5
  650. package/src/simple-tree/node-kinds/object/objectNode.ts +3 -3
  651. package/src/simple-tree/node-kinds/record/recordNode.ts +3 -3
  652. package/src/text/README.md +1 -1
  653. package/src/text/codePointUtils.ts +2 -2
  654. package/src/text/index.ts +3 -3
  655. package/src/text/textDomain.ts +50 -27
  656. package/src/text/textDomainFormatted.ts +384 -163
  657. package/src/text/textDomainFormattedDefault.ts +32 -32
  658. package/src/treeDataStore.ts +125 -0
  659. package/src/treeFactory.ts +11 -3
  660. package/src/util/compressedIds.ts +36 -3
@@ -3,30 +3,42 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { TreeNodeFromImplicitAllowedTypes, InsertableTreeNodeFromImplicitAllowedTypes } from "../simple-tree/index.js";
6
- import { FormattedTextAsTree } from "./textDomainFormatted.js";
6
+ import { FormattedText } from "./textDomainFormatted.js";
7
7
  /**
8
- * A collection of text related types, schema and utilities for working with text beyond the basic {@link SchemaStatics.string}.
8
+ * A default parameterization of the generic {@link FormattedText} with hard-coded assumptions about what kind of embedded content and what kind of formatting is supported.
9
9
  * @remarks
10
- * This is a default parameterization of the generic {@link FormattedTextAsTree} with hard-coded assumptions about what kind of embedded content and what kind of formatting is supported.
11
- * It is unlikely this meets the needs of most users, but it can serve as an unstable example of how to use the generic {@link FormattedTextAsTree}.
10
+ * It is unlikely this meets the needs of most users, but it can serve as an unstable example of how to use the generic {@link FormattedText}.
12
11
  * @internal
13
12
  */
14
- export declare namespace FormattedTextAsTreeDefault {
13
+ export declare namespace FormattedTextDefault {
15
14
  /**
16
15
  * Portion of a string with formatting.
17
16
  * @sealed
18
17
  * @internal
19
18
  */
20
- export type FormattedAtom = FormattedTextAsTree.FormattedAtom<CharacterFormat, StringAtomContent>;
21
- const CharacterFormat_base: import("../simple-tree/index.js").ObjectNodeSchemaWorkaround<"com.fluidframework.text.formatted.default.CharacterFormat", {
19
+ export type FormattedAtom = FormattedText.FormattedAtom<CharacterFormat, StringAtomContent>;
20
+ const CharacterFormat_base: import("../simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.text.formatted.default.CharacterFormat", import("../simple-tree/index.js").NodeKind.Object, import("../simple-tree/index.js").TreeObjectNode<{
22
21
  readonly bold: import("../simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>;
23
22
  readonly italic: import("../simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>;
24
23
  readonly underline: import("../simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>;
25
24
  readonly size: import("../simple-tree/leafNodeSchema.js").LeafSchema<"number", number>;
26
25
  readonly font: import("../simple-tree/leafNodeSchema.js").LeafSchema<"string", string>;
27
- }, true, unknown>;
26
+ }, "com.fluidframework.text.formatted.default.CharacterFormat">, object & {
27
+ readonly bold: boolean;
28
+ readonly italic: boolean;
29
+ readonly underline: boolean;
30
+ readonly size: number;
31
+ readonly font: string;
32
+ }, true, {
33
+ readonly bold: import("../simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>;
34
+ readonly italic: import("../simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>;
35
+ readonly underline: import("../simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>;
36
+ readonly size: import("../simple-tree/leafNodeSchema.js").LeafSchema<"number", number>;
37
+ readonly font: import("../simple-tree/leafNodeSchema.js").LeafSchema<"string", string>;
38
+ }, never, unknown>;
28
39
  /**
29
40
  * Formatting options for characters.
41
+ * @sealed
30
42
  * @internal
31
43
  */
32
44
  export class CharacterFormat extends CharacterFormat_base {
@@ -45,17 +57,17 @@ export declare namespace FormattedTextAsTreeDefault {
45
57
  h3: import("../simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.text.formatted.default.lineTag.h3" | "com.h3", import("../simple-tree/index.js").NodeKind.Object, import("../simple-tree/index.js").TreeNode & {
46
58
  readonly value: "h3";
47
59
  }, Record<string, never>, true, Record<string, never>, undefined>;
48
- codeBlock: import("../simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.text.formatted.default.lineTag.codeBlock" | "com.codeBlock", import("../simple-tree/index.js").NodeKind.Object, import("../simple-tree/index.js").TreeNode & {
49
- readonly value: "codeBlock";
50
- }, Record<string, never>, true, Record<string, never>, undefined>;
51
60
  h2: import("../simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.text.formatted.default.lineTag.h2" | "com.h2", import("../simple-tree/index.js").NodeKind.Object, import("../simple-tree/index.js").TreeNode & {
52
61
  readonly value: "h2";
53
62
  }, Record<string, never>, true, Record<string, never>, undefined>;
63
+ codeBlock: import("../simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.text.formatted.default.lineTag.codeBlock" | "com.codeBlock", import("../simple-tree/index.js").NodeKind.Object, import("../simple-tree/index.js").TreeNode & {
64
+ readonly value: "codeBlock";
65
+ }, Record<string, never>, true, Record<string, never>, undefined>;
54
66
  h4: import("../simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.text.formatted.default.lineTag.h4" | "com.h4", import("../simple-tree/index.js").NodeKind.Object, import("../simple-tree/index.js").TreeNode & {
55
67
  readonly value: "h4";
56
68
  }, Record<string, never>, true, Record<string, never>, undefined>;
57
- unchecked: import("../simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.text.formatted.default.lineTag.unchecked" | "com.unchecked", import("../simple-tree/index.js").NodeKind.Object, import("../simple-tree/index.js").TreeNode & {
58
- readonly value: "unchecked";
69
+ blockquote: import("../simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.text.formatted.default.lineTag.blockquote" | "com.blockquote", import("../simple-tree/index.js").NodeKind.Object, import("../simple-tree/index.js").TreeNode & {
70
+ readonly value: "blockquote";
59
71
  }, Record<string, never>, true, Record<string, never>, undefined>;
60
72
  h5: import("../simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.text.formatted.default.lineTag.h5" | "com.h5", import("../simple-tree/index.js").NodeKind.Object, import("../simple-tree/index.js").TreeNode & {
61
73
  readonly value: "h5";
@@ -69,8 +81,8 @@ export declare namespace FormattedTextAsTreeDefault {
69
81
  checked: import("../simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.text.formatted.default.lineTag.checked" | "com.checked", import("../simple-tree/index.js").NodeKind.Object, import("../simple-tree/index.js").TreeNode & {
70
82
  readonly value: "checked";
71
83
  }, Record<string, never>, true, Record<string, never>, undefined>;
72
- blockquote: import("../simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.text.formatted.default.lineTag.blockquote" | "com.blockquote", import("../simple-tree/index.js").NodeKind.Object, import("../simple-tree/index.js").TreeNode & {
73
- readonly value: "blockquote";
84
+ unchecked: import("../simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.text.formatted.default.lineTag.unchecked" | "com.unchecked", import("../simple-tree/index.js").NodeKind.Object, import("../simple-tree/index.js").TreeNode & {
85
+ readonly value: "unchecked";
74
86
  }, Record<string, never>, true, Record<string, never>, undefined>;
75
87
  } & {
76
88
  readonly schema: [import("../simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.text.formatted.default.lineTag.ol" | "com.ol", import("../simple-tree/index.js").NodeKind.Object, import("../simple-tree/index.js").TreeNode & {
@@ -98,7 +110,8 @@ export declare namespace FormattedTextAsTreeDefault {
98
110
  })];
99
111
  };
100
112
  /**
101
- * {@inheritdoc FormattedTextAsTreeDefault.(LineTag:variable)}
113
+ * {@inheritdoc FormattedTextDefault.(LineTag:variable)}
114
+ * @sealed
102
115
  * @internal
103
116
  */
104
117
  export type LineTag = TreeNodeFromImplicitAllowedTypes<typeof LineTag.schema>;
@@ -231,6 +244,7 @@ export declare namespace FormattedTextAsTreeDefault {
231
244
  * The optional indent level mirrors Quill's indent attribute,
232
245
  * which is applies to the line before the line break.
233
246
  * Any tagged line can be indented independently.
247
+ * @sealed
234
248
  * @internal
235
249
  */
236
250
  export class StringLineAtom extends StringLineAtom_base {
@@ -238,34 +252,43 @@ export declare namespace FormattedTextAsTreeDefault {
238
252
  }
239
253
  /**
240
254
  * Types of "atoms" that make up the text.
255
+ * @sealed
241
256
  * @internal
242
257
  */
243
- export const StringAtomContent: readonly [typeof FormattedTextAsTree.StringTextAtom, typeof StringLineAtom];
258
+ export const StringAtomContent: readonly [FormattedText.StringTextAtomStatics & import("../simple-tree/index.js").TreeNodeSchema<"com.fluidframework.text.formatted.StringTextAtom", import("../simple-tree/index.js").NodeKind, FormattedText.TextAtom & import("../simple-tree/index.js").TreeNode & import("../simple-tree/index.js").WithType<"com.fluidframework.text.formatted.StringTextAtom", import("../simple-tree/index.js").NodeKind, unknown>, never, false>, typeof StringLineAtom];
244
259
  /**
245
- * {@inheritdoc FormattedTextAsTreeDefault.(StringAtomContent:variable)}
260
+ * {@inheritdoc FormattedTextDefault.(StringAtomContent:variable)}
261
+ * @sealed
246
262
  * @internal
247
263
  */
248
264
  export type StringAtomContent = TreeNodeFromImplicitAllowedTypes<typeof StringAtomContent>;
249
265
  /**
250
266
  * Statics for text nodes.
267
+ * @sealed
251
268
  * @internal
252
269
  */
253
- export type Statics<TTree = Tree> = FormattedTextAsTree.Statics<TTree>;
270
+ export type Statics<TTree = Tree> = FormattedText.Statics<TTree, typeof CharacterFormat>;
254
271
  /**
255
- * Insertable shape for a formatted text atom used by {@link FormattedTextAsTree.Members.insertWithFormattingAt}.
272
+ * Insertable shape for a formatted text atom used by {@link FormattedText.Members.insertWithFormattingAt}.
273
+ * @sealed
256
274
  * @internal
257
275
  */
258
- export type FormattedAtomInsertable = FormattedTextAsTree.FormattedAtom<InsertableTreeNodeFromImplicitAllowedTypes<typeof CharacterFormat>, InsertableTreeNodeFromImplicitAllowedTypes<FormattedTextAtoms>>;
276
+ export type FormattedAtomInsertable = FormattedText.FormattedAtom<InsertableTreeNodeFromImplicitAllowedTypes<typeof CharacterFormat>, InsertableTreeNodeFromImplicitAllowedTypes<TextAtomSchemas>>;
259
277
  /**
260
278
  * Helper for expressing the full set of formatted text atoms for a given schema.
261
279
  * @privateRemarks
262
280
  * Eventually this should probably be given a better name and/or made a system type in a system namespace.
281
+ * @sealed
282
+ * @internal
283
+ */
284
+ export type TextAtomSchemas = FormattedText.TextAtomSchemas<[typeof StringLineAtom]>;
285
+ const Tree_base: FormattedText.FormattedTextSchema<"com.fluidframework.text.formatted.default", typeof CharacterFormat, readonly [typeof StringLineAtom]>;
286
+ /**
287
+ * The schema produced using {@link FormattedText.createSchema} with hard-coded assumptions
288
+ * about what kind of embedded content and what kind of formatting is supported.
289
+ * @sealed
263
290
  * @internal
264
291
  */
265
- export type FormattedTextAtoms = FormattedTextAsTree.FormattedTextAtoms<[
266
- typeof StringLineAtom
267
- ]>;
268
- const Tree_base: FormattedTextAsTree.FormattedTextSchema<"default", typeof CharacterFormat, readonly [typeof StringLineAtom]>;
269
292
  export class Tree extends Tree_base {
270
293
  }
271
294
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"textDomainFormattedDefault.d.ts","sourceRoot":"","sources":["../../src/text/textDomainFormattedDefault.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,KAAK,EACX,gCAAgC,EAChC,0CAA0C,EAC1C,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAe/D;;;;;;GAMG;AACH,yBAAiB,0BAA0B,CAAC;IAC3C;;;;OAIG;IACH,MAAM,MAAM,aAAa,GAAG,mBAAmB,CAAC,aAAa,CAC5D,eAAe,EACf,iBAAiB,CACjB,CAAC;;;;;;;;IAEF;;;OAGG;IACH,MAAM,OAAO,eAAgB,SAAQ,oBAMnC;QACD,gBAAuB,aAAa,kBAAsC;KAC1E;IAED;;;OAGG;IACH,MAAM,CAAC,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAYlB,CAAC;IACH;;;OAGG;IACH,MAAM,MAAM,OAAO,GAAG,gCAAgC,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAYlB,CAAC;IACH;;;;OAIG;IACH,MAAM,MAAM,OAAO,GAAG,gCAAgC,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAE9E;;;;;;;;;;;OAWG;IACH,MAAM,OAAO,cAAe,SAAQ,mBAGlC;QACD,SAAgB,OAAO,QAAQ;KAC/B;IAED;;;;OAIG;IACH,MAAM,CAAC,MAAM,iBAAiB,mcAA0D,CAAC;IACzF;;;;OAIG;IACH,MAAM,MAAM,iBAAiB,GAAG,gCAAgC,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAE3F;;;;OAIG;IACH,MAAM,MAAM,OAAO,CAAC,KAAK,GAAG,IAAI,IAAI,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,eAAe,CAAC,CAAC;IAEzF;;;;OAIG;IACH,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC,aAAa,CAChE,0CAA0C,CAAC,OAAO,eAAe,CAAC,EAClE,0CAA0C,CAAC,eAAe,CAAC,CAC3D,CAAC;IAEF;;;;;;OAMG;IACH,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC;;IAErF;;;;;OAKG;IACH,MAAM,OAAO,IAAK,SAAQ,SAKzB;KAAG;;CACJ"}
@@ -2,12 +2,12 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { enumFromStrings, SchemaFactory, SchemaFactoryAlpha, SchemaFactoryBeta, } from "../simple-tree/index.js";
6
- import { FormattedTextAsTree } from "./textDomainFormatted.js";
5
+ import { enumFromStrings, SchemaFactory, SchemaFactoryBeta } from "../simple-tree/index.js";
6
+ import { FormattedText } from "./textDomainFormatted.js";
7
7
  /**
8
8
  * Schema factory for default formatted text types which are not generic.
9
9
  */
10
- const sf = new SchemaFactoryAlpha("com.fluidframework.text.formatted.default");
10
+ const sf = new SchemaFactoryBeta("com.fluidframework.text.formatted.default");
11
11
  const defaultFormat = {
12
12
  bold: false,
13
13
  italic: false,
@@ -16,19 +16,19 @@ const defaultFormat = {
16
16
  font: "Arial",
17
17
  };
18
18
  /**
19
- * A collection of text related types, schema and utilities for working with text beyond the basic {@link SchemaStatics.string}.
19
+ * A default parameterization of the generic {@link FormattedText} with hard-coded assumptions about what kind of embedded content and what kind of formatting is supported.
20
20
  * @remarks
21
- * This is a default parameterization of the generic {@link FormattedTextAsTree} with hard-coded assumptions about what kind of embedded content and what kind of formatting is supported.
22
- * It is unlikely this meets the needs of most users, but it can serve as an unstable example of how to use the generic {@link FormattedTextAsTree}.
21
+ * It is unlikely this meets the needs of most users, but it can serve as an unstable example of how to use the generic {@link FormattedText}.
23
22
  * @internal
24
23
  */
25
- export var FormattedTextAsTreeDefault;
26
- (function (FormattedTextAsTreeDefault) {
24
+ export var FormattedTextDefault;
25
+ (function (FormattedTextDefault) {
27
26
  /**
28
27
  * Formatting options for characters.
28
+ * @sealed
29
29
  * @internal
30
30
  */
31
- class CharacterFormat extends sf.objectAlpha("CharacterFormat", {
31
+ class CharacterFormat extends sf.object("CharacterFormat", {
32
32
  bold: SchemaFactory.boolean,
33
33
  italic: SchemaFactory.boolean,
34
34
  underline: SchemaFactory.boolean,
@@ -37,12 +37,12 @@ export var FormattedTextAsTreeDefault;
37
37
  }) {
38
38
  }
39
39
  CharacterFormat.defaultFormat = new CharacterFormat(defaultFormat);
40
- FormattedTextAsTreeDefault.CharacterFormat = CharacterFormat;
40
+ FormattedTextDefault.CharacterFormat = CharacterFormat;
41
41
  /**
42
42
  * Tag with which a line in text can be formatted from HTML.
43
43
  * @internal
44
44
  */
45
- FormattedTextAsTreeDefault.LineTag = enumFromStrings(sf.scopedFactory("lineTag"), [
45
+ FormattedTextDefault.LineTag = enumFromStrings(sf.scopedFactory("lineTag"), [
46
46
  "h1",
47
47
  "h2",
48
48
  "h3",
@@ -64,10 +64,11 @@ export var FormattedTextAsTreeDefault;
64
64
  * The optional indent level mirrors Quill's indent attribute,
65
65
  * which is applies to the line before the line break.
66
66
  * Any tagged line can be indented independently.
67
+ * @sealed
67
68
  * @internal
68
69
  */
69
70
  class StringLineAtom extends sf.object("StringLineAtom", {
70
- tag: FormattedTextAsTreeDefault.LineTag.schema,
71
+ tag: FormattedTextDefault.LineTag.schema,
71
72
  indent: SchemaFactory.number,
72
73
  }) {
73
74
  constructor() {
@@ -75,17 +76,21 @@ export var FormattedTextAsTreeDefault;
75
76
  this.content = "\n";
76
77
  }
77
78
  }
78
- FormattedTextAsTreeDefault.StringLineAtom = StringLineAtom;
79
+ FormattedTextDefault.StringLineAtom = StringLineAtom;
79
80
  /**
80
81
  * Types of "atoms" that make up the text.
82
+ * @sealed
81
83
  * @internal
82
84
  */
83
- FormattedTextAsTreeDefault.StringAtomContent = [
84
- FormattedTextAsTree.StringTextAtom,
85
- StringLineAtom,
86
- ];
87
- class Tree extends FormattedTextAsTree.createSchema(new SchemaFactoryBeta("default"), CharacterFormat, [StringLineAtom], defaultFormat) {
85
+ FormattedTextDefault.StringAtomContent = [FormattedText.StringTextAtom, StringLineAtom];
86
+ /**
87
+ * The schema produced using {@link FormattedText.createSchema} with hard-coded assumptions
88
+ * about what kind of embedded content and what kind of formatting is supported.
89
+ * @sealed
90
+ * @internal
91
+ */
92
+ class Tree extends FormattedText.createSchema(sf, CharacterFormat, [StringLineAtom], defaultFormat) {
88
93
  }
89
- FormattedTextAsTreeDefault.Tree = Tree;
90
- })(FormattedTextAsTreeDefault || (FormattedTextAsTreeDefault = {}));
94
+ FormattedTextDefault.Tree = Tree;
95
+ })(FormattedTextDefault || (FormattedTextDefault = {}));
91
96
  //# sourceMappingURL=textDomainFormattedDefault.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"textDomainFormattedDefault.js","sourceRoot":"","sources":["../../src/text/textDomainFormattedDefault.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,iBAAiB,GACjB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;GAEG;AACH,MAAM,EAAE,GAAG,IAAI,kBAAkB,CAAC,2CAA2C,CAAC,CAAC;AAE/E,MAAM,aAAa,GAAG;IACrB,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,KAAK;IAChB,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,OAAO;CACJ,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,KAAW,0BAA0B,CA+G1C;AA/GD,WAAiB,0BAA0B;IAW1C;;;OAGG;IACH,MAAa,eAAgB,SAAQ,EAAE,CAAC,WAAW,CAAC,iBAAiB,EAAE;QACtE,IAAI,EAAE,aAAa,CAAC,OAAO;QAC3B,MAAM,EAAE,aAAa,CAAC,OAAO;QAC7B,SAAS,EAAE,aAAa,CAAC,OAAO;QAChC,IAAI,EAAE,aAAa,CAAC,MAAM;QAC1B,IAAI,EAAE,aAAa,CAAC,MAAM;KAC1B,CAAC;;IACsB,6BAAa,GAAG,IAAI,eAAe,CAAC,aAAa,CAAC,CAAC;IAP9D,0CAAe,kBAQ3B,CAAA;IAED;;;OAGG;IACU,kCAAO,GAAG,eAAe,CAAC,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE;QACnE,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,SAAS;QACT,WAAW;QACX,YAAY;QACZ,WAAW;KACX,CAAC,CAAC;IAOH;;;;;;;;;;OAUG;IACH,MAAa,cAAe,SAAQ,EAAE,CAAC,MAAM,CAAC,gBAAgB,EAAE;QAC/D,GAAG,EAAE,2BAAA,OAAO,CAAC,MAAM;QACnB,MAAM,EAAE,aAAa,CAAC,MAAM;KAC5B,CAAC;QAHF;;YAIiB,YAAO,GAAG,IAAI,CAAC;QAChC,CAAC;KAAA;IALY,yCAAc,iBAK1B,CAAA;IAED;;;OAGG;IACU,4CAAiB,GAAG;QAChC,mBAAmB,CAAC,cAAc;QAClC,cAAc;KACL,CAAC;IAgCX,MAAa,IAAK,SAAQ,mBAAmB,CAAC,YAAY,CACzD,IAAI,iBAAiB,CAAC,SAAS,CAAC,EAChC,eAAe,EACf,CAAC,cAAc,CAAC,EAChB,aAAa,CACb;KAAG;IALS,+BAAI,OAKb,CAAA;AACL,CAAC,EA/GgB,0BAA0B,KAA1B,0BAA0B,QA+G1C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tenumFromStrings,\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\tSchemaFactoryBeta,\n} from \"../simple-tree/index.js\";\nimport type {\n\tTreeNodeFromImplicitAllowedTypes,\n\tInsertableTreeNodeFromImplicitAllowedTypes,\n} from \"../simple-tree/index.js\";\n\nimport { FormattedTextAsTree } from \"./textDomainFormatted.js\";\n\n/**\n * Schema factory for default formatted text types which are not generic.\n */\nconst sf = new SchemaFactoryAlpha(\"com.fluidframework.text.formatted.default\");\n\nconst defaultFormat = {\n\tbold: false,\n\titalic: false,\n\tunderline: false,\n\tsize: 12,\n\tfont: \"Arial\",\n} as const;\n\n/**\n * A collection of text related types, schema and utilities for working with text beyond the basic {@link SchemaStatics.string}.\n * @remarks\n * This is a default parameterization of the generic {@link FormattedTextAsTree} with hard-coded assumptions about what kind of embedded content and what kind of formatting is supported.\n * It is unlikely this meets the needs of most users, but it can serve as an unstable example of how to use the generic {@link FormattedTextAsTree}.\n * @internal\n */\nexport namespace FormattedTextAsTreeDefault {\n\t/**\n\t * Portion of a string with formatting.\n\t * @sealed\n\t * @internal\n\t */\n\texport type FormattedAtom = FormattedTextAsTree.FormattedAtom<\n\t\tCharacterFormat,\n\t\tStringAtomContent\n\t>;\n\n\t/**\n\t * Formatting options for characters.\n\t * @internal\n\t */\n\texport class CharacterFormat extends sf.objectAlpha(\"CharacterFormat\", {\n\t\tbold: SchemaFactory.boolean,\n\t\titalic: SchemaFactory.boolean,\n\t\tunderline: SchemaFactory.boolean,\n\t\tsize: SchemaFactory.number,\n\t\tfont: SchemaFactory.string,\n\t}) {\n\t\tpublic static readonly defaultFormat = new CharacterFormat(defaultFormat);\n\t}\n\n\t/**\n\t * Tag with which a line in text can be formatted from HTML.\n\t * @internal\n\t */\n\texport const LineTag = enumFromStrings(sf.scopedFactory(\"lineTag\"), [\n\t\t\"h1\",\n\t\t\"h2\",\n\t\t\"h3\",\n\t\t\"h4\",\n\t\t\"h5\",\n\t\t\"li\",\n\t\t\"ol\",\n\t\t\"checked\",\n\t\t\"unchecked\",\n\t\t\"blockquote\",\n\t\t\"codeBlock\",\n\t]);\n\t/**\n\t * {@inheritdoc FormattedTextAsTreeDefault.(LineTag:variable)}\n\t * @internal\n\t */\n\texport type LineTag = TreeNodeFromImplicitAllowedTypes<typeof LineTag.schema>;\n\n\t/**\n\t * Unit in the string representing a new line character with line formatting.\n\t * @remarks\n\t * This aligns with how Quill represents line formatting.\n\t * Quill formats line attributes (headers, list, blockquote, etc... ) on the newline character\n\t * and only lines using this atom can have line-specific formatting.\n\t * The optional indent level mirrors Quill's indent attribute,\n\t * which is applies to the line before the line break.\n\t * Any tagged line can be indented independently.\n\t * @internal\n\t */\n\texport class StringLineAtom extends sf.object(\"StringLineAtom\", {\n\t\ttag: LineTag.schema,\n\t\tindent: SchemaFactory.number,\n\t}) {\n\t\tpublic readonly content = \"\\n\";\n\t}\n\n\t/**\n\t * Types of \"atoms\" that make up the text.\n\t * @internal\n\t */\n\texport const StringAtomContent = [\n\t\tFormattedTextAsTree.StringTextAtom,\n\t\tStringLineAtom,\n\t] as const;\n\t/**\n\t * {@inheritdoc FormattedTextAsTreeDefault.(StringAtomContent:variable)}\n\t * @internal\n\t */\n\texport type StringAtomContent = TreeNodeFromImplicitAllowedTypes<typeof StringAtomContent>;\n\n\t/**\n\t * Statics for text nodes.\n\t * @internal\n\t */\n\texport type Statics<TTree = Tree> = FormattedTextAsTree.Statics<TTree>;\n\n\t/**\n\t * Insertable shape for a formatted text atom used by {@link FormattedTextAsTree.Members.insertWithFormattingAt}.\n\t * @internal\n\t */\n\texport type FormattedAtomInsertable = FormattedTextAsTree.FormattedAtom<\n\t\tInsertableTreeNodeFromImplicitAllowedTypes<typeof CharacterFormat>,\n\t\tInsertableTreeNodeFromImplicitAllowedTypes<FormattedTextAtoms>\n\t>;\n\n\t/**\n\t * Helper for expressing the full set of formatted text atoms for a given schema.\n\t * @privateRemarks\n\t * Eventually this should probably be given a better name and/or made a system type in a system namespace.\n\t * @internal\n\t */\n\texport type FormattedTextAtoms = FormattedTextAsTree.FormattedTextAtoms<\n\t\t[typeof StringLineAtom]\n\t>;\n\n\texport class Tree extends FormattedTextAsTree.createSchema(\n\t\tnew SchemaFactoryBeta(\"default\"),\n\t\tCharacterFormat,\n\t\t[StringLineAtom],\n\t\tdefaultFormat,\n\t) {}\n}\n"]}
1
+ {"version":3,"file":"textDomainFormattedDefault.js","sourceRoot":"","sources":["../../src/text/textDomainFormattedDefault.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAM5F,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;GAEG;AACH,MAAM,EAAE,GAAG,IAAI,iBAAiB,CAAC,2CAA2C,CAAC,CAAC;AAE9E,MAAM,aAAa,GAAG;IACrB,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,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;AACL,CAAC,EArHgB,oBAAoB,KAApB,oBAAoB,QAqHpC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { enumFromStrings, SchemaFactory, SchemaFactoryBeta } from \"../simple-tree/index.js\";\nimport type {\n\tTreeNodeFromImplicitAllowedTypes,\n\tInsertableTreeNodeFromImplicitAllowedTypes,\n} from \"../simple-tree/index.js\";\n\nimport { FormattedText } from \"./textDomainFormatted.js\";\n\n/**\n * Schema factory for default formatted text types which are not generic.\n */\nconst sf = new SchemaFactoryBeta(\"com.fluidframework.text.formatted.default\");\n\nconst defaultFormat = {\n\tbold: false,\n\titalic: false,\n\tunderline: false,\n\tsize: 12,\n\tfont: \"Arial\",\n} as const;\n\n/**\n * A default parameterization of the generic {@link FormattedText} with hard-coded assumptions about what kind of embedded content and what kind of formatting is supported.\n * @remarks\n * It is unlikely this meets the needs of most users, but it can serve as an unstable example of how to use the generic {@link FormattedText}.\n * @internal\n */\nexport namespace FormattedTextDefault {\n\t/**\n\t * Portion of a string with formatting.\n\t * @sealed\n\t * @internal\n\t */\n\texport type FormattedAtom = FormattedText.FormattedAtom<CharacterFormat, StringAtomContent>;\n\n\t/**\n\t * Formatting options for characters.\n\t * @sealed\n\t * @internal\n\t */\n\texport class CharacterFormat extends sf.object(\"CharacterFormat\", {\n\t\tbold: SchemaFactory.boolean,\n\t\titalic: SchemaFactory.boolean,\n\t\tunderline: SchemaFactory.boolean,\n\t\tsize: SchemaFactory.number,\n\t\tfont: SchemaFactory.string,\n\t}) {\n\t\tpublic static readonly defaultFormat = new CharacterFormat(defaultFormat);\n\t}\n\n\t/**\n\t * Tag with which a line in text can be formatted from HTML.\n\t * @internal\n\t */\n\texport const LineTag = enumFromStrings(sf.scopedFactory(\"lineTag\"), [\n\t\t\"h1\",\n\t\t\"h2\",\n\t\t\"h3\",\n\t\t\"h4\",\n\t\t\"h5\",\n\t\t\"li\",\n\t\t\"ol\",\n\t\t\"checked\",\n\t\t\"unchecked\",\n\t\t\"blockquote\",\n\t\t\"codeBlock\",\n\t]);\n\t/**\n\t * {@inheritdoc FormattedTextDefault.(LineTag:variable)}\n\t * @sealed\n\t * @internal\n\t */\n\texport type LineTag = TreeNodeFromImplicitAllowedTypes<typeof LineTag.schema>;\n\n\t/**\n\t * Unit in the string representing a new line character with line formatting.\n\t * @remarks\n\t * This aligns with how Quill represents line formatting.\n\t * Quill formats line attributes (headers, list, blockquote, etc... ) on the newline character\n\t * and only lines using this atom can have line-specific formatting.\n\t * The optional indent level mirrors Quill's indent attribute,\n\t * which is applies to the line before the line break.\n\t * Any tagged line can be indented independently.\n\t * @sealed\n\t * @internal\n\t */\n\texport class StringLineAtom extends sf.object(\"StringLineAtom\", {\n\t\ttag: LineTag.schema,\n\t\tindent: SchemaFactory.number,\n\t}) {\n\t\tpublic readonly content = \"\\n\";\n\t}\n\n\t/**\n\t * Types of \"atoms\" that make up the text.\n\t * @sealed\n\t * @internal\n\t */\n\texport const StringAtomContent = [FormattedText.StringTextAtom, StringLineAtom] as const;\n\t/**\n\t * {@inheritdoc FormattedTextDefault.(StringAtomContent:variable)}\n\t * @sealed\n\t * @internal\n\t */\n\texport type StringAtomContent = TreeNodeFromImplicitAllowedTypes<typeof StringAtomContent>;\n\n\t/**\n\t * Statics for text nodes.\n\t * @sealed\n\t * @internal\n\t */\n\texport type Statics<TTree = Tree> = FormattedText.Statics<TTree, typeof CharacterFormat>;\n\n\t/**\n\t * Insertable shape for a formatted text atom used by {@link FormattedText.Members.insertWithFormattingAt}.\n\t * @sealed\n\t * @internal\n\t */\n\texport type FormattedAtomInsertable = FormattedText.FormattedAtom<\n\t\tInsertableTreeNodeFromImplicitAllowedTypes<typeof CharacterFormat>,\n\t\tInsertableTreeNodeFromImplicitAllowedTypes<TextAtomSchemas>\n\t>;\n\n\t/**\n\t * Helper for expressing the full set of formatted text atoms for a given schema.\n\t * @privateRemarks\n\t * Eventually this should probably be given a better name and/or made a system type in a system namespace.\n\t * @sealed\n\t * @internal\n\t */\n\texport type TextAtomSchemas = FormattedText.TextAtomSchemas<[typeof StringLineAtom]>;\n\n\t/**\n\t * The schema produced using {@link FormattedText.createSchema} with hard-coded assumptions\n\t * about what kind of embedded content and what kind of formatting is supported.\n\t * @sealed\n\t * @internal\n\t */\n\texport class Tree extends FormattedText.createSchema(\n\t\tsf,\n\t\tCharacterFormat,\n\t\t[StringLineAtom],\n\t\tdefaultFormat,\n\t) {}\n}\n"]}
@@ -0,0 +1,49 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { IFluidLoadable } from "@fluidframework/core-interfaces";
6
+ import type { DataStoreKind } from "@fluidframework/driver-definitions/internal";
7
+ import type { SharedObjectCreator, SharedObjectKey, SharedObjectRegistry, SharedObjectKindAlpha, DataStoreOptions } from "@fluidframework/shared-object-base/internal";
8
+ import type { ImplicitFieldSchema, InsertableTreeFieldFromImplicitField, ITree, TreeView, TreeViewConfiguration } from "./simple-tree/index.js";
9
+ /**
10
+ * Options for {@link defineTreeDataStore}.
11
+ * @input
12
+ * @alpha
13
+ */
14
+ export interface TreeDataStoreOptions<TSchema extends ImplicitFieldSchema> extends Pick<DataStoreOptions<never, never>, "type"> {
15
+ /**
16
+ * Configuration for the tree view to be used in this data store.
17
+ */
18
+ readonly config: TreeViewConfiguration<TSchema>;
19
+ /**
20
+ * If provided, used to initialize the tree content when creating a new instance of the data store.
21
+ */
22
+ readonly initializer?: (creator: SharedObjectCreator) => InsertableTreeFieldFromImplicitField<TSchema>;
23
+ /**
24
+ * If provided, must include at least a SharedTree kind in the registry.
25
+ * @remarks
26
+ * {@link configuredSharedTree} can be used to customize the SharedTree kind used in the registry.
27
+ */
28
+ readonly registry?: Iterable<SharedObjectKindAlpha<IFluidLoadable>> | SharedObjectRegistry;
29
+ readonly key?: SharedObjectKey<ITree>;
30
+ }
31
+ /**
32
+ * Defines a {@link @fluidframework/driver-definitions#DataStoreKind} for a simple tree data store.
33
+ * @remarks
34
+ * This is a simple tree specific wrapper around {@link @fluidframework/shared-object-base#defineDataStore}.
35
+ * Use {@link @fluidframework/shared-object-base#defineDataStore} directly if more control is needed, even if still just using tree.
36
+ *
37
+ * This uses {@link instantiateTreeFirstTime} to create the tree, and optionally initialize it.
38
+ * @alpha
39
+ */
40
+ export declare function defineTreeDataStore<const TSchema extends ImplicitFieldSchema>(options: TreeDataStoreOptions<TSchema>): DataStoreKind<TreeView<TSchema>>;
41
+ /**
42
+ * Simple tree instantiation helper.
43
+ * @remarks
44
+ * This is used by {@link defineTreeDataStore}, but can also be used in custom data stores with {@link @fluidframework/shared-object-base#defineDataStore}.
45
+ * Typically used to implement {@link @fluidframework/shared-object-base#DataStoreOptions.instantiateFirstTime} to create the tree and optionally initialize it.
46
+ * @alpha
47
+ */
48
+ export declare function instantiateTreeFirstTime<TSchema extends ImplicitFieldSchema>(rootCreator: SharedObjectCreator, creator: SharedObjectCreator, treeKind: SharedObjectKey<ITree>, options: Pick<TreeDataStoreOptions<TSchema>, "config" | "initializer">): Promise<ITree>;
49
+ //# sourceMappingURL=treeDataStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeDataStore.d.ts","sourceRoot":"","sources":["../src/treeDataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,KAAK,EACX,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,MAAM,6CAA6C,CAAC;AAMrD,OAAO,KAAK,EACX,mBAAmB,EACnB,oCAAoC,EACpC,KAAK,EACL,QAAQ,EACR,qBAAqB,EACrB,MAAM,wBAAwB,CAAC;AAGhC;;;;GAIG;AACH,MAAM,WAAW,oBAAoB,CAAC,OAAO,SAAS,mBAAmB,CACxE,SAAQ,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IACpD;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAEhD;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,CACtB,OAAO,EAAE,mBAAmB,KACxB,oCAAoC,CAAC,OAAO,CAAC,CAAC;IAEnD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,qBAAqB,CAAC,cAAc,CAAC,CAAC,GAAG,oBAAoB,CAAC;IAE3F,QAAQ,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;CACtC;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,OAAO,SAAS,mBAAmB,EAC5E,OAAO,EAAE,oBAAoB,CAAC,OAAO,CAAC,GACpC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CA0BlC;AAED;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,SAAS,mBAAmB,EACjF,WAAW,EAAE,mBAAmB,EAChC,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,eAAe,CAAC,KAAK,CAAC,EAChC,OAAO,EAAE,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC,GACpE,OAAO,CAAC,KAAK,CAAC,CAIhB"}
@@ -0,0 +1,52 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { sharedObjectRegistryFromIterable, defineDataStore, } from "@fluidframework/shared-object-base/internal";
6
+ import { SharedTreeAlpha } from "./treeFactory.js";
7
+ /**
8
+ * Defines a {@link @fluidframework/driver-definitions#DataStoreKind} for a simple tree data store.
9
+ * @remarks
10
+ * This is a simple tree specific wrapper around {@link @fluidframework/shared-object-base#defineDataStore}.
11
+ * Use {@link @fluidframework/shared-object-base#defineDataStore} directly if more control is needed, even if still just using tree.
12
+ *
13
+ * This uses {@link instantiateTreeFirstTime} to create the tree, and optionally initialize it.
14
+ * @alpha
15
+ */
16
+ export function defineTreeDataStore(options) {
17
+ const registry = typeof options.registry === "function"
18
+ ? options.registry
19
+ : sharedObjectRegistryFromIterable([...(options.registry ?? [SharedTreeAlpha])]);
20
+ const result = defineDataStore({
21
+ type: options.type,
22
+ registry,
23
+ async instantiateFirstTime(rootCreator, creator) {
24
+ return instantiateTreeFirstTime(rootCreator, creator, options.key ?? SharedTreeAlpha, options);
25
+ },
26
+ async view(tree) {
27
+ const view = tree.viewWith(options.config);
28
+ return view;
29
+ },
30
+ });
31
+ return result;
32
+ }
33
+ /**
34
+ * Simple tree instantiation helper.
35
+ * @remarks
36
+ * This is used by {@link defineTreeDataStore}, but can also be used in custom data stores with {@link @fluidframework/shared-object-base#defineDataStore}.
37
+ * Typically used to implement {@link @fluidframework/shared-object-base#DataStoreOptions.instantiateFirstTime} to create the tree and optionally initialize it.
38
+ * @alpha
39
+ */
40
+ export async function instantiateTreeFirstTime(rootCreator, creator, treeKind, options) {
41
+ const tree = await rootCreator.createSharedObject(treeKind);
42
+ initializeTreeFirstTime(tree, options, creator);
43
+ return tree;
44
+ }
45
+ function initializeTreeFirstTime(tree, options, creator) {
46
+ if (options.initializer !== undefined) {
47
+ const view = tree.viewWith(options.config);
48
+ view.initialize(options.initializer(creator));
49
+ view.dispose();
50
+ }
51
+ }
52
+ //# sourceMappingURL=treeDataStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeDataStore.js","sourceRoot":"","sources":["../src/treeDataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EACN,gCAAgC,EAChC,eAAe,GACf,MAAM,6CAA6C,CAAC;AASrD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AA+BnD;;;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OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport type { DataStoreKind } from \"@fluidframework/driver-definitions/internal\";\nimport type {\n\tSharedObjectCreator,\n\tSharedObjectKey,\n\tSharedObjectRegistry,\n\tSharedObjectKindAlpha,\n\tDataStoreOptions,\n} from \"@fluidframework/shared-object-base/internal\";\nimport {\n\tsharedObjectRegistryFromIterable,\n\tdefineDataStore,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport type {\n\tImplicitFieldSchema,\n\tInsertableTreeFieldFromImplicitField,\n\tITree,\n\tTreeView,\n\tTreeViewConfiguration,\n} from \"./simple-tree/index.js\";\nimport { SharedTreeAlpha } from \"./treeFactory.js\";\n\n/**\n * Options for {@link defineTreeDataStore}.\n * @input\n * @alpha\n */\nexport interface TreeDataStoreOptions<TSchema extends ImplicitFieldSchema>\n\textends Pick<DataStoreOptions<never, never>, \"type\"> {\n\t/**\n\t * Configuration for the tree view to be used in this data store.\n\t */\n\treadonly config: TreeViewConfiguration<TSchema>;\n\n\t/**\n\t * If provided, used to initialize the tree content when creating a new instance of the data store.\n\t */\n\treadonly initializer?: (\n\t\tcreator: SharedObjectCreator,\n\t) => InsertableTreeFieldFromImplicitField<TSchema>;\n\n\t/**\n\t * If provided, must include at least a SharedTree kind in the registry.\n\t * @remarks\n\t * {@link configuredSharedTree} can be used to customize the SharedTree kind used in the registry.\n\t */\n\treadonly registry?: Iterable<SharedObjectKindAlpha<IFluidLoadable>> | SharedObjectRegistry;\n\n\treadonly key?: SharedObjectKey<ITree>;\n}\n\n/**\n * Defines a {@link @fluidframework/driver-definitions#DataStoreKind} for a simple tree data store.\n * @remarks\n * This is a simple tree specific wrapper around {@link @fluidframework/shared-object-base#defineDataStore}.\n * Use {@link @fluidframework/shared-object-base#defineDataStore} directly if more control is needed, even if still just using tree.\n *\n * This uses {@link instantiateTreeFirstTime} to create the tree, and optionally initialize it.\n * @alpha\n */\nexport function defineTreeDataStore<const TSchema extends ImplicitFieldSchema>(\n\toptions: TreeDataStoreOptions<TSchema>,\n): DataStoreKind<TreeView<TSchema>> {\n\tconst registry: SharedObjectRegistry =\n\t\ttypeof options.registry === \"function\"\n\t\t\t? options.registry\n\t\t\t: sharedObjectRegistryFromIterable([...(options.registry ?? [SharedTreeAlpha])]);\n\n\tconst result = defineDataStore<TreeView<TSchema>, ITree>({\n\t\ttype: options.type,\n\t\tregistry,\n\t\tasync instantiateFirstTime(\n\t\t\trootCreator: SharedObjectCreator,\n\t\t\tcreator: SharedObjectCreator,\n\t\t): Promise<ITree> {\n\t\t\treturn instantiateTreeFirstTime(\n\t\t\t\trootCreator,\n\t\t\t\tcreator,\n\t\t\t\toptions.key ?? SharedTreeAlpha,\n\t\t\t\toptions,\n\t\t\t);\n\t\t},\n\t\tasync view(tree): Promise<TreeView<TSchema>> {\n\t\t\tconst view = tree.viewWith(options.config);\n\t\t\treturn view;\n\t\t},\n\t});\n\treturn result;\n}\n\n/**\n * Simple tree instantiation helper.\n * @remarks\n * This is used by {@link defineTreeDataStore}, but can also be used in custom data stores with {@link @fluidframework/shared-object-base#defineDataStore}.\n * Typically used to implement {@link @fluidframework/shared-object-base#DataStoreOptions.instantiateFirstTime} to create the tree and optionally initialize it.\n * @alpha\n */\nexport async function instantiateTreeFirstTime<TSchema extends ImplicitFieldSchema>(\n\trootCreator: SharedObjectCreator,\n\tcreator: SharedObjectCreator,\n\ttreeKind: SharedObjectKey<ITree>,\n\toptions: Pick<TreeDataStoreOptions<TSchema>, \"config\" | \"initializer\">,\n): Promise<ITree> {\n\tconst tree = await rootCreator.createSharedObject(treeKind);\n\tinitializeTreeFirstTime(tree, options, creator);\n\treturn tree;\n}\n\nfunction initializeTreeFirstTime<TSchema extends ImplicitFieldSchema>(\n\ttree: ITree,\n\toptions: Pick<TreeDataStoreOptions<TSchema>, \"config\" | \"initializer\">,\n\tcreator: SharedObjectCreator,\n): void {\n\tif (options.initializer !== undefined) {\n\t\tconst view = tree.viewWith(options.config);\n\t\tview.initialize(options.initializer(creator));\n\t\tview.dispose();\n\t}\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { SharedObjectKind } from "@fluidframework/shared-object-base";
6
- import { type ISharedObject, type ISharedObjectKind } from "@fluidframework/shared-object-base/internal";
6
+ import { type ISharedObject, type ISharedObjectKind, type SharedObjectKindAlpha } from "@fluidframework/shared-object-base/internal";
7
7
  import { type ITreePrivate, type SharedTreeOptions, type SharedTreeOptionsBeta, type SharedTreeOptionsInternal } from "./shared-tree/index.js";
8
8
  import type { ITree } from "./simple-tree/index.js";
9
9
  /**
@@ -19,6 +19,11 @@ export interface ISharedTree extends ISharedObject, ITreePrivate {
19
19
  * @legacy @beta
20
20
  */
21
21
  export declare const SharedTree: ISharedObjectKind<ITree> & SharedObjectKind<ITree>;
22
+ /**
23
+ * {@link SharedTree} but without legacy types, and with alpha types.
24
+ * @alpha
25
+ */
26
+ export declare const SharedTreeAlpha: SharedObjectKindAlpha<ITree>;
22
27
  /**
23
28
  * {@link SharedTree} but allowing a non-default configuration.
24
29
  * @remarks
@@ -78,7 +83,7 @@ export declare function configuredSharedTreeAlpha(options: SharedTreeOptions): S
78
83
  * This should be renamed to `configuredSharedTreeAlpha` to avoid colliding with the eventual public version which will have less options.
79
84
  * @internal
80
85
  */
81
- export declare function configuredSharedTree(options: SharedTreeOptions): ISharedObjectKind<ITree> & SharedObjectKind<ITree>;
82
- export declare function configuredSharedTreeInternal(options: SharedTreeOptionsInternal): ISharedObjectKind<ITree> & SharedObjectKind<ITree>;
86
+ export declare function configuredSharedTree(options: SharedTreeOptions): ISharedObjectKind<ITree> & SharedObjectKindAlpha<ITree>;
87
+ export declare function configuredSharedTreeInternal(options: SharedTreeOptionsInternal): ISharedObjectKind<ITree> & SharedObjectKindAlpha<ITree>;
83
88
  export declare function resolveOptions(options: SharedTreeOptions): SharedTreeOptionsInternal;
84
89
  //# sourceMappingURL=treeFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"treeFactory.d.ts","sourceRoot":"","sources":["../src/treeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAMtB,MAAM,6CAA6C,CAAC;AAQrD,OAAO,EAEN,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAE9B,MAAM,wBAAwB,CAAC;AAQhC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAGpD;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,aAAa,EAAE,YAAY;CAAG;AA8DnE;;;;GAIG;AACH,eAAO,MAAM,UAAU,oDAA2B,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,qBAAqB,GAC5B,gBAAgB,CAAC,KAAK,CAAC,CAEzB;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC7C,OAAO,EAAE,qBAAqB,GAC5B,iBAAiB,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAEpD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACxC,OAAO,EAAE,iBAAiB,GACxB,gBAAgB,CAAC,KAAK,CAAC,CAEzB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,iBAAiB,GACxB,iBAAiB,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAGpD;AAED,wB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CAEzB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,iBAAiB,GACxB,iBAAiB,CAAC,KAAK,CAAC,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAGzD;AAED,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,yBAAyB,GAChC,iBAAiB,CAAC,KAAK,CAAC,GAAG,qBAAqB,CAAC,KAAK,CAAC,CASzD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,iBAAiB,GAAG,yBAAyB,CAQpF"}
@@ -54,6 +54,11 @@ function treeKernelFactory(options) {
54
54
  * @legacy @beta
55
55
  */
56
56
  export const SharedTree = configuredSharedTree({});
57
+ /**
58
+ * {@link SharedTree} but without legacy types, and with alpha types.
59
+ * @alpha
60
+ */
61
+ export const SharedTreeAlpha = configuredSharedTree({});
57
62
  /**
58
63
  * {@link SharedTree} but allowing a non-default configuration.
59
64
  * @remarks
@@ -1 +1 @@
1
- {"version":3,"file":"treeFactory.js","sourceRoot":"","sources":["../src/treeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAGN,oBAAoB,GAKpB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAsB,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EACN,8BAA8B,EAC9B,+BAA+B,GAC/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,gBAAgB,GAMhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAExF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAS1D;;;;;GAKG;AACH,SAAS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;AACjB,CAAC;AAED,SAAS,oBAAoB,CAAC,OAA0B;IACvD,MAAM,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,IAAI,KAAK,CAAC;IAEnE,IAAI,oBAAoB,EAAE,CAAC;QAC1B,OAAO,qBAAqB,CAAC;IAC9B,CAAC;IAED,OAAO,EAAE,CAAC;AACX,CAAC;AAED,MAAM,qBAAqB,GAA8B;IACxD,qBAAqB,EAAE,IAAI,GAAG,CAAwB;QACrD,CAAC,oBAAoB,EAAE,wBAAwB,CAAC,eAAe,CAAC;QAChE,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,eAAe,CAAC;QACxD,CAAC,8BAA8B,CAAC,IAAI,EAAE,+BAA+B,CAAC,EAAE,CAAC;KACzE,CAAC;IACF,8CAA8C,EAAE,IAAI;CACpD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nimport {\n\ttype ISharedObject,\n\ttype ISharedObjectKind,\n\tmakeSharedObjectKind,\n\ttype KernelArgs,\n\ttype SharedKernelFactory,\n\ttype SharedObjectOptions,\n\ttype FactoryOut,\n} from \"@fluidframework/shared-object-base/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { FluidClientVersion, type FormatVersion } from \"./codec/index.js\";\nimport {\n\tdetachedFieldIndexCodecBuilder,\n\tDetachedFieldIndexFormatVersion,\n} from \"./core/index.js\";\nimport {\n\tSharedTreeKernel,\n\ttype ITreePrivate,\n\ttype SharedTreeOptions,\n\ttype SharedTreeOptionsBeta,\n\ttype SharedTreeOptionsInternal,\n\ttype SharedTreeKernelView,\n} from \"./shared-tree/index.js\";\nimport {\n\teditManagerCodecName,\n\tEditManagerFormatVersion,\n\tmessageCodecName,\n\tMessageFormatVersion,\n} from \"./shared-tree-core/index.js\";\nimport { SharedTreeFactoryType, SharedTreeAttributes } from \"./sharedTreeAttributes.js\";\nimport type { ITree } from \"./simple-tree/index.js\";\nimport { Breakable, copyProperty } from \"./util/index.js\";\n\n/**\n * {@link ITreePrivate} extended with ISharedObject.\n * @remarks\n * This is used when integration testing this package with the Fluid runtime as it exposes the APIs the runtime consumes to manipulate the tree.\n */\nexport interface ISharedTree extends ISharedObject, ITreePrivate {}\n\n/**\n * Creates a factory for shared tree kernels with the given options.\n * @remarks\n * Exposes {@link ITreePrivate} to allow access to internals in tests without a cast.\n * Code exposing this beyond this package will need to update to a more public type.\n */\nfunction treeKernelFactory(\n\toptions: SharedTreeOptionsInternal,\n): SharedKernelFactory<SharedTreeKernelView> {\n\tfunction treeFromKernelArgs(args: KernelArgs): SharedTreeKernel {\n\t\tif (args.idCompressor === undefined) {\n\t\t\tthrow new UsageError(\"IdCompressor must be enabled to use SharedTree\");\n\t\t}\n\n\t\tconst { minVersionForCollab, ...otherOptions } = options;\n\n\t\tconst adjustedOptions = {\n\t\t\t...otherOptions,\n\t\t\t// Cases:\n\t\t\t// A. If options specifies minVersionForCollab, it takes precedence over args.minVersionForCollab.\n\t\t\t// This value is set when:\n\t\t\t// - A customer using the declarative SharedTree API specifies the setting at the Shared Tree level.\n\t\t\t// There is currently no way to set it via the declarative API, but it could be added in the future.\n\t\t\t// - treeKernelFactory is invoked in a fuzz test with a specific minVersionForCollab\n\t\t\t// B. Otherwise, we use args.minVersionForCollab, which is propagated from the ContainerRuntime.\n\t\t\t// C. If neither specifies it, we fall back to a default value default of 2.0 since that is the oldest version that supports SharedTree.\n\t\t\tminVersionForCollab:\n\t\t\t\tminVersionForCollab ?? args.minVersionForCollab ?? FluidClientVersion.v2_0,\n\t\t};\n\n\t\treturn new SharedTreeKernel(\n\t\t\tnew Breakable(\"SharedTree\", args.logger),\n\t\t\targs.sharedObject,\n\t\t\targs.serializer,\n\t\t\targs.submitLocalMessage,\n\t\t\targs.lastSequenceNumber,\n\t\t\targs.initialSequenceNumber,\n\t\t\targs.logger,\n\t\t\targs.idCompressor,\n\t\t\tadjustedOptions,\n\t\t);\n\t}\n\n\treturn {\n\t\tcreate: (args: KernelArgs): FactoryOut<SharedTreeKernelView> => {\n\t\t\tconst k = treeFromKernelArgs(args);\n\t\t\treturn { kernel: k, view: k.view };\n\t\t},\n\n\t\tasync loadCore(\n\t\t\targs: KernelArgs,\n\t\t\tstorage: IChannelStorageService,\n\t\t): Promise<FactoryOut<SharedTreeKernelView>> {\n\t\t\tconst k = treeFromKernelArgs(args);\n\t\t\tawait k.loadCore(storage);\n\t\t\treturn { kernel: k, view: k.view };\n\t\t},\n\t};\n}\n\n/**\n * SharedTree is a hierarchical data structure for collaboratively editing strongly typed JSON-like trees\n * of objects, arrays, and other data types.\n * @legacy @beta\n */\nexport const SharedTree = configuredSharedTree({});\n\n/**\n * {@link SharedTree} but allowing a non-default configuration.\n * @remarks\n * This is useful for debugging and testing.\n * For example it can be used to opt into extra validation or see if opting out of some optimizations fixes an issue.\n *\n * With great care, and knowledge of the support and stability of the options exposed here,\n * this can also be used to opt into some features early or for performance tuning.\n *\n * @example\n * ```typescript\n * import {\n * \tconfiguredSharedTreeBeta,\n * \tForestTypeReference,\n * } from \"fluid-framework/beta\";\n * const SharedTree = configuredSharedTree({\n * \tforest: ForestTypeReference,\n * });\n * ```\n * @privateRemarks\n * The Legacy `ISharedObjectKind<ITree>` type is omitted here for simplicity.\n * @beta\n */\nexport function configuredSharedTreeBeta(\n\toptions: SharedTreeOptionsBeta,\n): SharedObjectKind<ITree> {\n\treturn configuredSharedTree(options);\n}\n\n/**\n * {@link configuredSharedTreeBeta} including the legacy `ISharedObjectKind` type.\n * @privateRemarks\n * This is given a different export name (with legacy appended) to avoid the need to do the special reexport with different types from the fluid-framework package.\n * @legacy @beta\n */\nexport function configuredSharedTreeBetaLegacy(\n\toptions: SharedTreeOptionsBeta,\n): ISharedObjectKind<ITree> & SharedObjectKind<ITree> {\n\treturn configuredSharedTree(options);\n}\n\n/**\n * {@link configuredSharedTreeBeta} but including the alpha {@link SharedTreeOptions}.\n * @alpha\n */\nexport function configuredSharedTreeAlpha(\n\toptions: SharedTreeOptions,\n): SharedObjectKind<ITree> {\n\treturn configuredSharedTree(options);\n}\n\n/**\n * {@link configuredSharedTreeBetaLegacy} but including `@alpha` options.\n *\n * @example\n * ```typescript\n * import {\n * \tTreeCompressionStrategy,\n * \tconfiguredSharedTree,\n * \tFormatValidatorBasic,\n * \tForestTypeReference,\n * } from \"@fluidframework/tree/internal\";\n * const SharedTree = configuredSharedTree({\n * \tforest: ForestTypeReference,\n * \tjsonValidator: FormatValidatorBasic,\n * \ttreeEncodeType: TreeCompressionStrategy.Uncompressed,\n * });\n * ```\n * @privateRemarks\n * This should be legacy, but has to be internal due to no alpha+legacy being setup yet.\n *\n * This should be renamed to `configuredSharedTreeAlpha` to avoid colliding with the eventual public version which will have less options.\n * @internal\n */\nexport function configuredSharedTree(\n\toptions: SharedTreeOptions,\n): ISharedObjectKind<ITree> & SharedObjectKind<ITree> {\n\tconst internalOptions = resolveOptions(options);\n\treturn configuredSharedTreeInternal(internalOptions);\n}\n\nexport function configuredSharedTreeInternal(\n\toptions: SharedTreeOptionsInternal,\n): ISharedObjectKind<ITree> & SharedObjectKind<ITree> {\n\tconst sharedObjectOptions: SharedObjectOptions<ITree> = {\n\t\ttype: SharedTreeFactoryType,\n\t\tattributes: SharedTreeAttributes,\n\t\ttelemetryContextPrefix: \"fluid_sharedTree_\",\n\t\tfactory: treeKernelFactory(options),\n\t};\n\n\treturn makeSharedObjectKind<ITree>(sharedObjectOptions);\n}\n\nexport function resolveOptions(options: SharedTreeOptions): SharedTreeOptionsInternal {\n\tconst internal: SharedTreeOptionsInternal = {\n\t\t...resolveFormatOptions(options),\n\t};\n\tfor (const optionName of Object.keys(options)) {\n\t\tcopyProperty(options, optionName, internal);\n\t}\n\treturn internal;\n}\n\nfunction resolveFormatOptions(options: SharedTreeOptions): SharedTreeOptionsInternal {\n\tconst enableSharedBranches = options.enableSharedBranches ?? false;\n\n\tif (enableSharedBranches) {\n\t\treturn sharedBranchesOptions;\n\t}\n\n\treturn {};\n}\n\nconst sharedBranchesOptions: SharedTreeOptionsInternal = {\n\twriteVersionOverrides: new Map<string, FormatVersion>([\n\t\t[editManagerCodecName, EditManagerFormatVersion.vSharedBranches],\n\t\t[messageCodecName, MessageFormatVersion.vSharedBranches],\n\t\t[detachedFieldIndexCodecBuilder.name, DetachedFieldIndexFormatVersion.v2],\n\t]),\n\tallowPossiblyIncompatibleWriteVersionOverrides: true,\n};\n"]}
1
+ {"version":3,"file":"treeFactory.js","sourceRoot":"","sources":["../src/treeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAGN,oBAAoB,GAMpB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAsB,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EACN,8BAA8B,EAC9B,+BAA+B,GAC/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,gBAAgB,GAMhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAExF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAS1D;;;;;GAKG;AACH,SAAS,iBAAiB,CACzB,OAAkC;IAElC,SAAS,kBAAkB,CAAC,IAAgB;QAC3C,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACrC,MAAM,IAAI,UAAU,CAAC,gDAAgD,CAAC,CAAC;QACxE,CAAC;QAED,MAAM,EAAE,mBAAmB,EAAE,GAAG,YAAY,EAAE,GAAG,OAAO,CAAC;QAEzD,MAAM,eAAe,G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,CAAC;IAED,OAAO,EAAE,CAAC;AACX,CAAC;AAED,MAAM,qBAAqB,GAA8B;IACxD,qBAAqB,EAAE,IAAI,GAAG,CAAwB;QACrD,CAAC,oBAAoB,EAAE,wBAAwB,CAAC,eAAe,CAAC;QAChE,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,eAAe,CAAC;QACxD,CAAC,8BAA8B,CAAC,IAAI,EAAE,+BAA+B,CAAC,EAAE,CAAC;KACzE,CAAC;IACF,8CAA8C,EAAE,IAAI;CACpD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nimport {\n\ttype ISharedObject,\n\ttype ISharedObjectKind,\n\tmakeSharedObjectKind,\n\ttype KernelArgs,\n\ttype SharedKernelFactory,\n\ttype SharedObjectOptions,\n\ttype FactoryOut,\n\ttype SharedObjectKindAlpha,\n} from \"@fluidframework/shared-object-base/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { FluidClientVersion, type FormatVersion } from \"./codec/index.js\";\nimport {\n\tdetachedFieldIndexCodecBuilder,\n\tDetachedFieldIndexFormatVersion,\n} from \"./core/index.js\";\nimport {\n\tSharedTreeKernel,\n\ttype ITreePrivate,\n\ttype SharedTreeOptions,\n\ttype SharedTreeOptionsBeta,\n\ttype SharedTreeOptionsInternal,\n\ttype SharedTreeKernelView,\n} from \"./shared-tree/index.js\";\nimport {\n\teditManagerCodecName,\n\tEditManagerFormatVersion,\n\tmessageCodecName,\n\tMessageFormatVersion,\n} from \"./shared-tree-core/index.js\";\nimport { SharedTreeFactoryType, SharedTreeAttributes } from \"./sharedTreeAttributes.js\";\nimport type { ITree } from \"./simple-tree/index.js\";\nimport { Breakable, copyProperty } from \"./util/index.js\";\n\n/**\n * {@link ITreePrivate} extended with ISharedObject.\n * @remarks\n * This is used when integration testing this package with the Fluid runtime as it exposes the APIs the runtime consumes to manipulate the tree.\n */\nexport interface ISharedTree extends ISharedObject, ITreePrivate {}\n\n/**\n * Creates a factory for shared tree kernels with the given options.\n * @remarks\n * Exposes {@link ITreePrivate} to allow access to internals in tests without a cast.\n * Code exposing this beyond this package will need to update to a more public type.\n */\nfunction treeKernelFactory(\n\toptions: SharedTreeOptionsInternal,\n): SharedKernelFactory<SharedTreeKernelView> {\n\tfunction treeFromKernelArgs(args: KernelArgs): SharedTreeKernel {\n\t\tif (args.idCompressor === undefined) {\n\t\t\tthrow new UsageError(\"IdCompressor must be enabled to use SharedTree\");\n\t\t}\n\n\t\tconst { minVersionForCollab, ...otherOptions } = options;\n\n\t\tconst adjustedOptions = {\n\t\t\t...otherOptions,\n\t\t\t// Cases:\n\t\t\t// A. If options specifies minVersionForCollab, it takes precedence over args.minVersionForCollab.\n\t\t\t// This value is set when:\n\t\t\t// - A customer using the declarative SharedTree API specifies the setting at the Shared Tree level.\n\t\t\t// There is currently no way to set it via the declarative API, but it could be added in the future.\n\t\t\t// - treeKernelFactory is invoked in a fuzz test with a specific minVersionForCollab\n\t\t\t// B. Otherwise, we use args.minVersionForCollab, which is propagated from the ContainerRuntime.\n\t\t\t// C. If neither specifies it, we fall back to a default value default of 2.0 since that is the oldest version that supports SharedTree.\n\t\t\tminVersionForCollab:\n\t\t\t\tminVersionForCollab ?? args.minVersionForCollab ?? FluidClientVersion.v2_0,\n\t\t};\n\n\t\treturn new SharedTreeKernel(\n\t\t\tnew Breakable(\"SharedTree\", args.logger),\n\t\t\targs.sharedObject,\n\t\t\targs.serializer,\n\t\t\targs.submitLocalMessage,\n\t\t\targs.lastSequenceNumber,\n\t\t\targs.initialSequenceNumber,\n\t\t\targs.logger,\n\t\t\targs.idCompressor,\n\t\t\tadjustedOptions,\n\t\t);\n\t}\n\n\treturn {\n\t\tcreate: (args: KernelArgs): FactoryOut<SharedTreeKernelView> => {\n\t\t\tconst k = treeFromKernelArgs(args);\n\t\t\treturn { kernel: k, view: k.view };\n\t\t},\n\n\t\tasync loadCore(\n\t\t\targs: KernelArgs,\n\t\t\tstorage: IChannelStorageService,\n\t\t): Promise<FactoryOut<SharedTreeKernelView>> {\n\t\t\tconst k = treeFromKernelArgs(args);\n\t\t\tawait k.loadCore(storage);\n\t\t\treturn { kernel: k, view: k.view };\n\t\t},\n\t};\n}\n\n/**\n * SharedTree is a hierarchical data structure for collaboratively editing strongly typed JSON-like trees\n * of objects, arrays, and other data types.\n * @legacy @beta\n */\nexport const SharedTree: ISharedObjectKind<ITree> & SharedObjectKind<ITree> =\n\tconfiguredSharedTree({});\n\n/**\n * {@link SharedTree} but without legacy types, and with alpha types.\n * @alpha\n */\nexport const SharedTreeAlpha: SharedObjectKindAlpha<ITree> = configuredSharedTree({});\n\n/**\n * {@link SharedTree} but allowing a non-default configuration.\n * @remarks\n * This is useful for debugging and testing.\n * For example it can be used to opt into extra validation or see if opting out of some optimizations fixes an issue.\n *\n * With great care, and knowledge of the support and stability of the options exposed here,\n * this can also be used to opt into some features early or for performance tuning.\n *\n * @example\n * ```typescript\n * import {\n * \tconfiguredSharedTreeBeta,\n * \tForestTypeReference,\n * } from \"fluid-framework/beta\";\n * const SharedTree = configuredSharedTree({\n * \tforest: ForestTypeReference,\n * });\n * ```\n * @privateRemarks\n * The Legacy `ISharedObjectKind<ITree>` type is omitted here for simplicity.\n * @beta\n */\nexport function configuredSharedTreeBeta(\n\toptions: SharedTreeOptionsBeta,\n): SharedObjectKind<ITree> {\n\treturn configuredSharedTree(options);\n}\n\n/**\n * {@link configuredSharedTreeBeta} including the legacy `ISharedObjectKind` type.\n * @privateRemarks\n * This is given a different export name (with legacy appended) to avoid the need to do the special reexport with different types from the fluid-framework package.\n * @legacy @beta\n */\nexport function configuredSharedTreeBetaLegacy(\n\toptions: SharedTreeOptionsBeta,\n): ISharedObjectKind<ITree> & SharedObjectKind<ITree> {\n\treturn configuredSharedTree(options);\n}\n\n/**\n * {@link configuredSharedTreeBeta} but including the alpha {@link SharedTreeOptions}.\n * @alpha\n */\nexport function configuredSharedTreeAlpha(\n\toptions: SharedTreeOptions,\n): SharedObjectKind<ITree> {\n\treturn configuredSharedTree(options);\n}\n\n/**\n * {@link configuredSharedTreeBetaLegacy} but including `@alpha` options.\n *\n * @example\n * ```typescript\n * import {\n * \tTreeCompressionStrategy,\n * \tconfiguredSharedTree,\n * \tFormatValidatorBasic,\n * \tForestTypeReference,\n * } from \"@fluidframework/tree/internal\";\n * const SharedTree = configuredSharedTree({\n * \tforest: ForestTypeReference,\n * \tjsonValidator: FormatValidatorBasic,\n * \ttreeEncodeType: TreeCompressionStrategy.Uncompressed,\n * });\n * ```\n * @privateRemarks\n * This should be legacy, but has to be internal due to no alpha+legacy being setup yet.\n *\n * This should be renamed to `configuredSharedTreeAlpha` to avoid colliding with the eventual public version which will have less options.\n * @internal\n */\nexport function configuredSharedTree(\n\toptions: SharedTreeOptions,\n): ISharedObjectKind<ITree> & SharedObjectKindAlpha<ITree> {\n\tconst internalOptions = resolveOptions(options);\n\treturn configuredSharedTreeInternal(internalOptions);\n}\n\nexport function configuredSharedTreeInternal(\n\toptions: SharedTreeOptionsInternal,\n): ISharedObjectKind<ITree> & SharedObjectKindAlpha<ITree> {\n\tconst sharedObjectOptions: SharedObjectOptions<ITree> = {\n\t\ttype: SharedTreeFactoryType,\n\t\tattributes: SharedTreeAttributes,\n\t\ttelemetryContextPrefix: \"fluid_sharedTree_\",\n\t\tfactory: treeKernelFactory(options),\n\t};\n\n\treturn makeSharedObjectKind<ITree>(sharedObjectOptions);\n}\n\nexport function resolveOptions(options: SharedTreeOptions): SharedTreeOptionsInternal {\n\tconst internal: SharedTreeOptionsInternal = {\n\t\t...resolveFormatOptions(options),\n\t};\n\tfor (const optionName of Object.keys(options)) {\n\t\tcopyProperty(options, optionName, internal);\n\t}\n\treturn internal;\n}\n\nfunction resolveFormatOptions(options: SharedTreeOptions): SharedTreeOptionsInternal {\n\tconst enableSharedBranches = options.enableSharedBranches ?? false;\n\n\tif (enableSharedBranches) {\n\t\treturn sharedBranchesOptions;\n\t}\n\n\treturn {};\n}\n\nconst sharedBranchesOptions: SharedTreeOptionsInternal = {\n\twriteVersionOverrides: new Map<string, FormatVersion>([\n\t\t[editManagerCodecName, EditManagerFormatVersion.vSharedBranches],\n\t\t[messageCodecName, MessageFormatVersion.vSharedBranches],\n\t\t[detachedFieldIndexCodecBuilder.name, DetachedFieldIndexFormatVersion.v2],\n\t]),\n\tallowPossiblyIncompatibleWriteVersionOverrides: true,\n};\n"]}
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ import { type ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
5
6
  import type { IIdCompressor, OpSpaceCompressedId, SessionId, SessionSpaceCompressedId } from "@fluidframework/id-compressor";
6
7
  /**
7
8
  * An encoded identifier that can be decoded without an originator session id.
@@ -96,6 +97,11 @@ export interface IdentifierHealingConfig {
96
97
  * same session offsets.
97
98
  */
98
99
  readonly sharedObjectId: string;
100
+ /**
101
+ * Optional logger used by {@link forceDecodeEncodedIdWithoutSession} to record telemetry
102
+ * when the heal-on-decode recovery path is taken (a non-final identifier is healed).
103
+ */
104
+ readonly logger?: ITelemetryBaseLogger;
99
105
  }
100
106
  /**
101
107
  * Decode an op-space compressed id without a session.
@@ -106,6 +112,16 @@ export interface IdentifierHealingConfig {
106
112
  * deterministic v5 UUID string — *not* a `StableId`, since that brand requires
107
113
  * v4, but still a valid identifier value; the `string` arm of the return type
108
114
  * covers this case.
115
+ *
116
+ * The recovery (heal) path only occurs because of a prior bug where non-finalized identifiers were
117
+ * written into summaries. When {@link IdentifierHealingConfig.logger} is supplied, a telemetry event
118
+ * is recorded on that path so heals can be observed in the wild. The error/throw path is intentionally
119
+ * not instrumented here: the thrown exception is expected to surface via the application's own error
120
+ * telemetry, and should never be silently swallowed.
121
+ *
122
+ * @param id - The op-space compressed ID to decode.
123
+ * @param idCompressor - The ID compressor used to normalize the ID.
124
+ * @param healing - Heal-on-decode configuration. Presence enables healing of non-final IDs.
109
125
  */
110
126
  export declare function forceDecodeEncodedIdWithoutSession(id: OpSpaceCompressedId, idCompressor: IIdCompressor, healing: IdentifierHealingConfig | undefined): SessionSpaceCompressedId | string;
111
127
  /**
@@ -159,9 +175,13 @@ export interface IdDecoderOptionsWithOriginator {
159
175
  */
160
176
  export declare class IdDecodingContext {
161
177
  /**
162
- * Used internally to prevent the use of this decoder in incremental chunks if it has a session id (which would be wrong in those chunks).
178
+ * Whether this context resolves identifiers using an originator session ID.
179
+ * @remarks
180
+ * Consulted by {@link FieldBatchDecodingContext} to prevent using an originator-based
181
+ * decoder in incremental chunks (which may come from other sessions, making such a
182
+ * decoder wrong there).
163
183
  */
164
- protected readonly hasOriginatorSessionId: boolean;
184
+ readonly hasOriginatorSessionId: boolean;
165
185
  /**
166
186
  * Compressor which can decompress session-space identifiers from {@link resolveEncodedId} as needed.
167
187
  */
@@ -1 +1 @@
1
- {"version":3,"file":"compressedIds.d.ts","sourceRoot":"","sources":["../../src/util/compressedIds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,wBAAwB,EACxB,MAAM,+BAA+B,CAAC;AAIvC;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,wBAAwB,GAAG,mBAAmB,CAAC;AAErF;;;;;;;GAOG;AACH,MAAM,MAAM,4BAA4B,GAAG,mBAAmB,CAAC;AAE/D;;GAEG;AACH,oBAAY,aAAa;IACxB;;OAEG;IACH,cAAc,IAAA;IACd;;OAEG;IACH,mBAAmB,IAAA;CACnB;AAED,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,aAAa,IAAI,CAAC,SAAS,aAAa,CAAC,cAAc,GACpF,uBAAuB,GACvB,CAAC,SAAS,aAAa,CAAC,mBAAmB,GAC1C,4BAA4B,GAC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