@manuscripts/article-editor 3.9.3-LEAN-4611.1 → 4.0.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/{es/lib/tracking.js → cjs/__mocks__/fileMock.js} +4 -35
- package/dist/cjs/__mocks__/fileMock.js.map +1 -0
- package/dist/{types/components/FileManager/FileGroup.d.ts → cjs/__mocks__/styleMock.js} +5 -9
- package/dist/cjs/__mocks__/styleMock.js.map +1 -0
- package/dist/cjs/components/FileManager/FileActions.js +1 -3
- package/dist/cjs/components/FileManager/FileActions.js.map +1 -1
- package/dist/cjs/components/FileManager/InlineFilesSection.js +28 -77
- package/dist/cjs/components/FileManager/InlineFilesSection.js.map +1 -1
- package/dist/cjs/lib/{tracking.js → __tests__/layout.test.js} +25 -38
- package/dist/cjs/lib/__tests__/layout.test.js.map +1 -0
- package/dist/cjs/lib/__tests__/preferences.test.js +50 -0
- package/dist/cjs/lib/__tests__/preferences.test.js.map +1 -0
- package/dist/cjs/lib/__tests__/roles.test.js +32 -0
- package/dist/cjs/lib/__tests__/roles.test.js.map +1 -0
- package/dist/cjs/lib/change-handlers.js +28 -5
- package/dist/cjs/lib/change-handlers.js.map +1 -1
- package/dist/es/__mocks__/fileMock.js +13 -0
- package/dist/es/__mocks__/fileMock.js.map +1 -0
- package/dist/es/__mocks__/styleMock.js +13 -0
- package/dist/es/__mocks__/styleMock.js.map +1 -0
- package/dist/es/components/FileManager/FileActions.js +1 -3
- package/dist/es/components/FileManager/FileActions.js.map +1 -1
- package/dist/es/components/FileManager/InlineFilesSection.js +31 -80
- package/dist/es/components/FileManager/InlineFilesSection.js.map +1 -1
- package/dist/es/lib/__tests__/layout.test.js +33 -0
- package/dist/es/lib/__tests__/layout.test.js.map +1 -0
- package/dist/es/lib/__tests__/preferences.test.js +25 -0
- package/dist/es/lib/__tests__/preferences.test.js.map +1 -0
- package/dist/es/lib/__tests__/roles.test.js +30 -0
- package/dist/es/lib/__tests__/roles.test.js.map +1 -0
- package/dist/es/lib/change-handlers.js +23 -1
- package/dist/es/lib/change-handlers.js.map +1 -1
- package/dist/types/__mocks__/fileMock.d.ts +13 -0
- package/dist/types/__mocks__/styleMock.d.ts +13 -0
- package/dist/types/components/FileManager/FileActions.d.ts +0 -1
- package/dist/types/components/projects/inputs.d.ts +1 -1
- package/dist/types/lib/{tracking.d.ts → __tests__/layout.test.d.ts} +0 -17
- package/dist/types/lib/__tests__/preferences.test.d.ts +12 -0
- package/dist/types/lib/__tests__/roles.test.d.ts +12 -0
- package/dist/types/lib/change-handlers.d.ts +1 -0
- package/package.json +77 -82
- package/dist/cjs/components/FileManager/FileGroup.js +0 -108
- package/dist/cjs/components/FileManager/FileGroup.js.map +0 -1
- package/dist/cjs/lib/tracking.js.map +0 -1
- package/dist/es/components/FileManager/FileGroup.js +0 -102
- package/dist/es/components/FileManager/FileGroup.js.map +0 -1
- package/dist/es/lib/tracking.js.map +0 -1
@@ -1,3 +1,4 @@
|
|
1
|
+
"use strict";
|
1
2
|
/*!
|
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.
|
3
4
|
*
|
@@ -9,38 +10,6 @@
|
|
9
10
|
*
|
10
11
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
12
|
*/
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
hitType: 'event',
|
16
|
-
eventCategory: category,
|
17
|
-
eventAction: action,
|
18
|
-
eventLabel: label,
|
19
|
-
eventValue: value,
|
20
|
-
});
|
21
|
-
}
|
22
|
-
};
|
23
|
-
export const changeOperationAlias = (operation) => {
|
24
|
-
switch (operation) {
|
25
|
-
case 'delete': {
|
26
|
-
return 'Deleted';
|
27
|
-
}
|
28
|
-
case 'insert':
|
29
|
-
case 'wrap_with_node': {
|
30
|
-
return 'Inserted';
|
31
|
-
}
|
32
|
-
case 'set_attrs': {
|
33
|
-
return 'Updated';
|
34
|
-
}
|
35
|
-
case 'node_split': {
|
36
|
-
return 'Split';
|
37
|
-
}
|
38
|
-
case 'move': {
|
39
|
-
return 'Move';
|
40
|
-
}
|
41
|
-
default: {
|
42
|
-
return 'null';
|
43
|
-
}
|
44
|
-
}
|
45
|
-
};
|
46
|
-
//# sourceMappingURL=tracking.js.map
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
+
exports.default = 'test-file-stub';
|
15
|
+
//# sourceMappingURL=fileMock.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"fileMock.js","sourceRoot":"","sources":["../../../src/__mocks__/fileMock.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAEH,kBAAe,gBAAgB,CAAA"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
"use strict";
|
1
2
|
/*!
|
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.
|
3
4
|
*
|
@@ -7,13 +8,8 @@
|
|
7
8
|
*
|
8
9
|
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
10
|
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c)
|
11
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
12
|
*/
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
export declare const FileLabel: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
16
|
-
export declare const FileGroupHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
17
|
-
export declare const ToggleIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
18
|
-
isOpen: boolean;
|
19
|
-
}, never>;
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
+
exports.default = {};
|
15
|
+
//# sourceMappingURL=styleMock.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"styleMock.js","sourceRoot":"","sources":["../../../src/__mocks__/styleMock.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAEH,kBAAe,EAAE,CAAA"}
|
@@ -33,7 +33,7 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
33
33
|
/**
|
34
34
|
* This component represents the drop-down list action for each file item.
|
35
35
|
*/
|
36
|
-
const FileActions = ({ sectionType, onDownload, onReplace, onDetach,
|
36
|
+
const FileActions = ({ sectionType, onDownload, onReplace, onDetach, onUseAsMain, move, className, file, accept, }) => {
|
37
37
|
const can = (0, style_guide_1.usePermissions)();
|
38
38
|
const { isOpen, toggleOpen, wrapperRef } = (0, style_guide_1.useDropdown)();
|
39
39
|
const [isMoveDialogOpen, setMoveDialogOpen] = (0, react_1.useState)(false);
|
@@ -41,7 +41,6 @@ const FileActions = ({ sectionType, onDownload, onReplace, onDetach, onDelete, o
|
|
41
41
|
const showDownload = can?.downloadFiles && onDownload;
|
42
42
|
const showReplace = can?.replaceFile && onReplace;
|
43
43
|
const showDetach = can?.detachFile && onDetach;
|
44
|
-
const showDelete = can?.detachFile && onDelete;
|
45
44
|
const showMove = can?.moveFile && move;
|
46
45
|
const showUseAsMain = can?.moveFile && onUseAsMain && isValidMainDocumentFormat(file);
|
47
46
|
const show = showDownload || showReplace || showDetach || showMove || showUseAsMain;
|
@@ -69,7 +68,6 @@ const FileActions = ({ sectionType, onDownload, onReplace, onDetach, onDelete, o
|
|
69
68
|
react_1.default.createElement(exports.FileAction, { onClick: openFileDialog }, "Replace"),
|
70
69
|
react_1.default.createElement("input", { ref: fileInputRef, type: "file", style: { display: 'none' }, onChange: handleChange, accept: accept }))),
|
71
70
|
showDetach && react_1.default.createElement(exports.FileAction, { onClick: onDetach }, "Detach"),
|
72
|
-
showDelete && react_1.default.createElement(exports.FileAction, { onClick: onDelete }, "Delete"),
|
73
71
|
showMove && (react_1.default.createElement(exports.FileAction, { onClick: () => setMoveDialogOpen(true) },
|
74
72
|
"Move to ",
|
75
73
|
move.sectionType)),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FileActions.js","sourceRoot":"","sources":["../../../../src/components/FileManager/FileActions.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,0DASiC;AACjC,+CAA4D;AAC5D,0EAAsC;AAItC;;GAEG;AACI,MAAM,WAAW,
|
1
|
+
{"version":3,"file":"FileActions.js","sourceRoot":"","sources":["../../../../src/components/FileManager/FileActions.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,0DASiC;AACjC,+CAA4D;AAC5D,0EAAsC;AAItC;;GAEG;AACI,MAAM,WAAW,GAUnB,CAAC,EACJ,WAAW,EACX,UAAU,EACV,SAAS,EACT,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,MAAM,GACP,EAAE,EAAE;IACH,MAAM,GAAG,GAAG,IAAA,4BAAc,GAAE,CAAA;IAC5B,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAA,yBAAW,GAAE,CAAA;IACxD,MAAM,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAA;IACtE,MAAM,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,GACnD,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAA;IAE1B,MAA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|
const prosemirror_state_1 = require("prosemirror-state");
|
30
30
|
const prosemirror_utils_1 = require("prosemirror-utils");
|
31
31
|
const react_1 = __importStar(require("react"));
|
32
|
-
const files_1 = require("../../lib/files");
|
33
32
|
const store_1 = require("../../store");
|
34
33
|
const FileActions_1 = require("./FileActions");
|
34
|
+
const FileContainer_1 = require("./FileContainer");
|
35
35
|
const FileCreatedDate_1 = require("./FileCreatedDate");
|
36
|
-
const FileGroup_1 = require("./FileGroup");
|
37
36
|
const FileManager_1 = require("./FileManager");
|
38
37
|
const FileName_1 = require("./FileName");
|
39
|
-
const FileTypeIcon_1 = require("./FileTypeIcon");
|
40
38
|
const InlineFilesSection = ({ elements, }) => {
|
41
39
|
const [{ view, fileManagement, sectionCategories }] = (0, store_1.useStore)((s) => ({
|
42
40
|
view: s.view,
|
43
41
|
fileManagement: s.fileManagement,
|
44
42
|
sectionCategories: s.sectionCategories,
|
45
43
|
}));
|
46
|
-
const
|
44
|
+
const metadata = (0, react_1.useMemo)(() => {
|
47
45
|
if (!view) {
|
48
46
|
return [];
|
49
47
|
}
|
50
48
|
let figureIndex = 1;
|
51
49
|
let imageIndex = 1;
|
52
50
|
return elements.map((element) => {
|
51
|
+
const figure = element.files[0];
|
52
|
+
const file = figure?.file || { id: '', name: '' };
|
53
53
|
const $pos = view.state.doc.resolve(element.pos);
|
54
54
|
const section = (0, prosemirror_utils_1.findParentNodeOfTypeClosestToPos)($pos, transform_1.schema.nodes.graphical_abstract_section);
|
55
|
-
let label
|
55
|
+
let label;
|
56
|
+
let icon;
|
56
57
|
if (section) {
|
57
58
|
const category = section.node.attrs.category;
|
58
59
|
label = sectionCategories.get(category)?.titles[0] || '';
|
@@ -62,112 +63,62 @@ const InlineFilesSection = ({ elements, }) => {
|
|
62
63
|
label = `Image ${imageIndex++}`;
|
63
64
|
icon = style_guide_1.FileImageIcon;
|
64
65
|
}
|
66
|
+
else if (element.node.type === transform_1.schema.nodes.hero_image) {
|
67
|
+
label = `Hero Image`;
|
68
|
+
icon = style_guide_1.FileImageIcon;
|
69
|
+
}
|
65
70
|
else {
|
66
71
|
label = `Figure ${figureIndex++}`;
|
67
72
|
icon = style_guide_1.FileFigureIcon;
|
68
73
|
}
|
69
74
|
return {
|
70
75
|
element,
|
76
|
+
node: figure?.node,
|
77
|
+
pos: figure?.pos,
|
78
|
+
file,
|
71
79
|
label,
|
72
80
|
icon,
|
73
|
-
files: element.files.filter((f) => f.file.id),
|
74
81
|
};
|
75
82
|
});
|
76
83
|
}, [elements, view, sectionCategories]);
|
77
|
-
const [openGroupIndexes, setOpenGroupIndexes] = (0, react_1.useState)(new Set(groupedMetadata.map((_, index) => index)));
|
78
|
-
const toggleGroupOpen = (groupIndex) => {
|
79
|
-
setOpenGroupIndexes((prevOpenIndexes) => {
|
80
|
-
const newOpenIndexes = new Set(prevOpenIndexes);
|
81
|
-
if (newOpenIndexes.has(groupIndex)) {
|
82
|
-
newOpenIndexes.delete(groupIndex);
|
83
|
-
}
|
84
|
-
else {
|
85
|
-
newOpenIndexes.add(groupIndex);
|
86
|
-
}
|
87
|
-
return newOpenIndexes;
|
88
|
-
});
|
89
|
-
};
|
90
84
|
if (!view) {
|
91
85
|
return null;
|
92
86
|
}
|
93
|
-
const handleClick = (
|
94
|
-
const tr = view.state.tr;
|
95
|
-
tr.setSelection(prosemirror_state_1.NodeSelection.create(view.state.doc, element.pos));
|
96
|
-
tr.scrollIntoView();
|
97
|
-
view.focus();
|
98
|
-
view.dispatch(tr);
|
99
|
-
};
|
100
|
-
const handleFileClick = (pos) => {
|
101
|
-
if (!pos) {
|
102
|
-
return;
|
103
|
-
}
|
87
|
+
const handleClick = (metadata) => {
|
104
88
|
const tr = view.state.tr;
|
105
|
-
tr.setSelection(prosemirror_state_1.NodeSelection.create(view.state.doc, pos));
|
89
|
+
tr.setSelection(prosemirror_state_1.NodeSelection.create(view.state.doc, metadata.element.pos));
|
106
90
|
tr.scrollIntoView();
|
107
91
|
view.focus();
|
108
92
|
view.dispatch(tr);
|
109
93
|
};
|
110
|
-
const handleDetach = (
|
111
|
-
if (!pos) {
|
94
|
+
const handleDetach = (metadata) => {
|
95
|
+
if (!metadata.pos) {
|
112
96
|
return;
|
113
97
|
}
|
114
98
|
const tr = view.state.tr;
|
115
|
-
tr.setNodeAttribute(pos, 'src', '');
|
116
|
-
tr.setSelection(prosemirror_state_1.NodeSelection.create(tr.doc, pos));
|
99
|
+
tr.setNodeAttribute(metadata.pos, 'src', '');
|
100
|
+
tr.setSelection(prosemirror_state_1.NodeSelection.create(tr.doc, metadata.pos));
|
117
101
|
tr.scrollIntoView();
|
118
102
|
view.focus();
|
119
103
|
view.dispatch(tr);
|
120
104
|
};
|
121
|
-
const
|
122
|
-
if (!pos
|
123
|
-
return;
|
124
|
-
}
|
125
|
-
const node = view.state.doc.nodeAt(pos);
|
126
|
-
if (node?.type === transform_1.schema.nodes.figure) {
|
127
|
-
const tr = view.state.tr;
|
128
|
-
tr.delete(pos, pos + node.nodeSize);
|
129
|
-
view.dispatch(tr);
|
130
|
-
}
|
131
|
-
};
|
132
|
-
const handleReplace = async (pos, file) => {
|
133
|
-
if (!pos || !file) {
|
105
|
+
const handleReplace = async (metadata, file) => {
|
106
|
+
if (!metadata.pos) {
|
134
107
|
return;
|
135
108
|
}
|
136
109
|
const uploaded = await fileManagement.upload(file);
|
137
110
|
const tr = view.state.tr;
|
138
|
-
tr.setNodeAttribute(pos, 'src', uploaded.id);
|
139
|
-
tr.setSelection(prosemirror_state_1.NodeSelection.create(tr.doc, pos));
|
111
|
+
tr.setNodeAttribute(metadata.pos, 'src', uploaded.id);
|
112
|
+
tr.setSelection(prosemirror_state_1.NodeSelection.create(tr.doc, metadata.pos));
|
140
113
|
tr.scrollIntoView();
|
141
114
|
view.focus();
|
142
115
|
view.dispatch(tr);
|
143
116
|
};
|
144
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
145
|
-
|
146
|
-
|
147
|
-
react_1.default.createElement(
|
148
|
-
|
149
|
-
group.label && react_1.default.createElement(FileGroup_1.FileLabel, null,
|
150
|
-
group.label,
|
151
|
-
":"),
|
152
|
-
group.files.length > 0 && (react_1.default.createElement(FileGroup_1.ToggleIcon, { isOpen: isOpen, onClick: (e) => {
|
153
|
-
e.stopPropagation();
|
154
|
-
toggleGroupOpen(groupIndex);
|
155
|
-
} }, isOpen ? (react_1.default.createElement(style_guide_1.TriangleExpandedIcon, null)) : (react_1.default.createElement(style_guide_1.TriangleCollapsedIcon, null))))),
|
156
|
-
isOpen && group.files.length > 0 && (react_1.default.createElement(FileGroup_1.FileGroup, null, group.files.map((fileAttachment, fileIndex) => (react_1.default.createElement(FileGroup_1.FileGroupItemContainer, { key: fileIndex, "data-tooltip-id": `${fileAttachment.file?.id}-file-name-tooltip`, onClick: (e) => {
|
157
|
-
e.stopPropagation();
|
158
|
-
handleFileClick(fileAttachment.pos);
|
159
|
-
} },
|
160
|
-
fileAttachment.file && (react_1.default.createElement(FileTypeIcon_1.FileTypeIcon, { file: fileAttachment.file })),
|
161
|
-
react_1.default.createElement(FileName_1.FileNameText, { "data-cy": "filename" },
|
162
|
-
fileAttachment.file?.name
|
163
|
-
? (0, files_1.trimFilename)(fileAttachment.file.name, 25)
|
164
|
-
: 'Figure',
|
165
|
-
react_1.default.createElement(style_guide_1.Tooltip, { id: `${fileAttachment.file?.id}-file-name-tooltip`, place: "bottom" }, fileAttachment.file?.name || 'Figure')),
|
166
|
-
fileAttachment.file && (react_1.default.createElement(FileCreatedDate_1.FileCreatedDate, { file: fileAttachment.file, className: "show-on-hover" })),
|
167
|
-
react_1.default.createElement(FileActions_1.FileActions, { sectionType: FileManager_1.FileSectionType.Inline, onReplace: async (f) => await handleReplace(fileAttachment.pos, f), onDetach: () => handleDetach(fileAttachment.pos), onDownload: () => fileAttachment.file &&
|
168
|
-
fileManagement.download(fileAttachment.file), onDelete: fileIndex !== 0 // Skip displaying the delete option for the first figure
|
169
|
-
? () => handleDelete(fileAttachment.pos)
|
170
|
-
: undefined }))))))));
|
117
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, metadata.map((e, index) => {
|
118
|
+
return (react_1.default.createElement(FileContainer_1.FileContainer, { "data-cy": "file-container", key: index, onClick: () => handleClick(e) },
|
119
|
+
react_1.default.createElement(FileName_1.FileName, { file: e.file, label: e.label, icon: e.icon }),
|
120
|
+
react_1.default.createElement(FileCreatedDate_1.FileCreatedDate, { file: e.file, className: "show-on-hover" }),
|
121
|
+
react_1.default.createElement(FileActions_1.FileActions, { "data-cy": "file-actions", sectionType: FileManager_1.FileSectionType.Inline, onReplace: async (f) => await handleReplace(e, f), onDetach: () => handleDetach(e), onDownload: () => fileManagement.download(e.file) })));
|
171
122
|
})));
|
172
123
|
};
|
173
124
|
exports.InlineFilesSection = InlineFilesSection;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"InlineFilesSection.js","sourceRoot":"","sources":["../../../../src/components/FileManager/InlineFilesSection.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,
|
1
|
+
{"version":3,"file":"InlineFilesSection.js","sourceRoot":"","sources":["../../../../src/components/FileManager/InlineFilesSection.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,0DAIiC;AACjC,sDAA+D;AAC/D,yDAAiD;AACjD,yDAAoE;AACpE,+CAAsC;AAEtC,uCAAsC;AACtC,+CAA2C;AAC3C,mDAA+C;AAC/C,uDAAmD;AACnD,+CAA+C;AAC/C,yCAAqC;AAe9B,MAAM,kBAAkB,GAAsC,CAAC,EACpE,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACrE,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,cAAc,EAAE,CAAC,CAAC,cAAc;QAChC,iBAAiB,EAAE,CAAC,CAAC,iBAAiB;KACvC,CAAC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EACnC,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,EACjD,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,EAC/B,UAAU,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GACjD,CACY,CACjB,CAAA;IACH,CAAC,CAAC,CACD,CACJ,CAAA;AACH,CAAC,CAAA;AAhHY,QAAA,kBAAkB,sBAgH9B"}
|
@@ -10,42 +10,29 @@
|
|
10
10
|
*
|
11
11
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
12
12
|
*/
|
13
|
-
|
14
|
-
|
15
|
-
const trackEvent = ({ category, action, label, value }) => {
|
16
|
-
if (window.ga) {
|
17
|
-
window.ga('send', {
|
18
|
-
hitType: 'event',
|
19
|
-
eventCategory: category,
|
20
|
-
eventAction: action,
|
21
|
-
eventLabel: label,
|
22
|
-
eventValue: value,
|
23
|
-
});
|
24
|
-
}
|
25
|
-
};
|
26
|
-
exports.trackEvent = trackEvent;
|
27
|
-
const changeOperationAlias = (operation) => {
|
28
|
-
switch (operation) {
|
29
|
-
case 'delete': {
|
30
|
-
return 'Deleted';
|
31
|
-
}
|
32
|
-
case 'insert':
|
33
|
-
case 'wrap_with_node': {
|
34
|
-
return 'Inserted';
|
35
|
-
}
|
36
|
-
case 'set_attrs': {
|
37
|
-
return 'Updated';
|
38
|
-
}
|
39
|
-
case 'node_split': {
|
40
|
-
return 'Split';
|
41
|
-
}
|
42
|
-
case 'move': {
|
43
|
-
return 'Move';
|
44
|
-
}
|
45
|
-
default: {
|
46
|
-
return 'null';
|
47
|
-
}
|
48
|
-
}
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
49
15
|
};
|
50
|
-
exports
|
51
|
-
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
const layout_1 = __importDefault(require("../layout"));
|
18
|
+
describe('layout state persistence', () => {
|
19
|
+
it('get', () => {
|
20
|
+
const loadResult = layout_1.default.get('foo');
|
21
|
+
expect(loadResult).toEqual({ size: 200, collapsed: false });
|
22
|
+
});
|
23
|
+
it('set', () => {
|
24
|
+
const bar = {
|
25
|
+
size: 10,
|
26
|
+
collapsed: true,
|
27
|
+
};
|
28
|
+
const setResult = layout_1.default.set('foo', bar);
|
29
|
+
expect(setResult).toEqual(bar);
|
30
|
+
// expect(Layout.get('foo')).toEqual(bar) // FIXME: I think this not being met is indicating a bug?
|
31
|
+
});
|
32
|
+
it('remove', () => {
|
33
|
+
layout_1.default.remove();
|
34
|
+
const storage = window.localStorage;
|
35
|
+
expect(storage.getItem('layout')).toBeFalsy();
|
36
|
+
});
|
37
|
+
});
|
38
|
+
//# sourceMappingURL=layout.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"layout.test.js","sourceRoot":"","sources":["../../../../src/lib/__tests__/layout.test.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;AAEH,uDAAqC;AAErC,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;QACb,MAAM,UAAU,GAAG,gBAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC3C,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAA;IAC7D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;QACb,MAAM,GAAG,GAAG;YACV,IAAI,EAAE,EAAE;YACR,SAAS,EAAE,IAAI;SAChB,CAAA;QACD,MAAM,SAAS,GAAG,gBAAa,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QAC/C,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QAC9B,mGAAmG;IACrG,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QAChB,gBAAa,CAAC,MAAM,EAAE,CAAA;QACtB,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAA;QACnC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,CAAA;IAC/C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1,50 @@
|
|
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) 2019 Atypon Systems LLC. All Rights Reserved.
|
12
|
+
*/
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
14
|
+
if (k2 === undefined) k2 = k;
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
18
|
+
}
|
19
|
+
Object.defineProperty(o, k2, desc);
|
20
|
+
}) : (function(o, m, k, k2) {
|
21
|
+
if (k2 === undefined) k2 = k;
|
22
|
+
o[k2] = m[k];
|
23
|
+
}));
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
26
|
+
}) : function(o, v) {
|
27
|
+
o["default"] = v;
|
28
|
+
});
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
30
|
+
if (mod && mod.__esModule) return mod;
|
31
|
+
var result = {};
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
33
|
+
__setModuleDefault(result, mod);
|
34
|
+
return result;
|
35
|
+
};
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
37
|
+
const preferences_1 = __importStar(require("../preferences"));
|
38
|
+
describe('preferences', () => {
|
39
|
+
it('have defaults', () => {
|
40
|
+
expect(preferences_1.default.get()).toEqual(preferences_1.defaults);
|
41
|
+
});
|
42
|
+
it('can be set and removed', () => {
|
43
|
+
const prefs = { locale: 'ar' };
|
44
|
+
expect(preferences_1.default.set(prefs)).toEqual(prefs);
|
45
|
+
expect(preferences_1.default.get()).toEqual(prefs);
|
46
|
+
preferences_1.default.remove();
|
47
|
+
expect(preferences_1.default.get()).toEqual(preferences_1.defaults); // check that we're back to defaults
|
48
|
+
});
|
49
|
+
});
|
50
|
+
//# sourceMappingURL=preferences.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"preferences.test.js","sourceRoot":"","sources":["../../../../src/lib/__tests__/preferences.test.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8DAA6D;AAE7D,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;QACvB,MAAM,CAAC,qBAAK,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,sBAAQ,CAAC,CAAA;IACvC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;QAChC,MAAM,KAAK,GAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;QAC3C,MAAM,CAAC,qBAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QACvC,MAAM,CAAC,qBAAK,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAElC,qBAAK,CAAC,MAAM,EAAE,CAAA;QACd,MAAM,CAAC,qBAAK,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,sBAAQ,CAAC,CAAA,CAAC,oCAAoC;IAC5E,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1,32 @@
|
|
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) 2019 Atypon Systems LLC. All Rights Reserved.
|
12
|
+
*/
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
+
const roles_1 = require("../roles");
|
15
|
+
describe('roles', () => {
|
16
|
+
const project = {
|
17
|
+
owners: ['User_A'],
|
18
|
+
viewers: ['User_B'],
|
19
|
+
writers: ['User_C'],
|
20
|
+
};
|
21
|
+
it('isOwner must return true if the user is an owner', () => expect((0, roles_1.isOwner)(project, 'User_A')).toBeTruthy());
|
22
|
+
it('isOwner must return false if the user is not an owner', () => expect((0, roles_1.isOwner)(project, 'User_D')).toBeFalsy());
|
23
|
+
it('isWriter must return true if the user is a writer', () => expect((0, roles_1.isWriter)(project, 'User_C')).toBeTruthy());
|
24
|
+
it('isWriter must return false if the user is not a writer', () => expect((0, roles_1.isWriter)(project, 'User_D')).toBeFalsy());
|
25
|
+
it('isViewer must return true if the user is a viewer', () => expect((0, roles_1.isViewer)(project, 'User_B')).toBeTruthy());
|
26
|
+
it('isViewer must return false if the user is not a viewer', () => expect((0, roles_1.isViewer)(project, 'User_D')).toBeFalsy());
|
27
|
+
it('getRole must return owner if the user is an owner', () => expect((0, roles_1.getUserRole)(project, 'User_A')).toBe(roles_1.ProjectRole.owner));
|
28
|
+
it('getRole must return writer if the user is a writer', () => expect((0, roles_1.getUserRole)(project, 'User_C')).toBe(roles_1.ProjectRole.writer));
|
29
|
+
it('getRole must return viewer if the user is a viewer', () => expect((0, roles_1.getUserRole)(project, 'User_B')).toBe(roles_1.ProjectRole.viewer));
|
30
|
+
it('getRole must return null if the user not in the project', () => expect((0, roles_1.getUserRole)(project, 'User_D')).toBeNull());
|
31
|
+
});
|
32
|
+
//# sourceMappingURL=roles.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"roles.test.js","sourceRoot":"","sources":["../../../../src/lib/__tests__/roles.test.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAIH,oCAAgF;AAEhF,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,MAAM,OAAO,GAAY;QACvB,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OA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,CAAC,IAAI,CAAC,mBAAW,CAAC,MAAM,CAAC,CAAC,CAAA;IAElE,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE,CAC5D,MAAM,CAAC,IAAA,mBAAW,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAW,CAAC,MAAM,CAAC,CAAC,CAAA;IAElE,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE,CACjE,MAAM,CAAC,IAAA,mBAAW,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;AACtD,CAAC,CAAC,CAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.handleUnknownChange = exports.handleGroupChanges = exports.handleNodeChange = exports.handleTextChange = void 0;
|
3
|
+
exports.changeOperationAlias = exports.handleUnknownChange = exports.handleGroupChanges = exports.handleNodeChange = exports.handleTextChange = void 0;
|
4
4
|
/*!
|
5
5
|
* 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.
|
6
6
|
*
|
@@ -16,7 +16,6 @@ const body_editor_1 = require("@manuscripts/body-editor");
|
|
16
16
|
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
17
17
|
const transform_1 = require("@manuscripts/transform");
|
18
18
|
const node_content_retriever_1 = require("./node-content-retriever");
|
19
|
-
const tracking_1 = require("./tracking");
|
20
19
|
const utils_1 = require("./utils");
|
21
20
|
const isAltTitleNode = (node) => node.type === transform_1.schema.nodes.alt_title;
|
22
21
|
const getTitleDisplayName = (node) => {
|
@@ -46,7 +45,7 @@ const handleTextChange = (suggestion, state) => {
|
|
46
45
|
}
|
47
46
|
}
|
48
47
|
return {
|
49
|
-
operation: (0,
|
48
|
+
operation: (0, exports.changeOperationAlias)(dataTracked.operation),
|
50
49
|
nodeName: nodeName || suggestion.nodeType.name,
|
51
50
|
content: suggestion.text,
|
52
51
|
};
|
@@ -55,7 +54,7 @@ exports.handleTextChange = handleTextChange;
|
|
55
54
|
const handleNodeChange = (suggestion, state) => {
|
56
55
|
const nodeContentRetriever = new node_content_retriever_1.NodeTextContentRetriever(state);
|
57
56
|
const { node, dataTracked } = suggestion;
|
58
|
-
const operation = (0,
|
57
|
+
const operation = (0, exports.changeOperationAlias)(dataTracked.operation);
|
59
58
|
const nodeName = transform_1.nodeNames.get(node.type) || node.type.name;
|
60
59
|
switch (node.type) {
|
61
60
|
case transform_1.schema.nodes.inline_footnote: {
|
@@ -192,7 +191,7 @@ const handleGroupChanges = (suggestions, view, doc, dataTracked) => {
|
|
192
191
|
: result?.content || '')
|
193
192
|
.join('');
|
194
193
|
return {
|
195
|
-
operation: (0,
|
194
|
+
operation: (0, exports.changeOperationAlias)(dataTracked.operation),
|
196
195
|
nodeName: titleNodeName || 'Text',
|
197
196
|
content,
|
198
197
|
};
|
@@ -206,4 +205,28 @@ const handleUnknownChange = () => {
|
|
206
205
|
};
|
207
206
|
};
|
208
207
|
exports.handleUnknownChange = handleUnknownChange;
|
208
|
+
const changeOperationAlias = (operation) => {
|
209
|
+
switch (operation) {
|
210
|
+
case 'delete': {
|
211
|
+
return 'Deleted';
|
212
|
+
}
|
213
|
+
case 'insert':
|
214
|
+
case 'wrap_with_node': {
|
215
|
+
return 'Inserted';
|
216
|
+
}
|
217
|
+
case 'set_attrs': {
|
218
|
+
return 'Updated';
|
219
|
+
}
|
220
|
+
case 'node_split': {
|
221
|
+
return 'Split';
|
222
|
+
}
|
223
|
+
case 'move': {
|
224
|
+
return 'Move';
|
225
|
+
}
|
226
|
+
default: {
|
227
|
+
return 'null';
|
228
|
+
}
|
229
|
+
}
|
230
|
+
};
|
231
|
+
exports.changeOperationAlias = changeOperationAlias;
|
209
232
|
//# sourceMappingURL=change-handlers.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"change-handlers.js","sourceRoot":"","sources":["../../../src/lib/change-handlers.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,0DAKiC;AACjC,4EAM0C;AAC1C,sDAK+B;AAE/B,qEAAmE;AACnE,
|
1
|
+
{"version":3,"file":"change-handlers.js","sourceRoot":"","sources":["../../../src/lib/change-handlers.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,0DAKiC;AACjC,4EAM0C;AAC1C,sDAK+B;AAE/B,qEAAmE;AACnE,mCAAuC;AAQvC,MAAM,cAAc,GAAG,CAAC,IAAoB,EAAW,EAAE,CACvD,IAAI,CAAC,IAAI,KAAK,kBAAM,CAAC,KAAK,CAAC,SAAS,CAAA;AAEtC,MAAM,mBAAmB,GAAG,CAAC,IAAoB,EAAU,EAAE;IAC3D,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE;QACxB,OAAO,CACL,IAAI,CAAC,KAAK,CAAC,IAAI;aACZ,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aACnE,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CACxB,CAAA;KACF;IACD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;AACvB,CAAC,CAAA;AAEM,MAAM,gBAAgB,GAAG,CAC9B,UAAsB,EACtB,KAA4B,EACR,EAAE;IACtB,MAAM,EAAE,WAAW,EAAE,GAAG,UAAU,CAAA;IAClC,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IACxD,IAAI,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AA;SACjB;QACD,KAAK,YAAY,CAAC,CAAC;YACjB,OAAO,OAAO,CAAA;SACf;QACD,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,MAAM,CAAA;SACd;QACD,OAAO,CAAC,CAAC;YACP,OAAO,MAAM,CAAA;SACd;KACF;AACH,CAAC,CAAA;AAtBY,QAAA,oBAAoB,wBAsBhC"}
|
@@ -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) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
|
+
*/
|
12
|
+
export default 'test-file-stub';
|
13
|
+
//# sourceMappingURL=fileMock.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"fileMock.js","sourceRoot":"","sources":["../../../src/__mocks__/fileMock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAe,gBAAgB,CAAA"}
|