@manuscripts/style-guide 1.7.11 → 1.8.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/components/{FileManager/DragLayer.js → DragLayer.js} +26 -50
- package/dist/cjs/components/FileManager/FileManager.js +1 -1
- package/dist/cjs/components/icons/index.js +3 -1
- package/dist/cjs/index.js +2 -6
- package/dist/cjs/lib/capabilities.js +1 -1
- package/dist/es/components/{FileManager/DragLayer.js → DragLayer.js} +26 -27
- package/dist/es/components/FileManager/FileManager.js +1 -1
- package/dist/es/components/icons/index.js +1 -0
- package/dist/es/index.js +2 -6
- package/dist/es/lib/capabilities.js +1 -1
- package/dist/types/components/AlertMessage.d.ts +1 -1
- package/dist/types/components/Button.d.ts +9 -9
- package/dist/types/components/EditorHeader/EditorHeader.d.ts +1 -1
- package/dist/types/components/InspectorSection.d.ts +1 -1
- package/dist/types/components/NavDropdown.d.ts +1 -1
- package/dist/types/components/StyledModal.d.ts +1 -1
- package/dist/types/components/icons/index.d.ts +1 -0
- package/dist/types/index.d.ts +2 -6
- package/dist/types/lib/capabilities.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditor.js +0 -62
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorItem.js +0 -176
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorProfile.js +0 -62
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorView.js +0 -80
- package/dist/cjs/components/AffiliationsEditor/index.js +0 -25
- package/dist/cjs/components/AffiliationsEditor/styles.js +0 -56
- package/dist/cjs/components/AuthorForm/AuthorForm.js +0 -99
- package/dist/cjs/components/AuthorForm/AuthorFormComponents.js +0 -63
- package/dist/cjs/components/AuthorForm/ContributorRolesSelect.js +0 -100
- package/dist/cjs/components/AuthorForm/RemoveAuthorButton.js +0 -45
- package/dist/cjs/components/AuthorForm/index.js +0 -32
- package/dist/cjs/components/AuthorName.js +0 -52
- package/dist/cjs/components/AuthorsDND/AuthorItemComponents.js +0 -22
- package/dist/cjs/components/AuthorsDND/AuthorsDND.js +0 -68
- package/dist/cjs/components/AuthorsDND/DraggableAuthorItem.js +0 -197
- package/dist/cjs/components/AuthorsDND/index.js +0 -23
- package/dist/cjs/lib/authors.js +0 -110
- package/dist/cjs/lib/formatAddress.js +0 -31
- package/dist/cjs/lib/name.js +0 -26
- package/dist/cjs/types.js +0 -17
- package/dist/es/components/AffiliationsEditor/AffiliationsEditor.js +0 -34
- package/dist/es/components/AffiliationsEditor/AffiliationsEditorItem.js +0 -146
- package/dist/es/components/AffiliationsEditor/AffiliationsEditorProfile.js +0 -34
- package/dist/es/components/AffiliationsEditor/AffiliationsEditorView.js +0 -52
- package/dist/es/components/AffiliationsEditor/index.js +0 -17
- package/dist/es/components/AffiliationsEditor/styles.js +0 -49
- package/dist/es/components/AuthorForm/AuthorForm.js +0 -92
- package/dist/es/components/AuthorForm/AuthorFormComponents.js +0 -57
- package/dist/es/components/AuthorForm/ContributorRolesSelect.js +0 -70
- package/dist/es/components/AuthorForm/RemoveAuthorButton.js +0 -40
- package/dist/es/components/AuthorForm/index.js +0 -16
- package/dist/es/components/AuthorName.js +0 -23
- package/dist/es/components/AuthorsDND/AuthorItemComponents.js +0 -19
- package/dist/es/components/AuthorsDND/AuthorsDND.js +0 -40
- package/dist/es/components/AuthorsDND/DraggableAuthorItem.js +0 -192
- package/dist/es/components/AuthorsDND/index.js +0 -16
- package/dist/es/lib/authors.js +0 -98
- package/dist/es/lib/formatAddress.js +0 -29
- package/dist/es/lib/name.js +0 -22
- package/dist/es/types.js +0 -16
- package/dist/types/components/AffiliationsEditor/AffiliationsEditor.d.ts +0 -31
- package/dist/types/components/AffiliationsEditor/AffiliationsEditorItem.d.ts +0 -26
- package/dist/types/components/AffiliationsEditor/AffiliationsEditorProfile.d.ts +0 -30
- package/dist/types/components/AffiliationsEditor/AffiliationsEditorView.d.ts +0 -34
- package/dist/types/components/AffiliationsEditor/index.d.ts +0 -17
- package/dist/types/components/AffiliationsEditor/styles.d.ts +0 -23
- package/dist/types/components/AuthorForm/AuthorForm.d.ts +0 -29
- package/dist/types/components/AuthorForm/AuthorFormComponents.d.ts +0 -31
- package/dist/types/components/AuthorForm/ContributorRolesSelect.d.ts +0 -23
- package/dist/types/components/AuthorForm/RemoveAuthorButton.d.ts +0 -27
- package/dist/types/components/AuthorForm/index.d.ts +0 -16
- package/dist/types/components/AuthorName.d.ts +0 -22
- package/dist/types/components/AuthorsDND/AuthorItemComponents.d.ts +0 -24
- package/dist/types/components/AuthorsDND/AuthorsDND.d.ts +0 -28
- package/dist/types/components/AuthorsDND/DraggableAuthorItem.d.ts +0 -50
- package/dist/types/components/AuthorsDND/index.d.ts +0 -16
- package/dist/types/lib/authors.d.ts +0 -30
- package/dist/types/lib/formatAddress.d.ts +0 -18
- package/dist/types/lib/name.d.ts +0 -17
- package/dist/types/types.d.ts +0 -80
- /package/dist/types/components/{FileManager/DragLayer.d.ts → DragLayer.d.ts} +0 -0
|
@@ -1,40 +1,32 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
exports.DragLayer = void 0;
|
|
30
|
-
const react_1 =
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
31
8
|
const react_dnd_1 = require("react-dnd");
|
|
32
9
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
33
|
-
const FileContainer_1 = require("./FileContainer");
|
|
34
|
-
const FileCreatedDate_1 = require("./FileCreatedDate");
|
|
35
|
-
const FileName_1 = require("./FileName");
|
|
36
|
-
|
|
37
|
-
|
|
10
|
+
const FileContainer_1 = require("./FileManager/FileContainer");
|
|
11
|
+
const FileCreatedDate_1 = require("./FileManager/FileCreatedDate");
|
|
12
|
+
const FileName_1 = require("./FileManager/FileName");
|
|
13
|
+
const Container = styled_components_1.default.div `
|
|
14
|
+
position: fixed;
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
z-index: 999;
|
|
17
|
+
left: 0;
|
|
18
|
+
top: 0;
|
|
19
|
+
max-width: 400px;
|
|
20
|
+
`;
|
|
21
|
+
const DraggableFileContainer = (0, styled_components_1.default)(FileContainer_1.FileContainer) `
|
|
22
|
+
padding: 16px 32px;
|
|
23
|
+
background: #f2fbfc;
|
|
24
|
+
border: 1px solid #bce7f6;
|
|
25
|
+
box-shadow: 0 4px 9px rgba(0, 0, 0, 0.3);
|
|
26
|
+
border-radius: 6px;
|
|
27
|
+
`;
|
|
28
|
+
const getItemStyles = (currentOffset) => {
|
|
29
|
+
if (!currentOffset) {
|
|
38
30
|
return {
|
|
39
31
|
display: 'none',
|
|
40
32
|
};
|
|
@@ -45,16 +37,15 @@ function getItemStyles(initialOffset, currentOffset) {
|
|
|
45
37
|
transform,
|
|
46
38
|
WebkitTransform: transform,
|
|
47
39
|
};
|
|
48
|
-
}
|
|
40
|
+
};
|
|
49
41
|
const DragLayer = () => {
|
|
50
|
-
const { itemType, isDragging, item,
|
|
42
|
+
const { itemType, isDragging, item, currentOffset } = (0, react_dnd_1.useDragLayer)((monitor) => ({
|
|
51
43
|
item: monitor.getItem(),
|
|
52
44
|
itemType: monitor.getItemType(),
|
|
53
|
-
initialOffset: monitor.getInitialSourceClientOffset(),
|
|
54
45
|
currentOffset: monitor.getSourceClientOffset(),
|
|
55
46
|
isDragging: monitor.isDragging(),
|
|
56
47
|
}));
|
|
57
|
-
const renderItem = (
|
|
48
|
+
const renderItem = () => {
|
|
58
49
|
switch (itemType) {
|
|
59
50
|
case 'file':
|
|
60
51
|
return (react_1.default.createElement(DraggableFileContainer, null,
|
|
@@ -63,25 +54,10 @@ const DragLayer = () => {
|
|
|
63
54
|
default:
|
|
64
55
|
return null;
|
|
65
56
|
}
|
|
66
|
-
}
|
|
57
|
+
};
|
|
67
58
|
if (!isDragging) {
|
|
68
59
|
return null;
|
|
69
60
|
}
|
|
70
|
-
return (react_1.default.createElement(Container, { style: getItemStyles(
|
|
61
|
+
return (react_1.default.createElement(Container, { style: getItemStyles(currentOffset) }, renderItem()));
|
|
71
62
|
};
|
|
72
63
|
exports.DragLayer = DragLayer;
|
|
73
|
-
const Container = styled_components_1.default.div `
|
|
74
|
-
position: fixed;
|
|
75
|
-
pointer-events: none;
|
|
76
|
-
z-index: 999;
|
|
77
|
-
left: 0;
|
|
78
|
-
top: 0;
|
|
79
|
-
max-width: 400px;
|
|
80
|
-
`;
|
|
81
|
-
const DraggableFileContainer = (0, styled_components_1.default)(FileContainer_1.FileContainer) `
|
|
82
|
-
padding: 16px 32px;
|
|
83
|
-
background: #f2fbfc;
|
|
84
|
-
border: 1px solid #bce7f6;
|
|
85
|
-
box-shadow: 0 4px 9px rgba(0, 0, 0, 0.3);
|
|
86
|
-
border-radius: 6px;
|
|
87
|
-
`;
|
|
@@ -26,10 +26,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.FileManager = exports.PermissionsContext = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
const index_1 = require("../../index");
|
|
29
|
+
const DragLayer_1 = require("../DragLayer");
|
|
29
30
|
const Inspector_1 = require("../Inspector");
|
|
30
31
|
const InspectorSection_1 = require("../InspectorSection");
|
|
31
32
|
const Tooltip_1 = require("../Tooltip");
|
|
32
|
-
const DragLayer_1 = require("./DragLayer");
|
|
33
33
|
const FileManagerProvider_1 = require("./FileManagerProvider");
|
|
34
34
|
const InlineFilesSection_1 = require("./InlineFilesSection");
|
|
35
35
|
const OtherFilesSection_1 = require("./OtherFilesSection");
|
|
@@ -18,7 +18,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.PlusIcon = exports.PullQuoteIcon = exports.BlockQuoteIcon = exports.LeftArrow = exports.AnnotatorIcon = exports.ReadingIcon = exports.EditIcon = exports.UnsupportedFormatFileIcon = exports.MissingImage = exports.UploadIcon = exports.AttachIcon = exports.TaskStepNextIcon = exports.TaskStepDoneIcon = exports.TaskStepCurrentIcon = exports.ZoomOutIcon = exports.ZoomInIcon = exports.UserIcon = exports.TickMarkIcon = exports.SearchIcon = exports.ProjectsListIcon = exports.ProjectIcon = exports.ProjectNotificationIcon = exports.OrcidIcon = exports.GoogleIcon = exports.AddComment = exports.CloseOIcon = exports.CloseIcon = exports.BookmarkIcon = exports.BackArrowIcon = exports.AddIconInverted = exports.AddIconActive = exports.AddAuthor = void 0;
|
|
21
|
+
exports.DeleteIcon = exports.PlusIcon = exports.PullQuoteIcon = exports.BlockQuoteIcon = exports.LeftArrow = exports.AnnotatorIcon = exports.ReadingIcon = exports.EditIcon = exports.UnsupportedFormatFileIcon = exports.MissingImage = exports.UploadIcon = exports.AttachIcon = exports.TaskStepNextIcon = exports.TaskStepDoneIcon = exports.TaskStepCurrentIcon = exports.ZoomOutIcon = exports.ZoomInIcon = exports.UserIcon = exports.TickMarkIcon = exports.SearchIcon = exports.ProjectsListIcon = exports.ProjectIcon = exports.ProjectNotificationIcon = exports.OrcidIcon = exports.GoogleIcon = exports.AddComment = exports.CloseOIcon = exports.CloseIcon = exports.BookmarkIcon = exports.BackArrowIcon = exports.AddIconInverted = exports.AddIconActive = exports.AddAuthor = void 0;
|
|
22
22
|
var add_author_1 = require("./add-author");
|
|
23
23
|
Object.defineProperty(exports, "AddAuthor", { enumerable: true, get: function () { return __importDefault(add_author_1).default; } });
|
|
24
24
|
var add_icon_active_1 = require("./add-icon-active");
|
|
@@ -83,3 +83,5 @@ var pull_quote_icon_1 = require("./pull-quote-icon");
|
|
|
83
83
|
Object.defineProperty(exports, "PullQuoteIcon", { enumerable: true, get: function () { return __importDefault(pull_quote_icon_1).default; } });
|
|
84
84
|
var plus_icon_1 = require("./plus-icon");
|
|
85
85
|
Object.defineProperty(exports, "PlusIcon", { enumerable: true, get: function () { return __importDefault(plus_icon_1).default; } });
|
|
86
|
+
var delete_icon_1 = require("./delete-icon");
|
|
87
|
+
Object.defineProperty(exports, "DeleteIcon", { enumerable: true, get: function () { return delete_icon_1.DeleteIcon; } });
|
package/dist/cjs/index.js
CHANGED
|
@@ -33,10 +33,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
exports.errorsDecoder = exports.useDeepCompareCallback = exports.useDeepCompareMemo = void 0;
|
|
36
|
-
__exportStar(require("./components/AffiliationsEditor"), exports);
|
|
37
|
-
__exportStar(require("./components/AuthorForm"), exports);
|
|
38
|
-
__exportStar(require("./components/AuthorName"), exports);
|
|
39
|
-
__exportStar(require("./components/AuthorsDND"), exports);
|
|
40
36
|
__exportStar(require("./components/AlertMessage"), exports);
|
|
41
37
|
__exportStar(require("./components/Button"), exports);
|
|
42
38
|
__exportStar(require("./components/RadioButton"), exports);
|
|
@@ -51,6 +47,8 @@ __exportStar(require("./components/Resizer"), exports);
|
|
|
51
47
|
__exportStar(require("./components/SaveStatus"), exports);
|
|
52
48
|
__exportStar(require("./components/StyledModal"), exports);
|
|
53
49
|
__exportStar(require("./components/TableFootnotesSelector"), exports);
|
|
50
|
+
__exportStar(require("./components/Sidebar"), exports);
|
|
51
|
+
__exportStar(require("./components/DragLayer"), exports);
|
|
54
52
|
__exportStar(require("./components/TextField"), exports);
|
|
55
53
|
__exportStar(require("./components/TextFieldContainer"), exports);
|
|
56
54
|
__exportStar(require("./components/TextFieldError"), exports);
|
|
@@ -77,11 +75,9 @@ __exportStar(require("./hooks/use-menus"), exports);
|
|
|
77
75
|
var use_deep_compare_1 = require("./hooks/use-deep-compare");
|
|
78
76
|
Object.defineProperty(exports, "useDeepCompareMemo", { enumerable: true, get: function () { return use_deep_compare_1.useDeepCompareMemo; } });
|
|
79
77
|
Object.defineProperty(exports, "useDeepCompareCallback", { enumerable: true, get: function () { return use_deep_compare_1.useDeepCompareCallback; } });
|
|
80
|
-
__exportStar(require("./lib/authors"), exports);
|
|
81
78
|
__exportStar(require("./lib/capabilities"), exports);
|
|
82
79
|
__exportStar(require("./lib/files"), exports);
|
|
83
80
|
__exportStar(require("./lib/comments"), exports);
|
|
84
81
|
__exportStar(require("./lib/menus"), exports);
|
|
85
82
|
var errors_decoder_1 = require("./lib/errors-decoder");
|
|
86
83
|
Object.defineProperty(exports, "errorsDecoder", { enumerable: true, get: function () { return __importDefault(errors_decoder_1).default; } });
|
|
87
|
-
__exportStar(require("./types"), exports);
|
|
@@ -23,6 +23,7 @@ const getCapabilities = (project, profile, role, actions) => {
|
|
|
23
23
|
const allowed = (action) => !!(actions === null || actions === void 0 ? void 0 : actions.includes(action));
|
|
24
24
|
return {
|
|
25
25
|
handleSuggestion: isOwner() || isEditor() || isWriter(),
|
|
26
|
+
editWithoutTracking: isWriter(),
|
|
26
27
|
rejectOwnSuggestion: !isViewer(),
|
|
27
28
|
createSuggestion: !isViewer(),
|
|
28
29
|
viewSuggestion: true,
|
|
@@ -52,7 +53,6 @@ const getCapabilities = (project, profile, role, actions) => {
|
|
|
52
53
|
putOnHoldTask: isProdEditor(),
|
|
53
54
|
changeDueDate: isProdEditor() && allowed(Actions.updateDueDate),
|
|
54
55
|
previewAccess: true,
|
|
55
|
-
editNotTracked: false,
|
|
56
56
|
accessEditor: true,
|
|
57
57
|
formatArticle: !isViewer(),
|
|
58
58
|
editArticle: !isViewer(),
|
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { useDragLayer } from 'react-dnd';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import { FileContainer } from './FileContainer';
|
|
5
|
-
import { FileCreatedDate } from './FileCreatedDate';
|
|
6
|
-
import { FileName } from './FileName';
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { FileContainer } from './FileManager/FileContainer';
|
|
5
|
+
import { FileCreatedDate } from './FileManager/FileCreatedDate';
|
|
6
|
+
import { FileName } from './FileManager/FileName';
|
|
7
|
+
const Container = styled.div `
|
|
8
|
+
position: fixed;
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
z-index: 999;
|
|
11
|
+
left: 0;
|
|
12
|
+
top: 0;
|
|
13
|
+
max-width: 400px;
|
|
14
|
+
`;
|
|
15
|
+
const DraggableFileContainer = styled(FileContainer) `
|
|
16
|
+
padding: 16px 32px;
|
|
17
|
+
background: #f2fbfc;
|
|
18
|
+
border: 1px solid #bce7f6;
|
|
19
|
+
box-shadow: 0 4px 9px rgba(0, 0, 0, 0.3);
|
|
20
|
+
border-radius: 6px;
|
|
21
|
+
`;
|
|
22
|
+
const getItemStyles = (currentOffset) => {
|
|
23
|
+
if (!currentOffset) {
|
|
9
24
|
return {
|
|
10
25
|
display: 'none',
|
|
11
26
|
};
|
|
@@ -16,16 +31,15 @@ function getItemStyles(initialOffset, currentOffset) {
|
|
|
16
31
|
transform,
|
|
17
32
|
WebkitTransform: transform,
|
|
18
33
|
};
|
|
19
|
-
}
|
|
34
|
+
};
|
|
20
35
|
export const DragLayer = () => {
|
|
21
|
-
const { itemType, isDragging, item,
|
|
36
|
+
const { itemType, isDragging, item, currentOffset } = useDragLayer((monitor) => ({
|
|
22
37
|
item: monitor.getItem(),
|
|
23
38
|
itemType: monitor.getItemType(),
|
|
24
|
-
initialOffset: monitor.getInitialSourceClientOffset(),
|
|
25
39
|
currentOffset: monitor.getSourceClientOffset(),
|
|
26
40
|
isDragging: monitor.isDragging(),
|
|
27
41
|
}));
|
|
28
|
-
const renderItem =
|
|
42
|
+
const renderItem = () => {
|
|
29
43
|
switch (itemType) {
|
|
30
44
|
case 'file':
|
|
31
45
|
return (React.createElement(DraggableFileContainer, null,
|
|
@@ -34,24 +48,9 @@ export const DragLayer = () => {
|
|
|
34
48
|
default:
|
|
35
49
|
return null;
|
|
36
50
|
}
|
|
37
|
-
}
|
|
51
|
+
};
|
|
38
52
|
if (!isDragging) {
|
|
39
53
|
return null;
|
|
40
54
|
}
|
|
41
|
-
return (React.createElement(Container, { style: getItemStyles(
|
|
55
|
+
return (React.createElement(Container, { style: getItemStyles(currentOffset) }, renderItem()));
|
|
42
56
|
};
|
|
43
|
-
const Container = styled.div `
|
|
44
|
-
position: fixed;
|
|
45
|
-
pointer-events: none;
|
|
46
|
-
z-index: 999;
|
|
47
|
-
left: 0;
|
|
48
|
-
top: 0;
|
|
49
|
-
max-width: 400px;
|
|
50
|
-
`;
|
|
51
|
-
const DraggableFileContainer = styled(FileContainer) `
|
|
52
|
-
padding: 16px 32px;
|
|
53
|
-
background: #f2fbfc;
|
|
54
|
-
border: 1px solid #bce7f6;
|
|
55
|
-
box-shadow: 0 4px 9px rgba(0, 0, 0, 0.3);
|
|
56
|
-
border-radius: 6px;
|
|
57
|
-
`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { createContext } from 'react';
|
|
2
2
|
import { useFiles } from '../../index';
|
|
3
|
+
import { DragLayer } from '../DragLayer';
|
|
3
4
|
import { InspectorTab, InspectorTabList, InspectorTabPanel, InspectorTabPanels, InspectorTabs, } from '../Inspector';
|
|
4
5
|
import { InspectorSection } from '../InspectorSection';
|
|
5
6
|
import { Tooltip } from '../Tooltip';
|
|
6
|
-
import { DragLayer } from './DragLayer';
|
|
7
7
|
import { FileManagerProvider } from './FileManagerProvider';
|
|
8
8
|
import { InlineFilesSection } from './InlineFilesSection';
|
|
9
9
|
import { OtherFilesSection } from './OtherFilesSection';
|
|
@@ -45,3 +45,4 @@ export { default as LeftArrow } from './left-arrow';
|
|
|
45
45
|
export { default as BlockQuoteIcon } from './block-quote-icon';
|
|
46
46
|
export { default as PullQuoteIcon } from './pull-quote-icon';
|
|
47
47
|
export { default as PlusIcon } from './plus-icon';
|
|
48
|
+
export { DeleteIcon } from './delete-icon';
|
package/dist/es/index.js
CHANGED
|
@@ -13,10 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export * from './components/AffiliationsEditor';
|
|
17
|
-
export * from './components/AuthorForm';
|
|
18
|
-
export * from './components/AuthorName';
|
|
19
|
-
export * from './components/AuthorsDND';
|
|
20
16
|
export * from './components/AlertMessage';
|
|
21
17
|
export * from './components/Button';
|
|
22
18
|
export * from './components/RadioButton';
|
|
@@ -31,6 +27,8 @@ export * from './components/Resizer';
|
|
|
31
27
|
export * from './components/SaveStatus';
|
|
32
28
|
export * from './components/StyledModal';
|
|
33
29
|
export * from './components/TableFootnotesSelector';
|
|
30
|
+
export * from './components/Sidebar';
|
|
31
|
+
export * from './components/DragLayer';
|
|
34
32
|
export * from './components/TextField';
|
|
35
33
|
export * from './components/TextFieldContainer';
|
|
36
34
|
export * from './components/TextFieldError';
|
|
@@ -55,10 +53,8 @@ export * from './hooks/use-dropdown';
|
|
|
55
53
|
export * from './hooks/use-files';
|
|
56
54
|
export * from './hooks/use-menus';
|
|
57
55
|
export { useDeepCompareMemo, useDeepCompareCallback, } from './hooks/use-deep-compare';
|
|
58
|
-
export * from './lib/authors';
|
|
59
56
|
export * from './lib/capabilities';
|
|
60
57
|
export * from './lib/files';
|
|
61
58
|
export * from './lib/comments';
|
|
62
59
|
export * from './lib/menus';
|
|
63
60
|
export { default as errorsDecoder } from './lib/errors-decoder';
|
|
64
|
-
export * from './types';
|
|
@@ -17,6 +17,7 @@ export const getCapabilities = (project, profile, role, actions) => {
|
|
|
17
17
|
const allowed = (action) => !!(actions === null || actions === void 0 ? void 0 : actions.includes(action));
|
|
18
18
|
return {
|
|
19
19
|
handleSuggestion: isOwner() || isEditor() || isWriter(),
|
|
20
|
+
editWithoutTracking: isWriter(),
|
|
20
21
|
rejectOwnSuggestion: !isViewer(),
|
|
21
22
|
createSuggestion: !isViewer(),
|
|
22
23
|
viewSuggestion: true,
|
|
@@ -46,7 +47,6 @@ export const getCapabilities = (project, profile, role, actions) => {
|
|
|
46
47
|
putOnHoldTask: isProdEditor(),
|
|
47
48
|
changeDueDate: isProdEditor() && allowed(Actions.updateDueDate),
|
|
48
49
|
previewAccess: true,
|
|
49
|
-
editNotTracked: false,
|
|
50
50
|
accessEditor: true,
|
|
51
51
|
formatArticle: !isViewer(),
|
|
52
52
|
editArticle: !isViewer(),
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import React from 'react';
|
|
17
17
|
export declare const TextButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
18
|
-
type: "button" | "
|
|
18
|
+
type: "button" | "submit" | "reset";
|
|
19
19
|
} & {
|
|
20
20
|
danger?: boolean | undefined;
|
|
21
21
|
disabled?: boolean | undefined;
|
|
@@ -14,35 +14,35 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export declare const SecondaryButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
17
|
-
type: "button" | "
|
|
17
|
+
type: "button" | "submit" | "reset";
|
|
18
18
|
} & {
|
|
19
19
|
danger?: boolean | undefined;
|
|
20
20
|
disabled?: boolean | undefined;
|
|
21
21
|
mini?: boolean | undefined;
|
|
22
22
|
}, "type">;
|
|
23
23
|
export declare const PrimaryButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
24
|
-
type: "button" | "
|
|
24
|
+
type: "button" | "submit" | "reset";
|
|
25
25
|
} & {
|
|
26
26
|
danger?: boolean | undefined;
|
|
27
27
|
disabled?: boolean | undefined;
|
|
28
28
|
mini?: boolean | undefined;
|
|
29
29
|
}, "type">;
|
|
30
30
|
export declare const TertiaryButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
31
|
-
type: "button" | "
|
|
31
|
+
type: "button" | "submit" | "reset";
|
|
32
32
|
} & {
|
|
33
33
|
danger?: boolean | undefined;
|
|
34
34
|
disabled?: boolean | undefined;
|
|
35
35
|
mini?: boolean | undefined;
|
|
36
36
|
}, "type">;
|
|
37
37
|
export declare const IconTextButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
38
|
-
type: "button" | "
|
|
38
|
+
type: "button" | "submit" | "reset";
|
|
39
39
|
} & {
|
|
40
40
|
danger?: boolean | undefined;
|
|
41
41
|
disabled?: boolean | undefined;
|
|
42
42
|
mini?: boolean | undefined;
|
|
43
43
|
}, "type">;
|
|
44
44
|
export declare const ToggleButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
45
|
-
type: "button" | "
|
|
45
|
+
type: "button" | "submit" | "reset";
|
|
46
46
|
} & {
|
|
47
47
|
danger?: boolean | undefined;
|
|
48
48
|
disabled?: boolean | undefined;
|
|
@@ -51,7 +51,7 @@ export declare const ToggleButton: import("styled-components").StyledComponent<"
|
|
|
51
51
|
selected?: boolean | undefined;
|
|
52
52
|
}, "type">;
|
|
53
53
|
export declare const ToggleButtonAlt: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
54
|
-
type: "button" | "
|
|
54
|
+
type: "button" | "submit" | "reset";
|
|
55
55
|
} & {
|
|
56
56
|
danger?: boolean | undefined;
|
|
57
57
|
disabled?: boolean | undefined;
|
|
@@ -60,7 +60,7 @@ export declare const ToggleButtonAlt: import("styled-components").StyledComponen
|
|
|
60
60
|
selected?: boolean | undefined;
|
|
61
61
|
}, "type">;
|
|
62
62
|
export declare const IconButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
63
|
-
type: "button" | "
|
|
63
|
+
type: "button" | "submit" | "reset";
|
|
64
64
|
} & {
|
|
65
65
|
danger?: boolean | undefined;
|
|
66
66
|
disabled?: boolean | undefined;
|
|
@@ -71,7 +71,7 @@ export declare const IconButton: import("styled-components").StyledComponent<"bu
|
|
|
71
71
|
iconColor?: string | undefined;
|
|
72
72
|
}, "type">;
|
|
73
73
|
export declare const RoundIconButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
74
|
-
type: "button" | "
|
|
74
|
+
type: "button" | "submit" | "reset";
|
|
75
75
|
} & {
|
|
76
76
|
danger?: boolean | undefined;
|
|
77
77
|
disabled?: boolean | undefined;
|
|
@@ -84,7 +84,7 @@ export declare const RoundIconButton: import("styled-components").StyledComponen
|
|
|
84
84
|
defaultColor: boolean;
|
|
85
85
|
}, "type" | "defaultColor">;
|
|
86
86
|
export declare const SecondaryIconButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
87
|
-
type: "button" | "
|
|
87
|
+
type: "button" | "submit" | "reset";
|
|
88
88
|
} & {
|
|
89
89
|
danger?: boolean | undefined;
|
|
90
90
|
disabled?: boolean | undefined;
|
|
@@ -60,7 +60,7 @@ export declare const EditorHeader: React.FC<{
|
|
|
60
60
|
disabelProceedNote?: boolean;
|
|
61
61
|
}>;
|
|
62
62
|
export declare const PrimaryButtonSmall: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
63
|
-
type: "button" | "
|
|
63
|
+
type: "button" | "submit" | "reset";
|
|
64
64
|
} & {
|
|
65
65
|
danger?: boolean | undefined;
|
|
66
66
|
disabled?: boolean | undefined;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import React, { CSSProperties } from 'react';
|
|
17
17
|
export declare const ExpanderButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
18
|
-
type: "button" | "
|
|
18
|
+
type: "button" | "submit" | "reset";
|
|
19
19
|
} & {
|
|
20
20
|
danger?: boolean | undefined;
|
|
21
21
|
disabled?: boolean | undefined;
|
|
@@ -36,7 +36,7 @@ interface DropdownProps {
|
|
|
36
36
|
export declare const NavDropdownToggle: import("styled-components").StyledComponent<React.SFC<React.SVGAttributes<SVGElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
37
37
|
export declare const NotificationsBadge: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, DropdownProps, never>;
|
|
38
38
|
export declare const NavDropdownButtonContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
39
|
-
type: "button" | "
|
|
39
|
+
type: "button" | "submit" | "reset";
|
|
40
40
|
} & {
|
|
41
41
|
danger?: boolean | undefined;
|
|
42
42
|
disabled?: boolean | undefined;
|
|
@@ -22,7 +22,7 @@ interface Props {
|
|
|
22
22
|
export declare const ModalContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
23
23
|
export declare const ModalHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
24
24
|
export declare const CloseButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
25
|
-
type: "button" | "
|
|
25
|
+
type: "button" | "submit" | "reset";
|
|
26
26
|
} & {
|
|
27
27
|
danger?: boolean | undefined;
|
|
28
28
|
disabled?: boolean | undefined;
|
|
@@ -45,3 +45,4 @@ export { default as LeftArrow } from './left-arrow';
|
|
|
45
45
|
export { default as BlockQuoteIcon } from './block-quote-icon';
|
|
46
46
|
export { default as PullQuoteIcon } from './pull-quote-icon';
|
|
47
47
|
export { default as PlusIcon } from './plus-icon';
|
|
48
|
+
export { DeleteIcon } from './delete-icon';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -14,10 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export { Theme } from './theme';
|
|
17
|
-
export * from './components/AffiliationsEditor';
|
|
18
|
-
export * from './components/AuthorForm';
|
|
19
|
-
export * from './components/AuthorName';
|
|
20
|
-
export * from './components/AuthorsDND';
|
|
21
17
|
export * from './components/AlertMessage';
|
|
22
18
|
export * from './components/Button';
|
|
23
19
|
export * from './components/RadioButton';
|
|
@@ -32,6 +28,8 @@ export * from './components/Resizer';
|
|
|
32
28
|
export * from './components/SaveStatus';
|
|
33
29
|
export * from './components/StyledModal';
|
|
34
30
|
export * from './components/TableFootnotesSelector';
|
|
31
|
+
export * from './components/Sidebar';
|
|
32
|
+
export * from './components/DragLayer';
|
|
35
33
|
export * from './components/TextField';
|
|
36
34
|
export * from './components/TextFieldContainer';
|
|
37
35
|
export * from './components/TextFieldError';
|
|
@@ -56,10 +54,8 @@ export * from './hooks/use-dropdown';
|
|
|
56
54
|
export * from './hooks/use-files';
|
|
57
55
|
export * from './hooks/use-menus';
|
|
58
56
|
export { useDeepCompareMemo, useDeepCompareCallback, } from './hooks/use-deep-compare';
|
|
59
|
-
export * from './lib/authors';
|
|
60
57
|
export * from './lib/capabilities';
|
|
61
58
|
export * from './lib/files';
|
|
62
59
|
export * from './lib/comments';
|
|
63
60
|
export * from './lib/menus';
|
|
64
61
|
export { default as errorsDecoder } from './lib/errors-decoder';
|
|
65
|
-
export * from './types';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/style-guide",
|
|
3
3
|
"description": "Shared components for Manuscripts applications",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.8.1",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* © 2019 Atypon Systems LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
-
};
|
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
const react_1 = __importStar(require("react"));
|
|
45
|
-
const authors_1 = require("../../lib/authors");
|
|
46
|
-
const AffiliationsEditorView_1 = __importDefault(require("./AffiliationsEditorView"));
|
|
47
|
-
const AffiliationsEditor = ({ affiliations, authorAffiliations, addAuthorAffiliation, updateAffiliation, removeAuthorAffiliation, components, styleOverrides, }) => {
|
|
48
|
-
const [searchText, setSearchText] = (0, react_1.useState)('');
|
|
49
|
-
const handleChoose = (0, react_1.useCallback)((value) => {
|
|
50
|
-
if (value) {
|
|
51
|
-
const selectedAffiliation = value;
|
|
52
|
-
addAuthorAffiliation(selectedAffiliation.value);
|
|
53
|
-
}
|
|
54
|
-
setSearchText('');
|
|
55
|
-
}, [addAuthorAffiliation]);
|
|
56
|
-
const options = (0, authors_1.affiliationsOptions)(affiliations, authorAffiliations);
|
|
57
|
-
const active = authorAffiliations
|
|
58
|
-
? authorAffiliations.map((item) => item.data)
|
|
59
|
-
: [];
|
|
60
|
-
return (react_1.default.createElement(AffiliationsEditorView_1.default, { options: options, selected: active, updateAffiliation: updateAffiliation, removeAuthorAffiliation: removeAuthorAffiliation, components: components, styleOverrides: styleOverrides, handleChoose: handleChoose, handleInputChange: setSearchText, inputValue: searchText }));
|
|
61
|
-
};
|
|
62
|
-
exports.default = AffiliationsEditor;
|