@manuscripts/track-changes-plugin 2.0.9 → 2.0.11
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/dist/cjs/actions.js +6 -5
- package/dist/cjs/change-steps/diffChangeSteps.js +1 -2
- package/dist/cjs/change-steps/matchInserted.js +1 -2
- package/dist/cjs/change-steps/processChangeSteps.js +22 -10
- package/dist/cjs/changes/applyChanges.js +53 -12
- package/dist/cjs/changes/findChanges.js +1 -2
- package/dist/cjs/changes/fixInconsistentChanges.js +1 -2
- package/dist/cjs/changes/revertChange.js +2 -3
- package/dist/cjs/changes/updateChangeAttrs.js +9 -3
- package/dist/cjs/changes/updateChangesStatus.js +1 -2
- package/dist/cjs/compute/nodeHelpers.js +7 -8
- package/dist/cjs/compute/setFragmentAsInserted.js +23 -14
- package/dist/cjs/compute/splitSliceIntoMergedParts.js +1 -2
- package/dist/cjs/index.js +20 -8
- package/dist/cjs/mutate/deleteAndMergeSplitNodes.js +18 -9
- package/dist/cjs/mutate/deleteNode.js +4 -4
- package/dist/cjs/mutate/deleteText.js +1 -2
- package/dist/cjs/mutate/mergeNode.js +1 -2
- package/dist/cjs/mutate/mergeTrackedMarks.js +1 -2
- package/dist/cjs/steps/trackReplaceAroundStep.js +18 -9
- package/dist/cjs/steps/trackReplaceStep.js +25 -14
- package/dist/cjs/steps/trackTransaction.js +17 -7
- package/dist/cjs/types/change.js +2 -2
- package/dist/cjs/types/track.js +1 -1
- package/dist/cjs/utils/mapChangeStep.js +1 -2
- package/dist/cjs/utils/track-utils.js +11 -11
- package/dist/cjs/utils/uuidv4.js +1 -2
- package/dist/es/actions.js +1 -0
- package/dist/es/change-steps/processChangeSteps.js +4 -1
- package/dist/es/changes/applyChanges.js +52 -10
- package/dist/es/changes/updateChangeAttrs.js +6 -0
- package/dist/es/compute/setFragmentAsInserted.js +2 -2
- package/dist/es/index.js +1 -1
- package/dist/es/mutate/deleteNode.js +2 -1
- package/dist/es/steps/trackReplaceStep.js +7 -5
- package/dist/es/steps/trackTransaction.js +16 -5
- package/dist/es/utils/track-utils.js +2 -2
- package/dist/types/ChangeSet.d.ts +4 -4
- package/dist/types/actions.d.ts +5 -1
- package/dist/types/changes/updateChangeAttrs.d.ts +1 -0
- package/dist/types/compute/setFragmentAsInserted.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/change.d.ts +1 -0
- package/dist/types/types/track.d.ts +6 -2
- package/dist/types/utils/track-utils.d.ts +2 -2
- package/package.json +8 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment, ResolvedPos, Schema } from 'prosemirror-model';
|
|
2
2
|
import { Transaction } from 'prosemirror-state';
|
|
3
|
-
import { NewEmptyAttrs, NewInsertAttrs } from '../types/track';
|
|
3
|
+
import { NewEmptyAttrs, NewInsertAttrs, NewMoveAttrs } from '../types/track';
|
|
4
4
|
export declare function setFragmentAsInserted(inserted: Fragment, insertAttrs: NewInsertAttrs, schema: Schema): Fragment;
|
|
5
5
|
export declare function setFragmentAsWrapChange(inserted: Fragment, attrs: NewEmptyAttrs, schema: Schema): Fragment;
|
|
6
|
-
export declare function setFragmentAsMoveChange(fragment: Fragment,
|
|
6
|
+
export declare function setFragmentAsMoveChange(fragment: Fragment, moveAttrs: NewMoveAttrs): Fragment;
|
|
7
7
|
export declare function setFragmentAsNodeSplit($pos: ResolvedPos, newTr: Transaction, inserted: Fragment, attrs: NewEmptyAttrs): Fragment;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { trackChangesPluginKey, trackChangesPlugin } from './plugin';
|
|
2
|
-
export { skipTracking } from './actions';
|
|
2
|
+
export { skipTracking, setAction, TrackChangesAction } from './actions';
|
|
3
3
|
export * as trackCommands from './commands';
|
|
4
4
|
export { enableDebug } from './utils/logger';
|
|
5
5
|
export { ChangeSet } from './ChangeSet';
|
|
@@ -55,6 +55,7 @@ export type ReferenceAttrs = Omit<InsertDeleteAttrs, 'operation'> & {
|
|
|
55
55
|
};
|
|
56
56
|
export type NodeMoveAttrs = Omit<InsertDeleteAttrs, 'operation'> & {
|
|
57
57
|
operation: CHANGE_OPERATION.move;
|
|
58
|
+
indentationType?: 'indent' | 'unindent';
|
|
58
59
|
};
|
|
59
60
|
export type TrackedAttrs = InsertDeleteAttrs | UpdateAttrs | WrapAttrs | NodeSplitAttrs | ReferenceAttrs | NodeMoveAttrs;
|
|
60
61
|
type Change = {
|
|
@@ -16,7 +16,7 @@ export interface TrackChangesState {
|
|
|
16
16
|
}
|
|
17
17
|
export type NewEmptyAttrs = Omit<TrackedAttrs, 'id' | 'operation'>;
|
|
18
18
|
export type NewInsertAttrs = Omit<TrackedAttrs, 'id' | 'operation'> & {
|
|
19
|
-
operation: CHANGE_OPERATION.insert | CHANGE_OPERATION.wrap_with_node
|
|
19
|
+
operation: CHANGE_OPERATION.insert | CHANGE_OPERATION.wrap_with_node;
|
|
20
20
|
};
|
|
21
21
|
export type NewDeleteAttrs = Omit<TrackedAttrs, 'id' | 'operation'> & {
|
|
22
22
|
operation: CHANGE_OPERATION.delete;
|
|
@@ -28,11 +28,15 @@ export type NewUpdateAttrs = Omit<TrackedAttrs, 'id' | 'operation'> & {
|
|
|
28
28
|
export type NewSplitNodeAttrs = Omit<TrackedAttrs, 'id' | 'operation'> & {
|
|
29
29
|
operation: CHANGE_OPERATION.node_split;
|
|
30
30
|
};
|
|
31
|
+
export type NewMoveAttrs = Omit<TrackedAttrs, 'id' | 'operation'> & {
|
|
32
|
+
operation: CHANGE_OPERATION.move;
|
|
33
|
+
indentationType?: 'indent' | 'unindent';
|
|
34
|
+
};
|
|
31
35
|
export type NewReferenceAttrs = Omit<TrackedAttrs, 'id' | 'operation'> & {
|
|
32
36
|
operation: CHANGE_OPERATION.reference;
|
|
33
37
|
referenceId: string;
|
|
34
38
|
};
|
|
35
|
-
export type NewTrackedAttrs = NewInsertAttrs | NewDeleteAttrs | NewUpdateAttrs;
|
|
39
|
+
export type NewTrackedAttrs = NewInsertAttrs | NewDeleteAttrs | NewUpdateAttrs | NewMoveAttrs;
|
|
36
40
|
export declare enum TrackChangesStatus {
|
|
37
41
|
enabled = "enabled",
|
|
38
42
|
viewSnapshots = "view-snapshots",
|
|
@@ -2,13 +2,13 @@ import { Node as PMNode, Slice } from 'prosemirror-model';
|
|
|
2
2
|
import { Selection, Transaction } from 'prosemirror-state';
|
|
3
3
|
import { ReplaceAroundStep, ReplaceStep, Step } from 'prosemirror-transform';
|
|
4
4
|
import { CHANGE_OPERATION, TrackedAttrs } from '../types/change';
|
|
5
|
-
import { NewDeleteAttrs, NewEmptyAttrs, NewInsertAttrs, NewReferenceAttrs, NewSplitNodeAttrs, NewUpdateAttrs } from '../types/track';
|
|
5
|
+
import { NewDeleteAttrs, NewEmptyAttrs, NewInsertAttrs, NewMoveAttrs, NewReferenceAttrs, NewSplitNodeAttrs, NewUpdateAttrs } from '../types/track';
|
|
6
6
|
export declare function createNewInsertAttrs(attrs: NewEmptyAttrs): NewInsertAttrs;
|
|
7
7
|
export declare function createNewWrapAttrs(attrs: NewEmptyAttrs): NewInsertAttrs;
|
|
8
8
|
export declare function createNewSplitAttrs(attrs: NewEmptyAttrs): NewSplitNodeAttrs;
|
|
9
9
|
export declare function createNewReferenceAttrs(attrs: NewEmptyAttrs, id: string): NewReferenceAttrs;
|
|
10
10
|
export declare function createNewDeleteAttrs(attrs: NewEmptyAttrs): NewDeleteAttrs;
|
|
11
|
-
export declare function createNewMoveAttrs(attrs: NewEmptyAttrs):
|
|
11
|
+
export declare function createNewMoveAttrs(attrs: NewEmptyAttrs, indentationType?: 'indent' | 'unindent'): NewMoveAttrs;
|
|
12
12
|
export declare function createNewUpdateAttrs(attrs: NewEmptyAttrs, oldAttrs: Record<string, any>): NewUpdateAttrs;
|
|
13
13
|
export declare const isSplitStep: (step: ReplaceStep, selection: Selection, uiEvent: string) => boolean;
|
|
14
14
|
export declare const isWrapStep: (step: ReplaceAroundStep) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/track-changes-plugin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"author": "Atypon Systems LLC",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/Atypon-OpenSource/manuscripts-track-changes-plugin",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@manuscripts/eslint-config": "0.5.1",
|
|
38
38
|
"@manuscripts/transform": "3.0.48",
|
|
39
39
|
"@types/debug": "4.1.12",
|
|
40
|
-
"@types/jest": "
|
|
40
|
+
"@types/jest": "30.0.0",
|
|
41
41
|
"@types/node": "20.17.46",
|
|
42
42
|
"@typescript-eslint/eslint-plugin": "5.62.0",
|
|
43
43
|
"@typescript-eslint/parser": "5.62.0",
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"eslint-plugin-react-hooks": "4.6.2",
|
|
56
56
|
"eslint-plugin-simple-import-sort": "8.0.0",
|
|
57
57
|
"husky": "8.0.3",
|
|
58
|
-
"jest": "
|
|
59
|
-
"jest-environment-jsdom": "
|
|
58
|
+
"jest": "30.0.5",
|
|
59
|
+
"jest-environment-jsdom": "30.0.5",
|
|
60
60
|
"jsdom": "26.1.0",
|
|
61
|
-
"prosemirror-example-setup": "1.2.3",
|
|
62
|
-
"prosemirror-schema-list": "1.5.1",
|
|
63
61
|
"npm-run-all": "4.1.5",
|
|
64
62
|
"prettier": "2.8.8",
|
|
65
|
-
"
|
|
66
|
-
"
|
|
63
|
+
"prosemirror-example-setup": "1.2.3",
|
|
64
|
+
"prosemirror-schema-list": "1.5.1",
|
|
65
|
+
"ts-jest": "29.4.0",
|
|
66
|
+
"typescript": "5.9.2"
|
|
67
67
|
}
|
|
68
68
|
}
|