@manuscripts/style-guide 1.7.10-LEAN-3278 → 1.7.10-LEAN-3415
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/Button.js +20 -4
- package/dist/cjs/components/ContextMenu.js +42 -0
- package/dist/cjs/components/References/CitationEditor.js +1 -4
- package/dist/cjs/components/References/ReferenceSearch.js +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/lib/capabilities.js +1 -1
- package/dist/es/components/Button.js +19 -3
- package/dist/es/components/ContextMenu.js +35 -0
- package/dist/es/components/References/CitationEditor.js +1 -4
- package/dist/es/components/References/ReferenceSearch.js +1 -1
- package/dist/es/index.js +1 -0
- package/dist/es/lib/capabilities.js +1 -1
- package/dist/types/components/Button.d.ts +1 -0
- package/dist/types/components/ContextMenu.d.ts +25 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/lib/capabilities.d.ts +1 -1
- package/package.json +1 -1
|
@@ -38,13 +38,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
38
38
|
return result;
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.ButtonGroup = exports.SecondaryIconButton = exports.RoundIconButton = exports.IconButton = exports.ToggleButtonAlt = exports.ToggleButton = exports.IconTextButton = exports.TertiaryButton = exports.PrimaryButton = exports.SecondaryButton = void 0;
|
|
41
|
+
exports.IconButtonGroup = exports.ButtonGroup = exports.SecondaryIconButton = exports.RoundIconButton = exports.IconButton = exports.ToggleButtonAlt = exports.ToggleButton = exports.IconTextButton = exports.TertiaryButton = exports.PrimaryButton = exports.SecondaryButton = void 0;
|
|
42
42
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
43
43
|
const dangerBtnStyles = (0, styled_components_1.css) `
|
|
44
44
|
${(props) => btnColors(props.theme.colors.button.error.color.default, props.theme.colors.button.error.background.default, props.theme.colors.button.error.border.default, true)}
|
|
45
45
|
|
|
46
46
|
&:not([disabled]):hover, &:not([disabled]):focus {
|
|
47
|
-
${(props) => btnColors(
|
|
47
|
+
${(props) => btnColors('red', 'pink', props.theme.colors.button.error.border.hover, true)}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
&:not([disabled]):active {
|
|
@@ -230,10 +230,10 @@ const IconButtonTemplate = (0, styled_components_1.default)(ButtonTemplate) `
|
|
|
230
230
|
${(props) => !props.defaultColor && svgColors}
|
|
231
231
|
`;
|
|
232
232
|
exports.IconButton = (0, styled_components_1.default)(IconButtonTemplate) `
|
|
233
|
-
${(props) => btnColors(
|
|
233
|
+
${(props) => btnColors('#6e6e6e', props.theme.colors.button.default.background.default, props.theme.colors.button.default.border.default, false)}
|
|
234
234
|
|
|
235
235
|
&:not([disabled]):hover, &:not([disabled]):focus {
|
|
236
|
-
${(props) => btnColors(
|
|
236
|
+
${(props) => btnColors('#363636', '#f2f2f2', '#f2f2f2', false)}
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
&:not([disabled]):active {
|
|
@@ -288,3 +288,19 @@ exports.ButtonGroup = styled_components_1.default.div `
|
|
|
288
288
|
margin-left: ${(props) => props.theme.grid.unit}px;
|
|
289
289
|
}
|
|
290
290
|
`;
|
|
291
|
+
exports.IconButtonGroup = styled_components_1.default.div `
|
|
292
|
+
display: flex;
|
|
293
|
+
flex-direction: row;
|
|
294
|
+
justify-content: flex-start;
|
|
295
|
+
align-items: center;
|
|
296
|
+
|
|
297
|
+
// button:hover {
|
|
298
|
+
// color: inherit !important;
|
|
299
|
+
// background-color: hotpink !important;
|
|
300
|
+
// }
|
|
301
|
+
|
|
302
|
+
button {
|
|
303
|
+
width: 28px;
|
|
304
|
+
height: 28px;
|
|
305
|
+
}
|
|
306
|
+
`;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2024 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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.ContextMenu = void 0;
|
|
22
|
+
const react_1 = __importDefault(require("react"));
|
|
23
|
+
const Button_1 = require("./Button");
|
|
24
|
+
const icons_1 = require("./icons");
|
|
25
|
+
const Tooltip_1 = require("./Tooltip");
|
|
26
|
+
const Icons = {
|
|
27
|
+
AddComment: icons_1.AddComment,
|
|
28
|
+
EditIcon: icons_1.EditIcon,
|
|
29
|
+
};
|
|
30
|
+
const ContextMenu = ({ actions }) => {
|
|
31
|
+
let Icon;
|
|
32
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
33
|
+
react_1.default.createElement(Button_1.IconButtonGroup, null, actions.map((action) => {
|
|
34
|
+
{
|
|
35
|
+
Icon = Icons[action.icon];
|
|
36
|
+
}
|
|
37
|
+
return (react_1.default.createElement(Button_1.IconButton, { key: action.icon, "data-tooltip-id": action.icon, onClick: action.action },
|
|
38
|
+
react_1.default.createElement(Icon, null),
|
|
39
|
+
react_1.default.createElement(Tooltip_1.Tooltip, { id: action.icon, place: "bottom" }, action.label)));
|
|
40
|
+
}))));
|
|
41
|
+
};
|
|
42
|
+
exports.ContextMenu = ContextMenu;
|
|
@@ -34,7 +34,6 @@ const react_1 = __importStar(require("react"));
|
|
|
34
34
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
35
35
|
const Button_1 = require("../Button");
|
|
36
36
|
const Dialog_1 = require("../Dialog");
|
|
37
|
-
const icons_1 = require("../icons");
|
|
38
37
|
const CitationViewer_1 = require("./CitationViewer");
|
|
39
38
|
const ReferenceLine_1 = require("./ReferenceLine");
|
|
40
39
|
const ReferenceSearch_1 = require("./ReferenceSearch");
|
|
@@ -136,9 +135,7 @@ const CitationEditor = ({ query, rids, items, citationCounts, sources, onCite, o
|
|
|
136
135
|
react_1.default.createElement(CloseIconDark_1.default, { className: 'remove-icon' }))))))),
|
|
137
136
|
react_1.default.createElement(ReferencesModal_1.ReferencesModal, { isOpen: editingForm.show, onCancel: () => setEditingForm({ show: false }), items: items, citationCounts: citationCounts, item: editingForm.item, onSave: onSave, onDelete: onDelete }),
|
|
138
137
|
react_1.default.createElement(Actions, null,
|
|
139
|
-
react_1.default.createElement(Button_1.IconTextButton,
|
|
140
|
-
react_1.default.createElement(icons_1.AddComment, null),
|
|
141
|
-
react_1.default.createElement(AddCommentButtonText, null, "Add Comment")),
|
|
138
|
+
react_1.default.createElement(Button_1.IconTextButton, null),
|
|
142
139
|
react_1.default.createElement(Button_1.ButtonGroup, null,
|
|
143
140
|
react_1.default.createElement(Button_1.SecondaryButton, { onClick: onCancel }, "Done"),
|
|
144
141
|
react_1.default.createElement(Button_1.PrimaryButton, { disabled: !canEdit, onClick: () => setSearching(true) }, "Add Citation")))));
|
|
@@ -105,7 +105,7 @@ const ReferenceSearch = ({ query: initialQuery, sources, items, onAdd, onCite, o
|
|
|
105
105
|
const debouncedSetQuery = (0, lodash_1.debounce)((e) => {
|
|
106
106
|
setQuery(e.target.value.trim());
|
|
107
107
|
}, 800);
|
|
108
|
-
return (react_1.default.createElement(Container,
|
|
108
|
+
return (react_1.default.createElement(Container, { "data-marek": "MAREK" },
|
|
109
109
|
react_1.default.createElement(SearchInput_1.SearchInput, { onChange: debouncedSetQuery, defaultValue: initialQuery }),
|
|
110
110
|
react_1.default.createElement(ReferenceSearchSectionContainer, null,
|
|
111
111
|
react_1.default.createElement(ReferenceSearchSection_1.ReferenceSearchSection, { key: document.id, query: query, source: document, isSelected: isSelected, onSelect: toggleSelection }),
|
package/dist/cjs/index.js
CHANGED
|
@@ -39,6 +39,7 @@ __exportStar(require("./components/AuthorName"), exports);
|
|
|
39
39
|
__exportStar(require("./components/AuthorsDND"), exports);
|
|
40
40
|
__exportStar(require("./components/AlertMessage"), exports);
|
|
41
41
|
__exportStar(require("./components/Button"), exports);
|
|
42
|
+
__exportStar(require("./components/ContextMenu"), exports);
|
|
42
43
|
__exportStar(require("./components/RadioButton"), exports);
|
|
43
44
|
__exportStar(require("./components/AutoSaveInput"), exports);
|
|
44
45
|
__exportStar(require("./components/Avatar"), exports);
|
|
@@ -23,7 +23,6 @@ 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(),
|
|
27
26
|
rejectOwnSuggestion: !isViewer(),
|
|
28
27
|
createSuggestion: !isViewer(),
|
|
29
28
|
viewSuggestion: true,
|
|
@@ -53,6 +52,7 @@ const getCapabilities = (project, profile, role, actions) => {
|
|
|
53
52
|
putOnHoldTask: isProdEditor(),
|
|
54
53
|
changeDueDate: isProdEditor() && allowed(Actions.updateDueDate),
|
|
55
54
|
previewAccess: true,
|
|
55
|
+
editNotTracked: false,
|
|
56
56
|
accessEditor: true,
|
|
57
57
|
formatArticle: !isViewer(),
|
|
58
58
|
editArticle: !isViewer(),
|
|
@@ -18,7 +18,7 @@ const dangerBtnStyles = css `
|
|
|
18
18
|
${(props) => btnColors(props.theme.colors.button.error.color.default, props.theme.colors.button.error.background.default, props.theme.colors.button.error.border.default, true)}
|
|
19
19
|
|
|
20
20
|
&:not([disabled]):hover, &:not([disabled]):focus {
|
|
21
|
-
${(props) => btnColors(
|
|
21
|
+
${(props) => btnColors('red', 'pink', props.theme.colors.button.error.border.hover, true)}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
&:not([disabled]):active {
|
|
@@ -204,10 +204,10 @@ const IconButtonTemplate = styled(ButtonTemplate) `
|
|
|
204
204
|
${(props) => !props.defaultColor && svgColors}
|
|
205
205
|
`;
|
|
206
206
|
export const IconButton = styled(IconButtonTemplate) `
|
|
207
|
-
${(props) => btnColors(
|
|
207
|
+
${(props) => btnColors('#6e6e6e', props.theme.colors.button.default.background.default, props.theme.colors.button.default.border.default, false)}
|
|
208
208
|
|
|
209
209
|
&:not([disabled]):hover, &:not([disabled]):focus {
|
|
210
|
-
${(props) => btnColors(
|
|
210
|
+
${(props) => btnColors('#363636', '#f2f2f2', '#f2f2f2', false)}
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
&:not([disabled]):active {
|
|
@@ -262,3 +262,19 @@ export const ButtonGroup = styled.div `
|
|
|
262
262
|
margin-left: ${(props) => props.theme.grid.unit}px;
|
|
263
263
|
}
|
|
264
264
|
`;
|
|
265
|
+
export const IconButtonGroup = styled.div `
|
|
266
|
+
display: flex;
|
|
267
|
+
flex-direction: row;
|
|
268
|
+
justify-content: flex-start;
|
|
269
|
+
align-items: center;
|
|
270
|
+
|
|
271
|
+
// button:hover {
|
|
272
|
+
// color: inherit !important;
|
|
273
|
+
// background-color: hotpink !important;
|
|
274
|
+
// }
|
|
275
|
+
|
|
276
|
+
button {
|
|
277
|
+
width: 28px;
|
|
278
|
+
height: 28px;
|
|
279
|
+
}
|
|
280
|
+
`;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2024 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import React from 'react';
|
|
17
|
+
import { IconButton, IconButtonGroup } from './Button';
|
|
18
|
+
import { AddComment, EditIcon } from './icons';
|
|
19
|
+
import { Tooltip } from './Tooltip';
|
|
20
|
+
const Icons = {
|
|
21
|
+
AddComment: AddComment,
|
|
22
|
+
EditIcon: EditIcon,
|
|
23
|
+
};
|
|
24
|
+
export const ContextMenu = ({ actions }) => {
|
|
25
|
+
let Icon;
|
|
26
|
+
return (React.createElement(React.Fragment, null,
|
|
27
|
+
React.createElement(IconButtonGroup, null, actions.map((action) => {
|
|
28
|
+
{
|
|
29
|
+
Icon = Icons[action.icon];
|
|
30
|
+
}
|
|
31
|
+
return (React.createElement(IconButton, { key: action.icon, "data-tooltip-id": action.icon, onClick: action.action },
|
|
32
|
+
React.createElement(Icon, null),
|
|
33
|
+
React.createElement(Tooltip, { id: action.icon, place: "bottom" }, action.label)));
|
|
34
|
+
}))));
|
|
35
|
+
};
|
|
@@ -5,7 +5,6 @@ import React, { useMemo, useState } from 'react';
|
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
import { ButtonGroup, IconButton, IconTextButton, PrimaryButton, SecondaryButton, } from '../Button';
|
|
7
7
|
import { Category, Dialog } from '../Dialog';
|
|
8
|
-
import { AddComment } from '../icons';
|
|
9
8
|
import { CitedItem, CitedItems } from './CitationViewer';
|
|
10
9
|
import { ReferenceLine } from './ReferenceLine';
|
|
11
10
|
import { ReferenceSearch } from './ReferenceSearch';
|
|
@@ -107,9 +106,7 @@ export const CitationEditor = ({ query, rids, items, citationCounts, sources, on
|
|
|
107
106
|
React.createElement(CloseIconDark, { className: 'remove-icon' }))))))),
|
|
108
107
|
React.createElement(ReferencesModal, { isOpen: editingForm.show, onCancel: () => setEditingForm({ show: false }), items: items, citationCounts: citationCounts, item: editingForm.item, onSave: onSave, onDelete: onDelete }),
|
|
109
108
|
React.createElement(Actions, null,
|
|
110
|
-
React.createElement(IconTextButton,
|
|
111
|
-
React.createElement(AddComment, null),
|
|
112
|
-
React.createElement(AddCommentButtonText, null, "Add Comment")),
|
|
109
|
+
React.createElement(IconTextButton, null),
|
|
113
110
|
React.createElement(ButtonGroup, null,
|
|
114
111
|
React.createElement(SecondaryButton, { onClick: onCancel }, "Done"),
|
|
115
112
|
React.createElement(PrimaryButton, { disabled: !canEdit, onClick: () => setSearching(true) }, "Add Citation")))));
|
|
@@ -76,7 +76,7 @@ export const ReferenceSearch = ({ query: initialQuery, sources, items, onAdd, on
|
|
|
76
76
|
const debouncedSetQuery = debounce((e) => {
|
|
77
77
|
setQuery(e.target.value.trim());
|
|
78
78
|
}, 800);
|
|
79
|
-
return (React.createElement(Container,
|
|
79
|
+
return (React.createElement(Container, { "data-marek": "MAREK" },
|
|
80
80
|
React.createElement(SearchInput, { onChange: debouncedSetQuery, defaultValue: initialQuery }),
|
|
81
81
|
React.createElement(ReferenceSearchSectionContainer, null,
|
|
82
82
|
React.createElement(ReferenceSearchSection, { key: document.id, query: query, source: document, isSelected: isSelected, onSelect: toggleSelection }),
|
package/dist/es/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export * from './components/AuthorName';
|
|
|
19
19
|
export * from './components/AuthorsDND';
|
|
20
20
|
export * from './components/AlertMessage';
|
|
21
21
|
export * from './components/Button';
|
|
22
|
+
export * from './components/ContextMenu';
|
|
22
23
|
export * from './components/RadioButton';
|
|
23
24
|
export * from './components/AutoSaveInput';
|
|
24
25
|
export * from './components/Avatar';
|
|
@@ -17,7 +17,6 @@ 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(),
|
|
21
20
|
rejectOwnSuggestion: !isViewer(),
|
|
22
21
|
createSuggestion: !isViewer(),
|
|
23
22
|
viewSuggestion: true,
|
|
@@ -47,6 +46,7 @@ export const getCapabilities = (project, profile, role, actions) => {
|
|
|
47
46
|
putOnHoldTask: isProdEditor(),
|
|
48
47
|
changeDueDate: isProdEditor() && allowed(Actions.updateDueDate),
|
|
49
48
|
previewAccess: true,
|
|
49
|
+
editNotTracked: false,
|
|
50
50
|
accessEditor: true,
|
|
51
51
|
formatArticle: !isViewer(),
|
|
52
52
|
editArticle: !isViewer(),
|
|
@@ -95,3 +95,4 @@ export declare const SecondaryIconButton: import("styled-components").StyledComp
|
|
|
95
95
|
iconColor?: string | undefined;
|
|
96
96
|
}, "type">;
|
|
97
97
|
export declare const ButtonGroup: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
98
|
+
export declare const IconButtonGroup: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2024 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import React from 'react';
|
|
17
|
+
export interface Actions {
|
|
18
|
+
label: string;
|
|
19
|
+
action: () => void;
|
|
20
|
+
icon: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ContextMenuProps {
|
|
23
|
+
actions: Actions[];
|
|
24
|
+
}
|
|
25
|
+
export declare const ContextMenu: React.FC<ContextMenuProps>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * from './components/AuthorName';
|
|
|
20
20
|
export * from './components/AuthorsDND';
|
|
21
21
|
export * from './components/AlertMessage';
|
|
22
22
|
export * from './components/Button';
|
|
23
|
+
export * from './components/ContextMenu';
|
|
23
24
|
export * from './components/RadioButton';
|
|
24
25
|
export * from './components/AutoSaveInput';
|
|
25
26
|
export * from './components/Avatar';
|
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.7.10-LEAN-
|
|
4
|
+
"version": "1.7.10-LEAN-3415",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|