@radix-ui/react-context-menu 2.1.6-rc.9 → 2.2.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +83 -71
- package/dist/index.d.ts +83 -71
- package/dist/index.js +306 -393
- package/dist/index.js.map +7 -1
- package/dist/index.mjs +295 -340
- package/dist/index.mjs.map +7 -1
- package/package.json +7 -8
- package/dist/index.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,406 +1,319 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
1
|
+
"use strict";
|
|
2
|
+
(() => {
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
10
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
11
|
+
}) : x)(function(x) {
|
|
12
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
13
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
14
|
+
});
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
9
31
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
$parcel$export(module.exports, "CheckboxItem", () => $5de197f6cd80e8e9$export$16ce288f89fa631c);
|
|
42
|
-
$parcel$export(module.exports, "RadioGroup", () => $5de197f6cd80e8e9$export$a98f0dcb43a68a25);
|
|
43
|
-
$parcel$export(module.exports, "RadioItem", () => $5de197f6cd80e8e9$export$371ab307eab489c0);
|
|
44
|
-
$parcel$export(module.exports, "ItemIndicator", () => $5de197f6cd80e8e9$export$c3468e2714d175fa);
|
|
45
|
-
$parcel$export(module.exports, "Separator", () => $5de197f6cd80e8e9$export$1ff3c3f08ae963c0);
|
|
46
|
-
$parcel$export(module.exports, "Arrow", () => $5de197f6cd80e8e9$export$21b07c8f274aebd5);
|
|
47
|
-
$parcel$export(module.exports, "Sub", () => $5de197f6cd80e8e9$export$d7a01e11500dfb6f);
|
|
48
|
-
$parcel$export(module.exports, "SubTrigger", () => $5de197f6cd80e8e9$export$2ea8a7a591ac5eac);
|
|
49
|
-
$parcel$export(module.exports, "SubContent", () => $5de197f6cd80e8e9$export$6d4de93b380beddf);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/* -------------------------------------------------------------------------------------------------
|
|
60
|
-
* ContextMenu
|
|
61
|
-
* -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$CONTEXT_MENU_NAME = 'ContextMenu';
|
|
62
|
-
const [$5de197f6cd80e8e9$var$createContextMenuContext, $5de197f6cd80e8e9$export$1059331f43ddcc82] = $l8XVT$radixuireactcontext.createContextScope($5de197f6cd80e8e9$var$CONTEXT_MENU_NAME, [
|
|
63
|
-
$l8XVT$radixuireactmenu.createMenuScope
|
|
64
|
-
]);
|
|
65
|
-
const $5de197f6cd80e8e9$var$useMenuScope = $l8XVT$radixuireactmenu.createMenuScope();
|
|
66
|
-
const [$5de197f6cd80e8e9$var$ContextMenuProvider, $5de197f6cd80e8e9$var$useContextMenuContext] = $5de197f6cd80e8e9$var$createContextMenuContext($5de197f6cd80e8e9$var$CONTEXT_MENU_NAME);
|
|
67
|
-
const $5de197f6cd80e8e9$export$8dc6765e8be191c7 = (props)=>{
|
|
68
|
-
const { __scopeContextMenu: __scopeContextMenu , children: children , onOpenChange: onOpenChange , dir: dir , modal: modal = true } = props;
|
|
69
|
-
const [open1, setOpen] = $l8XVT$react.useState(false);
|
|
70
|
-
const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
|
|
71
|
-
const handleOpenChangeProp = $l8XVT$radixuireactusecallbackref.useCallbackRef(onOpenChange);
|
|
72
|
-
const handleOpenChange = $l8XVT$react.useCallback((open)=>{
|
|
73
|
-
setOpen(open);
|
|
74
|
-
handleOpenChangeProp(open);
|
|
75
|
-
}, [
|
|
76
|
-
handleOpenChangeProp
|
|
77
|
-
]);
|
|
78
|
-
return /*#__PURE__*/ $l8XVT$react.createElement($5de197f6cd80e8e9$var$ContextMenuProvider, {
|
|
32
|
+
// packages/react/context-menu/src/ContextMenu.tsx
|
|
33
|
+
var React = __toESM(__require("react"));
|
|
34
|
+
var import_primitive = __require("@radix-ui/primitive");
|
|
35
|
+
var import_react_context = __require("@radix-ui/react-context");
|
|
36
|
+
var import_react_primitive = __require("@radix-ui/react-primitive");
|
|
37
|
+
var MenuPrimitive = __toESM(__require("@radix-ui/react-menu"));
|
|
38
|
+
var import_react_menu = __require("@radix-ui/react-menu");
|
|
39
|
+
var import_react_use_callback_ref = __require("@radix-ui/react-use-callback-ref");
|
|
40
|
+
var import_react_use_controllable_state = __require("@radix-ui/react-use-controllable-state");
|
|
41
|
+
var import_jsx_runtime = __require("react/jsx-runtime");
|
|
42
|
+
var CONTEXT_MENU_NAME = "ContextMenu";
|
|
43
|
+
var [createContextMenuContext, createContextMenuScope] = (0, import_react_context.createContextScope)(CONTEXT_MENU_NAME, [
|
|
44
|
+
import_react_menu.createMenuScope
|
|
45
|
+
]);
|
|
46
|
+
var useMenuScope = (0, import_react_menu.createMenuScope)();
|
|
47
|
+
var [ContextMenuProvider, useContextMenuContext] = createContextMenuContext(CONTEXT_MENU_NAME);
|
|
48
|
+
var ContextMenu = (props) => {
|
|
49
|
+
const { __scopeContextMenu, children, onOpenChange, dir, modal = true } = props;
|
|
50
|
+
const [open, setOpen] = React.useState(false);
|
|
51
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
52
|
+
const handleOpenChangeProp = (0, import_react_use_callback_ref.useCallbackRef)(onOpenChange);
|
|
53
|
+
const handleOpenChange = React.useCallback(
|
|
54
|
+
(open2) => {
|
|
55
|
+
setOpen(open2);
|
|
56
|
+
handleOpenChangeProp(open2);
|
|
57
|
+
},
|
|
58
|
+
[handleOpenChangeProp]
|
|
59
|
+
);
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
+
ContextMenuProvider,
|
|
62
|
+
{
|
|
79
63
|
scope: __scopeContextMenu,
|
|
80
|
-
open
|
|
81
|
-
onOpenChange: handleOpenChange,
|
|
82
|
-
modal: modal
|
|
83
|
-
}, /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Root, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, {
|
|
84
|
-
dir: dir,
|
|
85
|
-
open: open1,
|
|
64
|
+
open,
|
|
86
65
|
onOpenChange: handleOpenChange,
|
|
87
|
-
modal
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
66
|
+
modal,
|
|
67
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
MenuPrimitive.Root,
|
|
69
|
+
{
|
|
70
|
+
...menuScope,
|
|
71
|
+
dir,
|
|
72
|
+
open,
|
|
73
|
+
onOpenChange: handleOpenChange,
|
|
74
|
+
modal,
|
|
75
|
+
children
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
ContextMenu.displayName = CONTEXT_MENU_NAME;
|
|
82
|
+
var TRIGGER_NAME = "ContextMenuTrigger";
|
|
83
|
+
var ContextMenuTrigger = React.forwardRef(
|
|
84
|
+
(props, forwardedRef) => {
|
|
85
|
+
const { __scopeContextMenu, disabled = false, ...triggerProps } = props;
|
|
86
|
+
const context = useContextMenuContext(TRIGGER_NAME, __scopeContextMenu);
|
|
87
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
88
|
+
const pointRef = React.useRef({ x: 0, y: 0 });
|
|
89
|
+
const virtualRef = React.useRef({
|
|
90
|
+
getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...pointRef.current })
|
|
91
|
+
});
|
|
92
|
+
const longPressTimerRef = React.useRef(0);
|
|
93
|
+
const clearLongPress = React.useCallback(
|
|
94
|
+
() => window.clearTimeout(longPressTimerRef.current),
|
|
95
|
+
[]
|
|
96
|
+
);
|
|
97
|
+
const handleOpen = (event) => {
|
|
98
|
+
pointRef.current = { x: event.clientX, y: event.clientY };
|
|
119
99
|
context.onOpenChange(true);
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
const hasInteractedOutsideRef = $l8XVT$react.useRef(false);
|
|
183
|
-
return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Content, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, contentProps, {
|
|
184
|
-
ref: forwardedRef,
|
|
185
|
-
side: "right",
|
|
186
|
-
sideOffset: 2,
|
|
187
|
-
align: "start",
|
|
188
|
-
onCloseAutoFocus: (event)=>{
|
|
189
|
-
var _props$onCloseAutoFoc;
|
|
190
|
-
(_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event);
|
|
191
|
-
if (!event.defaultPrevented && hasInteractedOutsideRef.current) event.preventDefault();
|
|
100
|
+
};
|
|
101
|
+
React.useEffect(() => clearLongPress, [clearLongPress]);
|
|
102
|
+
React.useEffect(() => void (disabled && clearLongPress()), [disabled, clearLongPress]);
|
|
103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Anchor, { ...menuScope, virtualRef }),
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
106
|
+
import_react_primitive.Primitive.span,
|
|
107
|
+
{
|
|
108
|
+
"data-state": context.open ? "open" : "closed",
|
|
109
|
+
"data-disabled": disabled ? "" : void 0,
|
|
110
|
+
...triggerProps,
|
|
111
|
+
ref: forwardedRef,
|
|
112
|
+
style: { WebkitTouchCallout: "none", ...props.style },
|
|
113
|
+
onContextMenu: disabled ? props.onContextMenu : (0, import_primitive.composeEventHandlers)(props.onContextMenu, (event) => {
|
|
114
|
+
clearLongPress();
|
|
115
|
+
handleOpen(event);
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
}),
|
|
118
|
+
onPointerDown: disabled ? props.onPointerDown : (0, import_primitive.composeEventHandlers)(
|
|
119
|
+
props.onPointerDown,
|
|
120
|
+
whenTouchOrPen((event) => {
|
|
121
|
+
clearLongPress();
|
|
122
|
+
longPressTimerRef.current = window.setTimeout(() => handleOpen(event), 700);
|
|
123
|
+
})
|
|
124
|
+
),
|
|
125
|
+
onPointerMove: disabled ? props.onPointerMove : (0, import_primitive.composeEventHandlers)(props.onPointerMove, whenTouchOrPen(clearLongPress)),
|
|
126
|
+
onPointerCancel: disabled ? props.onPointerCancel : (0, import_primitive.composeEventHandlers)(props.onPointerCancel, whenTouchOrPen(clearLongPress)),
|
|
127
|
+
onPointerUp: disabled ? props.onPointerUp : (0, import_primitive.composeEventHandlers)(props.onPointerUp, whenTouchOrPen(clearLongPress))
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
] });
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
ContextMenuTrigger.displayName = TRIGGER_NAME;
|
|
134
|
+
var PORTAL_NAME = "ContextMenuPortal";
|
|
135
|
+
var ContextMenuPortal = (props) => {
|
|
136
|
+
const { __scopeContextMenu, ...portalProps } = props;
|
|
137
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Portal, { ...menuScope, ...portalProps });
|
|
139
|
+
};
|
|
140
|
+
ContextMenuPortal.displayName = PORTAL_NAME;
|
|
141
|
+
var CONTENT_NAME = "ContextMenuContent";
|
|
142
|
+
var ContextMenuContent = React.forwardRef(
|
|
143
|
+
(props, forwardedRef) => {
|
|
144
|
+
const { __scopeContextMenu, ...contentProps } = props;
|
|
145
|
+
const context = useContextMenuContext(CONTENT_NAME, __scopeContextMenu);
|
|
146
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
147
|
+
const hasInteractedOutsideRef = React.useRef(false);
|
|
148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
149
|
+
MenuPrimitive.Content,
|
|
150
|
+
{
|
|
151
|
+
...menuScope,
|
|
152
|
+
...contentProps,
|
|
153
|
+
ref: forwardedRef,
|
|
154
|
+
side: "right",
|
|
155
|
+
sideOffset: 2,
|
|
156
|
+
align: "start",
|
|
157
|
+
onCloseAutoFocus: (event) => {
|
|
158
|
+
props.onCloseAutoFocus?.(event);
|
|
159
|
+
if (!event.defaultPrevented && hasInteractedOutsideRef.current) {
|
|
160
|
+
event.preventDefault();
|
|
161
|
+
}
|
|
192
162
|
hasInteractedOutsideRef.current = false;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
(_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event);
|
|
163
|
+
},
|
|
164
|
+
onInteractOutside: (event) => {
|
|
165
|
+
props.onInteractOutside?.(event);
|
|
197
166
|
if (!event.defaultPrevented && !context.modal) hasInteractedOutsideRef.current = true;
|
|
198
|
-
|
|
199
|
-
|
|
167
|
+
},
|
|
168
|
+
style: {
|
|
200
169
|
...props.style,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
170
|
+
// re-namespace exposed content custom properties
|
|
171
|
+
...{
|
|
172
|
+
"--radix-context-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
173
|
+
"--radix-context-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
174
|
+
"--radix-context-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
175
|
+
"--radix-context-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
176
|
+
"--radix-context-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
206
179
|
}
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
/*
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const { __scopeContextMenu
|
|
269
|
-
const menuScope =
|
|
270
|
-
return
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
/* -------------------------------------------------------------------------------------------------
|
|
291
|
-
* ContextMenuItemIndicator
|
|
292
|
-
* -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$INDICATOR_NAME = 'ContextMenuItemIndicator';
|
|
293
|
-
const $5de197f6cd80e8e9$export$9ed8194dee42d94b = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
|
|
294
|
-
const { __scopeContextMenu: __scopeContextMenu , ...itemIndicatorProps } = props;
|
|
295
|
-
const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
|
|
296
|
-
return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.ItemIndicator, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, itemIndicatorProps, {
|
|
297
|
-
ref: forwardedRef
|
|
298
|
-
}));
|
|
299
|
-
});
|
|
300
|
-
/*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$9ed8194dee42d94b, {
|
|
301
|
-
displayName: $5de197f6cd80e8e9$var$INDICATOR_NAME
|
|
302
|
-
});
|
|
303
|
-
/* -------------------------------------------------------------------------------------------------
|
|
304
|
-
* ContextMenuSeparator
|
|
305
|
-
* -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$SEPARATOR_NAME = 'ContextMenuSeparator';
|
|
306
|
-
const $5de197f6cd80e8e9$export$8d6b009fadfe1207 = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
|
|
307
|
-
const { __scopeContextMenu: __scopeContextMenu , ...separatorProps } = props;
|
|
308
|
-
const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
|
|
309
|
-
return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Separator, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, separatorProps, {
|
|
310
|
-
ref: forwardedRef
|
|
311
|
-
}));
|
|
312
|
-
});
|
|
313
|
-
/*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$8d6b009fadfe1207, {
|
|
314
|
-
displayName: $5de197f6cd80e8e9$var$SEPARATOR_NAME
|
|
315
|
-
});
|
|
316
|
-
/* -------------------------------------------------------------------------------------------------
|
|
317
|
-
* ContextMenuArrow
|
|
318
|
-
* -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$ARROW_NAME = 'ContextMenuArrow';
|
|
319
|
-
const $5de197f6cd80e8e9$export$f47d0a58228a61e2 = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
|
|
320
|
-
const { __scopeContextMenu: __scopeContextMenu , ...arrowProps } = props;
|
|
321
|
-
const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
|
|
322
|
-
return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.Arrow, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, arrowProps, {
|
|
323
|
-
ref: forwardedRef
|
|
324
|
-
}));
|
|
325
|
-
});
|
|
326
|
-
/*#__PURE__*/ Object.assign($5de197f6cd80e8e9$export$f47d0a58228a61e2, {
|
|
327
|
-
displayName: $5de197f6cd80e8e9$var$ARROW_NAME
|
|
328
|
-
});
|
|
329
|
-
/* -------------------------------------------------------------------------------------------------
|
|
330
|
-
* ContextMenuSub
|
|
331
|
-
* -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$SUB_NAME = 'ContextMenuSub';
|
|
332
|
-
const $5de197f6cd80e8e9$export$5bc21d1c00c4b201 = (props)=>{
|
|
333
|
-
const { __scopeContextMenu: __scopeContextMenu , children: children , onOpenChange: onOpenChange , open: openProp , defaultOpen: defaultOpen } = props;
|
|
334
|
-
const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
|
|
335
|
-
const [open, setOpen] = $l8XVT$radixuireactusecontrollablestate.useControllableState({
|
|
336
|
-
prop: openProp,
|
|
337
|
-
defaultProp: defaultOpen,
|
|
338
|
-
onChange: onOpenChange
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
ContextMenuContent.displayName = CONTENT_NAME;
|
|
184
|
+
var GROUP_NAME = "ContextMenuGroup";
|
|
185
|
+
var ContextMenuGroup = React.forwardRef(
|
|
186
|
+
(props, forwardedRef) => {
|
|
187
|
+
const { __scopeContextMenu, ...groupProps } = props;
|
|
188
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Group, { ...menuScope, ...groupProps, ref: forwardedRef });
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
ContextMenuGroup.displayName = GROUP_NAME;
|
|
193
|
+
var LABEL_NAME = "ContextMenuLabel";
|
|
194
|
+
var ContextMenuLabel = React.forwardRef(
|
|
195
|
+
(props, forwardedRef) => {
|
|
196
|
+
const { __scopeContextMenu, ...labelProps } = props;
|
|
197
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Label, { ...menuScope, ...labelProps, ref: forwardedRef });
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
ContextMenuLabel.displayName = LABEL_NAME;
|
|
202
|
+
var ITEM_NAME = "ContextMenuItem";
|
|
203
|
+
var ContextMenuItem = React.forwardRef(
|
|
204
|
+
(props, forwardedRef) => {
|
|
205
|
+
const { __scopeContextMenu, ...itemProps } = props;
|
|
206
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef });
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
ContextMenuItem.displayName = ITEM_NAME;
|
|
211
|
+
var CHECKBOX_ITEM_NAME = "ContextMenuCheckboxItem";
|
|
212
|
+
var ContextMenuCheckboxItem = React.forwardRef((props, forwardedRef) => {
|
|
213
|
+
const { __scopeContextMenu, ...checkboxItemProps } = props;
|
|
214
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
216
|
+
});
|
|
217
|
+
ContextMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
218
|
+
var RADIO_GROUP_NAME = "ContextMenuRadioGroup";
|
|
219
|
+
var ContextMenuRadioGroup = React.forwardRef((props, forwardedRef) => {
|
|
220
|
+
const { __scopeContextMenu, ...radioGroupProps } = props;
|
|
221
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
223
|
+
});
|
|
224
|
+
ContextMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
225
|
+
var RADIO_ITEM_NAME = "ContextMenuRadioItem";
|
|
226
|
+
var ContextMenuRadioItem = React.forwardRef((props, forwardedRef) => {
|
|
227
|
+
const { __scopeContextMenu, ...radioItemProps } = props;
|
|
228
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
230
|
+
});
|
|
231
|
+
ContextMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
232
|
+
var INDICATOR_NAME = "ContextMenuItemIndicator";
|
|
233
|
+
var ContextMenuItemIndicator = React.forwardRef((props, forwardedRef) => {
|
|
234
|
+
const { __scopeContextMenu, ...itemIndicatorProps } = props;
|
|
235
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
237
|
+
});
|
|
238
|
+
ContextMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
239
|
+
var SEPARATOR_NAME = "ContextMenuSeparator";
|
|
240
|
+
var ContextMenuSeparator = React.forwardRef((props, forwardedRef) => {
|
|
241
|
+
const { __scopeContextMenu, ...separatorProps } = props;
|
|
242
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
244
|
+
});
|
|
245
|
+
ContextMenuSeparator.displayName = SEPARATOR_NAME;
|
|
246
|
+
var ARROW_NAME = "ContextMenuArrow";
|
|
247
|
+
var ContextMenuArrow = React.forwardRef(
|
|
248
|
+
(props, forwardedRef) => {
|
|
249
|
+
const { __scopeContextMenu, ...arrowProps } = props;
|
|
250
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef });
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
ContextMenuArrow.displayName = ARROW_NAME;
|
|
255
|
+
var SUB_NAME = "ContextMenuSub";
|
|
256
|
+
var ContextMenuSub = (props) => {
|
|
257
|
+
const { __scopeContextMenu, children, onOpenChange, open: openProp, defaultOpen } = props;
|
|
258
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
259
|
+
const [open, setOpen] = (0, import_react_use_controllable_state.useControllableState)({
|
|
260
|
+
prop: openProp,
|
|
261
|
+
defaultProp: defaultOpen,
|
|
262
|
+
onChange: onOpenChange
|
|
339
263
|
});
|
|
340
|
-
return
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
});
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
const { __scopeContextMenu
|
|
353
|
-
const menuScope =
|
|
354
|
-
return
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
displayName: $5de197f6cd80e8e9$var$SUB_TRIGGER_NAME
|
|
360
|
-
});
|
|
361
|
-
/* -------------------------------------------------------------------------------------------------
|
|
362
|
-
* ContextMenuSubContent
|
|
363
|
-
* -----------------------------------------------------------------------------------------------*/ const $5de197f6cd80e8e9$var$SUB_CONTENT_NAME = 'ContextMenuSubContent';
|
|
364
|
-
const $5de197f6cd80e8e9$export$2c967063bd2dc512 = /*#__PURE__*/ $l8XVT$react.forwardRef((props, forwardedRef)=>{
|
|
365
|
-
const { __scopeContextMenu: __scopeContextMenu , ...subContentProps } = props;
|
|
366
|
-
const menuScope = $5de197f6cd80e8e9$var$useMenuScope(__scopeContextMenu);
|
|
367
|
-
return /*#__PURE__*/ $l8XVT$react.createElement($l8XVT$radixuireactmenu.SubContent, ($parcel$interopDefault($l8XVT$babelruntimehelpersextends))({}, menuScope, subContentProps, {
|
|
264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
265
|
+
};
|
|
266
|
+
ContextMenuSub.displayName = SUB_NAME;
|
|
267
|
+
var SUB_TRIGGER_NAME = "ContextMenuSubTrigger";
|
|
268
|
+
var ContextMenuSubTrigger = React.forwardRef((props, forwardedRef) => {
|
|
269
|
+
const { __scopeContextMenu, ...triggerItemProps } = props;
|
|
270
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.SubTrigger, { ...menuScope, ...triggerItemProps, ref: forwardedRef });
|
|
272
|
+
});
|
|
273
|
+
ContextMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
274
|
+
var SUB_CONTENT_NAME = "ContextMenuSubContent";
|
|
275
|
+
var ContextMenuSubContent = React.forwardRef((props, forwardedRef) => {
|
|
276
|
+
const { __scopeContextMenu, ...subContentProps } = props;
|
|
277
|
+
const menuScope = useMenuScope(__scopeContextMenu);
|
|
278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
279
|
+
MenuPrimitive.SubContent,
|
|
280
|
+
{
|
|
281
|
+
...menuScope,
|
|
282
|
+
...subContentProps,
|
|
368
283
|
ref: forwardedRef,
|
|
369
284
|
style: {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
285
|
+
...props.style,
|
|
286
|
+
// re-namespace exposed content custom properties
|
|
287
|
+
...{
|
|
288
|
+
"--radix-context-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
289
|
+
"--radix-context-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
290
|
+
"--radix-context-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
291
|
+
"--radix-context-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
292
|
+
"--radix-context-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
293
|
+
}
|
|
376
294
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
const $5de197f6cd80e8e9$export$6d4de93b380beddf = $5de197f6cd80e8e9$export$2c967063bd2dc512;
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
});
|
|
298
|
+
ContextMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
299
|
+
function whenTouchOrPen(handler) {
|
|
300
|
+
return (event) => event.pointerType !== "mouse" ? handler(event) : void 0;
|
|
301
|
+
}
|
|
302
|
+
var Root2 = ContextMenu;
|
|
303
|
+
var Trigger = ContextMenuTrigger;
|
|
304
|
+
var Portal2 = ContextMenuPortal;
|
|
305
|
+
var Content2 = ContextMenuContent;
|
|
306
|
+
var Group2 = ContextMenuGroup;
|
|
307
|
+
var Label2 = ContextMenuLabel;
|
|
308
|
+
var Item2 = ContextMenuItem;
|
|
309
|
+
var CheckboxItem2 = ContextMenuCheckboxItem;
|
|
310
|
+
var RadioGroup2 = ContextMenuRadioGroup;
|
|
311
|
+
var RadioItem2 = ContextMenuRadioItem;
|
|
312
|
+
var ItemIndicator2 = ContextMenuItemIndicator;
|
|
313
|
+
var Separator2 = ContextMenuSeparator;
|
|
314
|
+
var Arrow2 = ContextMenuArrow;
|
|
315
|
+
var Sub2 = ContextMenuSub;
|
|
316
|
+
var SubTrigger2 = ContextMenuSubTrigger;
|
|
317
|
+
var SubContent2 = ContextMenuSubContent;
|
|
318
|
+
})();
|
|
406
319
|
//# sourceMappingURL=index.js.map
|