@manuscripts/article-editor 3.9.2-LEAN-2023.2 → 3.9.3-LEAN-4573.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/lib/change-handlers.js +5 -28
- package/dist/cjs/lib/change-handlers.js.map +1 -1
- package/dist/cjs/lib/{__tests__/layout.test.js → tracking.js} +38 -25
- package/dist/cjs/lib/tracking.js.map +1 -0
- package/dist/es/lib/change-handlers.js +1 -23
- package/dist/es/lib/change-handlers.js.map +1 -1
- package/dist/{cjs/__mocks__/fileMock.js → es/lib/tracking.js} +35 -4
- package/dist/es/lib/tracking.js.map +1 -0
- package/dist/types/components/projects/inputs.d.ts +1 -1
- package/dist/types/lib/change-handlers.d.ts +0 -1
- package/dist/types/lib/{__tests__/layout.test.d.ts → tracking.d.ts} +17 -0
- package/package.json +82 -77
- package/dist/cjs/__mocks__/fileMock.js.map +0 -1
- package/dist/cjs/__mocks__/styleMock.js +0 -15
- package/dist/cjs/__mocks__/styleMock.js.map +0 -1
- package/dist/cjs/lib/__tests__/layout.test.js.map +0 -1
- package/dist/cjs/lib/__tests__/preferences.test.js +0 -50
- package/dist/cjs/lib/__tests__/preferences.test.js.map +0 -1
- package/dist/cjs/lib/__tests__/roles.test.js +0 -32
- package/dist/cjs/lib/__tests__/roles.test.js.map +0 -1
- package/dist/es/__mocks__/fileMock.js +0 -13
- package/dist/es/__mocks__/fileMock.js.map +0 -1
- package/dist/es/__mocks__/styleMock.js +0 -13
- package/dist/es/__mocks__/styleMock.js.map +0 -1
- package/dist/es/lib/__tests__/layout.test.js +0 -33
- package/dist/es/lib/__tests__/layout.test.js.map +0 -1
- package/dist/es/lib/__tests__/preferences.test.js +0 -25
- package/dist/es/lib/__tests__/preferences.test.js.map +0 -1
- package/dist/es/lib/__tests__/roles.test.js +0 -30
- package/dist/es/lib/__tests__/roles.test.js.map +0 -1
- package/dist/types/__mocks__/fileMock.d.ts +0 -13
- package/dist/types/__mocks__/styleMock.d.ts +0 -13
- package/dist/types/lib/__tests__/preferences.test.d.ts +0 -12
- package/dist/types/lib/__tests__/roles.test.d.ts +0 -12
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
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,6 +16,7 @@ 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");
|
19
20
|
const utils_1 = require("./utils");
|
20
21
|
const isAltTitleNode = (node) => node.type === transform_1.schema.nodes.alt_title;
|
21
22
|
const getTitleDisplayName = (node) => {
|
@@ -45,7 +46,7 @@ const handleTextChange = (suggestion, state) => {
|
|
45
46
|
}
|
46
47
|
}
|
47
48
|
return {
|
48
|
-
operation: (0,
|
49
|
+
operation: (0, tracking_1.changeOperationAlias)(dataTracked.operation),
|
49
50
|
nodeName: nodeName || suggestion.nodeType.name,
|
50
51
|
content: suggestion.text,
|
51
52
|
};
|
@@ -54,7 +55,7 @@ exports.handleTextChange = handleTextChange;
|
|
54
55
|
const handleNodeChange = (suggestion, state) => {
|
55
56
|
const nodeContentRetriever = new node_content_retriever_1.NodeTextContentRetriever(state);
|
56
57
|
const { node, dataTracked } = suggestion;
|
57
|
-
const operation = (0,
|
58
|
+
const operation = (0, tracking_1.changeOperationAlias)(dataTracked.operation);
|
58
59
|
const nodeName = transform_1.nodeNames.get(node.type) || node.type.name;
|
59
60
|
switch (node.type) {
|
60
61
|
case transform_1.schema.nodes.inline_footnote: {
|
@@ -191,7 +192,7 @@ const handleGroupChanges = (suggestions, view, doc, dataTracked) => {
|
|
191
192
|
: result?.content || '')
|
192
193
|
.join('');
|
193
194
|
return {
|
194
|
-
operation: (0,
|
195
|
+
operation: (0, tracking_1.changeOperationAlias)(dataTracked.operation),
|
195
196
|
nodeName: titleNodeName || 'Text',
|
196
197
|
content,
|
197
198
|
};
|
@@ -205,28 +206,4 @@ const handleUnknownChange = () => {
|
|
205
206
|
};
|
206
207
|
};
|
207
208
|
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;
|
232
209
|
//# 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,mCAAuC;AAQvC,MAAM,cAAc,GAAG,CAAC,IAAoB,EAAW,EAAE,CACvD,IAAI,CAAC,IAAI,K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MAAM,EAAE,QAAQ,IAAI,IAAI,CAAA;IAEpE,oBAAoB;IACpB,MAAM,OAAO,GAAG,SAAS;SACtB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAClB,MAAM,EAAE,QAAQ,KAAK,iBAAiB;QACpC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,GAAG;QACvB,CAAC,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE,CAC1B;SACA,IAAI,CAAC,EAAE,CAAC,CAAA;IAEX,OAAO;QACL,SAAS,EAAE,IAAA,+BAAoB,EAAC,WAAW,CAAC,SAAS,CAAC;QACtD,QAAQ,EAAE,aAAa,IAAI,MAAM;QACjC,OAAO;KACR,CAAA;AACH,CAAC,CAAA;AAvCY,QAAA,kBAAkB,sBAuC9B;AAEM,MAAM,mBAAmB,GAAG,GAAgB,EAAE;IACnD,OAAO;QACL,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,iBAAiB;KAC3B,CAAA;AACH,CAAC,CAAA;AANY,QAAA,mBAAmB,uBAM/B"}
|
@@ -10,29 +10,42 @@
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
15
|
-
};
|
16
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
14
|
+
exports.changeOperationAlias = exports.trackEvent = void 0;
|
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
|
+
}
|
49
|
+
};
|
50
|
+
exports.changeOperationAlias = changeOperationAlias;
|
51
|
+
//# sourceMappingURL=tracking.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../../src/lib/tracking.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAqBI,MAAM,UAAU,GAAe,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3E,IAAI,MAAM,CAAC,EAAE,EAAE;QACb,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE;YAChB,OAAO,EAAE,OAAO;YAChB,aAAa,EAAE,QAAQ;YACvB,WAAW,EAAE,MAAM;YACnB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,KAAK;SAClB,CAAC,CAAA;KACH;AACH,CAAC,CAAA;AAVY,QAAA,UAAU,cAUtB;AAEM,MAAM,oBAAoB,GAAG,CAAC,SAAiB,EAAU,EAAE;IAChE,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ,CAAC,CAAC;YACb,OAAO,SAAS,CAAA;SACjB;QACD,KAAK,QAAQ,CAAC;QACd,KAAK,gBAAgB,CAAC,CAAC;YACrB,OAAO,UAAU,CAAA;SAClB;QACD,KAAK,WAAW,CAAC,CAAC;YAChB,OAAO,SAAS,CAAA;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"}
|
@@ -13,6 +13,7 @@ import { affiliationLabel, authorLabel, } from '@manuscripts/body-editor';
|
|
13
13
|
import { ChangeSet, } from '@manuscripts/track-changes-plugin';
|
14
14
|
import { nodeNames, schema, } from '@manuscripts/transform';
|
15
15
|
import { NodeTextContentRetriever } from './node-content-retriever';
|
16
|
+
import { changeOperationAlias } from './tracking';
|
16
17
|
import { getParentNode } from './utils';
|
17
18
|
const isAltTitleNode = (node) => node.type === schema.nodes.alt_title;
|
18
19
|
const getTitleDisplayName = (node) => {
|
@@ -198,27 +199,4 @@ export const handleUnknownChange = () => {
|
|
198
199
|
content: 'Unknown change!',
|
199
200
|
};
|
200
201
|
};
|
201
|
-
export const changeOperationAlias = (operation) => {
|
202
|
-
switch (operation) {
|
203
|
-
case 'delete': {
|
204
|
-
return 'Deleted';
|
205
|
-
}
|
206
|
-
case 'insert':
|
207
|
-
case 'wrap_with_node': {
|
208
|
-
return 'Inserted';
|
209
|
-
}
|
210
|
-
case 'set_attrs': {
|
211
|
-
return 'Updated';
|
212
|
-
}
|
213
|
-
case 'node_split': {
|
214
|
-
return 'Split';
|
215
|
-
}
|
216
|
-
case 'move': {
|
217
|
-
return 'Move';
|
218
|
-
}
|
219
|
-
default: {
|
220
|
-
return 'null';
|
221
|
-
}
|
222
|
-
}
|
223
|
-
};
|
224
202
|
//# 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,OAAO,EAEL,gBAAgB,EAChB,WAAW,GAEZ,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,SAAS,GAKV,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAGL,SAAS,EACT,MAAM,GACP,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAQvC,MAAM,cAAc,GAAG,CAAC,IAAoB,EAAW,EAAE,CACvD,IAAI,CAAC,IAAI,KAAK,MAAM,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;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,UAAsB,EACtB,KAA4B,EACR,EAAE;IACtB,MAAM,EAAE,WAAW,EAAE,GAAG,UAAU,CAAA;IAClC,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IACxD,IAAI,QAAQ,CAAA;IAEZ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SAAS,EAAE,oBAAoB,CAAC,WAAW,CAAC,SAAS,CAAC;QACtD,QAAQ,EAAE,aAAa,IAAI,MAAM;QACjC,OAAO;KACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAgB,EAAE;IACnD,OAAO;QACL,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,iBAAiB;KAC3B,CAAA;AACH,CAAC,CAAA"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
"use strict";
|
2
1
|
/*!
|
3
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.
|
4
3
|
*
|
@@ -10,6 +9,38 @@
|
|
10
9
|
*
|
11
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
12
11
|
*/
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
export const trackEvent = ({ category, action, label, value }) => {
|
13
|
+
if (window.ga) {
|
14
|
+
window.ga('send', {
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../../src/lib/tracking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAqBH,MAAM,CAAC,MAAM,UAAU,GAAe,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3E,IAAI,MAAM,CAAC,EAAE,EAAE;QACb,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE;YAChB,OAAO,EAAE,OAAO;YAChB,aAAa,EAAE,QAAQ;YACvB,WAAW,EAAE,MAAM;YACnB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,KAAK;SAClB,CAAC,CAAA;KACH;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAAiB,EAAU,EAAE;IAChE,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ,CAAC,CAAC;YACb,OAAO,SAAS,CAAA;SACjB;QACD,KAAK,QAAQ,CAAC;QACd,KAAK,gBAAgB,CAAC,CAAC;YACrB,OAAO,UAAU,CAAA;SAClB;QACD,KAAK,WAAW,CAAC,CAAC;YAChB,OAAO,SAAS,CAAA;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"}
|
@@ -9,4 +9,4 @@
|
|
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
|
-
export declare const MediumTextField: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, import("@manuscripts/style-guide
|
12
|
+
export declare const MediumTextField: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, import("@manuscripts/style-guide").ErrorProps, never>;
|
@@ -9,5 +9,4 @@ export declare const handleTextChange: (suggestion: TextChange, state: Manuscrip
|
|
9
9
|
export declare const handleNodeChange: (suggestion: NodeChange | NodeAttrChange, state: ManuscriptEditorState) => SnippetData | null;
|
10
10
|
export declare const handleGroupChanges: (suggestions: RootChange, view: any, doc: any, dataTracked: any) => SnippetData | null;
|
11
11
|
export declare const handleUnknownChange: () => SnippetData;
|
12
|
-
export declare const changeOperationAlias: (operation: string) => string;
|
13
12
|
export {};
|
@@ -9,4 +9,21 @@
|
|
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
|
+
interface Tracking {
|
13
|
+
category: string;
|
14
|
+
action: string;
|
15
|
+
label?: string;
|
16
|
+
value?: string;
|
17
|
+
}
|
18
|
+
interface InvitationsTracking extends Tracking {
|
19
|
+
category: 'Invitations';
|
20
|
+
action: 'Share' | 'Send' | 'Accept';
|
21
|
+
}
|
22
|
+
interface ManuscriptsTracking extends Tracking {
|
23
|
+
category: 'Manuscripts';
|
24
|
+
action: 'Create' | 'Import' | 'Export';
|
25
|
+
}
|
26
|
+
type TrackEvent = (f: InvitationsTracking | ManuscriptsTracking) => void;
|
27
|
+
export declare const trackEvent: TrackEvent;
|
28
|
+
export declare const changeOperationAlias: (operation: string) => string;
|
12
29
|
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@manuscripts/article-editor",
|
3
|
-
"version": "3.9.
|
3
|
+
"version": "3.9.3-LEAN-4573.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",
|
@@ -13,91 +13,96 @@
|
|
13
13
|
"module": "dist/es",
|
14
14
|
"types": "dist/types",
|
15
15
|
"scripts": {
|
16
|
-
"dev": "
|
17
|
-
"build": "
|
18
|
-
"build:cjs": "tsc --outDir dist/cjs --module commonjs",
|
19
|
-
"build:es": "tsc --outDir dist/es --declarationDir dist/types --declaration",
|
16
|
+
"dev": "concurrently 'yarn:build:* --watch'",
|
17
|
+
"build": "concurrently 'yarn:build:*'",
|
18
|
+
"build:cjs": "tsc --outDir dist/cjs --module commonjs --project tsconfig.build.json",
|
19
|
+
"build:es": "tsc --outDir dist/es --declarationDir dist/types --declaration --project tsconfig.build.json",
|
20
20
|
"test": "TZ=UTC jest --runInBand --detectOpenHandles --forceExit",
|
21
|
+
"test:integration": "TZ=UTC jest --config=jest.integration.config.js --runInBand --detectOpenHandles --forceExit",
|
22
|
+
"test:unit": "TZ=UTC jest --runInBand --detectOpenHandles --forceExit --testPathIgnorePatterns=Storyshots",
|
23
|
+
"test:storyshots": "TZ=UTC jest --runInBand --detectOpenHandles --forceExit --testPathPattern=Storyshots",
|
24
|
+
"test:watch": "jest --runInBand --testPathIgnorePatterns=Storyshots.test.ts --watch",
|
21
25
|
"lint": "eslint src types --ext .ts,.tsx --max-warnings 0",
|
26
|
+
"lint:fix": "eslint src types --fix --ext .ts,.tsx --max-warnings 0",
|
22
27
|
"typecheck": "tsc --noEmit",
|
23
28
|
"prettier": "prettier --write \"{src,stories,tests}/**/*.{js,ts,tsx,css}\"",
|
24
|
-
"
|
29
|
+
"stats": "ALLOW_MISSING_VARIABLES=1 yarn --silent build --json > stats.json",
|
30
|
+
"preversion": "concurrently typecheck lint",
|
25
31
|
"prepare": "husky install",
|
26
|
-
"version": "
|
32
|
+
"version": "ALLOW_MISSING_VARIABLES=1 yarn build"
|
27
33
|
},
|
28
34
|
"dependencies": {
|
29
|
-
"@fontsource/lato": "5.
|
30
|
-
"@fontsource/pt-sans": "5.
|
31
|
-
"@fontsource/pt-serif": "5.
|
32
|
-
"@
|
33
|
-
"@manuscripts/
|
34
|
-
"@manuscripts/
|
35
|
-
"@manuscripts/style-guide": "2.1.
|
36
|
-
"@manuscripts/track-changes-plugin": "1.10.
|
37
|
-
"@manuscripts/transform": "3.1.3-LEAN-
|
38
|
-
"@popperjs/core": "2.11.8",
|
39
|
-
"
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"prosemirror-utils": "
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"react": "18.3.1",
|
51
|
-
"react-
|
52
|
-
"react-
|
53
|
-
"react-
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"
|
57
|
-
"
|
58
|
-
"styled-components": "5.3.11",
|
59
|
-
"use-sync-external-store": "1.5.0",
|
60
|
-
"uuid": "9.0.1"
|
35
|
+
"@fontsource/lato": "^4.5.10",
|
36
|
+
"@fontsource/pt-sans": "^4.5.11",
|
37
|
+
"@fontsource/pt-serif": "^4.5.11",
|
38
|
+
"@manuscripts/body-editor": "2.9.3-LEAN-4573.0",
|
39
|
+
"@manuscripts/json-schema": "2.2.11",
|
40
|
+
"@manuscripts/library": "1.3.14",
|
41
|
+
"@manuscripts/style-guide": "2.1.13",
|
42
|
+
"@manuscripts/track-changes-plugin": "1.10.9",
|
43
|
+
"@manuscripts/transform": "3.1.3-LEAN-4573.0",
|
44
|
+
"@popperjs/core": "^2.11.8",
|
45
|
+
"@types/use-sync-external-store": "^0.0.6",
|
46
|
+
"autotrack": "^2.4.1",
|
47
|
+
"axios": "^1.6.7",
|
48
|
+
"html-react-parser": "^5.1.16",
|
49
|
+
"http-status-codes": "^2.2.0",
|
50
|
+
"lodash": "^4.17.21",
|
51
|
+
"prosemirror-utils": "^0.9.6",
|
52
|
+
"react": "^18.3.1",
|
53
|
+
"react-dnd": "^16.0.1",
|
54
|
+
"react-dnd-html5-backend": "^16.0.1",
|
55
|
+
"react-dom": "^18.3.1",
|
56
|
+
"react-is": "^18.3.1",
|
57
|
+
"react-modal": "^3.16.1",
|
58
|
+
"react-popper": "^2.0.0",
|
59
|
+
"react-select": "^5.7.3",
|
60
|
+
"styled-components": "^5.2.0",
|
61
|
+
"use-sync-external-store": "^1.2.2",
|
62
|
+
"uuid": "^9.0.0",
|
63
|
+
"yarn-run-all": "^3.1.1"
|
61
64
|
},
|
62
65
|
"devDependencies": {
|
63
|
-
"@babel/core": "7.
|
64
|
-
"@babel/preset-env": "7.
|
65
|
-
"@babel/preset-react": "7.
|
66
|
-
"@babel/preset-typescript": "7.
|
67
|
-
"@manuscripts/eslint-config": "0.5.1",
|
68
|
-
"@types/
|
69
|
-
"@types/
|
70
|
-
"@types/
|
71
|
-
"@types/
|
72
|
-
"@types/react
|
73
|
-
"@types/
|
74
|
-
"@types/
|
75
|
-
"@types/
|
76
|
-
"@
|
77
|
-
"@typescript-eslint/
|
78
|
-
"
|
79
|
-
"
|
80
|
-
"
|
81
|
-
"eslint
|
82
|
-
"eslint-
|
83
|
-
"eslint-plugin-
|
84
|
-
"eslint-plugin-
|
85
|
-
"eslint-plugin-
|
86
|
-
"eslint-plugin-
|
87
|
-
"eslint-plugin-
|
88
|
-
"eslint-plugin-
|
89
|
-
"eslint-plugin-
|
90
|
-
"eslint-plugin-react
|
91
|
-
"eslint-plugin-
|
92
|
-
"
|
93
|
-
"
|
94
|
-
"jest
|
95
|
-
"
|
96
|
-
"
|
97
|
-
"
|
98
|
-
"
|
66
|
+
"@babel/core": "^7.20.5",
|
67
|
+
"@babel/preset-env": "^7.20.2",
|
68
|
+
"@babel/preset-react": "^7.18.6",
|
69
|
+
"@babel/preset-typescript": "^7.18.6",
|
70
|
+
"@manuscripts/eslint-config": "^0.5.1",
|
71
|
+
"@types/dompurify": "^2.0.4",
|
72
|
+
"@types/google.analytics": "^0.0.45",
|
73
|
+
"@types/jest": "^29.2.4",
|
74
|
+
"@types/lodash": "^4.14.202",
|
75
|
+
"@types/react": "^18.3.1",
|
76
|
+
"@types/react-dom": "^18.3.0",
|
77
|
+
"@types/react-modal": "^3.10.6",
|
78
|
+
"@types/styled-components": "^5.1.4",
|
79
|
+
"@types/uuid": "^9.0.8",
|
80
|
+
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
81
|
+
"@typescript-eslint/parser": "^5.47.0",
|
82
|
+
"babel-jest": "^29.3.1",
|
83
|
+
"concurrently": "^7.6.0",
|
84
|
+
"eslint": "^8.46.0",
|
85
|
+
"eslint-config-prettier": "^8.5.0",
|
86
|
+
"eslint-plugin-header": "^3.1.1",
|
87
|
+
"eslint-plugin-import": "^2.26.0",
|
88
|
+
"eslint-plugin-jest": "^27.1.7",
|
89
|
+
"eslint-plugin-jsx-a11y": "^6.6.1",
|
90
|
+
"eslint-plugin-mdx": "^2.0.5",
|
91
|
+
"eslint-plugin-prettier": "^4.2.1",
|
92
|
+
"eslint-plugin-promise": "^6.1.1",
|
93
|
+
"eslint-plugin-react": "^7.31.11",
|
94
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
95
|
+
"eslint-plugin-simple-import-sort": "^8.0.0",
|
96
|
+
"husky": "^8.0.2",
|
97
|
+
"jest": "^29.3.1",
|
98
|
+
"jest-environment-jsdom": "^29.3.1",
|
99
|
+
"jest-junit": "^15.0.0",
|
100
|
+
"jest-styled-components": "^7.1.1",
|
101
|
+
"prettier": "^2.8.1",
|
102
|
+
"react-dnd-test-backend": "^16.0.1",
|
103
|
+
"typescript": "^4.0.5"
|
99
104
|
},
|
100
|
-
"
|
101
|
-
"
|
105
|
+
"resolutions": {
|
106
|
+
"@types/react": "^18.3.1"
|
102
107
|
}
|
103
108
|
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"fileMock.js","sourceRoot":"","sources":["../../../src/__mocks__/fileMock.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAEH,kBAAe,gBAAgB,CAAA"}
|
@@ -1,15 +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) 2019 Atypon Systems LLC. All Rights Reserved.
|
12
|
-
*/
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
-
exports.default = {};
|
15
|
-
//# sourceMappingURL=styleMock.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"styleMock.js","sourceRoot":"","sources":["../../../src/__mocks__/styleMock.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAEH,kBAAe,EAAE,CAAA"}
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1,50 +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) 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
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1,32 +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) 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
|
@@ -1 +0,0 @@
|
|
1
|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,MAAM,CAAC,IAAA,mBAAW,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAW,CAAC,KAAK,CAAC,CAAC,CAAA;IAEjE,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,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,13 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"fileMock.js","sourceRoot":"","sources":["../../../src/__mocks__/fileMock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAe,gBAAgB,CAAA"}
|
@@ -1,13 +0,0 @@
|
|
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 {};
|
13
|
-
//# sourceMappingURL=styleMock.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"styleMock.js","sourceRoot":"","sources":["../../../src/__mocks__/styleMock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAe,EAAE,CAAA"}
|
@@ -1,33 +0,0 @@
|
|
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
|
-
import LayoutStorage from '../layout';
|
13
|
-
describe('layout state persistence', () => {
|
14
|
-
it('get', () => {
|
15
|
-
const loadResult = LayoutStorage.get('foo');
|
16
|
-
expect(loadResult).toEqual({ size: 200, collapsed: false });
|
17
|
-
});
|
18
|
-
it('set', () => {
|
19
|
-
const bar = {
|
20
|
-
size: 10,
|
21
|
-
collapsed: true,
|
22
|
-
};
|
23
|
-
const setResult = LayoutStorage.set('foo', bar);
|
24
|
-
expect(setResult).toEqual(bar);
|
25
|
-
// expect(Layout.get('foo')).toEqual(bar) // FIXME: I think this not being met is indicating a bug?
|
26
|
-
});
|
27
|
-
it('remove', () => {
|
28
|
-
LayoutStorage.remove();
|
29
|
-
const storage = window.localStorage;
|
30
|
-
expect(storage.getItem('layout')).toBeFalsy();
|
31
|
-
});
|
32
|
-
});
|
33
|
-
//# sourceMappingURL=layout.test.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"layout.test.js","sourceRoot":"","sources":["../../../../src/lib/__tests__/layout.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,aAAa,MAAM,WAAW,CAAA;AAErC,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;QACb,MAAM,UAAU,GAAG,aAAa,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,aAAa,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,aAAa,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"}
|
@@ -1,25 +0,0 @@
|
|
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
|
-
import Prefs, { defaults } from '../preferences';
|
13
|
-
describe('preferences', () => {
|
14
|
-
it('have defaults', () => {
|
15
|
-
expect(Prefs.get()).toEqual(defaults);
|
16
|
-
});
|
17
|
-
it('can be set and removed', () => {
|
18
|
-
const prefs = { locale: 'ar' };
|
19
|
-
expect(Prefs.set(prefs)).toEqual(prefs);
|
20
|
-
expect(Prefs.get()).toEqual(prefs);
|
21
|
-
Prefs.remove();
|
22
|
-
expect(Prefs.get()).toEqual(defaults); // check that we're back to defaults
|
23
|
-
});
|
24
|
-
});
|
25
|
-
//# sourceMappingURL=preferences.test.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"preferences.test.js","sourceRoot":"","sources":["../../../../src/lib/__tests__/preferences.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAe,MAAM,gBAAgB,CAAA;AAE7D,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;QACvB,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,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,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QACvC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAElC,KAAK,CAAC,MAAM,EAAE,CAAA;QACd,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA,CAAC,oCAAoC;IAC5E,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -1,30 +0,0 @@
|
|
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
|
-
import { getUserRole, isOwner, isViewer, isWriter, ProjectRole } from '../roles';
|
13
|
-
describe('roles', () => {
|
14
|
-
const project = {
|
15
|
-
owners: ['User_A'],
|
16
|
-
viewers: ['User_B'],
|
17
|
-
writers: ['User_C'],
|
18
|
-
};
|
19
|
-
it('isOwner must return true if the user is an owner', () => expect(isOwner(project, 'User_A')).toBeTruthy());
|
20
|
-
it('isOwner must return false if the user is not an owner', () => expect(isOwner(project, 'User_D')).toBeFalsy());
|
21
|
-
it('isWriter must return true if the user is a writer', () => expect(isWriter(project, 'User_C')).toBeTruthy());
|
22
|
-
it('isWriter must return false if the user is not a writer', () => expect(isWriter(project, 'User_D')).toBeFalsy());
|
23
|
-
it('isViewer must return true if the user is a viewer', () => expect(isViewer(project, 'User_B')).toBeTruthy());
|
24
|
-
it('isViewer must return false if the user is not a viewer', () => expect(isViewer(project, 'User_D')).toBeFalsy());
|
25
|
-
it('getRole must return owner if the user is an owner', () => expect(getUserRole(project, 'User_A')).toBe(ProjectRole.owner));
|
26
|
-
it('getRole must return writer if the user is a writer', () => expect(getUserRole(project, 'User_C')).toBe(ProjectRole.writer));
|
27
|
-
it('getRole must return viewer if the user is a viewer', () => expect(getUserRole(project, 'User_B')).toBe(ProjectRole.viewer));
|
28
|
-
it('getRole must return null if the user not in the project', () => expect(getUserRole(project, 'User_D')).toBeNull());
|
29
|
-
});
|
30
|
-
//# sourceMappingURL=roles.test.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"roles.test.js","sourceRoot":"","sources":["../../../../src/lib/__tests__/roles.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEhF,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,MAAM,OAAO,GAAY;QACvB,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,OAAO,EAAE,CAAC,QAAQ,CAAC;KACT,CAAA;IAEZ,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE,CAC1D,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAA;IAElD,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE,CAC/D,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAA;IAEjD,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE,CAC3D,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAA;IAEnD,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE,CAChE,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAA;IAElD,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE,CAC3D,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAA;IAEnD,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE,CAChE,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAA;IAElD,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE,CAC3D,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAA;IAEjE,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE,CAC5D,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAA;IAElE,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE,CAC5D,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAA;IAElE,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE,CACjE,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;AACtD,CAAC,CAAC,CAAA"}
|
@@ -1,13 +0,0 @@
|
|
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
|
-
declare const _default: "test-file-stub";
|
13
|
-
export default _default;
|
@@ -1,13 +0,0 @@
|
|
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
|
-
declare const _default: {};
|
13
|
-
export default _default;
|
@@ -1,12 +0,0 @@
|
|
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 {};
|
@@ -1,12 +0,0 @@
|
|
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 {};
|