@manuscripts/article-editor 1.16.17 → 1.16.19-LEAN-3771.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/dist/cjs/EditorApp.js +2 -1
- package/dist/cjs/EditorApp.js.map +1 -1
- package/dist/cjs/components/FileManager/FileActions.js +136 -0
- package/dist/cjs/components/FileManager/FileActions.js.map +1 -0
- package/dist/cjs/components/FileManager/FileContainer.js +51 -0
- package/dist/cjs/components/FileManager/FileContainer.js.map +1 -0
- package/dist/cjs/components/FileManager/FileCreatedDate.js +26 -0
- package/dist/cjs/components/FileManager/FileCreatedDate.js.map +1 -0
- package/dist/cjs/components/FileManager/FileManager.js +68 -0
- package/dist/cjs/components/FileManager/FileManager.js.map +1 -0
- package/dist/cjs/components/FileManager/FileManagerDragLayer.js +67 -0
- package/dist/cjs/components/FileManager/FileManagerDragLayer.js.map +1 -0
- package/dist/cjs/components/FileManager/FileName.js +28 -0
- package/dist/cjs/components/FileManager/FileName.js.map +1 -0
- package/dist/cjs/components/FileManager/FileSectionAlert.js +181 -0
- package/dist/cjs/components/FileManager/FileSectionAlert.js.map +1 -0
- package/dist/cjs/components/FileManager/FileTypeIcon.js +24 -0
- package/dist/cjs/components/FileManager/FileTypeIcon.js.map +1 -0
- package/dist/cjs/components/FileManager/FileUploader.js +100 -0
- package/dist/cjs/components/FileManager/FileUploader.js.map +1 -0
- package/dist/cjs/components/FileManager/InlineFilesSection.js +158 -0
- package/dist/cjs/components/FileManager/InlineFilesSection.js.map +1 -0
- package/dist/cjs/components/FileManager/OtherFilesSection.js +109 -0
- package/dist/cjs/components/FileManager/OtherFilesSection.js.map +1 -0
- package/dist/cjs/components/FileManager/SupplementsSection.js +131 -0
- package/dist/cjs/components/FileManager/SupplementsSection.js.map +1 -0
- package/dist/cjs/components/projects/EditorElement.js +9 -12
- package/dist/cjs/components/projects/EditorElement.js.map +1 -1
- package/dist/cjs/components/projects/Inspector.js +2 -3
- package/dist/cjs/components/projects/Inspector.js.map +1 -1
- package/dist/cjs/lib/attrs-change-filter.js.map +1 -1
- package/dist/cjs/postgres-data/PsSource.js +11 -0
- package/dist/cjs/postgres-data/PsSource.js.map +1 -1
- package/dist/cjs/postgres-data/buildUtilities.js +5 -11
- package/dist/cjs/postgres-data/buildUtilities.js.map +1 -1
- package/dist/cjs/postgres-data/savingUtilities.js +1 -24
- package/dist/cjs/postgres-data/savingUtilities.js.map +1 -1
- package/dist/cjs/store/Store.js.map +1 -1
- package/dist/cjs/store/StoreContext.js +1 -2
- package/dist/cjs/store/StoreContext.js.map +1 -1
- package/dist/es/EditorApp.js +2 -1
- package/dist/es/EditorApp.js.map +1 -1
- package/dist/es/components/FileManager/FileActions.js +106 -0
- package/dist/es/components/FileManager/FileActions.js.map +1 -0
- package/dist/es/components/FileManager/FileContainer.js +45 -0
- package/dist/es/components/FileManager/FileContainer.js.map +1 -0
- package/dist/es/components/FileManager/FileCreatedDate.js +19 -0
- package/dist/es/components/FileManager/FileCreatedDate.js.map +1 -0
- package/dist/es/components/FileManager/FileManager.js +61 -0
- package/dist/es/components/FileManager/FileManager.js.map +1 -0
- package/dist/es/components/FileManager/FileManagerDragLayer.js +60 -0
- package/dist/es/components/FileManager/FileManagerDragLayer.js.map +1 -0
- package/dist/es/components/FileManager/FileName.js +21 -0
- package/dist/es/components/FileManager/FileName.js.map +1 -0
- package/dist/es/components/FileManager/FileSectionAlert.js +174 -0
- package/dist/es/components/FileManager/FileSectionAlert.js.map +1 -0
- package/dist/es/components/FileManager/FileTypeIcon.js +17 -0
- package/dist/es/components/FileManager/FileTypeIcon.js.map +1 -0
- package/dist/es/components/FileManager/FileUploader.js +73 -0
- package/dist/es/components/FileManager/FileUploader.js.map +1 -0
- package/dist/es/components/FileManager/InlineFilesSection.js +128 -0
- package/dist/es/components/FileManager/InlineFilesSection.js.map +1 -0
- package/dist/es/components/FileManager/OtherFilesSection.js +82 -0
- package/dist/es/components/FileManager/OtherFilesSection.js.map +1 -0
- package/dist/es/components/FileManager/SupplementsSection.js +104 -0
- package/dist/es/components/FileManager/SupplementsSection.js.map +1 -0
- package/dist/es/components/projects/EditorElement.js +10 -13
- package/dist/es/components/projects/EditorElement.js.map +1 -1
- package/dist/es/components/projects/Inspector.js +3 -4
- package/dist/es/components/projects/Inspector.js.map +1 -1
- package/dist/es/lib/attrs-change-filter.js.map +1 -1
- package/dist/es/postgres-data/PsSource.js +11 -0
- package/dist/es/postgres-data/PsSource.js.map +1 -1
- package/dist/es/postgres-data/buildUtilities.js +5 -11
- package/dist/es/postgres-data/buildUtilities.js.map +1 -1
- package/dist/es/postgres-data/savingUtilities.js +0 -22
- package/dist/es/postgres-data/savingUtilities.js.map +1 -1
- package/dist/es/store/Store.js.map +1 -1
- package/dist/es/store/StoreContext.js +1 -2
- package/dist/es/store/StoreContext.js.map +1 -1
- package/dist/types/EditorApp.d.ts +1 -1
- package/dist/types/components/FileManager/FileActions.d.ts +21 -0
- package/dist/types/components/FileManager/FileContainer.d.ts +1 -0
- package/dist/types/components/FileManager/FileCreatedDate.d.ts +19 -0
- package/dist/types/components/FileManager/FileManager.d.ts +23 -0
- package/dist/types/components/FileManager/FileManagerDragLayer.d.ts +13 -0
- package/dist/types/components/FileManager/FileName.d.ts +17 -0
- package/dist/types/components/FileManager/FileSectionAlert.d.ts +13 -0
- package/dist/types/components/FileManager/FileTypeIcon.d.ts +20 -0
- package/dist/types/components/FileManager/FileUploader.d.ts +19 -0
- package/dist/types/components/FileManager/InlineFilesSection.d.ts +17 -0
- package/dist/types/components/FileManager/OtherFilesSection.d.ts +19 -0
- package/dist/types/components/FileManager/SupplementsSection.d.ts +20 -0
- package/dist/types/lib/attrs-change-filter.d.ts +1 -1
- package/dist/types/postgres-data/PsSource.d.ts +1 -1
- package/dist/types/postgres-data/savingUtilities.d.ts +0 -1
- package/dist/types/store/DataSourceStrategy.d.ts +1 -1
- package/dist/types/store/Store.d.ts +1 -2
- package/dist/types/store/StoreContext.d.ts +1 -2
- package/package.json +3 -3
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* 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.
|
|
3
|
+
*
|
|
4
|
+
* 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.
|
|
5
|
+
*
|
|
6
|
+
* The Original Code is manuscripts-frontend.
|
|
7
|
+
*
|
|
8
|
+
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
+
*
|
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
+
*/
|
|
12
|
+
import { insertSupplement } from '@manuscripts/body-editor';
|
|
13
|
+
import { usePermissions } from '@manuscripts/style-guide';
|
|
14
|
+
import React, { useEffect, useState } from 'react';
|
|
15
|
+
import { useDrag } from 'react-dnd';
|
|
16
|
+
import { getEmptyImage } from 'react-dnd-html5-backend';
|
|
17
|
+
import { useStore } from '../../store';
|
|
18
|
+
import { FileActions } from './FileActions';
|
|
19
|
+
import { FileContainer } from './FileContainer';
|
|
20
|
+
import { FileCreatedDate } from './FileCreatedDate';
|
|
21
|
+
import { FileSectionType } from './FileManager';
|
|
22
|
+
import { FileName } from './FileName';
|
|
23
|
+
import { FileSectionAlert, FileSectionAlertType } from './FileSectionAlert';
|
|
24
|
+
import { FileUploader } from './FileUploader';
|
|
25
|
+
/**
|
|
26
|
+
* This component represents the other files in the file section.
|
|
27
|
+
*/
|
|
28
|
+
export const SupplementsSection = ({ supplements, }) => {
|
|
29
|
+
const [{ view, fileManagement }] = useStore((s) => ({
|
|
30
|
+
view: s.view,
|
|
31
|
+
fileManagement: s.fileManagement,
|
|
32
|
+
}));
|
|
33
|
+
const can = usePermissions();
|
|
34
|
+
const [alert, setAlert] = useState({
|
|
35
|
+
type: FileSectionAlertType.NONE,
|
|
36
|
+
message: '',
|
|
37
|
+
});
|
|
38
|
+
const upload = async (file) => {
|
|
39
|
+
setAlert({
|
|
40
|
+
type: FileSectionAlertType.UPLOAD_IN_PROGRESS,
|
|
41
|
+
message: file.name,
|
|
42
|
+
});
|
|
43
|
+
const uploaded = await fileManagement.upload(file);
|
|
44
|
+
setAlert({
|
|
45
|
+
type: FileSectionAlertType.UPLOAD_SUCCESSFUL,
|
|
46
|
+
message: '',
|
|
47
|
+
});
|
|
48
|
+
return uploaded;
|
|
49
|
+
};
|
|
50
|
+
const handleUpload = async (file) => {
|
|
51
|
+
const uploaded = await upload(file);
|
|
52
|
+
insertSupplement(uploaded, view.state, view.dispatch);
|
|
53
|
+
};
|
|
54
|
+
const handleReplace = async (supplement, file) => {
|
|
55
|
+
const uploaded = await upload(file);
|
|
56
|
+
const tr = view.state.tr;
|
|
57
|
+
tr.setNodeAttribute(supplement.pos, 'href', uploaded.id);
|
|
58
|
+
view.dispatch(tr);
|
|
59
|
+
};
|
|
60
|
+
const handleMoveToOtherFiles = (supplement) => {
|
|
61
|
+
const tr = view.state.tr;
|
|
62
|
+
const from = supplement.pos;
|
|
63
|
+
const to = from + supplement.node.nodeSize;
|
|
64
|
+
tr.delete(from, to);
|
|
65
|
+
view.dispatch(tr);
|
|
66
|
+
setAlert({
|
|
67
|
+
type: FileSectionAlertType.MOVE_SUCCESSFUL,
|
|
68
|
+
message: FileSectionType.OtherFile,
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
return (React.createElement(React.Fragment, null,
|
|
72
|
+
can?.uploadFile && React.createElement(FileUploader, { onUpload: handleUpload }),
|
|
73
|
+
React.createElement(FileSectionAlert, { alert: alert }),
|
|
74
|
+
supplements.map((supplement) => (React.createElement(SupplementFile, { key: supplement.node.attrs.id, supplement: supplement, onDownload: () => fileManagement.download(supplement.file), onReplace: async (f) => await handleReplace(supplement, f), onDetach: () => handleMoveToOtherFiles(supplement) })))));
|
|
75
|
+
};
|
|
76
|
+
const SupplementFile = ({ supplement, onDownload, onReplace, onDetach }) => {
|
|
77
|
+
const [{ isDragging }, dragRef, preview] = useDrag({
|
|
78
|
+
type: 'file',
|
|
79
|
+
item: {
|
|
80
|
+
file: supplement,
|
|
81
|
+
},
|
|
82
|
+
end: (_, monitor) => {
|
|
83
|
+
if (monitor.didDrop()) {
|
|
84
|
+
onDetach();
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
collect: (monitor) => ({
|
|
88
|
+
isDragging: monitor.isDragging(),
|
|
89
|
+
}),
|
|
90
|
+
});
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
preview(getEmptyImage());
|
|
93
|
+
}, [preview]);
|
|
94
|
+
return (React.createElement(FileContainer, { "data-cy": "file-container", key: supplement.file.id, ref: dragRef, className: isDragging ? 'dragging' : '' },
|
|
95
|
+
React.createElement(FileName, { file: supplement.file }),
|
|
96
|
+
React.createElement(FileCreatedDate, { file: supplement.file, className: "show-on-hover" }),
|
|
97
|
+
React.createElement(FileActions, { "data-cy": "file-actions", sectionType: FileSectionType.Supplements, onDownload: supplement.file ? onDownload : undefined, onReplace: onReplace, move: supplement.file
|
|
98
|
+
? {
|
|
99
|
+
sectionType: FileSectionType.OtherFile,
|
|
100
|
+
handler: onDetach,
|
|
101
|
+
}
|
|
102
|
+
: undefined })));
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=SupplementsSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupplementsSection.js","sourceRoot":"","sources":["../../../../src/components/FileManager/SupplementsSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,gBAAgB,EAAY,MAAM,0BAA0B,CAAA;AACrE,OAAO,EAA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,OAAO,CAAC,aAAa,EAAE,CAAC,CAAA;IAC1B,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IAEb,OAAO,CACL,oBAAC,aAAa,eACJ,gBAAgB,EACxB,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,EACvB,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;QAEvC,oBAAC,QAAQ,IAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAI;QACnC,oBAAC,eAAe,IAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,SAAS,EAAC,eAAe,GAAG;QACpE,oBAAC,WAAW,eACF,cAAc,EACtB,WAAW,EAAE,eAAe,CAAC,WAAW,EACxC,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EACpD,SAAS,EAAE,SAAS,EACpB,IAAI,EACF,UAAU,CAAC,IAAI;gBACb,CAAC,CAAC;oBACE,WAAW,EAAE,eAAe,CAAC,SAAS;oBACtC,OAAO,EAAE,QAAQ;iBAClB;gBACH,CAAC,CAAC,SAAS,GAEf,CACY,CACjB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2021 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
|
-
import { findParentElement, getMatchingChild,
|
|
12
|
+
import { findParentElement, getMatchingChild, insertFigure, } from '@manuscripts/body-editor';
|
|
13
13
|
import { ObjectTypes } from '@manuscripts/json-schema';
|
|
14
14
|
import { Category, Dialog } from '@manuscripts/style-guide';
|
|
15
15
|
import { CHANGE_STATUS, trackCommands, } from '@manuscripts/track-changes-plugin';
|
|
@@ -25,8 +25,7 @@ import { SpriteMap } from '../track-changes/suggestion-list/Icons';
|
|
|
25
25
|
const EditorElement = ({ editor }) => {
|
|
26
26
|
const { onRender, view, dispatch } = editor;
|
|
27
27
|
const [error, setError] = useState('');
|
|
28
|
-
const [{
|
|
29
|
-
deleteModel: store.deleteTrackModel,
|
|
28
|
+
const [{ trackState }] = useStore((store) => ({
|
|
30
29
|
trackState: store.trackState,
|
|
31
30
|
}));
|
|
32
31
|
const execCmd = useExecCmd();
|
|
@@ -38,10 +37,8 @@ const EditorElement = ({ editor }) => {
|
|
|
38
37
|
const docPos = view.posAtCoords({ left: offset.x, top: offset.y });
|
|
39
38
|
// @ts-expect-error: Ignoring default type from the React DnD plugin. Seems to be unreachable
|
|
40
39
|
const file = item.file;
|
|
41
|
-
// @ts-expect-error: Ignoring default type from the React DnD plugin. Seems to be unreachable
|
|
42
|
-
const model = item.model;
|
|
43
40
|
if (!file || !docPos || !docPos.pos) {
|
|
44
|
-
return;
|
|
41
|
+
return false;
|
|
45
42
|
}
|
|
46
43
|
const resolvedPos = view.state.doc.resolve(docPos.pos);
|
|
47
44
|
const attrs = {
|
|
@@ -70,17 +67,17 @@ const EditorElement = ({ editor }) => {
|
|
|
70
67
|
break;
|
|
71
68
|
}
|
|
72
69
|
default: {
|
|
73
|
-
const
|
|
70
|
+
const tr = view.state.tr;
|
|
71
|
+
tr.setSelection(NodeSelection.near(resolvedPos));
|
|
74
72
|
view.focus();
|
|
75
|
-
dispatch(
|
|
73
|
+
dispatch(tr);
|
|
76
74
|
// after dispatch is called - the view.state changes and becomes the new state of the editor so exactly the view.state has to be used to make changes on the actual state
|
|
77
|
-
|
|
75
|
+
insertFigure(file, view.state, dispatch);
|
|
78
76
|
}
|
|
79
77
|
}
|
|
80
|
-
|
|
81
|
-
await deleteModel(model._id);
|
|
82
|
-
}
|
|
78
|
+
return true;
|
|
83
79
|
}
|
|
80
|
+
return false;
|
|
84
81
|
},
|
|
85
82
|
});
|
|
86
83
|
const handleAcceptChange = useCallback((c) => {
|
|
@@ -176,7 +173,7 @@ const addFigureAtFigCaptionPosition = (editor, resolvePos, attrs, file) => {
|
|
|
176
173
|
const transaction = view.state.tr.setSelection(NodeSelection.near(resolvePos));
|
|
177
174
|
view.focus();
|
|
178
175
|
dispatch(transaction);
|
|
179
|
-
|
|
176
|
+
insertFigure(file, view.state, dispatch);
|
|
180
177
|
}
|
|
181
178
|
};
|
|
182
179
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorElement.js","sourceRoot":"","sources":["../../../../src/components/projects/EditorElement.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"EditorElement.js","sourceRoot":"","sources":["../../../../src/components/projects/EditorElement.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAEL,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GAEb,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EACL,aAAa,EAEb,aAAa,GAEd,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAEL,UAAU,EAGV,MAAM,GACP,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,aAAa,EAAe,MAAM,mBAAmB,CAAA;AAC9D,OAAO,EAAE,0BAA0B,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACvE,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,UAAU,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAA;AAMlE,MAAM,aAAa,GAAo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AM,CAAC,CAAA;IAC5C,QAAQ,CAAC,EAAE,CAAC,CAAA;AACd,CAAC,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2023 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
12
|
+
import { usePermissions } from '@manuscripts/style-guide';
|
|
13
13
|
import React, { useEffect, useState } from 'react';
|
|
14
14
|
import config from '../../config';
|
|
15
15
|
import { useStore } from '../../store';
|
|
16
16
|
import { CommentsPanel } from '../comments/CommentsPanel';
|
|
17
|
+
import { FileManager } from '../FileManager/FileManager';
|
|
17
18
|
import { InspectorContainer, InspectorTab, InspectorTabList, InspectorTabPanel, InspectorTabs, PaddedInspectorTabPanels, } from '../Inspector';
|
|
18
19
|
import Panel from '../Panel';
|
|
19
20
|
import { ResizingInspectorButton } from '../ResizerButtons';
|
|
@@ -60,9 +61,7 @@ const Inspector = ({ editor }) => {
|
|
|
60
61
|
React.createElement(InspectorTabPanel, { key: "Content", "data-cy": "content" }, tabIndex === CONTENT_TAB_INDEX && (React.createElement(ContentTab, { state: state, dispatch: dispatch, key: "content" }))),
|
|
61
62
|
React.createElement(InspectorTabPanel, { key: "Comments", "data-cy": "comments" }, tabIndex === COMMENTS_TAB_INDEX && (React.createElement(CommentsPanel, { key: "comments" }))),
|
|
62
63
|
!can.editWithoutTracking && (React.createElement(InspectorTabPanel, { key: "History", "data-cy": "history" }, tabIndex === SUGGESTIONS_TAB_INDEX && (React.createElement(TrackChangesPanel, { key: "track-changes" })))),
|
|
63
|
-
config.features.fileManagement && (React.createElement(InspectorTabPanel, { key: "Files", "data-cy": "files" }, tabIndex === FILES_TAB_INDEX &&
|
|
64
|
-
// @ts-ignore
|
|
65
|
-
saveModel: store.saveTrackModel, deleteModel: store.deleteTrackModel, fileManagement: store.fileManagement })))))))));
|
|
64
|
+
config.features.fileManagement && (React.createElement(InspectorTabPanel, { key: "Files", "data-cy": "files" }, tabIndex === FILES_TAB_INDEX && React.createElement(FileManager, { key: "files" }))))))));
|
|
66
65
|
};
|
|
67
66
|
export default Inspector;
|
|
68
67
|
//# sourceMappingURL=Inspector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inspector.js","sourceRoot":"","sources":["../../../../src/components/projects/Inspector.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Inspector.js","sourceRoot":"","sources":["../../../../src/components/projects/Inspector.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAElD,OAAO,MAAM,MAAM,cAAc,CAAA;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,wBAAwB,GACzB,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAKzC,MAAM,SAAS,GAAoB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;IAChD,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACnC,cAAc,EAAE,KAAK,CAAC,cAAc;Q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{"version":3,"file":"attrs-change-filter.js","sourceRoot":"","sources":["../../../src/lib/attrs-change-filter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"attrs-change-filter.js","sourceRoot":"","sources":["../../../src/lib/attrs-change-filter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,EACL,cAAc,EACd,oBAAoB,GAErB,MAAM,wBAAwB,CAAA;AAE/B;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,aAA6B,EAC7B,WAA2B,EAC3B,KAAuB,EACvB,YAA2B,EAC3B,UAA8B,EAC9B,SAAqB,EACrB,EAAE;IACF,qEAAqE;IACrE,OAAO;QACL,QAAQ,EAAE,kBAAkB,CAC1B,aAAa,EACb,WAAW,CAAC,QAAQ,EACpB,KAAK,EACL,YAAY,EACZ,UAAU,EACV,SAAS,CACV;QACD,QAAQ,EAAE,kBAAkB,CAC1B,aAAa,EACb,WAAW,CAAC,QAAQ,EACpB,KAAK,EACL,YAAY,EACZ,UAAU,EACV,SAAS,CACV;KACF,CAAA;AACH,CAAC,CAAA;AAED,SAAS,wBAAwB,CAAC,KAAc;IAC9C,MAAM,IAAI,GAAG,KAA0B,CAAA;IACvC,OAAO,IAAI,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;AAChF,CAAC;AAED,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAC/B,GAAG,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE;IAC1C,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE;QACrB,OAAO,KAAK,CAAC,WAAW,EAAE,CAAA;KAC3B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AG,CACJ;iBACF,CAAC,CAAA;YACJ,KAAK,gBAAgB;gBACnB,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG;oBAC3B,KAAK,EAAE,iBAAiB;oBACxB,KAAK,EAAE,KAAe;iBACvB,CAAC,CAAA;YACJ,KAAK,iBAAiB;gBACpB,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG;oBAC3B,KAAK,EAAE,sBAAsB;oBAC7B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;iBAC5B,CAAC,CAAA;YACJ,KAAK,cAAc;gBACjB,aAAa,CAAC,GAAG,CAAC,GAAG;oBACnB,KAAK,EAAE,gBAAgB;oBACvB,KAAK,EAAE,KAAe;iBACvB,CAAA;gBACD,OAAM;YACR,KAAK,aAAa;gBAChB,aAAa,CAAC,GAAG,CAAC,GAAG;oBACnB,KAAK,EAAE,kBAAkB;oBACzB,KAAK,EAAE,KAAe;iBACvB,CAAA;gBACD,OAAM;YAER;gBACE,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG;oBAC3B,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC;oBACpB,KAAK,EAAE,KAAe;iBACvB,CAAC,CAAA;SACL;IACH,CAAC,CAAC,CAAA;IAEJ,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA"}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* 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.
|
|
3
|
+
*
|
|
4
|
+
* 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.
|
|
5
|
+
*
|
|
6
|
+
* The Original Code is manuscripts-frontend.
|
|
7
|
+
*
|
|
8
|
+
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
+
*
|
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
+
*/
|
|
1
12
|
import Api from './Api';
|
|
2
13
|
import { buildData } from './buildData';
|
|
3
14
|
import { buildUtilities } from './buildUtilities';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PsSource.js","sourceRoot":"","sources":["../../../src/postgres-data/PsSource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PsSource.js","sourceRoot":"","sources":["../../../src/postgres-data/PsSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,GAAG,MAAM,OAAO,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,MAAM,CAAC,OAAO,OAAO,QAAQ;IAM3B,YAAY,KAAuB;QASnC,gBAAW,GAAG,CAAC,KAAqB,EAAE,EAAE;YACtC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC,KAAK,CAAC,CAAA;QACzD,CAAC,CAAA;QAED,UAAK,GAAc,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YACjD,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,SAAS,EAAE;gBACnC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;aACnC;YACD,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAA;YACjC,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAA;YACvC,IAAI,YAAY,IAAI,SAAS,EAAE;gBAC7B,IAAI,CAAC,IAAI,GAAG,MAAM,SAAS,CAAC,SAAS,EAAE,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;gBAC9D,IAAI,CAAC,SAAS,GAAG,cAAc,CAC7B,SAAS,EACT,YAAY,EACZ,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EACf,QAAQ,EACR,IAAI,CAAC,GAAG,CACT,CAAA;aACF;YACD,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA;QACrD,CAAC,CAAA;QACD,gBAAW,GAAG,CAAC,KAAY,EAAE,EAAE;YAC7B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAA,CAAC,uCAAuC;QAC3D,CAAC,CAAA;QACD,gBAAW,GAAG,CAAC,QAAqB,EAAE,EAAE;YACtC,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAA;QAC7B,CAAC,CAAA;QAnCC,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,EAAE,CAAA;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,aAAa;QACb,4BAA4B;QAC5B,oGAAoG;QACpG,yBAAyB;IAC3B,CAAC;CA8BF"}
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
import { manuscriptIDTypes, ObjectTypes, } from '@manuscripts/json-schema';
|
|
13
13
|
import { encode } from '@manuscripts/transform';
|
|
14
14
|
import { getUserRole } from '../lib/roles';
|
|
15
|
-
import { saveWithThrottle } from './savingUtilities';
|
|
16
15
|
export const buildUtilities = (projectID, manuscriptID, getState, updateState, api) => {
|
|
17
16
|
const nonPMModelsTypes = new Set([
|
|
18
17
|
ObjectTypes.Manuscript,
|
|
@@ -70,18 +69,13 @@ export const buildUtilities = (projectID, manuscriptID, getState, updateState, a
|
|
|
70
69
|
modelMap.set(model._id, updated);
|
|
71
70
|
}
|
|
72
71
|
updateState({
|
|
73
|
-
|
|
72
|
+
savingProcess: 'saving',
|
|
74
73
|
preventUnload: true,
|
|
75
74
|
});
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const result = await saveProject([...modelMap.values()]);
|
|
81
|
-
updateState({
|
|
82
|
-
savingProcess: result ? 'saved' : 'failed',
|
|
83
|
-
preventUnload: false,
|
|
84
|
-
});
|
|
75
|
+
const result = await saveProject([...modelMap.values()]);
|
|
76
|
+
updateState({
|
|
77
|
+
savingProcess: result ? 'saved' : 'failed',
|
|
78
|
+
preventUnload: false,
|
|
85
79
|
});
|
|
86
80
|
};
|
|
87
81
|
const saveModel = async (model) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildUtilities.js","sourceRoot":"","sources":["../../../src/postgres-data/buildUtilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAEL,iBAAiB,EAEjB,WAAW,GAEZ,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAS,MAAM,EAAkB,MAAM,wBAAwB,CAAA;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"buildUtilities.js","sourceRoot":"","sources":["../../../src/postgres-data/buildUtilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAEL,iBAAiB,EAEjB,WAAW,GAEZ,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAS,MAAM,EAAkB,MAAM,wBAAwB,CAAA;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAI1C,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,SAAiB,EACjB,YAAoB,EACpB,QAA8B,EAC9B,WAA4C,EAC5C,GAAQ,EACQ,EAAE;IAClB,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC;QAC/B,WAAW,CAAC,UAAU;QACtB,WAAW,CAAC,OAAO;KACpB,CAAC,CAAA;IAEF,MAAM,k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,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC;SACxD,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,MAAM,cAAc,GAAG,KAAK,IAAI,EAAE;QAChC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;QACxB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAA;QAC3B,IAAI,CAAC,MAAM,EAAE;YACX,OAAM;SACP;QACD,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,aAAa,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;QAC/D,IAAI,CAAC,MAAM,EAAE;YACX,OAAM;SACP;QACD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAC3B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,WAAW,CAAC,OAAO,CAC5C,CAAC,CAAC,CAAY,CAAA;QACf,IAAI,CAAC,OAAO,EAAE;YACZ,OAAM;SACP;QACD,WAAW,CAAC;YACV,OAAO;YACP,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC;SACvC,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,OAAO;QACL,SAAS;QACT,WAAW;QACX,cAAc;QACd,QAAQ;QACR,UAAU;QACV,OAAO;QACP,cAAc;QACd,cAAc;KACf,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -10,28 +10,6 @@
|
|
|
10
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 { useRef } from 'react';
|
|
13
|
-
let throttled = () => null;
|
|
14
|
-
let timeout;
|
|
15
|
-
export const saveWithThrottle = (fn, interval = 4000, flush = false, onDone) => {
|
|
16
|
-
throttled = fn;
|
|
17
|
-
const action = () => {
|
|
18
|
-
throttled();
|
|
19
|
-
window.clearTimeout(timeout);
|
|
20
|
-
onDone && onDone();
|
|
21
|
-
};
|
|
22
|
-
if (flush) {
|
|
23
|
-
action();
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if (!timeout) {
|
|
27
|
-
timeout = window.setTimeout(() => {
|
|
28
|
-
action();
|
|
29
|
-
}, interval);
|
|
30
|
-
}
|
|
31
|
-
return () => {
|
|
32
|
-
action();
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
13
|
export const saveWithDebounce = () => {
|
|
36
14
|
let timeout;
|
|
37
15
|
return (fn, interval = 4000, flush = false, onDone) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"savingUtilities.js","sourceRoot":"","sources":["../../../src/postgres-data/savingUtilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAE9B,
|
|
1
|
+
{"version":3,"file":"savingUtilities.js","sourceRoot":"","sources":["../../../src/postgres-data/savingUtilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAE9B,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,IAAI,OAAe,CAAA;IAEnB,OAAO,CACL,EAAa,EACb,QAAQ,GAAG,IAAI,EACf,KAAK,GAAG,KAAK,EACb,MAAmB,EACnB,EAAE;QACF,MAAM,MAAM,GAAG,GAAG,EAAE;YAClB,EAAE,EAAE,CAAA;YACJ,MAAM,IAAI,MAAM,EAAE,CAAA;QACpB,CAAC,CAAA;QACD,IAAI,KAAK,EAAE;YACT,MAAM,EAAE,CAAA;YACR,YAAY,CAAC,OAAO,CAAC,CAAA;YACrB,OAAM;SACP;QAED,YAAY,CAAC,OAAO,CAAC,CAAA;QACrB,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;YAC/B,MAAM,EAAE,CAAA;QACV,CAAC,EAAE,QAAQ,CAAC,CAAA;QAEZ,OAAO,GAAG,EAAE;YACV,MAAM,EAAE,CAAA;YACR,YAAY,CAAC,OAAO,CAAC,CAAA;QACvB,CAAC,CAAA;IACH,CAAC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;IACpC,MAAM,OAAO,GAAG,MAAM,EAAU,CAAA;IAEhC,OAAO,CAAC,EAAa,EAAE,QAAQ,GAAG,IAAI,EAAE,EAAE;QACxC,SAAS,CAAC,OAAO,GAAG,EAAE,CAAA;QACtB,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACpB,SAAS,CAAC,OAAO,EAAE,CAAA;YACnB,SAAS,CAAC,OAAO,GAAG,GAAG,EAAE;gBACvB,OAAO,IAAI,CAAA;YACb,CAAC,CAAA;YACD,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;gBACvC,SAAS,CAAC,OAAO,EAAE,CAAA;gBACnB,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;gBACpC,OAAO,CAAC,OAAO,GAAG,CAAC,CAAA;YACrB,CAAC,EAAE,QAAQ,CAAC,CAAA;SACb;IACH,CAAC,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../src/store/Store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../src/store/Store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAuBH,OAAO,EAAE,qBAAqB,EAA2B,MAAM,GAAG,CAAA;AA0ElE,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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
|
12
12
|
import React, { createContext, useContext, useEffect } from 'react';
|
|
13
13
|
import { GenericStore } from '.';
|
|
14
14
|
const GenericStoreContext = createContext(new GenericStore());
|
|
15
|
-
export const createStore = async (sources
|
|
15
|
+
export const createStore = async (sources) => {
|
|
16
16
|
const store = new GenericStore();
|
|
17
17
|
await store.init(sources);
|
|
18
|
-
store.subscribe((state) => observer?.onUpdate(state));
|
|
19
18
|
return store;
|
|
20
19
|
};
|
|
21
20
|
export const GenericStoreProvider = ({ children, store }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoreContext.js","sourceRoot":"","sources":["../../../src/store/StoreContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"StoreContext.js","sourceRoot":"","sources":["../../../src/store/StoreContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEnE,OAAO,EAAE,YAAY,EAA2B,MAAM,GAAG,CAAA;AAEzD,MAAM,mBAAmB,GAAG,aAAa,CAAe,IAAI,YAAY,EAAE,CAAC,CAAA;AAE3E,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,OAAkC,EAAE,EAAE;IACtE,MAAM,KAAK,GAAG,IAAI,YAAY,EAAE,CAAA;IAChC,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACzB,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAMD,MAAM,CAAC,MAAM,oBAAoB,GAAoB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3E,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAA;IAC9B,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,IAAI,KAAK,EAAE;QACT,OAAO,CACL,oBAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IACvC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,uDAA4B,CAClC,CAChC,CAAA;KACF;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAA"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
|
-
import { FileAttachment, FileManagement } from '@manuscripts/
|
|
12
|
+
import { FileAttachment, FileManagement } from '@manuscripts/body-editor';
|
|
13
13
|
import React, { MutableRefObject } from 'react';
|
|
14
14
|
import { state } from './store';
|
|
15
15
|
export type AppState = {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FileSectionType, Move, Replace } from './FileManager';
|
|
3
|
+
/**
|
|
4
|
+
* This component represents the drop-down list action for each file item.
|
|
5
|
+
*/
|
|
6
|
+
export declare const FileActions: React.FC<{
|
|
7
|
+
sectionType: FileSectionType;
|
|
8
|
+
onDownload?: () => void;
|
|
9
|
+
onReplace?: Replace;
|
|
10
|
+
onDetach?: () => void;
|
|
11
|
+
move?: Move;
|
|
12
|
+
className?: string;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const ActionsIcon: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
15
|
+
export declare const FileActionDropdownList: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
16
|
+
direction?: "right" | "left" | undefined;
|
|
17
|
+
width?: number | undefined;
|
|
18
|
+
height?: number | undefined;
|
|
19
|
+
top?: number | undefined;
|
|
20
|
+
}, never>;
|
|
21
|
+
export declare const FileAction: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FileContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* 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.
|
|
3
|
+
*
|
|
4
|
+
* 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.
|
|
5
|
+
*
|
|
6
|
+
* The Original Code is manuscripts-frontend.
|
|
7
|
+
*
|
|
8
|
+
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
+
*
|
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
+
*/
|
|
12
|
+
import { FileAttachment } from '@manuscripts/body-editor';
|
|
13
|
+
import React from 'react';
|
|
14
|
+
export declare const FileCreatedDate: React.FC<{
|
|
15
|
+
file: FileAttachment;
|
|
16
|
+
className?: string;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const FileDateContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
19
|
+
export declare const FileDate: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare enum FileSectionType {
|
|
3
|
+
Inline = "Inline files",
|
|
4
|
+
Supplements = "Supplements",
|
|
5
|
+
OtherFile = "Other files"
|
|
6
|
+
}
|
|
7
|
+
export type Replace = (file: File) => Promise<void>;
|
|
8
|
+
export type Move = {
|
|
9
|
+
sectionType: FileSectionType;
|
|
10
|
+
handler: () => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* This is the main component of the file handling
|
|
14
|
+
* that should be called in the inspector,
|
|
15
|
+
* and it expects to receive an array of submission attachments
|
|
16
|
+
* and use Drag-and-Drop technique for manuscript-frontend inspector.
|
|
17
|
+
*
|
|
18
|
+
* File section component consist of three types of files which is:
|
|
19
|
+
* 1- Inline files.
|
|
20
|
+
* 2- Supplemental files.
|
|
21
|
+
* 3- Other files.
|
|
22
|
+
*/
|
|
23
|
+
export declare const FileManager: React.FC;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* 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.
|
|
3
|
+
*
|
|
4
|
+
* 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.
|
|
5
|
+
*
|
|
6
|
+
* The Original Code is manuscripts-frontend.
|
|
7
|
+
*
|
|
8
|
+
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
+
*
|
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
+
*/
|
|
12
|
+
import React from 'react';
|
|
13
|
+
export declare const FileManagerDragLayer: React.FC;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* 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.
|
|
3
|
+
*
|
|
4
|
+
* 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.
|
|
5
|
+
*
|
|
6
|
+
* The Original Code is manuscripts-frontend.
|
|
7
|
+
*
|
|
8
|
+
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
+
*
|
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
+
*/
|
|
12
|
+
import { FileAttachment } from '@manuscripts/body-editor';
|
|
13
|
+
import React from 'react';
|
|
14
|
+
export declare const FileName: React.FC<{
|
|
15
|
+
file: FileAttachment;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const FileNameText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare enum FileSectionAlertType {
|
|
3
|
+
NONE = 0,
|
|
4
|
+
UPLOAD_IN_PROGRESS = 1,
|
|
5
|
+
UPLOAD_SUCCESSFUL = 2,
|
|
6
|
+
MOVE_SUCCESSFUL = 3
|
|
7
|
+
}
|
|
8
|
+
export declare const FileSectionAlert: React.FC<{
|
|
9
|
+
alert: {
|
|
10
|
+
type: FileSectionAlertType;
|
|
11
|
+
message: string;
|
|
12
|
+
};
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* 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.
|
|
3
|
+
*
|
|
4
|
+
* 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.
|
|
5
|
+
*
|
|
6
|
+
* The Original Code is manuscripts-frontend.
|
|
7
|
+
*
|
|
8
|
+
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
+
*
|
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
+
*/
|
|
12
|
+
import { FileAttachment } from '@manuscripts/body-editor';
|
|
13
|
+
import React from 'react';
|
|
14
|
+
/**
|
|
15
|
+
* Each file item has an icon to represent besides the file info based on the file extension,
|
|
16
|
+
* in case the file type is an image or video then the icon should be the preview image or video thumbnail.
|
|
17
|
+
*/
|
|
18
|
+
export declare const FileTypeIcon: React.FC<{
|
|
19
|
+
file: FileAttachment;
|
|
20
|
+
}>;
|