@radix-ui/react-context-menu 0.1.7-rc.3 → 0.1.7-rc.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -4,11 +4,16 @@ import { Primitive } from "@radix-ui/react-primitive";
4
4
  import * as MenuPrimitive from "@radix-ui/react-menu";
5
5
  type Direction = 'ltr' | 'rtl';
6
6
  export const createContextMenuScope: import("@radix-ui/react-context").CreateScope;
7
+ type MenuRootProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Root>;
7
8
  export interface ContextMenuProps {
9
+ children?: React.ReactNode;
8
10
  onOpenChange?(open: boolean): void;
9
11
  dir?: Direction;
10
12
  modal?: boolean;
11
- children?: React.ReactNode;
13
+ /**
14
+ * @see https://github.com/theKashey/react-remove-scroll#usage
15
+ */
16
+ allowPinchZoom?: MenuRootProps['allowPinchZoom'];
12
17
  }
13
18
  export const ContextMenu: React.FC<ContextMenuProps>;
14
19
  type PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;
@@ -16,7 +21,7 @@ export interface ContextMenuTriggerProps extends PrimitiveSpanProps {
16
21
  }
17
22
  export const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
18
23
  type MenuContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;
19
- export interface ContextMenuContentProps extends Omit<MenuContentProps, 'portalled' | 'side' | 'align'> {
24
+ export interface ContextMenuContentProps extends Omit<MenuContentProps, 'portalled' | 'side' | 'sideOffset' | 'align'> {
20
25
  }
21
26
  export const ContextMenuContent: React.ForwardRefExoticComponent<ContextMenuContentProps & React.RefAttributes<HTMLDivElement>>;
22
27
  type MenuGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>;
@@ -31,10 +36,6 @@ type MenuItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Item>;
31
36
  export interface ContextMenuItemProps extends MenuItemProps {
32
37
  }
33
38
  export const ContextMenuItem: React.ForwardRefExoticComponent<ContextMenuItemProps & React.RefAttributes<HTMLDivElement>>;
34
- type MenuSubTriggerProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;
35
- export interface ContextMenuTriggerItemProps extends MenuSubTriggerProps {
36
- }
37
- export const ContextMenuTriggerItem: React.ForwardRefExoticComponent<ContextMenuTriggerItemProps & React.RefAttributes<HTMLDivElement>>;
38
39
  type MenuCheckboxItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>;
39
40
  export interface ContextMenuCheckboxItemProps extends MenuCheckboxItemProps {
40
41
  }
@@ -59,18 +60,35 @@ type MenuArrowProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Arrow>
59
60
  export interface ContextMenuArrowProps extends MenuArrowProps {
60
61
  }
61
62
  export const ContextMenuArrow: React.ForwardRefExoticComponent<ContextMenuArrowProps & React.RefAttributes<SVGSVGElement>>;
63
+ export interface ContextMenuSubProps {
64
+ children?: React.ReactNode;
65
+ open?: boolean;
66
+ defaultOpen?: boolean;
67
+ onOpenChange?(open: boolean): void;
68
+ }
69
+ export const ContextMenuSub: React.FC<ContextMenuSubProps>;
70
+ type MenuSubTriggerProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;
71
+ export interface ContextMenuSubTriggerProps extends MenuSubTriggerProps {
72
+ }
73
+ export const ContextMenuSubTrigger: React.ForwardRefExoticComponent<ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
74
+ type MenuSubContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubContent>;
75
+ export interface ContextMenuSubContentProps extends MenuSubContentProps {
76
+ }
77
+ export const ContextMenuSubContent: React.ForwardRefExoticComponent<ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
62
78
  export const Root: React.FC<ContextMenuProps>;
63
79
  export const Trigger: React.ForwardRefExoticComponent<ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
64
80
  export const Content: React.ForwardRefExoticComponent<ContextMenuContentProps & React.RefAttributes<HTMLDivElement>>;
65
81
  export const Group: React.ForwardRefExoticComponent<ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
66
82
  export const Label: React.ForwardRefExoticComponent<ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
67
83
  export const Item: React.ForwardRefExoticComponent<ContextMenuItemProps & React.RefAttributes<HTMLDivElement>>;
68
- export const TriggerItem: React.ForwardRefExoticComponent<ContextMenuTriggerItemProps & React.RefAttributes<HTMLDivElement>>;
69
84
  export const CheckboxItem: React.ForwardRefExoticComponent<ContextMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
70
85
  export const RadioGroup: React.ForwardRefExoticComponent<ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
71
86
  export const RadioItem: React.ForwardRefExoticComponent<ContextMenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
72
87
  export const ItemIndicator: React.ForwardRefExoticComponent<ContextMenuItemIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
73
88
  export const Separator: React.ForwardRefExoticComponent<ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
74
89
  export const Arrow: React.ForwardRefExoticComponent<ContextMenuArrowProps & React.RefAttributes<SVGSVGElement>>;
90
+ export const Sub: React.FC<ContextMenuSubProps>;
91
+ export const SubTrigger: React.ForwardRefExoticComponent<ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
92
+ export const SubContent: React.ForwardRefExoticComponent<ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
75
93
 
76
94
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"mappings":"A;A;A;A;AAWA,iBAAiB,KAAK,GAAG,KAAK,CAAC;AAU/B,OAAA,6FAEE,CAAC;AAaH;IACE,YAAY,CAAC,CAAC,IAAI,EAAE,OAAO,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,cAAc,UAAU,CAAC,CAAC;AAC3F,2CAAqC,SAAQ,mBAAmB;CAAG;AAEnE,OAAA,MAAM,wHAOJ,CAAC;AAWH,0BAA0B,MAAM,wBAAwB,CAAC,OAAO,cAAc,SAAS,CAAC,CAAC;AACzF,0CAAoC,SAAQ,kBAAkB;CAAG;AAEjE,OAAA,MAAM,sHAOJ,CAAC;AAWH,8BAA8B,MAAM,wBAAwB,CAAC,OAAO,cAAc,aAAa,CAAC,CAAC;AACjG,8CAAwC,SAAQ,sBAAsB;CAAG;AAEzE,OAAA,MAAM,+HAOJ,CAAC;AAWH,0BAA0B,MAAM,wBAAwB,CAAC,OAAO,cAAc,SAAS,CAAC,CAAC;AACzF,0CAAoC,SAAQ,kBAAkB;CAAG;AAEjE,OAAA,MAAM,sHAOJ,CAAC;AAWH,sBAAsB,MAAM,wBAAwB,CAAC,OAAO,cAAc,KAAK,CAAC,CAAC;AACjF,sCAAgC,SAAQ,cAAc;CAAG;AAEzD,OAAA,MAAM,6GAML,CAAC;AAUF,OAAA,MAAM,gCAAkB,CAAC;AACzB,OAAA,MAAM,wGAA4B,CAAC;AACnC,OAAA,MAAM,uGAA4B,CAAC;AACnC,OAAA,MAAM,mGAAwB,CAAC;AAC/B,OAAA,MAAM,mGAAwB,CAAC;AAC/B,OAAA,MAAM,iGAAsB,CAAC;AAC7B,OAAA,MAAM,+GAAoC,CAAC;AAC3C,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","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"],"sourcesContent":[null,null],"names":[],"version":3,"file":"index.d.ts.map"}
1
+ {"mappings":";;;;AAYA,iBAAiB,KAAK,GAA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,wHAoBJ,CAAC;AAUH,OAAA,MAAM,gCAAkB,CAAC;AACzB,OAAA,MAAM,wGAA4B,CAAC;AACnC,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
@@ -1,2 +1,397 @@
1
- var e,t=require("@radix-ui/react-use-callback-ref").useCallbackRef,n=require("@radix-ui/react-menu"),o=p({},n),r=n.createMenuScope,c=require("@radix-ui/react-primitive").Primitive,s=require("@radix-ui/react-context").createContextScope,u=require("@radix-ui/primitive").composeEventHandlers,a=p({},require("react")),i=(e=require("@babel/runtime/helpers/extends"))&&e.__esModule?e.default:e;function p(e,t){return Object.keys(t).forEach((function(n){"default"!==n&&"__esModule"!==n&&Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})),e}const[x,l]=s("ContextMenu",[r]);exports.createContextMenuScope=l;const C=r(),[f,d]=x("ContextMenu"),m=e=>{const{__scopeContextMenu:n,children:r,onOpenChange:c,dir:s,modal:u=!0}=e,[p,x]=a.useState(!1),l=R("ContextMenu",n),d=C(n),m=t(c),M=a.useCallback((e=>{x(e),m(e)}),[m]);return l.isInsideContent?/*#__PURE__*/a.createElement(f,{scope:n,isRootMenu:!1,open:p,onOpenChange:M,modal:u},/*#__PURE__*/a.createElement(o.Sub,i({},d,{open:p,onOpenChange:M}),r)):/*#__PURE__*/a.createElement(f,{scope:n,isRootMenu:!0,open:p,onOpenChange:M,modal:u},/*#__PURE__*/a.createElement(o.Root,i({},d,{dir:s,open:p,onOpenChange:M,modal:u}),r))};exports.ContextMenu=m;const M=/*#__PURE__*/a.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=d("ContextMenuTrigger",n),p=C(n),x=a.useRef({x:0,y:0}),l=a.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...x.current})}),f=a.useRef(0),m=a.useCallback((()=>window.clearTimeout(f.current)),[]),M=e=>{x.current={x:e.clientX,y:e.clientY},s.onOpenChange(!0)};return a.useEffect((()=>m),[m]),/*#__PURE__*/a.createElement(_,{scope:n,isInsideContent:!1},/*#__PURE__*/a.createElement(o.Anchor,i({},p,{virtualRef:l})),/*#__PURE__*/a.createElement(c.span,i({},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:u(e.onContextMenu,(e=>{m(),e.preventDefault(),M(e)})),onPointerDown:u(e.onPointerDown,S((e=>{m(),f.current=window.setTimeout((()=>M(e)),700)}))),onPointerMove:u(e.onPointerMove,S(m)),onPointerCancel:u(e.onPointerCancel,S(m)),onPointerUp:u(e.onPointerUp,S(m))})))}));exports.ContextMenuTrigger=M;const[_,R]=x("ContextMenuContent",{isInsideContent:!1}),g=/*#__PURE__*/a.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,c=d("ContextMenuContent",n),s=C(n),u={...r,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)"}};/*#__PURE__*/return a.createElement(_,{scope:n,isInsideContent:!0},c.isRootMenu?/*#__PURE__*/a.createElement(E,i({__scopeContextMenu:n},u,{ref:t})):/*#__PURE__*/a.createElement(o.Content,i({},s,u,{ref:t})))}));exports.ContextMenuContent=g;const E=/*#__PURE__*/a.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,c=d("ContextMenuContent",n),s=C(n),u=a.useRef(!1);/*#__PURE__*/return a.createElement(o.Content,i({},s,r,{ref:t,portalled:!0,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:t=>{var n;null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),!t.defaultPrevented&&u.current&&t.preventDefault(),u.current=!1},onInteractOutside:t=>{var n;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||c.modal||(u.current=!0)}}))})),w=/*#__PURE__*/a.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,c=C(n);/*#__PURE__*/return a.createElement(o.Group,i({},c,r,{ref:t}))}));exports.ContextMenuGroup=w;const I=/*#__PURE__*/a.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,c=C(n);/*#__PURE__*/return a.createElement(o.Label,i({},c,r,{ref:t}))}));exports.ContextMenuLabel=I;const b=/*#__PURE__*/a.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,c=C(n);/*#__PURE__*/return a.createElement(o.Item,i({},c,r,{ref:t}))}));exports.ContextMenuItem=b;const h=/*#__PURE__*/a.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,c=C(n);/*#__PURE__*/return a.createElement(o.SubTrigger,i({},c,r,{ref:t}))}));exports.ContextMenuTriggerItem=h;const v=/*#__PURE__*/a.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,c=C(n);/*#__PURE__*/return a.createElement(o.CheckboxItem,i({},c,r,{ref:t}))}));exports.ContextMenuCheckboxItem=v;const O=/*#__PURE__*/a.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,c=C(n);/*#__PURE__*/return a.createElement(o.RadioGroup,i({},c,r,{ref:t}))}));exports.ContextMenuRadioGroup=O;const P=/*#__PURE__*/a.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,c=C(n);/*#__PURE__*/return a.createElement(o.RadioItem,i({},c,r,{ref:t}))}));exports.ContextMenuRadioItem=P;const T=/*#__PURE__*/a.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,c=C(n);/*#__PURE__*/return a.createElement(o.ItemIndicator,i({},c,r,{ref:t}))}));exports.ContextMenuItemIndicator=T;const k=/*#__PURE__*/a.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,c=C(n);/*#__PURE__*/return a.createElement(o.Separator,i({},c,r,{ref:t}))}));exports.ContextMenuSeparator=k;const y=/*#__PURE__*/a.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,c=C(n);/*#__PURE__*/return a.createElement(o.Arrow,i({},c,r,{ref:t}))}));function S(e){return t=>"mouse"!==t.pointerType?e(t):void 0}exports.ContextMenuArrow=y;const q=m;exports.Root=q;const A=M;exports.Trigger=A;const G=g;exports.Content=G;const D=w;exports.Group=D;const L=I;exports.Label=L;const j=b;exports.Item=j;const F=h;exports.TriggerItem=F;const U=v;exports.CheckboxItem=U;const B=O;exports.RadioGroup=B;const H=P;exports.RadioItem=H;const W=T;exports.ItemIndicator=W;const X=k;exports.Separator=X;const Y=y;exports.Arrow=Y;
1
+ var $l8XVT$babelruntimehelpersextends = require("@babel/runtime/helpers/extends");
2
+ var $l8XVT$react = require("react");
3
+ var $l8XVT$radixuiprimitive = require("@radix-ui/primitive");
4
+ var $l8XVT$radixuireactcontext = require("@radix-ui/react-context");
5
+ var $l8XVT$radixuireactprimitive = require("@radix-ui/react-primitive");
6
+ var $l8XVT$radixuireactmenu = require("@radix-ui/react-menu");
7
+ var $l8XVT$radixuireactusecallbackref = require("@radix-ui/react-use-callback-ref");
8
+ var $l8XVT$radixuireactusecontrollablestate = require("@radix-ui/react-use-controllable-state");
9
+
10
+ function $parcel$exportWildcard(dest, source) {
11
+ Object.keys(source).forEach(function(key) {
12
+ if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
13
+ return;
14
+ }
15
+
16
+ Object.defineProperty(dest, key, {
17
+ enumerable: true,
18
+ get: function get() {
19
+ return source[key];
20
+ }
21
+ });
22
+ });
23
+
24
+ return dest;
25
+ }
26
+ function $parcel$interopDefault(a) {
27
+ return a && a.__esModule ? a.default : a;
28
+ }
29
+ function $parcel$export(e, n, v, s) {
30
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
31
+ }
32
+ var $5de197f6cd80e8e9$exports = {};
33
+
34
+ $parcel$export($5de197f6cd80e8e9$exports, "createContextMenuScope", () => $5de197f6cd80e8e9$export$1059331f43ddcc82);
35
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenu", () => $5de197f6cd80e8e9$export$8dc6765e8be191c7);
36
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuTrigger", () => $5de197f6cd80e8e9$export$be6fc7b1d5b0beb9);
37
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuContent", () => $5de197f6cd80e8e9$export$572205900c9369e);
38
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuGroup", () => $5de197f6cd80e8e9$export$9860523b0fcdd664);
39
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuLabel", () => $5de197f6cd80e8e9$export$d4b9d3b609a10742);
40
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuItem", () => $5de197f6cd80e8e9$export$16a26dc176a49100);
41
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuCheckboxItem", () => $5de197f6cd80e8e9$export$b6adbe51d5d8b7ec);
42
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuRadioGroup", () => $5de197f6cd80e8e9$export$db5c89af5ed9aa07);
43
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuRadioItem", () => $5de197f6cd80e8e9$export$8a727d09a7d9bfc2);
44
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuItemIndicator", () => $5de197f6cd80e8e9$export$9ed8194dee42d94b);
45
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuSeparator", () => $5de197f6cd80e8e9$export$8d6b009fadfe1207);
46
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuArrow", () => $5de197f6cd80e8e9$export$f47d0a58228a61e2);
47
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuSub", () => $5de197f6cd80e8e9$export$5bc21d1c00c4b201);
48
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuSubTrigger", () => $5de197f6cd80e8e9$export$30b2b5c64556d316);
49
+ $parcel$export($5de197f6cd80e8e9$exports, "ContextMenuSubContent", () => $5de197f6cd80e8e9$export$2c967063bd2dc512);
50
+ $parcel$export($5de197f6cd80e8e9$exports, "Root", () => $5de197f6cd80e8e9$export$be92b6f5f03c0fe9);
51
+ $parcel$export($5de197f6cd80e8e9$exports, "Trigger", () => $5de197f6cd80e8e9$export$41fb9f06171c75f4);
52
+ $parcel$export($5de197f6cd80e8e9$exports, "Content", () => $5de197f6cd80e8e9$export$7c6e2c02157bb7d2);
53
+ $parcel$export($5de197f6cd80e8e9$exports, "Group", () => $5de197f6cd80e8e9$export$eb2fcfdbd7ba97d4);
54
+ $parcel$export($5de197f6cd80e8e9$exports, "Label", () => $5de197f6cd80e8e9$export$b04be29aa201d4f5);
55
+ $parcel$export($5de197f6cd80e8e9$exports, "Item", () => $5de197f6cd80e8e9$export$6d08773d2e66f8f2);
56
+ $parcel$export($5de197f6cd80e8e9$exports, "CheckboxItem", () => $5de197f6cd80e8e9$export$16ce288f89fa631c);
57
+ $parcel$export($5de197f6cd80e8e9$exports, "RadioGroup", () => $5de197f6cd80e8e9$export$a98f0dcb43a68a25);
58
+ $parcel$export($5de197f6cd80e8e9$exports, "RadioItem", () => $5de197f6cd80e8e9$export$371ab307eab489c0);
59
+ $parcel$export($5de197f6cd80e8e9$exports, "ItemIndicator", () => $5de197f6cd80e8e9$export$c3468e2714d175fa);
60
+ $parcel$export($5de197f6cd80e8e9$exports, "Separator", () => $5de197f6cd80e8e9$export$1ff3c3f08ae963c0);
61
+ $parcel$export($5de197f6cd80e8e9$exports, "Arrow", () => $5de197f6cd80e8e9$export$21b07c8f274aebd5);
62
+ $parcel$export($5de197f6cd80e8e9$exports, "Sub", () => $5de197f6cd80e8e9$export$d7a01e11500dfb6f);
63
+ $parcel$export($5de197f6cd80e8e9$exports, "SubTrigger", () => $5de197f6cd80e8e9$export$2ea8a7a591ac5eac);
64
+ $parcel$export($5de197f6cd80e8e9$exports, "SubContent", () => $5de197f6cd80e8e9$export$6d4de93b380beddf);
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+ /* -------------------------------------------------------------------------------------------------
75
+ * ContextMenu
76
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$CONTEXT_MENU_NAME = 'ContextMenu';
77
+ const [$5de197f6cd80e8e9$var$createContextMenuContext, $5de197f6cd80e8e9$export$1059331f43ddcc82] = $l8XVT$radixuireactcontext.createContextScope($5de197f6cd80e8e9$var$CONTEXT_MENU_NAME, [
78
+ $l8XVT$radixuireactmenu.createMenuScope
79
+ ]);
80
+ const $5de197f6cd80e8e9$var$useMenuScope = $l8XVT$radixuireactmenu.createMenuScope();
81
+ const [$5de197f6cd80e8e9$var$ContextMenuProvider, $5de197f6cd80e8e9$var$useContextMenuContext] = $5de197f6cd80e8e9$var$createContextMenuContext($5de197f6cd80e8e9$var$CONTEXT_MENU_NAME);
82
+ const $5de197f6cd80e8e9$export$8dc6765e8be191c7 = (props)=>{
83
+ const { __scopeContextMenu: __scopeContextMenu , children: children , onOpenChange: onOpenChange , dir: dir , modal: modal = true , allowPinchZoom: allowPinchZoom } = props;
84
+ const [open1, setOpen] = $l8XVT$react.useState(false);
85
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
86
+ const handleOpenChangeProp = $l8XVT$radixuireactusecallbackref.useCallbackRef(onOpenChange);
87
+ const handleOpenChange = $l8XVT$react.useCallback((open)=>{
88
+ setOpen(open);
89
+ handleOpenChangeProp(open);
90
+ }, [
91
+ handleOpenChangeProp
92
+ ]);
93
+ return /*#__PURE__*/ $l8XVT$react.createElement($5de197f6cd80e8e9$var$ContextMenuProvider, {
94
+ scope: __scopeContextMenu,
95
+ open: open1,
96
+ onOpenChange: handleOpenChange,
97
+ modal: modal
98
+ }, /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Root, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, {
99
+ dir: dir,
100
+ open: open1,
101
+ onOpenChange: handleOpenChange,
102
+ modal: modal,
103
+ allowPinchZoom: allowPinchZoom
104
+ }), children));
105
+ };
106
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$8dc6765e8be191c7, {
107
+ displayName: $5de197f6cd80e8e9$var$CONTEXT_MENU_NAME
108
+ });
109
+ /* -------------------------------------------------------------------------------------------------
110
+ * ContextMenuTrigger
111
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$TRIGGER_NAME = 'ContextMenuTrigger';
112
+ const $5de197f6cd80e8e9$export$be6fc7b1d5b0beb9 = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
113
+ const { __scopeContextMenu: __scopeContextMenu , ...triggerProps } = props;
114
+ const context = $5de197f6cd80e8e9$var$useContextMenuContext($5de197f6cd80e8e9$var$TRIGGER_NAME, __scopeContextMenu);
115
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
116
+ const pointRef = $l8XVT$react.useRef({
117
+ x: 0,
118
+ y: 0
119
+ });
120
+ const virtualRef = $l8XVT$react.useRef({
121
+ getBoundingClientRect: ()=>DOMRect.fromRect({
122
+ width: 0,
123
+ height: 0,
124
+ ...pointRef.current
125
+ })
126
+ });
127
+ const longPressTimerRef = $l8XVT$react.useRef(0);
128
+ const clearLongPress = $l8XVT$react.useCallback(()=>window.clearTimeout(longPressTimerRef.current)
129
+ , []);
130
+ const handleOpen = (event)=>{
131
+ pointRef.current = {
132
+ x: event.clientX,
133
+ y: event.clientY
134
+ };
135
+ context.onOpenChange(true);
136
+ };
137
+ $l8XVT$react.useEffect(()=>clearLongPress
138
+ , [
139
+ clearLongPress
140
+ ]);
141
+ return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$react.Fragment, null, /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Anchor, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, {
142
+ virtualRef: virtualRef
143
+ })), /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactprimitive.Primitive.span, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, triggerProps, {
144
+ ref: forwardedRef // prevent iOS context menu from appearing
145
+ ,
146
+ style: {
147
+ WebkitTouchCallout: 'none',
148
+ ...props.style
149
+ },
150
+ onContextMenu: $l8XVT$radixuiprimitive.composeEventHandlers(props.onContextMenu, (event)=>{
151
+ // clearing the long press here because some platforms already support
152
+ // long press to trigger a `contextmenu` event
153
+ clearLongPress();
154
+ handleOpen(event);
155
+ event.preventDefault();
156
+ }),
157
+ onPointerDown: $l8XVT$radixuiprimitive.composeEventHandlers(props.onPointerDown, $5de197f6cd80e8e9$var$whenTouchOrPen((event)=>{
158
+ // clear the long press here in case there's multiple touch points
159
+ clearLongPress();
160
+ longPressTimerRef.current = window.setTimeout(()=>handleOpen(event)
161
+ , 700);
162
+ })),
163
+ onPointerMove: $l8XVT$radixuiprimitive.composeEventHandlers(props.onPointerMove, $5de197f6cd80e8e9$var$whenTouchOrPen(clearLongPress)),
164
+ onPointerCancel: $l8XVT$radixuiprimitive.composeEventHandlers(props.onPointerCancel, $5de197f6cd80e8e9$var$whenTouchOrPen(clearLongPress)),
165
+ onPointerUp: $l8XVT$radixuiprimitive.composeEventHandlers(props.onPointerUp, $5de197f6cd80e8e9$var$whenTouchOrPen(clearLongPress))
166
+ })));
167
+ });
168
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$be6fc7b1d5b0beb9, {
169
+ displayName: $5de197f6cd80e8e9$var$TRIGGER_NAME
170
+ });
171
+ /* -------------------------------------------------------------------------------------------------
172
+ * ContextMenuContent
173
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$CONTENT_NAME = 'ContextMenuContent';
174
+ const $5de197f6cd80e8e9$export$572205900c9369e = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
175
+ const { __scopeContextMenu: __scopeContextMenu , ...contentProps } = props;
176
+ const context = $5de197f6cd80e8e9$var$useContextMenuContext($5de197f6cd80e8e9$var$CONTENT_NAME, __scopeContextMenu);
177
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
178
+ const hasInteractedOutsideRef = $l8XVT$react.useRef(false);
179
+ return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Content, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, contentProps, {
180
+ ref: forwardedRef,
181
+ portalled: true,
182
+ side: "right",
183
+ sideOffset: 2,
184
+ align: "start",
185
+ onCloseAutoFocus: (event)=>{
186
+ var _props$onCloseAutoFoc;
187
+ (_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event);
188
+ if (!event.defaultPrevented && hasInteractedOutsideRef.current) event.preventDefault();
189
+ hasInteractedOutsideRef.current = false;
190
+ },
191
+ onInteractOutside: (event)=>{
192
+ var _props$onInteractOuts;
193
+ (_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event);
194
+ if (!event.defaultPrevented && !context.modal) hasInteractedOutsideRef.current = true;
195
+ },
196
+ style: {
197
+ ...props.style,
198
+ // re-namespace exposed content custom property
199
+ ['--radix-context-menu-content-transform-origin']: 'var(--radix-popper-transform-origin)'
200
+ }
201
+ }));
202
+ });
203
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$572205900c9369e, {
204
+ displayName: $5de197f6cd80e8e9$var$CONTENT_NAME
205
+ });
206
+ /* -------------------------------------------------------------------------------------------------
207
+ * ContextMenuGroup
208
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$GROUP_NAME = 'ContextMenuGroup';
209
+ const $5de197f6cd80e8e9$export$9860523b0fcdd664 = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
210
+ const { __scopeContextMenu: __scopeContextMenu , ...groupProps } = props;
211
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
212
+ return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Group, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, groupProps, {
213
+ ref: forwardedRef
214
+ }));
215
+ });
216
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$9860523b0fcdd664, {
217
+ displayName: $5de197f6cd80e8e9$var$GROUP_NAME
218
+ });
219
+ /* -------------------------------------------------------------------------------------------------
220
+ * ContextMenuLabel
221
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$LABEL_NAME = 'ContextMenuLabel';
222
+ const $5de197f6cd80e8e9$export$d4b9d3b609a10742 = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
223
+ const { __scopeContextMenu: __scopeContextMenu , ...labelProps } = props;
224
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
225
+ return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Label, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, labelProps, {
226
+ ref: forwardedRef
227
+ }));
228
+ });
229
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$d4b9d3b609a10742, {
230
+ displayName: $5de197f6cd80e8e9$var$LABEL_NAME
231
+ });
232
+ /* -------------------------------------------------------------------------------------------------
233
+ * ContextMenuItem
234
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$ITEM_NAME = 'ContextMenuItem';
235
+ const $5de197f6cd80e8e9$export$16a26dc176a49100 = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
236
+ const { __scopeContextMenu: __scopeContextMenu , ...itemProps } = props;
237
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
238
+ return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Item, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, itemProps, {
239
+ ref: forwardedRef
240
+ }));
241
+ });
242
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$16a26dc176a49100, {
243
+ displayName: $5de197f6cd80e8e9$var$ITEM_NAME
244
+ });
245
+ /* -------------------------------------------------------------------------------------------------
246
+ * ContextMenuCheckboxItem
247
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$CHECKBOX_ITEM_NAME = 'ContextMenuCheckboxItem';
248
+ const $5de197f6cd80e8e9$export$b6adbe51d5d8b7ec = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
249
+ const { __scopeContextMenu: __scopeContextMenu , ...checkboxItemProps } = props;
250
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
251
+ return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.CheckboxItem, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, checkboxItemProps, {
252
+ ref: forwardedRef
253
+ }));
254
+ });
255
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$b6adbe51d5d8b7ec, {
256
+ displayName: $5de197f6cd80e8e9$var$CHECKBOX_ITEM_NAME
257
+ });
258
+ /* -------------------------------------------------------------------------------------------------
259
+ * ContextMenuRadioGroup
260
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$RADIO_GROUP_NAME = 'ContextMenuRadioGroup';
261
+ const $5de197f6cd80e8e9$export$db5c89af5ed9aa07 = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
262
+ const { __scopeContextMenu: __scopeContextMenu , ...radioGroupProps } = props;
263
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
264
+ return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.RadioGroup, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, radioGroupProps, {
265
+ ref: forwardedRef
266
+ }));
267
+ });
268
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$db5c89af5ed9aa07, {
269
+ displayName: $5de197f6cd80e8e9$var$RADIO_GROUP_NAME
270
+ });
271
+ /* -------------------------------------------------------------------------------------------------
272
+ * ContextMenuRadioItem
273
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$RADIO_ITEM_NAME = 'ContextMenuRadioItem';
274
+ const $5de197f6cd80e8e9$export$8a727d09a7d9bfc2 = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
275
+ const { __scopeContextMenu: __scopeContextMenu , ...radioItemProps } = props;
276
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
277
+ return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.RadioItem, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, radioItemProps, {
278
+ ref: forwardedRef
279
+ }));
280
+ });
281
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$8a727d09a7d9bfc2, {
282
+ displayName: $5de197f6cd80e8e9$var$RADIO_ITEM_NAME
283
+ });
284
+ /* -------------------------------------------------------------------------------------------------
285
+ * ContextMenuItemIndicator
286
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$INDICATOR_NAME = 'ContextMenuItemIndicator';
287
+ const $5de197f6cd80e8e9$export$9ed8194dee42d94b = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
288
+ const { __scopeContextMenu: __scopeContextMenu , ...itemIndicatorProps } = props;
289
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
290
+ return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.ItemIndicator, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, itemIndicatorProps, {
291
+ ref: forwardedRef
292
+ }));
293
+ });
294
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$9ed8194dee42d94b, {
295
+ displayName: $5de197f6cd80e8e9$var$INDICATOR_NAME
296
+ });
297
+ /* -------------------------------------------------------------------------------------------------
298
+ * ContextMenuSeparator
299
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$SEPARATOR_NAME = 'ContextMenuSeparator';
300
+ const $5de197f6cd80e8e9$export$8d6b009fadfe1207 = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
301
+ const { __scopeContextMenu: __scopeContextMenu , ...separatorProps } = props;
302
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
303
+ return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Separator, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, separatorProps, {
304
+ ref: forwardedRef
305
+ }));
306
+ });
307
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$8d6b009fadfe1207, {
308
+ displayName: $5de197f6cd80e8e9$var$SEPARATOR_NAME
309
+ });
310
+ /* -------------------------------------------------------------------------------------------------
311
+ * ContextMenuArrow
312
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$ARROW_NAME = 'ContextMenuArrow';
313
+ const $5de197f6cd80e8e9$export$f47d0a58228a61e2 = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
314
+ const { __scopeContextMenu: __scopeContextMenu , ...arrowProps } = props;
315
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
316
+ return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Arrow, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, arrowProps, {
317
+ ref: forwardedRef
318
+ }));
319
+ });
320
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$f47d0a58228a61e2, {
321
+ displayName: $5de197f6cd80e8e9$var$ARROW_NAME
322
+ });
323
+ /* -------------------------------------------------------------------------------------------------
324
+ * ContextMenuSub
325
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$SUB_NAME = 'ContextMenuSub';
326
+ const $5de197f6cd80e8e9$export$5bc21d1c00c4b201 = (props)=>{
327
+ const { __scopeContextMenu: __scopeContextMenu , children: children , onOpenChange: onOpenChange , open: openProp , defaultOpen: defaultOpen } = props;
328
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
329
+ const [open, setOpen] = $l8XVT$radixuireactusecontrollablestate.useControllableState({
330
+ prop: openProp,
331
+ defaultProp: defaultOpen,
332
+ onChange: onOpenChange
333
+ });
334
+ return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Sub, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, {
335
+ open: open,
336
+ onOpenChange: setOpen
337
+ }), children);
338
+ };
339
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$5bc21d1c00c4b201, {
340
+ displayName: $5de197f6cd80e8e9$var$SUB_NAME
341
+ });
342
+ /* -------------------------------------------------------------------------------------------------
343
+ * ContextMenuSubTrigger
344
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$SUB_TRIGGER_NAME = 'ContextMenuSubTrigger';
345
+ const $5de197f6cd80e8e9$export$30b2b5c64556d316 = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
346
+ const { __scopeContextMenu: __scopeContextMenu , ...triggerItemProps } = props;
347
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
348
+ return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.SubTrigger, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, triggerItemProps, {
349
+ ref: forwardedRef
350
+ }));
351
+ });
352
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$30b2b5c64556d316, {
353
+ displayName: $5de197f6cd80e8e9$var$SUB_TRIGGER_NAME
354
+ });
355
+ /* -------------------------------------------------------------------------------------------------
356
+ * ContextMenuSubContent
357
+ * -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$SUB_CONTENT_NAME = 'ContextMenuSubContent';
358
+ const $5de197f6cd80e8e9$export$2c967063bd2dc512 = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
359
+ const { __scopeContextMenu: __scopeContextMenu , ...subContentProps } = props;
360
+ const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
361
+ return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.SubContent, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, subContentProps, {
362
+ ref: forwardedRef,
363
+ style: {
364
+ ...props.style,
365
+ // re-namespace exposed content custom property
366
+ ['--radix-context-menu-content-transform-origin']: 'var(--radix-popper-transform-origin)'
367
+ }
368
+ }));
369
+ });
370
+ /*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$2c967063bd2dc512, {
371
+ displayName: $5de197f6cd80e8e9$var$SUB_CONTENT_NAME
372
+ });
373
+ /* -----------------------------------------------------------------------------------------------*/ function $5de197f6cd80e8e9$var$whenTouchOrPen(handler) {
374
+ return (event)=>event.pointerType !== 'mouse' ? handler(event) : undefined
375
+ ;
376
+ }
377
+ const $5de197f6cd80e8e9$export$be92b6f5f03c0fe9 = $5de197f6cd80e8e9$export$8dc6765e8be191c7;
378
+ const $5de197f6cd80e8e9$export$41fb9f06171c75f4 = $5de197f6cd80e8e9$export$be6fc7b1d5b0beb9;
379
+ const $5de197f6cd80e8e9$export$7c6e2c02157bb7d2 = $5de197f6cd80e8e9$export$572205900c9369e;
380
+ const $5de197f6cd80e8e9$export$eb2fcfdbd7ba97d4 = $5de197f6cd80e8e9$export$9860523b0fcdd664;
381
+ const $5de197f6cd80e8e9$export$b04be29aa201d4f5 = $5de197f6cd80e8e9$export$d4b9d3b609a10742;
382
+ const $5de197f6cd80e8e9$export$6d08773d2e66f8f2 = $5de197f6cd80e8e9$export$16a26dc176a49100;
383
+ const $5de197f6cd80e8e9$export$16ce288f89fa631c = $5de197f6cd80e8e9$export$b6adbe51d5d8b7ec;
384
+ const $5de197f6cd80e8e9$export$a98f0dcb43a68a25 = $5de197f6cd80e8e9$export$db5c89af5ed9aa07;
385
+ const $5de197f6cd80e8e9$export$371ab307eab489c0 = $5de197f6cd80e8e9$export$8a727d09a7d9bfc2;
386
+ const $5de197f6cd80e8e9$export$c3468e2714d175fa = $5de197f6cd80e8e9$export$9ed8194dee42d94b;
387
+ const $5de197f6cd80e8e9$export$1ff3c3f08ae963c0 = $5de197f6cd80e8e9$export$8d6b009fadfe1207;
388
+ const $5de197f6cd80e8e9$export$21b07c8f274aebd5 = $5de197f6cd80e8e9$export$f47d0a58228a61e2;
389
+ const $5de197f6cd80e8e9$export$d7a01e11500dfb6f = $5de197f6cd80e8e9$export$5bc21d1c00c4b201;
390
+ const $5de197f6cd80e8e9$export$2ea8a7a591ac5eac = $5de197f6cd80e8e9$export$30b2b5c64556d316;
391
+ const $5de197f6cd80e8e9$export$6d4de93b380beddf = $5de197f6cd80e8e9$export$2c967063bd2dc512;
392
+
393
+
394
+ $parcel$exportWildcard(module.exports, $5de197f6cd80e8e9$exports);
395
+
396
+
2
397
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@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AYhB,EAAaK,gBAC/B,OAAOiB,EAAAC,cAACI,EAAcmF,UAAfjF,EAAA,GAA6Bb,EAAe6F,EAA5C,CAA4DjD,IAAK3B,uCAS1E,MAMM8E,eAA2BnG,EAAMoB,YAGrC,CAAC5B,EAAmD6B,KACpD,MAAM5B,mBAAEA,KAAuB2G,GAAuB5G,EAChDY,EAAYhB,EAAaK,gBAC/B,OAAOiB,EAAAC,cAACI,EAAcsF,cAAfpF,EAAA,GAAiCb,EAAegG,EAAhD,CAAoEpD,IAAK3B,2CASlF,MAMMiF,eAAuBtG,EAAMoB,YAGjC,CAAC5B,EAA+C6B,KAChD,MAAM5B,mBAAEA,KAAuB8G,GAAmB/G,EAC5CY,EAAYhB,EAAaK,gBAC/B,OAAOiB,EAAAC,cAACI,EAAcyF,UAAfvF,EAAA,GAA6Bb,EAAemG,EAA5C,CAA4DvD,IAAK3B,uCAS1E,MAMMoF,eAAmBzG,EAAMoB,YAC7B,CAAC5B,EAA2C6B,KAC1C,MAAM5B,mBAAEA,KAAuBiH,GAAelH,EACxCY,EAAYhB,EAAaK,gBAC/B,OAAOiB,EAAAC,cAACI,EAAc4F,MAAf1F,EAAA,GAAyBb,EAAesG,EAAxC,CAAoD1D,IAAK3B,QAQpE,SAASkC,EAAkBqD,GACzB,OAAQpE,GAAiC,UAAtBA,EAAMqE,YAA0BD,EAAQpE,QAASsE,6BAGtE,MAAM5F,EAAO3B,iBACb,MAAMwH,EAAU5F,oBAChB,MAAM8C,EAAUJ,oBAChB,MAAMmB,EAAQF,kBACd,MAAMK,EAAQF,kBACd,MAAMK,EAAOF,iBACb,MAAM4B,EAAczB,wBACpB,MAAMK,EAAeF,yBACrB,MAAMK,EAAaF,uBACnB,MAAMK,EAAYF,sBAClB,MAAMK,EAAgBF,0BACtB,MAAMK,EAAYF,sBAClB,MAAMK,EAAQF","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./packages/react/context-menu/src/ContextMenu.tsx"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$reexport(e, n, v) {\n Object.defineProperty(e, n, {get: v, enumerable: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\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';\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 isRootMenu: boolean;\n open: boolean;\n onOpenChange(open: boolean): void;\n modal: boolean;\n};\n\nconst [ContextMenuProvider, useContextMenuContext] =\n createContextMenuContext<ContextMenuContextValue>(CONTEXT_MENU_NAME);\n\ninterface ContextMenuProps {\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n children?: React.ReactNode;\n}\n\nconst ContextMenu: React.FC<ContextMenuProps> = (props: ScopedProps<ContextMenuProps>) => {\n const { __scopeContextMenu, children, onOpenChange, dir, modal = true } = props;\n const [open, setOpen] = React.useState(false);\n const contentContext = useContentContext(CONTEXT_MENU_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const handleOpenChangeProp = useCallbackRef(onOpenChange);\n\n const handleOpenChange = React.useCallback(\n (open) => {\n setOpen(open);\n handleOpenChangeProp(open);\n },\n [handleOpenChangeProp]\n );\n\n return contentContext.isInsideContent ? (\n <ContextMenuProvider\n scope={__scopeContextMenu}\n isRootMenu={false}\n open={open}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n <MenuPrimitive.Sub {...menuScope} open={open} onOpenChange={handleOpenChange}>\n {children}\n </MenuPrimitive.Sub>\n </ContextMenuProvider>\n ) : (\n <ContextMenuProvider\n scope={__scopeContextMenu}\n isRootMenu={true}\n open={open}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n <MenuPrimitive.Root\n {...menuScope}\n dir={dir}\n open={open}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n {children}\n </MenuPrimitive.Root>\n </ContextMenuProvider>\n );\n};\n\nContextMenu.displayName = CONTEXT_MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'ContextMenuTrigger';\n\ntype ContextMenuTriggerElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface ContextMenuTriggerProps extends PrimitiveSpanProps {}\n\nconst ContextMenuTrigger = React.forwardRef<ContextMenuTriggerElement, ContextMenuTriggerProps>(\n (props: ScopedProps<ContextMenuTriggerProps>, forwardedRef) => {\n const { __scopeContextMenu, ...triggerProps } = props;\n const context = useContextMenuContext(TRIGGER_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const pointRef = React.useRef<Point>({ x: 0, y: 0 });\n const virtualRef = React.useRef({\n getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...pointRef.current }),\n });\n const longPressTimerRef = React.useRef(0);\n const clearLongPress = React.useCallback(\n () => window.clearTimeout(longPressTimerRef.current),\n []\n );\n const handleOpen = (event: React.MouseEvent | React.PointerEvent) => {\n pointRef.current = { x: event.clientX, y: event.clientY };\n context.onOpenChange(true);\n };\n\n React.useEffect(() => clearLongPress, [clearLongPress]);\n\n return (\n <ContentProvider scope={__scopeContextMenu} isInsideContent={false}>\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 event.preventDefault();\n handleOpen(event);\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 </ContentProvider>\n );\n }\n);\n\nContextMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'ContextMenuContent';\n\nconst [ContentProvider, useContentContext] = createContextMenuContext(CONTENT_NAME, {\n isInsideContent: false,\n});\n\ntype ContextMenuContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;\ninterface ContextMenuContentProps extends Omit<MenuContentProps, 'portalled' | 'side' | '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\n const commonProps = {\n ...contentProps,\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 return (\n <ContentProvider scope={__scopeContextMenu} isInsideContent={true}>\n {context.isRootMenu ? (\n <ContextMenuRootContent\n __scopeContextMenu={__scopeContextMenu}\n {...commonProps}\n ref={forwardedRef}\n />\n ) : (\n <MenuPrimitive.Content {...menuScope} {...commonProps} ref={forwardedRef} />\n )}\n </ContentProvider>\n );\n }\n);\n\nContextMenuContent.displayName = CONTENT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype ContextMenuRootContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ninterface ContextMenuRootContentProps extends ScopedProps<MenuContentProps> {}\n\nconst ContextMenuRootContent = React.forwardRef<\n ContextMenuRootContentElement,\n ContextMenuRootContentProps\n>((props, 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 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 />\n );\n});\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 * ContextMenuTriggerItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_ITEM_NAME = 'ContextMenuTriggerItem';\n\ntype ContextMenuTriggerItemElement = React.ElementRef<typeof MenuPrimitive.SubTrigger>;\ntype MenuSubTriggerProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;\ninterface ContextMenuTriggerItemProps extends MenuSubTriggerProps {}\n\nconst ContextMenuTriggerItem = React.forwardRef<\n ContextMenuTriggerItemElement,\n ContextMenuTriggerItemProps\n>((props: ScopedProps<ContextMenuTriggerItemProps>, forwardedRef) => {\n const { __scopeContextMenu, ...triggerItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.SubTrigger {...menuScope} {...triggerItemProps} ref={forwardedRef} />;\n});\n\nContextMenuTriggerItem.displayName = TRIGGER_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\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 TriggerItem = ContextMenuTriggerItem;\nconst CheckboxItem = ContextMenuCheckboxItem;\nconst RadioGroup = ContextMenuRadioGroup;\nconst RadioItem = ContextMenuRadioItem;\nconst ItemIndicator = ContextMenuItemIndicator;\nconst Separator = ContextMenuSeparator;\nconst Arrow = ContextMenuArrow;\n\nexport {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuTriggerItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n //\n Root,\n Trigger,\n Content,\n Group,\n Label,\n Item,\n TriggerItem,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n};\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuTriggerItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n};\n"],"names":["a","__esModule","default","$parcel$exportWildcard","dest","source","Object","keys","forEach","key","defineProperty","enumerable","get","createContextMenuContext","createContextMenuScope","createContextScope","createMenuScope","useMenuScope","ContextMenuProvider","useContextMenuContext","ContextMenu","props","__scopeContextMenu","children","onOpenChange","dir","modal","open","setOpen","React","useState","contentContext","useContentContext","menuScope","handleOpenChangeProp","useCallbackRef","handleOpenChange","useCallback","isInsideContent","_react","createElement","$ffc34e43379ee114b0300eebc3d396c$var$ContextMenuProvider","scope","isRootMenu","_radixUiReactMenu","Sub","_babelRuntimeHelpersExtends","Root","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","$ffc34e43379ee114b0300eebc3d396c$var$ContentProvider","Anchor","Primitive","span","ref","style","WebkitTouchCallout","onContextMenu","composeEventHandlers","preventDefault","onPointerDown","whenTouchOrPen","setTimeout","onPointerMove","onPointerCancel","onPointerUp","ContentProvider","ContextMenuContent","contentProps","commonProps","$ffc34e43379ee114b0300eebc3d396c$var$ContextMenuRootContent","Content","ContextMenuRootContent","hasInteractedOutsideRef","portalled","side","sideOffset","align","onCloseAutoFocus","_props$onCloseAutoFoc","call","defaultPrevented","onInteractOutside","_props$onInteractOuts","ContextMenuGroup","groupProps","Group","ContextMenuLabel","labelProps","Label","ContextMenuItem","itemProps","Item","ContextMenuTriggerItem","triggerItemProps","SubTrigger","ContextMenuCheckboxItem","checkboxItemProps","CheckboxItem","ContextMenuRadioGroup","radioGroupProps","RadioGroup","ContextMenuRadioItem","radioItemProps","RadioItem","ContextMenuItemIndicator","itemIndicatorProps","ItemIndicator","ContextMenuSeparator","separatorProps","Separator","ContextMenuArrow","arrowProps","Arrow","handler","pointerType","undefined","Trigger","TriggerItem"],"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,kCAAY,CAACK,kBAAD,CAA9B,AAAA;IACA,MAAMU,oBAAoB,GAAGpB,gDAAc,CAACY,YAAD,CAA3C,AAAA;IAEA,MAAMS,gBAAgB,GAAG3B,wBAAA,CACtBsB,C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D,KAAD,CAAvC,GAAiD+D,SAApE;IAAA,CAAA;CACD;AAED,MAAMC,yCAAI,GAAGrG,yCAAb,AAAA;AACA,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.js.map"}
@@ -1,2 +1,378 @@
1
- import{useCallbackRef as e}from"@radix-ui/react-use-callback-ref";import*as t from"@radix-ui/react-menu";import{createMenuScope as n}from"@radix-ui/react-menu";import{Primitive as o}from"@radix-ui/react-primitive";import{createContextScope as r}from"@radix-ui/react-context";import{composeEventHandlers as c}from"@radix-ui/primitive";import*as u from"react";import a from"@babel/runtime/helpers/esm/extends";const[s,i]=r("ContextMenu",[n]);export{i as createContextMenuScope};const x=n(),[p,C]=s("ContextMenu");export const ContextMenu=n=>{const{__scopeContextMenu:o,children:r,onOpenChange:c,dir:s,modal:i=!0}=n,[C,m]=u.useState(!1),f=l("ContextMenu",o),d=x(o),M=e(c),R=u.useCallback((e=>{m(e),M(e)}),[M]);return f.isInsideContent?/*#__PURE__*/u.createElement(p,{scope:o,isRootMenu:!1,open:C,onOpenChange:R,modal:i},/*#__PURE__*/u.createElement(t.Sub,a({},d,{open:C,onOpenChange:R}),r)):/*#__PURE__*/u.createElement(p,{scope:o,isRootMenu:!0,open:C,onOpenChange:R,modal:i},/*#__PURE__*/u.createElement(t.Root,a({},d,{dir:s,open:C,onOpenChange:R,modal:i}),r))};/*#__PURE__*/export const ContextMenuTrigger=/*#__PURE__*/u.forwardRef(((e,n)=>{const{__scopeContextMenu:r,...s}=e,i=C("ContextMenuTrigger",r),p=x(r),l=u.useRef({x:0,y:0}),f=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),M=u.useRef(0),R=u.useCallback((()=>window.clearTimeout(M.current)),[]),_=e=>{l.current={x:e.clientX,y:e.clientY},i.onOpenChange(!0)};return u.useEffect((()=>R),[R]),/*#__PURE__*/u.createElement(m,{scope:r,isInsideContent:!1},/*#__PURE__*/u.createElement(t.Anchor,a({},p,{virtualRef:f})),/*#__PURE__*/u.createElement(o.span,a({},s,{ref:n,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:c(e.onContextMenu,(e=>{R(),e.preventDefault(),_(e)})),onPointerDown:c(e.onPointerDown,d((e=>{R(),M.current=window.setTimeout((()=>_(e)),700)}))),onPointerMove:c(e.onPointerMove,d(R)),onPointerCancel:c(e.onPointerCancel,d(R)),onPointerUp:c(e.onPointerUp,d(R))})))}));/*#__PURE__*/const[m,l]=s("ContextMenuContent",{isInsideContent:!1});export const ContextMenuContent=/*#__PURE__*/u.forwardRef(((e,n)=>{const{__scopeContextMenu:o,...r}=e,c=C("ContextMenuContent",o),s=x(o),i={...r,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)"}};/*#__PURE__*/return u.createElement(m,{scope:o,isInsideContent:!0},c.isRootMenu?/*#__PURE__*/u.createElement(f,a({__scopeContextMenu:o},i,{ref:n})):/*#__PURE__*/u.createElement(t.Content,a({},s,i,{ref:n})))}));/*#__PURE__*/const f=/*#__PURE__*/u.forwardRef(((e,n)=>{const{__scopeContextMenu:o,...r}=e,c=C("ContextMenuContent",o),s=x(o),i=u.useRef(!1);/*#__PURE__*/return u.createElement(t.Content,a({},s,r,{ref:n,portalled:!0,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:t=>{var n;null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),!t.defaultPrevented&&i.current&&t.preventDefault(),i.current=!1},onInteractOutside:t=>{var n;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||c.modal||(i.current=!0)}}))}));export const ContextMenuGroup=/*#__PURE__*/u.forwardRef(((e,n)=>{const{__scopeContextMenu:o,...r}=e,c=x(o);/*#__PURE__*/return u.createElement(t.Group,a({},c,r,{ref:n}))}));/*#__PURE__*/export const ContextMenuLabel=/*#__PURE__*/u.forwardRef(((e,n)=>{const{__scopeContextMenu:o,...r}=e,c=x(o);/*#__PURE__*/return u.createElement(t.Label,a({},c,r,{ref:n}))}));/*#__PURE__*/export const ContextMenuItem=/*#__PURE__*/u.forwardRef(((e,n)=>{const{__scopeContextMenu:o,...r}=e,c=x(o);/*#__PURE__*/return u.createElement(t.Item,a({},c,r,{ref:n}))}));/*#__PURE__*/export const ContextMenuTriggerItem=/*#__PURE__*/u.forwardRef(((e,n)=>{const{__scopeContextMenu:o,...r}=e,c=x(o);/*#__PURE__*/return u.createElement(t.SubTrigger,a({},c,r,{ref:n}))}));/*#__PURE__*/export const ContextMenuCheckboxItem=/*#__PURE__*/u.forwardRef(((e,n)=>{const{__scopeContextMenu:o,...r}=e,c=x(o);/*#__PURE__*/return u.createElement(t.CheckboxItem,a({},c,r,{ref:n}))}));/*#__PURE__*/export const ContextMenuRadioGroup=/*#__PURE__*/u.forwardRef(((e,n)=>{const{__scopeContextMenu:o,...r}=e,c=x(o);/*#__PURE__*/return u.createElement(t.RadioGroup,a({},c,r,{ref:n}))}));/*#__PURE__*/export const ContextMenuRadioItem=/*#__PURE__*/u.forwardRef(((e,n)=>{const{__scopeContextMenu:o,...r}=e,c=x(o);/*#__PURE__*/return u.createElement(t.RadioItem,a({},c,r,{ref:n}))}));/*#__PURE__*/export const ContextMenuItemIndicator=/*#__PURE__*/u.forwardRef(((e,n)=>{const{__scopeContextMenu:o,...r}=e,c=x(o);/*#__PURE__*/return u.createElement(t.ItemIndicator,a({},c,r,{ref:n}))}));/*#__PURE__*/export const ContextMenuSeparator=/*#__PURE__*/u.forwardRef(((e,n)=>{const{__scopeContextMenu:o,...r}=e,c=x(o);/*#__PURE__*/return u.createElement(t.Separator,a({},c,r,{ref:n}))}));/*#__PURE__*/export const ContextMenuArrow=/*#__PURE__*/u.forwardRef(((e,n)=>{const{__scopeContextMenu:o,...r}=e,c=x(o);/*#__PURE__*/return u.createElement(t.Arrow,a({},c,r,{ref:n}))}));/*#__PURE__*/function d(e){return t=>"mouse"!==t.pointerType?e(t):void 0}export const Root=ContextMenu;export const Trigger=ContextMenuTrigger;export const Content=ContextMenuContent;export const Group=ContextMenuGroup;export const Label=ContextMenuLabel;export const Item=ContextMenuItem;export const TriggerItem=ContextMenuTriggerItem;export const CheckboxItem=ContextMenuCheckboxItem;export const RadioGroup=ContextMenuRadioGroup;export const RadioItem=ContextMenuRadioItem;export const ItemIndicator=ContextMenuItemIndicator;export const Separator=ContextMenuSeparator;export const Arrow=ContextMenuArrow;
1
+ import $3TiJz$babelruntimehelpersesmextends from "@babel/runtime/helpers/esm/extends";
2
+ import {useState as $3TiJz$useState, useCallback as $3TiJz$useCallback, createElement as $3TiJz$createElement, forwardRef as $3TiJz$forwardRef, useRef as $3TiJz$useRef, useEffect as $3TiJz$useEffect, Fragment as $3TiJz$Fragment} from "react";
3
+ import {composeEventHandlers as $3TiJz$composeEventHandlers} from "@radix-ui/primitive";
4
+ import {createContextScope as $3TiJz$createContextScope} from "@radix-ui/react-context";
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";
7
+ import {useCallbackRef as $3TiJz$useCallbackRef} from "@radix-ui/react-use-callback-ref";
8
+ import {useControllableState as $3TiJz$useControllableState} from "@radix-ui/react-use-controllable-state";
9
+
10
+ function $parcel$export(e, n, v, s) {
11
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
12
+ }
13
+ var $1b0217ee4a91d156$exports = {};
14
+
15
+ $parcel$export($1b0217ee4a91d156$exports, "createContextMenuScope", () => $1b0217ee4a91d156$export$1059331f43ddcc82);
16
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenu", () => $1b0217ee4a91d156$export$8dc6765e8be191c7);
17
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuTrigger", () => $1b0217ee4a91d156$export$be6fc7b1d5b0beb9);
18
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuContent", () => $1b0217ee4a91d156$export$572205900c9369e);
19
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuGroup", () => $1b0217ee4a91d156$export$9860523b0fcdd664);
20
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuLabel", () => $1b0217ee4a91d156$export$d4b9d3b609a10742);
21
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuItem", () => $1b0217ee4a91d156$export$16a26dc176a49100);
22
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuCheckboxItem", () => $1b0217ee4a91d156$export$b6adbe51d5d8b7ec);
23
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuRadioGroup", () => $1b0217ee4a91d156$export$db5c89af5ed9aa07);
24
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuRadioItem", () => $1b0217ee4a91d156$export$8a727d09a7d9bfc2);
25
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuItemIndicator", () => $1b0217ee4a91d156$export$9ed8194dee42d94b);
26
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuSeparator", () => $1b0217ee4a91d156$export$8d6b009fadfe1207);
27
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuArrow", () => $1b0217ee4a91d156$export$f47d0a58228a61e2);
28
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuSub", () => $1b0217ee4a91d156$export$5bc21d1c00c4b201);
29
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuSubTrigger", () => $1b0217ee4a91d156$export$30b2b5c64556d316);
30
+ $parcel$export($1b0217ee4a91d156$exports, "ContextMenuSubContent", () => $1b0217ee4a91d156$export$2c967063bd2dc512);
31
+ $parcel$export($1b0217ee4a91d156$exports, "Root", () => $1b0217ee4a91d156$export$be92b6f5f03c0fe9);
32
+ $parcel$export($1b0217ee4a91d156$exports, "Trigger", () => $1b0217ee4a91d156$export$41fb9f06171c75f4);
33
+ $parcel$export($1b0217ee4a91d156$exports, "Content", () => $1b0217ee4a91d156$export$7c6e2c02157bb7d2);
34
+ $parcel$export($1b0217ee4a91d156$exports, "Group", () => $1b0217ee4a91d156$export$eb2fcfdbd7ba97d4);
35
+ $parcel$export($1b0217ee4a91d156$exports, "Label", () => $1b0217ee4a91d156$export$b04be29aa201d4f5);
36
+ $parcel$export($1b0217ee4a91d156$exports, "Item", () => $1b0217ee4a91d156$export$6d08773d2e66f8f2);
37
+ $parcel$export($1b0217ee4a91d156$exports, "CheckboxItem", () => $1b0217ee4a91d156$export$16ce288f89fa631c);
38
+ $parcel$export($1b0217ee4a91d156$exports, "RadioGroup", () => $1b0217ee4a91d156$export$a98f0dcb43a68a25);
39
+ $parcel$export($1b0217ee4a91d156$exports, "RadioItem", () => $1b0217ee4a91d156$export$371ab307eab489c0);
40
+ $parcel$export($1b0217ee4a91d156$exports, "ItemIndicator", () => $1b0217ee4a91d156$export$c3468e2714d175fa);
41
+ $parcel$export($1b0217ee4a91d156$exports, "Separator", () => $1b0217ee4a91d156$export$1ff3c3f08ae963c0);
42
+ $parcel$export($1b0217ee4a91d156$exports, "Arrow", () => $1b0217ee4a91d156$export$21b07c8f274aebd5);
43
+ $parcel$export($1b0217ee4a91d156$exports, "Sub", () => $1b0217ee4a91d156$export$d7a01e11500dfb6f);
44
+ $parcel$export($1b0217ee4a91d156$exports, "SubTrigger", () => $1b0217ee4a91d156$export$2ea8a7a591ac5eac);
45
+ $parcel$export($1b0217ee4a91d156$exports, "SubContent", () => $1b0217ee4a91d156$export$6d4de93b380beddf);
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+ /* -------------------------------------------------------------------------------------------------
56
+ * ContextMenu
57
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$CONTEXT_MENU_NAME = 'ContextMenu';
58
+ const [$1b0217ee4a91d156$var$createContextMenuContext, $1b0217ee4a91d156$export$1059331f43ddcc82] = $3TiJz$createContextScope($1b0217ee4a91d156$var$CONTEXT_MENU_NAME, [
59
+ $3TiJz$createMenuScope
60
+ ]);
61
+ const $1b0217ee4a91d156$var$useMenuScope = $3TiJz$createMenuScope();
62
+ const [$1b0217ee4a91d156$var$ContextMenuProvider, $1b0217ee4a91d156$var$useContextMenuContext] = $1b0217ee4a91d156$var$createContextMenuContext($1b0217ee4a91d156$var$CONTEXT_MENU_NAME);
63
+ const $1b0217ee4a91d156$export$8dc6765e8be191c7 = (props)=>{
64
+ const { __scopeContextMenu: __scopeContextMenu , children: children , onOpenChange: onOpenChange , dir: dir , modal: modal = true , allowPinchZoom: allowPinchZoom } = props;
65
+ const [open1, setOpen] = $3TiJz$useState(false);
66
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
67
+ const handleOpenChangeProp = $3TiJz$useCallbackRef(onOpenChange);
68
+ const handleOpenChange = $3TiJz$useCallback((open)=>{
69
+ setOpen(open);
70
+ handleOpenChangeProp(open);
71
+ }, [
72
+ handleOpenChangeProp
73
+ ]);
74
+ return /*#__PURE__*/ $3TiJz$createElement($1b0217ee4a91d156$var$ContextMenuProvider, {
75
+ scope: __scopeContextMenu,
76
+ open: open1,
77
+ onOpenChange: handleOpenChange,
78
+ modal: modal
79
+ }, /*#__PURE__*/ $3TiJz$createElement($3TiJz$Root, $3TiJz$babelruntimehelpersesmextends({}, menuScope, {
80
+ dir: dir,
81
+ open: open1,
82
+ onOpenChange: handleOpenChange,
83
+ modal: modal,
84
+ allowPinchZoom: allowPinchZoom
85
+ }), children));
86
+ };
87
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$8dc6765e8be191c7, {
88
+ displayName: $1b0217ee4a91d156$var$CONTEXT_MENU_NAME
89
+ });
90
+ /* -------------------------------------------------------------------------------------------------
91
+ * ContextMenuTrigger
92
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$TRIGGER_NAME = 'ContextMenuTrigger';
93
+ const $1b0217ee4a91d156$export$be6fc7b1d5b0beb9 = /*#__PURE__*/ $3TiJz$forwardRef((props, forwardedRef)=>{
94
+ const { __scopeContextMenu: __scopeContextMenu , ...triggerProps } = props;
95
+ const context = $1b0217ee4a91d156$var$useContextMenuContext($1b0217ee4a91d156$var$TRIGGER_NAME, __scopeContextMenu);
96
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
97
+ const pointRef = $3TiJz$useRef({
98
+ x: 0,
99
+ y: 0
100
+ });
101
+ const virtualRef = $3TiJz$useRef({
102
+ getBoundingClientRect: ()=>DOMRect.fromRect({
103
+ width: 0,
104
+ height: 0,
105
+ ...pointRef.current
106
+ })
107
+ });
108
+ const longPressTimerRef = $3TiJz$useRef(0);
109
+ const clearLongPress = $3TiJz$useCallback(()=>window.clearTimeout(longPressTimerRef.current)
110
+ , []);
111
+ const handleOpen = (event)=>{
112
+ pointRef.current = {
113
+ x: event.clientX,
114
+ y: event.clientY
115
+ };
116
+ context.onOpenChange(true);
117
+ };
118
+ $3TiJz$useEffect(()=>clearLongPress
119
+ , [
120
+ clearLongPress
121
+ ]);
122
+ return /*#__PURE__*/ $3TiJz$createElement($3TiJz$Fragment, null, /*#__PURE__*/ $3TiJz$createElement($3TiJz$Anchor, $3TiJz$babelruntimehelpersesmextends({}, menuScope, {
123
+ virtualRef: virtualRef
124
+ })), /*#__PURE__*/ $3TiJz$createElement($3TiJz$Primitive.span, $3TiJz$babelruntimehelpersesmextends({}, triggerProps, {
125
+ ref: forwardedRef // prevent iOS context menu from appearing
126
+ ,
127
+ style: {
128
+ WebkitTouchCallout: 'none',
129
+ ...props.style
130
+ },
131
+ onContextMenu: $3TiJz$composeEventHandlers(props.onContextMenu, (event)=>{
132
+ // clearing the long press here because some platforms already support
133
+ // long press to trigger a `contextmenu` event
134
+ clearLongPress();
135
+ handleOpen(event);
136
+ event.preventDefault();
137
+ }),
138
+ onPointerDown: $3TiJz$composeEventHandlers(props.onPointerDown, $1b0217ee4a91d156$var$whenTouchOrPen((event)=>{
139
+ // clear the long press here in case there's multiple touch points
140
+ clearLongPress();
141
+ longPressTimerRef.current = window.setTimeout(()=>handleOpen(event)
142
+ , 700);
143
+ })),
144
+ onPointerMove: $3TiJz$composeEventHandlers(props.onPointerMove, $1b0217ee4a91d156$var$whenTouchOrPen(clearLongPress)),
145
+ onPointerCancel: $3TiJz$composeEventHandlers(props.onPointerCancel, $1b0217ee4a91d156$var$whenTouchOrPen(clearLongPress)),
146
+ onPointerUp: $3TiJz$composeEventHandlers(props.onPointerUp, $1b0217ee4a91d156$var$whenTouchOrPen(clearLongPress))
147
+ })));
148
+ });
149
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$be6fc7b1d5b0beb9, {
150
+ displayName: $1b0217ee4a91d156$var$TRIGGER_NAME
151
+ });
152
+ /* -------------------------------------------------------------------------------------------------
153
+ * ContextMenuContent
154
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$CONTENT_NAME = 'ContextMenuContent';
155
+ const $1b0217ee4a91d156$export$572205900c9369e = /*#__PURE__*/ $3TiJz$forwardRef((props, forwardedRef)=>{
156
+ const { __scopeContextMenu: __scopeContextMenu , ...contentProps } = props;
157
+ const context = $1b0217ee4a91d156$var$useContextMenuContext($1b0217ee4a91d156$var$CONTENT_NAME, __scopeContextMenu);
158
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
159
+ const hasInteractedOutsideRef = $3TiJz$useRef(false);
160
+ return /*#__PURE__*/ $3TiJz$createElement($3TiJz$Content, $3TiJz$babelruntimehelpersesmextends({}, menuScope, contentProps, {
161
+ ref: forwardedRef,
162
+ portalled: true,
163
+ side: "right",
164
+ sideOffset: 2,
165
+ align: "start",
166
+ onCloseAutoFocus: (event)=>{
167
+ var _props$onCloseAutoFoc;
168
+ (_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event);
169
+ if (!event.defaultPrevented && hasInteractedOutsideRef.current) event.preventDefault();
170
+ hasInteractedOutsideRef.current = false;
171
+ },
172
+ onInteractOutside: (event)=>{
173
+ var _props$onInteractOuts;
174
+ (_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event);
175
+ if (!event.defaultPrevented && !context.modal) hasInteractedOutsideRef.current = true;
176
+ },
177
+ style: {
178
+ ...props.style,
179
+ // re-namespace exposed content custom property
180
+ ['--radix-context-menu-content-transform-origin']: 'var(--radix-popper-transform-origin)'
181
+ }
182
+ }));
183
+ });
184
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$572205900c9369e, {
185
+ displayName: $1b0217ee4a91d156$var$CONTENT_NAME
186
+ });
187
+ /* -------------------------------------------------------------------------------------------------
188
+ * ContextMenuGroup
189
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$GROUP_NAME = 'ContextMenuGroup';
190
+ const $1b0217ee4a91d156$export$9860523b0fcdd664 = /*#__PURE__*/ $3TiJz$forwardRef((props, forwardedRef)=>{
191
+ const { __scopeContextMenu: __scopeContextMenu , ...groupProps } = props;
192
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
193
+ return /*#__PURE__*/ $3TiJz$createElement($3TiJz$Group, $3TiJz$babelruntimehelpersesmextends({}, menuScope, groupProps, {
194
+ ref: forwardedRef
195
+ }));
196
+ });
197
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$9860523b0fcdd664, {
198
+ displayName: $1b0217ee4a91d156$var$GROUP_NAME
199
+ });
200
+ /* -------------------------------------------------------------------------------------------------
201
+ * ContextMenuLabel
202
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$LABEL_NAME = 'ContextMenuLabel';
203
+ const $1b0217ee4a91d156$export$d4b9d3b609a10742 = /*#__PURE__*/ $3TiJz$forwardRef((props, forwardedRef)=>{
204
+ const { __scopeContextMenu: __scopeContextMenu , ...labelProps } = props;
205
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
206
+ return /*#__PURE__*/ $3TiJz$createElement($3TiJz$Label, $3TiJz$babelruntimehelpersesmextends({}, menuScope, labelProps, {
207
+ ref: forwardedRef
208
+ }));
209
+ });
210
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$d4b9d3b609a10742, {
211
+ displayName: $1b0217ee4a91d156$var$LABEL_NAME
212
+ });
213
+ /* -------------------------------------------------------------------------------------------------
214
+ * ContextMenuItem
215
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$ITEM_NAME = 'ContextMenuItem';
216
+ const $1b0217ee4a91d156$export$16a26dc176a49100 = /*#__PURE__*/ $3TiJz$forwardRef((props, forwardedRef)=>{
217
+ const { __scopeContextMenu: __scopeContextMenu , ...itemProps } = props;
218
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
219
+ return /*#__PURE__*/ $3TiJz$createElement($3TiJz$Item, $3TiJz$babelruntimehelpersesmextends({}, menuScope, itemProps, {
220
+ ref: forwardedRef
221
+ }));
222
+ });
223
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$16a26dc176a49100, {
224
+ displayName: $1b0217ee4a91d156$var$ITEM_NAME
225
+ });
226
+ /* -------------------------------------------------------------------------------------------------
227
+ * ContextMenuCheckboxItem
228
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$CHECKBOX_ITEM_NAME = 'ContextMenuCheckboxItem';
229
+ const $1b0217ee4a91d156$export$b6adbe51d5d8b7ec = /*#__PURE__*/ $3TiJz$forwardRef((props, forwardedRef)=>{
230
+ const { __scopeContextMenu: __scopeContextMenu , ...checkboxItemProps } = props;
231
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
232
+ return /*#__PURE__*/ $3TiJz$createElement($3TiJz$CheckboxItem, $3TiJz$babelruntimehelpersesmextends({}, menuScope, checkboxItemProps, {
233
+ ref: forwardedRef
234
+ }));
235
+ });
236
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$b6adbe51d5d8b7ec, {
237
+ displayName: $1b0217ee4a91d156$var$CHECKBOX_ITEM_NAME
238
+ });
239
+ /* -------------------------------------------------------------------------------------------------
240
+ * ContextMenuRadioGroup
241
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$RADIO_GROUP_NAME = 'ContextMenuRadioGroup';
242
+ const $1b0217ee4a91d156$export$db5c89af5ed9aa07 = /*#__PURE__*/ $3TiJz$forwardRef((props, forwardedRef)=>{
243
+ const { __scopeContextMenu: __scopeContextMenu , ...radioGroupProps } = props;
244
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
245
+ return /*#__PURE__*/ $3TiJz$createElement($3TiJz$RadioGroup, $3TiJz$babelruntimehelpersesmextends({}, menuScope, radioGroupProps, {
246
+ ref: forwardedRef
247
+ }));
248
+ });
249
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$db5c89af5ed9aa07, {
250
+ displayName: $1b0217ee4a91d156$var$RADIO_GROUP_NAME
251
+ });
252
+ /* -------------------------------------------------------------------------------------------------
253
+ * ContextMenuRadioItem
254
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$RADIO_ITEM_NAME = 'ContextMenuRadioItem';
255
+ const $1b0217ee4a91d156$export$8a727d09a7d9bfc2 = /*#__PURE__*/ $3TiJz$forwardRef((props, forwardedRef)=>{
256
+ const { __scopeContextMenu: __scopeContextMenu , ...radioItemProps } = props;
257
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
258
+ return /*#__PURE__*/ $3TiJz$createElement($3TiJz$RadioItem, $3TiJz$babelruntimehelpersesmextends({}, menuScope, radioItemProps, {
259
+ ref: forwardedRef
260
+ }));
261
+ });
262
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$8a727d09a7d9bfc2, {
263
+ displayName: $1b0217ee4a91d156$var$RADIO_ITEM_NAME
264
+ });
265
+ /* -------------------------------------------------------------------------------------------------
266
+ * ContextMenuItemIndicator
267
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$INDICATOR_NAME = 'ContextMenuItemIndicator';
268
+ const $1b0217ee4a91d156$export$9ed8194dee42d94b = /*#__PURE__*/ $3TiJz$forwardRef((props, forwardedRef)=>{
269
+ const { __scopeContextMenu: __scopeContextMenu , ...itemIndicatorProps } = props;
270
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
271
+ return /*#__PURE__*/ $3TiJz$createElement($3TiJz$ItemIndicator, $3TiJz$babelruntimehelpersesmextends({}, menuScope, itemIndicatorProps, {
272
+ ref: forwardedRef
273
+ }));
274
+ });
275
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$9ed8194dee42d94b, {
276
+ displayName: $1b0217ee4a91d156$var$INDICATOR_NAME
277
+ });
278
+ /* -------------------------------------------------------------------------------------------------
279
+ * ContextMenuSeparator
280
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$SEPARATOR_NAME = 'ContextMenuSeparator';
281
+ const $1b0217ee4a91d156$export$8d6b009fadfe1207 = /*#__PURE__*/ $3TiJz$forwardRef((props, forwardedRef)=>{
282
+ const { __scopeContextMenu: __scopeContextMenu , ...separatorProps } = props;
283
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
284
+ return /*#__PURE__*/ $3TiJz$createElement($3TiJz$Separator, $3TiJz$babelruntimehelpersesmextends({}, menuScope, separatorProps, {
285
+ ref: forwardedRef
286
+ }));
287
+ });
288
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$8d6b009fadfe1207, {
289
+ displayName: $1b0217ee4a91d156$var$SEPARATOR_NAME
290
+ });
291
+ /* -------------------------------------------------------------------------------------------------
292
+ * ContextMenuArrow
293
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$ARROW_NAME = 'ContextMenuArrow';
294
+ const $1b0217ee4a91d156$export$f47d0a58228a61e2 = /*#__PURE__*/ $3TiJz$forwardRef((props, forwardedRef)=>{
295
+ const { __scopeContextMenu: __scopeContextMenu , ...arrowProps } = props;
296
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
297
+ return /*#__PURE__*/ $3TiJz$createElement($3TiJz$Arrow, $3TiJz$babelruntimehelpersesmextends({}, menuScope, arrowProps, {
298
+ ref: forwardedRef
299
+ }));
300
+ });
301
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$f47d0a58228a61e2, {
302
+ displayName: $1b0217ee4a91d156$var$ARROW_NAME
303
+ });
304
+ /* -------------------------------------------------------------------------------------------------
305
+ * ContextMenuSub
306
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$SUB_NAME = 'ContextMenuSub';
307
+ const $1b0217ee4a91d156$export$5bc21d1c00c4b201 = (props)=>{
308
+ const { __scopeContextMenu: __scopeContextMenu , children: children , onOpenChange: onOpenChange , open: openProp , defaultOpen: defaultOpen } = props;
309
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
310
+ const [open, setOpen] = $3TiJz$useControllableState({
311
+ prop: openProp,
312
+ defaultProp: defaultOpen,
313
+ onChange: onOpenChange
314
+ });
315
+ return /*#__PURE__*/ $3TiJz$createElement($3TiJz$Sub, $3TiJz$babelruntimehelpersesmextends({}, menuScope, {
316
+ open: open,
317
+ onOpenChange: setOpen
318
+ }), children);
319
+ };
320
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$5bc21d1c00c4b201, {
321
+ displayName: $1b0217ee4a91d156$var$SUB_NAME
322
+ });
323
+ /* -------------------------------------------------------------------------------------------------
324
+ * ContextMenuSubTrigger
325
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$SUB_TRIGGER_NAME = 'ContextMenuSubTrigger';
326
+ const $1b0217ee4a91d156$export$30b2b5c64556d316 = /*#__PURE__*/ $3TiJz$forwardRef((props, forwardedRef)=>{
327
+ const { __scopeContextMenu: __scopeContextMenu , ...triggerItemProps } = props;
328
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
329
+ return /*#__PURE__*/ $3TiJz$createElement($3TiJz$SubTrigger, $3TiJz$babelruntimehelpersesmextends({}, menuScope, triggerItemProps, {
330
+ ref: forwardedRef
331
+ }));
332
+ });
333
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$30b2b5c64556d316, {
334
+ displayName: $1b0217ee4a91d156$var$SUB_TRIGGER_NAME
335
+ });
336
+ /* -------------------------------------------------------------------------------------------------
337
+ * ContextMenuSubContent
338
+ * -----------------------------------------------------------------------------------------------*/ const $1b0217ee4a91d156$var$SUB_CONTENT_NAME = 'ContextMenuSubContent';
339
+ const $1b0217ee4a91d156$export$2c967063bd2dc512 = /*#__PURE__*/ $3TiJz$forwardRef((props, forwardedRef)=>{
340
+ const { __scopeContextMenu: __scopeContextMenu , ...subContentProps } = props;
341
+ const menuScope = $1b0217ee4a91d156$var$useMenuScope(__scopeContextMenu);
342
+ return /*#__PURE__*/ $3TiJz$createElement($3TiJz$SubContent, $3TiJz$babelruntimehelpersesmextends({}, menuScope, subContentProps, {
343
+ ref: forwardedRef,
344
+ style: {
345
+ ...props.style,
346
+ // re-namespace exposed content custom property
347
+ ['--radix-context-menu-content-transform-origin']: 'var(--radix-popper-transform-origin)'
348
+ }
349
+ }));
350
+ });
351
+ /*#__PURE__*/ Object.assign($1b0217ee4a91d156$export$2c967063bd2dc512, {
352
+ displayName: $1b0217ee4a91d156$var$SUB_CONTENT_NAME
353
+ });
354
+ /* -----------------------------------------------------------------------------------------------*/ function $1b0217ee4a91d156$var$whenTouchOrPen(handler) {
355
+ return (event)=>event.pointerType !== 'mouse' ? handler(event) : undefined
356
+ ;
357
+ }
358
+ const $1b0217ee4a91d156$export$be92b6f5f03c0fe9 = $1b0217ee4a91d156$export$8dc6765e8be191c7;
359
+ const $1b0217ee4a91d156$export$41fb9f06171c75f4 = $1b0217ee4a91d156$export$be6fc7b1d5b0beb9;
360
+ const $1b0217ee4a91d156$export$7c6e2c02157bb7d2 = $1b0217ee4a91d156$export$572205900c9369e;
361
+ const $1b0217ee4a91d156$export$eb2fcfdbd7ba97d4 = $1b0217ee4a91d156$export$9860523b0fcdd664;
362
+ const $1b0217ee4a91d156$export$b04be29aa201d4f5 = $1b0217ee4a91d156$export$d4b9d3b609a10742;
363
+ const $1b0217ee4a91d156$export$6d08773d2e66f8f2 = $1b0217ee4a91d156$export$16a26dc176a49100;
364
+ const $1b0217ee4a91d156$export$16ce288f89fa631c = $1b0217ee4a91d156$export$b6adbe51d5d8b7ec;
365
+ const $1b0217ee4a91d156$export$a98f0dcb43a68a25 = $1b0217ee4a91d156$export$db5c89af5ed9aa07;
366
+ const $1b0217ee4a91d156$export$371ab307eab489c0 = $1b0217ee4a91d156$export$8a727d09a7d9bfc2;
367
+ const $1b0217ee4a91d156$export$c3468e2714d175fa = $1b0217ee4a91d156$export$9ed8194dee42d94b;
368
+ const $1b0217ee4a91d156$export$1ff3c3f08ae963c0 = $1b0217ee4a91d156$export$8d6b009fadfe1207;
369
+ const $1b0217ee4a91d156$export$21b07c8f274aebd5 = $1b0217ee4a91d156$export$f47d0a58228a61e2;
370
+ const $1b0217ee4a91d156$export$d7a01e11500dfb6f = $1b0217ee4a91d156$export$5bc21d1c00c4b201;
371
+ const $1b0217ee4a91d156$export$2ea8a7a591ac5eac = $1b0217ee4a91d156$export$30b2b5c64556d316;
372
+ const $1b0217ee4a91d156$export$6d4de93b380beddf = $1b0217ee4a91d156$export$2c967063bd2dc512;
373
+
374
+
375
+
376
+
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};
2
378
  //# sourceMappingURL=index.module.js.map
