@fluidframework/tree 2.114.0 → 2.116.0-416006

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 (242) hide show
  1. package/CHANGELOG.md +191 -0
  2. package/api-report/tree.alpha.api.md +108 -39
  3. package/dist/core/index.d.ts +1 -1
  4. package/dist/core/index.d.ts.map +1 -1
  5. package/dist/core/index.js +3 -2
  6. package/dist/core/index.js.map +1 -1
  7. package/dist/core/rebase/index.d.ts +1 -1
  8. package/dist/core/rebase/index.d.ts.map +1 -1
  9. package/dist/core/rebase/index.js +2 -1
  10. package/dist/core/rebase/index.js.map +1 -1
  11. package/dist/core/rebase/types.d.ts +110 -0
  12. package/dist/core/rebase/types.d.ts.map +1 -1
  13. package/dist/core/rebase/types.js +47 -1
  14. package/dist/core/rebase/types.js.map +1 -1
  15. package/dist/entrypoints/alpha.d.ts +1 -1
  16. package/dist/entrypoints/alpha.d.ts.map +1 -1
  17. package/dist/entrypoints/alpha.js +6 -4
  18. package/dist/entrypoints/alpha.js.map +1 -1
  19. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +9 -6
  20. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  21. package/dist/feature-libraries/chunked-forest/codec/codecs.js +16 -13
  22. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  23. package/dist/index.d.ts +3 -3
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +6 -5
  26. package/dist/index.js.map +1 -1
  27. package/dist/packageVersion.d.ts +1 -1
  28. package/dist/packageVersion.d.ts.map +1 -1
  29. package/dist/packageVersion.js +1 -1
  30. package/dist/packageVersion.js.map +1 -1
  31. package/dist/shared-tree/sharedTree.d.ts +5 -0
  32. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  33. package/dist/shared-tree/sharedTree.js +1 -1
  34. package/dist/shared-tree/sharedTree.js.map +1 -1
  35. package/dist/shared-tree/treeCheckout.d.ts +5 -0
  36. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  37. package/dist/shared-tree/treeCheckout.js +58 -12
  38. package/dist/shared-tree/treeCheckout.js.map +1 -1
  39. package/dist/shared-tree-core/branch.d.ts +1 -0
  40. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  41. package/dist/shared-tree-core/branch.js.map +1 -1
  42. package/dist/shared-tree-core/sharedTreeCore.js +1 -1
  43. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  44. package/dist/simple-tree/api/index.d.ts +1 -1
  45. package/dist/simple-tree/api/index.d.ts.map +1 -1
  46. package/dist/simple-tree/api/index.js +2 -3
  47. package/dist/simple-tree/api/index.js.map +1 -1
  48. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +3 -3
  49. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  50. package/dist/simple-tree/api/schemaStatics.d.ts +6 -7
  51. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  52. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  53. package/dist/simple-tree/api/treeNodeApi.d.ts +20 -24
  54. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  55. package/dist/simple-tree/api/treeNodeApi.js +48 -49
  56. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  57. package/dist/simple-tree/core/treeNode.d.ts +5 -6
  58. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  59. package/dist/simple-tree/core/treeNode.js +2 -4
  60. package/dist/simple-tree/core/treeNode.js.map +1 -1
  61. package/dist/simple-tree/core/withType.d.ts +20 -7
  62. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  63. package/dist/simple-tree/core/withType.js +4 -7
  64. package/dist/simple-tree/core/withType.js.map +1 -1
  65. package/dist/simple-tree/index.d.ts +2 -2
  66. package/dist/simple-tree/index.d.ts.map +1 -1
  67. package/dist/simple-tree/index.js +3 -4
  68. package/dist/simple-tree/index.js.map +1 -1
  69. package/dist/simple-tree/leafNodeSchema.d.ts +6 -1
  70. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  71. package/dist/simple-tree/leafNodeSchema.js +0 -1
  72. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  73. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +32 -3
  74. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  75. package/dist/simple-tree/node-kinds/array/arrayNode.js +91 -10
  76. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  77. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +77 -0
  78. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  79. package/dist/simple-tree/node-kinds/map/mapNode.js +17 -1
  80. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  81. package/dist/simple-tree/node-kinds/object/objectNode.js +2 -2
  82. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  83. package/dist/simple-tree/node-kinds/record/recordNode.js +2 -2
  84. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  85. package/dist/text/codePointUtils.d.ts +2 -2
  86. package/dist/text/codePointUtils.js +2 -2
  87. package/dist/text/codePointUtils.js.map +1 -1
  88. package/dist/text/index.d.ts +3 -3
  89. package/dist/text/index.d.ts.map +1 -1
  90. package/dist/text/index.js +4 -4
  91. package/dist/text/index.js.map +1 -1
  92. package/dist/text/textDomain.d.ts +18 -18
  93. package/dist/text/textDomain.d.ts.map +1 -1
  94. package/dist/text/textDomain.js +8 -8
  95. package/dist/text/textDomain.js.map +1 -1
  96. package/dist/text/textDomainFormatted.d.ts +46 -42
  97. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  98. package/dist/text/textDomainFormatted.js +32 -28
  99. package/dist/text/textDomainFormatted.js.map +1 -1
  100. package/dist/text/textDomainFormattedDefault.d.ts +18 -18
  101. package/dist/text/textDomainFormattedDefault.d.ts.map +1 -1
  102. package/dist/text/textDomainFormattedDefault.js +14 -17
  103. package/dist/text/textDomainFormattedDefault.js.map +1 -1
  104. package/dist/util/compressedIds.d.ts +22 -2
  105. package/dist/util/compressedIds.d.ts.map +1 -1
  106. package/dist/util/compressedIds.js +22 -1
  107. package/dist/util/compressedIds.js.map +1 -1
  108. package/lib/core/index.d.ts +1 -1
  109. package/lib/core/index.d.ts.map +1 -1
  110. package/lib/core/index.js +1 -1
  111. package/lib/core/index.js.map +1 -1
  112. package/lib/core/rebase/index.d.ts +1 -1
  113. package/lib/core/rebase/index.d.ts.map +1 -1
  114. package/lib/core/rebase/index.js +1 -1
  115. package/lib/core/rebase/index.js.map +1 -1
  116. package/lib/core/rebase/types.d.ts +110 -0
  117. package/lib/core/rebase/types.d.ts.map +1 -1
  118. package/lib/core/rebase/types.js +46 -0
  119. package/lib/core/rebase/types.js.map +1 -1
  120. package/lib/entrypoints/alpha.d.ts +1 -1
  121. package/lib/entrypoints/alpha.d.ts.map +1 -1
  122. package/lib/entrypoints/alpha.js +1 -1
  123. package/lib/entrypoints/alpha.js.map +1 -1
  124. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +9 -6
  125. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  126. package/lib/feature-libraries/chunked-forest/codec/codecs.js +16 -13
  127. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  128. package/lib/index.d.ts +3 -3
  129. package/lib/index.d.ts.map +1 -1
  130. package/lib/index.js +2 -2
  131. package/lib/index.js.map +1 -1
  132. package/lib/packageVersion.d.ts +1 -1
  133. package/lib/packageVersion.d.ts.map +1 -1
  134. package/lib/packageVersion.js +1 -1
  135. package/lib/packageVersion.js.map +1 -1
  136. package/lib/shared-tree/sharedTree.d.ts +5 -0
  137. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  138. package/lib/shared-tree/sharedTree.js +1 -1
  139. package/lib/shared-tree/sharedTree.js.map +1 -1
  140. package/lib/shared-tree/treeCheckout.d.ts +5 -0
  141. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  142. package/lib/shared-tree/treeCheckout.js +60 -14
  143. package/lib/shared-tree/treeCheckout.js.map +1 -1
  144. package/lib/shared-tree-core/branch.d.ts +1 -0
  145. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  146. package/lib/shared-tree-core/branch.js.map +1 -1
  147. package/lib/shared-tree-core/sharedTreeCore.js +1 -1
  148. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  149. package/lib/simple-tree/api/index.d.ts +1 -1
  150. package/lib/simple-tree/api/index.d.ts.map +1 -1
  151. package/lib/simple-tree/api/index.js +1 -1
  152. package/lib/simple-tree/api/index.js.map +1 -1
  153. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +3 -3
  154. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  155. package/lib/simple-tree/api/schemaStatics.d.ts +6 -7
  156. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  157. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  158. package/lib/simple-tree/api/treeNodeApi.d.ts +20 -24
  159. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  160. package/lib/simple-tree/api/treeNodeApi.js +46 -46
  161. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  162. package/lib/simple-tree/core/treeNode.d.ts +5 -6
  163. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  164. package/lib/simple-tree/core/treeNode.js +2 -4
  165. package/lib/simple-tree/core/treeNode.js.map +1 -1
  166. package/lib/simple-tree/core/withType.d.ts +20 -7
  167. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  168. package/lib/simple-tree/core/withType.js +4 -7
  169. package/lib/simple-tree/core/withType.js.map +1 -1
  170. package/lib/simple-tree/index.d.ts +2 -2
  171. package/lib/simple-tree/index.d.ts.map +1 -1
  172. package/lib/simple-tree/index.js +1 -1
  173. package/lib/simple-tree/index.js.map +1 -1
  174. package/lib/simple-tree/leafNodeSchema.d.ts +6 -1
  175. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  176. package/lib/simple-tree/leafNodeSchema.js +0 -1
  177. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  178. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +32 -3
  179. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  180. package/lib/simple-tree/node-kinds/array/arrayNode.js +93 -12
  181. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  182. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +77 -0
  183. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  184. package/lib/simple-tree/node-kinds/map/mapNode.js +18 -2
  185. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  186. package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
  187. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  188. package/lib/simple-tree/node-kinds/record/recordNode.js +3 -3
  189. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  190. package/lib/text/codePointUtils.d.ts +2 -2
  191. package/lib/text/codePointUtils.js +2 -2
  192. package/lib/text/codePointUtils.js.map +1 -1
  193. package/lib/text/index.d.ts +3 -3
  194. package/lib/text/index.d.ts.map +1 -1
  195. package/lib/text/index.js +3 -3
  196. package/lib/text/index.js.map +1 -1
  197. package/lib/text/textDomain.d.ts +18 -18
  198. package/lib/text/textDomain.d.ts.map +1 -1
  199. package/lib/text/textDomain.js +7 -7
  200. package/lib/text/textDomain.js.map +1 -1
  201. package/lib/text/textDomainFormatted.d.ts +46 -42
  202. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  203. package/lib/text/textDomainFormatted.js +31 -27
  204. package/lib/text/textDomainFormatted.js.map +1 -1
  205. package/lib/text/textDomainFormattedDefault.d.ts +18 -18
  206. package/lib/text/textDomainFormattedDefault.d.ts.map +1 -1
  207. package/lib/text/textDomainFormattedDefault.js +14 -17
  208. package/lib/text/textDomainFormattedDefault.js.map +1 -1
  209. package/lib/util/compressedIds.d.ts +22 -2
  210. package/lib/util/compressedIds.d.ts.map +1 -1
  211. package/lib/util/compressedIds.js +22 -1
  212. package/lib/util/compressedIds.js.map +1 -1
  213. package/package.json +29 -22
  214. package/src/core/index.ts +2 -0
  215. package/src/core/rebase/index.ts +2 -0
  216. package/src/core/rebase/types.ts +113 -0
  217. package/src/entrypoints/alpha.ts +10 -6
  218. package/src/feature-libraries/chunked-forest/codec/codecs.ts +17 -14
  219. package/src/index.ts +7 -4
  220. package/src/packageVersion.ts +1 -1
  221. package/src/shared-tree/sharedTree.ts +6 -1
  222. package/src/shared-tree/treeCheckout.ts +81 -14
  223. package/src/shared-tree-core/branch.ts +1 -0
  224. package/src/shared-tree-core/sharedTreeCore.ts +1 -1
  225. package/src/simple-tree/api/index.ts +0 -1
  226. package/src/simple-tree/api/schemaStatics.ts +2 -2
  227. package/src/simple-tree/api/treeNodeApi.ts +64 -48
  228. package/src/simple-tree/core/treeNode.ts +13 -10
  229. package/src/simple-tree/core/withType.ts +20 -7
  230. package/src/simple-tree/index.ts +1 -2
  231. package/src/simple-tree/leafNodeSchema.ts +6 -1
  232. package/src/simple-tree/node-kinds/array/arrayNode.ts +109 -14
  233. package/src/simple-tree/node-kinds/map/mapNode.ts +113 -3
  234. package/src/simple-tree/node-kinds/object/objectNode.ts +3 -3
  235. package/src/simple-tree/node-kinds/record/recordNode.ts +3 -3
  236. package/src/text/README.md +1 -1
  237. package/src/text/codePointUtils.ts +2 -2
  238. package/src/text/index.ts +3 -3
  239. package/src/text/textDomain.ts +21 -21
  240. package/src/text/textDomainFormatted.ts +56 -52
  241. package/src/text/textDomainFormattedDefault.ts +14 -23
  242. package/src/util/compressedIds.ts +36 -3
