@fluidframework/sequence 2.0.0-internal.1.4.2 → 2.0.0-internal.2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/defaultMap.d.ts.map +1 -1
  2. package/dist/defaultMap.js +1 -0
  3. package/dist/defaultMap.js.map +1 -1
  4. package/dist/index.d.ts +4 -5
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +2 -4
  7. package/dist/index.js.map +1 -1
  8. package/dist/intervalCollection.d.ts +271 -34
  9. package/dist/intervalCollection.d.ts.map +1 -1
  10. package/dist/intervalCollection.js +343 -97
  11. package/dist/intervalCollection.js.map +1 -1
  12. package/dist/intervalTree.d.ts +72 -0
  13. package/dist/intervalTree.d.ts.map +1 -0
  14. package/dist/intervalTree.js +91 -0
  15. package/dist/intervalTree.js.map +1 -0
  16. package/dist/packageVersion.d.ts +1 -1
  17. package/dist/packageVersion.js +1 -1
  18. package/dist/packageVersion.js.map +1 -1
  19. package/dist/sequence.d.ts +66 -15
  20. package/dist/sequence.d.ts.map +1 -1
  21. package/dist/sequence.js +73 -19
  22. package/dist/sequence.js.map +1 -1
  23. package/dist/sequenceDeltaEvent.d.ts +15 -1
  24. package/dist/sequenceDeltaEvent.d.ts.map +1 -1
  25. package/dist/sequenceDeltaEvent.js +2 -1
  26. package/dist/sequenceDeltaEvent.js.map +1 -1
  27. package/dist/sequenceFactory.d.ts +0 -89
  28. package/dist/sequenceFactory.d.ts.map +1 -1
  29. package/dist/sequenceFactory.js +2 -142
  30. package/dist/sequenceFactory.js.map +1 -1
  31. package/dist/sharedIntervalCollection.d.ts +0 -6
  32. package/dist/sharedIntervalCollection.d.ts.map +1 -1
  33. package/dist/sharedIntervalCollection.js +0 -7
  34. package/dist/sharedIntervalCollection.js.map +1 -1
  35. package/dist/sharedSequence.d.ts +2 -2
  36. package/dist/sharedString.d.ts +16 -15
  37. package/dist/sharedString.d.ts.map +1 -1
  38. package/dist/sharedString.js +96 -15
  39. package/dist/sharedString.js.map +1 -1
  40. package/lib/defaultMap.d.ts.map +1 -1
  41. package/lib/defaultMap.js +1 -0
  42. package/lib/defaultMap.js.map +1 -1
  43. package/lib/index.d.ts +4 -5
  44. package/lib/index.d.ts.map +1 -1
  45. package/lib/index.js +2 -4
  46. package/lib/index.js.map +1 -1
  47. package/lib/intervalCollection.d.ts +271 -34
  48. package/lib/intervalCollection.d.ts.map +1 -1
  49. package/lib/intervalCollection.js +341 -98
  50. package/lib/intervalCollection.js.map +1 -1
  51. package/lib/intervalTree.d.ts +72 -0
  52. package/lib/intervalTree.d.ts.map +1 -0
  53. package/lib/intervalTree.js +86 -0
  54. package/lib/intervalTree.js.map +1 -0
  55. package/lib/packageVersion.d.ts +1 -1
  56. package/lib/packageVersion.js +1 -1
  57. package/lib/packageVersion.js.map +1 -1
  58. package/lib/sequence.d.ts +66 -15
  59. package/lib/sequence.d.ts.map +1 -1
  60. package/lib/sequence.js +73 -19
  61. package/lib/sequence.js.map +1 -1
  62. package/lib/sequenceDeltaEvent.d.ts +15 -1
  63. package/lib/sequenceDeltaEvent.d.ts.map +1 -1
  64. package/lib/sequenceDeltaEvent.js +2 -1
  65. package/lib/sequenceDeltaEvent.js.map +1 -1
  66. package/lib/sequenceFactory.d.ts +0 -89
  67. package/lib/sequenceFactory.d.ts.map +1 -1
  68. package/lib/sequenceFactory.js +1 -139
  69. package/lib/sequenceFactory.js.map +1 -1
  70. package/lib/sharedIntervalCollection.d.ts +0 -6
  71. package/lib/sharedIntervalCollection.d.ts.map +1 -1
  72. package/lib/sharedIntervalCollection.js +0 -7
  73. package/lib/sharedIntervalCollection.js.map +1 -1
  74. package/lib/sharedSequence.d.ts +2 -2
  75. package/lib/sharedString.d.ts +16 -15
  76. package/lib/sharedString.d.ts.map +1 -1
  77. package/lib/sharedString.js +97 -16
  78. package/lib/sharedString.js.map +1 -1
  79. package/package.json +99 -27
  80. package/src/defaultMap.ts +3 -0
  81. package/src/index.ts +4 -4
  82. package/src/intervalCollection.ts +486 -143
  83. package/src/intervalTree.ts +166 -0
  84. package/src/packageVersion.ts +1 -1
  85. package/src/sequence.ts +86 -30
  86. package/src/sequenceDeltaEvent.ts +18 -4
  87. package/src/sequenceFactory.ts +2 -163
  88. package/src/sharedIntervalCollection.ts +0 -11
  89. package/src/sharedString.ts +120 -23
  90. package/tsconfig.json +0 -1
  91. package/dist/sharedNumberSequence.d.ts +0 -50
  92. package/dist/sharedNumberSequence.d.ts.map +0 -1
  93. package/dist/sharedNumberSequence.js +0 -61
  94. package/dist/sharedNumberSequence.js.map +0 -1
  95. package/dist/sharedObjectSequence.d.ts +0 -50
  96. package/dist/sharedObjectSequence.d.ts.map +0 -1
  97. package/dist/sharedObjectSequence.js +0 -61
  98. package/dist/sharedObjectSequence.js.map +0 -1
  99. package/dist/sparsematrix.d.ts +0 -152
  100. package/dist/sparsematrix.d.ts.map +0 -1
  101. package/dist/sparsematrix.js +0 -343
  102. package/dist/sparsematrix.js.map +0 -1
  103. package/lib/sharedNumberSequence.d.ts +0 -50
  104. package/lib/sharedNumberSequence.d.ts.map +0 -1
  105. package/lib/sharedNumberSequence.js +0 -57
  106. package/lib/sharedNumberSequence.js.map +0 -1
  107. package/lib/sharedObjectSequence.d.ts +0 -50
  108. package/lib/sharedObjectSequence.d.ts.map +0 -1
  109. package/lib/sharedObjectSequence.js +0 -57
  110. package/lib/sharedObjectSequence.js.map +0 -1
  111. package/lib/sparsematrix.d.ts +0 -152
  112. package/lib/sparsematrix.d.ts.map +0 -1
  113. package/lib/sparsematrix.js +0 -334
  114. package/lib/sparsematrix.js.map +0 -1
  115. package/src/sharedNumberSequence.ts +0 -62
  116. package/src/sharedObjectSequence.ts +0 -62
  117. package/src/sparsematrix.ts +0 -434
