@fluidframework/sequence 2.90.0 → 2.92.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 +8 -0
- package/dist/IntervalCollectionValues.d.ts +3 -3
- package/dist/IntervalCollectionValues.d.ts.map +1 -1
- package/dist/IntervalCollectionValues.js.map +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/intervalCollection.d.ts +6 -5
- package/dist/intervalCollection.d.ts.map +1 -1
- package/dist/intervalCollection.js +10 -9
- package/dist/intervalCollection.js.map +1 -1
- package/dist/intervalCollectionMap.d.ts +4 -5
- package/dist/intervalCollectionMap.d.ts.map +1 -1
- package/dist/intervalCollectionMap.js +3 -3
- package/dist/intervalCollectionMap.js.map +1 -1
- package/dist/intervalCollectionMapInterfaces.d.ts +3 -3
- package/dist/intervalCollectionMapInterfaces.d.ts.map +1 -1
- package/dist/intervalCollectionMapInterfaces.js.map +1 -1
- package/dist/intervalIndex/endpointInRangeIndex.d.ts +2 -2
- package/dist/intervalIndex/endpointInRangeIndex.d.ts.map +1 -1
- package/dist/intervalIndex/endpointInRangeIndex.js.map +1 -1
- package/dist/intervalIndex/endpointIndex.d.ts +2 -2
- package/dist/intervalIndex/endpointIndex.d.ts.map +1 -1
- package/dist/intervalIndex/endpointIndex.js.map +1 -1
- package/dist/intervalIndex/index.d.ts +7 -7
- package/dist/intervalIndex/index.d.ts.map +1 -1
- package/dist/intervalIndex/index.js.map +1 -1
- package/dist/intervalIndex/overlappingIntervalsIndex.d.ts +3 -3
- package/dist/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
- package/dist/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
- package/dist/intervalIndex/sequenceIntervalIndexes.d.ts +2 -2
- package/dist/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -1
- package/dist/intervalIndex/sequenceIntervalIndexes.js.map +1 -1
- package/dist/intervalIndex/startpointInRangeIndex.d.ts +2 -2
- package/dist/intervalIndex/startpointInRangeIndex.d.ts.map +1 -1
- package/dist/intervalIndex/startpointInRangeIndex.js.map +1 -1
- package/dist/intervalTree.d.ts +3 -2
- package/dist/intervalTree.d.ts.map +1 -1
- package/dist/intervalTree.js.map +1 -1
- package/dist/intervals/index.d.ts +2 -2
- package/dist/intervals/index.d.ts.map +1 -1
- package/dist/intervals/index.js.map +1 -1
- package/dist/intervals/intervalUtils.d.ts +2 -1
- package/dist/intervals/intervalUtils.d.ts.map +1 -1
- package/dist/intervals/intervalUtils.js +0 -1
- package/dist/intervals/intervalUtils.js.map +1 -1
- package/dist/intervals/sequenceInterval.d.ts +5 -3
- package/dist/intervals/sequenceInterval.d.ts.map +1 -1
- package/dist/intervals/sequenceInterval.js.map +1 -1
- package/dist/legacy.d.ts +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +1 -1
- package/dist/revertibles.d.ts +5 -4
- package/dist/revertibles.d.ts.map +1 -1
- package/dist/revertibles.js +26 -20
- package/dist/revertibles.js.map +1 -1
- package/dist/sequence.d.ts +8 -6
- package/dist/sequence.d.ts.map +1 -1
- package/dist/sequence.js +9 -10
- package/dist/sequence.js.map +1 -1
- package/dist/sequenceDeltaEvent.d.ts +2 -1
- package/dist/sequenceDeltaEvent.d.ts.map +1 -1
- package/dist/sequenceDeltaEvent.js +2 -2
- package/dist/sequenceDeltaEvent.js.map +1 -1
- package/dist/sequenceFactory.d.ts +3 -2
- package/dist/sequenceFactory.d.ts.map +1 -1
- package/dist/sequenceFactory.js +3 -2
- package/dist/sequenceFactory.js.map +1 -1
- package/dist/sharedSequence.d.ts +3 -2
- package/dist/sharedSequence.d.ts.map +1 -1
- package/dist/sharedSequence.js.map +1 -1
- package/dist/sharedString.d.ts +3 -2
- package/dist/sharedString.d.ts.map +1 -1
- package/dist/sharedString.js.map +1 -1
- package/eslint.config.mts +16 -4
- package/internal.d.ts +1 -1
- package/legacy.d.ts +1 -1
- package/lib/IntervalCollectionValues.d.ts +3 -3
- package/lib/IntervalCollectionValues.d.ts.map +1 -1
- package/lib/IntervalCollectionValues.js +1 -1
- package/lib/IntervalCollectionValues.js.map +1 -1
- package/lib/index.d.ts +10 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/intervalCollection.d.ts +6 -5
- package/lib/intervalCollection.d.ts.map +1 -1
- package/lib/intervalCollection.js +10 -9
- package/lib/intervalCollection.js.map +1 -1
- package/lib/intervalCollectionMap.d.ts +4 -5
- package/lib/intervalCollectionMap.d.ts.map +1 -1
- package/lib/intervalCollectionMap.js +3 -3
- package/lib/intervalCollectionMap.js.map +1 -1
- package/lib/intervalCollectionMapInterfaces.d.ts +3 -3
- package/lib/intervalCollectionMapInterfaces.d.ts.map +1 -1
- package/lib/intervalCollectionMapInterfaces.js.map +1 -1
- package/lib/intervalIndex/endpointInRangeIndex.d.ts +2 -2
- package/lib/intervalIndex/endpointInRangeIndex.d.ts.map +1 -1
- package/lib/intervalIndex/endpointInRangeIndex.js +1 -1
- package/lib/intervalIndex/endpointInRangeIndex.js.map +1 -1
- package/lib/intervalIndex/endpointIndex.d.ts +2 -2
- package/lib/intervalIndex/endpointIndex.d.ts.map +1 -1
- package/lib/intervalIndex/endpointIndex.js.map +1 -1
- package/lib/intervalIndex/index.d.ts +7 -7
- package/lib/intervalIndex/index.d.ts.map +1 -1
- package/lib/intervalIndex/index.js.map +1 -1
- package/lib/intervalIndex/overlappingIntervalsIndex.d.ts +3 -3
- package/lib/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
- package/lib/intervalIndex/overlappingIntervalsIndex.js +1 -1
- package/lib/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
- package/lib/intervalIndex/sequenceIntervalIndexes.d.ts +2 -2
- package/lib/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -1
- package/lib/intervalIndex/sequenceIntervalIndexes.js.map +1 -1
- package/lib/intervalIndex/startpointInRangeIndex.d.ts +2 -2
- package/lib/intervalIndex/startpointInRangeIndex.d.ts.map +1 -1
- package/lib/intervalIndex/startpointInRangeIndex.js +1 -1
- package/lib/intervalIndex/startpointInRangeIndex.js.map +1 -1
- package/lib/intervalTree.d.ts +3 -2
- package/lib/intervalTree.d.ts.map +1 -1
- package/lib/intervalTree.js +1 -1
- package/lib/intervalTree.js.map +1 -1
- package/lib/intervals/index.d.ts +2 -2
- package/lib/intervals/index.d.ts.map +1 -1
- package/lib/intervals/index.js.map +1 -1
- package/lib/intervals/intervalUtils.d.ts +2 -1
- package/lib/intervals/intervalUtils.d.ts.map +1 -1
- package/lib/intervals/intervalUtils.js +0 -1
- package/lib/intervals/intervalUtils.js.map +1 -1
- package/lib/intervals/sequenceInterval.d.ts +5 -3
- package/lib/intervals/sequenceInterval.d.ts.map +1 -1
- package/lib/intervals/sequenceInterval.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +1 -1
- package/lib/revertibles.d.ts +5 -4
- package/lib/revertibles.d.ts.map +1 -1
- package/lib/revertibles.js +26 -20
- package/lib/revertibles.js.map +1 -1
- package/lib/sequence.d.ts +8 -6
- package/lib/sequence.d.ts.map +1 -1
- package/lib/sequence.js +11 -12
- package/lib/sequence.js.map +1 -1
- package/lib/sequenceDeltaEvent.d.ts +2 -1
- package/lib/sequenceDeltaEvent.d.ts.map +1 -1
- package/lib/sequenceDeltaEvent.js +2 -2
- package/lib/sequenceDeltaEvent.js.map +1 -1
- package/lib/sequenceFactory.d.ts +3 -2
- package/lib/sequenceFactory.d.ts.map +1 -1
- package/lib/sequenceFactory.js +3 -2
- package/lib/sequenceFactory.js.map +1 -1
- package/lib/sharedSequence.d.ts +3 -2
- package/lib/sharedSequence.d.ts.map +1 -1
- package/lib/sharedSequence.js +1 -1
- package/lib/sharedSequence.js.map +1 -1
- package/lib/sharedString.d.ts +3 -2
- package/lib/sharedString.d.ts.map +1 -1
- package/lib/sharedString.js +1 -1
- package/lib/sharedString.js.map +1 -1
- package/package.json +23 -23
- package/src/IntervalCollectionValues.ts +4 -6
- package/src/index.ts +25 -25
- package/src/intervalCollection.ts +25 -20
- package/src/intervalCollectionMap.ts +8 -8
- package/src/intervalCollectionMapInterfaces.ts +4 -4
- package/src/intervalIndex/endpointInRangeIndex.ts +7 -8
- package/src/intervalIndex/endpointIndex.ts +3 -2
- package/src/intervalIndex/index.ts +7 -7
- package/src/intervalIndex/overlappingIntervalsIndex.ts +8 -9
- package/src/intervalIndex/sequenceIntervalIndexes.ts +2 -2
- package/src/intervalIndex/startpointInRangeIndex.ts +7 -8
- package/src/intervalTree.ts +3 -3
- package/src/intervals/index.ts +6 -6
- package/src/intervals/intervalUtils.ts +2 -1
- package/src/intervals/sequenceInterval.ts +7 -6
- package/src/packageVersion.ts +1 -1
- package/src/revertibles.ts +35 -26
- package/src/sequence.ts +25 -26
- package/src/sequenceDeltaEvent.ts +6 -4
- package/src/sequenceFactory.ts +6 -4
- package/src/sharedSequence.ts +3 -7
- package/src/sharedString.ts +3 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceInterval.js","sourceRoot":"","sources":["../../src/intervals/sequenceInterval.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;AAKH,kEAA6D;AAE7D,kEAuB6C;AAC7C,uEAAoF;AACpF,+BAAkC;AAIlC,yDAU4B;AAE5B,SAAS,YAAY,CAAC,KAAW,EAAE,KAAW;IAC7C,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QACrB,OAAO,CAAC,CAAC;IACV,CAAC;IAED,IAAI,KAAK,KAAK,eAAI,CAAC,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,CAAC;IACV,CAAC;IAED,OAAO,CAAC,CAAC,CAAC;AACX,C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B,EAAE,kBAAkB,IAAI,UAAU,KAAK,qCAAkB,CAAC,IAAI;QAChF,QAAQ;KACR,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG;QACjB,CAAC,iCAAsB,CAAC,EAAE,CAAC,KAAK,CAAC;KACjC,CAAC;IACF,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACnC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAEjC,MAAM,IAAI,GAAG,IAAI,qBAAqB,CACrC,MAAM,EACN,EAAE,EACF,KAAK,EACL,SAAS,EACT,OAAO,EACP,YAAY,EACZ,KAAK,KAAK,SAAS;QAClB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,qBAAqB,CAAC,EAAE,SAAS,EAAE,CAAC,iCAAsB,CAAC,EAAE,SAAS,EAAE,EACxF,SAAS,EACT,OAAO,CACP,CAAC;IACF,OAAO,IAAI,CAAC;AACb,CAAC;AApGD,wDAoGC","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 type { IDisposable } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tClient,\n\tISegment,\n\tLocalReferencePosition,\n\tPropertiesManager,\n\tPropertySet,\n\tReferenceType,\n\tSlidingPreference,\n\tcompareReferencePositions,\n\tcreateDetachedLocalReferencePosition,\n\tcreateMap,\n\tgetSlideToSegoff,\n\tmaxReferencePosition,\n\tminReferencePosition,\n\trefTypeIncludesFlag,\n\treservedRangeLabelsKey,\n\tSequencePlace,\n\tSide,\n\tendpointPosAndSide,\n\taddProperties,\n\ttype ISegmentInternal,\n\tUnassignedSequenceNumber,\n\tUniversalSequenceNumber,\n} from \"@fluidframework/merge-tree/internal\";\nimport { LoggingError, UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport type { ISharedSegmentSequence } from \"../sequence.js\";\n\nimport {\n\tISerializableInterval,\n\tISerializedInterval,\n\tIntervalStickiness,\n\tIntervalType,\n\tcomputeStickinessFromSide,\n\tendReferenceSlidingPreference,\n\tstartReferenceSlidingPreference,\n\ttype IInterval,\n\ttype SerializedIntervalDelta,\n} from \"./intervalUtils.js\";\n\nfunction compareSides(sideA: Side, sideB: Side): number {\n\tif (sideA === sideB) {\n\t\treturn 0;\n\t}\n\n\tif (sideA === Side.Before) {\n\t\treturn 1;\n\t}\n\n\treturn -1;\n}\n\nfunction minSide(sideA: Side, sideB: Side): Side {\n\tif (sideA === Side.After && sideB === Side.After) {\n\t\treturn Side.After;\n\t}\n\n\treturn Side.Before;\n}\n\nfunction maxSide(sideA: Side, sideB: Side): Side {\n\tif (sideA === Side.Before && sideB === Side.Before) {\n\t\treturn Side.Before;\n\t}\n\n\treturn Side.After;\n}\n\nconst reservedIntervalIdKey = \"intervalId\";\n\nconst legacyIdPrefix = \"legacy\";\n\nexport function getSerializedProperties(\n\tserializedInterval: ISerializedInterval | SerializedIntervalDelta,\n): {\n\tid: string;\n\tlabels: string[];\n\tproperties: PropertySet;\n} {\n\tconst {\n\t\t[reservedIntervalIdKey]: maybeId,\n\t\t[reservedRangeLabelsKey]: labels,\n\t\t...properties\n\t} = serializedInterval.properties ?? {};\n\t// Create a non-unique ID based on start and end to be used on intervals that come from legacy clients\n\t// without ID's.\n\tconst id =\n\t\tmaybeId ?? `${legacyIdPrefix}${serializedInterval.start}-${serializedInterval.end}`;\n\n\treturn { id, labels, properties };\n}\n\n/**\n * Interval implementation whose ends are associated with positions in a mutatable sequence.\n * As such, when content is inserted into the middle of the interval, the interval expands to\n * include that content.\n *\n * @remarks The endpoints' positions should be treated exclusively to get\n * reasonable behavior. E.g., an interval referring to \"hello\" in \"hello world\"\n * should have a start position of 0 and an end position of 5.\n *\n * To see why, consider what happens if \"llo wor\" is removed from the string to make \"held\".\n * The interval's startpoint remains on the \"h\" (it isn't altered), but the interval's endpoint\n * slides forward to the next unremoved position, which is the \"l\" in \"held\".\n * Users would generally expect the interval to now refer to \"he\" (as it is the subset of content\n * remaining after the removal), hence the \"l\" should be excluded.\n * If the interval endpoint was treated inclusively, the interval would now refer to \"hel\", which\n * is undesirable.\n *\n * Since the endpoints of an interval are treated exclusively but cannot be greater\n * than or equal to the length of the associated sequence, there exist special\n * endpoint segments, \"start\" and \"end\", which represent the position immediately\n * before or immediately after the string respectively.\n *\n * If a `SequenceInterval` is created on a sequence with the\n * `mergeTreeReferencesCanSlideToEndpoint` feature flag set to true, the endpoints\n * of the interval that are exclusive will have the ability to slide to these\n * special endpoint segments.\n * @legacy @beta\n */\nexport interface SequenceInterval extends IInterval {\n\treadonly start: LocalReferencePosition;\n\t/**\n\t * End endpoint of this interval.\n\t * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.\n\t */\n\treadonly end: LocalReferencePosition;\n\treadonly intervalType: IntervalType;\n\treadonly startSide: Side;\n\treadonly endSide: Side;\n\treadonly stickiness: IntervalStickiness;\n\n\t/** Serializable bag of properties associated with the interval. */\n\tproperties: PropertySet;\n\n\t/**\n\t * Compares this interval to `b` with standard comparator semantics:\n\t * - returns -1 if this is less than `b`\n\t * - returns 1 if this is greater than `b`\n\t * - returns 0 if this is equivalent to `b`\n\t * @param b - Interval to compare against\n\t */\n\tcompare(b: SequenceInterval): number;\n\t/**\n\t * Compares the start endpoint of this interval to `b`'s start endpoint.\n\t * Standard comparator semantics apply.\n\t * @param b - Interval to compare against\n\t */\n\tcompareStart(b: SequenceInterval): number;\n\t/**\n\t * Compares the end endpoint of this interval to `b`'s end endpoint.\n\t * Standard comparator semantics apply.\n\t * @param b - Interval to compare against\n\t */\n\tcompareEnd(b: SequenceInterval): number;\n\n\t/**\n\t * @returns whether this interval overlaps with `b`.\n\t * Intervals are considered to overlap if their intersection is non-empty.\n\t */\n\toverlaps(b: SequenceInterval): boolean;\n\n\t/**\n\t * @returns whether this interval overlaps two numerical positions.\n\t */\n\toverlapsPos(bstart: number, bend: number): boolean;\n\n\t/**\n\t * Gets the id associated with this interval.\n\t * When the interval is used as part of an interval collection, this id can be used to modify or remove the\n\t * interval.\n\t */\n\tgetIntervalId(): string;\n}\n\n/**\n * Lightweight interval for index queries (overlap, comparison).\n * Has no Client dependency; cannot serialize or be disposed.\n */\nexport class BaseSequenceInterval implements SequenceInterval, ISerializableInterval {\n\treadonly #id: string;\n\treadonly #properties: PropertySet = createMap<any>();\n\n\tconstructor(\n\t\tid: string,\n\t\t/**\n\t\t * Start endpoint of this interval.\n\t\t * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.\n\t\t */\n\t\tpublic start: LocalReferencePosition,\n\t\t/**\n\t\t * End endpoint of this interval.\n\t\t * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.\n\t\t */\n\t\tpublic end: LocalReferencePosition,\n\t\tpublic intervalType: IntervalType,\n\t\tpublic readonly startSide: Side = Side.Before,\n\t\tpublic readonly endSide: Side = Side.Before,\n\t) {\n\t\tthis.#id = id;\n\t}\n\n\tpublic get properties(): Readonly<PropertySet> {\n\t\treturn this.#properties;\n\t}\n\n\t/***/\n\tpublic get stickiness(): IntervalStickiness {\n\t\tthis.verifyNotDispose();\n\n\t\tconst startSegment: ISegmentInternal | undefined = this.start.getSegment();\n\t\tconst endSegment: ISegmentInternal | undefined = this.end.getSegment();\n\t\treturn computeStickinessFromSide(\n\t\t\tstartSegment?.endpointType,\n\t\t\tthis.startSide,\n\t\t\tendSegment?.endpointType,\n\t\t\tthis.endSide,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ISerializableInterval.getIntervalId}\n\t */\n\tpublic getIntervalId(): string {\n\t\treturn this.#id;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.compare}\n\t */\n\tpublic compare(b: SequenceInterval) {\n\t\tconst startResult = this.compareStart(b);\n\t\tif (startResult === 0) {\n\t\t\tconst endResult = this.compareEnd(b);\n\t\t\tif (endResult === 0) {\n\t\t\t\tconst thisId = this.getIntervalId();\n\t\t\t\tif (thisId) {\n\t\t\t\t\tconst bId = b.getIntervalId();\n\t\t\t\t\tif (bId) {\n\t\t\t\t\t\treturn thisId > bId ? 1 : thisId < bId ? -1 : 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn endResult;\n\t\t\t}\n\t\t} else {\n\t\t\treturn startResult;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.compareStart}\n\t */\n\tpublic compareStart(b: SequenceInterval) {\n\t\tthis.verifyNotDispose();\n\n\t\tconst dist = compareReferencePositions(this.start, b.start);\n\n\t\tif (dist === 0) {\n\t\t\treturn compareSides(this.startSide, b.startSide);\n\t\t}\n\n\t\treturn dist;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.compareEnd}\n\t */\n\tpublic compareEnd(b: SequenceInterval): number {\n\t\tthis.verifyNotDispose();\n\n\t\tconst dist = compareReferencePositions(this.end, b.end);\n\n\t\tif (dist === 0) {\n\t\t\treturn compareSides(b.endSide, this.endSide);\n\t\t}\n\n\t\treturn dist;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.overlaps}\n\t */\n\tpublic overlaps(b: SequenceInterval) {\n\t\tthis.verifyNotDispose();\n\n\t\tconst result =\n\t\t\tcompareReferencePositions(this.start, b.end) <= 0 &&\n\t\t\tcompareReferencePositions(this.end, b.start) >= 0;\n\t\treturn result;\n\t}\n\n\t/**\n\t * Whether this interval overlaps the provided numerical positions.\n\t */\n\tpublic overlapsPos(_bstart: number, _bend: number): boolean {\n\t\tassert(false, 0xcd7 /* overlapsPos not supported on BaseSequenceInterval */);\n\t}\n\n\tpublic clone(): BaseSequenceInterval {\n\t\tassert(false, 0xcd8 /* clone not supported on BaseSequenceInterval */);\n\t}\n\n\tpublic union(_b: BaseSequenceInterval): BaseSequenceInterval {\n\t\tassert(false, 0xcd9 /* union not supported on BaseSequenceInterval */);\n\t}\n\n\tprotected verifyNotDispose(): void {\n\t\t// No-op: transient intervals are not disposable.\n\t}\n}\n\nexport class SequenceIntervalClass\n\textends BaseSequenceInterval\n\timplements ISerializableInterval, IDisposable\n{\n\treadonly #props: {\n\t\tpropertyManager?: PropertiesManager;\n\t\tproperties: PropertySet;\n\t} = { properties: createMap<any>() };\n\n\t/**\n\t * {@inheritDoc ISerializableInterval.properties}\n\t */\n\tpublic override get properties(): Readonly<PropertySet> {\n\t\tthis.verifyNotDispose();\n\t\treturn this.#props.properties;\n\t}\n\n\tpublic changeProperties(\n\t\tprops: PropertySet | undefined,\n\t\top?: ISequencedDocumentMessage,\n\t\trollback?: boolean,\n\t) {\n\t\tthis.verifyNotDispose();\n\n\t\tif (props !== undefined) {\n\t\t\tthis.#props.propertyManager ??= new PropertiesManager();\n\t\t\treturn this.#props.propertyManager.handleProperties(\n\t\t\t\t{ props },\n\t\t\t\tthis.#props,\n\t\t\t\tthis.client.getCollabWindow().collaborating\n\t\t\t\t\t? (op?.sequenceNumber ?? UnassignedSequenceNumber)\n\t\t\t\t\t: UniversalSequenceNumber,\n\t\t\t\top?.minimumSequenceNumber ?? UniversalSequenceNumber,\n\t\t\t\tthis.client.getCollabWindow().collaborating,\n\t\t\t\trollback,\n\t\t\t);\n\t\t}\n\t}\n\n\tconstructor(\n\t\tprivate readonly client: Client,\n\t\tid: string,\n\t\tprivate readonly label: string,\n\t\tstart: LocalReferencePosition,\n\t\tend: LocalReferencePosition,\n\t\tintervalType: IntervalType,\n\t\tprops?: PropertySet,\n\t\tstartSide: Side = Side.Before,\n\t\tendSide: Side = Side.Before,\n\t) {\n\t\tsuper(id, start, end, intervalType, startSide, endSide);\n\t\tif (props) {\n\t\t\tthis.#props.properties = addProperties(this.#props.properties, props);\n\t\t}\n\t}\n\t#disposed = false;\n\tpublic get disposed() {\n\t\treturn this.#disposed;\n\t}\n\tpublic dispose(error?: Error): void {\n\t\tif (this.#disposed) return;\n\t\tthis.#disposed = true;\n\t\tthis.client.removeLocalReferencePosition(this.start);\n\t\tthis.client.removeLocalReferencePosition(this.end);\n\t\tthis.removePositionChangeListeners();\n\t\tthis.#props.propertyManager = undefined;\n\t}\n\n\tprotected override verifyNotDispose() {\n\t\tif (this.#disposed) {\n\t\t\tthrow new LoggingError(\"Invalid interval access after dispose\");\n\t\t}\n\t}\n\n\tprivate callbacks?: Record<\"beforePositionChange\" | \"afterPositionChange\", () => void>;\n\n\t/**\n\t * Subscribes to position change events on this interval if there are no current listeners.\n\t */\n\tpublic addPositionChangeListeners(\n\t\tbeforePositionChange: () => void,\n\t\tafterPositionChange: () => void,\n\t): void {\n\t\tthis.verifyNotDispose();\n\t\tif (this.callbacks === undefined) {\n\t\t\tthis.callbacks = {\n\t\t\t\tbeforePositionChange,\n\t\t\t\tafterPositionChange,\n\t\t\t};\n\n\t\t\tconst startCbs = (this.start.callbacks ??= {});\n\t\t\tconst endCbs = (this.end.callbacks ??= {});\n\t\t\tstartCbs.beforeSlide = endCbs.beforeSlide = beforePositionChange;\n\t\t\tstartCbs.afterSlide = endCbs.afterSlide = afterPositionChange;\n\t\t}\n\t}\n\n\t/**\n\t * Removes the currently subscribed position change listeners.\n\t */\n\tpublic removePositionChangeListeners(): void {\n\t\tif (this.callbacks) {\n\t\t\tthis.callbacks = undefined;\n\t\t\tthis.start.callbacks = undefined;\n\t\t\tthis.end.callbacks = undefined;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc ISerializableInterval.serialize}\n\t */\n\tpublic serialize(): ISerializedInterval {\n\t\tthis.verifyNotDispose();\n\n\t\treturn this.serializeDelta({\n\t\t\tprops: this.properties,\n\t\t\tincludeEndpoints: true,\n\t\t}) as ISerializedInterval;\n\t}\n\n\tpublic serializeDelta({\n\t\tprops,\n\t\tincludeEndpoints,\n\t}: {\n\t\tprops: PropertySet | undefined;\n\t\tincludeEndpoints: boolean;\n\t}): SerializedIntervalDelta {\n\t\tthis.verifyNotDispose();\n\n\t\tconst startSegment: ISegmentInternal | undefined = this.start.getSegment();\n\t\tconst endSegment: ISegmentInternal | undefined = this.end.getSegment();\n\t\tconst startPosition = includeEndpoints\n\t\t\t? (startSegment?.endpointType ??\n\t\t\t\tthis.client.localReferencePositionToPosition(this.start))\n\t\t\t: undefined;\n\t\tconst endPosition = includeEndpoints\n\t\t\t? (endSegment?.endpointType ?? this.client.localReferencePositionToPosition(this.end))\n\t\t\t: undefined;\n\t\treturn {\n\t\t\tend: endPosition,\n\t\t\tintervalType: this.intervalType,\n\t\t\tsequenceNumber: this.client.getCurrentSeq(),\n\t\t\tstart: startPosition,\n\t\t\tstickiness: this.stickiness,\n\t\t\tstartSide: includeEndpoints ? this.startSide : undefined,\n\t\t\tendSide: includeEndpoints ? this.endSide : undefined,\n\t\t\tproperties: {\n\t\t\t\t...props,\n\t\t\t\t[reservedIntervalIdKey]: this.getIntervalId(),\n\t\t\t\t[reservedRangeLabelsKey]: [this.label],\n\t\t\t},\n\t\t} satisfies SerializedIntervalDelta;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.clone}\n\t */\n\tpublic clone(): SequenceIntervalClass {\n\t\tthis.verifyNotDispose();\n\n\t\treturn new SequenceIntervalClass(\n\t\t\tthis.client,\n\t\t\tthis.getIntervalId(),\n\t\t\tthis.label,\n\t\t\tthis.start,\n\t\t\tthis.end,\n\t\t\tthis.intervalType,\n\t\t\tthis.properties,\n\t\t\tthis.startSide,\n\t\t\tthis.endSide,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.union}\n\t */\n\tpublic union(b: SequenceIntervalClass) {\n\t\tthis.verifyNotDispose();\n\n\t\tconst newStart = minReferencePosition(this.start, b.start);\n\t\tconst newEnd = maxReferencePosition(this.end, b.end);\n\n\t\tlet startSide: Side;\n\n\t\tif (this.start === b.start) {\n\t\t\tstartSide = minSide(this.startSide, b.startSide);\n\t\t} else {\n\t\t\tstartSide = this.start === newStart ? this.startSide : b.startSide;\n\t\t}\n\n\t\tlet endSide: Side;\n\n\t\tif (this.end === b.end) {\n\t\t\tendSide = maxSide(this.endSide, b.endSide);\n\t\t} else {\n\t\t\tendSide = this.end === newEnd ? this.endSide : b.endSide;\n\t\t}\n\n\t\treturn new SequenceIntervalClass(\n\t\t\tthis.client,\n\t\t\tuuid(),\n\t\t\tthis.label,\n\t\t\tnewStart,\n\t\t\tnewEnd,\n\t\t\tthis.intervalType,\n\t\t\tundefined,\n\t\t\tstartSide,\n\t\t\tendSide,\n\t\t);\n\t}\n\n\t/**\n\t * Whether this interval overlaps the provided numerical positions.\n\t */\n\tpublic override overlapsPos(bstart: number, bend: number) {\n\t\tthis.verifyNotDispose();\n\n\t\tconst startPos = this.client.localReferencePositionToPosition(this.start);\n\t\tconst endPos = this.client.localReferencePositionToPosition(this.end);\n\t\treturn endPos > bstart && startPos < bend;\n\t}\n\n\tpublic moveEndpointReferences(\n\t\trebased: Record<\"start\" | \"end\", { segment: ISegment; offset: number }>,\n\t) {\n\t\tthis.verifyNotDispose();\n\n\t\tconst startRef = createPositionReferenceFromSegoff({\n\t\t\tclient: this.client,\n\t\t\tsegoff: rebased.start,\n\t\t\trefType: this.start.refType,\n\t\t\tslidingPreference: this.start.slidingPreference,\n\t\t\tcanSlideToEndpoint: this.start.canSlideToEndpoint,\n\t\t});\n\t\tif (this.start.properties) {\n\t\t\tstartRef.addProperties(this.start.properties);\n\t\t}\n\t\tthis.start = startRef;\n\n\t\tconst endRef = createPositionReferenceFromSegoff({\n\t\t\tclient: this.client,\n\t\t\tsegoff: rebased.end,\n\t\t\trefType: this.end.refType,\n\t\t\tslidingPreference: this.end.slidingPreference,\n\t\t\tcanSlideToEndpoint: this.end.canSlideToEndpoint,\n\t\t});\n\t\tif (this.end.properties) {\n\t\t\tendRef.addProperties(this.end.properties);\n\t\t}\n\t\tthis.end = endRef;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.modify}\n\t */\n\tpublic modify(\n\t\tlabel: string,\n\t\tstart: SequencePlace | undefined,\n\t\tend: SequencePlace | undefined,\n\t\top?: ISequencedDocumentMessage,\n\t\tlocalSeq?: number,\n\t\tcanSlideToEndpoint: boolean = false,\n\t) {\n\t\tthis.verifyNotDispose();\n\n\t\tconst { startSide, endSide, startPos, endPos } = endpointPosAndSide(start, end);\n\t\tconst getRefType = (baseType: ReferenceType): ReferenceType => {\n\t\t\tlet refType = baseType;\n\t\t\tif (op === undefined) {\n\t\t\t\trefType &= ~ReferenceType.SlideOnRemove;\n\t\t\t\trefType |= ReferenceType.StayOnRemove;\n\t\t\t} else {\n\t\t\t\trefType &= ~ReferenceType.StayOnRemove;\n\t\t\t\trefType |= ReferenceType.SlideOnRemove;\n\t\t\t}\n\t\t\treturn refType;\n\t\t};\n\n\t\tlet startRef = this.start;\n\t\tif (startPos !== undefined) {\n\t\t\tconst slidingPreference = startReferenceSlidingPreference(\n\t\t\t\tstartPos,\n\t\t\t\tstartSide ?? Side.Before,\n\t\t\t\tendPos,\n\t\t\t\tendSide ?? Side.Before,\n\t\t\t);\n\t\t\tstartRef = createPositionReference({\n\t\t\t\tclient: this.client,\n\t\t\t\tpos: startPos,\n\t\t\t\trefType: getRefType(this.start.refType),\n\t\t\t\top,\n\t\t\t\tlocalSeq,\n\t\t\t\tslidingPreference,\n\t\t\t\tcanSlideToEndpoint:\n\t\t\t\t\tcanSlideToEndpoint && slidingPreference === SlidingPreference.BACKWARD,\n\t\t\t});\n\t\t\tif (this.start.properties) {\n\t\t\t\tstartRef.addProperties(this.start.properties);\n\t\t\t}\n\t\t}\n\n\t\tlet endRef = this.end;\n\t\tif (endPos !== undefined) {\n\t\t\tconst slidingPreference = endReferenceSlidingPreference(\n\t\t\t\tstartPos,\n\t\t\t\tstartSide ?? Side.Before,\n\t\t\t\tendPos,\n\t\t\t\tendSide ?? Side.Before,\n\t\t\t);\n\t\t\tendRef = createPositionReference({\n\t\t\t\tclient: this.client,\n\t\t\t\tpos: endPos,\n\t\t\t\trefType: getRefType(this.end.refType),\n\t\t\t\top,\n\t\t\t\tlocalSeq,\n\t\t\t\tslidingPreference,\n\t\t\t\tcanSlideToEndpoint:\n\t\t\t\t\tcanSlideToEndpoint && slidingPreference === SlidingPreference.FORWARD,\n\t\t\t});\n\t\t\tif (this.end.properties) {\n\t\t\t\tendRef.addProperties(this.end.properties);\n\t\t\t}\n\t\t}\n\n\t\tconst newInterval = new SequenceIntervalClass(\n\t\t\tthis.client,\n\t\t\tthis.getIntervalId(),\n\t\t\tthis.label,\n\t\t\tstartRef,\n\t\t\tendRef,\n\t\t\tthis.intervalType,\n\t\t\tundefined,\n\t\t\tstartSide ?? this.startSide,\n\t\t\tendSide ?? this.endSide,\n\t\t);\n\t\tnewInterval.#props.propertyManager = this.#props.propertyManager ??=\n\t\t\tnew PropertiesManager();\n\t\tnewInterval.#props.properties = this.#props.properties;\n\t\treturn newInterval;\n\t}\n\n\tpublic ackPropertiesChange(newProps: PropertySet, op: ISequencedDocumentMessage) {\n\t\tthis.verifyNotDispose();\n\n\t\tif (Object.keys(newProps).length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tassert(\n\t\t\tthis.#props.propertyManager !== undefined,\n\t\t\t0xbd5 /* must have property manager to ack */,\n\t\t);\n\t\t// Let the propertyManager prune its pending change-properties set.\n\t\tthis.#props.propertyManager.ack(op.sequenceNumber, op.minimumSequenceNumber, {\n\t\t\tprops: newProps,\n\t\t});\n\t}\n}\n\nexport function createPositionReferenceFromSegoff({\n\tclient,\n\tsegoff,\n\trefType,\n\top,\n\tlocalSeq,\n\tfromSnapshot,\n\tslidingPreference,\n\tcanSlideToEndpoint,\n\trollback,\n}: {\n\tclient: Client;\n\tsegoff: { segment: ISegment; offset: number } | undefined | \"start\" | \"end\";\n\trefType: ReferenceType;\n\top?: ISequencedDocumentMessage;\n\tlocalSeq?: number;\n\tfromSnapshot?: boolean;\n\tslidingPreference: SlidingPreference | undefined;\n\tcanSlideToEndpoint: boolean | undefined;\n\trollback?: boolean;\n}): LocalReferencePosition {\n\tif (segoff === \"start\" || segoff === \"end\") {\n\t\treturn client.createLocalReferencePosition(\n\t\t\tsegoff,\n\t\t\tundefined,\n\t\t\trefType,\n\t\t\tundefined,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t}\n\n\tif (segoff?.segment) {\n\t\tconst ref = client.createLocalReferencePosition(\n\t\t\tsegoff.segment,\n\t\t\tsegoff.offset,\n\t\t\trefType,\n\t\t\tundefined,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t\treturn ref;\n\t}\n\n\t// Creating references on detached segments is allowed for:\n\t// - Transient segments\n\t// - References coming from a remote client (location may have been concurrently removed)\n\t// - References being rebased to a new sequence number\n\t// (segment they originally referred to may have been removed with no suitable replacement)\n\tif (\n\t\t!op &&\n\t\t!localSeq &&\n\t\t!fromSnapshot &&\n\t\t!refTypeIncludesFlag(refType, ReferenceType.Transient) &&\n\t\t!rollback\n\t) {\n\t\tthrow new UsageError(\"Non-transient references need segment\");\n\t}\n\n\treturn createDetachedLocalReferencePosition(slidingPreference, refType);\n}\n\n/**\n * Resolves a position to a {@link LocalReferencePosition} using an\n * {@link ISharedSegmentSequence} (no Client or op context needed).\n */\nexport function resolvePositionRef(\n\tsequence: ISharedSegmentSequence<any>,\n\tpos: number | \"start\" | \"end\",\n\trefType: ReferenceType,\n\tslidingPreference: SlidingPreference,\n\tcanSlideToEndpoint?: boolean,\n): LocalReferencePosition {\n\tif (pos === \"start\" || pos === \"end\") {\n\t\treturn sequence.createLocalReferencePosition(\n\t\t\tpos,\n\t\t\tundefined,\n\t\t\trefType,\n\t\t\tundefined,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t}\n\tconst segoff = sequence.getContainingSegment(pos);\n\tif (segoff?.segment !== undefined && segoff?.offset !== undefined) {\n\t\treturn sequence.createLocalReferencePosition(\n\t\t\tsegoff.segment,\n\t\t\tsegoff.offset,\n\t\t\trefType,\n\t\t\tundefined,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t}\n\treturn createDetachedLocalReferencePosition(slidingPreference, refType);\n}\n\nfunction createPositionReference({\n\tclient,\n\tpos,\n\trefType,\n\top,\n\tfromSnapshot,\n\tlocalSeq,\n\tslidingPreference,\n\tcanSlideToEndpoint,\n\trollback,\n}: {\n\tclient: Client;\n\tpos: number | \"start\" | \"end\";\n\trefType: ReferenceType;\n\top?: ISequencedDocumentMessage;\n\tfromSnapshot?: boolean;\n\tlocalSeq?: number;\n\tslidingPreference: SlidingPreference;\n\tcanSlideToEndpoint: boolean;\n\trollback?: boolean;\n}): LocalReferencePosition {\n\tlet segoff;\n\n\tif (op) {\n\t\tassert(\n\t\t\t(refType & ReferenceType.SlideOnRemove) !== 0,\n\t\t\t0x2f5 /* op create references must be SlideOnRemove */,\n\t\t);\n\t\tif (pos === \"start\" || pos === \"end\") {\n\t\t\tsegoff = pos;\n\t\t} else {\n\t\t\tsegoff = client.getContainingSegment(pos, {\n\t\t\t\treferenceSequenceNumber: op.referenceSequenceNumber,\n\t\t\t\tclientId: op.clientId,\n\t\t\t});\n\t\t\tsegoff = getSlideToSegoff(segoff, slidingPreference, undefined, canSlideToEndpoint);\n\t\t}\n\t} else {\n\t\tassert(\n\t\t\t(refType & ReferenceType.SlideOnRemove) === 0 || !!fromSnapshot,\n\t\t\t0x2f6 /* SlideOnRemove references must be op created */,\n\t\t);\n\t\tsegoff =\n\t\t\tpos === \"start\" || pos === \"end\"\n\t\t\t\t? pos\n\t\t\t\t: client.getContainingSegment(pos, undefined, localSeq);\n\t}\n\n\treturn createPositionReferenceFromSegoff({\n\t\tclient,\n\t\tsegoff,\n\t\trefType,\n\t\top,\n\t\tlocalSeq,\n\t\tfromSnapshot,\n\t\tslidingPreference,\n\t\tcanSlideToEndpoint,\n\t\trollback,\n\t});\n}\n\n/**\n * Creates a transient interval using an `ISharedSegmentSequence` instead of a `Client`.\n * This avoids coupling index classes to merge-tree internals.\n */\nexport function createTransientIntervalFromSequence(\n\tstart: SequencePlace | undefined,\n\tend: SequencePlace | undefined,\n\tsequence: ISharedSegmentSequence<any>,\n): BaseSequenceInterval {\n\tconst { startPos, startSide, endPos, endSide } = endpointPosAndSide(\n\t\tstart ?? \"start\",\n\t\tend ?? \"end\",\n\t);\n\tassert(\n\t\tstartPos !== undefined &&\n\t\t\tendPos !== undefined &&\n\t\t\tstartSide !== undefined &&\n\t\t\tendSide !== undefined,\n\t\t0xcda /* start and end cannot be undefined because they were not passed in as undefined */,\n\t);\n\n\tconst startSlidingPref = startReferenceSlidingPreference(\n\t\tstartPos,\n\t\tstartSide,\n\t\tendPos,\n\t\tendSide,\n\t);\n\tconst endSlidingPref = endReferenceSlidingPreference(startPos, startSide, endPos, endSide);\n\n\tconst startLref = resolvePositionRef(\n\t\tsequence,\n\t\tstartPos,\n\t\tReferenceType.Transient,\n\t\tstartSlidingPref,\n\t);\n\tconst endLref = resolvePositionRef(\n\t\tsequence,\n\t\tendPos,\n\t\tReferenceType.Transient,\n\t\tendSlidingPref,\n\t);\n\n\tconst rangeProp = {\n\t\t[reservedRangeLabelsKey]: [\"transient\"],\n\t};\n\tstartLref.addProperties(rangeProp);\n\tendLref.addProperties(rangeProp);\n\n\treturn new BaseSequenceInterval(\n\t\tuuid(),\n\t\tstartLref,\n\t\tendLref,\n\t\tIntervalType.Transient,\n\t\tstartSide,\n\t\tendSide,\n\t);\n}\n\nexport function createSequenceInterval(\n\tlabel: string,\n\tid: string,\n\tstart: SequencePlace | undefined,\n\tend: SequencePlace | undefined,\n\tclient: Client,\n\tintervalType: IntervalType,\n\top?: ISequencedDocumentMessage,\n\tfromSnapshot?: boolean,\n\tcanSlideToEndpoint: boolean = false,\n\tprops?: PropertySet,\n\trollback?: boolean,\n): SequenceIntervalClass {\n\tconst { startPos, startSide, endPos, endSide } = endpointPosAndSide(\n\t\tstart ?? \"start\",\n\t\tend ?? \"end\",\n\t);\n\tassert(\n\t\tstartPos !== undefined &&\n\t\t\tendPos !== undefined &&\n\t\t\tstartSide !== undefined &&\n\t\t\tendSide !== undefined,\n\t\t0x794 /* start and end cannot be undefined because they were not passed in as undefined */,\n\t);\n\tlet beginRefType = ReferenceType.RangeBegin;\n\tlet endRefType = ReferenceType.RangeEnd;\n\tif (intervalType === IntervalType.Transient) {\n\t\tbeginRefType = ReferenceType.Transient;\n\t\tendRefType = ReferenceType.Transient;\n\t} else {\n\t\t// All non-transient interval references must eventually be SlideOnRemove\n\t\t// To ensure eventual consistency, they must start as StayOnRemove when\n\t\t// pending (created locally and creation op is not acked)\n\t\tif (op ?? fromSnapshot) {\n\t\t\tbeginRefType |= ReferenceType.SlideOnRemove;\n\t\t\tendRefType |= ReferenceType.SlideOnRemove;\n\t\t} else {\n\t\t\tbeginRefType |= ReferenceType.StayOnRemove;\n\t\t\tendRefType |= ReferenceType.StayOnRemove;\n\t\t}\n\t}\n\n\tconst stickiness = computeStickinessFromSide(startPos, startSide, endPos, endSide);\n\n\tconst startSlidingPreference = startReferenceSlidingPreference(\n\t\tstartPos,\n\t\tstartSide,\n\t\tendPos,\n\t\tendSide,\n\t);\n\n\tconst endSlidingPreference = endReferenceSlidingPreference(\n\t\tstartPos,\n\t\tstartSide,\n\t\tendPos,\n\t\tendSide,\n\t);\n\n\tconst startLref = createPositionReference({\n\t\tclient,\n\t\tpos: startPos,\n\t\trefType: beginRefType,\n\t\top,\n\t\tfromSnapshot,\n\t\tslidingPreference: startSlidingPreference,\n\t\tcanSlideToEndpoint: canSlideToEndpoint && stickiness !== IntervalStickiness.NONE,\n\t\trollback,\n\t});\n\n\tconst endLref = createPositionReference({\n\t\tclient,\n\t\tpos: endPos,\n\t\trefType: endRefType,\n\t\top,\n\t\tfromSnapshot,\n\t\tslidingPreference: endSlidingPreference,\n\t\tcanSlideToEndpoint: canSlideToEndpoint && stickiness !== IntervalStickiness.NONE,\n\t\trollback,\n\t});\n\n\tconst rangeProp = {\n\t\t[reservedRangeLabelsKey]: [label],\n\t};\n\tstartLref.addProperties(rangeProp);\n\tendLref.addProperties(rangeProp);\n\n\tconst ival = new SequenceIntervalClass(\n\t\tclient,\n\t\tid,\n\t\tlabel,\n\t\tstartLref,\n\t\tendLref,\n\t\tintervalType,\n\t\tprops === undefined\n\t\t\t? undefined\n\t\t\t: { ...props, [reservedIntervalIdKey]: undefined, [reservedRangeLabelsKey]: undefined },\n\t\tstartSide,\n\t\tendSide,\n\t);\n\treturn ival;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sequenceInterval.js","sourceRoot":"","sources":["../../src/intervals/sequenceInterval.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;AAKH,kEAA6D;AAS7D,kEAkB6C;AAC7C,uEAAoF;AACpF,+BAAkC;AAKlC,yDAQ4B;AAE5B,SAAS,YAAY,CAAC,KAAW,EAAE,KAAW;IAC7C,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QACrB,OAAO,CAAC,CAAC;IACV,CAAC;IAED,IAAI,KAAK,KAAK,eAAI,CAAC,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,CAAC;IACV,CAAC;IAED,OAAO,CAAC,CAAC,CAAC;AACX,CAAC;AAED,SAAS,OAAO,CAAC,KAAW,EAAE,KAAW;IACxC,IAAI,KAAK,KAAK,eAAI,CAAC,KAAK,IAAI,KAAK,KAAK,eAAI,CAAC,KAAK,EAAE,CAAC;QAClD,OAAO,eAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAED,OAAO,eAAI,CAAC,MAAM,CAAC;AACpB,CAAC;AAED,SAAS,OAAO,CAAC,KAAW,EAAE,KAAW;IACxC,IAAI,KAAK,KAAK,eAAI,CAAC,MAAM,IAAI,KAAK,KAAK,eAAI,CAAC,MAAM,EAAE,CAAC;QACpD,OAAO,eAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED,OAAO,eAAI,CAAC,KAAK,CAAC;AACnB,CAAC;AAED,MAAM,qBAAqB,GAAG,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EAAE,SAAS,EAAE,CAAC,iCAAsB,CAAC,EAAE,SAAS,EAAE,EACxF,SAAS,EACT,OAAO,CACP,CAAC;IACF,OAAO,IAAI,CAAC;AACb,CAAC;AApGD,wDAoGC","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 type { IDisposable } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport type {\n\tClient,\n\tISegment,\n\tLocalReferencePosition,\n\tPropertySet,\n\tSequencePlace,\n} from \"@fluidframework/merge-tree/internal\";\nimport {\n\tPropertiesManager,\n\tReferenceType,\n\tSlidingPreference,\n\tcompareReferencePositions,\n\tcreateDetachedLocalReferencePosition,\n\tcreateMap,\n\tgetSlideToSegoff,\n\tmaxReferencePosition,\n\tminReferencePosition,\n\trefTypeIncludesFlag,\n\treservedRangeLabelsKey,\n\tSide,\n\tendpointPosAndSide,\n\taddProperties,\n\ttype ISegmentInternal,\n\tUnassignedSequenceNumber,\n\tUniversalSequenceNumber,\n} from \"@fluidframework/merge-tree/internal\";\nimport { LoggingError, UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport type { ISharedSegmentSequence } from \"../sequence.js\";\n\nimport type { ISerializableInterval, ISerializedInterval } from \"./intervalUtils.js\";\nimport {\n\tIntervalStickiness,\n\tIntervalType,\n\tcomputeStickinessFromSide,\n\tendReferenceSlidingPreference,\n\tstartReferenceSlidingPreference,\n\ttype IInterval,\n\ttype SerializedIntervalDelta,\n} from \"./intervalUtils.js\";\n\nfunction compareSides(sideA: Side, sideB: Side): number {\n\tif (sideA === sideB) {\n\t\treturn 0;\n\t}\n\n\tif (sideA === Side.Before) {\n\t\treturn 1;\n\t}\n\n\treturn -1;\n}\n\nfunction minSide(sideA: Side, sideB: Side): Side {\n\tif (sideA === Side.After && sideB === Side.After) {\n\t\treturn Side.After;\n\t}\n\n\treturn Side.Before;\n}\n\nfunction maxSide(sideA: Side, sideB: Side): Side {\n\tif (sideA === Side.Before && sideB === Side.Before) {\n\t\treturn Side.Before;\n\t}\n\n\treturn Side.After;\n}\n\nconst reservedIntervalIdKey = \"intervalId\";\n\nconst legacyIdPrefix = \"legacy\";\n\nexport function getSerializedProperties(\n\tserializedInterval: ISerializedInterval | SerializedIntervalDelta,\n): {\n\tid: string;\n\tlabels: string[];\n\tproperties: PropertySet;\n} {\n\tconst {\n\t\t[reservedIntervalIdKey]: maybeId,\n\t\t[reservedRangeLabelsKey]: labels,\n\t\t...properties\n\t} = serializedInterval.properties ?? {};\n\t// Create a non-unique ID based on start and end to be used on intervals that come from legacy clients\n\t// without ID's.\n\tconst id =\n\t\tmaybeId ?? `${legacyIdPrefix}${serializedInterval.start}-${serializedInterval.end}`;\n\n\treturn { id, labels, properties };\n}\n\n/**\n * Interval implementation whose ends are associated with positions in a mutatable sequence.\n * As such, when content is inserted into the middle of the interval, the interval expands to\n * include that content.\n *\n * @remarks The endpoints' positions should be treated exclusively to get\n * reasonable behavior. E.g., an interval referring to \"hello\" in \"hello world\"\n * should have a start position of 0 and an end position of 5.\n *\n * To see why, consider what happens if \"llo wor\" is removed from the string to make \"held\".\n * The interval's startpoint remains on the \"h\" (it isn't altered), but the interval's endpoint\n * slides forward to the next unremoved position, which is the \"l\" in \"held\".\n * Users would generally expect the interval to now refer to \"he\" (as it is the subset of content\n * remaining after the removal), hence the \"l\" should be excluded.\n * If the interval endpoint was treated inclusively, the interval would now refer to \"hel\", which\n * is undesirable.\n *\n * Since the endpoints of an interval are treated exclusively but cannot be greater\n * than or equal to the length of the associated sequence, there exist special\n * endpoint segments, \"start\" and \"end\", which represent the position immediately\n * before or immediately after the string respectively.\n *\n * If a `SequenceInterval` is created on a sequence with the\n * `mergeTreeReferencesCanSlideToEndpoint` feature flag set to true, the endpoints\n * of the interval that are exclusive will have the ability to slide to these\n * special endpoint segments.\n * @legacy @beta\n */\nexport interface SequenceInterval extends IInterval {\n\treadonly start: LocalReferencePosition;\n\t/**\n\t * End endpoint of this interval.\n\t * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.\n\t */\n\treadonly end: LocalReferencePosition;\n\treadonly intervalType: IntervalType;\n\treadonly startSide: Side;\n\treadonly endSide: Side;\n\treadonly stickiness: IntervalStickiness;\n\n\t/** Serializable bag of properties associated with the interval. */\n\tproperties: PropertySet;\n\n\t/**\n\t * Compares this interval to `b` with standard comparator semantics:\n\t * - returns -1 if this is less than `b`\n\t * - returns 1 if this is greater than `b`\n\t * - returns 0 if this is equivalent to `b`\n\t * @param b - Interval to compare against\n\t */\n\tcompare(b: SequenceInterval): number;\n\t/**\n\t * Compares the start endpoint of this interval to `b`'s start endpoint.\n\t * Standard comparator semantics apply.\n\t * @param b - Interval to compare against\n\t */\n\tcompareStart(b: SequenceInterval): number;\n\t/**\n\t * Compares the end endpoint of this interval to `b`'s end endpoint.\n\t * Standard comparator semantics apply.\n\t * @param b - Interval to compare against\n\t */\n\tcompareEnd(b: SequenceInterval): number;\n\n\t/**\n\t * @returns whether this interval overlaps with `b`.\n\t * Intervals are considered to overlap if their intersection is non-empty.\n\t */\n\toverlaps(b: SequenceInterval): boolean;\n\n\t/**\n\t * @returns whether this interval overlaps two numerical positions.\n\t */\n\toverlapsPos(bstart: number, bend: number): boolean;\n\n\t/**\n\t * Gets the id associated with this interval.\n\t * When the interval is used as part of an interval collection, this id can be used to modify or remove the\n\t * interval.\n\t */\n\tgetIntervalId(): string;\n}\n\n/**\n * Lightweight interval for index queries (overlap, comparison).\n * Has no Client dependency; cannot serialize or be disposed.\n */\nexport class BaseSequenceInterval implements SequenceInterval, ISerializableInterval {\n\treadonly #id: string;\n\treadonly #properties: PropertySet = createMap<any>();\n\n\tconstructor(\n\t\tid: string,\n\t\t/**\n\t\t * Start endpoint of this interval.\n\t\t * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.\n\t\t */\n\t\tpublic start: LocalReferencePosition,\n\t\t/**\n\t\t * End endpoint of this interval.\n\t\t * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.\n\t\t */\n\t\tpublic end: LocalReferencePosition,\n\t\tpublic intervalType: IntervalType,\n\t\tpublic readonly startSide: Side = Side.Before,\n\t\tpublic readonly endSide: Side = Side.Before,\n\t) {\n\t\tthis.#id = id;\n\t}\n\n\tpublic get properties(): Readonly<PropertySet> {\n\t\treturn this.#properties;\n\t}\n\n\t/***/\n\tpublic get stickiness(): IntervalStickiness {\n\t\tthis.verifyNotDispose();\n\n\t\tconst startSegment: ISegmentInternal | undefined = this.start.getSegment();\n\t\tconst endSegment: ISegmentInternal | undefined = this.end.getSegment();\n\t\treturn computeStickinessFromSide(\n\t\t\tstartSegment?.endpointType,\n\t\t\tthis.startSide,\n\t\t\tendSegment?.endpointType,\n\t\t\tthis.endSide,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ISerializableInterval.getIntervalId}\n\t */\n\tpublic getIntervalId(): string {\n\t\treturn this.#id;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.compare}\n\t */\n\tpublic compare(b: SequenceInterval) {\n\t\tconst startResult = this.compareStart(b);\n\t\tif (startResult === 0) {\n\t\t\tconst endResult = this.compareEnd(b);\n\t\t\tif (endResult === 0) {\n\t\t\t\tconst thisId = this.getIntervalId();\n\t\t\t\tif (thisId) {\n\t\t\t\t\tconst bId = b.getIntervalId();\n\t\t\t\t\tif (bId) {\n\t\t\t\t\t\treturn thisId > bId ? 1 : thisId < bId ? -1 : 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn endResult;\n\t\t\t}\n\t\t} else {\n\t\t\treturn startResult;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.compareStart}\n\t */\n\tpublic compareStart(b: SequenceInterval) {\n\t\tthis.verifyNotDispose();\n\n\t\tconst dist = compareReferencePositions(this.start, b.start);\n\n\t\tif (dist === 0) {\n\t\t\treturn compareSides(this.startSide, b.startSide);\n\t\t}\n\n\t\treturn dist;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.compareEnd}\n\t */\n\tpublic compareEnd(b: SequenceInterval): number {\n\t\tthis.verifyNotDispose();\n\n\t\tconst dist = compareReferencePositions(this.end, b.end);\n\n\t\tif (dist === 0) {\n\t\t\treturn compareSides(b.endSide, this.endSide);\n\t\t}\n\n\t\treturn dist;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.overlaps}\n\t */\n\tpublic overlaps(b: SequenceInterval) {\n\t\tthis.verifyNotDispose();\n\n\t\tconst result =\n\t\t\tcompareReferencePositions(this.start, b.end) <= 0 &&\n\t\t\tcompareReferencePositions(this.end, b.start) >= 0;\n\t\treturn result;\n\t}\n\n\t/**\n\t * Whether this interval overlaps the provided numerical positions.\n\t */\n\tpublic overlapsPos(_bstart: number, _bend: number): boolean {\n\t\tassert(false, 0xcd7 /* overlapsPos not supported on BaseSequenceInterval */);\n\t}\n\n\tpublic clone(): BaseSequenceInterval {\n\t\tassert(false, 0xcd8 /* clone not supported on BaseSequenceInterval */);\n\t}\n\n\tpublic union(_b: BaseSequenceInterval): BaseSequenceInterval {\n\t\tassert(false, 0xcd9 /* union not supported on BaseSequenceInterval */);\n\t}\n\n\tprotected verifyNotDispose(): void {\n\t\t// No-op: transient intervals are not disposable.\n\t}\n}\n\nexport class SequenceIntervalClass\n\textends BaseSequenceInterval\n\timplements ISerializableInterval, IDisposable\n{\n\treadonly #props: {\n\t\tpropertyManager?: PropertiesManager;\n\t\tproperties: PropertySet;\n\t} = { properties: createMap<any>() };\n\n\t/**\n\t * {@inheritDoc ISerializableInterval.properties}\n\t */\n\tpublic override get properties(): Readonly<PropertySet> {\n\t\tthis.verifyNotDispose();\n\t\treturn this.#props.properties;\n\t}\n\n\tpublic changeProperties(\n\t\tprops: PropertySet | undefined,\n\t\top?: ISequencedDocumentMessage,\n\t\trollback?: boolean,\n\t) {\n\t\tthis.verifyNotDispose();\n\n\t\tif (props !== undefined) {\n\t\t\tthis.#props.propertyManager ??= new PropertiesManager();\n\t\t\treturn this.#props.propertyManager.handleProperties(\n\t\t\t\t{ props },\n\t\t\t\tthis.#props,\n\t\t\t\tthis.client.getCollabWindow().collaborating\n\t\t\t\t\t? (op?.sequenceNumber ?? UnassignedSequenceNumber)\n\t\t\t\t\t: UniversalSequenceNumber,\n\t\t\t\top?.minimumSequenceNumber ?? UniversalSequenceNumber,\n\t\t\t\tthis.client.getCollabWindow().collaborating,\n\t\t\t\trollback,\n\t\t\t);\n\t\t}\n\t}\n\n\tconstructor(\n\t\tprivate readonly client: Client,\n\t\tid: string,\n\t\tprivate readonly label: string,\n\t\tstart: LocalReferencePosition,\n\t\tend: LocalReferencePosition,\n\t\tintervalType: IntervalType,\n\t\tprops?: PropertySet,\n\t\tstartSide: Side = Side.Before,\n\t\tendSide: Side = Side.Before,\n\t) {\n\t\tsuper(id, start, end, intervalType, startSide, endSide);\n\t\tif (props) {\n\t\t\tthis.#props.properties = addProperties(this.#props.properties, props);\n\t\t}\n\t}\n\t#disposed = false;\n\tpublic get disposed() {\n\t\treturn this.#disposed;\n\t}\n\tpublic dispose(error?: Error): void {\n\t\tif (this.#disposed) return;\n\t\tthis.#disposed = true;\n\t\tthis.client.removeLocalReferencePosition(this.start);\n\t\tthis.client.removeLocalReferencePosition(this.end);\n\t\tthis.removePositionChangeListeners();\n\t\tthis.#props.propertyManager = undefined;\n\t}\n\n\tprotected override verifyNotDispose() {\n\t\tif (this.#disposed) {\n\t\t\tthrow new LoggingError(\"Invalid interval access after dispose\");\n\t\t}\n\t}\n\n\tprivate callbacks?: Record<\"beforePositionChange\" | \"afterPositionChange\", () => void>;\n\n\t/**\n\t * Subscribes to position change events on this interval if there are no current listeners.\n\t */\n\tpublic addPositionChangeListeners(\n\t\tbeforePositionChange: () => void,\n\t\tafterPositionChange: () => void,\n\t): void {\n\t\tthis.verifyNotDispose();\n\t\tif (this.callbacks === undefined) {\n\t\t\tthis.callbacks = {\n\t\t\t\tbeforePositionChange,\n\t\t\t\tafterPositionChange,\n\t\t\t};\n\n\t\t\tconst startCbs = (this.start.callbacks ??= {});\n\t\t\tconst endCbs = (this.end.callbacks ??= {});\n\t\t\tstartCbs.beforeSlide = endCbs.beforeSlide = beforePositionChange;\n\t\t\tstartCbs.afterSlide = endCbs.afterSlide = afterPositionChange;\n\t\t}\n\t}\n\n\t/**\n\t * Removes the currently subscribed position change listeners.\n\t */\n\tpublic removePositionChangeListeners(): void {\n\t\tif (this.callbacks) {\n\t\t\tthis.callbacks = undefined;\n\t\t\tthis.start.callbacks = undefined;\n\t\t\tthis.end.callbacks = undefined;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc ISerializableInterval.serialize}\n\t */\n\tpublic serialize(): ISerializedInterval {\n\t\tthis.verifyNotDispose();\n\n\t\treturn this.serializeDelta({\n\t\t\tprops: this.properties,\n\t\t\tincludeEndpoints: true,\n\t\t}) as ISerializedInterval;\n\t}\n\n\tpublic serializeDelta({\n\t\tprops,\n\t\tincludeEndpoints,\n\t}: {\n\t\tprops: PropertySet | undefined;\n\t\tincludeEndpoints: boolean;\n\t}): SerializedIntervalDelta {\n\t\tthis.verifyNotDispose();\n\n\t\tconst startSegment: ISegmentInternal | undefined = this.start.getSegment();\n\t\tconst endSegment: ISegmentInternal | undefined = this.end.getSegment();\n\t\tconst startPosition = includeEndpoints\n\t\t\t? (startSegment?.endpointType ??\n\t\t\t\tthis.client.localReferencePositionToPosition(this.start))\n\t\t\t: undefined;\n\t\tconst endPosition = includeEndpoints\n\t\t\t? (endSegment?.endpointType ?? this.client.localReferencePositionToPosition(this.end))\n\t\t\t: undefined;\n\t\treturn {\n\t\t\tend: endPosition,\n\t\t\tintervalType: this.intervalType,\n\t\t\tsequenceNumber: this.client.getCurrentSeq(),\n\t\t\tstart: startPosition,\n\t\t\tstickiness: this.stickiness,\n\t\t\tstartSide: includeEndpoints ? this.startSide : undefined,\n\t\t\tendSide: includeEndpoints ? this.endSide : undefined,\n\t\t\tproperties: {\n\t\t\t\t...props,\n\t\t\t\t[reservedIntervalIdKey]: this.getIntervalId(),\n\t\t\t\t[reservedRangeLabelsKey]: [this.label],\n\t\t\t},\n\t\t} satisfies SerializedIntervalDelta;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.clone}\n\t */\n\tpublic clone(): SequenceIntervalClass {\n\t\tthis.verifyNotDispose();\n\n\t\treturn new SequenceIntervalClass(\n\t\t\tthis.client,\n\t\t\tthis.getIntervalId(),\n\t\t\tthis.label,\n\t\t\tthis.start,\n\t\t\tthis.end,\n\t\t\tthis.intervalType,\n\t\t\tthis.properties,\n\t\t\tthis.startSide,\n\t\t\tthis.endSide,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.union}\n\t */\n\tpublic union(b: SequenceIntervalClass) {\n\t\tthis.verifyNotDispose();\n\n\t\tconst newStart = minReferencePosition(this.start, b.start);\n\t\tconst newEnd = maxReferencePosition(this.end, b.end);\n\n\t\tlet startSide: Side;\n\n\t\tif (this.start === b.start) {\n\t\t\tstartSide = minSide(this.startSide, b.startSide);\n\t\t} else {\n\t\t\tstartSide = this.start === newStart ? this.startSide : b.startSide;\n\t\t}\n\n\t\tlet endSide: Side;\n\n\t\tif (this.end === b.end) {\n\t\t\tendSide = maxSide(this.endSide, b.endSide);\n\t\t} else {\n\t\t\tendSide = this.end === newEnd ? this.endSide : b.endSide;\n\t\t}\n\n\t\treturn new SequenceIntervalClass(\n\t\t\tthis.client,\n\t\t\tuuid(),\n\t\t\tthis.label,\n\t\t\tnewStart,\n\t\t\tnewEnd,\n\t\t\tthis.intervalType,\n\t\t\tundefined,\n\t\t\tstartSide,\n\t\t\tendSide,\n\t\t);\n\t}\n\n\t/**\n\t * Whether this interval overlaps the provided numerical positions.\n\t */\n\tpublic override overlapsPos(bstart: number, bend: number) {\n\t\tthis.verifyNotDispose();\n\n\t\tconst startPos = this.client.localReferencePositionToPosition(this.start);\n\t\tconst endPos = this.client.localReferencePositionToPosition(this.end);\n\t\treturn endPos > bstart && startPos < bend;\n\t}\n\n\tpublic moveEndpointReferences(\n\t\trebased: Record<\"start\" | \"end\", { segment: ISegment; offset: number }>,\n\t) {\n\t\tthis.verifyNotDispose();\n\n\t\tconst startRef = createPositionReferenceFromSegoff({\n\t\t\tclient: this.client,\n\t\t\tsegoff: rebased.start,\n\t\t\trefType: this.start.refType,\n\t\t\tslidingPreference: this.start.slidingPreference,\n\t\t\tcanSlideToEndpoint: this.start.canSlideToEndpoint,\n\t\t});\n\t\tif (this.start.properties) {\n\t\t\tstartRef.addProperties(this.start.properties);\n\t\t}\n\t\tthis.start = startRef;\n\n\t\tconst endRef = createPositionReferenceFromSegoff({\n\t\t\tclient: this.client,\n\t\t\tsegoff: rebased.end,\n\t\t\trefType: this.end.refType,\n\t\t\tslidingPreference: this.end.slidingPreference,\n\t\t\tcanSlideToEndpoint: this.end.canSlideToEndpoint,\n\t\t});\n\t\tif (this.end.properties) {\n\t\t\tendRef.addProperties(this.end.properties);\n\t\t}\n\t\tthis.end = endRef;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.modify}\n\t */\n\tpublic modify(\n\t\tlabel: string,\n\t\tstart: SequencePlace | undefined,\n\t\tend: SequencePlace | undefined,\n\t\top?: ISequencedDocumentMessage,\n\t\tlocalSeq?: number,\n\t\tcanSlideToEndpoint: boolean = false,\n\t) {\n\t\tthis.verifyNotDispose();\n\n\t\tconst { startSide, endSide, startPos, endPos } = endpointPosAndSide(start, end);\n\t\tconst getRefType = (baseType: ReferenceType): ReferenceType => {\n\t\t\tlet refType = baseType;\n\t\t\tif (op === undefined) {\n\t\t\t\trefType &= ~ReferenceType.SlideOnRemove;\n\t\t\t\trefType |= ReferenceType.StayOnRemove;\n\t\t\t} else {\n\t\t\t\trefType &= ~ReferenceType.StayOnRemove;\n\t\t\t\trefType |= ReferenceType.SlideOnRemove;\n\t\t\t}\n\t\t\treturn refType;\n\t\t};\n\n\t\tlet startRef = this.start;\n\t\tif (startPos !== undefined) {\n\t\t\tconst slidingPreference = startReferenceSlidingPreference(\n\t\t\t\tstartPos,\n\t\t\t\tstartSide ?? Side.Before,\n\t\t\t\tendPos,\n\t\t\t\tendSide ?? Side.Before,\n\t\t\t);\n\t\t\tstartRef = createPositionReference({\n\t\t\t\tclient: this.client,\n\t\t\t\tpos: startPos,\n\t\t\t\trefType: getRefType(this.start.refType),\n\t\t\t\top,\n\t\t\t\tlocalSeq,\n\t\t\t\tslidingPreference,\n\t\t\t\tcanSlideToEndpoint:\n\t\t\t\t\tcanSlideToEndpoint && slidingPreference === SlidingPreference.BACKWARD,\n\t\t\t});\n\t\t\tif (this.start.properties) {\n\t\t\t\tstartRef.addProperties(this.start.properties);\n\t\t\t}\n\t\t}\n\n\t\tlet endRef = this.end;\n\t\tif (endPos !== undefined) {\n\t\t\tconst slidingPreference = endReferenceSlidingPreference(\n\t\t\t\tstartPos,\n\t\t\t\tstartSide ?? Side.Before,\n\t\t\t\tendPos,\n\t\t\t\tendSide ?? Side.Before,\n\t\t\t);\n\t\t\tendRef = createPositionReference({\n\t\t\t\tclient: this.client,\n\t\t\t\tpos: endPos,\n\t\t\t\trefType: getRefType(this.end.refType),\n\t\t\t\top,\n\t\t\t\tlocalSeq,\n\t\t\t\tslidingPreference,\n\t\t\t\tcanSlideToEndpoint:\n\t\t\t\t\tcanSlideToEndpoint && slidingPreference === SlidingPreference.FORWARD,\n\t\t\t});\n\t\t\tif (this.end.properties) {\n\t\t\t\tendRef.addProperties(this.end.properties);\n\t\t\t}\n\t\t}\n\n\t\tconst newInterval = new SequenceIntervalClass(\n\t\t\tthis.client,\n\t\t\tthis.getIntervalId(),\n\t\t\tthis.label,\n\t\t\tstartRef,\n\t\t\tendRef,\n\t\t\tthis.intervalType,\n\t\t\tundefined,\n\t\t\tstartSide ?? this.startSide,\n\t\t\tendSide ?? this.endSide,\n\t\t);\n\t\tnewInterval.#props.propertyManager = this.#props.propertyManager ??=\n\t\t\tnew PropertiesManager();\n\t\tnewInterval.#props.properties = this.#props.properties;\n\t\treturn newInterval;\n\t}\n\n\tpublic ackPropertiesChange(newProps: PropertySet, op: ISequencedDocumentMessage) {\n\t\tthis.verifyNotDispose();\n\n\t\tif (Object.keys(newProps).length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tassert(\n\t\t\tthis.#props.propertyManager !== undefined,\n\t\t\t0xbd5 /* must have property manager to ack */,\n\t\t);\n\t\t// Let the propertyManager prune its pending change-properties set.\n\t\tthis.#props.propertyManager.ack(op.sequenceNumber, op.minimumSequenceNumber, {\n\t\t\tprops: newProps,\n\t\t});\n\t}\n}\n\nexport function createPositionReferenceFromSegoff({\n\tclient,\n\tsegoff,\n\trefType,\n\top,\n\tlocalSeq,\n\tfromSnapshot,\n\tslidingPreference,\n\tcanSlideToEndpoint,\n\trollback,\n}: {\n\tclient: Client;\n\tsegoff: { segment: ISegment; offset: number } | undefined | \"start\" | \"end\";\n\trefType: ReferenceType;\n\top?: ISequencedDocumentMessage;\n\tlocalSeq?: number;\n\tfromSnapshot?: boolean;\n\tslidingPreference: SlidingPreference | undefined;\n\tcanSlideToEndpoint: boolean | undefined;\n\trollback?: boolean;\n}): LocalReferencePosition {\n\tif (segoff === \"start\" || segoff === \"end\") {\n\t\treturn client.createLocalReferencePosition(\n\t\t\tsegoff,\n\t\t\tundefined,\n\t\t\trefType,\n\t\t\tundefined,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t}\n\n\tif (segoff?.segment) {\n\t\tconst ref = client.createLocalReferencePosition(\n\t\t\tsegoff.segment,\n\t\t\tsegoff.offset,\n\t\t\trefType,\n\t\t\tundefined,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t\treturn ref;\n\t}\n\n\t// Creating references on detached segments is allowed for:\n\t// - Transient segments\n\t// - References coming from a remote client (location may have been concurrently removed)\n\t// - References being rebased to a new sequence number\n\t// (segment they originally referred to may have been removed with no suitable replacement)\n\tif (\n\t\t!op &&\n\t\t!localSeq &&\n\t\t!fromSnapshot &&\n\t\t!refTypeIncludesFlag(refType, ReferenceType.Transient) &&\n\t\t!rollback\n\t) {\n\t\tthrow new UsageError(\"Non-transient references need segment\");\n\t}\n\n\treturn createDetachedLocalReferencePosition(slidingPreference, refType);\n}\n\n/**\n * Resolves a position to a {@link LocalReferencePosition} using an\n * {@link ISharedSegmentSequence} (no Client or op context needed).\n */\nexport function resolvePositionRef(\n\tsequence: ISharedSegmentSequence<any>,\n\tpos: number | \"start\" | \"end\",\n\trefType: ReferenceType,\n\tslidingPreference: SlidingPreference,\n\tcanSlideToEndpoint?: boolean,\n): LocalReferencePosition {\n\tif (pos === \"start\" || pos === \"end\") {\n\t\treturn sequence.createLocalReferencePosition(\n\t\t\tpos,\n\t\t\tundefined,\n\t\t\trefType,\n\t\t\tundefined,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t}\n\tconst segoff = sequence.getContainingSegment(pos);\n\tif (segoff?.segment !== undefined && segoff?.offset !== undefined) {\n\t\treturn sequence.createLocalReferencePosition(\n\t\t\tsegoff.segment,\n\t\t\tsegoff.offset,\n\t\t\trefType,\n\t\t\tundefined,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t}\n\treturn createDetachedLocalReferencePosition(slidingPreference, refType);\n}\n\nfunction createPositionReference({\n\tclient,\n\tpos,\n\trefType,\n\top,\n\tfromSnapshot,\n\tlocalSeq,\n\tslidingPreference,\n\tcanSlideToEndpoint,\n\trollback,\n}: {\n\tclient: Client;\n\tpos: number | \"start\" | \"end\";\n\trefType: ReferenceType;\n\top?: ISequencedDocumentMessage;\n\tfromSnapshot?: boolean;\n\tlocalSeq?: number;\n\tslidingPreference: SlidingPreference;\n\tcanSlideToEndpoint: boolean;\n\trollback?: boolean;\n}): LocalReferencePosition {\n\tlet segoff;\n\n\tif (op) {\n\t\tassert(\n\t\t\t(refType & ReferenceType.SlideOnRemove) !== 0,\n\t\t\t0x2f5 /* op create references must be SlideOnRemove */,\n\t\t);\n\t\tif (pos === \"start\" || pos === \"end\") {\n\t\t\tsegoff = pos;\n\t\t} else {\n\t\t\tsegoff = client.getContainingSegment(pos, {\n\t\t\t\treferenceSequenceNumber: op.referenceSequenceNumber,\n\t\t\t\tclientId: op.clientId,\n\t\t\t});\n\t\t\tsegoff = getSlideToSegoff(segoff, slidingPreference, undefined, canSlideToEndpoint);\n\t\t}\n\t} else {\n\t\tassert(\n\t\t\t(refType & ReferenceType.SlideOnRemove) === 0 || !!fromSnapshot,\n\t\t\t0x2f6 /* SlideOnRemove references must be op created */,\n\t\t);\n\t\tsegoff =\n\t\t\tpos === \"start\" || pos === \"end\"\n\t\t\t\t? pos\n\t\t\t\t: client.getContainingSegment(pos, undefined, localSeq);\n\t}\n\n\treturn createPositionReferenceFromSegoff({\n\t\tclient,\n\t\tsegoff,\n\t\trefType,\n\t\top,\n\t\tlocalSeq,\n\t\tfromSnapshot,\n\t\tslidingPreference,\n\t\tcanSlideToEndpoint,\n\t\trollback,\n\t});\n}\n\n/**\n * Creates a transient interval using an `ISharedSegmentSequence` instead of a `Client`.\n * This avoids coupling index classes to merge-tree internals.\n */\nexport function createTransientIntervalFromSequence(\n\tstart: SequencePlace | undefined,\n\tend: SequencePlace | undefined,\n\tsequence: ISharedSegmentSequence<any>,\n): BaseSequenceInterval {\n\tconst { startPos, startSide, endPos, endSide } = endpointPosAndSide(\n\t\tstart ?? \"start\",\n\t\tend ?? \"end\",\n\t);\n\tassert(\n\t\tstartPos !== undefined &&\n\t\t\tendPos !== undefined &&\n\t\t\tstartSide !== undefined &&\n\t\t\tendSide !== undefined,\n\t\t0xcda /* start and end cannot be undefined because they were not passed in as undefined */,\n\t);\n\n\tconst startSlidingPref = startReferenceSlidingPreference(\n\t\tstartPos,\n\t\tstartSide,\n\t\tendPos,\n\t\tendSide,\n\t);\n\tconst endSlidingPref = endReferenceSlidingPreference(startPos, startSide, endPos, endSide);\n\n\tconst startLref = resolvePositionRef(\n\t\tsequence,\n\t\tstartPos,\n\t\tReferenceType.Transient,\n\t\tstartSlidingPref,\n\t);\n\tconst endLref = resolvePositionRef(\n\t\tsequence,\n\t\tendPos,\n\t\tReferenceType.Transient,\n\t\tendSlidingPref,\n\t);\n\n\tconst rangeProp = {\n\t\t[reservedRangeLabelsKey]: [\"transient\"],\n\t};\n\tstartLref.addProperties(rangeProp);\n\tendLref.addProperties(rangeProp);\n\n\treturn new BaseSequenceInterval(\n\t\tuuid(),\n\t\tstartLref,\n\t\tendLref,\n\t\tIntervalType.Transient,\n\t\tstartSide,\n\t\tendSide,\n\t);\n}\n\nexport function createSequenceInterval(\n\tlabel: string,\n\tid: string,\n\tstart: SequencePlace | undefined,\n\tend: SequencePlace | undefined,\n\tclient: Client,\n\tintervalType: IntervalType,\n\top?: ISequencedDocumentMessage,\n\tfromSnapshot?: boolean,\n\tcanSlideToEndpoint: boolean = false,\n\tprops?: PropertySet,\n\trollback?: boolean,\n): SequenceIntervalClass {\n\tconst { startPos, startSide, endPos, endSide } = endpointPosAndSide(\n\t\tstart ?? \"start\",\n\t\tend ?? \"end\",\n\t);\n\tassert(\n\t\tstartPos !== undefined &&\n\t\t\tendPos !== undefined &&\n\t\t\tstartSide !== undefined &&\n\t\t\tendSide !== undefined,\n\t\t0x794 /* start and end cannot be undefined because they were not passed in as undefined */,\n\t);\n\tlet beginRefType = ReferenceType.RangeBegin;\n\tlet endRefType = ReferenceType.RangeEnd;\n\tif (intervalType === IntervalType.Transient) {\n\t\tbeginRefType = ReferenceType.Transient;\n\t\tendRefType = ReferenceType.Transient;\n\t} else {\n\t\t// All non-transient interval references must eventually be SlideOnRemove\n\t\t// To ensure eventual consistency, they must start as StayOnRemove when\n\t\t// pending (created locally and creation op is not acked)\n\t\tif (op ?? fromSnapshot) {\n\t\t\tbeginRefType |= ReferenceType.SlideOnRemove;\n\t\t\tendRefType |= ReferenceType.SlideOnRemove;\n\t\t} else {\n\t\t\tbeginRefType |= ReferenceType.StayOnRemove;\n\t\t\tendRefType |= ReferenceType.StayOnRemove;\n\t\t}\n\t}\n\n\tconst stickiness = computeStickinessFromSide(startPos, startSide, endPos, endSide);\n\n\tconst startSlidingPreference = startReferenceSlidingPreference(\n\t\tstartPos,\n\t\tstartSide,\n\t\tendPos,\n\t\tendSide,\n\t);\n\n\tconst endSlidingPreference = endReferenceSlidingPreference(\n\t\tstartPos,\n\t\tstartSide,\n\t\tendPos,\n\t\tendSide,\n\t);\n\n\tconst startLref = createPositionReference({\n\t\tclient,\n\t\tpos: startPos,\n\t\trefType: beginRefType,\n\t\top,\n\t\tfromSnapshot,\n\t\tslidingPreference: startSlidingPreference,\n\t\tcanSlideToEndpoint: canSlideToEndpoint && stickiness !== IntervalStickiness.NONE,\n\t\trollback,\n\t});\n\n\tconst endLref = createPositionReference({\n\t\tclient,\n\t\tpos: endPos,\n\t\trefType: endRefType,\n\t\top,\n\t\tfromSnapshot,\n\t\tslidingPreference: endSlidingPreference,\n\t\tcanSlideToEndpoint: canSlideToEndpoint && stickiness !== IntervalStickiness.NONE,\n\t\trollback,\n\t});\n\n\tconst rangeProp = {\n\t\t[reservedRangeLabelsKey]: [label],\n\t};\n\tstartLref.addProperties(rangeProp);\n\tendLref.addProperties(rangeProp);\n\n\tconst ival = new SequenceIntervalClass(\n\t\tclient,\n\t\tid,\n\t\tlabel,\n\t\tstartLref,\n\t\tendLref,\n\t\tintervalType,\n\t\tprops === undefined\n\t\t\t? undefined\n\t\t\t: { ...props, [reservedIntervalIdKey]: undefined, [reservedRangeLabelsKey]: undefined },\n\t\tstartSide,\n\t\tendSide,\n\t);\n\treturn ival;\n}\n"]}
|
package/dist/legacy.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
8
|
+
* Generated by "flub generate entrypoints --resolutionConditions require --outFileLegacyBeta legacy --outDir ./dist" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/**
|
package/dist/packageVersion.d.ts
CHANGED
package/dist/packageVersion.js
CHANGED
|
@@ -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
|
+
exports.pkgVersion = "2.92.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.
|
|
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.92.0\";\n"]}
|
package/dist/public.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
8
|
+
* Generated by "flub generate entrypoints --resolutionConditions require --outFileLegacyBeta legacy --outDir ./dist" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/**
|
package/dist/revertibles.d.ts
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { LocalReferencePosition, MergeTreeDeltaRevertible, PropertySet } from "@fluidframework/merge-tree/internal";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import type { LocalReferencePosition, MergeTreeDeltaRevertible, PropertySet } from "@fluidframework/merge-tree/internal";
|
|
6
|
+
import type { SequenceInterval } from "./intervals/index.js";
|
|
7
|
+
import { IntervalOpType } from "./intervals/index.js";
|
|
8
|
+
import type { SequenceDeltaEvent } from "./sequenceDeltaEvent.js";
|
|
9
|
+
import type { ISharedString } from "./sharedString.js";
|
|
9
10
|
/**
|
|
10
11
|
* Data for undoing edits on SharedStrings and Intervals.
|
|
11
12
|
* @legacy @beta
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revertibles.d.ts","sourceRoot":"","sources":["../src/revertibles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,
|
|
1
|
+
{"version":3,"file":"revertibles.d.ts","sourceRoot":"","sources":["../src/revertibles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EACX,sBAAsB,EAEtB,wBAAwB,EACxB,WAAW,EAEX,MAAM,qCAAqC,CAAC;AAkB7C,OAAO,K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AAmB,EAAE,wBAAwB,CAAC;CAC7C,CAAC;AAeL;;;GAGG;AACH,wBAAgB,8BAA8B,CAC7C,QAAQ,EAAE,gBAAgB,EAC1B,WAAW,EAAE,sBAAsB,EAAE,4BAQrC;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAChD,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,gBAAgB,EAC1B,WAAW,EAAE,sBAAsB,EAAE,GACnC,sBAAsB,EAAE,CAwC1B;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAChD,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,gBAAgB,EAC7B,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,sBAAsB,EAAE,4BAsCrC;AAED;;;GAGG;AACH,wBAAgB,0CAA0C,CACzD,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,sBAAsB,EAAE,4BASrC;AA2CD;;;;GAIG;AACH,wBAAgB,oCAAoC,CACnD,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,kBAAkB,EACzB,WAAW,EAAE,sBAAsB,EAAE,QAwFrC;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC7C,YAAY,EAAE,aAAa,EAC3B,WAAW,EAAE,sBAAsB,EAAE,QAUrC;AAwRD;;;GAGG;AACH,wBAAgB,6BAA6B,CAC5C,YAAY,EAAE,aAAa,EAC3B,WAAW,EAAE,sBAAsB,EAAE,QAoCrC"}
|
package/dist/revertibles.js
CHANGED
|
@@ -169,7 +169,7 @@ function appendSharedStringDeltaToRevertibles(string, delta, revertibles) {
|
|
|
169
169
|
mergeTreeRevertible: removeRevertibles[0],
|
|
170
170
|
};
|
|
171
171
|
// add an interval for each startInterval, accounting for any corresponding endIntervals
|
|
172
|
-
|
|
172
|
+
for (const { interval, offset } of startIntervals) {
|
|
173
173
|
// find any corresponding end for this interval
|
|
174
174
|
const endIntervalIndex = endIntervals.findIndex((end) => {
|
|
175
175
|
return end.interval === interval;
|
|
@@ -185,15 +185,15 @@ function appendSharedStringDeltaToRevertibles(string, delta, revertibles) {
|
|
|
185
185
|
startOffset: offset,
|
|
186
186
|
endOffset,
|
|
187
187
|
});
|
|
188
|
-
}
|
|
188
|
+
}
|
|
189
189
|
// add any remaining endIntervals that aren't matched with a startInterval
|
|
190
|
-
|
|
190
|
+
for (const { interval, offset } of endIntervals) {
|
|
191
191
|
revertible.intervals.push({
|
|
192
192
|
intervalId: interval.getIntervalId(),
|
|
193
193
|
label: interval.start.properties?.referenceRangeLabels[0],
|
|
194
194
|
endOffset: offset,
|
|
195
195
|
});
|
|
196
|
-
}
|
|
196
|
+
}
|
|
197
197
|
revertibles.push(revertible);
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
@@ -214,7 +214,7 @@ exports.appendSharedStringDeltaToRevertibles = appendSharedStringDeltaToRevertib
|
|
|
214
214
|
* @legacy @beta
|
|
215
215
|
*/
|
|
216
216
|
function discardSharedStringRevertibles(sharedString, revertibles) {
|
|
217
|
-
|
|
217
|
+
for (const r of revertibles) {
|
|
218
218
|
if ((0, internal_2.isMergeTreeDeltaRevertible)(r)) {
|
|
219
219
|
(0, internal_2.discardMergeTreeDeltaRevertible)([r]);
|
|
220
220
|
}
|
|
@@ -222,7 +222,7 @@ function discardSharedStringRevertibles(sharedString, revertibles) {
|
|
|
222
222
|
sharedString.removeLocalReferencePosition(r.start);
|
|
223
223
|
sharedString.removeLocalReferencePosition(r.end);
|
|
224
224
|
}
|
|
225
|
-
}
|
|
225
|
+
}
|
|
226
226
|
}
|
|
227
227
|
exports.discardSharedStringRevertibles = discardSharedStringRevertibles;
|
|
228
228
|
function getSlidePosition(string, lref, pos) {
|
|
@@ -282,11 +282,11 @@ function revertLocalDelete(string, revertible) {
|
|
|
282
282
|
end: createSequencePlace(endSlidePos, revertible.end.slidingPreference),
|
|
283
283
|
props,
|
|
284
284
|
});
|
|
285
|
-
idMap.
|
|
285
|
+
for (const [oldId, newId] of idMap.entries()) {
|
|
286
286
|
if (intervalId === newId) {
|
|
287
287
|
idMap.set(oldId, getUpdatedIdFromInterval(int));
|
|
288
288
|
}
|
|
289
|
-
}
|
|
289
|
+
}
|
|
290
290
|
idMap.set(intervalId, int.getIntervalId());
|
|
291
291
|
}
|
|
292
292
|
string.removeLocalReferencePosition(revertible.start);
|
|
@@ -347,9 +347,9 @@ function revertLocalSequenceRemove(sharedString, revertible) {
|
|
|
347
347
|
const saveSegments = (event) => {
|
|
348
348
|
if (event.ranges.length > 0) {
|
|
349
349
|
let length = 0;
|
|
350
|
-
event.ranges
|
|
350
|
+
for (const range of event.ranges) {
|
|
351
351
|
length += range.segment.cachedLength;
|
|
352
|
-
}
|
|
352
|
+
}
|
|
353
353
|
restoredRanges.addOrUpdate({
|
|
354
354
|
ranges: event.ranges,
|
|
355
355
|
length,
|
|
@@ -360,7 +360,7 @@ function revertLocalSequenceRemove(sharedString, revertible) {
|
|
|
360
360
|
sharedString.on("sequenceDelta", saveSegments);
|
|
361
361
|
(0, internal_2.revertMergeTreeDeltaRevertibles)(sharedString, [revertible.mergeTreeRevertible]);
|
|
362
362
|
sharedString.off("sequenceDelta", saveSegments);
|
|
363
|
-
revertible.intervals
|
|
363
|
+
for (const intervalInfo of revertible.intervals) {
|
|
364
364
|
const intervalCollection = sharedString.getIntervalCollection(intervalInfo.label);
|
|
365
365
|
const intervalId = getUpdatedId(intervalInfo.intervalId);
|
|
366
366
|
const interval = intervalCollection.getIntervalById(intervalId);
|
|
@@ -376,9 +376,9 @@ function revertLocalSequenceRemove(sharedString, revertible) {
|
|
|
376
376
|
});
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
}
|
|
379
|
+
}
|
|
380
380
|
// fix up the local references used by delete and change revertibles
|
|
381
|
-
revertible.revertibleRefs
|
|
381
|
+
for (const revertibleRef of revertible.revertibleRefs) {
|
|
382
382
|
(0, internal_1.assert)(revertibleRef.revertible.event === index_js_1.IntervalOpType.CHANGE ||
|
|
383
383
|
revertibleRef.revertible.event === index_js_1.IntervalOpType.DELETE, 0x6c5 /* revertible is not delete or change */);
|
|
384
384
|
const pos = newPosition(revertibleRef.offset, restoredRanges);
|
|
@@ -394,7 +394,7 @@ function revertLocalSequenceRemove(sharedString, revertible) {
|
|
|
394
394
|
revertibleRef.revertible.end = newRef;
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
}
|
|
397
|
+
}
|
|
398
398
|
}
|
|
399
399
|
/**
|
|
400
400
|
* Invoke revertibles to reverse prior edits
|
|
@@ -407,23 +407,29 @@ function revertSharedStringRevertibles(sharedString, revertibles) {
|
|
|
407
407
|
if ("event" in r) {
|
|
408
408
|
const event = r.event;
|
|
409
409
|
switch (event) {
|
|
410
|
-
case index_js_1.IntervalOpType.ADD:
|
|
410
|
+
case index_js_1.IntervalOpType.ADD: {
|
|
411
411
|
revertLocalAdd(sharedString, r);
|
|
412
412
|
break;
|
|
413
|
-
|
|
413
|
+
}
|
|
414
|
+
case index_js_1.IntervalOpType.DELETE: {
|
|
414
415
|
revertLocalDelete(sharedString, r);
|
|
415
416
|
break;
|
|
416
|
-
|
|
417
|
+
}
|
|
418
|
+
case index_js_1.IntervalOpType.CHANGE: {
|
|
417
419
|
revertLocalChange(sharedString, r);
|
|
418
420
|
break;
|
|
419
|
-
|
|
421
|
+
}
|
|
422
|
+
case index_js_1.IntervalOpType.PROPERTY_CHANGED: {
|
|
420
423
|
revertLocalPropertyChanged(sharedString, r);
|
|
421
424
|
break;
|
|
422
|
-
|
|
425
|
+
}
|
|
426
|
+
case index_js_1.IntervalOpType.POSITION_REMOVE: {
|
|
423
427
|
revertLocalSequenceRemove(sharedString, r);
|
|
424
428
|
break;
|
|
425
|
-
|
|
429
|
+
}
|
|
430
|
+
default: {
|
|
426
431
|
(0, internal_1.unreachableCase)(event);
|
|
432
|
+
}
|
|
427
433
|
}
|
|
428
434
|
}
|
|
429
435
|
else {
|