@radix-ui/react-context-menu 0.1.7-rc.35 → 0.1.7-rc.38
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 +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -2
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +19 -4
- package/dist/index.module.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -20,8 +20,12 @@ type PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
|
20
20
|
export interface ContextMenuTriggerProps extends PrimitiveSpanProps {
|
|
21
21
|
}
|
|
22
22
|
export const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
23
|
+
type MenuPortalProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Portal>;
|
|
24
|
+
export interface ContextMenuPortalProps extends MenuPortalProps {
|
|
25
|
+
}
|
|
26
|
+
export const ContextMenuPortal: React.FC<ContextMenuPortalProps>;
|
|
23
27
|
type MenuContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;
|
|
24
|
-
export interface ContextMenuContentProps extends Omit<MenuContentProps, '
|
|
28
|
+
export interface ContextMenuContentProps extends Omit<MenuContentProps, 'side' | 'sideOffset' | 'align'> {
|
|
25
29
|
}
|
|
26
30
|
export const ContextMenuContent: React.ForwardRefExoticComponent<ContextMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
31
|
type MenuGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>;
|
|
@@ -77,6 +81,7 @@ export interface ContextMenuSubContentProps extends MenuSubContentProps {
|
|
|
77
81
|
export const ContextMenuSubContent: React.ForwardRefExoticComponent<ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
78
82
|
export const Root: React.FC<ContextMenuProps>;
|
|
79
83
|
export const Trigger: React.ForwardRefExoticComponent<ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
84
|
+
export const Portal: React.FC<ContextMenuPortalProps>;
|
|
80
85
|
export const Content: React.ForwardRefExoticComponent<ContextMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
81
86
|
export const Group: React.ForwardRefExoticComponent<ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
82
87
|
export const Label: React.ForwardRefExoticComponent<ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAYA,iBAAiB,KAAK,GAAG,KAAK,CAAC;AAU/B,OAAA,6FAEE,CAAC;AAYH,qBAAqB,MAAM,wBAAwB,CAAC,OAAO,cAAc,IAAI,CAAC,CAAC;AAC/E;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;IAChB;;OAEG;IACH,cAAc,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CAClD;AAED,OAAA,MAAM,aAAa,MAAM,EAAE,CAAC,gBAAgB,CAiC3C,CAAC;AAWF,0BAA0B,MAAM,wBAAwB,CAAC,OAAO,UAAU,IAAI,CAAC,CAAC;AAChF,wCAAkC,SAAQ,kBAAkB;CAAG;AAE/D,OAAA,MAAM,
|
|
1
|
+
{"mappings":";;;;AAYA,iBAAiB,KAAK,GAAG,KAAK,CAAC;AAU/B,OAAA,6FAEE,CAAC;AAYH,qBAAqB,MAAM,wBAAwB,CAAC,OAAO,cAAc,IAAI,CAAC,CAAC;AAC/E;IACE,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;IAC3B,YAAY,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,I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;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 * from './ContextMenu';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,7 @@ var $5de197f6cd80e8e9$exports = {};
|
|
|
34
34
|
$parcel$export($5de197f6cd80e8e9$exports, "createContextMenuScope", () => $5de197f6cd80e8e9$export$1059331f43ddcc82);
|
|
35
35
|
$parcel$export($5de197f6cd80e8e9$exports, "ContextMenu", () => $5de197f6cd80e8e9$export$8dc6765e8be191c7);
|
|
36
36
|
$parcel$export($5de197f6cd80e8e9$exports, "ContextMenuTrigger", () => $5de197f6cd80e8e9$export$be6fc7b1d5b0beb9);
|
|
37
|
+
$parcel$export($5de197f6cd80e8e9$exports, "ContextMenuPortal", () => $5de197f6cd80e8e9$export$14afd0be83e45060);
|
|
37
38
|
$parcel$export($5de197f6cd80e8e9$exports, "ContextMenuContent", () => $5de197f6cd80e8e9$export$572205900c9369e);
|
|
38
39
|
$parcel$export($5de197f6cd80e8e9$exports, "ContextMenuGroup", () => $5de197f6cd80e8e9$export$9860523b0fcdd664);
|
|
39
40
|
$parcel$export($5de197f6cd80e8e9$exports, "ContextMenuLabel", () => $5de197f6cd80e8e9$export$d4b9d3b609a10742);
|
|
@@ -49,6 +50,7 @@ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuSubTrigger", () => $5de197
|
|
|
49
50
|
$parcel$export($5de197f6cd80e8e9$exports, "ContextMenuSubContent", () => $5de197f6cd80e8e9$export$2c967063bd2dc512);
|
|
50
51
|
$parcel$export($5de197f6cd80e8e9$exports, "Root", () => $5de197f6cd80e8e9$export$be92b6f5f03c0fe9);
|
|
51
52
|
$parcel$export($5de197f6cd80e8e9$exports, "Trigger", () => $5de197f6cd80e8e9$export$41fb9f06171c75f4);
|
|
53
|
+
$parcel$export($5de197f6cd80e8e9$exports, "Portal", () => $5de197f6cd80e8e9$export$602eac185826482c);
|
|
52
54
|
$parcel$export($5de197f6cd80e8e9$exports, "Content", () => $5de197f6cd80e8e9$export$7c6e2c02157bb7d2);
|
|
53
55
|
$parcel$export($5de197f6cd80e8e9$exports, "Group", () => $5de197f6cd80e8e9$export$eb2fcfdbd7ba97d4);
|
|
54
56
|
$parcel$export($5de197f6cd80e8e9$exports, "Label", () => $5de197f6cd80e8e9$export$b04be29aa201d4f5);
|
|
@@ -140,7 +142,9 @@ const $5de197f6cd80e8e9$export$be6fc7b1d5b0beb9 = /*#__PURE__*/ $l8XVT$react.for
|
|
|
140
142
|
]);
|
|
141
143
|
return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$react.Fragment, null, /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Anchor, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, {
|
|
142
144
|
virtualRef: virtualRef
|
|
143
|
-
})), /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactprimitive.Primitive.span, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({
|
|
145
|
+
})), /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactprimitive.Primitive.span, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({
|
|
146
|
+
"data-state": context.open ? 'open' : 'closed'
|
|
147
|
+
}, triggerProps, {
|
|
144
148
|
ref: forwardedRef // prevent iOS context menu from appearing
|
|
145
149
|
,
|
|
146
150
|
style: {
|
|
@@ -168,6 +172,17 @@ const $5de197f6cd80e8e9$export$be6fc7b1d5b0beb9 = /*#__PURE__*/ $l8XVT$react.for
|
|
|
168
172
|
/*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$be6fc7b1d5b0beb9, {
|
|
169
173
|
displayName: $5de197f6cd80e8e9$var$TRIGGER_NAME
|
|
170
174
|
});
|
|
175
|
+
/* -------------------------------------------------------------------------------------------------
|
|
176
|
+
* ContextMenuPortal
|
|
177
|
+
* -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$PORTAL_NAME = 'ContextMenuPortal';
|
|
178
|
+
const $5de197f6cd80e8e9$export$14afd0be83e45060 = (props)=>{
|
|
179
|
+
const { __scopeContextMenu: __scopeContextMenu , ...portalProps } = props;
|
|
180
|
+
const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
|
|
181
|
+
return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Portal, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, portalProps));
|
|
182
|
+
};
|
|
183
|
+
/*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$14afd0be83e45060, {
|
|
184
|
+
displayName: $5de197f6cd80e8e9$var$PORTAL_NAME
|
|
185
|
+
});
|
|
171
186
|
/* -------------------------------------------------------------------------------------------------
|
|
172
187
|
* ContextMenuContent
|
|
173
188
|
* -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$CONTENT_NAME = 'ContextMenuContent';
|
|
@@ -178,7 +193,6 @@ const $5de197f6cd80e8e9$export$572205900c9369e = /*#__PURE__*/ $l8XVT$react.forw
|
|
|
178
193
|
const hasInteractedOutsideRef = $l8XVT$react.useRef(false);
|
|
179
194
|
return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Content, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, contentProps, {
|
|
180
195
|
ref: forwardedRef,
|
|
181
|
-
portalled: true,
|
|
182
196
|
side: "right",
|
|
183
197
|
sideOffset: 2,
|
|
184
198
|
align: "start",
|
|
@@ -376,6 +390,7 @@ const $5de197f6cd80e8e9$export$2c967063bd2dc512 = /*#__PURE__*/ $l8XVT$react.for
|
|
|
376
390
|
}
|
|
377
391
|
const $5de197f6cd80e8e9$export$be92b6f5f03c0fe9 = $5de197f6cd80e8e9$export$8dc6765e8be191c7;
|
|
378
392
|
const $5de197f6cd80e8e9$export$41fb9f06171c75f4 = $5de197f6cd80e8e9$export$be6fc7b1d5b0beb9;
|
|
393
|
+
const $5de197f6cd80e8e9$export$602eac185826482c = $5de197f6cd80e8e9$export$14afd0be83e45060;
|
|
379
394
|
const $5de197f6cd80e8e9$export$7c6e2c02157bb7d2 = $5de197f6cd80e8e9$export$572205900c9369e;
|
|
380
395
|
const $5de197f6cd80e8e9$export$eb2fcfdbd7ba97d4 = $5de197f6cd80e8e9$export$9860523b0fcdd664;
|
|
381
396
|
const $5de197f6cd80e8e9$export$b04be29aa201d4f5 = $5de197f6cd80e8e9$export$d4b9d3b609a10742;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;ACeA;;oGAEA,CAEA,MAAMQ,uCAAiB,GAAG,aAA1B,AAAA;AAGA,MAAM,CAACC,8CAAD,EAA2BC,yCAA3B,CAAA,GAAqDR,6CAAkB,CAACM,uCAAD,EAAoB;IAC/FH,uCAD+F;CAApB,CAA7E,AAAA;AAGA,MAAMM,kCAAY,GAA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,GAAGrB,yCAAnB,AAAA;AACA,MAAMsB,yCAAU,GAAGnB,yCAAnB,AAAA;;ADlfA","sources":["packages/react/context-menu/src/index.ts","packages/react/context-menu/src/ContextMenu.tsx"],"sourcesContent":["export * 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\ntype MenuRootProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Root>;\ninterface ContextMenuProps {\n children?: React.ReactNode;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n /**\n * @see https://github.com/theKashey/react-remove-scroll#usage\n */\n allowPinchZoom?: MenuRootProps['allowPinchZoom'];\n}\n\nconst ContextMenu: React.FC<ContextMenuProps> = (props: ScopedProps<ContextMenuProps>) => {\n const { __scopeContextMenu, children, onOpenChange, dir, modal = true, allowPinchZoom } = 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 allowPinchZoom={allowPinchZoom}\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 {...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 * ContextMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'ContextMenuContent';\n\ntype ContextMenuContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;\ninterface ContextMenuContentProps\n extends Omit<MenuContentProps, 'portalled' | '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 portalled\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 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 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 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 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":["React","composeEventHandlers","createContextScope","Primitive","MenuPrimitive","createMenuScope","useCallbackRef","useControllableState","CONTEXT_MENU_NAME","createContextMenuContext","createContextMenuScope","useMenuScope","ContextMenuProvider","useContextMenuContext","ContextMenu","props","__scopeContextMenu","children","onOpenChange","dir","modal","allowPinchZoom","open","setOpen","useState","menuScope","handleOpenChangeProp","handleOpenChange","useCallback","TRIGGER_NAME","ContextMenuTrigger","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","CONTENT_NAME","ContextMenuContent","contentProps","hasInteractedOutsideRef","onCloseAutoFocus","defaultPrevented","onInteractOutside","GROUP_NAME","ContextMenuGroup","groupProps","LABEL_NAME","ContextMenuLabel","labelProps","ITEM_NAME","ContextMenuItem","itemProps","CHECKBOX_ITEM_NAME","ContextMenuCheckboxItem","checkboxItemProps","RADIO_GROUP_NAME","ContextMenuRadioGroup","radioGroupProps","RADIO_ITEM_NAME","ContextMenuRadioItem","radioItemProps","INDICATOR_NAME","ContextMenuItemIndicator","itemIndicatorProps","SEPARATOR_NAME","ContextMenuSeparator","separatorProps","ARROW_NAME","ContextMenuArrow","arrowProps","SUB_NAME","ContextMenuSub","openProp","defaultOpen","prop","defaultProp","onChange","SUB_TRIGGER_NAME","ContextMenuSubTrigger","triggerItemProps","SUB_CONTENT_NAME","ContextMenuSubContent","subContentProps","handler","pointerType","undefined","Root","Trigger","Content","Group","Label","Item","CheckboxItem","RadioGroup","RadioItem","ItemIndicator","Separator","Arrow","Sub","SubTrigger","SubContent"],"version":3,"file":"index.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;ACeA;;oGAEA,CAEA,MAAMQ,uCAAiB,GAAG,aAA1B,AAAA;AAGA,MAAM,CAACC,8CAAD,EAA2BC,yCAA3B,CAAA,GAAqDR,6CAAkB,CAACM,uCAAD,EAAoB;IAC/FH,uCAD+F;CAApB,CAA7E,AAAA;AAGA,MAAMM,kCAAY,GAAGN,uCAAe,EAApC,AAAA;AAQA,MAAM,CAACO,yCAAD,EAAsBC,2CAAtB,CAAA,GACJJ,8CAAwB,CAA0BD,uCAA1B,CAD1B,AAAA;AAeA,MAAMM,yCAAuC,GAAIC,CAAAA,KAAD,GAA0C;IACxF,MAAM,E,oBAAEC,kBAAF,CAAA,E,UAAsBC,QAAtB,CAAA,E,cAAgCC,YAAhC,CAAA,E,KAA8CC,GAA9C,CAAA,SAAmDC,KAAK,GAAG,IAA3D,G,gBAAiEC,cAAAA,CAAAA,EAAjE,GAAoFN,KAA1F,AAAM;IACN,MAAM,CAACO,KAAD,EAAOC,OAAP,CAAA,GAAkBvB,qBAAA,CAAe,KAAf,CAAxB,AAAA;IACA,MAAMyB,SAAS,GAAGd,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yCAAK,GAAG9B,yCAAd,AAAA;AACA,MAAM+B,yCAAG,GAAG5B,yCAAZ,AAAA;AACA,MAAM6B,yCAAU,GAAGtB,yCAAnB,AAAA;AACA,MAAMuB,yCAAU,GAAGpB,yCAAnB,AAAA;;ADrgBA","sources":["packages/react/context-menu/src/index.ts","packages/react/context-menu/src/ContextMenu.tsx"],"sourcesContent":["export * 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\ntype MenuRootProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Root>;\ninterface ContextMenuProps {\n children?: React.ReactNode;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n /**\n * @see https://github.com/theKashey/react-remove-scroll#usage\n */\n allowPinchZoom?: MenuRootProps['allowPinchZoom'];\n}\n\nconst ContextMenu: React.FC<ContextMenuProps> = (props: ScopedProps<ContextMenuProps>) => {\n const { __scopeContextMenu, children, onOpenChange, dir, modal = true, allowPinchZoom } = 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 allowPinchZoom={allowPinchZoom}\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":["React","composeEventHandlers","createContextScope","Primitive","MenuPrimitive","createMenuScope","useCallbackRef","useControllableState","CONTEXT_MENU_NAME","createContextMenuContext","createContextMenuScope","useMenuScope","ContextMenuProvider","useContextMenuContext","ContextMenu","props","__scopeContextMenu","children","onOpenChange","dir","modal","allowPinchZoom","open","setOpen","useState","menuScope","handleOpenChangeProp","handleOpenChange","useCallback","TRIGGER_NAME","ContextMenuTrigger","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","ContextMenuPortal","portalProps","CONTENT_NAME","ContextMenuContent","contentProps","hasInteractedOutsideRef","onCloseAutoFocus","defaultPrevented","onInteractOutside","GROUP_NAME","ContextMenuGroup","groupProps","LABEL_NAME","ContextMenuLabel","labelProps","ITEM_NAME","ContextMenuItem","itemProps","CHECKBOX_ITEM_NAME","ContextMenuCheckboxItem","checkboxItemProps","RADIO_GROUP_NAME","ContextMenuRadioGroup","radioGroupProps","RADIO_ITEM_NAME","ContextMenuRadioItem","radioItemProps","INDICATOR_NAME","ContextMenuItemIndicator","itemIndicatorProps","SEPARATOR_NAME","ContextMenuSeparator","separatorProps","ARROW_NAME","ContextMenuArrow","arrowProps","SUB_NAME","ContextMenuSub","openProp","defaultOpen","prop","defaultProp","onChange","SUB_TRIGGER_NAME","ContextMenuSubTrigger","triggerItemProps","SUB_CONTENT_NAME","ContextMenuSubContent","subContentProps","handler","pointerType","undefined","Root","Trigger","Portal","Content","Group","Label","Item","CheckboxItem","RadioGroup","RadioItem","ItemIndicator","Separator","Arrow","Sub","SubTrigger","SubContent"],"version":3,"file":"index.js.map"}
|
package/dist/index.module.js
CHANGED
|
@@ -3,7 +3,7 @@ import {useState as $3TiJz$useState, useCallback as $3TiJz$useCallback, createEl
|
|
|
3
3
|
import {composeEventHandlers as $3TiJz$composeEventHandlers} from "@radix-ui/primitive";
|
|
4
4
|
import {createContextScope as $3TiJz$createContextScope} from "@radix-ui/react-context";
|
|
5
5
|
import {Primitive as $3TiJz$Primitive} from "@radix-ui/react-primitive";
|
|
6
|
-
import {createMenuScope as $3TiJz$createMenuScope, Root as $3TiJz$Root, Anchor as $3TiJz$Anchor, Content as $3TiJz$Content, Group as $3TiJz$Group, Label as $3TiJz$Label, Item as $3TiJz$Item, CheckboxItem as $3TiJz$CheckboxItem, RadioGroup as $3TiJz$RadioGroup, RadioItem as $3TiJz$RadioItem, ItemIndicator as $3TiJz$ItemIndicator, Separator as $3TiJz$Separator, Arrow as $3TiJz$Arrow, Sub as $3TiJz$Sub, SubTrigger as $3TiJz$SubTrigger, SubContent as $3TiJz$SubContent} from "@radix-ui/react-menu";
|
|
6
|
+
import {createMenuScope as $3TiJz$createMenuScope, Root as $3TiJz$Root, Anchor as $3TiJz$Anchor, Portal as $3TiJz$Portal, Content as $3TiJz$Content, Group as $3TiJz$Group, Label as $3TiJz$Label, Item as $3TiJz$Item, CheckboxItem as $3TiJz$CheckboxItem, RadioGroup as $3TiJz$RadioGroup, RadioItem as $3TiJz$RadioItem, ItemIndicator as $3TiJz$ItemIndicator, Separator as $3TiJz$Separator, Arrow as $3TiJz$Arrow, Sub as $3TiJz$Sub, SubTrigger as $3TiJz$SubTrigger, SubContent as $3TiJz$SubContent} from "@radix-ui/react-menu";
|
|
7
7
|
import {useCallbackRef as $3TiJz$useCallbackRef} from "@radix-ui/react-use-callback-ref";
|
|
8
8
|
import {useControllableState as $3TiJz$useControllableState} from "@radix-ui/react-use-controllable-state";
|
|
9
9
|
|
|
@@ -15,6 +15,7 @@ var $1b0217ee4a91d156$exports = {};
|
|
|
15
15
|
$parcel$export($1b0217ee4a91d156$exports, "createContextMenuScope", () => $1b0217ee4a91d156$export$1059331f43ddcc82);
|
|
16
16
|
$parcel$export($1b0217ee4a91d156$exports, "ContextMenu", () => $1b0217ee4a91d156$export$8dc6765e8be191c7);
|
|
17
17
|
$parcel$export($1b0217ee4a91d156$exports, "ContextMenuTrigger", () => $1b0217ee4a91d156$export$be6fc7b1d5b0beb9);
|
|
18
|
+
$parcel$export($1b0217ee4a91d156$exports, "ContextMenuPortal", () => $1b0217ee4a91d156$export$14afd0be83e45060);
|
|
18
19
|
$parcel$export($1b0217ee4a91d156$exports, "ContextMenuContent", () => $1b0217ee4a91d156$export$572205900c9369e);
|
|
19
20
|
$parcel$export($1b0217ee4a91d156$exports, "ContextMenuGroup", () => $1b0217ee4a91d156$export$9860523b0fcdd664);
|
|
20
21
|
$parcel$export($1b0217ee4a91d156$exports, "ContextMenuLabel", () => $1b0217ee4a91d156$export$d4b9d3b609a10742);
|
|
@@ -30,6 +31,7 @@ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuSubTrigger", () => $1b0217
|
|
|
30
31
|
$parcel$export($1b0217ee4a91d156$exports, "ContextMenuSubContent", () => $1b0217ee4a91d156$export$2c967063bd2dc512);
|
|
31
32
|
$parcel$export($1b0217ee4a91d156$exports, "Root", () => $1b0217ee4a91d156$export$be92b6f5f03c0fe9);
|
|
32
33
|
$parcel$export($1b0217ee4a91d156$exports, "Trigger", () => $1b0217ee4a91d156$export$41fb9f06171c75f4);
|
|
34
|
+
$parcel$export($1b0217ee4a91d156$exports, "Portal", () => $1b0217ee4a91d156$export$602eac185826482c);
|
|
33
35
|
$parcel$export($1b0217ee4a91d156$exports, "Content", () => $1b0217ee4a91d156$export$7c6e2c02157bb7d2);
|
|
34
36
|
$parcel$export($1b0217ee4a91d156$exports, "Group", () => $1b0217ee4a91d156$export$eb2fcfdbd7ba97d4);
|
|
35
37
|
$parcel$export($1b0217ee4a91d156$exports, "Label", () => $1b0217ee4a91d156$export$b04be29aa201d4f5);
|
|
@@ -121,7 +123,9 @@ const $1b0217ee4a91d156$export$be6fc7b1d5b0beb9 = /*#__PURE__*/ $3TiJz$forwardRe
|
|
|
121
123
|
]);
|
|
122
124
|
return /*#__PURE__*/ $3TiJz$createElement($3TiJz$Fragment, null, /*#__PURE__*/ $3TiJz$createElement($3TiJz$Anchor, $3TiJz$babelruntimehelpersesmextends({}, menuScope, {
|
|
123
125
|
virtualRef: virtualRef
|
|
124
|
-
})), /*#__PURE__*/ $3TiJz$createElement($3TiJz$Primitive.span, $3TiJz$babelruntimehelpersesmextends({
|
|
126
|
+
})), /*#__PURE__*/ $3TiJz$createElement($3TiJz$Primitive.span, $3TiJz$babelruntimehelpersesmextends({
|
|
127
|
+
"data-state": context.open ? 'open' : 'closed'
|
|
128
|
+
}, triggerProps, {
|
|
125
129
|
ref: forwardedRef // prevent iOS context menu from appearing
|
|
126
130
|
,
|
|
127
131
|
style: {
|
|
@@ -149,6 +153,17 @@ const $1b0217ee4a91d156$export$be6fc7b1d5b0beb9 = /*#__PURE__*/ $3TiJz$forwardRe
|
|
|
149
153
|
/*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$be6fc7b1d5b0beb9, {
|
|
150
154
|
displayName: $1b0217ee4a91d156$var$TRIGGER_NAME
|
|
151
155
|
});
|
|
156
|
+
/* -------------------------------------------------------------------------------------------------
|
|
157
|
+
* ContextMenuPortal
|
|
158
|
+
* -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$PORTAL_NAME = 'ContextMenuPortal';
|
|
159
|
+
const $1b0217ee4a91d156$export$14afd0be83e45060 = (props)=>{
|
|
160
|
+
const { __scopeContextMenu: __scopeContextMenu , ...portalProps } = props;
|
|
161
|
+
const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
|
|
162
|
+
return /*#__PURE__*/ $3TiJz$createElement($3TiJz$Portal, $3TiJz$babelruntimehelpersesmextends({}, menuScope, portalProps));
|
|
163
|
+
};
|
|
164
|
+
/*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$14afd0be83e45060, {
|
|
165
|
+
displayName: $1b0217ee4a91d156$var$PORTAL_NAME
|
|
166
|
+
});
|
|
152
167
|
/* -------------------------------------------------------------------------------------------------
|
|
153
168
|
* ContextMenuContent
|
|
154
169
|
* -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$CONTENT_NAME = 'ContextMenuContent';
|
|
@@ -159,7 +174,6 @@ const $1b0217ee4a91d156$export$572205900c9369e = /*#__PURE__*/ $3TiJz$forwardRef
|
|
|
159
174
|
const hasInteractedOutsideRef = $3TiJz$useRef(false);
|
|
160
175
|
return /*#__PURE__*/ $3TiJz$createElement($3TiJz$Content, $3TiJz$babelruntimehelpersesmextends({}, menuScope, contentProps, {
|
|
161
176
|
ref: forwardedRef,
|
|
162
|
-
portalled: true,
|
|
163
177
|
side: "right",
|
|
164
178
|
sideOffset: 2,
|
|
165
179
|
align: "start",
|
|
@@ -357,6 +371,7 @@ const $1b0217ee4a91d156$export$2c967063bd2dc512 = /*#__PURE__*/ $3TiJz$forwardRe
|
|
|
357
371
|
}
|
|
358
372
|
const $1b0217ee4a91d156$export$be92b6f5f03c0fe9 = $1b0217ee4a91d156$export$8dc6765e8be191c7;
|
|
359
373
|
const $1b0217ee4a91d156$export$41fb9f06171c75f4 = $1b0217ee4a91d156$export$be6fc7b1d5b0beb9;
|
|
374
|
+
const $1b0217ee4a91d156$export$602eac185826482c = $1b0217ee4a91d156$export$14afd0be83e45060;
|
|
360
375
|
const $1b0217ee4a91d156$export$7c6e2c02157bb7d2 = $1b0217ee4a91d156$export$572205900c9369e;
|
|
361
376
|
const $1b0217ee4a91d156$export$eb2fcfdbd7ba97d4 = $1b0217ee4a91d156$export$9860523b0fcdd664;
|
|
362
377
|
const $1b0217ee4a91d156$export$b04be29aa201d4f5 = $1b0217ee4a91d156$export$d4b9d3b609a10742;
|
|
@@ -374,5 +389,5 @@ const $1b0217ee4a91d156$export$6d4de93b380beddf = $1b0217ee4a91d156$export$2c967
|
|
|
374
389
|
|
|
375
390
|
|
|
376
391
|
|
|
377
|
-
export {$1b0217ee4a91d156$export$1059331f43ddcc82 as createContextMenuScope, $1b0217ee4a91d156$export$8dc6765e8be191c7 as ContextMenu, $1b0217ee4a91d156$export$be6fc7b1d5b0beb9 as ContextMenuTrigger, $1b0217ee4a91d156$export$572205900c9369e as ContextMenuContent, $1b0217ee4a91d156$export$9860523b0fcdd664 as ContextMenuGroup, $1b0217ee4a91d156$export$d4b9d3b609a10742 as ContextMenuLabel, $1b0217ee4a91d156$export$16a26dc176a49100 as ContextMenuItem, $1b0217ee4a91d156$export$b6adbe51d5d8b7ec as ContextMenuCheckboxItem, $1b0217ee4a91d156$export$db5c89af5ed9aa07 as ContextMenuRadioGroup, $1b0217ee4a91d156$export$8a727d09a7d9bfc2 as ContextMenuRadioItem, $1b0217ee4a91d156$export$9ed8194dee42d94b as ContextMenuItemIndicator, $1b0217ee4a91d156$export$8d6b009fadfe1207 as ContextMenuSeparator, $1b0217ee4a91d156$export$f47d0a58228a61e2 as ContextMenuArrow, $1b0217ee4a91d156$export$5bc21d1c00c4b201 as ContextMenuSub, $1b0217ee4a91d156$export$30b2b5c64556d316 as ContextMenuSubTrigger, $1b0217ee4a91d156$export$2c967063bd2dc512 as ContextMenuSubContent, $1b0217ee4a91d156$export$be92b6f5f03c0fe9 as Root, $1b0217ee4a91d156$export$41fb9f06171c75f4 as Trigger, $1b0217ee4a91d156$export$7c6e2c02157bb7d2 as Content, $1b0217ee4a91d156$export$eb2fcfdbd7ba97d4 as Group, $1b0217ee4a91d156$export$b04be29aa201d4f5 as Label, $1b0217ee4a91d156$export$6d08773d2e66f8f2 as Item, $1b0217ee4a91d156$export$16ce288f89fa631c as CheckboxItem, $1b0217ee4a91d156$export$a98f0dcb43a68a25 as RadioGroup, $1b0217ee4a91d156$export$371ab307eab489c0 as RadioItem, $1b0217ee4a91d156$export$c3468e2714d175fa as ItemIndicator, $1b0217ee4a91d156$export$1ff3c3f08ae963c0 as Separator, $1b0217ee4a91d156$export$21b07c8f274aebd5 as Arrow, $1b0217ee4a91d156$export$d7a01e11500dfb6f as Sub, $1b0217ee4a91d156$export$2ea8a7a591ac5eac as SubTrigger, $1b0217ee4a91d156$export$6d4de93b380beddf as SubContent};
|
|
392
|
+
export {$1b0217ee4a91d156$export$1059331f43ddcc82 as createContextMenuScope, $1b0217ee4a91d156$export$8dc6765e8be191c7 as ContextMenu, $1b0217ee4a91d156$export$be6fc7b1d5b0beb9 as ContextMenuTrigger, $1b0217ee4a91d156$export$14afd0be83e45060 as ContextMenuPortal, $1b0217ee4a91d156$export$572205900c9369e as ContextMenuContent, $1b0217ee4a91d156$export$9860523b0fcdd664 as ContextMenuGroup, $1b0217ee4a91d156$export$d4b9d3b609a10742 as ContextMenuLabel, $1b0217ee4a91d156$export$16a26dc176a49100 as ContextMenuItem, $1b0217ee4a91d156$export$b6adbe51d5d8b7ec as ContextMenuCheckboxItem, $1b0217ee4a91d156$export$db5c89af5ed9aa07 as ContextMenuRadioGroup, $1b0217ee4a91d156$export$8a727d09a7d9bfc2 as ContextMenuRadioItem, $1b0217ee4a91d156$export$9ed8194dee42d94b as ContextMenuItemIndicator, $1b0217ee4a91d156$export$8d6b009fadfe1207 as ContextMenuSeparator, $1b0217ee4a91d156$export$f47d0a58228a61e2 as ContextMenuArrow, $1b0217ee4a91d156$export$5bc21d1c00c4b201 as ContextMenuSub, $1b0217ee4a91d156$export$30b2b5c64556d316 as ContextMenuSubTrigger, $1b0217ee4a91d156$export$2c967063bd2dc512 as ContextMenuSubContent, $1b0217ee4a91d156$export$be92b6f5f03c0fe9 as Root, $1b0217ee4a91d156$export$41fb9f06171c75f4 as Trigger, $1b0217ee4a91d156$export$602eac185826482c as Portal, $1b0217ee4a91d156$export$7c6e2c02157bb7d2 as Content, $1b0217ee4a91d156$export$eb2fcfdbd7ba97d4 as Group, $1b0217ee4a91d156$export$b04be29aa201d4f5 as Label, $1b0217ee4a91d156$export$6d08773d2e66f8f2 as Item, $1b0217ee4a91d156$export$16ce288f89fa631c as CheckboxItem, $1b0217ee4a91d156$export$a98f0dcb43a68a25 as RadioGroup, $1b0217ee4a91d156$export$371ab307eab489c0 as RadioItem, $1b0217ee4a91d156$export$c3468e2714d175fa as ItemIndicator, $1b0217ee4a91d156$export$1ff3c3f08ae963c0 as Separator, $1b0217ee4a91d156$export$21b07c8f274aebd5 as Arrow, $1b0217ee4a91d156$export$d7a01e11500dfb6f as Sub, $1b0217ee4a91d156$export$2ea8a7a591ac5eac as SubTrigger, $1b0217ee4a91d156$export$6d4de93b380beddf as SubContent};
|
|
378
393
|
//# sourceMappingURL=index.module.js.map
|
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;ACeA;;oGAEA,CAEA,MAAMQ,uCAAiB,GAAG,aAA1B,AAAA;AAGA,MAAM,CAACC,8CAAD,EAA2BC,yCAA3B,CAAA,GAAqDR,yBAAkB,CAACM,uCAAD,EAAoB;IAC/FH,sBAD+F;CAApB,CAA7E,AAAA;AAGA,MAAMM,kCAAY,GAAGN,sBAAe,EAApC,AAAA;AAQA,MAAM,CAACO,yCAAD,EAAsBC,2CAAtB,CAAA,GACJJ,8CAAwB,CAA0BD,uCAA1B,CAD1B,AAAA;AAeA,MAAMM,yCAAuC,GAAIC,CAAAA,KAAD,GAA0C;IACxF,MAAM,E,oBAAEC,kBAAF,CAAA,E,UAAsBC,QAAtB,CAAA,E,cAAgCC,YAAhC,CAAA,E,KAA8CC,GAA9C,CAAA,SAAmDC,KAAK,GAAG,IAA3D,G,gBAAiEC,cAAAA,CAAAA,EAAjE,GAAoFN,KAA1F,AAAM;IACN,MAAM,CAACO,KAAD,EAAOC,OAAP,CAAA,GAAkBvB,eAAA,CAAe,KAAf,CAAxB,AAAA;IACA,MAAMyB,SAAS,GAAGd,kCAAY,CAACK,kBAAD,CAA9B,AAAA;IACA,MAAMU,oBAAoB,GAAGpB,qBAAc,CAACY,YAAD,CAA3C,AAAA;IAEA,MAAMS,gBAAgB,GAAG3B,kBAAA,CACtBsB,CAAAA,IAAD,GAAmB;QACjBC,OAAO,CAACD,IAAD,CAAP,CAAAC;QACAG,oBAAoB,CAACJ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MAAMsG,yCAAO,GAAGtF,yCAAhB,AAAA;AACA,MAAMuF,yCAAO,GAAGnD,wCAAhB,AAAA;AACA,MAAMoD,yCAAK,GAAG7C,yCAAd,AAAA;AACA,MAAM8C,yCAAK,GAAG3C,yCAAd,AAAA;AACA,MAAM4C,yCAAI,GAAGzC,yCAAb,AAAA;AACA,MAAM0C,yCAAY,GAAGvC,yCAArB,AAAA;AACA,MAAMwC,yCAAU,GAAGrC,yCAAnB,AAAA;AACA,MAAMsC,yCAAS,GAAGnC,yCAAlB,AAAA;AACA,MAAMoC,yCAAa,GAAGjC,yCAAtB,AAAA;AACA,MAAMkC,yCAAS,GAAG/B,yCAAlB,AAAA;AACA,MAAMgC,yCAAK,GAAG7B,yCAAd,AAAA;AACA,MAAM8B,yCAAG,GAAG3B,yCAAZ,AAAA;AACA,MAAM4B,yCAAU,GAAGrB,yCAAnB,AAAA;AACA,MAAMsB,yCAAU,GAAGnB,yCAAnB,AAAA;;ADlfA","sources":["packages/react/context-menu/src/index.ts","packages/react/context-menu/src/ContextMenu.tsx"],"sourcesContent":["export * 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\ntype MenuRootProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Root>;\ninterface ContextMenuProps {\n children?: React.ReactNode;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n /**\n * @see https://github.com/theKashey/react-remove-scroll#usage\n */\n allowPinchZoom?: MenuRootProps['allowPinchZoom'];\n}\n\nconst ContextMenu: React.FC<ContextMenuProps> = (props: ScopedProps<ContextMenuProps>) => {\n const { __scopeContextMenu, children, onOpenChange, dir, modal = true, allowPinchZoom } = 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 allowPinchZoom={allowPinchZoom}\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 {...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 * ContextMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'ContextMenuContent';\n\ntype ContextMenuContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;\ninterface ContextMenuContentProps\n extends Omit<MenuContentProps, 'portalled' | '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 portalled\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 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 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 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 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":["React","composeEventHandlers","createContextScope","Primitive","MenuPrimitive","createMenuScope","useCallbackRef","useControllableState","CONTEXT_MENU_NAME","createContextMenuContext","createContextMenuScope","useMenuScope","ContextMenuProvider","useContextMenuContext","ContextMenu","props","__scopeContextMenu","children","onOpenChange","dir","modal","allowPinchZoom","open","setOpen","useState","menuScope","handleOpenChangeProp","handleOpenChange","useCallback","TRIGGER_NAME","ContextMenuTrigger","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","CONTENT_NAME","ContextMenuContent","contentProps","hasInteractedOutsideRef","onCloseAutoFocus","defaultPrevented","onInteractOutside","GROUP_NAME","ContextMenuGroup","groupProps","LABEL_NAME","ContextMenuLabel","labelProps","ITEM_NAME","ContextMenuItem","itemProps","CHECKBOX_ITEM_NAME","ContextMenuCheckboxItem","checkboxItemProps","RADIO_GROUP_NAME","ContextMenuRadioGroup","radioGroupProps","RADIO_ITEM_NAME","ContextMenuRadioItem","radioItemProps","INDICATOR_NAME","ContextMenuItemIndicator","itemIndicatorProps","SEPARATOR_NAME","ContextMenuSeparator","separatorProps","ARROW_NAME","ContextMenuArrow","arrowProps","SUB_NAME","ContextMenuSub","openProp","defaultOpen","prop","defaultProp","onChange","SUB_TRIGGER_NAME","ContextMenuSubTrigger","triggerItemProps","SUB_CONTENT_NAME","ContextMenuSubContent","subContentProps","handler","pointerType","undefined","Root","Trigger","Content","Group","Label","Item","CheckboxItem","RadioGroup","RadioItem","ItemIndicator","Separator","Arrow","Sub","SubTrigger","SubContent"],"version":3,"file":"index.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;ACeA;;oGAEA,CAEA,MAAMQ,uCAAiB,GAAG,aAA1B,AAAA;AAGA,MAAM,CAACC,8CAAD,EAA2BC,yCAA3B,CAAA,GAAqDR,yBAAkB,CAACM,uCAAD,EAAoB;IAC/FH,sBAD+F;CAAp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AAAA;AACA,MAAMyG,yCAAO,GAAGzF,yCAAhB,AAAA;AACA,MAAM0F,yCAAM,GAAGtD,yCAAf,AAAA;AACA,MAAMuD,yCAAO,GAAGpD,wCAAhB,AAAA;AACA,MAAMqD,yCAAK,GAAG9C,yCAAd,AAAA;AACA,MAAM+C,yCAAK,GAAG5C,yCAAd,AAAA;AACA,MAAM6C,yCAAI,GAAG1C,yCAAb,AAAA;AACA,MAAM2C,yCAAY,GAAGxC,yCAArB,AAAA;AACA,MAAMyC,yCAAU,GAAGtC,yCAAnB,AAAA;AACA,MAAMuC,yCAAS,GAAGpC,yCAAlB,AAAA;AACA,MAAMqC,yCAAa,GAAGlC,yCAAtB,AAAA;AACA,MAAMmC,yCAAS,GAAGhC,yCAAlB,AAAA;AACA,MAAMiC,yCAAK,GAAG9B,yCAAd,AAAA;AACA,MAAM+B,yCAAG,GAAG5B,yCAAZ,AAAA;AACA,MAAM6B,yCAAU,GAAGtB,yCAAnB,AAAA;AACA,MAAMuB,yCAAU,GAAGpB,yCAAnB,AAAA;;ADrgBA","sources":["packages/react/context-menu/src/index.ts","packages/react/context-menu/src/ContextMenu.tsx"],"sourcesContent":["export * 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\ntype MenuRootProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Root>;\ninterface ContextMenuProps {\n children?: React.ReactNode;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n /**\n * @see https://github.com/theKashey/react-remove-scroll#usage\n */\n allowPinchZoom?: MenuRootProps['allowPinchZoom'];\n}\n\nconst ContextMenu: React.FC<ContextMenuProps> = (props: ScopedProps<ContextMenuProps>) => {\n const { __scopeContextMenu, children, onOpenChange, dir, modal = true, allowPinchZoom } = 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 allowPinchZoom={allowPinchZoom}\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":["React","composeEventHandlers","createContextScope","Primitive","MenuPrimitive","createMenuScope","useCallbackRef","useControllableState","CONTEXT_MENU_NAME","createContextMenuContext","createContextMenuScope","useMenuScope","ContextMenuProvider","useContextMenuContext","ContextMenu","props","__scopeContextMenu","children","onOpenChange","dir","modal","allowPinchZoom","open","setOpen","useState","menuScope","handleOpenChangeProp","handleOpenChange","useCallback","TRIGGER_NAME","ContextMenuTrigger","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","ContextMenuPortal","portalProps","CONTENT_NAME","ContextMenuContent","contentProps","hasInteractedOutsideRef","onCloseAutoFocus","defaultPrevented","onInteractOutside","GROUP_NAME","ContextMenuGroup","groupProps","LABEL_NAME","ContextMenuLabel","labelProps","ITEM_NAME","ContextMenuItem","itemProps","CHECKBOX_ITEM_NAME","ContextMenuCheckboxItem","checkboxItemProps","RADIO_GROUP_NAME","ContextMenuRadioGroup","radioGroupProps","RADIO_ITEM_NAME","ContextMenuRadioItem","radioItemProps","INDICATOR_NAME","ContextMenuItemIndicator","itemIndicatorProps","SEPARATOR_NAME","ContextMenuSeparator","separatorProps","ARROW_NAME","ContextMenuArrow","arrowProps","SUB_NAME","ContextMenuSub","openProp","defaultOpen","prop","defaultProp","onChange","SUB_TRIGGER_NAME","ContextMenuSubTrigger","triggerItemProps","SUB_CONTENT_NAME","ContextMenuSubContent","subContentProps","handler","pointerType","undefined","Root","Trigger","Portal","Content","Group","Label","Item","CheckboxItem","RadioGroup","RadioItem","ItemIndicator","Separator","Arrow","Sub","SubTrigger","SubContent"],"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": "0.1.7-rc.
|
|
3
|
+
"version": "0.1.7-rc.38",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/runtime": "^7.13.10",
|
|
20
20
|
"@radix-ui/primitive": "0.1.0",
|
|
21
|
-
"@radix-ui/react-context": "0.1.2-rc.
|
|
22
|
-
"@radix-ui/react-menu": "0.1.7-rc.
|
|
23
|
-
"@radix-ui/react-primitive": "0.1.5-rc.
|
|
24
|
-
"@radix-ui/react-use-callback-ref": "0.1.1-rc.
|
|
25
|
-
"@radix-ui/react-use-controllable-state": "0.1.1-rc.
|
|
21
|
+
"@radix-ui/react-context": "0.1.2-rc.35",
|
|
22
|
+
"@radix-ui/react-menu": "0.1.7-rc.38",
|
|
23
|
+
"@radix-ui/react-primitive": "0.1.5-rc.35",
|
|
24
|
+
"@radix-ui/react-use-callback-ref": "0.1.1-rc.35",
|
|
25
|
+
"@radix-ui/react-use-controllable-state": "0.1.1-rc.35"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^16.8 || ^17.0 || ^18.0",
|