@fluidframework/tree 2.113.0-411909 → 2.114.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 (534) hide show
  1. package/CHANGELOG.md +272 -0
  2. package/api-report/tree.alpha.api.md +19 -0
  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 +3 -2
  14. package/dist/core/index.d.ts.map +1 -1
  15. package/dist/core/index.js.map +1 -1
  16. package/dist/core/tree/delta.d.ts +62 -16
  17. package/dist/core/tree/delta.d.ts.map +1 -1
  18. package/dist/core/tree/delta.js.map +1 -1
  19. package/dist/core/tree/detachedFieldIndex.d.ts +7 -13
  20. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  21. package/dist/core/tree/detachedFieldIndex.js +32 -46
  22. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  23. package/dist/core/tree/index.d.ts +1 -0
  24. package/dist/core/tree/index.d.ts.map +1 -1
  25. package/dist/core/tree/index.js.map +1 -1
  26. package/dist/core/tree/visitorUtils.d.ts +2 -4
  27. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  28. package/dist/core/tree/visitorUtils.js +2 -2
  29. package/dist/core/tree/visitorUtils.js.map +1 -1
  30. package/dist/entrypoints/alpha.d.ts +1 -1
  31. package/dist/entrypoints/alpha.d.ts.map +1 -1
  32. package/dist/entrypoints/alpha.js +5 -2
  33. package/dist/entrypoints/alpha.js.map +1 -1
  34. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  35. package/dist/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  36. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  37. package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  38. package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  39. package/dist/feature-libraries/comparison-forest/comparisonForest.js +98 -0
  40. package/dist/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  41. package/dist/feature-libraries/comparison-forest/index.d.ts +6 -0
  42. package/dist/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  43. package/dist/feature-libraries/comparison-forest/index.js +10 -0
  44. package/dist/feature-libraries/comparison-forest/index.js.map +1 -0
  45. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  46. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  47. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  48. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  49. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  50. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  51. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  52. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  53. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  54. package/dist/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  55. package/dist/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  56. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  57. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  58. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +18 -6
  59. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  60. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  61. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  62. package/dist/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  63. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  64. package/dist/feature-libraries/index.d.ts +4 -3
  65. package/dist/feature-libraries/index.d.ts.map +1 -1
  66. package/dist/feature-libraries/index.js +77 -72
  67. package/dist/feature-libraries/index.js.map +1 -1
  68. package/dist/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  69. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  70. package/dist/feature-libraries/mitigatedChangeFamily.js +12 -0
  71. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  72. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  73. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  74. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  75. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  76. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  77. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  78. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  79. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  80. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  81. package/dist/feature-libraries/modular-schema/invert.d.ts +15 -0
  82. package/dist/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  83. package/dist/feature-libraries/modular-schema/invert.js +159 -0
  84. package/dist/feature-libraries/modular-schema/invert.js.map +1 -0
  85. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  86. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  87. package/dist/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  88. package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  89. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  90. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  91. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  92. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  93. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  94. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  95. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  96. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  97. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  98. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  99. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  100. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  101. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +53 -406
  102. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  103. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  104. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  105. package/dist/feature-libraries/modular-schema/modularChangeUtils.js +205 -0
  106. package/dist/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  107. package/dist/feature-libraries/modular-schema/prune.d.ts +10 -0
  108. package/dist/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  109. package/dist/feature-libraries/modular-schema/prune.js +49 -0
  110. package/dist/feature-libraries/modular-schema/prune.js.map +1 -0
  111. package/dist/feature-libraries/optional-field/optionalField.js +1 -1
  112. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  113. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  114. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  115. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  116. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  117. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  118. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  119. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  120. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  121. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  122. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  123. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  124. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  125. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  126. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  127. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  128. package/dist/feature-libraries/treeTextCursor.d.ts +15 -0
  129. package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
  130. package/dist/feature-libraries/treeTextCursor.js +64 -1
  131. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  132. package/dist/index.d.ts +3 -1
  133. package/dist/index.d.ts.map +1 -1
  134. package/dist/index.js +5 -1
  135. package/dist/index.js.map +1 -1
  136. package/dist/packageVersion.d.ts +1 -1
  137. package/dist/packageVersion.d.ts.map +1 -1
  138. package/dist/packageVersion.js +1 -1
  139. package/dist/packageVersion.js.map +1 -1
  140. package/dist/shared-tree/serializedChange.d.ts +2 -2
  141. package/dist/shared-tree/serializedChange.d.ts.map +1 -1
  142. package/dist/shared-tree/serializedChange.js.map +1 -1
  143. package/dist/shared-tree/sharedTree.d.ts +6 -3
  144. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  145. package/dist/shared-tree/sharedTree.js +8 -6
  146. package/dist/shared-tree/sharedTree.js.map +1 -1
  147. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  148. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  149. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  150. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  151. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  152. package/dist/shared-tree/sharedTreeChangeFamily.js +57 -1
  153. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  154. package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
  155. package/dist/shared-tree/transactionMinimize.js +2 -2
  156. package/dist/shared-tree/transactionMinimize.js.map +1 -1
  157. package/dist/shared-tree/transactionPostProcessor.d.ts +2 -1
  158. package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  159. package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
  160. package/dist/shared-tree/treeCheckout.d.ts +8 -7
  161. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  162. package/dist/shared-tree/treeCheckout.js +1 -1
  163. package/dist/shared-tree/treeCheckout.js.map +1 -1
  164. package/dist/shared-tree-core/branch.d.ts +23 -9
  165. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  166. package/dist/shared-tree-core/branch.js +7 -0
  167. package/dist/shared-tree-core/branch.js.map +1 -1
  168. package/dist/shared-tree-core/editManager.d.ts +4 -4
  169. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  170. package/dist/shared-tree-core/editManager.js +2 -0
  171. package/dist/shared-tree-core/editManager.js.map +1 -1
  172. package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -14
  173. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  174. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  175. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  176. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  177. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  178. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  179. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  180. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  181. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  182. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  183. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  184. package/dist/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  185. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  186. package/dist/shared-tree-core/editManagerSummarizer.js +0 -1
  187. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  188. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  189. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  190. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  191. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  192. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  193. package/dist/shared-tree-core/messageCodecs.d.ts +8 -1
  194. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  195. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  196. package/dist/shared-tree-core/sharedTreeCore.d.ts +5 -5
  197. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  198. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  199. package/dist/shared-tree-core/transaction.d.ts +10 -10
  200. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  201. package/dist/shared-tree-core/transaction.js +6 -3
  202. package/dist/shared-tree-core/transaction.js.map +1 -1
  203. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  204. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  205. package/dist/simple-tree/api/eraseSchemaDetails.js +15 -0
  206. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  207. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +21 -2
  208. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  209. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  210. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  211. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  212. package/dist/simple-tree/node-kinds/map/mapNode.js +9 -0
  213. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  214. package/dist/text/textDomain.d.ts +12 -0
  215. package/dist/text/textDomain.d.ts.map +1 -1
  216. package/dist/text/textDomain.js +37 -16
  217. package/dist/text/textDomain.js.map +1 -1
  218. package/dist/text/textDomainFormatted.d.ts +155 -61
  219. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  220. package/dist/text/textDomainFormatted.js +147 -71
  221. package/dist/text/textDomainFormatted.js.map +1 -1
  222. package/dist/text/textDomainFormattedDefault.d.ts +37 -14
  223. package/dist/text/textDomainFormattedDefault.d.ts.map +1 -1
  224. package/dist/text/textDomainFormattedDefault.js +13 -5
  225. package/dist/text/textDomainFormattedDefault.js.map +1 -1
  226. package/dist/treeDataStore.d.ts +49 -0
  227. package/dist/treeDataStore.d.ts.map +1 -0
  228. package/dist/treeDataStore.js +57 -0
  229. package/dist/treeDataStore.js.map +1 -0
  230. package/dist/treeFactory.d.ts +8 -3
  231. package/dist/treeFactory.d.ts.map +1 -1
  232. package/dist/treeFactory.js +6 -1
  233. package/dist/treeFactory.js.map +1 -1
  234. package/lib/core/change-family/changeFamily.d.ts +15 -4
  235. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  236. package/lib/core/change-family/changeFamily.js.map +1 -1
  237. package/lib/core/change-family/editBuilder.d.ts +2 -3
  238. package/lib/core/change-family/editBuilder.d.ts.map +1 -1
  239. package/lib/core/change-family/editBuilder.js +1 -2
  240. package/lib/core/change-family/editBuilder.js.map +1 -1
  241. package/lib/core/change-family/index.d.ts +1 -1
  242. package/lib/core/change-family/index.d.ts.map +1 -1
  243. package/lib/core/change-family/index.js.map +1 -1
  244. package/lib/core/index.d.ts +3 -2
  245. package/lib/core/index.d.ts.map +1 -1
  246. package/lib/core/index.js +1 -1
  247. package/lib/core/index.js.map +1 -1
  248. package/lib/core/tree/delta.d.ts +62 -16
  249. package/lib/core/tree/delta.d.ts.map +1 -1
  250. package/lib/core/tree/delta.js.map +1 -1
  251. package/lib/core/tree/detachedFieldIndex.d.ts +7 -13
  252. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  253. package/lib/core/tree/detachedFieldIndex.js +7 -21
  254. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  255. package/lib/core/tree/index.d.ts +1 -0
  256. package/lib/core/tree/index.d.ts.map +1 -1
  257. package/lib/core/tree/index.js.map +1 -1
  258. package/lib/core/tree/visitorUtils.d.ts +2 -4
  259. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  260. package/lib/core/tree/visitorUtils.js +2 -2
  261. package/lib/core/tree/visitorUtils.js.map +1 -1
  262. package/lib/entrypoints/alpha.d.ts +1 -1
  263. package/lib/entrypoints/alpha.d.ts.map +1 -1
  264. package/lib/entrypoints/alpha.js +1 -1
  265. package/lib/entrypoints/alpha.js.map +1 -1
  266. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  267. package/lib/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  268. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  269. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  270. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  271. package/lib/feature-libraries/comparison-forest/comparisonForest.js +94 -0
  272. package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  273. package/lib/feature-libraries/comparison-forest/index.d.ts +6 -0
  274. package/lib/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  275. package/lib/feature-libraries/comparison-forest/index.js +6 -0
  276. package/lib/feature-libraries/comparison-forest/index.js.map +1 -0
  277. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  278. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  279. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  280. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  281. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  282. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  283. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  284. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  285. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  286. package/lib/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  287. package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  288. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  289. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  290. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +16 -4
  291. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  292. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  293. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  294. package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  295. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  296. package/lib/feature-libraries/index.d.ts +4 -3
  297. package/lib/feature-libraries/index.d.ts.map +1 -1
  298. package/lib/feature-libraries/index.js +2 -1
  299. package/lib/feature-libraries/index.js.map +1 -1
  300. package/lib/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  301. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  302. package/lib/feature-libraries/mitigatedChangeFamily.js +12 -0
  303. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  304. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  305. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  306. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  307. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  308. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  309. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  310. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  311. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  312. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  313. package/lib/feature-libraries/modular-schema/invert.d.ts +15 -0
  314. package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  315. package/lib/feature-libraries/modular-schema/invert.js +155 -0
  316. package/lib/feature-libraries/modular-schema/invert.js.map +1 -0
  317. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  318. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  319. package/lib/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  320. package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  321. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  322. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  323. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  324. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  325. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  326. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  327. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  328. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  329. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  330. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  331. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  332. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  333. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +16 -367
  334. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  335. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  336. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  337. package/lib/feature-libraries/modular-schema/modularChangeUtils.js +192 -0
  338. package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  339. package/lib/feature-libraries/modular-schema/prune.d.ts +10 -0
  340. package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  341. package/lib/feature-libraries/modular-schema/prune.js +45 -0
  342. package/lib/feature-libraries/modular-schema/prune.js.map +1 -0
  343. package/lib/feature-libraries/optional-field/optionalField.js +1 -1
  344. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  345. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  346. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  347. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  348. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  349. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  350. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  351. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  352. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  353. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  354. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  355. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  356. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  357. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  358. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  359. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  360. package/lib/feature-libraries/treeTextCursor.d.ts +15 -0
  361. package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
  362. package/lib/feature-libraries/treeTextCursor.js +62 -1
  363. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  364. package/lib/index.d.ts +3 -1
  365. package/lib/index.d.ts.map +1 -1
  366. package/lib/index.js +2 -1
  367. package/lib/index.js.map +1 -1
  368. package/lib/packageVersion.d.ts +1 -1
  369. package/lib/packageVersion.d.ts.map +1 -1
  370. package/lib/packageVersion.js +1 -1
  371. package/lib/packageVersion.js.map +1 -1
  372. package/lib/shared-tree/serializedChange.d.ts +2 -2
  373. package/lib/shared-tree/serializedChange.d.ts.map +1 -1
  374. package/lib/shared-tree/serializedChange.js.map +1 -1
  375. package/lib/shared-tree/sharedTree.d.ts +6 -3
  376. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  377. package/lib/shared-tree/sharedTree.js +9 -7
  378. package/lib/shared-tree/sharedTree.js.map +1 -1
  379. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  380. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  381. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  382. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  383. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  384. package/lib/shared-tree/sharedTreeChangeFamily.js +55 -0
  385. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  386. package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
  387. package/lib/shared-tree/transactionMinimize.js +3 -3
  388. package/lib/shared-tree/transactionMinimize.js.map +1 -1
  389. package/lib/shared-tree/transactionPostProcessor.d.ts +2 -1
  390. package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  391. package/lib/shared-tree/transactionPostProcessor.js.map +1 -1
  392. package/lib/shared-tree/treeCheckout.d.ts +8 -7
  393. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  394. package/lib/shared-tree/treeCheckout.js +1 -1
  395. package/lib/shared-tree/treeCheckout.js.map +1 -1
  396. package/lib/shared-tree-core/branch.d.ts +23 -9
  397. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  398. package/lib/shared-tree-core/branch.js +7 -0
  399. package/lib/shared-tree-core/branch.js.map +1 -1
  400. package/lib/shared-tree-core/editManager.d.ts +4 -4
  401. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  402. package/lib/shared-tree-core/editManager.js +2 -0
  403. package/lib/shared-tree-core/editManager.js.map +1 -1
  404. package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -14
  405. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  406. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  407. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  408. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  409. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  410. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  411. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  412. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  413. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  414. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  415. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  416. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  417. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  418. package/lib/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  419. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  420. package/lib/shared-tree-core/editManagerSummarizer.js +0 -1
  421. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  422. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  423. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  424. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  425. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  426. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  427. package/lib/shared-tree-core/messageCodecs.d.ts +8 -1
  428. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  429. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  430. package/lib/shared-tree-core/sharedTreeCore.d.ts +5 -5
  431. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  432. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  433. package/lib/shared-tree-core/transaction.d.ts +10 -10
  434. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  435. package/lib/shared-tree-core/transaction.js +6 -3
  436. package/lib/shared-tree-core/transaction.js.map +1 -1
  437. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  438. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  439. package/lib/simple-tree/api/eraseSchemaDetails.js +15 -0
  440. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  441. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +21 -2
  442. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  443. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  444. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  445. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  446. package/lib/simple-tree/node-kinds/map/mapNode.js +9 -0
  447. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  448. package/lib/text/textDomain.d.ts +12 -0
  449. package/lib/text/textDomain.d.ts.map +1 -1
  450. package/lib/text/textDomain.js +34 -15
  451. package/lib/text/textDomain.js.map +1 -1
  452. package/lib/text/textDomainFormatted.d.ts +155 -61
  453. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  454. package/lib/text/textDomainFormatted.js +148 -73
  455. package/lib/text/textDomainFormatted.js.map +1 -1
  456. package/lib/text/textDomainFormattedDefault.d.ts +37 -14
  457. package/lib/text/textDomainFormattedDefault.d.ts.map +1 -1
  458. package/lib/text/textDomainFormattedDefault.js +14 -6
  459. package/lib/text/textDomainFormattedDefault.js.map +1 -1
  460. package/lib/treeDataStore.d.ts +49 -0
  461. package/lib/treeDataStore.d.ts.map +1 -0
  462. package/lib/treeDataStore.js +52 -0
  463. package/lib/treeDataStore.js.map +1 -0
  464. package/lib/treeFactory.d.ts +8 -3
  465. package/lib/treeFactory.d.ts.map +1 -1
  466. package/lib/treeFactory.js +5 -0
  467. package/lib/treeFactory.js.map +1 -1
  468. package/package.json +25 -24
  469. package/src/core/change-family/changeFamily.ts +32 -4
  470. package/src/core/change-family/editBuilder.ts +1 -2
  471. package/src/core/change-family/index.ts +2 -0
  472. package/src/core/index.ts +9 -6
  473. package/src/core/tree/delta.ts +62 -16
  474. package/src/core/tree/detachedFieldIndex.ts +7 -38
  475. package/src/core/tree/index.ts +2 -0
  476. package/src/core/tree/visitorUtils.ts +3 -17
  477. package/src/entrypoints/alpha.ts +7 -3
  478. package/src/feature-libraries/chunked-forest/uniformChunk.ts +11 -1
  479. package/src/feature-libraries/comparison-forest/comparisonForest.ts +140 -0
  480. package/src/feature-libraries/comparison-forest/index.ts +6 -0
  481. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +20 -6
  482. package/src/feature-libraries/default-schema/index.ts +1 -0
  483. package/src/feature-libraries/default-schema/noChangeCodecs.ts +11 -3
  484. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +33 -5
  485. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -3
  486. package/src/feature-libraries/index.ts +5 -0
  487. package/src/feature-libraries/mitigatedChangeFamily.ts +21 -3
  488. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +10 -1
  489. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +9 -4
  490. package/src/feature-libraries/modular-schema/index.ts +1 -0
  491. package/src/feature-libraries/modular-schema/invert.ts +338 -0
  492. package/src/feature-libraries/modular-schema/minimizeModularChange.ts +3 -5
  493. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +16 -13
  494. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +3 -1
  495. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +2 -1
  496. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +45 -644
  497. package/src/feature-libraries/modular-schema/modularChangeUtils.ts +340 -0
  498. package/src/feature-libraries/modular-schema/prune.ts +69 -0
  499. package/src/feature-libraries/optional-field/optionalField.ts +1 -1
  500. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +4 -2
  501. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -2
  502. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +4 -2
  503. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +4 -2
  504. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +6 -3
  505. package/src/feature-libraries/treeTextCursor.ts +66 -1
  506. package/src/index.ts +4 -0
  507. package/src/packageVersion.ts +1 -1
  508. package/src/shared-tree/serializedChange.ts +2 -2
  509. package/src/shared-tree/sharedTree.ts +34 -14
  510. package/src/shared-tree/sharedTreeChangeCodecs.ts +11 -3
  511. package/src/shared-tree/sharedTreeChangeFamily.ts +77 -2
  512. package/src/shared-tree/transactionMinimize.ts +7 -3
  513. package/src/shared-tree/transactionPostProcessor.ts +5 -1
  514. package/src/shared-tree/treeCheckout.ts +55 -16
  515. package/src/shared-tree-core/branch.ts +40 -12
  516. package/src/shared-tree-core/editManager.ts +46 -25
  517. package/src/shared-tree-core/editManagerCodecs.ts +9 -21
  518. package/src/shared-tree-core/editManagerCodecsCommons.ts +14 -2
  519. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +18 -21
  520. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +18 -20
  521. package/src/shared-tree-core/editManagerSummarizer.ts +9 -6
  522. package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -3
  523. package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -2
  524. package/src/shared-tree-core/messageCodecs.ts +12 -2
  525. package/src/shared-tree-core/sharedTreeCore.ts +15 -6
  526. package/src/shared-tree-core/transaction.ts +47 -25
  527. package/src/simple-tree/api/eraseSchemaDetails.ts +15 -0
  528. package/src/simple-tree/node-kinds/array/arrayNode.ts +21 -2
  529. package/src/simple-tree/node-kinds/map/mapNode.ts +24 -2
  530. package/src/text/textDomain.ts +29 -6
  531. package/src/text/textDomainFormatted.ts +351 -134
  532. package/src/text/textDomainFormattedDefault.ts +25 -16
  533. package/src/treeDataStore.ts +125 -0
  534. package/src/treeFactory.ts +11 -3