@@ -1 +1 @@
1
- {"mappings":"wZAkBA,MAGOA,EAA0BC,GAA0BC,EAHjC,cAGuE,CAC/FC,wCAEF,MAAMC,EAAeD,KASdE,EAAqBC,GAC1BN,EAhBwB,sBAyB1B,MAAMO,YAA2CC,IAC/C,MAAMC,mBAAEA,EAAFC,SAAsBA,E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B,mBAAEA,KAAuB8G,GAAmB/G,EAC5CY,EAAYhB,EAAaK,gBAC/B,OAAOiB,EAAAC,cAACI,EAAcyF,UAAfvF,EAAA,GAA6Bb,EAAemG,EAA5C,CAA4DvD,IAAK3B,4BAe1E,MAAMoF,8BAAmBzG,EAAMoB,YAC7B,CAAC5B,EAA2C6B,KAC1C,MAAM5B,mBAAEA,KAAuBiH,GAAelH,EACxCY,EAAYhB,EAAaK,gBAC/B,OAAOiB,EAAAC,cAACI,EAAc4F,MAAf1F,EAAA,GAAyBb,EAAesG,EAAxC,CAAoD1D,IAAK3B,qBAQpE,SAASkC,EAAkBqD,GACzB,OAAQpE,GAAiC,UAAtBA,EAAMqE,YAA0BD,EAAQpE,QAASsE,SAGtE,MAAM5F,KAAO3B,mBACb,MAAMwH,QAAU5F,0BAChB,MAAM8C,QAAUJ,0BAChB,MAAMmB,MAAQF,wBACd,MAAMK,MAAQF,wBACd,MAAMK,KAAOF,uBACb,MAAM4B,YAAczB,8BACpB,MAAMK,aAAeF,+BACrB,MAAMK,WAAaF,6BACnB,MAAMK,UAAYF,4BAClB,MAAMK,cAAgBF,gCACtB,MAAMK,UAAYF,4BAClB,MAAMK,MAAQF","sources":["./packages/react/context-menu/src/ContextMenu.tsx"],"sourcesContent":["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';\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 isRootMenu: boolean;\n open: boolean;\n onOpenChange(open: boolean): void;\n modal: boolean;\n};\n\nconst [ContextMenuProvider, useContextMenuContext] =\n createContextMenuContext<ContextMenuContextValue>(CONTEXT_MENU_NAME);\n\ninterface ContextMenuProps {\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n children?: React.ReactNode;\n}\n\nconst ContextMenu: React.FC<ContextMenuProps> = (props: ScopedProps<ContextMenuProps>) => {\n const { __scopeContextMenu, children, onOpenChange, dir, modal = true } = props;\n const [open, setOpen] = React.useState(false);\n const contentContext = useContentContext(CONTEXT_MENU_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const handleOpenChangeProp = useCallbackRef(onOpenChange);\n\n const handleOpenChange = React.useCallback(\n (open) => {\n setOpen(open);\n handleOpenChangeProp(open);\n },\n [handleOpenChangeProp]\n );\n\n return contentContext.isInsideContent ? (\n <ContextMenuProvider\n scope={__scopeContextMenu}\n isRootMenu={false}\n open={open}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n <MenuPrimitive.Sub {...menuScope} open={open} onOpenChange={handleOpenChange}>\n {children}\n </MenuPrimitive.Sub>\n </ContextMenuProvider>\n ) : (\n <ContextMenuProvider\n scope={__scopeContextMenu}\n isRootMenu={true}\n open={open}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n <MenuPrimitive.Root\n {...menuScope}\n dir={dir}\n open={open}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n {children}\n </MenuPrimitive.Root>\n </ContextMenuProvider>\n );\n};\n\nContextMenu.displayName = CONTEXT_MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'ContextMenuTrigger';\n\ntype ContextMenuTriggerElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface ContextMenuTriggerProps extends PrimitiveSpanProps {}\n\nconst ContextMenuTrigger = React.forwardRef<ContextMenuTriggerElement, ContextMenuTriggerProps>(\n (props: ScopedProps<ContextMenuTriggerProps>, forwardedRef) => {\n const { __scopeContextMenu, ...triggerProps } = props;\n const context = useContextMenuContext(TRIGGER_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const pointRef = React.useRef<Point>({ x: 0, y: 0 });\n const virtualRef = React.useRef({\n getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...pointRef.current }),\n });\n const longPressTimerRef = React.useRef(0);\n const clearLongPress = React.useCallback(\n () => window.clearTimeout(longPressTimerRef.current),\n []\n );\n const handleOpen = (event: React.MouseEvent | React.PointerEvent) => {\n pointRef.current = { x: event.clientX, y: event.clientY };\n context.onOpenChange(true);\n };\n\n React.useEffect(() => clearLongPress, [clearLongPress]);\n\n return (\n <ContentProvider scope={__scopeContextMenu} isInsideContent={false}>\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 event.preventDefault();\n handleOpen(event);\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 </ContentProvider>\n );\n }\n);\n\nContextMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'ContextMenuContent';\n\nconst [ContentProvider, useContentContext] = createContextMenuContext(CONTENT_NAME, {\n isInsideContent: false,\n});\n\ntype ContextMenuContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;\ninterface ContextMenuContentProps extends Omit<MenuContentProps, 'portalled' | 'side' | '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\n const commonProps = {\n ...contentProps,\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 return (\n <ContentProvider scope={__scopeContextMenu} isInsideContent={true}>\n {context.isRootMenu ? (\n <ContextMenuRootContent\n __scopeContextMenu={__scopeContextMenu}\n {...commonProps}\n ref={forwardedRef}\n />\n ) : (\n <MenuPrimitive.Content {...menuScope} {...commonProps} ref={forwardedRef} />\n )}\n </ContentProvider>\n );\n }\n);\n\nContextMenuContent.displayName = CONTENT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype ContextMenuRootContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ninterface ContextMenuRootContentProps extends ScopedProps<MenuContentProps> {}\n\nconst ContextMenuRootContent = React.forwardRef<\n ContextMenuRootContentElement,\n ContextMenuRootContentProps\n>((props, 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 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 />\n );\n});\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 * ContextMenuTriggerItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_ITEM_NAME = 'ContextMenuTriggerItem';\n\ntype ContextMenuTriggerItemElement = React.ElementRef<typeof MenuPrimitive.SubTrigger>;\ntype MenuSubTriggerProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;\ninterface ContextMenuTriggerItemProps extends MenuSubTriggerProps {}\n\nconst ContextMenuTriggerItem = React.forwardRef<\n ContextMenuTriggerItemElement,\n ContextMenuTriggerItemProps\n>((props: ScopedProps<ContextMenuTriggerItemProps>, forwardedRef) => {\n const { __scopeContextMenu, ...triggerItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.SubTrigger {...menuScope} {...triggerItemProps} ref={forwardedRef} />;\n});\n\nContextMenuTriggerItem.displayName = TRIGGER_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\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 TriggerItem = ContextMenuTriggerItem;\nconst CheckboxItem = ContextMenuCheckboxItem;\nconst RadioGroup = ContextMenuRadioGroup;\nconst RadioItem = ContextMenuRadioItem;\nconst ItemIndicator = ContextMenuItemIndicator;\nconst Separator = ContextMenuSeparator;\nconst Arrow = ContextMenuArrow;\n\nexport {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuTriggerItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n //\n Root,\n Trigger,\n Content,\n Group,\n Label,\n Item,\n TriggerItem,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n};\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuTriggerItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n};\n"],"names":["createContextMenuContext","createContextMenuScope","createContextScope","createMenuScope","useMenuScope","ContextMenuProvider","useContextMenuContext","ContextMenu","props","__scopeContextMenu","children","onOpenChange","dir","modal","open","setOpen","React","useState","contentContext","useContentContext","menuScope","handleOpenChangeProp","useCallbackRef","handleOpenChange","useCallback","isInsideContent","_react","createElement","$b55f3d34bcc87b2d9b0bc87c90588a09$var$ContextMenuProvider","scope","isRootMenu","_radixUiReactMenu","Sub","_babelRuntimeHelpersEsmExtends","Root","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","$b55f3d34bcc87b2d9b0bc87c90588a09$var$ContentProvider","Anchor","Primitive","span","ref","style","WebkitTouchCallout","onContextMenu","composeEventHandlers","preventDefault","onPointerDown","whenTouchOrPen","setTimeout","onPointerMove","onPointerCancel","onPointerUp","ContentProvider","ContextMenuContent","contentProps","commonProps","$b55f3d34bcc87b2d9b0bc87c90588a09$var$ContextMenuRootContent","Content","ContextMenuRootContent","hasInteractedOutsideRef","portalled","side","sideOffset","align","onCloseAutoFocus","_props$onCloseAutoFoc","call","defaultPrevented","onInteractOutside","_props$onInteractOuts","ContextMenuGroup","groupProps","Group","ContextMenuLabel","labelProps","Label","ContextMenuItem","itemProps","Item","ContextMenuTriggerItem","triggerItemProps","SubTrigger","ContextMenuCheckboxItem","checkboxItemProps","CheckboxItem","ContextMenuRadioGroup","radioGroupProps","RadioGroup","ContextMenuRadioItem","radioItemProps","RadioItem","ContextMenuItemIndicator","itemIndicatorProps","ItemIndicator","ContextMenuSeparator","separatorProps","Separator","ContextMenuArrow","arrowProps","Arrow","handler","pointerType","undefined","Trigger","TriggerItem"],"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;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,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AAA,CAAA,CAAA;AAEA,oGAAA,CAEA,SAASI,oCAAT,CAA2BoD,OAA3B,EAAgG;IAC9F,OAAQ7D,CAAAA,KAAD,GAAYA,KAAK,CAAC8D,WAAN,KAAsB,OAAtB,GAAgCD,OAAO,CAAC7D,KAAD,CAAvC,GAAiD+D,SAApE;IAAA,CAAA;CACD;AAED,MAAMC,yCAAI,GAAGrG,yCAAb,AAAA;AACA,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"}
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",
3
+ "version": "0.1.7-rc.30",
4
4
  "license": "MIT",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -18,14 +18,15 @@
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.1",
22
- "@radix-ui/react-menu": "0.1.7-rc.3",
23
- "@radix-ui/react-primitive": "0.1.4",
24
- "@radix-ui/react-use-callback-ref": "0.1.0"
21
+ "@radix-ui/react-context": "0.1.2-rc.27",
22
+ "@radix-ui/react-menu": "0.1.7-rc.30",
23
+ "@radix-ui/react-primitive": "0.1.5-rc.27",
24
+ "@radix-ui/react-use-callback-ref": "0.1.1-rc.27",
25
+ "@radix-ui/react-use-controllable-state": "0.1.1-rc.27"
25
26
  },
26
27
  "peerDependencies": {
27
- "react": "^16.8 || ^17.0",
28
- "react-dom": "^16.8 || ^17.0"
28
+ "react": "^16.8 || ^17.0 || ^18.0",
29
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
29
30
  },
30
31
  "homepage": "https://radix-ui.com/primitives",
31
32
  "repository": {