@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.
Files changed (47) hide show
  1. package/dist/{es/lib/tracking.js → cjs/__mocks__/fileMock.js} +4 -35
  2. package/dist/cjs/__mocks__/fileMock.js.map +1 -0
  3. package/dist/{types/components/FileManager/FileGroup.d.ts → cjs/__mocks__/styleMock.js} +5 -9
  4. package/dist/cjs/__mocks__/styleMock.js.map +1 -0
  5. package/dist/cjs/components/FileManager/FileActions.js +1 -3
  6. package/dist/cjs/components/FileManager/FileActions.js.map +1 -1
  7. package/dist/cjs/components/FileManager/InlineFilesSection.js +28 -77
  8. package/dist/cjs/components/FileManager/InlineFilesSection.js.map +1 -1
  9. package/dist/cjs/lib/{tracking.js → __tests__/layout.test.js} +25 -38
  10. package/dist/cjs/lib/__tests__/layout.test.js.map +1 -0
  11. package/dist/cjs/lib/__tests__/preferences.test.js +50 -0
  12. package/dist/cjs/lib/__tests__/preferences.test.js.map +1 -0
  13. package/dist/cjs/lib/__tests__/roles.test.js +32 -0
  14. package/dist/cjs/lib/__tests__/roles.test.js.map +1 -0
  15. package/dist/cjs/lib/change-handlers.js +28 -5
  16. package/dist/cjs/lib/change-handlers.js.map +1 -1
  17. package/dist/es/__mocks__/fileMock.js +13 -0
  18. package/dist/es/__mocks__/fileMock.js.map +1 -0
  19. package/dist/es/__mocks__/styleMock.js +13 -0
  20. package/dist/es/__mocks__/styleMock.js.map +1 -0
  21. package/dist/es/components/FileManager/FileActions.js +1 -3
  22. package/dist/es/components/FileManager/FileActions.js.map +1 -1
  23. package/dist/es/components/FileManager/InlineFilesSection.js +31 -80
  24. package/dist/es/components/FileManager/InlineFilesSection.js.map +1 -1
  25. package/dist/es/lib/__tests__/layout.test.js +33 -0
  26. package/dist/es/lib/__tests__/layout.test.js.map +1 -0
  27. package/dist/es/lib/__tests__/preferences.test.js +25 -0
  28. package/dist/es/lib/__tests__/preferences.test.js.map +1 -0
  29. package/dist/es/lib/__tests__/roles.test.js +30 -0
  30. package/dist/es/lib/__tests__/roles.test.js.map +1 -0
  31. package/dist/es/lib/change-handlers.js +23 -1
  32. package/dist/es/lib/change-handlers.js.map +1 -1
  33. package/dist/types/__mocks__/fileMock.d.ts +13 -0
  34. package/dist/types/__mocks__/styleMock.d.ts +13 -0
  35. package/dist/types/components/FileManager/FileActions.d.ts +0 -1
  36. package/dist/types/components/projects/inputs.d.ts +1 -1
  37. package/dist/types/lib/{tracking.d.ts → __tests__/layout.test.d.ts} +0 -17
  38. package/dist/types/lib/__tests__/preferences.test.d.ts +12 -0
  39. package/dist/types/lib/__tests__/roles.test.d.ts +12 -0
  40. package/dist/types/lib/change-handlers.d.ts +1 -0
  41. package/package.json +77 -82
  42. package/dist/cjs/components/FileManager/FileGroup.js +0 -108
  43. package/dist/cjs/components/FileManager/FileGroup.js.map +0 -1
  44. package/dist/cjs/lib/tracking.js.map +0 -1
  45. package/dist/es/components/FileManager/FileGroup.js +0 -102
  46. package/dist/es/components/FileManager/FileGroup.js.map +0 -1
  47. package/dist/es/lib/tracking.js.map +0 -1
@@ -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 {};
13
+ //# sourceMappingURL=styleMock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styleMock.js","sourceRoot":"","sources":["../../../src/__mocks__/styleMock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAe,EAAE,CAAA"}
@@ -4,7 +4,7 @@ import styled from 'styled-components';
4
4
  /**
5
5
  * This component represents the drop-down list action for each file item.
6
6
  */