@@ -10,15 +10,10 @@ import {
10
10
  IChannelFactory,
11
11
  } from "@fluidframework/datastore-definitions";
12
12
  import {
13
- IJSONSegment,
14
13
  Marker,
15
14
  TextSegment,
16
15
  } from "@fluidframework/merge-tree";
17
- import { ISharedObject } from "@fluidframework/shared-object-base";
18
16
  import { pkgVersion } from "./packageVersion";
19
- import { SharedNumberSequence } from "./sharedNumberSequence";
20
- import { SharedObjectSequence } from "./sharedObjectSequence";
21
- import { IJSONRunSegment, SubSequence } from "./sharedSequence";
22
17
  import { SharedString, SharedStringSegment } from "./sharedString";
23
18
 
24
19
  export class SharedStringFactory implements IChannelFactory {
@@ -38,6 +33,8 @@ export class SharedStringFactory implements IChannelFactory {
38
33
 
39
34
  const maybeMarker = Marker.fromJSONObject(spec);
40
35
  if (maybeMarker) { return maybeMarker; }
36
+
37
+ throw new Error(`Unrecognized IJSONObject`);
41
38
  }
42
39
 
43
40
  public get type() {
@@ -67,161 +64,3 @@ export class SharedStringFactory implements IChannelFactory {
67
64
  return sharedString;
68
65
  }
69
66
  }
70
-
71
- /**
72
- * @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
73
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
74
- */
75
- export class SharedObjectSequenceFactory implements IChannelFactory {
76
- /**
77
- * @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
78
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
79
- */
80
- public static Type = "https://graph.microsoft.com/types/mergeTree/object-sequence";
81
-
82
- /**
83
- * @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
84
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
85
- */
86
- public static readonly Attributes: IChannelAttributes = {
87
- type: SharedObjectSequenceFactory.Type,
88
- snapshotFormatVersion: "0.1",
89
- packageVersion: pkgVersion,
90
- };
91
-
92
- /**
93
- * @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
94
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
95
- */
96
- public static segmentFromSpec(segSpec: IJSONSegment) {
97
- const runSegment = segSpec as IJSONRunSegment<object>;
98
- if (runSegment.items) {
99
- const seg = new SubSequence<object>(runSegment.items);
100
- if (runSegment.props) {
101
- seg.addProperties(runSegment.props);
102
- }
103
- return seg;
104
- }
105
- }
106
-
107
- /**
108
- * @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
109
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
110
- */
111
- public get type() {
112
- return SharedObjectSequenceFactory.Type;
113
- }
114
-
115
- /**
116
- * @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
117
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
118
- */
119
- public get attributes() {
120
- return SharedObjectSequenceFactory.Attributes;
121
- }
122
-
123
- /**
124
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
125
- *
126
- * @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
127
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
128
- */
129
- public async load(
130
- runtime: IFluidDataStoreRuntime,
131
- id: string,
132
- services: IChannelServices,
133
- attributes: IChannelAttributes): Promise<ISharedObject> {
134
- const sharedSeq = new SharedObjectSequence<object>(runtime, id, attributes);
135
- await sharedSeq.load(services);
136
- return sharedSeq;
137
- }
138
-
139
- /**
140
- * @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
141
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
142
- */
143
- public create(document: IFluidDataStoreRuntime, id: string): ISharedObject {
144
- const sharedString = new SharedObjectSequence(document, id, this.attributes);
145
- sharedString.initializeLocal();
146
- return sharedString;
147
- }
148
- }
149
-
150
- /**
151
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
152
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
153
- */
154
- export class SharedNumberSequenceFactory implements IChannelFactory {
155
- /**
156
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
157
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
158
- */
159
- public static Type = "https://graph.microsoft.com/types/mergeTree/number-sequence";
160
-
161
- /**
162
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
163
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
164
- */
165
- public static readonly Attributes: IChannelAttributes = {
166
- type: SharedNumberSequenceFactory.Type,
167
- snapshotFormatVersion: "0.1",
168
- packageVersion: pkgVersion,
169
- };
170
-
171
- /**
172
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
173
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
174
- */
175
- public static segmentFromSpec(segSpec: IJSONSegment) {
176
- const runSegment = segSpec as IJSONRunSegment<number>;
177
- if (runSegment.items) {
178
- const seg = new SubSequence<number>(runSegment.items);
179
- if (runSegment.props) {
180
- seg.addProperties(runSegment.props);
181
- }
182
- return seg;
183
- }
184
- }
185
-
186
- /**
187
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
188
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
189
- */
190
- public get type() {
191
- return SharedNumberSequenceFactory.Type;
192
- }
193
-
194
- /**
195
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
196
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
197
- */
198
- public get attributes() {
199
- return SharedNumberSequenceFactory.Attributes;
200
- }
201
-
202
- /**
203
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
204
- *
205
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
206
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
207
- */
208
- public async load(
209
- runtime: IFluidDataStoreRuntime,
210
- id: string,
211
- services: IChannelServices,
212
- attributes: IChannelAttributes): Promise<ISharedObject> {
213
- const sharedSeq = new SharedNumberSequence(runtime, id, attributes);
214
- await sharedSeq.load(services);
215
- return sharedSeq;
216
- }
217
-
218
- /**
219
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
220
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
221
- */
222
- public create(document: IFluidDataStoreRuntime, id: string): ISharedObject {
223
- const sharedString = new SharedNumberSequence(document, id, this.attributes);
224
- sharedString.initializeLocal();
225
- return sharedString;
226
- }
227
- }
@@ -77,7 +77,6 @@ export class SharedIntervalCollectionFactory implements IChannelFactory {
77
77
  }
78
78
 
79
79
  export interface ISharedIntervalCollection<TInterval extends ISerializableInterval> {
80
- waitIntervalCollection(label: string): Promise<IntervalCollection<TInterval>>;
81
80
  getIntervalCollection(label: string): IntervalCollection<TInterval>;
82
81
  }
83
82
 
@@ -127,16 +126,6 @@ export class SharedIntervalCollection
127
126
  );
