@fluidframework/tree 2.110.0 → 2.111.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 (374) hide show
  1. package/.vscode/settings.json +1 -0
  2. package/CHANGELOG.md +48 -0
  3. package/api-report/tree.alpha.api.md +48 -31
  4. package/api-report/tree.beta.api.md +38 -0
  5. package/api-report/tree.legacy.beta.api.md +38 -0
  6. package/dist/core/change-family/changeFamily.d.ts +3 -10
  7. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  8. package/dist/core/change-family/changeFamily.js.map +1 -1
  9. package/dist/core/rebase/types.d.ts +2 -2
  10. package/dist/core/rebase/types.js.map +1 -1
  11. package/dist/core/schema-stored/storedSchemaRepository.d.ts +2 -2
  12. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  13. package/dist/entrypoints/alpha.d.ts +1 -1
  14. package/dist/entrypoints/alpha.d.ts.map +1 -1
  15. package/dist/entrypoints/alpha.js.map +1 -1
  16. package/dist/entrypoints/beta.d.ts +1 -1
  17. package/dist/entrypoints/beta.d.ts.map +1 -1
  18. package/dist/entrypoints/beta.js.map +1 -1
  19. package/dist/entrypoints/legacy.d.ts +1 -1
  20. package/dist/entrypoints/legacy.d.ts.map +1 -1
  21. package/dist/entrypoints/legacy.js.map +1 -1
  22. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +19 -14
  23. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  24. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +13 -32
  25. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  26. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +85 -28
  27. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  28. package/dist/feature-libraries/chunked-forest/codec/codecs.js +83 -9
  29. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  30. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
  31. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  32. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +11 -0
  33. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  34. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  35. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  36. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
  37. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  38. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
  39. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  40. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
  41. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  42. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  43. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  44. package/dist/feature-libraries/chunked-forest/index.js +2 -1
  45. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  46. package/dist/feature-libraries/forest-summary/codec.d.ts +3 -3
  47. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  48. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  49. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
  50. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  51. package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -6
  52. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  53. package/dist/feature-libraries/index.d.ts +1 -1
  54. package/dist/feature-libraries/index.d.ts.map +1 -1
  55. package/dist/feature-libraries/index.js +2 -1
  56. package/dist/feature-libraries/index.js.map +1 -1
  57. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  58. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +9 -9
  59. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  60. package/dist/index.d.ts +2 -2
  61. package/dist/index.d.ts.map +1 -1
  62. package/dist/index.js +2 -1
  63. package/dist/index.js.map +1 -1
  64. package/dist/packageVersion.d.ts +1 -1
  65. package/dist/packageVersion.js +1 -1
  66. package/dist/packageVersion.js.map +1 -1
  67. package/dist/shared-tree/independentView.d.ts.map +1 -1
  68. package/dist/shared-tree/independentView.js +4 -7
  69. package/dist/shared-tree/independentView.js.map +1 -1
  70. package/dist/shared-tree/index.d.ts +1 -1
  71. package/dist/shared-tree/index.d.ts.map +1 -1
  72. package/dist/shared-tree/index.js.map +1 -1
  73. package/dist/shared-tree/schematizingTreeView.d.ts +5 -5
  74. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  75. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  76. package/dist/shared-tree/sharedTree.d.ts +5 -0
  77. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  78. package/dist/shared-tree/sharedTree.js +7 -4
  79. package/dist/shared-tree/sharedTree.js.map +1 -1
  80. package/dist/shared-tree/transactionPostProcessor.d.ts +28 -0
  81. package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -0
  82. package/dist/shared-tree/transactionPostProcessor.js +28 -0
  83. package/dist/shared-tree/transactionPostProcessor.js.map +1 -0
  84. package/dist/shared-tree/treeAlpha.js +3 -3
  85. package/dist/shared-tree/treeAlpha.js.map +1 -1
  86. package/dist/shared-tree/treeCheckout.d.ts +16 -12
  87. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  88. package/dist/shared-tree/treeCheckout.js +18 -9
  89. package/dist/shared-tree/treeCheckout.js.map +1 -1
  90. package/dist/shared-tree/unhydratedTreeContext.d.ts +5 -5
  91. package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
  92. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
  93. package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -2
  94. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  95. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  96. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +3 -9
  97. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  98. package/dist/shared-tree-core/editManagerCodecsCommons.js +2 -4
  99. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  100. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
  101. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  102. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  103. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
  104. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  105. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  106. package/dist/shared-tree-core/editManagerSummarizer.d.ts +5 -9
  107. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  108. package/dist/shared-tree-core/editManagerSummarizer.js +5 -10
  109. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  110. package/dist/shared-tree-core/index.d.ts +1 -1
  111. package/dist/shared-tree-core/index.d.ts.map +1 -1
  112. package/dist/shared-tree-core/index.js +3 -2
  113. package/dist/shared-tree-core/index.js.map +1 -1
  114. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  115. package/dist/shared-tree-core/sharedTreeCore.js +3 -1
  116. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  117. package/dist/shared-tree-core/transaction.d.ts +84 -9
  118. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  119. package/dist/shared-tree-core/transaction.js +74 -7
  120. package/dist/shared-tree-core/transaction.js.map +1 -1
  121. package/dist/simple-tree/api/index.d.ts +1 -1
  122. package/dist/simple-tree/api/index.d.ts.map +1 -1
  123. package/dist/simple-tree/api/index.js.map +1 -1
  124. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
  125. package/dist/simple-tree/api/schemaCreationUtilities.js +3 -3
  126. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  127. package/dist/simple-tree/api/schemaFactory.d.ts +1 -1
  128. package/dist/simple-tree/api/schemaFactory.js +2 -2
  129. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  130. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
  131. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  132. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  133. package/dist/simple-tree/api/transactionTypes.d.ts +91 -28
  134. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  135. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  136. package/dist/simple-tree/api/tree.d.ts +86 -22
  137. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  138. package/dist/simple-tree/api/tree.js.map +1 -1
  139. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  140. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  141. package/dist/simple-tree/core/treeNodeSchema.d.ts +7 -7
  142. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  143. package/dist/simple-tree/index.d.ts +1 -1
  144. package/dist/simple-tree/index.d.ts.map +1 -1
  145. package/dist/simple-tree/index.js.map +1 -1
  146. package/dist/text/index.d.ts +1 -0
  147. package/dist/text/index.d.ts.map +1 -1
  148. package/dist/text/index.js +3 -1
  149. package/dist/text/index.js.map +1 -1
  150. package/dist/text/textDomainFormatted.d.ts +69 -758
  151. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  152. package/dist/text/textDomainFormatted.js +275 -322
  153. package/dist/text/textDomainFormatted.js.map +1 -1
  154. package/dist/text/textDomainFormattedDefault.d.ts +273 -0
  155. package/dist/text/textDomainFormattedDefault.d.ts.map +1 -0
  156. package/dist/text/textDomainFormattedDefault.js +94 -0
  157. package/dist/text/textDomainFormattedDefault.js.map +1 -0
  158. package/dist/util/compressedIds.d.ts +118 -0
  159. package/dist/util/compressedIds.d.ts.map +1 -0
  160. package/dist/util/compressedIds.js +133 -0
  161. package/dist/util/compressedIds.js.map +1 -0
  162. package/dist/util/index.d.ts +1 -0
  163. package/dist/util/index.d.ts.map +1 -1
  164. package/dist/util/index.js +9 -1
  165. package/dist/util/index.js.map +1 -1
  166. package/lib/core/change-family/changeFamily.d.ts +3 -10
  167. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  168. package/lib/core/change-family/changeFamily.js.map +1 -1
  169. package/lib/core/rebase/types.d.ts +2 -2
  170. package/lib/core/rebase/types.js.map +1 -1
  171. package/lib/core/schema-stored/storedSchemaRepository.d.ts +2 -2
  172. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  173. package/lib/entrypoints/alpha.d.ts +1 -1
  174. package/lib/entrypoints/alpha.d.ts.map +1 -1
  175. package/lib/entrypoints/alpha.js.map +1 -1
  176. package/lib/entrypoints/beta.d.ts +1 -1
  177. package/lib/entrypoints/beta.d.ts.map +1 -1
  178. package/lib/entrypoints/beta.js.map +1 -1
  179. package/lib/entrypoints/legacy.d.ts +1 -1
  180. package/lib/entrypoints/legacy.d.ts.map +1 -1
  181. package/lib/entrypoints/legacy.js.map +1 -1
  182. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +19 -14
  183. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  184. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +14 -33
  185. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  186. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +85 -28
  187. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  188. package/lib/feature-libraries/chunked-forest/codec/codecs.js +82 -9
  189. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  190. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
  191. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  192. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +12 -1
  193. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  194. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  195. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  196. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  197. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  198. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
  199. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  200. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
  201. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  202. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  203. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  204. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  205. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  206. package/lib/feature-libraries/forest-summary/codec.d.ts +3 -3
  207. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  208. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  209. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
  210. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  211. package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -6
  212. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  213. package/lib/feature-libraries/index.d.ts +1 -1
  214. package/lib/feature-libraries/index.d.ts.map +1 -1
  215. package/lib/feature-libraries/index.js +1 -1
  216. package/lib/feature-libraries/index.js.map +1 -1
  217. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  218. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +10 -10
  219. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  220. package/lib/index.d.ts +2 -2
  221. package/lib/index.d.ts.map +1 -1
  222. package/lib/index.js +1 -1
  223. package/lib/index.js.map +1 -1
  224. package/lib/packageVersion.d.ts +1 -1
  225. package/lib/packageVersion.js +1 -1
  226. package/lib/packageVersion.js.map +1 -1
  227. package/lib/shared-tree/independentView.d.ts.map +1 -1
  228. package/lib/shared-tree/independentView.js +5 -8
  229. package/lib/shared-tree/independentView.js.map +1 -1
  230. package/lib/shared-tree/index.d.ts +1 -1
  231. package/lib/shared-tree/index.d.ts.map +1 -1
  232. package/lib/shared-tree/index.js.map +1 -1
  233. package/lib/shared-tree/schematizingTreeView.d.ts +5 -5
  234. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  235. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  236. package/lib/shared-tree/sharedTree.d.ts +5 -0
  237. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  238. package/lib/shared-tree/sharedTree.js +8 -5
  239. package/lib/shared-tree/sharedTree.js.map +1 -1
  240. package/lib/shared-tree/transactionPostProcessor.d.ts +28 -0
  241. package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -0
  242. package/lib/shared-tree/transactionPostProcessor.js +23 -0
  243. package/lib/shared-tree/transactionPostProcessor.js.map +1 -0
  244. package/lib/shared-tree/treeAlpha.js +3 -3
  245. package/lib/shared-tree/treeAlpha.js.map +1 -1
  246. package/lib/shared-tree/treeCheckout.d.ts +16 -12
  247. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  248. package/lib/shared-tree/treeCheckout.js +18 -9
  249. package/lib/shared-tree/treeCheckout.js.map +1 -1
  250. package/lib/shared-tree/unhydratedTreeContext.d.ts +5 -5
  251. package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
  252. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
  253. package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -2
  254. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  255. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  256. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +3 -9
  257. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  258. package/lib/shared-tree-core/editManagerCodecsCommons.js +3 -5
  259. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  260. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
  261. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  262. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  263. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
  264. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  265. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  266. package/lib/shared-tree-core/editManagerSummarizer.d.ts +5 -9
  267. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  268. package/lib/shared-tree-core/editManagerSummarizer.js +5 -10
  269. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  270. package/lib/shared-tree-core/index.d.ts +1 -1
  271. package/lib/shared-tree-core/index.d.ts.map +1 -1
  272. package/lib/shared-tree-core/index.js +1 -1
  273. package/lib/shared-tree-core/index.js.map +1 -1
  274. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  275. package/lib/shared-tree-core/sharedTreeCore.js +3 -1
  276. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  277. package/lib/shared-tree-core/transaction.d.ts +84 -9
  278. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  279. package/lib/shared-tree-core/transaction.js +73 -6
  280. package/lib/shared-tree-core/transaction.js.map +1 -1
  281. package/lib/simple-tree/api/index.d.ts +1 -1
  282. package/lib/simple-tree/api/index.d.ts.map +1 -1
  283. package/lib/simple-tree/api/index.js.map +1 -1
  284. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
  285. package/lib/simple-tree/api/schemaCreationUtilities.js +3 -3
  286. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  287. package/lib/simple-tree/api/schemaFactory.d.ts +1 -1
  288. package/lib/simple-tree/api/schemaFactory.js +2 -2
  289. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  290. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
  291. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  292. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  293. package/lib/simple-tree/api/transactionTypes.d.ts +91 -28
  294. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  295. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  296. package/lib/simple-tree/api/tree.d.ts +86 -22
  297. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  298. package/lib/simple-tree/api/tree.js.map +1 -1
  299. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  300. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  301. package/lib/simple-tree/core/treeNodeSchema.d.ts +7 -7
  302. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  303. package/lib/simple-tree/index.d.ts +1 -1
  304. package/lib/simple-tree/index.d.ts.map +1 -1
  305. package/lib/simple-tree/index.js.map +1 -1
  306. package/lib/text/index.d.ts +1 -0
  307. package/lib/text/index.d.ts.map +1 -1
  308. package/lib/text/index.js +1 -0
  309. package/lib/text/index.js.map +1 -1
  310. package/lib/text/textDomainFormatted.d.ts +69 -758
  311. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  312. package/lib/text/textDomainFormatted.js +277 -324
  313. package/lib/text/textDomainFormatted.js.map +1 -1
  314. package/lib/text/textDomainFormattedDefault.d.ts +273 -0
  315. package/lib/text/textDomainFormattedDefault.d.ts.map +1 -0
  316. package/lib/text/textDomainFormattedDefault.js +91 -0
  317. package/lib/text/textDomainFormattedDefault.js.map +1 -0
  318. package/lib/util/compressedIds.d.ts +118 -0
  319. package/lib/util/compressedIds.d.ts.map +1 -0
  320. package/lib/util/compressedIds.js +124 -0
  321. package/lib/util/compressedIds.js.map +1 -0
  322. package/lib/util/index.d.ts +1 -0
  323. package/lib/util/index.d.ts.map +1 -1
  324. package/lib/util/index.js +1 -0
  325. package/lib/util/index.js.map +1 -1
  326. package/package.json +23 -23
  327. package/src/core/change-family/changeFamily.ts +3 -12
  328. package/src/core/rebase/types.ts +2 -2
  329. package/src/core/schema-stored/storedSchemaRepository.ts +2 -2
  330. package/src/entrypoints/alpha.ts +12 -8
  331. package/src/entrypoints/beta.ts +8 -0
  332. package/src/entrypoints/legacy.ts +8 -0
  333. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +35 -64
  334. package/src/feature-libraries/chunked-forest/codec/codecs.ts +138 -42
  335. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +32 -4
  336. package/src/feature-libraries/chunked-forest/codec/index.ts +1 -0
  337. package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +7 -19
  338. package/src/feature-libraries/chunked-forest/index.ts +3 -0
  339. package/src/feature-libraries/forest-summary/codec.ts +5 -3
  340. package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -5
  341. package/src/feature-libraries/index.ts +3 -0
  342. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +13 -9
  343. package/src/index.ts +13 -8
  344. package/src/packageVersion.ts +1 -1
  345. package/src/shared-tree/independentView.ts +5 -10
  346. package/src/shared-tree/index.ts +1 -0
  347. package/src/shared-tree/schematizingTreeView.ts +25 -25
  348. package/src/shared-tree/sharedTree.ts +16 -4
  349. package/src/shared-tree/transactionPostProcessor.ts +40 -0
  350. package/src/shared-tree/treeAlpha.ts +3 -3
  351. package/src/shared-tree/treeCheckout.ts +61 -44
  352. package/src/shared-tree/unhydratedTreeContext.ts +18 -15
  353. package/src/shared-tree-core/editManagerCodecs.ts +3 -2
  354. package/src/shared-tree-core/editManagerCodecsCommons.ts +10 -14
  355. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +3 -2
  356. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +3 -2
  357. package/src/shared-tree-core/editManagerSummarizer.ts +5 -9
  358. package/src/shared-tree-core/index.ts +8 -5
  359. package/src/shared-tree-core/sharedTreeCore.ts +3 -2
  360. package/src/shared-tree-core/transaction.ts +148 -18
  361. package/src/simple-tree/api/index.ts +13 -9
  362. package/src/simple-tree/api/schemaCreationUtilities.ts +3 -3
  363. package/src/simple-tree/api/schemaFactory.ts +2 -2
  364. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +2 -2
  365. package/src/simple-tree/api/transactionTypes.ts +111 -39
  366. package/src/simple-tree/api/tree.ts +141 -47
  367. package/src/simple-tree/api/treeBeta.ts +2 -0
  368. package/src/simple-tree/core/treeNodeSchema.ts +7 -7
  369. package/src/simple-tree/index.ts +12 -8
  370. package/src/text/index.ts +1 -0
  371. package/src/text/textDomainFormatted.ts +520 -415
  372. package/src/text/textDomainFormattedDefault.ts +150 -0
  373. package/src/util/compressedIds.ts +216 -0
  374. package/src/util/index.ts +15 -0