7
- export const FileActions = ({ sectionType, onDownload, onReplace, onDetach, onDelete, onUseAsMain, move, className, file, accept, }) => {
7
+ export const FileActions = ({ sectionType, onDownload, onReplace, onDetach, onUseAsMain, move, className, file, accept, }) => {
8
8
  const can = usePermissions();
9
9
  const { isOpen, toggleOpen, wrapperRef } = useDropdown();
10
10
  const [isMoveDialogOpen, setMoveDialogOpen] = useState(false);
@@ -12,7 +12,6 @@ export const FileActions = ({ sectionType, onDownload, onReplace, onDetach, onDe
12
12
  const showDownload = can?.downloadFiles && onDownload;
13
13
  const showReplace = can?.replaceFile && onReplace;
14
14
  const showDetach = can?.detachFile && onDetach;
15
- const showDelete = can?.detachFile && onDelete;
16
15
  const showMove = can?.moveFile && move;
17
16
  const showUseAsMain = can?.moveFile && onUseAsMain && isValidMainDocumentFormat(file);
18
17
  const show = showDownload || showReplace || showDetach || showMove || showUseAsMain;
@@ -40,7 +39,6 @@ export const FileActions = ({ sectionType, onDownload, onReplace, onDetach, onDe
40
39
  React.createElement(FileAction, { onClick: openFileDialog }, "Replace"),
41
40
  React.createElement("input", { ref: fileInputRef, type: "file", style: { display: 'none' }, onChange: handleChange, accept: accept }))),
42
41
  showDetach && React.createElement(FileAction, { onClick: onDetach }, "Detach"),
43
- showDelete && React.createElement(FileAction, { onClick: onDelete }, "Delete"),
44
42
  showMove && (React.createElement(FileAction, { onClick: () => setMoveDialogOpen(true) },
45
43
  "Move to ",
46
44
  move.sectionType)),
@@ -1 +1 @@
1
- {"version":3,"file":"FileActions.js","sourceRoot":"","sources":["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,KAAK,CAAA;KACb;IAED,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAEjE,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAClC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CACpD,CAAA;AACH,CAAC,CAAA"}
@@ -1,32 +1,33 @@
1
- import { FileFigureIcon, FileGraphicalAbstractIcon, FileImageIcon, Tooltip, TriangleCollapsedIcon, TriangleExpandedIcon, } from '@manuscripts/style-guide';
1
+ import { FileFigureIcon, FileGraphicalAbstractIcon, FileImageIcon, } from '@manuscripts/style-guide';
2
2
  import { schema } from '@manuscripts/transform';
3
3
  import { NodeSelection } from 'prosemirror-state';
4
4
  import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
5
- import React, { useMemo, useState } from 'react';
6
- import { trimFilename } from '../../lib/files';
5
+ import React, { useMemo } from 'react';
7
6
  import { useStore } from '../../store';
8
7
  import { FileActions } from './FileActions';
8
+ import { FileContainer } from './FileContainer';
9
9
  import { FileCreatedDate } from './FileCreatedDate';
10
- import { FileGroup, FileGroupContainer, FileGroupHeader, FileGroupItemContainer, FileLabel, ToggleIcon, } from './FileGroup';
11
10
  import { FileSectionType } from './FileManager';
12
- import { FileNameText } from './FileName';
13
- import { FileTypeIcon } from './FileTypeIcon';
11
+ import { FileName } from './FileName';
14
12
  export const InlineFilesSection = ({ elements, }) => {
15
13
  const [{ view, fileManagement, sectionCategories }] = useStore((s) => ({
16
14
  view: s.view,
17
15
  fileManagement: s.fileManagement,
18
16
  sectionCategories: s.sectionCategories,
19
17
  }));
20
- const groupedMetadata = useMemo(() => {
18
+ const metadata = useMemo(() => {
21
19
  if (!view) {
22
20
  return [];
23
21
  }
24
22
  let figureIndex = 1;
25
23
  let imageIndex = 1;
26
24
  return elements.map((element) => {
25
+ const figure = element.files[0];
26
+ const file = figure?.file || { id: '', name: '' };
27
27
  const $pos = view.state.doc.resolve(element.pos);
28
28
  const section = findParentNodeOfTypeClosestToPos($pos, schema.nodes.graphical_abstract_section);
29
- let label, icon;
29
+ let label;
30
+ let icon;
30
31
  if (section) {
31
32
  const category = section.node.attrs.category;
32
33
  label = sectionCategories.get(category)?.titles[0] || '';
@@ -36,112 +37,62 @@ export const InlineFilesSection = ({ elements, }) => {
36
37
  label = `Image ${imageIndex++}`;
37
38
  icon = FileImageIcon;
38
39
  }
40
+ else if (element.node.type === schema.nodes.hero_image) {
41
+ label = `Hero Image`;
42
+ icon = FileImageIcon;
43
+ }
39
44
  else {
40
45
  label = `Figure ${figureIndex++}`;
41
46
  icon = FileFigureIcon;
42
47
  }
43
48
  return {
44
49
  element,
50
+ node: figure?.node,
51
+ pos: figure?.pos,
52
+ file,
45
53
  label,
46
54
  icon,
47
- files: element.files.filter((f) => f.file.id),
48
55
  };
49
56
  });
50
57
  }, [elements, view, sectionCategories]);
51
- const [openGroupIndexes, setOpenGroupIndexes] = useState(new Set(groupedMetadata.map((_, index) => index)));
52
- const toggleGroupOpen = (groupIndex) => {
53
- setOpenGroupIndexes((prevOpenIndexes) => {
54
- const newOpenIndexes = new Set(prevOpenIndexes);
55
- if (newOpenIndexes.has(groupIndex)) {
56
- newOpenIndexes.delete(groupIndex);
57
- }
58
- else {
59
- newOpenIndexes.add(groupIndex);
60
- }
61
- return newOpenIndexes;
62
- });
63
- };
64
58
  if (!view) {
65
59
  return null;
66
60
  }
67
- const handleClick = (element) => {
68
- const tr = view.state.tr;
69
- tr.setSelection(NodeSelection.create(view.state.doc, element.pos));
70
- tr.scrollIntoView();
71
- view.focus();
72
- view.dispatch(tr);
73
- };
74
- const handleFileClick = (pos) => {
75
- if (!pos) {
76
- return;
77
- }
61
+ const handleClick = (metadata) => {
78
62
  const tr = view.state.tr;
79
- tr.setSelection(NodeSelection.create(view.state.doc, pos));
63
+ tr.setSelection(NodeSelection.create(view.state.doc, metadata.element.pos));
80
64
  tr.scrollIntoView();
81
65
  view.focus();
82
66
  view.dispatch(tr);
83
67
  };
84
- const handleDetach = (pos) => {
85
- if (!pos) {
68
+ const handleDetach = (metadata) => {
69
+ if (!metadata.pos) {
86
70
  return;
87
71
  }
88
72
  const tr = view.state.tr;
89
- tr.setNodeAttribute(pos, 'src', '');
90
- tr.setSelection(NodeSelection.create(tr.doc, pos));
73
+ tr.setNodeAttribute(metadata.pos, 'src', '');
74
+ tr.setSelection(NodeSelection.create(tr.doc, metadata.pos));
91
75
  tr.scrollIntoView();
92
76
  view.focus();
93
77
  view.dispatch(tr);
94
78
  };
95
- const handleDelete = (pos) => {
96
- if (!pos || !view) {
97
- return;
98
- }
99
- const node = view.state.doc.nodeAt(pos);
100
- if (node?.type === schema.nodes.figure) {
101
- const tr = view.state.tr;
102
- tr.delete(pos, pos + node.nodeSize);
103
- view.dispatch(tr);
104
- }
105
- };
106
- const handleReplace = async (pos, file) => {
107
- if (!pos || !file) {
79
+ const handleReplace = async (metadata, file) => {
80
+ if (!metadata.pos) {
108
81
  return;
109
82
  }
110
83
  const uploaded = await fileManagement.upload(file);
111
84
  const tr = view.state.tr;
112
- tr.setNodeAttribute(pos, 'src', uploaded.id);
113
- tr.setSelection(NodeSelection.create(tr.doc, pos));
85
+ tr.setNodeAttribute(metadata.pos, 'src', uploaded.id);
86
+ tr.setSelection(NodeSelection.create(tr.doc, metadata.pos));
114
87
  tr.scrollIntoView();
115
88
  view.focus();
116
89
  view.dispatch(tr);
117
90
  };
118
- return (React.createElement(React.Fragment, null, groupedMetadata.map((group, groupIndex) => {
119
- const isOpen = openGroupIndexes.has(groupIndex);
120
- return (React.createElement(FileGroupContainer, { "data-cy": "file-container", key: groupIndex, onClick: () => handleClick(group.element) },
121
- React.createElement(FileGroupHeader, null,
122
- React.createElement(group.icon, { className: "file-icon" }),
123
- group.label && React.createElement(FileLabel, null,
124
- group.label,
125
- ":"),
126
- group.files.length > 0 && (React.createElement(ToggleIcon, { isOpen: isOpen, onClick: (e) => {
127
- e.stopPropagation();
128
- toggleGroupOpen(groupIndex);
129
- } }, isOpen ? (React.createElement(TriangleExpandedIcon, null)) : (React.createElement(TriangleCollapsedIcon, null))))),
130
- isOpen && group.files.length > 0 && (React.createElement(FileGroup, null, group.files.map((fileAttachment, fileIndex) => (React.createElement(FileGroupItemContainer, { key: fileIndex, "data-tooltip-id": `${fileAttachment.file?.id}-file-name-tooltip`, onClick: (e) => {
131
- e.stopPropagation();
132
- handleFileClick(fileAttachment.pos);
133
- } },
134
- fileAttachment.file && (React.createElement(FileTypeIcon, { file: fileAttachment.file })),
135
- React.createElement(FileNameText, { "data-cy": "filename" },
136
- fileAttachment.file?.name
137
- ? trimFilename(fileAttachment.file.name, 25)
138
- : 'Figure',
139
- React.createElement(Tooltip, { id: `${fileAttachment.file?.id}-file-name-tooltip`, place: "bottom" }, fileAttachment.file?.name || 'Figure')),
140
- fileAttachment.file && (React.createElement(FileCreatedDate, { file: fileAttachment.file, className: "show-on-hover" })),
141
- React.createElement(FileActions, { sectionType: FileSectionType.Inline, onReplace: async (f) => await handleReplace(fileAttachment.pos, f), onDetach: () => handleDetach(fileAttachment.pos), onDownload: () => fileAttachment.file &&
142
- fileManagement.download(fileAttachment.file), onDelete: fileIndex !== 0 // Skip displaying the delete option for the first figure
143
- ? () => handleDelete(fileAttachment.pos)
144
- : undefined }))))))));
91
+ return (React.createElement(React.Fragment, null, metadata.map((e, index) => {
92
+ return (React.createElement(FileContainer, { "data-cy": "file-container", key: index, onClick: () => handleClick(e) },
93
+ React.createElement(FileName, { file: e.file, label: e.label, icon: e.icon }),
94
+ React.createElement(FileCreatedDate, { file: e.file, className: "show-on-hover" }),
95
+ React.createElement(FileActions, { "data-cy": "file-actions", sectionType: FileSectionType.Inline, onReplace: async (f) => await handleReplace(e, f), onDetach: () => handleDetach(e), onDownload: () => fileManagement.download(e.file) })));
145
96
  })));
146
97
  };
147
98
  //# sourceMappingURL=InlineFilesSection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InlineFilesSection.js","sourceRoot":"","sources":["../../../../src/components/FileManager/InlineFilesSection.tsx"],"names":[],"mappings":"AAYA,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,aAAa,EACb,OAAO,EACP,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,SAAS,EACT,UAAU,GACX,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAa7C,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EACpE,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACrE,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,cAAc,EAAE,CAAC,CAAC,cAAc;QAChC,iBAAiB,EAAE,CAAC,CAAC,iBAAiB;KACv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Ac,CAAC,GAAG,EAAE,CAAC,CAAC,EAE5C,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC,EAChD,UAAU,EAAE,GAAG,EAAE,CACf,cAAc,CAAC,IAAI;wBACnB,cAAc,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,EAE9C,QAAQ,EACN,SAAS,KAAK,CAAC,CAAC,yDAAyD;wBACvE,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC;wBACxC,CAAC,CAAC,SAAS,GAEf,CACqB,CAC1B,CAAC,CACQ,CACb,CACkB,CACtB,CAAA;IACH,CAAC,CAAC,CACD,CACJ,CAAA;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"InlineFilesSection.js","sourceRoot":"","sources":["../../../../src/components/FileManager/InlineFilesSection.tsx"],"names":[],"mappings":"AAYA,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,aAAa,GACd,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAkB,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAerC,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EACpE,QAAQ,GACT,EAAE,EAAE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EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,GAAI;YACxD,oBAAC,eAAe,IAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,EAAC,eAAe,GAAG;YAC3D,oBAAC,WAAW,eACF,cAAc,EACtB,WAAW,EAAE,eAAe,CAAC,MAAM,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"}
@@ -0,0 +1,33 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,25 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,30 @@
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
@@ -0,0 +1 @@
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,EAA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C,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;AACtD,CAAC,CAAC,CAAA"}
@@ -13,7 +13,6 @@ 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';
17
16
  import { getParentNode } from './utils';
18
17
  const isAltTitleNode = (node) => node.type === schema.nodes.alt_title;
19
18
  const getTitleDisplayName = (node) => {
@@ -199,4 +198,27 @@ export const handleUnknownChange = () => {
199
198
  content: 'Unknown change!',
200
199
  };
201
200
  };
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
+ };
202
224
  //# 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,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAQvC,MAAM,cAAc,GAAG,CAAC,IAAoB,EAA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,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"}
@@ -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
+ declare const _default: "test-file-stub";
13
+ export default _default;
@@ -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
+ declare const _default: {};
13
+ export default _default;
@@ -20,7 +20,6 @@ export declare const FileActions: React.FC<{
20
20
  onDownload?: () => void;
21
21
  onReplace?: Replace;
22
22
  onDetach?: () => void;
23
- onDelete?: () => void;
24
23
  onUseAsMain?: () => void;
25
24
  move?: Move;
26
25
  className?: string;
@@ -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").ErrorProps, never>;
12
+ export declare const MediumTextField: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, import("@manuscripts/style-guide/dist/types").ErrorProps, never>;
@@ -9,21 +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
- 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;
29
12
  export {};
@@ -0,0 +1,12 @@
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 {};
@@ -0,0 +1,12 @@
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 {};
@@ -9,4 +9,5 @@ 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;
12
13
  export {};