@openfin/ui-library 0.31.3-alpha.1759174206 → 0.31.3-alpha.1759501280
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/components/controls/Menus/CustomContextMenu/CustomContextMenuItems/CustomContextMenuItem.d.ts +2 -1
- package/dist/components/controls/Menus/CustomContextMenu/CustomContextMenuItems/NormalCustomContextMenuItem.d.ts +2 -1
- package/dist/components/controls/Menus/CustomContextMenu/CustomContextMenuItems/SubmenuHeaderCustomContextMenuItem.d.ts +1 -0
- package/dist/components/controls/Menus/CustomContextMenu/CustomContextMenuItems/WidgetCustomContextMenuItem.d.ts +1 -0
- package/dist/index.js +3 -3
- package/package.json +1 -1
|
@@ -7,5 +7,6 @@ export type CustomContextMenuItemData = Omit<SubmenulessMenuItemTemplate, 'type'
|
|
|
7
7
|
onClose?: () => void;
|
|
8
8
|
onBack?: () => void;
|
|
9
9
|
selected?: boolean;
|
|
10
|
+
index?: number;
|
|
10
11
|
};
|
|
11
|
-
export declare const CustomContextMenuItem: ({ type, icon, label, enabled, checked, hasSubMenu, showShouldHomeButton, onClick, onClose, onBack, selected, ...rest }: CustomContextMenuItemData) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const CustomContextMenuItem: ({ type, icon, label, enabled, checked, hasSubMenu, showShouldHomeButton, onClick, onClose, onBack, selected, index, ...rest }: CustomContextMenuItemData) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,5 +2,6 @@ import { ContextMenuTemplate, CustomContextMenuData } from '../CustomContextMenu
|
|
|
2
2
|
export type NormalCustomContextMenuItemProps = ContextMenuTemplate & {
|
|
3
3
|
onClick?: (data?: CustomContextMenuData) => void;
|
|
4
4
|
selected?: boolean;
|
|
5
|
+
index?: number;
|
|
5
6
|
};
|
|
6
|
-
export declare const NormalCustomContextMenuItem: ({ type, label, enabled, checked, submenu, onClick, selected, data, }: NormalCustomContextMenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const NormalCustomContextMenuItem: ({ type, label, enabled, checked, submenu, onClick, selected, data, index, }: NormalCustomContextMenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,5 +4,6 @@ export type SubmenuHeaderCustomContextMenuItemProps = {
|
|
|
4
4
|
onClose?: () => void;
|
|
5
5
|
onBack?: () => void;
|
|
6
6
|
selected?: boolean;
|
|
7
|
+
index?: number;
|
|
7
8
|
};
|
|
8
9
|
export declare const SubmenuHeaderCustomContextMenuItem: ({ label, showShouldHomeButton, onClose, onBack, selected, }: SubmenuHeaderCustomContextMenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CustomContextMenuData, WidgetContextMenuTemplate } from '../CustomContextMenu';
|
|
2
2
|
export type WidgetCustomContextMenuItemProps = WidgetContextMenuTemplate & {
|
|
3
3
|
onClick?: (data?: CustomContextMenuData) => void;
|
|
4
|
+
index?: number;
|
|
4
5
|
};
|
|
5
6
|
export declare const WidgetCustomContextMenuItem: ({ label, enabled, onClick, config, }: WidgetCustomContextMenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -398,7 +398,7 @@ var e={1193:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(1601),o=n.n(r),a=n(6
|
|
|
398
398
|
border-top-color: ${({theme:e})=>e.palette.background1};
|
|
399
399
|
`}
|
|
400
400
|
}
|
|
401
|
-
`},4810:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(6368),t)},244:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CustomContextMenu=t.CONTEXT_MENU_ANIMATION_DURATION=t.PRIOR_CONTEXT_MENU_CLASS=t.BASE_CONTEXT_MENU=t.ACTIVE_CONTEXT_MENU_CLASS=t.CONTEXT_MENU_FRAME_ID=void 0;const o=n(4848),a=n(2015),i=r(n(2770)),l=n(9005),s=n(68),c=n(6972),u=n(8666),d=n(3247),p=n(8429),f=n(6418);t.CONTEXT_MENU_FRAME_ID="context_menu_frame",t.ACTIVE_CONTEXT_MENU_CLASS="active_context_menu",t.BASE_CONTEXT_MENU="base_context_menu",t.PRIOR_CONTEXT_MENU_CLASS="previous_context_menu",t.CONTEXT_MENU_ANIMATION_DURATION=200,t.CustomContextMenu=({menuTemplate:e,onClick:n,icon:r,onMenuResize:i,onContextMenuReady:f,isWindows:g=!0})=>{var m;const v=(0,a.useRef)(null),[x,y]=(0,a.useState)(!1),[C,_]=(0,a.useState)({width:160,height:160}),[O,w]=(0,a.useState)(0),[j,k]=(0,a.useState)([]),[P,S]=(0,a.useState)(),[M,$]=(0,a.useState)([]),[I,D]=(0,a.useState)(e.map((e=>e.label||""))),[B,E]=(0,a.useState)(-1);(0,a.useEffect)((()=>{D(e.map((e=>e.label||""))),E(I.findIndex((e=>e===P)))}),[e]);const{width:T,height:F}=(0,s.useResizeContextMenu)(P),{handleNavigateToSubmenu:L,handleNavigateBackToParent:H,handleNavigateToBase:z}=(0,u.useContextMenuNavigation)(O,w,M,$,P,S,_,E,j,i);return(0,a.useEffect)((()=>{k((0,c.getMenuNavigationOrder)(e)),S(t.BASE_CONTEXT_MENU),$([]),_({width:T,height:F})}),[e]),(0,d.useContextMenuKeyboardNavigation)(null===(m=j.find((e=>e.parentLabel===P)))||void 0===m?void 0:m.menuTemplate,M,P,B,E,n,L,H,z),(0,a.useEffect)((()=>{v.current&&(x||(f&&f(),y(!0)))}),[v.current]),(0,o.jsx)(h,{id:t.CONTEXT_MENU_FRAME_ID,transitionSpeed:O,isWindows:g,children:j.map((({parentLabel:e,menuTemplate:a})=>(0,o.jsx)("div",{ref:e===P?v:void 0,children:(0,o.jsxs)(b,{className:(0,c.getClassName)(e,P,M),activeMenuWidth:C.width,transitionSpeed:O,id:e,children:[e!==t.BASE_CONTEXT_MENU?(0,o.jsx)(l.CustomContextMenuItem,{type:"submenuHeader",label:e,onBack:()=>H(e,"click"),onClose:z,showShouldHomeButton:M.slice(2).includes(e)||M.length>=2&&P===e,selected:-1===B},`${e}-submenu-header`):r&&(0,o.jsx)(p.RootMenuHeader,{icon:r}),a.map(((t,r)=>(0,o.jsx)(l.CustomContextMenuItem,Object.assign({onClick:e=>{t.hasSubMenu?L(t.label||""):n(e),E(-2)}},t,{selected:B===r}),`${e}-${t.label}-${r}`)))]})},e)))})};const h=i.default.div`
|
|
401
|
+
`},4810:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(6368),t)},244:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CustomContextMenu=t.CONTEXT_MENU_ANIMATION_DURATION=t.PRIOR_CONTEXT_MENU_CLASS=t.BASE_CONTEXT_MENU=t.ACTIVE_CONTEXT_MENU_CLASS=t.CONTEXT_MENU_FRAME_ID=void 0;const o=n(4848),a=n(2015),i=r(n(2770)),l=n(9005),s=n(68),c=n(6972),u=n(8666),d=n(3247),p=n(8429),f=n(6418);t.CONTEXT_MENU_FRAME_ID="context_menu_frame",t.ACTIVE_CONTEXT_MENU_CLASS="active_context_menu",t.BASE_CONTEXT_MENU="base_context_menu",t.PRIOR_CONTEXT_MENU_CLASS="previous_context_menu",t.CONTEXT_MENU_ANIMATION_DURATION=200,t.CustomContextMenu=({menuTemplate:e,onClick:n,icon:r,onMenuResize:i,onContextMenuReady:f,isWindows:g=!0})=>{var m;const v=(0,a.useRef)(null),[x,y]=(0,a.useState)(!1),[C,_]=(0,a.useState)({width:160,height:160}),[O,w]=(0,a.useState)(0),[j,k]=(0,a.useState)([]),[P,S]=(0,a.useState)(),[M,$]=(0,a.useState)([]),[I,D]=(0,a.useState)(e.map((e=>e.label||""))),[B,E]=(0,a.useState)(-1);(0,a.useEffect)((()=>{D(e.map((e=>e.label||""))),E(I.findIndex((e=>e===P)))}),[e]);const{width:T,height:F}=(0,s.useResizeContextMenu)(P),{handleNavigateToSubmenu:L,handleNavigateBackToParent:H,handleNavigateToBase:z}=(0,u.useContextMenuNavigation)(O,w,M,$,P,S,_,E,j,i);return(0,a.useEffect)((()=>{k((0,c.getMenuNavigationOrder)(e)),S(t.BASE_CONTEXT_MENU),$([]),_({width:T,height:F})}),[e]),(0,d.useContextMenuKeyboardNavigation)(null===(m=j.find((e=>e.parentLabel===P)))||void 0===m?void 0:m.menuTemplate,M,P,B,E,n,L,H,z),(0,a.useEffect)((()=>{v.current&&(x||(f&&f(),y(!0)))}),[v.current]),(0,o.jsx)(h,{id:t.CONTEXT_MENU_FRAME_ID,transitionSpeed:O,isWindows:g,children:j.map((({parentLabel:e,menuTemplate:a})=>(0,o.jsx)("div",{ref:e===P?v:void 0,children:(0,o.jsxs)(b,{className:(0,c.getClassName)(e,P,M),activeMenuWidth:C.width,transitionSpeed:O,id:e,children:[e!==t.BASE_CONTEXT_MENU?(0,o.jsx)(l.CustomContextMenuItem,{type:"submenuHeader",label:e,onBack:()=>H(e,"click"),onClose:z,showShouldHomeButton:M.slice(2).includes(e)||M.length>=2&&P===e,selected:-1===B},`${e}-submenu-header`):r&&(0,o.jsx)(p.RootMenuHeader,{icon:r}),a.map(((t,r)=>(0,o.jsx)(l.CustomContextMenuItem,Object.assign({onClick:e=>{t.hasSubMenu?L(t.label||""):n(e),E(-2)}},t,{selected:B===r,index:r}),`${e}-${t.label}-${r}`)))]})},e)))})};const h=i.default.div`
|
|
402
402
|
position: relative;
|
|
403
403
|
min-width: fit-content;
|
|
404
404
|
min-height: fit-content;
|
|
@@ -446,7 +446,7 @@ var e={1193:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(1601),o=n.n(r),a=n(6
|
|
|
446
446
|
);
|
|
447
447
|
flex-wrap: wrap;
|
|
448
448
|
padding: ${({theme:e})=>e.px.small} ${({theme:e})=>e.px.small};
|
|
449
|
-
`},9005:function(e,t,n){var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.CustomContextMenuItem=void 0;const o=n(4848),a=n(2015),i=n(6554),l=n(2294),s=n(3741),c=n(4953),u={normal:l.NormalCustomContextMenuItem,checkbox:l.NormalCustomContextMenuItem,submenu:l.NormalCustomContextMenuItem,separator:i.SeparatorCustomContextMenuItem,submenuHeader:s.SubmenuHeaderCustomContextMenuItem,widget:c.WidgetCustomContextMenuItem};t.CustomContextMenuItem=e=>{var{type:t="normal",icon:n,label:i,enabled:l=!0,checked:s,hasSubMenu:c,showShouldHomeButton:d,onClick:p,onClose:f,onBack:h,selected:b}=e,
|
|
449
|
+
`},9005:function(e,t,n){var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.CustomContextMenuItem=void 0;const o=n(4848),a=n(2015),i=n(6554),l=n(2294),s=n(3741),c=n(4953),u={normal:l.NormalCustomContextMenuItem,checkbox:l.NormalCustomContextMenuItem,submenu:l.NormalCustomContextMenuItem,separator:i.SeparatorCustomContextMenuItem,submenuHeader:s.SubmenuHeaderCustomContextMenuItem,widget:c.WidgetCustomContextMenuItem};t.CustomContextMenuItem=e=>{var{type:t="normal",icon:n,label:i,enabled:l=!0,checked:s,hasSubMenu:c,showShouldHomeButton:d,onClick:p,onClose:f,onBack:h,selected:b,index:g}=e,m=r(e,["type","icon","label","enabled","checked","hasSubMenu","showShouldHomeButton","onClick","onClose","onBack","selected","index"]);let v;switch(t){case"normal":case"checkbox":{v=Object.assign(Object.assign({},m),{type:t,label:i,icon:n,enabled:l,checked:s,selected:b,onClick:p});const e=u[t];return(0,a.createElement)(e,Object.assign({},v,{key:i,index:g}))}case"submenu":{v=Object.assign(Object.assign({},m),{label:i,enabled:l,checked:s,submenu:c,selected:b,onClick:p});const e=u[t];return(0,a.createElement)(e,Object.assign({},v,{key:i,index:g}))}case"submenuHeader":{v={label:i,showShouldHomeButton:d,onClose:f,onBack:h,selected:b,onClick:p};const e=u[t];return(0,a.createElement)(e,Object.assign({},v,{key:i,index:g}))}case"separator":{const e=u[t];return(0,o.jsx)(e,{})}case"widget":{const e=Object.assign(Object.assign({},m),{onClick:p,label:i,enabled:l}),n=u[t];return(0,a.createElement)(n,Object.assign({},e,{key:i,index:g,onClick:p}))}default:return(0,o.jsx)(o.Fragment,{})}}},2294:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NormalCustomContextMenuItem=void 0;const o=n(4848),a=r(n(2770)),i=n(5917),l=n(6418);t.NormalCustomContextMenuItem=({type:e,label:t,enabled:n=!0,checked:r,submenu:a,onClick:i,selected:c,data:u,index:d})=>(0,o.jsx)(l.MenuItemContainer,{children:(0,o.jsxs)(l.MenuItemInnerContainer,{id:`${t}-${d}`,tabIndex:0,"aria-label":`${t}`,onClick:n?()=>null==i?void 0:i(u):void 0,enabled:n.toString(),selected:c,children:["checkbox"===e&&(0,o.jsx)(l.MenuItemIconContainer,{side:"left",children:(0,o.jsx)(s,{icon:"CheckIcon",enabled:n,checked:r})}),(0,o.jsx)(l.MenuItemText,{size:"base",weight:"normal",enabled:n,children:t}),a&&(0,o.jsx)(l.MenuItemIconContainer,{tabIndex:0,side:"right",children:(0,o.jsx)(l.MenuItemRightIcon,{icon:"ChevronRightIcon",enabled:n})})]})});const s=(0,a.default)(i.Icon)`
|
|
450
450
|
svg path {
|
|
451
451
|
fill: ${({theme:e,enabled:t,checked:n})=>t?n?e.palette.textDefault:"transparent":e.palette.textInactive};
|
|
452
452
|
stroke-width: 1.25;
|
|
@@ -512,7 +512,7 @@ var e={1193:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(1601),o=n.n(r),a=n(6
|
|
|
512
512
|
justify-content: flex-start;
|
|
513
513
|
border-radius: ${({theme:e})=>e.radius.small};
|
|
514
514
|
background-color: ${({theme:e,selected:t,enabled:n})=>"false"!==n&&t?e.palette.background3:"transparent"};
|
|
515
|
-
`},759:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(244),t)},3247:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useContextMenuKeyboardNavigation=void 0;const r=n(2015),o=n(244);t.useContextMenuKeyboardNavigation=(e,t,n,a,i,l,s,c,u)=>{const d=t=>{var n,r,o;return"separator"===(null===(n=e[t])||void 0===n?void 0:n.type)||!1===(null===(r=e[t])||void 0===r?void 0:r.enabled)||!1===(null===(o=e[t])||void 0===o?void 0:o.visible)},p=(0,r.useCallback)((()=>{i((t=>{let
|
|
515
|
+
`},759:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(244),t)},3247:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useContextMenuKeyboardNavigation=void 0;const r=n(2015),o=n(244);t.useContextMenuKeyboardNavigation=(e,t,n,a,i,l,s,c,u)=>{const d=t=>{var n,r,o;return"separator"===(null===(n=e[t])||void 0===n?void 0:n.type)||!1===(null===(r=e[t])||void 0===r?void 0:r.enabled)||!1===(null===(o=e[t])||void 0===o?void 0:o.visible)},p=(0,r.useCallback)((()=>{i((t=>{var n,r;let o=t;do{if(o===(null==e?void 0:e.length)-1)break;o+=1}while(d(o));if(d(o)){const r=document.getElementById(`${null===(n=e[t])||void 0===n?void 0:n.label}-${t}`);return null==r||r.focus(),t}const a=document.getElementById(`${null===(r=e[o])||void 0===r?void 0:r.label}-${o}`);return null==a||a.focus(),o}))}),[i,e]),f=(0,r.useCallback)((()=>{i((t=>{var r;let a=t;do{if(n===o.BASE_CONTEXT_MENU&&0===a||-1===a)break;a-=1}while(d(a));const i=document.getElementById(`${null===(r=e[a])||void 0===r?void 0:r.label}-${a}`);return null==i||i.focus(),a}))}),[i,e]),h=(0,r.useCallback)((()=>{i(n===o.BASE_CONTEXT_MENU?0:-1)}),[i,n]),b=(0,r.useCallback)((()=>{i((t=>{for(let n=e.length-1;n>=t;n--)if(!d(n))return n;return t}))}),[null==e?void 0:e.length,i]),g=(0,r.useCallback)((()=>{var t,r;if(null===(t=e[a])||void 0===t?void 0:t.hasSubMenu)s((null===(r=e[a])||void 0===r?void 0:r.label)||"");else{if(-1===a)return void c(n,"keyboard");l(e[a].data)}i(-1)}),[i,l,s,e,a,c,n]),m=(0,r.useCallback)((()=>{var t,n;(null===(t=e[a])||void 0===t?void 0:t.hasSubMenu)&&(s((null===(n=e[a])||void 0===n?void 0:n.label)||""),i(-1))}),[i,s,e,a]),v=(0,r.useCallback)((()=>{(t.slice(1).includes(n)||(null==t?void 0:t.length)>=1)&&c(n,"keyboard")}),[c,t,n]),x=(0,r.useCallback)((()=>{t.slice(2).includes(n)||(null==t?void 0:t.length)>=2?u():l({type:"close"})}),[u,t,n]);(0,r.useEffect)((()=>{const e=e=>{switch(e.key){case"ArrowDown":p();break;case"ArrowUp":f();break;case"Home":case"PageUp":h();break;case"End":case"PageDown":b();break;case"Enter":g();break;case"ArrowRight":m();break;case"ArrowLeft":v();break;case"Escape":x()}};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[p,f,h,b,g,m,v,x])}},8666:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useContextMenuNavigation=void 0;const r=n(2015),o=n(244);t.useContextMenuNavigation=(e,t,n,a,i,l,s,c,u,d)=>{const p=(0,r.useCallback)((e=>{const t=document.getElementById(e),n=null==t?void 0:t.getBoundingClientRect();return{height:(null==n?void 0:n.height)||0,width:(null==n?void 0:n.width)||0}}),[]);return{handleNavigateToSubmenu:(0,r.useCallback)((r=>{const{height:c,width:u}=p(r);d&&d(c,u),e||t(o.CONTEXT_MENU_ANIMATION_DURATION),s({width:u,height:c}),l(r),a([...n,i])}),[i,n,a,d,t,p]),handleNavigateBackToParent:(0,r.useCallback)(((e,t="click")=>{if(d){const e=1===n.length?o.BASE_CONTEXT_MENU:n[n.length-1],{height:t,width:r}=p(e);d(t,r)}const r=n,i=r.pop(),s=u.find((e=>e.parentLabel===i));l(i),a(r),c("keyboard"===t?(null==s?void 0:s.menuTemplate.findIndex((t=>t.label===e)))||0:-1)}),[n,a,c,p,d,u]),handleNavigateToBase:(0,r.useCallback)((()=>{if(d){const{height:e,width:t}=p(o.BASE_CONTEXT_MENU);d(e,t)}l(o.BASE_CONTEXT_MENU),a([]),c(-1)}),[l,a,c,p,d])}}},68:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useResizeContextMenu=void 0;const r=n(2015),o=n(244);t.useResizeContextMenu=e=>{const[t,n]=(0,r.useState)({height:160,width:160});return(0,r.useEffect)((()=>{const t=document.getElementById(e),r=document.getElementById(o.CONTEXT_MENU_FRAME_ID);if(!t)return;const a=new ResizeObserver((e=>{for(const t of e){const{width:e,height:o}=t.target.getBoundingClientRect();r&&(r.style.height=`${o}px`,r.style.width=`${e}px`,n({width:e,height:o}))}}));return a.observe(t),()=>{a.unobserve(t)}}),[e]),t}},6972:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getMenuNavigationOrder=t.getClassName=void 0;const r=n(244);t.getClassName=(e,t,n)=>t===e?r.ACTIVE_CONTEXT_MENU_CLASS:n.includes(e)?r.PRIOR_CONTEXT_MENU_CLASS:"",t.getMenuNavigationOrder=e=>{if(!e)return[];const t=[{parentLabel:r.BASE_CONTEXT_MENU,template:e}],n=[];for(;t.length;){const{template:e,parentLabel:r}=t.pop();e.forEach((({submenu:n,label:r},o)=>{n&&(t.push({parentLabel:r||"",template:n}),delete e[o].submenu,e[o].hasSubMenu=!0)})),n.push({parentLabel:r,menuTemplate:e})}return n}},6418:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MenuItemText=t.MenuItemRightIcon=t.MenuItemIconButton=t.MenuItemIconContainer=t.MenuItemInnerContainer=t.MenuItemContainer=t.MenuFrame=void 0;const o=r(n(2770)),a=n(2094),i=n(5917),l=n(5963);t.MenuFrame=(0,o.default)(a.Box)`
|
|
516
516
|
display: flex;
|
|
517
517
|
flex-direction: column;
|
|
518
518
|
position: absolute;
|
package/package.json
CHANGED