mantine-contextmenu 6.0.3 → 7.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -31
- package/dist/cjs/ContextMenu.js +60 -0
- package/dist/cjs/ContextMenu.js.map +1 -0
- package/dist/cjs/ContextMenuDivider.js +14 -0
- package/dist/cjs/ContextMenuDivider.js.map +1 -0
- package/dist/cjs/ContextMenuItem.js +53 -0
- package/dist/cjs/ContextMenuItem.js.map +1 -0
- package/dist/cjs/ContextMenuPortal.js +39 -0
- package/dist/cjs/ContextMenuPortal.js.map +1 -0
- package/dist/cjs/ContextMenuProvider.js +58 -0
- package/dist/cjs/ContextMenuProvider.js.map +1 -0
- package/dist/cjs/index.js +22 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/utils.js +27 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/css/styles.css +53 -0
- package/dist/css/styles.layer.css +61 -0
- package/dist/esm/ContextMenu.js +37 -0
- package/dist/esm/ContextMenu.js.map +1 -0
- package/dist/esm/ContextMenuDivider.js +9 -0
- package/dist/esm/ContextMenuDivider.js.map +1 -0
- package/dist/esm/ContextMenuItem.js +44 -0
- package/dist/esm/ContextMenuItem.js.map +1 -0
- package/dist/esm/ContextMenuPortal.js +12 -0
- package/dist/esm/ContextMenuPortal.js.map +1 -0
- package/dist/esm/ContextMenuProvider.js +41 -0
- package/dist/esm/ContextMenuProvider.js.map +1 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils.js +18 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/{ContextMenu.d.ts → types/ContextMenu.d.ts} +1 -2
- package/dist/types/ContextMenuDivider.d.ts +3 -0
- package/dist/{ContextMenuItem.d.ts → types/ContextMenuItem.d.ts} +1 -2
- package/dist/{ContextMenuPortal.d.ts → types/ContextMenuPortal.d.ts} +0 -1
- package/dist/{ContextMenuProvider.d.ts → types/ContextMenuProvider.d.ts} +0 -1
- package/dist/{index.d.ts → types/index.d.ts} +1 -2
- package/dist/{types.d.ts → types/types.d.ts} +8 -19
- package/dist/types/utils.d.ts +18 -0
- package/package.json +56 -19
- package/LICENSE +0 -21
- package/dist/ContextMenu.d.ts.map +0 -1
- package/dist/ContextMenuDivider.d.ts +0 -9
- package/dist/ContextMenuDivider.d.ts.map +0 -1
- package/dist/ContextMenuItem.d.ts.map +0 -1
- package/dist/ContextMenuPortal.d.ts.map +0 -1
- package/dist/ContextMenuProvider.d.ts.map +0 -1
- package/dist/index.cjs +0 -2
- package/dist/index.cjs.map +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +0 -7
- package/dist/types.d.ts.map +0 -1
- package/dist/utils.d.ts +0 -8
- package/dist/utils.d.ts.map +0 -1
package/dist/index.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import*as x from"react";import{Box as G,createStyles as J}from"@mantine/core";import{jsx as Z}from"react/jsx-runtime";var X=J(e=>({root:{height:1,background:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}}));function D({className:e,sx:t,style:o}){let{cx:i,classes:s}=X();return Z(G,{className:i(s.root,e),sx:t,style:o})}import{Box as W,Text as se,UnstyledButton as ie,createStyles as ue,px as ae}from"@mantine/core";import{useRef as de,useState as pe}from"react";import{Paper as Q,createStyles as V,packSx as j,px as ee}from"@mantine/core";import{useResizeObserver as te}from"@mantine/hooks";import{useEffect as oe,useState as ne}from"react";function k(e){let t=e.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`}import{jsx as O}from"react/jsx-runtime";var H={},re=V(e=>({root:{position:"fixed",border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,overflow:"hidden",transition:"all .15s ease"}}));function P({x:e,y:t,content:o,zIndex:i,shadow:s,borderRadius:u,onHide:a,className:m,style:d,sx:n,classNames:r,styles:f}){let[M]=te(),{width:C,height:S}=M.current?.getBoundingClientRect()||{width:0,height:0},p=0,y=0;typeof window<"u"&&({innerWidth:p,innerHeight:y}=window);let[,g]=ne(!1);oe(()=>{g(!0)},[]);let{cx:l,classes:w,theme:R}=re(),{dir:U,spacing:K}=R,b=typeof f=="function"?f(R,H,H):f,c=ee(K.md);return O(Q,{ref:M,shadow:s,radius:u,className:l(w.root,m,r?.root),style:{...b?.root,...d},sx:[{zIndex:i,top:t+S+c>y?y-S-c:t,left:U==="ltr"?e+C+c>p?p-C-c:e:p-c-(e-C-c<0?C+c:e)},...j(n)],children:Array.isArray(o)?o.map(({key:h,className:I,sx:T,style:B,onClick:z,items:E,title:Y,..._})=>z||E?O(N,{className:l(r?.item,I),sx:T,style:{...b?.item,...B},title:Y??k(h),onClick:z,onHide:a,items:E,..._},h):O(D,{className:l(r?.divider,I),sx:T,style:{...b?.divider,...B}},h)):o(a)})}import{jsx as v,jsxs as L}from"react/jsx-runtime";var le=ue((e,{color:t})=>{let o=ae(e.spacing.sm)/2;return{button:{width:"100%",display:"flex",alignItems:"center",paddingTop:o,paddingBottom:o,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,color:t&&e.colors[t][6],transition:"background .15s ease","&[disabled]":{cursor:"not-allowed",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:hover:not([disabled])":{background:e.fn.rgba(t?e.colors[t][6]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4],t?e.colorScheme==="dark"?.15:.08:.25)},"&:active:not([disabled])":{background:e.fn.rgba(t?e.colors[t][6]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4],t?e.colorScheme==="dark"?.3:.2:.5)}},title:{whiteSpace:"nowrap",flexGrow:1}}});function N({className:e,style:t,icon:o,title:i,color:s,disabled:u,onClick:a,onHide:m,items:d}){let n=de(null),[r,f]=pe(null),M=a?l=>{m(),a(l)}:void 0,C=()=>{let{top:l,right:w}=n.current.getBoundingClientRect();f({x:w,y:l})},S=()=>{f(null)},p=d&&!u,{cx:y,classes:g}=le({color:s});return L("div",{onMouseOver:p?C:void 0,onMouseOut:p?S:void 0,children:[L(ie,{ref:n,className:y(g.button,e),style:t,disabled:u,onClick:M,children:[o&&v(W,{fz:0,mr:"xs",children:o}),v(se,{className:g.title,size:"sm",children:i}),d&&v(W,{fz:10,mt:-2,ml:"xs",children:"\u25B6"})]}),r&&v(P,{content:d,onHide:m,...r})]})}import{Portal as ce}from"@mantine/core";import{useClickOutside as xe,useWindowEvent as A}from"@mantine/hooks";import{jsx as $}from"react/jsx-runtime";function q({onHide:e,...t}){A("resize",e),A("scroll",e);let o=xe(e);return $(ce,{innerRef:o,children:$(P,{...t,onHide:e})})}import{createContext as me,useContext as fe,useState as Ce}from"react";import{jsx as ye,jsxs as Me}from"react/jsx-runtime";var F=me(()=>()=>{});function Qe({zIndex:e=9999,shadow:t="sm",borderRadius:o="xs",children:i}){let[s,u]=Ce(null),a=()=>{u(null)},m=(d,n)=>r=>{r.preventDefault(),r.stopPropagation(),u({x:r.clientX,y:r.clientY,content:d,zIndex:n?.zIndex||e,shadow:n?.shadow||t,borderRadius:n?.borderRadius||o,className:n?.className,style:n?.style,sx:n?.sx,classNames:n?.classNames,styles:n?.styles})};return Me(F.Provider,{value:m,children:[i,s&&ye(q,{onHide:a,...s})]})}function Ve(){return fe(F)}export{D as ContextMenuDivider,N as ContextMenuItem,q as ContextMenuPortal,Qe as ContextMenuProvider,k as humanize,Ve as useContextMenu};
|
|
2
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../react-shim.mjs", "../ContextMenuDivider.tsx", "../ContextMenuItem.tsx", "../ContextMenu.tsx", "../utils.ts", "../ContextMenuPortal.tsx", "../ContextMenuProvider.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Box, createStyles, type Sx } from '@mantine/core';\nimport type { CSSProperties } from 'react';\n\nconst useStyles = createStyles((theme) => ({\n root: {\n height: 1,\n background: theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[1],\n },\n}));\n\nexport type ContextMenuDividerProps = {\n className: string;\n sx: Sx | (Sx | undefined)[] | undefined;\n style: CSSProperties;\n};\n\nexport function ContextMenuDivider({ className, sx, style }: ContextMenuDividerProps) {\n const { cx, classes } = useStyles();\n return <Box className={cx(classes.root, className)} sx={sx} style={style} />;\n}\n", "import { Box, Text, UnstyledButton, createStyles, px, type MantineColor } from '@mantine/core';\nimport { MouseEventHandler, useRef, useState } from 'react';\nimport { ContextMenu } from './ContextMenu';\nimport { ContextMenuContent, ContextMenuItemOptions } from './types';\nimport { WithRequiredProperty } from './utils';\n\nconst useStyles = createStyles((theme, { color }: { color?: MantineColor }) => {\n const verticalPadding = px(theme.spacing.sm) / 2;\n return {\n button: {\n width: '100%',\n display: 'flex',\n alignItems: 'center',\n paddingTop: verticalPadding,\n paddingBottom: verticalPadding,\n paddingLeft: theme.spacing.sm,\n paddingRight: theme.spacing.sm,\n color: color && theme.colors[color][6],\n transition: 'background .15s ease',\n '&[disabled]': {\n cursor: 'not-allowed',\n color: theme.colorScheme === 'dark' ? theme.colors.dark[3] : theme.colors.gray[5],\n },\n '&:hover:not([disabled])': {\n background: theme.fn.rgba(\n color ? theme.colors[color][6] : theme.colorScheme === 'dark' ? theme.colors.dark[3] : theme.colors.gray[4],\n color ? (theme.colorScheme === 'dark' ? 0.15 : 0.08) : 0.25\n ),\n },\n '&:active:not([disabled])': {\n background: theme.fn.rgba(\n color ? theme.colors[color][6] : theme.colorScheme === 'dark' ? theme.colors.dark[3] : theme.colors.gray[4],\n color ? (theme.colorScheme === 'dark' ? 0.3 : 0.2) : 0.5\n ),\n },\n },\n title: {\n whiteSpace: 'nowrap',\n flexGrow: 1,\n },\n };\n});\n\nexport function ContextMenuItem({\n className,\n style,\n icon,\n title,\n color,\n disabled,\n onClick,\n onHide,\n items,\n}: WithRequiredProperty<Omit<ContextMenuItemOptions, 'key'>, 'title'> & { onHide: () => void }) {\n const ref = useRef<HTMLButtonElement>(null);\n const [submenuPosition, setSubmenuPosition] = useState<{ x: number; y: number } | null>(null);\n\n const handleClick: MouseEventHandler<HTMLButtonElement> | undefined = onClick\n ? (e) => {\n onHide();\n onClick!(e);\n }\n : undefined;\n\n const showSubmenu = () => {\n const { top: y, right: x } = ref.current!.getBoundingClientRect();\n setSubmenuPosition({ x, y });\n };\n\n const hideSubmenu = () => {\n setSubmenuPosition(null);\n };\n\n const hasItemsAndIsNotDisabled = items && !disabled;\n const { cx, classes } = useStyles({ color });\n\n return (\n <div\n onMouseOver={hasItemsAndIsNotDisabled ? showSubmenu : undefined}\n onMouseOut={hasItemsAndIsNotDisabled ? hideSubmenu : undefined}\n >\n <UnstyledButton\n ref={ref}\n className={cx(classes.button, className)}\n style={style}\n disabled={disabled}\n onClick={handleClick}\n >\n {icon && (\n <Box fz={0} mr=\"xs\">\n {icon}\n </Box>\n )}\n <Text className={classes.title} size=\"sm\">\n {title}\n </Text>\n {items && (\n <Box fz={10} mt={-2} ml=\"xs\">\n \u25B6\n </Box>\n )}\n </UnstyledButton>\n {submenuPosition && <ContextMenu content={items as ContextMenuContent} onHide={onHide} {...submenuPosition} />}\n </div>\n );\n}\n", "import { Paper, createStyles, packSx, px } from '@mantine/core';\nimport { useResizeObserver } from '@mantine/hooks';\nimport { CSSProperties, useEffect, useState } from 'react';\nimport { ContextMenuDivider } from './ContextMenuDivider';\nimport { ContextMenuItem } from './ContextMenuItem';\nimport type { ContextMenuContent, ContextMenuOptions } from './types';\nimport { humanize } from './utils';\n\nconst EMPTY_OBJECT = {};\n\nconst useStyles = createStyles((theme) => ({\n root: {\n position: 'fixed',\n border: `1px solid ${theme.colorScheme === 'dark' ? theme.colors.dark[4] : theme.colors.gray[3]}`,\n overflow: 'hidden',\n transition: 'all .15s ease',\n },\n}));\n\nexport type ContextMenuInstanceOptions = {\n x: number;\n y: number;\n content: ContextMenuContent;\n};\n\nexport type ContextMenuProps = ContextMenuOptions &\n ContextMenuInstanceOptions & {\n onHide: () => void;\n };\n\nexport function ContextMenu({\n x,\n y,\n content,\n zIndex,\n shadow,\n borderRadius,\n onHide,\n className,\n style,\n sx,\n classNames,\n styles,\n}: ContextMenuProps) {\n const [paperRef] = useResizeObserver<HTMLDivElement>();\n const { width, height } = paperRef.current?.getBoundingClientRect() || { width: 0, height: 0 };\n\n let windowWidth = 0;\n let windowHeight = 0;\n if (typeof window !== 'undefined') ({ innerWidth: windowWidth, innerHeight: windowHeight } = window);\n\n // trigger a rerender to make sure that context menu is positioned correctly\n const [, setRendered] = useState(false);\n useEffect(() => {\n setRendered(true);\n }, []);\n\n const { cx, classes, theme } = useStyles();\n const { dir, spacing } = theme;\n const styleProperties = typeof styles === 'function' ? styles(theme, EMPTY_OBJECT, EMPTY_OBJECT) : styles;\n const mdSpacing = px(spacing.md);\n\n return (\n <Paper\n ref={paperRef}\n shadow={shadow}\n radius={borderRadius}\n className={cx(classes.root, className, classNames?.root)}\n style={{ ...styleProperties?.root, ...style } as CSSProperties}\n sx={[\n {\n zIndex,\n top: y + height + mdSpacing > windowHeight ? windowHeight - height - mdSpacing : y,\n left:\n dir === 'ltr'\n ? x + width + mdSpacing > windowWidth\n ? windowWidth - width - mdSpacing\n : x\n : windowWidth - mdSpacing - (x - width - mdSpacing < 0 ? width + mdSpacing : x),\n },\n ...packSx(sx),\n ]}\n >\n {Array.isArray(content)\n ? content.map(({ key, className, sx, style, onClick, items, title, ...otherOptions }) =>\n onClick || items ? (\n <ContextMenuItem\n key={key}\n className={cx(classNames?.item, className)}\n sx={sx}\n style={{ ...styleProperties?.item, ...style } as CSSProperties}\n title={title ?? humanize(key)}\n onClick={onClick}\n onHide={onHide}\n items={items}\n {...otherOptions}\n />\n ) : (\n <ContextMenuDivider\n key={key}\n className={cx(classNames?.divider, className)}\n sx={sx}\n style={{ ...styleProperties?.divider, ...style } as CSSProperties}\n />\n )\n )\n : content(onHide)}\n </Paper>\n );\n}\n", "export type WithRequiredProperty<Type, Key extends keyof Type> = Type & {\n [Property in Key]-?: Type[Property];\n};\n\n/**\n * Utility function that returns a humanized version of a string, e.g. \"camelCase\" -> \"Camel Case\"\n */\nexport function humanize(value: string) {\n const str = value\n .replace(/([a-z\\d])([A-Z]+)/g, '$1 $2')\n .replace(/\\W|_/g, ' ')\n .trim()\n .toLowerCase();\n return `${str.charAt(0).toUpperCase()}${str.slice(1)}`;\n}\n", "import { Portal } from '@mantine/core';\nimport { useClickOutside, useWindowEvent } from '@mantine/hooks';\nimport { ContextMenu, type ContextMenuProps } from './ContextMenu';\n\nexport function ContextMenuPortal({ onHide, ...otherProps }: ContextMenuProps) {\n useWindowEvent('resize', onHide);\n useWindowEvent('scroll', onHide);\n const portalInnerRef = useClickOutside<HTMLDivElement>(onHide);\n\n return (\n <Portal innerRef={portalInnerRef}>\n <ContextMenu {...otherProps} onHide={onHide} />\n </Portal>\n );\n}\n", "import { createContext, useContext, useState } from 'react';\nimport { ContextMenuInstanceOptions } from './ContextMenu';\nimport { ContextMenuPortal } from './ContextMenuPortal';\nimport type { ContextMenuOptions, ContextMenuProviderProps, ShowContextMenuFunction } from './types';\n\nconst MenuContext = createContext<ShowContextMenuFunction>(() => () => undefined);\n\n/**\n * Provider that allows to show a context menu anywhere in your application.\n * If you wrap your application with this provider, you can use the `useContextMenu` hook\n * anywhere in the component tree to access a function that shows the context menu.\n */\nexport function ContextMenuProvider({\n zIndex = 9999,\n shadow = 'sm',\n borderRadius = 'xs',\n children,\n}: ContextMenuProviderProps) {\n const [data, setData] = useState<(ContextMenuInstanceOptions & ContextMenuOptions) | null>(null);\n\n const destroy = () => {\n setData(null);\n };\n\n const showContextMenu: ShowContextMenuFunction = (content, options) => (e) => {\n e.preventDefault();\n e.stopPropagation();\n setData({\n x: e.clientX,\n y: e.clientY,\n content,\n zIndex: options?.zIndex || zIndex,\n shadow: options?.shadow || shadow,\n borderRadius: options?.borderRadius || borderRadius,\n className: options?.className,\n style: options?.style,\n sx: options?.sx,\n classNames: options?.classNames,\n styles: options?.styles,\n });\n };\n\n return (\n <MenuContext.Provider value={showContextMenu}>\n {children}\n {data && <ContextMenuPortal onHide={destroy} {...data} />}\n </MenuContext.Provider>\n );\n}\n\n/**\n * Hook returning a function that shows a context menu.\n */\nexport function useContextMenu() {\n return useContext(MenuContext);\n}\n"],
|
|
5
|
-
"mappings": "AAAA,UAAYA,MAAW,QCAvB,OAAS,OAAAC,EAAK,gBAAAC,MAA6B,gBAkBlC,cAAAC,MAAA,oBAfT,IAAMC,EAAYF,EAAcG,IAAW,CACzC,KAAM,CACJ,OAAQ,EACR,WAAYA,EAAM,cAAgB,OAASA,EAAM,OAAO,KAAK,CAAC,EAAIA,EAAM,OAAO,KAAK,CAAC,CACvF,CACF,EAAE,EAQK,SAASC,EAAmB,CAAE,UAAAC,EAAW,GAAAC,EAAI,MAAAC,CAAM,EAA4B,CACpF,GAAM,CAAE,GAAAC,EAAI,QAAAC,CAAQ,EAAIP,EAAU,EAClC,OAAOD,EAACF,EAAA,CAAI,UAAWS,EAAGC,EAAQ,KAAMJ,CAAS,EAAG,GAAIC,EAAI,MAAOC,EAAO,CAC5E,CCnBA,OAAS,OAAAG,EAAK,QAAAC,GAAM,kBAAAC,GAAgB,gBAAAC,GAAc,MAAAC,OAA6B,gBAC/E,OAA4B,UAAAC,GAAQ,YAAAC,OAAgB,QCDpD,OAAS,SAAAC,EAAO,gBAAAC,EAAc,UAAAC,EAAQ,MAAAC,OAAU,gBAChD,OAAS,qBAAAC,OAAyB,iBAClC,OAAwB,aAAAC,GAAW,YAAAC,OAAgB,QCK5C,SAASC,EAASC,EAAe,CACtC,IAA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C3B,GAAM,CAACC,EAAMC,CAAO,EAAIC,GAAmE,IAAI,EAEzFC,EAAU,IAAM,CACpBF,EAAQ,IAAI,CACd,EAEMG,EAA2C,CAACC,EAASC,IAAaC,GAAM,CAC5EA,EAAE,eAAe,EACjBA,EAAE,gBAAgB,EAClBN,EAAQ,CACN,EAAGM,EAAE,QACL,EAAGA,EAAE,QACL,QAAAF,EACA,OAAQC,GAAS,QAAUV,EAC3B,OAAQU,GAAS,QAAUT,EAC3B,aAAcS,GAAS,cAAgBR,EACvC,UAAWQ,GAAS,UACpB,MAAOA,GAAS,MAChB,GAAIA,GAAS,GACb,WAAYA,GAAS,WACrB,OAAQA,GAAS,MACnB,CAAC,CACH,EAEA,OACEd,GAACC,EAAY,SAAZ,CAAqB,MAAOW,EAC1B,UAAAL,EACAC,GAAQT,GAACiB,EAAA,CAAkB,OAAQL,EAAU,GAAGH,EAAM,GACzD,CAEJ,CAKO,SAASS,IAAiB,CAC/B,OAAOC,GAAWjB,CAAW,CAC/B",
|
|
6
|
-
"names": ["React", "Box", "createStyles", "jsx", "useStyles", "theme", "ContextMenuDivider", "className", "sx", "style", "cx", "classes", "Box", "Text", "UnstyledButton", "createStyles", "px", "useRef", "useState", "Paper", "createStyles", "packSx", "px", "useResizeObserver", "useEffect", "useState", "humanize", "value", "str", "jsx", "EMPTY_OBJECT", "useStyles", "createStyles", "theme", "ContextMenu", "x", "y", "content", "zIndex", "shadow", "borderRadius", "onHide", "className", "style", "sx", "classNames", "styles", "paperRef", "useResizeObserver", "width", "height", "windowWidth", "windowHeight", "setRendered", "useState", "useEffect", "cx", "classes", "dir", "spacing", "styleProperties", "mdSpacing", "px", "Paper", "packSx", "key", "onClick", "items", "title", "otherOptions", "ContextMenuItem", "humanize", "ContextMenuDivider", "jsx", "jsxs", "useStyles", "createStyles", "theme", "color", "verticalPadding", "px", "ContextMenuItem", "className", "style", "icon", "title", "disabled", "onClick", "onHide", "items", "ref", "useRef", "submenuPosition", "setSubmenuPosition", "useState", "handleClick", "e", "showSubmenu", "y", "x", "hideSubmenu", "hasItemsAndIsNotDisabled", "cx", "classes", "UnstyledButton", "Box", "Text", "ContextMenu", "Portal", "useClickOutside", "useWindowEvent", "jsx", "ContextMenuPortal", "onHide", "otherProps", "useWindowEvent", "portalInnerRef", "useClickOutside", "Portal", "ContextMenu", "createContext", "useContext", "useState", "jsx", "jsxs", "MenuContext", "createContext", "ContextMenuProvider", "zIndex", "shadow", "borderRadius", "children", "data", "setData", "useState", "destroy", "showContextMenu", "content", "options", "e", "ContextMenuPortal", "useContextMenu", "useContext"]
|
|
7
|
-
}
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAC5G,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzE,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IAEvB;;;OAGG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;IAEjC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB;;;OAGG;IACH,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,CAAC;IAE7B;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;IAErD;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,GAA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BAAuB,GAAG;AACpC;;;GAGG;AACH,OAAO,EAAE,kBAAkB;AAE3B;;GAEG;AACH,OAAO,CAAC,EAAE,kBAAkB,KACzB,iBAAiB,CAAC"}
|
package/dist/utils.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type WithRequiredProperty<Type, Key extends keyof Type> = Type & {
|
|
2
|
-
[Property in Key]-?: Type[Property];
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* Utility function that returns a humanized version of a string, e.g. "camelCase" -> "Camel Case"
|
|
6
|
-
*/
|
|
7
|
-
export declare function humanize(value: string): string;
|
|
8
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,CAAC,IAAI,EAAE,GAAG,SAAS,MAAM,IAAI,IAAI,IAAI,GAAG;KACrE,QAAQ,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;CACpC,CAAC;AAEF;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,UAOrC"}
|