@manuscripts/article-editor 3.9.1-LEAN-4533.1 → 3.9.1
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/EditorApp.js +1 -8
- package/dist/cjs/EditorApp.js.map +1 -1
- package/dist/cjs/Main.js +3 -3
- package/dist/cjs/Main.js.map +1 -1
- package/dist/cjs/components/inspector/SnapshotsList.js +2 -14
- package/dist/cjs/components/inspector/SnapshotsList.js.map +1 -1
- package/dist/cjs/components/projects/EditorElement.js +4 -5
- package/dist/cjs/components/projects/EditorElement.js.map +1 -1
- package/dist/cjs/components/projects/Inspector.js +1 -7
- package/dist/cjs/components/projects/Inspector.js.map +1 -1
- package/dist/cjs/components/projects/ManuscriptPageContainer.js +3 -4
- package/dist/cjs/components/projects/ManuscriptPageContainer.js.map +1 -1
- package/dist/cjs/components/track-changes/TrackChangesPanel.js +3 -16
- package/dist/cjs/components/track-changes/TrackChangesPanel.js.map +1 -1
- package/dist/cjs/components/track-changes/suggestion-list/Suggestion.js +3 -7
- package/dist/cjs/components/track-changes/suggestion-list/Suggestion.js.map +1 -1
- package/dist/cjs/components/track-changes/suggestion-list/SuggestionList.js +2 -6
- package/dist/cjs/components/track-changes/suggestion-list/SuggestionList.js.map +1 -1
- package/dist/cjs/components/track-changes/utils.js +1 -2
- package/dist/cjs/components/track-changes/utils.js.map +1 -1
- package/dist/cjs/hooks/use-create-editor.js +13 -30
- package/dist/cjs/hooks/use-create-editor.js.map +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/store/Store.js +2 -7
- package/dist/cjs/store/Store.js.map +1 -1
- package/dist/es/EditorApp.js +1 -8
- package/dist/es/EditorApp.js.map +1 -1
- package/dist/es/Main.js +3 -3
- package/dist/es/Main.js.map +1 -1
- package/dist/es/components/inspector/SnapshotsList.js +3 -15
- package/dist/es/components/inspector/SnapshotsList.js.map +1 -1
- package/dist/es/components/projects/EditorElement.js +4 -5
- package/dist/es/components/projects/EditorElement.js.map +1 -1
- package/dist/es/components/projects/Inspector.js +1 -7
- package/dist/es/components/projects/Inspector.js.map +1 -1
- package/dist/es/components/projects/ManuscriptPageContainer.js +3 -4
- package/dist/es/components/projects/ManuscriptPageContainer.js.map +1 -1
- package/dist/es/components/track-changes/TrackChangesPanel.js +3 -16
- package/dist/es/components/track-changes/TrackChangesPanel.js.map +1 -1
- package/dist/es/components/track-changes/suggestion-list/Suggestion.js +3 -7
- package/dist/es/components/track-changes/suggestion-list/Suggestion.js.map +1 -1
- package/dist/es/components/track-changes/suggestion-list/SuggestionList.js +2 -6
- package/dist/es/components/track-changes/suggestion-list/SuggestionList.js.map +1 -1
- package/dist/es/components/track-changes/utils.js +1 -2
- package/dist/es/components/track-changes/utils.js.map +1 -1
- package/dist/es/hooks/use-create-editor.js +14 -31
- package/dist/es/hooks/use-create-editor.js.map +1 -1
- package/dist/es/index.js +3 -3
- package/dist/es/index.js.map +1 -1
- package/dist/es/store/Store.js +2 -7
- package/dist/es/store/Store.js.map +1 -1
- package/dist/types/EditorApp.d.ts +1 -2
- package/dist/types/Main.d.ts +1 -1
- package/dist/types/components/projects/Inspector.d.ts +1 -1
- package/dist/types/components/projects/ManuscriptPageContainer.d.ts +1 -1
- package/dist/types/components/track-changes/TrackChangesPanel.d.ts +1 -1
- package/dist/types/components/track-changes/suggestion-list/Suggestion.d.ts +1 -1
- package/dist/types/components/track-changes/suggestion-list/SuggestionList.d.ts +3 -3
- package/dist/types/index.d.ts +1 -1
- package/dist/types/store/Store.d.ts +1 -3
- package/package.json +5 -7
- package/dist/cjs/components/tools/CompareDocumentsModal.js +0 -170
- package/dist/cjs/components/tools/CompareDocumentsModal.js.map +0 -1
- package/dist/cjs/hooks/use-compare-documents.js +0 -69
- package/dist/cjs/hooks/use-compare-documents.js.map +0 -1
- package/dist/cjs/lib/comparison/compare-documents.js +0 -53
- package/dist/cjs/lib/comparison/compare-documents.js.map +0 -1
- package/dist/cjs/lib/comparison/compare-paragraph-like.js +0 -388
- package/dist/cjs/lib/comparison/compare-paragraph-like.js.map +0 -1
- package/dist/cjs/lib/comparison/compare-table-element.js +0 -567
- package/dist/cjs/lib/comparison/compare-table-element.js.map +0 -1
- package/dist/cjs/lib/comparison/create-dataTracked-attrs.js +0 -60
- package/dist/cjs/lib/comparison/create-dataTracked-attrs.js.map +0 -1
- package/dist/cjs/lib/comparison/distribute-nodes.js +0 -131
- package/dist/cjs/lib/comparison/distribute-nodes.js.map +0 -1
- package/dist/cjs/lib/comparison/rebuild-nodes-tree.js +0 -76
- package/dist/cjs/lib/comparison/rebuild-nodes-tree.js.map +0 -1
- package/dist/es/components/tools/CompareDocumentsModal.js +0 -140
- package/dist/es/components/tools/CompareDocumentsModal.js.map +0 -1
- package/dist/es/hooks/use-compare-documents.js +0 -65
- package/dist/es/hooks/use-compare-documents.js.map +0 -1
- package/dist/es/lib/comparison/compare-documents.js +0 -48
- package/dist/es/lib/comparison/compare-documents.js.map +0 -1
- package/dist/es/lib/comparison/compare-paragraph-like.js +0 -378
- package/dist/es/lib/comparison/compare-paragraph-like.js.map +0 -1
- package/dist/es/lib/comparison/compare-table-element.js +0 -559
- package/dist/es/lib/comparison/compare-table-element.js.map +0 -1
- package/dist/es/lib/comparison/create-dataTracked-attrs.js +0 -54
- package/dist/es/lib/comparison/create-dataTracked-attrs.js.map +0 -1
- package/dist/es/lib/comparison/distribute-nodes.js +0 -127
- package/dist/es/lib/comparison/distribute-nodes.js.map +0 -1
- package/dist/es/lib/comparison/rebuild-nodes-tree.js +0 -72
- package/dist/es/lib/comparison/rebuild-nodes-tree.js.map +0 -1
- package/dist/types/components/tools/CompareDocumentsModal.d.ts +0 -11
- package/dist/types/hooks/use-compare-documents.d.ts +0 -24
- package/dist/types/lib/comparison/compare-documents.d.ts +0 -16
- package/dist/types/lib/comparison/compare-paragraph-like.d.ts +0 -23
- package/dist/types/lib/comparison/compare-table-element.d.ts +0 -21
- package/dist/types/lib/comparison/create-dataTracked-attrs.d.ts +0 -15
- package/dist/types/lib/comparison/distribute-nodes.d.ts +0 -19
- package/dist/types/lib/comparison/rebuild-nodes-tree.d.ts +0 -14
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-create-editor.js","sourceRoot":"","sources":["../../../src/hooks/use-create-editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,
|
1
|
+
{"version":3,"file":"use-create-editor.js","sourceRoot":"","sources":["../../../src/hooks/use-create-editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAEtE,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,MAAM,CACJ,EACE,GAAG,EACH,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,IAAI,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MAAM,CAAC,QAAQ,CAAC,QAAQ;QAClC,aAAa;KACd,CAAA;IACD,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;IAC/B,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
|
package/dist/es/index.js
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
*
|
8
8
|
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
9
|
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c)
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
12
|
import './lib/fonts';
|
13
13
|
import React, { Suspense } from 'react';
|
@@ -17,12 +17,12 @@ import Main from './Main';
|
|
17
17
|
import { ThemeProvider } from './theme/ThemeProvider';
|
18
18
|
export { ProjectRole } from './lib/roles';
|
19
19
|
export { getUserRole } from './lib/roles';
|
20
|
-
const ManuscriptEditor = ({ fileManagement, files, manuscriptID, projectID, permittedActions, getAuthToken, config, observer,
|
20
|
+
const ManuscriptEditor = ({ fileManagement, files, manuscriptID, projectID, permittedActions, getAuthToken, config, observer, }) => {
|
21
21
|
setConfig(config);
|
22
22
|
return (React.createElement(React.Fragment, null,
|
23
23
|
React.createElement(ThemeProvider, null,
|
24
24
|
React.createElement(Suspense, { fallback: React.createElement(LoadingPage, { className: 'loader' }, "Loading...") },
|
25
|
-
React.createElement(Main, { fileManagement: fileManagement, files: files, manuscriptID: manuscriptID, projectID: projectID, permittedActions: permittedActions, getAuthToken: getAuthToken, observer: observer
|
25
|
+
React.createElement(Main, { fileManagement: fileManagement, files: files, manuscriptID: manuscriptID, projectID: projectID, permittedActions: permittedActions, getAuthToken: getAuthToken, observer: observer }))),
|
26
26
|
React.createElement("div", { id: "menu" }),
|
27
27
|
React.createElement("div", { id: "notifications" }),
|
28
28
|
React.createElement("div", { id: "size" })));
|
package/dist/es/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAA2B,SAAS,EAAE,MAAM,UAAU,CAAA;AAE7D,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AASzC,MAAM,gBAAgB,GAElB,CAAC,EACH,cAAc,EACd,KAAK,EACL,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,QAAQ,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAA2B,SAAS,EAAE,MAAM,UAAU,CAAA;AAE7D,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AASzC,MAAM,gBAAgB,GAElB,CAAC,EACH,cAAc,EACd,KAAK,EACL,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,QAAQ,GACT,EAAE,EAAE;IACH,SAAS,CAAC,MAAM,CAAC,CAAA;IACjB,OAAO,CACL;QACE,oBAAC,aAAa;YACZ,oBAAC,QAAQ,IACP,QAAQ,EAAE,oBAAC,WAAW,IAAC,SAAS,EAAE,QAAQ,iBAA0B;gBAEpE,oBAAC,IAAI,IACH,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,GAClB,CACO,CACG;QAChB,6BAAK,EAAE,EAAC,MAAM,GAAO;QACrB,6BAAK,EAAE,EAAC,eAAe,GAAO;QAC9B,6BAAK,EAAE,EAAC,MAAM,GAAO,CACpB,CACJ,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAC3C,gBAAgB,EAChB,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;IACb,mHAAmH;IACnH,mIAAmI;IACnI,OAAO,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAA,CAAC,sCAAsC;AACtF,CAAC,CACF,CAAA"}
|
package/dist/es/store/Store.js
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
*
|
8
8
|
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
9
|
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c)
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
12
|
import { buildStateFromSources } from '.';
|
13
13
|
const DEFAULT_ACTION = '_'; // making actions optional
|
@@ -20,12 +20,7 @@ export class GenericStore {
|
|
20
20
|
this.init = async (sources) => {
|
21
21
|
this.sources = sources;
|
22
22
|
const state = await buildStateFromSources(sources, this.setState);
|
23
|
-
this.setState({
|
24
|
-
...this.state,
|
25
|
-
...state,
|
26
|
-
isViewingMode: false,
|
27
|
-
isComparingMode: false,
|
28
|
-
});
|
23
|
+
this.setState({ ...this.state, ...state, isViewingMode: false });
|
29
24
|
// listening to changes before state applied
|
30
25
|
this.beforeAction = (action, payload, store, setState) => {
|
31
26
|
// provide a way for the data sources to cancel the action optionally
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../src/store/Store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAkBH,OAAO,EAAE,qBAAqB,EAA2B,MAAM,GAAG,CAAA;
|
1
|
+
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../src/store/Store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAkBH,OAAO,EAAE,qBAAqB,EAA2B,MAAM,GAAG,CAAA;AAyDlE,MAAM,cAAc,GAAG,GAAG,CAAA,CAAC,0BAA0B;AAErD,MAAM,cAAc,GAAG,CAAC,OAAY,EAAE,KAAY,EAAE,MAAe,EAAE,EAAE;IACrE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,EAAE,CAAA;AACjC,CAAC,CAAA;AAqBD,MAAM,OAAO,YAAY;IAWvB,YACE,OAAO,GAAG,cAAc,EACxB,cAAuC,EACvC,KAAK,GAAG,EAAE;QAiBZ,UAAK,GAA6C,IAAI,GAAG,EAAE,CAAA;QAa3D,SAAI,GAAG,KAAK,EAAE,OAAkC,EAAE,EAAE;YAClD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;YAEtB,MAAM,KAAK,GAAG,MAAM,qBAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YACjE,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,GAAI,KAAe,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAA;YAC3E,4CAA4C;YAC5C,IAAI,CAAC,YAAY,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,KAA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I,CAAC,QAAQ,CACd,CAAA;QACD,IAAI,kBAAkB,EAAE;YACtB,IAAI,CAAC,QAAQ,CACX,IAAI,CAAC,OAAO,CACV,kBAAkB,CAAC,OAAO,EAC1B,IAAI,CAAC,KAAM,EACX,kBAAkB,CAAC,MAAM,IAAI,EAAE,CAChC,CACF,CAAA;SACF;IACH,CAAC;IACD,OAAO;QACL,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAM,CAAC,CAAA;SACjC;QACD,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;SACrE;QACD,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,KAAK,GAAG,EAAW,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAA;IACxB,CAAC;CACF"}
|
@@ -7,7 +7,7 @@
|
|
7
7
|
*
|
8
8
|
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
9
|
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c)
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
12
|
import { FileAttachment, FileManagement } from '@manuscripts/body-editor';
|
13
13
|
import React, { MutableRefObject } from 'react';
|
@@ -29,7 +29,6 @@ export interface EditorAppProps {
|
|
29
29
|
permittedActions: string[];
|
30
30
|
getAuthToken: () => Promise<string | undefined>;
|
31
31
|
observer?: AppStateObserver;
|
32
|
-
submissionID: string;
|
33
32
|
}
|
34
33
|
declare const EditorApp: React.FC<EditorAppProps>;
|
35
34
|
export default EditorApp;
|
package/dist/types/Main.d.ts
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
*
|
8
8
|
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
9
|
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c)
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
12
|
import React from 'react';
|
13
13
|
import { EditorAppProps } from './EditorApp';
|
@@ -7,7 +7,7 @@
|
|
7
7
|
*
|
8
8
|
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
9
|
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c)
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2023 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
12
|
import React from 'react';
|
13
13
|
declare const Inspector: React.FC;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
*
|
8
8
|
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
9
|
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c)
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
12
|
import '@manuscripts/body-editor/styles/Editor.css';
|
13
13
|
import '@manuscripts/body-editor/styles/AdvancedEditor.css';
|
@@ -7,7 +7,7 @@
|
|
7
7
|
*
|
8
8
|
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
9
|
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c)
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
12
|
import React from 'react';
|
13
13
|
export declare const TrackChangesPanel: React.FC;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
*
|
8
8
|
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
9
|
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c)
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2022 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
12
|
import { RootChange } from '@manuscripts/track-changes-plugin';
|
13
13
|
import React from 'react';
|
@@ -7,7 +7,7 @@
|
|
7
7
|
*
|
8
8
|
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
9
|
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c)
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2022 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
12
|
import { RootChange, RootChanges } from '@manuscripts/track-changes-plugin';
|
13
13
|
import React from 'react';
|
@@ -17,8 +17,8 @@ export interface SuggestionListProps {
|
|
17
17
|
title: string;
|
18
18
|
type: string;
|
19
19
|
sortBy: string;
|
20
|
-
onAccept(change: RootChange): void
|
21
|
-
onReject(change: RootChange): void
|
20
|
+
onAccept(change: RootChange): void;
|
21
|
+
onReject(change: RootChange): void;
|
22
22
|
onAcceptAll?(): void;
|
23
23
|
onSelect?(change: RootChange): void;
|
24
24
|
}
|
package/dist/types/index.d.ts
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
*
|
8
8
|
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
9
|
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c)
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
12
|
import './lib/fonts';
|
13
13
|
import React from 'react';
|
@@ -7,7 +7,7 @@
|
|
7
7
|
*
|
8
8
|
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
9
|
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c)
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
12
|
import { CommentKey, FileAttachment, FileManagement } from '@manuscripts/body-editor';
|
13
13
|
import { Project, UserProfile } from '@manuscripts/json-schema';
|
@@ -26,7 +26,6 @@ export type state = {
|
|
26
26
|
manuscriptID: string;
|
27
27
|
projectID: string;
|
28
28
|
userID?: string;
|
29
|
-
submissionID?: string;
|
30
29
|
project: Project;
|
31
30
|
refreshProject: () => Promise<void>;
|
32
31
|
user: UserProfile;
|
@@ -35,7 +34,6 @@ export type state = {
|
|
35
34
|
initialDocVersion: number;
|
36
35
|
trackState?: TrackChangesState;
|
37
36
|
isViewingMode?: boolean;
|
38
|
-
isComparingMode?: boolean;
|
39
37
|
view?: ManuscriptEditorView;
|
40
38
|
titleText: string;
|
41
39
|
fileManagement: FileManagement;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@manuscripts/article-editor",
|
3
|
-
"version": "3.9.1
|
3
|
+
"version": "3.9.1",
|
4
4
|
"license": "CPAL-1.0",
|
5
5
|
"description": "React components for editing and viewing manuscripts",
|
6
6
|
"repository": "github:Atypon-OpenSource/manuscripts-article-editor",
|
@@ -35,12 +35,12 @@
|
|
35
35
|
"@fontsource/lato": "^4.5.10",
|
36
36
|
"@fontsource/pt-sans": "^4.5.11",
|
37
37
|
"@fontsource/pt-serif": "^4.5.11",
|
38
|
-
"@manuscripts/body-editor": "2.9.1
|
38
|
+
"@manuscripts/body-editor": "2.9.1",
|
39
39
|
"@manuscripts/json-schema": "2.2.11",
|
40
40
|
"@manuscripts/library": "1.3.14",
|
41
41
|
"@manuscripts/style-guide": "2.1.13",
|
42
|
-
"@manuscripts/track-changes-plugin": "1.10.
|
43
|
-
"@manuscripts/transform": "3.1.
|
42
|
+
"@manuscripts/track-changes-plugin": "1.10.9",
|
43
|
+
"@manuscripts/transform": "3.1.0",
|
44
44
|
"@popperjs/core": "^2.11.8",
|
45
45
|
"@types/use-sync-external-store": "^0.0.6",
|
46
46
|
"autotrack": "^2.4.1",
|
@@ -60,8 +60,7 @@
|
|
60
60
|
"styled-components": "^5.2.0",
|
61
61
|
"use-sync-external-store": "^1.2.2",
|
62
62
|
"uuid": "^9.0.0",
|
63
|
-
"yarn-run-all": "^3.1.1"
|
64
|
-
"diff-match-patch": "^1.0.5"
|
63
|
+
"yarn-run-all": "^3.1.1"
|
65
64
|
},
|
66
65
|
"devDependencies": {
|
67
66
|
"@babel/core": "^7.20.5",
|
@@ -69,7 +68,6 @@
|
|
69
68
|
"@babel/preset-react": "^7.18.6",
|
70
69
|
"@babel/preset-typescript": "^7.18.6",
|
71
70
|
"@manuscripts/eslint-config": "^0.5.1",
|
72
|
-
"@types/diff-match-patch": "^1.0.36",
|
73
71
|
"@types/dompurify": "^2.0.4",
|
74
72
|
"@types/google.analytics": "^0.0.45",
|
75
73
|
"@types/jest": "^29.2.4",
|
@@ -1,170 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
-
};
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
exports.CompareDocumentsModal = void 0;
|
30
|
-
/*!
|
31
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
32
|
-
*
|
33
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
34
|
-
*
|
35
|
-
* The Original Code is manuscripts-frontend.
|
36
|
-
*
|
37
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
38
|
-
*
|
39
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2025 Atypon Systems LLC. All Rights Reserved.
|
40
|
-
*/
|
41
|
-
const style_guide_1 = require("@manuscripts/style-guide");
|
42
|
-
const react_1 = __importStar(require("react"));
|
43
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
44
|
-
const CompareDocumentsModal = ({ snapshots, loading = false, error = null, onCancel, submissionID, }) => {
|
45
|
-
const [isOpen, setOpen] = (0, react_1.useState)(true);
|
46
|
-
const [originalDocId, setOriginalDocId] = (0, react_1.useState)('');
|
47
|
-
const [comparisonDocId, setComparisonDocId] = (0, react_1.useState)('');
|
48
|
-
const handleCompare = () => {
|
49
|
-
setOpen(false);
|
50
|
-
window.open(`/editor/${submissionID}/compare/${originalDocId}/${comparisonDocId}`, '_blank');
|
51
|
-
handleClose();
|
52
|
-
};
|
53
|
-
const handleClose = () => {
|
54
|
-
setOpen(false);
|
55
|
-
onCancel();
|
56
|
-
};
|
57
|
-
return (react_1.default.createElement(style_guide_1.StyledModal, { isOpen: isOpen, onRequestClose: handleClose, shouldCloseOnOverlayClick: true },
|
58
|
-
react_1.default.createElement(StyledModalContainer, null,
|
59
|
-
react_1.default.createElement(StyledModalHeader, null,
|
60
|
-
react_1.default.createElement(ModalTitle, null, "Compare Documents"),
|
61
|
-
react_1.default.createElement(style_guide_1.CloseButton, { onClick: handleClose })),
|
62
|
-
react_1.default.createElement(StyledModalBody, null, loading ? (react_1.default.createElement(LoadingContainer, null,
|
63
|
-
react_1.default.createElement(LoadingText, null, "Loading snapshots..."))) : error ? (react_1.default.createElement(ErrorMessage, null, error)) : (react_1.default.createElement(react_1.default.Fragment, null,
|
64
|
-
react_1.default.createElement(DocumentSelectContainer, null,
|
65
|
-
react_1.default.createElement(SelectContainer, null,
|
66
|
-
react_1.default.createElement(InputLabel, { htmlFor: "original-document" }, "Original Version"),
|
67
|
-
react_1.default.createElement(Select, { id: "original-document", value: originalDocId, onChange: (e) => setOriginalDocId(e.target.value) },
|
68
|
-
react_1.default.createElement("option", { value: "" }, "Select a version"),
|
69
|
-
snapshots.map((snapshot) => (react_1.default.createElement("option", { key: snapshot.id, value: snapshot.id, disabled: snapshot.id === comparisonDocId },
|
70
|
-
snapshot.name,
|
71
|
-
" (",
|
72
|
-
snapshot.createdAt,
|
73
|
-
")"))))),
|
74
|
-
react_1.default.createElement(SelectContainer, null,
|
75
|
-
react_1.default.createElement(InputLabel, { htmlFor: "comparison-document" }, "Version to Compare"),
|
76
|
-
react_1.default.createElement(Select, { id: "comparison-document", value: comparisonDocId, onChange: (e) => setComparisonDocId(e.target.value) },
|
77
|
-
react_1.default.createElement("option", { value: "" }, "Select a version"),
|
78
|
-
snapshots.map((snapshot) => (react_1.default.createElement("option", { key: snapshot.id, value: snapshot.id, disabled: snapshot.id === originalDocId },
|
79
|
-
snapshot.name,
|
80
|
-
" (",
|
81
|
-
snapshot.createdAt,
|
82
|
-
")")))))),
|
83
|
-
react_1.default.createElement(ButtonContainer, null,
|
84
|
-
react_1.default.createElement(style_guide_1.SecondaryButton, { onClick: handleClose }, "Cancel"),
|
85
|
-
react_1.default.createElement(style_guide_1.PrimaryButton, { onClick: handleCompare, disabled: !originalDocId ||
|
86
|
-
!comparisonDocId ||
|
87
|
-
originalDocId === comparisonDocId }, "Compare"))))))));
|
88
|
-
};
|
89
|
-
exports.CompareDocumentsModal = CompareDocumentsModal;
|
90
|
-
const DocumentSelectContainer = styled_components_1.default.div `
|
91
|
-
display: flex;
|
92
|
-
flex-direction: column;
|
93
|
-
gap: ${(props) => props.theme.grid.unit * 2}px;
|
94
|
-
`;
|
95
|
-
const SelectContainer = styled_components_1.default.div `
|
96
|
-
display: flex;
|
97
|
-
flex-direction: column;
|
98
|
-
gap: ${(props) => props.theme.grid.unit}px;
|
99
|
-
margin-bottom: ${(props) => props.theme.grid.unit * 2}px;
|
100
|
-
`;
|
101
|
-
const InputLabel = styled_components_1.default.label `
|
102
|
-
font-size: ${(props) => props.theme.font.size.normal};
|
103
|
-
font-weight: ${(props) => props.theme.font.weight.medium};
|
104
|
-
color: ${(props) => props.theme.colors.text.primary};
|
105
|
-
margin-bottom: ${(props) => props.theme.grid.unit}px;
|
106
|
-
`;
|
107
|
-
const Select = styled_components_1.default.select `
|
108
|
-
width: 100%;
|
109
|
-
height: 36px;
|
110
|
-
padding: 0 ${(props) => props.theme.grid.unit * 2}px;
|
111
|
-
border: 1px solid ${(props) => props.theme.colors.border.secondary};
|
112
|
-
border-radius: ${(props) => props.theme.grid.radius.small};
|
113
|
-
background-color: ${(props) => props.theme.colors.background.primary};
|
114
|
-
font-size: ${(props) => props.theme.font.size.normal};
|
115
|
-
color: ${(props) => props.theme.colors.text.primary};
|
116
|
-
appearance: none;
|
117
|
-
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 6L0 0h12z' fill='%23666'/%3E%3C/svg%3E");
|
118
|
-
background-repeat: no-repeat;
|
119
|
-
background-position: right ${(props) => props.theme.grid.unit * 2}px center;
|
120
|
-
`;
|
121
|
-
const ButtonContainer = styled_components_1.default.div `
|
122
|
-
display: flex;
|
123
|
-
justify-content: flex-end;
|
124
|
-
gap: ${(props) => props.theme.grid.unit * 2}px;
|
125
|
-
padding-top: ${(props) => props.theme.grid.unit * 2}px;
|
126
|
-
border-top: 1px solid ${(props) => props.theme.colors.border.tertiary};
|
127
|
-
`;
|
128
|
-
const StyledModalBody = (0, styled_components_1.default)(style_guide_1.ModalBody) `
|
129
|
-
width: 400px;
|
130
|
-
padding: ${(props) => props.theme.grid.unit * 3}px;
|
131
|
-
flex-direction: column;
|
132
|
-
height: 250px;
|
133
|
-
justify-content: end;
|
134
|
-
margin-bottom: 15px;
|
135
|
-
`;
|
136
|
-
const StyledModalContainer = (0, styled_components_1.default)(style_guide_1.ModalContainer) `
|
137
|
-
margin: auto;
|
138
|
-
position: relative;
|
139
|
-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
|
140
|
-
`;
|
141
|
-
const ModalTitle = styled_components_1.default.h2 `
|
142
|
-
font-size: ${(props) => props.theme.font.size.medium};
|
143
|
-
font-weight: ${(props) => props.theme.font.weight.bold};
|
144
|
-
color: ${(props) => props.theme.colors.text.primary};
|
145
|
-
margin-left: ${(props) => props.theme.grid.unit * 2}px;
|
146
|
-
`;
|
147
|
-
const StyledModalHeader = (0, styled_components_1.default)(style_guide_1.ModalHeader) `
|
148
|
-
width: 100%;
|
149
|
-
display: flex;
|
150
|
-
justify-content: space-between;
|
151
|
-
align-items: center;
|
152
|
-
border-bottom: 1px solid ${(props) => props.theme.colors.border.tertiary};
|
153
|
-
`;
|
154
|
-
const LoadingContainer = styled_components_1.default.div `
|
155
|
-
display: flex;
|
156
|
-
justify-content: center;
|
157
|
-
align-items: center;
|
158
|
-
height: 60px;
|
159
|
-
`;
|
160
|
-
const LoadingText = styled_components_1.default.div `
|
161
|
-
font-size: ${(props) => props.theme.font.size.normal};
|
162
|
-
color: ${(props) => props.theme.colors.text.secondary};
|
163
|
-
text-align: center;
|
164
|
-
`;
|
165
|
-
const ErrorMessage = styled_components_1.default.div `
|
166
|
-
color: ${(props) => props.theme.colors.text.error};
|
167
|
-
margin: ${(props) => props.theme.grid.unit * 2}px 0;
|
168
|
-
text-align: center;
|
169
|
-
`;
|
170
|
-
//# sourceMappingURL=CompareDocumentsModal.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"CompareDocumentsModal.js","sourceRoot":"","sources":["../../../../src/components/tools/CompareDocumentsModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,0DAQiC;AACjC,+CAAuC;AACvC,0EAAsC;AAY/B,MAAM,qBAAqB,GAAyC,CAAC,EAC1E,SAAS,EACT,OAAO,GAAG,KAAK,EACf,KAAK,GAAG,IAAI,EACZ,QAAQ,EACR,YAAY,GACb,EAAE,EAAE;IACH,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAA;IACxC,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAS,EAAE,CAAC,CAAA;IAC9D,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAS,EAAE,CAAC,CAAA;IAElE,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,OAAO,CAAC,KAAK,CAAC,CAAA;QACd,MAAM,CAAC,IAAI,CACT,WAAW,YAAY,YAAY,aAAa,IAAI,eAAe,EAAE,EACrE,QAAQ,CACT,CAA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AC,IAAI,CAAC,IAAI,CAAC,MAAM;WAC3C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS;;CAEtD,CAAA;AAED,MAAM,YAAY,GAAG,2BAAM,CAAC,GAAG,CAAA;WACpB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;YACvC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;CAE/C,CAAA"}
|
@@ -1,69 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/*!
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
4
|
-
*
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
6
|
-
*
|
7
|
-
* The Original Code is manuscripts-frontend.
|
8
|
-
*
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
10
|
-
*
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2025 Atypon Systems LLC. All Rights Reserved.
|
12
|
-
*/
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
-
exports.useCompareDocuments = void 0;
|
15
|
-
const react_1 = require("react");
|
16
|
-
const compare_documents_1 = require("../lib/comparison/compare-documents");
|
17
|
-
const useCompareDocuments = ({ originalId, comparisonId, getSnapshot, }) => {
|
18
|
-
const [comparedDoc, setComparedDoc] = (0, react_1.useState)(null);
|
19
|
-
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
20
|
-
const [error, setError] = (0, react_1.useState)(null);
|
21
|
-
const isComparingMode = Boolean(originalId && comparisonId);
|
22
|
-
(0, react_1.useEffect)(() => {
|
23
|
-
const fetchAndCompareDocuments = async () => {
|
24
|
-
if (!originalId || !comparisonId) {
|
25
|
-
setComparedDoc(null);
|
26
|
-
setError(null);
|
27
|
-
return;
|
28
|
-
}
|
29
|
-
setIsLoading(true);
|
30
|
-
setError(null);
|
31
|
-
try {
|
32
|
-
const [originalSnapshot, comparisonSnapshot] = await Promise.all([
|
33
|
-
getSnapshot(originalId),
|
34
|
-
getSnapshot(comparisonId),
|
35
|
-
]);
|
36
|
-
if (!originalSnapshot || !comparisonSnapshot) {
|
37
|
-
throw new Error('Failed to fetch one or both snapshots');
|
38
|
-
}
|
39
|
-
const comparedDocument = (0, compare_documents_1.compareDocuments)(originalSnapshot, comparisonSnapshot);
|
40
|
-
setComparedDoc(comparedDocument);
|
41
|
-
}
|
42
|
-
catch (err) {
|
43
|
-
console.error('Error comparing documents:', err);
|
44
|
-
setError(err instanceof Error ? err.message : 'Unknown error occurred');
|
45
|
-
setComparedDoc(null);
|
46
|
-
}
|
47
|
-
finally {
|
48
|
-
setIsLoading(false);
|
49
|
-
}
|
50
|
-
};
|
51
|
-
fetchAndCompareDocuments();
|
52
|
-
}, [originalId, comparisonId, getSnapshot]);
|
53
|
-
// Reset state when exiting comparison mode
|
54
|
-
(0, react_1.useEffect)(() => {
|
55
|
-
if (!isComparingMode) {
|
56
|
-
setComparedDoc(null);
|
57
|
-
setError(null);
|
58
|
-
setIsLoading(false);
|
59
|
-
}
|
60
|
-
}, [isComparingMode]);
|
61
|
-
return {
|
62
|
-
comparedDoc,
|
63
|
-
isComparingMode,
|
64
|
-
isLoading,
|
65
|
-
error,
|
66
|
-
};
|
67
|
-
};
|
68
|
-
exports.useCompareDocuments = useCompareDocuments;
|
69
|
-
//# sourceMappingURL=use-compare-documents.js.map
|
@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BAAkB,CACnB,CAAA;gBACD,cAAc,CAAC,gBAAgB,CAAC,CAAA;aACjC;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAA;gBAChD,QAAQ,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAA;gBACvE,cAAc,CAAC,IAAI,CAAC,CAAA;aACrB;oBAAS;gBACR,YAAY,CAAC,KAAK,CAAC,CAAA;aACpB;QACH,CAAC,CAAA;QAED,wBAAwB,EAAE,CAAA;IAC5B,CAAC,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC,CAAA;IAE3C,2CAA2C;IAC3C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,eAAe,EAAE;YACpB,cAAc,CAAC,IAAI,CAAC,CAAA;YACpB,QAAQ,CAAC,IAAI,CAAC,CAAA;YACd,YAAY,CAAC,KAAK,CAAC,CAAA;SACpB;IACH,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAA;IAErB,OAAO;QACL,WAAW;QACX,eAAe;QACf,SAAS;QACT,KAAK;KACN,CAAA;AACH,CAAC,CAAA;AAhEY,QAAA,mBAAmB,uBAgE/B"}
|
@@ -1,53 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/*!
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
4
|
-
*
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
6
|
-
*
|
7
|
-
* The Original Code is manuscripts-frontend.
|
8
|
-
*
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
10
|
-
*
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2025 Atypon Systems LLC. All Rights Reserved.
|
12
|
-
*/
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
-
exports.compareSingleNodeAttrs = exports.compareDocuments = void 0;
|
15
|
-
const transform_1 = require("@manuscripts/transform");
|
16
|
-
const lodash_1 = require("lodash");
|
17
|
-
const create_dataTracked_attrs_1 = require("./create-dataTracked-attrs");
|
18
|
-
const distribute_nodes_1 = require("./distribute-nodes");
|
19
|
-
const rebuild_nodes_tree_1 = require("./rebuild-nodes-tree");
|
20
|
-
// The entry point for the comparison mode, which is used to compare two ManuscriptNode trees
|
21
|
-
// It distributes the nodes, rebuilds the nodes tree and then creates a new ManuscriptNode tree
|
22
|
-
const compareDocuments = (originalSnapshot, comparisonSnapshot) => {
|
23
|
-
const originalDocument = transform_1.schema.nodeFromJSON(originalSnapshot.snapshot);
|
24
|
-
const comparisonDocument = transform_1.schema.nodeFromJSON(comparisonSnapshot.snapshot);
|
25
|
-
const distributedNodes = (0, distribute_nodes_1.distributeNodesForComparison)(originalDocument, comparisonDocument);
|
26
|
-
const distributedNodesArray = [];
|
27
|
-
distributedNodes.forEach((_, key) => {
|
28
|
-
distributedNodesArray.push((0, rebuild_nodes_tree_1.rebuildDocNodeTree)(key, distributedNodes));
|
29
|
-
});
|
30
|
-
const manuscript = transform_1.schema.nodes.manuscript.create(comparisonDocument.attrs, distributedNodesArray);
|
31
|
-
return manuscript;
|
32
|
-
};
|
33
|
-
exports.compareDocuments = compareDocuments;
|
34
|
-
// Compares the attributes of two nodes and returns a new node with the updated attributes
|
35
|
-
const compareSingleNodeAttrs = (originalNode, comparisonNode, nodeType, rebuiltChildren) => {
|
36
|
-
const originalAttrs = originalNode?.attrs || {};
|
37
|
-
const comparisonAttrs = comparisonNode?.attrs || {};
|
38
|
-
if (!(0, lodash_1.isEqual)(originalAttrs, comparisonAttrs)) {
|
39
|
-
return nodeType.create({
|
40
|
-
...comparisonAttrs,
|
41
|
-
dataTracked: [(0, create_dataTracked_attrs_1.createComparisonSetAttrsDataTracked)('', originalAttrs)],
|
42
|
-
}, rebuiltChildren.length > 0
|
43
|
-
? rebuiltChildren
|
44
|
-
: comparisonNode?.content || null);
|
45
|
-
}
|
46
|
-
else {
|
47
|
-
return nodeType.create(comparisonAttrs, rebuiltChildren.length > 0
|
48
|
-
? rebuiltChildren
|
49
|
-
: comparisonNode?.content || null);
|
50
|
-
}
|
51
|
-
};
|
52
|
-
exports.compareSingleNodeAttrs = compareSingleNodeAttrs;
|
53
|
-
//# sourceMappingURL=compare-documents.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"compare-documents.js","sourceRoot":"","sources":["../../../../src/lib/comparison/compare-documents.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,sDAA+D;AAC/D,mCAAgC;AAIhC,yEAAgF;AAChF,yDAAiE;AACjE,6DAAyD;AAEzD,6FAA6F;AAC7F,+FAA+F;AACxF,MAAM,gBAAgB,GAAG,CAC9B,gBAAoC,EACpC,kBAAsC,EACtC,EAAE;IACF,MAAM,gBAAgB,GAAG,kBAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAA;IACvE,MAAM,kBAAkB,GAAG,kBAAM,CAAC,YAAY,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,gBAAgB,GAAG,IAAA,+CAA4B,EACnD,gBAAgB,EAChB,kBAAkB,CACnB,CAAA;IACD,MAAM,qBAAqB,GAAqB,EAAE,CAAA;IAClD,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;QAClC,qBAAqB,CAAC,IAAI,CAAC,IAAA,uCAAkB,EAAC,GAA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