@fluidframework/sequence 2.0.2 → 2.1.0-276326

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/api-extractor/api-extractor.legacy.json +4 -0
  2. package/api-report/sequence.beta.api.md +0 -48
  3. package/api-report/{sequence.alpha.api.md → sequence.legacy.alpha.api.md} +2 -52
  4. package/api-report/sequence.public.api.md +0 -48
  5. package/dist/intervalCollection.d.ts +6 -0
  6. package/dist/intervalCollection.d.ts.map +1 -1
  7. package/dist/intervalCollection.js +1 -0
  8. package/dist/intervalCollection.js.map +1 -1
  9. package/dist/intervalCollectionMapInterfaces.d.ts +5 -12
  10. package/dist/intervalCollectionMapInterfaces.d.ts.map +1 -1
  11. package/dist/intervalCollectionMapInterfaces.js.map +1 -1
  12. package/dist/intervalIndex/intervalIndex.d.ts +1 -0
  13. package/dist/intervalIndex/intervalIndex.d.ts.map +1 -1
  14. package/dist/intervalIndex/intervalIndex.js.map +1 -1
  15. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts +2 -0
  16. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
  17. package/dist/intervalIndex/overlappingIntervalsIndex.js +1 -0
  18. package/dist/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
  19. package/dist/intervals/intervalUtils.d.ts +8 -0
  20. package/dist/intervals/intervalUtils.d.ts.map +1 -1
  21. package/dist/intervals/intervalUtils.js +3 -0
  22. package/dist/intervals/intervalUtils.js.map +1 -1
  23. package/dist/intervals/sequenceInterval.d.ts +1 -0
  24. package/dist/intervals/sequenceInterval.d.ts.map +1 -1
  25. package/dist/intervals/sequenceInterval.js +1 -0
  26. package/dist/intervals/sequenceInterval.js.map +1 -1
  27. package/dist/legacy.d.ts +1 -1
  28. package/dist/packageVersion.d.ts +1 -1
  29. package/dist/packageVersion.d.ts.map +1 -1
  30. package/dist/packageVersion.js +1 -1
  31. package/dist/packageVersion.js.map +1 -1
  32. package/dist/revertibles.d.ts +9 -0
  33. package/dist/revertibles.d.ts.map +1 -1
  34. package/dist/revertibles.js +7 -0
  35. package/dist/revertibles.js.map +1 -1
  36. package/dist/sequence.d.ts +3 -0
  37. package/dist/sequence.d.ts.map +1 -1
  38. package/dist/sequence.js +8 -2
  39. package/dist/sequence.js.map +1 -1
  40. package/dist/sequenceDeltaEvent.d.ts +4 -0
  41. package/dist/sequenceDeltaEvent.d.ts.map +1 -1
  42. package/dist/sequenceDeltaEvent.js +3 -0
  43. package/dist/sequenceDeltaEvent.js.map +1 -1
  44. package/dist/sequenceFactory.d.ts +2 -0
  45. package/dist/sequenceFactory.d.ts.map +1 -1
  46. package/dist/sequenceFactory.js +1 -0
  47. package/dist/sequenceFactory.js.map +1 -1
  48. package/dist/sharedIntervalCollection.d.ts +1 -0
  49. package/dist/sharedIntervalCollection.d.ts.map +1 -1
  50. package/dist/sharedIntervalCollection.js.map +1 -1
  51. package/dist/sharedString.d.ts +3 -0
  52. package/dist/sharedString.d.ts.map +1 -1
  53. package/dist/sharedString.js +1 -0
  54. package/dist/sharedString.js.map +1 -1
  55. package/lib/intervalCollection.d.ts +6 -0
  56. package/lib/intervalCollection.d.ts.map +1 -1
  57. package/lib/intervalCollection.js +1 -0
  58. package/lib/intervalCollection.js.map +1 -1
  59. package/lib/intervalCollectionMapInterfaces.d.ts +5 -12
  60. package/lib/intervalCollectionMapInterfaces.d.ts.map +1 -1
  61. package/lib/intervalCollectionMapInterfaces.js.map +1 -1
  62. package/lib/intervalIndex/intervalIndex.d.ts +1 -0
  63. package/lib/intervalIndex/intervalIndex.d.ts.map +1 -1
  64. package/lib/intervalIndex/intervalIndex.js.map +1 -1
  65. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts +2 -0
  66. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
  67. package/lib/intervalIndex/overlappingIntervalsIndex.js +1 -0
  68. package/lib/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
  69. package/lib/intervals/intervalUtils.d.ts +8 -0
  70. package/lib/intervals/intervalUtils.d.ts.map +1 -1
  71. package/lib/intervals/intervalUtils.js +3 -0
  72. package/lib/intervals/intervalUtils.js.map +1 -1
  73. package/lib/intervals/sequenceInterval.d.ts +1 -0
  74. package/lib/intervals/sequenceInterval.d.ts.map +1 -1
  75. package/lib/intervals/sequenceInterval.js +1 -0
  76. package/lib/intervals/sequenceInterval.js.map +1 -1
  77. package/lib/legacy.d.ts +1 -1
  78. package/lib/packageVersion.d.ts +1 -1
  79. package/lib/packageVersion.d.ts.map +1 -1
  80. package/lib/packageVersion.js +1 -1
  81. package/lib/packageVersion.js.map +1 -1
  82. package/lib/revertibles.d.ts +9 -0
  83. package/lib/revertibles.d.ts.map +1 -1
  84. package/lib/revertibles.js +7 -0
  85. package/lib/revertibles.js.map +1 -1
  86. package/lib/sequence.d.ts +3 -0
  87. package/lib/sequence.d.ts.map +1 -1
  88. package/lib/sequence.js +9 -3
  89. package/lib/sequence.js.map +1 -1
  90. package/lib/sequenceDeltaEvent.d.ts +4 -0
  91. package/lib/sequenceDeltaEvent.d.ts.map +1 -1
  92. package/lib/sequenceDeltaEvent.js +3 -0
  93. package/lib/sequenceDeltaEvent.js.map +1 -1
  94. package/lib/sequenceFactory.d.ts +2 -0
  95. package/lib/sequenceFactory.d.ts.map +1 -1
  96. package/lib/sequenceFactory.js +1 -0
  97. package/lib/sequenceFactory.js.map +1 -1
  98. package/lib/sharedIntervalCollection.d.ts +1 -0
  99. package/lib/sharedIntervalCollection.d.ts.map +1 -1
  100. package/lib/sharedIntervalCollection.js.map +1 -1
  101. package/lib/sharedString.d.ts +3 -0
  102. package/lib/sharedString.d.ts.map +1 -1
  103. package/lib/sharedString.js +1 -0
  104. package/lib/sharedString.js.map +1 -1
  105. package/package.json +27 -76
  106. package/src/intervalCollection.ts +6 -0
  107. package/src/intervalCollectionMapInterfaces.ts +9 -12
  108. package/src/intervalIndex/intervalIndex.ts +1 -0
  109. package/src/intervalIndex/overlappingIntervalsIndex.ts +2 -0
  110. package/src/intervals/intervalUtils.ts +8 -0
  111. package/src/intervals/sequenceInterval.ts +1 -0
  112. package/src/packageVersion.ts +1 -1
  113. package/src/revertibles.ts +9 -0
  114. package/src/sequence.ts +27 -4
  115. package/src/sequenceDeltaEvent.ts +4 -0
  116. package/src/sequenceFactory.ts +2 -0
  117. package/src/sharedIntervalCollection.ts +1 -0
  118. package/src/sharedString.ts +3 -0
