@manuscripts/style-guide 1.13.8-LEAN-3450.0 → 1.13.8-LEAN-3645
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/{TableFootnotesSelector.js → FootnotesSelector.js} +7 -7
- package/dist/cjs/components/Menus/Menus.js +18 -16
- package/dist/cjs/index.js +1 -1
- package/dist/es/components/{TableFootnotesSelector.js → FootnotesSelector.js} +5 -5
- package/dist/es/components/Menus/Menus.js +16 -15
- package/dist/es/index.js +1 -1
- package/dist/types/components/{TableFootnotesSelector.d.ts → FootnotesSelector.d.ts} +2 -1
- package/dist/types/components/Menus/Menus.d.ts +5 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -41,7 +41,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
41
41
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
42
|
};
|
|
43
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.
|
|
44
|
+
exports.FootnotesSelector = void 0;
|
|
45
45
|
const react_1 = __importStar(require("react"));
|
|
46
46
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
47
47
|
const Button_1 = require("./Button");
|
|
@@ -77,7 +77,7 @@ const AddNewFootnote = (0, styled_components_1.default)(Button_1.ButtonGroup) `
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
`;
|
|
80
|
-
const
|
|
80
|
+
const FootnotesSelector = ({ notes, inlineFootnote, onAdd, onInsert, onCancel, addNewLabel }) => {
|
|
81
81
|
let selectedNotesMap;
|
|
82
82
|
if (inlineFootnote) {
|
|
83
83
|
const rids = inlineFootnote.attrs.rids;
|
|
@@ -104,18 +104,18 @@ const TableFootnotesSelector = ({ notes, inlineFootnote, onAdd, onInsert, onCanc
|
|
|
104
104
|
};
|
|
105
105
|
return (react_1.default.createElement(Container, null,
|
|
106
106
|
react_1.default.createElement(NotesContainer, null,
|
|
107
|
-
react_1.default.createElement(
|
|
107
|
+
react_1.default.createElement(FootnotesList, { notes: notes, inlineFootnote: inlineFootnote, isSelected: isSelected, onSelect: toggleSelection })),
|
|
108
108
|
react_1.default.createElement(Actions, null,
|
|
109
109
|
react_1.default.createElement(AddNewFootnote, null,
|
|
110
110
|
react_1.default.createElement(Button_1.IconTextButton, { onClick: onAdd },
|
|
111
111
|
react_1.default.createElement(icons_1.AddNewIcon, null),
|
|
112
|
-
|
|
112
|
+
addNewLabel || 'Add new')),
|
|
113
113
|
react_1.default.createElement(Button_1.ButtonGroup, null,
|
|
114
114
|
react_1.default.createElement(Button_1.SecondaryButton, { onClick: onCancel }, "Cancel"),
|
|
115
115
|
react_1.default.createElement(Button_1.PrimaryButton, { onClick: handleClick, disabled: selections.size === 0 && !inlineFootnote }, inlineFootnote ? 'Update' : 'Insert')))));
|
|
116
116
|
};
|
|
117
|
-
exports.
|
|
118
|
-
const
|
|
117
|
+
exports.FootnotesSelector = FootnotesSelector;
|
|
118
|
+
const FootnotesList = ({ notes, isSelected, onSelect, inlineFootnote }) => {
|
|
119
119
|
const selectedNotes = [];
|
|
120
120
|
const remainingNotes = [];
|
|
121
121
|
notes.forEach((note) => {
|
|
@@ -170,5 +170,5 @@ const NoteText = styled_components_1.default.div `
|
|
|
170
170
|
color: ${(props) => props.theme.colors.text.primary};
|
|
171
171
|
flex: 1;
|
|
172
172
|
font-weight: ${(props) => props.theme.font.weight.normal};
|
|
173
|
-
margin-top:
|
|
173
|
+
margin-top: 2px;
|
|
174
174
|
`;
|
|
@@ -41,7 +41,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
41
41
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
42
|
};
|
|
43
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.Label = exports.Block = exports.BlockItem = exports.StyleBlock = exports.ListContainer = exports.bulletListContextMenu = exports.orderedListContextMenu = exports.Menus = void 0;
|
|
44
|
+
exports.ColumnChangeWarningDialog = exports.Label = exports.Block = exports.BlockItem = exports.StyleBlock = exports.ListContainer = exports.bulletListContextMenu = exports.orderedListContextMenu = exports.Menus = void 0;
|
|
45
45
|
const react_1 = __importStar(require("react"));
|
|
46
46
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
47
47
|
const Dialog_1 = require("../Dialog");
|
|
@@ -81,21 +81,12 @@ const Menus = ({ menus, innerRef, handleClick, }) => {
|
|
|
81
81
|
return (react_1.default.createElement(Submenu_1.Submenu, { key: `${index}-${sindex}`, menu: submenu, handleClick: (i) => handleClick([index, sindex, ...i]), setColumnMenu: setColumnMenu }));
|
|
82
82
|
})))));
|
|
83
83
|
}),
|
|
84
|
-
react_1.default.createElement(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
title: 'Ok',
|
|
93
|
-
},
|
|
94
|
-
secondary: {
|
|
95
|
-
action: () => setColumnMenu(undefined),
|
|
96
|
-
title: 'Cancel',
|
|
97
|
-
},
|
|
98
|
-
} })));
|
|
84
|
+
react_1.default.createElement(exports.ColumnChangeWarningDialog, { isOpen: !!columnMenu, primaryAction: () => {
|
|
85
|
+
if (columnMenu === null || columnMenu === void 0 ? void 0 : columnMenu.run) {
|
|
86
|
+
columnMenu.run();
|
|
87
|
+
setColumnMenu(undefined);
|
|
88
|
+
}
|
|
89
|
+
}, secondaryAction: () => setColumnMenu(undefined) })));
|
|
99
90
|
};
|
|
100
91
|
exports.Menus = Menus;
|
|
101
92
|
exports.orderedListContextMenu = [
|
|
@@ -151,3 +142,14 @@ exports.Label = styled_components_1.default.div `
|
|
|
151
142
|
font-style: normal;
|
|
152
143
|
color: ${(props) => (props.hide && 'white') || 'initial'};
|
|
153
144
|
`;
|
|
145
|
+
const ColumnChangeWarningDialog = ({ isOpen, primaryAction, secondaryAction }) => (react_1.default.createElement(Dialog_1.Dialog, { isOpen: isOpen, category: Dialog_1.Category.confirmation, header: "This change can't be tracked", message: "This column action won't be marked as chnage. Do you want to continue?", actions: {
|
|
146
|
+
primary: {
|
|
147
|
+
action: primaryAction,
|
|
148
|
+
title: 'Ok',
|
|
149
|
+
},
|
|
150
|
+
secondary: {
|
|
151
|
+
action: secondaryAction,
|
|
152
|
+
title: 'Cancel',
|
|
153
|
+
},
|
|
154
|
+
} }));
|
|
155
|
+
exports.ColumnChangeWarningDialog = ColumnChangeWarningDialog;
|
package/dist/cjs/index.js
CHANGED
|
@@ -47,7 +47,7 @@ __exportStar(require("./components/FileManager/util"), exports);
|
|
|
47
47
|
__exportStar(require("./components/Resizer"), exports);
|
|
48
48
|
__exportStar(require("./components/SaveStatus"), exports);
|
|
49
49
|
__exportStar(require("./components/StyledModal"), exports);
|
|
50
|
-
__exportStar(require("./components/
|
|
50
|
+
__exportStar(require("./components/FootnotesSelector"), exports);
|
|
51
51
|
__exportStar(require("./components/Sidebar"), exports);
|
|
52
52
|
__exportStar(require("./components/RichText"), exports);
|
|
53
53
|
__exportStar(require("./components/TextField"), exports);
|
|
@@ -48,7 +48,7 @@ const AddNewFootnote = styled(ButtonGroup) `
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
`;
|
|
51
|
-
export const
|
|
51
|
+
export const FootnotesSelector = ({ notes, inlineFootnote, onAdd, onInsert, onCancel, addNewLabel }) => {
|
|
52
52
|
let selectedNotesMap;
|
|
53
53
|
if (inlineFootnote) {
|
|
54
54
|
const rids = inlineFootnote.attrs.rids;
|
|
@@ -75,17 +75,17 @@ export const TableFootnotesSelector = ({ notes, inlineFootnote, onAdd, onInsert,
|
|
|
75
75
|
};
|
|
76
76
|
return (React.createElement(Container, null,
|
|
77
77
|
React.createElement(NotesContainer, null,
|
|
78
|
-
React.createElement(
|
|
78
|
+
React.createElement(FootnotesList, { notes: notes, inlineFootnote: inlineFootnote, isSelected: isSelected, onSelect: toggleSelection })),
|
|
79
79
|
React.createElement(Actions, null,
|
|
80
80
|
React.createElement(AddNewFootnote, null,
|
|
81
81
|
React.createElement(IconTextButton, { onClick: onAdd },
|
|
82
82
|
React.createElement(AddNewIcon, null),
|
|
83
|
-
|
|
83
|
+
addNewLabel || 'Add new')),
|
|
84
84
|
React.createElement(ButtonGroup, null,
|
|
85
85
|
React.createElement(SecondaryButton, { onClick: onCancel }, "Cancel"),
|
|
86
86
|
React.createElement(PrimaryButton, { onClick: handleClick, disabled: selections.size === 0 && !inlineFootnote }, inlineFootnote ? 'Update' : 'Insert')))));
|
|
87
87
|
};
|
|
88
|
-
const
|
|
88
|
+
const FootnotesList = ({ notes, isSelected, onSelect, inlineFootnote }) => {
|
|
89
89
|
const selectedNotes = [];
|
|
90
90
|
const remainingNotes = [];
|
|
91
91
|
notes.forEach((note) => {
|
|
@@ -140,5 +140,5 @@ const NoteText = styled.div `
|
|
|
140
140
|
color: ${(props) => props.theme.colors.text.primary};
|
|
141
141
|
flex: 1;
|
|
142
142
|
font-weight: ${(props) => props.theme.font.weight.normal};
|
|
143
|
-
margin-top:
|
|
143
|
+
margin-top: 2px;
|
|
144
144
|
`;
|
|
@@ -52,21 +52,12 @@ export const Menus = ({ menus, innerRef, handleClick, }) => {
|
|
|
52
52
|
return (React.createElement(Submenu, { key: `${index}-${sindex}`, menu: submenu, handleClick: (i) => handleClick([index, sindex, ...i]), setColumnMenu: setColumnMenu }));
|
|
53
53
|
})))));
|
|
54
54
|
}),
|
|
55
|
-
React.createElement(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
title: 'Ok',
|
|
64
|
-
},
|
|
65
|
-
secondary: {
|
|
66
|
-
action: () => setColumnMenu(undefined),
|
|
67
|
-
title: 'Cancel',
|
|
68
|
-
},
|
|
69
|
-
} })));
|
|
55
|
+
React.createElement(ColumnChangeWarningDialog, { isOpen: !!columnMenu, primaryAction: () => {
|
|
56
|
+
if (columnMenu === null || columnMenu === void 0 ? void 0 : columnMenu.run) {
|
|
57
|
+
columnMenu.run();
|
|
58
|
+
setColumnMenu(undefined);
|
|
59
|
+
}
|
|
60
|
+
}, secondaryAction: () => setColumnMenu(undefined) })));
|
|
70
61
|
};
|
|
71
62
|
export const orderedListContextMenu = [
|
|
72
63
|
{ items: ['1.', '2.', '3.'], type: 'order' },
|
|
@@ -121,3 +112,13 @@ export const Label = styled.div `
|
|
|
121
112
|
font-style: normal;
|
|
122
113
|
color: ${(props) => (props.hide && 'white') || 'initial'};
|
|
123
114
|
`;
|
|
115
|
+
export const ColumnChangeWarningDialog = ({ isOpen, primaryAction, secondaryAction }) => (React.createElement(Dialog, { isOpen: isOpen, category: Category.confirmation, header: "This change can't be tracked", message: "This column action won't be marked as chnage. Do you want to continue?", actions: {
|
|
116
|
+
primary: {
|
|
117
|
+
action: primaryAction,
|
|
118
|
+
title: 'Ok',
|
|
119
|
+
},
|
|
120
|
+
secondary: {
|
|
121
|
+
action: secondaryAction,
|
|
122
|
+
title: 'Cancel',
|
|
123
|
+
},
|
|
124
|
+
} }));
|
package/dist/es/index.js
CHANGED
|
@@ -27,7 +27,7 @@ export * from './components/FileManager/util';
|
|
|
27
27
|
export * from './components/Resizer';
|
|
28
28
|
export * from './components/SaveStatus';
|
|
29
29
|
export * from './components/StyledModal';
|
|
30
|
-
export * from './components/
|
|
30
|
+
export * from './components/FootnotesSelector';
|
|
31
31
|
export * from './components/Sidebar';
|
|
32
32
|
export * from './components/RichText';
|
|
33
33
|
export * from './components/TextField';
|
|
@@ -19,10 +19,11 @@ export type FootnoteWithIndex = {
|
|
|
19
19
|
node: FootnoteNode;
|
|
20
20
|
index?: string;
|
|
21
21
|
};
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const FootnotesSelector: React.FC<{
|
|
23
23
|
notes: FootnoteWithIndex[];
|
|
24
24
|
inlineFootnote?: InlineFootnoteNode;
|
|
25
25
|
onAdd: () => void;
|
|
26
26
|
onInsert: (notes: FootnoteWithIndex[]) => void;
|
|
27
27
|
onCancel: () => void;
|
|
28
|
+
addNewLabel?: string;
|
|
28
29
|
}>;
|
|
@@ -36,4 +36,9 @@ export declare const Block: import("styled-components").StyledComponent<"div", i
|
|
|
36
36
|
export declare const Label: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
37
37
|
hide?: boolean | undefined;
|
|
38
38
|
}, never>;
|
|
39
|
+
export declare const ColumnChangeWarningDialog: React.FC<{
|
|
40
|
+
isOpen: boolean;
|
|
41
|
+
primaryAction: () => void;
|
|
42
|
+
secondaryAction: () => void;
|
|
43
|
+
}>;
|
|
39
44
|
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export * from './components/FileManager/util';
|
|
|
28
28
|
export * from './components/Resizer';
|
|
29
29
|
export * from './components/SaveStatus';
|
|
30
30
|
export * from './components/StyledModal';
|
|
31
|
-
export * from './components/
|
|
31
|
+
export * from './components/FootnotesSelector';
|
|
32
32
|
export * from './components/Sidebar';
|
|
33
33
|
export * from './components/RichText';
|
|
34
34
|
export * from './components/TextField';
|
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.13.8-LEAN-
|
|
4
|
+
"version": "1.13.8-LEAN-3645",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -109,4 +109,4 @@
|
|
|
109
109
|
"@types/react": "^17.0.2",
|
|
110
110
|
"jackspeak": "2.1.1"
|
|
111
111
|
}
|
|
112
|
-
}
|
|
112
|
+
}
|