@@ -4,13 +4,13 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.utf16LengthForCodePoints = exports.codePointCount = exports.FormattedTextAsTreeDefault = exports.FormattedTextAsTree = exports.TextAsTree = void 0;
7
+ exports.utf16LengthForCodePoints = exports.codePointCount = exports.FormattedTextDefault = exports.FormattedText = exports.PlainText = void 0;
8
8
  var textDomain_js_1 = require("./textDomain.js");
9
- Object.defineProperty(exports, "TextAsTree", { enumerable: true, get: function () { return textDomain_js_1.TextAsTree; } });
9
+ Object.defineProperty(exports, "PlainText", { enumerable: true, get: function () { return textDomain_js_1.PlainText; } });
10
10
  var textDomainFormatted_js_1 = require("./textDomainFormatted.js");
11
- Object.defineProperty(exports, "FormattedTextAsTree", { enumerable: true, get: function () { return textDomainFormatted_js_1.FormattedTextAsTree; } });
11
+ Object.defineProperty(exports, "FormattedText", { enumerable: true, get: function () { return textDomainFormatted_js_1.FormattedText; } });
12
12
  var textDomainFormattedDefault_js_1 = require("./textDomainFormattedDefault.js");
13
- Object.defineProperty(exports, "FormattedTextAsTreeDefault", { enumerable: true, get: function () { return textDomainFormattedDefault_js_1.FormattedTextAsTreeDefault; } });
13
+ Object.defineProperty(exports, "FormattedTextDefault", { enumerable: true, get: function () { return textDomainFormattedDefault_js_1.FormattedTextDefault; } });
14
14
  var codePointUtils_js_1 = require("./codePointUtils.js");
15
15
  Object.defineProperty(exports, "codePointCount", { enumerable: true, get: function () { return codePointUtils_js_1.codePointCount; } });
