@manuscripts/style-guide 2.0.36-LEAN-4314.0 → 2.0.36-LEAN-4311.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.
@@ -32,6 +32,7 @@ const MenuHeading = styled_components_1.default.div `
32
32
  `;
33
33
  const MenuContainer = styled_components_1.default.div `
34
34
  position: relative;
35
+ background: pink;
35
36
 
36
37
  & ${MenuHeading} {
37
38
  background-color: ${(props) => props.theme.colors.background.secondary};
@@ -58,6 +58,7 @@ exports.NestedSubmenusContainer = (0, styled_components_1.default)(exports.Subme
58
58
  position: absolute;
59
59
  top: 0;
60
60
  left: 100%;
61
+ overflow: visible;
61
62
  `;
62
63
  const Separator = styled_components_1.default.div `
63
64
  height: 0;
@@ -80,6 +81,7 @@ const Container = styled_components_1.default.div `
80
81
  align-items: center;
81
82
  cursor: pointer;
82
83
  padding: 8px 16px 8px 4px;
84
+
83
85
  ${(props) => props.isOpen && 'background: #f2fbfc;'}
84
86
 
85
87
  &:hover {
@@ -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.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;
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,7 @@ const transformPointer = (depth, index) => (pointer) => pointer.map((pointerPart
14
14
  return pointerPart;
15
15
  });
16
16
  const isPart = (pointer, position) => {
17
- const limit = position.length < 3 ? position.length : 3;
17
+ const limit = position.length < 4 ? position.length : 4;
18
18
  for (let i = 0; i < limit; i++) {
19
19
  if (position[i] !== pointer[i]) {
20
20
  return false;
@@ -60,7 +60,7 @@ const useMenus = (menus) => {
60
60
  }
61
61
  if (menu.run) {
62
62
  menu.run();
63
- setPointer([-1, -1, -1]);
63
+ setPointer(initialPointer);
64
64
  }
65
65
  else if (menu.submenu) {
66
66
  const depth = indices.length - 1;
@@ -72,7 +72,7 @@ const useMenus = (menus) => {
72
72
  (0, react_1.useEffect)(() => {
73
73
  const handleClickOutside = (event) => {
74
74
  if (ref.current && !ref.current.contains(event.target)) {
75
- setPointer([-1, -1, -1]);
75
+ setPointer(initialPointer);
76
76
  }
77
77
  };
78
78
  document.addEventListener('click', handleClickOutside);
@@ -26,6 +26,7 @@ const MenuHeading = styled.div `
26
26
  `;
27
27
  const MenuContainer = styled.div `
28
28
  position: relative;
29
+ background: pink;
29
30
 
30
31
  & ${MenuHeading} {
31
32
  background-color: ${(props) => props.theme.colors.background.secondary};
@@ -52,6 +52,7 @@ export const NestedSubmenusContainer = styled(SubmenusContainer) `
52
52
  position: absolute;
53
53
  top: 0;
54
54
  left: 100%;
55
+ overflow: visible;
55
56
  `;
56
57
  const Separator = styled.div `
57
58
  height: 0;
@@ -74,6 +75,7 @@ const Container = styled.div `
74
75
  align-items: center;
75
76
  cursor: pointer;
76
77
  padding: 8px 16px 8px 4px;
78
+
77
79
  ${(props) => props.isOpen && 'background: #f2fbfc;'}
78
80
 
79
81
  &:hover {
@@ -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,7 @@ const transformPointer = (depth, index) => (pointer) => pointer.map((pointerPart
11
11
  return pointerPart;
12
12
  });
13
13
  const isPart = (pointer, position) => {
14
- const limit = position.length < 3 ? position.length : 3;
14
+ const limit = position.length < 4 ? position.length : 4;
15
15
  for (let i = 0; i < limit; i++) {
16
16
  if (position[i] !== pointer[i]) {
17
17
  return false;
@@ -57,7 +57,7 @@ export const useMenus = (menus) => {
57
57
  }
58
58
  if (menu.run) {
59
59
  menu.run();
60
- setPointer([-1, -1, -1]);
60
+ setPointer(initialPointer);
61
61
  }
62
62
  else if (menu.submenu) {
63
63
  const depth = indices.length - 1;
@@ -69,7 +69,7 @@ export const useMenus = (menus) => {
69
69
  useEffect(() => {
70
70
  const handleClickOutside = (event) => {
71
71
  if (ref.current && !ref.current.contains(event.target)) {
72
- setPointer([-1, -1, -1]);
72
+ setPointer(initialPointer);
73
73
  }
74
74
  };
75
75
  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';
@@ -41,4 +41,4 @@ export type MenuSeparator = {
41
41
  role: 'separator';
42
42
  };
43
43
  export declare const isMenuSeparator: (menu: any) => menu is MenuSeparator;
44
- export type MenuPointer = [number, number, number];
44
+ export type MenuPointer = [number, number, number, number];
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-4314.0",
4
+ "version": "2.0.36-LEAN-4311.1",
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;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- declare const TickIcon: React.FC<IconProps>;
4
- export default TickIcon;