@manuscripts/style-guide 2.1.2-LEAN-4366.0 → 2.1.2
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/Menus/Submenu.js +1 -0
- package/dist/cjs/components/icons/index.js +1 -3
- package/dist/cjs/hooks/use-menus.js +5 -4
- package/dist/es/components/Menus/Submenu.js +1 -0
- package/dist/es/components/icons/index.js +0 -1
- package/dist/es/hooks/use-menus.js +5 -4
- package/dist/types/components/icons/index.d.ts +0 -1
- package/dist/types/lib/menus.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/icons/toolbar-indent.js +0 -14
- package/dist/es/components/icons/toolbar-indent.js +0 -9
- package/dist/types/components/icons/toolbar-indent.d.ts +0 -4
|
@@ -19,7 +19,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.ImageDefaultIcon = exports.ImageLeftIcon = exports.HelpIcon = exports.HandleOutlineIcon = exports.HandleInspectorIcon = exports.FileVideoIcon = exports.FileUnknownIcon = exports.FileTableIcon = exports.FilePdfIcon = exports.FileMainDocumentIcon = exports.FileLatexIcon = exports.FileImageIcon = exports.FileGraphicalAbstractIcon = exports.FileFigureIcon = exports.FileDocumentIcon = exports.FileCorruptedIcon = exports.FileCompressedIcon = exports.FileCodeIcon = exports.FileAudioIcon = exports.EditAttrsTrackingIcon = exports.EditIcon = exports.DraggableIcon = exports.DotsIcon = exports.DeleteIcon = exports.DeleteSolidIcon = exports.CorrespondingAuthorIcon = exports.CommentResolveIcon = exports.CommentReplyIcon = exports.CitationCountIcon = exports.SystemUserAvatarIcon = exports.AffiliationPlaceholderIcon = exports.AuthorPlaceholderIcon = exports.AffiliationIcon = exports.AlertIcon = exports.AvatarIcon = exports.AttentionRedIcon = exports.AttentionOrangeIcon = exports.AttentionGreenIcon = exports.AttentionBlueIcon = exports.AttachIcon = exports.ArrowUpIcon = exports.ArrowLeftIcon = exports.ArrowDownCircleIcon = exports.ArrowDownIcon = exports.AddIcon = exports.AddOutlineIcon = exports.AddNewIcon = exports.AddedIcon = exports.AddCommentIcon = exports.AddAuthorIcon = void 0;
|
|
22
|
-
exports.AddInstitutionIcon = exports.AddUserIcon = exports.ProfileIcon = exports.CrclTickAnimation = exports.VerticalEllipsisIcon = exports.UploadIcon = exports.TriangleExpandedIcon = exports.TriangleCollapsedIcon = exports.
|
|
22
|
+
exports.AddInstitutionIcon = exports.AddUserIcon = exports.ProfileIcon = exports.CrclTickAnimation = exports.VerticalEllipsisIcon = exports.UploadIcon = exports.TriangleExpandedIcon = exports.TriangleCollapsedIcon = exports.ToolbarUnorderedListIcon = exports.ToolbarUnderlineIcon = exports.ToolbarTableIcon = exports.ToolbarSymbolIcon = exports.ToolbarSuperscriptIcon = exports.ToolbarSubscriptIcon = exports.ToolbarOrderedListIcon = exports.ToolbarItalicIcon = exports.ToolbarFigureIcon = exports.ToolbarEquationIcon = exports.ToolbarCodeIcon = exports.ToolbarCitationIcon = exports.ToolbarBoldIcon = exports.TickIcon = exports.TaskStepDoneIcon = exports.SliderOnIcon = exports.SliderOffIcon = exports.SectionCategoryIcon = exports.SearchIcon = exports.ScrollIcon = exports.SaveStatusSavingIcon = exports.SaveStatusSavedIcon = exports.SaveStatusOfflineIcon = exports.RoleReadingIcon = exports.RoleAnnotatingIcon = exports.PlusIcon = exports.OutlineUnorderedListIcon = exports.OutlineTableIcon = exports.OutlineSectionIcon = exports.OutlinePullQuoteIcon = exports.OutlineParagraphIcon = exports.OutlineOrderedListIcon = exports.OutlineManuscriptIcon = exports.OutlineFigureIcon = exports.OutlineEmbedIcon = exports.OutlineEquationIcon = exports.OutlineCodeIcon = exports.OutlineBlockQuoteIcon = exports.LogoutIcon = exports.LinkIcon = exports.ImageRightIcon = void 0;
|
|
23
23
|
var add_author_1 = require("./add-author");
|
|
24
24
|
Object.defineProperty(exports, "AddAuthorIcon", { enumerable: true, get: function () { return __importDefault(add_author_1).default; } });
|
|
25
25
|
var add_comment_1 = require("./add-comment");
|
|
@@ -202,8 +202,6 @@ var toolbar_underline_1 = require("./toolbar-underline");
|
|
|
202
202
|
Object.defineProperty(exports, "ToolbarUnderlineIcon", { enumerable: true, get: function () { return __importDefault(toolbar_underline_1).default; } });
|
|
203
203
|
var toolbar_unordered_list_1 = require("./toolbar-unordered-list");
|
|
204
204
|
Object.defineProperty(exports, "ToolbarUnorderedListIcon", { enumerable: true, get: function () { return __importDefault(toolbar_unordered_list_1).default; } });
|
|
205
|
-
var toolbar_indent_1 = require("./toolbar-indent");
|
|
206
|
-
Object.defineProperty(exports, "ToolbarIndentIcon", { enumerable: true, get: function () { return __importDefault(toolbar_indent_1).default; } });
|
|
207
205
|
var triangle_collapsed_1 = require("./triangle-collapsed");
|
|
208
206
|
Object.defineProperty(exports, "TriangleCollapsedIcon", { enumerable: true, get: function () { return __importDefault(triangle_collapsed_1).default; } });
|
|
209
207
|
var triangle_expanded_1 = require("./triangle-expanded");
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useMenus = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const menus_1 = require("../lib/menus");
|
|
6
|
-
const initialPointer = [-1, -1, -1];
|
|
6
|
+
const initialPointer = [-1, -1, -1, -1];
|
|
7
7
|
const transformPointer = (depth, index) => (pointer) => pointer.map((pointerPart, i) => {
|
|
8
8
|
if (i === depth) {
|
|
9
9
|
return index;
|
|
@@ -14,7 +14,8 @@ const transformPointer = (depth, index) => (pointer) => pointer.map((pointerPart
|
|
|
14
14
|
return pointerPart;
|
|
15
15
|
});
|
|
16
16
|
const isPart = (pointer, position) => {
|
|
17
|
-
const
|
|
17
|
+
const max = initialPointer.length;
|
|
18
|
+
const limit = position.length < max ? position.length : max;
|
|
18
19
|
for (let i = 0; i < limit; i++) {
|
|
19
20
|
if (position[i] !== pointer[i]) {
|
|
20
21
|
return false;
|
|
@@ -60,7 +61,7 @@ const useMenus = (menus) => {
|
|
|
60
61
|
}
|
|
61
62
|
if (menu.run) {
|
|
62
63
|
menu.run();
|
|
63
|
-
setPointer(
|
|
64
|
+
setPointer(initialPointer);
|
|
64
65
|
}
|
|
65
66
|
else if (menu.submenu) {
|
|
66
67
|
const depth = indices.length - 1;
|
|
@@ -72,7 +73,7 @@ const useMenus = (menus) => {
|
|
|
72
73
|
(0, react_1.useEffect)(() => {
|
|
73
74
|
const handleClickOutside = (event) => {
|
|
74
75
|
if (ref.current && !ref.current.contains(event.target)) {
|
|
75
|
-
setPointer(
|
|
76
|
+
setPointer(initialPointer);
|
|
76
77
|
}
|
|
77
78
|
};
|
|
78
79
|
document.addEventListener('click', handleClickOutside);
|
|
@@ -104,7 +104,6 @@ export { default as ToolbarSymbolIcon } from './toolbar-symbol';
|
|
|
104
104
|
export { default as ToolbarTableIcon } from './toolbar-table';
|
|
105
105
|
export { default as ToolbarUnderlineIcon } from './toolbar-underline';
|
|
106
106
|
export { default as ToolbarUnorderedListIcon } from './toolbar-unordered-list';
|
|
107
|
-
export { default as ToolbarIndentIcon } from './toolbar-indent';
|
|
108
107
|
export { default as TriangleCollapsedIcon } from './triangle-collapsed';
|
|
109
108
|
export { default as TriangleExpandedIcon } from './triangle-expanded';
|
|
110
109
|
export { default as UploadIcon } from './upload';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { isMenuSeparator, } from '../lib/menus';
|
|
3
|
-
const initialPointer = [-1, -1, -1];
|
|
3
|
+
const initialPointer = [-1, -1, -1, -1];
|
|
4
4
|
const transformPointer = (depth, index) => (pointer) => pointer.map((pointerPart, i) => {
|
|
5
5
|
if (i === depth) {
|
|
6
6
|
return index;
|
|
@@ -11,7 +11,8 @@ const transformPointer = (depth, index) => (pointer) => pointer.map((pointerPart
|
|
|
11
11
|
return pointerPart;
|
|
12
12
|
});
|
|
13
13
|
const isPart = (pointer, position) => {
|
|
14
|
-
const
|
|
14
|
+
const max = initialPointer.length;
|
|
15
|
+
const limit = position.length < max ? position.length : max;
|
|
15
16
|
for (let i = 0; i < limit; i++) {
|
|
16
17
|
if (position[i] !== pointer[i]) {
|
|
17
18
|
return false;
|
|
@@ -57,7 +58,7 @@ export const useMenus = (menus) => {
|
|
|
57
58
|
}
|
|
58
59
|
if (menu.run) {
|
|
59
60
|
menu.run();
|
|
60
|
-
setPointer(
|
|
61
|
+
setPointer(initialPointer);
|
|
61
62
|
}
|
|
62
63
|
else if (menu.submenu) {
|
|
63
64
|
const depth = indices.length - 1;
|
|
@@ -69,7 +70,7 @@ export const useMenus = (menus) => {
|
|
|
69
70
|
useEffect(() => {
|
|
70
71
|
const handleClickOutside = (event) => {
|
|
71
72
|
if (ref.current && !ref.current.contains(event.target)) {
|
|
72
|
-
setPointer(
|
|
73
|
+
setPointer(initialPointer);
|
|
73
74
|
}
|
|
74
75
|
};
|
|
75
76
|
document.addEventListener('click', handleClickOutside);
|
|
@@ -104,7 +104,6 @@ export { default as ToolbarSymbolIcon } from './toolbar-symbol';
|
|
|
104
104
|
export { default as ToolbarTableIcon } from './toolbar-table';
|
|
105
105
|
export { default as ToolbarUnderlineIcon } from './toolbar-underline';
|
|
106
106
|
export { default as ToolbarUnorderedListIcon } from './toolbar-unordered-list';
|
|
107
|
-
export { default as ToolbarIndentIcon } from './toolbar-indent';
|
|
108
107
|
export { default as TriangleCollapsedIcon } from './triangle-collapsed';
|
|
109
108
|
export { default as TriangleExpandedIcon } from './triangle-expanded';
|
|
110
109
|
export { default as UploadIcon } from './upload';
|
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": "2.1.2
|
|
4
|
+
"version": "2.1.2",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const ToolbarIndentIcon = (props) => (react_1.default.createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
8
|
-
react_1.default.createElement("line", { x1: "13", y1: "6.5", x2: "20", y2: "6.5", stroke: "#6E6E6E", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
9
|
-
react_1.default.createElement("line", { x1: "13", y1: "10.25", x2: "20", y2: "10.25", stroke: "#6E6E6E", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
10
|
-
react_1.default.createElement("line", { x1: "13", y1: "14", x2: "20", y2: "14", stroke: "#6E6E6E", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
11
|
-
react_1.default.createElement("line", { x1: "5.5", y1: "17.75", x2: "20", y2: "17.75", stroke: "#6E6E6E", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
12
|
-
react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.35742 10.5002C8.35742 11.3878 7.98843 12.1074 7.53325 12.1074L3.82445 12.1074C3.36927 12.1074 3.00028 11.3878 3.00028 10.5002C3.00028 9.61261 3.36927 8.89307 3.82445 8.89307L7.53325 8.89307C7.98843 8.89307 8.35742 9.61261 8.35742 10.5002Z", fill: "#6E6E6E" }),
|
|
13
|
-
react_1.default.createElement("path", { d: "M9.94931 10.3645C10.0169 10.4325 10.0169 10.5675 9.94931 10.6355L6.88351 13.7199C6.85861 13.7449 6.84202 13.7484 6.83586 13.7494C6.827 13.7508 6.81287 13.7502 6.79482 13.7416C6.76137 13.7257 6.71429 13.6808 6.71429 13.5844L6.71429 7.41561C6.71429 7.31919 6.76137 7.27433 6.79482 7.25839C6.81287 7.24979 6.827 7.2492 6.83586 7.25059C6.84202 7.25156 6.85861 7.25508 6.88351 7.28013L9.94931 10.3645Z", fill: "#6E6E6E", stroke: "#6E6E6E" })));
|
|
14
|
-
exports.default = ToolbarIndentIcon;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
const ToolbarIndentIcon = (props) => (React.createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
3
|
-
React.createElement("line", { x1: "13", y1: "6.5", x2: "20", y2: "6.5", stroke: "#6E6E6E", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
4
|
-
React.createElement("line", { x1: "13", y1: "10.25", x2: "20", y2: "10.25", stroke: "#6E6E6E", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
5
|
-
React.createElement("line", { x1: "13", y1: "14", x2: "20", y2: "14", stroke: "#6E6E6E", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
6
|
-
React.createElement("line", { x1: "5.5", y1: "17.75", x2: "20", y2: "17.75", stroke: "#6E6E6E", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
7
|
-
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.35742 10.5002C8.35742 11.3878 7.98843 12.1074 7.53325 12.1074L3.82445 12.1074C3.36927 12.1074 3.00028 11.3878 3.00028 10.5002C3.00028 9.61261 3.36927 8.89307 3.82445 8.89307L7.53325 8.89307C7.98843 8.89307 8.35742 9.61261 8.35742 10.5002Z", fill: "#6E6E6E" }),
|
|
8
|
-
React.createElement("path", { d: "M9.94931 10.3645C10.0169 10.4325 10.0169 10.5675 9.94931 10.6355L6.88351 13.7199C6.85861 13.7449 6.84202 13.7484 6.83586 13.7494C6.827 13.7508 6.81287 13.7502 6.79482 13.7416C6.76137 13.7257 6.71429 13.6808 6.71429 13.5844L6.71429 7.41561C6.71429 7.31919 6.76137 7.27433 6.79482 7.25839C6.81287 7.24979 6.827 7.2492 6.83586 7.25059C6.84202 7.25156 6.85861 7.25508 6.88351 7.28013L9.94931 10.3645Z", fill: "#6E6E6E", stroke: "#6E6E6E" })));
|
|
9
|
-
export default ToolbarIndentIcon;
|