@fluidframework/sequence 2.11.0 → 2.13.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # @fluidframework/sequence
2
2
 
3
+ ## 2.13.0
4
+
5
+ Dependency updates only.
6
+
7
+ ## 2.12.0
8
+
9
+ ### Minor Changes
10
+
11
+ - Merge-Tree and SharedString ISegment Deprecations ([#23323](https://github.com/microsoft/FluidFramework/pull/23323)) [e8762e37cd](https://github.com/microsoft/FluidFramework/commit/e8762e37cd5edbad36b78b5a40d62a730522e18f)
12
+
13
+ The current ISegment interface over-exposes a number of properties which do not have an external use case, and any external usage could result in damage to the underlying merge-tree including data corruption.
14
+
15
+ The only use case that will continue to be supported is determining if a segment is removed. For this purpose we've added the free function `segmentIsRemoved(segment: ISegment): boolean`.
16
+
17
+ For example, checking if a segment is not removed would change as follows:
18
+
19
+ ```diff
20
+ - if(segment.removedSeq === undefined){
21
+ + if(!segmentIsRemoved(segment)){
22
+ ```
23
+
24
+ The following properties are deprecated on ISegment and its implementations:
25
+
26
+ - clientId
27
+ - index
28
+ - localMovedSeq
29
+ - localRefs
30
+ - localRemovedSeq
31
+ - localSeq
32
+ - movedClientsIds
33
+ - movedSeq
34
+ - movedSeqs
35
+ - ordinal
36
+ - removedClientIds
37
+ - removedSeq
38
+ - seq
39
+ - wasMovedOnInsert
40
+
41
+ Additionally, the following types are also deprecated, and will become internal (i.e. users of the Fluid Framework will not have access to them):
42
+
43
+ - IMergeNodeCommon
44
+ - IMoveInfo
45
+ - IRemovalInfo
46
+ - LocalReferenceCollection
47
+
3
48
  ## 2.11.0
4
49
 
5
50
  Dependency updates only.
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/sequence";
8
- export declare const pkgVersion = "2.11.0";
8
+ export declare const pkgVersion = "2.13.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/sequence";
11
- exports.pkgVersion = "2.11.0";
11
+ exports.pkgVersion = "2.13.0";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,0BAA0B,CAAC;AACrC,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/sequence\";\nexport const pkgVersion = \"2.11.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,0BAA0B,CAAC;AACrC,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/sequence\";\nexport const pkgVersion = \"2.13.0\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"revertibles.d.ts","sourceRoot":"","sources":["../src/revertibles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,sBAAsB,EAEtB,wBAAwB,EAExB,WAAW,EAaX,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAyB,MAAM,sBAAsB,CAAC;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E,CAwC1B;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAChD,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,gBAAgB,EAC7B,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,sBAAsB,EAAE,4BAsCrC;AAED;;;;GAIG;AACH,wBAAgB,0CAA0C,CACzD,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,sBAAsB,EAAE,4BASrC;AA2CD;;;;;GAKG;AACH,wBAAgB,oCAAoC,CACnD,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,kBAAkB,EACzB,WAAW,EAAE,sBAAsB,EAAE,QAwFrC;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC7C,YAAY,EAAE,aAAa,EAC3B,WAAW,EAAE,sBAAsB,EAAE,QAUrC;AAsRD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC5C,YAAY,EAAE,aAAa,EAC3B,WAAW,EAAE,sBAAsB,EAAE,QA8BrC"}
@@ -40,14 +40,14 @@ function appendDeleteIntervalToRevertibles(string, interval, revertibles) {
40
40
  if (!startSeg) {
41
41
  return revertibles;
42
42
  }
43
- const startType = startSeg.removedSeq !== undefined
43
+ const startType = (0, internal_2.segmentIsRemoved)(startSeg)
44
44
  ? internal_2.ReferenceType.SlideOnRemove | internal_2.ReferenceType.RangeBegin
45
45
  : internal_2.ReferenceType.StayOnRemove | internal_2.ReferenceType.RangeBegin;
46
46
  const endSeg = interval.end.getSegment();
47
47
  if (!endSeg) {
48
48
  return revertibles;
49
49
  }
50
- const endType = endSeg.removedSeq !== undefined
50
+ const endType = (0, internal_2.segmentIsRemoved)(startSeg)
51
51
  ? internal_2.ReferenceType.SlideOnRemove | internal_2.ReferenceType.RangeEnd
52
52
  : internal_2.ReferenceType.StayOnRemove | internal_2.ReferenceType.RangeEnd;
53
53
  const startRef = string.createLocalReferencePosition(startSeg, interval.start.getOffset(), startType, undefined, interval.start.slidingPreference);
@@ -74,11 +74,11 @@ function appendChangeIntervalToRevertibles(string, newInterval, previousInterval
74
74
  // This logic is needed because the ReferenceType StayOnRemove cannot be used
75
75
  // on removed segments. This works for revertibles because the old position of the
76
76
  // interval within the removed segment is handled by the remove range revertible.
77
- const startType = startSeg.removedSeq !== undefined
77
+ const startType = (0, internal_2.segmentIsRemoved)(startSeg)
78
78
  ? internal_2.ReferenceType.SlideOnRemove | internal_2.ReferenceType.RangeBegin
79
79
  : internal_2.ReferenceType.StayOnRemove | internal_2.ReferenceType.RangeBegin;
80
80
  const endSeg = previousInterval.end.getSegment();
81
- const endType = endSeg.removedSeq !== undefined
81
+ const endType = (0, internal_2.segmentIsRemoved)(startSeg)
82
82
  ? internal_2.ReferenceType.SlideOnRemove | internal_2.ReferenceType.RangeEnd
83
83
  : internal_2.ReferenceType.StayOnRemove | internal_2.ReferenceType.RangeEnd;
84
84
  const prevStartRef = string.createLocalReferencePosition(startSeg, previousInterval.start.getOffset(), startType, undefined, previousInterval.start.slidingPreference);
@@ -186,7 +186,7 @@ function appendSharedStringDeltaToRevertibles(string, delta, revertibles) {
186
186
  }
187
187
  revertible.intervals.push({
188
188
  intervalId: interval.getIntervalId(),
189
- label: interval.properties.referenceRangeLabels[0],
189
+ label: interval.properties.referenceRangeLabels?.[0],
190
190
  startOffset: offset,
191
191
  endOffset,
192
192
  });
@@ -195,7 +195,7 @@ function appendSharedStringDeltaToRevertibles(string, delta, revertibles) {
195
195
  endIntervals.forEach(({ interval, offset }) => {
196
196
  revertible.intervals.push({
197
197
  intervalId: interval.getIntervalId(),
198
- label: interval.properties.referenceRangeLabels[0],
198
+ label: interval.properties.referenceRangeLabels?.[0],
199
199
  endOffset: offset,
200
200
  });
201
201
  });
@@ -251,7 +251,7 @@ function isValidRange(start, startSlide, end, endSlide, string) {
251
251
  }
252
252
  function revertLocalAdd(string, revertible) {
253
253
  const id = getUpdatedIdFromInterval(revertible.interval);
254
- const label = revertible.interval.properties.referenceRangeLabels[0];
254
+ const label = revertible.interval.properties.referenceRangeLabels?.[0];
255
255
  string.getIntervalCollection(label).removeIntervalById(id);
256
256
  }
257
257
  function createSequencePlace(pos, newSlidingPreference, oldSlidingPreference = undefined) {
@@ -270,7 +270,7 @@ function createSequencePlace(pos, newSlidingPreference, oldSlidingPreference = u
270
270
  : pos; // Avoid setting side if possible since stickiness may not be enabled
271
271
  }
272
272
  function revertLocalDelete(string, revertible) {
273
- const label = revertible.interval.properties.referenceRangeLabels[0];
273
+ const label = revertible.interval.properties.referenceRangeLabels?.[0];
274
274
  const collection = string.getIntervalCollection(label);
275
275
  const start = string.localReferencePositionToPosition(revertible.start);
276
276
  const startSlidePos = getSlidePosition(string, revertible.start, start);
@@ -295,7 +295,7 @@ function revertLocalDelete(string, revertible) {
295
295
  string.removeLocalReferencePosition(revertible.end);
296
296
  }
297
297
  function revertLocalChange(string, revertible) {
298
- const label = revertible.interval.properties.referenceRangeLabels[0];
298
+ const label = revertible.interval.properties.referenceRangeLabels?.[0];
299
299
  const collection = string.getIntervalCollection(label);
300
300
  const id = getUpdatedIdFromInterval(revertible.interval);
301
301
  const start = string.localReferencePositionToPosition(revertible.start);
@@ -314,7 +314,7 @@ function revertLocalChange(string, revertible) {
314
314
  string.removeLocalReferencePosition(revertible.end);
315
315
  }
316
316
  function revertLocalPropertyChanged(string, revertible) {
317
- const label = revertible.interval.properties.referenceRangeLabels[0];
317
+ const label = revertible.interval.properties.referenceRangeLabels?.[0];
318
318
  const id = getUpdatedIdFromInterval(revertible.interval);
319
319
  const newProps = revertible.propertyDeltas;
320
320
  string.getIntervalCollection(label).change(id, { props: newProps });
@@ -1 +1 @@
1
- {"version":3,"file":"revertibles.js","sourceRoot":"","sources":["../src/revertibles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAA+B;AAE/B,kEAA8E;AAC9E,kEAkB6C;AAE7C,mDAA+F;AAW/F,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;AAkDxC,SAAS,wBAAw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CAAC;QACF,CAAC;aAAM,CAAC;YACP,IAAA,0CAA+B,EAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC;IACF,CAAC;AACF,CAAC;AAhCD,sEAgCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\tLocalReferencePosition,\n\tMergeTreeDeltaOperationType,\n\tMergeTreeDeltaRevertible,\n\tMergeTreeDeltaType,\n\tPropertySet,\n\tReferenceType,\n\tSlidingPreference, // eslint-disable-next-line import/no-deprecated\n\tSortedSet,\n\tappendToMergeTreeDeltaRevertibles,\n\tdiscardMergeTreeDeltaRevertible,\n\tgetSlideToSegoff,\n\tisMergeTreeDeltaRevertible,\n\trefTypeIncludesFlag,\n\trevertMergeTreeDeltaRevertibles,\n\tInteriorSequencePlace,\n\tSide,\n\ttype ISegmentInternal,\n} from \"@fluidframework/merge-tree/internal\";\n\nimport { IntervalOpType, SequenceInterval, SequenceIntervalClass } from \"./intervals/index.js\";\nimport { ISequenceDeltaRange, SequenceDeltaEvent } from \"./sequenceDeltaEvent.js\";\nimport { ISharedString, SharedStringSegment } from \"./sharedString.js\";\n\n/**\n * Data for undoing edits on SharedStrings and Intervals.\n * @legacy\n * @alpha\n */\nexport type SharedStringRevertible = MergeTreeDeltaRevertible | IntervalRevertible;\n\nconst idMap = new Map<string, string>();\n\n/**\n * Data for undoing edits affecting Intervals.\n * @legacy\n * @alpha\n */\nexport type IntervalRevertible =\n\t| {\n\t\t\tevent: typeof IntervalOpType.CHANGE;\n\t\t\tinterval: SequenceInterval;\n\t\t\tstart: LocalReferencePosition;\n\t\t\tend: LocalReferencePosition;\n\t }\n\t| {\n\t\t\tevent: typeof IntervalOpType.ADD;\n\t\t\tinterval: SequenceInterval;\n\t }\n\t| {\n\t\t\tevent: typeof IntervalOpType.DELETE;\n\t\t\tinterval: SequenceInterval;\n\t\t\tstart: LocalReferencePosition;\n\t\t\tend: LocalReferencePosition;\n\t }\n\t| {\n\t\t\tevent: typeof IntervalOpType.PROPERTY_CHANGED;\n\t\t\tinterval: SequenceInterval;\n\t\t\tpropertyDeltas: PropertySet;\n\t }\n\t| {\n\t\t\tevent: typeof IntervalOpType.POSITION_REMOVE;\n\t\t\tintervals: {\n\t\t\t\tintervalId: string;\n\t\t\t\tlabel: string;\n\t\t\t\tstartOffset?: number; // interval start index within a removed range\n\t\t\t\tendOffset?: number; // interval end index within a removed range\n\t\t\t}[];\n\t\t\t// local refs used by IntervalOpType.CHANGE and DELETE revertibles\n\t\t\trevertibleRefs: {\n\t\t\t\trevertible: IntervalRevertible;\n\t\t\t\toffset: number;\n\t\t\t\tisStart: boolean;\n\t\t\t}[];\n\t\t\tmergeTreeRevertible: MergeTreeDeltaRevertible;\n\t };\n\ntype TypedRevertible<T extends IntervalRevertible[\"event\"]> = IntervalRevertible & {\n\tevent: T;\n};\n\nfunction getUpdatedIdFromInterval(interval: SequenceInterval): string {\n\tconst maybeId = interval.getIntervalId();\n\treturn getUpdatedId(maybeId);\n}\n\nfunction getUpdatedId(intervalId: string): string {\n\treturn idMap.get(intervalId) ?? intervalId;\n}\n\n/**\n * Create revertibles for adding an interval\n * @legacy\n * @alpha\n */\nexport function appendAddIntervalToRevertibles(\n\tinterval: SequenceInterval,\n\trevertibles: SharedStringRevertible[],\n) {\n\trevertibles.push({\n\t\tevent: IntervalOpType.ADD,\n\t\tinterval,\n\t});\n\n\treturn revertibles;\n}\n\n/**\n * Create revertibles for deleting an interval\n * @legacy\n * @alpha\n */\nexport function appendDeleteIntervalToRevertibles(\n\tstring: ISharedString,\n\tinterval: SequenceInterval,\n\trevertibles: SharedStringRevertible[],\n): SharedStringRevertible[] {\n\tconst startSeg = interval.start.getSegment() as SharedStringSegment | undefined;\n\tif (!startSeg) {\n\t\treturn revertibles;\n\t}\n\tconst startType =\n\t\tstartSeg.removedSeq !== undefined\n\t\t\t? ReferenceType.SlideOnRemove | ReferenceType.RangeBegin\n\t\t\t: ReferenceType.StayOnRemove | ReferenceType.RangeBegin;\n\tconst endSeg = interval.end.getSegment() as SharedStringSegment | undefined;\n\tif (!endSeg) {\n\t\treturn revertibles;\n\t}\n\tconst endType =\n\t\tendSeg.removedSeq !== undefined\n\t\t\t? ReferenceType.SlideOnRemove | ReferenceType.RangeEnd\n\t\t\t: ReferenceType.StayOnRemove | ReferenceType.RangeEnd;\n\tconst startRef = string.createLocalReferencePosition(\n\t\tstartSeg,\n\t\tinterval.start.getOffset(),\n\t\tstartType,\n\t\tundefined,\n\t\tinterval.start.slidingPreference,\n\t);\n\tconst endRef = string.createLocalReferencePosition(\n\t\tendSeg,\n\t\tinterval.end.getOffset(),\n\t\tendType,\n\t\tundefined,\n\t\tinterval.end.slidingPreference,\n\t);\n\tconst revertible = {\n\t\tevent: IntervalOpType.DELETE,\n\t\tinterval,\n\t\tstart: startRef,\n\t\tend: endRef,\n\t};\n\trevertible.start.addProperties({ revertible });\n\trevertible.end.addProperties({ revertible });\n\trevertibles.push(revertible);\n\n\treturn revertibles;\n}\n\n/**\n * Create revertibles for moving endpoints of an interval\n * @legacy\n * @alpha\n */\nexport function appendChangeIntervalToRevertibles(\n\tstring: ISharedString,\n\tnewInterval: SequenceInterval,\n\tpreviousInterval: SequenceInterval,\n\trevertibles: SharedStringRevertible[],\n) {\n\tconst startSeg = previousInterval.start.getSegment() as SharedStringSegment;\n\t// This logic is needed because the ReferenceType StayOnRemove cannot be used\n\t// on removed segments. This works for revertibles because the old position of the\n\t// interval within the removed segment is handled by the remove range revertible.\n\tconst startType =\n\t\tstartSeg.removedSeq !== undefined\n\t\t\t? ReferenceType.SlideOnRemove | ReferenceType.RangeBegin\n\t\t\t: ReferenceType.StayOnRemove | ReferenceType.RangeBegin;\n\tconst endSeg = previousInterval.end.getSegment() as SharedStringSegment;\n\tconst endType =\n\t\tendSeg.removedSeq !== undefined\n\t\t\t? ReferenceType.SlideOnRemove | ReferenceType.RangeEnd\n\t\t\t: ReferenceType.StayOnRemove | ReferenceType.RangeEnd;\n\tconst prevStartRef = string.createLocalReferencePosition(\n\t\tstartSeg,\n\t\tpreviousInterval.start.getOffset(),\n\t\tstartType,\n\t\tundefined,\n\t\tpreviousInterval.start.slidingPreference,\n\t);\n\tconst prevEndRef = string.createLocalReferencePosition(\n\t\tendSeg,\n\t\tpreviousInterval.end.getOffset(),\n\t\tendType,\n\t\tundefined,\n\t\tpreviousInterval.end.slidingPreference,\n\t);\n\tconst revertible = {\n\t\tevent: IntervalOpType.CHANGE,\n\t\tinterval: newInterval,\n\t\tstart: prevStartRef,\n\t\tend: prevEndRef,\n\t};\n\trevertible.start.addProperties({ revertible });\n\trevertible.end.addProperties({ revertible });\n\trevertibles.push(revertible);\n\n\treturn revertibles;\n}\n\n/**\n * Create revertibles for changing properties of an interval\n * @legacy\n * @alpha\n */\nexport function appendIntervalPropertyChangedToRevertibles(\n\tinterval: SequenceInterval,\n\tdeltas: PropertySet,\n\trevertibles: SharedStringRevertible[],\n) {\n\trevertibles.push({\n\t\tevent: IntervalOpType.PROPERTY_CHANGED,\n\t\tinterval,\n\t\tpropertyDeltas: deltas,\n\t});\n\n\treturn revertibles;\n}\n\nfunction addIfIntervalEndpoint(\n\tref: LocalReferencePosition,\n\tsegmentLengths: number,\n\tstartIntervals: { offset: number; interval: SequenceInterval }[],\n\tendIntervals: { offset: number; interval: SequenceInterval }[],\n) {\n\tif (refTypeIncludesFlag(ref.refType, ReferenceType.RangeBegin)) {\n\t\tconst interval = ref.properties?.interval;\n\t\tif (interval && interval instanceof SequenceIntervalClass) {\n\t\t\tstartIntervals.push({ offset: segmentLengths + interval.start.getOffset(), interval });\n\t\t\treturn true;\n\t\t}\n\t} else if (refTypeIncludesFlag(ref.refType, ReferenceType.RangeEnd)) {\n\t\tconst interval = ref.properties?.interval;\n\t\tif (interval && interval instanceof SequenceIntervalClass) {\n\t\t\tendIntervals.push({ offset: segmentLengths + interval.end.getOffset(), interval });\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction addIfRevertibleRef(\n\tref: LocalReferencePosition,\n\tsegmentLengths: number,\n\trevertibleRefs: {\n\t\trevertible: IntervalRevertible;\n\t\toffset: number;\n\t\tisStart: boolean;\n\t}[],\n) {\n\tconst revertible = ref.properties?.revertible;\n\tif (revertible) {\n\t\trevertibleRefs.push({\n\t\t\trevertible,\n\t\t\toffset: segmentLengths + ref.getOffset(),\n\t\t\tisStart: refTypeIncludesFlag(ref.refType, ReferenceType.RangeBegin),\n\t\t});\n\t}\n}\n\n/**\n * Create revertibles for SharedStringDeltas, handling indirectly modified intervals\n * (e.g. reverting remove of a range that contains an interval will move the interval back)\n * @legacy\n * @alpha\n */\nexport function appendSharedStringDeltaToRevertibles(\n\tstring: ISharedString,\n\tdelta: SequenceDeltaEvent,\n\trevertibles: SharedStringRevertible[],\n) {\n\tif (delta.ranges.length === 0) {\n\t\treturn;\n\t}\n\tif (delta.deltaOperation === MergeTreeDeltaType.REMOVE) {\n\t\tconst startIntervals: { offset: number; interval: SequenceInterval }[] = [];\n\t\tconst endIntervals: { offset: number; interval: SequenceInterval }[] = [];\n\t\tconst revertibleRefs: {\n\t\t\trevertible: IntervalRevertible;\n\t\t\toffset: number;\n\t\t\tisStart: boolean;\n\t\t}[] = [];\n\t\tlet segmentLengths = 0;\n\n\t\t// find interval endpoints in each segment\n\t\tfor (const deltaRange of delta.ranges) {\n\t\t\tconst segment: ISegmentInternal = deltaRange.segment;\n\t\t\tconst refs = segment.localRefs;\n\t\t\tif (refs !== undefined && deltaRange.position !== -1) {\n\t\t\t\tfor (const ref of refs) {\n\t\t\t\t\taddIfIntervalEndpoint(ref, segmentLengths, startIntervals, endIntervals);\n\t\t\t\t\taddIfRevertibleRef(ref, segmentLengths, revertibleRefs);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsegmentLengths += deltaRange.segment.cachedLength;\n\t\t}\n\n\t\tif (startIntervals.length > 0 || endIntervals.length > 0 || revertibleRefs.length > 0) {\n\t\t\tconst removeRevertibles: MergeTreeDeltaRevertible[] = [];\n\t\t\tappendToMergeTreeDeltaRevertibles(delta.deltaArgs, removeRevertibles);\n\t\t\tassert(\n\t\t\t\tremoveRevertibles.length === 1,\n\t\t\t\t0x6c4 /* Remove revertible should be a single delta */,\n\t\t\t);\n\n\t\t\tconst revertible: TypedRevertible<typeof IntervalOpType.POSITION_REMOVE> = {\n\t\t\t\tevent: IntervalOpType.POSITION_REMOVE,\n\t\t\t\tintervals: [],\n\t\t\t\trevertibleRefs,\n\t\t\t\tmergeTreeRevertible: removeRevertibles[0],\n\t\t\t};\n\n\t\t\t// add an interval for each startInterval, accounting for any corresponding endIntervals\n\t\t\tstartIntervals.forEach(({ interval, offset }) => {\n\t\t\t\t// find any corresponding end for this interval\n\t\t\t\tconst endIntervalIndex = endIntervals.findIndex((end) => {\n\t\t\t\t\treturn end.interval === interval;\n\t\t\t\t});\n\t\t\t\tlet endOffset: number | undefined;\n\t\t\t\tif (endIntervalIndex !== -1) {\n\t\t\t\t\tendOffset = endIntervals[endIntervalIndex].offset;\n\t\t\t\t\tendIntervals.splice(endIntervalIndex, 1);\n\t\t\t\t}\n\n\t\t\t\trevertible.intervals.push({\n\t\t\t\t\tintervalId: interval.getIntervalId(),\n\t\t\t\t\tlabel: interval.properties.referenceRangeLabels[0],\n\t\t\t\t\tstartOffset: offset,\n\t\t\t\t\tendOffset,\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// add any remaining endIntervals that aren't matched with a startInterval\n\t\t\tendIntervals.forEach(({ interval, offset }) => {\n\t\t\t\trevertible.intervals.push({\n\t\t\t\t\tintervalId: interval.getIntervalId(),\n\t\t\t\t\tlabel: interval.properties.referenceRangeLabels[0],\n\t\t\t\t\tendOffset: offset,\n\t\t\t\t});\n\t\t\t});\n\n\t\t\trevertibles.push(revertible);\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Handle any merge tree delta that is not REMOVE or is REMOVE with no interval endpoints\n\tconst mergeTreeRevertibles: MergeTreeDeltaRevertible[] = [];\n\t// Allow merging MergeTreeDeltaRevertible with previous\n\tif (\n\t\trevertibles.length > 0 &&\n\t\tisMergeTreeDeltaRevertible(revertibles[revertibles.length - 1])\n\t) {\n\t\tmergeTreeRevertibles.push(revertibles.pop() as MergeTreeDeltaRevertible);\n\t}\n\tappendToMergeTreeDeltaRevertibles(delta.deltaArgs, mergeTreeRevertibles);\n\trevertibles.push(...mergeTreeRevertibles);\n}\n\n/**\n * Clean up resources held by revertibles that are no longer needed.\n * @legacy\n * @alpha\n */\nexport function discardSharedStringRevertibles(\n\tsharedString: ISharedString,\n\trevertibles: SharedStringRevertible[],\n) {\n\trevertibles.forEach((r) => {\n\t\tif (isMergeTreeDeltaRevertible(r)) {\n\t\t\tdiscardMergeTreeDeltaRevertible([r]);\n\t\t} else if (r.event === IntervalOpType.CHANGE || r.event === IntervalOpType.DELETE) {\n\t\t\tsharedString.removeLocalReferencePosition(r.start);\n\t\t\tsharedString.removeLocalReferencePosition(r.end);\n\t\t}\n\t});\n}\n\nfunction getSlidePosition(\n\tstring: ISharedString,\n\tlref: LocalReferencePosition,\n\tpos: number,\n): number {\n\tconst slide = getSlideToSegoff(\n\t\t{ segment: lref.getSegment(), offset: undefined },\n\t\tlref.slidingPreference,\n\t);\n\treturn slide?.segment !== undefined &&\n\t\tslide.offset !== undefined &&\n\t\tstring.getPosition(slide.segment) !== -1 &&\n\t\t(pos < 0 || pos >= string.getLength())\n\t\t? string.getPosition(slide.segment) + slide.offset\n\t\t: pos;\n}\n\nfunction isValidRange(\n\tstart: number,\n\tstartSlide: SlidingPreference | undefined,\n\tend: number,\n\tendSlide: SlidingPreference | undefined,\n\tstring: ISharedString,\n) {\n\treturn (\n\t\tstart >= 0 &&\n\t\tstart < string.getLength() &&\n\t\tend >= 0 &&\n\t\tend < string.getLength() &&\n\t\t(start < end ||\n\t\t\t(start === end &&\n\t\t\t\t(startSlide === SlidingPreference.FORWARD || endSlide !== SlidingPreference.FORWARD)))\n\t);\n}\n\nfunction revertLocalAdd(\n\tstring: ISharedString,\n\trevertible: TypedRevertible<typeof IntervalOpType.ADD>,\n) {\n\tconst id = getUpdatedIdFromInterval(revertible.interval);\n\tconst label = revertible.interval.properties.referenceRangeLabels[0];\n\tstring.getIntervalCollection(label).removeIntervalById(id);\n}\n\nfunction createSequencePlace(\n\tpos: number,\n\tnewSlidingPreference: SlidingPreference | undefined,\n\toldSlidingPreference: SlidingPreference | undefined = undefined,\n): number | InteriorSequencePlace {\n\treturn newSlidingPreference === SlidingPreference.BACKWARD ||\n\t\t(newSlidingPreference === undefined && oldSlidingPreference === SlidingPreference.BACKWARD)\n\t\t? {\n\t\t\t\tpos,\n\t\t\t\tside: Side.After,\n\t\t\t}\n\t\t: newSlidingPreference === SlidingPreference.FORWARD &&\n\t\t\t\toldSlidingPreference === SlidingPreference.BACKWARD\n\t\t\t? {\n\t\t\t\t\tpos,\n\t\t\t\t\tside: Side.Before,\n\t\t\t\t}\n\t\t\t: pos; // Avoid setting side if possible since stickiness may not be enabled\n}\n\nfunction revertLocalDelete(\n\tstring: ISharedString,\n\trevertible: TypedRevertible<typeof IntervalOpType.DELETE>,\n) {\n\tconst label = revertible.interval.properties.referenceRangeLabels[0];\n\tconst collection = string.getIntervalCollection(label);\n\tconst start = string.localReferencePositionToPosition(revertible.start);\n\tconst startSlidePos = getSlidePosition(string, revertible.start, start);\n\tconst end = string.localReferencePositionToPosition(revertible.end);\n\tconst endSlidePos = getSlidePosition(string, revertible.end, end);\n\t// reusing the id causes eventual consistency bugs, so it is removed here and recreated in add\n\tconst { intervalId, ...props } = revertible.interval.properties;\n\tif (\n\t\tisValidRange(\n\t\t\tstartSlidePos,\n\t\t\trevertible.start.slidingPreference,\n\t\t\tendSlidePos,\n\t\t\trevertible.end.slidingPreference,\n\t\t\tstring,\n\t\t)\n\t) {\n\t\tconst int = collection.add({\n\t\t\tstart: createSequencePlace(startSlidePos, revertible.start.slidingPreference),\n\t\t\tend: createSequencePlace(endSlidePos, revertible.end.slidingPreference),\n\t\t\tprops,\n\t\t});\n\n\t\tidMap.forEach((newId, oldId) => {\n\t\t\tif (intervalId === newId) {\n\t\t\t\tidMap.set(oldId, getUpdatedIdFromInterval(int));\n\t\t\t}\n\t\t});\n\t\tidMap.set(intervalId, int.getIntervalId());\n\t}\n\n\tstring.removeLocalReferencePosition(revertible.start);\n\tstring.removeLocalReferencePosition(revertible.end);\n}\n\nfunction revertLocalChange(\n\tstring: ISharedString,\n\trevertible: TypedRevertible<typeof IntervalOpType.CHANGE>,\n) {\n\tconst label = revertible.interval.properties.referenceRangeLabels[0];\n\tconst collection = string.getIntervalCollection(label);\n\tconst id = getUpdatedIdFromInterval(revertible.interval);\n\tconst start = string.localReferencePositionToPosition(revertible.start);\n\tconst startSlidePos = getSlidePosition(string, revertible.start, start);\n\tconst end = string.localReferencePositionToPosition(revertible.end);\n\tconst endSlidePos = getSlidePosition(string, revertible.end, end);\n\tconst interval = collection.getIntervalById(id);\n\tif (\n\t\tinterval !== undefined &&\n\t\tisValidRange(\n\t\t\tstartSlidePos,\n\t\t\trevertible.start.slidingPreference ?? interval.start.slidingPreference,\n\t\t\tendSlidePos,\n\t\t\trevertible.end.slidingPreference ?? interval.end.slidingPreference,\n\t\t\tstring,\n\t\t)\n\t) {\n\t\tcollection.change(id, {\n\t\t\tstart: createSequencePlace(\n\t\t\t\tstartSlidePos,\n\t\t\t\trevertible.start.slidingPreference,\n\t\t\t\tinterval.start.slidingPreference,\n\t\t\t),\n\t\t\tend: createSequencePlace(\n\t\t\t\tendSlidePos,\n\t\t\t\trevertible.end.slidingPreference,\n\t\t\t\tinterval.end.slidingPreference,\n\t\t\t),\n\t\t});\n\t}\n\n\tstring.removeLocalReferencePosition(revertible.start);\n\tstring.removeLocalReferencePosition(revertible.end);\n}\n\nfunction revertLocalPropertyChanged(\n\tstring: ISharedString,\n\trevertible: TypedRevertible<typeof IntervalOpType.PROPERTY_CHANGED>,\n) {\n\tconst label = revertible.interval.properties.referenceRangeLabels[0];\n\tconst id = getUpdatedIdFromInterval(revertible.interval);\n\tconst newProps = revertible.propertyDeltas;\n\tstring.getIntervalCollection(label).change(id, { props: newProps });\n}\n\nfunction newPosition(offset: number | undefined, restoredRanges: SortedRangeSet) {\n\tif (offset === undefined) {\n\t\treturn undefined;\n\t}\n\n\tlet offsetFromSegment = offset;\n\tfor (const rangeInfo of restoredRanges.items) {\n\t\tif (offsetFromSegment < rangeInfo.length) {\n\t\t\t// find the segment inside the range\n\t\t\tfor (const range of rangeInfo.ranges) {\n\t\t\t\tif (range.segment.cachedLength > offsetFromSegment) {\n\t\t\t\t\treturn { segment: range.segment, offset: offsetFromSegment };\n\t\t\t\t}\n\t\t\t\toffsetFromSegment -= range.segment.cachedLength;\n\t\t\t}\n\t\t}\n\t\toffsetFromSegment -= rangeInfo.length;\n\t}\n\n\treturn undefined;\n}\n\nfunction newEndpointPosition(\n\toffset: number | undefined,\n\trestoredRanges: SortedRangeSet,\n\tsharedString: ISharedString,\n) {\n\tconst pos = newPosition(offset, restoredRanges);\n\treturn pos === undefined ? undefined : sharedString.getPosition(pos.segment) + pos.offset;\n}\n\ninterface RangeInfo {\n\tranges: readonly Readonly<ISequenceDeltaRange<MergeTreeDeltaOperationType>>[];\n\tlength: number;\n}\n\n// eslint-disable-next-line import/no-deprecated\nclass SortedRangeSet extends SortedSet<RangeInfo, string> {\n\tprotected getKey(item: RangeInfo): string {\n\t\treturn item.ranges[0].segment.ordinal;\n\t}\n}\n\nfunction revertLocalSequenceRemove(\n\tsharedString: ISharedString,\n\trevertible: TypedRevertible<typeof IntervalOpType.POSITION_REMOVE>,\n) {\n\tconst restoredRanges = new SortedRangeSet();\n\tconst saveSegments = (event: SequenceDeltaEvent) => {\n\t\tif (event.ranges.length > 0) {\n\t\t\tlet length = 0;\n\t\t\tevent.ranges.forEach((range) => {\n\t\t\t\tlength += range.segment.cachedLength;\n\t\t\t});\n\t\t\trestoredRanges.addOrUpdate({ ranges: event.ranges, length });\n\t\t}\n\t};\n\tsharedString.on(\"sequenceDelta\", saveSegments);\n\trevertMergeTreeDeltaRevertibles(sharedString, [revertible.mergeTreeRevertible]);\n\tsharedString.off(\"sequenceDelta\", saveSegments);\n\n\trevertible.intervals.forEach((intervalInfo) => {\n\t\tconst intervalCollection = sharedString.getIntervalCollection(intervalInfo.label);\n\t\tconst intervalId = getUpdatedId(intervalInfo.intervalId);\n\t\tconst interval = intervalCollection.getIntervalById(intervalId);\n\t\tif (interval !== undefined) {\n\t\t\tconst start =\n\t\t\t\tnewEndpointPosition(intervalInfo.startOffset, restoredRanges, sharedString) ??\n\t\t\t\tsharedString.localReferencePositionToPosition(interval.start);\n\t\t\tconst end =\n\t\t\t\tnewEndpointPosition(intervalInfo.endOffset, restoredRanges, sharedString) ??\n\t\t\t\tsharedString.localReferencePositionToPosition(interval.end);\n\t\t\tif (\n\t\t\t\tisValidRange(\n\t\t\t\t\tstart,\n\t\t\t\t\tinterval.start.slidingPreference,\n\t\t\t\t\tend,\n\t\t\t\t\tinterval.end.slidingPreference,\n\t\t\t\t\tsharedString,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tintervalCollection.change(intervalId, {\n\t\t\t\t\tstart: createSequencePlace(start, interval.start.slidingPreference),\n\t\t\t\t\tend: createSequencePlace(end, interval.end.slidingPreference),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n\n\t// fix up the local references used by delete and change revertibles\n\trevertible.revertibleRefs.forEach((revertibleRef) => {\n\t\tassert(\n\t\t\trevertibleRef.revertible.event === IntervalOpType.CHANGE ||\n\t\t\t\trevertibleRef.revertible.event === IntervalOpType.DELETE,\n\t\t\t0x6c5 /* revertible is not delete or change */,\n\t\t);\n\t\tconst pos = newPosition(revertibleRef.offset, restoredRanges);\n\t\tif (pos !== undefined) {\n\t\t\tif (revertibleRef.isStart) {\n\t\t\t\tsharedString.removeLocalReferencePosition(revertibleRef.revertible.start);\n\t\t\t\tconst newRef = sharedString.createLocalReferencePosition(\n\t\t\t\t\tpos.segment as SharedStringSegment,\n\t\t\t\t\tpos.offset,\n\t\t\t\t\tReferenceType.StayOnRemove | ReferenceType.RangeBegin,\n\t\t\t\t\t{ revertible: revertibleRef.revertible },\n\t\t\t\t\trevertibleRef.revertible.start.slidingPreference,\n\t\t\t\t);\n\t\t\t\trevertibleRef.revertible.start = newRef;\n\t\t\t} else {\n\t\t\t\tsharedString.removeLocalReferencePosition(revertibleRef.revertible.end);\n\t\t\t\tconst newRef = sharedString.createLocalReferencePosition(\n\t\t\t\t\tpos.segment as SharedStringSegment,\n\t\t\t\t\tpos.offset,\n\t\t\t\t\tReferenceType.StayOnRemove | ReferenceType.RangeEnd,\n\t\t\t\t\t{ revertible: revertibleRef.revertible },\n\t\t\t\t\trevertibleRef.revertible.end.slidingPreference,\n\t\t\t\t);\n\t\t\t\trevertibleRef.revertible.end = newRef;\n\t\t\t}\n\t\t}\n\t});\n}\n\n/**\n * Invoke revertibles to reverse prior edits\n * @legacy\n * @alpha\n */\nexport function revertSharedStringRevertibles(\n\tsharedString: ISharedString,\n\trevertibles: SharedStringRevertible[],\n) {\n\twhile (revertibles.length > 0) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tconst r = revertibles.pop()!;\n\t\tif (\"event\" in r) {\n\t\t\tconst event = r.event;\n\t\t\tswitch (event) {\n\t\t\t\tcase IntervalOpType.ADD:\n\t\t\t\t\trevertLocalAdd(sharedString, r);\n\t\t\t\t\tbreak;\n\t\t\t\tcase IntervalOpType.DELETE:\n\t\t\t\t\trevertLocalDelete(sharedString, r);\n\t\t\t\t\tbreak;\n\t\t\t\tcase IntervalOpType.CHANGE:\n\t\t\t\t\trevertLocalChange(sharedString, r);\n\t\t\t\t\tbreak;\n\t\t\t\tcase IntervalOpType.PROPERTY_CHANGED:\n\t\t\t\t\trevertLocalPropertyChanged(sharedString, r);\n\t\t\t\t\tbreak;\n\t\t\t\tcase IntervalOpType.POSITION_REMOVE:\n\t\t\t\t\trevertLocalSequenceRemove(sharedString, r);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(event);\n\t\t\t}\n\t\t} else {\n\t\t\trevertMergeTreeDeltaRevertibles(sharedString, [r]);\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"revertibles.js","sourceRoot":"","sources":["../src/revertibles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAA+B;AAE/B,kEAA8E;AAC9E,kEAmB6C;AAE7C,mDAA+F;AAW/F,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;AAkDxC,SAAS,wBAAwB,CAAC,QAA0B;IAC3D,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC;IACzC,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,YAAY,CAAC,UAAkB;IACvC,OAAO,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC;AAC5C,CAAC;AAED;;;;GAIG;AACH,SAAgB,8BAA8B,CAC7C,QAA0B,EAC1B,WAAqC;IAErC,WAAW,CAAC,IAAI,CAAC;QAChB,KAAK,EAAE,yBAAc,CAAC,GAAG;QACzB,QAAQ;KACR,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACpB,CAAC;AAVD,wEAUC;AAED;;;;GAIG;AACH,SAAgB,iCAAiC,CAChD,MAAqB,EACrB,QAA0B,EAC1B,WAAqC;IAErC,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,UAAU,EAAqC,CAAC;IAChF,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,OAAO,WAAW,CAAC;IACpB,CAAC;IACD,MAAM,SAAS,GAAG,IAAA,2BAAgB,EAAC,QAAQ,CAAC;QAC3C,CAAC,CAAC,wBAAa,CAAC,aAAa,GAAG,wBAAa,CAAC,UAAU;QACxD,CAAC,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EAAE,CAAC,CAAC,CAAC;oBAChC,MAAM;gBACP,KAAK,yBAAc,CAAC,MAAM;oBACzB,iBAAiB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;oBACnC,MAAM;gBACP,KAAK,yBAAc,CAAC,MAAM;oBACzB,iBAAiB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;oBACnC,MAAM;gBACP,KAAK,yBAAc,CAAC,gBAAgB;oBACnC,0BAA0B,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;oBAC5C,MAAM;gBACP,KAAK,yBAAc,CAAC,eAAe;oBAClC,yBAAyB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;oBAC3C,MAAM;gBACP;oBACC,IAAA,0BAAe,EAAC,KAAK,CAAC,CAAC;YACzB,CAAC;QACF,CAAC;aAAM,CAAC;YACP,IAAA,0CAA+B,EAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC;IACF,CAAC;AACF,CAAC;AAhCD,sEAgCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\tLocalReferencePosition,\n\tMergeTreeDeltaOperationType,\n\tMergeTreeDeltaRevertible,\n\tMergeTreeDeltaType,\n\tPropertySet,\n\tReferenceType,\n\tSlidingPreference, // eslint-disable-next-line import/no-deprecated\n\tSortedSet,\n\tappendToMergeTreeDeltaRevertibles,\n\tdiscardMergeTreeDeltaRevertible,\n\tgetSlideToSegoff,\n\tisMergeTreeDeltaRevertible,\n\trefTypeIncludesFlag,\n\trevertMergeTreeDeltaRevertibles,\n\tInteriorSequencePlace,\n\tSide,\n\ttype ISegmentInternal,\n\tsegmentIsRemoved,\n} from \"@fluidframework/merge-tree/internal\";\n\nimport { IntervalOpType, SequenceInterval, SequenceIntervalClass } from \"./intervals/index.js\";\nimport { ISequenceDeltaRange, SequenceDeltaEvent } from \"./sequenceDeltaEvent.js\";\nimport { ISharedString, SharedStringSegment } from \"./sharedString.js\";\n\n/**\n * Data for undoing edits on SharedStrings and Intervals.\n * @legacy\n * @alpha\n */\nexport type SharedStringRevertible = MergeTreeDeltaRevertible | IntervalRevertible;\n\nconst idMap = new Map<string, string>();\n\n/**\n * Data for undoing edits affecting Intervals.\n * @legacy\n * @alpha\n */\nexport type IntervalRevertible =\n\t| {\n\t\t\tevent: typeof IntervalOpType.CHANGE;\n\t\t\tinterval: SequenceInterval;\n\t\t\tstart: LocalReferencePosition;\n\t\t\tend: LocalReferencePosition;\n\t }\n\t| {\n\t\t\tevent: typeof IntervalOpType.ADD;\n\t\t\tinterval: SequenceInterval;\n\t }\n\t| {\n\t\t\tevent: typeof IntervalOpType.DELETE;\n\t\t\tinterval: SequenceInterval;\n\t\t\tstart: LocalReferencePosition;\n\t\t\tend: LocalReferencePosition;\n\t }\n\t| {\n\t\t\tevent: typeof IntervalOpType.PROPERTY_CHANGED;\n\t\t\tinterval: SequenceInterval;\n\t\t\tpropertyDeltas: PropertySet;\n\t }\n\t| {\n\t\t\tevent: typeof IntervalOpType.POSITION_REMOVE;\n\t\t\tintervals: {\n\t\t\t\tintervalId: string;\n\t\t\t\tlabel: string;\n\t\t\t\tstartOffset?: number; // interval start index within a removed range\n\t\t\t\tendOffset?: number; // interval end index within a removed range\n\t\t\t}[];\n\t\t\t// local refs used by IntervalOpType.CHANGE and DELETE revertibles\n\t\t\trevertibleRefs: {\n\t\t\t\trevertible: IntervalRevertible;\n\t\t\t\toffset: number;\n\t\t\t\tisStart: boolean;\n\t\t\t}[];\n\t\t\tmergeTreeRevertible: MergeTreeDeltaRevertible;\n\t };\n\ntype TypedRevertible<T extends IntervalRevertible[\"event\"]> = IntervalRevertible & {\n\tevent: T;\n};\n\nfunction getUpdatedIdFromInterval(interval: SequenceInterval): string {\n\tconst maybeId = interval.getIntervalId();\n\treturn getUpdatedId(maybeId);\n}\n\nfunction getUpdatedId(intervalId: string): string {\n\treturn idMap.get(intervalId) ?? intervalId;\n}\n\n/**\n * Create revertibles for adding an interval\n * @legacy\n * @alpha\n */\nexport function appendAddIntervalToRevertibles(\n\tinterval: SequenceInterval,\n\trevertibles: SharedStringRevertible[],\n) {\n\trevertibles.push({\n\t\tevent: IntervalOpType.ADD,\n\t\tinterval,\n\t});\n\n\treturn revertibles;\n}\n\n/**\n * Create revertibles for deleting an interval\n * @legacy\n * @alpha\n */\nexport function appendDeleteIntervalToRevertibles(\n\tstring: ISharedString,\n\tinterval: SequenceInterval,\n\trevertibles: SharedStringRevertible[],\n): SharedStringRevertible[] {\n\tconst startSeg = interval.start.getSegment() as SharedStringSegment | undefined;\n\tif (!startSeg) {\n\t\treturn revertibles;\n\t}\n\tconst startType = segmentIsRemoved(startSeg)\n\t\t? ReferenceType.SlideOnRemove | ReferenceType.RangeBegin\n\t\t: ReferenceType.StayOnRemove | ReferenceType.RangeBegin;\n\tconst endSeg = interval.end.getSegment() as SharedStringSegment | undefined;\n\tif (!endSeg) {\n\t\treturn revertibles;\n\t}\n\tconst endType = segmentIsRemoved(startSeg)\n\t\t? ReferenceType.SlideOnRemove | ReferenceType.RangeEnd\n\t\t: ReferenceType.StayOnRemove | ReferenceType.RangeEnd;\n\tconst startRef = string.createLocalReferencePosition(\n\t\tstartSeg,\n\t\tinterval.start.getOffset(),\n\t\tstartType,\n\t\tundefined,\n\t\tinterval.start.slidingPreference,\n\t);\n\tconst endRef = string.createLocalReferencePosition(\n\t\tendSeg,\n\t\tinterval.end.getOffset(),\n\t\tendType,\n\t\tundefined,\n\t\tinterval.end.slidingPreference,\n\t);\n\tconst revertible = {\n\t\tevent: IntervalOpType.DELETE,\n\t\tinterval,\n\t\tstart: startRef,\n\t\tend: endRef,\n\t};\n\trevertible.start.addProperties({ revertible });\n\trevertible.end.addProperties({ revertible });\n\trevertibles.push(revertible);\n\n\treturn revertibles;\n}\n\n/**\n * Create revertibles for moving endpoints of an interval\n * @legacy\n * @alpha\n */\nexport function appendChangeIntervalToRevertibles(\n\tstring: ISharedString,\n\tnewInterval: SequenceInterval,\n\tpreviousInterval: SequenceInterval,\n\trevertibles: SharedStringRevertible[],\n) {\n\tconst startSeg = previousInterval.start.getSegment() as SharedStringSegment;\n\t// This logic is needed because the ReferenceType StayOnRemove cannot be used\n\t// on removed segments. This works for revertibles because the old position of the\n\t// interval within the removed segment is handled by the remove range revertible.\n\tconst startType = segmentIsRemoved(startSeg)\n\t\t? ReferenceType.SlideOnRemove | ReferenceType.RangeBegin\n\t\t: ReferenceType.StayOnRemove | ReferenceType.RangeBegin;\n\tconst endSeg = previousInterval.end.getSegment() as SharedStringSegment;\n\tconst endType = segmentIsRemoved(startSeg)\n\t\t? ReferenceType.SlideOnRemove | ReferenceType.RangeEnd\n\t\t: ReferenceType.StayOnRemove | ReferenceType.RangeEnd;\n\tconst prevStartRef = string.createLocalReferencePosition(\n\t\tstartSeg,\n\t\tpreviousInterval.start.getOffset(),\n\t\tstartType,\n\t\tundefined,\n\t\tpreviousInterval.start.slidingPreference,\n\t);\n\tconst prevEndRef = string.createLocalReferencePosition(\n\t\tendSeg,\n\t\tpreviousInterval.end.getOffset(),\n\t\tendType,\n\t\tundefined,\n\t\tpreviousInterval.end.slidingPreference,\n\t);\n\tconst revertible = {\n\t\tevent: IntervalOpType.CHANGE,\n\t\tinterval: newInterval,\n\t\tstart: prevStartRef,\n\t\tend: prevEndRef,\n\t};\n\trevertible.start.addProperties({ revertible });\n\trevertible.end.addProperties({ revertible });\n\trevertibles.push(revertible);\n\n\treturn revertibles;\n}\n\n/**\n * Create revertibles for changing properties of an interval\n * @legacy\n * @alpha\n */\nexport function appendIntervalPropertyChangedToRevertibles(\n\tinterval: SequenceInterval,\n\tdeltas: PropertySet,\n\trevertibles: SharedStringRevertible[],\n) {\n\trevertibles.push({\n\t\tevent: IntervalOpType.PROPERTY_CHANGED,\n\t\tinterval,\n\t\tpropertyDeltas: deltas,\n\t});\n\n\treturn revertibles;\n}\n\nfunction addIfIntervalEndpoint(\n\tref: LocalReferencePosition,\n\tsegmentLengths: number,\n\tstartIntervals: { offset: number; interval: SequenceInterval }[],\n\tendIntervals: { offset: number; interval: SequenceInterval }[],\n) {\n\tif (refTypeIncludesFlag(ref.refType, ReferenceType.RangeBegin)) {\n\t\tconst interval = ref.properties?.interval;\n\t\tif (interval && interval instanceof SequenceIntervalClass) {\n\t\t\tstartIntervals.push({ offset: segmentLengths + interval.start.getOffset(), interval });\n\t\t\treturn true;\n\t\t}\n\t} else if (refTypeIncludesFlag(ref.refType, ReferenceType.RangeEnd)) {\n\t\tconst interval = ref.properties?.interval;\n\t\tif (interval && interval instanceof SequenceIntervalClass) {\n\t\t\tendIntervals.push({ offset: segmentLengths + interval.end.getOffset(), interval });\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction addIfRevertibleRef(\n\tref: LocalReferencePosition,\n\tsegmentLengths: number,\n\trevertibleRefs: {\n\t\trevertible: IntervalRevertible;\n\t\toffset: number;\n\t\tisStart: boolean;\n\t}[],\n) {\n\tconst revertible = ref.properties?.revertible;\n\tif (revertible) {\n\t\trevertibleRefs.push({\n\t\t\trevertible,\n\t\t\toffset: segmentLengths + ref.getOffset(),\n\t\t\tisStart: refTypeIncludesFlag(ref.refType, ReferenceType.RangeBegin),\n\t\t});\n\t}\n}\n\n/**\n * Create revertibles for SharedStringDeltas, handling indirectly modified intervals\n * (e.g. reverting remove of a range that contains an interval will move the interval back)\n * @legacy\n * @alpha\n */\nexport function appendSharedStringDeltaToRevertibles(\n\tstring: ISharedString,\n\tdelta: SequenceDeltaEvent,\n\trevertibles: SharedStringRevertible[],\n) {\n\tif (delta.ranges.length === 0) {\n\t\treturn;\n\t}\n\tif (delta.deltaOperation === MergeTreeDeltaType.REMOVE) {\n\t\tconst startIntervals: { offset: number; interval: SequenceInterval }[] = [];\n\t\tconst endIntervals: { offset: number; interval: SequenceInterval }[] = [];\n\t\tconst revertibleRefs: {\n\t\t\trevertible: IntervalRevertible;\n\t\t\toffset: number;\n\t\t\tisStart: boolean;\n\t\t}[] = [];\n\t\tlet segmentLengths = 0;\n\n\t\t// find interval endpoints in each segment\n\t\tfor (const deltaRange of delta.ranges) {\n\t\t\tconst segment: ISegmentInternal = deltaRange.segment;\n\t\t\tconst refs = segment.localRefs;\n\t\t\tif (refs !== undefined && deltaRange.position !== -1) {\n\t\t\t\tfor (const ref of refs) {\n\t\t\t\t\taddIfIntervalEndpoint(ref, segmentLengths, startIntervals, endIntervals);\n\t\t\t\t\taddIfRevertibleRef(ref, segmentLengths, revertibleRefs);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsegmentLengths += deltaRange.segment.cachedLength;\n\t\t}\n\n\t\tif (startIntervals.length > 0 || endIntervals.length > 0 || revertibleRefs.length > 0) {\n\t\t\tconst removeRevertibles: MergeTreeDeltaRevertible[] = [];\n\t\t\tappendToMergeTreeDeltaRevertibles(delta.deltaArgs, removeRevertibles);\n\t\t\tassert(\n\t\t\t\tremoveRevertibles.length === 1,\n\t\t\t\t0x6c4 /* Remove revertible should be a single delta */,\n\t\t\t);\n\n\t\t\tconst revertible: TypedRevertible<typeof IntervalOpType.POSITION_REMOVE> = {\n\t\t\t\tevent: IntervalOpType.POSITION_REMOVE,\n\t\t\t\tintervals: [],\n\t\t\t\trevertibleRefs,\n\t\t\t\tmergeTreeRevertible: removeRevertibles[0],\n\t\t\t};\n\n\t\t\t// add an interval for each startInterval, accounting for any corresponding endIntervals\n\t\t\tstartIntervals.forEach(({ interval, offset }) => {\n\t\t\t\t// find any corresponding end for this interval\n\t\t\t\tconst endIntervalIndex = endIntervals.findIndex((end) => {\n\t\t\t\t\treturn end.interval === interval;\n\t\t\t\t});\n\t\t\t\tlet endOffset: number | undefined;\n\t\t\t\tif (endIntervalIndex !== -1) {\n\t\t\t\t\tendOffset = endIntervals[endIntervalIndex].offset;\n\t\t\t\t\tendIntervals.splice(endIntervalIndex, 1);\n\t\t\t\t}\n\n\t\t\t\trevertible.intervals.push({\n\t\t\t\t\tintervalId: interval.getIntervalId(),\n\t\t\t\t\tlabel: interval.properties.referenceRangeLabels?.[0],\n\t\t\t\t\tstartOffset: offset,\n\t\t\t\t\tendOffset,\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// add any remaining endIntervals that aren't matched with a startInterval\n\t\t\tendIntervals.forEach(({ interval, offset }) => {\n\t\t\t\trevertible.intervals.push({\n\t\t\t\t\tintervalId: interval.getIntervalId(),\n\t\t\t\t\tlabel: interval.properties.referenceRangeLabels?.[0],\n\t\t\t\t\tendOffset: offset,\n\t\t\t\t});\n\t\t\t});\n\n\t\t\trevertibles.push(revertible);\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Handle any merge tree delta that is not REMOVE or is REMOVE with no interval endpoints\n\tconst mergeTreeRevertibles: MergeTreeDeltaRevertible[] = [];\n\t// Allow merging MergeTreeDeltaRevertible with previous\n\tif (\n\t\trevertibles.length > 0 &&\n\t\tisMergeTreeDeltaRevertible(revertibles[revertibles.length - 1])\n\t) {\n\t\tmergeTreeRevertibles.push(revertibles.pop() as MergeTreeDeltaRevertible);\n\t}\n\tappendToMergeTreeDeltaRevertibles(delta.deltaArgs, mergeTreeRevertibles);\n\trevertibles.push(...mergeTreeRevertibles);\n}\n\n/**\n * Clean up resources held by revertibles that are no longer needed.\n * @legacy\n * @alpha\n */\nexport function discardSharedStringRevertibles(\n\tsharedString: ISharedString,\n\trevertibles: SharedStringRevertible[],\n) {\n\trevertibles.forEach((r) => {\n\t\tif (isMergeTreeDeltaRevertible(r)) {\n\t\t\tdiscardMergeTreeDeltaRevertible([r]);\n\t\t} else if (r.event === IntervalOpType.CHANGE || r.event === IntervalOpType.DELETE) {\n\t\t\tsharedString.removeLocalReferencePosition(r.start);\n\t\t\tsharedString.removeLocalReferencePosition(r.end);\n\t\t}\n\t});\n}\n\nfunction getSlidePosition(\n\tstring: ISharedString,\n\tlref: LocalReferencePosition,\n\tpos: number,\n): number {\n\tconst slide = getSlideToSegoff(\n\t\t{ segment: lref.getSegment(), offset: undefined },\n\t\tlref.slidingPreference,\n\t);\n\treturn slide?.segment !== undefined &&\n\t\tslide.offset !== undefined &&\n\t\tstring.getPosition(slide.segment) !== -1 &&\n\t\t(pos < 0 || pos >= string.getLength())\n\t\t? string.getPosition(slide.segment) + slide.offset\n\t\t: pos;\n}\n\nfunction isValidRange(\n\tstart: number,\n\tstartSlide: SlidingPreference | undefined,\n\tend: number,\n\tendSlide: SlidingPreference | undefined,\n\tstring: ISharedString,\n) {\n\treturn (\n\t\tstart >= 0 &&\n\t\tstart < string.getLength() &&\n\t\tend >= 0 &&\n\t\tend < string.getLength() &&\n\t\t(start < end ||\n\t\t\t(start === end &&\n\t\t\t\t(startSlide === SlidingPreference.FORWARD || endSlide !== SlidingPreference.FORWARD)))\n\t);\n}\n\nfunction revertLocalAdd(\n\tstring: ISharedString,\n\trevertible: TypedRevertible<typeof IntervalOpType.ADD>,\n) {\n\tconst id = getUpdatedIdFromInterval(revertible.interval);\n\tconst label = revertible.interval.properties.referenceRangeLabels?.[0];\n\tstring.getIntervalCollection(label).removeIntervalById(id);\n}\n\nfunction createSequencePlace(\n\tpos: number,\n\tnewSlidingPreference: SlidingPreference | undefined,\n\toldSlidingPreference: SlidingPreference | undefined = undefined,\n): number | InteriorSequencePlace {\n\treturn newSlidingPreference === SlidingPreference.BACKWARD ||\n\t\t(newSlidingPreference === undefined && oldSlidingPreference === SlidingPreference.BACKWARD)\n\t\t? {\n\t\t\t\tpos,\n\t\t\t\tside: Side.After,\n\t\t\t}\n\t\t: newSlidingPreference === SlidingPreference.FORWARD &&\n\t\t\t\toldSlidingPreference === SlidingPreference.BACKWARD\n\t\t\t? {\n\t\t\t\t\tpos,\n\t\t\t\t\tside: Side.Before,\n\t\t\t\t}\n\t\t\t: pos; // Avoid setting side if possible since stickiness may not be enabled\n}\n\nfunction revertLocalDelete(\n\tstring: ISharedString,\n\trevertible: TypedRevertible<typeof IntervalOpType.DELETE>,\n) {\n\tconst label = revertible.interval.properties.referenceRangeLabels?.[0];\n\tconst collection = string.getIntervalCollection(label);\n\tconst start = string.localReferencePositionToPosition(revertible.start);\n\tconst startSlidePos = getSlidePosition(string, revertible.start, start);\n\tconst end = string.localReferencePositionToPosition(revertible.end);\n\tconst endSlidePos = getSlidePosition(string, revertible.end, end);\n\t// reusing the id causes eventual consistency bugs, so it is removed here and recreated in add\n\tconst { intervalId, ...props } = revertible.interval.properties;\n\tif (\n\t\tisValidRange(\n\t\t\tstartSlidePos,\n\t\t\trevertible.start.slidingPreference,\n\t\t\tendSlidePos,\n\t\t\trevertible.end.slidingPreference,\n\t\t\tstring,\n\t\t)\n\t) {\n\t\tconst int = collection.add({\n\t\t\tstart: createSequencePlace(startSlidePos, revertible.start.slidingPreference),\n\t\t\tend: createSequencePlace(endSlidePos, revertible.end.slidingPreference),\n\t\t\tprops,\n\t\t});\n\n\t\tidMap.forEach((newId, oldId) => {\n\t\t\tif (intervalId === newId) {\n\t\t\t\tidMap.set(oldId, getUpdatedIdFromInterval(int));\n\t\t\t}\n\t\t});\n\t\tidMap.set(intervalId, int.getIntervalId());\n\t}\n\n\tstring.removeLocalReferencePosition(revertible.start);\n\tstring.removeLocalReferencePosition(revertible.end);\n}\n\nfunction revertLocalChange(\n\tstring: ISharedString,\n\trevertible: TypedRevertible<typeof IntervalOpType.CHANGE>,\n) {\n\tconst label = revertible.interval.properties.referenceRangeLabels?.[0];\n\tconst collection = string.getIntervalCollection(label);\n\tconst id = getUpdatedIdFromInterval(revertible.interval);\n\tconst start = string.localReferencePositionToPosition(revertible.start);\n\tconst startSlidePos = getSlidePosition(string, revertible.start, start);\n\tconst end = string.localReferencePositionToPosition(revertible.end);\n\tconst endSlidePos = getSlidePosition(string, revertible.end, end);\n\tconst interval = collection.getIntervalById(id);\n\tif (\n\t\tinterval !== undefined &&\n\t\tisValidRange(\n\t\t\tstartSlidePos,\n\t\t\trevertible.start.slidingPreference ?? interval.start.slidingPreference,\n\t\t\tendSlidePos,\n\t\t\trevertible.end.slidingPreference ?? interval.end.slidingPreference,\n\t\t\tstring,\n\t\t)\n\t) {\n\t\tcollection.change(id, {\n\t\t\tstart: createSequencePlace(\n\t\t\t\tstartSlidePos,\n\t\t\t\trevertible.start.slidingPreference,\n\t\t\t\tinterval.start.slidingPreference,\n\t\t\t),\n\t\t\tend: createSequencePlace(\n\t\t\t\tendSlidePos,\n\t\t\t\trevertible.end.slidingPreference,\n\t\t\t\tinterval.end.slidingPreference,\n\t\t\t),\n\t\t});\n\t}\n\n\tstring.removeLocalReferencePosition(revertible.start);\n\tstring.removeLocalReferencePosition(revertible.end);\n}\n\nfunction revertLocalPropertyChanged(\n\tstring: ISharedString,\n\trevertible: TypedRevertible<typeof IntervalOpType.PROPERTY_CHANGED>,\n) {\n\tconst label = revertible.interval.properties.referenceRangeLabels?.[0];\n\tconst id = getUpdatedIdFromInterval(revertible.interval);\n\tconst newProps = revertible.propertyDeltas;\n\tstring.getIntervalCollection(label).change(id, { props: newProps });\n}\n\nfunction newPosition(offset: number | undefined, restoredRanges: SortedRangeSet) {\n\tif (offset === undefined) {\n\t\treturn undefined;\n\t}\n\n\tlet offsetFromSegment = offset;\n\tfor (const rangeInfo of restoredRanges.items) {\n\t\tif (offsetFromSegment < rangeInfo.length) {\n\t\t\t// find the segment inside the range\n\t\t\tfor (const range of rangeInfo.ranges) {\n\t\t\t\tif (range.segment.cachedLength > offsetFromSegment) {\n\t\t\t\t\treturn { segment: range.segment, offset: offsetFromSegment };\n\t\t\t\t}\n\t\t\t\toffsetFromSegment -= range.segment.cachedLength;\n\t\t\t}\n\t\t}\n\t\toffsetFromSegment -= rangeInfo.length;\n\t}\n\n\treturn undefined;\n}\n\nfunction newEndpointPosition(\n\toffset: number | undefined,\n\trestoredRanges: SortedRangeSet,\n\tsharedString: ISharedString,\n) {\n\tconst pos = newPosition(offset, restoredRanges);\n\treturn pos === undefined ? undefined : sharedString.getPosition(pos.segment) + pos.offset;\n}\n\ninterface RangeInfo {\n\tranges: readonly Readonly<ISequenceDeltaRange<MergeTreeDeltaOperationType>>[];\n\tlength: number;\n}\n\n// eslint-disable-next-line import/no-deprecated\nclass SortedRangeSet extends SortedSet<RangeInfo, string> {\n\tprotected getKey(item: RangeInfo): string {\n\t\treturn item.ranges[0].segment.ordinal;\n\t}\n}\n\nfunction revertLocalSequenceRemove(\n\tsharedString: ISharedString,\n\trevertible: TypedRevertible<typeof IntervalOpType.POSITION_REMOVE>,\n) {\n\tconst restoredRanges = new SortedRangeSet();\n\tconst saveSegments = (event: SequenceDeltaEvent) => {\n\t\tif (event.ranges.length > 0) {\n\t\t\tlet length = 0;\n\t\t\tevent.ranges.forEach((range) => {\n\t\t\t\tlength += range.segment.cachedLength;\n\t\t\t});\n\t\t\trestoredRanges.addOrUpdate({ ranges: event.ranges, length });\n\t\t}\n\t};\n\tsharedString.on(\"sequenceDelta\", saveSegments);\n\trevertMergeTreeDeltaRevertibles(sharedString, [revertible.mergeTreeRevertible]);\n\tsharedString.off(\"sequenceDelta\", saveSegments);\n\n\trevertible.intervals.forEach((intervalInfo) => {\n\t\tconst intervalCollection = sharedString.getIntervalCollection(intervalInfo.label);\n\t\tconst intervalId = getUpdatedId(intervalInfo.intervalId);\n\t\tconst interval = intervalCollection.getIntervalById(intervalId);\n\t\tif (interval !== undefined) {\n\t\t\tconst start =\n\t\t\t\tnewEndpointPosition(intervalInfo.startOffset, restoredRanges, sharedString) ??\n\t\t\t\tsharedString.localReferencePositionToPosition(interval.start);\n\t\t\tconst end =\n\t\t\t\tnewEndpointPosition(intervalInfo.endOffset, restoredRanges, sharedString) ??\n\t\t\t\tsharedString.localReferencePositionToPosition(interval.end);\n\t\t\tif (\n\t\t\t\tisValidRange(\n\t\t\t\t\tstart,\n\t\t\t\t\tinterval.start.slidingPreference,\n\t\t\t\t\tend,\n\t\t\t\t\tinterval.end.slidingPreference,\n\t\t\t\t\tsharedString,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tintervalCollection.change(intervalId, {\n\t\t\t\t\tstart: createSequencePlace(start, interval.start.slidingPreference),\n\t\t\t\t\tend: createSequencePlace(end, interval.end.slidingPreference),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n\n\t// fix up the local references used by delete and change revertibles\n\trevertible.revertibleRefs.forEach((revertibleRef) => {\n\t\tassert(\n\t\t\trevertibleRef.revertible.event === IntervalOpType.CHANGE ||\n\t\t\t\trevertibleRef.revertible.event === IntervalOpType.DELETE,\n\t\t\t0x6c5 /* revertible is not delete or change */,\n\t\t);\n\t\tconst pos = newPosition(revertibleRef.offset, restoredRanges);\n\t\tif (pos !== undefined) {\n\t\t\tif (revertibleRef.isStart) {\n\t\t\t\tsharedString.removeLocalReferencePosition(revertibleRef.revertible.start);\n\t\t\t\tconst newRef = sharedString.createLocalReferencePosition(\n\t\t\t\t\tpos.segment as SharedStringSegment,\n\t\t\t\t\tpos.offset,\n\t\t\t\t\tReferenceType.StayOnRemove | ReferenceType.RangeBegin,\n\t\t\t\t\t{ revertible: revertibleRef.revertible },\n\t\t\t\t\trevertibleRef.revertible.start.slidingPreference,\n\t\t\t\t);\n\t\t\t\trevertibleRef.revertible.start = newRef;\n\t\t\t} else {\n\t\t\t\tsharedString.removeLocalReferencePosition(revertibleRef.revertible.end);\n\t\t\t\tconst newRef = sharedString.createLocalReferencePosition(\n\t\t\t\t\tpos.segment as SharedStringSegment,\n\t\t\t\t\tpos.offset,\n\t\t\t\t\tReferenceType.StayOnRemove | ReferenceType.RangeEnd,\n\t\t\t\t\t{ revertible: revertibleRef.revertible },\n\t\t\t\t\trevertibleRef.revertible.end.slidingPreference,\n\t\t\t\t);\n\t\t\t\trevertibleRef.revertible.end = newRef;\n\t\t\t}\n\t\t}\n\t});\n}\n\n/**\n * Invoke revertibles to reverse prior edits\n * @legacy\n * @alpha\n */\nexport function revertSharedStringRevertibles(\n\tsharedString: ISharedString,\n\trevertibles: SharedStringRevertible[],\n) {\n\twhile (revertibles.length > 0) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tconst r = revertibles.pop()!;\n\t\tif (\"event\" in r) {\n\t\t\tconst event = r.event;\n\t\t\tswitch (event) {\n\t\t\t\tcase IntervalOpType.ADD:\n\t\t\t\t\trevertLocalAdd(sharedString, r);\n\t\t\t\t\tbreak;\n\t\t\t\tcase IntervalOpType.DELETE:\n\t\t\t\t\trevertLocalDelete(sharedString, r);\n\t\t\t\t\tbreak;\n\t\t\t\tcase IntervalOpType.CHANGE:\n\t\t\t\t\trevertLocalChange(sharedString, r);\n\t\t\t\t\tbreak;\n\t\t\t\tcase IntervalOpType.PROPERTY_CHANGED:\n\t\t\t\t\trevertLocalPropertyChanged(sharedString, r);\n\t\t\t\t\tbreak;\n\t\t\t\tcase IntervalOpType.POSITION_REMOVE:\n\t\t\t\t\trevertLocalSequenceRemove(sharedString, r);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(event);\n\t\t\t}\n\t\t} else {\n\t\t\trevertMergeTreeDeltaRevertibles(sharedString, [r]);\n\t\t}\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sequence.d.ts","sourceRoot":"","sources":["../src/sequence.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAEN,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAEN,MAAM,EACN,YAAY,EAIZ,kBAAkB,EAKlB,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,sBAAsB,EAEtB,yBAAyB,EACzB,WAAW,EACX,iBAAiB,EACjB,aAAa,EAGb,iBAAiB,EAQjB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,OAAO,EACZ,MAAM,qCAAqC,CAAC;AAC7C,OAAO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AAiB;CASzB;AA4BD;;GAEG;AACH,wBAAgB,yBAAyB,SAExC"}
package/dist/sequence.js CHANGED
@@ -136,7 +136,6 @@ class SharedSegmentSequence extends internal_5.SharedObject {
136
136
  mergeTreeReferencesCanSlideToEndpoint: (c, n) => c.getBoolean(n),
137
137
  mergeTreeEnableAnnotateAdjust: (c, n) => c.getBoolean(n),
138
138
  }, dataStoreRuntime.options);
139
- // eslint-disable-next-line import/no-deprecated
140
139
  this.client = new internal_3.Client(segmentFromSpec, (0, internal_6.createChildLogger)({
141
140
  logger: this.logger,
142
141
  namespace: "SharedSegmentSequence.MergeTreeClient",
@@ -294,9 +293,7 @@ class SharedSegmentSequence extends internal_5.SharedObject {
294
293
  (0, internal_1.assert)(originalRefSeq !== undefined, 0x8bb /* Expected a recorded refSeq when resubmitting an op */);
295
294
  this.useResubmitRefSeq(originalRefSeq, () => {
296
295
  if (!this.intervalCollections.tryResubmitMessage(content, localOpMetadata)) {
297
- this.submitSequenceMessage(this.client.regeneratePendingOp(content,
298
- // eslint-disable-next-line import/no-deprecated
299
- localOpMetadata));
296
+ this.submitSequenceMessage(this.client.regeneratePendingOp(content, localOpMetadata));
300
297
  }
301
298
  });
302
299
  }