@tamagui/context-menu 2.7.7 → 3.0.0-beta.637.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/dist/cjs/ContextMenu.cjs +152 -166
- package/dist/cjs/ContextMenu.native.cjs +178 -0
- package/dist/cjs/ContextMenu.native.js +157 -170
- package/dist/cjs/ContextMenu.native.js.map +1 -1
- package/dist/cjs/createNonNativeContextMenu.cjs +358 -422
- package/dist/cjs/createNonNativeContextMenu.native.cjs +405 -0
- package/dist/cjs/createNonNativeContextMenu.native.js +380 -443
- package/dist/cjs/createNonNativeContextMenu.native.js.map +1 -1
- package/dist/cjs/index.cjs +15 -29
- package/dist/cjs/index.native.cjs +29 -0
- package/dist/cjs/index.native.js +16 -29
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/ContextMenu.mjs +136 -140
- package/dist/esm/ContextMenu.mjs.map +1 -1
- package/dist/esm/ContextMenu.native.js +141 -145
- package/dist/esm/ContextMenu.native.js.map +1 -1
- package/dist/esm/createNonNativeContextMenu.mjs +342 -398
- package/dist/esm/createNonNativeContextMenu.mjs.map +1 -1
- package/dist/esm/createNonNativeContextMenu.native.js +365 -421
- package/dist/esm/createNonNativeContextMenu.native.js.map +1 -1
- package/dist/esm/index.js +3 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +3 -12
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +3 -12
- package/dist/esm/index.native.js.map +1 -1
- package/dist/jsx/ContextMenu.mjs +136 -140
- package/dist/jsx/ContextMenu.mjs.map +1 -1
- package/dist/jsx/ContextMenu.native.cjs +178 -0
- package/dist/jsx/ContextMenu.native.js +157 -170
- package/dist/jsx/ContextMenu.native.js.map +1 -1
- package/dist/jsx/createNonNativeContextMenu.mjs +342 -398
- package/dist/jsx/createNonNativeContextMenu.mjs.map +1 -1
- package/dist/jsx/createNonNativeContextMenu.native.cjs +405 -0
- package/dist/jsx/createNonNativeContextMenu.native.js +380 -443
- package/dist/jsx/createNonNativeContextMenu.native.js.map +1 -1
- package/dist/jsx/index.js +3 -12
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +3 -12
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.cjs +29 -0
- package/dist/jsx/index.native.js +16 -29
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +9 -7
- package/src/ContextMenu.tsx +2 -3
- package/src/createNonNativeContextMenu.tsx +131 -104
- package/src/index.tsx +1 -13
- package/types/ContextMenu.d.ts +85 -76
- package/types/ContextMenu.d.ts.map +1 -1
- package/types/createNonNativeContextMenu.d.ts +77 -107
- package/types/createNonNativeContextMenu.d.ts.map +1 -1
- package/types/index.d.ts +84 -74
- package/types/index.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","createBaseMenu","useControllableState","composeEventHandlers","composeRefs","createStyledContext","isAndroid","isWeb","Slot","View","withStaticProperties","React","useId","_instanceof","left","right","Symbol","hasInstance","CONTEXTMENU_CONTEXT","createNonNativeContextMenu","params","Menu","CONTEXT_MENU_NAME","Provider","ContextMenuProvider","useStyledContext","useContextMenuContext","ContextMenuComp","props","scope","children","onOpenChange","dir","modal","rest","open","setOpen","useState","triggerRef","useRef","handleOpenChange","useCallback","open2","event","defaultPrevented","triggerId","contentId","displayName","TRIGGER_NAME","ContextMenuTrigger","styleable","forwardedRef","style","disabled","asChild","triggerProps","context","pointRef","x","y","virtualRef","useMemo","current","getBoundingClientRect","scrollX","window","document","documentElement","scrollLeft","scrollY","scrollTop","DOMRect","fromRect","width","height","top","measure","c","measureInWindow","longPressTimerRef","clearLongPress","clearTimeout","createOpenChangeEvent","preventDefault","handleOpen","MouseEvent","PointerEvent","clientX","clientY","nativeEvent","pageX","pageY","openChangeEvent","useEffect","Comp","Anchor","render","componentName","id","ref","WebkitTouchCallout","onContextMenu","onPointerDown","pointerType","setTimeout","onPointerMove","onPointerCancel","onPointerUp","onLongPress","PORTAL_NAME","ContextMenuPortal","portalProps","content","Portal","CONTENT_NAME","ContextMenuContent","forwardRef","contentProps","hasInteractedOutsideRef","Content","onCloseAutoFocus","_context_triggerRef_current","focus","onInteractOutside","originalEvent","detail","ctrlLeftClick","button","ctrlKey","isRightClick","ITEM_NAME","ContextMenuItem","itemProps","Item","CHECKBOX_ITEM_NAME","ContextMenuCheckboxItem","checkboxItemProps","CheckboxItem","RADIO_GROUP_NAME","ContextMenuRadioGroup","radioGroupProps","RadioGroup","RADIO_ITEM_NAME","ContextMenuRadioItem","radioItemProps","RadioItem","INDICATOR_NAME","ContextMenuItemIndicator","ItemIndicator","itemIndicatorProps","SUB_NAME","ContextMenuSub","openProp","defaultOpen","prop","defaultProp","onChange","Sub","SUB_TRIGGER_NAME","ContextMenuSubTrigger","subTriggerProps","SubTrigger","SUB_CONTENT_NAME","ContextMenuSubContent","subContentProps","SubContent","ARROW_NAME","ContextMenuArrow","arrowProps","Arrow","ContextMenuGroup","Group","ContextMenuLabel","Label","ContextMenuSeparator","Separator","ContextMenuItemTitle","ItemTitle","ContextMenuItemSubTitle","ItemSubtitle","ContextMenuItemImage","ItemImage","ContextMenuItemIcon","ItemIcon","ContextMenuPreview","Root","Trigger","Preview"],"sources":["../../src/createNonNativeContextMenu.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAgD,EAAAC,QAAA,IAAAC,SAAA;AACzD,SAASC,cAAA,8BAA4B;AACrC,SAAAC,oBAAA;AAAA,SACEC,oBAAA,EAAAC,WAAA,EAAAC,mBAAA,EAAAC,SAAA,EAAAC,KAAA,EAAAC,IAAA,EAAAC,IAAA,EAAAC,oBAAA;AAAA,OACAC,KAAA,IAAAC,KAAA;AAAA,SACAC,YAAAC,IAAA,EAAAC,KAAA;EACA,IAAAA,KAAA,mBAAAC,MAAA,oBAAAD,KAAA,CAAAC,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ACN;EACE;EAAMoH,gBAAL,CAAAxH,WAAA,GAAAuH,UAAA;EAAA,IAAAI,gBACC,GAAerJ,IAAA,CAAAsJ,KAAA;EAAA,IAAAC,gBACR,GAASvJ,IAAA,CAAAwJ,KAAA;EAAA,IAAAC,oBACZ,GAAAzJ,IAAA,CAAA0J,SAAA;EAAA,IAAAC,oBACC,GAAA3J,IAAA,CAAA4J,SAAA;EAAA,IAAAC,uBAAA,GAAA7J,IAAA,CAAA8J,YAAA;EAAA,IACPC,oBAAA,GAAA/J,IAAA,CAAAgK,SAAA;EAEJ,IAACC,mBAAA,GAAAjK,IAAA,CAAAkK,QAAA;EAED,IAAAC,kBAAiB,YAAAA,CAAA,EAAc;IAM/B,OAAM;EACN;EACA,OAAM9K,oBAAA,CAAAiB,eAA4B;IAClC8J,IAAM,EAAA9J,eAAA;IACN+J,OAAM,EAAAzI,kBAAA;IACNgE,MAAM,EAAAH,iBAAA;IACNS,OAAM,EAAAJ,kBAAsB;IAC5BwD,KAAM,EAAAD,gBAAA;IAING,KAAO,EAAAD,gBAAA;IACLvC,IAAA,EAAMF,eAAA;IACNM,YAAS,EAAAF,uBAAA;IACTM,UAAQ,EAAAF,qBAAA;IACRM,SAAS,EAAAF,oBAAA;IACTK,aAAO,EAAAD,wBAAA;IACP4B,SAAO,EAAAD,oBAAA;IACPL,KAAA,EAAMF,gBAAA;IACNV,GAAA,EAAAN,cAAc;IACdU,UAAA,EAAYF,qBAAA;IACZM,UAAA,EAAWF,qBAAA;IACXc,SAAA,EAAAD,oBAAe;IACfG,YAAW,EAAAD,uBAAA;IACXK,QAAO,EAAAD,mBAAA;IACPD,SAAK,EAAAD,oBAAA;IACLO,OAAA,EAAAH;EAAY,EACZ;AAAY;AACD,SACGtK,mBACJ,EAAAC,0BACC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"createNonNativeContextMenu.native.js","names":["_Fragment"],"sources":["esm/createNonNativeContextMenu.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { createRefComponent } from \"@tamagui/compose-refs\";\nimport { createBaseMenu } from \"@tamagui/create-menu\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport { createStyledHOC, composeEventHandlers, composeRefs, createStyledContext, isAndroid, isWeb, Slot, View, withStaticProperties } from \"@tamagui/web\";\nimport React, { useId } from \"react\";\nfunction _instanceof(left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\n return !!right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n}\nvar CONTEXTMENU_CONTEXT = \"ContextMenuContext\";\nfunction createNonNativeContextMenu() {\n var { Menu } = createBaseMenu();\n var CONTEXT_MENU_NAME = \"ContextMenu\";\n var { Provider: ContextMenuProvider, useStyledContext: useContextMenuContext } = createStyledContext();\n var ContextMenuComp = function(props) {\n var { scope, children, onOpenChange, open: openProp, defaultOpen, dir, modal = true, ...rest } = props;\n var [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen !== null && defaultOpen !== void 0 ? defaultOpen : false\n });\n var triggerRef = React.useRef(null);\n var handleOpenChange = React.useCallback(function(open2, event) {\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(open2, event);\n if (event === null || event === void 0 ? void 0 : event.defaultPrevented) return;\n setOpen(open2);\n }, [\n onOpenChange,\n setOpen\n ]);\n return /* @__PURE__ */ _jsx(ContextMenuProvider, {\n scope,\n triggerId: useId(),\n triggerRef,\n contentId: useId(),\n open,\n onOpenChange: handleOpenChange,\n modal,\n children: /* @__PURE__ */ _jsx(Menu, {\n scope: scope || CONTEXTMENU_CONTEXT,\n dir,\n open,\n onOpenChange: handleOpenChange,\n modal,\n ...rest,\n children\n })\n });\n };\n ContextMenuComp.displayName = CONTEXT_MENU_NAME;\n var TRIGGER_NAME = \"ContextMenuTrigger\";\n var ContextMenuTrigger = createStyledHOC(View, function(props, forwardedRef) {\n var { scope, style, className, disabled = false, asChild, children, ...triggerProps } = props;\n var context = useContextMenuContext(scope);\n var pointRef = React.useRef({\n x: 0,\n y: 0\n });\n var virtualRef = React.useMemo(function() {\n return {\n current: {\n getBoundingClientRect: function() {\n if (isWeb) {\n var scrollX = window.scrollX || document.documentElement.scrollLeft;\n var scrollY = window.scrollY || document.documentElement.scrollTop;\n return DOMRect.fromRect({\n width: 0,\n height: 0,\n x: pointRef.current.x - scrollX,\n y: pointRef.current.y - scrollY\n });\n }\n return {\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n ...pointRef.current\n };\n },\n ...!isWeb && {\n measure: function(c) {\n return c(pointRef.current.x, pointRef.current.y, 0, 0);\n },\n measureInWindow: function(c) {\n return c(pointRef.current.x, pointRef.current.y, 0, 0);\n }\n }\n }\n };\n }, [\n pointRef.current.x,\n pointRef.current.y\n ]);\n var longPressTimerRef = React.useRef(0);\n var clearLongPress = React.useCallback(function() {\n return window.clearTimeout(longPressTimerRef.current);\n }, []);\n var createOpenChangeEvent = function() {\n var defaultPrevented = false;\n return {\n get defaultPrevented() {\n return defaultPrevented;\n },\n preventDefault() {\n defaultPrevented = true;\n }\n };\n };\n var handleOpen = function(event) {\n if (isWeb && (_instanceof(event, MouseEvent) || _instanceof(event, PointerEvent))) {\n pointRef.current = {\n x: event.clientX,\n y: event.clientY\n };\n } else {\n pointRef.current = {\n x: event.nativeEvent.pageX,\n y: event.nativeEvent.pageY\n };\n }\n var openChangeEvent = createOpenChangeEvent();\n context.onOpenChange(true, openChangeEvent);\n return openChangeEvent;\n };\n React.useEffect(function() {\n return clearLongPress;\n }, [\n clearLongPress\n ]);\n React.useEffect(function() {\n return void (disabled && clearLongPress());\n }, [\n disabled,\n clearLongPress\n ]);\n var Comp = asChild ? Slot : View;\n return /* @__PURE__ */ _jsxs(_Fragment, {\n children: [\n /* @__PURE__ */ _jsx(Menu.Anchor, {\n scope: scope || CONTEXTMENU_CONTEXT,\n virtualRef\n }),\n /* @__PURE__ */ _jsx(Comp, {\n render: \"span\",\n className: `is_${TRIGGER_NAME} ${className || \"\"}`.trim(),\n id: context.triggerId,\n \"data-state\": context.open ? \"open\" : \"closed\",\n \"data-disabled\": disabled ? \"\" : void 0,\n ...triggerProps,\n ref: composeRefs(forwardedRef, context.triggerRef),\n style: isWeb ? {\n WebkitTouchCallout: \"none\",\n ...style\n } : null,\n ...isWeb && {\n onContextMenu: disabled ? props.onContextMenu : composeEventHandlers(props.onContextMenu, function(event) {\n clearLongPress();\n var openChangeEvent = handleOpen(event);\n if (!openChangeEvent.defaultPrevented) {\n event.preventDefault();\n }\n }),\n onPointerDown: disabled ? props.onPointerDown : composeEventHandlers(props.onPointerDown, function(event) {\n if (event.pointerType === \"mouse\") return;\n clearLongPress();\n longPressTimerRef.current = window.setTimeout(function() {\n return handleOpen(event);\n }, 700);\n }),\n onPointerMove: disabled ? props.onPointerMove : composeEventHandlers(props.onPointerMove, function(event) {\n if (event.pointerType === \"mouse\") return;\n clearLongPress();\n }),\n onPointerCancel: disabled ? props.onPointerCancel : composeEventHandlers(props.onPointerCancel, function(event) {\n if (event.pointerType === \"mouse\") return;\n clearLongPress();\n }),\n onPointerUp: disabled ? props.onPointerUp : composeEventHandlers(props.onPointerUp, function(event) {\n if (event.pointerType === \"mouse\") return;\n clearLongPress();\n })\n },\n ...!isWeb && {\n onLongPress: disabled ? props.onLongPress : composeEventHandlers(props.onLongPress, function(event) {\n clearLongPress();\n var openChangeEvent = handleOpen(event);\n if (!openChangeEvent.defaultPrevented) {\n event.preventDefault();\n }\n })\n },\n children\n })\n ]\n });\n });\n ContextMenuTrigger.displayName = TRIGGER_NAME;\n var PORTAL_NAME = \"ContextMenuPortal\";\n var ContextMenuPortal = function(props) {\n var { scope, children, ...portalProps } = props;\n var context = isAndroid ? useContextMenuContext(scope) : null;\n var content = isAndroid ? /* @__PURE__ */ _jsx(ContextMenuProvider, {\n ...context,\n children\n }) : children;\n return /* @__PURE__ */ _jsx(Menu.Portal, {\n scope: scope || CONTEXTMENU_CONTEXT,\n ...portalProps,\n children: content\n });\n };\n ContextMenuPortal.displayName = PORTAL_NAME;\n var CONTENT_NAME = \"ContextMenuContent\";\n var ContextMenuContent = createStyledHOC(Menu.Content, function(props, forwardedRef) {\n var { scope, ...contentProps } = props;\n var context = useContextMenuContext(scope);\n var hasInteractedOutsideRef = React.useRef(false);\n return /* @__PURE__ */ _jsx(Menu.Content, {\n id: context.contentId,\n \"aria-labelledby\": context.triggerId,\n scope: scope || CONTEXTMENU_CONTEXT,\n ...contentProps,\n ref: forwardedRef,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, function(event) {\n var _context_triggerRef_current;\n if (!hasInteractedOutsideRef.current) (_context_triggerRef_current = context.triggerRef.current) === null || _context_triggerRef_current === void 0 ? void 0 : _context_triggerRef_current.focus();\n hasInteractedOutsideRef.current = false;\n event.cancel();\n }),\n onInteractOutside: composeEventHandlers(props.onInteractOutside, function(event) {\n if (event.interaction !== \"pointer\" || !event.event) return;\n var originalEvent = event.event;\n var ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n var isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;\n })\n });\n });\n ContextMenuContent.displayName = CONTENT_NAME;\n var ITEM_NAME = \"ContextMenuItem\";\n var ContextMenuItem = createRefComponent(function(props, forwardedRef) {\n var { scope, className, ...itemProps } = props;\n return /* @__PURE__ */ _jsx(Menu.Item, {\n className: `is_${ITEM_NAME} ${className || \"\"}`.trim(),\n scope: scope || CONTEXTMENU_CONTEXT,\n ...itemProps,\n ref: forwardedRef\n });\n });\n ContextMenuItem.displayName = ITEM_NAME;\n var CHECKBOX_ITEM_NAME = \"ContextMenuCheckboxItem\";\n var ContextMenuCheckboxItem = createRefComponent(function(props, forwardedRef) {\n var { scope, className, ...checkboxItemProps } = props;\n return /* @__PURE__ */ _jsx(Menu.CheckboxItem, {\n className: `is_${CHECKBOX_ITEM_NAME} ${className || \"\"}`.trim(),\n scope: scope || CONTEXTMENU_CONTEXT,\n ...checkboxItemProps,\n ref: forwardedRef\n });\n });\n ContextMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n var RADIO_GROUP_NAME = \"ContextMenuRadioGroup\";\n var ContextMenuRadioGroup = createRefComponent(function(props, forwardedRef) {\n var { scope, ...radioGroupProps } = props;\n return /* @__PURE__ */ _jsx(Menu.RadioGroup, {\n scope: scope || CONTEXTMENU_CONTEXT,\n ...radioGroupProps,\n ref: forwardedRef\n });\n });\n ContextMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n var RADIO_ITEM_NAME = \"ContextMenuRadioItem\";\n var ContextMenuRadioItem = createRefComponent(function(props, forwardedRef) {\n var { scope, className, ...radioItemProps } = props;\n return /* @__PURE__ */ _jsx(Menu.RadioItem, {\n className: `is_${RADIO_ITEM_NAME} ${className || \"\"}`.trim(),\n scope: scope || CONTEXTMENU_CONTEXT,\n ...radioItemProps,\n ref: forwardedRef\n });\n });\n ContextMenuRadioItem.displayName = RADIO_ITEM_NAME;\n var INDICATOR_NAME = \"ContextMenuItemIndicator\";\n var ContextMenuItemIndicator = createStyledHOC(Menu.ItemIndicator, function(props, forwardedRef) {\n var { scope, className, ...itemIndicatorProps } = props;\n return /* @__PURE__ */ _jsx(Menu.ItemIndicator, {\n className: `is_${INDICATOR_NAME} ${className || \"\"}`.trim(),\n scope: scope || CONTEXTMENU_CONTEXT,\n ...itemIndicatorProps,\n ref: forwardedRef\n });\n });\n ContextMenuItemIndicator.displayName = INDICATOR_NAME;\n var SUB_NAME = \"ContextMenuSub\";\n var ContextMenuSub = function(props) {\n var { scope, children, onOpenChange, open: openProp, defaultOpen, ...rest } = props;\n var [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ _jsx(Menu.Sub, {\n scope: scope || CONTEXTMENU_CONTEXT,\n open,\n onOpenChange: setOpen,\n ...rest,\n children\n });\n };\n ContextMenuSub.displayName = SUB_NAME;\n var SUB_TRIGGER_NAME = \"ContextMenuSubTrigger\";\n var ContextMenuSubTrigger = createStyledHOC(View, function(props, forwardedRef) {\n var { scope, className, ...subTriggerProps } = props;\n return /* @__PURE__ */ _jsx(Menu.SubTrigger, {\n className: `is_${SUB_TRIGGER_NAME} ${className || \"\"}`.trim(),\n scope: scope || CONTEXTMENU_CONTEXT,\n ...subTriggerProps,\n ref: forwardedRef\n });\n });\n ContextMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n var SUB_CONTENT_NAME = \"ContextMenuSubContent\";\n var ContextMenuSubContent = createStyledHOC(Menu.SubContent, function(props, forwardedRef) {\n var { scope, ...subContentProps } = props;\n return /* @__PURE__ */ _jsx(Menu.SubContent, {\n scope: scope || CONTEXTMENU_CONTEXT,\n ...subContentProps,\n ref: forwardedRef,\n style: isWeb ? {\n ...props.style,\n ...{\n \"--tamagui-context-menu-content-transform-origin\": \"var(--tamagui-popper-transform-origin)\",\n \"--tamagui-context-menu-content-available-width\": \"var(--tamagui-popper-available-width)\",\n \"--tamagui-context-menu-content-available-height\": \"var(--tamagui-popper-available-height)\",\n \"--tamagui-context-menu-trigger-width\": \"var(--tamagui-popper-anchor-width)\",\n \"--tamagui-context-menu-trigger-height\": \"var(--tamagui-popper-anchor-height)\"\n }\n } : null\n });\n });\n ContextMenuSubContent.displayName = SUB_CONTENT_NAME;\n var ARROW_NAME = \"ContextMenuArrow\";\n var ContextMenuArrow = createRefComponent(function(props, forwardedRef) {\n var { scope, className, ...arrowProps } = props;\n return /* @__PURE__ */ _jsx(Menu.Arrow, {\n className: `is_${ARROW_NAME} ${className || \"\"}`.trim(),\n scope: scope || CONTEXTMENU_CONTEXT,\n ...arrowProps,\n ref: forwardedRef\n });\n });\n ContextMenuArrow.displayName = ARROW_NAME;\n var ContextMenuGroup = Menu.Group;\n var ContextMenuLabel = Menu.Label;\n var ContextMenuSeparator = Menu.Separator;\n var ContextMenuItemTitle = Menu.ItemTitle;\n var ContextMenuItemSubTitle = Menu.ItemSubtitle;\n var ContextMenuItemImage = Menu.ItemImage;\n var ContextMenuItemIcon = Menu.ItemIcon;\n var ContextMenuPreview = function() {\n return null;\n };\n return withStaticProperties(ContextMenuComp, {\n Root: ContextMenuComp,\n Trigger: ContextMenuTrigger,\n Portal: ContextMenuPortal,\n Content: ContextMenuContent,\n Group: ContextMenuGroup,\n Label: ContextMenuLabel,\n Item: ContextMenuItem,\n CheckboxItem: ContextMenuCheckboxItem,\n RadioGroup: ContextMenuRadioGroup,\n RadioItem: ContextMenuRadioItem,\n ItemIndicator: ContextMenuItemIndicator,\n Separator: ContextMenuSeparator,\n Arrow: ContextMenuArrow,\n Sub: ContextMenuSub,\n SubTrigger: ContextMenuSubTrigger,\n SubContent: ContextMenuSubContent,\n ItemTitle: ContextMenuItemTitle,\n ItemSubtitle: ContextMenuItemSubTitle,\n ItemIcon: ContextMenuItemIcon,\n ItemImage: ContextMenuItemImage,\n Preview: ContextMenuPreview\n });\n}\nexport {\n CONTEXTMENU_CONTEXT,\n createNonNativeContextMenu\n};\n//# sourceMappingURL=createNonNativeContextMenu.js.map\n"],"mappings":";;;;;;;;AAMA,SAAS,YAAY,MAAM,OAAO;CAChC,IAAI,SAAS,QAAQ,OAAO,WAAW,eAAe,MAAM,OAAO,cAAc;EAC/E,OAAO,CAAC,CAAC,MAAM,OAAO,aAAa,IAAI;CACzC,OAAO;EACL,OAAO,gBAAgB;CACzB;AACF;AACA,IAAI,sBAAsB;AAC1B,SAAS,6BAA6B;CACpC,IAAI,EAAE,SAAS,eAAe;CAC9B,IAAI,oBAAoB;CACxB,IAAI,EAAE,UAAU,qBAAqB,kBAAkB,0BAA0B,oBAAoB;CACrG,IAAI,kBAAkB,SAAS,OAAO;EACpC,IAAI,EAAE,OAAO,UAAU,cAAc,MAAM,UAAU,aAAa,KAAK,QAAQ,MAAM,GAAG,SAAS;EACjG,IAAI,CAAC,MAAM,WAAW,qBAAqB;GACzC,MAAM;GACN,aAAa,gBAAgB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AI,uBAAuB,KAAK;CAChC,IAAI,uBAAuB,KAAK;CAChC,IAAI,0BAA0B,KAAK;CACnC,IAAI,uBAAuB,KAAK;CAChC,IAAI,sBAAsB,KAAK;CAC/B,IAAI,qBAAqB,WAAW;EAClC,OAAO;CACT;CACA,OAAO,qBAAqB,iBAAiB;EAC3C,MAAM;EACN,SAAS;EACT,QAAQ;EACR,SAAS;EACT,OAAO;EACP,OAAO;EACP,MAAM;EACN,cAAc;EACd,YAAY;EACZ,WAAW;EACX,eAAe;EACf,WAAW;EACX,OAAO;EACP,KAAK;EACL,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,cAAc;EACd,UAAU;EACV,WAAW;EACX,SAAS;CACX,CAAC;AACH"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import { MenuPredefined } from "@tamagui/create-menu";
|
|
2
1
|
import { createContextMenu } from "./ContextMenu.mjs";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Indicator: MenuPredefined.MenuIndicator,
|
|
7
|
-
Item: MenuPredefined.MenuItem,
|
|
8
|
-
Label: MenuPredefined.MenuLabel,
|
|
9
|
-
MenuGroup: MenuPredefined.MenuGroup,
|
|
10
|
-
Separator: MenuPredefined.MenuSeparator,
|
|
11
|
-
SubTitle: MenuPredefined.SubTitle,
|
|
12
|
-
Title: MenuPredefined.Title
|
|
13
|
-
});
|
|
2
|
+
|
|
3
|
+
const ContextMenu = createContextMenu();
|
|
4
|
+
|
|
14
5
|
export { ContextMenu };
|
|
15
6
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["\nimport { createContextMenu } from \"./ContextMenu\";\nconst ContextMenu = createContextMenu();\nexport {\n ContextMenu\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AAEA,MAAM,cAAc,kBAAkB"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import { MenuPredefined } from "@tamagui/create-menu";
|
|
2
1
|
import { createContextMenu } from "./ContextMenu.mjs";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Indicator: MenuPredefined.MenuIndicator,
|
|
7
|
-
Item: MenuPredefined.MenuItem,
|
|
8
|
-
Label: MenuPredefined.MenuLabel,
|
|
9
|
-
MenuGroup: MenuPredefined.MenuGroup,
|
|
10
|
-
Separator: MenuPredefined.MenuSeparator,
|
|
11
|
-
SubTitle: MenuPredefined.SubTitle,
|
|
12
|
-
Title: MenuPredefined.Title
|
|
13
|
-
});
|
|
2
|
+
|
|
3
|
+
const ContextMenu = createContextMenu();
|
|
4
|
+
|
|
14
5
|
export { ContextMenu };
|
|
15
6
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["\nimport { createContextMenu } from \"./ContextMenu\";\nconst ContextMenu = createContextMenu();\nexport {\n ContextMenu\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AAEA,MAAM,cAAc,kBAAkB"}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import { MenuPredefined } from "@tamagui/create-menu";
|
|
2
1
|
import { createContextMenu } from "./ContextMenu.native.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Indicator: MenuPredefined.MenuIndicator,
|
|
7
|
-
Item: MenuPredefined.MenuItem,
|
|
8
|
-
Label: MenuPredefined.MenuLabel,
|
|
9
|
-
MenuGroup: MenuPredefined.MenuGroup,
|
|
10
|
-
Separator: MenuPredefined.MenuSeparator,
|
|
11
|
-
SubTitle: MenuPredefined.SubTitle,
|
|
12
|
-
Title: MenuPredefined.Title
|
|
13
|
-
});
|
|
2
|
+
|
|
3
|
+
var ContextMenu = createContextMenu();
|
|
4
|
+
|
|
14
5
|
export { ContextMenu };
|
|
15
6
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["esm/index.native.js"],"sourcesContent":["\nimport { createContextMenu } from \"./ContextMenu\";\nvar ContextMenu = createContextMenu();\nexport {\n ContextMenu\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AAEA,IAAI,cAAc,kBAAkB"}
|
package/dist/jsx/ContextMenu.mjs
CHANGED
|
@@ -2,148 +2,144 @@ import { createNativeMenu, withNativeMenu } from "@tamagui/create-menu";
|
|
|
2
2
|
import { withStaticProperties } from "@tamagui/web";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { CONTEXTMENU_CONTEXT, createNonNativeContextMenu } from "./createNonNativeContextMenu.mjs";
|
|
5
|
+
|
|
5
6
|
const COMMON_PARAMS = {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
isRoot: false,
|
|
8
|
+
scope: CONTEXTMENU_CONTEXT
|
|
8
9
|
};
|
|
9
|
-
function createContextMenu(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
// cast to React.FC to avoid TS error
|
|
142
|
-
ItemIcon,
|
|
143
|
-
ItemImage,
|
|
144
|
-
Preview
|
|
145
|
-
});
|
|
146
|
-
return ContextMenu;
|
|
10
|
+
function createContextMenu() {
|
|
11
|
+
const { Menu: NativeMenuRoot } = createNativeMenu("ContextMenu");
|
|
12
|
+
const NonNativeContextMenu = createNonNativeContextMenu();
|
|
13
|
+
const ContextMenuComp = withNativeMenu({
|
|
14
|
+
...COMMON_PARAMS,
|
|
15
|
+
Component: NonNativeContextMenu.Root,
|
|
16
|
+
NativeComponent: NativeMenuRoot,
|
|
17
|
+
isRoot: true
|
|
18
|
+
});
|
|
19
|
+
const Trigger = withNativeMenu({
|
|
20
|
+
...COMMON_PARAMS,
|
|
21
|
+
Component: NonNativeContextMenu.Trigger,
|
|
22
|
+
NativeComponent: NativeMenuRoot.Trigger
|
|
23
|
+
});
|
|
24
|
+
const Portal = withNativeMenu({
|
|
25
|
+
...COMMON_PARAMS,
|
|
26
|
+
Component: NonNativeContextMenu.Portal,
|
|
27
|
+
NativeComponent: React.Fragment
|
|
28
|
+
});
|
|
29
|
+
const Content = withNativeMenu({
|
|
30
|
+
...COMMON_PARAMS,
|
|
31
|
+
Component: NonNativeContextMenu.Content,
|
|
32
|
+
NativeComponent: NativeMenuRoot.Content
|
|
33
|
+
});
|
|
34
|
+
const Preview = withNativeMenu({
|
|
35
|
+
...COMMON_PARAMS,
|
|
36
|
+
Component: NonNativeContextMenu.Preview,
|
|
37
|
+
NativeComponent: NativeMenuRoot.Preview
|
|
38
|
+
});
|
|
39
|
+
const Group = withNativeMenu({
|
|
40
|
+
...COMMON_PARAMS,
|
|
41
|
+
Component: NonNativeContextMenu.Group,
|
|
42
|
+
NativeComponent: NativeMenuRoot.Group
|
|
43
|
+
});
|
|
44
|
+
const Label = withNativeMenu({
|
|
45
|
+
...COMMON_PARAMS,
|
|
46
|
+
Component: NonNativeContextMenu.Label,
|
|
47
|
+
NativeComponent: NativeMenuRoot.Label
|
|
48
|
+
});
|
|
49
|
+
const Item = withNativeMenu({
|
|
50
|
+
...COMMON_PARAMS,
|
|
51
|
+
Component: NonNativeContextMenu.Item,
|
|
52
|
+
NativeComponent: NativeMenuRoot.Item
|
|
53
|
+
});
|
|
54
|
+
const ItemTitle = withNativeMenu({
|
|
55
|
+
...COMMON_PARAMS,
|
|
56
|
+
Component: NonNativeContextMenu.ItemTitle,
|
|
57
|
+
NativeComponent: NativeMenuRoot.ItemTitle
|
|
58
|
+
});
|
|
59
|
+
const ItemSubtitle = withNativeMenu({
|
|
60
|
+
...COMMON_PARAMS,
|
|
61
|
+
Component: NonNativeContextMenu.ItemSubtitle,
|
|
62
|
+
NativeComponent: NativeMenuRoot.ItemSubtitle
|
|
63
|
+
});
|
|
64
|
+
const ItemIcon = withNativeMenu({
|
|
65
|
+
...COMMON_PARAMS,
|
|
66
|
+
Component: NonNativeContextMenu.ItemIcon,
|
|
67
|
+
NativeComponent: NativeMenuRoot.ItemIcon
|
|
68
|
+
});
|
|
69
|
+
const ItemImage = withNativeMenu({
|
|
70
|
+
...COMMON_PARAMS,
|
|
71
|
+
Component: NonNativeContextMenu.ItemImage,
|
|
72
|
+
NativeComponent: NativeMenuRoot.ItemImage
|
|
73
|
+
});
|
|
74
|
+
const CheckboxItem = withNativeMenu({
|
|
75
|
+
...COMMON_PARAMS,
|
|
76
|
+
Component: NonNativeContextMenu.CheckboxItem,
|
|
77
|
+
NativeComponent: NativeMenuRoot.CheckboxItem
|
|
78
|
+
});
|
|
79
|
+
const RadioGroup = withNativeMenu({
|
|
80
|
+
...COMMON_PARAMS,
|
|
81
|
+
Component: NonNativeContextMenu.RadioGroup,
|
|
82
|
+
NativeComponent: () => null
|
|
83
|
+
});
|
|
84
|
+
const RadioItem = withNativeMenu({
|
|
85
|
+
...COMMON_PARAMS,
|
|
86
|
+
Component: NonNativeContextMenu.RadioItem,
|
|
87
|
+
NativeComponent: ({ children }) => children
|
|
88
|
+
});
|
|
89
|
+
const ItemIndicator = withNativeMenu({
|
|
90
|
+
...COMMON_PARAMS,
|
|
91
|
+
Component: NonNativeContextMenu.ItemIndicator,
|
|
92
|
+
NativeComponent: NativeMenuRoot.ItemIndicator
|
|
93
|
+
});
|
|
94
|
+
const Separator = withNativeMenu({
|
|
95
|
+
...COMMON_PARAMS,
|
|
96
|
+
Component: NonNativeContextMenu.Separator,
|
|
97
|
+
NativeComponent: NativeMenuRoot.Separator
|
|
98
|
+
});
|
|
99
|
+
const Arrow = withNativeMenu({
|
|
100
|
+
...COMMON_PARAMS,
|
|
101
|
+
Component: NonNativeContextMenu.Arrow,
|
|
102
|
+
NativeComponent: NativeMenuRoot.Arrow
|
|
103
|
+
});
|
|
104
|
+
const Sub = withNativeMenu({
|
|
105
|
+
...COMMON_PARAMS,
|
|
106
|
+
Component: NonNativeContextMenu.Sub,
|
|
107
|
+
NativeComponent: NativeMenuRoot.Sub
|
|
108
|
+
});
|
|
109
|
+
const SubTrigger = withNativeMenu({
|
|
110
|
+
...COMMON_PARAMS,
|
|
111
|
+
Component: NonNativeContextMenu.SubTrigger,
|
|
112
|
+
NativeComponent: NativeMenuRoot.SubTrigger
|
|
113
|
+
});
|
|
114
|
+
const SubContent = withNativeMenu({
|
|
115
|
+
...COMMON_PARAMS,
|
|
116
|
+
Component: NonNativeContextMenu.SubContent,
|
|
117
|
+
NativeComponent: NativeMenuRoot.SubContent
|
|
118
|
+
});
|
|
119
|
+
const ContextMenu = withStaticProperties(ContextMenuComp, {
|
|
120
|
+
Trigger,
|
|
121
|
+
Portal,
|
|
122
|
+
Content,
|
|
123
|
+
Group,
|
|
124
|
+
Label,
|
|
125
|
+
Item,
|
|
126
|
+
CheckboxItem,
|
|
127
|
+
RadioGroup,
|
|
128
|
+
RadioItem,
|
|
129
|
+
ItemIndicator,
|
|
130
|
+
Separator,
|
|
131
|
+
Arrow,
|
|
132
|
+
Sub,
|
|
133
|
+
SubTrigger,
|
|
134
|
+
SubContent,
|
|
135
|
+
ItemTitle,
|
|
136
|
+
ItemSubtitle,
|
|
137
|
+
ItemIcon,
|
|
138
|
+
ItemImage,
|
|
139
|
+
Preview
|
|
140
|
+
});
|
|
141
|
+
return ContextMenu;
|
|
147
142
|
}
|
|
143
|
+
|
|
148
144
|
export { createContextMenu };
|
|
149
145
|
//# sourceMappingURL=ContextMenu.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"file":"ContextMenu.js","names":[],"sources":["jsx/ContextMenu.js"],"sourcesContent":["import { createNativeMenu, withNativeMenu } from \"@tamagui/create-menu\";\nimport { withStaticProperties } from \"@tamagui/web\";\nimport React from \"react\";\nimport {\n CONTEXTMENU_CONTEXT,\n createNonNativeContextMenu\n} from \"./createNonNativeContextMenu\";\nconst COMMON_PARAMS = {\n isRoot: false,\n scope: CONTEXTMENU_CONTEXT\n};\nfunction createContextMenu() {\n const { Menu: NativeMenuRoot } = createNativeMenu(\"ContextMenu\");\n const NonNativeContextMenu = createNonNativeContextMenu();\n const ContextMenuComp = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Root,\n NativeComponent: NativeMenuRoot,\n isRoot: true\n });\n const Trigger = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Trigger,\n NativeComponent: NativeMenuRoot.Trigger\n });\n const Portal = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Portal,\n NativeComponent: React.Fragment\n });\n const Content = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Content,\n NativeComponent: NativeMenuRoot.Content\n });\n const Preview = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Preview,\n NativeComponent: NativeMenuRoot.Preview\n });\n const Group = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Group,\n NativeComponent: NativeMenuRoot.Group\n });\n const Label = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Label,\n NativeComponent: NativeMenuRoot.Label\n });\n const Item = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Item,\n NativeComponent: NativeMenuRoot.Item\n });\n const ItemTitle = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.ItemTitle,\n NativeComponent: NativeMenuRoot.ItemTitle\n });\n const ItemSubtitle = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.ItemSubtitle,\n NativeComponent: NativeMenuRoot.ItemSubtitle\n });\n const ItemIcon = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.ItemIcon,\n NativeComponent: NativeMenuRoot.ItemIcon\n });\n const ItemImage = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.ItemImage,\n NativeComponent: NativeMenuRoot.ItemImage\n });\n const CheckboxItem = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.CheckboxItem,\n NativeComponent: NativeMenuRoot.CheckboxItem\n });\n const RadioGroup = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.RadioGroup,\n NativeComponent: () => null\n });\n const RadioItem = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.RadioItem,\n NativeComponent: ({ children }) => children\n });\n const ItemIndicator = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.ItemIndicator,\n NativeComponent: NativeMenuRoot.ItemIndicator\n });\n const Separator = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Separator,\n NativeComponent: NativeMenuRoot.Separator\n });\n const Arrow = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Arrow,\n NativeComponent: NativeMenuRoot.Arrow\n });\n const Sub = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Sub,\n NativeComponent: NativeMenuRoot.Sub\n });\n const SubTrigger = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.SubTrigger,\n NativeComponent: NativeMenuRoot.SubTrigger\n });\n const SubContent = withNativeMenu({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.SubContent,\n NativeComponent: NativeMenuRoot.SubContent\n });\n const ContextMenu = withStaticProperties(ContextMenuComp, {\n Trigger,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n // cast to React.FC to avoid TS error\n SubTrigger,\n SubContent,\n ItemTitle,\n ItemSubtitle,\n // cast to React.FC to avoid TS error\n ItemIcon,\n ItemImage,\n Preview\n });\n return ContextMenu;\n}\nexport {\n createContextMenu\n};\n//# sourceMappingURL=ContextMenu.js.map\n"],"mappings":";;;;;;AAOA,MAAM,gBAAgB;CACpB,QAAQ;CACR,OAAO;AACT;AACA,SAAS,oBAAoB;CAC3B,MAAM,EAAE,MAAM,mBAAmB,iBAAiB,aAAa;CAC/D,MAAM,uBAAuB,2BAA2B;CACxD,MAAM,kBAAkB,eAAe;EACrC,GAAG;EACH,WAAW,qBAAqB;EAChC,iBAAiB;EACjB,QAAQ;CACV,CAAC;CACD,MAAM,UAAU,eAAe;EAC7B,GAAG;EACH,WAAW,qBAAqB;EAChC,iBAAiB,eAAe;CAClC,CAAC;CACD,MAAM,SAAS,eAAe;EAC5B,GAAG;EACH,WAAW,qBAAqB;EAChC,iBAAiB,MAAM;CACzB,CAAC;CACD,MAAM,UAAU,eAAe;EAC7B,GAAG;EACH,WAAW,qBAAqB;EAChC,iBAAiB,eAAe;CAClC,CAAC;CACD,MAAM,UAAU,eAAe;EAC7B,GAAG;EACH,WAAW,qBAAqB;EAChC,iBAAiB,eAAe;CAClC,CAAC;CACD,MAAM,QAAQ,eAAe;EAC3B,GAAG;EACH,WAAW,qBAAqB;EAChC,iBAAiB,eAAe;CAClC,CAAC;CACD,MAAM,QAAQ,eAAe;EAC3B,GAAG;EACH,WAAW,qBAAqB;EAChC,iBAAiB,eAAe;CAClC,CAAC;CACD,MAAM,OAAO,eAAe;EAC1B,GAAG;EACH,WAAW,qBAAqB;EAChC,iBAAiB,eAAe;CAClC,CAAC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