@@ -5,9 +5,8 @@
5
5
  import type { TreeNodeFromImplicitAllowedTypes, InsertableTreeNodeFromImplicitAllowedTypes } from "../simple-tree/index.js";
6
6
  import { FormattedTextAsTree } 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 FormattedTextAsTree} 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
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 FormattedTextAsTree}.
12
11
  * @internal
13
12
  */
@@ -18,15 +17,28 @@ export declare namespace FormattedTextAsTreeDefault {
18
17
  * @internal
19
18
  */
20
19
  export type FormattedAtom = FormattedTextAsTree.FormattedAtom<CharacterFormat, StringAtomContent>;
21
- const CharacterFormat_base: import("../simple-tree/index.js").ObjectNodeSchemaWorkaround<"com.fluidframework.text.formatted.default.CharacterFormat", {
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,12 +57,12 @@ 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>;
@@ -99,6 +111,7 @@ export declare namespace FormattedTextAsTreeDefault {
99
111
  };
100
112
  /**
101
113
  * {@inheritdoc FormattedTextAsTreeDefault.(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 [FormattedTextAsTree.StringTextAtomStatics & import("../simple-tree/index.js").TreeNodeSchema<"com.fluidframework.text.formatted.StringTextAtom", import("../simple-tree/index.js").NodeKind, FormattedTextAsTree.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
260
  * {@inheritdoc FormattedTextAsTreeDefault.(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> = FormattedTextAsTree.Statics<TTree, typeof CharacterFormat>;
254
271
  /**
255
272
  * Insertable shape for a formatted text atom used by {@link FormattedTextAsTree.Members.insertWithFormattingAt}.
273
+ * @sealed
256
274
  * @internal
257
275
  */
258
- export type FormattedAtomInsertable = FormattedTextAsTree.FormattedAtom<InsertableTreeNodeFromImplicitAllowedTypes<typeof CharacterFormat>, InsertableTreeNodeFromImplicitAllowedTypes<FormattedTextAtoms>>;
276
+ export type FormattedAtomInsertable = FormattedTextAsTree.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 = FormattedTextAsTree.TextAtomSchemas<[typeof StringLineAtom]>;
285
+ const Tree_base: FormattedTextAsTree.FormattedTextSchema<"com.fluidframework.text.formatted.default", typeof CharacterFormat, readonly [typeof StringLineAtom]>;
286
+ /**
287
+ * The schema produced using {@link FormattedTextAsTree.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;IAC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;KAAG;;CACJ"}
@@ -10,7 +10,7 @@ const textDomainFormatted_js_1 = require("./textDomainFormatted.js");
10
10
  /**
11
11
  * Schema factory for default formatted text types which are not generic.
12
12
  */
13
- const sf = new index_js_1.SchemaFactoryAlpha("com.fluidframework.text.formatted.default");
13
+ const sf = new index_js_1.SchemaFactoryBeta("com.fluidframework.text.formatted.default");
14
14
  const defaultFormat = {
15
15
  bold: false,
16
16
  italic: false,
@@ -19,9 +19,8 @@ const defaultFormat = {
19
19
  font: "Arial",
20
20
  };
21
21
  /**
22
- * A collection of text related types, schema and utilities for working with text beyond the basic {@link SchemaStatics.string}.
22
+ * 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.
23
23
  * @remarks
24
- * 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.
25
24
  * 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}.
26
25
  * @internal
27
26
  */
@@ -29,9 +28,10 @@ var FormattedTextAsTreeDefault;
29
28
  (function (FormattedTextAsTreeDefault) {
30
29
  /**
31
30
  * Formatting options for characters.
31
+ * @sealed
32
32
  * @internal
33
33
  */
34
- class CharacterFormat extends sf.objectAlpha("CharacterFormat", {
34
+ class CharacterFormat extends sf.object("CharacterFormat", {
35
35
  bold: index_js_1.SchemaFactory.boolean,
36
36
  italic: index_js_1.SchemaFactory.boolean,
37
37
  underline: index_js_1.SchemaFactory.boolean,
@@ -67,6 +67,7 @@ var FormattedTextAsTreeDefault;
67
67
  * The optional indent level mirrors Quill's indent attribute,
68
68
  * which is applies to the line before the line break.
69
69
  * Any tagged line can be indented independently.
70
+ * @sealed
70
71
  * @internal
71
72
  */
72
73
  class StringLineAtom extends sf.object("StringLineAtom", {
@@ -81,13 +82,20 @@ var FormattedTextAsTreeDefault;
81
82
  FormattedTextAsTreeDefault.StringLineAtom = StringLineAtom;
82
83
  /**
83
84
  * Types of "atoms" that make up the text.
85
+ * @sealed
84
86
  * @internal
85
87
  */
86
88
  FormattedTextAsTreeDefault.StringAtomContent = [
87
89
  textDomainFormatted_js_1.FormattedTextAsTree.StringTextAtom,
88
90
  StringLineAtom,
89
91
  ];
90
- class Tree extends textDomainFormatted_js_1.FormattedTextAsTree.createSchema(new index_js_1.SchemaFactoryBeta("default"), CharacterFormat, [StringLineAtom], defaultFormat) {
92
+ /**
93
+ * The schema produced using {@link FormattedTextAsTree.createSchema} with hard-coded assumptions
94
+ * about what kind of embedded content and what kind of formatting is supported.
95
+ * @sealed
96
+ * @internal
97
+ */
98
+ class Tree extends textDomainFormatted_js_1.FormattedTextAsTree.createSchema(sf, CharacterFormat, [StringLineAtom], defaultFormat) {
91
99
  }
92
100
  FormattedTextAsTreeDefault.Tree = Tree;
93
101
  })(FormattedTextAsTreeDefault || (exports.FormattedTextAsTreeDefault = FormattedTextAsTreeDefault = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"textDomainFormattedDefault.js","sourceRoot":"","sources":["../../src/text/textDomainFormattedDefault.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,sDAKiC;AAMjC,qEAA+D;AAE/D;;GAEG;AACH,MAAM,EAAE,GAAG,IAAI,6BAAkB,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,IAAiB,0BAA0B,CA+G1C;AA/GD,WAAiB,0BAA0B;IAW1C;;;OAGG;IACH,MAAa,eAAgB,SAAQ,EAAE,CAAC,WAAW,CAAC,iBAAiB,EAAE;QACtE,IAAI,EAAE,wBAAa,CAAC,OAAO;QAC3B,MAAM,EAAE,wBAAa,CAAC,OAAO;QAC7B,SAAS,EAAE,wBAAa,CAAC,OAAO;QAChC,IAAI,EAAE,wBAAa,CAAC,MAAM;QAC1B,IAAI,EAAE,wBAAa,CAAC,MAAM;KAC1B,CAAC;;IACsB,6BAAa,GAAG,IAAI,eAAe,CAAC,aAAa,CAAC,CAAC;IAP9D,0CAAe,kBAQ3B,CAAA;IAED;;;OAGG;IACU,kCAAO,GAAG,IAAA,0BAAe,EAAC,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,wBAAa,CAAC,MAAM;KAC5B,CAAC;QAHF;;YAIiB,YAAO,GAAG,IAAI,CAAC;QAChC,CAAC;KAAA;IALY,yCAAc,iBAK1B,CAAA;IAED;;;OAGG;IACU,4CAAiB,GAAG;QAChC,4CAAmB,CAAC,cAAc;QAClC,cAAc;KACL,CAAC;IAgCX,MAAa,IAAK,SAAQ,4CAAmB,CAAC,YAAY,CACzD,IAAI,4BAAiB,CAAC,SAAS,CAAC,EAChC,eAAe,EACf,CAAC,cAAc,CAAC,EAChB,aAAa,CACb;KAAG;IALS,+BAAI,OAKb,CAAA;AACL,CAAC,EA/GgB,0BAA0B,0CAA1B,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,sDAA4F;AAM5F,qEAA+D;AAE/D;;GAEG;AACH,MAAM,EAAE,GAAG,IAAI,4BAAiB,CAAC,2CAA2C,CAAC,CAAC;AAE9E,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;;;;;GAKG;AACH,IAAiB,0BAA0B,CA8H1C;AA9HD,WAAiB,0BAA0B;IAW1C;;;;OAIG;IACH,MAAa,eAAgB,SAAQ,EAAE,CAAC,MAAM,CAAC,iBAAiB,EAAE;QACjE,IAAI,EAAE,wBAAa,CAAC,OAAO;QAC3B,MAAM,EAAE,wBAAa,CAAC,OAAO;QAC7B,SAAS,EAAE,wBAAa,CAAC,OAAO;QAChC,IAAI,EAAE,wBAAa,CAAC,MAAM;QAC1B,IAAI,EAAE,wBAAa,CAAC,MAAM;KAC1B,CAAC;;IACsB,6BAAa,GAAG,IAAI,eAAe,CAAC,aAAa,CAAC,CAAC;IAP9D,0CAAe,kBAQ3B,CAAA;IAED;;;OAGG;IACU,kCAAO,GAAG,IAAA,0BAAe,EAAC,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;IAQH;;;;;;;;;;;OAWG;IACH,MAAa,cAAe,SAAQ,EAAE,CAAC,MAAM,CAAC,gBAAgB,EAAE;QAC/D,GAAG,EAAE,2BAAA,OAAO,CAAC,MAAM;QACnB,MAAM,EAAE,wBAAa,CAAC,MAAM;KAC5B,CAAC;QAHF;;YAIiB,YAAO,GAAG,IAAI,CAAC;QAChC,CAAC;KAAA;IALY,yCAAc,iBAK1B,CAAA;IAED;;;;OAIG;IACU,4CAAiB,GAAG;QAChC,4CAAmB,CAAC,cAAc;QAClC,cAAc;KACL,CAAC;IAqCX;;;;;OAKG;IACH,MAAa,IAAK,SAAQ,4CAAmB,CAAC,YAAY,CACzD,EAAE,EACF,eAAe,EACf,CAAC,cAAc,CAAC,EAChB,aAAa,CACb;KAAG;IALS,+BAAI,OAKb,CAAA;AACL,CAAC,EA9HgB,0BAA0B,0CAA1B,0BAA0B,QA8H1C","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 { FormattedTextAsTree } 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 FormattedTextAsTree} 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 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 * @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 FormattedTextAsTreeDefault.(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 = [\n\t\tFormattedTextAsTree.StringTextAtom,\n\t\tStringLineAtom,\n\t] as const;\n\t/**\n\t * {@inheritdoc FormattedTextAsTreeDefault.(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> = FormattedTextAsTree.Statics<\n\t\tTTree,\n\t\ttypeof CharacterFormat\n\t>;\n\n\t/**\n\t * Insertable shape for a formatted text atom used by {@link FormattedTextAsTree.Members.insertWithFormattingAt}.\n\t * @sealed\n\t * @internal\n\t */\n\texport type FormattedAtomInsertable = FormattedTextAsTree.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 = FormattedTextAsTree.TextAtomSchemas<[typeof StringLineAtom]>;\n\n\t/**\n\t * The schema produced using {@link FormattedTextAsTree.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 FormattedTextAsTree.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
@@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AAW,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,57 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.instantiateTreeFirstTime = exports.defineTreeDataStore = void 0;
8
+ const internal_1 = require("@fluidframework/shared-object-base/internal");
9
+ const treeFactory_js_1 = require("./treeFactory.js");
10
+ /**
11
+ * Defines a {@link @fluidframework/driver-definitions#DataStoreKind} for a simple tree data store.
12
+ * @remarks
13
+ * This is a simple tree specific wrapper around {@link @fluidframework/shared-object-base#defineDataStore}.
14
+ * Use {@link @fluidframework/shared-object-base#defineDataStore} directly if more control is needed, even if still just using tree.
15
+ *
16
+ * This uses {@link instantiateTreeFirstTime} to create the tree, and optionally initialize it.
17
+ * @alpha
18
+ */
19
+ function defineTreeDataStore(options) {
20
+ const registry = typeof options.registry === "function"
21
+ ? options.registry
22
+ : (0, internal_1.sharedObjectRegistryFromIterable)([...(options.registry ?? [treeFactory_js_1.SharedTreeAlpha])]);
23
+ const result = (0, internal_1.defineDataStore)({
24
+ type: options.type,
25
+ registry,
26
+ async instantiateFirstTime(rootCreator, creator) {
27
+ return instantiateTreeFirstTime(rootCreator, creator, options.key ?? treeFactory_js_1.SharedTreeAlpha, options);
28
+ },
29
+ async view(tree) {
30
+ const view = tree.viewWith(options.config);
31
+ return view;
32
+ },
33
+ });
34
+ return result;
35
+ }
36
+ exports.defineTreeDataStore = defineTreeDataStore;
37
+ /**
38
+ * Simple tree instantiation helper.
39
+ * @remarks
40
+ * This is used by {@link defineTreeDataStore}, but can also be used in custom data stores with {@link @fluidframework/shared-object-base#defineDataStore}.
41
+ * Typically used to implement {@link @fluidframework/shared-object-base#DataStoreOptions.instantiateFirstTime} to create the tree and optionally initialize it.
42
+ * @alpha
43
+ */
44
+ async function instantiateTreeFirstTime(rootCreator, creator, treeKind, options) {
45
+ const tree = await rootCreator.createSharedObject(treeKind);
46
+ initializeTreeFirstTime(tree, options, creator);
47
+ return tree;
48
+ }
49
+ exports.instantiateTreeFirstTime = instantiateTreeFirstTime;
50
+ function initializeTreeFirstTime(tree, options, creator) {
51
+ if (options.initializer !== undefined) {
52
+ const view = tree.viewWith(options.config);
53
+ view.initialize(options.initializer(creator));
54
+ view.dispose();
55
+ }
56
+ }
57
+ //# sourceMappingURL=treeDataStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeDataStore.js","sourceRoot":"","sources":["../src/treeDataStore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,0EAGqD;AASrD,qDAAmD;AA+BnD;;;;;;;;GAQG;AACH,SAAgB,mBAAmB,CAClC,OAAsC;IAEtC,MAAM,QAAQ,GACb,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU;QACrC,CAAC,CAAC,OAAO,CAAC,QAAQ;QAClB,CAAC,CAAC,IAAA,2CAAgC,EAAC,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,gCAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnF,MAAM,MAAM,GAAG,IAAA,0BAAe,EAA2B;QACxD,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,QAAQ;QACR,KAAK,CAAC,oBAAoB,CACzB,WAAgC,EAChC,OAA4B;YAE5B,OAAO,wBAAwB,CAC9B,WAAW,EACX,OAAO,EACP,OAAO,CAAC,GAAG,IAAI,gCAAe,EAC9B,OAAO,CACP,CAAC;QACH,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,IAAI;YACd,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAC3C,OAAO,IAAI,CAAC;QACb,CAAC;KACD,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AACf,CAAC;AA5BD,kDA4BC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,wBAAwB,CAC7C,WAAgC,EAChC,OAA4B,EAC5B,QAAgC,EAChC,OAAsE;IAEtE,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC5D,uBAAuB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAChD,OAAO,IAAI,CAAC;AACb,CAAC;AATD,4DASC;AAED,SAAS,uBAAuB,CAC/B,IAAW,EACX,OAAsE,EACtE,OAA4B;IAE5B,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC3C,IAAI,CAAC,UAAU,CAAC,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,WAA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CAAC;AAGpD;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,aAAa,EAAE,YAAY;CAAG;AA8DnE;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAAC,KAAK,CACjD,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,qBAAqB,CAAC,KAAK,CAA4B,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;;;;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,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"}
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.resolveOptions = exports.configuredSharedTreeInternal = exports.configuredSharedTree = exports.configuredSharedTreeAlpha = exports.configuredSharedTreeBetaLegacy = exports.configuredSharedTreeBeta = exports.SharedTree = void 0;
7
+ exports.resolveOptions = exports.configuredSharedTreeInternal = exports.configuredSharedTree = exports.configuredSharedTreeAlpha = exports.configuredSharedTreeBetaLegacy = exports.configuredSharedTreeBeta = exports.SharedTreeAlpha = exports.SharedTree = void 0;
8
8
  const internal_1 = require("@fluidframework/shared-object-base/internal");
9
9
  const internal_2 = require("@fluidframework/telemetry-utils/internal");
10
10
  const index_js_1 = require("./codec/index.js");
@@ -57,6 +57,11 @@ function treeKernelFactory(options) {
57
57
  * @legacy @beta
58
58
  */
59
59
  exports.SharedTree = configuredSharedTree({});
60
+ /**
61
+ * {@link SharedTree} but without legacy types, and with alpha types.
62
+ * @alpha
63
+ */
64
+ exports.SharedTreeAlpha = configuredSharedTree({});
60
65
  /**
61
66
  * {@link SharedTree} but allowing a non-default configuration.
62
67
  * @remarks
@@ -1 +1 @@
1
- {"version":3,"file":"treeFactory.js","sourceRoot":"","sources":["../src/treeFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,0EAQqD;AACrD,uEAAsE;AAEtE,+CAA0E;AAC1E,8CAGyB;AACzB,qDAOgC;AAChC,0DAKqC;AACrC,uEAAwF;AAExF,8CAA0D;AAS1D;;;;;GAKG;AACH,SAAS,iBAAiB,CACzB,OAAkC;IAElC,SAAS,kBAAkB,CAAC,IAAgB;QAC3C,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACrC,MAAM,IAAI,qBAAU,CAAC,gDAAgD,CAAC,CAAC;QACxE,CAAC;QAED,MAAM,EAAE,mBAAmB,EAAE,GAAG,YAAY,EAAE,GAAG,OAAO,CAAC;QAEzD,MAAM,eAAe,GAAG;YACvB,GAAG,YAAY;YACf,SAAS;YACT,kGAAkG;YAClG,0BAA0B;YAC1B,oGAAoG;YACpG,sGAAsG;YACtG,oFAAoF;YACpF,gGAAgG;YAChG,wIAAwI;YACxI,mBAAmB,EAClB,mBAAmB,IAAI,IAAI,CAAC,mBAAmB,IAAI,6BAAkB,CAAC,IAAI;SAC3E,CAAC;QAEF,OAAO,IAAI,2BAAgB,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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,0EASqD;AACrD,uEAAsE;AAE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AG,oBAAoB,CAAC,OAAO,CAAC;KAChC,CAAC;IACF,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/C,IAAA,uBAAY,EAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC;AARD,wCAQC;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,+BAAoB,EAAE,mCAAwB,CAAC,eAAe,CAAC;QAChE,CAAC,2BAAgB,EAAE,+BAAoB,CAAC,eAAe,CAAC;QACxD,CAAC,yCAA8B,CAAC,IAAI,EAAE,0CAA+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"]}
@@ -7,10 +7,12 @@ import type { ICodecFamily, IJsonCodec } from "../../codec/index.js";
7
7
  import type { SchemaAndPolicy } from "../../core/index.js";
8
8
  import type { IdentifierHealingConfig, JsonCompatibleReadOnly } from "../../util/index.js";
9
9
  import type { ChangeRebaser, RevisionTag, TaggedChange } from "../rebase/index.js";
10
- export interface ChangeFamily<TEditor extends ChangeFamilyEditor, TChange> {
10
+ export type ProcessChangeFn<TChange, TChangeProcessingContext> = TChangeProcessingContext extends never ? (change: TChange) => TChange : (change: TChange, context: TChangeProcessingContext) => TChange;
11
+ export interface ChangeFamily<TEditor extends ChangeFamilyEditor, TChange, TChangeProcessingContext = never> {
11
12
  buildEditor(mintRevisionTag: () => RevisionTag, changeReceiver: (change: TaggedChange<TChange>) => void): TEditor;
12
13
  readonly rebaser: ChangeRebaser<TChange>;
13
- readonly codecs: ICodecFamily<TChange, ChangeEncodingContext>;
14
+ readonly codecs: ICodecFamily<TChange, ChangeEncodingContext, ChangeDecodingContext>;
15
+ buildProcessor(processFn: ProcessChangeFn<TChange, TChangeProcessingContext>): (change: TChange) => TChange;
14
16
  }
15
17
  export interface ChangeEncodingContext {
16
18
  readonly originatorId: SessionId;
@@ -28,13 +30,22 @@ export interface ChangeEncodingContext {
28
30
  * (possibly broken) attach-summary blob, never when applying ops.
29
31
  */
30
32
  readonly isSummary: boolean;
33
+ }
34
+ /**
35
+ * Context provided to change codecs when decoding.
36
+ * @remarks
37
+ * The same as {@link ChangeEncodingContext} except that it omits `schema` (only consulted when
38
+ * *encoding*, for schema-aware compression) and adds `healing` (only consulted when *decoding*, to
39
+ * recover unresolvable identifiers from a summary blob).
40
+ */
41
+ export type ChangeDecodingContext = Omit<ChangeEncodingContext, "schema"> & {
31
42
  /**
32
43
  * Heal-on-decode workaround configuration. See {@link IdentifierHealingConfig}.
33
44
  * Only takes effect when `isSummary` is also `true`.
34
45
  */
35
46
  readonly healing?: IdentifierHealingConfig;
36
- }
37
- export type ChangeFamilyCodec<TChange> = IJsonCodec<TChange, JsonCompatibleReadOnly, JsonCompatibleReadOnly, ChangeEncodingContext>;
47
+ };
48
+ export type ChangeFamilyCodec<TChange> = IJsonCodec<TChange, JsonCompatibleReadOnly, JsonCompatibleReadOnly, ChangeEncodingContext, ChangeDecodingContext>;
38
49
  export interface ChangeFamilyEditor {
39
50
  /**
40
51
  * Must be called when a new transaction starts.
@@ -1 +1 @@
1
- {"version":3,"file":"changeFamily.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/changeFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE9E,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBA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,EAAE,aAAa,CAAC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IAClC;;;;;;;;;OASG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,GAAG;IAC3E;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,uBAAuB,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,OAAO,IAAI,UAAU,CAClD,OAAO,EACP,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,CACrB,CAAC;AAEF,MAAM,WAAW,kBAAkB;IAClC;;;;;;;OAOG;IACH,gBAAgB,IAAI,IAAI,CAAC;IAEzB;;;;;;;OAOG;IACH,eAAe,IAAI,IAAI,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"changeFamily.js","sourceRoot":"","sources":["../../../src/core/change-family/changeFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { ICodecFamily, IJsonCodec } from \"../../codec/index.js\";\nimport type { SchemaAndPolicy } from \"../../core/index.js\";\nimport type { IdentifierHealingConfig, JsonCompatibleReadOnly } from \"../../util/index.js\";\nimport type { ChangeRebaser, RevisionTag, TaggedChange } from \"../rebase/index.js\";\n\nexport interface ChangeFamily<TEditor extends ChangeFamilyEditor, TChange> {\n\tbuildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<TChange>) => void,\n\t): TEditor;\n\n\treadonly rebaser: ChangeRebaser<TChange>;\n\treadonly codecs: ICodecFamily<TChange, ChangeEncodingContext>;\n}\n\nexport interface ChangeEncodingContext {\n\treadonly originatorId: SessionId;\n\treadonly revision: RevisionTag | undefined;\n\treadonly idCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n\t/**\n\t * `true` when this context is encoding to or decoding from a summary blob.\n\t * `false` when this context is for an op (or any other non-summary path,\n\t * including utility encoders that aren't tied to persistence).\n\t *\n\t * @remarks\n\t * Used to gate decode-time recovery behavior — for example, healing of\n\t * unresolvable identifier IDs — that should only run when loading a\n\t * (possibly broken) attach-summary blob, never when applying ops.\n\t */\n\treadonly isSummary: boolean;\n\t/**\n\t * Heal-on-decode workaround configuration. See {@link IdentifierHealingConfig}.\n\t * Only takes effect when `isSummary` is also `true`.\n\t */\n\treadonly healing?: IdentifierHealingConfig;\n}\n\nexport type ChangeFamilyCodec<TChange> = IJsonCodec<\n\tTChange,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tChangeEncodingContext\n>;\n\nexport interface ChangeFamilyEditor {\n\t/**\n\t * Must be called when a new transaction starts.\n\t *\n\t * Note: transactions are an optional feature. It is valid to make edits outside of a transaction.\n\t *\n\t * For each call to this function, a matching call to `exitTransaction` must be made at a later time.\n\t * Can be called repeatedly to indicate the start of nesting transactions.\n\t */\n\tenterTransaction(): void;\n\n\t/**\n\t * Must be called when a transaction ends.\n\t *\n\t * Note: transactions are an optional feature. It is valid to make edits outside of a transaction.\n\t *\n\t * For each call to this function, a matching call to `enterTransaction` must be made at an earlier time.\n\t * Can be called repeatedly to indicate the end of nesting transactions.\n\t */\n\texitTransaction(): void;\n}\n"]}
1
+ {"version":3,"file":"changeFamily.js","sourceRoot":"","sources":["../../../src/core/change-family/changeFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { ICodecFamily, IJsonCodec } from \"../../codec/index.js\";\nimport type { SchemaAndPolicy } from \"../../core/index.js\";\nimport type { IdentifierHealingConfig, JsonCompatibleReadOnly } from \"../../util/index.js\";\nimport type { ChangeRebaser, RevisionTag, TaggedChange } from \"../rebase/index.js\";\n\nexport type ProcessChangeFn<TChange, TChangeProcessingContext> =\n\tTChangeProcessingContext extends never\n\t\t? (change: TChange) => TChange\n\t\t: (change: TChange, context: TChangeProcessingContext) => TChange;\n\nexport interface ChangeFamily<\n\tTEditor extends ChangeFamilyEditor,\n\tTChange,\n\t// For simplicity, may be a concrete ChangeFamily implementation such as\n\t// ChangeFamilyFoo implements ChangeFamily<EditorFoo, ChangeFoo, ChangeFamilyFoo>\n\t// to provide all details and helpers that processFn for ChangeFoo\n\t// may require, but there is no requirement to follow that pattern.\n\tTChangeProcessingContext = never,\n> {\n\tbuildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<TChange>) => void,\n\t): TEditor;\n\n\treadonly rebaser: ChangeRebaser<TChange>;\n\treadonly codecs: ICodecFamily<TChange, ChangeEncodingContext, ChangeDecodingContext>;\n\n\tbuildProcessor(\n\t\tprocessFn: ProcessChangeFn<TChange, TChangeProcessingContext>,\n\t): (change: TChange) => TChange;\n}\n\nexport interface ChangeEncodingContext {\n\treadonly originatorId: SessionId;\n\treadonly revision: RevisionTag | undefined;\n\treadonly idCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n\t/**\n\t * `true` when this context is encoding to or decoding from a summary blob.\n\t * `false` when this context is for an op (or any other non-summary path,\n\t * including utility encoders that aren't tied to persistence).\n\t *\n\t * @remarks\n\t * Used to gate decode-time recovery behavior — for example, healing of\n\t * unresolvable identifier IDs — that should only run when loading a\n\t * (possibly broken) attach-summary blob, never when applying ops.\n\t */\n\treadonly isSummary: boolean;\n}\n\n/**\n * Context provided to change codecs when decoding.\n * @remarks\n * The same as {@link ChangeEncodingContext} except that it omits `schema` (only consulted when\n * *encoding*, for schema-aware compression) and adds `healing` (only consulted when *decoding*, to\n * recover unresolvable identifiers from a summary blob).\n */\nexport type ChangeDecodingContext = Omit<ChangeEncodingContext, \"schema\"> & {\n\t/**\n\t * Heal-on-decode workaround configuration. See {@link IdentifierHealingConfig}.\n\t * Only takes effect when `isSummary` is also `true`.\n\t */\n\treadonly healing?: IdentifierHealingConfig;\n};\n\nexport type ChangeFamilyCodec<TChange> = IJsonCodec<\n\tTChange,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tChangeEncodingContext,\n\tChangeDecodingContext\n>;\n\nexport interface ChangeFamilyEditor {\n\t/**\n\t * Must be called when a new transaction starts.\n\t *\n\t * Note: transactions are an optional feature. It is valid to make edits outside of a transaction.\n\t *\n\t * For each call to this function, a matching call to `exitTransaction` must be made at a later time.\n\t * Can be called repeatedly to indicate the start of nesting transactions.\n\t */\n\tenterTransaction(): void;\n\n\t/**\n\t * Must be called when a transaction ends.\n\t *\n\t * Note: transactions are an optional feature. It is valid to make edits outside of a transaction.\n\t *\n\t * For each call to this function, a matching call to `enterTransaction` must be made at an earlier time.\n\t * Can be called repeatedly to indicate the end of nesting transactions.\n\t */\n\texitTransaction(): void;\n}\n"]}
@@ -3,11 +3,10 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { TaggedChange } from "../rebase/index.js";
6
- import type { ChangeFamily, ChangeFamilyEditor } from "./changeFamily.js";
6
+ import type { ChangeFamilyEditor } from "./changeFamily.js";
7
7
  export declare abstract class EditBuilder<TChange> implements ChangeFamilyEditor {
8
- protected readonly changeFamily: ChangeFamily<ChangeFamilyEditor, TChange>;
9
8
  private readonly changeReceiver;
10
- constructor(changeFamily: ChangeFamily<ChangeFamilyEditor, TChange>, changeReceiver: (change: TaggedChange<TChange>) => void);
9
+ constructor(changeReceiver: (change: TaggedChange<TChange>) => void);
11
10
  /**
12
11
  * Subclasses add editing methods which call this with their generated edits.
13
12
  *
@@ -1 +1 @@
1
- {"version":3,"file":"editBuilder.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/editBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE1E,8BAAsB,WAAW,CAAC,OAAO,CAAE,YAAW,kBAAkB;IAEtE,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC;IAC1E,OAAO,CAAC,QAAQ,CAAC,cAAc;gBADZ,YAAY,EAAE,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,EACzD,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,IAAI;IAGzE;;;;OAIG;IACH,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI;IAInD,gBAAgB,IAAI,IAAI;IACxB,eAAe,IAAI,IAAI;CAC9B"}
1
+ {"version":3,"file":"editBuilder.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/editBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,8BAAsB,WAAW,CAAC,OAAO,CAAE,YAAW,kBAAkB;IAEtE,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,IAAI;IAGzE;;;;OAIG;IACH,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI;IAInD,gBAAgB,IAAI,IAAI;IACxB,eAAe,IAAI,IAAI;CAC9B"}
@@ -3,8 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export class EditBuilder {
6
- constructor(changeFamily, changeReceiver) {
7
- this.changeFamily = changeFamily;
6
+ constructor(changeReceiver) {
8
7
  this.changeReceiver = changeReceiver;
9
8
  }
10
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"editBuilder.js","sourceRoot":"","sources":["../../../src/core/change-family/editBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,OAAgB,WAAW;IAChC,YACoB,YAAuD,EACzD,cAAuD;QADrD,iBAAY,GAAZ,YAAY,CAA2C;QACzD,mBAAc,GAAd,cAAc,CAAyC;IACtE,CAAC;IAEJ;;;;OAIG;IACO,WAAW,CAAC,MAA6B;QAClD,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAEM,gBAAgB,KAAU,CAAC;IAC3B,eAAe,KAAU,CAAC;CACjC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { TaggedChange } from \"../rebase/index.js\";\n\nimport type { ChangeFamily, ChangeFamilyEditor } from \"./changeFamily.js\";\n\nexport abstract class EditBuilder<TChange> implements ChangeFamilyEditor {\n\tpublic constructor(\n\t\tprotected readonly changeFamily: ChangeFamily<ChangeFamilyEditor, TChange>,\n\t\tprivate readonly changeReceiver: (change: TaggedChange<TChange>) => void,\n\t) {}\n\n\t/**\n\t * Subclasses add editing methods which call this with their generated edits.\n\t *\n\t * @sealed\n\t */\n\tprotected applyChange(change: TaggedChange<TChange>): void {\n\t\tthis.changeReceiver(change);\n\t}\n\n\tpublic enterTransaction(): void {}\n\tpublic exitTransaction(): void {}\n}\n"]}
1
+ {"version":3,"file":"editBuilder.js","sourceRoot":"","sources":["../../../src/core/change-family/editBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,OAAgB,WAAW;IAChC,YACkB,cAAuD;QAAvD,mBAAc,GAAd,cAAc,CAAyC;IACtE,CAAC;IAEJ;;;;OAIG;IACO,WAAW,CAAC,MAA6B;QAClD,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAEM,gBAAgB,KAAU,CAAC;IAC3B,eAAe,KAAU,CAAC;CACjC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { TaggedChange } from \"../rebase/index.js\";\n\nimport type { ChangeFamilyEditor } from \"./changeFamily.js\";\n\nexport abstract class EditBuilder<TChange> implements ChangeFamilyEditor {\n\tpublic constructor(\n\t\tprivate readonly changeReceiver: (change: TaggedChange<TChange>) => void,\n\t) {}\n\n\t/**\n\t * Subclasses add editing methods which call this with their generated edits.\n\t *\n\t * @sealed\n\t */\n\tprotected applyChange(change: TaggedChange<TChange>): void {\n\t\tthis.changeReceiver(change);\n\t}\n\n\tpublic enterTransaction(): void {}\n\tpublic exitTransaction(): void {}\n}\n"]}
@@ -2,6 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export type { ChangeFamily, ChangeFamilyEditor, ChangeEncodingContext, ChangeFamilyCodec, } from "./changeFamily.js";
5
+ export type { ChangeFamily, ChangeFamilyEditor, ChangeEncodingContext, ChangeDecodingContext, ChangeFamilyCodec, ProcessChangeFn, } from "./changeFamily.js";
6
6
  export { EditBuilder } from "./editBuilder.js";
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}