128
127
  }
129
128
 
130
- /**
131
- * @deprecated `IntervalCollection`s are created on a first-write wins basis, and concurrent creates
132
- * are supported. Use {@link SharedIntervalCollection.getIntervalCollection} instead.
133
- */
134
- public async waitIntervalCollection(
135
- label: string,
136
- ): Promise<IntervalCollection<Interval>> {
137
- return this.intervalCollections.get(this.getIntervalCollectionPath(label));
138
- }
139
-
140
129
  public getIntervalCollection(label: string): IntervalCollection<Interval> {
141
130
  const realLabel = this.getIntervalCollectionPath(label);
142
131
  const sharedCollection = this.intervalCollections.get(realLabel);
@@ -10,10 +10,12 @@ import {
10
10
  IMergeTreeTextHelper,
11
11
  IRelativePosition,
12
12
  ISegment,
13
+ ISegmentAction,
13
14
  Marker,
14
15
  PropertySet,
15
16
  ReferencePosition,
16
17
  ReferenceType,
18
+ refHasTileLabel,
17
19
  TextSegment,
18
20
  } from "@fluidframework/merge-tree";
19
21
  import { IFluidDataStoreRuntime, IChannelAttributes } from "@fluidframework/datastore-definitions";
@@ -38,7 +40,7 @@ export interface ISharedString extends SharedSegmentSequence<SharedStringSegment
38
40
  * @param refType - The reference type of the marker
39
41
  * @param props - The properties of the marker
40
42
  */
41
- insertMarker(pos: number, refType: ReferenceType, props?: PropertySet): IMergeTreeInsertMsg;
43
+ insertMarker(pos: number, refType: ReferenceType, props?: PropertySet): IMergeTreeInsertMsg | undefined;
42
44
 
43
45
  /**
44
46
  * {@inheritDoc SharedSegmentSequence.posFromRelativePos}
@@ -84,7 +86,7 @@ export class SharedString extends SharedSegmentSequence<SharedStringSegment> imp
84
86
  private readonly mergeTreeTextHelper: IMergeTreeTextHelper;
85
87
 
86
88
  constructor(document: IFluidDataStoreRuntime, public id: string, attributes: IChannelAttributes) {
87
- super(document, id, attributes, SharedStringFactory.segmentFromSpec);
89
+ super(document, id, attributes, SharedStringFactory.segmentFromSpec as any);
88
90
  this.mergeTreeTextHelper = this.client.createTextHelper();
89
91
  }
90
92
 
@@ -116,7 +118,7 @@ export class SharedString extends SharedSegmentSequence<SharedStringSegment> imp
116
118
  public insertMarker(
117
119
  pos: number,
118
120
  refType: ReferenceType,
119
- props?: PropertySet): IMergeTreeInsertMsg {
121
+ props?: PropertySet): IMergeTreeInsertMsg | undefined {
120
122
  const segment = new Marker(refType);
121
123
  if (props) {
122
124
  segment.addProperties(props);
@@ -216,19 +218,19 @@ export class SharedString extends SharedSegmentSequence<SharedStringSegment> imp
216
218
  }
217
219
  }
218
220
 
221
+ /**
222
+ * Finds the nearest reference with ReferenceType.Tile to `startPos` in the direction dictated by `tilePrecedesPos`.
223
+ * Note that Markers receive `ReferenceType.Tile` by default.
224
+ * @param startPos - Position at which to start the search
225
+ * @param clientId - clientId dictating the perspective to search from
226
+ * @param tileLabel - Label of the tile to search for
227
+ * @param preceding - Whether the desired tile comes before (true) or after (false) `startPos`
228
+ */
219
229
  public findTile(startPos: number | undefined, tileLabel: string, preceding = true): {
220
230
  tile: ReferencePosition;
221
231
  pos: number;
222
- } {
223
- return this.client.findTile(startPos, tileLabel, preceding);
224
- }
225
-
226
- /**
227
- * @deprecated Use the free function {@link getTextAndMarkers} exported by this package instead.
228
- */
229
- public getTextAndMarkers(label: string) {
230
- const segmentWindow = this.client.getCollabWindow();
231
- return this.mergeTreeTextHelper.getTextAndMarkers(segmentWindow.currentSeq, segmentWindow.clientId, label);
232
+ } | undefined {
233
+ return this.client.findTile(startPos ?? 0, tileLabel, preceding);
232
234
  }
233
235
 
234
236
  /**
@@ -250,19 +252,16 @@ export class SharedString extends SharedSegmentSequence<SharedStringSegment> imp
250
252
  return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, " ", start, end);
251
253
  }
252
254
 
253
- /**
254
- * @deprecated Use {@link SharedString.getTextWithPlaceholders} instead.
255
- */
256
- public getTextRangeWithPlaceholders(start: number, end: number) {
257
- return this.getTextWithPlaceholders(start, end);
258
- }
259
-
260
255
  public getTextRangeWithMarkers(start: number, end: number) {
261
256
  const segmentWindow = this.client.getCollabWindow();
262
257
  return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, "*", start, end);
263
258
  }
