@manuscripts/style-guide 2.0.36-LEAN-4314.0 → 2.0.36-LEAN-4311.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/tick.js +0 -9
- package/dist/es/components/icons/tick.js +0 -4
- package/dist/types/components/icons/tick.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.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.
|
|
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.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");
|
|
@@ -174,8 +174,6 @@ var slider_on_1 = require("./slider-on");
|
|
|
174
174
|
Object.defineProperty(exports, "SliderOnIcon", { enumerable: true, get: function () { return __importDefault(slider_on_1).default; } });
|
|
175
175
|
var task_step_done_1 = require("./task-step-done");
|
|
176
176
|
Object.defineProperty(exports, "TaskStepDoneIcon", { enumerable: true, get: function () { return __importDefault(task_step_done_1).default; } });
|
|
177
|
-
var tick_1 = require("./tick");
|
|
178
|
-
Object.defineProperty(exports, "TickIcon", { enumerable: true, get: function () { return __importDefault(tick_1).default; } });
|
|
179
177
|
var toolbar_bold_1 = require("./toolbar-bold");
|
|
180
178
|
Object.defineProperty(exports, "ToolbarBoldIcon", { enumerable: true, get: function () { return __importDefault(toolbar_bold_1).default; } });
|
|
181
179
|
var toolbar_citation_1 = require("./toolbar-citation");
|
|
@@ -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);
|
|
@@ -90,7 +90,6 @@ export { default as SectionCategoryIcon } from './section-category';
|
|
|
90
90
|
export { default as SliderOffIcon } from './slider-off';
|
|
91
91
|
export { default as SliderOnIcon } from './slider-on';
|
|
92
92
|
export { default as TaskStepDoneIcon } from './task-step-done';
|
|
93
|
-
export { default as TickIcon } from './tick';
|
|
94
93
|
export { default as ToolbarBoldIcon } from './toolbar-bold';
|
|
95
94
|
export { default as ToolbarCitationIcon } from './toolbar-citation';
|
|
96
95
|
export { default as ToolbarCodeIcon } from './toolbar-code';
|
|
@@ -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);
|
|
@@ -90,7 +90,6 @@ export { default as SectionCategoryIcon } from './section-category';
|
|
|
90
90
|
export { default as SliderOffIcon } from './slider-off';
|
|
91
91
|
export { default as SliderOnIcon } from './slider-on';
|
|
92
92
|
export { default as TaskStepDoneIcon } from './task-step-done';
|
|
93
|
-
export { default as TickIcon } from './tick';
|
|
94
93
|
export { default as ToolbarBoldIcon } from './toolbar-bold';
|
|
95
94
|
export { default as ToolbarCitationIcon } from './toolbar-citation';
|
|
96
95
|
export { default as ToolbarCodeIcon } from './toolbar-code';
|
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.0.36-LEAN-
|
|
4
|
+
"version": "2.0.36-LEAN-4311.2",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -1,9 +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 TickIcon = (props) => (react_1.default.createElement("svg", { width: "14", height: "12", viewBox: "0 0 14 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
8
|
-
react_1.default.createElement("path", { d: "M2.26296 5.27695C1.76426 4.67329 0.958698 4.6576 0.453885 5.25348L0.738765 4.91721C0.238342 5.50791 0.239155 6.4752 0.735001 7.07101L4.1106 11.1271C4.60894 11.726 5.43049 11.7459 5.94204 11.1756L13.2477 3.03111C13.7608 2.45906 13.7755 1.52164 13.2707 0.925762L13.5556 1.26203C13.0552 0.671335 12.228 0.656796 11.7131 1.22411L5.01293 8.60571L2.26296 5.27695Z", fill: "#36B260" })));
|
|
9
|
-
exports.default = TickIcon;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
const TickIcon = (props) => (React.createElement("svg", { width: "14", height: "12", viewBox: "0 0 14 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
3
|
-
React.createElement("path", { d: "M2.26296 5.27695C1.76426 4.67329 0.958698 4.6576 0.453885 5.25348L0.738765 4.91721C0.238342 5.50791 0.239155 6.4752 0.735001 7.07101L4.1106 11.1271C4.60894 11.726 5.43049 11.7459 5.94204 11.1756L13.2477 3.03111C13.7608 2.45906 13.7755 1.52164 13.2707 0.925762L13.5556 1.26203C13.0552 0.671335 12.228 0.656796 11.7131 1.22411L5.01293 8.60571L2.26296 5.27695Z", fill: "#36B260" })));
|
|
4
|
-
export default TickIcon;
|