create-airjam 0.1.7 → 0.2.0
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.js +12 -4
- package/package.json +10 -8
- package/templates/pong/.env.example +7 -0
- package/templates/pong/{AI_INSTRUCTIONS.md → AGENTS.md} +9 -2
- package/templates/pong/README.md +38 -3
- package/templates/pong/airjam-docs/for-agents/page.md +27 -0
- package/templates/pong/airjam-docs/getting-started/architecture/page.md +4 -1
- package/templates/pong/airjam-docs/getting-started/introduction/page.md +56 -38
- package/templates/pong/airjam-docs/getting-started/quick-start/page.md +108 -0
- package/templates/pong/airjam-docs/how-it-works/architecture/page.md +168 -0
- package/templates/pong/airjam-docs/how-it-works/host-system/page.md +20 -10
- package/templates/pong/airjam-docs/sdk/hooks/page.md +13 -11
- package/templates/pong/airjam-docs/sdk/networked-state/page.md +1 -1
- package/templates/pong/package.json +6 -3
- package/templates/pong/scripts/dev-secure.mjs +177 -0
- package/templates/pong/scripts/secure-init.mjs +134 -0
- package/templates/pong/src/App.tsx +2 -0
- package/templates/pong/src/controller-view.tsx +78 -99
- package/templates/pong/src/host-view.tsx +3 -18
- package/templates/pong/src/vite-env.d.ts +1 -0
- package/templates/pong/vite.config.ts +9 -0
- package/templates/pong/dist/assets/index-BwJ4uU20.js +0 -269
- package/templates/pong/dist/assets/index-D42jDbB5.css +0 -1
- package/templates/pong/dist/index.html +0 -19
- package/templates/pong/node_modules/.bin/air-jam-server +0 -17
- package/templates/pong/node_modules/.bin/eslint +0 -17
- package/templates/pong/node_modules/.bin/eslint-config-prettier +0 -17
- package/templates/pong/node_modules/.bin/tsc +0 -17
- package/templates/pong/node_modules/.bin/tsserver +0 -17
- package/templates/pong/node_modules/.bin/vite +0 -17
- package/templates/pong/node_modules/.vite/deps/@radix-ui_react-dialog.js +0 -1680
- package/templates/pong/node_modules/.vite/deps/@radix-ui_react-dialog.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/@radix-ui_react-slider.js +0 -638
- package/templates/pong/node_modules/.vite/deps/@radix-ui_react-slider.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/@radix-ui_react-slot.js +0 -129
- package/templates/pong/node_modules/.vite/deps/@radix-ui_react-slot.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/@radix-ui_react-tabs.js +0 -434
- package/templates/pong/node_modules/.vite/deps/@radix-ui_react-tabs.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/_metadata.json +0 -163
- package/templates/pong/node_modules/.vite/deps/chunk-6G72RLJL.js +0 -1004
- package/templates/pong/node_modules/.vite/deps/chunk-6G72RLJL.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/chunk-BHOBIW4J.js +0 -99
- package/templates/pong/node_modules/.vite/deps/chunk-BHOBIW4J.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/chunk-E44IQKDY.js +0 -49
- package/templates/pong/node_modules/.vite/deps/chunk-E44IQKDY.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/chunk-E5X4SHYG.js +0 -21
- package/templates/pong/node_modules/.vite/deps/chunk-E5X4SHYG.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/chunk-G3PMV62Z.js +0 -35
- package/templates/pong/node_modules/.vite/deps/chunk-G3PMV62Z.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/chunk-LI6KBZ3D.js +0 -292
- package/templates/pong/node_modules/.vite/deps/chunk-LI6KBZ3D.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/chunk-MDNXVKSA.js +0 -337
- package/templates/pong/node_modules/.vite/deps/chunk-MDNXVKSA.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/chunk-METQ356G.js +0 -280
- package/templates/pong/node_modules/.vite/deps/chunk-METQ356G.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/chunk-NPTAWNEA.js +0 -171
- package/templates/pong/node_modules/.vite/deps/chunk-NPTAWNEA.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/class-variance-authority.js +0 -51
- package/templates/pong/node_modules/.vite/deps/class-variance-authority.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/clsx.js +0 -9
- package/templates/pong/node_modules/.vite/deps/clsx.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/howler.js +0 -2241
- package/templates/pong/node_modules/.vite/deps/howler.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/html5-qrcode.js +0 -29350
- package/templates/pong/node_modules/.vite/deps/html5-qrcode.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/lucide-react.js +0 -28662
- package/templates/pong/node_modules/.vite/deps/lucide-react.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/package.json +0 -3
- package/templates/pong/node_modules/.vite/deps/qrcode.js +0 -2083
- package/templates/pong/node_modules/.vite/deps/qrcode.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/react-dom.js +0 -6
- package/templates/pong/node_modules/.vite/deps/react-dom.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/react-dom_client.js +0 -20217
- package/templates/pong/node_modules/.vite/deps/react-dom_client.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/react-router-dom.js +0 -13900
- package/templates/pong/node_modules/.vite/deps/react-router-dom.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/react.js +0 -5
- package/templates/pong/node_modules/.vite/deps/react.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/react_jsx-dev-runtime.js +0 -278
- package/templates/pong/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/react_jsx-runtime.js +0 -6
- package/templates/pong/node_modules/.vite/deps/react_jsx-runtime.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/socket__io-client.js +0 -3422
- package/templates/pong/node_modules/.vite/deps/socket__io-client.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/tailwind-merge.js +0 -2534
- package/templates/pong/node_modules/.vite/deps/tailwind-merge.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/zod.js +0 -13810
- package/templates/pong/node_modules/.vite/deps/zod.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/zustand.js +0 -56
- package/templates/pong/node_modules/.vite/deps/zustand.js.map +0 -7
- package/templates/pong/node_modules/.vite/deps/zustand_react_shallow.js +0 -77
- package/templates/pong/node_modules/.vite/deps/zustand_react_shallow.js.map +0 -7
|
@@ -1,1680 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
Presence,
|
|
4
|
-
useCallbackRef,
|
|
5
|
-
useId
|
|
6
|
-
} from "./chunk-NPTAWNEA.js";
|
|
7
|
-
import {
|
|
8
|
-
Primitive,
|
|
9
|
-
composeEventHandlers,
|
|
10
|
-
createContext2,
|
|
11
|
-
createContextScope,
|
|
12
|
-
createSlot,
|
|
13
|
-
dispatchDiscreteCustomEvent,
|
|
14
|
-
useControllableState,
|
|
15
|
-
useLayoutEffect2
|
|
16
|
-
} from "./chunk-MDNXVKSA.js";
|
|
17
|
-
import {
|
|
18
|
-
require_react_dom
|
|
19
|
-
} from "./chunk-METQ356G.js";
|
|
20
|
-
import {
|
|
21
|
-
useComposedRefs
|
|
22
|
-
} from "./chunk-E44IQKDY.js";
|
|
23
|
-
import {
|
|
24
|
-
require_jsx_runtime
|
|
25
|
-
} from "./chunk-LI6KBZ3D.js";
|
|
26
|
-
import {
|
|
27
|
-
require_react
|
|
28
|
-
} from "./chunk-6G72RLJL.js";
|
|
29
|
-
import {
|
|
30
|
-
__toESM
|
|
31
|
-
} from "./chunk-G3PMV62Z.js";
|
|
32
|
-
|
|
33
|
-
// ../../../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.15_@types+react-dom@19.2.3_@types+react@19.2.6__@types+react@19.2._vo4kj5mvvikqqetwf4krwfjr74/node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
34
|
-
var React15 = __toESM(require_react(), 1);
|
|
35
|
-
|
|
36
|
-
// ../../../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.11_@types+react-dom@19.2.3_@types+react@19.2.6__@types+_uuuuyl6beu5dpjhlw6uzwkcyku/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
37
|
-
var React2 = __toESM(require_react(), 1);
|
|
38
|
-
|
|
39
|
-
// ../../../../node_modules/.pnpm/@radix-ui+react-use-escape-keydown@1.1.1_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
|
|
40
|
-
var React = __toESM(require_react(), 1);
|
|
41
|
-
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
42
|
-
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
43
|
-
React.useEffect(() => {
|
|
44
|
-
const handleKeyDown = (event) => {
|
|
45
|
-
if (event.key === "Escape") {
|
|
46
|
-
onEscapeKeyDown(event);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
50
|
-
return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
51
|
-
}, [onEscapeKeyDown, ownerDocument]);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// ../../../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.11_@types+react-dom@19.2.3_@types+react@19.2.6__@types+_uuuuyl6beu5dpjhlw6uzwkcyku/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
55
|
-
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
56
|
-
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
|
57
|
-
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
58
|
-
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
59
|
-
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
60
|
-
var originalBodyPointerEvents;
|
|
61
|
-
var DismissableLayerContext = React2.createContext({
|
|
62
|
-
layers: /* @__PURE__ */ new Set(),
|
|
63
|
-
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
64
|
-
branches: /* @__PURE__ */ new Set()
|
|
65
|
-
});
|
|
66
|
-
var DismissableLayer = React2.forwardRef(
|
|
67
|
-
(props, forwardedRef) => {
|
|
68
|
-
const {
|
|
69
|
-
disableOutsidePointerEvents = false,
|
|
70
|
-
onEscapeKeyDown,
|
|
71
|
-
onPointerDownOutside,
|
|
72
|
-
onFocusOutside,
|
|
73
|
-
onInteractOutside,
|
|
74
|
-
onDismiss,
|
|
75
|
-
...layerProps
|
|
76
|
-
} = props;
|
|
77
|
-
const context = React2.useContext(DismissableLayerContext);
|
|
78
|
-
const [node, setNode] = React2.useState(null);
|
|
79
|
-
const ownerDocument = (node == null ? void 0 : node.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document);
|
|
80
|
-
const [, force] = React2.useState({});
|
|
81
|
-
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
82
|
-
const layers = Array.from(context.layers);
|
|
83
|
-
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
84
|
-
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
85
|
-
const index = node ? layers.indexOf(node) : -1;
|
|
86
|
-
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
87
|
-
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
88
|
-
const pointerDownOutside = usePointerDownOutside((event) => {
|
|
89
|
-
const target = event.target;
|
|
90
|
-
const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
91
|
-
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
92
|
-
onPointerDownOutside == null ? void 0 : onPointerDownOutside(event);
|
|
93
|
-
onInteractOutside == null ? void 0 : onInteractOutside(event);
|
|
94
|
-
if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
|
|
95
|
-
}, ownerDocument);
|
|
96
|
-
const focusOutside = useFocusOutside((event) => {
|
|
97
|
-
const target = event.target;
|
|
98
|
-
const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
99
|
-
if (isFocusInBranch) return;
|
|
100
|
-
onFocusOutside == null ? void 0 : onFocusOutside(event);
|
|
101
|
-
onInteractOutside == null ? void 0 : onInteractOutside(event);
|
|
102
|
-
if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
|
|
103
|
-
}, ownerDocument);
|
|
104
|
-
useEscapeKeydown((event) => {
|
|
105
|
-
const isHighestLayer = index === context.layers.size - 1;
|
|
106
|
-
if (!isHighestLayer) return;
|
|
107
|
-
onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(event);
|
|
108
|
-
if (!event.defaultPrevented && onDismiss) {
|
|
109
|
-
event.preventDefault();
|
|
110
|
-
onDismiss();
|
|
111
|
-
}
|
|
112
|
-
}, ownerDocument);
|
|
113
|
-
React2.useEffect(() => {
|
|
114
|
-
if (!node) return;
|
|
115
|
-
if (disableOutsidePointerEvents) {
|
|
116
|
-
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
117
|
-
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
118
|
-
ownerDocument.body.style.pointerEvents = "none";
|
|
119
|
-
}
|
|
120
|
-
context.layersWithOutsidePointerEventsDisabled.add(node);
|
|
121
|
-
}
|
|
122
|
-
context.layers.add(node);
|
|
123
|
-
dispatchUpdate();
|
|
124
|
-
return () => {
|
|
125
|
-
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
|
|
126
|
-
ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
130
|
-
React2.useEffect(() => {
|
|
131
|
-
return () => {
|
|
132
|
-
if (!node) return;
|
|
133
|
-
context.layers.delete(node);
|
|
134
|
-
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
|
135
|
-
dispatchUpdate();
|
|
136
|
-
};
|
|
137
|
-
}, [node, context]);
|
|
138
|
-
React2.useEffect(() => {
|
|
139
|
-
const handleUpdate = () => force({});
|
|
140
|
-
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
141
|
-
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
142
|
-
}, []);
|
|
143
|
-
return (0, import_jsx_runtime.jsx)(
|
|
144
|
-
Primitive.div,
|
|
145
|
-
{
|
|
146
|
-
...layerProps,
|
|
147
|
-
ref: composedRefs,
|
|
148
|
-
style: {
|
|
149
|
-
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
|
150
|
-
...props.style
|
|
151
|
-
},
|
|
152
|
-
onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
153
|
-
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
154
|
-
onPointerDownCapture: composeEventHandlers(
|
|
155
|
-
props.onPointerDownCapture,
|
|
156
|
-
pointerDownOutside.onPointerDownCapture
|
|
157
|
-
)
|
|
158
|
-
}
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
);
|
|
162
|
-
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
163
|
-
var BRANCH_NAME = "DismissableLayerBranch";
|
|
164
|
-
var DismissableLayerBranch = React2.forwardRef((props, forwardedRef) => {
|
|
165
|
-
const context = React2.useContext(DismissableLayerContext);
|
|
166
|
-
const ref = React2.useRef(null);
|
|
167
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
168
|
-
React2.useEffect(() => {
|
|
169
|
-
const node = ref.current;
|
|
170
|
-
if (node) {
|
|
171
|
-
context.branches.add(node);
|
|
172
|
-
return () => {
|
|
173
|
-
context.branches.delete(node);
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
}, [context.branches]);
|
|
177
|
-
return (0, import_jsx_runtime.jsx)(Primitive.div, { ...props, ref: composedRefs });
|
|
178
|
-
});
|
|
179
|
-
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
180
|
-
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
181
|
-
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
182
|
-
const isPointerInsideReactTreeRef = React2.useRef(false);
|
|
183
|
-
const handleClickRef = React2.useRef(() => {
|
|
184
|
-
});
|
|
185
|
-
React2.useEffect(() => {
|
|
186
|
-
const handlePointerDown = (event) => {
|
|
187
|
-
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
188
|
-
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
189
|
-
handleAndDispatchCustomEvent(
|
|
190
|
-
POINTER_DOWN_OUTSIDE,
|
|
191
|
-
handlePointerDownOutside,
|
|
192
|
-
eventDetail,
|
|
193
|
-
{ discrete: true }
|
|
194
|
-
);
|
|
195
|
-
};
|
|
196
|
-
var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
|
|
197
|
-
const eventDetail = { originalEvent: event };
|
|
198
|
-
if (event.pointerType === "touch") {
|
|
199
|
-
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
200
|
-
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
|
|
201
|
-
ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
|
|
202
|
-
} else {
|
|
203
|
-
handleAndDispatchPointerDownOutsideEvent2();
|
|
204
|
-
}
|
|
205
|
-
} else {
|
|
206
|
-
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
207
|
-
}
|
|
208
|
-
isPointerInsideReactTreeRef.current = false;
|
|
209
|
-
};
|
|
210
|
-
const timerId = window.setTimeout(() => {
|
|
211
|
-
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
212
|
-
}, 0);
|
|
213
|
-
return () => {
|
|
214
|
-
window.clearTimeout(timerId);
|
|
215
|
-
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
216
|
-
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
217
|
-
};
|
|
218
|
-
}, [ownerDocument, handlePointerDownOutside]);
|
|
219
|
-
return {
|
|
220
|
-
// ensures we check React component tree (not just DOM tree)
|
|
221
|
-
onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
225
|
-
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
226
|
-
const isFocusInsideReactTreeRef = React2.useRef(false);
|
|
227
|
-
React2.useEffect(() => {
|
|
228
|
-
const handleFocus = (event) => {
|
|
229
|
-
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
230
|
-
const eventDetail = { originalEvent: event };
|
|
231
|
-
handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
232
|
-
discrete: false
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
ownerDocument.addEventListener("focusin", handleFocus);
|
|
237
|
-
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
|
238
|
-
}, [ownerDocument, handleFocusOutside]);
|
|
239
|
-
return {
|
|
240
|
-
onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
|
|
241
|
-
onBlurCapture: () => isFocusInsideReactTreeRef.current = false
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
function dispatchUpdate() {
|
|
245
|
-
const event = new CustomEvent(CONTEXT_UPDATE);
|
|
246
|
-
document.dispatchEvent(event);
|
|
247
|
-
}
|
|
248
|
-
function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
249
|
-
const target = detail.originalEvent.target;
|
|
250
|
-
const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
|
|
251
|
-
if (handler) target.addEventListener(name, handler, { once: true });
|
|
252
|
-
if (discrete) {
|
|
253
|
-
dispatchDiscreteCustomEvent(target, event);
|
|
254
|
-
} else {
|
|
255
|
-
target.dispatchEvent(event);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
// ../../../../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.7_@types+react-dom@19.2.3_@types+react@19.2.6__@types+react@1_62kakk5xmvj3pbxbhhsi3sqfpy/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
260
|
-
var React3 = __toESM(require_react(), 1);
|
|
261
|
-
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
262
|
-
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
263
|
-
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
264
|
-
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
265
|
-
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
266
|
-
var FocusScope = React3.forwardRef((props, forwardedRef) => {
|
|
267
|
-
const {
|
|
268
|
-
loop = false,
|
|
269
|
-
trapped = false,
|
|
270
|
-
onMountAutoFocus: onMountAutoFocusProp,
|
|
271
|
-
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
272
|
-
...scopeProps
|
|
273
|
-
} = props;
|
|
274
|
-
const [container, setContainer] = React3.useState(null);
|
|
275
|
-
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
276
|
-
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
277
|
-
const lastFocusedElementRef = React3.useRef(null);
|
|
278
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
279
|
-
const focusScope = React3.useRef({
|
|
280
|
-
paused: false,
|
|
281
|
-
pause() {
|
|
282
|
-
this.paused = true;
|
|
283
|
-
},
|
|
284
|
-
resume() {
|
|
285
|
-
this.paused = false;
|
|
286
|
-
}
|
|
287
|
-
}).current;
|
|
288
|
-
React3.useEffect(() => {
|
|
289
|
-
if (trapped) {
|
|
290
|
-
let handleFocusIn2 = function(event) {
|
|
291
|
-
if (focusScope.paused || !container) return;
|
|
292
|
-
const target = event.target;
|
|
293
|
-
if (container.contains(target)) {
|
|
294
|
-
lastFocusedElementRef.current = target;
|
|
295
|
-
} else {
|
|
296
|
-
focus(lastFocusedElementRef.current, { select: true });
|
|
297
|
-
}
|
|
298
|
-
}, handleFocusOut2 = function(event) {
|
|
299
|
-
if (focusScope.paused || !container) return;
|
|
300
|
-
const relatedTarget = event.relatedTarget;
|
|
301
|
-
if (relatedTarget === null) return;
|
|
302
|
-
if (!container.contains(relatedTarget)) {
|
|
303
|
-
focus(lastFocusedElementRef.current, { select: true });
|
|
304
|
-
}
|
|
305
|
-
}, handleMutations2 = function(mutations) {
|
|
306
|
-
const focusedElement = document.activeElement;
|
|
307
|
-
if (focusedElement !== document.body) return;
|
|
308
|
-
for (const mutation of mutations) {
|
|
309
|
-
if (mutation.removedNodes.length > 0) focus(container);
|
|
310
|
-
}
|
|
311
|
-
};
|
|
312
|
-
var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;
|
|
313
|
-
document.addEventListener("focusin", handleFocusIn2);
|
|
314
|
-
document.addEventListener("focusout", handleFocusOut2);
|
|
315
|
-
const mutationObserver = new MutationObserver(handleMutations2);
|
|
316
|
-
if (container) mutationObserver.observe(container, { childList: true, subtree: true });
|
|
317
|
-
return () => {
|
|
318
|
-
document.removeEventListener("focusin", handleFocusIn2);
|
|
319
|
-
document.removeEventListener("focusout", handleFocusOut2);
|
|
320
|
-
mutationObserver.disconnect();
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
}, [trapped, container, focusScope.paused]);
|
|
324
|
-
React3.useEffect(() => {
|
|
325
|
-
if (container) {
|
|
326
|
-
focusScopesStack.add(focusScope);
|
|
327
|
-
const previouslyFocusedElement = document.activeElement;
|
|
328
|
-
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
329
|
-
if (!hasFocusedCandidate) {
|
|
330
|
-
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
331
|
-
container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
332
|
-
container.dispatchEvent(mountEvent);
|
|
333
|
-
if (!mountEvent.defaultPrevented) {
|
|
334
|
-
focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
|
|
335
|
-
if (document.activeElement === previouslyFocusedElement) {
|
|
336
|
-
focus(container);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
return () => {
|
|
341
|
-
container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
342
|
-
setTimeout(() => {
|
|
343
|
-
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
344
|
-
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
345
|
-
container.dispatchEvent(unmountEvent);
|
|
346
|
-
if (!unmountEvent.defaultPrevented) {
|
|
347
|
-
focus(previouslyFocusedElement ?? document.body, { select: true });
|
|
348
|
-
}
|
|
349
|
-
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
350
|
-
focusScopesStack.remove(focusScope);
|
|
351
|
-
}, 0);
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
355
|
-
const handleKeyDown = React3.useCallback(
|
|
356
|
-
(event) => {
|
|
357
|
-
if (!loop && !trapped) return;
|
|
358
|
-
if (focusScope.paused) return;
|
|
359
|
-
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
360
|
-
const focusedElement = document.activeElement;
|
|
361
|
-
if (isTabKey && focusedElement) {
|
|
362
|
-
const container2 = event.currentTarget;
|
|
363
|
-
const [first, last] = getTabbableEdges(container2);
|
|
364
|
-
const hasTabbableElementsInside = first && last;
|
|
365
|
-
if (!hasTabbableElementsInside) {
|
|
366
|
-
if (focusedElement === container2) event.preventDefault();
|
|
367
|
-
} else {
|
|
368
|
-
if (!event.shiftKey && focusedElement === last) {
|
|
369
|
-
event.preventDefault();
|
|
370
|
-
if (loop) focus(first, { select: true });
|
|
371
|
-
} else if (event.shiftKey && focusedElement === first) {
|
|
372
|
-
event.preventDefault();
|
|
373
|
-
if (loop) focus(last, { select: true });
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
},
|
|
378
|
-
[loop, trapped, focusScope.paused]
|
|
379
|
-
);
|
|
380
|
-
return (0, import_jsx_runtime2.jsx)(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
381
|
-
});
|
|
382
|
-
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
383
|
-
function focusFirst(candidates, { select = false } = {}) {
|
|
384
|
-
const previouslyFocusedElement = document.activeElement;
|
|
385
|
-
for (const candidate of candidates) {
|
|
386
|
-
focus(candidate, { select });
|
|
387
|
-
if (document.activeElement !== previouslyFocusedElement) return;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
function getTabbableEdges(container) {
|
|
391
|
-
const candidates = getTabbableCandidates(container);
|
|
392
|
-
const first = findVisible(candidates, container);
|
|
393
|
-
const last = findVisible(candidates.reverse(), container);
|
|
394
|
-
return [first, last];
|
|
395
|
-
}
|
|
396
|
-
function getTabbableCandidates(container) {
|
|
397
|
-
const nodes = [];
|
|
398
|
-
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
399
|
-
acceptNode: (node) => {
|
|
400
|
-
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
401
|
-
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
402
|
-
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
|
-
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
406
|
-
return nodes;
|
|
407
|
-
}
|
|
408
|
-
function findVisible(elements, container) {
|
|
409
|
-
for (const element of elements) {
|
|
410
|
-
if (!isHidden(element, { upTo: container })) return element;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
function isHidden(node, { upTo }) {
|
|
414
|
-
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
415
|
-
while (node) {
|
|
416
|
-
if (upTo !== void 0 && node === upTo) return false;
|
|
417
|
-
if (getComputedStyle(node).display === "none") return true;
|
|
418
|
-
node = node.parentElement;
|
|
419
|
-
}
|
|
420
|
-
return false;
|
|
421
|
-
}
|
|
422
|
-
function isSelectableInput(element) {
|
|
423
|
-
return element instanceof HTMLInputElement && "select" in element;
|
|
424
|
-
}
|
|
425
|
-
function focus(element, { select = false } = {}) {
|
|
426
|
-
if (element && element.focus) {
|
|
427
|
-
const previouslyFocusedElement = document.activeElement;
|
|
428
|
-
element.focus({ preventScroll: true });
|
|
429
|
-
if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
|
|
430
|
-
element.select();
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
var focusScopesStack = createFocusScopesStack();
|
|
434
|
-
function createFocusScopesStack() {
|
|
435
|
-
let stack = [];
|
|
436
|
-
return {
|
|
437
|
-
add(focusScope) {
|
|
438
|
-
const activeFocusScope = stack[0];
|
|
439
|
-
if (focusScope !== activeFocusScope) {
|
|
440
|
-
activeFocusScope == null ? void 0 : activeFocusScope.pause();
|
|
441
|
-
}
|
|
442
|
-
stack = arrayRemove(stack, focusScope);
|
|
443
|
-
stack.unshift(focusScope);
|
|
444
|
-
},
|
|
445
|
-
remove(focusScope) {
|
|
446
|
-
var _a;
|
|
447
|
-
stack = arrayRemove(stack, focusScope);
|
|
448
|
-
(_a = stack[0]) == null ? void 0 : _a.resume();
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
function arrayRemove(array, item) {
|
|
453
|
-
const updatedArray = [...array];
|
|
454
|
-
const index = updatedArray.indexOf(item);
|
|
455
|
-
if (index !== -1) {
|
|
456
|
-
updatedArray.splice(index, 1);
|
|
457
|
-
}
|
|
458
|
-
return updatedArray;
|
|
459
|
-
}
|
|
460
|
-
function removeLinks(items) {
|
|
461
|
-
return items.filter((item) => item.tagName !== "A");
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
// ../../../../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.2.3_@types+react@19.2.6__@types+react@19.2.6_htr4zmxsforuzysc45z2whji4m/node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
465
|
-
var React4 = __toESM(require_react(), 1);
|
|
466
|
-
var import_react_dom = __toESM(require_react_dom(), 1);
|
|
467
|
-
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
468
|
-
var PORTAL_NAME = "Portal";
|
|
469
|
-
var Portal = React4.forwardRef((props, forwardedRef) => {
|
|
470
|
-
var _a;
|
|
471
|
-
const { container: containerProp, ...portalProps } = props;
|
|
472
|
-
const [mounted, setMounted] = React4.useState(false);
|
|
473
|
-
useLayoutEffect2(() => setMounted(true), []);
|
|
474
|
-
const container = containerProp || mounted && ((_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body);
|
|
475
|
-
return container ? import_react_dom.default.createPortal((0, import_jsx_runtime3.jsx)(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
476
|
-
});
|
|
477
|
-
Portal.displayName = PORTAL_NAME;
|
|
478
|
-
|
|
479
|
-
// ../../../../node_modules/.pnpm/@radix-ui+react-focus-guards@1.1.3_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
480
|
-
var React5 = __toESM(require_react(), 1);
|
|
481
|
-
var count = 0;
|
|
482
|
-
function useFocusGuards() {
|
|
483
|
-
React5.useEffect(() => {
|
|
484
|
-
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
485
|
-
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
486
|
-
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
487
|
-
count++;
|
|
488
|
-
return () => {
|
|
489
|
-
if (count === 1) {
|
|
490
|
-
document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
|
|
491
|
-
}
|
|
492
|
-
count--;
|
|
493
|
-
};
|
|
494
|
-
}, []);
|
|
495
|
-
}
|
|
496
|
-
function createFocusGuard() {
|
|
497
|
-
const element = document.createElement("span");
|
|
498
|
-
element.setAttribute("data-radix-focus-guard", "");
|
|
499
|
-
element.tabIndex = 0;
|
|
500
|
-
element.style.outline = "none";
|
|
501
|
-
element.style.opacity = "0";
|
|
502
|
-
element.style.position = "fixed";
|
|
503
|
-
element.style.pointerEvents = "none";
|
|
504
|
-
return element;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
// ../../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
|
|
508
|
-
var __assign = function() {
|
|
509
|
-
__assign = Object.assign || function __assign2(t) {
|
|
510
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
511
|
-
s = arguments[i];
|
|
512
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
513
|
-
}
|
|
514
|
-
return t;
|
|
515
|
-
};
|
|
516
|
-
return __assign.apply(this, arguments);
|
|
517
|
-
};
|
|
518
|
-
function __rest(s, e) {
|
|
519
|
-
var t = {};
|
|
520
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
521
|
-
t[p] = s[p];
|
|
522
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
523
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
524
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
525
|
-
t[p[i]] = s[p[i]];
|
|
526
|
-
}
|
|
527
|
-
return t;
|
|
528
|
-
}
|
|
529
|
-
function __spreadArray(to, from, pack) {
|
|
530
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
531
|
-
if (ar || !(i in from)) {
|
|
532
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
533
|
-
ar[i] = from[i];
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
// ../../../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
540
|
-
var React14 = __toESM(require_react());
|
|
541
|
-
|
|
542
|
-
// ../../../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
543
|
-
var React10 = __toESM(require_react());
|
|
544
|
-
|
|
545
|
-
// ../../../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js
|
|
546
|
-
var zeroRightClassName = "right-scroll-bar-position";
|
|
547
|
-
var fullWidthClassName = "width-before-scroll-bar";
|
|
548
|
-
var noScrollbarsClassName = "with-scroll-bars-hidden";
|
|
549
|
-
var removedBarSizeVariable = "--removed-body-scroll-bar-size";
|
|
550
|
-
|
|
551
|
-
// ../../../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es2015/assignRef.js
|
|
552
|
-
function assignRef(ref, value) {
|
|
553
|
-
if (typeof ref === "function") {
|
|
554
|
-
ref(value);
|
|
555
|
-
} else if (ref) {
|
|
556
|
-
ref.current = value;
|
|
557
|
-
}
|
|
558
|
-
return ref;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
// ../../../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es2015/useRef.js
|
|
562
|
-
var import_react = __toESM(require_react());
|
|
563
|
-
function useCallbackRef2(initialValue, callback) {
|
|
564
|
-
var ref = (0, import_react.useState)(function() {
|
|
565
|
-
return {
|
|
566
|
-
// value
|
|
567
|
-
value: initialValue,
|
|
568
|
-
// last callback
|
|
569
|
-
callback,
|
|
570
|
-
// "memoized" public interface
|
|
571
|
-
facade: {
|
|
572
|
-
get current() {
|
|
573
|
-
return ref.value;
|
|
574
|
-
},
|
|
575
|
-
set current(value) {
|
|
576
|
-
var last = ref.value;
|
|
577
|
-
if (last !== value) {
|
|
578
|
-
ref.value = value;
|
|
579
|
-
ref.callback(value, last);
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
};
|
|
584
|
-
})[0];
|
|
585
|
-
ref.callback = callback;
|
|
586
|
-
return ref.facade;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
// ../../../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js
|
|
590
|
-
var React6 = __toESM(require_react());
|
|
591
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React6.useLayoutEffect : React6.useEffect;
|
|
592
|
-
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
593
|
-
function useMergeRefs(refs, defaultValue) {
|
|
594
|
-
var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
|
|
595
|
-
return refs.forEach(function(ref) {
|
|
596
|
-
return assignRef(ref, newValue);
|
|
597
|
-
});
|
|
598
|
-
});
|
|
599
|
-
useIsomorphicLayoutEffect(function() {
|
|
600
|
-
var oldValue = currentValues.get(callbackRef);
|
|
601
|
-
if (oldValue) {
|
|
602
|
-
var prevRefs_1 = new Set(oldValue);
|
|
603
|
-
var nextRefs_1 = new Set(refs);
|
|
604
|
-
var current_1 = callbackRef.current;
|
|
605
|
-
prevRefs_1.forEach(function(ref) {
|
|
606
|
-
if (!nextRefs_1.has(ref)) {
|
|
607
|
-
assignRef(ref, null);
|
|
608
|
-
}
|
|
609
|
-
});
|
|
610
|
-
nextRefs_1.forEach(function(ref) {
|
|
611
|
-
if (!prevRefs_1.has(ref)) {
|
|
612
|
-
assignRef(ref, current_1);
|
|
613
|
-
}
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
currentValues.set(callbackRef, refs);
|
|
617
|
-
}, [refs]);
|
|
618
|
-
return callbackRef;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
// ../../../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es2015/hoc.js
|
|
622
|
-
var React7 = __toESM(require_react());
|
|
623
|
-
|
|
624
|
-
// ../../../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es2015/hook.js
|
|
625
|
-
var import_react2 = __toESM(require_react());
|
|
626
|
-
|
|
627
|
-
// ../../../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es2015/medium.js
|
|
628
|
-
function ItoI(a) {
|
|
629
|
-
return a;
|
|
630
|
-
}
|
|
631
|
-
function innerCreateMedium(defaults, middleware) {
|
|
632
|
-
if (middleware === void 0) {
|
|
633
|
-
middleware = ItoI;
|
|
634
|
-
}
|
|
635
|
-
var buffer = [];
|
|
636
|
-
var assigned = false;
|
|
637
|
-
var medium = {
|
|
638
|
-
read: function() {
|
|
639
|
-
if (assigned) {
|
|
640
|
-
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
641
|
-
}
|
|
642
|
-
if (buffer.length) {
|
|
643
|
-
return buffer[buffer.length - 1];
|
|
644
|
-
}
|
|
645
|
-
return defaults;
|
|
646
|
-
},
|
|
647
|
-
useMedium: function(data) {
|
|
648
|
-
var item = middleware(data, assigned);
|
|
649
|
-
buffer.push(item);
|
|
650
|
-
return function() {
|
|
651
|
-
buffer = buffer.filter(function(x) {
|
|
652
|
-
return x !== item;
|
|
653
|
-
});
|
|
654
|
-
};
|
|
655
|
-
},
|
|
656
|
-
assignSyncMedium: function(cb) {
|
|
657
|
-
assigned = true;
|
|
658
|
-
while (buffer.length) {
|
|
659
|
-
var cbs = buffer;
|
|
660
|
-
buffer = [];
|
|
661
|
-
cbs.forEach(cb);
|
|
662
|
-
}
|
|
663
|
-
buffer = {
|
|
664
|
-
push: function(x) {
|
|
665
|
-
return cb(x);
|
|
666
|
-
},
|
|
667
|
-
filter: function() {
|
|
668
|
-
return buffer;
|
|
669
|
-
}
|
|
670
|
-
};
|
|
671
|
-
},
|
|
672
|
-
assignMedium: function(cb) {
|
|
673
|
-
assigned = true;
|
|
674
|
-
var pendingQueue = [];
|
|
675
|
-
if (buffer.length) {
|
|
676
|
-
var cbs = buffer;
|
|
677
|
-
buffer = [];
|
|
678
|
-
cbs.forEach(cb);
|
|
679
|
-
pendingQueue = buffer;
|
|
680
|
-
}
|
|
681
|
-
var executeQueue = function() {
|
|
682
|
-
var cbs2 = pendingQueue;
|
|
683
|
-
pendingQueue = [];
|
|
684
|
-
cbs2.forEach(cb);
|
|
685
|
-
};
|
|
686
|
-
var cycle = function() {
|
|
687
|
-
return Promise.resolve().then(executeQueue);
|
|
688
|
-
};
|
|
689
|
-
cycle();
|
|
690
|
-
buffer = {
|
|
691
|
-
push: function(x) {
|
|
692
|
-
pendingQueue.push(x);
|
|
693
|
-
cycle();
|
|
694
|
-
},
|
|
695
|
-
filter: function(filter) {
|
|
696
|
-
pendingQueue = pendingQueue.filter(filter);
|
|
697
|
-
return buffer;
|
|
698
|
-
}
|
|
699
|
-
};
|
|
700
|
-
}
|
|
701
|
-
};
|
|
702
|
-
return medium;
|
|
703
|
-
}
|
|
704
|
-
function createSidecarMedium(options) {
|
|
705
|
-
if (options === void 0) {
|
|
706
|
-
options = {};
|
|
707
|
-
}
|
|
708
|
-
var medium = innerCreateMedium(null);
|
|
709
|
-
medium.options = __assign({ async: true, ssr: false }, options);
|
|
710
|
-
return medium;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
// ../../../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es2015/renderProp.js
|
|
714
|
-
var React8 = __toESM(require_react());
|
|
715
|
-
var import_react3 = __toESM(require_react());
|
|
716
|
-
|
|
717
|
-
// ../../../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es2015/exports.js
|
|
718
|
-
var React9 = __toESM(require_react());
|
|
719
|
-
var SideCar = function(_a) {
|
|
720
|
-
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
721
|
-
if (!sideCar) {
|
|
722
|
-
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
723
|
-
}
|
|
724
|
-
var Target = sideCar.read();
|
|
725
|
-
if (!Target) {
|
|
726
|
-
throw new Error("Sidecar medium not found");
|
|
727
|
-
}
|
|
728
|
-
return React9.createElement(Target, __assign({}, rest));
|
|
729
|
-
};
|
|
730
|
-
SideCar.isSideCarExport = true;
|
|
731
|
-
function exportSidecar(medium, exported) {
|
|
732
|
-
medium.useMedium(exported);
|
|
733
|
-
return SideCar;
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
// ../../../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/medium.js
|
|
737
|
-
var effectCar = createSidecarMedium();
|
|
738
|
-
|
|
739
|
-
// ../../../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
740
|
-
var nothing = function() {
|
|
741
|
-
return;
|
|
742
|
-
};
|
|
743
|
-
var RemoveScroll = React10.forwardRef(function(props, parentRef) {
|
|
744
|
-
var ref = React10.useRef(null);
|
|
745
|
-
var _a = React10.useState({
|
|
746
|
-
onScrollCapture: nothing,
|
|
747
|
-
onWheelCapture: nothing,
|
|
748
|
-
onTouchMoveCapture: nothing
|
|
749
|
-
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
750
|
-
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
|
|
751
|
-
var SideCar2 = sideCar;
|
|
752
|
-
var containerRef = useMergeRefs([ref, parentRef]);
|
|
753
|
-
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
754
|
-
return React10.createElement(
|
|
755
|
-
React10.Fragment,
|
|
756
|
-
null,
|
|
757
|
-
enabled && React10.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
758
|
-
forwardProps ? React10.cloneElement(React10.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React10.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
759
|
-
);
|
|
760
|
-
});
|
|
761
|
-
RemoveScroll.defaultProps = {
|
|
762
|
-
enabled: true,
|
|
763
|
-
removeScrollBar: true,
|
|
764
|
-
inert: false
|
|
765
|
-
};
|
|
766
|
-
RemoveScroll.classNames = {
|
|
767
|
-
fullWidth: fullWidthClassName,
|
|
768
|
-
zeroRight: zeroRightClassName
|
|
769
|
-
};
|
|
770
|
-
|
|
771
|
-
// ../../../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
772
|
-
var React13 = __toESM(require_react());
|
|
773
|
-
|
|
774
|
-
// ../../../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
|
|
775
|
-
var React12 = __toESM(require_react());
|
|
776
|
-
|
|
777
|
-
// ../../../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es2015/hook.js
|
|
778
|
-
var React11 = __toESM(require_react());
|
|
779
|
-
|
|
780
|
-
// ../../../../node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js
|
|
781
|
-
var currentNonce;
|
|
782
|
-
var getNonce = function() {
|
|
783
|
-
if (currentNonce) {
|
|
784
|
-
return currentNonce;
|
|
785
|
-
}
|
|
786
|
-
if (typeof __webpack_nonce__ !== "undefined") {
|
|
787
|
-
return __webpack_nonce__;
|
|
788
|
-
}
|
|
789
|
-
return void 0;
|
|
790
|
-
};
|
|
791
|
-
|
|
792
|
-
// ../../../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es2015/singleton.js
|
|
793
|
-
function makeStyleTag() {
|
|
794
|
-
if (!document)
|
|
795
|
-
return null;
|
|
796
|
-
var tag = document.createElement("style");
|
|
797
|
-
tag.type = "text/css";
|
|
798
|
-
var nonce = getNonce();
|
|
799
|
-
if (nonce) {
|
|
800
|
-
tag.setAttribute("nonce", nonce);
|
|
801
|
-
}
|
|
802
|
-
return tag;
|
|
803
|
-
}
|
|
804
|
-
function injectStyles(tag, css) {
|
|
805
|
-
if (tag.styleSheet) {
|
|
806
|
-
tag.styleSheet.cssText = css;
|
|
807
|
-
} else {
|
|
808
|
-
tag.appendChild(document.createTextNode(css));
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
function insertStyleTag(tag) {
|
|
812
|
-
var head = document.head || document.getElementsByTagName("head")[0];
|
|
813
|
-
head.appendChild(tag);
|
|
814
|
-
}
|
|
815
|
-
var stylesheetSingleton = function() {
|
|
816
|
-
var counter = 0;
|
|
817
|
-
var stylesheet = null;
|
|
818
|
-
return {
|
|
819
|
-
add: function(style) {
|
|
820
|
-
if (counter == 0) {
|
|
821
|
-
if (stylesheet = makeStyleTag()) {
|
|
822
|
-
injectStyles(stylesheet, style);
|
|
823
|
-
insertStyleTag(stylesheet);
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
counter++;
|
|
827
|
-
},
|
|
828
|
-
remove: function() {
|
|
829
|
-
counter--;
|
|
830
|
-
if (!counter && stylesheet) {
|
|
831
|
-
stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
|
|
832
|
-
stylesheet = null;
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
};
|
|
836
|
-
};
|
|
837
|
-
|
|
838
|
-
// ../../../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es2015/hook.js
|
|
839
|
-
var styleHookSingleton = function() {
|
|
840
|
-
var sheet = stylesheetSingleton();
|
|
841
|
-
return function(styles, isDynamic) {
|
|
842
|
-
React11.useEffect(function() {
|
|
843
|
-
sheet.add(styles);
|
|
844
|
-
return function() {
|
|
845
|
-
sheet.remove();
|
|
846
|
-
};
|
|
847
|
-
}, [styles && isDynamic]);
|
|
848
|
-
};
|
|
849
|
-
};
|
|
850
|
-
|
|
851
|
-
// ../../../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es2015/component.js
|
|
852
|
-
var styleSingleton = function() {
|
|
853
|
-
var useStyle = styleHookSingleton();
|
|
854
|
-
var Sheet = function(_a) {
|
|
855
|
-
var styles = _a.styles, dynamic = _a.dynamic;
|
|
856
|
-
useStyle(styles, dynamic);
|
|
857
|
-
return null;
|
|
858
|
-
};
|
|
859
|
-
return Sheet;
|
|
860
|
-
};
|
|
861
|
-
|
|
862
|
-
// ../../../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.js
|
|
863
|
-
var zeroGap = {
|
|
864
|
-
left: 0,
|
|
865
|
-
top: 0,
|
|
866
|
-
right: 0,
|
|
867
|
-
gap: 0
|
|
868
|
-
};
|
|
869
|
-
var parse = function(x) {
|
|
870
|
-
return parseInt(x || "", 10) || 0;
|
|
871
|
-
};
|
|
872
|
-
var getOffset = function(gapMode) {
|
|
873
|
-
var cs = window.getComputedStyle(document.body);
|
|
874
|
-
var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
|
|
875
|
-
var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
|
|
876
|
-
var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
|
|
877
|
-
return [parse(left), parse(top), parse(right)];
|
|
878
|
-
};
|
|
879
|
-
var getGapWidth = function(gapMode) {
|
|
880
|
-
if (gapMode === void 0) {
|
|
881
|
-
gapMode = "margin";
|
|
882
|
-
}
|
|
883
|
-
if (typeof window === "undefined") {
|
|
884
|
-
return zeroGap;
|
|
885
|
-
}
|
|
886
|
-
var offsets = getOffset(gapMode);
|
|
887
|
-
var documentWidth = document.documentElement.clientWidth;
|
|
888
|
-
var windowWidth = window.innerWidth;
|
|
889
|
-
return {
|
|
890
|
-
left: offsets[0],
|
|
891
|
-
top: offsets[1],
|
|
892
|
-
right: offsets[2],
|
|
893
|
-
gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
|
|
894
|
-
};
|
|
895
|
-
};
|
|
896
|
-
|
|
897
|
-
// ../../../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
|
|
898
|
-
var Style = styleSingleton();
|
|
899
|
-
var lockAttribute = "data-scroll-locked";
|
|
900
|
-
var getStyles = function(_a, allowRelative, gapMode, important) {
|
|
901
|
-
var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
|
|
902
|
-
if (gapMode === void 0) {
|
|
903
|
-
gapMode = "margin";
|
|
904
|
-
}
|
|
905
|
-
return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
|
|
906
|
-
allowRelative && "position: relative ".concat(important, ";"),
|
|
907
|
-
gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
|
|
908
|
-
gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
|
|
909
|
-
].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
|
|
910
|
-
};
|
|
911
|
-
var getCurrentUseCounter = function() {
|
|
912
|
-
var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
|
|
913
|
-
return isFinite(counter) ? counter : 0;
|
|
914
|
-
};
|
|
915
|
-
var useLockAttribute = function() {
|
|
916
|
-
React12.useEffect(function() {
|
|
917
|
-
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
918
|
-
return function() {
|
|
919
|
-
var newCounter = getCurrentUseCounter() - 1;
|
|
920
|
-
if (newCounter <= 0) {
|
|
921
|
-
document.body.removeAttribute(lockAttribute);
|
|
922
|
-
} else {
|
|
923
|
-
document.body.setAttribute(lockAttribute, newCounter.toString());
|
|
924
|
-
}
|
|
925
|
-
};
|
|
926
|
-
}, []);
|
|
927
|
-
};
|
|
928
|
-
var RemoveScrollBar = function(_a) {
|
|
929
|
-
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
930
|
-
useLockAttribute();
|
|
931
|
-
var gap = React12.useMemo(function() {
|
|
932
|
-
return getGapWidth(gapMode);
|
|
933
|
-
}, [gapMode]);
|
|
934
|
-
return React12.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
935
|
-
};
|
|
936
|
-
|
|
937
|
-
// ../../../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
|
|
938
|
-
var passiveSupported = false;
|
|
939
|
-
if (typeof window !== "undefined") {
|
|
940
|
-
try {
|
|
941
|
-
options = Object.defineProperty({}, "passive", {
|
|
942
|
-
get: function() {
|
|
943
|
-
passiveSupported = true;
|
|
944
|
-
return true;
|
|
945
|
-
}
|
|
946
|
-
});
|
|
947
|
-
window.addEventListener("test", options, options);
|
|
948
|
-
window.removeEventListener("test", options, options);
|
|
949
|
-
} catch (err) {
|
|
950
|
-
passiveSupported = false;
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
var options;
|
|
954
|
-
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
955
|
-
|
|
956
|
-
// ../../../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.js
|
|
957
|
-
var alwaysContainsScroll = function(node) {
|
|
958
|
-
return node.tagName === "TEXTAREA";
|
|
959
|
-
};
|
|
960
|
-
var elementCanBeScrolled = function(node, overflow) {
|
|
961
|
-
if (!(node instanceof Element)) {
|
|
962
|
-
return false;
|
|
963
|
-
}
|
|
964
|
-
var styles = window.getComputedStyle(node);
|
|
965
|
-
return (
|
|
966
|
-
// not-not-scrollable
|
|
967
|
-
styles[overflow] !== "hidden" && // contains scroll inside self
|
|
968
|
-
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
|
|
969
|
-
);
|
|
970
|
-
};
|
|
971
|
-
var elementCouldBeVScrolled = function(node) {
|
|
972
|
-
return elementCanBeScrolled(node, "overflowY");
|
|
973
|
-
};
|
|
974
|
-
var elementCouldBeHScrolled = function(node) {
|
|
975
|
-
return elementCanBeScrolled(node, "overflowX");
|
|
976
|
-
};
|
|
977
|
-
var locationCouldBeScrolled = function(axis, node) {
|
|
978
|
-
var ownerDocument = node.ownerDocument;
|
|
979
|
-
var current = node;
|
|
980
|
-
do {
|
|
981
|
-
if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) {
|
|
982
|
-
current = current.host;
|
|
983
|
-
}
|
|
984
|
-
var isScrollable = elementCouldBeScrolled(axis, current);
|
|
985
|
-
if (isScrollable) {
|
|
986
|
-
var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
|
|
987
|
-
if (scrollHeight > clientHeight) {
|
|
988
|
-
return true;
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
current = current.parentNode;
|
|
992
|
-
} while (current && current !== ownerDocument.body);
|
|
993
|
-
return false;
|
|
994
|
-
};
|
|
995
|
-
var getVScrollVariables = function(_a) {
|
|
996
|
-
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
997
|
-
return [
|
|
998
|
-
scrollTop,
|
|
999
|
-
scrollHeight,
|
|
1000
|
-
clientHeight
|
|
1001
|
-
];
|
|
1002
|
-
};
|
|
1003
|
-
var getHScrollVariables = function(_a) {
|
|
1004
|
-
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
|
|
1005
|
-
return [
|
|
1006
|
-
scrollLeft,
|
|
1007
|
-
scrollWidth,
|
|
1008
|
-
clientWidth
|
|
1009
|
-
];
|
|
1010
|
-
};
|
|
1011
|
-
var elementCouldBeScrolled = function(axis, node) {
|
|
1012
|
-
return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
1013
|
-
};
|
|
1014
|
-
var getScrollVariables = function(axis, node) {
|
|
1015
|
-
return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
1016
|
-
};
|
|
1017
|
-
var getDirectionFactor = function(axis, direction) {
|
|
1018
|
-
return axis === "h" && direction === "rtl" ? -1 : 1;
|
|
1019
|
-
};
|
|
1020
|
-
var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
1021
|
-
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
1022
|
-
var delta = directionFactor * sourceDelta;
|
|
1023
|
-
var target = event.target;
|
|
1024
|
-
var targetInLock = endTarget.contains(target);
|
|
1025
|
-
var shouldCancelScroll = false;
|
|
1026
|
-
var isDeltaPositive = delta > 0;
|
|
1027
|
-
var availableScroll = 0;
|
|
1028
|
-
var availableScrollTop = 0;
|
|
1029
|
-
do {
|
|
1030
|
-
if (!target) {
|
|
1031
|
-
break;
|
|
1032
|
-
}
|
|
1033
|
-
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
|
|
1034
|
-
var elementScroll = scroll_1 - capacity - directionFactor * position;
|
|
1035
|
-
if (position || elementScroll) {
|
|
1036
|
-
if (elementCouldBeScrolled(axis, target)) {
|
|
1037
|
-
availableScroll += elementScroll;
|
|
1038
|
-
availableScrollTop += position;
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
var parent_1 = target.parentNode;
|
|
1042
|
-
target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
|
|
1043
|
-
} while (
|
|
1044
|
-
// portaled content
|
|
1045
|
-
!targetInLock && target !== document.body || // self content
|
|
1046
|
-
targetInLock && (endTarget.contains(target) || endTarget === target)
|
|
1047
|
-
);
|
|
1048
|
-
if (isDeltaPositive && (noOverscroll && Math.abs(availableScroll) < 1 || !noOverscroll && delta > availableScroll)) {
|
|
1049
|
-
shouldCancelScroll = true;
|
|
1050
|
-
} else if (!isDeltaPositive && (noOverscroll && Math.abs(availableScrollTop) < 1 || !noOverscroll && -delta > availableScrollTop)) {
|
|
1051
|
-
shouldCancelScroll = true;
|
|
1052
|
-
}
|
|
1053
|
-
return shouldCancelScroll;
|
|
1054
|
-
};
|
|
1055
|
-
|
|
1056
|
-
// ../../../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
1057
|
-
var getTouchXY = function(event) {
|
|
1058
|
-
return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
|
|
1059
|
-
};
|
|
1060
|
-
var getDeltaXY = function(event) {
|
|
1061
|
-
return [event.deltaX, event.deltaY];
|
|
1062
|
-
};
|
|
1063
|
-
var extractRef = function(ref) {
|
|
1064
|
-
return ref && "current" in ref ? ref.current : ref;
|
|
1065
|
-
};
|
|
1066
|
-
var deltaCompare = function(x, y) {
|
|
1067
|
-
return x[0] === y[0] && x[1] === y[1];
|
|
1068
|
-
};
|
|
1069
|
-
var generateStyle = function(id) {
|
|
1070
|
-
return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
|
|
1071
|
-
};
|
|
1072
|
-
var idCounter = 0;
|
|
1073
|
-
var lockStack = [];
|
|
1074
|
-
function RemoveScrollSideCar(props) {
|
|
1075
|
-
var shouldPreventQueue = React13.useRef([]);
|
|
1076
|
-
var touchStartRef = React13.useRef([0, 0]);
|
|
1077
|
-
var activeAxis = React13.useRef();
|
|
1078
|
-
var id = React13.useState(idCounter++)[0];
|
|
1079
|
-
var Style2 = React13.useState(styleSingleton)[0];
|
|
1080
|
-
var lastProps = React13.useRef(props);
|
|
1081
|
-
React13.useEffect(function() {
|
|
1082
|
-
lastProps.current = props;
|
|
1083
|
-
}, [props]);
|
|
1084
|
-
React13.useEffect(function() {
|
|
1085
|
-
if (props.inert) {
|
|
1086
|
-
document.body.classList.add("block-interactivity-".concat(id));
|
|
1087
|
-
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
1088
|
-
allow_1.forEach(function(el) {
|
|
1089
|
-
return el.classList.add("allow-interactivity-".concat(id));
|
|
1090
|
-
});
|
|
1091
|
-
return function() {
|
|
1092
|
-
document.body.classList.remove("block-interactivity-".concat(id));
|
|
1093
|
-
allow_1.forEach(function(el) {
|
|
1094
|
-
return el.classList.remove("allow-interactivity-".concat(id));
|
|
1095
|
-
});
|
|
1096
|
-
};
|
|
1097
|
-
}
|
|
1098
|
-
return;
|
|
1099
|
-
}, [props.inert, props.lockRef.current, props.shards]);
|
|
1100
|
-
var shouldCancelEvent = React13.useCallback(function(event, parent) {
|
|
1101
|
-
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
1102
|
-
return !lastProps.current.allowPinchZoom;
|
|
1103
|
-
}
|
|
1104
|
-
var touch = getTouchXY(event);
|
|
1105
|
-
var touchStart = touchStartRef.current;
|
|
1106
|
-
var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
|
|
1107
|
-
var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
|
|
1108
|
-
var currentAxis;
|
|
1109
|
-
var target = event.target;
|
|
1110
|
-
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
|
|
1111
|
-
if ("touches" in event && moveDirection === "h" && target.type === "range") {
|
|
1112
|
-
return false;
|
|
1113
|
-
}
|
|
1114
|
-
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
1115
|
-
if (!canBeScrolledInMainDirection) {
|
|
1116
|
-
return true;
|
|
1117
|
-
}
|
|
1118
|
-
if (canBeScrolledInMainDirection) {
|
|
1119
|
-
currentAxis = moveDirection;
|
|
1120
|
-
} else {
|
|
1121
|
-
currentAxis = moveDirection === "v" ? "h" : "v";
|
|
1122
|
-
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
1123
|
-
}
|
|
1124
|
-
if (!canBeScrolledInMainDirection) {
|
|
1125
|
-
return false;
|
|
1126
|
-
}
|
|
1127
|
-
if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) {
|
|
1128
|
-
activeAxis.current = currentAxis;
|
|
1129
|
-
}
|
|
1130
|
-
if (!currentAxis) {
|
|
1131
|
-
return true;
|
|
1132
|
-
}
|
|
1133
|
-
var cancelingAxis = activeAxis.current || currentAxis;
|
|
1134
|
-
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
1135
|
-
}, []);
|
|
1136
|
-
var shouldPrevent = React13.useCallback(function(_event) {
|
|
1137
|
-
var event = _event;
|
|
1138
|
-
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
1139
|
-
return;
|
|
1140
|
-
}
|
|
1141
|
-
var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
|
|
1142
|
-
var sourceEvent = shouldPreventQueue.current.filter(function(e) {
|
|
1143
|
-
return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
|
|
1144
|
-
})[0];
|
|
1145
|
-
if (sourceEvent && sourceEvent.should) {
|
|
1146
|
-
if (event.cancelable) {
|
|
1147
|
-
event.preventDefault();
|
|
1148
|
-
}
|
|
1149
|
-
return;
|
|
1150
|
-
}
|
|
1151
|
-
if (!sourceEvent) {
|
|
1152
|
-
var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
|
|
1153
|
-
return node.contains(event.target);
|
|
1154
|
-
});
|
|
1155
|
-
var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
|
|
1156
|
-
if (shouldStop) {
|
|
1157
|
-
if (event.cancelable) {
|
|
1158
|
-
event.preventDefault();
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
}
|
|
1162
|
-
}, []);
|
|
1163
|
-
var shouldCancel = React13.useCallback(function(name, delta, target, should) {
|
|
1164
|
-
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
1165
|
-
shouldPreventQueue.current.push(event);
|
|
1166
|
-
setTimeout(function() {
|
|
1167
|
-
shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
|
|
1168
|
-
return e !== event;
|
|
1169
|
-
});
|
|
1170
|
-
}, 1);
|
|
1171
|
-
}, []);
|
|
1172
|
-
var scrollTouchStart = React13.useCallback(function(event) {
|
|
1173
|
-
touchStartRef.current = getTouchXY(event);
|
|
1174
|
-
activeAxis.current = void 0;
|
|
1175
|
-
}, []);
|
|
1176
|
-
var scrollWheel = React13.useCallback(function(event) {
|
|
1177
|
-
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
1178
|
-
}, []);
|
|
1179
|
-
var scrollTouchMove = React13.useCallback(function(event) {
|
|
1180
|
-
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
1181
|
-
}, []);
|
|
1182
|
-
React13.useEffect(function() {
|
|
1183
|
-
lockStack.push(Style2);
|
|
1184
|
-
props.setCallbacks({
|
|
1185
|
-
onScrollCapture: scrollWheel,
|
|
1186
|
-
onWheelCapture: scrollWheel,
|
|
1187
|
-
onTouchMoveCapture: scrollTouchMove
|
|
1188
|
-
});
|
|
1189
|
-
document.addEventListener("wheel", shouldPrevent, nonPassive);
|
|
1190
|
-
document.addEventListener("touchmove", shouldPrevent, nonPassive);
|
|
1191
|
-
document.addEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
1192
|
-
return function() {
|
|
1193
|
-
lockStack = lockStack.filter(function(inst) {
|
|
1194
|
-
return inst !== Style2;
|
|
1195
|
-
});
|
|
1196
|
-
document.removeEventListener("wheel", shouldPrevent, nonPassive);
|
|
1197
|
-
document.removeEventListener("touchmove", shouldPrevent, nonPassive);
|
|
1198
|
-
document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
1199
|
-
};
|
|
1200
|
-
}, []);
|
|
1201
|
-
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
1202
|
-
return React13.createElement(
|
|
1203
|
-
React13.Fragment,
|
|
1204
|
-
null,
|
|
1205
|
-
inert ? React13.createElement(Style2, { styles: generateStyle(id) }) : null,
|
|
1206
|
-
removeScrollBar ? React13.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
1207
|
-
);
|
|
1208
|
-
}
|
|
1209
|
-
function getOutermostShadowParent(node) {
|
|
1210
|
-
var shadowParent = null;
|
|
1211
|
-
while (node !== null) {
|
|
1212
|
-
if (node instanceof ShadowRoot) {
|
|
1213
|
-
shadowParent = node.host;
|
|
1214
|
-
node = node.host;
|
|
1215
|
-
}
|
|
1216
|
-
node = node.parentNode;
|
|
1217
|
-
}
|
|
1218
|
-
return shadowParent;
|
|
1219
|
-
}
|
|
1220
|
-
|
|
1221
|
-
// ../../../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/sidecar.js
|
|
1222
|
-
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
1223
|
-
|
|
1224
|
-
// ../../../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
1225
|
-
var ReactRemoveScroll = React14.forwardRef(function(props, ref) {
|
|
1226
|
-
return React14.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
1227
|
-
});
|
|
1228
|
-
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
1229
|
-
var Combination_default = ReactRemoveScroll;
|
|
1230
|
-
|
|
1231
|
-
// ../../../../node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js
|
|
1232
|
-
var getDefaultParent = function(originalTarget) {
|
|
1233
|
-
if (typeof document === "undefined") {
|
|
1234
|
-
return null;
|
|
1235
|
-
}
|
|
1236
|
-
var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
|
|
1237
|
-
return sampleTarget.ownerDocument.body;
|
|
1238
|
-
};
|
|
1239
|
-
var counterMap = /* @__PURE__ */ new WeakMap();
|
|
1240
|
-
var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
1241
|
-
var markerMap = {};
|
|
1242
|
-
var lockCount = 0;
|
|
1243
|
-
var unwrapHost = function(node) {
|
|
1244
|
-
return node && (node.host || unwrapHost(node.parentNode));
|
|
1245
|
-
};
|
|
1246
|
-
var correctTargets = function(parent, targets) {
|
|
1247
|
-
return targets.map(function(target) {
|
|
1248
|
-
if (parent.contains(target)) {
|
|
1249
|
-
return target;
|
|
1250
|
-
}
|
|
1251
|
-
var correctedTarget = unwrapHost(target);
|
|
1252
|
-
if (correctedTarget && parent.contains(correctedTarget)) {
|
|
1253
|
-
return correctedTarget;
|
|
1254
|
-
}
|
|
1255
|
-
console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
|
|
1256
|
-
return null;
|
|
1257
|
-
}).filter(function(x) {
|
|
1258
|
-
return Boolean(x);
|
|
1259
|
-
});
|
|
1260
|
-
};
|
|
1261
|
-
var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
|
|
1262
|
-
var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
1263
|
-
if (!markerMap[markerName]) {
|
|
1264
|
-
markerMap[markerName] = /* @__PURE__ */ new WeakMap();
|
|
1265
|
-
}
|
|
1266
|
-
var markerCounter = markerMap[markerName];
|
|
1267
|
-
var hiddenNodes = [];
|
|
1268
|
-
var elementsToKeep = /* @__PURE__ */ new Set();
|
|
1269
|
-
var elementsToStop = new Set(targets);
|
|
1270
|
-
var keep = function(el) {
|
|
1271
|
-
if (!el || elementsToKeep.has(el)) {
|
|
1272
|
-
return;
|
|
1273
|
-
}
|
|
1274
|
-
elementsToKeep.add(el);
|
|
1275
|
-
keep(el.parentNode);
|
|
1276
|
-
};
|
|
1277
|
-
targets.forEach(keep);
|
|
1278
|
-
var deep = function(parent) {
|
|
1279
|
-
if (!parent || elementsToStop.has(parent)) {
|
|
1280
|
-
return;
|
|
1281
|
-
}
|
|
1282
|
-
Array.prototype.forEach.call(parent.children, function(node) {
|
|
1283
|
-
if (elementsToKeep.has(node)) {
|
|
1284
|
-
deep(node);
|
|
1285
|
-
} else {
|
|
1286
|
-
try {
|
|
1287
|
-
var attr = node.getAttribute(controlAttribute);
|
|
1288
|
-
var alreadyHidden = attr !== null && attr !== "false";
|
|
1289
|
-
var counterValue = (counterMap.get(node) || 0) + 1;
|
|
1290
|
-
var markerValue = (markerCounter.get(node) || 0) + 1;
|
|
1291
|
-
counterMap.set(node, counterValue);
|
|
1292
|
-
markerCounter.set(node, markerValue);
|
|
1293
|
-
hiddenNodes.push(node);
|
|
1294
|
-
if (counterValue === 1 && alreadyHidden) {
|
|
1295
|
-
uncontrolledNodes.set(node, true);
|
|
1296
|
-
}
|
|
1297
|
-
if (markerValue === 1) {
|
|
1298
|
-
node.setAttribute(markerName, "true");
|
|
1299
|
-
}
|
|
1300
|
-
if (!alreadyHidden) {
|
|
1301
|
-
node.setAttribute(controlAttribute, "true");
|
|
1302
|
-
}
|
|
1303
|
-
} catch (e) {
|
|
1304
|
-
console.error("aria-hidden: cannot operate on ", node, e);
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
});
|
|
1308
|
-
};
|
|
1309
|
-
deep(parentNode);
|
|
1310
|
-
elementsToKeep.clear();
|
|
1311
|
-
lockCount++;
|
|
1312
|
-
return function() {
|
|
1313
|
-
hiddenNodes.forEach(function(node) {
|
|
1314
|
-
var counterValue = counterMap.get(node) - 1;
|
|
1315
|
-
var markerValue = markerCounter.get(node) - 1;
|
|
1316
|
-
counterMap.set(node, counterValue);
|
|
1317
|
-
markerCounter.set(node, markerValue);
|
|
1318
|
-
if (!counterValue) {
|
|
1319
|
-
if (!uncontrolledNodes.has(node)) {
|
|
1320
|
-
node.removeAttribute(controlAttribute);
|
|
1321
|
-
}
|
|
1322
|
-
uncontrolledNodes.delete(node);
|
|
1323
|
-
}
|
|
1324
|
-
if (!markerValue) {
|
|
1325
|
-
node.removeAttribute(markerName);
|
|
1326
|
-
}
|
|
1327
|
-
});
|
|
1328
|
-
lockCount--;
|
|
1329
|
-
if (!lockCount) {
|
|
1330
|
-
counterMap = /* @__PURE__ */ new WeakMap();
|
|
1331
|
-
counterMap = /* @__PURE__ */ new WeakMap();
|
|
1332
|
-
uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
1333
|
-
markerMap = {};
|
|
1334
|
-
}
|
|
1335
|
-
};
|
|
1336
|
-
};
|
|
1337
|
-
var hideOthers = function(originalTarget, parentNode, markerName) {
|
|
1338
|
-
if (markerName === void 0) {
|
|
1339
|
-
markerName = "data-aria-hidden";
|
|
1340
|
-
}
|
|
1341
|
-
var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
1342
|
-
var activeParentNode = parentNode || getDefaultParent(originalTarget);
|
|
1343
|
-
if (!activeParentNode) {
|
|
1344
|
-
return function() {
|
|
1345
|
-
return null;
|
|
1346
|
-
};
|
|
1347
|
-
}
|
|
1348
|
-
targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
|
|
1349
|
-
return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
|
|
1350
|
-
};
|
|
1351
|
-
|
|
1352
|
-
// ../../../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.15_@types+react-dom@19.2.3_@types+react@19.2.6__@types+react@19.2._vo4kj5mvvikqqetwf4krwfjr74/node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
1353
|
-
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
|
1354
|
-
var DIALOG_NAME = "Dialog";
|
|
1355
|
-
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
1356
|
-
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
1357
|
-
var Dialog = (props) => {
|
|
1358
|
-
const {
|
|
1359
|
-
__scopeDialog,
|
|
1360
|
-
children,
|
|
1361
|
-
open: openProp,
|
|
1362
|
-
defaultOpen,
|
|
1363
|
-
onOpenChange,
|
|
1364
|
-
modal = true
|
|
1365
|
-
} = props;
|
|
1366
|
-
const triggerRef = React15.useRef(null);
|
|
1367
|
-
const contentRef = React15.useRef(null);
|
|
1368
|
-
const [open, setOpen] = useControllableState({
|
|
1369
|
-
prop: openProp,
|
|
1370
|
-
defaultProp: defaultOpen ?? false,
|
|
1371
|
-
onChange: onOpenChange,
|
|
1372
|
-
caller: DIALOG_NAME
|
|
1373
|
-
});
|
|
1374
|
-
return (0, import_jsx_runtime4.jsx)(
|
|
1375
|
-
DialogProvider,
|
|
1376
|
-
{
|
|
1377
|
-
scope: __scopeDialog,
|
|
1378
|
-
triggerRef,
|
|
1379
|
-
contentRef,
|
|
1380
|
-
contentId: useId(),
|
|
1381
|
-
titleId: useId(),
|
|
1382
|
-
descriptionId: useId(),
|
|
1383
|
-
open,
|
|
1384
|
-
onOpenChange: setOpen,
|
|
1385
|
-
onOpenToggle: React15.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
1386
|
-
modal,
|
|
1387
|
-
children
|
|
1388
|
-
}
|
|
1389
|
-
);
|
|
1390
|
-
};
|
|
1391
|
-
Dialog.displayName = DIALOG_NAME;
|
|
1392
|
-
var TRIGGER_NAME = "DialogTrigger";
|
|
1393
|
-
var DialogTrigger = React15.forwardRef(
|
|
1394
|
-
(props, forwardedRef) => {
|
|
1395
|
-
const { __scopeDialog, ...triggerProps } = props;
|
|
1396
|
-
const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
|
|
1397
|
-
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
1398
|
-
return (0, import_jsx_runtime4.jsx)(
|
|
1399
|
-
Primitive.button,
|
|
1400
|
-
{
|
|
1401
|
-
type: "button",
|
|
1402
|
-
"aria-haspopup": "dialog",
|
|
1403
|
-
"aria-expanded": context.open,
|
|
1404
|
-
"aria-controls": context.contentId,
|
|
1405
|
-
"data-state": getState(context.open),
|
|
1406
|
-
...triggerProps,
|
|
1407
|
-
ref: composedTriggerRef,
|
|
1408
|
-
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
1409
|
-
}
|
|
1410
|
-
);
|
|
1411
|
-
}
|
|
1412
|
-
);
|
|
1413
|
-
DialogTrigger.displayName = TRIGGER_NAME;
|
|
1414
|
-
var PORTAL_NAME2 = "DialogPortal";
|
|
1415
|
-
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME2, {
|
|
1416
|
-
forceMount: void 0
|
|
1417
|
-
});
|
|
1418
|
-
var DialogPortal = (props) => {
|
|
1419
|
-
const { __scopeDialog, forceMount, children, container } = props;
|
|
1420
|
-
const context = useDialogContext(PORTAL_NAME2, __scopeDialog);
|
|
1421
|
-
return (0, import_jsx_runtime4.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children: React15.Children.map(children, (child) => (0, import_jsx_runtime4.jsx)(Presence, { present: forceMount || context.open, children: (0, import_jsx_runtime4.jsx)(Portal, { asChild: true, container, children: child }) })) });
|
|
1422
|
-
};
|
|
1423
|
-
DialogPortal.displayName = PORTAL_NAME2;
|
|
1424
|
-
var OVERLAY_NAME = "DialogOverlay";
|
|
1425
|
-
var DialogOverlay = React15.forwardRef(
|
|
1426
|
-
(props, forwardedRef) => {
|
|
1427
|
-
const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
|
|
1428
|
-
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
|
|
1429
|
-
const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
|
|
1430
|
-
return context.modal ? (0, import_jsx_runtime4.jsx)(Presence, { present: forceMount || context.open, children: (0, import_jsx_runtime4.jsx)(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
|
|
1431
|
-
}
|
|
1432
|
-
);
|
|
1433
|
-
DialogOverlay.displayName = OVERLAY_NAME;
|
|
1434
|
-
var Slot = createSlot("DialogOverlay.RemoveScroll");
|
|
1435
|
-
var DialogOverlayImpl = React15.forwardRef(
|
|
1436
|
-
(props, forwardedRef) => {
|
|
1437
|
-
const { __scopeDialog, ...overlayProps } = props;
|
|
1438
|
-
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
1439
|
-
return (
|
|
1440
|
-
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
1441
|
-
// ie. when `Overlay` and `Content` are siblings
|
|
1442
|
-
(0, import_jsx_runtime4.jsx)(Combination_default, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: (0, import_jsx_runtime4.jsx)(
|
|
1443
|
-
Primitive.div,
|
|
1444
|
-
{
|
|
1445
|
-
"data-state": getState(context.open),
|
|
1446
|
-
...overlayProps,
|
|
1447
|
-
ref: forwardedRef,
|
|
1448
|
-
style: { pointerEvents: "auto", ...overlayProps.style }
|
|
1449
|
-
}
|
|
1450
|
-
) })
|
|
1451
|
-
);
|
|
1452
|
-
}
|
|
1453
|
-
);
|
|
1454
|
-
var CONTENT_NAME = "DialogContent";
|
|
1455
|
-
var DialogContent = React15.forwardRef(
|
|
1456
|
-
(props, forwardedRef) => {
|
|
1457
|
-
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
|
|
1458
|
-
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
1459
|
-
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
1460
|
-
return (0, import_jsx_runtime4.jsx)(Presence, { present: forceMount || context.open, children: context.modal ? (0, import_jsx_runtime4.jsx)(DialogContentModal, { ...contentProps, ref: forwardedRef }) : (0, import_jsx_runtime4.jsx)(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
1461
|
-
}
|
|
1462
|
-
);
|
|
1463
|
-
DialogContent.displayName = CONTENT_NAME;
|
|
1464
|
-
var DialogContentModal = React15.forwardRef(
|
|
1465
|
-
(props, forwardedRef) => {
|
|
1466
|
-
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
1467
|
-
const contentRef = React15.useRef(null);
|
|
1468
|
-
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
1469
|
-
React15.useEffect(() => {
|
|
1470
|
-
const content = contentRef.current;
|
|
1471
|
-
if (content) return hideOthers(content);
|
|
1472
|
-
}, []);
|
|
1473
|
-
return (0, import_jsx_runtime4.jsx)(
|
|
1474
|
-
DialogContentImpl,
|
|
1475
|
-
{
|
|
1476
|
-
...props,
|
|
1477
|
-
ref: composedRefs,
|
|
1478
|
-
trapFocus: context.open,
|
|
1479
|
-
disableOutsidePointerEvents: true,
|
|
1480
|
-
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
1481
|
-
var _a;
|
|
1482
|
-
event.preventDefault();
|
|
1483
|
-
(_a = context.triggerRef.current) == null ? void 0 : _a.focus();
|
|
1484
|
-
}),
|
|
1485
|
-
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
|
|
1486
|
-
const originalEvent = event.detail.originalEvent;
|
|
1487
|
-
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
1488
|
-
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
1489
|
-
if (isRightClick) event.preventDefault();
|
|
1490
|
-
}),
|
|
1491
|
-
onFocusOutside: composeEventHandlers(
|
|
1492
|
-
props.onFocusOutside,
|
|
1493
|
-
(event) => event.preventDefault()
|
|
1494
|
-
)
|
|
1495
|
-
}
|
|
1496
|
-
);
|
|
1497
|
-
}
|
|
1498
|
-
);
|
|
1499
|
-
var DialogContentNonModal = React15.forwardRef(
|
|
1500
|
-
(props, forwardedRef) => {
|
|
1501
|
-
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
1502
|
-
const hasInteractedOutsideRef = React15.useRef(false);
|
|
1503
|
-
const hasPointerDownOutsideRef = React15.useRef(false);
|
|
1504
|
-
return (0, import_jsx_runtime4.jsx)(
|
|
1505
|
-
DialogContentImpl,
|
|
1506
|
-
{
|
|
1507
|
-
...props,
|
|
1508
|
-
ref: forwardedRef,
|
|
1509
|
-
trapFocus: false,
|
|
1510
|
-
disableOutsidePointerEvents: false,
|
|
1511
|
-
onCloseAutoFocus: (event) => {
|
|
1512
|
-
var _a, _b;
|
|
1513
|
-
(_a = props.onCloseAutoFocus) == null ? void 0 : _a.call(props, event);
|
|
1514
|
-
if (!event.defaultPrevented) {
|
|
1515
|
-
if (!hasInteractedOutsideRef.current) (_b = context.triggerRef.current) == null ? void 0 : _b.focus();
|
|
1516
|
-
event.preventDefault();
|
|
1517
|
-
}
|
|
1518
|
-
hasInteractedOutsideRef.current = false;
|
|
1519
|
-
hasPointerDownOutsideRef.current = false;
|
|
1520
|
-
},
|
|
1521
|
-
onInteractOutside: (event) => {
|
|
1522
|
-
var _a, _b;
|
|
1523
|
-
(_a = props.onInteractOutside) == null ? void 0 : _a.call(props, event);
|
|
1524
|
-
if (!event.defaultPrevented) {
|
|
1525
|
-
hasInteractedOutsideRef.current = true;
|
|
1526
|
-
if (event.detail.originalEvent.type === "pointerdown") {
|
|
1527
|
-
hasPointerDownOutsideRef.current = true;
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1530
|
-
const target = event.target;
|
|
1531
|
-
const targetIsTrigger = (_b = context.triggerRef.current) == null ? void 0 : _b.contains(target);
|
|
1532
|
-
if (targetIsTrigger) event.preventDefault();
|
|
1533
|
-
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
1534
|
-
event.preventDefault();
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
}
|
|
1538
|
-
);
|
|
1539
|
-
}
|
|
1540
|
-
);
|
|
1541
|
-
var DialogContentImpl = React15.forwardRef(
|
|
1542
|
-
(props, forwardedRef) => {
|
|
1543
|
-
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
1544
|
-
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
|
1545
|
-
const contentRef = React15.useRef(null);
|
|
1546
|
-
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
1547
|
-
useFocusGuards();
|
|
1548
|
-
return (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1549
|
-
(0, import_jsx_runtime4.jsx)(
|
|
1550
|
-
FocusScope,
|
|
1551
|
-
{
|
|
1552
|
-
asChild: true,
|
|
1553
|
-
loop: true,
|
|
1554
|
-
trapped: trapFocus,
|
|
1555
|
-
onMountAutoFocus: onOpenAutoFocus,
|
|
1556
|
-
onUnmountAutoFocus: onCloseAutoFocus,
|
|
1557
|
-
children: (0, import_jsx_runtime4.jsx)(
|
|
1558
|
-
DismissableLayer,
|
|
1559
|
-
{
|
|
1560
|
-
role: "dialog",
|
|
1561
|
-
id: context.contentId,
|
|
1562
|
-
"aria-describedby": context.descriptionId,
|
|
1563
|
-
"aria-labelledby": context.titleId,
|
|
1564
|
-
"data-state": getState(context.open),
|
|
1565
|
-
...contentProps,
|
|
1566
|
-
ref: composedRefs,
|
|
1567
|
-
onDismiss: () => context.onOpenChange(false)
|
|
1568
|
-
}
|
|
1569
|
-
)
|
|
1570
|
-
}
|
|
1571
|
-
),
|
|
1572
|
-
(0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1573
|
-
(0, import_jsx_runtime4.jsx)(TitleWarning, { titleId: context.titleId }),
|
|
1574
|
-
(0, import_jsx_runtime4.jsx)(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
|
|
1575
|
-
] })
|
|
1576
|
-
] });
|
|
1577
|
-
}
|
|
1578
|
-
);
|
|
1579
|
-
var TITLE_NAME = "DialogTitle";
|
|
1580
|
-
var DialogTitle = React15.forwardRef(
|
|
1581
|
-
(props, forwardedRef) => {
|
|
1582
|
-
const { __scopeDialog, ...titleProps } = props;
|
|
1583
|
-
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
1584
|
-
return (0, import_jsx_runtime4.jsx)(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
|
1585
|
-
}
|
|
1586
|
-
);
|
|
1587
|
-
DialogTitle.displayName = TITLE_NAME;
|
|
1588
|
-
var DESCRIPTION_NAME = "DialogDescription";
|
|
1589
|
-
var DialogDescription = React15.forwardRef(
|
|
1590
|
-
(props, forwardedRef) => {
|
|
1591
|
-
const { __scopeDialog, ...descriptionProps } = props;
|
|
1592
|
-
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
1593
|
-
return (0, import_jsx_runtime4.jsx)(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
|
1594
|
-
}
|
|
1595
|
-
);
|
|
1596
|
-
DialogDescription.displayName = DESCRIPTION_NAME;
|
|
1597
|
-
var CLOSE_NAME = "DialogClose";
|
|
1598
|
-
var DialogClose = React15.forwardRef(
|
|
1599
|
-
(props, forwardedRef) => {
|
|
1600
|
-
const { __scopeDialog, ...closeProps } = props;
|
|
1601
|
-
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
1602
|
-
return (0, import_jsx_runtime4.jsx)(
|
|
1603
|
-
Primitive.button,
|
|
1604
|
-
{
|
|
1605
|
-
type: "button",
|
|
1606
|
-
...closeProps,
|
|
1607
|
-
ref: forwardedRef,
|
|
1608
|
-
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
1609
|
-
}
|
|
1610
|
-
);
|
|
1611
|
-
}
|
|
1612
|
-
);
|
|
1613
|
-
DialogClose.displayName = CLOSE_NAME;
|
|
1614
|
-
function getState(open) {
|
|
1615
|
-
return open ? "open" : "closed";
|
|
1616
|
-
}
|
|
1617
|
-
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
|
1618
|
-
var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
|
|
1619
|
-
contentName: CONTENT_NAME,
|
|
1620
|
-
titleName: TITLE_NAME,
|
|
1621
|
-
docsSlug: "dialog"
|
|
1622
|
-
});
|
|
1623
|
-
var TitleWarning = ({ titleId }) => {
|
|
1624
|
-
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
|
|
1625
|
-
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
|
|
1626
|
-
|
|
1627
|
-
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
1628
|
-
|
|
1629
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
|
1630
|
-
React15.useEffect(() => {
|
|
1631
|
-
if (titleId) {
|
|
1632
|
-
const hasTitle = document.getElementById(titleId);
|
|
1633
|
-
if (!hasTitle) console.error(MESSAGE);
|
|
1634
|
-
}
|
|
1635
|
-
}, [MESSAGE, titleId]);
|
|
1636
|
-
return null;
|
|
1637
|
-
};
|
|
1638
|
-
var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
|
|
1639
|
-
var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
|
1640
|
-
const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
|
|
1641
|
-
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
|
|
1642
|
-
React15.useEffect(() => {
|
|
1643
|
-
var _a;
|
|
1644
|
-
const describedById = (_a = contentRef.current) == null ? void 0 : _a.getAttribute("aria-describedby");
|
|
1645
|
-
if (descriptionId && describedById) {
|
|
1646
|
-
const hasDescription = document.getElementById(descriptionId);
|
|
1647
|
-
if (!hasDescription) console.warn(MESSAGE);
|
|
1648
|
-
}
|
|
1649
|
-
}, [MESSAGE, contentRef, descriptionId]);
|
|
1650
|
-
return null;
|
|
1651
|
-
};
|
|
1652
|
-
var Root = Dialog;
|
|
1653
|
-
var Trigger = DialogTrigger;
|
|
1654
|
-
var Portal2 = DialogPortal;
|
|
1655
|
-
var Overlay = DialogOverlay;
|
|
1656
|
-
var Content = DialogContent;
|
|
1657
|
-
var Title = DialogTitle;
|
|
1658
|
-
var Description = DialogDescription;
|
|
1659
|
-
var Close = DialogClose;
|
|
1660
|
-
export {
|
|
1661
|
-
Close,
|
|
1662
|
-
Content,
|
|
1663
|
-
Description,
|
|
1664
|
-
Dialog,
|
|
1665
|
-
DialogClose,
|
|
1666
|
-
DialogContent,
|
|
1667
|
-
DialogDescription,
|
|
1668
|
-
DialogOverlay,
|
|
1669
|
-
DialogPortal,
|
|
1670
|
-
DialogTitle,
|
|
1671
|
-
DialogTrigger,
|
|
1672
|
-
Overlay,
|
|
1673
|
-
Portal2 as Portal,
|
|
1674
|
-
Root,
|
|
1675
|
-
Title,
|
|
1676
|
-
Trigger,
|
|
1677
|
-
WarningProvider,
|
|
1678
|
-
createDialogScope
|
|
1679
|
-
};
|
|
1680
|
-
//# sourceMappingURL=@radix-ui_react-dialog.js.map
|