264
259
 
265
- public getMarkerFromId(id: string): ISegment {
260
+ /**
261
+ * Looks up and returns a `Marker` using its id. Returns `undefined` if there is no marker with the provided
262
+ * id in this `SharedString`.
263
+ */
264
+ public getMarkerFromId(id: string): ISegment | undefined {
266
265
  return this.client.getMarkerFromId(id);
267
266
  }
268
267
 
@@ -278,6 +277,15 @@ export class SharedString extends SharedSegmentSequence<SharedStringSegment> imp
278
277
  }
279
278
  }
280
279
 
280
+ interface ITextAndMarkerAccumulator {
281
+ parallelText: string[];
282
+ parallelMarkers: Marker[];
283
+ parallelMarkerLabel: string;
284
+ placeholder?: string;
285
+ tagsInProgress: string[];
286
+ textSegment: TextSegment;
287
+ }
288
+
281
289
  /**
282
290
  * Splits the text into regions ending with markers with the given `label`.
283
291
  * @param sharedString - String to retrieve text and markers from
@@ -293,9 +301,98 @@ export class SharedString extends SharedSegmentSequence<SharedStringSegment> imp
293
301
  * // Note parallelText does not include "missing".
294
302
  * ```
295
303
  */
296
- export function getTextAndMarkers(sharedString: SharedString, label: string): {
304
+ export function getTextAndMarkers(sharedString: SharedString, label: string, start?: number, end?: number): {
297
305
  parallelText: string[];
298
306
  parallelMarkers: Marker[];
299
307
  } {
300
- return sharedString.getTextAndMarkers(label);
308
+ const accum: ITextAndMarkerAccumulator = {
309
+ parallelMarkerLabel: label,
310
+ parallelMarkers: [],
311
+ parallelText: [],
312
+ tagsInProgress: [],
313
+ textSegment: new TextSegment(""),
314
+ };
315
+
316
+ sharedString.walkSegments(gatherTextAndMarkers, start, end, accum);
317
+ return { parallelText: accum.parallelText, parallelMarkers: accum.parallelMarkers };
301
318
  }
319
+
320
+ const gatherTextAndMarkers: ISegmentAction<ITextAndMarkerAccumulator> = (
321
+ segment: ISegment,
322
+ pos: number,
323
+ refSeq: number,
324
+ clientId: number,
325
+ start: number,
326
+ end: number,
327
+ accumText: ITextAndMarkerAccumulator,
328
+ ) => {
329
+ const { placeholder, tagsInProgress, textSegment } = accumText;
330
+ if (TextSegment.is(segment)) {
331
+ let beginTags = "";
332
+ let endTags = "";
333
+ // TODO: let clients pass in function to get tag
334
+ const tags = [] as string[];
335
+ const initTags = [] as string[];
336
+
337
+ if (segment.properties?.["font-weight"]) {
338
+ tags.push("b");
339
+ }
340
+ if (segment.properties?.["text-decoration"]) {
341
+ tags.push("u");
342
+ }
343
+ const remTags = [] as string[];
344
+ if (tags.length > 0) {
345
+ for (const tag of tags) {
346
+ if (!tagsInProgress.includes(tag)) {
347
+ beginTags += `<${tag}>`;
348
+ initTags.push(tag);
349
+ }
350
+ }
351
+ for (const accumTag of tagsInProgress) {
352
+ if (!tags.includes(accumTag)) {
353
+ endTags += `</${accumTag}>`;
354
+ remTags.push(accumTag);
355
+ }
356
+ }
357
+ for (const initTag of initTags.reverse()) {
358
+ tagsInProgress.push(initTag);
359
+ }
360
+ } else {
361
+ for (const accumTag of tagsInProgress) {
362
+ endTags += `</${accumTag}>`;
363
+ remTags.push(accumTag);
364
+ }
365
+ }
366
+ for (const remTag of remTags) {
367
+ const remdex = tagsInProgress.indexOf(remTag);
368
+ if (remdex >= 0) {
369
+ tagsInProgress.splice(remdex, 1);
370
+ }
371
+ }
372
+ textSegment.text += endTags;
373
+ textSegment.text += beginTags;
374
+ if ((start <= 0) && (end >= segment.text.length)) {
375
+ textSegment.text += segment.text;
376
+ } else {
377
+ const seglen = segment.text.length;
378
+ const _start = start < 0 ? 0 : start;
379
+ const _end = end >= seglen ? undefined : end;
380
+ textSegment.text += segment.text.substring(_start, _end);
381
+ }
382
+ } else {
383
+ if (placeholder && (placeholder.length > 0)) {
384
+ const placeholderText = placeholder === "*" ?
385
+ `\n${segment.toString()}` : placeholder.repeat(segment.cachedLength);
386
+ textSegment.text += placeholderText;
387
+ } else {
388
+ const marker = segment as Marker;
389
+ if (refHasTileLabel(marker, accumText.parallelMarkerLabel)) {
390
+ accumText.parallelMarkers.push(marker);
391
+ accumText.parallelText.push(textSegment.text);
392
+ textSegment.text = "";
393
+ }
394
+ }
395
+ }
396
+
397
+ return true;
398
+ };
package/tsconfig.json CHANGED
@@ -4,7 +4,6 @@
4
4
  "src/test/**/*"
5
5
  ],
