@manuscripts/article-editor 3.8.13-LEAN-4355.0 → 3.8.13-LEAN-4439.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/FileManager/FileActions.js +16 -43
- package/dist/cjs/components/FileManager/FileActions.js.map +1 -1
- package/dist/cjs/components/FileManager/FileManager.js +1 -7
- package/dist/cjs/components/FileManager/FileManager.js.map +1 -1
- package/dist/cjs/components/FileManager/FileSectionAlert.js +1 -12
- package/dist/cjs/components/FileManager/FileSectionAlert.js.map +1 -1
- package/dist/cjs/components/FileManager/FileUploader.js +3 -3
- package/dist/cjs/components/FileManager/FileUploader.js.map +1 -1
- package/dist/cjs/components/FileManager/OtherFilesSection.js +5 -12
- package/dist/cjs/components/FileManager/OtherFilesSection.js.map +1 -1
- package/dist/cjs/components/FileManager/SupplementsSection.js +4 -16
- package/dist/cjs/components/FileManager/SupplementsSection.js.map +1 -1
- package/dist/es/components/FileManager/FileActions.js +17 -44
- package/dist/es/components/FileManager/FileActions.js.map +1 -1
- package/dist/es/components/FileManager/FileManager.js +1 -7
- package/dist/es/components/FileManager/FileManager.js.map +1 -1
- package/dist/es/components/FileManager/FileSectionAlert.js +1 -12
- package/dist/es/components/FileManager/FileSectionAlert.js.map +1 -1
- package/dist/es/components/FileManager/FileUploader.js +3 -3
- package/dist/es/components/FileManager/FileUploader.js.map +1 -1
- package/dist/es/components/FileManager/OtherFilesSection.js +6 -13
- package/dist/es/components/FileManager/OtherFilesSection.js.map +1 -1
- package/dist/es/components/FileManager/SupplementsSection.js +5 -17
- package/dist/es/components/FileManager/SupplementsSection.js.map +1 -1
- package/dist/types/components/FileManager/FileActions.d.ts +0 -15
- package/dist/types/components/FileManager/FileManager.d.ts +1 -2
- package/dist/types/components/FileManager/FileSectionAlert.d.ts +1 -2
- package/dist/types/components/FileManager/FileUploader.d.ts +0 -2
- package/package.json +3 -3
- package/dist/cjs/components/FileManager/MainFilesSection.js +0 -183
- package/dist/cjs/components/FileManager/MainFilesSection.js.map +0 -1
- package/dist/es/components/FileManager/MainFilesSection.js +0 -153
- package/dist/es/components/FileManager/MainFilesSection.js.map +0 -1
- package/dist/types/components/FileManager/MainFilesSection.d.ts +0 -16
@@ -16,7 +16,7 @@ import styled, { css } from 'styled-components';
|
|
16
16
|
/**
|
17
17
|
* This component will show the drag or upload file area
|
18
18
|
*/
|
19
|
-
export const FileUploader = ({ onUpload
|
19
|
+
export const FileUploader = ({ onUpload }) => {
|
20
20
|
const fileInputRef = useRef(null);
|
21
21
|
const openFileDialog = () => {
|
22
22
|
if (fileInputRef && fileInputRef.current) {
|
@@ -42,8 +42,8 @@ export const FileUploader = ({ onUpload, placeholder, accept, }) => {
|
|
42
42
|
});
|
43
43
|
const isActive = canDrop && isOver;
|
44
44
|
return (React.createElement(Container, { ref: dropRef, "data-cy": "file-uploader", active: isActive, onClick: openFileDialog },
|
45
|
-
React.createElement("input", { ref: fileInputRef, type: "file", style: { display: 'none' }, onChange: handleChange,
|
46
|
-
|
45
|
+
React.createElement("input", { ref: fileInputRef, type: "file", style: { display: 'none' }, onChange: handleChange, value: '' }),
|
46
|
+
"Drag or click to upload a new file"));
|
47
47
|
};
|
48
48
|
const activeBoxStyle = css `
|
49
49
|
background: #f2fbfc;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FileUploader.js","sourceRoot":"","sources":["../../../../src/components/FileManager/FileUploader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,EAAe,MAAM,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;
|
1
|
+
{"version":3,"file":"FileUploader.js","sourceRoot":"","sources":["../../../../src/components/FileManager/FileUploader.tsx"],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AE,OAAO,CAAC,OAAO,EAAE;SAC3B,CAAC;KACH,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,OAAO,IAAI,MAAM,CAAA;IAElC,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,OAAO,aACJ,eAAe,EACvB,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,cAAc;QAEvB,+BACE,GAAG,EAAE,YAAY,EACjB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAC1B,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,EAAE,GACT;6CAEQ,CACb,CAAA;AACH,CAAC,CAAA;AAED,MAAM,cAAc,GAAG,GAAG,CAAA;;;CAGzB,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAqB;gBACjC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS;;;;;;;;;;iBAUjD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;WAC7C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO;;;IAGjD,CAAC,KAAK,EAAE,EAAE,CACV,KAAK,CAAC,MAAM;IACV,CAAC,CAAC,GAAG,CAAA;YACC,cAAc;SACjB;IACH,CAAC,CAAC,GAAG,CAAA,EAAE;CACZ,CAAA"}
|
@@ -9,7 +9,7 @@
|
|
9
9
|
*
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
|
-
import {
|
12
|
+
import { insertSupplement } from '@manuscripts/body-editor';
|
13
13
|
import { usePermissions } from '@manuscripts/style-guide';
|
14
14
|
import React, { useEffect, useState } from 'react';
|
15
15
|
import { useDrag } from 'react-dnd';
|
@@ -56,19 +56,12 @@ export const OtherFilesSection = ({ files }) => {
|
|
56
56
|
message: FileSectionType.Supplements,
|
57
57
|
});
|
58
58
|
};
|
59
|
-
const asMainDocument = async (file) => {
|
60
|
-
insertAttachment(file, view.state, 'document', view.dispatch);
|
61
|
-
setAlert({
|
62
|
-
type: FileSectionAlertType.MOVE_SUCCESSFUL,
|
63
|
-
message: FileSectionType.MainFile,
|
64
|
-
});
|
65
|
-
};
|
66
59
|
return (React.createElement("div", null,
|
67
|
-
can?.uploadFile &&
|
60
|
+
can?.uploadFile && React.createElement(FileUploader, { onUpload: handleUpload }),
|
68
61
|
React.createElement(FileSectionAlert, { alert: alert }),
|
69
|
-
files.map((file) => (React.createElement(OtherFile, { key: file.id, file: file, onDownload: () => fileManagement.download(file), onMoveToSupplements: async () => await moveToSupplements(file)
|
62
|
+
files.map((file) => (React.createElement(OtherFile, { key: file.id, file: file, onDownload: () => fileManagement.download(file), onMoveToSupplements: async () => await moveToSupplements(file) })))));
|
70
63
|
};
|
71
|
-
const OtherFile = ({ file, onDownload, onMoveToSupplements
|
64
|
+
const OtherFile = ({ file, onDownload, onMoveToSupplements }) => {
|
72
65
|
const [{ isDragging }, dragRef, preview] = useDrag({
|
73
66
|
type: 'file',
|
74
67
|
item: {
|
@@ -84,9 +77,9 @@ const OtherFile = ({ file, onDownload, onMoveToSupplements, onUseAsMain }) => {
|
|
84
77
|
return (React.createElement(FileContainer, { key: file.id, "data-cy": "file-container", ref: dragRef, className: isDragging ? 'dragging' : '' },
|
85
78
|
React.createElement(FileName, { file: file }),
|
86
79
|
React.createElement(FileCreatedDate, { file: file, className: "show-on-hover" }),
|
87
|
-
React.createElement(FileActions, { sectionType: FileSectionType.OtherFile, onDownload: onDownload,
|
80
|
+
React.createElement(FileActions, { sectionType: FileSectionType.OtherFile, onDownload: onDownload, move: {
|
88
81
|
sectionType: FileSectionType.Supplements,
|
89
82
|
handler: onMoveToSupplements,
|
90
|
-
}
|
83
|
+
} })));
|
91
84
|
};
|
92
85
|
//# sourceMappingURL=OtherFilesSection.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"OtherFilesSection.js","sourceRoot":"","sources":["../../../../src/components/FileManager/OtherFilesSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,
|
1
|
+
{"version":3,"file":"OtherFilesSection.js","sourceRoot":"","sources":["../../../../src/components/FileManager/OtherFilesSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAkB,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEvD,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;AACrC,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAEzB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjB,MAAM,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAClD,IAAI,EAAE,CAAC,CAAC,I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yright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
|
-
import {
|
12
|
+
import { insertSupplement } from '@manuscripts/body-editor';
|
13
13
|
import { usePermissions } from '@manuscripts/style-guide';
|
14
14
|
import { skipTracking } from '@manuscripts/track-changes-plugin';
|
15
15
|
import React, { useEffect, useState } from 'react';
|
@@ -72,24 +72,12 @@ export const SupplementsSection = ({ supplements, }) => {
|
|
72
72
|
message: FileSectionType.OtherFile,
|
73
73
|
});
|
74
74
|
};
|
75
|
-
const handleUseAsMain = async (supplement) => {
|
76
|
-
const tr = view.state.tr;
|
77
|
-
const from = supplement.pos;
|
78
|
-
const to = from + supplement.node.nodeSize;
|
79
|
-
tr.delete(from, to);
|
80
|
-
view.dispatch(skipTracking(tr));
|
81
|
-
insertAttachment(supplement.file, view.state, 'document', view.dispatch);
|
82
|
-
setAlert({
|
83
|
-
type: FileSectionAlertType.MOVE_SUCCESSFUL,
|
84
|
-
message: FileSectionType.MainFile,
|
85
|
-
});
|
86
|
-
};
|
87
75
|
return (React.createElement(React.Fragment, null,
|
88
|
-
can?.uploadFile &&
|
76
|
+
can?.uploadFile && React.createElement(FileUploader, { onUpload: handleUpload }),
|
89
77
|
React.createElement(FileSectionAlert, { alert: alert }),
|
90
|
-
supplements.map((supplement) => (React.createElement(SupplementFile, { key: supplement.node.attrs.id, supplement: supplement, onDownload: () => fileManagement.download(supplement.file), onReplace: async (f) => await handleReplace(supplement, f), onDetach: () => handleMoveToOtherFiles(supplement)
|
78
|
+
supplements.map((supplement) => (React.createElement(SupplementFile, { key: supplement.node.attrs.id, supplement: supplement, onDownload: () => fileManagement.download(supplement.file), onReplace: async (f) => await handleReplace(supplement, f), onDetach: () => handleMoveToOtherFiles(supplement) })))));
|
91
79
|
};
|
92
|
-
const SupplementFile = ({ supplement, onDownload, onReplace, onDetach
|
80
|
+
const SupplementFile = ({ supplement, onDownload, onReplace, onDetach }) => {
|
93
81
|
const [{ isDragging }, dragRef, preview] = useDrag({
|
94
82
|
type: 'file',
|
95
83
|
item: {
|
@@ -115,6 +103,6 @@ const SupplementFile = ({ supplement, onDownload, onReplace, onDetach, onUseAsMa
|
|
115
103
|
sectionType: FileSectionType.OtherFile,
|
116
104
|
handler: onDetach,
|
117
105
|
}
|
118
|
-
: undefined
|
106
|
+
: undefined })));
|
119
107
|
};
|
120
108
|
//# sourceMappingURL=SupplementsSection.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SupplementsSection.js","sourceRoot":"","sources":["../../../../src/components/FileManager/SupplementsSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,
|
1
|
+
{"version":3,"file":"SupplementsSection.js","sourceRoot":"","sources":["../../../../src/components/FileManager/SupplementsSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,gBAAgB,EAAY,MAAM,0BAA0B,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAChE,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEvD,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,EAAW,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC3E,OAAO,EAAE,YAAY,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ACxC,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EACpD,SAAS,EAAE,SAAS,EACpB,IAAI,EACF,UAAU,CAAC,IAAI;gBACb,CAAC,CAAC;oBACE,WAAW,EAAE,eAAe,CAAC,SAAS;oBACtC,OAAO,EAAE,QAAQ;iBAClB;gBACH,CAAC,CAAC,SAAS,GAEf,CACY,CACjB,CAAA;AACH,CAAC,CAAA"}
|
@@ -1,15 +1,3 @@
|
|
1
|
-
/*!
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
-
*
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
-
*
|
6
|
-
* The Original Code is manuscripts-frontend.
|
7
|
-
*
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
-
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
import { FileAttachment } from '@manuscripts/body-editor';
|
13
1
|
import React from 'react';
|
14
2
|
import { FileSectionType, Move, Replace } from './FileManager';
|
15
3
|
/**
|
@@ -20,11 +8,8 @@ export declare const FileActions: React.FC<{
|
|
20
8
|
onDownload?: () => void;
|
21
9
|
onReplace?: Replace;
|
22
10
|
onDetach?: () => void;
|
23
|
-
onUseAsMain?: () => void;
|
24
11
|
move?: Move;
|
25
12
|
className?: string;
|
26
|
-
file?: FileAttachment;
|
27
|
-
accept?: string;
|
28
13
|
}>;
|
29
14
|
export declare const ActionsIcon: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
30
15
|
export declare const FileActionDropdownList: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
@@ -2,8 +2,7 @@ import React from 'react';
|
|
2
2
|
export declare enum FileSectionType {
|
3
3
|
Inline = "Inline files",
|
4
4
|
Supplements = "Supplements",
|
5
|
-
OtherFile = "Other files"
|
6
|
-
MainFile = "Main Document"
|
5
|
+
OtherFile = "Other files"
|
7
6
|
}
|
8
7
|
export type Replace = (file: File) => Promise<void>;
|
9
8
|
export type Move = {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@manuscripts/article-editor",
|
3
|
-
"version": "3.8.13-LEAN-
|
3
|
+
"version": "3.8.13-LEAN-4439.0",
|
4
4
|
"license": "CPAL-1.0",
|
5
5
|
"description": "React components for editing and viewing manuscripts",
|
6
6
|
"repository": "github:Atypon-OpenSource/manuscripts-article-editor",
|
@@ -35,12 +35,12 @@
|
|
35
35
|
"@fontsource/lato": "^4.5.10",
|
36
36
|
"@fontsource/pt-sans": "^4.5.11",
|
37
37
|
"@fontsource/pt-serif": "^4.5.11",
|
38
|
-
"@manuscripts/body-editor": "2.8.13-LEAN-
|
38
|
+
"@manuscripts/body-editor": "2.8.13-LEAN-4439.0",
|
39
39
|
"@manuscripts/json-schema": "2.2.11",
|
40
40
|
"@manuscripts/library": "1.3.11",
|
41
41
|
"@manuscripts/style-guide": "2.1.6",
|
42
42
|
"@manuscripts/track-changes-plugin": "1.10.0",
|
43
|
-
"@manuscripts/transform": "3.0.
|
43
|
+
"@manuscripts/transform": "3.0.47-LEAN-4439.0",
|
44
44
|
"@popperjs/core": "^2.11.8",
|
45
45
|
"@types/use-sync-external-store": "^0.0.6",
|
46
46
|
"autotrack": "^2.4.1",
|
@@ -1,183 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
-
};
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
exports.MainFilesSection = void 0;
|
30
|
-
/*!
|
31
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
32
|
-
*
|
33
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
34
|
-
*
|
35
|
-
* The Original Code is manuscripts-frontend.
|
36
|
-
*
|
37
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
38
|
-
*
|
39
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2025 Atypon Systems LLC. All Rights Reserved.
|
40
|
-
*/
|
41
|
-
const body_editor_1 = require("@manuscripts/body-editor");
|
42
|
-
const style_guide_1 = require("@manuscripts/style-guide");
|
43
|
-
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
44
|
-
const react_1 = __importStar(require("react"));
|
45
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
46
|
-
const store_1 = require("../../store");
|
47
|
-
const FileActions_1 = require("./FileActions");
|
48
|
-
const FileManager_1 = require("./FileManager");
|
49
|
-
const FileSectionAlert_1 = require("./FileSectionAlert");
|
50
|
-
const FileUploader_1 = require("./FileUploader");
|
51
|
-
const MainDocumentContainer = styled_components_1.default.div `
|
52
|
-
display: flex;
|
53
|
-
align-items: center;
|
54
|
-
padding: 26px 16px;
|
55
|
-
gap: 12px;
|
56
|
-
position: relative;
|
57
|
-
&:hover {
|
58
|
-
background-color: #f2fbfc;
|
59
|
-
}
|
60
|
-
`;
|
61
|
-
const MainDocumentInfo = styled_components_1.default.div `
|
62
|
-
display: flex;
|
63
|
-
flex: 1;
|
64
|
-
`;
|
65
|
-
const MainDocumentTitle = styled_components_1.default.div `
|
66
|
-
color: ${(props) => props.theme.colors.text.primary};
|
67
|
-
font-weight: 700;
|
68
|
-
display: flex;
|
69
|
-
align-items: center;
|
70
|
-
margin-top: 20px;
|
71
|
-
padding: 0 16px 8px 16px;
|
72
|
-
gap: 12px;
|
73
|
-
position: relative;
|
74
|
-
`;
|
75
|
-
const Label = styled_components_1.default.span `
|
76
|
-
color: ${(props) => props.theme.colors.text.primary};
|
77
|
-
font-size: 16px;
|
78
|
-
margin-right: 3.2px;
|
79
|
-
font-weight: 700;
|
80
|
-
`;
|
81
|
-
const FileName = styled_components_1.default.span `
|
82
|
-
color: ${(props) => props.theme.colors.text.primary};
|
83
|
-
font-size: 16px;
|
84
|
-
`;
|
85
|
-
const MainFilesSection = ({ mainDocument, }) => {
|
86
|
-
const [{ fileManagement, view }] = (0, store_1.useStore)((s) => ({
|
87
|
-
fileManagement: s.fileManagement,
|
88
|
-
view: s.view,
|
89
|
-
}));
|
90
|
-
const can = (0, style_guide_1.usePermissions)();
|
91
|
-
const [alert, setAlert] = (0, react_1.useState)({
|
92
|
-
type: FileSectionAlert_1.FileSectionAlertType.NONE,
|
93
|
-
message: '',
|
94
|
-
});
|
95
|
-
const [isConfirmDialogOpen, setConfirmDialogOpen] = (0, react_1.useState)(false);
|
96
|
-
const [fileToUpload, setFileToUpload] = (0, react_1.useState)(null);
|
97
|
-
const handleUpload = async (file) => {
|
98
|
-
if (mainDocument) {
|
99
|
-
setFileToUpload(file);
|
100
|
-
setConfirmDialogOpen(true);
|
101
|
-
}
|
102
|
-
else {
|
103
|
-
await uploadFile(file);
|
104
|
-
}
|
105
|
-
};
|
106
|
-
if (!view) {
|
107
|
-
return null;
|
108
|
-
}
|
109
|
-
const uploadFile = async (file) => {
|
110
|
-
setAlert({
|
111
|
-
type: FileSectionAlert_1.FileSectionAlertType.UPLOAD_IN_PROGRESS,
|
112
|
-
message: file.name,
|
113
|
-
});
|
114
|
-
const uploaded = await fileManagement.upload(file);
|
115
|
-
(0, body_editor_1.insertAttachment)(uploaded, view.state, 'document', view.dispatch);
|
116
|
-
setAlert({
|
117
|
-
type: FileSectionAlert_1.FileSectionAlertType.UPLOAD_SUCCESSFUL,
|
118
|
-
message: '',
|
119
|
-
});
|
120
|
-
return uploaded;
|
121
|
-
};
|
122
|
-
const handleDownload = () => {
|
123
|
-
if (mainDocument) {
|
124
|
-
fileManagement.download(mainDocument.file);
|
125
|
-
}
|
126
|
-
};
|
127
|
-
const handleReplace = async (file) => {
|
128
|
-
setFileToUpload(file);
|
129
|
-
setConfirmDialogOpen(true);
|
130
|
-
};
|
131
|
-
const handleMove = (mainFile) => {
|
132
|
-
const tr = view.state.tr;
|
133
|
-
const from = mainFile.pos;
|
134
|
-
const to = from + mainFile.node.nodeSize;
|
135
|
-
tr.delete(from, to);
|
136
|
-
view.dispatch((0, track_changes_plugin_1.skipTracking)(tr));
|
137
|
-
setAlert({
|
138
|
-
type: FileSectionAlert_1.FileSectionAlertType.MOVE_SUCCESSFUL,
|
139
|
-
message: FileManager_1.FileSectionType.OtherFile,
|
140
|
-
});
|
141
|
-
};
|
142
|
-
return (react_1.default.createElement("div", null,
|
143
|
-
mainDocument ? (react_1.default.createElement(MainDocumentContainer, { "data-cy": "file-container" },
|
144
|
-
react_1.default.createElement(style_guide_1.FileMainDocumentIcon, null),
|
145
|
-
react_1.default.createElement(MainDocumentInfo, null,
|
146
|
-
react_1.default.createElement(Label, null, "Main:"),
|
147
|
-
react_1.default.createElement(FileName, null, mainDocument.file.name)),
|
148
|
-
react_1.default.createElement(FileActions_1.FileActions, { "data-cy": "file-actions", sectionType: FileManager_1.FileSectionType.MainFile, onDownload: handleDownload, onReplace: handleReplace, move: {
|
149
|
-
sectionType: FileManager_1.FileSectionType.OtherFile,
|
150
|
-
handler: () => handleMove(mainDocument),
|
151
|
-
}, file: mainDocument.file, accept: ".docx, .doc, .pdf, .xml, .tex" }))) : (can?.uploadFile && (react_1.default.createElement(MainDocumentTitle, null, "Upload main document"))),
|
152
|
-
can?.uploadFile && (react_1.default.createElement(FileUploader_1.FileUploader, { onUpload: handleUpload, placeholder: "Drag or click to replace with a new file", accept: ".docx, .doc, .pdf, .xml, .tex" })),
|
153
|
-
react_1.default.createElement(FileSectionAlert_1.FileSectionAlert, { alert: alert }),
|
154
|
-
react_1.default.createElement(style_guide_1.Dialog, { isOpen: isConfirmDialogOpen, category: style_guide_1.Category.confirmation, header: "Replace Main Document", message: react_1.default.createElement(react_1.default.Fragment, null,
|
155
|
-
"This action will replace the current main document file with this one!",
|
156
|
-
react_1.default.createElement("br", null),
|
157
|
-
react_1.default.createElement("br", null),
|
158
|
-
"Do you want to continue?"), actions: {
|
159
|
-
primary: {
|
160
|
-
action: async () => {
|
161
|
-
if (fileToUpload) {
|
162
|
-
const uploaded = await fileManagement.upload(fileToUpload);
|
163
|
-
(0, body_editor_1.insertAttachment)(uploaded, view.state, 'document', view.dispatch);
|
164
|
-
}
|
165
|
-
setConfirmDialogOpen(false);
|
166
|
-
setAlert({
|
167
|
-
type: FileSectionAlert_1.FileSectionAlertType.REPLACE_SUCCESSFUL,
|
168
|
-
message: FileManager_1.FileSectionType.MainFile,
|
169
|
-
});
|
170
|
-
},
|
171
|
-
title: 'Replace',
|
172
|
-
},
|
173
|
-
secondary: {
|
174
|
-
action: () => {
|
175
|
-
setFileToUpload(null);
|
176
|
-
setConfirmDialogOpen(false);
|
177
|
-
},
|
178
|
-
title: 'Cancel',
|
179
|
-
},
|
180
|
-
} })));
|
181
|
-
};
|
182
|
-
exports.MainFilesSection = MainFilesSection;
|
183
|
-
//# sourceMappingURL=MainFilesSection.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"MainFilesSection.js","sourceRoot":"","sources":["../../../../src/components/FileManager/MainFilesSection.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,0DAAqE;AACrE,0DAKiC;AACjC,4EAAgE;AAChE,+CAAuC;AACvC,0EAAsC;AAEtC,uCAAsC;AACtC,+CAA2C;AAC3C,+CAA+C;AAC/C,yDAA2E;AAC3E,iDAA6C;AAE7C,MAAM,qBAAqB,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;;;;CASvC,CAAA;AAED,MAAM,gBAAgB,GAAG,2BAAM,CAAC,GAAG,CAAA;;;CAGlC,CAAA;AAED,MAAM,iBAAiB,GAAG,2BAAM,CAAC,GAAG,CAAA;WACzB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO;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M,CAAC,YAAY,CAAC,CAAA;4BAC1D,IAAA,8BAAgB,EACd,QAAQ,EACR,IAAI,CAAC,KAAK,EACV,UAAU,EACV,IAAI,CAAC,QAAQ,CACd,CAAA;yBACF;wBACD,oBAAoB,CAAC,KAAK,CAAC,CAAA;wBAC3B,QAAQ,CAAC;4BACP,IAAI,EAAE,uCAAoB,CAAC,kBAAkB;4BAC7C,OAAO,EAAE,6BAAe,CAAC,QAAQ;yBAClC,CAAC,CAAA;oBACJ,CAAC;oBACD,KAAK,EAAE,SAAS;iBACjB;gBACD,SAAS,EAAE;oBACT,MAAM,EAAE,GAAG,EAAE;wBACX,eAAe,CAAC,IAAI,CAAC,CAAA;wBACrB,oBAAoB,CAAC,KAAK,CAAC,CAAA;oBAC7B,CAAC;oBACD,KAAK,EAAE,QAAQ;iBAChB;aACF,GACD,CACE,CACP,CAAA;AACH,CAAC,CAAA;AAlJY,QAAA,gBAAgB,oBAkJ5B"}
|
@@ -1,153 +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) 2025 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
import { insertAttachment } from '@manuscripts/body-editor';
|
13
|
-
import { Category, Dialog, FileMainDocumentIcon, usePermissions, } from '@manuscripts/style-guide';
|
14
|
-
import { skipTracking } from '@manuscripts/track-changes-plugin';
|
15
|
-
import React, { useState } from 'react';
|
16
|
-
import styled from 'styled-components';
|
17
|
-
import { useStore } from '../../store';
|
18
|
-
import { FileActions } from './FileActions';
|
19
|
-
import { FileSectionType } from './FileManager';
|
20
|
-
import { FileSectionAlert, FileSectionAlertType } from './FileSectionAlert';
|
21
|
-
import { FileUploader } from './FileUploader';
|
22
|
-
const MainDocumentContainer = styled.div `
|
23
|
-
display: flex;
|
24
|
-
align-items: center;
|
25
|
-
padding: 26px 16px;
|
26
|
-
gap: 12px;
|
27
|
-
position: relative;
|
28
|
-
&:hover {
|
29
|
-
background-color: #f2fbfc;
|
30
|
-
}
|
31
|
-
`;
|
32
|
-
const MainDocumentInfo = styled.div `
|
33
|
-
display: flex;
|
34
|
-
flex: 1;
|
35
|
-
`;
|
36
|
-
const MainDocumentTitle = styled.div `
|
37
|
-
color: ${(props) => props.theme.colors.text.primary};
|
38
|
-
font-weight: 700;
|
39
|
-
display: flex;
|
40
|
-
align-items: center;
|
41
|
-
margin-top: 20px;
|
42
|
-
padding: 0 16px 8px 16px;
|
43
|
-
gap: 12px;
|
44
|
-
position: relative;
|
45
|
-
`;
|
46
|
-
const Label = styled.span `
|
47
|
-
color: ${(props) => props.theme.colors.text.primary};
|
48
|
-
font-size: 16px;
|
49
|
-
margin-right: 3.2px;
|
50
|
-
font-weight: 700;
|
51
|
-
`;
|
52
|
-
const FileName = styled.span `
|
53
|
-
color: ${(props) => props.theme.colors.text.primary};
|
54
|
-
font-size: 16px;
|
55
|
-
`;
|
56
|
-
export const MainFilesSection = ({ mainDocument, }) => {
|
57
|
-
const [{ fileManagement, view }] = useStore((s) => ({
|
58
|
-
fileManagement: s.fileManagement,
|
59
|
-
view: s.view,
|
60
|
-
}));
|
61
|
-
const can = usePermissions();
|
62
|
-
const [alert, setAlert] = useState({
|
63
|
-
type: FileSectionAlertType.NONE,
|
64
|
-
message: '',
|
65
|
-
});
|
66
|
-
const [isConfirmDialogOpen, setConfirmDialogOpen] = useState(false);
|
67
|
-
const [fileToUpload, setFileToUpload] = useState(null);
|
68
|
-
const handleUpload = async (file) => {
|
69
|
-
if (mainDocument) {
|
70
|
-
setFileToUpload(file);
|
71
|
-
setConfirmDialogOpen(true);
|
72
|
-
}
|
73
|
-
else {
|
74
|
-
await uploadFile(file);
|
75
|
-
}
|
76
|
-
};
|
77
|
-
if (!view) {
|
78
|
-
return null;
|
79
|
-
}
|
80
|
-
const uploadFile = async (file) => {
|
81
|
-
setAlert({
|
82
|
-
type: FileSectionAlertType.UPLOAD_IN_PROGRESS,
|
83
|
-
message: file.name,
|
84
|
-
});
|
85
|
-
const uploaded = await fileManagement.upload(file);
|
86
|
-
insertAttachment(uploaded, view.state, 'document', view.dispatch);
|
87
|
-
setAlert({
|
88
|
-
type: FileSectionAlertType.UPLOAD_SUCCESSFUL,
|
89
|
-
message: '',
|
90
|
-
});
|
91
|
-
return uploaded;
|
92
|
-
};
|
93
|
-
const handleDownload = () => {
|
94
|
-
if (mainDocument) {
|
95
|
-
fileManagement.download(mainDocument.file);
|
96
|
-
}
|
97
|
-
};
|
98
|
-
const handleReplace = async (file) => {
|
99
|
-
setFileToUpload(file);
|
100
|
-
setConfirmDialogOpen(true);
|
101
|
-
};
|
102
|
-
const handleMove = (mainFile) => {
|
103
|
-
const tr = view.state.tr;
|
104
|
-
const from = mainFile.pos;
|
105
|
-
const to = from + mainFile.node.nodeSize;
|
106
|
-
tr.delete(from, to);
|
107
|
-
view.dispatch(skipTracking(tr));
|
108
|
-
setAlert({
|
109
|
-
type: FileSectionAlertType.MOVE_SUCCESSFUL,
|
110
|
-
message: FileSectionType.OtherFile,
|
111
|
-
});
|
112
|
-
};
|
113
|
-
return (React.createElement("div", null,
|
114
|
-
mainDocument ? (React.createElement(MainDocumentContainer, { "data-cy": "file-container" },
|
115
|
-
React.createElement(FileMainDocumentIcon, null),
|
116
|
-
React.createElement(MainDocumentInfo, null,
|
117
|
-
React.createElement(Label, null, "Main:"),
|
118
|
-
React.createElement(FileName, null, mainDocument.file.name)),
|
119
|
-
React.createElement(FileActions, { "data-cy": "file-actions", sectionType: FileSectionType.MainFile, onDownload: handleDownload, onReplace: handleReplace, move: {
|
120
|
-
sectionType: FileSectionType.OtherFile,
|
121
|
-
handler: () => handleMove(mainDocument),
|
122
|
-
}, file: mainDocument.file, accept: ".docx, .doc, .pdf, .xml, .tex" }))) : (can?.uploadFile && (React.createElement(MainDocumentTitle, null, "Upload main document"))),
|
123
|
-
can?.uploadFile && (React.createElement(FileUploader, { onUpload: handleUpload, placeholder: "Drag or click to replace with a new file", accept: ".docx, .doc, .pdf, .xml, .tex" })),
|
124
|
-
React.createElement(FileSectionAlert, { alert: alert }),
|
125
|
-
React.createElement(Dialog, { isOpen: isConfirmDialogOpen, category: Category.confirmation, header: "Replace Main Document", message: React.createElement(React.Fragment, null,
|
126
|
-
"This action will replace the current main document file with this one!",
|
127
|
-
React.createElement("br", null),
|
128
|
-
React.createElement("br", null),
|
129
|
-
"Do you want to continue?"), actions: {
|
130
|
-
primary: {
|
131
|
-
action: async () => {
|
132
|
-
if (fileToUpload) {
|
133
|
-
const uploaded = await fileManagement.upload(fileToUpload);
|
134
|
-
insertAttachment(uploaded, view.state, 'document', view.dispatch);
|
135
|
-
}
|
136
|
-
setConfirmDialogOpen(false);
|
137
|
-
setAlert({
|
138
|
-
type: FileSectionAlertType.REPLACE_SUCCESSFUL,
|
139
|
-
message: FileSectionType.MainFile,
|
140
|
-
});
|
141
|
-
},
|
142
|
-
title: 'Replace',
|
143
|
-
},
|
144
|
-
secondary: {
|
145
|
-
action: () => {
|
146
|
-
setFileToUpload(null);
|
147
|
-
setConfirmDialogOpen(false);
|
148
|
-
},
|
149
|
-
title: 'Cancel',
|
150
|
-
},
|
151
|
-
} })));
|
152
|
-
};
|
153
|
-
//# sourceMappingURL=MainFilesSection.js.map
|
@@ -1 +0,0 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S;iBACjB;gBACD,SAAS,EAAE;oBACT,MAAM,EAAE,GAAG,EAAE;wBACX,eAAe,CAAC,IAAI,CAAC,CAAA;wBACrB,oBAAoB,CAAC,KAAK,CAAC,CAAA;oBAC7B,CAAC;oBACD,KAAK,EAAE,QAAQ;iBAChB;aACF,GACD,CACE,CACP,CAAA;AACH,CAAC,CAAA"}
|
@@ -1,16 +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) 2025 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
import { NodeFile } from '@manuscripts/body-editor';
|
13
|
-
import React from 'react';
|
14
|
-
export declare const MainFilesSection: React.FC<{
|
15
|
-
mainDocument: NodeFile;
|
16
|
-
}>;
|