@atlaskit/prosemirror-collab 0.22.95 → 0.22.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/package.json +2 -2
- package/dist/types-ts4.5/index.d.ts +0 -52
- package/dist/types-ts4.5/movedContent.d.ts +0 -24
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/prosemirror-collab",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.97",
|
|
4
4
|
"description": "Collaborative editing for ProseMirror - Atlassian Fork",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/adf-schema": "^54.0.0",
|
|
31
31
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
32
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
32
|
+
"@atlaskit/tmp-editor-statsig": "^103.0.0",
|
|
33
33
|
"@babel/runtime": "^7.0.0",
|
|
34
34
|
"uuid": "^3.1.0"
|
|
35
35
|
},
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { Plugin } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { Step as ProseMirrorStep, Transform as ProseMirrorTransform } from '@atlaskit/editor-prosemirror/transform';
|
|
5
|
-
export declare class Rebaseable {
|
|
6
|
-
readonly step: ProseMirrorStep;
|
|
7
|
-
readonly inverted: ProseMirrorStep;
|
|
8
|
-
readonly origin: ProseMirrorTransform;
|
|
9
|
-
constructor(step: ProseMirrorStep, inverted: ProseMirrorStep, origin: ProseMirrorTransform);
|
|
10
|
-
}
|
|
11
|
-
export declare function rebaseSteps(steps: readonly Rebaseable[], over: readonly ProseMirrorStep[], transform: ProseMirrorTransform): Rebaseable[];
|
|
12
|
-
declare class CollabState {
|
|
13
|
-
readonly version: number;
|
|
14
|
-
readonly unconfirmed: readonly Rebaseable[];
|
|
15
|
-
constructor(version: number, unconfirmed: readonly Rebaseable[]);
|
|
16
|
-
}
|
|
17
|
-
type CollabConfig = {
|
|
18
|
-
clientID?: number | string | null;
|
|
19
|
-
transformUnconfirmed?: (steps: Rebaseable[]) => Rebaseable[];
|
|
20
|
-
version?: number;
|
|
21
|
-
};
|
|
22
|
-
export declare function collab(config?: CollabConfig): Plugin;
|
|
23
|
-
/**
|
|
24
|
-
* Get the document before the unconfirmed steps were applied.
|
|
25
|
-
* This is used to facilitate tab syncing across multiple tabs while offline, by returning the document before the unconfirmed steps were
|
|
26
|
-
* applied we can ensure each tab starts from the same doc.
|
|
27
|
-
* @param state The editor state
|
|
28
|
-
* @returns The document before the unconfirmed steps were applied
|
|
29
|
-
*/
|
|
30
|
-
export declare function getDocBeforeUnconfirmedSteps(state: EditorState): Node;
|
|
31
|
-
/**
|
|
32
|
-
* Sync the document, version and unconfirmed steps from another source.
|
|
33
|
-
* This is used to facilitate tab syncing across multiple tabs while offline, because we no longer have access to the central authority.
|
|
34
|
-
*
|
|
35
|
-
* @param state The editor state
|
|
36
|
-
* @param version the version number of the last update received from the central authority
|
|
37
|
-
* @param docJSON the document corresponding with the version
|
|
38
|
-
* @param unconfirmedSteps the unconfirmed steps that havent been successfully sent to the server yet
|
|
39
|
-
* @returns A transaction that represents the new state of the editor after receiving the new steps, doc and version
|
|
40
|
-
*/
|
|
41
|
-
export declare function syncFromAnotherSource(state: EditorState, version: number, docJSON: any, unconfirmedSteps: readonly ProseMirrorStep[]): Transaction;
|
|
42
|
-
export declare function receiveTransaction(state: EditorState, steps: readonly ProseMirrorStep[], clientIDs: readonly (string | number)[], options?: {
|
|
43
|
-
mapSelectionBackward?: boolean;
|
|
44
|
-
}): Transaction;
|
|
45
|
-
export declare function sendableSteps(state: EditorState): {
|
|
46
|
-
clientID: number | string;
|
|
47
|
-
origins: readonly Transaction[];
|
|
48
|
-
steps: readonly ProseMirrorStep[];
|
|
49
|
-
version: number;
|
|
50
|
-
} | null;
|
|
51
|
-
export declare function getCollabState(state: EditorState): CollabState | undefined;
|
|
52
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
2
|
-
import type { Step as ProseMirrorStep, Transform as ProseMirrorTransform } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
-
import type { Rebaseable } from './index';
|
|
4
|
-
export declare const mapStep: (steps: readonly Rebaseable[], transform: ProseMirrorTransform, index: number, mapped: ProseMirrorStep | null) => ReplaceStep | undefined;
|
|
5
|
-
/**
|
|
6
|
-
* Determines if a step pairing is a move sequence (ie. drag + drop or cut + paste).
|
|
7
|
-
*
|
|
8
|
-
* We determine this if we have a deletion followed by insertion and their content matches
|
|
9
|
-
*
|
|
10
|
-
* @param previousStep
|
|
11
|
-
* @param currentStep
|
|
12
|
-
* @param previousRebaseable
|
|
13
|
-
*/
|
|
14
|
-
export declare const isMoveSequence: (previousRebaseableStep: Rebaseable, currentStep: ProseMirrorStep) => boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Update the replace step slice of the insert part of a move
|
|
17
|
-
* to contain the slice of the current document rather than what was sliced originally.
|
|
18
|
-
*
|
|
19
|
-
* @param mapped
|
|
20
|
-
* @param previousStep
|
|
21
|
-
* @param transform
|
|
22
|
-
* @returns Step to apply missing changes
|
|
23
|
-
*/
|
|
24
|
-
export declare const createMoveMapStep: (mapped: ProseMirrorStep | null, previousStep: ProseMirrorStep, transform: ProseMirrorTransform, previousStepIndex: number) => ReplaceStep | undefined;
|