6
6
  "compilerOptions": {
7
- "strictNullChecks": false,
8
7
  "rootDir": "./src",
9
8
  "outDir": "./dist",
10
9
  "composite": true
@@ -1,50 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { IFluidDataStoreRuntime, IChannelAttributes } from "@fluidframework/datastore-definitions";
6
- import { SharedNumberSequenceFactory } from "./sequenceFactory";
7
- import { SharedSequence } from "./sharedSequence";
8
- /**
9
- * The SharedNumberSequence holds a sequence of numbers. Each number will be stored
10
- * at a position within the sequence. See the
11
- * {@link https://fluidframework.com/docs/data-structures/sequences/ | sequence documentation}
12
- * for details on working with sequences.
13
- *
14
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
15
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
16
- */
17
- export declare class SharedNumberSequence extends SharedSequence<number> {
18
- id: string;
19
- /**
20
- * Create a new shared number sequence
21
- *
22
- * @param runtime - data store runtime the new shared number sequence belongs to
23
- * @param id - optional name of the shared number sequence
24
- * @returns newly create shared number sequence (but not attached yet)
25
- *
26
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
27
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
28
- */
29
- static create(runtime: IFluidDataStoreRuntime, id?: string): SharedNumberSequence;
30
- /**
31
- * Get a factory for SharedNumberSequence to register with the data store.
32
- *
33
- * @returns a factory that creates and load SharedNumberSequence
34
- *
35
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
36
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
37
- */
38
- static getFactory(): SharedNumberSequenceFactory;
39
- /**
40
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
41
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
42
- */
43
- constructor(document: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
44
- /**
45
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
46
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
47
- */
48
- getRange(start: number, end?: number): number[];
49
- }
50
- //# sourceMappingURL=sharedNumberSequence.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sharedNumberSequence.d.ts","sourceRoot":"","sources":["../src/sharedNumberSequence.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AACnG,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;;;GAQG;AACH,qBAAa,oBAAqB,SAAQ,cAAc,CAAC,MAAM,CAAC;IAgCP,EAAE,EAAE,MAAM;IA/B/D;;;;;;;;;OASG;WACW,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,MAAM;IAKjE;;;;;;;OAOG;WACW,UAAU;IAIxB;;;OAGG;gBACS,QAAQ,EAAE,sBAAsB,EAAS,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB;IAI/F;;;OAGG;IACI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;CAG9C"}
@@ -1,61 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SharedNumberSequence = void 0;
8
- const sequenceFactory_1 = require("./sequenceFactory");
9
- const sharedSequence_1 = require("./sharedSequence");
10
- /**
11
- * The SharedNumberSequence holds a sequence of numbers. Each number will be stored
12
- * at a position within the sequence. See the
13
- * {@link https://fluidframework.com/docs/data-structures/sequences/ | sequence documentation}
14
- * for details on working with sequences.
15
- *
16
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
17
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
18
- */
19
- class SharedNumberSequence extends sharedSequence_1.SharedSequence {
20
- /**
21
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
22
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
23
- */
24
- constructor(document, id, attributes) {
25
- super(document, id, attributes, sequenceFactory_1.SharedNumberSequenceFactory.segmentFromSpec);
26
- this.id = id;
27
- }
28
- /**
29
- * Create a new shared number sequence
30
- *
31
- * @param runtime - data store runtime the new shared number sequence belongs to
32
- * @param id - optional name of the shared number sequence
33
- * @returns newly create shared number sequence (but not attached yet)
34
- *
35
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
36
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
37
- */
38
- static create(runtime, id) {
39
- return runtime.createChannel(id, sequenceFactory_1.SharedNumberSequenceFactory.Type);
40
- }
41
- /**
42
- * Get a factory for SharedNumberSequence to register with the data store.
43
- *
44
- * @returns a factory that creates and load SharedNumberSequence
45
- *
46
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
47
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
48
- */
49
- static getFactory() {
50
- return new sequenceFactory_1.SharedNumberSequenceFactory();
51
- }
52
- /**
53
- * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
54
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
55
- */
56
- getRange(start, end) {
57
- return this.getItems(start, end);
58
- }
59
- }
60
- exports.SharedNumberSequence = SharedNumberSequence;
61
- //# sourceMappingURL=sharedNumberSequence.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sharedNumberSequence.js","sourceRoot":"","sources":["../src/sharedNumberSequence.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uDAAgE;AAChE,qDAAkD;AAElD;;;;;;;;GAQG;AACH,MAAa,oBAAqB,SAAQ,+BAAsB;IA4B5D;;;OAGG;IACH,YAAY,QAAgC,EAAS,EAAU,EAAE,UAA8B;QAC3F,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,6CAA2B,CAAC,eAAe,CAAC,CAAC;QAD5B,OAAE,GAAF,EAAE,CAAQ;IAE/D,CAAC;IAjCD;;;;;;;;;OASG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAC7D,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAC3B,6CAA2B,CAAC,IAAI,CAAyB,CAAC;IAClE,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,UAAU;QACpB,OAAO,IAAI,6CAA2B,EAAE,CAAC;IAC7C,CAAC;IAUD;;;OAGG;IACI,QAAQ,CAAC,KAAa,EAAE,GAAY;QACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACrC,CAAC;CACJ;AA3CD,oDA2CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidDataStoreRuntime, IChannelAttributes } from \"@fluidframework/datastore-definitions\";\nimport { SharedNumberSequenceFactory } from \"./sequenceFactory\";\nimport { SharedSequence } from \"./sharedSequence\";\n\n/**\n * The SharedNumberSequence holds a sequence of numbers. Each number will be stored\n * at a position within the sequence. See the\n * {@link https://fluidframework.com/docs/data-structures/sequences/ | sequence documentation}\n * for details on working with sequences.\n *\n * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.\n * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)\n */\nexport class SharedNumberSequence extends SharedSequence<number> {\n /**\n * Create a new shared number sequence\n *\n * @param runtime - data store runtime the new shared number sequence belongs to\n * @param id - optional name of the shared number sequence\n * @returns newly create shared number sequence (but not attached yet)\n *\n * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.\n * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string) {\n return runtime.createChannel(id,\n SharedNumberSequenceFactory.Type) as SharedNumberSequence;\n }\n\n /**\n * Get a factory for SharedNumberSequence to register with the data store.\n *\n * @returns a factory that creates and load SharedNumberSequence\n *\n * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.\n * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)\n */\n public static getFactory() {\n return new SharedNumberSequenceFactory();\n }\n\n /**\n * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.\n * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)\n */\n constructor(document: IFluidDataStoreRuntime, public id: string, attributes: IChannelAttributes) {\n super(document, id, attributes, SharedNumberSequenceFactory.segmentFromSpec);\n }\n\n /**\n * @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.\n * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)\n */\n public getRange(start: number, end?: number) {\n return this.getItems(start, end);\n }\n}\n"]}
@@ -1,50 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { IFluidDataStoreRuntime, IChannelAttributes, Serializable } from "@fluidframework/datastore-definitions";
6
- import { SharedObjectSequenceFactory } from "./sequenceFactory";
7
- import { SharedSequence } from "./sharedSequence";
8
- /**
9
- * The SharedObjectSequence holds a sequence of serializable objects. Each object will be stored
10
- * at a position within the sequence. See the
11
- * {@link https://fluidframework.com/docs/data-structures/sequences/ | sequence documentation}
12
- * for details on working with sequences.
13
- *
14
- * @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
15
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
16
- */
17
- export declare class SharedObjectSequence<T> extends SharedSequence<T> {
18
- id: string;
19
- /**
20
- * Create a new shared object sequence
21
- *
22
- * @param runtime - data store runtime the new shared object sequence belongs to
23
- * @param id - optional name of the shared object sequence
24
- * @returns newly create shared object sequence (but not attached yet)
25
- *
26
- * @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
27
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
28
- */
29
- static create<T>(runtime: IFluidDataStoreRuntime, id?: string): SharedObjectSequence<T>;
30
- /**
31
- * Get a factory for SharedObjectSequence to register with the data store.
32
- *
33
- * @returns a factory that creates and load SharedObjectSequence
34
- *
35
- * @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
36
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
37
- */
38
- static getFactory(): SharedObjectSequenceFactory;
39
- /**
40
- * @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
41
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
42
- */
43
- constructor(document: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
44
- /**
45
- * @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
46
- * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
47
- */
48
- getRange(start: number, end?: number): Serializable<T>[];
49
- }
50
- //# sourceMappingURL=sharedObjectSequence.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sharedObjectSequence.d.ts","sourceRoot":"","sources":["../src/sharedObjectSequence.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACjH,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;;;GAQG;AACH,qBAAa,oBAAoB,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;IAgCL,EAAE,EAAE,MAAM;IA/B/D;;;;;;;;;OASG;WAEW,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,MAAM;IAIpE;;;;;;;OAOG;WACW,UAAU;IAIxB;;;OAGG;gBACS,QAAQ,EAAE,sBAAsB,EAAS,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB;IAI/F;;;OAGG;IACI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE;CAGlE"}