@@ -9,6 +9,7 @@ import { Client, IMergeTreeDeltaCallbackArgs, IMergeTreeDeltaOpArgs, IMergeTreeM
9
9
  * The properties of this object and its sub-objects represent the state of the sequence at the
10
10
  * point in time at which the operation was applied.
11
11
  * They will not take into any future modifications performed to the underlying sequence and merge tree.
12
+ * @legacy
12
13
  * @alpha
13
14
  */
14
15
  export declare abstract class SequenceEvent<TOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes> {
@@ -57,6 +58,7 @@ export declare abstract class SequenceEvent<TOperation extends MergeTreeDeltaOpe
57
58
  * For group ops, each op will get its own event, and the group op property will be set on the op args.
58
59
  *
59
60
  * Ops may get multiple events. For instance, an insert-replace will get a remove then an insert event.
61
+ * @legacy
60
62
  * @alpha
61
63
  */
62
64
  export declare class SequenceDeltaEvent extends SequenceEvent<MergeTreeDeltaOperationType> {
@@ -73,6 +75,7 @@ export declare class SequenceDeltaEvent extends SequenceEvent<MergeTreeDeltaOper
73
75
  * The properties of this object and its sub-objects represent the state of the sequence at the
74
76
  * point in time at which the operation was applied.
75
77
  * They will not take into consideration any future modifications performed to the underlying sequence and merge tree.
78
+ * @legacy
76
79
  * @alpha
77
80
  */
78
81
  export declare class SequenceMaintenanceEvent extends SequenceEvent<MergeTreeMaintenanceType> {
@@ -92,6 +95,7 @@ export declare class SequenceMaintenanceEvent extends SequenceEvent<MergeTreeMai
92
95
  }
93
96
  /**
94
97
  * A range that has changed corresponding to a segment modification.
98
+ * @legacy
95
99
  * @alpha
96
100
  */
97
101
  export interface ISequenceDeltaRange<TOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes> {
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceDeltaEvent.d.ts","sourceRoot":"","sources":["../src/sequenceDeltaEvent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAEN,MAAM,EACN,2BAA2B,EAC3B,qBAAqB,EACrB,iCAAiC,EACjC,QAAQ,EACR,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,EACxB,WAAW,EAEX,MAAM,qCAAqC,CAAC;AAE7C;;;;;;;GAOG;AACH,8BAAsB,aAAa,CAClC,UAAU,SAAS,4BAA4B,GAAG,4BAA4B;IAS7E;;OAEG;aACa,SAAS,EAAE,2BAA2B,CAAC,UAAU,CAAC;IAElE,OAAO,CAAC,QAAQ,CAAC,eAAe;IAZjC,SAAgB,cAAc,EAAE,UAAU,CAAC;IAE3C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA0D;IACvF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;IAC/D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwC;;IAG7D;;OAEG;IACa,SAAS,EAAE,2BAA2B,CAAC,UAAU,CAAC,EAEjD,eAAe,EAAE,MAAM;IAiCzC;;;;;;OAMG;IACH,IAAW,MAAM,IAAI,SAAS,QAAQ,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,EAAE,CAExE;IAED;;OAEG;IACH,IAAW,QAAQ,IAAI,MAAM,GAAG,SAAS,CAExC;IAED;;OAEG;IACH,IAAW,KAAK,IAAI,QAAQ,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAE5D;IAED;;OAEG;IACH,IAAW,IAAI,IAAI,QAAQ,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAE3D;CACD;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAmB,SAAQ,aAAa,CAAC,2BAA2B,CAAC;aAOhE,MAAM,EAAE,qBAAqB;IAN9C;;O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
@@ -11,6 +11,7 @@ SortedSegmentSet, } from "@fluidframework/merge-tree/internal";
11
11
  * The properties of this object and its sub-objects represent the state of the sequence at the
12
12
  * point in time at which the operation was applied.
13
13
  * They will not take into any future modifications performed to the underlying sequence and merge tree.
14
+ * @legacy
14
15
  * @alpha
15
16
  */
16
17
  export class SequenceEvent {
@@ -82,6 +83,7 @@ export class SequenceEvent {
82
83
  * For group ops, each op will get its own event, and the group op property will be set on the op args.
83
84
  *
84
85
  * Ops may get multiple events. For instance, an insert-replace will get a remove then an insert event.
86
+ * @legacy
85
87
  * @alpha
86
88
  */
87
89
  export class SequenceDeltaEvent extends SequenceEvent {
@@ -99,6 +101,7 @@ export class SequenceDeltaEvent extends SequenceEvent {
99
101
  * The properties of this object and its sub-objects represent the state of the sequence at the
100
102
  * point in time at which the operation was applied.
101
103
  * They will not take into consideration any future modifications performed to the underlying sequence and merge tree.
104
+ * @legacy
102
105
  * @alpha
103
106
  */
104
107
  export class SequenceMaintenanceEvent extends SequenceEvent {
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceDeltaEvent.js","sourceRoot":"","sources":["../src/sequenceDeltaEvent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAUO,gDAAgD;AAC7D,gBAAgB,GAChB,MAAM,qCAAqC,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,OAAgB,aAAa;IASlC;IACC;;OAEG;IACa,SAAkD;IAClE,gDAAgD;IAC/B,eAAuB;QAFxB,cAAS,GAAT,SAAS,CAAyC;QAEjD,oBAAe,GAAf,eAAe,CAAQ;QAExC,MAAM,CACL,SAAS,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAClC,KAAK,CAAC,iDAAiD,CACvD,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC,SAAS,CAAC;QAE1C,gDAAgD;QAChD,IAAI,CAAC,YAAY,GAAG,IAAI,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AAC,KAAK,CAAC;IACzB,CAAC;CACD;AAED;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,kBAAmB,SAAQ,aAA0C;IAMjF,YACiB,MAA6B,EAC7C,SAAsC;IACtC,gDAAgD;IAChD,eAAuB;QAEvB,KAAK,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QALlB,WAAM,GAAN,MAAM,CAAuB;QAM7C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,gBAAgB,KAAK,SAAS,CAAC;IACtD,CAAC;CACD;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,wBAAyB,SAAQ,aAAuC;IACpF;IACC;;;;OAIG;IACa,MAAyC,EACzD,SAA4C;IAC5C,gDAAgD;IAChD,eAAuB;QAEvB,KAAK,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QALlB,WAAM,GAAN,MAAM,CAAmC;IAM1D,CAAC;CACD;AA2CD,MAAM,IAAI;IAGT,YAA6B,cAAuB;QAAvB,mBAAc,GAAd,cAAc,CAAS;QACnD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED,IAAW,KAAK;QACf,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,IAAI,CAAC,MAAW,CAAC;IACzB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\tClient,\n\tIMergeTreeDeltaCallbackArgs,\n\tIMergeTreeDeltaOpArgs,\n\tIMergeTreeMaintenanceCallbackArgs,\n\tISegment,\n\tMergeTreeDeltaOperationType,\n\tMergeTreeDeltaOperationTypes,\n\tMergeTreeMaintenanceType,\n\tPropertySet, // eslint-disable-next-line import/no-deprecated\n\tSortedSegmentSet,\n} from \"@fluidframework/merge-tree/internal\";\n\n/**\n * Base class for SequenceDeltaEvent and SequenceMaintenanceEvent.\n *\n * The properties of this object and its sub-objects represent the state of the sequence at the\n * point in time at which the operation was applied.\n * They will not take into any future modifications performed to the underlying sequence and merge tree.\n * @alpha\n */\nexport abstract class SequenceEvent<\n\tTOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes,\n> {\n\tpublic readonly deltaOperation: TOperation;\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate readonly sortedRanges: Lazy<SortedSegmentSet<ISequenceDeltaRange<TOperation>>>;\n\tprivate readonly pFirst: Lazy<ISequenceDeltaRange<TOperation>>;\n\tprivate readonly pLast: Lazy<ISequenceDeltaRange<TOperation>>;\n\n\tconstructor(\n\t\t/**\n\t\t * Arguments reflecting the type of change that caused this event.\n\t\t */\n\t\tpublic readonly deltaArgs: IMergeTreeDeltaCallbackArgs<TOperation>,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tprivate readonly mergeTreeClient: Client,\n\t) {\n\t\tassert(\n\t\t\tdeltaArgs.deltaSegments.length > 0,\n\t\t\t0x2d8 /* \"Empty change event should not be emitted.\" */,\n\t\t);\n\t\tthis.deltaOperation = deltaArgs.operation;\n\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tthis.sortedRanges = new Lazy<SortedSegmentSet<ISequenceDeltaRange<TOperation>>>(() => {\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\tconst set = new SortedSegmentSet<ISequenceDeltaRange<TOperation>>();\n\t\t\tthis.deltaArgs.deltaSegments.forEach((delta) => {\n\t\t\t\tconst newRange: ISequenceDeltaRange<TOperation> = {\n\t\t\t\t\toperation: this.deltaArgs.operation,\n\t\t\t\t\tposition: this.mergeTreeClient.getPosition(delta.segment),\n\t\t\t\t\tpropertyDeltas: delta.propertyDeltas ?? {},\n\t\t\t\t\tsegment: delta.segment,\n\t\t\t\t};\n\t\t\t\tset.addOrUpdate(newRange);\n\t\t\t});\n\t\t\treturn set;\n\t\t});\n\n\t\tthis.pFirst = new Lazy<ISequenceDeltaRange<TOperation>>(\n\t\t\t() => this.sortedRanges.value.items[0],\n\t\t);\n\n\t\tthis.pLast = new Lazy<ISequenceDeltaRange<TOperation>>(\n\t\t\t() => this.sortedRanges.value.items[this.sortedRanges.value.size - 1],\n\t\t);\n\t}\n\n\t/**\n\t * The in-order ranges affected by this delta.\n\t * These are not necessarily contiguous.\n\t *\n\t * @remarks - If processing code doesn't care about the order of the ranges, it may instead consider using the\n\t * {@link @fluidframework/merge-tree#IMergeTreeDeltaCallbackArgs.deltaSegments|deltaSegments} field on {@link SequenceEvent.deltaArgs|deltaArgs}.\n\t */\n\tpublic get ranges(): readonly Readonly<ISequenceDeltaRange<TOperation>>[] {\n\t\treturn this.sortedRanges.value.items;\n\t}\n\n\t/**\n\t * The client id of the client that made the change which caused the delta event\n\t */\n\tpublic get clientId(): string | undefined {\n\t\treturn this.mergeTreeClient.longClientId;\n\t}\n\n\t/**\n\t * The first of the modified ranges.\n\t */\n\tpublic get first(): Readonly<ISequenceDeltaRange<TOperation>> {\n\t\treturn this.pFirst.value;\n\t}\n\n\t/**\n\t * The last of the modified ranges.\n\t */\n\tpublic get last(): Readonly<ISequenceDeltaRange<TOperation>> {\n\t\treturn this.pLast.value;\n\t}\n}\n\n/**\n * The event object returned on sequenceDelta events.\n *\n * The properties of this object and its sub-objects represent the state of the sequence at the\n * point in time at which the operation was applied.\n * They will not take into consideration any future modifications performed to the underlying sequence and merge tree.\n *\n * For group ops, each op will get its own event, and the group op property will be set on the op args.\n *\n * Ops may get multiple events. For instance, an insert-replace will get a remove then an insert event.\n * @alpha\n */\nexport class SequenceDeltaEvent extends SequenceEvent<MergeTreeDeltaOperationType> {\n\t/**\n\t * Whether the event was caused by a locally-made change.\n\t */\n\tpublic readonly isLocal: boolean;\n\n\tconstructor(\n\t\tpublic readonly opArgs: IMergeTreeDeltaOpArgs,\n\t\tdeltaArgs: IMergeTreeDeltaCallbackArgs,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tmergeTreeClient: Client,\n\t) {\n\t\tsuper(deltaArgs, mergeTreeClient);\n\t\tthis.isLocal = opArgs.sequencedMessage === undefined;\n\t}\n}\n\n/**\n * The event object returned on maintenance events.\n *\n * The properties of this object and its sub-objects represent the state of the sequence at the\n * point in time at which the operation was applied.\n * They will not take into consideration any future modifications performed to the underlying sequence and merge tree.\n * @alpha\n */\nexport class SequenceMaintenanceEvent extends SequenceEvent<MergeTreeMaintenanceType> {\n\tconstructor(\n\t\t/**\n\t\t * Defined iff `deltaArgs.operation` is {@link @fluidframework/merge-tree#MergeTreeMaintenanceType.ACKNOWLEDGED|MergeTreeMaintenanceType.ACKNOWLEDGED}.\n\t\t *\n\t\t * In that case, this argument provides information about the change which was acknowledged.\n\t\t */\n\t\tpublic readonly opArgs: IMergeTreeDeltaOpArgs | undefined,\n\t\tdeltaArgs: IMergeTreeMaintenanceCallbackArgs,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tmergeTreeClient: Client,\n\t) {\n\t\tsuper(deltaArgs, mergeTreeClient);\n\t}\n}\n\n/**\n * A range that has changed corresponding to a segment modification.\n * @alpha\n */\nexport interface ISequenceDeltaRange<\n\tTOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes,\n> {\n\t/**\n\t * The type of operation that changed this range.\n\t *\n\t * @remarks Consuming code should typically compare this to the enum values defined in\n\t * `MergeTreeDeltaOperationTypes`.\n\t */\n\toperation: TOperation;\n\n\t/**\n\t * The index of the start of the range.\n\t */\n\tposition: number;\n\n\t/**\n\t * The segment that corresponds to the range.\n\t */\n\tsegment: ISegment;\n\n\t/**\n\t * Deltas object which contains all modified properties with their previous values.\n\t * Since `undefined` doesn't survive a round-trip through JSON serialization, the old value being absent\n\t * is instead encoded with `null`.\n\t *\n\t * @remarks This object is motivated by undo/redo scenarios, and provides a convenient \"inverse op\" to apply to\n\t * undo a property change.\n\t *\n\t * @example\n\t *\n\t * If a segment initially had properties `{ foo: \"1\", bar: 2 }` and it was annotated with\n\t * `{ foo: 3, baz: 5 }`, the corresponding event would have a `propertyDeltas` of `{ foo: \"1\", baz: null }`.\n\t */\n\tpropertyDeltas: PropertySet;\n}\n\nclass Lazy<T> {\n\tprivate pValue: T | undefined;\n\tprivate pEvaluated: boolean;\n\tconstructor(private readonly valueGenerator: () => T) {\n\t\tthis.pEvaluated = false;\n\t}\n\n\tpublic get evaluated(): boolean {\n\t\treturn this.pEvaluated;\n\t}\n\n\tpublic get value(): T {\n\t\tif (!this.pEvaluated) {\n\t\t\tthis.pEvaluated = true;\n\t\t\tthis.pValue = this.valueGenerator();\n\t\t}\n\t\treturn this.pValue as T;\n\t}\n}\n"]}
1
+ {"version":3,"file":"sequenceDeltaEvent.js","sourceRoot":"","sources":["../src/sequenceDeltaEvent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAUO,gDAAgD;AAC7D,gBAAgB,GAChB,MAAM,qCAAqC,CAAC;AAE7C;;;;;;;;GAQG;AACH,MAAM,OAAgB,aAAa;IASlC;IACC;;OAEG;IACa,SAAkD;IAClE,gDAAgD;IAC/B,eAAuB;QAFxB,cAAS,GAAT,SAAS,CAAyC;QAEjD,oBAAe,GAAf,eAAe,CAAQ;QAExC,MAAM,CACL,SAAS,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAClC,KAAK,CAAC,iDAAiD,CACvD,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC,SAAS,CAAC;QAE1C,gDAAgD;QAChD,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,CAAoD,GAAG,EAAE;YACpF,gDAAgD;YAChD,MAAM,GAAG,GAAG,IAAI,gBAAgB,E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mB,SAAQ,aAA0C;IAMjF,YACiB,MAA6B,EAC7C,SAAsC;IACtC,gDAAgD;IAChD,eAAuB;QAEvB,KAAK,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QALlB,WAAM,GAAN,MAAM,CAAuB;QAM7C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,gBAAgB,KAAK,SAAS,CAAC;IACtD,CAAC;CACD;AAED;;;;;;;;GAQG;AACH,MAAM,OAAO,wBAAyB,SAAQ,aAAuC;IACpF;IACC;;;;OAIG;IACa,MAAyC,EACzD,SAA4C;IAC5C,gDAAgD;IAChD,eAAuB;QAEvB,KAAK,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QALlB,WAAM,GAAN,MAAM,CAAmC;IAM1D,CAAC;CACD;AA4CD,MAAM,IAAI;IAGT,YAA6B,cAAuB;QAAvB,mBAAc,GAAd,cAAc,CAAS;QACnD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED,IAAW,KAAK;QACf,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,IAAI,CAAC,MAAW,CAAC;IACzB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\tClient,\n\tIMergeTreeDeltaCallbackArgs,\n\tIMergeTreeDeltaOpArgs,\n\tIMergeTreeMaintenanceCallbackArgs,\n\tISegment,\n\tMergeTreeDeltaOperationType,\n\tMergeTreeDeltaOperationTypes,\n\tMergeTreeMaintenanceType,\n\tPropertySet, // eslint-disable-next-line import/no-deprecated\n\tSortedSegmentSet,\n} from \"@fluidframework/merge-tree/internal\";\n\n/**\n * Base class for SequenceDeltaEvent and SequenceMaintenanceEvent.\n *\n * The properties of this object and its sub-objects represent the state of the sequence at the\n * point in time at which the operation was applied.\n * They will not take into any future modifications performed to the underlying sequence and merge tree.\n * @legacy\n * @alpha\n */\nexport abstract class SequenceEvent<\n\tTOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes,\n> {\n\tpublic readonly deltaOperation: TOperation;\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate readonly sortedRanges: Lazy<SortedSegmentSet<ISequenceDeltaRange<TOperation>>>;\n\tprivate readonly pFirst: Lazy<ISequenceDeltaRange<TOperation>>;\n\tprivate readonly pLast: Lazy<ISequenceDeltaRange<TOperation>>;\n\n\tconstructor(\n\t\t/**\n\t\t * Arguments reflecting the type of change that caused this event.\n\t\t */\n\t\tpublic readonly deltaArgs: IMergeTreeDeltaCallbackArgs<TOperation>,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tprivate readonly mergeTreeClient: Client,\n\t) {\n\t\tassert(\n\t\t\tdeltaArgs.deltaSegments.length > 0,\n\t\t\t0x2d8 /* \"Empty change event should not be emitted.\" */,\n\t\t);\n\t\tthis.deltaOperation = deltaArgs.operation;\n\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tthis.sortedRanges = new Lazy<SortedSegmentSet<ISequenceDeltaRange<TOperation>>>(() => {\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\tconst set = new SortedSegmentSet<ISequenceDeltaRange<TOperation>>();\n\t\t\tthis.deltaArgs.deltaSegments.forEach((delta) => {\n\t\t\t\tconst newRange: ISequenceDeltaRange<TOperation> = {\n\t\t\t\t\toperation: this.deltaArgs.operation,\n\t\t\t\t\tposition: this.mergeTreeClient.getPosition(delta.segment),\n\t\t\t\t\tpropertyDeltas: delta.propertyDeltas ?? {},\n\t\t\t\t\tsegment: delta.segment,\n\t\t\t\t};\n\t\t\t\tset.addOrUpdate(newRange);\n\t\t\t});\n\t\t\treturn set;\n\t\t});\n\n\t\tthis.pFirst = new Lazy<ISequenceDeltaRange<TOperation>>(\n\t\t\t() => this.sortedRanges.value.items[0],\n\t\t);\n\n\t\tthis.pLast = new Lazy<ISequenceDeltaRange<TOperation>>(\n\t\t\t() => this.sortedRanges.value.items[this.sortedRanges.value.size - 1],\n\t\t);\n\t}\n\n\t/**\n\t * The in-order ranges affected by this delta.\n\t * These are not necessarily contiguous.\n\t *\n\t * @remarks - If processing code doesn't care about the order of the ranges, it may instead consider using the\n\t * {@link @fluidframework/merge-tree#IMergeTreeDeltaCallbackArgs.deltaSegments|deltaSegments} field on {@link SequenceEvent.deltaArgs|deltaArgs}.\n\t */\n\tpublic get ranges(): readonly Readonly<ISequenceDeltaRange<TOperation>>[] {\n\t\treturn this.sortedRanges.value.items;\n\t}\n\n\t/**\n\t * The client id of the client that made the change which caused the delta event\n\t */\n\tpublic get clientId(): string | undefined {\n\t\treturn this.mergeTreeClient.longClientId;\n\t}\n\n\t/**\n\t * The first of the modified ranges.\n\t */\n\tpublic get first(): Readonly<ISequenceDeltaRange<TOperation>> {\n\t\treturn this.pFirst.value;\n\t}\n\n\t/**\n\t * The last of the modified ranges.\n\t */\n\tpublic get last(): Readonly<ISequenceDeltaRange<TOperation>> {\n\t\treturn this.pLast.value;\n\t}\n}\n\n/**\n * The event object returned on sequenceDelta events.\n *\n * The properties of this object and its sub-objects represent the state of the sequence at the\n * point in time at which the operation was applied.\n * They will not take into consideration any future modifications performed to the underlying sequence and merge tree.\n *\n * For group ops, each op will get its own event, and the group op property will be set on the op args.\n *\n * Ops may get multiple events. For instance, an insert-replace will get a remove then an insert event.\n * @legacy\n * @alpha\n */\nexport class SequenceDeltaEvent extends SequenceEvent<MergeTreeDeltaOperationType> {\n\t/**\n\t * Whether the event was caused by a locally-made change.\n\t */\n\tpublic readonly isLocal: boolean;\n\n\tconstructor(\n\t\tpublic readonly opArgs: IMergeTreeDeltaOpArgs,\n\t\tdeltaArgs: IMergeTreeDeltaCallbackArgs,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tmergeTreeClient: Client,\n\t) {\n\t\tsuper(deltaArgs, mergeTreeClient);\n\t\tthis.isLocal = opArgs.sequencedMessage === undefined;\n\t}\n}\n\n/**\n * The event object returned on maintenance events.\n *\n * The properties of this object and its sub-objects represent the state of the sequence at the\n * point in time at which the operation was applied.\n * They will not take into consideration any future modifications performed to the underlying sequence and merge tree.\n * @legacy\n * @alpha\n */\nexport class SequenceMaintenanceEvent extends SequenceEvent<MergeTreeMaintenanceType> {\n\tconstructor(\n\t\t/**\n\t\t * Defined iff `deltaArgs.operation` is {@link @fluidframework/merge-tree#MergeTreeMaintenanceType.ACKNOWLEDGED|MergeTreeMaintenanceType.ACKNOWLEDGED}.\n\t\t *\n\t\t * In that case, this argument provides information about the change which was acknowledged.\n\t\t */\n\t\tpublic readonly opArgs: IMergeTreeDeltaOpArgs | undefined,\n\t\tdeltaArgs: IMergeTreeMaintenanceCallbackArgs,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tmergeTreeClient: Client,\n\t) {\n\t\tsuper(deltaArgs, mergeTreeClient);\n\t}\n}\n\n/**\n * A range that has changed corresponding to a segment modification.\n * @legacy\n * @alpha\n */\nexport interface ISequenceDeltaRange<\n\tTOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes,\n> {\n\t/**\n\t * The type of operation that changed this range.\n\t *\n\t * @remarks Consuming code should typically compare this to the enum values defined in\n\t * `MergeTreeDeltaOperationTypes`.\n\t */\n\toperation: TOperation;\n\n\t/**\n\t * The index of the start of the range.\n\t */\n\tposition: number;\n\n\t/**\n\t * The segment that corresponds to the range.\n\t */\n\tsegment: ISegment;\n\n\t/**\n\t * Deltas object which contains all modified properties with their previous values.\n\t * Since `undefined` doesn't survive a round-trip through JSON serialization, the old value being absent\n\t * is instead encoded with `null`.\n\t *\n\t * @remarks This object is motivated by undo/redo scenarios, and provides a convenient \"inverse op\" to apply to\n\t * undo a property change.\n\t *\n\t * @example\n\t *\n\t * If a segment initially had properties `{ foo: \"1\", bar: 2 }` and it was annotated with\n\t * `{ foo: 3, baz: 5 }`, the corresponding event would have a `propertyDeltas` of `{ foo: \"1\", baz: null }`.\n\t */\n\tpropertyDeltas: PropertySet;\n}\n\nclass Lazy<T> {\n\tprivate pValue: T | undefined;\n\tprivate pEvaluated: boolean;\n\tconstructor(private readonly valueGenerator: () => T) {\n\t\tthis.pEvaluated = false;\n\t}\n\n\tpublic get evaluated(): boolean {\n\t\treturn this.pEvaluated;\n\t}\n\n\tpublic get value(): T {\n\t\tif (!this.pEvaluated) {\n\t\t\tthis.pEvaluated = true;\n\t\t\tthis.pValue = this.valueGenerator();\n\t\t}\n\t\treturn this.pValue as T;\n\t}\n}\n"]}
@@ -21,11 +21,13 @@ export declare class SharedStringFactory implements IChannelFactory<ISharedStrin
21
21
  }
22
22
  /**
23
23
  * Entrypoint for {@link ISharedString} creation.
24
+ * @legacy
24
25
  * @alpha
25
26
  */
26
27
  export declare const SharedString: import("@fluidframework/shared-object-base/internal").ISharedObjectKind<ISharedString> & import("@fluidframework/shared-object-base/internal").SharedObjectKind<ISharedString>;
27
28
  /**
28
29
  * Alias for {@link ISharedString} for compatibility.
30
+ * @legacy
29
31
  * @alpha
30
32
  */
31
33
  export type SharedString = ISharedString;
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceFactory.d.ts","sourceRoot":"","sources":["../src/sequenceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AAKxD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE/F,qBAAa,mBAAoB,YAAW,eAAe,CAAC,aAAa,CAAC;IAGzE,OAAc,IAAI,SAAiD;IAEnE,gBAA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AM,GAAG,iBAAiB;CAK9E;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,gLAA6D,CAAC;AAEvF;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC"}
@@ -51,6 +51,7 @@ SharedStringFactory.Attributes = {
51
51
  };
52
52
  /**
53
53
  * Entrypoint for {@link ISharedString} creation.
54
+ * @legacy
54
55
  * @alpha
55
56
  */
56
57
  export const SharedString = createSharedObjectKind(SharedStringFactory);
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceFactory.js","sourceRoot":"","sources":["../src/sequenceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAErF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAA2C,MAAM,mBAAmB,CAAC;AAE/F,MAAM,OAAO,mBAAmB;IAWxB,MAAM,CAAC,eAAe,CAAC,IAAS;QACtC,MAAM,SAAS,GAAG,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QACnD,IAAI,SAAS,EAAE,CAAC;YACf,OAAO,SAAS,CAAC;QAClB,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,WAAW,EAAE,CAAC;YACjB,OAAO,WAAW,CAAC;QACpB,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC7C,CAAC;IAED,IAAW,IAAI;QACd,OAAO,mBAAmB,CAAC,IAAI,CAAC;IACjC,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,mBAAmB,CAAC,UAAU,CAAC;IACvC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,YAAY,GAAG,IAAI,iBAAiB,CAAC,OAAO,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;QACpE,MAAM,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClC,OAAO,YAAY,CAAC;IACrB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD,MAAM,YAAY,GAAG,IAAI,iBAAiB,CAAC,QAAQ,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1E,YAAY,CAAC,eAAe,EAAE,CAAC;QAC/B,OAAO,YAAY,CAAC;IACrB,CAAC;;AArDD,+GAA+G;AAC/G,gEAAgE;AAClD,wBAAI,GAAG,6CAA6C,CAAC;AAE5C,8BAAU,GAAuB;IACvD,IAAI,EAAE,mBAAmB,CAAC,IAAI;IAC9B,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC1B,CAAC;AAgDH;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,CAAgB,mBAAmB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { Marker, TextSegment } from \"@fluidframework/merge-tree/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\nimport { SharedStringClass, SharedStringSegment, type ISharedString } from \"./sharedString.js\";\n\nexport class SharedStringFactory implements IChannelFactory<ISharedString> {\n\t// TODO rename back to https://graph.microsoft.com/types/mergeTree/string once paparazzi is able to dynamically\n\t// load code (UPDATE: paparazzi is gone... anything to do here?)\n\tpublic static Type = \"https://graph.microsoft.com/types/mergeTree\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: SharedStringFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic static segmentFromSpec(spec: any): SharedStringSegment {\n\t\tconst maybeText = TextSegment.fromJSONObject(spec);\n\t\tif (maybeText) {\n\t\t\treturn maybeText;\n\t\t}\n\n\t\tconst maybeMarker = Marker.fromJSONObject(spec);\n\t\tif (maybeMarker) {\n\t\t\treturn maybeMarker;\n\t\t}\n\n\t\tthrow new Error(`Unrecognized IJSONObject`);\n\t}\n\n\tpublic get type() {\n\t\treturn SharedStringFactory.Type;\n\t}\n\n\tpublic get attributes() {\n\t\treturn SharedStringFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<SharedStringClass> {\n\t\tconst sharedString = new SharedStringClass(runtime, id, attributes);\n\t\tawait sharedString.load(services);\n\t\treturn sharedString;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n\t */\n\tpublic create(document: IFluidDataStoreRuntime, id: string): SharedStringClass {\n\t\tconst sharedString = new SharedStringClass(document, id, this.attributes);\n\t\tsharedString.initializeLocal();\n\t\treturn sharedString;\n\t}\n}\n\n/**\n * Entrypoint for {@link ISharedString} creation.\n * @alpha\n */\nexport const SharedString = createSharedObjectKind<ISharedString>(SharedStringFactory);\n\n/**\n * Alias for {@link ISharedString} for compatibility.\n * @alpha\n */\nexport type SharedString = ISharedString;\n"]}
1
+ {"version":3,"file":"sequenceFactory.js","sourceRoot":"","sources":["../src/sequenceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA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mBAAmB,CAAC,IAAI;IAC9B,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC1B,CAAC;AAgDH;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,CAAgB,mBAAmB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { Marker, TextSegment } from \"@fluidframework/merge-tree/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\nimport { SharedStringClass, SharedStringSegment, type ISharedString } from \"./sharedString.js\";\n\nexport class SharedStringFactory implements IChannelFactory<ISharedString> {\n\t// TODO rename back to https://graph.microsoft.com/types/mergeTree/string once paparazzi is able to dynamically\n\t// load code (UPDATE: paparazzi is gone... anything to do here?)\n\tpublic static Type = \"https://graph.microsoft.com/types/mergeTree\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: SharedStringFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic static segmentFromSpec(spec: any): SharedStringSegment {\n\t\tconst maybeText = TextSegment.fromJSONObject(spec);\n\t\tif (maybeText) {\n\t\t\treturn maybeText;\n\t\t}\n\n\t\tconst maybeMarker = Marker.fromJSONObject(spec);\n\t\tif (maybeMarker) {\n\t\t\treturn maybeMarker;\n\t\t}\n\n\t\tthrow new Error(`Unrecognized IJSONObject`);\n\t}\n\n\tpublic get type() {\n\t\treturn SharedStringFactory.Type;\n\t}\n\n\tpublic get attributes() {\n\t\treturn SharedStringFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<SharedStringClass> {\n\t\tconst sharedString = new SharedStringClass(runtime, id, attributes);\n\t\tawait sharedString.load(services);\n\t\treturn sharedString;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n\t */\n\tpublic create(document: IFluidDataStoreRuntime, id: string): SharedStringClass {\n\t\tconst sharedString = new SharedStringClass(document, id, this.attributes);\n\t\tsharedString.initializeLocal();\n\t\treturn sharedString;\n\t}\n}\n\n/**\n * Entrypoint for {@link ISharedString} creation.\n * @legacy\n * @alpha\n */\nexport const SharedString = createSharedObjectKind<ISharedString>(SharedStringFactory);\n\n/**\n * Alias for {@link ISharedString} for compatibility.\n * @legacy\n * @alpha\n */\nexport type SharedString = ISharedString;\n"]}
@@ -25,6 +25,7 @@ export declare class SharedIntervalCollectionFactory implements IChannelFactory
25
25
  create(runtime: IFluidDataStoreRuntime, id: string): SharedIntervalCollection;
26
26
  }
27
27
  /**
28
+ * @legacy
28
29
  * @alpha
29
30
  */
30
31
  export interface ISharedIntervalCollection<TInterval extends ISerializableInterval> {
@@ -1 +1 @@
1
- {"version":3,"file":"sharedIntervalCollection.d.ts","sourceRoot":"","sources":["../src/sharedIntervalCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAEN,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EACN,gBAAgB,EAChB,YAAY,EAEZ,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAA+B,MAAM,yBAAyB,CAAC;AAG3F,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EA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AAG,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC5C,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAES,WAAW,CACpB,OAAkC,EAClC,KAAc,EACd,eAAwB;QAExB,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,SAAS,EAAE,CAAC;YAC5C,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CACzC,OAAO,CAAC,QAAyB,EACjC,KAAK,EACL,OAAO,EACP,eAAe,CACf,CAAC;QACH,CAAC;IACF,CAAC;IAED;;;OAGG;IACO,yBAAyB,CAAC,KAAa;QAChD,OAAO,KAAK,CAAC;IACd,CAAC;IAES,cAAc;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;KA3EiB,MAAM,CAAC,WAAW","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport {\n\tMessageType,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tIFluidSerializer,\n\tSharedObject,\n\tcreateSingleBlobSummary,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport { IIntervalCollection, IntervalCollectionValueType } from \"./intervalCollection.js\";\nimport { IMapOperation, IntervalCollectionMap } from \"./intervalCollectionMap.js\";\nimport { IMapMessageLocalMetadata } from \"./intervalCollectionMapInterfaces.js\";\nimport { ISerializableInterval, Interval } from \"./intervals/index.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * The factory that defines the SharedIntervalCollection.\n * @deprecated `SharedIntervalCollection` is not maintained and is planned to be removed.\n * @internal\n */\nexport class SharedIntervalCollectionFactory implements IChannelFactory {\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/sharedIntervalCollection\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: SharedIntervalCollectionFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type() {\n\t\treturn SharedIntervalCollectionFactory.Type;\n\t}\n\n\tpublic get attributes() {\n\t\treturn SharedIntervalCollectionFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<SharedIntervalCollection> {\n\t\tconst map = new SharedIntervalCollection(id, runtime, attributes);\n\t\tawait map.load(services);\n\n\t\treturn map;\n\t}\n\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): SharedIntervalCollection {\n\t\tconst map = new SharedIntervalCollection(id, runtime, this.attributes);\n\t\tmap.initializeLocal();\n\n\t\treturn map;\n\t}\n}\n\n/**\n * @alpha\n */\nexport interface ISharedIntervalCollection<TInterval extends ISerializableInterval> {\n\tgetIntervalCollection(label: string): IIntervalCollection<TInterval>;\n}\n\n/**\n * @deprecated `SharedIntervalCollection` is not maintained and is planned to be removed.\n * @internal\n */\nexport class SharedIntervalCollection\n\textends SharedObject\n\timplements ISharedIntervalCollection<Interval>\n{\n\t/**\n\t * Create a SharedIntervalCollection\n\t *\n\t * @param runtime - data store runtime the new shared map belongs to\n\t * @param id - optional name of the shared map\n\t * @returns newly create shared map (but not attached yet)\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string) {\n\t\treturn runtime.createChannel(\n\t\t\tid,\n\t\t\tSharedIntervalCollectionFactory.Type,\n\t\t) as SharedIntervalCollection;\n\t}\n\n\t/**\n\t * Get a factory for SharedIntervalCollection to register with the data store.\n\t *\n\t * @returns a factory that creates and load SharedIntervalCollection\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new SharedIntervalCollectionFactory();\n\t}\n\n\tpublic readonly [Symbol.toStringTag]: string = \"SharedIntervalCollection\";\n\tprivate readonly intervalCollections: IntervalCollectionMap<Interval>;\n\n\t/**\n\t * Constructs a new shared SharedIntervalCollection. If the object is non-local an id and service interfaces will\n\t * be provided\n\t */\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\tsuper(id, runtime, attributes, \"fluid_sharedIntervalCollection_\");\n\t\tthis.intervalCollections = new IntervalCollectionMap(\n\t\t\tthis.serializer,\n\t\t\tthis.handle,\n\t\t\t(op, localOpMetadata) => this.submitLocalMessage(op, localOpMetadata),\n\t\t\tnew IntervalCollectionValueType(),\n\t\t\truntime.options,\n\t\t);\n\t}\n\n\tpublic getIntervalCollection(label: string): IIntervalCollection<Interval> {\n\t\tconst realLabel = this.getIntervalCollectionPath(label);\n\t\tconst sharedCollection = this.intervalCollections.get(realLabel);\n\t\treturn sharedCollection;\n\t}\n\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\treturn createSingleBlobSummary(\n\t\t\tsnapshotFileName,\n\t\t\tthis.intervalCollections.serialize(serializer),\n\t\t);\n\t}\n\n\tprotected reSubmitCore(content: any, localOpMetadata: unknown) {\n\t\tthis.intervalCollections.tryResubmitMessage(\n\t\t\tcontent,\n\t\t\tlocalOpMetadata as IMapMessageLocalMetadata,\n\t\t);\n\t}\n\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService) {\n\t\tconst blob = await storage.readBlob(snapshotFileName);\n\t\tconst header = bufferToString(blob, \"utf8\");\n\t\tthis.intervalCollections.populate(header);\n\t}\n\n\tprotected processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t) {\n\t\tif (message.type === MessageType.Operation) {\n\t\t\tthis.intervalCollections.tryProcessMessage(\n\t\t\t\tmessage.contents as IMapOperation,\n\t\t\t\tlocal,\n\t\t\t\tmessage,\n\t\t\t\tlocalOpMetadata,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Creates the full path of the intervalCollection label\n\t * @param label - the incoming label\n\t */\n\tprotected getIntervalCollectionPath(label: string): string {\n\t\treturn label;\n\t}\n\n\tprotected applyStashedOp() {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
1
+ {"version":3,"file":"sharedIntervalCollection.js","sourceRoot":"","sources":["../src/sharedIntervalCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAQ9D,OAAO,EACN,WAAW,GAEX,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAEN,YAAY,EACZ,uBAAuB,GACvB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAuB,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAiB,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGlF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAElC;;;;GAIG;AACH,MAAM,OAAO,+BAA+B;IAS3C,IAAW,IAAI;QACd,OAAO,+BAA+B,CAAC,IAAI,CAAC;IAC7C,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,+BAA+B,CAAC,UAAU,CAAC;IACnD,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,GAAG,GAAG,IAAI,wBAAwB,CAAC,EAAE,EAAE,OAAO,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ributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport {\n\tMessageType,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tIFluidSerializer,\n\tSharedObject,\n\tcreateSingleBlobSummary,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport { IIntervalCollection, IntervalCollectionValueType } from \"./intervalCollection.js\";\nimport { IMapOperation, IntervalCollectionMap } from \"./intervalCollectionMap.js\";\nimport { IMapMessageLocalMetadata } from \"./intervalCollectionMapInterfaces.js\";\nimport { ISerializableInterval, Interval } from \"./intervals/index.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * The factory that defines the SharedIntervalCollection.\n * @deprecated `SharedIntervalCollection` is not maintained and is planned to be removed.\n * @internal\n */\nexport class SharedIntervalCollectionFactory implements IChannelFactory {\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/sharedIntervalCollection\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: SharedIntervalCollectionFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type() {\n\t\treturn SharedIntervalCollectionFactory.Type;\n\t}\n\n\tpublic get attributes() {\n\t\treturn SharedIntervalCollectionFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<SharedIntervalCollection> {\n\t\tconst map = new SharedIntervalCollection(id, runtime, attributes);\n\t\tawait map.load(services);\n\n\t\treturn map;\n\t}\n\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): SharedIntervalCollection {\n\t\tconst map = new SharedIntervalCollection(id, runtime, this.attributes);\n\t\tmap.initializeLocal();\n\n\t\treturn map;\n\t}\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface ISharedIntervalCollection<TInterval extends ISerializableInterval> {\n\tgetIntervalCollection(label: string): IIntervalCollection<TInterval>;\n}\n\n/**\n * @deprecated `SharedIntervalCollection` is not maintained and is planned to be removed.\n * @internal\n */\nexport class SharedIntervalCollection\n\textends SharedObject\n\timplements ISharedIntervalCollection<Interval>\n{\n\t/**\n\t * Create a SharedIntervalCollection\n\t *\n\t * @param runtime - data store runtime the new shared map belongs to\n\t * @param id - optional name of the shared map\n\t * @returns newly create shared map (but not attached yet)\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string) {\n\t\treturn runtime.createChannel(\n\t\t\tid,\n\t\t\tSharedIntervalCollectionFactory.Type,\n\t\t) as SharedIntervalCollection;\n\t}\n\n\t/**\n\t * Get a factory for SharedIntervalCollection to register with the data store.\n\t *\n\t * @returns a factory that creates and load SharedIntervalCollection\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new SharedIntervalCollectionFactory();\n\t}\n\n\tpublic readonly [Symbol.toStringTag]: string = \"SharedIntervalCollection\";\n\tprivate readonly intervalCollections: IntervalCollectionMap<Interval>;\n\n\t/**\n\t * Constructs a new shared SharedIntervalCollection. If the object is non-local an id and service interfaces will\n\t * be provided\n\t */\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\tsuper(id, runtime, attributes, \"fluid_sharedIntervalCollection_\");\n\t\tthis.intervalCollections = new IntervalCollectionMap(\n\t\t\tthis.serializer,\n\t\t\tthis.handle,\n\t\t\t(op, localOpMetadata) => this.submitLocalMessage(op, localOpMetadata),\n\t\t\tnew IntervalCollectionValueType(),\n\t\t\truntime.options,\n\t\t);\n\t}\n\n\tpublic getIntervalCollection(label: string): IIntervalCollection<Interval> {\n\t\tconst realLabel = this.getIntervalCollectionPath(label);\n\t\tconst sharedCollection = this.intervalCollections.get(realLabel);\n\t\treturn sharedCollection;\n\t}\n\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\treturn createSingleBlobSummary(\n\t\t\tsnapshotFileName,\n\t\t\tthis.intervalCollections.serialize(serializer),\n\t\t);\n\t}\n\n\tprotected reSubmitCore(content: any, localOpMetadata: unknown) {\n\t\tthis.intervalCollections.tryResubmitMessage(\n\t\t\tcontent,\n\t\t\tlocalOpMetadata as IMapMessageLocalMetadata,\n\t\t);\n\t}\n\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService) {\n\t\tconst blob = await storage.readBlob(snapshotFileName);\n\t\tconst header = bufferToString(blob, \"utf8\");\n\t\tthis.intervalCollections.populate(header);\n\t}\n\n\tprotected processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t) {\n\t\tif (message.type === MessageType.Operation) {\n\t\t\tthis.intervalCollections.tryProcessMessage(\n\t\t\t\tmessage.contents as IMapOperation,\n\t\t\t\tlocal,\n\t\t\t\tmessage,\n\t\t\t\tlocalOpMetadata,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Creates the full path of the intervalCollection label\n\t * @param label - the incoming label\n\t */\n\tprotected getIntervalCollectionPath(label: string): string {\n\t\treturn label;\n\t}\n\n\tprotected applyStashedOp() {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
@@ -7,6 +7,7 @@ import { IRelativePosition, ISegment, Marker, PropertySet, ReferenceType, TextSe
7
7
  import { SharedSegmentSequence, type ISharedSegmentSequence } from "./sequence.js";
8
8
  /**
9
9
  * Fluid object interface describing access methods on a SharedString
10
+ * @legacy
10
11
  * @alpha
11
12
  */
12
13
  export interface ISharedString extends ISharedSegmentSequence<SharedStringSegment> {
@@ -87,6 +88,7 @@ export interface ISharedString extends ISharedSegmentSequence<SharedStringSegmen
87
88
  getMarkerFromId(id: string): ISegment | undefined;
88
89
  }
89
90
  /**
91
+ * @legacy
90
92
  * @alpha
91
93
  */
92
94
  export type SharedStringSegment = TextSegment | Marker;
@@ -98,6 +100,7 @@ export type SharedStringSegment = TextSegment | Marker;
98
100
  * In addition to text, a Shared String can also contain markers. Markers can be
99
101
  * used to store metadata at positions within the text, like the details of an
100
102
  * image or Fluid object that should be rendered with the text.
103
+ * @legacy
101
104
  * @alpha
102
105
  */
103
106
  export declare class SharedStringClass extends SharedSegmentSequence<SharedStringSegment> implements ISharedString {
@@ -1 +1 @@
1
- {"version":3,"file":"sharedString.d.ts","sourceRoot":"","sources":["../src/sharedString.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAGN,iBAAiB,EACjB,QAAQ,EAER,MAAM,EACN,WAAW,EACX,aAAa,EACb,WAAW,EAEX,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAGnF;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,sBAAsB,CAAC,mBAAmB,CAAC;IACjF;;;;;OAKG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAEjE;;;;;OAKG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAE7E;;;;;OAKG;IACH,oBAAoB,CACnB,YAAY,EAAE,iBAAiB,EAC/B,OAA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AAE,MAAM;IAW3D;;OAEG;IACI,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAWzD;;OAEG;IACI,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAIxD;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;CAOhE;AAWD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAChC,YAAY,EAAE,aAAa,EAC3B,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,MAAM,GACV;IACF,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC1B,CAWA"}
@@ -13,6 +13,7 @@ import { SharedStringFactory } from "./sequenceFactory.js";
13
13
  * In addition to text, a Shared String can also contain markers. Markers can be
14
14
  * used to store metadata at positions within the text, like the details of an
15
15
  * image or Fluid object that should be rendered with the text.
16
+ * @legacy
16
17
  * @alpha
17
18
  */
18
19
  export class SharedStringClass extends SharedSegmentSequence {
@@ -1 +1 @@
1
- {"version":3,"file":"sharedString.js","sourceRoot":"","sources":["../src/sharedString.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAMN,MAAM,EAGN,WAAW,EACX,eAAe,GACf,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAA+B,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AA4G3D;;;;;;;;;GASG;AACH,MAAM,OAAO,iBACZ,SAAQ,qBAA0C;IAGlD,IAAW,aAAa;QACvB,OAAO,IAAI,CAAC;IACb,CAAC;IAKD,YACC,QAAgC,EACzB,EAAU,EACjB,UAA8B;QAE9B,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,mBAAmB,CAAC,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,CAAC;YACnC,MAAM,MAAM,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YACrC,MAAM,IAAI,GAAG,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC;YAC7C,WAAW,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC1D,CAAC;IACF,CAAC;SAAM,CAAC;QACP,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3C,MAAM,eAAe;YACpB,gEAAgE;YAChE,WAAW,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YACjF,WAAW,CAAC,IAAI,IAAI,eAAe,CAAC;QACrC,CAAC;aAAM,CAAC;YACP,MAAM,MAAM,GAAG,OAAiB,CAAC;YACjC,IAAI,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,mBAAmB,CAAC,EAAE,CAAC;gBAC5D,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACvC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBAC9C,WAAW,CAAC,IAAI,GAAG,EAAE,CAAC;YACvB,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\tIMergeTreeTextHelper,\n\tIRelativePosition,\n\tISegment,\n\tISegmentAction,\n\tMarker,\n\tPropertySet,\n\tReferenceType,\n\tTextSegment,\n\trefHasTileLabel,\n} from \"@fluidframework/merge-tree/internal\";\n\nimport { SharedSegmentSequence, type ISharedSegmentSequence } from \"./sequence.js\";\nimport { SharedStringFactory } from \"./sequenceFactory.js\";\n\n/**\n * Fluid object interface describing access methods on a SharedString\n * @alpha\n */\nexport interface ISharedString extends ISharedSegmentSequence<SharedStringSegment> {\n\t/**\n\t * Inserts the text at the position.\n\t * @param pos - The position to insert the text at\n\t * @param text - The text to insert\n\t * @param props - The properties of the text\n\t */\n\tinsertText(pos: number, text: string, props?: PropertySet): void;\n\n\t/**\n\t * Inserts a marker at the position.\n\t * @param pos - The position to insert the marker at\n\t * @param refType - The reference type of the marker\n\t * @param props - The properties of the marker\n\t */\n\tinsertMarker(pos: number, refType: ReferenceType, props?: PropertySet): void;\n\n\t/**\n\t * Inserts a marker at a relative position.\n\t * @param relativePos1 - The relative position to insert the marker at\n\t * @param refType - The reference type of the marker\n\t * @param props - The properties of the marker\n\t */\n\tinsertMarkerRelative(\n\t\trelativePos1: IRelativePosition,\n\t\trefType: ReferenceType,\n\t\tprops?: PropertySet,\n\t): void;\n\n\t/**\n\t * Inserts the text at the position.\n\t * @param relativePos1 - The relative position to insert the text at\n\t * @param text - The text to insert\n\t * @param props - The properties of text\n\t */\n\tinsertTextRelative(relativePos1: IRelativePosition, text: string, props?: PropertySet): void;\n\n\t/**\n\t * Replaces a range with the provided text.\n\t * @param start - The inclusive start of the range to replace\n\t * @param end - The exclusive end of the range to replace\n\t * @param text - The text to replace the range with\n\t * @param props - Optional. The properties of the replacement text\n\t */\n\treplaceText(start: number, end: number, text: string, props?: PropertySet): void;\n\n\t/**\n\t * Removes the text in the given range.\n\t * @param start - The inclusive start of the range to remove\n\t * @param end - The exclusive end of the range to replace\n\t * @returns the message sent.\n\t */\n\tremoveText(start: number, end: number): void;\n\n\t/**\n\t * Annotates the marker with the provided properties.\n\t * @param marker - The marker to annotate\n\t * @param props - The properties to annotate the marker with\n\t */\n\tannotateMarker(marker: Marker, props: PropertySet): void;\n\n\t/**\n\t * Searches a string for the nearest marker in either direction to a given start position.\n\t * The search will include the start position, so markers at the start position are valid\n\t * results of the search.\n\t * @param startPos - Position at which to start the search\n\t * @param markerLabel - Label of the marker to search for\n\t * @param forwards - Whether the desired marker comes before (false) or after (true) `startPos`. Default true.\n\t */\n\tsearchForMarker(\n\t\tstartPos: number,\n\t\tmarkerLabel: string,\n\t\tforwards?: boolean,\n\t): Marker | undefined;\n\n\t/**\n\t * Retrieve text from the SharedString in string format.\n\t * @param start - The starting index of the text to retrieve, or 0 if omitted.\n\t * @param end - The ending index of the text to retrieve, or the end of the string if omitted\n\t * @returns The requested text content as a string.\n\t */\n\tgetText(start?: number, end?: number): string;\n\n\t/**\n\t * Adds spaces for markers and handles, so that position calculations account for them.\n\t */\n\tgetTextWithPlaceholders(start?: number, end?: number): string;\n\n\tgetTextRangeWithMarkers(start: number, end: number): string;\n\n\t/**\n\t * Looks up and returns a `Marker` using its id. Returns `undefined` if there is no marker with the provided\n\t * id in this `SharedString`.\n\t */\n\tgetMarkerFromId(id: string): ISegment | undefined;\n}\n\n/**\n * @alpha\n */\nexport type SharedStringSegment = TextSegment | Marker;\n\n/**\n * The Shared String is a specialized data structure for handling collaborative\n * text. It is based on a more general Sequence data structure but has\n * additional features that make working with text easier.\n *\n * In addition to text, a Shared String can also contain markers. Markers can be\n * used to store metadata at positions within the text, like the details of an\n * image or Fluid object that should be rendered with the text.\n * @alpha\n */\nexport class SharedStringClass\n\textends SharedSegmentSequence<SharedStringSegment>\n\timplements ISharedString\n{\n\tpublic get ISharedString(): ISharedString {\n\t\treturn this;\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate readonly mergeTreeTextHelper: IMergeTreeTextHelper;\n\n\tconstructor(\n\t\tdocument: IFluidDataStoreRuntime,\n\t\tpublic id: string,\n\t\tattributes: IChannelAttributes,\n\t) {\n\t\tsuper(document, id, attributes, SharedStringFactory.segmentFromSpec as any);\n\t\tthis.mergeTreeTextHelper = this.client.createTextHelper();\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.insertMarkerRelative}\n\t */\n\tpublic insertMarkerRelative(\n\t\trelativePos1: IRelativePosition,\n\t\trefType: ReferenceType,\n\t\tprops?: PropertySet,\n\t): void {\n\t\tconst segment = new Marker(refType);\n\t\tif (props) {\n\t\t\tsegment.addProperties(props);\n\t\t}\n\n\t\tconst pos = this.posFromRelativePos(relativePos1);\n\t\tthis.guardReentrancy(() => this.client.insertSegmentLocal(pos, segment));\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.insertMarker}\n\t */\n\tpublic insertMarker(pos: number, refType: ReferenceType, props?: PropertySet): void {\n\t\tconst segment = new Marker(refType);\n\t\tif (props) {\n\t\t\tsegment.addProperties(props);\n\t\t}\n\n\t\tthis.guardReentrancy(() => this.client.insertSegmentLocal(pos, segment));\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.insertTextRelative}\n\t */\n\tpublic insertTextRelative(\n\t\trelativePos1: IRelativePosition,\n\t\ttext: string,\n\t\tprops?: PropertySet,\n\t): void {\n\t\tconst segment = new TextSegment(text);\n\t\tif (props) {\n\t\t\tsegment.addProperties(props);\n\t\t}\n\n\t\tconst pos = this.posFromRelativePos(relativePos1);\n\t\tthis.guardReentrancy(() => this.client.insertSegmentLocal(pos, segment));\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.insertText}\n\t */\n\tpublic insertText(pos: number, text: string, props?: PropertySet): void {\n\t\tconst segment = new TextSegment(text);\n\t\tif (props) {\n\t\t\tsegment.addProperties(props);\n\t\t}\n\n\t\tthis.guardReentrancy(() => this.client.insertSegmentLocal(pos, segment));\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.replaceText}\n\t */\n\tpublic replaceText(start: number, end: number, text: string, props?: PropertySet): void {\n\t\tthis.replaceRange(start, end, TextSegment.make(text, props));\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.removeText}\n\t */\n\tpublic removeText(start: number, end: number): void {\n\t\tthis.removeRange(start, end);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.annotateMarker}\n\t */\n\tpublic annotateMarker(marker: Marker, props: PropertySet): void {\n\t\tthis.guardReentrancy(() => this.client.annotateMarker(marker, props));\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.searchForMarker}\n\t */\n\tpublic searchForMarker(\n\t\tstartPos: number,\n\t\tmarkerLabel: string,\n\t\tforwards = true,\n\t): Marker | undefined {\n\t\treturn this.client.searchForMarker(startPos, markerLabel, forwards);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.getText}\n\t */\n\tpublic getText(start?: number, end?: number) {\n\t\tconst segmentWindow = this.client.getCollabWindow();\n\t\treturn this.mergeTreeTextHelper.getText(\n\t\t\tsegmentWindow.currentSeq,\n\t\t\tsegmentWindow.clientId,\n\t\t\t\"\",\n\t\t\tstart,\n\t\t\tend,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.getTextWithPlaceholders}\n\t */\n\tpublic getTextWithPlaceholders(start?: number, end?: number) {\n\t\tconst segmentWindow = this.client.getCollabWindow();\n\t\treturn this.mergeTreeTextHelper.getText(\n\t\t\tsegmentWindow.currentSeq,\n\t\t\tsegmentWindow.clientId,\n\t\t\t\" \",\n\t\t\tstart,\n\t\t\tend,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.getTextRangeWithMarkers}\n\t */\n\tpublic getTextRangeWithMarkers(start: number, end: number) {\n\t\tconst segmentWindow = this.client.getCollabWindow();\n\t\treturn this.mergeTreeTextHelper.getText(\n\t\t\tsegmentWindow.currentSeq,\n\t\t\tsegmentWindow.clientId,\n\t\t\t\"*\",\n\t\t\tstart,\n\t\t\tend,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.getMarkerFromId}\n\t */\n\tpublic getMarkerFromId(id: string): ISegment | undefined {\n\t\treturn this.client.getMarkerFromId(id);\n\t}\n\n\t/**\n\t * Revert an op\n\t */\n\tprotected rollback(content: any, localOpMetadata: unknown): void {\n\t\tif (this.client.rollback !== undefined) {\n\t\t\tthis.client.rollback(content, localOpMetadata);\n\t\t} else {\n\t\t\tsuper.rollback(content, localOpMetadata);\n\t\t}\n\t}\n}\n\ninterface ITextAndMarkerAccumulator {\n\tparallelText: string[];\n\tparallelMarkers: Marker[];\n\tparallelMarkerLabel: string;\n\tplaceholder?: string;\n\ttagsInProgress: string[];\n\ttextSegment: TextSegment;\n}\n\n/**\n * Splits the text into regions ending with markers with the given `label`.\n * @param sharedString - String to retrieve text and markers from\n * @param label - label to split on\n * @returns Two parallel lists of text and markers, split by markers with the provided `label`.\n * For example:\n * ```typescript\n * // Say sharedstring has contents \"hello<paragraph marker 1>world<paragraph marker 2>missing\".\n * const { parallelText, parallelMarkers } = getTextAndMarkers(sharedString, \"paragraph\");\n * // parallelText === [\"hello\", \"world\"]\n * // parallelMarkers === [<paragraph marker 1 object>, <paragraph marker 2 object>]\n * // Note parallelText does not include \"missing\".\n * ```\n * @internal\n */\nexport function getTextAndMarkers(\n\tsharedString: ISharedString,\n\tlabel: string,\n\tstart?: number,\n\tend?: number,\n): {\n\tparallelText: string[];\n\tparallelMarkers: Marker[];\n} {\n\tconst accum: ITextAndMarkerAccumulator = {\n\t\tparallelMarkerLabel: label,\n\t\tparallelMarkers: [],\n\t\tparallelText: [],\n\t\ttagsInProgress: [],\n\t\ttextSegment: new TextSegment(\"\"),\n\t};\n\n\tsharedString.walkSegments(gatherTextAndMarkers, start, end, accum);\n\treturn { parallelText: accum.parallelText, parallelMarkers: accum.parallelMarkers };\n}\n\nconst gatherTextAndMarkers: ISegmentAction<ITextAndMarkerAccumulator> = (\n\tsegment: ISegment,\n\tpos: number,\n\trefSeq: number,\n\tclientId: number,\n\tstart: number,\n\tend: number,\n\taccumText: ITextAndMarkerAccumulator,\n) => {\n\tconst { placeholder, tagsInProgress, textSegment } = accumText;\n\tif (TextSegment.is(segment)) {\n\t\tlet beginTags = \"\";\n\t\tlet endTags = \"\";\n\t\t// TODO: let clients pass in function to get tag\n\t\tconst tags = [] as string[];\n\t\tconst initTags = [] as string[];\n\n\t\tif (segment.properties?.[\"font-weight\"]) {\n\t\t\ttags.push(\"b\");\n\t\t}\n\t\tif (segment.properties?.[\"text-decoration\"]) {\n\t\t\ttags.push(\"u\");\n\t\t}\n\t\tconst remTags = [] as string[];\n\t\tif (tags.length > 0) {\n\t\t\tfor (const tag of tags) {\n\t\t\t\tif (!tagsInProgress.includes(tag)) {\n\t\t\t\t\tbeginTags += `<${tag}>`;\n\t\t\t\t\tinitTags.push(tag);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const accumTag of tagsInProgress) {\n\t\t\t\tif (!tags.includes(accumTag)) {\n\t\t\t\t\tendTags += `</${accumTag}>`;\n\t\t\t\t\tremTags.push(accumTag);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const initTag of initTags.reverse()) {\n\t\t\t\ttagsInProgress.push(initTag);\n\t\t\t}\n\t\t} else {\n\t\t\tfor (const accumTag of tagsInProgress) {\n\t\t\t\tendTags += `</${accumTag}>`;\n\t\t\t\tremTags.push(accumTag);\n\t\t\t}\n\t\t}\n\t\tfor (const remTag of remTags) {\n\t\t\tconst remdex = tagsInProgress.indexOf(remTag);\n\t\t\tif (remdex >= 0) {\n\t\t\t\ttagsInProgress.splice(remdex, 1);\n\t\t\t}\n\t\t}\n\t\ttextSegment.text += endTags;\n\t\ttextSegment.text += beginTags;\n\t\tif (start <= 0 && end >= segment.text.length) {\n\t\t\ttextSegment.text += segment.text;\n\t\t} else {\n\t\t\tconst seglen = segment.text.length;\n\t\t\tconst _start = start < 0 ? 0 : start;\n\t\t\tconst _end = end >= seglen ? undefined : end;\n\t\t\ttextSegment.text += segment.text.substring(_start, _end);\n\t\t}\n\t} else {\n\t\tif (placeholder && placeholder.length > 0) {\n\t\t\tconst placeholderText =\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\t\tplaceholder === \"*\" ? `\\n${segment}` : placeholder.repeat(segment.cachedLength);\n\t\t\ttextSegment.text += placeholderText;\n\t\t} else {\n\t\t\tconst marker = segment as Marker;\n\t\t\tif (refHasTileLabel(marker, accumText.parallelMarkerLabel)) {\n\t\t\t\taccumText.parallelMarkers.push(marker);\n\t\t\t\taccumText.parallelText.push(textSegment.text);\n\t\t\t\ttextSegment.text = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\n};\n"]}
1
+ {"version":3,"file":"sharedString.js","sourceRoot":"","sources":["../src/sharedString.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAMN,MAAM,EAGN,WAAW,EACX,eAAe,GACf,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAA+B,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AA8G3D;;;;;;;;;;GAUG;AACH,MAAM,OAAO,iBACZ,SAAQ,qBAA0C;IAGlD,IAAW,aAAa;QACvB,OAAO,IAAI,CAAC;IACb,CAAC;IAKD,YACC,QAAgC,EACzB,EAAU,EACjB,UAA8B;QAE9B,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,mBAAmB,CAAC,eAAsB,CAAC,CAAC;QAHrE,OAAE,GAAF,EAAE,CAAQ;QAIjB,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAC3D,CAAC;IAED;;OAEG;IACI,oBAAoB,CAC1B,YAA+B,EAC/B,OAAsB,EACtB,KAAmB;QAEnB,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,KAAK,EAAE,CAAC;YACX,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,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YACpB,gEAAgE;YAChE,WAAW,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YACjF,WAAW,CAAC,IAAI,IAAI,eAAe,CAAC;QACrC,CAAC;aAAM,CAAC;YACP,MAAM,MAAM,GAAG,OAAiB,CAAC;YACjC,IAAI,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,mBAAmB,CAAC,EAAE,CAAC;gBAC5D,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACvC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBAC9C,WAAW,CAAC,IAAI,GAAG,EAAE,CAAC;YACvB,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\tIMergeTreeTextHelper,\n\tIRelativePosition,\n\tISegment,\n\tISegmentAction,\n\tMarker,\n\tPropertySet,\n\tReferenceType,\n\tTextSegment,\n\trefHasTileLabel,\n} from \"@fluidframework/merge-tree/internal\";\n\nimport { SharedSegmentSequence, type ISharedSegmentSequence } from \"./sequence.js\";\nimport { SharedStringFactory } from \"./sequenceFactory.js\";\n\n/**\n * Fluid object interface describing access methods on a SharedString\n * @legacy\n * @alpha\n */\nexport interface ISharedString extends ISharedSegmentSequence<SharedStringSegment> {\n\t/**\n\t * Inserts the text at the position.\n\t * @param pos - The position to insert the text at\n\t * @param text - The text to insert\n\t * @param props - The properties of the text\n\t */\n\tinsertText(pos: number, text: string, props?: PropertySet): void;\n\n\t/**\n\t * Inserts a marker at the position.\n\t * @param pos - The position to insert the marker at\n\t * @param refType - The reference type of the marker\n\t * @param props - The properties of the marker\n\t */\n\tinsertMarker(pos: number, refType: ReferenceType, props?: PropertySet): void;\n\n\t/**\n\t * Inserts a marker at a relative position.\n\t * @param relativePos1 - The relative position to insert the marker at\n\t * @param refType - The reference type of the marker\n\t * @param props - The properties of the marker\n\t */\n\tinsertMarkerRelative(\n\t\trelativePos1: IRelativePosition,\n\t\trefType: ReferenceType,\n\t\tprops?: PropertySet,\n\t): void;\n\n\t/**\n\t * Inserts the text at the position.\n\t * @param relativePos1 - The relative position to insert the text at\n\t * @param text - The text to insert\n\t * @param props - The properties of text\n\t */\n\tinsertTextRelative(relativePos1: IRelativePosition, text: string, props?: PropertySet): void;\n\n\t/**\n\t * Replaces a range with the provided text.\n\t * @param start - The inclusive start of the range to replace\n\t * @param end - The exclusive end of the range to replace\n\t * @param text - The text to replace the range with\n\t * @param props - Optional. The properties of the replacement text\n\t */\n\treplaceText(start: number, end: number, text: string, props?: PropertySet): void;\n\n\t/**\n\t * Removes the text in the given range.\n\t * @param start - The inclusive start of the range to remove\n\t * @param end - The exclusive end of the range to replace\n\t * @returns the message sent.\n\t */\n\tremoveText(start: number, end: number): void;\n\n\t/**\n\t * Annotates the marker with the provided properties.\n\t * @param marker - The marker to annotate\n\t * @param props - The properties to annotate the marker with\n\t */\n\tannotateMarker(marker: Marker, props: PropertySet): void;\n\n\t/**\n\t * Searches a string for the nearest marker in either direction to a given start position.\n\t * The search will include the start position, so markers at the start position are valid\n\t * results of the search.\n\t * @param startPos - Position at which to start the search\n\t * @param markerLabel - Label of the marker to search for\n\t * @param forwards - Whether the desired marker comes before (false) or after (true) `startPos`. Default true.\n\t */\n\tsearchForMarker(\n\t\tstartPos: number,\n\t\tmarkerLabel: string,\n\t\tforwards?: boolean,\n\t): Marker | undefined;\n\n\t/**\n\t * Retrieve text from the SharedString in string format.\n\t * @param start - The starting index of the text to retrieve, or 0 if omitted.\n\t * @param end - The ending index of the text to retrieve, or the end of the string if omitted\n\t * @returns The requested text content as a string.\n\t */\n\tgetText(start?: number, end?: number): string;\n\n\t/**\n\t * Adds spaces for markers and handles, so that position calculations account for them.\n\t */\n\tgetTextWithPlaceholders(start?: number, end?: number): string;\n\n\tgetTextRangeWithMarkers(start: number, end: number): string;\n\n\t/**\n\t * Looks up and returns a `Marker` using its id. Returns `undefined` if there is no marker with the provided\n\t * id in this `SharedString`.\n\t */\n\tgetMarkerFromId(id: string): ISegment | undefined;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport type SharedStringSegment = TextSegment | Marker;\n\n/**\n * The Shared String is a specialized data structure for handling collaborative\n * text. It is based on a more general Sequence data structure but has\n * additional features that make working with text easier.\n *\n * In addition to text, a Shared String can also contain markers. Markers can be\n * used to store metadata at positions within the text, like the details of an\n * image or Fluid object that should be rendered with the text.\n * @legacy\n * @alpha\n */\nexport class SharedStringClass\n\textends SharedSegmentSequence<SharedStringSegment>\n\timplements ISharedString\n{\n\tpublic get ISharedString(): ISharedString {\n\t\treturn this;\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate readonly mergeTreeTextHelper: IMergeTreeTextHelper;\n\n\tconstructor(\n\t\tdocument: IFluidDataStoreRuntime,\n\t\tpublic id: string,\n\t\tattributes: IChannelAttributes,\n\t) {\n\t\tsuper(document, id, attributes, SharedStringFactory.segmentFromSpec as any);\n\t\tthis.mergeTreeTextHelper = this.client.createTextHelper();\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.insertMarkerRelative}\n\t */\n\tpublic insertMarkerRelative(\n\t\trelativePos1: IRelativePosition,\n\t\trefType: ReferenceType,\n\t\tprops?: PropertySet,\n\t): void {\n\t\tconst segment = new Marker(refType);\n\t\tif (props) {\n\t\t\tsegment.addProperties(props);\n\t\t}\n\n\t\tconst pos = this.posFromRelativePos(relativePos1);\n\t\tthis.guardReentrancy(() => this.client.insertSegmentLocal(pos, segment));\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.insertMarker}\n\t */\n\tpublic insertMarker(pos: number, refType: ReferenceType, props?: PropertySet): void {\n\t\tconst segment = new Marker(refType);\n\t\tif (props) {\n\t\t\tsegment.addProperties(props);\n\t\t}\n\n\t\tthis.guardReentrancy(() => this.client.insertSegmentLocal(pos, segment));\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.insertTextRelative}\n\t */\n\tpublic insertTextRelative(\n\t\trelativePos1: IRelativePosition,\n\t\ttext: string,\n\t\tprops?: PropertySet,\n\t): void {\n\t\tconst segment = new TextSegment(text);\n\t\tif (props) {\n\t\t\tsegment.addProperties(props);\n\t\t}\n\n\t\tconst pos = this.posFromRelativePos(relativePos1);\n\t\tthis.guardReentrancy(() => this.client.insertSegmentLocal(pos, segment));\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.insertText}\n\t */\n\tpublic insertText(pos: number, text: string, props?: PropertySet): void {\n\t\tconst segment = new TextSegment(text);\n\t\tif (props) {\n\t\t\tsegment.addProperties(props);\n\t\t}\n\n\t\tthis.guardReentrancy(() => this.client.insertSegmentLocal(pos, segment));\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.replaceText}\n\t */\n\tpublic replaceText(start: number, end: number, text: string, props?: PropertySet): void {\n\t\tthis.replaceRange(start, end, TextSegment.make(text, props));\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.removeText}\n\t */\n\tpublic removeText(start: number, end: number): void {\n\t\tthis.removeRange(start, end);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.annotateMarker}\n\t */\n\tpublic annotateMarker(marker: Marker, props: PropertySet): void {\n\t\tthis.guardReentrancy(() => this.client.annotateMarker(marker, props));\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.searchForMarker}\n\t */\n\tpublic searchForMarker(\n\t\tstartPos: number,\n\t\tmarkerLabel: string,\n\t\tforwards = true,\n\t): Marker | undefined {\n\t\treturn this.client.searchForMarker(startPos, markerLabel, forwards);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.getText}\n\t */\n\tpublic getText(start?: number, end?: number) {\n\t\tconst segmentWindow = this.client.getCollabWindow();\n\t\treturn this.mergeTreeTextHelper.getText(\n\t\t\tsegmentWindow.currentSeq,\n\t\t\tsegmentWindow.clientId,\n\t\t\t\"\",\n\t\t\tstart,\n\t\t\tend,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.getTextWithPlaceholders}\n\t */\n\tpublic getTextWithPlaceholders(start?: number, end?: number) {\n\t\tconst segmentWindow = this.client.getCollabWindow();\n\t\treturn this.mergeTreeTextHelper.getText(\n\t\t\tsegmentWindow.currentSeq,\n\t\t\tsegmentWindow.clientId,\n\t\t\t\" \",\n\t\t\tstart,\n\t\t\tend,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.getTextRangeWithMarkers}\n\t */\n\tpublic getTextRangeWithMarkers(start: number, end: number) {\n\t\tconst segmentWindow = this.client.getCollabWindow();\n\t\treturn this.mergeTreeTextHelper.getText(\n\t\t\tsegmentWindow.currentSeq,\n\t\t\tsegmentWindow.clientId,\n\t\t\t\"*\",\n\t\t\tstart,\n\t\t\tend,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.getMarkerFromId}\n\t */\n\tpublic getMarkerFromId(id: string): ISegment | undefined {\n\t\treturn this.client.getMarkerFromId(id);\n\t}\n\n\t/**\n\t * Revert an op\n\t */\n\tprotected rollback(content: any, localOpMetadata: unknown): void {\n\t\tif (this.client.rollback !== undefined) {\n\t\t\tthis.client.rollback(content, localOpMetadata);\n\t\t} else {\n\t\t\tsuper.rollback(content, localOpMetadata);\n\t\t}\n\t}\n}\n\ninterface ITextAndMarkerAccumulator {\n\tparallelText: string[];\n\tparallelMarkers: Marker[];\n\tparallelMarkerLabel: string;\n\tplaceholder?: string;\n\ttagsInProgress: string[];\n\ttextSegment: TextSegment;\n}\n\n/**\n * Splits the text into regions ending with markers with the given `label`.\n * @param sharedString - String to retrieve text and markers from\n * @param label - label to split on\n * @returns Two parallel lists of text and markers, split by markers with the provided `label`.\n * For example:\n * ```typescript\n * // Say sharedstring has contents \"hello<paragraph marker 1>world<paragraph marker 2>missing\".\n * const { parallelText, parallelMarkers } = getTextAndMarkers(sharedString, \"paragraph\");\n * // parallelText === [\"hello\", \"world\"]\n * // parallelMarkers === [<paragraph marker 1 object>, <paragraph marker 2 object>]\n * // Note parallelText does not include \"missing\".\n * ```\n * @internal\n */\nexport function getTextAndMarkers(\n\tsharedString: ISharedString,\n\tlabel: string,\n\tstart?: number,\n\tend?: number,\n): {\n\tparallelText: string[];\n\tparallelMarkers: Marker[];\n} {\n\tconst accum: ITextAndMarkerAccumulator = {\n\t\tparallelMarkerLabel: label,\n\t\tparallelMarkers: [],\n\t\tparallelText: [],\n\t\ttagsInProgress: [],\n\t\ttextSegment: new TextSegment(\"\"),\n\t};\n\n\tsharedString.walkSegments(gatherTextAndMarkers, start, end, accum);\n\treturn { parallelText: accum.parallelText, parallelMarkers: accum.parallelMarkers };\n}\n\nconst gatherTextAndMarkers: ISegmentAction<ITextAndMarkerAccumulator> = (\n\tsegment: ISegment,\n\tpos: number,\n\trefSeq: number,\n\tclientId: number,\n\tstart: number,\n\tend: number,\n\taccumText: ITextAndMarkerAccumulator,\n) => {\n\tconst { placeholder, tagsInProgress, textSegment } = accumText;\n\tif (TextSegment.is(segment)) {\n\t\tlet beginTags = \"\";\n\t\tlet endTags = \"\";\n\t\t// TODO: let clients pass in function to get tag\n\t\tconst tags = [] as string[];\n\t\tconst initTags = [] as string[];\n\n\t\tif (segment.properties?.[\"font-weight\"]) {\n\t\t\ttags.push(\"b\");\n\t\t}\n\t\tif (segment.properties?.[\"text-decoration\"]) {\n\t\t\ttags.push(\"u\");\n\t\t}\n\t\tconst remTags = [] as string[];\n\t\tif (tags.length > 0) {\n\t\t\tfor (const tag of tags) {\n\t\t\t\tif (!tagsInProgress.includes(tag)) {\n\t\t\t\t\tbeginTags += `<${tag}>`;\n\t\t\t\t\tinitTags.push(tag);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const accumTag of tagsInProgress) {\n\t\t\t\tif (!tags.includes(accumTag)) {\n\t\t\t\t\tendTags += `</${accumTag}>`;\n\t\t\t\t\tremTags.push(accumTag);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const initTag of initTags.reverse()) {\n\t\t\t\ttagsInProgress.push(initTag);\n\t\t\t}\n\t\t} else {\n\t\t\tfor (const accumTag of tagsInProgress) {\n\t\t\t\tendTags += `</${accumTag}>`;\n\t\t\t\tremTags.push(accumTag);\n\t\t\t}\n\t\t}\n\t\tfor (const remTag of remTags) {\n\t\t\tconst remdex = tagsInProgress.indexOf(remTag);\n\t\t\tif (remdex >= 0) {\n\t\t\t\ttagsInProgress.splice(remdex, 1);\n\t\t\t}\n\t\t}\n\t\ttextSegment.text += endTags;\n\t\ttextSegment.text += beginTags;\n\t\tif (start <= 0 && end >= segment.text.length) {\n\t\t\ttextSegment.text += segment.text;\n\t\t} else {\n\t\t\tconst seglen = segment.text.length;\n\t\t\tconst _start = start < 0 ? 0 : start;\n\t\t\tconst _end = end >= seglen ? undefined : end;\n\t\t\ttextSegment.text += segment.text.substring(_start, _end);\n\t\t}\n\t} else {\n\t\tif (placeholder && placeholder.length > 0) {\n\t\t\tconst placeholderText =\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\t\tplaceholder === \"*\" ? `\\n${segment}` : placeholder.repeat(segment.cachedLength);\n\t\t\ttextSegment.text += placeholderText;\n\t\t} else {\n\t\t\tconst marker = segment as Marker;\n\t\t\tif (refHasTileLabel(marker, accumText.parallelMarkerLabel)) {\n\t\t\t\taccumText.parallelMarkers.push(marker);\n\t\t\t\taccumText.parallelText.push(textSegment.text);\n\t\t\t\ttextSegment.text = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/sequence",
3
- "version": "2.0.2",
3
+ "version": "2.1.0-276326",
4
4
  "description": "Distributed sequence",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -87,33 +87,33 @@
87
87
  "temp-directory": "nyc/.nyc_output"
88
88
  },
89
89
  "dependencies": {
90
- "@fluid-internal/client-utils": "~2.0.2",
91
- "@fluidframework/core-interfaces": "~2.0.2",
92
- "@fluidframework/core-utils": "~2.0.2",
93
- "@fluidframework/datastore-definitions": "~2.0.2",
94
- "@fluidframework/driver-definitions": "~2.0.2",
95
- "@fluidframework/merge-tree": "~2.0.2",
96
- "@fluidframework/runtime-definitions": "~2.0.2",
97
- "@fluidframework/runtime-utils": "~2.0.2",
98
- "@fluidframework/shared-object-base": "~2.0.2",
99
- "@fluidframework/telemetry-utils": "~2.0.2",
90
+ "@fluid-internal/client-utils": "2.1.0-276326",
91
+ "@fluidframework/core-interfaces": "2.1.0-276326",
92
+ "@fluidframework/core-utils": "2.1.0-276326",
93
+ "@fluidframework/datastore-definitions": "2.1.0-276326",
94
+ "@fluidframework/driver-definitions": "2.1.0-276326",
95
+ "@fluidframework/merge-tree": "2.1.0-276326",
96
+ "@fluidframework/runtime-definitions": "2.1.0-276326",
97
+ "@fluidframework/runtime-utils": "2.1.0-276326",
98
+ "@fluidframework/shared-object-base": "2.1.0-276326",
99
+ "@fluidframework/telemetry-utils": "2.1.0-276326",
100
100
  "double-ended-queue": "^2.1.0-0",
101
101
  "uuid": "^9.0.0"
102
102
  },
103
103
  "devDependencies": {
104
104
  "@arethetypeswrong/cli": "^0.15.2",
105
105
  "@biomejs/biome": "^1.7.3",
106
- "@fluid-internal/mocha-test-setup": "~2.0.2",
107
- "@fluid-private/stochastic-test-utils": "~2.0.2",
108
- "@fluid-private/test-dds-utils": "~2.0.2",
106
+ "@fluid-internal/mocha-test-setup": "2.1.0-276326",
107
+ "@fluid-private/stochastic-test-utils": "2.1.0-276326",
108
+ "@fluid-private/test-dds-utils": "2.1.0-276326",
109
109
  "@fluid-tools/benchmark": "^0.48.0",
110
110
  "@fluid-tools/build-cli": "^0.39.0",
111
111
  "@fluidframework/build-common": "^2.0.3",
112
112
  "@fluidframework/build-tools": "^0.39.0",
113
- "@fluidframework/container-definitions": "~2.0.2",
113
+ "@fluidframework/container-definitions": "2.1.0-276326",
114
114
  "@fluidframework/eslint-config-fluid": "^5.3.0",
115
- "@fluidframework/sequence-previous": "npm:@fluidframework/sequence@2.0.0-rc.4.0.0",
116
- "@fluidframework/test-runtime-utils": "~2.0.2",
115
+ "@fluidframework/sequence-previous": "npm:@fluidframework/sequence@2.0.0-rc.5.0.0",
116
+ "@fluidframework/test-runtime-utils": "2.1.0-276326",
117
117
  "@microsoft/api-extractor": "^7.45.1",
118
118
  "@types/diff": "^3.5.1",
119
119
  "@types/double-ended-queue": "^2.1.0",
@@ -146,72 +146,21 @@
146
146
  },
147
147
  "typeValidation": {
148
148
  "broken": {
149
- "RemovedClassDeclaration_SharedString": {
150
- "backCompat": false,
151
- "forwardCompat": false
152
- },
153
- "RemovedClassDeclaration_SharedStringFactory": {
154
- "backCompat": false,
155
- "forwardCompat": false
156
- },
157
- "ClassDeclaration_BaseSegment": {
158
- "forwardCompat": false
159
- },
160
- "InterfaceDeclaration_ISegment": {
161
- "forwardCompat": false
162
- },
163
- "InterfaceDeclaration_ISequenceDeltaRange": {
164
- "forwardCompat": false
165
- },
166
- "ClassDeclaration_Marker": {
167
- "forwardCompat": false
168
- },
169
- "TypeAliasDeclaration_SharedStringSegment": {
170
- "forwardCompat": false
171
- },
172
- "ClassDeclaration_SubSequence": {
173
- "forwardCompat": false
174
- },
175
- "ClassDeclaration_TextSegment": {
176
- "forwardCompat": false
177
- },
178
- "ClassDeclaration_TrackingGroup": {
179
- "forwardCompat": false
180
- },
181
- "InterfaceDeclaration_ISharedString": {
149
+ "InterfaceDeclaration_SequenceOptions": {
182
150
  "backCompat": false
183
- },
184
- "TypeAliasDeclaration_SharedString": {
185
- "backCompat": false
186
- },
187
- "ClassDeclaration_SharedStringClass": {
188
- "backCompat": false
189
- },
190
- "TypeAliasDeclaration_IntervalRevertible": {
191
- "forwardCompat": false
192
- },
193
- "ClassDeclaration_SequenceDeltaEvent": {
194
- "forwardCompat": false
195
- },
196
- "ClassDeclaration_SequenceEvent": {
197
- "forwardCompat": false
198
- },
199
- "ClassDeclaration_SequenceMaintenanceEvent": {
200
- "forwardCompat": false
201
- },
202
- "TypeAliasDeclaration_SharedStringRevertible": {
203
- "forwardCompat": false
204
151
  }
205
152
  }
206
153
  },
207
154
  "scripts": {
208
155
  "api": "fluid-build . --task api",
209
- "api-extractor:commonjs": "flub generate entrypoints --outFileAlpha legacy --outDir ./dist",
210
- "api-extractor:esnext": "flub generate entrypoints --outFileAlpha legacy --outDir ./lib --node10TypeCompat",
156
+ "api-extractor:commonjs": "flub generate entrypoints --outDir ./dist",
157
+ "api-extractor:esnext": "flub generate entrypoints --outDir ./lib --node10TypeCompat",
211
158
  "build": "fluid-build . --task build",
212
159
  "build:commonjs": "fluid-build . --task commonjs",
213
160
  "build:compile": "fluid-build . --task compile",
214
- "build:docs": "api-extractor run --local",
161
+ "build:docs": "concurrently \"npm:build:docs:*\"",
162
+ "build:docs:current": "api-extractor run --local",
163
+ "build:docs:legacy": "api-extractor run --local --config api-extractor/api-extractor.legacy.json",
215
164
  "build:esnext": "tsc --project ./tsconfig.json",
216
165
  "build:genver": "gen-version",
217
166
  "build:test": "npm run build:test:esm && npm run build:test:cjs",
@@ -229,7 +178,9 @@
229
178
  "check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
230
179
  "check:format": "npm run check:biome",
231
180
  "check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
232
- "ci:build:docs": "api-extractor run",
181
+ "ci:build:docs": "concurrently \"npm:ci:build:docs:*\"",
182
+ "ci:build:docs:current": "api-extractor run",
183
+ "ci:build:docs:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
233
184
  "clean": "rimraf --glob dist lib \"*.d.ts\" \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
234
185
  "eslint": "eslint --format stylish src",
235
186
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
@@ -252,7 +203,7 @@
252
203
  "test:newsnapfiles": "node lib/test/createSnapshotFiles.js",
253
204
  "test:stress": "cross-env FUZZ_TEST_COUNT=100 FUZZ_STRESS_RUN=true mocha --ignore \"lib/test/memory/**/*\" --recursive \"lib/test/**/*.fuzz.spec.*js\" -r @fluid-internal/mocha-test-setup",
254
205
  "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
255
- "typetests:gen": "flub generate typetests --dir . -v --publicFallback",
206
+ "typetests:gen": "flub generate typetests --dir . -v",
256
207
  "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
257
208
  }
258
209
  }
@@ -88,6 +88,7 @@ import {
88
88
  * If a SequencePlace is the endpoint of a range (e.g. start/end of an interval or search range),
89
89
  * the Side value means it is exclusive if it is nearer to the other position and inclusive if it is farther.
90
90
  * E.g. the start of a range with Side.After is exclusive of the character at the position.
91
+ * @legacy
91
92
  * @alpha
92
93
  */
93
94
  export type SequencePlace = number | "start" | "end" | InteriorSequencePlace;
@@ -96,6 +97,7 @@ export type SequencePlace = number | "start" | "end" | InteriorSequencePlace;
96
97
  * A sequence place that does not refer to the special endpoint segments.
97
98
  *
98
99
  * See {@link SequencePlace} for additional context.
100
+ * @legacy
99
101
  * @alpha
100
102
  */
101
103
  export interface InteriorSequencePlace {
@@ -107,6 +109,7 @@ export interface InteriorSequencePlace {
107
109
  * Defines a side relative to a character in a sequence.
108
110
  *
109
111
  * @remarks See {@link SequencePlace} for additional context on usage.
112
+ * @legacy
110
113
  * @alpha
111
114
  */
112
115
  export enum Side {
@@ -639,6 +642,7 @@ export function makeOpsMap<T extends ISerializableInterval>(): Map<
639
642
  }
640
643
 
641
644
  /**
645
+ * @legacy
642
646
  * @alpha
643
647
  */
644
648
  export type DeserializeCallback = (properties: PropertySet) => void;
@@ -678,6 +682,7 @@ class IntervalCollectionIterator<TInterval extends ISerializableInterval>
678
682
 
679
683
  /**
680
684
  * Change events emitted by `IntervalCollection`s
685
+ * @legacy
681
686
  * @alpha
682
687
  */
683
688
  export interface IIntervalCollectionEvent<TInterval extends ISerializableInterval>
@@ -763,6 +768,7 @@ export interface IIntervalCollectionEvent<TInterval extends ISerializableInterva
763
768
  /**
764
769
  * Collection of intervals that supports addition, modification, removal, and efficient spatial querying.
765
770
  * Changes to this collection will be incur updates on collaborating clients (i.e. they are not local-only).
771
+ * @legacy
766
772
  * @alpha
767
773
  */
768
774
  export interface IIntervalCollection<TInterval extends ISerializableInterval>