@manuscripts/track-changes-plugin 0.0.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/actions.d.ts +1 -1
- package/dist/index.cjs +1562 -0
- package/dist/index.es.js +23 -17
- package/dist/index.js +124 -131
- package/dist/plugin.d.ts +2 -2
- package/dist/track/deleteNode.d.ts +1 -1
- package/dist/track/mergeNode.d.ts +1 -1
- package/dist/track/node-utils.d.ts +1 -1
- package/dist/track/steps/deleteAndMergeSplitNodes.d.ts +1 -1
- package/dist/track/steps/setFragmentAsInserted.d.ts +1 -1
- package/dist/track/trackTransaction.d.ts +1 -1
- package/package.json +17 -21
package/dist/plugin.d.ts
CHANGED
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
17
17
|
import { TrackChangesOptions, TrackChangesState } from './types/track';
|
|
18
|
-
export declare const trackChangesPluginKey: PluginKey<TrackChangesState
|
|
18
|
+
export declare const trackChangesPluginKey: PluginKey<TrackChangesState>;
|
|
19
19
|
/**
|
|
20
20
|
* The ProseMirror plugin needed to enable track-changes.
|
|
21
21
|
*
|
|
22
22
|
* Accepts an empty options object as an argument but note that this uses 'anonymous:Anonymous' as the default userID.
|
|
23
23
|
* @param opts
|
|
24
24
|
*/
|
|
25
|
-
export declare const trackChangesPlugin: (opts?: TrackChangesOptions) => Plugin<TrackChangesState
|
|
25
|
+
export declare const trackChangesPlugin: (opts?: TrackChangesOptions) => Plugin<TrackChangesState>;
|
|
@@ -24,4 +24,4 @@ import { Transaction } from 'prosemirror-state';
|
|
|
24
24
|
* @param tr
|
|
25
25
|
* @returns
|
|
26
26
|
*/
|
|
27
|
-
export declare function deleteNode(node: PMNode, pos: number, tr: Transaction): Transaction
|
|
27
|
+
export declare function deleteNode(node: PMNode, pos: number, tr: Transaction): Transaction;
|
|
@@ -22,4 +22,4 @@ import { Transaction } from 'prosemirror-state';
|
|
|
22
22
|
* @param tr
|
|
23
23
|
* @returns
|
|
24
24
|
*/
|
|
25
|
-
export declare function mergeNode(node: PMNode, pos: number, tr: Transaction): Transaction
|
|
25
|
+
export declare function mergeNode(node: PMNode, pos: number, tr: Transaction): Transaction | undefined;
|
|
@@ -22,7 +22,7 @@ export declare function addTrackIdIfDoesntExist(attrs: Partial<TrackedAttrs>): P
|
|
|
22
22
|
* @param pos
|
|
23
23
|
* @param tr
|
|
24
24
|
*/
|
|
25
|
-
export declare function liftNode(pos: number, tr: Transaction): Transaction
|
|
25
|
+
export declare function liftNode(pos: number, tr: Transaction): Transaction | undefined;
|
|
26
26
|
export declare function getInlineNodeTrackedMarkData(node: PMNode | undefined | null, schema: Schema): {
|
|
27
27
|
operation: CHANGE_OPERATION;
|
|
28
28
|
} | undefined;
|
|
@@ -49,5 +49,5 @@ export declare function deleteAndMergeSplitNodes(from: number, to: number, gap:
|
|
|
49
49
|
} | undefined, startDoc: PMNode, newTr: Transaction, schema: Schema, trackAttrs: NewEmptyAttrs, insertSlice: ExposedSlice): {
|
|
50
50
|
deleteMap: Mapping;
|
|
51
51
|
mergedInsertPos: undefined;
|
|
52
|
-
newSliceContent: Fragment
|
|
52
|
+
newSliceContent: Fragment;
|
|
53
53
|
};
|
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Fragment, Schema } from 'prosemirror-model';
|
|
17
17
|
import { NewInsertAttrs } from '../../types/track';
|
|
18
|
-
export declare function setFragmentAsInserted(inserted: Fragment, insertAttrs: NewInsertAttrs, schema: Schema): Fragment
|
|
18
|
+
export declare function setFragmentAsInserted(inserted: Fragment, insertAttrs: NewInsertAttrs, schema: Schema): Fragment;
|
|
@@ -14,4 +14,4 @@ import type { EditorState, Transaction } from 'prosemirror-state';
|
|
|
14
14
|
* @param userID User id
|
|
15
15
|
* @returns newTr that inverts the initial tr and applies track attributes/marks
|
|
16
16
|
*/
|
|
17
|
-
export declare function trackTransaction(tr: Transaction, oldState: EditorState, newTr: Transaction, userID: string): Transaction
|
|
17
|
+
export declare function trackTransaction(tr: Transaction, oldState: EditorState, newTr: Transaction, userID: string): Transaction;
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/track-changes-plugin",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"author": "Atypon Systems LLC",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/Atypon-OpenSource/manuscripts-quarterback/tree/main/quarterback-packages/track-changes-plugin",
|
|
7
|
-
"main": "dist/index.
|
|
8
|
-
"module": "dist/index.
|
|
7
|
+
"main": "dist/index.cjs",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"types": "dist/index.d.ts",
|
|
11
11
|
"exports": {
|
|
12
12
|
"./package.json": "./package.json",
|
|
13
13
|
"./src/styles.css": "./src/styles.css",
|
|
14
|
-
".": "./dist/index.
|
|
14
|
+
".": "./dist/index.js"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"dist",
|
|
@@ -21,30 +21,25 @@
|
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
+
"@manuscripts/manuscript-transform": "^0.49.4",
|
|
24
25
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
25
26
|
"@types/debug": "^4.1.7",
|
|
26
27
|
"@types/jest": "27.5.1",
|
|
27
28
|
"@types/node": "^17.0.35",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"@types/prosemirror-schema-list": "^1.0.3",
|
|
31
|
-
"@types/prosemirror-state": "^1.3.0",
|
|
32
|
-
"@types/prosemirror-transform": "^1.4.1",
|
|
33
|
-
"@types/prosemirror-view": "^1.23.3",
|
|
34
|
-
"jest": "28.1.0",
|
|
35
|
-
"jest-environment-jsdom": "28.1.0",
|
|
29
|
+
"jest": "27.5.1",
|
|
30
|
+
"jest-environment-jsdom": "27.5.1",
|
|
36
31
|
"jsdom": "^19.0.0",
|
|
37
|
-
"prosemirror-commands": "^1.
|
|
38
|
-
"prosemirror-example-setup": "^1.1
|
|
39
|
-
"prosemirror-keymap": "^1.
|
|
40
|
-
"prosemirror-model": "^1.
|
|
41
|
-
"prosemirror-schema-list": "^1.
|
|
42
|
-
"prosemirror-state": "^1.
|
|
43
|
-
"prosemirror-transform": "^1.
|
|
44
|
-
"prosemirror-view": "^1.
|
|
32
|
+
"prosemirror-commands": "^1.3.0",
|
|
33
|
+
"prosemirror-example-setup": "^1.2.1",
|
|
34
|
+
"prosemirror-keymap": "^1.2.0",
|
|
35
|
+
"prosemirror-model": "^1.18.1",
|
|
36
|
+
"prosemirror-schema-list": "^1.2.0",
|
|
37
|
+
"prosemirror-state": "^1.4.1",
|
|
38
|
+
"prosemirror-transform": "^1.6.0",
|
|
39
|
+
"prosemirror-view": "^1.26.2",
|
|
45
40
|
"rollup": "^2.74.0",
|
|
46
41
|
"rollup-plugin-typescript2": "^0.31.2",
|
|
47
|
-
"ts-jest": "
|
|
42
|
+
"ts-jest": "27.1.4",
|
|
48
43
|
"tslib": "^2.4.0",
|
|
49
44
|
"typescript": "^4.6.4"
|
|
50
45
|
},
|
|
@@ -62,6 +57,7 @@
|
|
|
62
57
|
"watch": "rollup -cw",
|
|
63
58
|
"test": "jest --runInBand",
|
|
64
59
|
"format": "prettier --write \"*.+(js|json|yml|yaml|ts|md|graphql|mdx)\" src/ test/",
|
|
60
|
+
"typecheck": "tsc --project tsconfig.test.json --noEmit",
|
|
65
61
|
"lint": "eslint --cache --ext .js,.ts, ./src ./test",
|
|
66
62
|
"lint:fix": "eslint --fix --ext .js,.ts, ./src ./test"
|
|
67
63
|
}
|