@fluidframework/sequence 1.3.0 → 2.0.0-dev.1.4.5.105745
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.js +12 -0
- package/README.md +19 -18
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/intervalCollection.d.ts +51 -18
- package/dist/intervalCollection.d.ts.map +1 -1
- package/dist/intervalCollection.js +117 -73
- package/dist/intervalCollection.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/sequence.d.ts +13 -22
- package/dist/sequence.d.ts.map +1 -1
- package/dist/sequence.js +11 -32
- package/dist/sequence.js.map +1 -1
- package/dist/sequenceDeltaEvent.d.ts +0 -6
- package/dist/sequenceDeltaEvent.d.ts.map +1 -1
- package/dist/sequenceDeltaEvent.js +0 -1
- package/dist/sequenceDeltaEvent.js.map +1 -1
- package/dist/sharedIntervalCollection.d.ts +5 -5
- package/dist/sharedIntervalCollection.js +5 -5
- package/dist/sharedIntervalCollection.js.map +1 -1
- package/dist/sharedString.d.ts +30 -1
- package/dist/sharedString.d.ts.map +1 -1
- package/dist/sharedString.js +40 -5
- package/dist/sharedString.js.map +1 -1
- package/dist/sparsematrix.d.ts +28 -15
- package/dist/sparsematrix.d.ts.map +1 -1
- package/dist/sparsematrix.js +24 -13
- package/dist/sparsematrix.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/intervalCollection.d.ts +51 -18
- package/lib/intervalCollection.d.ts.map +1 -1
- package/lib/intervalCollection.js +116 -73
- package/lib/intervalCollection.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/sequence.d.ts +13 -22
- package/lib/sequence.d.ts.map +1 -1
- package/lib/sequence.js +12 -33
- package/lib/sequence.js.map +1 -1
- package/lib/sequenceDeltaEvent.d.ts +0 -6
- package/lib/sequenceDeltaEvent.d.ts.map +1 -1
- package/lib/sequenceDeltaEvent.js +0 -1
- package/lib/sequenceDeltaEvent.js.map +1 -1
- package/lib/sharedIntervalCollection.d.ts +5 -5
- package/lib/sharedIntervalCollection.js +5 -5
- package/lib/sharedIntervalCollection.js.map +1 -1
- package/lib/sharedString.d.ts +30 -1
- package/lib/sharedString.d.ts.map +1 -1
- package/lib/sharedString.js +38 -4
- package/lib/sharedString.js.map +1 -1
- package/lib/sparsematrix.d.ts +28 -15
- package/lib/sparsematrix.d.ts.map +1 -1
- package/lib/sparsematrix.js +24 -13
- package/lib/sparsematrix.js.map +1 -1
- package/package.json +70 -25
- package/src/index.ts +3 -1
- package/src/intervalCollection.ts +209 -97
- package/src/packageVersion.ts +1 -1
- package/src/sequence.ts +12 -41
- package/src/sequenceDeltaEvent.ts +0 -7
- package/src/sharedIntervalCollection.ts +5 -5
- package/src/sharedString.ts +44 -6
- package/src/sparsematrix.ts +48 -35
package/lib/sharedString.js
CHANGED
|
@@ -147,6 +147,9 @@ export class SharedString extends SharedSegmentSequence {
|
|
|
147
147
|
findTile(startPos, tileLabel, preceding = true) {
|
|
148
148
|
return this.client.findTile(startPos, tileLabel, preceding);
|
|
149
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* @deprecated Use the free function {@link getTextAndMarkers} exported by this package instead.
|
|
152
|
+
*/
|
|
150
153
|
getTextAndMarkers(label) {
|
|
151
154
|
const segmentWindow = this.client.getCollabWindow();
|
|
152
155
|
return this.mergeTreeTextHelper.getTextAndMarkers(segmentWindow.currentSeq, segmentWindow.clientId, label);
|
|
@@ -164,13 +167,15 @@ export class SharedString extends SharedSegmentSequence {
|
|
|
164
167
|
/**
|
|
165
168
|
* Adds spaces for markers and handles, so that position calculations account for them.
|
|
166
169
|
*/
|
|
167
|
-
getTextWithPlaceholders() {
|
|
170
|
+
getTextWithPlaceholders(start, end) {
|
|
168
171
|
const segmentWindow = this.client.getCollabWindow();
|
|
169
|
-
return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, " ");
|
|
172
|
+
return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, " ", start, end);
|
|
170
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* @deprecated Use {@link SharedString.getTextWithPlaceholders} instead.
|
|
176
|
+
*/
|
|
171
177
|
getTextRangeWithPlaceholders(start, end) {
|
|
172
|
-
|
|
173
|
-
return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, " ", start, end);
|
|
178
|
+
return this.getTextWithPlaceholders(start, end);
|
|
174
179
|
}
|
|
175
180
|
getTextRangeWithMarkers(start, end) {
|
|
176
181
|
const segmentWindow = this.client.getCollabWindow();
|
|
@@ -179,5 +184,34 @@ export class SharedString extends SharedSegmentSequence {
|
|
|
179
184
|
getMarkerFromId(id) {
|
|
180
185
|
return this.client.getMarkerFromId(id);
|
|
181
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Revert an op
|
|
189
|
+
*/
|
|
190
|
+
rollback(content, localOpMetadata) {
|
|
191
|
+
if (this.client.rollback !== undefined) {
|
|
192
|
+
this.client.rollback(content, localOpMetadata);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
super.rollback(content, localOpMetadata);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Splits the text into regions ending with markers with the given `label`.
|
|
201
|
+
* @param sharedString - String to retrieve text and markers from
|
|
202
|
+
* @param label - label to split on
|
|
203
|
+
* @returns Two parallel lists of text and markers, split by markers with the provided `label`.
|
|
204
|
+
*
|
|
205
|
+
* For example:
|
|
206
|
+
* ```typescript
|
|
207
|
+
* // Say sharedstring has contents "hello<paragraph marker 1>world<paragraph marker 2>missing".
|
|
208
|
+
* const { parallelText, parallelMarkers } = getTextAndMarkers(sharedString, "paragraph");
|
|
209
|
+
* // parallelText === ["hello", "world"]
|
|
210
|
+
* // parallelMarkers === [<paragraph marker 1 object>, <paragraph marker 2 object>]
|
|
211
|
+
* // Note parallelText does not include "missing".
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
export function getTextAndMarkers(sharedString, label) {
|
|
215
|
+
return sharedString.getTextAndMarkers(label);
|
|
182
216
|
}
|
|
183
217
|
//# sourceMappingURL=sharedString.js.map
|
package/lib/sharedString.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedString.js","sourceRoot":"","sources":["../src/sharedString.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAMH,MAAM,EAKN,WAAW,GACd,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AA8BxD;;;;;;;;;GASG;AACH,MAAM,OAAO,YAAa,SAAQ,qBAA0C;IAyBxE,YAAY,QAAgC,EAAS,EAAU,EAAE,UAA8B;QAC3F,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;QADpB,OAAE,GAAF,EAAE,CAAQ;QAE3D,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAC9D,CAAC;IA3BD;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAC7D,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,mBAAmB,CAAC,IAAI,CAAiB,CAAC;IAC/E,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,UAAU;QACpB,OAAO,IA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C,OAAO,CAAC,aAAa,CAAC,UAAU,EAAE,aAAa,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC/G,CAAC;IAEM,uBAAuB,CAAC,KAAa,EAAE,GAAW;QACrD,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,EAAE,aAAa,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC/G,CAAC;IAEM,eAAe,CAAC,EAAU;QAC7B,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC3C,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n ICombiningOp,\n IMergeTreeInsertMsg,\n IMergeTreeRemoveMsg,\n IRelativePosition,\n ISegment,\n Marker,\n MergeTreeTextHelper,\n PropertySet,\n ReferencePosition,\n ReferenceType,\n TextSegment,\n} from \"@fluidframework/merge-tree\";\nimport { IFluidDataStoreRuntime, IChannelAttributes } from \"@fluidframework/datastore-definitions\";\nimport { SharedSegmentSequence } from \"./sequence\";\nimport { SharedStringFactory } from \"./sequenceFactory\";\n\n/**\n * Fluid object interface describing access methods on a SharedString\n */\nexport interface ISharedString extends SharedSegmentSequence<SharedStringSegment> {\n /**\n * Inserts the text at the position.\n * @param pos - The position to insert the text at\n * @param text - The text to insert\n * @param props - The properties of the text\n */\n insertText(pos: number, text: string, props?: PropertySet): void;\n\n /**\n * Inserts a marker at the position.\n * @param pos - The position to insert the marker at\n * @param refType - The reference type of the marker\n * @param props - The properties of the marker\n */\n insertMarker(pos: number, refType: ReferenceType, props?: PropertySet): IMergeTreeInsertMsg;\n\n /**\n * {@inheritDoc SharedSegmentSequence.posFromRelativePos}\n */\n posFromRelativePos(relativePos: IRelativePosition): number;\n}\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 *\n */\nexport class SharedString extends SharedSegmentSequence<SharedStringSegment> implements ISharedString {\n /**\n * Create a new shared string.\n * @param runtime - data store runtime the new shared string belongs to\n * @param id - optional name of the shared string\n * @returns newly create shared string (but not attached yet)\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string) {\n return runtime.createChannel(id, SharedStringFactory.Type) as SharedString;\n }\n\n /**\n * Get a factory for SharedString to register with the data store.\n * @returns a factory that creates and load SharedString\n */\n public static getFactory() {\n return new SharedStringFactory();\n }\n\n public get ISharedString(): ISharedString {\n return this;\n }\n\n private readonly mergeTreeTextHelper: MergeTreeTextHelper;\n\n constructor(document: IFluidDataStoreRuntime, public id: string, attributes: IChannelAttributes) {\n super(document, id, attributes, SharedStringFactory.segmentFromSpec);\n this.mergeTreeTextHelper = this.client.createTextHelper();\n }\n\n /**\n * Inserts a marker at a relative position.\n * @param relativePos1 - The relative position to insert the marker at\n * @param refType - The reference type of the marker\n * @param props - The properties of the marker\n */\n public insertMarkerRelative(\n relativePos1: IRelativePosition,\n refType: ReferenceType,\n props?: PropertySet) {\n const segment = new Marker(refType);\n if (props) {\n segment.addProperties(props);\n }\n\n const pos = this.posFromRelativePos(relativePos1);\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n /**\n * {@inheritDoc ISharedString.insertMarker}\n */\n public insertMarker(\n pos: number,\n refType: ReferenceType,\n props?: PropertySet): IMergeTreeInsertMsg {\n const segment = new Marker(refType);\n if (props) {\n segment.addProperties(props);\n }\n\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n return insertOp;\n }\n\n /**\n * Inserts the text at the position.\n * @param relativePos1 - The relative position to insert the text at\n * @param text - The text to insert\n * @param props - The properties of text\n */\n public insertTextRelative(relativePos1: IRelativePosition, text: string, props?: PropertySet) {\n const segment = new TextSegment(text);\n if (props) {\n segment.addProperties(props);\n }\n\n const pos = this.posFromRelativePos(relativePos1);\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n /**\n * {@inheritDoc ISharedString.insertText}\n */\n public insertText(pos: number, text: string, props?: PropertySet) {\n const segment = new TextSegment(text);\n if (props) {\n segment.addProperties(props);\n }\n\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n /**\n * Replaces a range with the provided text.\n * @param start - The inclusive start of the range to replace\n * @param end - The exclusive end of the range to replace\n * @param text - The text to replace the range with\n * @param props - Optional. The properties of the replacement text\n */\n public replaceText(start: number, end: number, text: string, props?: PropertySet) {\n this.replaceRange(start, end, TextSegment.make(text, props));\n }\n\n /**\n * Removes the text in the given range.\n * @param start - The inclusive start of the range to remove\n * @param end - The exclusive end of the range to replace\n * @returns the message sent.\n */\n public removeText(start: number, end: number): IMergeTreeRemoveMsg {\n return this.removeRange(start, end);\n }\n\n /**\n * Annotates the marker with the provided properties and calls the callback on consensus.\n * @param marker - The marker to annotate\n * @param props - The properties to annotate the marker with\n * @param consensusCallback - The callback called when consensus is reached\n */\n public annotateMarkerNotifyConsensus(\n marker: Marker,\n props: PropertySet,\n callback: (m: Marker) => void) {\n const annotateOp = this.client.annotateMarkerNotifyConsensus(marker, props, callback);\n if (annotateOp) {\n this.submitSequenceMessage(annotateOp);\n }\n }\n\n /**\n * Annotates the marker with the provided properties.\n * @param marker - The marker to annotate\n * @param props - The properties to annotate the marker with\n * @param combiningOp - Optional. Specifies how to combine values for the property, such as \"incr\" for increment.\n */\n public annotateMarker(\n marker: Marker,\n props: PropertySet,\n combiningOp?: ICombiningOp) {\n const annotateOp = this.client.annotateMarker(marker, props, combiningOp);\n if (annotateOp) {\n this.submitSequenceMessage(annotateOp);\n }\n }\n\n public findTile(startPos: number | undefined, tileLabel: string, preceding = true): {\n tile: ReferencePosition;\n pos: number;\n } {\n return this.client.findTile(startPos, tileLabel, preceding);\n }\n\n public getTextAndMarkers(label: string) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getTextAndMarkers(segmentWindow.currentSeq, segmentWindow.clientId, label);\n }\n\n /**\n * Retrieve text from the SharedString in string format.\n * @param start - The starting index of the text to retrieve, or 0 if omitted.\n * @param end - The ending index of the text to retrieve, or the end of the string if omitted\n * @returns The requested text content as a string.\n */\n public getText(start?: number, end?: number) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, \"\", start, end);\n }\n\n /**\n * Adds spaces for markers and handles, so that position calculations account for them.\n */\n public getTextWithPlaceholders() {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, \" \");\n }\n\n public getTextRangeWithPlaceholders(start: number, end: number) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, \" \", start, end);\n }\n\n public getTextRangeWithMarkers(start: number, end: number) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, \"*\", start, end);\n }\n\n public getMarkerFromId(id: string): ISegment {\n return this.client.getMarkerFromId(id);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sharedString.js","sourceRoot":"","sources":["../src/sharedString.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAOH,MAAM,EAIN,WAAW,GACd,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAE,MAA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,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;SAC5C;IACL,CAAC;CACJ;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAAC,YAA0B,EAAE,KAAa;IAIvE,OAAO,YAAY,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n ICombiningOp,\n IMergeTreeInsertMsg,\n IMergeTreeRemoveMsg,\n IMergeTreeTextHelper,\n IRelativePosition,\n ISegment,\n Marker,\n PropertySet,\n ReferencePosition,\n ReferenceType,\n TextSegment,\n} from \"@fluidframework/merge-tree\";\nimport { IFluidDataStoreRuntime, IChannelAttributes } from \"@fluidframework/datastore-definitions\";\nimport { SharedSegmentSequence } from \"./sequence\";\nimport { SharedStringFactory } from \"./sequenceFactory\";\n\n/**\n * Fluid object interface describing access methods on a SharedString\n */\nexport interface ISharedString extends SharedSegmentSequence<SharedStringSegment> {\n /**\n * Inserts the text at the position.\n * @param pos - The position to insert the text at\n * @param text - The text to insert\n * @param props - The properties of the text\n */\n insertText(pos: number, text: string, props?: PropertySet): void;\n\n /**\n * Inserts a marker at the position.\n * @param pos - The position to insert the marker at\n * @param refType - The reference type of the marker\n * @param props - The properties of the marker\n */\n insertMarker(pos: number, refType: ReferenceType, props?: PropertySet): IMergeTreeInsertMsg;\n\n /**\n * {@inheritDoc SharedSegmentSequence.posFromRelativePos}\n */\n posFromRelativePos(relativePos: IRelativePosition): number;\n}\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 *\n */\nexport class SharedString extends SharedSegmentSequence<SharedStringSegment> implements ISharedString {\n /**\n * Create a new shared string.\n * @param runtime - data store runtime the new shared string belongs to\n * @param id - optional name of the shared string\n * @returns newly create shared string (but not attached yet)\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string) {\n return runtime.createChannel(id, SharedStringFactory.Type) as SharedString;\n }\n\n /**\n * Get a factory for SharedString to register with the data store.\n * @returns a factory that creates and load SharedString\n */\n public static getFactory() {\n return new SharedStringFactory();\n }\n\n public get ISharedString(): ISharedString {\n return this;\n }\n\n private readonly mergeTreeTextHelper: IMergeTreeTextHelper;\n\n constructor(document: IFluidDataStoreRuntime, public id: string, attributes: IChannelAttributes) {\n super(document, id, attributes, SharedStringFactory.segmentFromSpec);\n this.mergeTreeTextHelper = this.client.createTextHelper();\n }\n\n /**\n * Inserts a marker at a relative position.\n * @param relativePos1 - The relative position to insert the marker at\n * @param refType - The reference type of the marker\n * @param props - The properties of the marker\n */\n public insertMarkerRelative(\n relativePos1: IRelativePosition,\n refType: ReferenceType,\n props?: PropertySet) {\n const segment = new Marker(refType);\n if (props) {\n segment.addProperties(props);\n }\n\n const pos = this.posFromRelativePos(relativePos1);\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n /**\n * {@inheritDoc ISharedString.insertMarker}\n */\n public insertMarker(\n pos: number,\n refType: ReferenceType,\n props?: PropertySet): IMergeTreeInsertMsg {\n const segment = new Marker(refType);\n if (props) {\n segment.addProperties(props);\n }\n\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n return insertOp;\n }\n\n /**\n * Inserts the text at the position.\n * @param relativePos1 - The relative position to insert the text at\n * @param text - The text to insert\n * @param props - The properties of text\n */\n public insertTextRelative(relativePos1: IRelativePosition, text: string, props?: PropertySet) {\n const segment = new TextSegment(text);\n if (props) {\n segment.addProperties(props);\n }\n\n const pos = this.posFromRelativePos(relativePos1);\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n /**\n * {@inheritDoc ISharedString.insertText}\n */\n public insertText(pos: number, text: string, props?: PropertySet) {\n const segment = new TextSegment(text);\n if (props) {\n segment.addProperties(props);\n }\n\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n /**\n * Replaces a range with the provided text.\n * @param start - The inclusive start of the range to replace\n * @param end - The exclusive end of the range to replace\n * @param text - The text to replace the range with\n * @param props - Optional. The properties of the replacement text\n */\n public replaceText(start: number, end: number, text: string, props?: PropertySet) {\n this.replaceRange(start, end, TextSegment.make(text, props));\n }\n\n /**\n * Removes the text in the given range.\n * @param start - The inclusive start of the range to remove\n * @param end - The exclusive end of the range to replace\n * @returns the message sent.\n */\n public removeText(start: number, end: number): IMergeTreeRemoveMsg {\n return this.removeRange(start, end);\n }\n\n /**\n * Annotates the marker with the provided properties and calls the callback on consensus.\n * @param marker - The marker to annotate\n * @param props - The properties to annotate the marker with\n * @param consensusCallback - The callback called when consensus is reached\n */\n public annotateMarkerNotifyConsensus(\n marker: Marker,\n props: PropertySet,\n callback: (m: Marker) => void) {\n const annotateOp = this.client.annotateMarkerNotifyConsensus(marker, props, callback);\n if (annotateOp) {\n this.submitSequenceMessage(annotateOp);\n }\n }\n\n /**\n * Annotates the marker with the provided properties.\n * @param marker - The marker to annotate\n * @param props - The properties to annotate the marker with\n * @param combiningOp - Optional. Specifies how to combine values for the property, such as \"incr\" for increment.\n */\n public annotateMarker(\n marker: Marker,\n props: PropertySet,\n combiningOp?: ICombiningOp) {\n const annotateOp = this.client.annotateMarker(marker, props, combiningOp);\n if (annotateOp) {\n this.submitSequenceMessage(annotateOp);\n }\n }\n\n public findTile(startPos: number | undefined, tileLabel: string, preceding = true): {\n tile: ReferencePosition;\n pos: number;\n } {\n return this.client.findTile(startPos, tileLabel, preceding);\n }\n\n /**\n * @deprecated Use the free function {@link getTextAndMarkers} exported by this package instead.\n */\n public getTextAndMarkers(label: string) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getTextAndMarkers(segmentWindow.currentSeq, segmentWindow.clientId, label);\n }\n\n /**\n * Retrieve text from the SharedString in string format.\n * @param start - The starting index of the text to retrieve, or 0 if omitted.\n * @param end - The ending index of the text to retrieve, or the end of the string if omitted\n * @returns The requested text content as a string.\n */\n public getText(start?: number, end?: number) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, \"\", start, end);\n }\n\n /**\n * Adds spaces for markers and handles, so that position calculations account for them.\n */\n public getTextWithPlaceholders(start?: number, end?: number) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, \" \", start, end);\n }\n\n /**\n * @deprecated Use {@link SharedString.getTextWithPlaceholders} instead.\n */\n public getTextRangeWithPlaceholders(start: number, end: number) {\n return this.getTextWithPlaceholders(start, end);\n }\n\n public getTextRangeWithMarkers(start: number, end: number) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, \"*\", start, end);\n }\n\n public getMarkerFromId(id: string): ISegment {\n return this.client.getMarkerFromId(id);\n }\n\n /**\n * Revert an op\n */\n protected rollback(content: any, localOpMetadata: unknown): void {\n if (this.client.rollback !== undefined) {\n this.client.rollback(content, localOpMetadata);\n } else {\n super.rollback(content, localOpMetadata);\n }\n }\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 *\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 */\nexport function getTextAndMarkers(sharedString: SharedString, label: string): {\n parallelText: string[];\n parallelMarkers: Marker[];\n} {\n return sharedString.getTextAndMarkers(label);\n}\n"]}
|
package/lib/sparsematrix.d.ts
CHANGED
|
@@ -8,10 +8,11 @@ import { IChannelAttributes, IFluidDataStoreRuntime, IChannelServices, IChannelF
|
|
|
8
8
|
import { ISharedObject } from "@fluidframework/shared-object-base";
|
|
9
9
|
import { SharedSegmentSequence, SubSequence } from "./";
|
|
10
10
|
/**
|
|
11
|
-
* An empty segment that occupies 'cachedLength' positions.
|
|
12
|
-
* to "pad" a run of unoccupied cells.
|
|
11
|
+
* An empty segment that occupies 'cachedLength' positions.
|
|
12
|
+
* {@link SparseMatrix} uses `PaddingSegment` to "pad" a run of unoccupied cells.
|
|
13
13
|
*
|
|
14
|
-
* @deprecated PaddingSegment is part of an abandoned prototype.
|
|
14
|
+
* @deprecated `PaddingSegment` is part of an abandoned prototype.
|
|
15
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
15
16
|
*/
|
|
16
17
|
export declare class PaddingSegment extends BaseSegment {
|
|
17
18
|
static readonly typeString = "PaddingSegment";
|
|
@@ -31,11 +32,13 @@ export declare class PaddingSegment extends BaseSegment {
|
|
|
31
32
|
protected createSplitSegmentAt(pos: number): PaddingSegment;
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
|
-
* @deprecated SparseMatrixItem is part of an abandoned prototype.
|
|
35
|
+
* @deprecated `SparseMatrixItem` is part of an abandoned prototype.
|
|
36
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
35
37
|
*/
|
|
36
38
|
export declare type SparseMatrixItem = Serializable;
|
|
37
39
|
/**
|
|
38
|
-
* @deprecated RunSegment is part of an abandoned prototype.
|
|
40
|
+
* @deprecated `RunSegment` is part of an abandoned prototype.
|
|
41
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
39
42
|
*/
|
|
40
43
|
export declare class RunSegment extends SubSequence<SparseMatrixItem> {
|
|
41
44
|
items: SparseMatrixItem[];
|
|
@@ -53,42 +56,51 @@ export declare class RunSegment extends SubSequence<SparseMatrixItem> {
|
|
|
53
56
|
protected createSplitSegmentAt(pos: number): RunSegment;
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
56
|
-
* @deprecated MatrixSegment is part of an abandoned prototype.
|
|
59
|
+
* @deprecated `MatrixSegment` is part of an abandoned prototype.
|
|
60
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
57
61
|
*/
|
|
58
62
|
export declare type MatrixSegment = RunSegment | PaddingSegment;
|
|
59
63
|
/**
|
|
60
|
-
* @deprecated maxCol is part of an abandoned prototype.
|
|
64
|
+
* @deprecated `maxCol` is part of an abandoned prototype.
|
|
65
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
61
66
|
*/
|
|
62
67
|
export declare const maxCol = 2097152;
|
|
63
68
|
/**
|
|
64
|
-
* @deprecated maxCols is part of an abandoned prototype.
|
|
69
|
+
* @deprecated `maxCols` is part of an abandoned prototype.
|
|
70
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
65
71
|
*/
|
|
66
72
|
export declare const maxCols: number;
|
|
67
73
|
/**
|
|
68
|
-
* @deprecated maxRow is part of an abandoned prototype.
|
|
74
|
+
* @deprecated `maxRow` is part of an abandoned prototype.
|
|
75
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
69
76
|
*/
|
|
70
77
|
export declare const maxRow = 4294967295;
|
|
71
78
|
/**
|
|
72
|
-
* @deprecated maxRows is part of an abandoned prototype.
|
|
79
|
+
* @deprecated `maxRows` is part of an abandoned prototype.
|
|
80
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
73
81
|
*/
|
|
74
82
|
export declare const maxRows: number;
|
|
75
83
|
/**
|
|
76
|
-
* @deprecated maxCellPosition is part of an abandoned prototype.
|
|
84
|
+
* @deprecated `maxCellPosition` is part of an abandoned prototype.
|
|
85
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
77
86
|
*/
|
|
78
87
|
export declare const maxCellPosition: number;
|
|
79
88
|
/**
|
|
80
|
-
* @deprecated positionToRowCol is part of an abandoned prototype.
|
|
89
|
+
* @deprecated `positionToRowCol` is part of an abandoned prototype.
|
|
90
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
81
91
|
*/
|
|
82
92
|
export declare const rowColToPosition: (row: number, col: number) => number;
|
|
83
93
|
/**
|
|
84
|
-
* @deprecated positionToRowCol is part of an abandoned prototype.
|
|
94
|
+
* @deprecated `positionToRowCol` is part of an abandoned prototype.
|
|
95
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
85
96
|
*/
|
|
86
97
|
export declare function positionToRowCol(position: number): {
|
|
87
98
|
row: number;
|
|
88
99
|
col: number;
|
|
89
100
|
};
|
|
90
101
|
/**
|
|
91
|
-
* @deprecated SparseMatrix is an abandoned prototype.
|
|
102
|
+
* @deprecated `SparseMatrix` is an abandoned prototype.
|
|
103
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
92
104
|
*/
|
|
93
105
|
export declare class SparseMatrix extends SharedSegmentSequence<MatrixSegment> {
|
|
94
106
|
id: string;
|
|
@@ -122,7 +134,8 @@ export declare class SparseMatrix extends SharedSegmentSequence<MatrixSegment> {
|
|
|
122
134
|
private getSegment;
|
|
123
135
|
}
|
|
124
136
|
/**
|
|
125
|
-
* @deprecated SparseMatrixFactory is an abandoned prototype.
|
|
137
|
+
* @deprecated `SparseMatrixFactory` is an abandoned prototype.
|
|
138
|
+
* Use {@link @fluidframework/matrix#SharedMatrixFactory} instead.
|
|
126
139
|
*/
|
|
127
140
|
export declare class SparseMatrixFactory implements IChannelFactory {
|
|
128
141
|
static Type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sparsematrix.d.ts","sourceRoot":"","sources":["../src/sparsematrix.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACH,WAAW,EAEX,YAAY,EACZ,QAAQ,EAER,WAAW,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,QAAQ,EACX,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnE,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"sparsematrix.d.ts","sourceRoot":"","sources":["../src/sparsematrix.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACH,WAAW,EAEX,YAAY,EACZ,QAAQ,EAER,WAAW,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,QAAQ,EACX,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnE,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAExD;;;;;;GAMG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC3C,gBAAuB,UAAU,oBAAoB;WACvC,EAAE,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,IAAI,cAAc;WAGhD,cAAc,CAAC,IAAI,EAAE,GAAG;IAUtC,SAAgB,IAAI,oBAA6B;gBAErC,IAAI,EAAE,MAAM;IAKjB,YAAY;;;;IAIZ,KAAK,CAAC,KAAK,SAAI,EAAE,GAAG,CAAC,EAAE,MAAM;IAM7B,SAAS,CAAC,OAAO,EA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OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,UAAU;CAIrB;AAED;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IACvD,OAAc,IAAI,SAA+D;IAEjF,OAAc,UAAU,EAAE,kBAAkB,CAI1C;WAEY,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,QAAQ;IAc3D,IAAW,IAAI,WAEd;IAED,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CACb,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC/B,OAAO,CAAC,aAAa,CAAC;IAMlB,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;CAK7E"}
|
package/lib/sparsematrix.js
CHANGED
|
@@ -6,10 +6,11 @@ import { BaseSegment, createGroupOp, LocalReferenceCollection, } from "@fluidfra
|
|
|
6
6
|
import { pkgVersion } from "./packageVersion";
|
|
7
7
|
import { SharedSegmentSequence, SubSequence } from "./";
|
|
8
8
|
/**
|
|
9
|
-
* An empty segment that occupies 'cachedLength' positions.
|
|
10
|
-
* to "pad" a run of unoccupied cells.
|
|
9
|
+
* An empty segment that occupies 'cachedLength' positions.
|
|
10
|
+
* {@link SparseMatrix} uses `PaddingSegment` to "pad" a run of unoccupied cells.
|
|
11
11
|
*
|
|
12
|
-
* @deprecated PaddingSegment is part of an abandoned prototype.
|
|
12
|
+
* @deprecated `PaddingSegment` is part of an abandoned prototype.
|
|
13
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
13
14
|
*/
|
|
14
15
|
export class PaddingSegment extends BaseSegment {
|
|
15
16
|
constructor(size) {
|
|
@@ -67,7 +68,8 @@ export class PaddingSegment extends BaseSegment {
|
|
|
67
68
|
}
|
|
68
69
|
PaddingSegment.typeString = "PaddingSegment";
|
|
69
70
|
/**
|
|
70
|
-
* @deprecated RunSegment is part of an abandoned prototype.
|
|
71
|
+
* @deprecated `RunSegment` is part of an abandoned prototype.
|
|
72
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
71
73
|
*/
|
|
72
74
|
export class RunSegment extends SubSequence {
|
|
73
75
|
constructor(items) {
|
|
@@ -134,31 +136,38 @@ export class RunSegment extends SubSequence {
|
|
|
134
136
|
}
|
|
135
137
|
RunSegment.typeString = "RunSegment";
|
|
136
138
|
/**
|
|
137
|
-
* @deprecated maxCol is part of an abandoned prototype.
|
|
139
|
+
* @deprecated `maxCol` is part of an abandoned prototype.
|
|
140
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
138
141
|
*/
|
|
139
142
|
export const maxCol = 0x200000; // X128 Excel maximum of 16,384 columns
|
|
140
143
|
/**
|
|
141
|
-
* @deprecated maxCols is part of an abandoned prototype.
|
|
144
|
+
* @deprecated `maxCols` is part of an abandoned prototype.
|
|
145
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
142
146
|
*/
|
|
143
147
|
export const maxCols = maxCol + 1;
|
|
144
148
|
/**
|
|
145
|
-
* @deprecated maxRow is part of an abandoned prototype.
|
|
149
|
+
* @deprecated `maxRow` is part of an abandoned prototype.
|
|
150
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
146
151
|
*/
|
|
147
152
|
export const maxRow = 0xFFFFFFFF; // X4096 Excel maximum of 1,048,576 rows
|
|
148
153
|
/**
|
|
149
|
-
* @deprecated maxRows is part of an abandoned prototype.
|
|
154
|
+
* @deprecated `maxRows` is part of an abandoned prototype.
|
|
155
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
150
156
|
*/
|
|
151
157
|
export const maxRows = maxRow + 1;
|
|
152
158
|
/**
|
|
153
|
-
* @deprecated maxCellPosition is part of an abandoned prototype.
|
|
159
|
+
* @deprecated `maxCellPosition` is part of an abandoned prototype.
|
|
160
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
154
161
|
*/
|
|
155
162
|
export const maxCellPosition = maxCol * maxRow;
|
|
156
163
|
/**
|
|
157
|
-
* @deprecated positionToRowCol is part of an abandoned prototype.
|
|
164
|
+
* @deprecated `positionToRowCol` is part of an abandoned prototype.
|
|
165
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
158
166
|
*/
|
|
159
167
|
export const rowColToPosition = (row, col) => row * maxCols + col;
|
|
160
168
|
/**
|
|
161
|
-
* @deprecated positionToRowCol is part of an abandoned prototype.
|
|
169
|
+
* @deprecated `positionToRowCol` is part of an abandoned prototype.
|
|
170
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
162
171
|
*/
|
|
163
172
|
export function positionToRowCol(position) {
|
|
164
173
|
const row = Math.floor(position / maxCols);
|
|
@@ -166,7 +175,8 @@ export function positionToRowCol(position) {
|
|
|
166
175
|
return { row, col };
|
|
167
176
|
}
|
|
168
177
|
/**
|
|
169
|
-
* @deprecated SparseMatrix is an abandoned prototype.
|
|
178
|
+
* @deprecated `SparseMatrix` is an abandoned prototype.
|
|
179
|
+
* Use {@link @fluidframework/matrix#SharedMatrix} instead.
|
|
170
180
|
*/
|
|
171
181
|
export class SparseMatrix extends SharedSegmentSequence {
|
|
172
182
|
constructor(document, id, attributes) {
|
|
@@ -280,7 +290,8 @@ export class SparseMatrix extends SharedSegmentSequence {
|
|
|
280
290
|
}
|
|
281
291
|
}
|
|
282
292
|
/**
|
|
283
|
-
* @deprecated SparseMatrixFactory is an abandoned prototype.
|
|
293
|
+
* @deprecated `SparseMatrixFactory` is an abandoned prototype.
|
|
294
|
+
* Use {@link @fluidframework/matrix#SharedMatrixFactory} instead.
|
|
284
295
|
*/
|
|
285
296
|
export class SparseMatrixFactory {
|
|
286
297
|
static segmentFromSpec(spec) {
|
package/lib/sparsematrix.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sparsematrix.js","sourceRoot":"","sources":["../src/sparsematrix.ts"],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AAc,EAAE,UAAU;CAC7B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n BaseSegment,\n createGroupOp,\n IJSONSegment,\n ISegment,\n LocalReferenceCollection,\n PropertySet,\n} from \"@fluidframework/merge-tree\";\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelServices,\n IChannelFactory,\n Serializable,\n Jsonable,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { SharedSegmentSequence, SubSequence } from \"./\";\n\n/**\n * An empty segment that occupies 'cachedLength' positions. SparseMatrix uses PaddingSegment\n * to \"pad\" a run of unoccupied cells.\n *\n * @deprecated PaddingSegment is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport class PaddingSegment extends BaseSegment {\n public static readonly typeString = \"PaddingSegment\";\n public static is(segment: ISegment): segment is PaddingSegment {\n return segment.type === PaddingSegment.typeString;\n }\n public static fromJSONObject(spec: any) {\n if (spec && typeof spec === \"object\" && \"pad\" in spec) {\n const segment = new PaddingSegment(spec.pad);\n if (spec.props) {\n segment.addProperties(spec.props);\n }\n return segment;\n }\n return undefined;\n }\n public readonly type = PaddingSegment.typeString;\n\n constructor(size: number) {\n super();\n this.cachedLength = size;\n }\n\n public toJSONObject() {\n return { pad: this.cachedLength, props: this.properties };\n }\n\n public clone(start = 0, end?: number) {\n const b = new PaddingSegment(this.cachedLength);\n this.cloneInto(b);\n return b;\n }\n\n public canAppend(segment: ISegment) {\n return PaddingSegment.is(segment);\n }\n\n public toString() {\n return `[padding: ${this.cachedLength}]`;\n }\n\n public append(segment: ISegment) {\n if (!PaddingSegment.is(segment)) {\n throw new Error(\"can only append padding segment\");\n }\n\n // Note: Must call 'appendLocalRefs' before modifying this segment's length as\n // 'this.cachedLength' is used to adjust the offsets of the local refs.\n LocalReferenceCollection.append(this, segment);\n\n this.cachedLength += segment.cachedLength;\n }\n\n // Returns true if entire run removed\n public removeRange(start: number, end: number) {\n this.cachedLength -= (end - start);\n return (this.cachedLength === 0);\n }\n\n protected createSplitSegmentAt(pos: number) {\n const leftLength = pos;\n const rightLength = this.cachedLength - pos;\n\n this.cachedLength = leftLength;\n return new PaddingSegment(rightLength);\n }\n}\n\n/**\n * @deprecated SparseMatrixItem is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport type SparseMatrixItem = Serializable;\n\n/**\n * @deprecated RunSegment is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport class RunSegment extends SubSequence<SparseMatrixItem> {\n public static readonly typeString = \"RunSegment\";\n public static is(segment: ISegment): segment is RunSegment {\n return segment.type === RunSegment.typeString;\n }\n public static fromJSONObject(spec: any) {\n if (spec && typeof spec === \"object\" && \"items\" in spec) {\n const segment = new RunSegment(spec.items);\n if (spec.props) {\n segment.addProperties(spec.props);\n }\n return segment;\n }\n return undefined;\n }\n public readonly type = RunSegment.typeString;\n\n private tags: any[];\n\n constructor(public items: SparseMatrixItem[]) {\n super(items);\n this.tags = new Array(items.length).fill(undefined);\n }\n\n public clone(start = 0, end?: number) {\n const b = new RunSegment(this.items.slice(start, end));\n if (this.tags) {\n b.tags = this.tags.slice(start, end);\n }\n this.cloneInto(b);\n return b;\n }\n\n public append(segment: ISegment) {\n super.append(segment);\n\n const asRun = segment as RunSegment;\n if (asRun.tags) {\n if (this.tags) {\n this.tags.splice(this.items.length, 0, ...asRun.tags);\n }\n }\n\n return this;\n }\n\n // TODO: retain removed items for undo\n // returns true if entire run removed\n public removeRange(start: number, end: number) {\n this.tags.splice(start, end - start);\n return super.removeRange(start, end);\n }\n\n public getTag(pos: number) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this.tags[pos];\n }\n\n public setTag(pos: number, tag: any) {\n this.tags[pos] = tag;\n }\n\n protected createSplitSegmentAt(pos: number) {\n if (pos > 0) {\n const remainingItems = this.items.slice(pos);\n this.items = this.items.slice(0, pos);\n this.cachedLength = this.items.length;\n\n const leafSegment = new RunSegment(remainingItems);\n leafSegment.tags = this.tags.slice(pos);\n this.tags.length = pos;\n\n return leafSegment;\n }\n }\n}\n\n/**\n * @deprecated MatrixSegment is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport type MatrixSegment = RunSegment | PaddingSegment;\n\n/**\n * @deprecated maxCol is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport const maxCol = 0x200000; // X128 Excel maximum of 16,384 columns\n\n/**\n * @deprecated maxCols is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport const maxCols = maxCol + 1;\n\n/**\n * @deprecated maxRow is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport const maxRow = 0xFFFFFFFF; // X4096 Excel maximum of 1,048,576 rows\n\n/**\n * @deprecated maxRows is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport const maxRows = maxRow + 1;\n\n/**\n * @deprecated maxCellPosition is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport const maxCellPosition = maxCol * maxRow;\n\n/**\n * @deprecated positionToRowCol is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport const rowColToPosition = (row: number, col: number) => row * maxCols + col;\n\n/**\n * @deprecated positionToRowCol is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport function positionToRowCol(position: number) {\n const row = Math.floor(position / maxCols);\n const col = position - (row * maxCols);\n return { row, col };\n}\n\n/**\n * @deprecated SparseMatrix is an abandoned prototype. Use SharedMatrix instead.\n */\nexport class SparseMatrix extends SharedSegmentSequence<MatrixSegment> {\n /**\n * Create a new sparse matrix\n *\n * @param runtime - data store runtime the new sparse matrix belongs to\n * @param id - optional name of the sparse matrix\n * @returns newly create sparse matrix (but not attached yet)\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string) {\n return runtime.createChannel(id, SparseMatrixFactory.Type) as SparseMatrix;\n }\n\n /**\n * Get a factory for SharedMap to register with the data store.\n *\n * @returns a factory that creates and load SharedMap\n */\n public static getFactory(): IChannelFactory {\n return new SparseMatrixFactory();\n }\n\n constructor(document: IFluidDataStoreRuntime, public id: string, attributes: IChannelAttributes) {\n super(document, id, attributes, SparseMatrixFactory.segmentFromSpec);\n }\n\n public get numRows() {\n return positionToRowCol(this.getLength()).row;\n }\n\n public setItems(\n row: number,\n col: number,\n values: SparseMatrixItem[],\n props?: PropertySet,\n ) {\n const start = rowColToPosition(row, col);\n const end = start + values.length;\n const segment = new RunSegment(values);\n if (props) {\n segment.addProperties(props);\n }\n\n this.replaceRange(start, end, segment);\n }\n\n public getItem(row: number, col: number):\n // The return type is defined explicitly here to prevent TypeScript from generating dynamic imports\n Jsonable<string | number | boolean | IFluidHandle> {\n const pos = rowColToPosition(row, col);\n const { segment, offset } = this.getContainingSegment(pos);\n if (segment && RunSegment.is(segment)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return segment.items[offset];\n } else if (segment && PaddingSegment.is(segment)) {\n return undefined;\n }\n\n throw new Error(`Unrecognized Segment type`);\n }\n\n public getTag(row: number, col: number) {\n const { segment, offset } = this.getSegment(row, col);\n if (RunSegment.is(segment)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return segment.getTag(offset);\n }\n return undefined;\n }\n\n public setTag(row: number, col: number, tag: any) {\n const { segment, offset } = this.getSegment(row, col);\n if (RunSegment.is(segment)) {\n segment.setTag(offset, tag);\n } else if (tag !== undefined) {\n throw new Error(`Must not attempt to set tags on '${segment.constructor.name}'.`);\n }\n }\n\n public insertRows(row: number, numRows: number) {\n const pos = rowColToPosition(row, 0);\n const size = maxCols * numRows;\n const segment = new PaddingSegment(size);\n\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n public removeRows(row: number, numRows: number) {\n const pos = rowColToPosition(row, 0);\n const size = maxCols * numRows;\n this.removeRange(pos, pos + size);\n }\n\n public insertCols(col: number, numCols: number) {\n this.moveAsPadding(maxCol - numCols, col, numCols);\n }\n\n public removeCols(col: number, numCols: number) {\n this.moveAsPadding(col, maxCol - numCols, numCols);\n }\n\n public annotatePosition(row: number, col: number, props: PropertySet) {\n const pos = rowColToPosition(row, col);\n this.annotateRange(pos, pos + 1, props);\n }\n\n public getPositionProperties(row: number, col: number) {\n const pos = rowColToPosition(row, col);\n return this.getPropertiesAtPosition(pos);\n }\n\n // For each row, moves 'numCols' items starting from 'srcCol' and inserts 'numCols' padding\n // at 'destCol'. Used by insertCols and removeCols.\n private moveAsPadding(srcCol: number, destCol: number, numCols: number) {\n const removeColStart = srcCol;\n const removeColEnd = srcCol + numCols;\n const ops = [];\n\n for (let r = 0, rowStart = 0; r < this.numRows; r++, rowStart += maxCols) {\n ops.push(this.client.removeRangeLocal(rowStart + removeColStart, rowStart + removeColEnd));\n const insertPos = rowStart + destCol;\n const segment = new PaddingSegment(numCols);\n ops.push(this.client.insertSegmentLocal(insertPos, segment));\n }\n\n this.submitSequenceMessage(createGroupOp(...ops));\n }\n\n private getSegment(row: number, col: number) {\n const pos = rowColToPosition(row, col);\n return this.getContainingSegment(pos);\n }\n}\n\n/**\n * @deprecated SparseMatrixFactory is an abandoned prototype. Use SharedMatrixFactory instead.\n */\nexport class SparseMatrixFactory implements IChannelFactory {\n public static Type = \"https://graph.microsoft.com/types/mergeTree/sparse-matrix\";\n\n public static Attributes: IChannelAttributes = {\n type: SparseMatrixFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: pkgVersion,\n };\n\n public static segmentFromSpec(spec: IJSONSegment): ISegment {\n const maybePadding = PaddingSegment.fromJSONObject(spec);\n if (maybePadding) {\n return maybePadding;\n }\n\n const maybeRun = RunSegment.fromJSONObject(spec);\n if (maybeRun) {\n return maybeRun;\n }\n\n throw new Error(`Unrecognized IJSONObject: '${JSON.stringify(spec)}'`);\n }\n\n public get type() {\n return SparseMatrixFactory.Type;\n }\n\n public get attributes() {\n return SparseMatrixFactory.Attributes;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n */\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n ): Promise<ISharedObject> {\n const sharedObject = new SparseMatrix(runtime, id, attributes);\n await sharedObject.load(services);\n return sharedObject;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string): ISharedObject {\n const sharedObject = new SparseMatrix(document, id, this.attributes);\n sharedObject.initializeLocal();\n return sharedObject;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sparsematrix.js","sourceRoot":"","sources":["../src/sparsematrix.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACH,WAAW,EACX,aAAa,EAGb,wBAAwB,GAE3B,MAAM,4BAA4B,CAAC;AAUpC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IAiB3C,YAAY,IAAY;QACpB,KAAK,EAAE,CAAC;QAHI,SAAI,GAAG,cAAc,CAAC,UAAU,CAAC;QAI7C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC7B,CAAC;IAlBM,MAAM,CAAC,EAAE,CAAC,OAAiB;QAC9B,OAAO,OAAO,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,CAAC;IACtD,CAAC;IACM,MAAM,CAAC,cAAc,CAAC,IAAS;QAClC,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,IAAI,IAAI,EAAE;YACnD,MAAM,OAAO,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC7C,IAAI,IAAI,CAAC,KAAK,EAAE;gBACZ,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACrC;YACD,OAAO,OAAO,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,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClC,OAAO,YAAY,CAAC;IACxB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACtD,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,QAAQ,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACrE,YAAY,CAAC,eAAe,EAAE,CAAC;QAC/B,OAAO,YAAY,CAAC;IACxB,CAAC;;AAhDa,wBAAI,GAAG,2DAA2D,CAAC;AAEnE,8BAAU,GAAuB;IAC3C,IAAI,EAAE,mBAAmB,CAAC,IAAI;IAC9B,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC7B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n BaseSegment,\n createGroupOp,\n IJSONSegment,\n ISegment,\n LocalReferenceCollection,\n PropertySet,\n} from \"@fluidframework/merge-tree\";\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelServices,\n IChannelFactory,\n Serializable,\n Jsonable,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { SharedSegmentSequence, SubSequence } from \"./\";\n\n/**\n * An empty segment that occupies 'cachedLength' positions.\n * {@link SparseMatrix} uses `PaddingSegment` to \"pad\" a run of unoccupied cells.\n *\n * @deprecated `PaddingSegment` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\nexport class PaddingSegment extends BaseSegment {\n public static readonly typeString = \"PaddingSegment\";\n public static is(segment: ISegment): segment is PaddingSegment {\n return segment.type === PaddingSegment.typeString;\n }\n public static fromJSONObject(spec: any) {\n if (spec && typeof spec === \"object\" && \"pad\" in spec) {\n const segment = new PaddingSegment(spec.pad);\n if (spec.props) {\n segment.addProperties(spec.props);\n }\n return segment;\n }\n return undefined;\n }\n public readonly type = PaddingSegment.typeString;\n\n constructor(size: number) {\n super();\n this.cachedLength = size;\n }\n\n public toJSONObject() {\n return { pad: this.cachedLength, props: this.properties };\n }\n\n public clone(start = 0, end?: number) {\n const b = new PaddingSegment(this.cachedLength);\n this.cloneInto(b);\n return b;\n }\n\n public canAppend(segment: ISegment) {\n return PaddingSegment.is(segment);\n }\n\n public toString() {\n return `[padding: ${this.cachedLength}]`;\n }\n\n public append(segment: ISegment) {\n if (!PaddingSegment.is(segment)) {\n throw new Error(\"can only append padding segment\");\n }\n\n // Note: Must call 'appendLocalRefs' before modifying this segment's length as\n // 'this.cachedLength' is used to adjust the offsets of the local refs.\n LocalReferenceCollection.append(this, segment);\n\n this.cachedLength += segment.cachedLength;\n }\n\n // Returns true if entire run removed\n public removeRange(start: number, end: number) {\n this.cachedLength -= (end - start);\n return (this.cachedLength === 0);\n }\n\n protected createSplitSegmentAt(pos: number) {\n const leftLength = pos;\n const rightLength = this.cachedLength - pos;\n\n this.cachedLength = leftLength;\n return new PaddingSegment(rightLength);\n }\n}\n\n/**\n * @deprecated `SparseMatrixItem` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\nexport type SparseMatrixItem = Serializable;\n\n/**\n * @deprecated `RunSegment` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\nexport class RunSegment extends SubSequence<SparseMatrixItem> {\n public static readonly typeString = \"RunSegment\";\n public static is(segment: ISegment): segment is RunSegment {\n return segment.type === RunSegment.typeString;\n }\n public static fromJSONObject(spec: any) {\n if (spec && typeof spec === \"object\" && \"items\" in spec) {\n const segment = new RunSegment(spec.items);\n if (spec.props) {\n segment.addProperties(spec.props);\n }\n return segment;\n }\n return undefined;\n }\n public readonly type = RunSegment.typeString;\n\n private tags: any[];\n\n constructor(public items: SparseMatrixItem[]) {\n super(items);\n this.tags = new Array(items.length).fill(undefined);\n }\n\n public clone(start = 0, end?: number) {\n const b = new RunSegment(this.items.slice(start, end));\n if (this.tags) {\n b.tags = this.tags.slice(start, end);\n }\n this.cloneInto(b);\n return b;\n }\n\n public append(segment: ISegment) {\n super.append(segment);\n\n const asRun = segment as RunSegment;\n if (asRun.tags) {\n if (this.tags) {\n this.tags.splice(this.items.length, 0, ...asRun.tags);\n }\n }\n\n return this;\n }\n\n // TODO: retain removed items for undo\n // returns true if entire run removed\n public removeRange(start: number, end: number) {\n this.tags.splice(start, end - start);\n return super.removeRange(start, end);\n }\n\n public getTag(pos: number) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this.tags[pos];\n }\n\n public setTag(pos: number, tag: any) {\n this.tags[pos] = tag;\n }\n\n protected createSplitSegmentAt(pos: number) {\n if (pos > 0) {\n const remainingItems = this.items.slice(pos);\n this.items = this.items.slice(0, pos);\n this.cachedLength = this.items.length;\n\n const leafSegment = new RunSegment(remainingItems);\n leafSegment.tags = this.tags.slice(pos);\n this.tags.length = pos;\n\n return leafSegment;\n }\n }\n}\n\n/**\n * @deprecated `MatrixSegment` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\nexport type MatrixSegment = RunSegment | PaddingSegment;\n\n/**\n * @deprecated `maxCol` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\nexport const maxCol = 0x200000; // X128 Excel maximum of 16,384 columns\n\n/**\n * @deprecated `maxCols` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\n export const maxCols = maxCol + 1;\n\n /**\n * @deprecated `maxRow` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\n export const maxRow = 0xFFFFFFFF; // X4096 Excel maximum of 1,048,576 rows\n\n /**\n * @deprecated `maxRows` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\n export const maxRows = maxRow + 1;\n\n /**\n * @deprecated `maxCellPosition` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\n export const maxCellPosition = maxCol * maxRow;\n\n /**\n * @deprecated `positionToRowCol` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\n export const rowColToPosition = (row: number, col: number) => row * maxCols + col;\n\n /**\n * @deprecated `positionToRowCol` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\nexport function positionToRowCol(position: number) {\n const row = Math.floor(position / maxCols);\n const col = position - (row * maxCols);\n return { row, col };\n}\n\n/**\n * @deprecated `SparseMatrix` is an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\nexport class SparseMatrix extends SharedSegmentSequence<MatrixSegment> {\n /**\n * Create a new sparse matrix\n *\n * @param runtime - data store runtime the new sparse matrix belongs to\n * @param id - optional name of the sparse matrix\n * @returns newly create sparse matrix (but not attached yet)\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string) {\n return runtime.createChannel(id, SparseMatrixFactory.Type) as SparseMatrix;\n }\n\n /**\n * Get a factory for SharedMap to register with the data store.\n *\n * @returns a factory that creates and load SharedMap\n */\n public static getFactory(): IChannelFactory {\n return new SparseMatrixFactory();\n }\n\n constructor(document: IFluidDataStoreRuntime, public id: string, attributes: IChannelAttributes) {\n super(document, id, attributes, SparseMatrixFactory.segmentFromSpec);\n }\n\n public get numRows() {\n return positionToRowCol(this.getLength()).row;\n }\n\n public setItems(\n row: number,\n col: number,\n values: SparseMatrixItem[],\n props?: PropertySet,\n ) {\n const start = rowColToPosition(row, col);\n const end = start + values.length;\n const segment = new RunSegment(values);\n if (props) {\n segment.addProperties(props);\n }\n\n this.replaceRange(start, end, segment);\n }\n\n public getItem(row: number, col: number):\n // The return type is defined explicitly here to prevent TypeScript from generating dynamic imports\n Jsonable<string | number | boolean | IFluidHandle> {\n const pos = rowColToPosition(row, col);\n const { segment, offset } = this.getContainingSegment(pos);\n if (segment && RunSegment.is(segment)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return segment.items[offset];\n } else if (segment && PaddingSegment.is(segment)) {\n return undefined;\n }\n\n throw new Error(`Unrecognized Segment type`);\n }\n\n public getTag(row: number, col: number) {\n const { segment, offset } = this.getSegment(row, col);\n if (RunSegment.is(segment)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return segment.getTag(offset);\n }\n return undefined;\n }\n\n public setTag(row: number, col: number, tag: any) {\n const { segment, offset } = this.getSegment(row, col);\n if (RunSegment.is(segment)) {\n segment.setTag(offset, tag);\n } else if (tag !== undefined) {\n throw new Error(`Must not attempt to set tags on '${segment.constructor.name}'.`);\n }\n }\n\n public insertRows(row: number, numRows: number) {\n const pos = rowColToPosition(row, 0);\n const size = maxCols * numRows;\n const segment = new PaddingSegment(size);\n\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n public removeRows(row: number, numRows: number) {\n const pos = rowColToPosition(row, 0);\n const size = maxCols * numRows;\n this.removeRange(pos, pos + size);\n }\n\n public insertCols(col: number, numCols: number) {\n this.moveAsPadding(maxCol - numCols, col, numCols);\n }\n\n public removeCols(col: number, numCols: number) {\n this.moveAsPadding(col, maxCol - numCols, numCols);\n }\n\n public annotatePosition(row: number, col: number, props: PropertySet) {\n const pos = rowColToPosition(row, col);\n this.annotateRange(pos, pos + 1, props);\n }\n\n public getPositionProperties(row: number, col: number) {\n const pos = rowColToPosition(row, col);\n return this.getPropertiesAtPosition(pos);\n }\n\n // For each row, moves 'numCols' items starting from 'srcCol' and inserts 'numCols' padding\n // at 'destCol'. Used by insertCols and removeCols.\n private moveAsPadding(srcCol: number, destCol: number, numCols: number) {\n const removeColStart = srcCol;\n const removeColEnd = srcCol + numCols;\n const ops = [];\n\n for (let r = 0, rowStart = 0; r < this.numRows; r++, rowStart += maxCols) {\n ops.push(this.client.removeRangeLocal(rowStart + removeColStart, rowStart + removeColEnd));\n const insertPos = rowStart + destCol;\n const segment = new PaddingSegment(numCols);\n ops.push(this.client.insertSegmentLocal(insertPos, segment));\n }\n\n this.submitSequenceMessage(createGroupOp(...ops));\n }\n\n private getSegment(row: number, col: number) {\n const pos = rowColToPosition(row, col);\n return this.getContainingSegment(pos);\n }\n}\n\n/**\n * @deprecated `SparseMatrixFactory` is an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrixFactory} instead.\n */\nexport class SparseMatrixFactory implements IChannelFactory {\n public static Type = \"https://graph.microsoft.com/types/mergeTree/sparse-matrix\";\n\n public static Attributes: IChannelAttributes = {\n type: SparseMatrixFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: pkgVersion,\n };\n\n public static segmentFromSpec(spec: IJSONSegment): ISegment {\n const maybePadding = PaddingSegment.fromJSONObject(spec);\n if (maybePadding) {\n return maybePadding;\n }\n\n const maybeRun = RunSegment.fromJSONObject(spec);\n if (maybeRun) {\n return maybeRun;\n }\n\n throw new Error(`Unrecognized IJSONObject: '${JSON.stringify(spec)}'`);\n }\n\n public get type() {\n return SparseMatrixFactory.Type;\n }\n\n public get attributes() {\n return SparseMatrixFactory.Attributes;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n */\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n ): Promise<ISharedObject> {\n const sharedObject = new SparseMatrix(runtime, id, attributes);\n await sharedObject.load(services);\n return sharedObject;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string): ISharedObject {\n const sharedObject = new SparseMatrix(document, id, this.attributes);\n sharedObject.initializeLocal();\n return sharedObject;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/sequence",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.0.0-dev.1.4.5.105745",
|
|
4
4
|
"description": "Distributed sequence",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -30,11 +30,15 @@
|
|
|
30
30
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
31
31
|
"lint": "npm run eslint",
|
|
32
32
|
"lint:fix": "npm run eslint:fix",
|
|
33
|
+
"postpack": "cd dist && tar -cvf ../sequence.test-files.tar ./test",
|
|
33
34
|
"test": "npm run test:mocha",
|
|
34
35
|
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
|
|
35
|
-
"test:
|
|
36
|
+
"test:memory": "mocha --config src/test/memory/.mocharc.js",
|
|
37
|
+
"test:memory-profiling:report": "mocha --config src/test/memory/.mocharc.js",
|
|
38
|
+
"test:mocha": "mocha --ignore 'dist/test/memory/**/*' --recursive 'dist/test/**/*.spec.js' -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
|
|
36
39
|
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
37
40
|
"test:newsnapfiles": "node dist/test/createSnapshotFiles.js",
|
|
41
|
+
"test:stress": "cross-env FUZZ_TEST_COUNT=100 FUZZ_STRESS_RUN=true npm run test:mocha",
|
|
38
42
|
"testfarm": "node dist/test/testFarm.js",
|
|
39
43
|
"tsc": "tsc",
|
|
40
44
|
"tsfmt": "tsfmt --verify",
|
|
@@ -63,29 +67,30 @@
|
|
|
63
67
|
},
|
|
64
68
|
"dependencies": {
|
|
65
69
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
66
|
-
"@fluidframework/common-utils": "^0.
|
|
67
|
-
"@fluidframework/container-utils": "
|
|
68
|
-
"@fluidframework/core-interfaces": "
|
|
69
|
-
"@fluidframework/datastore-definitions": "
|
|
70
|
-
"@fluidframework/merge-tree": "
|
|
71
|
-
"@fluidframework/protocol-definitions": "^0.
|
|
72
|
-
"@fluidframework/runtime-definitions": "
|
|
73
|
-
"@fluidframework/runtime-utils": "
|
|
74
|
-
"@fluidframework/shared-object-base": "
|
|
75
|
-
"@fluidframework/telemetry-utils": "
|
|
70
|
+
"@fluidframework/common-utils": "^1.0.0",
|
|
71
|
+
"@fluidframework/container-utils": "2.0.0-dev.1.4.5.105745",
|
|
72
|
+
"@fluidframework/core-interfaces": "2.0.0-dev.1.4.5.105745",
|
|
73
|
+
"@fluidframework/datastore-definitions": "2.0.0-dev.1.4.5.105745",
|
|
74
|
+
"@fluidframework/merge-tree": "2.0.0-dev.1.4.5.105745",
|
|
75
|
+
"@fluidframework/protocol-definitions": "^1.0.0",
|
|
76
|
+
"@fluidframework/runtime-definitions": "2.0.0-dev.1.4.5.105745",
|
|
77
|
+
"@fluidframework/runtime-utils": "2.0.0-dev.1.4.5.105745",
|
|
78
|
+
"@fluidframework/shared-object-base": "2.0.0-dev.1.4.5.105745",
|
|
79
|
+
"@fluidframework/telemetry-utils": "2.0.0-dev.1.4.5.105745",
|
|
76
80
|
"uuid": "^8.3.1"
|
|
77
81
|
},
|
|
78
82
|
"devDependencies": {
|
|
79
|
-
"@fluid-internal/stochastic-test-utils": "
|
|
80
|
-
"@fluid-internal/test-dds-utils": "
|
|
81
|
-
"@
|
|
82
|
-
"@fluidframework/build-
|
|
83
|
-
"@fluidframework/
|
|
84
|
-
"@fluidframework/
|
|
85
|
-
"@fluidframework/
|
|
86
|
-
"@fluidframework/
|
|
87
|
-
"@fluidframework/
|
|
88
|
-
"@fluidframework/
|
|
83
|
+
"@fluid-internal/stochastic-test-utils": "2.0.0-dev.1.4.5.105745",
|
|
84
|
+
"@fluid-internal/test-dds-utils": "2.0.0-dev.1.4.5.105745",
|
|
85
|
+
"@fluid-tools/benchmark": "^0.43.0",
|
|
86
|
+
"@fluidframework/build-common": "^1.0.0",
|
|
87
|
+
"@fluidframework/build-tools": "^0.4.4000",
|
|
88
|
+
"@fluidframework/eslint-config-fluid": "^1.0.0",
|
|
89
|
+
"@fluidframework/gitresources": "^0.1037.2001",
|
|
90
|
+
"@fluidframework/mocha-test-setup": "2.0.0-dev.1.4.5.105745",
|
|
91
|
+
"@fluidframework/sequence-previous": "npm:@fluidframework/sequence@^1.0.0",
|
|
92
|
+
"@fluidframework/server-services-client": "^0.1037.2001",
|
|
93
|
+
"@fluidframework/test-runtime-utils": "2.0.0-dev.1.4.5.105745",
|
|
89
94
|
"@microsoft/api-extractor": "^7.22.2",
|
|
90
95
|
"@rushstack/eslint-config": "^2.5.1",
|
|
91
96
|
"@types/diff": "^3.5.1",
|
|
@@ -93,7 +98,7 @@
|
|
|
93
98
|
"@types/node": "^14.18.0",
|
|
94
99
|
"@types/random-js": "^1.0.31",
|
|
95
100
|
"concurrently": "^6.2.0",
|
|
96
|
-
"copyfiles": "^2.1
|
|
101
|
+
"copyfiles": "^2.4.1",
|
|
97
102
|
"cross-env": "^7.0.2",
|
|
98
103
|
"diff": "^3.5.0",
|
|
99
104
|
"eslint": "~8.6.0",
|
|
@@ -105,7 +110,47 @@
|
|
|
105
110
|
"typescript-formatter": "7.1.0"
|
|
106
111
|
},
|
|
107
112
|
"typeValidation": {
|
|
108
|
-
"version": "
|
|
109
|
-
"broken": {
|
|
113
|
+
"version": "2.0.0",
|
|
114
|
+
"broken": {
|
|
115
|
+
"ClassDeclaration_IntervalCollection": {
|
|
116
|
+
"backCompat": false
|
|
117
|
+
},
|
|
118
|
+
"ClassDeclaration_SequenceInterval": {
|
|
119
|
+
"backCompat": false
|
|
120
|
+
},
|
|
121
|
+
"InterfaceDeclaration_ISharedString": {
|
|
122
|
+
"backCompat": false
|
|
123
|
+
},
|
|
124
|
+
"ClassDeclaration_SequenceEvent": {
|
|
125
|
+
"backCompat": false
|
|
126
|
+
},
|
|
127
|
+
"ClassDeclaration_SequenceDeltaEvent": {
|
|
128
|
+
"backCompat": false
|
|
129
|
+
},
|
|
130
|
+
"ClassDeclaration_SequenceMaintenanceEvent": {
|
|
131
|
+
"backCompat": false
|
|
132
|
+
},
|
|
133
|
+
"ClassDeclaration_SharedNumberSequence": {
|
|
134
|
+
"backCompat": false
|
|
135
|
+
},
|
|
136
|
+
"ClassDeclaration_SharedObjectSequence": {
|
|
137
|
+
"backCompat": false
|
|
138
|
+
},
|
|
139
|
+
"ClassDeclaration_SharedSegmentSequence": {
|
|
140
|
+
"backCompat": false
|
|
141
|
+
},
|
|
142
|
+
"ClassDeclaration_SharedSequence": {
|
|
143
|
+
"backCompat": false
|
|
144
|
+
},
|
|
145
|
+
"ClassDeclaration_SharedString": {
|
|
146
|
+
"backCompat": false
|
|
147
|
+
},
|
|
148
|
+
"TypeAliasDeclaration_SharedStringSegment": {
|
|
149
|
+
"backCompat": false
|
|
150
|
+
},
|
|
151
|
+
"ClassDeclaration_SparseMatrix": {
|
|
152
|
+
"backCompat": false
|
|
153
|
+
}
|
|
154
|
+
}
|
|
110
155
|
}
|
|
111
156
|
}
|
package/src/index.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Supports distributed data structures which are list-like.
|
|
8
8
|
*
|
|
9
|
-
* This
|
|
9
|
+
* This library's main export is {@link SharedSequence}, a DDS for storing and simultaneously editing a sequence of
|
|
10
10
|
* text.
|
|
11
11
|
*
|
|
12
12
|
* @remarks Note that SharedString is a sequence DDS but it has additional specialized features and behaviors for
|
|
@@ -22,6 +22,8 @@ export {
|
|
|
22
22
|
Interval,
|
|
23
23
|
IntervalCollection,
|
|
24
24
|
IntervalCollectionIterator,
|
|
25
|
+
IntervalLocator,
|
|
26
|
+
intervalLocatorFromEndpoint,
|
|
25
27
|
IntervalType,
|
|
26
28
|
ISerializableInterval,
|
|
27
29
|
ISerializedInterval,
|