16
16
  Object.defineProperty(exports, "utf16LengthForCodePoints", { enumerable: true, get: function () { return codePointUtils_js_1.utf16LengthForCodePoints; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/text/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAA6C;AAApC,2GAAA,UAAU,OAAA;AACnB,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AACnC,yDAA+E;AAAtE,mHAAA,cAAc,OAAA;AAAE,6HAAA,wBAAwB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { TextAsTree } from \"./textDomain.js\";\nexport { FormattedTextAsTree } from \"./textDomainFormatted.js\";\nexport { FormattedTextAsTreeDefault } from \"./textDomainFormattedDefault.js\";\nexport { codePointCount, utf16LengthForCodePoints } from \"./codePointUtils.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/text/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAA4C;AAAnC,0GAAA,SAAS,OAAA;AAClB,mEAAyD;AAAhD,uHAAA,aAAa,OAAA;AACtB,iFAAuE;AAA9D,qIAAA,oBAAoB,OAAA;AAC7B,yDAA+E;AAAtE,mHAAA,cAAc,OAAA;AAAE,6HAAA,wBAAwB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { PlainText } from \"./textDomain.js\";\nexport { FormattedText } from \"./textDomainFormatted.js\";\nexport { FormattedTextDefault } from \"./textDomainFormattedDefault.js\";\nexport { codePointCount, utf16LengthForCodePoints } from \"./codePointUtils.js\";\n"]}
@@ -25,7 +25,7 @@ export declare function expensiveInternalValidationAssert(condition: () => true
25
25
  */
26
26
  export declare function charactersFromString(value: string): Iterable<string>;
27
27
  /**
28
- * Processes an array-node delta into a {@link TextAsTree.TextOp}[] and calls `callback`.
28
+ * Processes an array-node delta into a {@link PlainText.TextOp}[] and calls `callback`.
29
29
  * @remarks
30
30
  * Shared by both the plain `onCharactersChanged` (from `nodeChanged`) and formatted `onContentChanged`
31
31
  * (from `treeChanged`) implementations.
@@ -38,7 +38,7 @@ export declare function charactersFromString(value: string): Iterable<string>;
38
38
  * Return `undefined` if the tree is out of sync with the delta; this triggers a full-reread fallback.
39
39
  * @param callback - The user-supplied callback to invoke with the translated ops.
40
40
  */
41
- export declare function processCharactersChangedDelta(delta: readonly (ArrayNodeDeltaOp | ArrayNodeTreeChangedDeltaOp)[] | undefined, getCharacter: (index: number) => string | undefined, callback: (ops: readonly TextAsTree.TextOp[] | undefined) => void): void;
41
+ export declare function processCharactersChangedDelta(delta: readonly (ArrayNodeDeltaOp | ArrayNodeTreeChangedDeltaOp)[] | undefined, getCharacter: (index: number) => string | undefined, callback: (ops: readonly PlainText.TextOp[] | undefined) => void): void;
42
42
  /**
43
43
  * A collection of text related types, schema and utilities for working with text beyond the basic {@link SchemaStatics.string}.
44
44
  * @privateRemarks
@@ -101,7 +101,7 @@ export declare function processCharactersChangedDelta(delta: readonly (ArrayNode
101
101
  * in addition to implementing them for text.
102
102
  * @alpha
103
103
  */
104
- export declare namespace TextAsTree {
104
+ export declare namespace PlainText {
105
105
  /**
106
106
  * A retain op in a character-level delta — a span of unchanged characters that the consumer should skip over.
107
107
  * @sealed
@@ -119,8 +119,8 @@ export declare namespace TextAsTree {
119
119
  /**
120
120
  * Whether at least one character in the retained range had a deep change.
121
121
  * @remarks
122
- * Present only on retain ops delivered by {@link @fluidframework/tree#FormattedTextAsTree.Members.onContentChanged};
123
- * always absent on retain ops delivered by {@link TextAsTree.Members.onCharactersChanged}.
122
+ * Present only on retain ops delivered by {@link @fluidframework/tree#FormattedText.Members.onContentChanged};
123
+ * always absent on retain ops delivered by {@link PlainText.Members.onCharactersChanged}.
124
124
  * When present, `true` indicates the retained range contained a formatting property update
125
125
  * or an atom content edit; `false` indicates no deep change.
126
126
  */
@@ -169,7 +169,7 @@ export declare namespace TextAsTree {
169
169
  */
170
170
  interface Statics {
171
171
  /**
172
- * Construct a {@link TextAsTree.(Tree:type)} from a string, where each character (as defined by iterating over the string) becomes a single character in the text node.
172
+ * Construct a {@link PlainText.(Tree:type)} from a string, where each character (as defined by iterating over the string) becomes a single character in the text node.
173
173
  * This combines pairs of utf-16 surrogate code units into single characters as appropriate.
174
174
  */
175
175
  fromString(value: string): Tree;
@@ -187,8 +187,8 @@ export declare namespace TextAsTree {
187
187
  * (which often operates on something in between unicode code points and grapheme clusters)
188
188
  * and navigation/selection (which typically uses grapheme clusters).
189
189
  *
190
- * @see {@link TextAsTree.Statics.fromString} for construction.
191
- * @see {@link TextAsTree.(Tree:type)} for schema.
190
+ * @see {@link PlainText.Statics.fromString} for construction.
191
+ * @see {@link PlainText.(Tree:type)} for schema.
192
192
  * @sealed
193
193
  * @alpha
194
194
  */
@@ -200,14 +200,14 @@ export declare namespace TextAsTree {
200
200
  */
201
201
  characters(): Iterable<string>;
202
202
  /**
203
- * Optimized way to get a copy of the {@link TextAsTree.Members.characters} in an array.
203
+ * Optimized way to get a copy of the {@link PlainText.Members.characters} in an array.
204
204
  */
205
205
  charactersCopy(): string[];
206
206
  /**
207
207
  * Gets the number of characters currently in the text.
208
208
  * @remarks
209
- * The length of {@link TextAsTree.Members.characters}.
210
- * This is not the length of the string returned by {@link TextAsTree.Members.fullString},
209
+ * The length of {@link PlainText.Members.characters}.
210
+ * This is not the length of the string returned by {@link PlainText.Members.fullString},
211
211
  * as that string may contain characters which are made up of multiple UTF-16 code units.
212
212
  */
213
213
  characterCount(): number;
@@ -219,7 +219,7 @@ export declare namespace TextAsTree {
219
219
  * Insert a range of characters into the string based on character index.
220
220
  * @remarks
221
221
  * See {@link (TreeArrayNode:interface).insertAt} for more details on the behavior.
222
- * See {@link TextAsTree.Statics.fromString} for how the `additionalCharacters` string is broken into characters.
222
+ * See {@link PlainText.Statics.fromString} for how the `additionalCharacters` string is broken into characters.
223
223
  * @privateRemarks
224
224
  * If we provide ways to customize character boundaries, that could be handled here by taking in an Iterable<string> instead of a string.
225
225
  * Doing this currently would enable insertion of text with different character boundaries than the existing text,
@@ -236,13 +236,13 @@ export declare namespace TextAsTree {
236
236
  removeRange(startIndex: number | undefined, endIndex: number | undefined): void;
237
237
  /**
238
238
  * Subscribe to shallow character-level changes on this text node — inserts and removes only.
239
- * @param callback - Called after each change with a sequence of {@link TextAsTree.TextOp}s describing what changed,
239
+ * @param callback - Called after each change with a sequence of {@link PlainText.TextOp}s describing what changed,
240
240
  * or `undefined` when a delta could not be computed (e.g. during a schema upgrade).
241
241
  * @returns A cleanup function that unsubscribes the callback when called.
242
242
  * @remarks
243
243
  * Only fires on shallow changes — inserts and removes.
244
244
  * It does not fire on deep changes such as formatting property updates on existing characters.
245
- * For formatted text, use {@link @fluidframework/tree#FormattedTextAsTree.Members.onContentChanged} to also receive deep changes.
245
+ * For formatted text, use {@link @fluidframework/tree#FormattedText.Members.onContentChanged} to also receive deep changes.
246
246
  *
247
247
  * All counts in the delivered ops are in Unicode code points, not UTF-16 code units.
248
248
  * For characters outside the Basic Multilingual Plane (e.g. emoji), one code point
@@ -251,16 +251,16 @@ export declare namespace TextAsTree {
251
251
  onCharactersChanged(callback: (ops: readonly TextOp[] | undefined) => void): () => void;
252
252
  }
253
253
  /**
254
- * Schema for a {@link TextAsTree.(Tree:variable)} node.
254
+ * Schema for a {@link PlainText.(Tree:variable)} node.
255
255
  * @remarks
256
- * See {@link TextAsTree.Statics} for static APIs on this schema, including construction.
256
+ * See {@link PlainText.Statics} for static APIs on this schema, including construction.
257
257
  * @alpha
258
258
  */
259
259
  const Tree: Statics & TreeNodeSchema<"com.fluidframework.text.Text", NodeKind, Members & TreeNode & WithType<"com.fluidframework.text.Text", NodeKind, unknown>, never, false>;
260
260
  /**
261
- * Node for the {@link TextAsTree.(Tree:type)} schema exposing the {@link TextAsTree.Members} API.
261
+ * Node for the {@link PlainText.(Tree:type)} schema exposing the {@link PlainText.Members} API.
262
262
  * @remarks
263
- * Create using {@link TextAsTree.Statics.fromString}.
263
+ * Create using {@link PlainText.Statics.fromString}.
264
264
  * @alpha
265
265
  */
266
266
  type Tree = Members & TreeNode & WithType<"com.fluidframework.text.Text">;
@@ -1 +1 @@
1
- {"version":3,"file":"textDomain.d.ts","sourceRoot":"","sources":["../../src/text/textDomain.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,OAAO,KAAK,EACX,gBAAgB,EAChB,2BAA2B,EAC3B,QAAQ,EACR,QAAQ,EAER,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc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;KACvB;IAED;;;OAGG;IACH,KAAY,MAAM,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC;IAEhE;;;OAGG;IACH,UAAiB,OAAO;QACvB;;;WAGG;QACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;KAChC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,UAAiB,OAAO;QACvB;;;;WAIG;QACH,UAAU,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;QAE/B;;WAEG;QACH,cAAc,IAAI,MAAM,EAAE,CAAC;QAE3B;;;;;;WAMG;QACH,cAAc,IAAI,MAAM,CAAC;QAEzB;;WAEG;QACH,UAAU,IAAI,MAAM,CAAC;QAErB;;;;;;;;;;;;WAYG;QACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;QAE5D;;;WAGG;QACH,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;QAEhF;;;;;;;;;;;;;WAaG;QACH,mBAAmB,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;KACxF;IAED;;;;;OAKG;IACI,MAAM,IAAI,oKAAmD,CAAC;IAErE;;;;;OAKG;IACH,KAAY,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC,8BAA8B,CAAC,CAAC;CACjF"}
@@ -5,7 +5,7 @@
5
5
  */
6
6
  var _TextNode_instances, _TextNode_fullString_reference, _TextNode_charactersCopy_reference;
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.TextAsTree = exports.processCharactersChangedDelta = exports.charactersFromString = exports.expensiveInternalValidationAssert = exports.setEnableExpensiveDebugAsserts = void 0;
8
+ exports.PlainText = exports.processCharactersChangedDelta = exports.charactersFromString = exports.expensiveInternalValidationAssert = exports.setEnableExpensiveDebugAsserts = void 0;
9
9
  const tslib_1 = require("tslib");
10
10
  const internal_1 = require("@fluidframework/core-utils/internal");
11
11
  const alpha_1 = require("@fluidframework/type-factory/alpha");
@@ -136,7 +136,7 @@ class StringArray extends sf.array("StringArray", index_js_3.SchemaFactory.strin
136
136
  }
137
137
  }
138
138
  /**
139
- * Processes an array-node delta into a {@link TextAsTree.TextOp}[] and calls `callback`.
139
+ * Processes an array-node delta into a {@link PlainText.TextOp}[] and calls `callback`.
140
140
  * @remarks
141
141
  * Shared by both the plain `onCharactersChanged` (from `nodeChanged`) and formatted `onContentChanged`
142
142
  * (from `treeChanged`) implementations.
@@ -250,14 +250,14 @@ exports.processCharactersChangedDelta = processCharactersChangedDelta;
250
250
  * in addition to implementing them for text.
251
251
  * @alpha
252
252
  */
253
- var TextAsTree;
254
- (function (TextAsTree) {
253
+ var PlainText;
254
+ (function (PlainText) {
255
255
  /**
256
- * Schema for a {@link TextAsTree.(Tree:variable)} node.
256
+ * Schema for a {@link PlainText.(Tree:variable)} node.
257
257
  * @remarks
258
- * See {@link TextAsTree.Statics} for static APIs on this schema, including construction.
258
+ * See {@link PlainText.Statics} for static APIs on this schema, including construction.
259
259
  * @alpha
260
260
  */
261
- TextAsTree.Tree = (0, index_js_3.eraseSchemaDetails)()(TextNode);
262
- })(TextAsTree || (exports.TextAsTree = TextAsTree = {}));
261
+ PlainText.Tree = (0, index_js_3.eraseSchemaDetails)()(TextNode);
262
+ })(PlainText || (exports.PlainText = PlainText = {}));
263
263
  //# sourceMappingURL=textDomain.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"textDomain.js","sourceRoot":"","sources":["../../src/text/textDomain.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAEH,kEAAiF;AACjF,8DAM4C;AAC5C,oEAA0E;AAE1E,+CAAyF;AACzF,sDAAoD;AACpD,sDAMiC;AAajC;;GAEG;AACH,IAAI,+BAA+B,GAAG,KAAK,CAAC;A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BAAV,UAAU,QAgL1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { compareArrays, debugAssert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tbuildFunc,\n\texposeMethodsSymbol,\n\ttype ExposedMethods,\n\ttype IExposedMethods,\n\t// eslint-disable-next-line import-x/no-internal-modules\n} from \"@fluidframework/type-factory/alpha\";\nimport { typeFactory as tf } from \"@fluidframework/type-factory/internal\";\n\nimport { EmptyKey, mapCursorField, type ITreeCursorSynchronous } from \"../core/index.js\";\nimport { TreeAlpha } from \"../shared-tree/index.js\";\nimport {\n\teraseSchemaDetails,\n\tgetInnerNode,\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\tTreeArrayNode,\n} from \"../simple-tree/index.js\";\nimport type {\n\tArrayNodeDeltaOp,\n\tArrayNodeTreeChangedDeltaOp,\n\tTreeNode,\n\tWithType,\n\t// eslint-disable-next-line import-x/no-duplicates\n} from \"../simple-tree/index.js\";\n// Add some unused imports which show up in the generated d.ts file.\n// This prevents them from getting inline imports generated, cleaning up the d.ts file and API reports.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports, import-x/no-duplicates\nimport type { NodeKind, TreeNodeSchema } from \"../simple-tree/index.js\";\n\n/**\n * Enables expensive debug assertions for formatted text.\n */\nlet enableTextExpensiveDebugAsserts = false;\n\n/**\n * Enables or disables expensive debug assertions for formatted text.\n * @remarks\n * These should remain disabled except when testing implementation details of this code.\n */\nexport function setEnableExpensiveDebugAsserts(value: boolean): void {\n\tenableTextExpensiveDebugAsserts = value;\n}\n\n/**\n * Runs `condition` as a {@link debugAssert} only when {@link enableTextExpensiveDebugAsserts} is enabled.\n * @remarks\n * Like all {@link debugAssert}s, this is compiled out of production builds, so `condition` is never evaluated there.\n */\nexport function expensiveInternalValidationAssert(condition: () => true | string): void {\n\tdebugAssert(() => !enableTextExpensiveDebugAsserts || condition());\n}\n\nconst sf = new SchemaFactoryAlpha(\"com.fluidframework.text\");\n\nclass TextNode\n\textends sf.object(\"Text\", {\n\t\tcontent: SchemaFactory.required([() => StringArray], { key: EmptyKey }),\n\t})\n\timplements TextAsTree.Members, IExposedMethods\n{\n\tpublic static [exposeMethodsSymbol](methods: ExposedMethods): void {\n\t\tmethods.exposeMethod(\n\t\t\tTextNode,\n\t\t\t\"insertAt\",\n\t\t\tbuildFunc(\n\t\t\t\t{\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"Insert characters into the text at the given character index (Unicode code points).\",\n\t\t\t\t\treturns: tf.void(),\n\t\t\t\t},\n\t\t\t\t[\"index\", tf.number()],\n\t\t\t\t[\"additionalCharacters\", tf.string()],\n\t\t\t),\n\t\t);\n\t\tmethods.exposeMethod(\n\t\t\tTextNode,\n\t\t\t\"removeRange\",\n\t\t\tbuildFunc(\n\t\t\t\t{\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"Remove a range of characters from the text by character index (Unicode code points). startIndex defaults to 0 and endIndex defaults to the length of the text.\",\n\t\t\t\t\treturns: tf.void(),\n\t\t\t\t},\n\t\t\t\t[\"startIndex\", tf.union([tf.number(), tf.undefined()])],\n\t\t\t\t[\"endIndex\", tf.union([tf.number(), tf.undefined()])],\n\t\t\t),\n\t\t);\n\t\tmethods.exposeMethod(\n\t\t\tTextNode,\n\t\t\t\"fullString\",\n\t\t\tbuildFunc({\n\t\t\t\tdescription: \"Return a copy of this text node's content as a string.\",\n\t\t\t\treturns: tf.string(),\n\t\t\t}),\n\t\t);\n\t\tmethods.exposeMethod(\n\t\t\tTextNode,\n\t\t\t\"characterCount\",\n\t\t\tbuildFunc({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Gets the number of characters (Unicode code points) currently in the text. Joined emojis and other grapheme clusters count as multiple characters.\",\n\t\t\t\treturns: tf.number(),\n\t\t\t}),\n\t\t);\n\t\tmethods.exposeMethod(\n\t\t\tTextNode,\n\t\t\t\"charactersCopy\",\n\t\t\tbuildFunc({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Returns all characters in the text as an array, where each element is a single Unicode code point. Joined emojis and other grapheme clusters are split into separate elements.\",\n\t\t\t\treturns: tf.array(tf.string()),\n\t\t\t}),\n\t\t);\n\t}\n\n\tpublic [exposeMethodsSymbol](methods: ExposedMethods): void {\n\t\tTextNode[exposeMethodsSymbol](methods);\n\t}\n\n\tpublic insertAt(index: number, additionalCharacters: string): void {\n\t\tthis.content.insertAt(\n\t\t\tindex,\n\t\t\tTreeArrayNode.spread(charactersFromString(additionalCharacters)),\n\t\t);\n\t}\n\tpublic removeRange(index: number | undefined, end: number | undefined): void {\n\t\tthis.content.removeRange(index, end);\n\t}\n\tpublic characters(): Iterable<string> {\n\t\treturn this.content[Symbol.iterator]();\n\t}\n\n\tpublic characterCount(): number {\n\t\treturn this.content.length;\n\t}\n\n\tpublic charactersCopy(): string[] {\n\t\tconst result = this.content.charactersCopy();\n\t\texpensiveInternalValidationAssert(\n\t\t\t() =>\n\t\t\t\tcompareArrays(result, this.#charactersCopy_reference()) ||\n\t\t\t\t\"invalid charactersCopy optimizations\",\n\t\t);\n\t\treturn result;\n\t}\n\n\tpublic fullString(): string {\n\t\tconst result = this.content.fullString();\n\t\texpensiveInternalValidationAssert(\n\t\t\t() => result === this.#fullString_reference() || \"invalid fullString optimizations\",\n\t\t);\n\t\treturn result;\n\t}\n\n\t/**\n\t * Unoptimized trivially correct implementation of fullString.\n\t */\n\t#fullString_reference(): string {\n\t\treturn this.content.join(\"\");\n\t}\n\n\t/**\n\t * Unoptimized trivially correct implementation of charactersCopy.\n\t */\n\t#charactersCopy_reference(): string[] {\n\t\treturn [...this.content];\n\t}\n\n\tpublic onCharactersChanged(\n\t\tcallback: (ops: readonly TextAsTree.TextOp[] | undefined) => void,\n\t): () => void {\n\t\treturn TreeAlpha.on(this.content, \"nodeChanged\", ({ delta }) =>\n\t\t\tprocessCharactersChangedDelta(delta, (i) => this.content[i], callback),\n\t\t);\n\t}\n\n\tpublic static fromString(value: string): TextNode {\n\t\t// Constructing an ArrayNode from an iterator is supported, so creating an array from the iterable of characters seems like its not necessary here,\n\t\t// but to reduce the risk of incorrect data interpretation, we actually ban this in the special case where the iterable is a string directly, which is the case here.\n\t\t// Thus the array construction here is necessary to avoid a runtime error.\n\t\treturn new TextNode({ content: [...charactersFromString(value)] });\n\t}\n}\n\n/**\n * Interpret a string as an iterable of characters.\n * @remarks\n * This mostly exists to clearly document where the code is interpreting a string as characters,\n * and provide a centralized place where validation could be added in the future if desired.\n * Additionally using this function consistently will make any refactors to support alternative character boundaries easier.\n */\nexport function charactersFromString(value: string): Iterable<string> {\n\t// Uses the string as an iterable of characters, so utf-16 surrogate pairs get grouped together correctly.\n\t// Might be nice to call isWellFormed or toWellFormed here (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toWellFormed)\n\t// But those are not widely supported yet.\n\treturn value;\n}\n\nclass StringArray extends sf.array(\"StringArray\", SchemaFactory.string) {\n\tpublic withBorrowedSequenceCursor<T>(f: (cursor: ITreeCursorSynchronous) => T): T {\n\t\tconst cursor = getInnerNode(this).borrowCursor();\n\t\tcursor.enterField(EmptyKey);\n\t\tconst result = f(cursor);\n\t\tcursor.exitField();\n\t\treturn result;\n\t}\n\n\tpublic charactersCopy(): string[] {\n\t\treturn this.withBorrowedSequenceCursor((cursor) =>\n\t\t\tmapCursorField(cursor, () => cursor.value as string),\n\t\t);\n\t}\n\n\tpublic fullString(): string {\n\t\treturn this.charactersCopy().join(\"\");\n\t}\n}\n\n/**\n * Processes an array-node delta into a {@link TextAsTree.TextOp}[] and calls `callback`.\n * @remarks\n * Shared by both the plain `onCharactersChanged` (from `nodeChanged`) and formatted `onContentChanged`\n * (from `treeChanged`) implementations.\n * @param delta - The raw array-node delta, or `undefined` when no delta is available.\n * When retain ops carry `subtreeChanged` (i.e. delta comes from a `treeChanged` event), the emitted\n * retain ops include an explicit `formattingChanged: boolean`. Otherwise `formattingChanged` is omitted.\n * @param getCharacter - Returns the character string at the given array index in the **post-edit** tree.\n * Only invoked for insert ops, where it must read the inserted character at the given index of the tree\n * after the edit has been applied. Passing an accessor that reads pre-edit content will silently produce wrong text.\n * Return `undefined` if the tree is out of sync with the delta; this triggers a full-reread fallback.\n * @param callback - The user-supplied callback to invoke with the translated ops.\n */\nexport function processCharactersChangedDelta(\n\tdelta: readonly (ArrayNodeDeltaOp | ArrayNodeTreeChangedDeltaOp)[] | undefined,\n\tgetCharacter: (index: number) => string | undefined,\n\tcallback: (ops: readonly TextAsTree.TextOp[] | undefined) => void,\n): void {\n\tif (delta === undefined) {\n\t\tcallback(undefined);\n\t\treturn;\n\t}\n\tlet readPosition = 0;\n\tconst ops: TextAsTree.TextOp[] = [];\n\tfor (const op of delta) {\n\t\tif (op.type === \"retain\") {\n\t\t\t// `subtreeChanged` is only present on retain ops from `treeChanged` deltas.\n\t\t\tops.push(\n\t\t\t\t\"subtreeChanged\" in op\n\t\t\t\t\t? { type: \"retain\", count: op.count, formattingChanged: op.subtreeChanged === true }\n\t\t\t\t\t: { type: \"retain\", count: op.count },\n\t\t\t);\n\t\t\treadPosition += op.count;\n\t\t} else if (op.type === \"insert\") {\n\t\t\t// Accumulate into an array and join at the end to keep this O(n) for large inserts\n\t\t\t// (paste of long text) instead of O(n^2) from repeated string concatenation.\n\t\t\tconst characters: string[] = [];\n\t\t\tfor (let i = 0; i < op.count; i++) {\n\t\t\t\tconst character = getCharacter(readPosition);\n\t\t\t\tif (character === undefined) {\n\t\t\t\t\t// Tree is out of sync with the delta — fall back to full re-read.\n\t\t\t\t\tcallback(undefined);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcharacters.push(character);\n\t\t\t\treadPosition++;\n\t\t\t}\n\t\t\tops.push({ type: \"insert\", text: characters.join(\"\") });\n\t\t} else {\n\t\t\t// Construct explicit remove op so internal fields on the source op don't leak.\n\t\t\tops.push({ type: \"remove\", count: op.count });\n\t\t}\n\t}\n\tcallback(ops);\n}\n\n/**\n * A collection of text related types, schema and utilities for working with text beyond the basic {@link SchemaStatics.string}.\n * @privateRemarks\n * Currently this API only supports a really minimal feature set, and has no support for more advanced features like:\n * - Alternative character boundaries (e.g. grapheme clusters, paragraphs, tokens, etc.).\n * We may want to provide either ways to create strings with application controlled character boundaries since there is not a clear single answer on how to break a string into atomic units.\n * - Character attributes (e.g. bold, italic, etc):\n * Properties that can be set on any character independently with optimizations for runs of characters with the same attributes.\n * - Inline objects (e.g. images, embedded components, etc):\n * These would be logically part of the text, generalizing characters to allow inline objects in character ranges.\n * How character attributes apply to inline objects is an open question\n * (there could be a kind of object which gets them, and one that doesn't for example).\n * - Annotations (e.g. comments, suggestions, etc).\n * Objects which can be associated with a range of characters but are not logically part of the text.\n * These would need to have the logical range they apply to updated by edits.\n * How edits which overlap annotation boundaries are handled may require hints from the application for optimal behavior (mainly inserts at the boundaries).\n * These get a lifetime tied to the text node, not any of the characters the annotation covers,\n * however it might be desirable to have a way for a range edit to (optionally) also remove any annotations which are fully covered by the edit.\n * Annotations over an empty range should also be supported and behave well (for example not end up with characters inside the range after edits unless specifically structured so that makes sense).\n * - Anchors (e.g. positions in the text which survive edits).\n * These would be useful for ephemeral state like cursor positions, but should match the behaviors with respect to edits exhibited by the ends of Annotations.\n *\n * How these features will be represented in the schema and API should be determined before any of this is stabilized so the simple more limited version can neatly fit into the larger design.\n *\n * There are various optimizations that should be implemented to make this performant for large texts and common usage patterns.\n * These include:\n * - Optimized persisted format.\n * - Optimized in memory representation (via chunked forest).\n * - Optimized edit persisted format (e.g. combining adjacent inserts/removes into single operations as well as support for efficient attribute editing of ranges).\n * - Optimized edit application (e.g. applying the above noted optimizable edit cases efficiently).\n * This applies to the revision manager, the forest, and any flex or simple-tree nodes and user events.\n *\n * There are also additional features required for ensuring the invariants of collaborative text editing are maintained through concurrent edits.\n * The main challenges here are related to annotations, but some policies for what to do in the case of corrupt/invalid text should also be included.\n * There are quite a few ways invariants could break, including:\n * - concurrent edits without proper constraints.\n * - collaboration with clients using compatible schema with different constraints.\n * - opening documents which contain invalid content (e.g. from older versions of the software, manual edits to the persisted format, or simply an existing corrupt case which was saved).\n * - a user inserting/constructing/importing invalid content.\n *\n * These cases could break constraints causing issues like invalided characters (empty, a utf-16 surrogate pair alone, etc) or\n * annotations which reference out of bounds character ranges.\n * Addressing these issues mainly falls into these categories:\n * - Handling of invalid content on import/construction of unhydrated nodes and/or insertion into the document (hydration).\n * - Handling of invalid content which is already part of the document (live). This should ideally include both detection and repair.\n * - Constraints on edits to prevent invalid content from being created by merges.\n * - Optimization of the constraints to reduce cases in which edits are rejected due to conflicts.\n *\n * Note that these cases of invariant violations are the same cases any component should handle, so ideally there would be a general framework or pattern for documenting and enforcing such constraints.\n *\n * Another area for future work is improved APIs for import, export and non-schema-aware use. This includes a variety of cases, including but not limited to:\n * - Insertable content format (taken by the constructor and import APIs).\n * - Customizable export formats (like a way to make exportVerbose and exportConcise flatten the text nodes to strings automatically).\n * - Customizable toJson behavior (e.g. flattening to strings, possibly via tools or patterns for custom tree stringifier).\n * - Ensure JS object APIs (like iteration, own vs inherited properties, etc) provide a good and consistent experience with respect to other nodes.\n * - Support in generateSchemaFromSimpleSchema for recognizing text nodes and generating the appropriate schema.\n * - Ensure above features work well enough to support important scenarios like AI assisted editing and document indexing for search.\n *\n * Part of that work will be establishing and documenting those patterns so other components with complex encodings can follow them,\n * in addition to implementing them for text.\n * @alpha\n */\nexport namespace TextAsTree {\n\t/**\n\t * A retain op in a character-level delta — a span of unchanged characters that the consumer should skip over.\n\t * @sealed\n\t * @alpha\n\t */\n\texport interface TextRetainOp {\n\t\t/**\n\t\t * Discriminator identifying this op as a retain.\n\t\t */\n\t\treadonly type: \"retain\";\n\t\t/**\n\t\t * The number of Unicode code points to retain.\n\t\t */\n\t\treadonly count: number;\n\t\t/**\n\t\t * Whether at least one character in the retained range had a deep change.\n\t\t * @remarks\n\t\t * Present only on retain ops delivered by {@link @fluidframework/tree#FormattedTextAsTree.Members.onContentChanged};\n\t\t * always absent on retain ops delivered by {@link TextAsTree.Members.onCharactersChanged}.\n\t\t * When present, `true` indicates the retained range contained a formatting property update\n\t\t * or an atom content edit; `false` indicates no deep change.\n\t\t */\n\t\treadonly formattingChanged?: boolean;\n\t}\n\n\t/**\n\t * An insert op in a character-level delta — characters newly added to the text.\n\t * @remarks\n\t * Carries the inserted text as a single string, which is more convenient for consumers than individual characters.\n\t * @sealed\n\t * @alpha\n\t */\n\texport interface TextInsertOp {\n\t\t/**\n\t\t * Discriminator identifying this op as an insert.\n\t\t */\n\t\treadonly type: \"insert\";\n\t\t/**\n\t\t * The newly inserted characters, concatenated into a single string.\n\t\t */\n\t\treadonly text: string;\n\t}\n\n\t/**\n\t * A remove op in a character-level delta — a span of characters that has been deleted from the text.\n\t * @sealed\n\t * @alpha\n\t */\n\texport interface TextRemoveOp {\n\t\t/**\n\t\t * Discriminator identifying this op as a remove.\n\t\t */\n\t\treadonly type: \"remove\";\n\t\t/**\n\t\t * The number of Unicode code points removed.\n\t\t */\n\t\treadonly count: number;\n\t}\n\n\t/**\n\t * A single operation in a character-level delta describing an insert, remove, or retain of text.\n\t * @alpha\n\t */\n\texport type TextOp = TextRetainOp | TextInsertOp | TextRemoveOp;\n\n\t/**\n\t * Statics for text nodes.\n\t * @alpha\n\t */\n\texport interface Statics {\n\t\t/**\n\t\t * Construct a {@link TextAsTree.(Tree:type)} from a string, where each character (as defined by iterating over the string) becomes a single character in the text node.\n\t\t * This combines pairs of utf-16 surrogate code units into single characters as appropriate.\n\t\t */\n\t\tfromString(value: string): Tree;\n\t}\n\n\t/**\n\t * Interface for a text node.\n\t * @remarks\n\t * The string is broken up into substrings which are referred to as 'characters'.\n\t * Unlike with JavaScript strings, all indexes are by character, not UTF-16 code unit.\n\t * This avoids the problem JavaScript where it can split UTF-16 surrogate pairs producing invalid strings,\n\t * and avoids the issue where indexing a string and iterating it segment the string differently.\n\t * This does NOT mean the characters correspond to user perceived characters (like grapheme clusters try to do):\n\t * applications will likely want to include higher level segmentation logic\n\t * which might differ between operations like delete\n\t * (which often operates on something in between unicode code points and grapheme clusters)\n\t * and navigation/selection (which typically uses grapheme clusters).\n\t *\n\t * @see {@link TextAsTree.Statics.fromString} for construction.\n\t * @see {@link TextAsTree.(Tree:type)} for schema.\n\t * @sealed\n\t * @alpha\n\t */\n\texport interface Members {\n\t\t/**\n\t\t * Gets an iterable over the characters currently in the text.\n\t\t * @remarks\n\t\t * This iterator matches the behavior of {@link (TreeArrayNode:interface)} with respect to edits during iteration.\n\t\t */\n\t\tcharacters(): Iterable<string>;\n\n\t\t/**\n\t\t * Optimized way to get a copy of the {@link TextAsTree.Members.characters} in an array.\n\t\t */\n\t\tcharactersCopy(): string[];\n\n\t\t/**\n\t\t * Gets the number of characters currently in the text.\n\t\t * @remarks\n\t\t * The length of {@link TextAsTree.Members.characters}.\n\t\t * This is not the length of the string returned by {@link TextAsTree.Members.fullString},\n\t\t * as that string may contain characters which are made up of multiple UTF-16 code units.\n\t\t */\n\t\tcharacterCount(): number;\n\n\t\t/**\n\t\t * Copy the content of this node into a string.\n\t\t */\n\t\tfullString(): string;\n\n\t\t/**\n\t\t * Insert a range of characters into the string based on character index.\n\t\t * @remarks\n\t\t * See {@link (TreeArrayNode:interface).insertAt} for more details on the behavior.\n\t\t * See {@link TextAsTree.Statics.fromString} for how the `additionalCharacters` string is broken into characters.\n\t\t * @privateRemarks\n\t\t * If we provide ways to customize character boundaries, that could be handled here by taking in an Iterable<string> instead of a string.\n\t\t * Doing this currently would enable insertion of text with different character boundaries than the existing text,\n\t\t * which would violate the currently documented character boundary invariants.\n\t\t *\n\t\t * Another option would be to take an approach like Table,\n\t\t * where the user of the API uses a factory function to generate the schema, and can inject custom logic, like a string character iterator.\n\t\t */\n\t\tinsertAt(index: number, additionalCharacters: string): void;\n\n\t\t/**\n\t\t * Remove a range from a string based on character index.\n\t\t * See {@link (TreeArrayNode:interface).removeRange} for more details on the behavior.\n\t\t */\n\t\tremoveRange(startIndex: number | undefined, endIndex: number | undefined): void;\n\n\t\t/**\n\t\t * Subscribe to shallow character-level changes on this text node — inserts and removes only.\n\t\t * @param callback - Called after each change with a sequence of {@link TextAsTree.TextOp}s describing what changed,\n\t\t * or `undefined` when a delta could not be computed (e.g. during a schema upgrade).\n\t\t * @returns A cleanup function that unsubscribes the callback when called.\n\t\t * @remarks\n\t\t * Only fires on shallow changes — inserts and removes.\n\t\t * It does not fire on deep changes such as formatting property updates on existing characters.\n\t\t * For formatted text, use {@link @fluidframework/tree#FormattedTextAsTree.Members.onContentChanged} to also receive deep changes.\n\t\t *\n\t\t * All counts in the delivered ops are in Unicode code points, not UTF-16 code units.\n\t\t * For characters outside the Basic Multilingual Plane (e.g. emoji), one code point\n\t\t * corresponds to two UTF-16 code units — convert before using the counts as string indices.\n\t\t */\n\t\tonCharactersChanged(callback: (ops: readonly TextOp[] | undefined) => void): () => void;\n\t}\n\n\t/**\n\t * Schema for a {@link TextAsTree.(Tree:variable)} node.\n\t * @remarks\n\t * See {@link TextAsTree.Statics} for static APIs on this schema, including construction.\n\t * @alpha\n\t */\n\texport const Tree = eraseSchemaDetails<Members, Statics>()(TextNode);\n\n\t/**\n\t * Node for the {@link TextAsTree.(Tree:type)} schema exposing the {@link TextAsTree.Members} API.\n\t * @remarks\n\t * Create using {@link TextAsTree.Statics.fromString}.\n\t * @alpha\n\t */\n\texport type Tree = Members & TreeNode & WithType<\"com.fluidframework.text.Text\">;\n}\n"]}
1
+ {"version":3,"file":"textDomain.js","sourceRoot":"","sources":["../../src/text/textDomain.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAEH,kEAAiF;AACjF,8DAM4C;AAC5C,oEAA0E;AAE1E,+CAAyF;AACzF,sDAAoD;AACpD,sDAMiC;AAajC;;GAEG;AACH,IAAI,+BAA+B,GAAG,KAAK,CAAC;AAE5C;;;;GAIG;AACH,SAAgB,8BAA8B,CAAC,KAAc;IAC5D,+BAA+B,GAAG,KAAK,CAAC;AACzC,CAAC;AAFD,wEAEC;AA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AC,KAAK,CAAC;QAC1B,CAAC;aAAM,IAAI,EAAE,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACjC,mFAAmF;YACnF,6EAA6E;YAC7E,MAAM,UAAU,GAAa,EAAE,CAAC;YAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;gBACnC,MAAM,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;gBAC7C,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;oBAC7B,kEAAkE;oBAClE,QAAQ,CAAC,SAAS,CAAC,CAAC;oBACpB,OAAO;gBACR,CAAC;gBACD,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBAC3B,YAAY,EAAE,CAAC;YAChB,CAAC;YACD,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACzD,CAAC;aAAM,CAAC;YACP,+EAA+E;YAC/E,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QAC/C,CAAC;IACF,CAAC;IACD,QAAQ,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAzCD,sEAyCC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,IAAiB,SAAS,CAgLzB;AAhLD,WAAiB,SAAS;IAiKzB;;;;;OAKG;IACU,cAAI,GAAG,IAAA,6BAAkB,GAAoB,CAAC,QAAQ,CAAC,CAAC;AAStE,CAAC,EAhLgB,SAAS,yBAAT,SAAS,QAgLzB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { compareArrays, debugAssert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tbuildFunc,\n\texposeMethodsSymbol,\n\ttype ExposedMethods,\n\ttype IExposedMethods,\n\t// eslint-disable-next-line import-x/no-internal-modules\n} from \"@fluidframework/type-factory/alpha\";\nimport { typeFactory as tf } from \"@fluidframework/type-factory/internal\";\n\nimport { EmptyKey, mapCursorField, type ITreeCursorSynchronous } from \"../core/index.js\";\nimport { TreeAlpha } from \"../shared-tree/index.js\";\nimport {\n\teraseSchemaDetails,\n\tgetInnerNode,\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\tTreeArrayNode,\n} from \"../simple-tree/index.js\";\nimport type {\n\tArrayNodeDeltaOp,\n\tArrayNodeTreeChangedDeltaOp,\n\tTreeNode,\n\tWithType,\n\t// eslint-disable-next-line import-x/no-duplicates\n} from \"../simple-tree/index.js\";\n// Add some unused imports which show up in the generated d.ts file.\n// This prevents them from getting inline imports generated, cleaning up the d.ts file and API reports.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports, import-x/no-duplicates\nimport type { NodeKind, TreeNodeSchema } from \"../simple-tree/index.js\";\n\n/**\n * Enables expensive debug assertions for formatted text.\n */\nlet enableTextExpensiveDebugAsserts = false;\n\n/**\n * Enables or disables expensive debug assertions for formatted text.\n * @remarks\n * These should remain disabled except when testing implementation details of this code.\n */\nexport function setEnableExpensiveDebugAsserts(value: boolean): void {\n\tenableTextExpensiveDebugAsserts = value;\n}\n\n/**\n * Runs `condition` as a {@link debugAssert} only when {@link enableTextExpensiveDebugAsserts} is enabled.\n * @remarks\n * Like all {@link debugAssert}s, this is compiled out of production builds, so `condition` is never evaluated there.\n */\nexport function expensiveInternalValidationAssert(condition: () => true | string): void {\n\tdebugAssert(() => !enableTextExpensiveDebugAsserts || condition());\n}\n\nconst sf = new SchemaFactoryAlpha(\"com.fluidframework.text\");\n\nclass TextNode\n\textends sf.object(\"Text\", {\n\t\tcontent: SchemaFactory.required([() => StringArray], { key: EmptyKey }),\n\t})\n\timplements PlainText.Members, IExposedMethods\n{\n\tpublic static [exposeMethodsSymbol](methods: ExposedMethods): void {\n\t\tmethods.exposeMethod(\n\t\t\tTextNode,\n\t\t\t\"insertAt\",\n\t\t\tbuildFunc(\n\t\t\t\t{\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"Insert characters into the text at the given character index (Unicode code points).\",\n\t\t\t\t\treturns: tf.void(),\n\t\t\t\t},\n\t\t\t\t[\"index\", tf.number()],\n\t\t\t\t[\"additionalCharacters\", tf.string()],\n\t\t\t),\n\t\t);\n\t\tmethods.exposeMethod(\n\t\t\tTextNode,\n\t\t\t\"removeRange\",\n\t\t\tbuildFunc(\n\t\t\t\t{\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"Remove a range of characters from the text by character index (Unicode code points). startIndex defaults to 0 and endIndex defaults to the length of the text.\",\n\t\t\t\t\treturns: tf.void(),\n\t\t\t\t},\n\t\t\t\t[\"startIndex\", tf.union([tf.number(), tf.undefined()])],\n\t\t\t\t[\"endIndex\", tf.union([tf.number(), tf.undefined()])],\n\t\t\t),\n\t\t);\n\t\tmethods.exposeMethod(\n\t\t\tTextNode,\n\t\t\t\"fullString\",\n\t\t\tbuildFunc({\n\t\t\t\tdescription: \"Return a copy of this text node's content as a string.\",\n\t\t\t\treturns: tf.string(),\n\t\t\t}),\n\t\t);\n\t\tmethods.exposeMethod(\n\t\t\tTextNode,\n\t\t\t\"characterCount\",\n\t\t\tbuildFunc({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Gets the number of characters (Unicode code points) currently in the text. Joined emojis and other grapheme clusters count as multiple characters.\",\n\t\t\t\treturns: tf.number(),\n\t\t\t}),\n\t\t);\n\t\tmethods.exposeMethod(\n\t\t\tTextNode,\n\t\t\t\"charactersCopy\",\n\t\t\tbuildFunc({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Returns all characters in the text as an array, where each element is a single Unicode code point. Joined emojis and other grapheme clusters are split into separate elements.\",\n\t\t\t\treturns: tf.array(tf.string()),\n\t\t\t}),\n\t\t);\n\t}\n\n\tpublic [exposeMethodsSymbol](methods: ExposedMethods): void {\n\t\tTextNode[exposeMethodsSymbol](methods);\n\t}\n\n\tpublic insertAt(index: number, additionalCharacters: string): void {\n\t\tthis.content.insertAt(\n\t\t\tindex,\n\t\t\tTreeArrayNode.spread(charactersFromString(additionalCharacters)),\n\t\t);\n\t}\n\tpublic removeRange(index: number | undefined, end: number | undefined): void {\n\t\tthis.content.removeRange(index, end);\n\t}\n\tpublic characters(): Iterable<string> {\n\t\treturn this.content[Symbol.iterator]();\n\t}\n\n\tpublic characterCount(): number {\n\t\treturn this.content.length;\n\t}\n\n\tpublic charactersCopy(): string[] {\n\t\tconst result = this.content.charactersCopy();\n\t\texpensiveInternalValidationAssert(\n\t\t\t() =>\n\t\t\t\tcompareArrays(result, this.#charactersCopy_reference()) ||\n\t\t\t\t\"invalid charactersCopy optimizations\",\n\t\t);\n\t\treturn result;\n\t}\n\n\tpublic fullString(): string {\n\t\tconst result = this.content.fullString();\n\t\texpensiveInternalValidationAssert(\n\t\t\t() => result === this.#fullString_reference() || \"invalid fullString optimizations\",\n\t\t);\n\t\treturn result;\n\t}\n\n\t/**\n\t * Unoptimized trivially correct implementation of fullString.\n\t */\n\t#fullString_reference(): string {\n\t\treturn this.content.join(\"\");\n\t}\n\n\t/**\n\t * Unoptimized trivially correct implementation of charactersCopy.\n\t */\n\t#charactersCopy_reference(): string[] {\n\t\treturn [...this.content];\n\t}\n\n\tpublic onCharactersChanged(\n\t\tcallback: (ops: readonly PlainText.TextOp[] | undefined) => void,\n\t): () => void {\n\t\treturn TreeAlpha.on(this.content, \"nodeChanged\", ({ delta }) =>\n\t\t\tprocessCharactersChangedDelta(delta, (i) => this.content[i], callback),\n\t\t);\n\t}\n\n\tpublic static fromString(value: string): TextNode {\n\t\t// Constructing an ArrayNode from an iterator is supported, so creating an array from the iterable of characters seems like its not necessary here,\n\t\t// but to reduce the risk of incorrect data interpretation, we actually ban this in the special case where the iterable is a string directly, which is the case here.\n\t\t// Thus the array construction here is necessary to avoid a runtime error.\n\t\treturn new TextNode({ content: [...charactersFromString(value)] });\n\t}\n}\n\n/**\n * Interpret a string as an iterable of characters.\n * @remarks\n * This mostly exists to clearly document where the code is interpreting a string as characters,\n * and provide a centralized place where validation could be added in the future if desired.\n * Additionally using this function consistently will make any refactors to support alternative character boundaries easier.\n */\nexport function charactersFromString(value: string): Iterable<string> {\n\t// Uses the string as an iterable of characters, so utf-16 surrogate pairs get grouped together correctly.\n\t// Might be nice to call isWellFormed or toWellFormed here (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toWellFormed)\n\t// But those are not widely supported yet.\n\treturn value;\n}\n\nclass StringArray extends sf.array(\"StringArray\", SchemaFactory.string) {\n\tpublic withBorrowedSequenceCursor<T>(f: (cursor: ITreeCursorSynchronous) => T): T {\n\t\tconst cursor = getInnerNode(this).borrowCursor();\n\t\tcursor.enterField(EmptyKey);\n\t\tconst result = f(cursor);\n\t\tcursor.exitField();\n\t\treturn result;\n\t}\n\n\tpublic charactersCopy(): string[] {\n\t\treturn this.withBorrowedSequenceCursor((cursor) =>\n\t\t\tmapCursorField(cursor, () => cursor.value as string),\n\t\t);\n\t}\n\n\tpublic fullString(): string {\n\t\treturn this.charactersCopy().join(\"\");\n\t}\n}\n\n/**\n * Processes an array-node delta into a {@link PlainText.TextOp}[] and calls `callback`.\n * @remarks\n * Shared by both the plain `onCharactersChanged` (from `nodeChanged`) and formatted `onContentChanged`\n * (from `treeChanged`) implementations.\n * @param delta - The raw array-node delta, or `undefined` when no delta is available.\n * When retain ops carry `subtreeChanged` (i.e. delta comes from a `treeChanged` event), the emitted\n * retain ops include an explicit `formattingChanged: boolean`. Otherwise `formattingChanged` is omitted.\n * @param getCharacter - Returns the character string at the given array index in the **post-edit** tree.\n * Only invoked for insert ops, where it must read the inserted character at the given index of the tree\n * after the edit has been applied. Passing an accessor that reads pre-edit content will silently produce wrong text.\n * Return `undefined` if the tree is out of sync with the delta; this triggers a full-reread fallback.\n * @param callback - The user-supplied callback to invoke with the translated ops.\n */\nexport function processCharactersChangedDelta(\n\tdelta: readonly (ArrayNodeDeltaOp | ArrayNodeTreeChangedDeltaOp)[] | undefined,\n\tgetCharacter: (index: number) => string | undefined,\n\tcallback: (ops: readonly PlainText.TextOp[] | undefined) => void,\n): void {\n\tif (delta === undefined) {\n\t\tcallback(undefined);\n\t\treturn;\n\t}\n\tlet readPosition = 0;\n\tconst ops: PlainText.TextOp[] = [];\n\tfor (const op of delta) {\n\t\tif (op.type === \"retain\") {\n\t\t\t// `subtreeChanged` is only present on retain ops from `treeChanged` deltas.\n\t\t\tops.push(\n\t\t\t\t\"subtreeChanged\" in op\n\t\t\t\t\t? { type: \"retain\", count: op.count, formattingChanged: op.subtreeChanged === true }\n\t\t\t\t\t: { type: \"retain\", count: op.count },\n\t\t\t);\n\t\t\treadPosition += op.count;\n\t\t} else if (op.type === \"insert\") {\n\t\t\t// Accumulate into an array and join at the end to keep this O(n) for large inserts\n\t\t\t// (paste of long text) instead of O(n^2) from repeated string concatenation.\n\t\t\tconst characters: string[] = [];\n\t\t\tfor (let i = 0; i < op.count; i++) {\n\t\t\t\tconst character = getCharacter(readPosition);\n\t\t\t\tif (character === undefined) {\n\t\t\t\t\t// Tree is out of sync with the delta — fall back to full re-read.\n\t\t\t\t\tcallback(undefined);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcharacters.push(character);\n\t\t\t\treadPosition++;\n\t\t\t}\n\t\t\tops.push({ type: \"insert\", text: characters.join(\"\") });\n\t\t} else {\n\t\t\t// Construct explicit remove op so internal fields on the source op don't leak.\n\t\t\tops.push({ type: \"remove\", count: op.count });\n\t\t}\n\t}\n\tcallback(ops);\n}\n\n/**\n * A collection of text related types, schema and utilities for working with text beyond the basic {@link SchemaStatics.string}.\n * @privateRemarks\n * Currently this API only supports a really minimal feature set, and has no support for more advanced features like:\n * - Alternative character boundaries (e.g. grapheme clusters, paragraphs, tokens, etc.).\n * We may want to provide either ways to create strings with application controlled character boundaries since there is not a clear single answer on how to break a string into atomic units.\n * - Character attributes (e.g. bold, italic, etc):\n * Properties that can be set on any character independently with optimizations for runs of characters with the same attributes.\n * - Inline objects (e.g. images, embedded components, etc):\n * These would be logically part of the text, generalizing characters to allow inline objects in character ranges.\n * How character attributes apply to inline objects is an open question\n * (there could be a kind of object which gets them, and one that doesn't for example).\n * - Annotations (e.g. comments, suggestions, etc).\n * Objects which can be associated with a range of characters but are not logically part of the text.\n * These would need to have the logical range they apply to updated by edits.\n * How edits which overlap annotation boundaries are handled may require hints from the application for optimal behavior (mainly inserts at the boundaries).\n * These get a lifetime tied to the text node, not any of the characters the annotation covers,\n * however it might be desirable to have a way for a range edit to (optionally) also remove any annotations which are fully covered by the edit.\n * Annotations over an empty range should also be supported and behave well (for example not end up with characters inside the range after edits unless specifically structured so that makes sense).\n * - Anchors (e.g. positions in the text which survive edits).\n * These would be useful for ephemeral state like cursor positions, but should match the behaviors with respect to edits exhibited by the ends of Annotations.\n *\n * How these features will be represented in the schema and API should be determined before any of this is stabilized so the simple more limited version can neatly fit into the larger design.\n *\n * There are various optimizations that should be implemented to make this performant for large texts and common usage patterns.\n * These include:\n * - Optimized persisted format.\n * - Optimized in memory representation (via chunked forest).\n * - Optimized edit persisted format (e.g. combining adjacent inserts/removes into single operations as well as support for efficient attribute editing of ranges).\n * - Optimized edit application (e.g. applying the above noted optimizable edit cases efficiently).\n * This applies to the revision manager, the forest, and any flex or simple-tree nodes and user events.\n *\n * There are also additional features required for ensuring the invariants of collaborative text editing are maintained through concurrent edits.\n * The main challenges here are related to annotations, but some policies for what to do in the case of corrupt/invalid text should also be included.\n * There are quite a few ways invariants could break, including:\n * - concurrent edits without proper constraints.\n * - collaboration with clients using compatible schema with different constraints.\n * - opening documents which contain invalid content (e.g. from older versions of the software, manual edits to the persisted format, or simply an existing corrupt case which was saved).\n * - a user inserting/constructing/importing invalid content.\n *\n * These cases could break constraints causing issues like invalided characters (empty, a utf-16 surrogate pair alone, etc) or\n * annotations which reference out of bounds character ranges.\n * Addressing these issues mainly falls into these categories:\n * - Handling of invalid content on import/construction of unhydrated nodes and/or insertion into the document (hydration).\n * - Handling of invalid content which is already part of the document (live). This should ideally include both detection and repair.\n * - Constraints on edits to prevent invalid content from being created by merges.\n * - Optimization of the constraints to reduce cases in which edits are rejected due to conflicts.\n *\n * Note that these cases of invariant violations are the same cases any component should handle, so ideally there would be a general framework or pattern for documenting and enforcing such constraints.\n *\n * Another area for future work is improved APIs for import, export and non-schema-aware use. This includes a variety of cases, including but not limited to:\n * - Insertable content format (taken by the constructor and import APIs).\n * - Customizable export formats (like a way to make exportVerbose and exportConcise flatten the text nodes to strings automatically).\n * - Customizable toJson behavior (e.g. flattening to strings, possibly via tools or patterns for custom tree stringifier).\n * - Ensure JS object APIs (like iteration, own vs inherited properties, etc) provide a good and consistent experience with respect to other nodes.\n * - Support in generateSchemaFromSimpleSchema for recognizing text nodes and generating the appropriate schema.\n * - Ensure above features work well enough to support important scenarios like AI assisted editing and document indexing for search.\n *\n * Part of that work will be establishing and documenting those patterns so other components with complex encodings can follow them,\n * in addition to implementing them for text.\n * @alpha\n */\nexport namespace PlainText {\n\t/**\n\t * A retain op in a character-level delta — a span of unchanged characters that the consumer should skip over.\n\t * @sealed\n\t * @alpha\n\t */\n\texport interface TextRetainOp {\n\t\t/**\n\t\t * Discriminator identifying this op as a retain.\n\t\t */\n\t\treadonly type: \"retain\";\n\t\t/**\n\t\t * The number of Unicode code points to retain.\n\t\t */\n\t\treadonly count: number;\n\t\t/**\n\t\t * Whether at least one character in the retained range had a deep change.\n\t\t * @remarks\n\t\t * Present only on retain ops delivered by {@link @fluidframework/tree#FormattedText.Members.onContentChanged};\n\t\t * always absent on retain ops delivered by {@link PlainText.Members.onCharactersChanged}.\n\t\t * When present, `true` indicates the retained range contained a formatting property update\n\t\t * or an atom content edit; `false` indicates no deep change.\n\t\t */\n\t\treadonly formattingChanged?: boolean;\n\t}\n\n\t/**\n\t * An insert op in a character-level delta — characters newly added to the text.\n\t * @remarks\n\t * Carries the inserted text as a single string, which is more convenient for consumers than individual characters.\n\t * @sealed\n\t * @alpha\n\t */\n\texport interface TextInsertOp {\n\t\t/**\n\t\t * Discriminator identifying this op as an insert.\n\t\t */\n\t\treadonly type: \"insert\";\n\t\t/**\n\t\t * The newly inserted characters, concatenated into a single string.\n\t\t */\n\t\treadonly text: string;\n\t}\n\n\t/**\n\t * A remove op in a character-level delta — a span of characters that has been deleted from the text.\n\t * @sealed\n\t * @alpha\n\t */\n\texport interface TextRemoveOp {\n\t\t/**\n\t\t * Discriminator identifying this op as a remove.\n\t\t */\n\t\treadonly type: \"remove\";\n\t\t/**\n\t\t * The number of Unicode code points removed.\n\t\t */\n\t\treadonly count: number;\n\t}\n\n\t/**\n\t * A single operation in a character-level delta describing an insert, remove, or retain of text.\n\t * @alpha\n\t */\n\texport type TextOp = TextRetainOp | TextInsertOp | TextRemoveOp;\n\n\t/**\n\t * Statics for text nodes.\n\t * @alpha\n\t */\n\texport interface Statics {\n\t\t/**\n\t\t * Construct a {@link PlainText.(Tree:type)} from a string, where each character (as defined by iterating over the string) becomes a single character in the text node.\n\t\t * This combines pairs of utf-16 surrogate code units into single characters as appropriate.\n\t\t */\n\t\tfromString(value: string): Tree;\n\t}\n\n\t/**\n\t * Interface for a text node.\n\t * @remarks\n\t * The string is broken up into substrings which are referred to as 'characters'.\n\t * Unlike with JavaScript strings, all indexes are by character, not UTF-16 code unit.\n\t * This avoids the problem JavaScript where it can split UTF-16 surrogate pairs producing invalid strings,\n\t * and avoids the issue where indexing a string and iterating it segment the string differently.\n\t * This does NOT mean the characters correspond to user perceived characters (like grapheme clusters try to do):\n\t * applications will likely want to include higher level segmentation logic\n\t * which might differ between operations like delete\n\t * (which often operates on something in between unicode code points and grapheme clusters)\n\t * and navigation/selection (which typically uses grapheme clusters).\n\t *\n\t * @see {@link PlainText.Statics.fromString} for construction.\n\t * @see {@link PlainText.(Tree:type)} for schema.\n\t * @sealed\n\t * @alpha\n\t */\n\texport interface Members {\n\t\t/**\n\t\t * Gets an iterable over the characters currently in the text.\n\t\t * @remarks\n\t\t * This iterator matches the behavior of {@link (TreeArrayNode:interface)} with respect to edits during iteration.\n\t\t */\n\t\tcharacters(): Iterable<string>;\n\n\t\t/**\n\t\t * Optimized way to get a copy of the {@link PlainText.Members.characters} in an array.\n\t\t */\n\t\tcharactersCopy(): string[];\n\n\t\t/**\n\t\t * Gets the number of characters currently in the text.\n\t\t * @remarks\n\t\t * The length of {@link PlainText.Members.characters}.\n\t\t * This is not the length of the string returned by {@link PlainText.Members.fullString},\n\t\t * as that string may contain characters which are made up of multiple UTF-16 code units.\n\t\t */\n\t\tcharacterCount(): number;\n\n\t\t/**\n\t\t * Copy the content of this node into a string.\n\t\t */\n\t\tfullString(): string;\n\n\t\t/**\n\t\t * Insert a range of characters into the string based on character index.\n\t\t * @remarks\n\t\t * See {@link (TreeArrayNode:interface).insertAt} for more details on the behavior.\n\t\t * See {@link PlainText.Statics.fromString} for how the `additionalCharacters` string is broken into characters.\n\t\t * @privateRemarks\n\t\t * If we provide ways to customize character boundaries, that could be handled here by taking in an Iterable<string> instead of a string.\n\t\t * Doing this currently would enable insertion of text with different character boundaries than the existing text,\n\t\t * which would violate the currently documented character boundary invariants.\n\t\t *\n\t\t * Another option would be to take an approach like Table,\n\t\t * where the user of the API uses a factory function to generate the schema, and can inject custom logic, like a string character iterator.\n\t\t */\n\t\tinsertAt(index: number, additionalCharacters: string): void;\n\n\t\t/**\n\t\t * Remove a range from a string based on character index.\n\t\t * See {@link (TreeArrayNode:interface).removeRange} for more details on the behavior.\n\t\t */\n\t\tremoveRange(startIndex: number | undefined, endIndex: number | undefined): void;\n\n\t\t/**\n\t\t * Subscribe to shallow character-level changes on this text node — inserts and removes only.\n\t\t * @param callback - Called after each change with a sequence of {@link PlainText.TextOp}s describing what changed,\n\t\t * or `undefined` when a delta could not be computed (e.g. during a schema upgrade).\n\t\t * @returns A cleanup function that unsubscribes the callback when called.\n\t\t * @remarks\n\t\t * Only fires on shallow changes — inserts and removes.\n\t\t * It does not fire on deep changes such as formatting property updates on existing characters.\n\t\t * For formatted text, use {@link @fluidframework/tree#FormattedText.Members.onContentChanged} to also receive deep changes.\n\t\t *\n\t\t * All counts in the delivered ops are in Unicode code points, not UTF-16 code units.\n\t\t * For characters outside the Basic Multilingual Plane (e.g. emoji), one code point\n\t\t * corresponds to two UTF-16 code units — convert before using the counts as string indices.\n\t\t */\n\t\tonCharactersChanged(callback: (ops: readonly TextOp[] | undefined) => void): () => void;\n\t}\n\n\t/**\n\t * Schema for a {@link PlainText.(Tree:variable)} node.\n\t * @remarks\n\t * See {@link PlainText.Statics} for static APIs on this schema, including construction.\n\t * @alpha\n\t */\n\texport const Tree = eraseSchemaDetails<Members, Statics>()(TextNode);\n\n\t/**\n\t * Node for the {@link PlainText.(Tree:type)} schema exposing the {@link PlainText.Members} API.\n\t * @remarks\n\t * Create using {@link PlainText.Statics.fromString}.\n\t * @alpha\n\t */\n\texport type Tree = Members & TreeNode & WithType<\"com.fluidframework.text.Text\">;\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { TreeNodeSchema, LazyItem, ImplicitAllowedTypes, TreeNodeFromImplicitAllowedTypes, InsertableTreeNodeFromImplicitAllowedTypes, InsertableTreeFieldFromImplicitField, NodeKind, TreeNode, ScopedSchemaName, ErasedSchemaSubclassable, ErasedNode, SchemaFactoryBeta } from "../simple-tree/index.js";
6
- import { type TextAsTree } from "./textDomain.js";
6
+ import { type PlainText } from "./textDomain.js";
7
7
  declare const StringTextAtomNode_base: import("../simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.text.formatted.StringTextAtom", NodeKind.Object, import("../simple-tree/index.js").TreeObjectNode<{
8
8
  /**
9
9
  * The underlying text content of this atom.
@@ -38,22 +38,25 @@ declare const StringTextAtomNode_base: import("../simple-tree/index.js").TreeNod
38
38
  * @privateRemarks
39
39
  * This is outside the namespace so it can be exported for testing, but not package exported.
40
40
  */
41
- export declare class StringTextAtomNode extends StringTextAtomNode_base implements FormattedTextAsTree.TextAtom {
41
+ export declare class StringTextAtomNode extends StringTextAtomNode_base implements FormattedText.TextAtom {
42
42
  static fromCharacter(value: string): StringTextAtomNode;
43
43
  static fromString(value: string): StringTextAtomNode[];
44
44
  }
45
45
  /**
46
46
  * A collection of text related types, schema and utilities for working with text beyond the basic {@link SchemaStatics.string}.
47
+ *
47
48
  * @remarks
48
49
  * This is generic over formatting an embedded object/atom types.
49
- * See {@link FormattedTextAsTreeDefault} for a default parameterization.
50
+ *
50
51
  * @privateRemarks
52
+ * See {@link FormattedTextDefault} for an example parameterization.
53
+ *
51
54
  * TODO:
52
55
  * - Add more comprehensive tests for generic parameterizations other than default.
53
56
  * - Sort out API around overwriting subsets of formatting information.
54
- * @internal
57
+ * @alpha
55
58
  */
56
- export declare namespace FormattedTextAsTree {
59
+ export declare namespace FormattedText {
57
60
  /**
58
61
  * Creates a schema for a formatted text node, parameterized by the formatting and the embedded object (atom) types.
59
62
  *
@@ -62,16 +65,17 @@ export declare namespace FormattedTextAsTree {
62
65
  * This scope is used to distinguish different usages of `createSchema` from each-other, and must be kept the same between versions for nodes to remain compatible.
63
66
  * It must be different to distinguish different formatted text schema within the same document.
64
67
  * @param formatSchema - Schema describing the formatting associated with each atom of text.
65
- * Use an {@link NodeKind.Object|Object node} to support {@link FormattedTextAsTree.Members.formatRange}.
66
- * @param extraAtoms - Additional atom schema to allow as text content beyond the built-in {@link FormattedTextAsTree.(StringTextAtom:variable)}.
68
+ * Use an {@link NodeKind.Object|Object node} to support {@link FormattedText.Members.formatRange}.
69
+ * @param extraAtoms - Additional atom schema to allow as text content beyond the built-in {@link FormattedText.(StringTextAtom:variable)}.
67
70
  * Use this to embed richer content (for example line breaks or inline objects) alongside plain characters.
68
71
  * @param defaultFormatInsertable - The formatting applied to text inserted via non-formatted APIs
69
- * (for example {@link FormattedTextAsTree.Members.insertAt} and {@link FormattedTextAsTree.Statics.fromString} when no explicit format is provided).
70
- * @returns The schema for the formatted text node, whose nodes implement {@link FormattedTextAsTree.Members} and whose statics implement {@link FormattedTextAsTree.Statics}.
71
- * @remarks
72
- * See {@link FormattedTextAsTreeDefault} for a default parameterization of this factory.
72
+ * (for example {@link FormattedText.Members.insertAt} and {@link FormattedText.Statics.fromString} when no explicit format is provided).
73
+ * @returns The schema for the formatted text node, whose nodes implement {@link FormattedText.Members} and whose statics implement {@link FormattedText.Statics}.
74
+ *
73
75
  * @privateRemarks
74
- * TODO: The choice to always include the built-in {@link FormattedTextAsTree.(StringTextAtom:variable)} is a design decision that should be re-evaluated before stabilizing.
76
+ * See {@link FormattedTextDefault} for an example parameterization of this factory.
77
+ *
78
+ * TODO: The choice to always include the built-in {@link FormattedText.(StringTextAtom:variable)} is a design decision that should be re-evaluated before stabilizing.
75
79
  */
76
80
  function createSchema<const TUserScope extends string, const FormatSchema extends ImplicitAllowedTypes, const ExtraAtomsSchema extends readonly LazyItem<TreeNodeSchema<string, NodeKind, TextAtom & TreeNode>>[]>(inputSchemaFactory: SchemaFactoryBeta<TUserScope>, formatSchema: FormatSchema, extraAtoms: ExtraAtomsSchema, defaultFormatInsertable: InsertableTreeFieldFromImplicitField<FormatSchema>): FormattedTextSchema<TUserScope, FormatSchema, ExtraAtomsSchema>;
77
81
  /**
@@ -80,7 +84,7 @@ export declare namespace FormattedTextAsTree {
80
84
  * This is implemented {@link StringAtom}, but we avoid leaking the fact this is a TreeNode in the API surface to
81
85
  * preserve more future flexibility.
82
86
  * @sealed
83
- * @internal
87
+ * @alpha
84
88
  */
85
89
  interface FormattedAtom<TFormat, TText> {
86
90
  /**
@@ -98,8 +102,8 @@ export declare namespace FormattedTextAsTree {
98
102
  * Portion of a string.
99
103
  * @remarks
100
104
  * Additional kinds of text atoms (also known as embedded objects) which can occur inside a string can implement this.
101
- * The schema for them can then be provided to {@link FormattedTextAsTree.createSchema}.
102
- * @internal
105
+ * The schema for them can then be provided to {@link FormattedText.createSchema}.
106
+ * @alpha
103
107
  */
104
108
  interface TextAtom {
105
109
  /**
@@ -108,14 +112,14 @@ export declare namespace FormattedTextAsTree {
108
112
  readonly content: string;
109
113
  }
110
114
  /**
111
- * Static factory functions for {@link FormattedTextAsTree.(StringTextAtom:variable)}.
115
+ * Static factory functions for {@link FormattedText.(StringTextAtom:variable)}.
112
116
  * @privateRemarks
113
117
  * We type-erase `StringTextAtom` and only provide these static factories for construction
114
118
  * to reduce the chance of someone accidentally creating a text atom for a string other than a single unicode code point.
115
119
  * Other strings should work, but our intention is to provide no type-safe API which can produce them, so an application can take their lack of existence as an invariant if they want.
116
120
  * It is still however possible to produce them, like export/import round trips with editing in the middle of the process, or collaboration with an equivalent schema which doesn't enforce this invariant.
117
121
  * @sealed
118
- * @internal
122
+ * @alpha
119
123
  */
120
124
  interface StringTextAtomStatics {
121
125
  /**
@@ -129,21 +133,21 @@ export declare namespace FormattedTextAsTree {
129
133
  fromString(value: string): StringTextAtom[];
130
134
  }
131
135
  /**
132
- * Schema for a {@link FormattedTextAsTree.(StringTextAtom:variable)} node.
136
+ * Schema for a {@link FormattedText.(StringTextAtom:variable)} node.
133
137
  * @sealed
134
- * @internal
138
+ * @alpha
135
139
  */
136
140
  const StringTextAtom: StringTextAtomStatics & TreeNodeSchema<"com.fluidframework.text.formatted.StringTextAtom", NodeKind, TextAtom & TreeNode & import("../simple-tree/index.js").WithType<"com.fluidframework.text.formatted.StringTextAtom", NodeKind, unknown>, never, false>;
137
141
  /**
138
- * Node for the {@link FormattedTextAsTree.(StringTextAtom:variable)} schema.
142
+ * Node for the {@link FormattedText.(StringTextAtom:variable)} schema.
139
143
  * @sealed
140
- * @internal
144
+ * @alpha
141
145
  */
142
146
  type StringTextAtom = ErasedNode<TextAtom, "com.fluidframework.text.formatted.StringTextAtom">;
143
147
  /**
144
148
  * Statics for formatted text nodes.
145
149
  * @sealed
146
- * @internal
150
+ * @alpha
147
151
  */
148
152
  interface Statics<TTree, FormatSchema extends ImplicitAllowedTypes> {
149
153
  /**
@@ -165,18 +169,18 @@ export declare namespace FormattedTextAsTree {
165
169
  * (which often operates on something in between unicode code points and grapheme clusters)
166
170
  * and navigation/selection (which typically uses grapheme clusters).
167
171
  *
168
- * @see {@link FormattedTextAsTree.Statics.fromString} for construction.
169
- * @see {@link FormattedTextAsTree.createSchema} for creating schemas whose nodes implement this.
172
+ * @see {@link FormattedText.Statics.fromString} for construction.
173
+ * @see {@link FormattedText.createSchema} for creating schemas whose nodes implement this.
170
174
  * @sealed
171
- * @internal
175
+ * @alpha
172
176
  */
173
- interface Members<FormatSchema extends ImplicitAllowedTypes, ExtraAtomsSchema extends readonly LazyItem<TreeNodeSchema<string, NodeKind, TextAtom & TreeNode>>[]> extends TextAsTree.Members {
177
+ interface Members<FormatSchema extends ImplicitAllowedTypes, ExtraAtomsSchema extends readonly LazyItem<TreeNodeSchema<string, NodeKind, TextAtom & TreeNode>>[]> extends PlainText.Members {
174
178
  /**
175
- * {@link TextAsTree.Members.insertAt} with optional formatting to apply to all additional characters,
179
+ * {@link PlainText.Members.insertAt} with optional formatting to apply to all additional characters,
176
180
  * and allowing an array of atoms instead of a string.
177
- * @param format - Optional formatting to apply to all additional characters. If not specified, the default formatting (from {@link FormattedTextAsTree.createSchema}) will be used.
181
+ * @param format - Optional formatting to apply to all additional characters. If not specified, the default formatting (from {@link FormattedText.createSchema}) will be used.
178
182
  * @remarks
179
- * Use {@link FormattedTextAsTree.Members.insertWithFormattingAt} if you need to specify formatting for atom independently.
183
+ * Use {@link FormattedText.Members.insertWithFormattingAt} if you need to specify formatting for atom independently.
180
184
  * @override
181
185
  */
182
186
  insertAt(index: number, additionalCharacters: string | Iterable<TreeNodeFromImplicitAllowedTypes<TextAtomSchemas<ExtraAtomsSchema>>>, format?: InsertableTreeFieldFromImplicitField<FormatSchema>): void;
@@ -185,7 +189,7 @@ export declare namespace FormattedTextAsTree {
185
189
  * @remarks
186
190
  * This iterator matches the behavior of {@link (TreeArrayNode:interface)} with respect to edits during iteration.
187
191
  *
188
- * For more efficient access, use {@link FormattedTextAsTree.Members.getUniformRun} and {@link FormattedTextAsTree.Members.getString} to access ranges of characters
192
+ * For more efficient access, use {@link FormattedText.Members.getUniformRun} and {@link FormattedText.Members.getString} to access ranges of characters
189
193
  * to avoid having to inspect the formatting on every atom.
190
194
  * @privateRemarks
191
195
  * Currently this is implemented by a node and changes with the text over time.
@@ -197,7 +201,7 @@ export declare namespace FormattedTextAsTree {
197
201
  * Insert a range of characters into the string based on character index.
198
202
  * @remarks
199
203
  * See {@link (TreeArrayNode:interface).insertAt} for more details on the behavior.
200
- * See {@link FormattedTextAsTree.Statics.fromString} for how the `additionalCharacters` string is broken into characters.
204
+ * See {@link FormattedText.Statics.fromString} for how the `additionalCharacters` string is broken into characters.
201
205
  * @privateRemarks
202
206
  * If we provide ways to customize character boundaries, that could be handled here by taking in an Iterable<string> instead of a string.
203
207
  * Doing this currently would enable insertion of text with different character boundaries than the existing text,
@@ -233,13 +237,13 @@ export declare namespace FormattedTextAsTree {
233
237
  * @param endIndex - The ending index (exclusive) of the range to format.
234
238
  * @param format - The formatting to replace the formatting of the indicated range with.
235
239
  * For each atom, `format` will be cloned and assigned to the atom's format, overwriting any existing formatting.
236
- * If not specified the `defaultFormat` from {@link FormattedTextAsTree.createSchema} will be used.
240
+ * If not specified the `defaultFormat` from {@link FormattedText.createSchema} will be used.
237
241
  * @remarks
238
242
  * The start and end behave the same as in {@link (TreeArrayNode:interface).removeRange}.
239
243
  *
240
244
  * This is typically used to normalize formatting, like resetting the formatting of a range to default settings.
241
245
  * @privateRemarks
242
- * See notes on {@link FormattedTextAsTree.Members.formatRange} for future optimization opportunities.
246
+ * See notes on {@link FormattedText.Members.formatRange} for future optimization opportunities.
243
247
  */
244
248
  reformat(startIndex?: number | undefined, endIndex?: number | undefined, format?: InsertableTreeFieldFromImplicitField<FormatSchema>): void;
245
249
  /**
@@ -257,26 +261,26 @@ export declare namespace FormattedTextAsTree {
257
261
  /**
258
262
  * Subscribe to all content changes on this text node, including both shallow
259
263
  * changes (inserts/removes) and deep changes (formatting updates on existing characters).
260
- * @param callback - Called after each change with a sequence of {@link TextAsTree.TextOp}s describing what changed,
264
+ * @param callback - Called after each change with a sequence of {@link PlainText.TextOp}s describing what changed,
261
265
  * or `undefined` when a delta could not be computed (e.g. during a schema upgrade).
262
266
  * @returns A cleanup function that unsubscribes the callback when called.
263
267
  * @remarks
264
- * Unlike {@link TextAsTree.Members.onCharactersChanged} which only fires on
268
+ * Unlike {@link PlainText.Members.onCharactersChanged} which only fires on
265
269
  * shallow changes (inserts and removes), this method also fires on deep changes —
266
270
  * formatting property updates on existing characters.
267
- * The {@link TextAsTree.TextRetainOp.formattingChanged} flag on retain ops
271
+ * The {@link PlainText.TextRetainOp.formattingChanged} flag on retain ops
268
272
  * indicates which character ranges had formatting updates.
269
273
  *
270
274
  * All counts in the delivered ops are in Unicode code points, not UTF-16 code units.
271
275
  * For characters outside the Basic Multilingual Plane (e.g. emoji), one code point
272
276
  * corresponds to two UTF-16 code units — convert before using the counts as string indices.
273
277
  */
274
- onContentChanged(callback: (ops: readonly TextAsTree.TextOp[] | undefined) => void): () => void;
278
+ onContentChanged(callback: (ops: readonly PlainText.TextOp[] | undefined) => void): () => void;
275
279
  }
276
280
  /**
277
- * Insertable shape for a formatted text atom used by {@link FormattedTextAsTree.Members.insertWithFormattingAt}.
281
+ * Insertable shape for a formatted text atom used by {@link FormattedText.Members.insertWithFormattingAt}.
278
282
  * @input
279
- * @internal
283
+ * @alpha
280
284
  */
281
285
  interface FormattedAtomInsertable<TFormat, TContent> {
282
286
  readonly content: TContent;
@@ -286,7 +290,7 @@ export declare namespace FormattedTextAsTree {
286
290
  * Schema identifier for the a generic formatted text schema.
287
291
  * @privateRemarks
288
292
  * Eventually this should probably be given a better name and/or made a system type in a system namespace.
289
- * @internal
293
+ * @alpha
290
294
  */
291
295
  type FormattedTextSchemaIdentifier<TUserScope extends string> = ScopedSchemaName<`com.fluidframework.text.formatted<${TUserScope}>`, "Text">;
292
296
  /**
@@ -295,13 +299,13 @@ export declare namespace FormattedTextAsTree {
295
299
  * This is just schema for the text atom {@link AllowedTypes},
296
300
  * and does not include the actual formatting (which is higher up in the tree).
297
301
  * @sealed
298
- * @internal
302
+ * @alpha
299
303
  */
300
304
  type TextAtomSchemas<ExtraAtomsSchema extends readonly LazyItem<TreeNodeSchema<string, NodeKind, TextAtom & TreeNode>>[]> = readonly [typeof StringTextAtom, ...ExtraAtomsSchema];
301
305
  /**
302
306
  * A generic type for a formatted text schema.
303
307
  * @sealed
304
- * @internal
308
+ * @alpha
305
309
  */
306
310
  type FormattedTextSchema<TUserScope extends string, FormatSchema extends ImplicitAllowedTypes, ExtraAtomsSchema extends readonly LazyItem<TreeNodeSchema<string, NodeKind, TextAtom & TreeNode>>[]> = Statics<ErasedNode<Members<FormatSchema, ExtraAtomsSchema>, FormattedTextSchemaIdentifier<TUserScope>>, FormatSchema> & ErasedSchemaSubclassable<Members<FormatSchema, ExtraAtomsSchema>, FormattedTextSchemaIdentifier<TUserScope>>;
307
311
  }
@@ -1 +1 @@
1
- {"version":3,"file":"textDomainFormatted.d.ts","sourceRoot":"","sources":["../../src/text/textDomainFormatted.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyBH,OAAO,KAAK,EACX,cAAc,EACd,QAAQ,EACR,oBAAoB,EAGpB,gCAAgC,EAChC,0CAA0C,EAC1C,oCAAoC,EACpC,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,wBAAwB,EACxB,UAAU,EACV,iBAAiB,EACjB,MAAM,yBAAyB,CAAC;AASjC,OAAO,EAIN,KAAK,UAAU,EACf,MAAM,iBAAiB,CAAC;;IA2BvB;;;;;;;;;;OAUG;;;;;IAVH;;;;;;;;;;OAUG;;;AAjBL;;;;GAIG;AACH,qBAAa,kBACZ,SAAQ,uBAcR,YAAW,mBAAmB,CAAC,QAAQ;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