@activecollab/components 2.0.573 → 2.0.575
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/Icons/collection/Bitbucket.js +47 -0
- package/dist/cjs/components/Icons/collection/Bitbucket.js.map +1 -0
- package/dist/cjs/components/Icons/collection/index.js +7 -0
- package/dist/cjs/components/Icons/collection/index.js.map +1 -1
- package/dist/cjs/components/MainMenu/MainMenu.js +44 -40
- package/dist/cjs/components/MainMenu/MainMenu.js.map +1 -1
- package/dist/cjs/components/MainMenu/MainMenuSettings.js +112 -0
- package/dist/cjs/components/MainMenu/MainMenuSettings.js.map +1 -0
- package/dist/cjs/components/MainMenu/Styles.js +8 -3
- package/dist/cjs/components/MainMenu/Styles.js.map +1 -1
- package/dist/cjs/components/MainMenu/hooks.js +1 -9
- package/dist/cjs/components/MainMenu/hooks.js.map +1 -1
- package/dist/cjs/components/MainMenu/types.js +4 -2
- package/dist/cjs/components/MainMenu/types.js.map +1 -1
- package/dist/cjs/components/ScrollArea/ScrollArea.js +5 -3
- package/dist/cjs/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/cjs/components/ViewSettings/Styles.js +21 -0
- package/dist/cjs/components/ViewSettings/Styles.js.map +1 -0
- package/dist/cjs/components/ViewSettings/ViewSettings.js +35 -0
- package/dist/cjs/components/ViewSettings/ViewSettings.js.map +1 -0
- package/dist/cjs/components/ViewSettings/index.js +17 -0
- package/dist/cjs/components/ViewSettings/index.js.map +1 -0
- package/dist/cjs/components/index.js +12 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/esm/components/Icons/collection/Bitbucket.d.ts +17 -0
- package/dist/esm/components/Icons/collection/Bitbucket.d.ts.map +1 -0
- package/dist/esm/components/Icons/collection/Bitbucket.js +40 -0
- package/dist/esm/components/Icons/collection/Bitbucket.js.map +1 -0
- package/dist/esm/components/Icons/collection/index.d.ts +1 -0
- package/dist/esm/components/Icons/collection/index.d.ts.map +1 -1
- package/dist/esm/components/Icons/collection/index.js +1 -0
- package/dist/esm/components/Icons/collection/index.js.map +1 -1
- package/dist/esm/components/MainMenu/MainMenu.d.ts +6 -4
- package/dist/esm/components/MainMenu/MainMenu.d.ts.map +1 -1
- package/dist/esm/components/MainMenu/MainMenu.js +39 -40
- package/dist/esm/components/MainMenu/MainMenu.js.map +1 -1
- package/dist/esm/components/MainMenu/MainMenuSettings.d.ts +14 -0
- package/dist/esm/components/MainMenu/MainMenuSettings.d.ts.map +1 -0
- package/dist/esm/components/MainMenu/MainMenuSettings.js +84 -0
- package/dist/esm/components/MainMenu/MainMenuSettings.js.map +1 -0
- package/dist/esm/components/MainMenu/Styles.d.ts +11 -0
- package/dist/esm/components/MainMenu/Styles.d.ts.map +1 -1
- package/dist/esm/components/MainMenu/Styles.js +7 -2
- package/dist/esm/components/MainMenu/Styles.js.map +1 -1
- package/dist/esm/components/MainMenu/hooks.d.ts.map +1 -1
- package/dist/esm/components/MainMenu/hooks.js +1 -8
- package/dist/esm/components/MainMenu/hooks.js.map +1 -1
- package/dist/esm/components/MainMenu/types.d.ts +4 -2
- package/dist/esm/components/MainMenu/types.d.ts.map +1 -1
- package/dist/esm/components/MainMenu/types.js +4 -2
- package/dist/esm/components/MainMenu/types.js.map +1 -1
- package/dist/esm/components/ScrollArea/ScrollArea.d.ts +2 -0
- package/dist/esm/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/esm/components/ScrollArea/ScrollArea.js +5 -3
- package/dist/esm/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/esm/components/ViewSettings/Styles.d.ts +3 -0
- package/dist/esm/components/ViewSettings/Styles.d.ts.map +1 -0
- package/dist/esm/components/ViewSettings/Styles.js +15 -0
- package/dist/esm/components/ViewSettings/Styles.js.map +1 -0
- package/dist/esm/components/ViewSettings/ViewSettings.d.ts +8 -0
- package/dist/esm/components/ViewSettings/ViewSettings.d.ts.map +1 -0
- package/dist/esm/components/ViewSettings/ViewSettings.js +26 -0
- package/dist/esm/components/ViewSettings/ViewSettings.js.map +1 -0
- package/dist/esm/components/ViewSettings/index.d.ts +2 -0
- package/dist/esm/components/ViewSettings/index.d.ts.map +1 -0
- package/dist/esm/components/ViewSettings/index.js +2 -0
- package/dist/esm/components/ViewSettings/index.js.map +1 -0
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/index.js +1079 -913
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
|
+
import { StyledSettingsList } from "./Styles";
|
|
3
|
+
import { Checkbox } from "../Checkbox";
|
|
4
|
+
import { IconButton } from "../IconButton";
|
|
5
|
+
import { SettingsIcon } from "../Icons";
|
|
6
|
+
import { ListItem, ListSeparator } from "../List";
|
|
7
|
+
import { Menu } from "../Menu";
|
|
8
|
+
import { RadioButton } from "../RadioButton";
|
|
9
|
+
import { Tooltip } from "../Tooltip";
|
|
10
|
+
const SETTINGS_MENU_WIDTH = 216;
|
|
11
|
+
/** The Settings button of the menu header: the menu width, Auto-Expand of the compact menu, and Customize Menu. */
|
|
12
|
+
export const MainMenuSettings = _ref => {
|
|
13
|
+
let collapsed = _ref.collapsed,
|
|
14
|
+
autoExpand = _ref.autoExpand,
|
|
15
|
+
onCollapsedChange = _ref.onCollapsedChange,
|
|
16
|
+
onAutoExpandChange = _ref.onAutoExpandChange,
|
|
17
|
+
onCustomize = _ref.onCustomize,
|
|
18
|
+
labels = _ref.labels,
|
|
19
|
+
buttonRef = _ref.buttonRef;
|
|
20
|
+
const _useState = useState(false),
|
|
21
|
+
open = _useState[0],
|
|
22
|
+
setOpen = _useState[1];
|
|
23
|
+
const handleOpen = useCallback(() => setOpen(true), []);
|
|
24
|
+
const handleClose = useCallback(() => setOpen(false), []);
|
|
25
|
+
const select = action => () => {
|
|
26
|
+
setOpen(false);
|
|
27
|
+
action();
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// The row takes the click, and the control only shows the state, so one press changes it once.
|
|
31
|
+
const row = (id, label, control, onSelect) => /*#__PURE__*/React.createElement(ListItem, {
|
|
32
|
+
key: id,
|
|
33
|
+
className: "main-menu-settings-row",
|
|
34
|
+
"data-testid": "main-menu-settings-" + id,
|
|
35
|
+
onClick: select(onSelect),
|
|
36
|
+
onKeyDown: event => {
|
|
37
|
+
if (event.key === "Enter") {
|
|
38
|
+
event.currentTarget.click();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
42
|
+
className: "main-menu-settings-text"
|
|
43
|
+
}, label), control);
|
|
44
|
+
return /*#__PURE__*/React.createElement(Menu, {
|
|
45
|
+
open: open,
|
|
46
|
+
onOpen: handleOpen,
|
|
47
|
+
onClose: handleClose,
|
|
48
|
+
width: SETTINGS_MENU_WIDTH,
|
|
49
|
+
target: /*#__PURE__*/React.createElement(Tooltip, {
|
|
50
|
+
title: labels.settings
|
|
51
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
52
|
+
ref: buttonRef,
|
|
53
|
+
variant: "text gray",
|
|
54
|
+
onClick: handleOpen,
|
|
55
|
+
"aria-label": labels.settings,
|
|
56
|
+
"aria-haspopup": "menu",
|
|
57
|
+
"aria-expanded": open,
|
|
58
|
+
className: "main-menu-edit-button",
|
|
59
|
+
size: "small"
|
|
60
|
+
}, /*#__PURE__*/React.createElement(SettingsIcon, {
|
|
61
|
+
width: 20,
|
|
62
|
+
height: 20
|
|
63
|
+
})))
|
|
64
|
+
}, /*#__PURE__*/React.createElement(StyledSettingsList, {
|
|
65
|
+
"data-autofocus": true,
|
|
66
|
+
tabIndex: -1
|
|
67
|
+
}, row("wide", labels.wideMenu, /*#__PURE__*/React.createElement(RadioButton, {
|
|
68
|
+
checked: !collapsed,
|
|
69
|
+
readOnly: true,
|
|
70
|
+
tabIndex: -1,
|
|
71
|
+
className: "main-menu-settings-control"
|
|
72
|
+
}), () => onCollapsedChange(false)), row("compact", labels.compactMenu, /*#__PURE__*/React.createElement(RadioButton, {
|
|
73
|
+
checked: collapsed,
|
|
74
|
+
readOnly: true,
|
|
75
|
+
tabIndex: -1,
|
|
76
|
+
className: "main-menu-settings-control"
|
|
77
|
+
}), () => onCollapsedChange(true)), collapsed && onAutoExpandChange ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ListSeparator, null), row("auto-expand", labels.autoExpand, /*#__PURE__*/React.createElement(Checkbox, {
|
|
78
|
+
checked: autoExpand,
|
|
79
|
+
readOnly: true,
|
|
80
|
+
tabIndex: -1,
|
|
81
|
+
className: "main-menu-settings-control"
|
|
82
|
+
}), () => onAutoExpandChange(!autoExpand))) : null, /*#__PURE__*/React.createElement(ListSeparator, null), row("customize", labels.customizeMenu, null, onCustomize)));
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=MainMenuSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MainMenuSettings.js","names":["React","useCallback","useState","StyledSettingsList","Checkbox","IconButton","SettingsIcon","ListItem","ListSeparator","Menu","RadioButton","Tooltip","SETTINGS_MENU_WIDTH","MainMenuSettings","_ref","collapsed","autoExpand","onCollapsedChange","onAutoExpandChange","onCustomize","labels","buttonRef","_useState","open","setOpen","handleOpen","handleClose","select","action","row","id","label","control","onSelect","createElement","key","className","onClick","onKeyDown","event","currentTarget","click","onOpen","onClose","width","target","title","settings","ref","variant","size","height","tabIndex","wideMenu","checked","readOnly","compactMenu","Fragment","customizeMenu"],"sources":["../../../../src/components/MainMenu/MainMenuSettings.tsx"],"sourcesContent":["import React, { ReactElement, Ref, useCallback, useState } from \"react\";\n\nimport { StyledSettingsList } from \"./Styles\";\nimport { IMainMenuLabels } from \"./types\";\nimport { Checkbox } from \"../Checkbox\";\nimport { IconButton } from \"../IconButton\";\nimport { SettingsIcon } from \"../Icons\";\nimport { ListItem, ListSeparator } from \"../List\";\nimport { Menu } from \"../Menu\";\nimport { RadioButton } from \"../RadioButton\";\nimport { Tooltip } from \"../Tooltip\";\n\nconst SETTINGS_MENU_WIDTH = 216;\n\nexport interface IMainMenuSettingsProps {\n collapsed: boolean;\n autoExpand: boolean;\n onCollapsedChange: (collapsed: boolean) => void;\n onAutoExpandChange?: (autoExpand: boolean) => void;\n onCustomize: () => void;\n labels: IMainMenuLabels;\n buttonRef?: Ref<HTMLButtonElement>;\n}\n\n/** The Settings button of the menu header: the menu width, Auto-Expand of the compact menu, and Customize Menu. */\nexport const MainMenuSettings = ({\n collapsed,\n autoExpand,\n onCollapsedChange,\n onAutoExpandChange,\n onCustomize,\n labels,\n buttonRef,\n}: IMainMenuSettingsProps): ReactElement => {\n const [open, setOpen] = useState(false);\n const handleOpen = useCallback(() => setOpen(true), []);\n const handleClose = useCallback(() => setOpen(false), []);\n\n const select = (action: () => void) => () => {\n setOpen(false);\n action();\n };\n\n // The row takes the click, and the control only shows the state, so one press changes it once.\n const row = (\n id: string,\n label: string,\n control: ReactElement | null,\n onSelect: () => void\n ) => (\n <ListItem\n key={id}\n className=\"main-menu-settings-row\"\n data-testid={`main-menu-settings-${id}`}\n onClick={select(onSelect)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n event.currentTarget.click();\n }\n }}\n >\n <span className=\"main-menu-settings-text\">{label}</span>\n {control}\n </ListItem>\n );\n\n return (\n <Menu\n open={open}\n onOpen={handleOpen}\n onClose={handleClose}\n width={SETTINGS_MENU_WIDTH}\n target={\n <Tooltip title={labels.settings}>\n <IconButton\n ref={buttonRef}\n variant=\"text gray\"\n onClick={handleOpen}\n aria-label={labels.settings}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n className=\"main-menu-edit-button\"\n size=\"small\"\n >\n <SettingsIcon width={20} height={20} />\n </IconButton>\n </Tooltip>\n }\n >\n {/* A focused first row looks hovered, so the focus lock starts on the list. */}\n <StyledSettingsList data-autofocus tabIndex={-1}>\n {row(\n \"wide\",\n labels.wideMenu,\n <RadioButton\n checked={!collapsed}\n readOnly\n tabIndex={-1}\n className=\"main-menu-settings-control\"\n />,\n () => onCollapsedChange(false)\n )}\n {row(\n \"compact\",\n labels.compactMenu,\n <RadioButton\n checked={collapsed}\n readOnly\n tabIndex={-1}\n className=\"main-menu-settings-control\"\n />,\n () => onCollapsedChange(true)\n )}\n {collapsed && onAutoExpandChange ? (\n <>\n <ListSeparator />\n {row(\n \"auto-expand\",\n labels.autoExpand,\n <Checkbox\n checked={autoExpand}\n readOnly\n tabIndex={-1}\n className=\"main-menu-settings-control\"\n />,\n () => onAutoExpandChange(!autoExpand)\n )}\n </>\n ) : null}\n <ListSeparator />\n {row(\"customize\", labels.customizeMenu, null, onCustomize)}\n </StyledSettingsList>\n </Menu>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAuBC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAEvE,SAASC,kBAAkB,QAAQ,UAAU;AAE7C,SAASC,QAAQ,QAAQ,aAAa;AACtC,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,YAAY,QAAQ,UAAU;AACvC,SAASC,QAAQ,EAAEC,aAAa,QAAQ,SAAS;AACjD,SAASC,IAAI,QAAQ,SAAS;AAC9B,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,OAAO,QAAQ,YAAY;AAEpC,MAAMC,mBAAmB,GAAG,GAAG;AAY/B;AACA,OAAO,MAAMC,gBAAgB,GAAGC,IAAA,IAQY;EAAA,IAP1CC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IACVC,iBAAiB,GAAAH,IAAA,CAAjBG,iBAAiB;IACjBC,kBAAkB,GAAAJ,IAAA,CAAlBI,kBAAkB;IAClBC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IACXC,MAAM,GAAAN,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Q;IACRH,QAAQ,EAAE,CAAC,CAAE;IACbhB,SAAS,EAAC;EAA4B,CACvC,CAAC,EACF,MAAMlB,kBAAkB,CAAC,CAACF,UAAU,CACtC,CACA,CAAC,GACD,IAAI,eACRhB,KAAA,CAAAkC,aAAA,CAAC1B,aAAa,MAAE,CAAC,EAChBqB,GAAG,CAAC,WAAW,EAAET,MAAM,CAACsC,aAAa,EAAE,IAAI,EAAEvC,WAAW,CACvC,CAChB,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -16,6 +16,17 @@ export declare const StyledHelpList: import("styled-components").StyledComponent
|
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
}, any, {}, never>;
|
|
19
|
+
export declare const StyledSettingsList: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").ListProps & {
|
|
20
|
+
children?: import("react").ReactNode | undefined;
|
|
21
|
+
} & import("react").HTMLAttributes<HTMLUListElement> & import("react").RefAttributes<HTMLUListElement>> & {
|
|
22
|
+
Item: import("react").ForwardRefExoticComponent<import("..").ListItemProps & {
|
|
23
|
+
children?: import("react").ReactNode | undefined;
|
|
24
|
+
} & import("react").HTMLAttributes<HTMLLIElement> & import("react").RefAttributes<HTMLLIElement>>;
|
|
25
|
+
Separator: {
|
|
26
|
+
({ className, ...props }: import("react").HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
}, any, {}, never>;
|
|
19
30
|
export declare const StyledFavoritesMenuList: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").ListProps & {
|
|
20
31
|
children?: import("react").ReactNode | undefined;
|
|
21
32
|
} & import("react").HTMLAttributes<HTMLUListElement> & import("react").RefAttributes<HTMLUListElement>> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/MainMenu/Styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,EAAE,UAAU,CAAC;AAC1B,eAAO,MAAM,EAAE,WAAW,CAAC;AAC3B,eAAO,MAAM,aAAa,wBAAuB,CAAC;AAClD,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,cAAc,MAAM,CAAC;AAMlC,eAAO,MAAM,mBAAmB,gGAI/B,CAAC;AAEF,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/MainMenu/Styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,EAAE,UAAU,CAAC;AAC1B,eAAO,MAAM,EAAE,WAAW,CAAC;AAC3B,eAAO,MAAM,aAAa,wBAAuB,CAAC;AAClD,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,cAAc,MAAM,CAAC;AAMlC,eAAO,MAAM,mBAAmB,gGAI/B,CAAC;AAEF,eAAO,MAAM,cAAc,oEAg2B1B,CAAC;AAKF,eAAO,MAAM,cAAc;;;;;;;;;;kBAiD1B,CAAC;AAIF,eAAO,MAAM,kBAAkB;;;;;;;;;;kBA4B9B,CAAC;AAKF,eAAO,MAAM,uBAAuB;;;;;;;;;;kBA4CnC,CAAC"}
|
|
@@ -14,7 +14,7 @@ export const MainMenuGlobalStyle = createGlobalStyle([".c-main-menu-favorites-po
|
|
|
14
14
|
export const StyledMainMenu = styled.div.withConfig({
|
|
15
15
|
displayName: "Styles__StyledMainMenu",
|
|
16
16
|
componentId: "sc-17ibzh0-0"
|
|
17
|
-
})(["", " &.c-main-menu--desktop{position:relative;left:10px;display:none;flex-direction:column;flex-shrink:0;height:100%;margin-right:4px;@media (min-width:", "){display:flex;}}&.c-main-menu--drawer{height:100%;}&.expanded{width:", "px;}&.collapsed{width:", "px;}&.expanded,&.collapsed{transition:width ", ";@media (max-width:", "){width:", "px;}}&.c-main-menu--drawer.c-main-menu--drawer{width:", "px;}.main-menu-panel{display:flex;flex:1;flex-direction:column;min-height:0;}&.main-menu-peek{width:", "px;}&.main-menu-peek .main-menu-panel{position:absolute;top:0;bottom:0;left:0;z-index:0;width:", "px;clip-path:inset( -100px ", "px -100px -100px );transition:clip-path 200ms cubic-bezier(0.25,0.46,0.45,0.94);&::before{content:\"\";position:absolute;inset:0 0 0 -10px;z-index:-1;background-color:var(--body-bg-main);box-shadow:var(--shadow-popover);}}&.main-menu-peek-open .main-menu-panel{clip-path:inset(-100px);}&.main-menu-peek::after{content:\"\";position:absolute;top:0;bottom:0;left:-10px;z-index:-1;width:", "px;}@media (prefers-reduced-motion:reduce){&.main-menu-peek .main-menu-panel{transition-duration:1ms;}}.main-menu-header{position:relative;display:flex;align-items:center;height:68px;overflow:hidden;}&.c-main-menu--desktop .main-menu-header{left:-10px;}.main-logo-url{position:absolute;left:30px;color:var(--color-secondary);path{fill:var(--color-secondary);transition:fill ", ";}&:hover path,&:focus-visible path{fill:var(--color-theme-900);}}.main-logo-long{transition:all ", ";#logotype{opacity:1;transition:all ", ";will-change:opacity,transform;@media (max-width:", "){opacity:0;transform:translateX(-5%);}}}.main-logo-long__collapsed #logotype{opacity:0;transform:translateX(-5%);}.main-menu-collapse-tab{position:absolute;top:8px;left:-10px;z-index:4;display:none;width:30px;height:48px;margin:0;padding:0;border:0;background:none;font:inherit;cursor:pointer;@media (min-width:", "){display:block;}}.main-menu-collapse-tab-face{position:absolute;top:50%;left:0;display:flex;align-items:center;gap:6px;height:27px;max-width:4px;margin-top:-0.5px;padding:0;overflow:hidden;border-radius:0 4px 4px 0;background:var(--color-theme-500);white-space:nowrap;opacity:0;transform:translateY(-50%);transition:all 180ms ease;}.main-menu-collapse-tab-icon,.main-menu-collapse-tab-label{opacity:0;transition:opacity 150ms ease,", ";}.main-menu-collapse-tab-icon{flex-shrink:0;fill:var(--color-theme-700);}.main-menu-collapse-tab.is-collapsed .main-menu-collapse-tab-icon{transform:rotate(180deg);}.main-menu-collapse-tab-label{color:var(--color-theme-900);font-size:12px;font-weight:600;line-height:16px;}&:hover .main-menu-collapse-tab-face,&:has(:focus-visible) .main-menu-collapse-tab-face,&.touch .main-menu-collapse-tab-face{opacity:1;}@media (hover:none){.main-menu-collapse-tab-face{opacity:1;}}.main-menu-collapse-tab:hover .main-menu-collapse-tab-face,.main-menu-collapse-tab:focus-visible .main-menu-collapse-tab-face{height:39px;max-width:120px;padding:0 14px 0 10px;border:1px solid var(--popover-border);border-left:0;border-radius:0 10px 10px 0;background:linear-gradient( 180deg,var(--page-paper-main),color-mix(in srgb,var(--page-paper-main) 92%,var(--color-theme-500)) );box-shadow:0 1px 2px rgba(0,0,0,0.14),0 4px 14px rgba(0,0,0,0.145),inset 0 1px 0 rgba(255,255,255,0.07);opacity:1;}.main-menu-collapse-tab:hover .main-menu-collapse-tab-icon,.main-menu-collapse-tab:hover .main-menu-collapse-tab-label,.main-menu-collapse-tab:focus-visible .main-menu-collapse-tab-icon,.main-menu-collapse-tab:focus-visible .main-menu-collapse-tab-label{opacity:1;}.main-menu-edit-button.main-menu-edit-button{opacity:0;transition:opacity ", ";}.main-menu-header .main-menu-edit-button.main-menu-edit-button{position:absolute;right:6px;transform:translateY(-2px);svg{fill:var(--color-theme-500);}&:hover svg,&:focus-visible svg{fill:var(--color-theme-900);}}&:hover .main-menu-edit-button.main-menu-edit-button,&:has(:focus-visible) .main-menu-edit-button.main-menu-edit-button,&.touch .main-menu-edit-button.main-menu-edit-button{opacity:1;}@media (hover:none){.main-menu-edit-button.main-menu-edit-button{opacity:1;}}&.collapsed .main-menu-edit-button.main-menu-edit-button{visibility:hidden;}@media (max-width:", "){&:not(.c-main-menu--drawer) .main-menu-edit-button.main-menu-edit-button{visibility:hidden;}}.main-menu-socket{display:flex;flex:1 1 0%;flex-direction:column;height:100%;overflow-y:auto;}&.c-main-menu--drawer .main-menu-socket{height:calc(100dvh - 72px);}.main-menu-items{display:flex;flex-grow:1;min-height:0;}.main-menu-items-inner{margin:12px 0;overflow-x:hidden;}.main-menu-item-icon{flex-shrink:0;fill:var(--color-theme-700);opacity:0.7;}.main-menu-item{display:flex;align-items:center;height:40px;margin:0 12px 2px;padding:0 4px 0 12px;border-radius:var(--ac-br-8);text-decoration:none;&:hover{background-color:var(--color-theme-300);transition:all ", ";.main-menu-item-icon{fill:var(--color-theme-900);opacity:1;}.main-menu-item-text{color:var(--color-theme-900);}}&.main-menu-item-current{background-color:var(--color-secondary-200);.main-menu-item-icon{fill:var(--color-secondary);opacity:1;}.main-menu-item-text{color:var(--color-secondary);}}}.main-menu-item--between{justify-content:space-between;}.main-menu-item-start{display:flex;align-items:center;}.main-menu-item-label{min-width:0;margin-left:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.main-menu-projects{position:relative;}.main-menu-subnav.main-menu-subnav{padding:2px 0;.main-menu-subnav-item{margin:0;padding-right:0;padding-left:0;&:hover{background-color:unset;}}.main-menu-subnav-item-icon{flex-shrink:0;margin-right:8px;opacity:0.5;fill:var(--color-theme-700);}.main-menu-subnav-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.main-menu-item{width:100%;min-width:0;height:32px;margin-right:12px;margin-left:22px;padding:8px;}.main-menu-item:hover{.main-menu-subnav-item-icon{fill:var(--color-theme-900);}.main-menu-subnav-item-text{color:var(--color-theme-900);}}.main-menu-subnav-item-active,.main-menu-subnav-item-active:hover{background-color:var(--color-secondary-200);.main-menu-subnav-item-icon{fill:var(--color-secondary);}.main-menu-subnav-item-text{color:var(--color-secondary);}}}.menu-section-text{opacity:0.7;}.main-menu-item-text,.menu-section{transition:all ", ";}.menu-section{position:relative;display:flex;align-items:center;justify-content:space-between;margin:0 12px 8px;padding:0 4px 0 12px;clip-path:inset(-4px);}&.expanded{.main-menu-item-text{opacity:1;visibility:visible;}.menu-section{max-height:32px;opacity:1;}}&.collapsed{.main-menu-item-text{opacity:0;visibility:hidden;}.menu-section{max-height:0;opacity:0;}}@media (max-width:", "){&.collapsed .menu-section,&.expanded .menu-section{max-height:0;opacity:0;}&.collapsed .main-menu-item-text,&.expanded .main-menu-item-text{width:0;opacity:0;visibility:hidden;}&.c-main-menu--drawer.expanded{.menu-section{max-height:32px;opacity:1;}.main-menu-item-text{width:auto;opacity:1;visibility:visible;}}}.favorite-projects-menu-target{position:absolute;top:0;right:0;z-index:1;display:none;align-items:center;justify-content:center;width:10px;height:40px;border-radius:4px;cursor:pointer;&.collapsed{display:flex;}@media (max-width:", "){display:flex;}svg{transform:rotate(180deg);}}&.main-menu-can-peek:not(.main-menu-peek-open) .favorite-projects-menu-target{display:none;}&.main-menu-peek-open .favorite-projects-menu-target.collapsed{top:8px;right:16px;width:24px;height:24px;}.favorite-projects-menu-target:hover{background-color:var(--color-theme-300);svg{fill:var(--color-theme-900);}}.main-menu-item-current + .favorite-projects-menu-target:hover,.favorite-projects-menu-target.open{background-color:var(--color-secondary-200);svg{fill:var(--color-secondary);}}.main-menu-toggle{flex-shrink:0;transition:", ";&.is-closed{transform:rotate(180deg);}}.favorite-projects-list,.favorite-projects-list-target{display:flex;&.collapsed{display:none;}@media (max-width:", "){display:none;}}.favorite-projects-list-target{margin-left:auto;}&.c-main-menu--drawer{.favorite-projects-list.favorite-projects-list,.favorite-projects-list-target.is-mobile{display:flex;}}.favorite-projects-list{opacity:1;overflow:hidden;transition:all ", ";}.favorite-projects-list-collapsed{opacity:0;transition:all ", ";}.show-hidden-options-long{display:block;margin:12px 24px;cursor:pointer;&.collapsed{display:none;}@media (max-width:", "){display:none;}}.show-hidden-options-short{display:none;margin:12px 0;cursor:pointer;&.collapsed{display:block;}@media (max-width:", "){display:block;}}&.c-main-menu--drawer{.show-hidden-options-long.show-hidden-options-long{display:block;}.show-hidden-options-short.show-hidden-options-short{display:none;}}.main-menu-shortcuts{position:relative;}.shortcuts-expander{margin-left:auto;cursor:pointer;}.shortcuts-expander-collapsed{position:absolute;top:-11px;right:0;left:0;display:none;margin:0 auto;border-radius:100%;background-color:var(--body-bg-main);cursor:pointer;&.collapsed{display:block;}@media (max-width:", "){display:block;}}.shortcuts-list-separator.c-list-separator{margin:16px 12px 12px;transition:margin ", ";&.collapsed{margin:20px 12px;}@media (max-width:", "){margin:20px 12px;}}.add-shortcut{cursor:pointer;.main-menu-item-text.main-menu-item-text{color:var(--color-secondary);}.main-menu-item-icon.main-menu-item-icon{fill:var(--color-secondary);opacity:1;}&:hover{background-color:var(--color-primary-200);}&:focus{background-color:var(--color-primary-300);outline:none;}}.main-menu-item.main-menu-help{position:relative;flex-shrink:0;margin-top:16px;margin-bottom:16px;&:hover{cursor:pointer;}}.main-menu-help .main-menu-toggle.is-hidden{display:none;}.main-menu-item.main-menu-help--promo,.main-menu-item.main-menu-help--promo:hover,.main-menu-item.main-menu-help--promo.main-menu-item-current{background-color:var(--color-primary);}.main-menu-help-promo{display:flex;align-items:center;gap:12px;}.main-menu-help-promo-icon{flex-shrink:0;fill:var(--page-paper-main);}.main-menu-help-promo-text{display:flex;visibility:visible;@media (min-width:", "){visibility:hidden;}@media (min-width:", "){visibility:visible;}}.main-menu-help-badge.main-menu-help-badge{position:absolute;top:16px;right:4px;margin-right:8px;margin-left:auto;@media (min-width:", "){top:0;right:auto;left:0;}&.is-promo{right:6px;@media (min-width:", "){right:auto;}}&.is-static{@media (min-width:", "){position:static;}}}.main-menu-editor{display:flex;flex-direction:column;flex-grow:1;min-height:0;outline:none;}.main-menu-editor-header{margin-top:12px;}.main-menu-editor-action{margin-right:4px;}.main-menu-editor-list{display:flex;flex-grow:1;min-height:0;}.main-menu-editor-list-inner{overflow-x:hidden;}.main-menu-editor-row.c-list-item{margin:0 0 2px;padding-right:12px;padding-left:8px;}.main-menu-editor-row-box{width:100%;border-radius:var(--ac-br-8);}.main-menu-editor-row-inner{display:flex;align-items:center;width:100%;}.main-menu-editor-handle{margin-right:4px;cursor:move;}.main-menu-edit-item{display:flex;align-items:center;justify-content:space-between;width:100%;max-width:204px;height:40px;padding-right:4px;text-decoration:none;}.main-menu-edit-item-start{display:flex;align-items:center;min-width:0;}.main-menu-edit-item.hidden{.main-menu-item-icon,.main-menu-item-text{opacity:0.4;}}.main-menu-editor-shortcuts-title{display:flex;align-items:center;height:24px;margin:0 12px 8px;padding:0 12px;}.main-menu-drawer-close{position:absolute;top:16px;right:16px;@media (min-width:", "){display:none;}}"], BoxSizingStyle, SM, EXPANDED_WIDTH, COLLAPSED_WIDTH, TRANSITION, XL, COLLAPSED_WIDTH, EXPANDED_WIDTH, COLLAPSED_WIDTH, EXPANDED_WIDTH, EXPANDED_WIDTH - COLLAPSED_WIDTH, EXPANDED_WIDTH + 10, TRANSITION, TRANSITION, TRANSITION, XL, XL, TOGGLE_TRANSITION, TRANSITION, XL, TRANSITION, TRANSITION, XL, XL, TOGGLE_TRANSITION, XL, TRANSITION, TRANSITION, XL, XL, XL, TRANSITION, XL, SM, XL, SM, SM, XL, SM);
|
|
17
|
+
})(["", " &.c-main-menu--desktop{position:relative;left:10px;display:none;flex-direction:column;flex-shrink:0;height:100%;margin-right:4px;@media (min-width:", "){display:flex;}}&.c-main-menu--drawer{height:100%;}&.expanded{width:", "px;}&.collapsed{width:", "px;}&.expanded,&.collapsed{transition:width ", ";@media (max-width:", "){width:", "px;}}&.c-main-menu--drawer.c-main-menu--drawer{width:", "px;}&.main-menu-instant-width{transition:none;}.main-menu-panel{display:flex;flex:1;flex-direction:column;min-height:0;}&.main-menu-peek{width:", "px;}&.main-menu-peek .main-menu-panel{position:absolute;top:0;bottom:0;left:0;z-index:0;width:", "px;clip-path:inset( -100px ", "px -100px -100px );transition:clip-path 200ms cubic-bezier(0.25,0.46,0.45,0.94);&::before{content:\"\";position:absolute;inset:0 0 0 -10px;z-index:-1;background-color:var(--body-bg-main);box-shadow:var(--shadow-popover);}}&.main-menu-peek-open .main-menu-panel{clip-path:inset(-100px);}&.main-menu-peek::after{content:\"\";position:absolute;top:0;bottom:0;left:-10px;z-index:-1;width:", "px;}@media (prefers-reduced-motion:reduce){&.main-menu-peek .main-menu-panel{transition-duration:1ms;}}.main-menu-header{position:relative;display:flex;align-items:center;height:68px;overflow:hidden;}&.c-main-menu--desktop .main-menu-header{left:-10px;}.main-logo-url{position:absolute;left:30px;color:var(--color-secondary);path{fill:var(--color-secondary);transition:fill ", ";}&:hover path,&:focus-visible path{fill:var(--color-theme-900);}}.main-logo-long{transition:all ", ";#logotype{opacity:1;transition:all ", ";will-change:opacity,transform;@media (max-width:", "){opacity:0;transform:translateX(-5%);}}}.main-logo-long__collapsed #logotype{opacity:0;transform:translateX(-5%);}.main-menu-edit-button.main-menu-edit-button{opacity:0;transition:opacity ", ";}.main-menu-header .main-menu-edit-button.main-menu-edit-button{position:absolute;right:6px;transform:translateY(-2px);svg{fill:var(--color-theme-500);}&:hover svg,&:focus-visible svg{fill:var(--color-theme-900);}}&:hover .main-menu-edit-button.main-menu-edit-button,&:has(:focus-visible) .main-menu-edit-button.main-menu-edit-button,&.touch .main-menu-edit-button.main-menu-edit-button,.main-menu-edit-button.main-menu-edit-button[aria-expanded=\"true\"]{opacity:1;}@media (hover:none){.main-menu-edit-button.main-menu-edit-button{opacity:1;}}&.collapsed.main-menu-can-peek .main-menu-edit-button.main-menu-edit-button{visibility:hidden;}&.collapsed:not(.main-menu-can-peek) .main-menu-header .main-menu-edit-button.main-menu-edit-button{top:18px;right:auto;left:0;z-index:1;display:flex;align-items:center;justify-content:flex-end;width:4px;min-width:0;height:27px;padding:0;overflow:visible;border:0;border-radius:0 4px 4px 0;background:var(--color-theme-500);opacity:1;transform:none;transition:top 180ms ease,width 180ms ease,height 180ms ease,border-radius 180ms ease,box-shadow 180ms ease;&::before{content:\"\";position:absolute;inset:-10px -22px -10px 0;}svg{flex-shrink:0;opacity:0;transition:opacity 150ms ease;}&:hover,&:focus-visible,&[aria-expanded=\"true\"]{top:12px;width:40px;height:39px;padding:0 9px 0 0;border:1px solid var(--popover-border);border-left:0;border-radius:0 10px 10px 0;background:linear-gradient( 180deg,var(--page-paper-main),color-mix(in srgb,var(--page-paper-main) 92%,var(--color-theme-500)) );box-shadow:0 1px 2px rgba(0,0,0,0.14),0 4px 14px rgba(0,0,0,0.145),inset 0 1px 0 rgba(255,255,255,0.07);svg{opacity:1;}}}@media (max-width:", "){&:not(.c-main-menu--drawer) .main-menu-edit-button.main-menu-edit-button{visibility:hidden;}}.main-menu-socket{display:flex;flex:1 1 0%;flex-direction:column;height:100%;overflow-y:auto;}&.c-main-menu--drawer .main-menu-socket{height:calc(100dvh - 72px);}.main-menu-items{display:flex;flex-grow:1;min-height:0;}.main-menu-items-inner{margin:12px 0;overflow-x:hidden;}.main-menu-item-icon{flex-shrink:0;fill:var(--color-theme-700);opacity:0.7;}.main-menu-item{display:flex;align-items:center;height:40px;margin:0 12px 2px;padding:0 4px 0 12px;border-radius:var(--ac-br-8);text-decoration:none;&:hover{background-color:var(--color-theme-300);transition:all ", ";.main-menu-item-icon{fill:var(--color-theme-900);opacity:1;}.main-menu-item-text{color:var(--color-theme-900);}}&.main-menu-item-current{background-color:var(--color-secondary-200);.main-menu-item-icon{fill:var(--color-secondary);opacity:1;}.main-menu-item-text{color:var(--color-secondary);}}}.main-menu-item--between{justify-content:space-between;}.main-menu-item-start{display:flex;align-items:center;}.main-menu-item-label{min-width:0;margin-left:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.main-menu-projects{position:relative;}.main-menu-subnav.main-menu-subnav{padding:2px 0;.main-menu-subnav-item{margin:0;padding-right:0;padding-left:0;&:hover{background-color:unset;}}.main-menu-subnav-item-icon{flex-shrink:0;margin-right:8px;opacity:0.5;fill:var(--color-theme-700);}.main-menu-subnav-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.main-menu-item{width:100%;min-width:0;height:32px;margin-right:12px;margin-left:22px;padding:8px;}.main-menu-item:hover{.main-menu-subnav-item-icon{fill:var(--color-theme-900);}.main-menu-subnav-item-text{color:var(--color-theme-900);}}.main-menu-subnav-item-active,.main-menu-subnav-item-active:hover{background-color:var(--color-secondary-200);.main-menu-subnav-item-icon{fill:var(--color-secondary);}.main-menu-subnav-item-text{color:var(--color-secondary);}}}.menu-section-text{opacity:0.7;}.main-menu-item-text,.menu-section{transition:all ", ";}.menu-section{position:relative;display:flex;align-items:center;justify-content:space-between;margin:0 12px 8px;padding:0 4px 0 12px;clip-path:inset(-4px);}&.expanded{.main-menu-item-text{opacity:1;visibility:visible;}.menu-section{max-height:32px;opacity:1;}}&.collapsed{.main-menu-item-text{opacity:0;visibility:hidden;}.menu-section{max-height:32px;opacity:0;visibility:hidden;}}@media (max-width:", "){&.collapsed .menu-section,&.expanded .menu-section{max-height:0;opacity:0;}&.collapsed .main-menu-item-text,&.expanded .main-menu-item-text{width:0;opacity:0;visibility:hidden;}&.c-main-menu--drawer.expanded{.menu-section{max-height:32px;opacity:1;}.main-menu-item-text{width:auto;opacity:1;visibility:visible;}}}.favorite-projects-menu-target{position:absolute;top:0;right:0;z-index:1;display:none;align-items:center;justify-content:center;width:10px;height:40px;border-radius:4px;cursor:pointer;&.collapsed{display:flex;}@media (max-width:", "){display:flex;}svg{transform:rotate(180deg);}}&.main-menu-can-peek:not(.main-menu-peek-open) .favorite-projects-menu-target{display:none;}&.main-menu-peek-open .favorite-projects-menu-target.collapsed{top:8px;right:16px;width:24px;height:24px;}.favorite-projects-menu-target:hover{background-color:var(--color-theme-300);svg{fill:var(--color-theme-900);}}.main-menu-item-current + .favorite-projects-menu-target:hover,.favorite-projects-menu-target.open{background-color:var(--color-secondary-200);svg{fill:var(--color-secondary);}}.main-menu-toggle{flex-shrink:0;transition:", ";&.is-closed{transform:rotate(180deg);}}.favorite-projects-list,.favorite-projects-list-target{display:flex;&.collapsed{display:none;}@media (max-width:", "){display:none;}}.favorite-projects-list-target{margin-left:auto;}&.c-main-menu--drawer{.favorite-projects-list.favorite-projects-list,.favorite-projects-list-target.is-mobile{display:flex;}}.favorite-projects-list{opacity:1;overflow:hidden;transition:all ", ";}.favorite-projects-list-collapsed{opacity:0;transition:all ", ";}.show-hidden-options-long{display:block;margin:12px 24px;cursor:pointer;&.collapsed{display:none;}@media (max-width:", "){display:none;}}.show-hidden-options-short{display:none;margin:12px 0;cursor:pointer;&.collapsed{display:block;}@media (max-width:", "){display:block;}}&.c-main-menu--drawer{.show-hidden-options-long.show-hidden-options-long{display:block;}.show-hidden-options-short.show-hidden-options-short{display:none;}}.main-menu-shortcuts{position:relative;}.shortcuts-expander{margin-left:auto;cursor:pointer;}.shortcuts-expander-collapsed{position:absolute;top:-11px;right:0;left:0;display:none;margin:0 auto;border-radius:100%;background-color:var(--body-bg-main);cursor:pointer;&.collapsed{display:block;}@media (max-width:", "){display:block;}}.shortcuts-list-separator.c-list-separator{margin:16px 12px 12px;transition:margin ", ";@media (max-width:", "){margin:20px 12px;}}.add-shortcut{cursor:pointer;.main-menu-item-text.main-menu-item-text{color:var(--color-secondary);}.main-menu-item-icon.main-menu-item-icon{fill:var(--color-secondary);opacity:1;}&:hover{background-color:var(--color-primary-200);}&:focus{background-color:var(--color-primary-300);outline:none;}}.main-menu-item.main-menu-help{position:relative;flex-shrink:0;margin-top:16px;margin-bottom:16px;&:hover{cursor:pointer;}}.main-menu-help .main-menu-toggle.is-hidden{display:none;}.main-menu-item.main-menu-help--promo,.main-menu-item.main-menu-help--promo:hover,.main-menu-item.main-menu-help--promo.main-menu-item-current{background-color:var(--color-primary);}.main-menu-help-promo{display:flex;align-items:center;gap:12px;}.main-menu-help-promo-icon{flex-shrink:0;fill:var(--page-paper-main);}.main-menu-help-promo-text{display:flex;visibility:visible;@media (min-width:", "){visibility:hidden;}@media (min-width:", "){visibility:visible;}}.main-menu-help-badge.main-menu-help-badge{position:absolute;top:16px;right:4px;margin-right:8px;margin-left:auto;@media (min-width:", "){top:0;right:auto;left:0;}&.is-promo{right:6px;@media (min-width:", "){right:auto;}}&.is-static{@media (min-width:", "){position:static;}}}.main-menu-editor{display:flex;flex-direction:column;flex-grow:1;min-height:0;outline:none;}.main-menu-editor-header{margin-top:12px;}.main-menu-editor-action{margin-right:4px;}.main-menu-editor-list{display:flex;flex-grow:1;min-height:0;}.main-menu-editor-list-inner{overflow-x:hidden;}.main-menu-editor-row.c-list-item{margin:0 0 2px;padding-right:12px;padding-left:8px;}.main-menu-editor-row-box{width:100%;border-radius:var(--ac-br-8);}.main-menu-editor-row-inner{display:flex;align-items:center;width:100%;}.main-menu-editor-handle{margin-right:4px;cursor:move;}.main-menu-edit-item{display:flex;align-items:center;justify-content:space-between;width:100%;max-width:204px;height:40px;padding-right:4px;text-decoration:none;}.main-menu-edit-item-start{display:flex;align-items:center;min-width:0;}.main-menu-edit-item.hidden{.main-menu-item-icon,.main-menu-item-text{opacity:0.4;}}.main-menu-editor-shortcuts-title{display:flex;align-items:center;height:24px;margin:0 12px 8px;padding:0 12px;}.main-menu-drawer-close{position:absolute;top:16px;right:16px;@media (min-width:", "){display:none;}}"], BoxSizingStyle, SM, EXPANDED_WIDTH, COLLAPSED_WIDTH, TRANSITION, XL, COLLAPSED_WIDTH, EXPANDED_WIDTH, COLLAPSED_WIDTH, EXPANDED_WIDTH, EXPANDED_WIDTH - COLLAPSED_WIDTH, EXPANDED_WIDTH + 10, TRANSITION, TRANSITION, TRANSITION, XL, TRANSITION, XL, TRANSITION, TRANSITION, XL, XL, TOGGLE_TRANSITION, XL, TRANSITION, TRANSITION, XL, XL, XL, TRANSITION, XL, SM, XL, SM, SM, XL, SM);
|
|
18
18
|
StyledMainMenu.displayName = "StyledMainMenu";
|
|
19
19
|
|
|
20
20
|
/* HelpAndSupportMenu.js: "tw:mt-3" on the first item, "tw:mb-3" on the last, "tw:shrink-0 tw:mr-3" on the icons */
|
|
@@ -23,11 +23,16 @@ export const StyledHelpList = styled(List).withConfig({
|
|
|
23
23
|
componentId: "sc-17ibzh0-1"
|
|
24
24
|
})(["outline:2px solid transparent;outline-offset:2px;.c-list-item > svg:first-child{flex-shrink:0;margin-right:12px;}.c-list-item:first-child{margin-top:12px;}.c-list-item:last-child{margin-bottom:12px;}.main-menu-help-entry-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.main-menu-help-entry-badge{margin-left:auto;}a.c-list-item{text-decoration:none;}.main-menu-help-entry.is-primary{color:var(--color-primary);> svg:first-child{fill:var(--color-primary);}}.main-menu-help-entry-text.has-end{margin-right:12px;}.main-menu-help-entry-end{flex-shrink:0;margin-left:auto;}"]);
|
|
25
25
|
StyledHelpList.displayName = "StyledHelpList";
|
|
26
|
+
export const StyledSettingsList = styled(List).withConfig({
|
|
27
|
+
displayName: "Styles__StyledSettingsList",
|
|
28
|
+
componentId: "sc-17ibzh0-2"
|
|
29
|
+
})(["outline:2px solid transparent;outline-offset:2px;.c-list-item:first-child{margin-top:12px;}.c-list-item:last-child{margin-bottom:12px;}.main-menu-settings-row{justify-content:space-between;gap:12px;}.main-menu-settings-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.main-menu-settings-control{flex-shrink:0;pointer-events:none;}"]);
|
|
30
|
+
StyledSettingsList.displayName = "StyledSettingsList";
|
|
26
31
|
|
|
27
32
|
/* FavoriteProjectsMenu.js "tw:py-2", FavoriteProjectMenuOption.js */
|
|
28
33
|
export const StyledFavoritesMenuList = styled(List).withConfig({
|
|
29
34
|
displayName: "Styles__StyledFavoritesMenuList",
|
|
30
|
-
componentId: "sc-17ibzh0-
|
|
35
|
+
componentId: "sc-17ibzh0-3"
|
|
31
36
|
})(["padding:8px 0;.c-list-item{padding-right:0;padding-left:0;}.favorite-project-menu-option{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;width:100%;padding:0 16px;color:var(--color-theme-900);text-decoration:none;svg{flex-shrink:0;margin-right:8px;opacity:0.5;}&.favorite-project-menu-option-active{background-color:var(--color-secondary-200);svg{fill:var(--color-secondary);}.favorite-project-menu-option-text{color:var(--color-secondary);}}}.favorite-project-menu-option-text{flex:1;padding-right:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}"]);
|
|
32
37
|
StyledFavoritesMenuList.displayName = "StyledFavoritesMenuList";
|
|
33
38
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","createGlobalStyle","BoxSizingStyle","List","SM","XL","NARROW_SCREEN","COLLAPSED_WIDTH","EXPANDED_WIDTH","TRANSITION","TOGGLE_TRANSITION","MainMenuGlobalStyle","StyledMainMenu","div","withConfig","displayName","componentId","StyledHelpList","StyledFavoritesMenuList"],"sources":["../../../../src/components/MainMenu/Styles.ts"],"sourcesContent":["import styled, { createGlobalStyle } from \"styled-components\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { List } from \"../List\";\n\nexport const SM = \"640px\";\nexport const XL = \"1280px\";\nexport const NARROW_SCREEN = `(max-width: ${XL})`;\nexport const COLLAPSED_WIDTH = 72;\nexport const EXPANDED_WIDTH = 240;\n\nconst TRANSITION = \"200ms ease\";\nconst TOGGLE_TRANSITION = \"transform 200ms cubic-bezier(0.4, 0, 0.2, 1)\";\n\n// The popper of a menu sits in a portal, out of reach of the menu styles.\nexport const MainMenuGlobalStyle = createGlobalStyle`\n .c-main-menu-favorites-popper {\n padding: 4px;\n }\n`;\n\nexport const StyledMainMenu = styled.div`\n ${BoxSizingStyle}\n\n /* MainMenu.js \"tw:relative tw:left-2.5 tw:hidden tw:sm:flex tw:flex-col tw:h-full tw:mr-1 tw:shrink-0\" */\n &.c-main-menu--desktop {\n position: relative;\n left: 10px;\n display: none;\n flex-direction: column;\n flex-shrink: 0;\n height: 100%;\n margin-right: 4px;\n\n @media (min-width: ${SM}) {\n display: flex;\n }\n }\n\n /* MainMenuMobile.js \"tw:flex-col tw:h-full tw:w-60\": a block, as wide as the drawer */\n &.c-main-menu--drawer {\n height: 100%;\n }\n\n &.expanded {\n width: ${EXPANDED_WIDTH}px;\n }\n\n &.collapsed {\n width: ${COLLAPSED_WIDTH}px;\n }\n\n &.expanded,\n &.collapsed {\n transition: width ${TRANSITION};\n\n @media (max-width: ${XL}) {\n width: ${COLLAPSED_WIDTH}px;\n }\n }\n\n &.c-main-menu--drawer.c-main-menu--drawer {\n width: ${EXPANDED_WIDTH}px;\n }\n\n .main-menu-panel {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n }\n\n &.main-menu-peek {\n width: ${COLLAPSED_WIDTH}px;\n }\n\n /* The menu sits 10px from the edge, so the backdrop reaches back to cover that strip too. */\n &.main-menu-peek .main-menu-panel {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n z-index: 0;\n width: ${EXPANDED_WIDTH}px;\n clip-path: inset(\n -100px ${EXPANDED_WIDTH - COLLAPSED_WIDTH}px -100px -100px\n );\n transition: clip-path 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);\n\n &::before {\n content: \"\";\n position: absolute;\n inset: 0 0 0 -10px;\n z-index: -1;\n background-color: var(--body-bg-main);\n box-shadow: var(--shadow-popover);\n }\n }\n\n &.main-menu-peek-open .main-menu-panel {\n clip-path: inset(-100px);\n }\n\n /* A clipped part of the panel takes no pointer, so this strip holds the hover while the clip opens. */\n &.main-menu-peek::after {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n left: -10px;\n z-index: -1;\n width: ${EXPANDED_WIDTH + 10}px;\n }\n\n @media (prefers-reduced-motion: reduce) {\n &.main-menu-peek .main-menu-panel {\n transition-duration: 1ms;\n }\n }\n\n /* \"main-menu-header tw:-left-2.5 tw:flex tw:items-center tw:overflow-hidden\" */\n .main-menu-header {\n position: relative;\n display: flex;\n align-items: center;\n height: 68px;\n overflow: hidden;\n }\n\n &.c-main-menu--desktop .main-menu-header {\n left: -10px;\n }\n\n /* On hover the logo takes the hover color of the menu items. */\n .main-logo-url {\n position: absolute;\n left: 30px;\n color: var(--color-secondary);\n\n path {\n fill: var(--color-secondary);\n transition: fill ${TRANSITION};\n }\n\n &:hover path,\n &:focus-visible path {\n fill: var(--color-theme-900);\n }\n }\n\n .main-logo-long {\n transition: all ${TRANSITION};\n\n #logotype {\n opacity: 1;\n transition: all ${TRANSITION};\n will-change: opacity, transform;\n\n @media (max-width: ${XL}) {\n opacity: 0;\n transform: translateX(-5%);\n }\n }\n }\n\n .main-logo-long__collapsed #logotype {\n opacity: 0;\n transform: translateX(-5%);\n }\n\n /* The tab sits in the free strip left of the logo. It floats, so the menu keeps its layout. */\n .main-menu-collapse-tab {\n position: absolute;\n top: 8px;\n left: -10px;\n z-index: 4;\n display: none;\n width: 30px;\n height: 48px;\n margin: 0;\n padding: 0;\n border: 0;\n background: none;\n font: inherit;\n cursor: pointer;\n\n @media (min-width: ${XL}) {\n display: block;\n }\n }\n\n .main-menu-collapse-tab-face {\n position: absolute;\n top: 50%;\n left: 0;\n display: flex;\n align-items: center;\n gap: 6px;\n height: 27px;\n max-width: 4px;\n margin-top: -0.5px;\n padding: 0;\n overflow: hidden;\n border-radius: 0 4px 4px 0;\n background: var(--color-theme-500);\n white-space: nowrap;\n opacity: 0;\n transform: translateY(-50%);\n transition: all 180ms ease;\n }\n\n .main-menu-collapse-tab-icon,\n .main-menu-collapse-tab-label {\n opacity: 0;\n transition: opacity 150ms ease, ${TOGGLE_TRANSITION};\n }\n\n .main-menu-collapse-tab-icon {\n flex-shrink: 0;\n fill: var(--color-theme-700);\n }\n\n .main-menu-collapse-tab.is-collapsed .main-menu-collapse-tab-icon {\n transform: rotate(180deg);\n }\n\n .main-menu-collapse-tab-label {\n color: var(--color-theme-900);\n font-size: 12px;\n font-weight: 600;\n line-height: 16px;\n }\n\n &:hover .main-menu-collapse-tab-face,\n &:has(:focus-visible) .main-menu-collapse-tab-face,\n &.touch .main-menu-collapse-tab-face {\n opacity: 1;\n }\n\n @media (hover: none) {\n .main-menu-collapse-tab-face {\n opacity: 1;\n }\n }\n\n .main-menu-collapse-tab:hover .main-menu-collapse-tab-face,\n .main-menu-collapse-tab:focus-visible .main-menu-collapse-tab-face {\n height: 39px;\n max-width: 120px;\n padding: 0 14px 0 10px;\n border: 1px solid var(--popover-border);\n border-left: 0;\n border-radius: 0 10px 10px 0;\n background: linear-gradient(\n 180deg,\n var(--page-paper-main),\n color-mix(in srgb, var(--page-paper-main) 92%, var(--color-theme-500))\n );\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14), 0 4px 14px rgba(0, 0, 0, 0.145),\n inset 0 1px 0 rgba(255, 255, 255, 0.07);\n opacity: 1;\n }\n\n .main-menu-collapse-tab:hover .main-menu-collapse-tab-icon,\n .main-menu-collapse-tab:hover .main-menu-collapse-tab-label,\n .main-menu-collapse-tab:focus-visible .main-menu-collapse-tab-icon,\n .main-menu-collapse-tab:focus-visible .main-menu-collapse-tab-label {\n opacity: 1;\n }\n\n /* Opacity, not visibility: a hidden button cannot take the focus, so Tab would skip it. */\n .main-menu-edit-button.main-menu-edit-button {\n opacity: 0;\n transition: opacity ${TRANSITION};\n }\n\n /* MainMenu.js \"tw:absolute tw:right-1.5 tw:-translate-y-0.5\" and the theme-500 icon */\n .main-menu-header .main-menu-edit-button.main-menu-edit-button {\n position: absolute;\n right: 6px;\n transform: translateY(-2px);\n\n svg {\n fill: var(--color-theme-500);\n }\n\n &:hover svg,\n &:focus-visible svg {\n fill: var(--color-theme-900);\n }\n }\n\n &:hover .main-menu-edit-button.main-menu-edit-button,\n &:has(:focus-visible) .main-menu-edit-button.main-menu-edit-button,\n &.touch .main-menu-edit-button.main-menu-edit-button {\n opacity: 1;\n }\n\n @media (hover: none) {\n .main-menu-edit-button.main-menu-edit-button {\n opacity: 1;\n }\n }\n\n /* Where its section is collapsed the button cannot open the editor, so it stays out of the tab order. */\n &.collapsed .main-menu-edit-button.main-menu-edit-button {\n visibility: hidden;\n }\n\n @media (max-width: ${XL}) {\n &:not(.c-main-menu--drawer) .main-menu-edit-button.main-menu-edit-button {\n visibility: hidden;\n }\n }\n\n /* \"tw:flex tw:flex-col tw:grow tw:flex-1 tw:h-full tw:overflow-y-auto\" */\n .main-menu-socket {\n display: flex;\n flex: 1 1 0%;\n flex-direction: column;\n height: 100%;\n overflow-y: auto;\n }\n\n /* MainMenuMobile.js \"tw:h-[calc(100dvh-72px)]\" */\n &.c-main-menu--drawer .main-menu-socket {\n height: calc(100dvh - 72px);\n }\n\n /* MainMenuItems.js \"tw:flex tw:min-h-0 tw:grow\" around the scrollbars, and \"tw:my-3 tw:overflow-x-hidden\" */\n .main-menu-items {\n display: flex;\n flex-grow: 1;\n min-height: 0;\n }\n\n .main-menu-items-inner {\n margin: 12px 0;\n overflow-x: hidden;\n }\n\n .main-menu-item-icon {\n flex-shrink: 0;\n fill: var(--color-theme-700);\n opacity: 0.7;\n }\n\n /* MainMenuItemWrapper.js \"main-menu-item tw:flex tw:items-center tw:no-underline tw:h-10 tw:pl-3 tw:pr-1 tw:mx-3\" */\n .main-menu-item {\n display: flex;\n align-items: center;\n height: 40px;\n margin: 0 12px 2px;\n padding: 0 4px 0 12px;\n border-radius: var(--ac-br-8);\n text-decoration: none;\n\n &:hover {\n background-color: var(--color-theme-300);\n transition: all ${TRANSITION};\n\n .main-menu-item-icon {\n fill: var(--color-theme-900);\n opacity: 1;\n }\n\n .main-menu-item-text {\n color: var(--color-theme-900);\n }\n }\n\n &.main-menu-item-current {\n background-color: var(--color-secondary-200);\n\n .main-menu-item-icon {\n fill: var(--color-secondary);\n opacity: 1;\n }\n\n .main-menu-item-text {\n color: var(--color-secondary);\n }\n }\n }\n\n .main-menu-item--between {\n justify-content: space-between;\n }\n\n .main-menu-item-start {\n display: flex;\n align-items: center;\n }\n\n /* MainMenuItemInner.js \"tw:ml-3 tw:truncate tw:min-w-0\" */\n .main-menu-item-label {\n min-width: 0;\n margin-left: 12px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .main-menu-projects {\n position: relative;\n }\n\n /* FavoriteProjectOption.js */\n .main-menu-subnav.main-menu-subnav {\n padding: 2px 0;\n\n .main-menu-subnav-item {\n margin: 0;\n padding-right: 0;\n padding-left: 0;\n\n &:hover {\n background-color: unset;\n }\n }\n\n .main-menu-subnav-item-icon {\n flex-shrink: 0;\n margin-right: 8px;\n opacity: 0.5;\n fill: var(--color-theme-700);\n }\n\n .main-menu-subnav-item-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .main-menu-item {\n width: 100%;\n min-width: 0;\n height: 32px;\n margin-right: 12px;\n margin-left: 22px;\n padding: 8px;\n }\n\n .main-menu-item:hover {\n .main-menu-subnav-item-icon {\n fill: var(--color-theme-900);\n }\n\n .main-menu-subnav-item-text {\n color: var(--color-theme-900);\n }\n }\n\n .main-menu-subnav-item-active,\n .main-menu-subnav-item-active:hover {\n background-color: var(--color-secondary-200);\n\n .main-menu-subnav-item-icon {\n fill: var(--color-secondary);\n }\n\n .main-menu-subnav-item-text {\n color: var(--color-secondary);\n }\n }\n }\n\n .menu-section-text {\n opacity: 0.7;\n }\n\n .main-menu-item-text,\n .menu-section {\n transition: all ${TRANSITION};\n }\n\n /* \"tw:mb-2 tw:mx-3 tw:pl-3 tw:pr-1 tw:flex tw:justify-between tw:items-center menu-section\" */\n .menu-section {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 0 12px 8px;\n padding: 0 4px 0 12px;\n /* The height clips the heading as it opens and closes, so its text is never squeezed. The 4px keep a focus ring. */\n clip-path: inset(-4px);\n }\n\n &.expanded {\n .main-menu-item-text {\n opacity: 1;\n visibility: visible;\n }\n\n .menu-section {\n max-height: 32px;\n opacity: 1;\n }\n }\n\n &.collapsed {\n .main-menu-item-text {\n opacity: 0;\n visibility: hidden;\n }\n\n .menu-section {\n max-height: 0;\n opacity: 0;\n }\n }\n\n @media (max-width: ${XL}) {\n &.collapsed .menu-section,\n &.expanded .menu-section {\n max-height: 0;\n opacity: 0;\n }\n\n &.collapsed .main-menu-item-text,\n &.expanded .main-menu-item-text {\n width: 0;\n opacity: 0;\n visibility: hidden;\n }\n\n /* The narrow screen collapses the sidebar, never the drawer. */\n &.c-main-menu--drawer.expanded {\n .menu-section {\n max-height: 32px;\n opacity: 1;\n }\n\n .main-menu-item-text {\n width: auto;\n opacity: 1;\n visibility: visible;\n }\n }\n }\n\n /* FavoriteProjectsMenu.js target */\n .favorite-projects-menu-target {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n display: none;\n align-items: center;\n justify-content: center;\n width: 10px;\n height: 40px;\n border-radius: 4px;\n cursor: pointer;\n\n &.collapsed {\n display: flex;\n }\n\n @media (max-width: ${XL}) {\n display: flex;\n }\n\n svg {\n transform: rotate(180deg);\n }\n }\n\n &.main-menu-can-peek:not(.main-menu-peek-open)\n .favorite-projects-menu-target {\n display: none;\n }\n\n /* Where the drawer toggle sits in the expanded menu. */\n &.main-menu-peek-open .favorite-projects-menu-target.collapsed {\n top: 8px;\n right: 16px;\n width: 24px;\n height: 24px;\n }\n\n .favorite-projects-menu-target:hover {\n background-color: var(--color-theme-300);\n\n svg {\n fill: var(--color-theme-900);\n }\n }\n\n .main-menu-item-current + .favorite-projects-menu-target:hover,\n .favorite-projects-menu-target.open {\n background-color: var(--color-secondary-200);\n\n svg {\n fill: var(--color-secondary);\n }\n }\n\n /* ExpandToggle.jsx \"tw:transition-transform tw:duration-200\", up when expanded */\n .main-menu-toggle {\n flex-shrink: 0;\n transition: ${TOGGLE_TRANSITION};\n\n &.is-closed {\n transform: rotate(180deg);\n }\n }\n\n .favorite-projects-list,\n .favorite-projects-list-target {\n display: flex;\n\n &.collapsed {\n display: none;\n }\n\n @media (max-width: ${XL}) {\n display: none;\n }\n }\n\n .favorite-projects-list-target {\n margin-left: auto;\n }\n\n &.c-main-menu--drawer {\n .favorite-projects-list.favorite-projects-list,\n .favorite-projects-list-target.is-mobile {\n display: flex;\n }\n }\n\n .favorite-projects-list {\n opacity: 1;\n overflow: hidden;\n transition: all ${TRANSITION};\n }\n\n .favorite-projects-list-collapsed {\n opacity: 0;\n transition: all ${TRANSITION};\n }\n\n /* HiddenOptionList.js */\n .show-hidden-options-long {\n display: block;\n margin: 12px 24px;\n cursor: pointer;\n\n &.collapsed {\n display: none;\n }\n\n @media (max-width: ${XL}) {\n display: none;\n }\n }\n\n .show-hidden-options-short {\n display: none;\n margin: 12px 0;\n cursor: pointer;\n\n &.collapsed {\n display: block;\n }\n\n @media (max-width: ${XL}) {\n display: block;\n }\n }\n\n &.c-main-menu--drawer {\n .show-hidden-options-long.show-hidden-options-long {\n display: block;\n }\n\n .show-hidden-options-short.show-hidden-options-short {\n display: none;\n }\n }\n\n /* Shortcuts/List.js */\n .main-menu-shortcuts {\n position: relative;\n }\n\n .shortcuts-expander {\n margin-left: auto;\n cursor: pointer;\n }\n\n .shortcuts-expander-collapsed {\n position: absolute;\n top: -11px;\n right: 0;\n left: 0;\n display: none;\n margin: 0 auto;\n border-radius: 100%;\n background-color: var(--body-bg-main);\n cursor: pointer;\n\n &.collapsed {\n display: block;\n }\n\n @media (max-width: ${XL}) {\n display: block;\n }\n }\n\n .shortcuts-list-separator.c-list-separator {\n margin: 16px 12px 12px;\n transition: margin ${TRANSITION};\n\n &.collapsed {\n margin: 20px 12px;\n }\n\n @media (max-width: ${XL}) {\n margin: 20px 12px;\n }\n }\n\n .add-shortcut {\n cursor: pointer;\n\n .main-menu-item-text.main-menu-item-text {\n color: var(--color-secondary);\n }\n\n .main-menu-item-icon.main-menu-item-icon {\n fill: var(--color-secondary);\n opacity: 1;\n }\n\n &:hover {\n background-color: var(--color-primary-200);\n }\n\n &:focus {\n background-color: var(--color-primary-300);\n outline: none;\n }\n }\n\n /* HelpAndSupportMenu.js target \"tw:relative main-menu-item tw:shrink-0 tw:my-4 tw:hover:cursor-pointer\" */\n .main-menu-item.main-menu-help {\n position: relative;\n flex-shrink: 0;\n margin-top: 16px;\n margin-bottom: 16px;\n\n &:hover {\n cursor: pointer;\n }\n }\n\n .main-menu-help .main-menu-toggle.is-hidden {\n display: none;\n }\n\n /* HelpAndSupportMenu.js \"tw:bg-primary\": a promotion in place of Help & Support */\n .main-menu-item.main-menu-help--promo,\n .main-menu-item.main-menu-help--promo:hover,\n .main-menu-item.main-menu-help--promo.main-menu-item-current {\n background-color: var(--color-primary);\n }\n\n .main-menu-help-promo {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n .main-menu-help-promo-icon {\n flex-shrink: 0;\n fill: var(--page-paper-main);\n }\n\n /* \"tw:flex tw:visible tw:sm:invisible tw:xl:visible\" */\n .main-menu-help-promo-text {\n display: flex;\n visibility: visible;\n\n @media (min-width: ${SM}) {\n visibility: hidden;\n }\n\n @media (min-width: ${XL}) {\n visibility: visible;\n }\n }\n\n /* \"new-features-badge tw:absolute tw:right-1 tw:top-4 tw:sm:top-0 tw:sm:left-0 tw:sm:right-auto tw:ml-auto tw:mr-2\" */\n .main-menu-help-badge.main-menu-help-badge {\n position: absolute;\n top: 16px;\n right: 4px;\n margin-right: 8px;\n margin-left: auto;\n\n @media (min-width: ${SM}) {\n top: 0;\n right: auto;\n left: 0;\n }\n\n &.is-promo {\n right: 6px;\n\n @media (min-width: ${SM}) {\n right: auto;\n }\n }\n\n &.is-static {\n @media (min-width: ${XL}) {\n position: static;\n }\n }\n }\n\n /* MainMenuItemsEditor.js \"tw:flex tw:flex-col tw:min-h-0 tw:grow tw:outline-none\" */\n .main-menu-editor {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n min-height: 0;\n outline: none;\n }\n\n /* Editor/Header.js \"tw:mt-3\" */\n .main-menu-editor-header {\n margin-top: 12px;\n }\n\n .main-menu-editor-action {\n margin-right: 4px;\n }\n\n .main-menu-editor-list {\n display: flex;\n flex-grow: 1;\n min-height: 0;\n }\n\n .main-menu-editor-list-inner {\n overflow-x: hidden;\n }\n\n /* DraggableListItem.js \"tw:pr-3 tw:pl-2 tw:mt-0\" with marginBottom 2px */\n .main-menu-editor-row.c-list-item {\n margin: 0 0 2px;\n padding-right: 12px;\n padding-left: 8px;\n }\n\n .main-menu-editor-row-box {\n width: 100%;\n border-radius: var(--ac-br-8);\n }\n\n .main-menu-editor-row-inner {\n display: flex;\n align-items: center;\n width: 100%;\n }\n\n .main-menu-editor-handle {\n margin-right: 4px;\n cursor: move;\n }\n\n /* Editor/MainMenuItem.js \"main-menu-edit-item tw:h-10 tw:w-full tw:pr-1\" with maxWidth 204px */\n .main-menu-edit-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n max-width: 204px;\n height: 40px;\n padding-right: 4px;\n text-decoration: none;\n }\n\n .main-menu-edit-item-start {\n display: flex;\n align-items: center;\n min-width: 0;\n }\n\n .main-menu-edit-item.hidden {\n .main-menu-item-icon,\n .main-menu-item-text {\n opacity: 0.4;\n }\n }\n\n /* \"tw:flex tw:items-center tw:h-6 tw:mb-2 tw:mx-3 tw:px-3 menu-section-text\" */\n .main-menu-editor-shortcuts-title {\n display: flex;\n align-items: center;\n height: 24px;\n margin: 0 12px 8px;\n padding: 0 12px;\n }\n\n /* MainMenuMobile.js \"tw:absolute tw:right-4 tw:top-4 tw:sm:hidden\" */\n .main-menu-drawer-close {\n position: absolute;\n top: 16px;\n right: 16px;\n\n @media (min-width: ${SM}) {\n display: none;\n }\n }\n`;\n\nStyledMainMenu.displayName = \"StyledMainMenu\";\n\n/* HelpAndSupportMenu.js: \"tw:mt-3\" on the first item, \"tw:mb-3\" on the last, \"tw:shrink-0 tw:mr-3\" on the icons */\nexport const StyledHelpList = styled(List)`\n outline: 2px solid transparent;\n outline-offset: 2px;\n\n .c-list-item > svg:first-child {\n flex-shrink: 0;\n margin-right: 12px;\n }\n\n .c-list-item:first-child {\n margin-top: 12px;\n }\n\n .c-list-item:last-child {\n margin-bottom: 12px;\n }\n\n .main-menu-help-entry-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .main-menu-help-entry-badge {\n margin-left: auto;\n }\n\n /* an entry with a link: \"tw:no-underline\" */\n a.c-list-item {\n text-decoration: none;\n }\n\n .main-menu-help-entry.is-primary {\n color: var(--color-primary);\n\n > svg:first-child {\n fill: var(--color-primary);\n }\n }\n\n /* \"tw:justify-between tw:gap-3\" */\n .main-menu-help-entry-text.has-end {\n margin-right: 12px;\n }\n\n .main-menu-help-entry-end {\n flex-shrink: 0;\n margin-left: auto;\n }\n`;\n\nStyledHelpList.displayName = \"StyledHelpList\";\n\n/* FavoriteProjectsMenu.js \"tw:py-2\", FavoriteProjectMenuOption.js */\nexport const StyledFavoritesMenuList = styled(List)`\n padding: 8px 0;\n\n .c-list-item {\n padding-right: 0;\n padding-left: 0;\n }\n\n .favorite-project-menu-option {\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: border-box;\n width: 100%;\n padding: 0 16px;\n color: var(--color-theme-900);\n text-decoration: none;\n\n svg {\n flex-shrink: 0;\n margin-right: 8px;\n opacity: 0.5;\n }\n\n &.favorite-project-menu-option-active {\n background-color: var(--color-secondary-200);\n\n svg {\n fill: var(--color-secondary);\n }\n\n .favorite-project-menu-option-text {\n color: var(--color-secondary);\n }\n }\n }\n\n .favorite-project-menu-option-text {\n flex: 1;\n padding-right: 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n`;\n\nStyledFavoritesMenuList.displayName = \"StyledFavoritesMenuList\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,iBAAiB,QAAQ,mBAAmB;AAE7D,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,IAAI,QAAQ,SAAS;AAE9B,OAAO,MAAMC,EAAE,GAAG,OAAO;AACzB,OAAO,MAAMC,EAAE,GAAG,QAAQ;AAC1B,OAAO,MAAMC,aAAa,oBAAkBD,EAAE,MAAG;AACjD,OAAO,MAAME,eAAe,GAAG,EAAE;AACjC,OAAO,MAAMC,cAAc,GAAG,GAAG;AAEjC,MAAMC,UAAU,GAAG,YAAY;AAC/B,MAAMC,iBAAiB,GAAG,8CAA8C;;AAExE;AACA,OAAO,MAAMC,mBAAmB,GAAGV,iBAAiB,iDAInD;AAED,OAAO,MAAMW,cAAc,GAAGZ,MAAM,CAACa,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,8yWACpCd,cAAc,EAYOE,EAAE,EAWdI,cAAc,EAIdD,eAAe,EAKJE,UAAU,EAETJ,EAAE,EACZE,eAAe,EAKjBC,cAAc,EAWdD,eAAe,EAUfC,cAAc,EAEZA,cAAc,GAAGD,eAAe,EA0BlCC,cAAc,GAAG,EAAE,EA8BPC,UAAU,EAUbA,UAAU,EAIRA,UAAU,EAGPJ,EAAE,EA4BJA,EAAE,EA4BWK,iBAAiB,EA2D7BD,UAAU,EAoCbJ,EAAE,EAkDDI,UAAU,EAkHZA,UAAU,EAuCTJ,EAAE,EA+CAA,EAAE,EA0CTK,iBAAiB,EAeVL,EAAE,EAmBLI,UAAU,EAKVA,UAAU,EAaPJ,EAAE,EAcFA,EAAE,EAwCFA,EAAE,EAOFI,UAAU,EAMVJ,EAAE,EAkEFD,EAAE,EAIFC,EAAE,EAaFD,EAAE,EASAA,EAAE,EAMFC,EAAE,EAiGJD,EAAE,CAI1B;AAEDQ,cAAc,CAACG,WAAW,GAAG,gBAAgB;;AAE7C;AACA,OAAO,MAAME,cAAc,GAAGjB,MAAM,CAACG,IAAI,CAAC,CAAAW,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,ilBAiDzC;AAEDC,cAAc,CAACF,WAAW,GAAG,gBAAgB;;AAE7C;AACA,OAAO,MAAMG,uBAAuB,GAAGlB,MAAM,CAACG,IAAI,CAAC,CAAAW,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,8lBA4ClD;AAEDE,uBAAuB,CAACH,WAAW,GAAG,yBAAyB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","createGlobalStyle","BoxSizingStyle","List","SM","XL","NARROW_SCREEN","COLLAPSED_WIDTH","EXPANDED_WIDTH","TRANSITION","TOGGLE_TRANSITION","MainMenuGlobalStyle","StyledMainMenu","div","withConfig","displayName","componentId","StyledHelpList","StyledSettingsList","StyledFavoritesMenuList"],"sources":["../../../../src/components/MainMenu/Styles.ts"],"sourcesContent":["import styled, { createGlobalStyle } from \"styled-components\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { List } from \"../List\";\n\nexport const SM = \"640px\";\nexport const XL = \"1280px\";\nexport const NARROW_SCREEN = `(max-width: ${XL})`;\nexport const COLLAPSED_WIDTH = 72;\nexport const EXPANDED_WIDTH = 240;\n\nconst TRANSITION = \"200ms ease\";\nconst TOGGLE_TRANSITION = \"transform 200ms cubic-bezier(0.4, 0, 0.2, 1)\";\n\n// The popper of a menu sits in a portal, out of reach of the menu styles.\nexport const MainMenuGlobalStyle = createGlobalStyle`\n .c-main-menu-favorites-popper {\n padding: 4px;\n }\n`;\n\nexport const StyledMainMenu = styled.div`\n ${BoxSizingStyle}\n\n /* MainMenu.js \"tw:relative tw:left-2.5 tw:hidden tw:sm:flex tw:flex-col tw:h-full tw:mr-1 tw:shrink-0\" */\n &.c-main-menu--desktop {\n position: relative;\n left: 10px;\n display: none;\n flex-direction: column;\n flex-shrink: 0;\n height: 100%;\n margin-right: 4px;\n\n @media (min-width: ${SM}) {\n display: flex;\n }\n }\n\n /* MainMenuMobile.js \"tw:flex-col tw:h-full tw:w-60\": a block, as wide as the drawer */\n &.c-main-menu--drawer {\n height: 100%;\n }\n\n &.expanded {\n width: ${EXPANDED_WIDTH}px;\n }\n\n &.collapsed {\n width: ${COLLAPSED_WIDTH}px;\n }\n\n &.expanded,\n &.collapsed {\n transition: width ${TRANSITION};\n\n @media (max-width: ${XL}) {\n width: ${COLLAPSED_WIDTH}px;\n }\n }\n\n &.c-main-menu--drawer.c-main-menu--drawer {\n width: ${EXPANDED_WIDTH}px;\n }\n\n &.main-menu-instant-width {\n transition: none;\n }\n\n .main-menu-panel {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n }\n\n &.main-menu-peek {\n width: ${COLLAPSED_WIDTH}px;\n }\n\n /* The menu sits 10px from the edge, so the backdrop reaches back to cover that strip too. */\n &.main-menu-peek .main-menu-panel {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n z-index: 0;\n width: ${EXPANDED_WIDTH}px;\n clip-path: inset(\n -100px ${EXPANDED_WIDTH - COLLAPSED_WIDTH}px -100px -100px\n );\n transition: clip-path 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);\n\n &::before {\n content: \"\";\n position: absolute;\n inset: 0 0 0 -10px;\n z-index: -1;\n background-color: var(--body-bg-main);\n box-shadow: var(--shadow-popover);\n }\n }\n\n &.main-menu-peek-open .main-menu-panel {\n clip-path: inset(-100px);\n }\n\n /* A clipped part of the panel takes no pointer, so this strip holds the hover while the clip opens. */\n &.main-menu-peek::after {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n left: -10px;\n z-index: -1;\n width: ${EXPANDED_WIDTH + 10}px;\n }\n\n @media (prefers-reduced-motion: reduce) {\n &.main-menu-peek .main-menu-panel {\n transition-duration: 1ms;\n }\n }\n\n /* \"main-menu-header tw:-left-2.5 tw:flex tw:items-center tw:overflow-hidden\" */\n .main-menu-header {\n position: relative;\n display: flex;\n align-items: center;\n height: 68px;\n overflow: hidden;\n }\n\n &.c-main-menu--desktop .main-menu-header {\n left: -10px;\n }\n\n /* On hover the logo takes the hover color of the menu items. */\n .main-logo-url {\n position: absolute;\n left: 30px;\n color: var(--color-secondary);\n\n path {\n fill: var(--color-secondary);\n transition: fill ${TRANSITION};\n }\n\n &:hover path,\n &:focus-visible path {\n fill: var(--color-theme-900);\n }\n }\n\n .main-logo-long {\n transition: all ${TRANSITION};\n\n #logotype {\n opacity: 1;\n transition: all ${TRANSITION};\n will-change: opacity, transform;\n\n @media (max-width: ${XL}) {\n opacity: 0;\n transform: translateX(-5%);\n }\n }\n }\n\n .main-logo-long__collapsed #logotype {\n opacity: 0;\n transform: translateX(-5%);\n }\n\n /* Opacity, not visibility: a hidden button cannot take the focus, so Tab would skip it. */\n .main-menu-edit-button.main-menu-edit-button {\n opacity: 0;\n transition: opacity ${TRANSITION};\n }\n\n /* MainMenu.js \"tw:absolute tw:right-1.5 tw:-translate-y-0.5\" and the theme-500 icon */\n .main-menu-header .main-menu-edit-button.main-menu-edit-button {\n position: absolute;\n right: 6px;\n transform: translateY(-2px);\n\n svg {\n fill: var(--color-theme-500);\n }\n\n &:hover svg,\n &:focus-visible svg {\n fill: var(--color-theme-900);\n }\n }\n\n /* An open popover sits outside the menu, so the button stays visible while the pointer is on the popover. */\n &:hover .main-menu-edit-button.main-menu-edit-button,\n &:has(:focus-visible) .main-menu-edit-button.main-menu-edit-button,\n &.touch .main-menu-edit-button.main-menu-edit-button,\n .main-menu-edit-button.main-menu-edit-button[aria-expanded=\"true\"] {\n opacity: 1;\n }\n\n @media (hover: none) {\n .main-menu-edit-button.main-menu-edit-button {\n opacity: 1;\n }\n }\n\n /* With Auto-Expand the compact menu shows Settings in the header of the open peek, so here it stays out of the tab order. */\n &.collapsed.main-menu-can-peek .main-menu-edit-button.main-menu-edit-button {\n visibility: hidden;\n }\n\n /* Without Auto-Expand the compact menu shows Settings as a tab on its left edge, which opens on hover, so the logo keeps its place. */\n &.collapsed:not(.main-menu-can-peek)\n .main-menu-header\n .main-menu-edit-button.main-menu-edit-button {\n top: 18px;\n right: auto;\n left: 0;\n z-index: 1;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n width: 4px;\n min-width: 0;\n height: 27px;\n padding: 0;\n overflow: visible;\n border: 0;\n border-radius: 0 4px 4px 0;\n background: var(--color-theme-500);\n opacity: 1;\n transform: none;\n transition: top 180ms ease, width 180ms ease, height 180ms ease,\n border-radius 180ms ease, box-shadow 180ms ease;\n\n /* The hover zone is wider than the strip, as the old 30px tab was. */\n &::before {\n content: \"\";\n position: absolute;\n inset: -10px -22px -10px 0;\n }\n\n svg {\n flex-shrink: 0;\n opacity: 0;\n transition: opacity 150ms ease;\n }\n\n &:hover,\n &:focus-visible,\n &[aria-expanded=\"true\"] {\n top: 12px;\n width: 40px;\n height: 39px;\n padding: 0 9px 0 0;\n border: 1px solid var(--popover-border);\n border-left: 0;\n border-radius: 0 10px 10px 0;\n background: linear-gradient(\n 180deg,\n var(--page-paper-main),\n color-mix(in srgb, var(--page-paper-main) 92%, var(--color-theme-500))\n );\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14), 0 4px 14px rgba(0, 0, 0, 0.145),\n inset 0 1px 0 rgba(255, 255, 255, 0.07);\n\n svg {\n opacity: 1;\n }\n }\n }\n\n @media (max-width: ${XL}) {\n &:not(.c-main-menu--drawer) .main-menu-edit-button.main-menu-edit-button {\n visibility: hidden;\n }\n }\n\n /* \"tw:flex tw:flex-col tw:grow tw:flex-1 tw:h-full tw:overflow-y-auto\" */\n .main-menu-socket {\n display: flex;\n flex: 1 1 0%;\n flex-direction: column;\n height: 100%;\n overflow-y: auto;\n }\n\n /* MainMenuMobile.js \"tw:h-[calc(100dvh-72px)]\" */\n &.c-main-menu--drawer .main-menu-socket {\n height: calc(100dvh - 72px);\n }\n\n /* MainMenuItems.js \"tw:flex tw:min-h-0 tw:grow\" around the scrollbars, and \"tw:my-3 tw:overflow-x-hidden\" */\n .main-menu-items {\n display: flex;\n flex-grow: 1;\n min-height: 0;\n }\n\n .main-menu-items-inner {\n margin: 12px 0;\n overflow-x: hidden;\n }\n\n .main-menu-item-icon {\n flex-shrink: 0;\n fill: var(--color-theme-700);\n opacity: 0.7;\n }\n\n /* MainMenuItemWrapper.js \"main-menu-item tw:flex tw:items-center tw:no-underline tw:h-10 tw:pl-3 tw:pr-1 tw:mx-3\" */\n .main-menu-item {\n display: flex;\n align-items: center;\n height: 40px;\n margin: 0 12px 2px;\n padding: 0 4px 0 12px;\n border-radius: var(--ac-br-8);\n text-decoration: none;\n\n &:hover {\n background-color: var(--color-theme-300);\n transition: all ${TRANSITION};\n\n .main-menu-item-icon {\n fill: var(--color-theme-900);\n opacity: 1;\n }\n\n .main-menu-item-text {\n color: var(--color-theme-900);\n }\n }\n\n &.main-menu-item-current {\n background-color: var(--color-secondary-200);\n\n .main-menu-item-icon {\n fill: var(--color-secondary);\n opacity: 1;\n }\n\n .main-menu-item-text {\n color: var(--color-secondary);\n }\n }\n }\n\n .main-menu-item--between {\n justify-content: space-between;\n }\n\n .main-menu-item-start {\n display: flex;\n align-items: center;\n }\n\n /* MainMenuItemInner.js \"tw:ml-3 tw:truncate tw:min-w-0\" */\n .main-menu-item-label {\n min-width: 0;\n margin-left: 12px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .main-menu-projects {\n position: relative;\n }\n\n /* FavoriteProjectOption.js */\n .main-menu-subnav.main-menu-subnav {\n padding: 2px 0;\n\n .main-menu-subnav-item {\n margin: 0;\n padding-right: 0;\n padding-left: 0;\n\n &:hover {\n background-color: unset;\n }\n }\n\n .main-menu-subnav-item-icon {\n flex-shrink: 0;\n margin-right: 8px;\n opacity: 0.5;\n fill: var(--color-theme-700);\n }\n\n .main-menu-subnav-item-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .main-menu-item {\n width: 100%;\n min-width: 0;\n height: 32px;\n margin-right: 12px;\n margin-left: 22px;\n padding: 8px;\n }\n\n .main-menu-item:hover {\n .main-menu-subnav-item-icon {\n fill: var(--color-theme-900);\n }\n\n .main-menu-subnav-item-text {\n color: var(--color-theme-900);\n }\n }\n\n .main-menu-subnav-item-active,\n .main-menu-subnav-item-active:hover {\n background-color: var(--color-secondary-200);\n\n .main-menu-subnav-item-icon {\n fill: var(--color-secondary);\n }\n\n .main-menu-subnav-item-text {\n color: var(--color-secondary);\n }\n }\n }\n\n .menu-section-text {\n opacity: 0.7;\n }\n\n .main-menu-item-text,\n .menu-section {\n transition: all ${TRANSITION};\n }\n\n /* \"tw:mb-2 tw:mx-3 tw:pl-3 tw:pr-1 tw:flex tw:justify-between tw:items-center menu-section\" */\n .menu-section {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 0 12px 8px;\n padding: 0 4px 0 12px;\n /* The height clips the heading as it opens and closes, so its text is never squeezed. The 4px keep a focus ring. */\n clip-path: inset(-4px);\n }\n\n &.expanded {\n .main-menu-item-text {\n opacity: 1;\n visibility: visible;\n }\n\n .menu-section {\n max-height: 32px;\n opacity: 1;\n }\n }\n\n &.collapsed {\n .main-menu-item-text {\n opacity: 0;\n visibility: hidden;\n }\n\n /* The heading keeps its height, so the items under it stay in place when the compact menu opens on hover. */\n .menu-section {\n max-height: 32px;\n opacity: 0;\n visibility: hidden;\n }\n }\n\n @media (max-width: ${XL}) {\n &.collapsed .menu-section,\n &.expanded .menu-section {\n max-height: 0;\n opacity: 0;\n }\n\n &.collapsed .main-menu-item-text,\n &.expanded .main-menu-item-text {\n width: 0;\n opacity: 0;\n visibility: hidden;\n }\n\n /* The narrow screen collapses the sidebar, never the drawer. */\n &.c-main-menu--drawer.expanded {\n .menu-section {\n max-height: 32px;\n opacity: 1;\n }\n\n .main-menu-item-text {\n width: auto;\n opacity: 1;\n visibility: visible;\n }\n }\n }\n\n /* FavoriteProjectsMenu.js target */\n .favorite-projects-menu-target {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n display: none;\n align-items: center;\n justify-content: center;\n width: 10px;\n height: 40px;\n border-radius: 4px;\n cursor: pointer;\n\n &.collapsed {\n display: flex;\n }\n\n @media (max-width: ${XL}) {\n display: flex;\n }\n\n svg {\n transform: rotate(180deg);\n }\n }\n\n &.main-menu-can-peek:not(.main-menu-peek-open)\n .favorite-projects-menu-target {\n display: none;\n }\n\n /* Where the drawer toggle sits in the expanded menu. */\n &.main-menu-peek-open .favorite-projects-menu-target.collapsed {\n top: 8px;\n right: 16px;\n width: 24px;\n height: 24px;\n }\n\n .favorite-projects-menu-target:hover {\n background-color: var(--color-theme-300);\n\n svg {\n fill: var(--color-theme-900);\n }\n }\n\n .main-menu-item-current + .favorite-projects-menu-target:hover,\n .favorite-projects-menu-target.open {\n background-color: var(--color-secondary-200);\n\n svg {\n fill: var(--color-secondary);\n }\n }\n\n /* ExpandToggle.jsx \"tw:transition-transform tw:duration-200\", up when expanded */\n .main-menu-toggle {\n flex-shrink: 0;\n transition: ${TOGGLE_TRANSITION};\n\n &.is-closed {\n transform: rotate(180deg);\n }\n }\n\n .favorite-projects-list,\n .favorite-projects-list-target {\n display: flex;\n\n &.collapsed {\n display: none;\n }\n\n @media (max-width: ${XL}) {\n display: none;\n }\n }\n\n .favorite-projects-list-target {\n margin-left: auto;\n }\n\n &.c-main-menu--drawer {\n .favorite-projects-list.favorite-projects-list,\n .favorite-projects-list-target.is-mobile {\n display: flex;\n }\n }\n\n .favorite-projects-list {\n opacity: 1;\n overflow: hidden;\n transition: all ${TRANSITION};\n }\n\n .favorite-projects-list-collapsed {\n opacity: 0;\n transition: all ${TRANSITION};\n }\n\n /* HiddenOptionList.js */\n .show-hidden-options-long {\n display: block;\n margin: 12px 24px;\n cursor: pointer;\n\n &.collapsed {\n display: none;\n }\n\n @media (max-width: ${XL}) {\n display: none;\n }\n }\n\n .show-hidden-options-short {\n display: none;\n margin: 12px 0;\n cursor: pointer;\n\n &.collapsed {\n display: block;\n }\n\n @media (max-width: ${XL}) {\n display: block;\n }\n }\n\n &.c-main-menu--drawer {\n .show-hidden-options-long.show-hidden-options-long {\n display: block;\n }\n\n .show-hidden-options-short.show-hidden-options-short {\n display: none;\n }\n }\n\n /* Shortcuts/List.js */\n .main-menu-shortcuts {\n position: relative;\n }\n\n .shortcuts-expander {\n margin-left: auto;\n cursor: pointer;\n }\n\n .shortcuts-expander-collapsed {\n position: absolute;\n top: -11px;\n right: 0;\n left: 0;\n display: none;\n margin: 0 auto;\n border-radius: 100%;\n background-color: var(--body-bg-main);\n cursor: pointer;\n\n &.collapsed {\n display: block;\n }\n\n @media (max-width: ${XL}) {\n display: block;\n }\n }\n\n /* The same margins in both widths, so the shortcuts do not move when the compact menu opens on hover. */\n .shortcuts-list-separator.c-list-separator {\n margin: 16px 12px 12px;\n transition: margin ${TRANSITION};\n\n @media (max-width: ${XL}) {\n margin: 20px 12px;\n }\n }\n\n .add-shortcut {\n cursor: pointer;\n\n .main-menu-item-text.main-menu-item-text {\n color: var(--color-secondary);\n }\n\n .main-menu-item-icon.main-menu-item-icon {\n fill: var(--color-secondary);\n opacity: 1;\n }\n\n &:hover {\n background-color: var(--color-primary-200);\n }\n\n &:focus {\n background-color: var(--color-primary-300);\n outline: none;\n }\n }\n\n /* HelpAndSupportMenu.js target \"tw:relative main-menu-item tw:shrink-0 tw:my-4 tw:hover:cursor-pointer\" */\n .main-menu-item.main-menu-help {\n position: relative;\n flex-shrink: 0;\n margin-top: 16px;\n margin-bottom: 16px;\n\n &:hover {\n cursor: pointer;\n }\n }\n\n .main-menu-help .main-menu-toggle.is-hidden {\n display: none;\n }\n\n /* HelpAndSupportMenu.js \"tw:bg-primary\": a promotion in place of Help & Support */\n .main-menu-item.main-menu-help--promo,\n .main-menu-item.main-menu-help--promo:hover,\n .main-menu-item.main-menu-help--promo.main-menu-item-current {\n background-color: var(--color-primary);\n }\n\n .main-menu-help-promo {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n .main-menu-help-promo-icon {\n flex-shrink: 0;\n fill: var(--page-paper-main);\n }\n\n /* \"tw:flex tw:visible tw:sm:invisible tw:xl:visible\" */\n .main-menu-help-promo-text {\n display: flex;\n visibility: visible;\n\n @media (min-width: ${SM}) {\n visibility: hidden;\n }\n\n @media (min-width: ${XL}) {\n visibility: visible;\n }\n }\n\n /* \"new-features-badge tw:absolute tw:right-1 tw:top-4 tw:sm:top-0 tw:sm:left-0 tw:sm:right-auto tw:ml-auto tw:mr-2\" */\n .main-menu-help-badge.main-menu-help-badge {\n position: absolute;\n top: 16px;\n right: 4px;\n margin-right: 8px;\n margin-left: auto;\n\n @media (min-width: ${SM}) {\n top: 0;\n right: auto;\n left: 0;\n }\n\n &.is-promo {\n right: 6px;\n\n @media (min-width: ${SM}) {\n right: auto;\n }\n }\n\n &.is-static {\n @media (min-width: ${XL}) {\n position: static;\n }\n }\n }\n\n /* MainMenuItemsEditor.js \"tw:flex tw:flex-col tw:min-h-0 tw:grow tw:outline-none\" */\n .main-menu-editor {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n min-height: 0;\n outline: none;\n }\n\n /* Editor/Header.js \"tw:mt-3\" */\n .main-menu-editor-header {\n margin-top: 12px;\n }\n\n .main-menu-editor-action {\n margin-right: 4px;\n }\n\n .main-menu-editor-list {\n display: flex;\n flex-grow: 1;\n min-height: 0;\n }\n\n .main-menu-editor-list-inner {\n overflow-x: hidden;\n }\n\n /* DraggableListItem.js \"tw:pr-3 tw:pl-2 tw:mt-0\" with marginBottom 2px */\n .main-menu-editor-row.c-list-item {\n margin: 0 0 2px;\n padding-right: 12px;\n padding-left: 8px;\n }\n\n .main-menu-editor-row-box {\n width: 100%;\n border-radius: var(--ac-br-8);\n }\n\n .main-menu-editor-row-inner {\n display: flex;\n align-items: center;\n width: 100%;\n }\n\n .main-menu-editor-handle {\n margin-right: 4px;\n cursor: move;\n }\n\n /* Editor/MainMenuItem.js \"main-menu-edit-item tw:h-10 tw:w-full tw:pr-1\" with maxWidth 204px */\n .main-menu-edit-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n max-width: 204px;\n height: 40px;\n padding-right: 4px;\n text-decoration: none;\n }\n\n .main-menu-edit-item-start {\n display: flex;\n align-items: center;\n min-width: 0;\n }\n\n .main-menu-edit-item.hidden {\n .main-menu-item-icon,\n .main-menu-item-text {\n opacity: 0.4;\n }\n }\n\n /* \"tw:flex tw:items-center tw:h-6 tw:mb-2 tw:mx-3 tw:px-3 menu-section-text\" */\n .main-menu-editor-shortcuts-title {\n display: flex;\n align-items: center;\n height: 24px;\n margin: 0 12px 8px;\n padding: 0 12px;\n }\n\n /* MainMenuMobile.js \"tw:absolute tw:right-4 tw:top-4 tw:sm:hidden\" */\n .main-menu-drawer-close {\n position: absolute;\n top: 16px;\n right: 16px;\n\n @media (min-width: ${SM}) {\n display: none;\n }\n }\n`;\n\nStyledMainMenu.displayName = \"StyledMainMenu\";\n\n/* HelpAndSupportMenu.js: \"tw:mt-3\" on the first item, \"tw:mb-3\" on the last, \"tw:shrink-0 tw:mr-3\" on the icons */\nexport const StyledHelpList = styled(List)`\n outline: 2px solid transparent;\n outline-offset: 2px;\n\n .c-list-item > svg:first-child {\n flex-shrink: 0;\n margin-right: 12px;\n }\n\n .c-list-item:first-child {\n margin-top: 12px;\n }\n\n .c-list-item:last-child {\n margin-bottom: 12px;\n }\n\n .main-menu-help-entry-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .main-menu-help-entry-badge {\n margin-left: auto;\n }\n\n /* an entry with a link: \"tw:no-underline\" */\n a.c-list-item {\n text-decoration: none;\n }\n\n .main-menu-help-entry.is-primary {\n color: var(--color-primary);\n\n > svg:first-child {\n fill: var(--color-primary);\n }\n }\n\n /* \"tw:justify-between tw:gap-3\" */\n .main-menu-help-entry-text.has-end {\n margin-right: 12px;\n }\n\n .main-menu-help-entry-end {\n flex-shrink: 0;\n margin-left: auto;\n }\n`;\n\nStyledHelpList.displayName = \"StyledHelpList\";\n\nexport const StyledSettingsList = styled(List)`\n outline: 2px solid transparent;\n outline-offset: 2px;\n\n .c-list-item:first-child {\n margin-top: 12px;\n }\n\n .c-list-item:last-child {\n margin-bottom: 12px;\n }\n\n .main-menu-settings-row {\n justify-content: space-between;\n gap: 12px;\n }\n\n .main-menu-settings-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n /* The row takes the click, so the control only shows the state. */\n .main-menu-settings-control {\n flex-shrink: 0;\n pointer-events: none;\n }\n`;\n\nStyledSettingsList.displayName = \"StyledSettingsList\";\n\n/* FavoriteProjectsMenu.js \"tw:py-2\", FavoriteProjectMenuOption.js */\nexport const StyledFavoritesMenuList = styled(List)`\n padding: 8px 0;\n\n .c-list-item {\n padding-right: 0;\n padding-left: 0;\n }\n\n .favorite-project-menu-option {\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: border-box;\n width: 100%;\n padding: 0 16px;\n color: var(--color-theme-900);\n text-decoration: none;\n\n svg {\n flex-shrink: 0;\n margin-right: 8px;\n opacity: 0.5;\n }\n\n &.favorite-project-menu-option-active {\n background-color: var(--color-secondary-200);\n\n svg {\n fill: var(--color-secondary);\n }\n\n .favorite-project-menu-option-text {\n color: var(--color-secondary);\n }\n }\n }\n\n .favorite-project-menu-option-text {\n flex: 1;\n padding-right: 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n`;\n\nStyledFavoritesMenuList.displayName = \"StyledFavoritesMenuList\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,iBAAiB,QAAQ,mBAAmB;AAE7D,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,IAAI,QAAQ,SAAS;AAE9B,OAAO,MAAMC,EAAE,GAAG,OAAO;AACzB,OAAO,MAAMC,EAAE,GAAG,QAAQ;AAC1B,OAAO,MAAMC,aAAa,oBAAkBD,EAAE,MAAG;AACjD,OAAO,MAAME,eAAe,GAAG,EAAE;AACjC,OAAO,MAAMC,cAAc,GAAG,GAAG;AAEjC,MAAMC,UAAU,GAAG,YAAY;AAC/B,MAAMC,iBAAiB,GAAG,8CAA8C;;AAExE;AACA,OAAO,MAAMC,mBAAmB,GAAGV,iBAAiB,iDAInD;AAED,OAAO,MAAMW,cAAc,GAAGZ,MAAM,CAACa,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,6kVACpCd,cAAc,EAYOE,EAAE,EAWdI,cAAc,EAIdD,eAAe,EAKJE,UAAU,EAETJ,EAAE,EACZE,eAAe,EAKjBC,cAAc,EAedD,eAAe,EAUfC,cAAc,EAEZA,cAAc,GAAGD,eAAe,EA0BlCC,cAAc,GAAG,EAAE,EA8BPC,UAAU,EAUbA,UAAU,EAIRA,UAAU,EAGPJ,EAAE,EAeHI,UAAU,EAmGbJ,EAAE,EAkDDI,UAAU,EAkHZA,UAAU,EAyCTJ,EAAE,EA+CAA,EAAE,EA0CTK,iBAAiB,EAeVL,EAAE,EAmBLI,UAAU,EAKVA,UAAU,EAaPJ,EAAE,EAcFA,EAAE,EAwCFA,EAAE,EAQFI,UAAU,EAEVJ,EAAE,EAkEFD,EAAE,EAIFC,EAAE,EAaFD,EAAE,EASAA,EAAE,EAMFC,EAAE,EAiGJD,EAAE,CAI1B;AAEDQ,cAAc,CAACG,WAAW,GAAG,gBAAgB;;AAE7C;AACA,OAAO,MAAME,cAAc,GAAGjB,MAAM,CAACG,IAAI,CAAC,CAAAW,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,ilBAiDzC;AAEDC,cAAc,CAACF,WAAW,GAAG,gBAAgB;AAE7C,OAAO,MAAMG,kBAAkB,GAAGlB,MAAM,CAACG,IAAI,CAAC,CAAAW,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kWA4B7C;AAEDE,kBAAkB,CAACH,WAAW,GAAG,oBAAoB;;AAErD;AACA,OAAO,MAAMI,uBAAuB,GAAGnB,MAAM,CAACG,IAAI,CAAC,CAAAW,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,8lBA4ClD;AAEDG,uBAAuB,CAACJ,WAAW,GAAG,yBAAyB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../src/components/MainMenu/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAMV,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,kBAAkB,EAClB,eAAe,EAChB,MAAM,SAAS,CAAC;AAIjB,eAAO,MAAM,eAAe,GAAI,CAAC,EAC/B,OAAO,CAAC,GAAG,SAAS,EACpB,cAAc,CAAC,EACf,WAAW,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,KAC5B,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAgBxB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,KAAG,OAsB7C,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,SAAS,SAAS,CAAC,WAAW,CAAC,EAC/B,YAAY,OAAO,KAClB,OA2BF,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../src/components/MainMenu/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAMV,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,kBAAkB,EAClB,eAAe,EAChB,MAAM,SAAS,CAAC;AAIjB,eAAO,MAAM,eAAe,GAAI,CAAC,EAC/B,OAAO,CAAC,GAAG,SAAS,EACpB,cAAc,CAAC,EACf,WAAW,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,KAC5B,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAgBxB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,KAAG,OAsB7C,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,SAAS,SAAS,CAAC,WAAW,CAAC,EAC/B,YAAY,OAAO,KAClB,OA2BF,CAAC;AAwBF,eAAO,MAAM,gBAAgB,GAC3B,SAAS,SAAS,CAAC,WAAW,CAAC,EAC/B,YAAY,OAAO,iCAK2B,OAAO,UA4CtD,CAAC;AAGF,eAAO,MAAM,WAAW,GAAI,SAAS,SAAS,CAAC,WAAW,CAAC,0FAoB1D,CAAC;AAIF,eAAO,MAAM,aAAa,GAAI,YAAY,OAAO,EAAE,QAAQ,MAAM,IAAI,SAuBpE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,SAAS,CAAC,WAAW,CAAC,EAC/B,UAAU,OAAO,EACjB,WAAW,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,SAkBrC,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,eAAe,GAAI,OAAO,kBAAkB;;;8CA/NpC,IAAI;;8CAAJ,IAAI;;;;;CAkRxB,CAAC"}
|
|
@@ -74,9 +74,6 @@ const isPointerOverMenu = (root, event) => {
|
|
|
74
74
|
// The menu sits on the left edge of the page, so the gutter on its left counts too.
|
|
75
75
|
return event.clientX < right && event.clientY >= top && event.clientY < bottom;
|
|
76
76
|
};
|
|
77
|
-
|
|
78
|
-
// The pointer on the tab of a closed menu must not open the peek, because the click there changes the mode.
|
|
79
|
-
const isOnTabOfClosedMenu = (root, event) => !(root != null && root.classList.contains("main-menu-peek")) && Boolean(event.target.closest == null ? void 0 : event.target.closest(".main-menu-collapse-tab"));
|
|
80
77
|
export const usePointerInside = (rootRef, isWatching) => {
|
|
81
78
|
const _useState4 = useState(false),
|
|
82
79
|
isInside = _useState4[0],
|
|
@@ -99,11 +96,7 @@ export const usePointerInside = (rootRef, isWatching) => {
|
|
|
99
96
|
leaveTimer.current = setTimeout(() => setIsInside(false), LEAVE_DELAY_MS);
|
|
100
97
|
}
|
|
101
98
|
};
|
|
102
|
-
const handleOver = event =>
|
|
103
|
-
if (!isOnTabOfClosedMenu(rootRef.current, event)) {
|
|
104
|
-
update(isPointerOverMenu(rootRef.current, event));
|
|
105
|
-
}
|
|
106
|
-
};
|
|
99
|
+
const handleOver = event => update(isPointerOverMenu(rootRef.current, event));
|
|
107
100
|
const handleOut = event => {
|
|
108
101
|
if (!event.relatedTarget) {
|
|
109
102
|
update(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","names":["useCallback","useEffect","useMemo","useRef","useState","DEFAULT_MAIN_MENU_LABELS","LEAVE_DELAY_MS","useControllable","value","defaultValue","onChange","_useState","own","setOwn","isControlled","undefined","setValue","next","useMediaQuery","query","getMatch","window","matchMedia","matches","_useState2","setMatches","list","update","addEventListener","removeEventListener","useHasOpenPopup","rootRef","isWatching","_useState3","hasOpenPopup","setHasOpenPopup","root","current","Boolean","querySelector","observer","MutationObserver","observe","subtree","attributes","attributeFilter","disconnect","isPointerOverMenu","event","_root$querySelector","document","contains","target","_getBoundingClientRec","getBoundingClientRect","right","top","bottom","clientX","clientY","isOnTabOfClosedMenu","classList","closest","usePointerInside","_useState4","isInside","setIsInside","leaveTimer","setPointerInside","inside","clearTimeout","setTimeout","handleOver","handleOut","relatedTarget","usePeekHold","_useState5","isHeld","setIsHeld","release","useDialogOpen","onOpen","check","body","childList","useOpenMenuPointer","isActive","onPointer","handlePointer","useMainMenuData","props","_props$defaultFavorit","_props$defaultShortcu","_props$defaultEditMod","labels","_extends","_useControllable","favoritesExpanded","defaultFavoritesExpanded","onFavoritesExpandedChange","setFavoritesExpanded","_useControllable2","shortcutsExpanded","defaultShortcutsExpanded","onShortcutsExpandedChange","setShortcutsExpanded","_useControllable3","editMode","defaultEditMode","onEditModeChange","setEditMode","editButtonRef","returnFocusRef","enterEditMode","exitEditMode","returnFocus","_editButtonRef$curren","focus"],"sources":["../../../../src/components/MainMenu/hooks.ts"],"sourcesContent":["import {\n RefObject,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport {\n DEFAULT_MAIN_MENU_LABELS,\n IMainMenuDataProps,\n IMainMenuLabels,\n} from \"./types\";\n\nconst LEAVE_DELAY_MS = 150;\n\nexport const useControllable = <T>(\n value: T | undefined,\n defaultValue: T,\n onChange?: (value: T) => void\n): [T, (value: T) => void] => {\n const [own, setOwn] = useState(defaultValue);\n const isControlled = value !== undefined;\n\n const setValue = useCallback(\n (next: T) => {\n if (!isControlled) {\n setOwn(next);\n }\n\n onChange?.(next);\n },\n [isControlled, onChange]\n );\n\n return [isControlled ? value : own, setValue];\n};\n\nexport const useMediaQuery = (query: string): boolean => {\n const getMatch = () =>\n typeof window !== \"undefined\" && typeof window.matchMedia === \"function\"\n ? window.matchMedia(query).matches\n : false;\n const [matches, setMatches] = useState(getMatch);\n\n useEffect(() => {\n if (typeof window.matchMedia !== \"function\") {\n return undefined;\n }\n\n const list = window.matchMedia(query);\n const update = () => setMatches(list.matches);\n\n update();\n list.addEventListener?.(\"change\", update);\n\n return () => list.removeEventListener?.(\"change\", update);\n }, [query]);\n\n return matches;\n};\n\nexport const useHasOpenPopup = (\n rootRef: RefObject<HTMLElement>,\n isWatching: boolean\n): boolean => {\n const [hasOpenPopup, setHasOpenPopup] = useState(false);\n\n useEffect(() => {\n const root = rootRef.current;\n\n if (!isWatching || !root) {\n setHasOpenPopup(false);\n\n return undefined;\n }\n\n const update = () =>\n setHasOpenPopup(Boolean(root.querySelector('[aria-expanded=\"true\"]')));\n const observer = new MutationObserver(update);\n\n update();\n observer.observe(root, {\n subtree: true,\n attributes: true,\n attributeFilter: [\"aria-expanded\"],\n });\n\n return () => observer.disconnect();\n }, [rootRef, isWatching]);\n\n return hasOpenPopup;\n};\n\n// Native events on the document: a React leave misses a node removed under the pointer and counts portals as inside.\n// A popup lays an overlay over the page, so the target alone does not tell where the pointer is.\nconst isPointerOverMenu = (root: HTMLElement | null, event: MouseEvent) => {\n // A modal dialog covers the menu, so the pointer cannot reach the menu.\n if (!root || document.querySelector(\"dialog[open]\")) {\n return false;\n }\n\n if (root.contains(event.target as Node)) {\n return true;\n }\n\n const { right, top, bottom } = (\n root.querySelector(\".main-menu-panel\") ?? root\n ).getBoundingClientRect();\n\n // The menu sits on the left edge of the page, so the gutter on its left counts too.\n return (\n event.clientX < right && event.clientY >= top && event.clientY < bottom\n );\n};\n\n// The pointer on the tab of a closed menu must not open the peek, because the click there changes the mode.\nconst isOnTabOfClosedMenu = (root: HTMLElement | null, event: MouseEvent) =>\n !root?.classList.contains(\"main-menu-peek\") &&\n Boolean((event.target as Element).closest?.(\".main-menu-collapse-tab\"));\n\nexport const usePointerInside = (\n rootRef: RefObject<HTMLElement>,\n isWatching: boolean\n) => {\n const [isInside, setIsInside] = useState(false);\n const leaveTimer = useRef<ReturnType<typeof setTimeout>>();\n\n const setPointerInside = useCallback((inside: boolean) => {\n clearTimeout(leaveTimer.current);\n setIsInside(inside);\n }, []);\n\n useEffect(() => {\n if (!isWatching) {\n setIsInside(false);\n\n return undefined;\n }\n\n const update = (inside: boolean) => {\n clearTimeout(leaveTimer.current);\n\n if (inside) {\n setIsInside(true);\n } else {\n leaveTimer.current = setTimeout(\n () => setIsInside(false),\n LEAVE_DELAY_MS\n );\n }\n };\n\n const handleOver = (event: MouseEvent) => {\n if (!isOnTabOfClosedMenu(rootRef.current, event)) {\n update(isPointerOverMenu(rootRef.current, event));\n }\n };\n const handleOut = (event: MouseEvent) => {\n if (!event.relatedTarget) {\n update(false);\n }\n };\n\n document.addEventListener(\"mouseover\", handleOver, true);\n document.addEventListener(\"mouseout\", handleOut, true);\n\n return () => {\n clearTimeout(leaveTimer.current);\n document.removeEventListener(\"mouseover\", handleOver, true);\n document.removeEventListener(\"mouseout\", handleOut, true);\n };\n }, [rootRef, isWatching]);\n\n return [isInside, setPointerInside] as const;\n};\n\n// After a collapse the pointer is still over the menu, so only a leave brings the peek back.\nexport const usePeekHold = (rootRef: RefObject<HTMLElement>) => {\n const [isHeld, setIsHeld] = useState(false);\n\n useEffect(() => {\n if (!isHeld) {\n return undefined;\n }\n\n const release = (event: MouseEvent) => {\n if (!isPointerOverMenu(rootRef.current, event)) {\n setIsHeld(false);\n }\n };\n\n document.addEventListener(\"mouseover\", release, true);\n\n return () => document.removeEventListener(\"mouseover\", release, true);\n }, [rootRef, isHeld]);\n\n return [isHeld, setIsHeld] as const;\n};\n\n// The listeners run only while the menu is fully open.\n// Every Dialog is a native modal <dialog>, and showModal sends no event to listen for.\nexport const useDialogOpen = (isWatching: boolean, onOpen: () => void) => {\n useEffect(() => {\n if (!isWatching) {\n return undefined;\n }\n\n const check = () => {\n if (document.querySelector(\"dialog[open]\")) {\n onOpen();\n }\n };\n const observer = new MutationObserver(check);\n\n check();\n observer.observe(document.body, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [\"open\"],\n });\n\n return () => observer.disconnect();\n }, [isWatching, onOpen]);\n};\n\nexport const useOpenMenuPointer = (\n rootRef: RefObject<HTMLElement>,\n isActive: boolean,\n onPointer: (inside: boolean) => void\n) => {\n useEffect(() => {\n if (!isActive) {\n return undefined;\n }\n\n const handlePointer = (event: MouseEvent) =>\n onPointer(isPointerOverMenu(rootRef.current, event));\n\n document.addEventListener(\"mousemove\", handlePointer, true);\n document.addEventListener(\"click\", handlePointer, true);\n\n return () => {\n document.removeEventListener(\"mousemove\", handlePointer, true);\n document.removeEventListener(\"click\", handlePointer, true);\n };\n }, [rootRef, isActive, onPointer]);\n};\n\n/** The states and the labels that the desktop menu and the drawer resolve the same way. */\nexport const useMainMenuData = (props: IMainMenuDataProps) => {\n const labels: IMainMenuLabels = useMemo(\n () => ({ ...DEFAULT_MAIN_MENU_LABELS, ...props.labels }),\n [props.labels]\n );\n const [favoritesExpanded, setFavoritesExpanded] = useControllable(\n props.favoritesExpanded,\n props.defaultFavoritesExpanded ?? false,\n props.onFavoritesExpandedChange\n );\n const [shortcutsExpanded, setShortcutsExpanded] = useControllable(\n props.shortcutsExpanded,\n props.defaultShortcutsExpanded ?? true,\n props.onShortcutsExpandedChange\n );\n const [editMode, setEditMode] = useControllable(\n props.editMode,\n props.defaultEditMode ?? false,\n props.onEditModeChange\n );\n const editButtonRef = useRef<HTMLButtonElement>(null);\n const returnFocusRef = useRef(false);\n\n const enterEditMode = useCallback(() => setEditMode(true), [setEditMode]);\n const exitEditMode = useCallback(\n (returnFocus = true) => {\n returnFocusRef.current = returnFocus;\n setEditMode(false);\n },\n [setEditMode]\n );\n\n // Leaving edit mode mounts a new edit button, so the focus moves to it once it is there.\n useEffect(() => {\n if (!editMode && returnFocusRef.current) {\n returnFocusRef.current = false;\n editButtonRef.current?.focus();\n }\n }, [editMode]);\n\n return {\n labels,\n favoritesExpanded,\n setFavoritesExpanded,\n shortcutsExpanded,\n setShortcutsExpanded,\n editMode,\n enterEditMode,\n exitEditMode,\n editButtonRef,\n };\n};\n"],"mappings":";AAAA,SAEEA,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AAEd,SACEC,wBAAwB,QAGnB,SAAS;AAEhB,MAAMC,cAAc,GAAG,GAAG;AAE1B,OAAO,MAAMC,eAAe,GAAGA,CAC7BC,KAAoB,EACpBC,YAAe,EACfC,QAA6B,KACD;EAC5B,MAAAC,SAAA,GAAsBP,QAAQ,CAACK,YAAY,CAAC;IAArCG,G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
{"version":3,"file":"hooks.js","names":["useCallback","useEffect","useMemo","useRef","useState","DEFAULT_MAIN_MENU_LABELS","LEAVE_DELAY_MS","useControllable","value","defaultValue","onChange","_useState","own","setOwn","isControlled","undefined","setValue","next","useMediaQuery","query","getMatch","window","matchMedia","matches","_useState2","setMatches","list","update","addEventListener","removeEventListener","useHasOpenPopup","rootRef","isWatching","_useState3","hasOpenPopup","setHasOpenPopup","root","current","Boolean","querySelector","observer","MutationObserver","observe","subtree","attributes","attributeFilter","disconnect","isPointerOverMenu","event","_root$querySelector","document","contains","target","_getBoundingClientRec","getBoundingClientRect","right","top","bottom","clientX","clientY","usePointerInside","_useState4","isInside","setIsInside","leaveTimer","setPointerInside","inside","clearTimeout","setTimeout","handleOver","handleOut","relatedTarget","usePeekHold","_useState5","isHeld","setIsHeld","release","useDialogOpen","onOpen","check","body","childList","useOpenMenuPointer","isActive","onPointer","handlePointer","useMainMenuData","props","_props$defaultFavorit","_props$defaultShortcu","_props$defaultEditMod","labels","_extends","_useControllable","favoritesExpanded","defaultFavoritesExpanded","onFavoritesExpandedChange","setFavoritesExpanded","_useControllable2","shortcutsExpanded","defaultShortcutsExpanded","onShortcutsExpandedChange","setShortcutsExpanded","_useControllable3","editMode","defaultEditMode","onEditModeChange","setEditMode","editButtonRef","returnFocusRef","enterEditMode","exitEditMode","returnFocus","_editButtonRef$curren","focus"],"sources":["../../../../src/components/MainMenu/hooks.ts"],"sourcesContent":["import {\n RefObject,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport {\n DEFAULT_MAIN_MENU_LABELS,\n IMainMenuDataProps,\n IMainMenuLabels,\n} from \"./types\";\n\nconst LEAVE_DELAY_MS = 150;\n\nexport const useControllable = <T>(\n value: T | undefined,\n defaultValue: T,\n onChange?: (value: T) => void\n): [T, (value: T) => void] => {\n const [own, setOwn] = useState(defaultValue);\n const isControlled = value !== undefined;\n\n const setValue = useCallback(\n (next: T) => {\n if (!isControlled) {\n setOwn(next);\n }\n\n onChange?.(next);\n },\n [isControlled, onChange]\n );\n\n return [isControlled ? value : own, setValue];\n};\n\nexport const useMediaQuery = (query: string): boolean => {\n const getMatch = () =>\n typeof window !== \"undefined\" && typeof window.matchMedia === \"function\"\n ? window.matchMedia(query).matches\n : false;\n const [matches, setMatches] = useState(getMatch);\n\n useEffect(() => {\n if (typeof window.matchMedia !== \"function\") {\n return undefined;\n }\n\n const list = window.matchMedia(query);\n const update = () => setMatches(list.matches);\n\n update();\n list.addEventListener?.(\"change\", update);\n\n return () => list.removeEventListener?.(\"change\", update);\n }, [query]);\n\n return matches;\n};\n\nexport const useHasOpenPopup = (\n rootRef: RefObject<HTMLElement>,\n isWatching: boolean\n): boolean => {\n const [hasOpenPopup, setHasOpenPopup] = useState(false);\n\n useEffect(() => {\n const root = rootRef.current;\n\n if (!isWatching || !root) {\n setHasOpenPopup(false);\n\n return undefined;\n }\n\n const update = () =>\n setHasOpenPopup(Boolean(root.querySelector('[aria-expanded=\"true\"]')));\n const observer = new MutationObserver(update);\n\n update();\n observer.observe(root, {\n subtree: true,\n attributes: true,\n attributeFilter: [\"aria-expanded\"],\n });\n\n return () => observer.disconnect();\n }, [rootRef, isWatching]);\n\n return hasOpenPopup;\n};\n\n// Native events on the document: a React leave misses a node removed under the pointer and counts portals as inside.\n// A popup lays an overlay over the page, so the target alone does not tell where the pointer is.\nconst isPointerOverMenu = (root: HTMLElement | null, event: MouseEvent) => {\n // A modal dialog covers the menu, so the pointer cannot reach the menu.\n if (!root || document.querySelector(\"dialog[open]\")) {\n return false;\n }\n\n if (root.contains(event.target as Node)) {\n return true;\n }\n\n const { right, top, bottom } = (\n root.querySelector(\".main-menu-panel\") ?? root\n ).getBoundingClientRect();\n\n // The menu sits on the left edge of the page, so the gutter on its left counts too.\n return (\n event.clientX < right && event.clientY >= top && event.clientY < bottom\n );\n};\n\nexport const usePointerInside = (\n rootRef: RefObject<HTMLElement>,\n isWatching: boolean\n) => {\n const [isInside, setIsInside] = useState(false);\n const leaveTimer = useRef<ReturnType<typeof setTimeout>>();\n\n const setPointerInside = useCallback((inside: boolean) => {\n clearTimeout(leaveTimer.current);\n setIsInside(inside);\n }, []);\n\n useEffect(() => {\n if (!isWatching) {\n setIsInside(false);\n\n return undefined;\n }\n\n const update = (inside: boolean) => {\n clearTimeout(leaveTimer.current);\n\n if (inside) {\n setIsInside(true);\n } else {\n leaveTimer.current = setTimeout(\n () => setIsInside(false),\n LEAVE_DELAY_MS\n );\n }\n };\n\n const handleOver = (event: MouseEvent) =>\n update(isPointerOverMenu(rootRef.current, event));\n const handleOut = (event: MouseEvent) => {\n if (!event.relatedTarget) {\n update(false);\n }\n };\n\n document.addEventListener(\"mouseover\", handleOver, true);\n document.addEventListener(\"mouseout\", handleOut, true);\n\n return () => {\n clearTimeout(leaveTimer.current);\n document.removeEventListener(\"mouseover\", handleOver, true);\n document.removeEventListener(\"mouseout\", handleOut, true);\n };\n }, [rootRef, isWatching]);\n\n return [isInside, setPointerInside] as const;\n};\n\n// After a collapse the pointer is still over the menu, so only a leave brings the peek back.\nexport const usePeekHold = (rootRef: RefObject<HTMLElement>) => {\n const [isHeld, setIsHeld] = useState(false);\n\n useEffect(() => {\n if (!isHeld) {\n return undefined;\n }\n\n const release = (event: MouseEvent) => {\n if (!isPointerOverMenu(rootRef.current, event)) {\n setIsHeld(false);\n }\n };\n\n document.addEventListener(\"mouseover\", release, true);\n\n return () => document.removeEventListener(\"mouseover\", release, true);\n }, [rootRef, isHeld]);\n\n return [isHeld, setIsHeld] as const;\n};\n\n// The listeners run only while the menu is fully open.\n// Every Dialog is a native modal <dialog>, and showModal sends no event to listen for.\nexport const useDialogOpen = (isWatching: boolean, onOpen: () => void) => {\n useEffect(() => {\n if (!isWatching) {\n return undefined;\n }\n\n const check = () => {\n if (document.querySelector(\"dialog[open]\")) {\n onOpen();\n }\n };\n const observer = new MutationObserver(check);\n\n check();\n observer.observe(document.body, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [\"open\"],\n });\n\n return () => observer.disconnect();\n }, [isWatching, onOpen]);\n};\n\nexport const useOpenMenuPointer = (\n rootRef: RefObject<HTMLElement>,\n isActive: boolean,\n onPointer: (inside: boolean) => void\n) => {\n useEffect(() => {\n if (!isActive) {\n return undefined;\n }\n\n const handlePointer = (event: MouseEvent) =>\n onPointer(isPointerOverMenu(rootRef.current, event));\n\n document.addEventListener(\"mousemove\", handlePointer, true);\n document.addEventListener(\"click\", handlePointer, true);\n\n return () => {\n document.removeEventListener(\"mousemove\", handlePointer, true);\n document.removeEventListener(\"click\", handlePointer, true);\n };\n }, [rootRef, isActive, onPointer]);\n};\n\n/** The states and the labels that the desktop menu and the drawer resolve the same way. */\nexport const useMainMenuData = (props: IMainMenuDataProps) => {\n const labels: IMainMenuLabels = useMemo(\n () => ({ ...DEFAULT_MAIN_MENU_LABELS, ...props.labels }),\n [props.labels]\n );\n const [favoritesExpanded, setFavoritesExpanded] = useControllable(\n props.favoritesExpanded,\n props.defaultFavoritesExpanded ?? false,\n props.onFavoritesExpandedChange\n );\n const [shortcutsExpanded, setShortcutsExpanded] = useControllable(\n props.shortcutsExpanded,\n props.defaultShortcutsExpanded ?? true,\n props.onShortcutsExpandedChange\n );\n const [editMode, setEditMode] = useControllable(\n props.editMode,\n props.defaultEditMode ?? false,\n props.onEditModeChange\n );\n const editButtonRef = useRef<HTMLButtonElement>(null);\n const returnFocusRef = useRef(false);\n\n const enterEditMode = useCallback(() => setEditMode(true), [setEditMode]);\n const exitEditMode = useCallback(\n (returnFocus = true) => {\n returnFocusRef.current = returnFocus;\n setEditMode(false);\n },\n [setEditMode]\n );\n\n // Leaving edit mode mounts a new edit button, so the focus moves to it once it is there.\n useEffect(() => {\n if (!editMode && returnFocusRef.current) {\n returnFocusRef.current = false;\n editButtonRef.current?.focus();\n }\n }, [editMode]);\n\n return {\n labels,\n favoritesExpanded,\n setFavoritesExpanded,\n shortcutsExpanded,\n setShortcutsExpanded,\n editMode,\n enterEditMode,\n exitEdit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
67
67
|
export interface IMainMenuLabels {
|
|
68
68
|
customizeMenu: string;
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
settings: string;
|
|
70
|
+
compactMenu: string;
|
|
71
|
+
wideMenu: string;
|
|
72
|
+
autoExpand: string;
|
|
71
73
|
menu: string;
|
|
72
74
|
edit: string;
|
|
73
75
|
shortcuts: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/MainMenu/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEvE,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAC/B,sGAAsG;IACtG,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC1D;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,C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AC;IACpC,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oDAAoD;IACpD,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6JAA6J;IAC7J,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,OAAO,KAAK,IAAI,KAAK,SAAS,CAAC;IACpE,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,qDAAqD;IACrD,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAClD,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC5D,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACnC"}
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
export const DEFAULT_MAIN_MENU_LABELS = {
|
|
4
4
|
customizeMenu: "Customize Menu",
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
settings: "Menu Settings",
|
|
6
|
+
compactMenu: "Compact Menu",
|
|
7
|
+
wideMenu: "Wide Menu",
|
|
8
|
+
autoExpand: "Auto-Expand",
|
|
7
9
|
menu: "MENU",
|
|
8
10
|
edit: "Edit",
|
|
9
11
|
shortcuts: "SHORTCUTS",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["DEFAULT_MAIN_MENU_LABELS","customizeMenu","
|
|
1
|
+
{"version":3,"file":"types.js","names":["DEFAULT_MAIN_MENU_LABELS","customizeMenu","settings","compactMenu","wideMenu","autoExpand","menu","edit","shortcuts","addNew","showMore","showLess","more","less","helpAndSupport","editing","restoreDefault","save","cancel","show","hide","delete","restore","close"],"sources":["../../../../src/components/MainMenu/types.ts"],"sourcesContent":["import { ComponentType, MouseEvent, ReactNode, SVGProps } from \"react\";\n\nexport type MainMenuIcon = ComponentType<SVGProps<SVGSVGElement>>;\n\nexport interface MainMenuItemData {\n /** The key of the item, for example \"projects\". The \"projects\" item carries the favorite projects. */\n id: string;\n text: string;\n icon: MainMenuIcon;\n href?: string;\n /** The `id` of the link, for example a target of a feature pointer. */\n elementId?: string;\n /** Marks the item current, besides `currentItem`, for example on a page under another item. */\n current?: boolean;\n /** Opens the link in a new tab with \"_blank\". */\n target?: string;\n rel?: string;\n /** A click on the link, before `onNavigate`. */\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n}\n\nexport interface MainMenuShortcutData {\n id: number | string;\n name: string;\n icon: MainMenuIcon;\n href?: string;\n /** Marks the shortcut current, for example when its page is open. */\n current?: boolean;\n /** Opens the link in a new tab with \"_blank\", for example an external shortcut. */\n target?: string;\n rel?: string;\n /** A click on the link, before `onNavigate`. */\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n}\n\nexport interface MainMenuFavoriteData {\n id: number | string;\n /** The display name, with the project number when the account shows it. */\n name: string;\n href?: string;\n}\n\nexport interface MainMenuHelpEntry {\n id: string;\n text: string;\n icon: MainMenuIcon;\n onClick?: (event: MouseEvent<HTMLElement>) => void;\n /** A count in a red badge after the text, for example the unseen new features. */\n badge?: number;\n /** Makes the entry a link. The menu closes on its click. */\n href?: string;\n target?: string;\n rel?: string;\n /** \"primary\" draws the text and the icon in the primary color, for example a promotion. */\n tone?: \"primary\";\n /** Content at the end of the entry, for example a discount chip. */\n end?: ReactNode;\n /** The `id` of the text, for example a target of a feature pointer. */\n elementId?: string;\n className?: string;\n tabIndex?: number;\n}\n\n/** A promotion in place of the Help & Support item: a primary filled item with its own icon and text. */\nexport interface MainMenuHelpPromo {\n label: string;\n icon: MainMenuIcon;\n}\n\nexport interface MainMenuEditResult {\n hidden: string[];\n deleted: Array<number | string>;\n}\n\nexport interface IMainMenuLabels {\n customizeMenu: string;\n settings: string;\n compactMenu: string;\n wideMenu: string;\n autoExpand: string;\n menu: string;\n edit: string;\n shortcuts: string;\n addNew: string;\n showMore: string;\n showLess: string;\n more: string;\n less: string;\n helpAndSupport: string;\n editing: string;\n restoreDefault: string;\n save: string;\n cancel: string;\n show: string;\n hide: string;\n delete: string;\n restore: string;\n close: string;\n}\n\nexport const DEFAULT_MAIN_MENU_LABELS: IMainMenuLabels = {\n customizeMenu: \"Customize Menu\",\n settings: \"Menu Settings\",\n compactMenu: \"Compact Menu\",\n wideMenu: \"Wide Menu\",\n autoExpand: \"Auto-Expand\",\n menu: \"MENU\",\n edit: \"Edit\",\n shortcuts: \"SHORTCUTS\",\n addNew: \"Add new\",\n showMore: \"Show more\",\n showLess: \"Show less\",\n more: \"More\",\n less: \"Less\",\n helpAndSupport: \"Help & Support\",\n editing: \"EDITING\",\n restoreDefault: \"Restore Default\",\n save: \"Save\",\n cancel: \"Cancel\",\n show: \"Show\",\n hide: \"Hide\",\n delete: \"Delete\",\n restore: \"Restore\",\n close: \"Close\",\n};\n\n/** The data and the handlers that the desktop menu and the drawer share. */\nexport interface IMainMenuDataProps {\n /** The items in their saved order. */\n items: MainMenuItemData[];\n /** The ids of the hidden items. They show under \"Show more\", and dimmed in the editor. */\n hiddenItems?: string[];\n /** The id of the item of the current page. */\n currentItem?: string;\n /** The favorite projects under the Projects item. */\n favorites?: MainMenuFavoriteData[];\n /** The id of the favorite project of the current page. */\n currentFavorite?: number | string;\n /** The favorite projects show under Projects. Uncontrolled when not set. */\n favoritesExpanded?: boolean;\n defaultFavoritesExpanded?: boolean;\n onFavoritesExpandedChange?: (expanded: boolean) => void;\n /** The shortcuts section. Not set, the menu has no shortcuts section. */\n shortcuts?: MainMenuShortcutData[];\n /** The shortcuts show under their heading. Uncontrolled when not set. */\n shortcutsExpanded?: boolean;\n defaultShortcutsExpanded?: boolean;\n onShortcutsExpandedChange?: (expanded: boolean) => void;\n /** The \"Add new\" row of the shortcuts. */\n onAddShortcut?: () => void;\n /** The groups of the Help & Support menu, with a separator between two groups. */\n helpEntries?: MainMenuHelpEntry[][];\n /** A count in a red badge on the Help & Support item. */\n helpBadge?: number;\n /** The Help & Support item looks current, for example on the New Features page. */\n helpCurrent?: boolean;\n /** Draws the Help & Support item as a promotion. */\n helpPromo?: MainMenuHelpPromo;\n /** The `id` of the Help & Support item, for example a target of a feature pointer. */\n helpId?: string;\n /** A part right above Help & Support, for example a development tool. */\n beforeHelp?: ReactNode;\n /** The `id` of the Show more block, for example a target of a feature pointer. */\n showMoreId?: string;\n /** Draws an editor of the app in place of the DS editor. `exit` leaves edit mode, and moves the focus back to the edit button when `returnFocus` is true. */\n renderEditor?: (exit: (returnFocus?: boolean) => void) => ReactNode;\n /** The editor shows in place of the items. Uncontrolled when not set. */\n editMode?: boolean;\n defaultEditMode?: boolean;\n onEditModeChange?: (editMode: boolean) => void;\n /** Save in the editor. The menu leaves edit mode. */\n onSaveEdit?: (result: MainMenuEditResult) => void;\n /** The link of the logo. */\n homeHref?: string;\n /** A click on any link of the menu, for example to route in the app. */\n onNavigate?: (event: MouseEvent<HTMLAnchorElement>) => void;\n /** A touch screen: the edit button always shows, as under `(hover: none)`. */\n touch?: boolean;\n labels?: Partial<IMainMenuLabels>;\n}\n"],"mappings":"AA+DA;;AAqCA,OAAO,MAAMA,wBAAyC,GAAG;EACvDC,aAAa,EAAE,gBAAgB;EAC/BC,QAAQ,EAAE,eAAe;EACzBC,WAAW,EAAE,cAAc;EAC3BC,QAAQ,EAAE,WAAW;EACrBC,UAAU,EAAE,aAAa;EACzBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,SAAS,EAAE,WAAW;EACtBC,MAAM,EAAE,SAAS;EACjBC,QAAQ,EAAE,WAAW;EACrBC,QAAQ,EAAE,WAAW;EACrBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,cAAc,EAAE,gBAAgB;EAChCC,OAAO,EAAE,SAAS;EAClBC,cAAc,EAAE,iBAAiB;EACjCC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE;AACT,CAAC;;AAED","ignoreList":[]}
|
|
@@ -33,6 +33,8 @@ export interface ScrollAreaProps {
|
|
|
33
33
|
onScroll?: (event: Event) => void;
|
|
34
34
|
/** Called with the scroll values on every scroll and on every change of size. */
|
|
35
35
|
onUpdate?: (values: ScrollAreaValues) => void;
|
|
36
|
+
/** "system" hides the scrollbars only where the system scrollbars hide too, as on a Mac with a trackpad. With a mouse they always show. */
|
|
37
|
+
autoHide?: "scroll" | "system";
|
|
36
38
|
}
|
|
37
39
|
/** Scrollbars that look the same in every browser: they show while the content scrolls, and grow under the pointer. Needs the overlayscrollbars CSS once in the app. */
|
|
38
40
|
export declare const ScrollArea: React.ForwardRefExoticComponent<ScrollAreaProps & React.RefAttributes<ScrollAreaHandle>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollArea.d.ts","sourceRoot":"","sources":["../../../../src/components/ScrollArea/ScrollArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,SAAS,EAKV,MAAM,OAAO,CAAC;AAOf,MAAM,WAAW,gBAAgB;IAC/B,mEAAmE;IACnE,GAAG,EAAE,MAA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AAQ,GAAG,QAAQ,CAAC;CAChC;AA2BD,wKAAwK;AACxK,eAAO,MAAM,UAAU,0FA+GtB,CAAC"}
|
|
@@ -40,7 +40,9 @@ export const ScrollArea = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
40
40
|
autoHeightMin = _ref2.autoHeightMin,
|
|
41
41
|
autoHeightMax = _ref2.autoHeightMax,
|
|
42
42
|
onScroll = _ref2.onScroll,
|
|
43
|
-
onUpdate = _ref2.onUpdate
|
|
43
|
+
onUpdate = _ref2.onUpdate,
|
|
44
|
+
_ref2$autoHide = _ref2.autoHide,
|
|
45
|
+
autoHide = _ref2$autoHide === void 0 ? "scroll" : _ref2$autoHide;
|
|
44
46
|
const hostRef = useRef(null);
|
|
45
47
|
const viewRef = useRef(null);
|
|
46
48
|
const handlersRef = useRef({
|
|
@@ -100,7 +102,7 @@ export const ScrollArea = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
100
102
|
}, {
|
|
101
103
|
scrollbars: {
|
|
102
104
|
theme: SCROLL_AREA_THEME,
|
|
103
|
-
autoHide: "scroll",
|
|
105
|
+
autoHide: autoHide === "system" && !OverlayScrollbars.env().scrollbarsOverlaid.x ? "never" : "scroll",
|
|
104
106
|
autoHideDelay: 800
|
|
105
107
|
}
|
|
106
108
|
}, {
|
|
@@ -112,7 +114,7 @@ export const ScrollArea = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
112
114
|
}
|
|
113
115
|
});
|
|
114
116
|
return () => instance.destroy();
|
|
115
|
-
}, []);
|
|
117
|
+
}, [autoHide]);
|
|
116
118
|
return /*#__PURE__*/React.createElement(StyledScrollArea, {
|
|
117
119
|
ref: hostRef,
|
|
118
120
|
className: classnames("c-scroll-area", className),
|