@radix-ui/react-context-menu 2.0.1 → 2.0.2-rc.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/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export interface ContextMenuProps {
13
13
  export const ContextMenu: React.FC<ContextMenuProps>;
14
14
  type PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;
15
15
  export interface ContextMenuTriggerProps extends PrimitiveSpanProps {
16
+ disabled?: boolean;
16
17
  }
17
18
  export const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
18
19
  type MenuPortalProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Portal>;
@@ -1 +1 @@
1
- {"mappings":";;;;AAYA,iBAAiB,KAAK,GAAG,KAAK,CAAC;AAU/B,OAAA,6FAEE,CAAC;AAYH;IACE,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;IAC3B,YAAY,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,OAAA,MAAM,aAAa,MAAM,EAAE,CAAC,gBAAgB,CAgC3C,CAAC;AAWF,0BAA0B,MAAM,wBAAwB,CAAC,OAAO,UAAU,IAAI,CAAC,CAAC;AAChF,wCAAkC,SAAQ,kBAAkB;CAAG;AAE/D,OAAA,MAAM,mHAuDL,CAAC;AAUF,uBAAuB,MAAM,wBAAwB,CAAC,OAAO,cAAc,MAAM,CAAC,CAAC;AACnF,uCAAiC,SAAQ,eAAe;CAAG;AAE3D,OAAA,MAAM,mBAAmB,MAAM,EAAE,CAAC,sBAAsB,CAMvD,CAAC;AAWF,wBAAwB,MAAM,wBAAwB,CAAC,OAAO,cAAc,OAAO,CAAC,CAAC;AACrF,wCAAkC,SAAQ,IAAI,CAAC,gBAAg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AAQ,cAAc;CAAG;AAEzD,OAAA,MAAM,6GAML,CAAC;AAUF;IACE,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;CACpC;AAED,OAAA,MAAM,gBAAgB,MAAM,EAAE,CAAC,mBAAmB,CAcjD,CAAC;AAWF,2BAA2B,MAAM,wBAAwB,CAAC,OAAO,cAAc,UAAU,CAAC,CAAC;AAC3F,2CAAqC,SAAQ,mBAAmB;CAAG;AAEnE,OAAA,MAAM,wHAOJ,CAAC;AAWH,2BAA2B,MAAM,wBAAwB,CAAC,OAAO,cAAc,UAAU,CAAC,CAAC;AAC3F,2CAAqC,SAAQ,mBAAmB;CAAG;AAEnE,OAAA,MAAM,wHAoBJ,CAAC;AAUH,OAAA,MAAM,gCAAkB,CAAC;AACzB,OAAA,MAAM,wGAA4B,CAAC;AACnC,OAAA,MAAM,wCAA0B,CAAC;AACjC,OAAA,MAAM,uGAA4B,CAAC;AACnC,OAAA,MAAM,mGAAwB,CAAC;AAC/B,OAAA,MAAM,mGAAwB,CAAC;AAC/B,OAAA,MAAM,iGAAsB,CAAC;AAC7B,OAAA,MAAM,iHAAsC,CAAC;AAC7C,OAAA,MAAM,6GAAkC,CAAC;AACzC,OAAA,MAAM,2GAAgC,CAAC;AACvC,OAAA,MAAM,oHAAwC,CAAC;AAC/C,OAAA,MAAM,2GAAgC,CAAC;AACvC,OAAA,MAAM,kGAAwB,CAAC;AAC/B,OAAA,MAAM,kCAAoB,CAAC;AAC3B,OAAA,MAAM,6GAAkC,CAAC;AACzC,OAAA,MAAM,6GAAkC,CAAC","sources":["packages/react/context-menu/src/packages/react/context-menu/src/ContextMenu.tsx","packages/react/context-menu/src/packages/react/context-menu/src/index.ts","packages/react/context-menu/src/index.ts"],"sourcesContent":[null,null,"export {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuPortal,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n ContextMenuSub,\n ContextMenuSubTrigger,\n ContextMenuSubContent,\n //\n Root,\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 SubTrigger,\n SubContent,\n} from './ContextMenu';\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuPortalProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n ContextMenuSubProps,\n ContextMenuSubTriggerProps,\n ContextMenuSubContentProps,\n} from './ContextMenu';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
1
+ {"mappings":";;;;AAYA,iBAAiB,KAAK,GAAG,KAAK,CAAC;AAU/B,OAAA,6FAEE,CAAC;AAYH;IACE,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;IAC3B,YAAY,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,OAAA,MAAM,aAAa,MAAM,EAAE,CAAC,gBAAgB,CAgC3C,CAAC;AAWF,0BAA0B,MAAM,wBAAwB,CAAC,OAAO,UAAU,IAAI,CAAC,CAAC;AAChF,wCAAkC,SAAQ,kBAAkB;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,OAAA,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C,OAAA,MAAM,2GAAgC,CAAC;AACvC,OAAA,MAAM,kGAAwB,CAAC;AAC/B,OAAA,MAAM,kCAAoB,CAAC;AAC3B,OAAA,MAAM,6GAAkC,CAAC;AACzC,OAAA,MAAM,6GAAkC,CAAC","sources":["packages/react/context-menu/src/packages/react/context-menu/src/ContextMenu.tsx","packages/react/context-menu/src/packages/react/context-menu/src/index.ts","packages/react/context-menu/src/index.ts"],"sourcesContent":[null,null,"export {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuPortal,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n ContextMenuSub,\n ContextMenuSubTrigger,\n ContextMenuSubContent,\n //\n Root,\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 SubTrigger,\n SubContent,\n} from './ContextMenu';\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuPortalProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n ContextMenuSubProps,\n ContextMenuSubTriggerProps,\n ContextMenuSubContentProps,\n} from './ContextMenu';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
package/dist/index.js CHANGED
@@ -94,7 +94,7 @@ const $5de197f6cd80e8e9$export$8dc6765e8be191c7 = (props)=>{
94
94
  * ContextMenuTrigger
95
95
  * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$TRIGGER_NAME = 'ContextMenuTrigger';
96
96
  const $5de197f6cd80e8e9$export$be6fc7b1d5b0beb9 = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
97
- const { __scopeContextMenu: __scopeContextMenu , ...triggerProps } = props;
97
+ const { __scopeContextMenu: __scopeContextMenu , disabled: disabled = false , ...triggerProps } = props;
98
98
  const context = $5de197f6cd80e8e9$var$useContextMenuContext($5de197f6cd80e8e9$var$TRIGGER_NAME, __scopeContextMenu);
99
99
  const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
100
100
  const pointRef = $l8XVT$react.useRef({
@@ -122,33 +122,40 @@ const $5de197f6cd80e8e9$export$be6fc7b1d5b0beb9 = /*#__PURE__*/ $l8XVT$react.for
122
122
  , [
123
123
  clearLongPress
124
124
  ]);
125
+ $l8XVT$react.useEffect(()=>void (disabled && clearLongPress())
126
+ , [
127
+ disabled,
128
+ clearLongPress
129
+ ]);
125
130
  return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$react.Fragment, null, /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Anchor, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, {
126
131
  virtualRef: virtualRef
127
132
  })), /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactprimitive.Primitive.span, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({
128
- "data-state": context.open ? 'open' : 'closed'
133
+ "data-state": context.open ? 'open' : 'closed',
134
+ "data-disabled": disabled ? '' : undefined
129
135
  }, triggerProps, {
130
136
  ref: forwardedRef // prevent iOS context menu from appearing
131
137
  ,
132
138
  style: {
133
139
  WebkitTouchCallout: 'none',
134
140
  ...props.style
135
- },
136
- onContextMenu: $l8XVT$radixuiprimitive.composeEventHandlers(props.onContextMenu, (event)=>{
141
+ } // if trigger is disabled, enable the native Context Menu
142
+ ,
143
+ onContextMenu: disabled ? props.onContextMenu : $l8XVT$radixuiprimitive.composeEventHandlers(props.onContextMenu, (event)=>{
137
144
  // clearing the long press here because some platforms already support
138
145
  // long press to trigger a `contextmenu` event
139
146
  clearLongPress();
140
147
  handleOpen(event);
141
148
  event.preventDefault();
142
149
  }),
143
- onPointerDown: $l8XVT$radixuiprimitive.composeEventHandlers(props.onPointerDown, $5de197f6cd80e8e9$var$whenTouchOrPen((event)=>{
150
+ onPointerDown: disabled ? props.onPointerDown : $l8XVT$radixuiprimitive.composeEventHandlers(props.onPointerDown, $5de197f6cd80e8e9$var$whenTouchOrPen((event)=>{
144
151
  // clear the long press here in case there's multiple touch points
145
152
  clearLongPress();
146
153
  longPressTimerRef.current = window.setTimeout(()=>handleOpen(event)
147
154
  , 700);
148
155
  })),
149
- onPointerMove: $l8XVT$radixuiprimitive.composeEventHandlers(props.onPointerMove, $5de197f6cd80e8e9$var$whenTouchOrPen(clearLongPress)),
150
- onPointerCancel: $l8XVT$radixuiprimitive.composeEventHandlers(props.onPointerCancel, $5de197f6cd80e8e9$var$whenTouchOrPen(clearLongPress)),
151
- onPointerUp: $l8XVT$radixuiprimitive.composeEventHandlers(props.onPointerUp, $5de197f6cd80e8e9$var$whenTouchOrPen(clearLongPress))
156
+ onPointerMove: disabled ? props.onPointerMove : $l8XVT$radixuiprimitive.composeEventHandlers(props.onPointerMove, $5de197f6cd80e8e9$var$whenTouchOrPen(clearLongPress)),
157
+ onPointerCancel: disabled ? props.onPointerCancel : $l8XVT$radixuiprimitive.composeEventHandlers(props.onPointerCancel, $5de197f6cd80e8e9$var$whenTouchOrPen(clearLongPress)),
158
+ onPointerUp: disabled ? props.onPointerUp : $l8XVT$radixuiprimitive.composeEventHandlers(props.onPointerUp, $5de197f6cd80e8e9$var$whenTouchOrPen(clearLongPress))
152
159
  })));
153
160
  });
154
161
  /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$be6fc7b1d5b0beb9, {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;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,CAAAA,KAAD,GAAYA,KAAK,CAACmD,WAAN,KAAsB,OAAtB,GAAgCD,OAAO,CAAClD,KAAD,CAAvC,GAAiDoD,SAApE;IAAA,CAAA;CACD;AAED,MAAMnH,yCAAI,GAAGhB,yCAAb,AAAA;AACA,MAAMiB,yCAAO,GAAGhB,yCAAhB,AAAA;AACA,MAAMiB,yCAAM,GAAGhB,yCAAf,AAAA;AACA,MAAMiB,yCAAO,GAAGhB,wCAAhB,AAAA;AACA,MAAMiB,yCAAK,GAAGhB,yCAAd,AAAA;AACA,MAAMiB,yCAAK,GAAGhB,yCAAd,AAAA;AACA,MAAMiB,yCAAI,GAAGhB,yCAAb,AAAA;AACA,MAAMiB,yCAAY,GAAGhB,yCAArB,AAAA;AACA,MAAMiB,yCAAU,GAAGhB,yCAAnB,AAAA;AACA,MAAMiB,yCAAS,GAAGhB,yCAAlB,AAAA;AACA,MAAMiB,yCAAa,GAAGhB,yCAAtB,AAAA;AACA,MAAMiB,yCAAS,GAAGhB,yCAAlB,AAAA;AACA,MAAMiB,yCAAK,GAAGhB,yCAAd,AAAA;AACA,MAAMiB,yCAAG,GAAGhB,yCAAZ,AAAA;AACA,MAAMiB,yCAAU,GAAGhB,yCAAnB,AAAA;AACA,MAAMiB,yCAAU,GAAGhB,yCAAnB,AAAA;;AD/fA","sources":["packages/react/context-menu/src/index.ts","packages/react/context-menu/src/ContextMenu.tsx"],"sourcesContent":["export {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuPortal,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n ContextMenuSub,\n ContextMenuSubTrigger,\n ContextMenuSubContent,\n //\n Root,\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 SubTrigger,\n SubContent,\n} from './ContextMenu';\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuPortalProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n ContextMenuSubProps,\n ContextMenuSubTriggerProps,\n ContextMenuSubContentProps,\n} from './ContextMenu';\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\ntype Point = { x: number; y: number };\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTEXT_MENU_NAME = 'ContextMenu';\n\ntype ScopedProps<P> = P & { __scopeContextMenu?: Scope };\nconst [createContextMenuContext, createContextMenuScope] = createContextScope(CONTEXT_MENU_NAME, [\n createMenuScope,\n]);\nconst useMenuScope = createMenuScope();\n\ntype ContextMenuContextValue = {\n open: boolean;\n onOpenChange(open: boolean): void;\n modal: boolean;\n};\n\nconst [ContextMenuProvider, useContextMenuContext] =\n createContextMenuContext<ContextMenuContextValue>(CONTEXT_MENU_NAME);\n\ninterface ContextMenuProps {\n children?: React.ReactNode;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n}\n\nconst ContextMenu: React.FC<ContextMenuProps> = (props: ScopedProps<ContextMenuProps>) => {\n const { __scopeContextMenu, children, onOpenChange, dir, modal = true } = props;\n const [open, setOpen] = React.useState(false);\n const menuScope = useMenuScope(__scopeContextMenu);\n const handleOpenChangeProp = useCallbackRef(onOpenChange);\n\n const handleOpenChange = React.useCallback(\n (open: boolean) => {\n setOpen(open);\n handleOpenChangeProp(open);\n },\n [handleOpenChangeProp]\n );\n\n return (\n <ContextMenuProvider\n scope={__scopeContextMenu}\n open={open}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n <MenuPrimitive.Root\n {...menuScope}\n dir={dir}\n open={open}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n {children}\n </MenuPrimitive.Root>\n </ContextMenuProvider>\n );\n};\n\nContextMenu.displayName = CONTEXT_MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'ContextMenuTrigger';\n\ntype ContextMenuTriggerElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface ContextMenuTriggerProps extends PrimitiveSpanProps {}\n\nconst ContextMenuTrigger = React.forwardRef<ContextMenuTriggerElement, ContextMenuTriggerProps>(\n (props: ScopedProps<ContextMenuTriggerProps>, forwardedRef) => {\n const { __scopeContextMenu, ...triggerProps } = props;\n const context = useContextMenuContext(TRIGGER_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const pointRef = React.useRef<Point>({ x: 0, y: 0 });\n const virtualRef = React.useRef({\n getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...pointRef.current }),\n });\n const longPressTimerRef = React.useRef(0);\n const clearLongPress = React.useCallback(\n () => window.clearTimeout(longPressTimerRef.current),\n []\n );\n const handleOpen = (event: React.MouseEvent | React.PointerEvent) => {\n pointRef.current = { x: event.clientX, y: event.clientY };\n context.onOpenChange(true);\n };\n\n React.useEffect(() => clearLongPress, [clearLongPress]);\n\n return (\n <>\n <MenuPrimitive.Anchor {...menuScope} virtualRef={virtualRef} />\n <Primitive.span\n data-state={context.open ? 'open' : 'closed'}\n {...triggerProps}\n ref={forwardedRef}\n // prevent iOS context menu from appearing\n style={{ WebkitTouchCallout: 'none', ...props.style }}\n onContextMenu={composeEventHandlers(props.onContextMenu, (event) => {\n // clearing the long press here because some platforms already support\n // long press to trigger a `contextmenu` event\n clearLongPress();\n handleOpen(event);\n event.preventDefault();\n })}\n onPointerDown={composeEventHandlers(\n props.onPointerDown,\n whenTouchOrPen((event) => {\n // clear the long press here in case there's multiple touch points\n clearLongPress();\n longPressTimerRef.current = window.setTimeout(() => handleOpen(event), 700);\n })\n )}\n onPointerMove={composeEventHandlers(props.onPointerMove, whenTouchOrPen(clearLongPress))}\n onPointerCancel={composeEventHandlers(\n props.onPointerCancel,\n whenTouchOrPen(clearLongPress)\n )}\n onPointerUp={composeEventHandlers(props.onPointerUp, whenTouchOrPen(clearLongPress))}\n />\n </>\n );\n }\n);\n\nContextMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'ContextMenuPortal';\n\ntype MenuPortalProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Portal>;\ninterface ContextMenuPortalProps extends MenuPortalProps {}\n\nconst ContextMenuPortal: React.FC<ContextMenuPortalProps> = (\n props: ScopedProps<ContextMenuPortalProps>\n) => {\n const { __scopeContextMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Portal {...menuScope} {...portalProps} />;\n};\n\nContextMenuPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'ContextMenuContent';\n\ntype ContextMenuContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;\ninterface ContextMenuContentProps extends Omit<MenuContentProps, 'side' | 'sideOffset' | 'align'> {}\n\nconst ContextMenuContent = React.forwardRef<ContextMenuContentElement, ContextMenuContentProps>(\n (props: ScopedProps<ContextMenuContentProps>, forwardedRef) => {\n const { __scopeContextMenu, ...contentProps } = props;\n const context = useContextMenuContext(CONTENT_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n <MenuPrimitive.Content\n {...menuScope}\n {...contentProps}\n ref={forwardedRef}\n side=\"right\"\n sideOffset={2}\n align=\"start\"\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented && hasInteractedOutsideRef.current) {\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented && !context.modal) hasInteractedOutsideRef.current = true;\n }}\n style={{\n ...props.style,\n // re-namespace exposed content custom property\n ['--radix-context-menu-content-transform-origin' as any]:\n 'var(--radix-popper-transform-origin)',\n }}\n />\n );\n }\n);\n\nContextMenuContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'ContextMenuGroup';\n\ntype ContextMenuGroupElement = React.ElementRef<typeof MenuPrimitive.Group>;\ntype MenuGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>;\ninterface ContextMenuGroupProps extends MenuGroupProps {}\n\nconst ContextMenuGroup = React.forwardRef<ContextMenuGroupElement, ContextMenuGroupProps>(\n (props: ScopedProps<ContextMenuGroupProps>, forwardedRef) => {\n const { __scopeContextMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Group {...menuScope} {...groupProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'ContextMenuLabel';\n\ntype ContextMenuLabelElement = React.ElementRef<typeof MenuPrimitive.Label>;\ntype MenuLabelProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Label>;\ninterface ContextMenuLabelProps extends MenuLabelProps {}\n\nconst ContextMenuLabel = React.forwardRef<ContextMenuLabelElement, ContextMenuLabelProps>(\n (props: ScopedProps<ContextMenuLabelProps>, forwardedRef) => {\n const { __scopeContextMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Label {...menuScope} {...labelProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'ContextMenuItem';\n\ntype ContextMenuItemElement = React.ElementRef<typeof MenuPrimitive.Item>;\ntype MenuItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Item>;\ninterface ContextMenuItemProps extends MenuItemProps {}\n\nconst ContextMenuItem = React.forwardRef<ContextMenuItemElement, ContextMenuItemProps>(\n (props: ScopedProps<ContextMenuItemProps>, forwardedRef) => {\n const { __scopeContextMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Item {...menuScope} {...itemProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'ContextMenuCheckboxItem';\n\ntype ContextMenuCheckboxItemElement = React.ElementRef<typeof MenuPrimitive.CheckboxItem>;\ntype MenuCheckboxItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>;\ninterface ContextMenuCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n ContextMenuCheckboxItemElement,\n ContextMenuCheckboxItemProps\n>((props: ScopedProps<ContextMenuCheckboxItemProps>, forwardedRef) => {\n const { __scopeContextMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.CheckboxItem {...menuScope} {...checkboxItemProps} ref={forwardedRef} />;\n});\n\nContextMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'ContextMenuRadioGroup';\n\ntype ContextMenuRadioGroupElement = React.ElementRef<typeof MenuPrimitive.RadioGroup>;\ntype MenuRadioGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioGroup>;\ninterface ContextMenuRadioGroupProps extends MenuRadioGroupProps {}\n\nconst ContextMenuRadioGroup = React.forwardRef<\n ContextMenuRadioGroupElement,\n ContextMenuRadioGroupProps\n>((props: ScopedProps<ContextMenuRadioGroupProps>, forwardedRef) => {\n const { __scopeContextMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.RadioGroup {...menuScope} {...radioGroupProps} ref={forwardedRef} />;\n});\n\nContextMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'ContextMenuRadioItem';\n\ntype ContextMenuRadioItemElement = React.ElementRef<typeof MenuPrimitive.RadioItem>;\ntype MenuRadioItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioItem>;\ninterface ContextMenuRadioItemProps extends MenuRadioItemProps {}\n\nconst ContextMenuRadioItem = React.forwardRef<\n ContextMenuRadioItemElement,\n ContextMenuRadioItemProps\n>((props: ScopedProps<ContextMenuRadioItemProps>, forwardedRef) => {\n const { __scopeContextMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.RadioItem {...menuScope} {...radioItemProps} ref={forwardedRef} />;\n});\n\nContextMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ContextMenuItemIndicator';\n\ntype ContextMenuItemIndicatorElement = React.ElementRef<typeof MenuPrimitive.ItemIndicator>;\ntype MenuItemIndicatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.ItemIndicator>;\ninterface ContextMenuItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst ContextMenuItemIndicator = React.forwardRef<\n ContextMenuItemIndicatorElement,\n ContextMenuItemIndicatorProps\n>((props: ScopedProps<ContextMenuItemIndicatorProps>, forwardedRef) => {\n const { __scopeContextMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.ItemIndicator {...menuScope} {...itemIndicatorProps} ref={forwardedRef} />;\n});\n\nContextMenuItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'ContextMenuSeparator';\n\ntype ContextMenuSeparatorElement = React.ElementRef<typeof MenuPrimitive.Separator>;\ntype MenuSeparatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Separator>;\ninterface ContextMenuSeparatorProps extends MenuSeparatorProps {}\n\nconst ContextMenuSeparator = React.forwardRef<\n ContextMenuSeparatorElement,\n ContextMenuSeparatorProps\n>((props: ScopedProps<ContextMenuSeparatorProps>, forwardedRef) => {\n const { __scopeContextMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Separator {...menuScope} {...separatorProps} ref={forwardedRef} />;\n});\n\nContextMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'ContextMenuArrow';\n\ntype ContextMenuArrowElement = React.ElementRef<typeof MenuPrimitive.Arrow>;\ntype MenuArrowProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Arrow>;\ninterface ContextMenuArrowProps extends MenuArrowProps {}\n\nconst ContextMenuArrow = React.forwardRef<ContextMenuArrowElement, ContextMenuArrowProps>(\n (props: ScopedProps<ContextMenuArrowProps>, forwardedRef) => {\n const { __scopeContextMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Arrow {...menuScope} {...arrowProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'ContextMenuSub';\n\ninterface ContextMenuSubProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst ContextMenuSub: React.FC<ContextMenuSubProps> = (props: ScopedProps<ContextMenuSubProps>) => {\n const { __scopeContextMenu, children, onOpenChange, open: openProp, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n <MenuPrimitive.Sub {...menuScope} open={open} onOpenChange={setOpen}>\n {children}\n </MenuPrimitive.Sub>\n );\n};\n\nContextMenuSub.displayName = SUB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'ContextMenuSubTrigger';\n\ntype ContextMenuSubTriggerElement = React.ElementRef<typeof MenuPrimitive.SubTrigger>;\ntype MenuSubTriggerProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;\ninterface ContextMenuSubTriggerProps extends MenuSubTriggerProps {}\n\nconst ContextMenuSubTrigger = React.forwardRef<\n ContextMenuSubTriggerElement,\n ContextMenuSubTriggerProps\n>((props: ScopedProps<ContextMenuSubTriggerProps>, forwardedRef) => {\n const { __scopeContextMenu, ...triggerItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.SubTrigger {...menuScope} {...triggerItemProps} ref={forwardedRef} />;\n});\n\nContextMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'ContextMenuSubContent';\n\ntype ContextMenuSubContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuSubContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubContent>;\ninterface ContextMenuSubContentProps extends MenuSubContentProps {}\n\nconst ContextMenuSubContent = React.forwardRef<\n ContextMenuSubContentElement,\n ContextMenuSubContentProps\n>((props: ScopedProps<ContextMenuSubContentProps>, forwardedRef) => {\n const { __scopeContextMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n\n return (\n <MenuPrimitive.SubContent\n {...menuScope}\n {...subContentProps}\n ref={forwardedRef}\n style={{\n ...props.style,\n // re-namespace exposed content custom property\n ['--radix-context-menu-content-transform-origin' as any]:\n 'var(--radix-popper-transform-origin)',\n }}\n />\n );\n});\n\nContextMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction whenTouchOrPen<E>(handler: React.PointerEventHandler<E>): React.PointerEventHandler<E> {\n return (event) => (event.pointerType !== 'mouse' ? handler(event) : undefined);\n}\n\nconst Root = ContextMenu;\nconst Trigger = ContextMenuTrigger;\nconst Portal = ContextMenuPortal;\nconst Content = ContextMenuContent;\nconst Group = ContextMenuGroup;\nconst Label = ContextMenuLabel;\nconst Item = ContextMenuItem;\nconst CheckboxItem = ContextMenuCheckboxItem;\nconst RadioGroup = ContextMenuRadioGroup;\nconst RadioItem = ContextMenuRadioItem;\nconst ItemIndicator = ContextMenuItemIndicator;\nconst Separator = ContextMenuSeparator;\nconst Arrow = ContextMenuArrow;\nconst Sub = ContextMenuSub;\nconst SubTrigger = ContextMenuSubTrigger;\nconst SubContent = ContextMenuSubContent;\n\nexport {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuPortal,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n ContextMenuSub,\n ContextMenuSubTrigger,\n ContextMenuSubContent,\n //\n Root,\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 SubTrigger,\n SubContent,\n};\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuPortalProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n ContextMenuSubProps,\n ContextMenuSubTriggerProps,\n ContextMenuSubContentProps,\n};\n"],"names":["createContextMenuScope","ContextMenu","ContextMenuTrigger","ContextMenuPortal","ContextMenuContent","ContextMenuGroup","ContextMenuLabel","ContextMenuItem","ContextMenuCheckboxItem","ContextMenuRadioGroup","ContextMenuRadioItem","ContextMenuItemIndicator","ContextMenuSeparator","ContextMenuArrow","ContextMenuSub","ContextMenuSubTrigger","ContextMenuSubContent","Root","Trigger","Portal","Content","Group","Label","Item","CheckboxItem","RadioGroup","RadioItem","ItemIndicator","Separator","Arrow","Sub","SubTrigger","SubContent","React","composeEventHandlers","createContextScope","Primitive","MenuPrimitive","createMenuScope","useCallbackRef","useControllableState","CONTEXT_MENU_NAME","createContextMenuContext","useMenuScope","ContextMenuProvider","useContextMenuContext","props","__scopeContextMenu","children","onOpenChange","dir","modal","open","setOpen","useState","menuScope","handleOpenChangeProp","handleOpenChange","useCallback","TRIGGER_NAME","forwardRef","forwardedRef","triggerProps","context","pointRef","useRef","x","y","virtualRef","getBoundingClientRect","DOMRect","fromRect","width","height","current","longPressTimerRef","clearLongPress","window","clearTimeout","handleOpen","event","clientX","clientY","useEffect","WebkitTouchCallout","style","onContextMenu","preventDefault","onPointerDown","whenTouchOrPen","setTimeout","onPointerMove","onPointerCancel","onPointerUp","PORTAL_NAME","portalProps","CONTENT_NAME","contentProps","hasInteractedOutsideRef","onCloseAutoFocus","defaultPrevented","onInteractOutside","GROUP_NAME","groupProps","LABEL_NAME","labelProps","ITEM_NAME","itemProps","CHECKBOX_ITEM_NAME","checkboxItemProps","RADIO_GROUP_NAME","radioGroupProps","RADIO_ITEM_NAME","radioItemProps","INDICATOR_NAME","itemIndicatorProps","SEPARATOR_NAME","separatorProps","ARROW_NAME","arrowProps","SUB_NAME","openProp","defaultOpen","prop","defaultProp","onChange","SUB_TRIGGER_NAME","triggerItemProps","SUB_CONTENT_NAME","subContentProps","handler","pointerType","undefined"],"version":3,"file":"index.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;ACeA;;oGAEA,CAEA,MAAMyC,uCAAiB,GAAG,aAA1B,AAAA;AAGA,MAAM,CAACC,8CAAD,EAA2B1C,yCAA3B,CAAA,GAAqDmC,6CAAkB,CAACM,uCAAD,EAAoB;IAC/F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E;YACL,GAAGf,KAAK,CAACyC,KADJ;YAEL,+CAAA;YACA,CAAC,+CAAD,CAAA,EACE,sCADF;SAHK;KAJT,CAAA,CADF,CACE;CAR0B,CAA9B,AAoBC;AAED,aAAA,CAAA,MAAA,CAAA,MAAA,CAAA,yCAAA,EAAA;IAAA,WAAA,EAAA,sCAAA;CAAA,CAAA,CAAA;AAEA,oGAAA,CAEA,SAASI,oCAAT,CAA2ByC,OAA3B,EAAgG;IAC9F,OAAQnD,CAAAA,KAAD,GAAYA,KAAK,CAACoD,WAAN,KAAsB,OAAtB,GAAgCD,OAAO,CAACnD,KAAD,CAAvC,GAAiDI,SAApE;IAAA,CAAA;CACD;AAED,MAAMpE,yCAAI,GAAGhB,yCAAb,AAAA;AACA,MAAMiB,yCAAO,GAAGhB,yCAAhB,AAAA;AACA,MAAMiB,yCAAM,GAAGhB,yCAAf,AAAA;AACA,MAAMiB,yCAAO,GAAGhB,wCAAhB,AAAA;AACA,MAAMiB,yCAAK,GAAGhB,yCAAd,AAAA;AACA,MAAMiB,yCAAK,GAAGhB,yCAAd,AAAA;AACA,MAAMiB,yCAAI,GAAGhB,yCAAb,AAAA;AACA,MAAMiB,yCAAY,GAAGhB,yCAArB,AAAA;AACA,MAAMiB,yCAAU,GAAGhB,yCAAnB,AAAA;AACA,MAAMiB,yCAAS,GAAGhB,yCAAlB,AAAA;AACA,MAAMiB,yCAAa,GAAGhB,yCAAtB,AAAA;AACA,MAAMiB,yCAAS,GAAGhB,yCAAlB,AAAA;AACA,MAAMiB,yCAAK,GAAGhB,yCAAd,AAAA;AACA,MAAMiB,yCAAG,GAAGhB,yCAAZ,AAAA;AACA,MAAMiB,yCAAU,GAAGhB,yCAAnB,AAAA;AACA,MAAMiB,yCAAU,GAAGhB,yCAAnB,AAAA;;ADrhBA","sources":["packages/react/context-menu/src/index.ts","packages/react/context-menu/src/ContextMenu.tsx"],"sourcesContent":["export {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuPortal,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n ContextMenuSub,\n ContextMenuSubTrigger,\n ContextMenuSubContent,\n //\n Root,\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 SubTrigger,\n SubContent,\n} from './ContextMenu';\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuPortalProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n ContextMenuSubProps,\n ContextMenuSubTriggerProps,\n ContextMenuSubContentProps,\n} from './ContextMenu';\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\ntype Point = { x: number; y: number };\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTEXT_MENU_NAME = 'ContextMenu';\n\ntype ScopedProps<P> = P & { __scopeContextMenu?: Scope };\nconst [createContextMenuContext, createContextMenuScope] = createContextScope(CONTEXT_MENU_NAME, [\n createMenuScope,\n]);\nconst useMenuScope = createMenuScope();\n\ntype ContextMenuContextValue = {\n open: boolean;\n onOpenChange(open: boolean): void;\n modal: boolean;\n};\n\nconst [ContextMenuProvider, useContextMenuContext] =\n createContextMenuContext<ContextMenuContextValue>(CONTEXT_MENU_NAME);\n\ninterface ContextMenuProps {\n children?: React.ReactNode;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n}\n\nconst ContextMenu: React.FC<ContextMenuProps> = (props: ScopedProps<ContextMenuProps>) => {\n const { __scopeContextMenu, children, onOpenChange, dir, modal = true } = props;\n const [open, setOpen] = React.useState(false);\n const menuScope = useMenuScope(__scopeContextMenu);\n const handleOpenChangeProp = useCallbackRef(onOpenChange);\n\n const handleOpenChange = React.useCallback(\n (open: boolean) => {\n setOpen(open);\n handleOpenChangeProp(open);\n },\n [handleOpenChangeProp]\n );\n\n return (\n <ContextMenuProvider\n scope={__scopeContextMenu}\n open={open}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n <MenuPrimitive.Root\n {...menuScope}\n dir={dir}\n open={open}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n {children}\n </MenuPrimitive.Root>\n </ContextMenuProvider>\n );\n};\n\nContextMenu.displayName = CONTEXT_MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'ContextMenuTrigger';\n\ntype ContextMenuTriggerElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface ContextMenuTriggerProps extends PrimitiveSpanProps {\n disabled?: boolean;\n}\n\nconst ContextMenuTrigger = React.forwardRef<ContextMenuTriggerElement, ContextMenuTriggerProps>(\n (props: ScopedProps<ContextMenuTriggerProps>, forwardedRef) => {\n const { __scopeContextMenu, disabled = false, ...triggerProps } = props;\n const context = useContextMenuContext(TRIGGER_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const pointRef = React.useRef<Point>({ x: 0, y: 0 });\n const virtualRef = React.useRef({\n getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...pointRef.current }),\n });\n const longPressTimerRef = React.useRef(0);\n const clearLongPress = React.useCallback(\n () => window.clearTimeout(longPressTimerRef.current),\n []\n );\n const handleOpen = (event: React.MouseEvent | React.PointerEvent) => {\n pointRef.current = { x: event.clientX, y: event.clientY };\n context.onOpenChange(true);\n };\n\n React.useEffect(() => clearLongPress, [clearLongPress]);\n React.useEffect(() => void (disabled && clearLongPress()), [disabled, clearLongPress]);\n\n return (\n <>\n <MenuPrimitive.Anchor {...menuScope} virtualRef={virtualRef} />\n <Primitive.span\n data-state={context.open ? 'open' : 'closed'}\n data-disabled={disabled ? '' : undefined}\n {...triggerProps}\n ref={forwardedRef}\n // prevent iOS context menu from appearing\n style={{ WebkitTouchCallout: 'none', ...props.style }}\n // if trigger is disabled, enable the native Context Menu\n onContextMenu={\n disabled\n ? props.onContextMenu\n : composeEventHandlers(props.onContextMenu, (event) => {\n // clearing the long press here because some platforms already support\n // long press to trigger a `contextmenu` event\n clearLongPress();\n handleOpen(event);\n event.preventDefault();\n })\n }\n onPointerDown={\n disabled\n ? props.onPointerDown\n : composeEventHandlers(\n props.onPointerDown,\n whenTouchOrPen((event) => {\n // clear the long press here in case there's multiple touch points\n clearLongPress();\n longPressTimerRef.current = window.setTimeout(() => handleOpen(event), 700);\n })\n )\n }\n onPointerMove={\n disabled\n ? props.onPointerMove\n : composeEventHandlers(props.onPointerMove, whenTouchOrPen(clearLongPress))\n }\n onPointerCancel={\n disabled\n ? props.onPointerCancel\n : composeEventHandlers(props.onPointerCancel, whenTouchOrPen(clearLongPress))\n }\n onPointerUp={\n disabled\n ? props.onPointerUp\n : composeEventHandlers(props.onPointerUp, whenTouchOrPen(clearLongPress))\n }\n />\n </>\n );\n }\n);\n\nContextMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'ContextMenuPortal';\n\ntype MenuPortalProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Portal>;\ninterface ContextMenuPortalProps extends MenuPortalProps {}\n\nconst ContextMenuPortal: React.FC<ContextMenuPortalProps> = (\n props: ScopedProps<ContextMenuPortalProps>\n) => {\n const { __scopeContextMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Portal {...menuScope} {...portalProps} />;\n};\n\nContextMenuPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'ContextMenuContent';\n\ntype ContextMenuContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;\ninterface ContextMenuContentProps extends Omit<MenuContentProps, 'side' | 'sideOffset' | 'align'> {}\n\nconst ContextMenuContent = React.forwardRef<ContextMenuContentElement, ContextMenuContentProps>(\n (props: ScopedProps<ContextMenuContentProps>, forwardedRef) => {\n const { __scopeContextMenu, ...contentProps } = props;\n const context = useContextMenuContext(CONTENT_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n <MenuPrimitive.Content\n {...menuScope}\n {...contentProps}\n ref={forwardedRef}\n side=\"right\"\n sideOffset={2}\n align=\"start\"\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented && hasInteractedOutsideRef.current) {\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented && !context.modal) hasInteractedOutsideRef.current = true;\n }}\n style={{\n ...props.style,\n // re-namespace exposed content custom property\n ['--radix-context-menu-content-transform-origin' as any]:\n 'var(--radix-popper-transform-origin)',\n }}\n />\n );\n }\n);\n\nContextMenuContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'ContextMenuGroup';\n\ntype ContextMenuGroupElement = React.ElementRef<typeof MenuPrimitive.Group>;\ntype MenuGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>;\ninterface ContextMenuGroupProps extends MenuGroupProps {}\n\nconst ContextMenuGroup = React.forwardRef<ContextMenuGroupElement, ContextMenuGroupProps>(\n (props: ScopedProps<ContextMenuGroupProps>, forwardedRef) => {\n const { __scopeContextMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Group {...menuScope} {...groupProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'ContextMenuLabel';\n\ntype ContextMenuLabelElement = React.ElementRef<typeof MenuPrimitive.Label>;\ntype MenuLabelProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Label>;\ninterface ContextMenuLabelProps extends MenuLabelProps {}\n\nconst ContextMenuLabel = React.forwardRef<ContextMenuLabelElement, ContextMenuLabelProps>(\n (props: ScopedProps<ContextMenuLabelProps>, forwardedRef) => {\n const { __scopeContextMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Label {...menuScope} {...labelProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'ContextMenuItem';\n\ntype ContextMenuItemElement = React.ElementRef<typeof MenuPrimitive.Item>;\ntype MenuItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Item>;\ninterface ContextMenuItemProps extends MenuItemProps {}\n\nconst ContextMenuItem = React.forwardRef<ContextMenuItemElement, ContextMenuItemProps>(\n (props: ScopedProps<ContextMenuItemProps>, forwardedRef) => {\n const { __scopeContextMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Item {...menuScope} {...itemProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'ContextMenuCheckboxItem';\n\ntype ContextMenuCheckboxItemElement = React.ElementRef<typeof MenuPrimitive.CheckboxItem>;\ntype MenuCheckboxItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>;\ninterface ContextMenuCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n ContextMenuCheckboxItemElement,\n ContextMenuCheckboxItemProps\n>((props: ScopedProps<ContextMenuCheckboxItemProps>, forwardedRef) => {\n const { __scopeContextMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.CheckboxItem {...menuScope} {...checkboxItemProps} ref={forwardedRef} />;\n});\n\nContextMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'ContextMenuRadioGroup';\n\ntype ContextMenuRadioGroupElement = React.ElementRef<typeof MenuPrimitive.RadioGroup>;\ntype MenuRadioGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioGroup>;\ninterface ContextMenuRadioGroupProps extends MenuRadioGroupProps {}\n\nconst ContextMenuRadioGroup = React.forwardRef<\n ContextMenuRadioGroupElement,\n ContextMenuRadioGroupProps\n>((props: ScopedProps<ContextMenuRadioGroupProps>, forwardedRef) => {\n const { __scopeContextMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.RadioGroup {...menuScope} {...radioGroupProps} ref={forwardedRef} />;\n});\n\nContextMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'ContextMenuRadioItem';\n\ntype ContextMenuRadioItemElement = React.ElementRef<typeof MenuPrimitive.RadioItem>;\ntype MenuRadioItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioItem>;\ninterface ContextMenuRadioItemProps extends MenuRadioItemProps {}\n\nconst ContextMenuRadioItem = React.forwardRef<\n ContextMenuRadioItemElement,\n ContextMenuRadioItemProps\n>((props: ScopedProps<ContextMenuRadioItemProps>, forwardedRef) => {\n const { __scopeContextMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.RadioItem {...menuScope} {...radioItemProps} ref={forwardedRef} />;\n});\n\nContextMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ContextMenuItemIndicator';\n\ntype ContextMenuItemIndicatorElement = React.ElementRef<typeof MenuPrimitive.ItemIndicator>;\ntype MenuItemIndicatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.ItemIndicator>;\ninterface ContextMenuItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst ContextMenuItemIndicator = React.forwardRef<\n ContextMenuItemIndicatorElement,\n ContextMenuItemIndicatorProps\n>((props: ScopedProps<ContextMenuItemIndicatorProps>, forwardedRef) => {\n const { __scopeContextMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.ItemIndicator {...menuScope} {...itemIndicatorProps} ref={forwardedRef} />;\n});\n\nContextMenuItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'ContextMenuSeparator';\n\ntype ContextMenuSeparatorElement = React.ElementRef<typeof MenuPrimitive.Separator>;\ntype MenuSeparatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Separator>;\ninterface ContextMenuSeparatorProps extends MenuSeparatorProps {}\n\nconst ContextMenuSeparator = React.forwardRef<\n ContextMenuSeparatorElement,\n ContextMenuSeparatorProps\n>((props: ScopedProps<ContextMenuSeparatorProps>, forwardedRef) => {\n const { __scopeContextMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Separator {...menuScope} {...separatorProps} ref={forwardedRef} />;\n});\n\nContextMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'ContextMenuArrow';\n\ntype ContextMenuArrowElement = React.ElementRef<typeof MenuPrimitive.Arrow>;\ntype MenuArrowProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Arrow>;\ninterface ContextMenuArrowProps extends MenuArrowProps {}\n\nconst ContextMenuArrow = React.forwardRef<ContextMenuArrowElement, ContextMenuArrowProps>(\n (props: ScopedProps<ContextMenuArrowProps>, forwardedRef) => {\n const { __scopeContextMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Arrow {...menuScope} {...arrowProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'ContextMenuSub';\n\ninterface ContextMenuSubProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst ContextMenuSub: React.FC<ContextMenuSubProps> = (props: ScopedProps<ContextMenuSubProps>) => {\n const { __scopeContextMenu, children, onOpenChange, open: openProp, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n <MenuPrimitive.Sub {...menuScope} open={open} onOpenChange={setOpen}>\n {children}\n </MenuPrimitive.Sub>\n );\n};\n\nContextMenuSub.displayName = SUB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'ContextMenuSubTrigger';\n\ntype ContextMenuSubTriggerElement = React.ElementRef<typeof MenuPrimitive.SubTrigger>;\ntype MenuSubTriggerProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;\ninterface ContextMenuSubTriggerProps extends MenuSubTriggerProps {}\n\nconst ContextMenuSubTrigger = React.forwardRef<\n ContextMenuSubTriggerElement,\n ContextMenuSubTriggerProps\n>((props: ScopedProps<ContextMenuSubTriggerProps>, forwardedRef) => {\n const { __scopeContextMenu, ...triggerItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.SubTrigger {...menuScope} {...triggerItemProps} ref={forwardedRef} />;\n});\n\nContextMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'ContextMenuSubContent';\n\ntype ContextMenuSubContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuSubContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubContent>;\ninterface ContextMenuSubContentProps extends MenuSubContentProps {}\n\nconst ContextMenuSubContent = React.forwardRef<\n ContextMenuSubContentElement,\n ContextMenuSubContentProps\n>((props: ScopedProps<ContextMenuSubContentProps>, forwardedRef) => {\n const { __scopeContextMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n\n return (\n <MenuPrimitive.SubContent\n {...menuScope}\n {...subContentProps}\n ref={forwardedRef}\n style={{\n ...props.style,\n // re-namespace exposed content custom property\n ['--radix-context-menu-content-transform-origin' as any]:\n 'var(--radix-popper-transform-origin)',\n }}\n />\n );\n});\n\nContextMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction whenTouchOrPen<E>(handler: React.PointerEventHandler<E>): React.PointerEventHandler<E> {\n return (event) => (event.pointerType !== 'mouse' ? handler(event) : undefined);\n}\n\nconst Root = ContextMenu;\nconst Trigger = ContextMenuTrigger;\nconst Portal = ContextMenuPortal;\nconst Content = ContextMenuContent;\nconst Group = ContextMenuGroup;\nconst Label = ContextMenuLabel;\nconst Item = ContextMenuItem;\nconst CheckboxItem = ContextMenuCheckboxItem;\nconst RadioGroup = ContextMenuRadioGroup;\nconst RadioItem = ContextMenuRadioItem;\nconst ItemIndicator = ContextMenuItemIndicator;\nconst Separator = ContextMenuSeparator;\nconst Arrow = ContextMenuArrow;\nconst Sub = ContextMenuSub;\nconst SubTrigger = ContextMenuSubTrigger;\nconst SubContent = ContextMenuSubContent;\n\nexport {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuPortal,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n ContextMenuSub,\n ContextMenuSubTrigger,\n ContextMenuSubContent,\n //\n Root,\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 SubTrigger,\n SubContent,\n};\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuPortalProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n ContextMenuSubProps,\n ContextMenuSubTriggerProps,\n ContextMenuSubContentProps,\n};\n"],"names":["createContextMenuScope","ContextMenu","ContextMenuTrigger","ContextMenuPortal","ContextMenuContent","ContextMenuGroup","ContextMenuLabel","ContextMenuItem","ContextMenuCheckboxItem","ContextMenuRadioGroup","ContextMenuRadioItem","ContextMenuItemIndicator","ContextMenuSeparator","ContextMenuArrow","ContextMenuSub","ContextMenuSubTrigger","ContextMenuSubContent","Root","Trigger","Portal","Content","Group","Label","Item","CheckboxItem","RadioGroup","RadioItem","ItemIndicator","Separator","Arrow","Sub","SubTrigger","SubContent","React","composeEventHandlers","createContextScope","Primitive","MenuPrimitive","createMenuScope","useCallbackRef","useControllableState","CONTEXT_MENU_NAME","createContextMenuContext","useMenuScope","ContextMenuProvider","useContextMenuContext","props","__scopeContextMenu","children","onOpenChange","dir","modal","open","setOpen","useState","menuScope","handleOpenChangeProp","handleOpenChange","useCallback","TRIGGER_NAME","forwardRef","forwardedRef","disabled","triggerProps","context","pointRef","useRef","x","y","virtualRef","getBoundingClientRect","DOMRect","fromRect","width","height","current","longPressTimerRef","clearLongPress","window","clearTimeout","handleOpen","event","clientX","clientY","useEffect","undefined","WebkitTouchCallout","style","onContextMenu","preventDefault","onPointerDown","whenTouchOrPen","setTimeout","onPointerMove","onPointerCancel","onPointerUp","PORTAL_NAME","portalProps","CONTENT_NAME","contentProps","hasInteractedOutsideRef","onCloseAutoFocus","defaultPrevented","onInteractOutside","GROUP_NAME","groupProps","LABEL_NAME","labelProps","ITEM_NAME","itemProps","CHECKBOX_ITEM_NAME","checkboxItemProps","RADIO_GROUP_NAME","radioGroupProps","RADIO_ITEM_NAME","radioItemProps","INDICATOR_NAME","itemIndicatorProps","SEPARATOR_NAME","separatorProps","ARROW_NAME","arrowProps","SUB_NAME","openProp","defaultOpen","prop","defaultProp","onChange","SUB_TRIGGER_NAME","triggerItemProps","SUB_CONTENT_NAME","subContentProps","handler","pointerType"],"version":3,"file":"index.js.map"}
@@ -54,7 +54,7 @@ const $1b0217ee4a91d156$export$8dc6765e8be191c7 = (props)=>{
54
54
  * ContextMenuTrigger
55
55
  * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$TRIGGER_NAME = 'ContextMenuTrigger';
56
56
  const $1b0217ee4a91d156$export$be6fc7b1d5b0beb9 = /*#__PURE__*/ $3TiJz$forwardRef((props, forwardedRef)=>{
57
- const { __scopeContextMenu: __scopeContextMenu , ...triggerProps } = props;
57
+ const { __scopeContextMenu: __scopeContextMenu , disabled: disabled = false , ...triggerProps } = props;
58
58
  const context = $1b0217ee4a91d156$var$useContextMenuContext($1b0217ee4a91d156$var$TRIGGER_NAME, __scopeContextMenu);
59
59
  const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
60
60
  const pointRef = $3TiJz$useRef({
@@ -82,33 +82,40 @@ const $1b0217ee4a91d156$export$be6fc7b1d5b0beb9 = /*#__PURE__*/ $3TiJz$forwardRe
82
82
  , [
83
83
  clearLongPress
84
84
  ]);
85
+ $3TiJz$useEffect(()=>void (disabled && clearLongPress())
86
+ , [
87
+ disabled,
88
+ clearLongPress
89
+ ]);
85
90
  return /*#__PURE__*/ $3TiJz$createElement($3TiJz$Fragment, null, /*#__PURE__*/ $3TiJz$createElement($3TiJz$Anchor, $3TiJz$babelruntimehelpersesmextends({}, menuScope, {
86
91
  virtualRef: virtualRef
87
92
  })), /*#__PURE__*/ $3TiJz$createElement($3TiJz$Primitive.span, $3TiJz$babelruntimehelpersesmextends({
88
- "data-state": context.open ? 'open' : 'closed'
93
+ "data-state": context.open ? 'open' : 'closed',
94
+ "data-disabled": disabled ? '' : undefined
89
95
  }, triggerProps, {
90
96
  ref: forwardedRef // prevent iOS context menu from appearing
91
97
  ,
92
98
  style: {
93
99
  WebkitTouchCallout: 'none',
94
100
  ...props.style
95
- },
96
- onContextMenu: $3TiJz$composeEventHandlers(props.onContextMenu, (event)=>{
101
+ } // if trigger is disabled, enable the native Context Menu
102
+ ,
103
+ onContextMenu: disabled ? props.onContextMenu : $3TiJz$composeEventHandlers(props.onContextMenu, (event)=>{
97
104
  // clearing the long press here because some platforms already support
98
105
  // long press to trigger a `contextmenu` event
99
106
  clearLongPress();
100
107
  handleOpen(event);
101
108
  event.preventDefault();
102
109
  }),
103
- onPointerDown: $3TiJz$composeEventHandlers(props.onPointerDown, $1b0217ee4a91d156$var$whenTouchOrPen((event)=>{
110
+ onPointerDown: disabled ? props.onPointerDown : $3TiJz$composeEventHandlers(props.onPointerDown, $1b0217ee4a91d156$var$whenTouchOrPen((event)=>{
104
111
  // clear the long press here in case there's multiple touch points
105
112
  clearLongPress();
106
113
  longPressTimerRef.current = window.setTimeout(()=>handleOpen(event)
107
114
  , 700);
108
115
  })),
109
- onPointerMove: $3TiJz$composeEventHandlers(props.onPointerMove, $1b0217ee4a91d156$var$whenTouchOrPen(clearLongPress)),
110
- onPointerCancel: $3TiJz$composeEventHandlers(props.onPointerCancel, $1b0217ee4a91d156$var$whenTouchOrPen(clearLongPress)),
111
- onPointerUp: $3TiJz$composeEventHandlers(props.onPointerUp, $1b0217ee4a91d156$var$whenTouchOrPen(clearLongPress))
116
+ onPointerMove: disabled ? props.onPointerMove : $3TiJz$composeEventHandlers(props.onPointerMove, $1b0217ee4a91d156$var$whenTouchOrPen(clearLongPress)),
117
+ onPointerCancel: disabled ? props.onPointerCancel : $3TiJz$composeEventHandlers(props.onPointerCancel, $1b0217ee4a91d156$var$whenTouchOrPen(clearLongPress)),
118
+ onPointerUp: disabled ? props.onPointerUp : $3TiJz$composeEventHandlers(props.onPointerUp, $1b0217ee4a91d156$var$whenTouchOrPen(clearLongPress))
112
119
  })));
113
120
  });
114
121
  /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$be6fc7b1d5b0beb9, {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;A;;;;;;;;;ACeA;;oGAEA,CAEA,MAAMyC,uCAAiB,GAAG,aAA1B,AAAA;AAGA,MAAM,CAACC,8CAAD,EAA2B1C,yCAA3B,CAAA,GAAqDmC,yBAAkB,CAACM,uCAAD,EAAoB;IAC/FH,sBAD+F;CAApB,CAA7E,AAAA;AAGA,MAAMK,kCAAY,GAAGL,sBAAe,EAApC,AAAA;AAQA,MAAM,CAACM,yCAAD,EAAsBC,2CAAtB,CAAA,GACJH,8CAAwB,CAA0BD,uCAA1B,CAD1B,AAAA;AAUA,MAAMxC,yCAAuC,GAAI6C,CAAAA,KAAD,GAA0C;IACxF,MAAM,E,oBAAEC,kBAAF,CAAA,E,UAAsBC,QAAtB,CAAA,E,cAAgCC,YAAhC,CAAA,E,KAA8CC,GAA9C,CAAA,SAAmDC,KAAK,GAAG,IAARA,GAAnD,GAAoEL,KAA1E,AAAM;IACN,MAAM,CAACM,KAAD,EAAOC,OAAP,CAAA,GAAkBpB,eAAA,CAAe,KAAf,CAAxB,AAAA;IACA,MAAMsB,SAAS,GAAGZ,kCAAY,CAACI,kBAAD,CAA9B,AAAA;IACA,MAAMS,oBAAoB,GAAGjB,qBAAc,CAACU,YAAD,CAA3C,AAAA;IAEA,MAAMQ,gBAAgB,GAAGxB,kBAAA,CACtBmB,CAAAA,IAAD,GAAmB;QACjBC,OAAO,CAACD,IAAD,CAAP,CAAAC;QACAG,oBAAoB,CAACJ,IAAD,CAApB,CAAAI;KAHqB,EAKvB;QAACA,oBAAD;KALuB,CAAzB,AAIG;IAIH,OAAA,aACE,CAAA,oBAAA,CAAC,yCAAD,EADF;QAEI,KAAK,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HK;KAJT,CAAA,CADF,CACE;CAR0B,CAA9B,AAoBC;AAED,aAAA,CAAA,MAAA,CAAA,MAAA,CAAA,yCAAA,EAAA;IAAA,WAAA,EAAA,sCAAA;CAAA,CAAA,CAAA;AAEA,oGAAA,CAEA,SAASI,oCAAT,CAA2ByC,OAA3B,EAAgG;IAC9F,OAAQlD,CAAAA,KAAD,GAAYA,KAAK,CAACmD,WAAN,KAAsB,OAAtB,GAAgCD,OAAO,CAAClD,KAAD,CAAvC,GAAiDoD,SAApE;IAAA,CAAA;CACD;AAED,MAAMnH,yCAAI,GAAGhB,yCAAb,AAAA;AACA,MAAMiB,yCAAO,GAAGhB,yCAAhB,AAAA;AACA,MAAMiB,yCAAM,GAAGhB,yCAAf,AAAA;AACA,MAAMiB,yCAAO,GAAGhB,wCAAhB,AAAA;AACA,MAAMiB,yCAAK,GAAGhB,yCAAd,AAAA;AACA,MAAMiB,yCAAK,GAAGhB,yCAAd,AAAA;AACA,MAAMiB,yCAAI,GAAGhB,yCAAb,AAAA;AACA,MAAMiB,yCAAY,GAAGhB,yCAArB,AAAA;AACA,MAAMiB,yCAAU,GAAGhB,yCAAnB,AAAA;AACA,MAAMiB,yCAAS,GAAGhB,yCAAlB,AAAA;AACA,MAAMiB,yCAAa,GAAGhB,yCAAtB,AAAA;AACA,MAAMiB,yCAAS,GAAGhB,yCAAlB,AAAA;AACA,MAAMiB,yCAAK,GAAGhB,yCAAd,AAAA;AACA,MAAMiB,yCAAG,GAAGhB,yCAAZ,AAAA;AACA,MAAMiB,yCAAU,GAAGhB,yCAAnB,AAAA;AACA,MAAMiB,yCAAU,GAAGhB,yCAAnB,AAAA;;AD/fA","sources":["packages/react/context-menu/src/index.ts","packages/react/context-menu/src/ContextMenu.tsx"],"sourcesContent":["export {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuPortal,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n ContextMenuSub,\n ContextMenuSubTrigger,\n ContextMenuSubContent,\n //\n Root,\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 SubTrigger,\n SubContent,\n} from './ContextMenu';\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuPortalProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n ContextMenuSubProps,\n ContextMenuSubTriggerProps,\n ContextMenuSubContentProps,\n} from './ContextMenu';\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\ntype Point = { x: number; y: number };\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTEXT_MENU_NAME = 'ContextMenu';\n\ntype ScopedProps<P> = P & { __scopeContextMenu?: Scope };\nconst [createContextMenuContext, createContextMenuScope] = createContextScope(CONTEXT_MENU_NAME, [\n createMenuScope,\n]);\nconst useMenuScope = createMenuScope();\n\ntype ContextMenuContextValue = {\n open: boolean;\n onOpenChange(open: boolean): void;\n modal: boolean;\n};\n\nconst [ContextMenuProvider, useContextMenuContext] =\n createContextMenuContext<ContextMenuContextValue>(CONTEXT_MENU_NAME);\n\ninterface ContextMenuProps {\n children?: React.ReactNode;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n}\n\nconst ContextMenu: React.FC<ContextMenuProps> = (props: ScopedProps<ContextMenuProps>) => {\n const { __scopeContextMenu, children, onOpenChange, dir, modal = true } = props;\n const [open, setOpen] = React.useState(false);\n const menuScope = useMenuScope(__scopeContextMenu);\n const handleOpenChangeProp = useCallbackRef(onOpenChange);\n\n const handleOpenChange = React.useCallback(\n (open: boolean) => {\n setOpen(open);\n handleOpenChangeProp(open);\n },\n [handleOpenChangeProp]\n );\n\n return (\n <ContextMenuProvider\n scope={__scopeContextMenu}\n open={open}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n <MenuPrimitive.Root\n {...menuScope}\n dir={dir}\n open={open}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n {children}\n </MenuPrimitive.Root>\n </ContextMenuProvider>\n );\n};\n\nContextMenu.displayName = CONTEXT_MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'ContextMenuTrigger';\n\ntype ContextMenuTriggerElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface ContextMenuTriggerProps extends PrimitiveSpanProps {}\n\nconst ContextMenuTrigger = React.forwardRef<ContextMenuTriggerElement, ContextMenuTriggerProps>(\n (props: ScopedProps<ContextMenuTriggerProps>, forwardedRef) => {\n const { __scopeContextMenu, ...triggerProps } = props;\n const context = useContextMenuContext(TRIGGER_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const pointRef = React.useRef<Point>({ x: 0, y: 0 });\n const virtualRef = React.useRef({\n getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...pointRef.current }),\n });\n const longPressTimerRef = React.useRef(0);\n const clearLongPress = React.useCallback(\n () => window.clearTimeout(longPressTimerRef.current),\n []\n );\n const handleOpen = (event: React.MouseEvent | React.PointerEvent) => {\n pointRef.current = { x: event.clientX, y: event.clientY };\n context.onOpenChange(true);\n };\n\n React.useEffect(() => clearLongPress, [clearLongPress]);\n\n return (\n <>\n <MenuPrimitive.Anchor {...menuScope} virtualRef={virtualRef} />\n <Primitive.span\n data-state={context.open ? 'open' : 'closed'}\n {...triggerProps}\n ref={forwardedRef}\n // prevent iOS context menu from appearing\n style={{ WebkitTouchCallout: 'none', ...props.style }}\n onContextMenu={composeEventHandlers(props.onContextMenu, (event) => {\n // clearing the long press here because some platforms already support\n // long press to trigger a `contextmenu` event\n clearLongPress();\n handleOpen(event);\n event.preventDefault();\n })}\n onPointerDown={composeEventHandlers(\n props.onPointerDown,\n whenTouchOrPen((event) => {\n // clear the long press here in case there's multiple touch points\n clearLongPress();\n longPressTimerRef.current = window.setTimeout(() => handleOpen(event), 700);\n })\n )}\n onPointerMove={composeEventHandlers(props.onPointerMove, whenTouchOrPen(clearLongPress))}\n onPointerCancel={composeEventHandlers(\n props.onPointerCancel,\n whenTouchOrPen(clearLongPress)\n )}\n onPointerUp={composeEventHandlers(props.onPointerUp, whenTouchOrPen(clearLongPress))}\n />\n </>\n );\n }\n);\n\nContextMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'ContextMenuPortal';\n\ntype MenuPortalProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Portal>;\ninterface ContextMenuPortalProps extends MenuPortalProps {}\n\nconst ContextMenuPortal: React.FC<ContextMenuPortalProps> = (\n props: ScopedProps<ContextMenuPortalProps>\n) => {\n const { __scopeContextMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Portal {...menuScope} {...portalProps} />;\n};\n\nContextMenuPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'ContextMenuContent';\n\ntype ContextMenuContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;\ninterface ContextMenuContentProps extends Omit<MenuContentProps, 'side' | 'sideOffset' | 'align'> {}\n\nconst ContextMenuContent = React.forwardRef<ContextMenuContentElement, ContextMenuContentProps>(\n (props: ScopedProps<ContextMenuContentProps>, forwardedRef) => {\n const { __scopeContextMenu, ...contentProps } = props;\n const context = useContextMenuContext(CONTENT_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n <MenuPrimitive.Content\n {...menuScope}\n {...contentProps}\n ref={forwardedRef}\n side=\"right\"\n sideOffset={2}\n align=\"start\"\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented && hasInteractedOutsideRef.current) {\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented && !context.modal) hasInteractedOutsideRef.current = true;\n }}\n style={{\n ...props.style,\n // re-namespace exposed content custom property\n ['--radix-context-menu-content-transform-origin' as any]:\n 'var(--radix-popper-transform-origin)',\n }}\n />\n );\n }\n);\n\nContextMenuContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'ContextMenuGroup';\n\ntype ContextMenuGroupElement = React.ElementRef<typeof MenuPrimitive.Group>;\ntype MenuGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>;\ninterface ContextMenuGroupProps extends MenuGroupProps {}\n\nconst ContextMenuGroup = React.forwardRef<ContextMenuGroupElement, ContextMenuGroupProps>(\n (props: ScopedProps<ContextMenuGroupProps>, forwardedRef) => {\n const { __scopeContextMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Group {...menuScope} {...groupProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'ContextMenuLabel';\n\ntype ContextMenuLabelElement = React.ElementRef<typeof MenuPrimitive.Label>;\ntype MenuLabelProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Label>;\ninterface ContextMenuLabelProps extends MenuLabelProps {}\n\nconst ContextMenuLabel = React.forwardRef<ContextMenuLabelElement, ContextMenuLabelProps>(\n (props: ScopedProps<ContextMenuLabelProps>, forwardedRef) => {\n const { __scopeContextMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Label {...menuScope} {...labelProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'ContextMenuItem';\n\ntype ContextMenuItemElement = React.ElementRef<typeof MenuPrimitive.Item>;\ntype MenuItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Item>;\ninterface ContextMenuItemProps extends MenuItemProps {}\n\nconst ContextMenuItem = React.forwardRef<ContextMenuItemElement, ContextMenuItemProps>(\n (props: ScopedProps<ContextMenuItemProps>, forwardedRef) => {\n const { __scopeContextMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Item {...menuScope} {...itemProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'ContextMenuCheckboxItem';\n\ntype ContextMenuCheckboxItemElement = React.ElementRef<typeof MenuPrimitive.CheckboxItem>;\ntype MenuCheckboxItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>;\ninterface ContextMenuCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n ContextMenuCheckboxItemElement,\n ContextMenuCheckboxItemProps\n>((props: ScopedProps<ContextMenuCheckboxItemProps>, forwardedRef) => {\n const { __scopeContextMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.CheckboxItem {...menuScope} {...checkboxItemProps} ref={forwardedRef} />;\n});\n\nContextMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'ContextMenuRadioGroup';\n\ntype ContextMenuRadioGroupElement = React.ElementRef<typeof MenuPrimitive.RadioGroup>;\ntype MenuRadioGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioGroup>;\ninterface ContextMenuRadioGroupProps extends MenuRadioGroupProps {}\n\nconst ContextMenuRadioGroup = React.forwardRef<\n ContextMenuRadioGroupElement,\n ContextMenuRadioGroupProps\n>((props: ScopedProps<ContextMenuRadioGroupProps>, forwardedRef) => {\n const { __scopeContextMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.RadioGroup {...menuScope} {...radioGroupProps} ref={forwardedRef} />;\n});\n\nContextMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'ContextMenuRadioItem';\n\ntype ContextMenuRadioItemElement = React.ElementRef<typeof MenuPrimitive.RadioItem>;\ntype MenuRadioItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioItem>;\ninterface ContextMenuRadioItemProps extends MenuRadioItemProps {}\n\nconst ContextMenuRadioItem = React.forwardRef<\n ContextMenuRadioItemElement,\n ContextMenuRadioItemProps\n>((props: ScopedProps<ContextMenuRadioItemProps>, forwardedRef) => {\n const { __scopeContextMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.RadioItem {...menuScope} {...radioItemProps} ref={forwardedRef} />;\n});\n\nContextMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ContextMenuItemIndicator';\n\ntype ContextMenuItemIndicatorElement = React.ElementRef<typeof MenuPrimitive.ItemIndicator>;\ntype MenuItemIndicatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.ItemIndicator>;\ninterface ContextMenuItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst ContextMenuItemIndicator = React.forwardRef<\n ContextMenuItemIndicatorElement,\n ContextMenuItemIndicatorProps\n>((props: ScopedProps<ContextMenuItemIndicatorProps>, forwardedRef) => {\n const { __scopeContextMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.ItemIndicator {...menuScope} {...itemIndicatorProps} ref={forwardedRef} />;\n});\n\nContextMenuItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'ContextMenuSeparator';\n\ntype ContextMenuSeparatorElement = React.ElementRef<typeof MenuPrimitive.Separator>;\ntype MenuSeparatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Separator>;\ninterface ContextMenuSeparatorProps extends MenuSeparatorProps {}\n\nconst ContextMenuSeparator = React.forwardRef<\n ContextMenuSeparatorElement,\n ContextMenuSeparatorProps\n>((props: ScopedProps<ContextMenuSeparatorProps>, forwardedRef) => {\n const { __scopeContextMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Separator {...menuScope} {...separatorProps} ref={forwardedRef} />;\n});\n\nContextMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'ContextMenuArrow';\n\ntype ContextMenuArrowElement = React.ElementRef<typeof MenuPrimitive.Arrow>;\ntype MenuArrowProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Arrow>;\ninterface ContextMenuArrowProps extends MenuArrowProps {}\n\nconst ContextMenuArrow = React.forwardRef<ContextMenuArrowElement, ContextMenuArrowProps>(\n (props: ScopedProps<ContextMenuArrowProps>, forwardedRef) => {\n const { __scopeContextMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Arrow {...menuScope} {...arrowProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'ContextMenuSub';\n\ninterface ContextMenuSubProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst ContextMenuSub: React.FC<ContextMenuSubProps> = (props: ScopedProps<ContextMenuSubProps>) => {\n const { __scopeContextMenu, children, onOpenChange, open: openProp, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n <MenuPrimitive.Sub {...menuScope} open={open} onOpenChange={setOpen}>\n {children}\n </MenuPrimitive.Sub>\n );\n};\n\nContextMenuSub.displayName = SUB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'ContextMenuSubTrigger';\n\ntype ContextMenuSubTriggerElement = React.ElementRef<typeof MenuPrimitive.SubTrigger>;\ntype MenuSubTriggerProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;\ninterface ContextMenuSubTriggerProps extends MenuSubTriggerProps {}\n\nconst ContextMenuSubTrigger = React.forwardRef<\n ContextMenuSubTriggerElement,\n ContextMenuSubTriggerProps\n>((props: ScopedProps<ContextMenuSubTriggerProps>, forwardedRef) => {\n const { __scopeContextMenu, ...triggerItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.SubTrigger {...menuScope} {...triggerItemProps} ref={forwardedRef} />;\n});\n\nContextMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'ContextMenuSubContent';\n\ntype ContextMenuSubContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuSubContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubContent>;\ninterface ContextMenuSubContentProps extends MenuSubContentProps {}\n\nconst ContextMenuSubContent = React.forwardRef<\n ContextMenuSubContentElement,\n ContextMenuSubContentProps\n>((props: ScopedProps<ContextMenuSubContentProps>, forwardedRef) => {\n const { __scopeContextMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n\n return (\n <MenuPrimitive.SubContent\n {...menuScope}\n {...subContentProps}\n ref={forwardedRef}\n style={{\n ...props.style,\n // re-namespace exposed content custom property\n ['--radix-context-menu-content-transform-origin' as any]:\n 'var(--radix-popper-transform-origin)',\n }}\n />\n );\n});\n\nContextMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction whenTouchOrPen<E>(handler: React.PointerEventHandler<E>): React.PointerEventHandler<E> {\n return (event) => (event.pointerType !== 'mouse' ? handler(event) : undefined);\n}\n\nconst Root = ContextMenu;\nconst Trigger = ContextMenuTrigger;\nconst Portal = ContextMenuPortal;\nconst Content = ContextMenuContent;\nconst Group = ContextMenuGroup;\nconst Label = ContextMenuLabel;\nconst Item = ContextMenuItem;\nconst CheckboxItem = ContextMenuCheckboxItem;\nconst RadioGroup = ContextMenuRadioGroup;\nconst RadioItem = ContextMenuRadioItem;\nconst ItemIndicator = ContextMenuItemIndicator;\nconst Separator = ContextMenuSeparator;\nconst Arrow = ContextMenuArrow;\nconst Sub = ContextMenuSub;\nconst SubTrigger = ContextMenuSubTrigger;\nconst SubContent = ContextMenuSubContent;\n\nexport {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuPortal,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n ContextMenuSub,\n ContextMenuSubTrigger,\n ContextMenuSubContent,\n //\n Root,\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 SubTrigger,\n SubContent,\n};\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuPortalProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n ContextMenuSubProps,\n ContextMenuSubTriggerProps,\n ContextMenuSubContentProps,\n};\n"],"names":["createContextMenuScope","ContextMenu","ContextMenuTrigger","ContextMenuPortal","ContextMenuContent","ContextMenuGroup","ContextMenuLabel","ContextMenuItem","ContextMenuCheckboxItem","ContextMenuRadioGroup","ContextMenuRadioItem","ContextMenuItemIndicator","ContextMenuSeparator","ContextMenuArrow","ContextMenuSub","ContextMenuSubTrigger","ContextMenuSubContent","Root","Trigger","Portal","Content","Group","Label","Item","CheckboxItem","RadioGroup","RadioItem","ItemIndicator","Separator","Arrow","Sub","SubTrigger","SubContent","React","composeEventHandlers","createContextScope","Primitive","MenuPrimitive","createMenuScope","useCallbackRef","useControllableState","CONTEXT_MENU_NAME","createContextMenuContext","useMenuScope","ContextMenuProvider","useContextMenuContext","props","__scopeContextMenu","children","onOpenChange","dir","modal","open","setOpen","useState","menuScope","handleOpenChangeProp","handleOpenChange","useCallback","TRIGGER_NAME","forwardRef","forwardedRef","triggerProps","context","pointRef","useRef","x","y","virtualRef","getBoundingClientRect","DOMRect","fromRect","width","height","current","longPressTimerRef","clearLongPress","window","clearTimeout","handleOpen","event","clientX","clientY","useEffect","WebkitTouchCallout","style","onContextMenu","preventDefault","onPointerDown","whenTouchOrPen","setTimeout","onPointerMove","onPointerCancel","onPointerUp","PORTAL_NAME","portalProps","CONTENT_NAME","contentProps","hasInteractedOutsideRef","onCloseAutoFocus","defaultPrevented","onInteractOutside","GROUP_NAME","groupProps","LABEL_NAME","labelProps","ITEM_NAME","itemProps","CHECKBOX_ITEM_NAME","checkboxItemProps","RADIO_GROUP_NAME","radioGroupProps","RADIO_ITEM_NAME","radioItemProps","INDICATOR_NAME","itemIndicatorProps","SEPARATOR_NAME","separatorProps","ARROW_NAME","arrowProps","SUB_NAME","openProp","defaultOpen","prop","defaultProp","onChange","SUB_TRIGGER_NAME","triggerItemProps","SUB_CONTENT_NAME","subContentProps","handler","pointerType","undefined"],"version":3,"file":"index.module.js.map"}
1
+ {"mappings":";;;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U,GAAGhB,yCAAnB,AAAA;;ADrhBA","sources":["packages/react/context-menu/src/index.ts","packages/react/context-menu/src/ContextMenu.tsx"],"sourcesContent":["export {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuPortal,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n ContextMenuSub,\n ContextMenuSubTrigger,\n ContextMenuSubContent,\n //\n Root,\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 SubTrigger,\n SubContent,\n} from './ContextMenu';\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuPortalProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n ContextMenuSubProps,\n ContextMenuSubTriggerProps,\n ContextMenuSubContentProps,\n} from './ContextMenu';\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\ntype Point = { x: number; y: number };\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTEXT_MENU_NAME = 'ContextMenu';\n\ntype ScopedProps<P> = P & { __scopeContextMenu?: Scope };\nconst [createContextMenuContext, createContextMenuScope] = createContextScope(CONTEXT_MENU_NAME, [\n createMenuScope,\n]);\nconst useMenuScope = createMenuScope();\n\ntype ContextMenuContextValue = {\n open: boolean;\n onOpenChange(open: boolean): void;\n modal: boolean;\n};\n\nconst [ContextMenuProvider, useContextMenuContext] =\n createContextMenuContext<ContextMenuContextValue>(CONTEXT_MENU_NAME);\n\ninterface ContextMenuProps {\n children?: React.ReactNode;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n}\n\nconst ContextMenu: React.FC<ContextMenuProps> = (props: ScopedProps<ContextMenuProps>) => {\n const { __scopeContextMenu, children, onOpenChange, dir, modal = true } = props;\n const [open, setOpen] = React.useState(false);\n const menuScope = useMenuScope(__scopeContextMenu);\n const handleOpenChangeProp = useCallbackRef(onOpenChange);\n\n const handleOpenChange = React.useCallback(\n (open: boolean) => {\n setOpen(open);\n handleOpenChangeProp(open);\n },\n [handleOpenChangeProp]\n );\n\n return (\n <ContextMenuProvider\n scope={__scopeContextMenu}\n open={open}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n <MenuPrimitive.Root\n {...menuScope}\n dir={dir}\n open={open}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n {children}\n </MenuPrimitive.Root>\n </ContextMenuProvider>\n );\n};\n\nContextMenu.displayName = CONTEXT_MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'ContextMenuTrigger';\n\ntype ContextMenuTriggerElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface ContextMenuTriggerProps extends PrimitiveSpanProps {\n disabled?: boolean;\n}\n\nconst ContextMenuTrigger = React.forwardRef<ContextMenuTriggerElement, ContextMenuTriggerProps>(\n (props: ScopedProps<ContextMenuTriggerProps>, forwardedRef) => {\n const { __scopeContextMenu, disabled = false, ...triggerProps } = props;\n const context = useContextMenuContext(TRIGGER_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const pointRef = React.useRef<Point>({ x: 0, y: 0 });\n const virtualRef = React.useRef({\n getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...pointRef.current }),\n });\n const longPressTimerRef = React.useRef(0);\n const clearLongPress = React.useCallback(\n () => window.clearTimeout(longPressTimerRef.current),\n []\n );\n const handleOpen = (event: React.MouseEvent | React.PointerEvent) => {\n pointRef.current = { x: event.clientX, y: event.clientY };\n context.onOpenChange(true);\n };\n\n React.useEffect(() => clearLongPress, [clearLongPress]);\n React.useEffect(() => void (disabled && clearLongPress()), [disabled, clearLongPress]);\n\n return (\n <>\n <MenuPrimitive.Anchor {...menuScope} virtualRef={virtualRef} />\n <Primitive.span\n data-state={context.open ? 'open' : 'closed'}\n data-disabled={disabled ? '' : undefined}\n {...triggerProps}\n ref={forwardedRef}\n // prevent iOS context menu from appearing\n style={{ WebkitTouchCallout: 'none', ...props.style }}\n // if trigger is disabled, enable the native Context Menu\n onContextMenu={\n disabled\n ? props.onContextMenu\n : composeEventHandlers(props.onContextMenu, (event) => {\n // clearing the long press here because some platforms already support\n // long press to trigger a `contextmenu` event\n clearLongPress();\n handleOpen(event);\n event.preventDefault();\n })\n }\n onPointerDown={\n disabled\n ? props.onPointerDown\n : composeEventHandlers(\n props.onPointerDown,\n whenTouchOrPen((event) => {\n // clear the long press here in case there's multiple touch points\n clearLongPress();\n longPressTimerRef.current = window.setTimeout(() => handleOpen(event), 700);\n })\n )\n }\n onPointerMove={\n disabled\n ? props.onPointerMove\n : composeEventHandlers(props.onPointerMove, whenTouchOrPen(clearLongPress))\n }\n onPointerCancel={\n disabled\n ? props.onPointerCancel\n : composeEventHandlers(props.onPointerCancel, whenTouchOrPen(clearLongPress))\n }\n onPointerUp={\n disabled\n ? props.onPointerUp\n : composeEventHandlers(props.onPointerUp, whenTouchOrPen(clearLongPress))\n }\n />\n </>\n );\n }\n);\n\nContextMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'ContextMenuPortal';\n\ntype MenuPortalProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Portal>;\ninterface ContextMenuPortalProps extends MenuPortalProps {}\n\nconst ContextMenuPortal: React.FC<ContextMenuPortalProps> = (\n props: ScopedProps<ContextMenuPortalProps>\n) => {\n const { __scopeContextMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Portal {...menuScope} {...portalProps} />;\n};\n\nContextMenuPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'ContextMenuContent';\n\ntype ContextMenuContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;\ninterface ContextMenuContentProps extends Omit<MenuContentProps, 'side' | 'sideOffset' | 'align'> {}\n\nconst ContextMenuContent = React.forwardRef<ContextMenuContentElement, ContextMenuContentProps>(\n (props: ScopedProps<ContextMenuContentProps>, forwardedRef) => {\n const { __scopeContextMenu, ...contentProps } = props;\n const context = useContextMenuContext(CONTENT_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n <MenuPrimitive.Content\n {...menuScope}\n {...contentProps}\n ref={forwardedRef}\n side=\"right\"\n sideOffset={2}\n align=\"start\"\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented && hasInteractedOutsideRef.current) {\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented && !context.modal) hasInteractedOutsideRef.current = true;\n }}\n style={{\n ...props.style,\n // re-namespace exposed content custom property\n ['--radix-context-menu-content-transform-origin' as any]:\n 'var(--radix-popper-transform-origin)',\n }}\n />\n );\n }\n);\n\nContextMenuContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'ContextMenuGroup';\n\ntype ContextMenuGroupElement = React.ElementRef<typeof MenuPrimitive.Group>;\ntype MenuGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>;\ninterface ContextMenuGroupProps extends MenuGroupProps {}\n\nconst ContextMenuGroup = React.forwardRef<ContextMenuGroupElement, ContextMenuGroupProps>(\n (props: ScopedProps<ContextMenuGroupProps>, forwardedRef) => {\n const { __scopeContextMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Group {...menuScope} {...groupProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'ContextMenuLabel';\n\ntype ContextMenuLabelElement = React.ElementRef<typeof MenuPrimitive.Label>;\ntype MenuLabelProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Label>;\ninterface ContextMenuLabelProps extends MenuLabelProps {}\n\nconst ContextMenuLabel = React.forwardRef<ContextMenuLabelElement, ContextMenuLabelProps>(\n (props: ScopedProps<ContextMenuLabelProps>, forwardedRef) => {\n const { __scopeContextMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Label {...menuScope} {...labelProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'ContextMenuItem';\n\ntype ContextMenuItemElement = React.ElementRef<typeof MenuPrimitive.Item>;\ntype MenuItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Item>;\ninterface ContextMenuItemProps extends MenuItemProps {}\n\nconst ContextMenuItem = React.forwardRef<ContextMenuItemElement, ContextMenuItemProps>(\n (props: ScopedProps<ContextMenuItemProps>, forwardedRef) => {\n const { __scopeContextMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Item {...menuScope} {...itemProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'ContextMenuCheckboxItem';\n\ntype ContextMenuCheckboxItemElement = React.ElementRef<typeof MenuPrimitive.CheckboxItem>;\ntype MenuCheckboxItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>;\ninterface ContextMenuCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n ContextMenuCheckboxItemElement,\n ContextMenuCheckboxItemProps\n>((props: ScopedProps<ContextMenuCheckboxItemProps>, forwardedRef) => {\n const { __scopeContextMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.CheckboxItem {...menuScope} {...checkboxItemProps} ref={forwardedRef} />;\n});\n\nContextMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'ContextMenuRadioGroup';\n\ntype ContextMenuRadioGroupElement = React.ElementRef<typeof MenuPrimitive.RadioGroup>;\ntype MenuRadioGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioGroup>;\ninterface ContextMenuRadioGroupProps extends MenuRadioGroupProps {}\n\nconst ContextMenuRadioGroup = React.forwardRef<\n ContextMenuRadioGroupElement,\n ContextMenuRadioGroupProps\n>((props: ScopedProps<ContextMenuRadioGroupProps>, forwardedRef) => {\n const { __scopeContextMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.RadioGroup {...menuScope} {...radioGroupProps} ref={forwardedRef} />;\n});\n\nContextMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'ContextMenuRadioItem';\n\ntype ContextMenuRadioItemElement = React.ElementRef<typeof MenuPrimitive.RadioItem>;\ntype MenuRadioItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioItem>;\ninterface ContextMenuRadioItemProps extends MenuRadioItemProps {}\n\nconst ContextMenuRadioItem = React.forwardRef<\n ContextMenuRadioItemElement,\n ContextMenuRadioItemProps\n>((props: ScopedProps<ContextMenuRadioItemProps>, forwardedRef) => {\n const { __scopeContextMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.RadioItem {...menuScope} {...radioItemProps} ref={forwardedRef} />;\n});\n\nContextMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ContextMenuItemIndicator';\n\ntype ContextMenuItemIndicatorElement = React.ElementRef<typeof MenuPrimitive.ItemIndicator>;\ntype MenuItemIndicatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.ItemIndicator>;\ninterface ContextMenuItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst ContextMenuItemIndicator = React.forwardRef<\n ContextMenuItemIndicatorElement,\n ContextMenuItemIndicatorProps\n>((props: ScopedProps<ContextMenuItemIndicatorProps>, forwardedRef) => {\n const { __scopeContextMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.ItemIndicator {...menuScope} {...itemIndicatorProps} ref={forwardedRef} />;\n});\n\nContextMenuItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'ContextMenuSeparator';\n\ntype ContextMenuSeparatorElement = React.ElementRef<typeof MenuPrimitive.Separator>;\ntype MenuSeparatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Separator>;\ninterface ContextMenuSeparatorProps extends MenuSeparatorProps {}\n\nconst ContextMenuSeparator = React.forwardRef<\n ContextMenuSeparatorElement,\n ContextMenuSeparatorProps\n>((props: ScopedProps<ContextMenuSeparatorProps>, forwardedRef) => {\n const { __scopeContextMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Separator {...menuScope} {...separatorProps} ref={forwardedRef} />;\n});\n\nContextMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'ContextMenuArrow';\n\ntype ContextMenuArrowElement = React.ElementRef<typeof MenuPrimitive.Arrow>;\ntype MenuArrowProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Arrow>;\ninterface ContextMenuArrowProps extends MenuArrowProps {}\n\nconst ContextMenuArrow = React.forwardRef<ContextMenuArrowElement, ContextMenuArrowProps>(\n (props: ScopedProps<ContextMenuArrowProps>, forwardedRef) => {\n const { __scopeContextMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Arrow {...menuScope} {...arrowProps} ref={forwardedRef} />;\n }\n);\n\nContextMenuArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'ContextMenuSub';\n\ninterface ContextMenuSubProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst ContextMenuSub: React.FC<ContextMenuSubProps> = (props: ScopedProps<ContextMenuSubProps>) => {\n const { __scopeContextMenu, children, onOpenChange, open: openProp, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n <MenuPrimitive.Sub {...menuScope} open={open} onOpenChange={setOpen}>\n {children}\n </MenuPrimitive.Sub>\n );\n};\n\nContextMenuSub.displayName = SUB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'ContextMenuSubTrigger';\n\ntype ContextMenuSubTriggerElement = React.ElementRef<typeof MenuPrimitive.SubTrigger>;\ntype MenuSubTriggerProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;\ninterface ContextMenuSubTriggerProps extends MenuSubTriggerProps {}\n\nconst ContextMenuSubTrigger = React.forwardRef<\n ContextMenuSubTriggerElement,\n ContextMenuSubTriggerProps\n>((props: ScopedProps<ContextMenuSubTriggerProps>, forwardedRef) => {\n const { __scopeContextMenu, ...triggerItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.SubTrigger {...menuScope} {...triggerItemProps} ref={forwardedRef} />;\n});\n\nContextMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'ContextMenuSubContent';\n\ntype ContextMenuSubContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuSubContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubContent>;\ninterface ContextMenuSubContentProps extends MenuSubContentProps {}\n\nconst ContextMenuSubContent = React.forwardRef<\n ContextMenuSubContentElement,\n ContextMenuSubContentProps\n>((props: ScopedProps<ContextMenuSubContentProps>, forwardedRef) => {\n const { __scopeContextMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n\n return (\n <MenuPrimitive.SubContent\n {...menuScope}\n {...subContentProps}\n ref={forwardedRef}\n style={{\n ...props.style,\n // re-namespace exposed content custom property\n ['--radix-context-menu-content-transform-origin' as any]:\n 'var(--radix-popper-transform-origin)',\n }}\n />\n );\n});\n\nContextMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction whenTouchOrPen<E>(handler: React.PointerEventHandler<E>): React.PointerEventHandler<E> {\n return (event) => (event.pointerType !== 'mouse' ? handler(event) : undefined);\n}\n\nconst Root = ContextMenu;\nconst Trigger = ContextMenuTrigger;\nconst Portal = ContextMenuPortal;\nconst Content = ContextMenuContent;\nconst Group = ContextMenuGroup;\nconst Label = ContextMenuLabel;\nconst Item = ContextMenuItem;\nconst CheckboxItem = ContextMenuCheckboxItem;\nconst RadioGroup = ContextMenuRadioGroup;\nconst RadioItem = ContextMenuRadioItem;\nconst ItemIndicator = ContextMenuItemIndicator;\nconst Separator = ContextMenuSeparator;\nconst Arrow = ContextMenuArrow;\nconst Sub = ContextMenuSub;\nconst SubTrigger = ContextMenuSubTrigger;\nconst SubContent = ContextMenuSubContent;\n\nexport {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuPortal,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n ContextMenuSub,\n ContextMenuSubTrigger,\n ContextMenuSubContent,\n //\n Root,\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 SubTrigger,\n SubContent,\n};\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuPortalProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n ContextMenuSubProps,\n ContextMenuSubTriggerProps,\n ContextMenuSubContentProps,\n};\n"],"names":["createContextMenuScope","ContextMenu","ContextMenuTrigger","ContextMenuPortal","ContextMenuContent","ContextMenuGroup","ContextMenuLabel","ContextMenuItem","ContextMenuCheckboxItem","ContextMenuRadioGroup","ContextMenuRadioItem","ContextMenuItemIndicator","ContextMenuSeparator","ContextMenuArrow","ContextMenuSub","ContextMenuSubTrigger","ContextMenuSubContent","Root","Trigger","Portal","Content","Group","Label","Item","CheckboxItem","RadioGroup","RadioItem","ItemIndicator","Separator","Arrow","Sub","SubTrigger","SubContent","React","composeEventHandlers","createContextScope","Primitive","MenuPrimitive","createMenuScope","useCallbackRef","useControllableState","CONTEXT_MENU_NAME","createContextMenuContext","useMenuScope","ContextMenuProvider","useContextMenuContext","props","__scopeContextMenu","children","onOpenChange","dir","modal","open","setOpen","useState","menuScope","handleOpenChangeProp","handleOpenChange","useCallback","TRIGGER_NAME","forwardRef","forwardedRef","disabled","triggerProps","context","pointRef","useRef","x","y","virtualRef","getBoundingClientRect","DOMRect","fromRect","width","height","current","longPressTimerRef","clearLongPress","window","clearTimeout","handleOpen","event","clientX","clientY","useEffect","undefined","WebkitTouchCallout","style","onContextMenu","preventDefault","onPointerDown","whenTouchOrPen","setTimeout","onPointerMove","onPointerCancel","onPointerUp","PORTAL_NAME","portalProps","CONTENT_NAME","contentProps","hasInteractedOutsideRef","onCloseAutoFocus","defaultPrevented","onInteractOutside","GROUP_NAME","groupProps","LABEL_NAME","labelProps","ITEM_NAME","itemProps","CHECKBOX_ITEM_NAME","checkboxItemProps","RADIO_GROUP_NAME","radioGroupProps","RADIO_ITEM_NAME","radioItemProps","INDICATOR_NAME","itemIndicatorProps","SEPARATOR_NAME","separatorProps","ARROW_NAME","arrowProps","SUB_NAME","openProp","defaultOpen","prop","defaultProp","onChange","SUB_TRIGGER_NAME","triggerItemProps","SUB_CONTENT_NAME","subContentProps","handler","pointerType"],"version":3,"file":"index.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ui/react-context-menu",
3
- "version": "2.0.1",
3
+ "version": "2.0.2-rc.1",
4
4
  "license": "MIT",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -35,5 +35,6 @@
35
35
  },
36
36
  "bugs": {
37
37
  "url": "https://github.com/radix-ui/primitives/issues"
38
- }
38
+ },
39
+ "stableVersion": "2.0.1"
39
40
  }