@@ -0,0 +1,150 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import {
7
+ enumFromStrings,
8
+ SchemaFactory,
9
+ SchemaFactoryAlpha,
10
+ SchemaFactoryBeta,
11
+ } from "../simple-tree/index.js";
12
+ import type {
13
+ TreeNodeFromImplicitAllowedTypes,
14
+ InsertableTreeNodeFromImplicitAllowedTypes,
15
+ } from "../simple-tree/index.js";
16
+
17
+ import { FormattedTextAsTree } from "./textDomainFormatted.js";
18
+
19
+ /**
20
+ * Schema factory for default formatted text types which are not generic.
21
+ */
22
+ const sf = new SchemaFactoryAlpha("com.fluidframework.text.formatted.default");
23
+
24
+ const defaultFormat = {
25
+ bold: false,
26
+ italic: false,
27
+ underline: false,
28
+ size: 12,
29
+ font: "Arial",
30
+ } as const;
31
+
32
+ /**
33
+ * A collection of text related types, schema and utilities for working with text beyond the basic {@link SchemaStatics.string}.
34
+ * @remarks
35
+ * 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.
36
+ * 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}.
37
+ * @internal
38
+ */
39
+ export namespace FormattedTextAsTreeDefault {
40
+ /**
41
+ * Portion of a string with formatting.
42
+ * @sealed
43
+ * @internal
44
+ */
45
+ export type FormattedAtom = FormattedTextAsTree.FormattedAtom<
46
+ CharacterFormat,
47
+ StringAtomContent
48
+ >;
49
+
50
+ /**
51
+ * Formatting options for characters.
52
+ * @internal
53
+ */
54
+ export class CharacterFormat extends sf.objectAlpha("CharacterFormat", {
55
+ bold: SchemaFactory.boolean,
56
+ italic: SchemaFactory.boolean,
57
+ underline: SchemaFactory.boolean,
58
+ size: SchemaFactory.number,
59
+ font: SchemaFactory.string,
60
+ }) {
61
+ public static readonly defaultFormat = new CharacterFormat(defaultFormat);
62
+ }
63
+
64
+ /**
65
+ * Tag with which a line in text can be formatted from HTML.
66
+ * @internal
67
+ */
68
+ export const LineTag = enumFromStrings(sf.scopedFactory("lineTag"), [
69
+ "h1",
70
+ "h2",
71
+ "h3",
72
+ "h4",
73
+ "h5",
74
+ "li",
75
+ "ol",
76
+ "checked",
77
+ "unchecked",
78
+ "blockquote",
79
+ "codeBlock",
80
+ ]);
81
+ /**
82
+ * {@inheritdoc FormattedTextAsTreeDefault.(LineTag:variable)}
83
+ * @internal
84
+ */
85
+ export type LineTag = TreeNodeFromImplicitAllowedTypes<typeof LineTag.schema>;
86
+
87
+ /**
88
+ * Unit in the string representing a new line character with line formatting.
89
+ * @remarks
90
+ * This aligns with how Quill represents line formatting.
91
+ * Quill formats line attributes (headers, list, blockquote, etc... ) on the newline character
92
+ * and only lines using this atom can have line-specific formatting.
93
+ * The optional indent level mirrors Quill's indent attribute,
94
+ * which is applies to the line before the line break.
95
+ * Any tagged line can be indented independently.
96
+ * @internal
97
+ */
98
+ export class StringLineAtom extends sf.object("StringLineAtom", {
99
+ tag: LineTag.schema,
100
+ indent: SchemaFactory.number,
101
+ }) {
102
+ public readonly content = "\n";
103
+ }
104
+
105
+ /**
106
+ * Types of "atoms" that make up the text.
107
+ * @internal
108
+ */
109
+ export const StringAtomContent = [
110
+ FormattedTextAsTree.StringTextAtom,
111
+ StringLineAtom,
112
+ ] as const;
113
+ /**
114
+ * {@inheritdoc FormattedTextAsTreeDefault.(StringAtomContent:variable)}
115
+ * @internal
116
+ */
117
+ export type StringAtomContent = TreeNodeFromImplicitAllowedTypes<typeof StringAtomContent>;
118
+
119
+ /**
120
+ * Statics for text nodes.
121
+ * @internal
122
+ */
123
+ export type Statics<TTree = Tree> = FormattedTextAsTree.Statics<TTree>;
124
+
125
+ /**
126
+ * Insertable shape for a formatted text atom used by {@link FormattedTextAsTree.Members.insertWithFormattingAt}.
127
+ * @internal
128
+ */
129
+ export type FormattedAtomInsertable = FormattedTextAsTree.FormattedAtom<
130
+ InsertableTreeNodeFromImplicitAllowedTypes<typeof CharacterFormat>,
131
+ InsertableTreeNodeFromImplicitAllowedTypes<FormattedTextAtoms>
132
+ >;
133
+
134
+ /**
135
+ * Helper for expressing the full set of formatted text atoms for a given schema.
136
+ * @privateRemarks
137
+ * Eventually this should probably be given a better name and/or made a system type in a system namespace.
138
+ * @internal
139
+ */
140
+ export type FormattedTextAtoms = FormattedTextAsTree.FormattedTextAtoms<
141
+ [typeof StringLineAtom]
142
+ >;
143
+
144
+ export class Tree extends FormattedTextAsTree.createSchema(
145
+ new SchemaFactoryBeta("default"),
146
+ CharacterFormat,
147
+ [StringLineAtom],
148
+ defaultFormat,
149
+ ) {}
150
+ }
@@ -0,0 +1,216 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { assert } from "@fluidframework/core-utils/internal";
7
+ import type {
8
+ IIdCompressor,
9
+ OpSpaceCompressedId,
10
+ SessionId,
11
+ SessionSpaceCompressedId,
12
+ } from "@fluidframework/id-compressor";
13
+ import { isFinalId, isStableId } from "@fluidframework/id-compressor/internal";
14
+ import { v5 as uuidV5 } from "uuid";
15
+
16
+ /**
17
+ * An encoded identifier that can be decoded without an originator session id.
18
+ * A finalized compressed id — the same numeric value in op-space and session-space.
19
+ * @remarks
20
+ * These are safe to use in contexts where the encoding id compressor is available to decode them,
21
+ * even when the session id of the encoding id compressor is not known.
22
+ */
23
+ export type OriginatorlessEncodedId = SessionSpaceCompressedId & OpSpaceCompressedId;
24
+
25
+ /**
26
+ * An encoded identifier that may require an originator session id to decode.
27
+ * Any op-space compressed id, either finalized or session-local.
28
+ * @remarks
29
+ * These are only safe to use in contexts where the encoding id compressor is available
30
+ * and the session id of the encoding id compressor is known.
31
+ * Currently the only such case is in ops, excluding attach summary ops.
32
+ */
33
+ export type OriginatorDependentEncodedId = OpSpaceCompressedId;
34
+
35
+ /**
36
+ * Selects how identifiers are encoded for transport/persistence.
37
+ */
38
+ export enum EncodedIdType {
39
+ /**
40
+ * {@link OriginatorlessEncodedId}.
41
+ */
42
+ Originatorless,
43
+ /**
44
+ * {@link OriginatorDependentEncodedId}.
45
+ */
46
+ OriginatorDependent,
47
+ }
48
+
49
+ export type EncodedId<T extends EncodedIdType> = T extends EncodedIdType.Originatorless
50
+ ? OriginatorlessEncodedId
51
+ : T extends EncodedIdType.OriginatorDependent
52
+ ? OriginatorDependentEncodedId
53
+ : OriginatorlessEncodedId | OriginatorDependentEncodedId;
54
+
55
+ /**
56
+ * Context for encoding identifiers.
57
+ * @remarks
58
+ * See {@link FieldBatchDecodingContext} for the decoder.
59
+ */
60
+ export interface IdEncodingContext {
61
+ encodePossiblyCompressedId(id: string): string | EncodedId<EncodedIdType>;
62
+ }
63
+
64
+ /**
65
+ * Encode a string identifier into a possibly compressed form based on the requested mode.
66
+ *
67
+ * @param id - The string identifier to encode.
68
+ * @param idCompressor - The ID compressor to use for compression.
69
+ * @param encodedIdType - The type of encoding to use. If the context doing the decoding will have the originator {@link SessionId},
70
+ * then {@link EncodedIdType.OriginatorDependent} can be used.
71
+ * Otherwise, {@link EncodedIdType.Originatorless} must be used.
72
+ *
73
+ * @privateRemarks
74
+ * Performance:
75
+ * When trying to optimize to avoid unnecessary identifier decompression, and store identifiers compressed in memory,
76
+ * this will likely need to be updated to allow in SessionSpaceCompressedIds.
77
+ */
78
+ export function encodePossiblyCompressedId<T extends EncodedIdType>(
79
+ id: string,
80
+ idCompressor: IIdCompressor,
81
+ encodedIdType: T,
82
+ ): string | EncodedId<T> {
83
+ if (!isStableId(id)) {
84
+ return id;
85
+ }
86
+ const sessionSpaceCompressedId = idCompressor.tryRecompress(id);
87
+ if (sessionSpaceCompressedId === undefined) {
88
+ return id;
89
+ }
90
+ const opSpaceId = idCompressor.normalizeToOpSpace(sessionSpaceCompressedId);
91
+ if (encodedIdType === EncodedIdType.Originatorless) {
92
+ return isFinalId(opSpaceId) ? (opSpaceId as unknown as EncodedId<T>) : id;
93
+ }
94
+ return opSpaceId as unknown as EncodedId<T>;
95
+ }
96
+
97
+ /**
98
+ * Namespace used for the deterministic UUIDv5 produced by the heal-on-decode workaround
99
+ * in {@link forceDecodeEncodedIdWithoutSession}.
100
+ *
101
+ * This scheme requires consensus across all clients to function — every client that
102
+ * encounters the same unresolvable id must produce the same v5 UUID.
103
+ */
104
+ const healingNamespace = "f8a89df3-6882-400f-b913-4c1f6f0157bd";
105
+
106
+ /**
107
+ * Decode an {@link OriginatorlessEncodedId} without needing an originator session id.
108
+ *
109
+ * The id is guaranteed to be final by the type contract; it is normalized via
110
+ * {@link IIdCompressor.tryNormalizeToSessionSpaceWithoutSession}, which handles the
111
+ * cluster-aligned-local case rather than relying on the bare numeric value.
112
+ */
113
+ export function decodeOriginatorlessEncodedId(
114
+ id: OriginatorlessEncodedId,
115
+ idCompressor: IIdCompressor,
116
+ ): SessionSpaceCompressedId {
117
+ const sessionSpaceId = idCompressor.tryNormalizeToSessionSpaceWithoutSession(id);
118
+ assert(
119
+ sessionSpaceId !== undefined,
120
+ 0xd0a /* OriginatorlessEncodedId must be a finalized compressed id at runtime */,
121
+ );
122
+ return sessionSpaceId;
123
+ }
124
+
125
+ /**
126
+ * Decode an {@link OriginatorDependentEncodedId} using a known originator session id.
127
+ */
128
+ export function decodeEncodedIdWithOriginator(
129
+ id: OriginatorDependentEncodedId,
130
+ originator: SessionId,
131
+ idCompressor: IIdCompressor,
132
+ ): SessionSpaceCompressedId {
133
+ return idCompressor.normalizeToSessionSpace(id, originator);
134
+ }
135
+
136
+ /**
137
+ * Decode an {@link OriginatorDependentEncodedId} without a session.
138
+ *
139
+ * Returns the session-space id if `id` is finalized (and therefore resolvable
140
+ * without an originator session), or `undefined` if `id` is a non-final op-space
141
+ * id that cannot be resolved without the originator session.
142
+ */
143
+ export function tryDecodeEncodedIdWithoutSession(
144
+ id: OriginatorDependentEncodedId,
145
+ idCompressor: IIdCompressor,
146
+ ): SessionSpaceCompressedId | undefined {
147
+ return idCompressor.tryNormalizeToSessionSpaceWithoutSession(id);
148
+ }
149
+
150
+ /**
151
+ * Configuration for the heal-on-decode workaround. The internal counterpart of
152
+ * the user-facing {@link SharedTreeOptionsBeta.healUnresolvableIdentifiersOnDecode}
153
+ * option — see that option for the user-facing rationale and trade-offs.
154
+ *
155
+ * Carried by decode-side contexts (`ChangeEncodingContext.healing`,
156
+ * `EditManagerEncodingContext.healing`, etc.) when the workaround is enabled.
157
+ * Presence enables healing; `undefined` opts out. There is no separate boolean,
158
+ * which makes it impossible to enable healing without supplying the namespace
159
+ * input.
160
+ */
161
+ export interface IdentifierHealingConfig {
162
+ /**
163
+ * The SharedTree's shared-object id, used as the v5 namespace input so
164
+ * healed UUIDs are unique across attaches of different documents with the
165
+ * same session offsets.
166
+ */
167
+ readonly sharedObjectId: string;
168
+ }
169
+
170
+ /**
171
+ * Decode an op-space compressed id without a session.
172
+ *
173
+ * Finalized ids are returned as session-space ids (final ids are invariant
174
+ * across the two spaces). Non-final ids are healed via {@link IdentifierHealingConfig}
175
+ * if provided, or cause the resolver to throw otherwise. A healed result is a
176
+ * deterministic v5 UUID string — *not* a `StableId`, since that brand requires
177
+ * v4, but still a valid identifier value; the `string` arm of the return type
178
+ * covers this case.
179
+ */
180
+ export function forceDecodeEncodedIdWithoutSession(
181
+ id: OpSpaceCompressedId,
182
+ idCompressor: IIdCompressor,
183
+ healing: IdentifierHealingConfig | undefined,
184
+ ): SessionSpaceCompressedId | string {
185
+ const decoded = tryDecodeEncodedIdWithoutSession(id, idCompressor);
186
+ if (decoded !== undefined) {
187
+ return decoded;
188
+ }
189
+ // `id` is a non-final op-space compressed id.
190
+ if (healing !== undefined) {
191
+ return uuidV5(`${healing.sharedObjectId}|${id}`, healingNamespace);
192
+ }
193
+ throw new Error(
194
+ "Summary could not be loaded due to an incorrectly encoded identifier. See SharedTreeOptionsBeta.healUnresolvableIdentifiersOnDecode for mitigation.",
195
+ );
196
+ }
197
+
198
+ /**
199
+ * Convert a decoded, but possibly compressed, identifier to the decompressed string format.
200
+ *
201
+ * Session-space compressed ids are decompressed to their UUID representation via the compressor.
202
+ * String inputs pass through unchanged — they are already in the stored form,
203
+ * whether a `StableId` UUID, a heal-synthesized v5 UUID or other arbitrary string identifier.
204
+ */
205
+ export function decompressIdentifierIfNeeded(
206
+ id: SessionSpaceCompressedId | string,
207
+ idCompressor: Pick<IIdCompressor, "decompress">,
208
+ ): string {
209
+ if (typeof id === "string") {
210
+ return id;
211
+ } else {
212
+ const decompressed = idCompressor.decompress(id);
213
+ assert(typeof decompressed === "string", 0xd0b /* Decompressed id must be a string */);
214
+ return decompressed;
215
+ }
216
+ }
package/src/util/index.ts CHANGED
@@ -165,3 +165,18 @@ export {
165
165
  export { cloneWithReplacements } from "./cloneWithReplacements.js";
166
166
 
167
167
  export { readAndParseSnapshotBlob } from "./readSnapshotBlob.js";
168
+
169
+ export {
170
+ type OriginatorlessEncodedId,
171
+ type OriginatorDependentEncodedId,
172
+ type IdentifierHealingConfig,
173
+ EncodedIdType,
174
+ encodePossiblyCompressedId,
175
+ type IdEncodingContext,
176
+ type EncodedId,
177
+ decodeOriginatorlessEncodedId,
178
+ decodeEncodedIdWithOriginator,
179
+ tryDecodeEncodedIdWithoutSession,
180
+ forceDecodeEncodedIdWithoutSession,
181
+ decompressIdentifierIfNeeded,
182
+ } from "./compressedIds.js";