better-mui-menu 1.2.4 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,7 +6,11 @@
6
6
 
7
7
  ## Live demo
8
8
 
9
- Try it: [StackBlitz playground](https://stackblitz.com/edit/vitejs-vite-autejxh8?embed=1&file=src%2FMenuDemo.tsx&view=preview).
9
+ Try it:
10
+
11
+ [StackBlitz playground](https://stackblitz.com/edit/vitejs-vite-autejxh8?embed=1&file=src%2FMenuDemo.tsx&view=preview).
12
+
13
+ [![Edit better-mui-menu-demo](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/9j2z7n)
10
14
 
11
15
  ![Menu demo preview](./app/demo/assets/bmm-demo.gif)
12
16
 
package/dist/index.cjs CHANGED
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
 
30
20
  // src/index.ts
@@ -35,15 +25,11 @@ __export(index_exports, {
35
25
  module.exports = __toCommonJS(index_exports);
36
26
 
37
27
  // src/Menu/index.tsx
38
- var import_Menu = __toESM(require("@mui/material/Menu"), 1);
39
- var import_Divider2 = __toESM(require("@mui/material/Divider"), 1);
28
+ var import_material4 = require("@mui/material");
40
29
  var import_react3 = require("react");
41
30
 
42
31
  // src/Menu/NestedMenuItem.tsx
43
32
  var import_react2 = require("react");
44
- var import_Fade2 = __toESM(require("@mui/material/Fade"), 1);
45
- var import_MenuItem2 = __toESM(require("@mui/material/MenuItem"), 1);
46
- var import_Divider = __toESM(require("@mui/material/Divider"), 1);
47
33
 
48
34
  // ../../node_modules/@mui/icons-material/esm/utils/createSvgIcon.js
49
35
  var import_utils = require("@mui/material/utils");
@@ -59,15 +45,13 @@ var import_material3 = require("@mui/material");
59
45
 
60
46
  // src/Menu/MenuEntry.tsx
61
47
  var import_react = require("react");
62
- var import_MenuItem = __toESM(require("@mui/material/MenuItem"), 1);
63
48
  var import_material2 = require("@mui/material");
64
49
 
65
50
  // src/Menu/common.ts
66
51
  var import_material = require("@mui/material");
67
- var import_Fade = __toESM(require("@mui/material/Fade"), 1);
68
52
  var CLOSE_DELAY = 50;
69
53
  var transitionConfig = {
70
- type: import_Fade.default,
54
+ type: import_material.Fade,
71
55
  timeout: { enter: CLOSE_DELAY + 50, exit: CLOSE_DELAY + 50 }
72
56
  };
73
57
  var DEFAULT_ELEVATION = 1;
@@ -83,7 +67,7 @@ var MenuItemContent = (0, import_material.styled)(import_material.Stack)({
83
67
  // src/Menu/MenuEntry.tsx
84
68
  var import_jsx_runtime2 = require("react/jsx-runtime");
85
69
  var MenuEntry = (0, import_react.forwardRef)(function MenuEntry2({ label, startIcon: StartIcon, endIcon: EndIcon, onClick, ...muiMenuItemProps }, ref) {
86
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_MenuItem.default, { ref, ...muiMenuItemProps, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(MenuItemContent, { children: [
70
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.MenuItem, { ref, ...muiMenuItemProps, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(MenuItemContent, { children: [
87
71
  StartIcon ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(StartIcon, {}) : null,
88
72
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Typography, { sx: { flex: 1, fontFamily: "inherit" }, children: label }),
89
73
  EndIcon ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(EndIcon, {}) : null
@@ -148,7 +132,7 @@ var NestedMenuItem = (props) => {
148
132
  };
149
133
  const renderChildren = import_react2.Children.map(children, (child) => {
150
134
  if (!(0, import_react2.isValidElement)(child)) return child;
151
- if (child.type === import_MenuItem2.default) {
135
+ if (child.type === import_material3.MenuItem) {
152
136
  const childOnClick = child.props.onClick;
153
137
  const clonedOnClick = (event) => {
154
138
  childOnClick?.(event);
@@ -163,7 +147,7 @@ var NestedMenuItem = (props) => {
163
147
  if (!items || items.length === 0) return null;
164
148
  return items.map((item, index) => {
165
149
  if (item.type === "divider") {
166
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Divider.default, {}, `divider-${index}`);
150
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Divider, {}, `divider-${index}`);
167
151
  }
168
152
  const {
169
153
  type: __,
@@ -269,7 +253,7 @@ var NestedMenuItem = (props) => {
269
253
  if (isNodeInstance(e.relatedTarget) && menuItemRef.current?.contains(e.relatedTarget)) return;
270
254
  scheduleClose();
271
255
  },
272
- children: ({ TransitionProps }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Fade2.default, { ...TransitionProps, timeout: transitionConfig.timeout, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Paper, { elevation: menuProps.elevation, sx: { overflow: "auto" }, ...menuProps?.slotProps?.paper || {}, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
256
+ children: ({ TransitionProps }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Fade, { ...TransitionProps, timeout: transitionConfig.timeout, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Paper, { elevation: menuProps.elevation, sx: { overflow: "auto" }, ...menuProps?.slotProps?.paper || {}, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
273
257
  import_material3.MenuList,
274
258
  {
275
259
  id: subMenuId,
@@ -309,7 +293,7 @@ function Menu({ items, elevation = DEFAULT_ELEVATION, ...rest }) {
309
293
  const generatedMenuId = (0, import_react3.useId)();
310
294
  const renderedMenuEntries = items.map((item, index) => {
311
295
  if (item.type === "divider") {
312
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_Divider2.default, {}, `divider-${index}`);
296
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.Divider, {}, `divider-${index}`);
313
297
  }
314
298
  const {
315
299
  type: _,
@@ -357,7 +341,7 @@ function Menu({ items, elevation = DEFAULT_ELEVATION, ...rest }) {
357
341
  );
358
342
  });
359
343
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
360
- import_Menu.default,
344
+ import_material4.Menu,
361
345
  {
362
346
  "data-testid": "root-menu",
363
347
  ...menuProps,
@@ -371,4 +355,3 @@ function Menu({ items, elevation = DEFAULT_ELEVATION, ...rest }) {
371
355
  0 && (module.exports = {
372
356
  Menu
373
357
  });
374
- //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -1,7 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { MenuProps } from '@mui/material/Menu';
2
+ import { MenuItemProps, MenuProps } from '@mui/material';
3
3
  import React, { ReactNode } from 'react';
4
- import { MenuItemProps } from '@mui/material/MenuItem';
5
4
  import { SvgIconComponent } from '@mui/icons-material';
6
5
 
7
6
  type MenuItemBase = {
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { MenuProps } from '@mui/material/Menu';
2
+ import { MenuItemProps, MenuProps } from '@mui/material';
3
3
  import React, { ReactNode } from 'react';
4
- import { MenuItemProps } from '@mui/material/MenuItem';
5
4
  import { SvgIconComponent } from '@mui/icons-material';
6
5
 
7
6
  type MenuItemBase = {
package/dist/index.js CHANGED
@@ -1,13 +1,9 @@
1
1
  // src/Menu/index.tsx
2
- import MuiMenu from "@mui/material/Menu";
3
- import Divider2 from "@mui/material/Divider";
2
+ import { Divider as Divider2, Menu as MuiMenu } from "@mui/material";
4
3
  import { useId as useId2 } from "react";
5
4
 
6
5
  // src/Menu/NestedMenuItem.tsx
7
6
  import { Children, cloneElement, isValidElement, useCallback, useEffect, useId, useRef, useState } from "react";
8
- import Fade2 from "@mui/material/Fade";
9
- import MuiMenuItem2 from "@mui/material/MenuItem";
10
- import Divider from "@mui/material/Divider";
11
7
 
12
8
  // ../../node_modules/@mui/icons-material/esm/utils/createSvgIcon.js
13
9
  import { createSvgIcon } from "@mui/material/utils";
@@ -19,16 +15,14 @@ var ArrowRight_default = createSvgIcon(/* @__PURE__ */ _jsx("path", {
19
15
  }), "ArrowRight");
20
16
 
21
17
  // src/Menu/NestedMenuItem.tsx
22
- import { MenuList, Paper, Popper } from "@mui/material";
18
+ import { Divider, Fade as Fade2, MenuItem as MuiMenuItem2, MenuList, Paper, Popper } from "@mui/material";
23
19
 
24
20
  // src/Menu/MenuEntry.tsx
25
21
  import { forwardRef } from "react";
26
- import MuiMenuItem from "@mui/material/MenuItem";
27
- import { Typography } from "@mui/material";
22
+ import { MenuItem as MuiMenuItem, Typography } from "@mui/material";
28
23
 
29
24
  // src/Menu/common.ts
30
- import { Stack, styled } from "@mui/material";
31
- import Fade from "@mui/material/Fade";
25
+ import { Fade, Stack, styled } from "@mui/material";
32
26
  var CLOSE_DELAY = 50;
33
27
  var transitionConfig = {
34
28
  type: Fade,
@@ -334,4 +328,3 @@ function Menu({ items, elevation = DEFAULT_ELEVATION, ...rest }) {
334
328
  export {
335
329
  Menu
336
330
  };
337
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/eggei/better-mui-menu/issues"
11
11
  },
12
- "version": "1.2.4",
12
+ "version": "1.3.2",
13
13
  "type": "module",
14
14
  "sideEffects": false,
15
15
  "files": [
@@ -30,8 +30,8 @@
30
30
  "build": "tsup",
31
31
  "dev": "tsup --watch",
32
32
  "prepublishOnly": "npm --prefix ../.. run test && npm run build",
33
- "test": "jest",
34
- "test:coverage": "jest --coverage --coverageReporters=json-summary --coverageReporters=lcov --coverageReporters=text --coverageReporters=clover"
33
+ "test": "npm run build && jest",
34
+ "test:coverage": "npm run build && jest --coverage --coverageReporters=json-summary --coverageReporters=lcov --coverageReporters=text --coverageReporters=clover"
35
35
  },
36
36
  "keywords": [
37
37
  "mui",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts","../src/Menu/index.tsx","../src/Menu/NestedMenuItem.tsx","../../../node_modules/@mui/icons-material/esm/utils/createSvgIcon.js","../../../node_modules/@mui/icons-material/esm/ArrowRight.js","../src/Menu/MenuEntry.tsx","../src/Menu/common.ts"],"sourcesContent":["export { Menu } from './Menu'\nexport type { MenuItem } from './Menu/types'\n","import type { MenuProps } from '@mui/material/Menu';\nimport MuiMenu from '@mui/material/Menu';\nimport Divider from '@mui/material/Divider';\nimport React, { useId } from 'react';\nimport { NestedMenuItem } from './NestedMenuItem';\nimport { MenuEntry } from './MenuEntry';\nimport type { MenuItem } from './types';\nimport { DEFAULT_ELEVATION, transitionConfig } from './common';\n\nexport type Props = {\n items: MenuItem[];\n onClose?: (event: React.MouseEvent | React.KeyboardEvent, reason: 'itemClick' | 'escapeKeyDown' | 'backdropClick', menuItemId?: string\n ) => void;\n} & Omit<MenuProps, 'onClose'>;\n\nexport function Menu({ items, elevation = DEFAULT_ELEVATION, ...rest }: Props) {\n const menuProps: Omit<Props, 'items'> = { elevation, ...rest }; // setting the elevation for all nested menus here\n const generatedMenuId = useId();\n\n const renderedMenuEntries = items.map((item, index) => {\n if (item.type === 'divider') {\n return <Divider key={`divider-${index}`} />;\n }\n\n const {\n type: _,\n id,\n label,\n items: childItems,\n onClick: itemOnClick,\n startIcon: StartIcon,\n endIcon: EndIcon,\n ...muiMenuItemProps\n } = item;\n const entryId = id ?? `${generatedMenuId}-entry-${index}`;\n const itemKey = `menu-item-id:${entryId}`;\n const displayLabel = label ?? entryId;\n\n if (childItems && childItems.length > 0) {\n return (\n <NestedMenuItem\n key={itemKey}\n id={entryId}\n label={displayLabel}\n startIcon={StartIcon}\n endIcon={EndIcon}\n parentMenuClose={menuProps.onClose}\n menuProps={menuProps}\n items={childItems}\n {...muiMenuItemProps}\n />\n );\n }\n\n const handleItemClick = (event: React.MouseEvent<HTMLLIElement>) => {\n itemOnClick?.(event);\n menuProps.onClose?.(event, \"itemClick\", entryId);\n };\n\n return (\n <MenuEntry\n key={itemKey}\n label={displayLabel}\n startIcon={StartIcon}\n endIcon={EndIcon}\n {...muiMenuItemProps}\n onClick={handleItemClick}\n />\n );\n });\n\n return (\n <MuiMenu\n data-testid='root-menu'\n {...menuProps}\n transitionDuration={menuProps.transitionDuration || transitionConfig.timeout}\n slots={{ transition: transitionConfig.type, ...menuProps.slots }}\n >\n {renderedMenuEntries}\n </MuiMenu>\n );\n}\n","import type { FC, ReactNode, MouseEvent, KeyboardEvent } from 'react';\nimport { Children, cloneElement, isValidElement, useCallback, useEffect, useId, useRef, useState } from 'react';\nimport Fade from '@mui/material/Fade';\nimport type { MenuItemProps } from '@mui/material/MenuItem';\nimport MuiMenuItem from '@mui/material/MenuItem';\nimport Divider from '@mui/material/Divider';\nimport ArrowRightIcon from '@mui/icons-material/ArrowRight';\nimport type { SvgIconComponent } from '@mui/icons-material';\nimport type { MenuListProps, MenuProps, PaperProps } from '@mui/material';\nimport { MenuList, Paper, Popper } from '@mui/material';\nimport type { MenuItem } from './types';\nimport { MenuEntry } from './MenuEntry';\nimport { CLOSE_DELAY, transitionConfig } from './common';\nimport type { Props as BetterMenuProps } from '.';\n\ntype NestedMenuItemProps = MenuItemProps & {\n label: ReactNode;\n startIcon?: SvgIconComponent;\n endIcon?: SvgIconComponent;\n parentMenuClose: BetterMenuProps['onClose'];\n children?: ReactNode;\n items?: MenuItem[];\n menuProps: MenuProps;\n};\n\nconst isNodeInstance = (target: EventTarget | null): target is Node => target instanceof Node;\n\nexport const NestedMenuItem: FC<NestedMenuItemProps> = props => {\n const {\n id: providedId,\n label,\n startIcon: StartIconComponent,\n parentMenuClose,\n children,\n items,\n endIcon: EndIconComponent,\n menuProps,\n ...menuItemProps\n } = props;\n const [subMenuAnchorEl, setSubMenuAnchorEl] = useState<null | HTMLElement>(null);\n const open = Boolean(subMenuAnchorEl);\n const menuItemRef = useRef<HTMLLIElement>(null);\n const subMenuRef = useRef<HTMLDivElement>(null);\n const generatedId = useId();\n const menuItemId = providedId ?? `nested-menu-trigger-${generatedId}`;\n const subMenuId = `${menuItemId}-submenu`;\n\n const closeTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const clearCloseTimer = useCallback(() => {\n if (closeTimerRef.current) {\n clearTimeout(closeTimerRef.current);\n closeTimerRef.current = null;\n }\n }, []);\n\n const handleClose = useCallback(() => {\n clearCloseTimer();\n setSubMenuAnchorEl(null);\n }, [clearCloseTimer]);\n\n // CRITICAL FEATURE: This will ensure that all menus close simultaneously when an item is closed. Without this,\n // when an item is clicked in the third- or deeper level menu, menus will close at slightly different times, \n // creating a weird staggered closing effect.\n useEffect(closeSubMenuFasterThanItsParent, [menuProps.open, handleClose]);\n function closeSubMenuFasterThanItsParent() {\n if (!menuProps.open) {\n handleClose();\n }\n }\n\n\n useEffect(defensivelyCleanupTimersOnUnmount, [clearCloseTimer]);\n function defensivelyCleanupTimersOnUnmount() {\n return () => {\n clearCloseTimer();\n }\n };\n\n const scheduleClose = useCallback(() => {\n clearCloseTimer();\n closeTimerRef.current = setTimeout(() => {\n handleClose();\n }, CLOSE_DELAY);\n }, [clearCloseTimer, handleClose]);\n\n const handleOpen = (event: MouseEvent<HTMLLIElement> | KeyboardEvent<HTMLLIElement>) => {\n clearCloseTimer();\n setSubMenuAnchorEl(event.currentTarget);\n };\n\n\n // eslint-disable-next-line react-hooks/refs\n const renderChildren = Children.map(children, child => {\n if (!isValidElement(child)) return child;\n\n // Ensure we only process MUI MenuItem children\n if (child.type === MuiMenuItem) {\n const childOnClick = (child.props as MenuItemProps).onClick;\n // Merge any user-defined click logic with the submenu closing behavior.\n const clonedOnClick = (event: MouseEvent<HTMLLIElement>) => {\n childOnClick?.(event);\n handleClose(); // Close the submenu\n parentMenuClose?.(event, \"itemClick\", menuItemId);\n };\n return cloneElement(child, { onClick: clonedOnClick } as Partial<MenuItemProps>);\n }\n return child;\n });\n\n const renderItemsFromData = () => {\n if (!items || items.length === 0) return null;\n\n return items.map((item, index) => {\n if (item.type === 'divider') {\n\n return <Divider key={`divider-${index}`} />;\n }\n\n const {\n type: __,\n items: entryItems,\n startIcon: EntryStartIcon,\n endIcon: EntryEndIcon,\n label: entryLabel,\n onClick: entryOnClick,\n id,\n ...entryMenuItemProps\n } = item;\n const entryId = id ?? `${menuItemId}-entry-${index}`;\n const entryKey = `nested-entry-${entryId}`;\n const entryLabelValue = entryLabel ?? entryId;\n\n if (entryItems && entryItems.length > 0) {\n return (\n <NestedMenuItem\n key={entryKey}\n id={entryId}\n label={entryLabelValue}\n startIcon={EntryStartIcon}\n endIcon={EntryEndIcon}\n parentMenuClose={parentMenuClose}\n items={entryItems}\n menuProps={menuProps}\n {...entryMenuItemProps}\n />\n );\n }\n\n const handleItemClick = (event: MouseEvent<HTMLLIElement>) => {\n entryOnClick?.(event);\n handleClose();\n parentMenuClose?.(event, \"itemClick\", entryId);\n };\n\n return (\n <MenuEntry\n key={entryKey}\n label={entryLabelValue}\n startIcon={EntryStartIcon}\n endIcon={EntryEndIcon}\n {...entryMenuItemProps}\n onClick={handleItemClick}\n />\n );\n });\n };\n\n const renderedSubMenuItems = items && items.length > 0 ? renderItemsFromData() : renderChildren;\n\n return (\n <>\n <MenuEntry\n data-testid={`${menuItemId}-trigger`}\n id={menuItemId}\n ref={menuItemRef}\n onMouseEnter={handleOpen}\n onMouseLeave={e => {\n // CRITICAL FEATURE:\n // Checking whether cursor left the menu item onto the related menu. If so, do not close.\n if (isNodeInstance(e.relatedTarget) && subMenuRef.current?.contains(e.relatedTarget)) return;\n // If the cursor leaves to anywhere else, close the submenu.\n scheduleClose();\n }}\n onKeyDown={e => {\n e.preventDefault();\n if (e.key === 'ArrowLeft') {\n handleClose();\n }\n if (e.key === 'ArrowRight' || e.key === 'Enter' || e.key === ' ') {\n handleOpen(e);\n }\n }}\n aria-haspopup='menu'\n aria-controls={subMenuId}\n aria-expanded={open ? 'true' : undefined}\n label={label}\n startIcon={StartIconComponent}\n endIcon={EndIconComponent ?? ArrowRightIcon}\n {...menuItemProps}\n />\n\n {/**\n * CRITICAL FEATURE: Menu over Menu fails with focus management and keyboard navigations. \n * It is way more complex to make Menu to work compared to Popper. So, I made the decision to use Popper for submenus.\n * This way we can manage focus and keyboard navigation simpler, and we can also avoid some weird edge cases.\n * If you change this to regular Menu, you will realize that you need to add many custom JS logic to manage focus and keyboard navigation,\n * as well as to block Menu's internal logic.\n */}\n <Popper\n data-testid={`${menuItemId}-submenu`}\n open={open}\n ref={subMenuRef}\n anchorEl={subMenuAnchorEl}\n transition\n sx={{ zIndex: t => t.zIndex.modal + 1 }}\n placement='right-start'\n onKeyDown={e => {\n if (e.key === 'ArrowLeft') {\n e.preventDefault();\n handleClose();\n menuItemRef.current?.focus();\n }\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n e.stopPropagation();\n }\n }}\n onMouseEnter={clearCloseTimer}\n onMouseLeave={e => {\n // CRITICAL FEATURE:\n // Checking whether cursor left the submenu onto the related trigger item. If so, do not close.\n if (isNodeInstance(e.relatedTarget) && menuItemRef.current?.contains(e.relatedTarget)) return;\n // If the cursor leaves to anywhere else, close the submenu.\n scheduleClose();\n }}\n >\n {({ TransitionProps }) => (\n <Fade {...TransitionProps} timeout={transitionConfig.timeout}>\n <Paper elevation={menuProps.elevation} sx={{ overflow: 'auto' }} {...(menuProps?.slotProps?.paper as PaperProps) || {}}>\n <MenuList\n id={subMenuId}\n aria-labelledby={menuItemId}\n role='menu'\n {...(menuProps?.slotProps?.list as MenuListProps) || {}}\n // What's under is not allowed to be overridden for now\n autoFocusItem\n onKeyDown={e => {\n if (e.key === 'ArrowLeft') {\n const { nativeEvent } = e as KeyboardEvent<HTMLUListElement> & {\n nativeEvent: KeyboardEvent & {\n // our custom flag to avoid duplicate handling in nested menus\n __nestedMenuArrowLeftHandled?: boolean;\n };\n };\n if (nativeEvent.__nestedMenuArrowLeftHandled) {\n // return early if we have already handled this event in a nested menu\n // prevents duplicate logic when the browser bubbles the same keypress through multiple nodes\n return;\n }\n if (!subMenuRef.current?.contains(e.target as Node)) {\n // confirm the event’s target is still inside this submenu;\n // if the keypress originated elsewhere, we don’t continue so other menus can handle it\n return;\n }\n // Mark this event as handled to prevent parent menus from also processing it\n nativeEvent.__nestedMenuArrowLeftHandled = true;\n // preventDefault is needed so the browser doesn’t do its own “arrow left” behavior (like moving the text caret\n // or changing focus) while the menu is managing the navigation. Without this, the closed submenu or focused item\n // might jump unexpectedly even though the menu logic is running.\n e.preventDefault();\n // stopPropagation stops the event from bubbling up to parent DOM nodes that might also have onKeyDown, which could\n // otherwise fight the menu’s own logic or trigger duplicate navigation even though we guard with __nestedMenuArrowLeftHandled\n e.stopPropagation();\n // stopImmediatePropagation keeps any other keydown handlers registered on this same DOM node from running after ours.\n // This is preventing all submenus to close when pressing ArrowLeft in a, say, third level menu. With this, ArrowLeft will only\n // close the current submenu. The __nestedMenuArrowLeftHandled flag only guards against bubbling; this stopImmediatePropagation()\n // ensures no other handlers wired to the same node interfere once we decide to close and focus.\n nativeEvent.stopImmediatePropagation();\n // close the sub menu\n handleClose();\n // move focus back to the parent MenuItem, letting the user continue navigation up the menu hierarchy\n menuItemRef.current?.focus();\n }\n }}\n >\n {renderedSubMenuItems}\n </MenuList>\n </Paper>\n </Fade>\n )}\n </Popper>\n </>\n );\n};\n","'use client';\n\nexport { createSvgIcon as default } from '@mui/material/utils';","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"m10 17 5-5-5-5z\"\n}), 'ArrowRight');","import type { ReactNode } from 'react';\nimport { forwardRef } from 'react';\nimport type { MenuItemProps } from '@mui/material/MenuItem';\nimport MuiMenuItem from '@mui/material/MenuItem';\nimport { Typography } from '@mui/material';\nimport type { SvgIconComponent } from '@mui/icons-material';\nimport { MenuItemContent } from './common';\n\ntype MenuEntryProps = Omit<MenuItemProps, 'children'> & {\n label: ReactNode;\n startIcon?: SvgIconComponent;\n endIcon?: SvgIconComponent;\n};\n\nexport const MenuEntry = forwardRef<HTMLLIElement, MenuEntryProps>(function MenuEntry(\n { label, startIcon: StartIcon, endIcon: EndIcon, onClick, ...muiMenuItemProps },\n ref\n) {\n return (\n <MuiMenuItem ref={ref} {...muiMenuItemProps} onClick={onClick}>\n <MenuItemContent>\n {StartIcon ? <StartIcon /> : null}\n <Typography sx={{ flex: 1, fontFamily: 'inherit' }}>{label}</Typography>\n {EndIcon ? <EndIcon /> : null}\n </MenuItemContent>\n </MuiMenuItem>\n );\n});\n","import { Stack, styled } from '@mui/material';\nimport Fade from '@mui/material/Fade';\n\nexport const CLOSE_DELAY = 50;\nexport const transitionConfig = {\n type: Fade,\n timeout: { enter: CLOSE_DELAY + 50, exit: CLOSE_DELAY + 50 },\n};\nexport const DEFAULT_ELEVATION = 1;\n\nexport const MenuItemContent = styled(Stack)({\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n width: '100%',\n gap: '8px',\n padding: 0,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;AAEA,UAAM;AAAA,MACJ,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,SAAS;AAAA,MACT,WAAW;AAAA,MACX,SAAS;AAAA,MACT,GAAG;AAAA,IACL,IAAI;AACJ,UAAM,UAAU,MAAM,GAAG,eAAe,UAAU,KAAK;AACvD,UAAM,UAAU,gBAAgB,OAAO;AACvC,UAAM,eAAe,SAAS;AAE9B,QAAI,cAAc,WAAW,SAAS,GAAG;AACvC,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,IAAI;AAAA,UACJ,OAAO;AAAA,UACP,WAAW;AAAA,UACX,SAAS;AAAA,UACT,iBAAiB,UAAU;AAAA,UAC3B;AAAA,UACA,OAAO;AAAA,UACN,GAAG;AAAA;AAAA,QARC;AAAA,MASP;AAAA,IAEJ;AAEA,UAAM,kBAAkB,CAAC,UAA2C;AAClE,oBAAc,KAAK;AACnB,gBAAU,UAAU,OAAO,aAAa,OAAO;AAAA,IACjD;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QAEC,OAAO;AAAA,QACP,WAAW;AAAA,QACX,SAAS;AAAA,QACR,GAAG;AAAA,QACJ,SAAS;AAAA;AAAA,MALJ;AAAA,IAMP;AAAA,EAEJ,CAAC;AAED,SACE;AAAA,IAAC,YAAAC;AAAA,IAAA;AAAA,MACC,eAAY;AAAA,MACX,GAAG;AAAA,MACJ,oBAAoB,UAAU,sBAAsB,iBAAiB;AAAA,MACrE,OAAO,EAAE,YAAY,iBAAiB,MAAM,GAAG,UAAU,MAAM;AAAA,MAE9D;AAAA;AAAA,EACH;AAEJ;","names":["import_Divider","import_react","import_react","import_Fade","import_MenuItem","_jsx","import_material","import_material","Fade","import_jsx_runtime","MenuEntry","MuiMenuItem","import_jsx_runtime","MuiMenuItem","Divider","Fade","import_jsx_runtime","Divider","MuiMenu"]}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/Menu/index.tsx","../src/Menu/NestedMenuItem.tsx","../../../node_modules/@mui/icons-material/esm/utils/createSvgIcon.js","../../../node_modules/@mui/icons-material/esm/ArrowRight.js","../src/Menu/MenuEntry.tsx","../src/Menu/common.ts"],"sourcesContent":["import type { MenuProps } from '@mui/material/Menu';\nimport MuiMenu from '@mui/material/Menu';\nimport Divider from '@mui/material/Divider';\nimport React, { useId } from 'react';\nimport { NestedMenuItem } from './NestedMenuItem';\nimport { MenuEntry } from './MenuEntry';\nimport type { MenuItem } from './types';\nimport { DEFAULT_ELEVATION, transitionConfig } from './common';\n\nexport type Props = {\n items: MenuItem[];\n onClose?: (event: React.MouseEvent | React.KeyboardEvent, reason: 'itemClick' | 'escapeKeyDown' | 'backdropClick', menuItemId?: string\n ) => void;\n} & Omit<MenuProps, 'onClose'>;\n\nexport function Menu({ items, elevation = DEFAULT_ELEVATION, ...rest }: Props) {\n const menuProps: Omit<Props, 'items'> = { elevation, ...rest }; // setting the elevation for all nested menus here\n const generatedMenuId = useId();\n\n const renderedMenuEntries = items.map((item, index) => {\n if (item.type === 'divider') {\n return <Divider key={`divider-${index}`} />;\n }\n\n const {\n type: _,\n id,\n label,\n items: childItems,\n onClick: itemOnClick,\n startIcon: StartIcon,\n endIcon: EndIcon,\n ...muiMenuItemProps\n } = item;\n const entryId = id ?? `${generatedMenuId}-entry-${index}`;\n const itemKey = `menu-item-id:${entryId}`;\n const displayLabel = label ?? entryId;\n\n if (childItems && childItems.length > 0) {\n return (\n <NestedMenuItem\n key={itemKey}\n id={entryId}\n label={displayLabel}\n startIcon={StartIcon}\n endIcon={EndIcon}\n parentMenuClose={menuProps.onClose}\n menuProps={menuProps}\n items={childItems}\n {...muiMenuItemProps}\n />\n );\n }\n\n const handleItemClick = (event: React.MouseEvent<HTMLLIElement>) => {\n itemOnClick?.(event);\n menuProps.onClose?.(event, \"itemClick\", entryId);\n };\n\n return (\n <MenuEntry\n key={itemKey}\n label={displayLabel}\n startIcon={StartIcon}\n endIcon={EndIcon}\n {...muiMenuItemProps}\n onClick={handleItemClick}\n />\n );\n });\n\n return (\n <MuiMenu\n data-testid='root-menu'\n {...menuProps}\n transitionDuration={menuProps.transitionDuration || transitionConfig.timeout}\n slots={{ transition: transitionConfig.type, ...menuProps.slots }}\n >\n {renderedMenuEntries}\n </MuiMenu>\n );\n}\n","import type { FC, ReactNode, MouseEvent, KeyboardEvent } from 'react';\nimport { Children, cloneElement, isValidElement, useCallback, useEffect, useId, useRef, useState } from 'react';\nimport Fade from '@mui/material/Fade';\nimport type { MenuItemProps } from '@mui/material/MenuItem';\nimport MuiMenuItem from '@mui/material/MenuItem';\nimport Divider from '@mui/material/Divider';\nimport ArrowRightIcon from '@mui/icons-material/ArrowRight';\nimport type { SvgIconComponent } from '@mui/icons-material';\nimport type { MenuListProps, MenuProps, PaperProps } from '@mui/material';\nimport { MenuList, Paper, Popper } from '@mui/material';\nimport type { MenuItem } from './types';\nimport { MenuEntry } from './MenuEntry';\nimport { CLOSE_DELAY, transitionConfig } from './common';\nimport type { Props as BetterMenuProps } from '.';\n\ntype NestedMenuItemProps = MenuItemProps & {\n label: ReactNode;\n startIcon?: SvgIconComponent;\n endIcon?: SvgIconComponent;\n parentMenuClose: BetterMenuProps['onClose'];\n children?: ReactNode;\n items?: MenuItem[];\n menuProps: MenuProps;\n};\n\nconst isNodeInstance = (target: EventTarget | null): target is Node => target instanceof Node;\n\nexport const NestedMenuItem: FC<NestedMenuItemProps> = props => {\n const {\n id: providedId,\n label,\n startIcon: StartIconComponent,\n parentMenuClose,\n children,\n items,\n endIcon: EndIconComponent,\n menuProps,\n ...menuItemProps\n } = props;\n const [subMenuAnchorEl, setSubMenuAnchorEl] = useState<null | HTMLElement>(null);\n const open = Boolean(subMenuAnchorEl);\n const menuItemRef = useRef<HTMLLIElement>(null);\n const subMenuRef = useRef<HTMLDivElement>(null);\n const generatedId = useId();\n const menuItemId = providedId ?? `nested-menu-trigger-${generatedId}`;\n const subMenuId = `${menuItemId}-submenu`;\n\n const closeTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const clearCloseTimer = useCallback(() => {\n if (closeTimerRef.current) {\n clearTimeout(closeTimerRef.current);\n closeTimerRef.current = null;\n }\n }, []);\n\n const handleClose = useCallback(() => {\n clearCloseTimer();\n setSubMenuAnchorEl(null);\n }, [clearCloseTimer]);\n\n // CRITICAL FEATURE: This will ensure that all menus close simultaneously when an item is closed. Without this,\n // when an item is clicked in the third- or deeper level menu, menus will close at slightly different times, \n // creating a weird staggered closing effect.\n useEffect(closeSubMenuFasterThanItsParent, [menuProps.open, handleClose]);\n function closeSubMenuFasterThanItsParent() {\n if (!menuProps.open) {\n handleClose();\n }\n }\n\n\n useEffect(defensivelyCleanupTimersOnUnmount, [clearCloseTimer]);\n function defensivelyCleanupTimersOnUnmount() {\n return () => {\n clearCloseTimer();\n }\n };\n\n const scheduleClose = useCallback(() => {\n clearCloseTimer();\n closeTimerRef.current = setTimeout(() => {\n handleClose();\n }, CLOSE_DELAY);\n }, [clearCloseTimer, handleClose]);\n\n const handleOpen = (event: MouseEvent<HTMLLIElement> | KeyboardEvent<HTMLLIElement>) => {\n clearCloseTimer();\n setSubMenuAnchorEl(event.currentTarget);\n };\n\n\n // eslint-disable-next-line react-hooks/refs\n const renderChildren = Children.map(children, child => {\n if (!isValidElement(child)) return child;\n\n // Ensure we only process MUI MenuItem children\n if (child.type === MuiMenuItem) {\n const childOnClick = (child.props as MenuItemProps).onClick;\n // Merge any user-defined click logic with the submenu closing behavior.\n const clonedOnClick = (event: MouseEvent<HTMLLIElement>) => {\n childOnClick?.(event);\n handleClose(); // Close the submenu\n parentMenuClose?.(event, \"itemClick\", menuItemId);\n };\n return cloneElement(child, { onClick: clonedOnClick } as Partial<MenuItemProps>);\n }\n return child;\n });\n\n const renderItemsFromData = () => {\n if (!items || items.length === 0) return null;\n\n return items.map((item, index) => {\n if (item.type === 'divider') {\n\n return <Divider key={`divider-${index}`} />;\n }\n\n const {\n type: __,\n items: entryItems,\n startIcon: EntryStartIcon,\n endIcon: EntryEndIcon,\n label: entryLabel,\n onClick: entryOnClick,\n id,\n ...entryMenuItemProps\n } = item;\n const entryId = id ?? `${menuItemId}-entry-${index}`;\n const entryKey = `nested-entry-${entryId}`;\n const entryLabelValue = entryLabel ?? entryId;\n\n if (entryItems && entryItems.length > 0) {\n return (\n <NestedMenuItem\n key={entryKey}\n id={entryId}\n label={entryLabelValue}\n startIcon={EntryStartIcon}\n endIcon={EntryEndIcon}\n parentMenuClose={parentMenuClose}\n items={entryItems}\n menuProps={menuProps}\n {...entryMenuItemProps}\n />\n );\n }\n\n const handleItemClick = (event: MouseEvent<HTMLLIElement>) => {\n entryOnClick?.(event);\n handleClose();\n parentMenuClose?.(event, \"itemClick\", entryId);\n };\n\n return (\n <MenuEntry\n key={entryKey}\n label={entryLabelValue}\n startIcon={EntryStartIcon}\n endIcon={EntryEndIcon}\n {...entryMenuItemProps}\n onClick={handleItemClick}\n />\n );\n });\n };\n\n const renderedSubMenuItems = items && items.length > 0 ? renderItemsFromData() : renderChildren;\n\n return (\n <>\n <MenuEntry\n data-testid={`${menuItemId}-trigger`}\n id={menuItemId}\n ref={menuItemRef}\n onMouseEnter={handleOpen}\n onMouseLeave={e => {\n // CRITICAL FEATURE:\n // Checking whether cursor left the menu item onto the related menu. If so, do not close.\n if (isNodeInstance(e.relatedTarget) && subMenuRef.current?.contains(e.relatedTarget)) return;\n // If the cursor leaves to anywhere else, close the submenu.\n scheduleClose();\n }}\n onKeyDown={e => {\n e.preventDefault();\n if (e.key === 'ArrowLeft') {\n handleClose();\n }\n if (e.key === 'ArrowRight' || e.key === 'Enter' || e.key === ' ') {\n handleOpen(e);\n }\n }}\n aria-haspopup='menu'\n aria-controls={subMenuId}\n aria-expanded={open ? 'true' : undefined}\n label={label}\n startIcon={StartIconComponent}\n endIcon={EndIconComponent ?? ArrowRightIcon}\n {...menuItemProps}\n />\n\n {/**\n * CRITICAL FEATURE: Menu over Menu fails with focus management and keyboard navigations. \n * It is way more complex to make Menu to work compared to Popper. So, I made the decision to use Popper for submenus.\n * This way we can manage focus and keyboard navigation simpler, and we can also avoid some weird edge cases.\n * If you change this to regular Menu, you will realize that you need to add many custom JS logic to manage focus and keyboard navigation,\n * as well as to block Menu's internal logic.\n */}\n <Popper\n data-testid={`${menuItemId}-submenu`}\n open={open}\n ref={subMenuRef}\n anchorEl={subMenuAnchorEl}\n transition\n sx={{ zIndex: t => t.zIndex.modal + 1 }}\n placement='right-start'\n onKeyDown={e => {\n if (e.key === 'ArrowLeft') {\n e.preventDefault();\n handleClose();\n menuItemRef.current?.focus();\n }\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n e.stopPropagation();\n }\n }}\n onMouseEnter={clearCloseTimer}\n onMouseLeave={e => {\n // CRITICAL FEATURE:\n // Checking whether cursor left the submenu onto the related trigger item. If so, do not close.\n if (isNodeInstance(e.relatedTarget) && menuItemRef.current?.contains(e.relatedTarget)) return;\n // If the cursor leaves to anywhere else, close the submenu.\n scheduleClose();\n }}\n >\n {({ TransitionProps }) => (\n <Fade {...TransitionProps} timeout={transitionConfig.timeout}>\n <Paper elevation={menuProps.elevation} sx={{ overflow: 'auto' }} {...(menuProps?.slotProps?.paper as PaperProps) || {}}>\n <MenuList\n id={subMenuId}\n aria-labelledby={menuItemId}\n role='menu'\n {...(menuProps?.slotProps?.list as MenuListProps) || {}}\n // What's under is not allowed to be overridden for now\n autoFocusItem\n onKeyDown={e => {\n if (e.key === 'ArrowLeft') {\n const { nativeEvent } = e as KeyboardEvent<HTMLUListElement> & {\n nativeEvent: KeyboardEvent & {\n // our custom flag to avoid duplicate handling in nested menus\n __nestedMenuArrowLeftHandled?: boolean;\n };\n };\n if (nativeEvent.__nestedMenuArrowLeftHandled) {\n // return early if we have already handled this event in a nested menu\n // prevents duplicate logic when the browser bubbles the same keypress through multiple nodes\n return;\n }\n if (!subMenuRef.current?.contains(e.target as Node)) {\n // confirm the event’s target is still inside this submenu;\n // if the keypress originated elsewhere, we don’t continue so other menus can handle it\n return;\n }\n // Mark this event as handled to prevent parent menus from also processing it\n nativeEvent.__nestedMenuArrowLeftHandled = true;\n // preventDefault is needed so the browser doesn’t do its own “arrow left” behavior (like moving the text caret\n // or changing focus) while the menu is managing the navigation. Without this, the closed submenu or focused item\n // might jump unexpectedly even though the menu logic is running.\n e.preventDefault();\n // stopPropagation stops the event from bubbling up to parent DOM nodes that might also have onKeyDown, which could\n // otherwise fight the menu’s own logic or trigger duplicate navigation even though we guard with __nestedMenuArrowLeftHandled\n e.stopPropagation();\n // stopImmediatePropagation keeps any other keydown handlers registered on this same DOM node from running after ours.\n // This is preventing all submenus to close when pressing ArrowLeft in a, say, third level menu. With this, ArrowLeft will only\n // close the current submenu. The __nestedMenuArrowLeftHandled flag only guards against bubbling; this stopImmediatePropagation()\n // ensures no other handlers wired to the same node interfere once we decide to close and focus.\n nativeEvent.stopImmediatePropagation();\n // close the sub menu\n handleClose();\n // move focus back to the parent MenuItem, letting the user continue navigation up the menu hierarchy\n menuItemRef.current?.focus();\n }\n }}\n >\n {renderedSubMenuItems}\n </MenuList>\n </Paper>\n </Fade>\n )}\n </Popper>\n </>\n );\n};\n","'use client';\n\nexport { createSvgIcon as default } from '@mui/material/utils';","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"m10 17 5-5-5-5z\"\n}), 'ArrowRight');","import type { ReactNode } from 'react';\nimport { forwardRef } from 'react';\nimport type { MenuItemProps } from '@mui/material/MenuItem';\nimport MuiMenuItem from '@mui/material/MenuItem';\nimport { Typography } from '@mui/material';\nimport type { SvgIconComponent } from '@mui/icons-material';\nimport { MenuItemContent } from './common';\n\ntype MenuEntryProps = Omit<MenuItemProps, 'children'> & {\n label: ReactNode;\n startIcon?: SvgIconComponent;\n endIcon?: SvgIconComponent;\n};\n\nexport const MenuEntry = forwardRef<HTMLLIElement, MenuEntryProps>(function MenuEntry(\n { label, startIcon: StartIcon, endIcon: EndIcon, onClick, ...muiMenuItemProps },\n ref\n) {\n return (\n <MuiMenuItem ref={ref} {...muiMenuItemProps} onClick={onClick}>\n <MenuItemContent>\n {StartIcon ? <StartIcon /> : null}\n <Typography sx={{ flex: 1, fontFamily: 'inherit' }}>{label}</Typography>\n {EndIcon ? <EndIcon /> : null}\n </MenuItemContent>\n </MuiMenuItem>\n );\n});\n","import { Stack, styled } from '@mui/material';\nimport Fade from '@mui/material/Fade';\n\nexport const CLOSE_DELAY = 50;\nexport const transitionConfig = {\n type: Fade,\n timeout: { enter: CLOSE_DELAY + 50, exit: CLOSE_DELAY + 50 },\n};\nexport const DEFAULT_ELEVATION = 1;\n\nexport const MenuItemContent = styled(Stack)({\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n width: '100%',\n gap: '8px',\n padding: 0,\n});\n"],"mappings":";AACA,OAAO,aAAa;AACpB,OAAOA,cAAa;AACpB,SAAgB,SAAAC,cAAa;;;ACF7B,SAAS,UAAU,cAAc,gBAAgB,aAAa,WAAW,OAAO,QAAQ,gBAAgB;AACxG,OAAOC,WAAU;AAEjB,OAAOC,kBAAiB;AACxB,OAAO,aAAa;;;ACHpB,SAA0B,qBAAe;;;ACCzC,SAAS,OAAO,YAAY;AAC5B,IAAO,qBAAQ,cAA2B,qBAAK,QAAQ;AAAA,EACrD,GAAG;AACL,CAAC,GAAG,YAAY;;;AFGhB,SAAS,UAAU,OAAO,cAAc;;;AGRxC,SAAS,kBAAkB;AAE3B,OAAO,iBAAiB;AACxB,SAAS,kBAAkB;;;ACJ3B,SAAS,OAAO,cAAc;AAC9B,OAAO,UAAU;AAEV,IAAM,cAAc;AACpB,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS,EAAE,OAAO,cAAc,IAAI,MAAM,cAAc,GAAG;AAC7D;AACO,IAAM,oBAAoB;AAE1B,IAAM,kBAAkB,OAAO,KAAK,EAAE;AAAA,EAC3C,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