@tonyclaw/agent-inspector 3.0.18 → 3.0.20
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/.output/cli.js +1257 -506
- package/.output/nitro.json +3 -3
- package/.output/public/assets/CompareDrawer-CV7rBBty.js +1 -0
- package/.output/public/assets/ProxyViewerContainer-CqRfBWJ3.js +127 -0
- package/.output/public/assets/ReplayDialog-yDeF-z9y.js +1 -0
- package/.output/public/assets/RequestAnatomy-BXxKNdgk.js +1 -0
- package/.output/public/assets/ResponseView-BIYNgUNB.js +3 -0
- package/.output/public/assets/StreamingChunkSequence-C1faiChu.js +1 -0
- package/.output/public/assets/_sessionId-B34PrfCQ.js +1 -0
- package/.output/public/assets/index-B3YOj8-_.css +1 -0
- package/.output/public/assets/index-BLwqIxup.js +12 -0
- package/.output/public/assets/{index-ClQ7Vi3J.js → index-DOspyaW6.js} +1 -1
- package/.output/public/assets/index-DT476lno.js +1 -0
- package/.output/public/assets/json-viewer-C1S08J_2.js +1 -0
- package/.output/server/_chunks/ssr-renderer.mjs +18 -2
- package/.output/server/_libs/@radix-ui/react-dismissable-layer+[...].mjs +165 -31
- package/.output/server/_libs/@radix-ui/react-use-callback-ref+[...].mjs +1 -1
- package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +2 -2
- package/.output/server/_libs/@radix-ui/react-use-is-hydrated+[...].mjs +28 -1
- package/.output/server/_libs/mistralai__mistralai.mjs +1 -1
- package/.output/server/_libs/modelcontextprotocol__server.mjs +11571 -8127
- package/.output/server/_libs/radix-ui__primitive.mjs +1 -1
- package/.output/server/_libs/radix-ui__react-collapsible.mjs +1 -1
- package/.output/server/_libs/radix-ui__react-collection.mjs +8 -8
- package/.output/server/_libs/radix-ui__react-compose-refs.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-context.mjs +4 -18
- package/.output/server/_libs/radix-ui__react-dialog.mjs +41 -88
- package/.output/server/_libs/radix-ui__react-focus-guards.mjs +15 -5
- package/.output/server/_libs/radix-ui__react-focus-scope.mjs +6 -2
- package/.output/server/_libs/radix-ui__react-id.mjs +3 -3
- package/.output/server/_libs/radix-ui__react-popper.mjs +62 -8
- package/.output/server/_libs/radix-ui__react-portal.mjs +2 -2
- package/.output/server/_libs/radix-ui__react-presence.mjs +50 -5
- package/.output/server/_libs/radix-ui__react-roving-focus.mjs +15 -4
- package/.output/server/_libs/radix-ui__react-scroll-area.mjs +30 -20
- package/.output/server/_libs/radix-ui__react-select.mjs +167 -123
- package/.output/server/_libs/radix-ui__react-slot.mjs +74 -41
- package/.output/server/_libs/radix-ui__react-tabs.mjs +6 -1
- package/.output/server/_libs/radix-ui__react-tooltip.mjs +6 -3
- package/.output/server/_libs/react-dom.mjs +13 -15
- package/.output/server/_libs/react.mjs +45 -45
- package/.output/server/_libs/srvx.mjs +409 -53
- package/.output/server/_libs/swr.mjs +10 -2
- package/.output/server/_libs/tailwind-merge.mjs +286 -41
- package/.output/server/_libs/tanstack__history.mjs +9 -13
- package/.output/server/_libs/tanstack__react-router.mjs +788 -1092
- package/.output/server/_libs/tanstack__react-store.mjs +1 -1
- package/.output/server/_libs/tanstack__react-virtual.mjs +82 -7
- package/.output/server/_libs/tanstack__router-core.mjs +1841 -2060
- package/.output/server/_libs/tanstack__virtual-core.mjs +116 -45
- package/.output/server/_libs/use-sync-external-store.mjs +1 -1
- package/.output/server/_libs/zod-to-json-schema.mjs +1 -1
- package/.output/server/_libs/zod.mjs +5085 -200
- package/.output/server/{_sessionId-Bi3ZIrqT.mjs → _sessionId-CmoBbtKT.mjs} +30 -32
- package/.output/server/_ssr/{CompareDrawer-BYZS_hCR.mjs → CompareDrawer-BsXnVK4e.mjs} +29 -31
- package/.output/server/_ssr/{ProxyViewerContainer-BE4umfVs.mjs → ProxyViewerContainer-D-_7pyfx.mjs} +54 -52
- package/.output/server/_ssr/{ReplayDialog-BlID2ZH4.mjs → ReplayDialog-deDQA2M5.mjs} +30 -32
- package/.output/server/_ssr/{RequestAnatomy-CGJ2lkzT.mjs → RequestAnatomy-CX-cCRdX.mjs} +29 -31
- package/.output/server/_ssr/{ResponseView-DDjcGf7M.mjs → ResponseView-D0LJR1qj.mjs} +29 -31
- package/.output/server/_ssr/{StreamingChunkSequence-G7B8M5G2.mjs → StreamingChunkSequence-CJRECetE.mjs} +29 -31
- package/.output/server/_ssr/empty-plugin-adapters-BFgPZ6_d.mjs +6 -0
- package/.output/server/_ssr/{index-ClQ9FvRJ.mjs → index-CYWOXS4d.mjs} +31 -33
- package/.output/server/_ssr/index.mjs +1102 -784
- package/.output/server/_ssr/{json-viewer-CFbpkiBJ.mjs → json-viewer-CCneYiCn.mjs} +29 -31
- package/.output/server/_ssr/{router-Cq8LEvhE.mjs → router-D-PAN8IK.mjs} +182 -67
- package/.output/server/_tanstack-start-manifest_v-CVZ9yh4R.mjs +4 -0
- package/.output/server/index.mjs +74 -92
- package/README.md +4 -4
- package/package.json +17 -8
- package/src/cli/onboard.ts +1 -1
- package/src/cli.ts +2 -2
- package/src/components/clients/ClientLogo.tsx +5 -1
- package/src/components/proxy-viewer/RequestToolsPanel.tsx +1 -0
- package/src/components/proxy-viewer/ResponseView.tsx +1 -0
- package/src/components/proxy-viewer/StreamingChunkSequence.tsx +1 -0
- package/src/components/proxy-viewer/TurnGroup.tsx +1 -0
- package/src/components/proxy-viewer/anatomy/SegmentBar.tsx +1 -0
- package/src/components/proxy-viewer/formats/anthropic/ContentBlocks.tsx +4 -0
- package/src/components/proxy-viewer/formats/anthropic/ResponseView.tsx +1 -0
- package/src/components/proxy-viewer/formats/openai/ResponseView.tsx +2 -0
- package/src/components/ui/dialog.tsx +1 -1
- package/src/components/ui/json-viewer.tsx +2 -0
- package/src/components/ui/select.tsx +1 -1
- package/src/contracts/json.ts +7 -2
- package/src/lib/providerContract.ts +25 -5
- package/src/mcp/server.ts +12 -3
- package/src/mcp/toolHandlers.ts +6 -1
- package/src/proxy/handler.ts +17 -7
- package/src/proxy/logFinalizer.ts +76 -8
- package/src/proxy/logIndex.ts +16 -32
- package/src/proxy/providers.ts +22 -1
- package/src/proxy/sessionProcess.ts +15 -1
- package/src/proxy/upstream.ts +4 -2
- package/src/router.tsx +9 -0
- package/.output/public/assets/CompareDrawer-Daj03-RL.js +0 -1
- package/.output/public/assets/ProxyViewerContainer-BLCRQtU_.js +0 -106
- package/.output/public/assets/ReplayDialog-5FR5crdo.js +0 -1
- package/.output/public/assets/RequestAnatomy-DF0hHdQY.js +0 -1
- package/.output/public/assets/ResponseView-BwkMSsUa.js +0 -3
- package/.output/public/assets/StreamingChunkSequence-CKeUd58x.js +0 -1
- package/.output/public/assets/_sessionId-CThgXa41.js +0 -1
- package/.output/public/assets/index-BHXN1Fsx.css +0 -1
- package/.output/public/assets/index-gm3A0idN.js +0 -1
- package/.output/public/assets/json-viewer-BA-W-PZq.js +0 -1
- package/.output/public/assets/main-BnRC1932.js +0 -18
- package/.output/server/_libs/@radix-ui/react-use-escape-keydown+[...].mjs +0 -17
- package/.output/server/_libs/cfworker__json-schema.mjs +0 -1
- package/.output/server/_libs/tiny-invariant.mjs +0 -12
- package/.output/server/_libs/tiny-warning.mjs +0 -5
- package/.output/server/_tanstack-start-manifest_v-p7J0QCMh.mjs +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
2
2
|
return function handleEvent(event) {
|
|
3
3
|
originalEventHandler?.(event);
|
|
4
|
-
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
4
|
+
if (checkForDefaultPrevented === false || !event || !event.defaultPrevented) {
|
|
5
5
|
return ourEventHandler?.(event);
|
|
6
6
|
}
|
|
7
7
|
};
|
|
@@ -57,7 +57,7 @@ var CollapsibleTrigger = reactExports.forwardRef(
|
|
|
57
57
|
Primitive.button,
|
|
58
58
|
{
|
|
59
59
|
type: "button",
|
|
60
|
-
"aria-controls": context.contentId,
|
|
60
|
+
"aria-controls": context.open ? context.contentId : void 0,
|
|
61
61
|
"aria-expanded": context.open || false,
|
|
62
62
|
"data-state": getState(context.open),
|
|
63
63
|
"data-disabled": context.disabled ? "" : void 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as reactExports, j as jsxRuntimeExports } from "./react.mjs";
|
|
2
2
|
import { c as createContextScope } from "./radix-ui__react-context.mjs";
|
|
3
3
|
import { u as useComposedRefs } from "./radix-ui__react-compose-refs.mjs";
|
|
4
4
|
import { c as createSlot } from "./radix-ui__react-slot.mjs";
|
|
@@ -11,14 +11,14 @@ function createCollection(name) {
|
|
|
11
11
|
);
|
|
12
12
|
const CollectionProvider = (props) => {
|
|
13
13
|
const { scope, children } = props;
|
|
14
|
-
const ref =
|
|
15
|
-
const itemMap =
|
|
14
|
+
const ref = reactExports.useRef(null);
|
|
15
|
+
const itemMap = reactExports.useRef(/* @__PURE__ */ new Map()).current;
|
|
16
16
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
17
17
|
};
|
|
18
18
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
19
19
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
20
20
|
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
21
|
-
const CollectionSlot =
|
|
21
|
+
const CollectionSlot = reactExports.forwardRef(
|
|
22
22
|
(props, forwardedRef) => {
|
|
23
23
|
const { scope, children } = props;
|
|
24
24
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
@@ -30,13 +30,13 @@ function createCollection(name) {
|
|
|
30
30
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
31
31
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
32
32
|
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
33
|
-
const CollectionItemSlot =
|
|
33
|
+
const CollectionItemSlot = reactExports.forwardRef(
|
|
34
34
|
(props, forwardedRef) => {
|
|
35
35
|
const { scope, children, ...itemData } = props;
|
|
36
|
-
const ref =
|
|
36
|
+
const ref = reactExports.useRef(null);
|
|
37
37
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
38
38
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
39
|
-
|
|
39
|
+
reactExports.useEffect(() => {
|
|
40
40
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
41
41
|
return () => void context.itemMap.delete(ref);
|
|
42
42
|
});
|
|
@@ -46,7 +46,7 @@ function createCollection(name) {
|
|
|
46
46
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
47
47
|
function useCollection(scope) {
|
|
48
48
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
49
|
-
const getItems =
|
|
49
|
+
const getItems = reactExports.useCallback(() => {
|
|
50
50
|
const collectionNode = context.collectionRef.current;
|
|
51
51
|
if (!collectionNode) return [];
|
|
52
52
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
@@ -1,24 +1,9 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "./react.mjs";
|
|
2
|
-
function createContext2(rootComponentName, defaultContext) {
|
|
3
|
-
const Context = reactExports.createContext(defaultContext);
|
|
4
|
-
const Provider = (props) => {
|
|
5
|
-
const { children, ...context } = props;
|
|
6
|
-
const value = reactExports.useMemo(() => context, Object.values(context));
|
|
7
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children });
|
|
8
|
-
};
|
|
9
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
10
|
-
function useContext2(consumerName) {
|
|
11
|
-
const context = reactExports.useContext(Context);
|
|
12
|
-
if (context) return context;
|
|
13
|
-
if (defaultContext !== void 0) return defaultContext;
|
|
14
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
15
|
-
}
|
|
16
|
-
return [Provider, useContext2];
|
|
17
|
-
}
|
|
18
2
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
19
3
|
let defaultContexts = [];
|
|
20
4
|
function createContext3(rootComponentName, defaultContext) {
|
|
21
5
|
const BaseContext = reactExports.createContext(defaultContext);
|
|
6
|
+
BaseContext.displayName = rootComponentName + "Context";
|
|
22
7
|
const index = defaultContexts.length;
|
|
23
8
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
24
9
|
const Provider = (props) => {
|
|
@@ -28,11 +13,13 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
28
13
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children });
|
|
29
14
|
};
|
|
30
15
|
Provider.displayName = rootComponentName + "Provider";
|
|
31
|
-
function useContext2(consumerName, scope) {
|
|
16
|
+
function useContext2(consumerName, scope, options = {}) {
|
|
17
|
+
const { optional = false } = options;
|
|
32
18
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
33
19
|
const context = reactExports.useContext(Context);
|
|
34
20
|
if (context) return context;
|
|
35
21
|
if (defaultContext !== void 0) return defaultContext;
|
|
22
|
+
if (optional) return void 0;
|
|
36
23
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
37
24
|
}
|
|
38
25
|
return [Provider, useContext2];
|
|
@@ -73,6 +60,5 @@ function composeContextScopes(...scopes) {
|
|
|
73
60
|
return createScope;
|
|
74
61
|
}
|
|
75
62
|
export {
|
|
76
|
-
createContext2 as a,
|
|
77
63
|
createContextScope as c
|
|
78
64
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "./react.mjs";
|
|
2
2
|
import { c as composeEventHandlers } from "./radix-ui__primitive.mjs";
|
|
3
3
|
import { u as useComposedRefs } from "./radix-ui__react-compose-refs.mjs";
|
|
4
|
-
import { c as createContextScope
|
|
4
|
+
import { c as createContextScope } from "./radix-ui__react-context.mjs";
|
|
5
5
|
import { u as useId } from "./radix-ui__react-id.mjs";
|
|
6
6
|
import { u as useControllableState } from "./@radix-ui/react-use-controllable-state+[...].mjs";
|
|
7
|
-
import { D as DismissableLayer } from "./@radix-ui/react-dismissable-layer+[...].mjs";
|
|
7
|
+
import { u as useDismissableLayerSurface, D as DismissableLayer } from "./@radix-ui/react-dismissable-layer+[...].mjs";
|
|
8
8
|
import { F as FocusScope } from "./radix-ui__react-focus-scope.mjs";
|
|
9
|
-
import { P as Portal
|
|
9
|
+
import { P as Portal } from "./radix-ui__react-portal.mjs";
|
|
10
10
|
import { P as Presence } from "./radix-ui__react-presence.mjs";
|
|
11
11
|
import { P as Primitive } from "./radix-ui__react-primitive.mjs";
|
|
12
12
|
import { u as useFocusGuards } from "./radix-ui__react-focus-guards.mjs";
|
|
@@ -63,7 +63,7 @@ var DialogTrigger = reactExports.forwardRef(
|
|
|
63
63
|
type: "button",
|
|
64
64
|
"aria-haspopup": "dialog",
|
|
65
65
|
"aria-expanded": context.open,
|
|
66
|
-
"aria-controls": context.contentId,
|
|
66
|
+
"aria-controls": context.open ? context.contentId : void 0,
|
|
67
67
|
"data-state": getState(context.open),
|
|
68
68
|
...triggerProps,
|
|
69
69
|
ref: composedTriggerRef,
|
|
@@ -80,7 +80,7 @@ var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
|
|
|
80
80
|
var DialogPortal = (props) => {
|
|
81
81
|
const { __scopeDialog, forceMount, children, container } = props;
|
|
82
82
|
const context = useDialogContext(PORTAL_NAME, __scopeDialog);
|
|
83
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: reactExports.Children.map(children, (child) => /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Portal
|
|
83
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: reactExports.Children.map(children, (child) => /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, { asChild: true, container, children: child }) })) });
|
|
84
84
|
};
|
|
85
85
|
DialogPortal.displayName = PORTAL_NAME;
|
|
86
86
|
var OVERLAY_NAME = "DialogOverlay";
|
|
@@ -98,6 +98,8 @@ var DialogOverlayImpl = reactExports.forwardRef(
|
|
|
98
98
|
(props, forwardedRef) => {
|
|
99
99
|
const { __scopeDialog, ...overlayProps } = props;
|
|
100
100
|
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
101
|
+
const registerDismissableSurface = useDismissableLayerSurface();
|
|
102
|
+
const composedRefs = useComposedRefs(forwardedRef, registerDismissableSurface);
|
|
101
103
|
return (
|
|
102
104
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
103
105
|
// ie. when `Overlay` and `Content` are siblings
|
|
@@ -106,7 +108,7 @@ var DialogOverlayImpl = reactExports.forwardRef(
|
|
|
106
108
|
{
|
|
107
109
|
"data-state": getState(context.open),
|
|
108
110
|
...overlayProps,
|
|
109
|
-
ref:
|
|
111
|
+
ref: composedRefs,
|
|
110
112
|
style: { pointerEvents: "auto", ...overlayProps.style }
|
|
111
113
|
}
|
|
112
114
|
) })
|
|
@@ -138,7 +140,7 @@ var DialogContentModal = reactExports.forwardRef(
|
|
|
138
140
|
...props,
|
|
139
141
|
ref: composedRefs,
|
|
140
142
|
trapFocus: context.open,
|
|
141
|
-
disableOutsidePointerEvents:
|
|
143
|
+
disableOutsidePointerEvents: context.open,
|
|
142
144
|
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
143
145
|
event.preventDefault();
|
|
144
146
|
context.triggerRef.current?.focus();
|
|
@@ -201,38 +203,31 @@ var DialogContentImpl = reactExports.forwardRef(
|
|
|
201
203
|
(props, forwardedRef) => {
|
|
202
204
|
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
203
205
|
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
|
204
|
-
const contentRef = reactExports.useRef(null);
|
|
205
|
-
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
206
206
|
useFocusGuards();
|
|
207
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
232
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(TitleWarning, { titleId: context.titleId }),
|
|
233
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
|
|
234
|
-
] })
|
|
235
|
-
] });
|
|
207
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
208
|
+
FocusScope,
|
|
209
|
+
{
|
|
210
|
+
asChild: true,
|
|
211
|
+
loop: true,
|
|
212
|
+
trapped: trapFocus,
|
|
213
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
214
|
+
onUnmountAutoFocus: onCloseAutoFocus,
|
|
215
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
216
|
+
DismissableLayer,
|
|
217
|
+
{
|
|
218
|
+
role: "dialog",
|
|
219
|
+
id: context.contentId,
|
|
220
|
+
"aria-describedby": context.descriptionId,
|
|
221
|
+
"aria-labelledby": context.titleId,
|
|
222
|
+
"data-state": getState(context.open),
|
|
223
|
+
...contentProps,
|
|
224
|
+
ref: forwardedRef,
|
|
225
|
+
deferPointerDownOutside: true,
|
|
226
|
+
onDismiss: () => context.onOpenChange(false)
|
|
227
|
+
}
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
) });
|
|
236
231
|
}
|
|
237
232
|
);
|
|
238
233
|
var TITLE_NAME = "DialogTitle";
|
|
@@ -273,55 +268,13 @@ DialogClose.displayName = CLOSE_NAME;
|
|
|
273
268
|
function getState(open) {
|
|
274
269
|
return open ? "open" : "closed";
|
|
275
270
|
}
|
|
276
|
-
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
|
277
|
-
var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
|
|
278
|
-
contentName: CONTENT_NAME,
|
|
279
|
-
titleName: TITLE_NAME,
|
|
280
|
-
docsSlug: "dialog"
|
|
281
|
-
});
|
|
282
|
-
var TitleWarning = ({ titleId }) => {
|
|
283
|
-
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
|
|
284
|
-
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
|
|
285
|
-
|
|
286
|
-
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
287
|
-
|
|
288
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
|
289
|
-
reactExports.useEffect(() => {
|
|
290
|
-
if (titleId) {
|
|
291
|
-
const hasTitle = document.getElementById(titleId);
|
|
292
|
-
if (!hasTitle) console.error(MESSAGE);
|
|
293
|
-
}
|
|
294
|
-
}, [MESSAGE, titleId]);
|
|
295
|
-
return null;
|
|
296
|
-
};
|
|
297
|
-
var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
|
|
298
|
-
var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
|
299
|
-
const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
|
|
300
|
-
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
|
|
301
|
-
reactExports.useEffect(() => {
|
|
302
|
-
const describedById = contentRef.current?.getAttribute("aria-describedby");
|
|
303
|
-
if (descriptionId && describedById) {
|
|
304
|
-
const hasDescription = document.getElementById(descriptionId);
|
|
305
|
-
if (!hasDescription) console.warn(MESSAGE);
|
|
306
|
-
}
|
|
307
|
-
}, [MESSAGE, contentRef, descriptionId]);
|
|
308
|
-
return null;
|
|
309
|
-
};
|
|
310
|
-
var Root = Dialog;
|
|
311
|
-
var Trigger = DialogTrigger;
|
|
312
|
-
var Portal = DialogPortal;
|
|
313
|
-
var Overlay = DialogOverlay;
|
|
314
|
-
var Content = DialogContent;
|
|
315
|
-
var Title = DialogTitle;
|
|
316
|
-
var Description = DialogDescription;
|
|
317
|
-
var Close = DialogClose;
|
|
318
271
|
export {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
272
|
+
Dialog as D,
|
|
273
|
+
DialogContent as a,
|
|
274
|
+
DialogClose as b,
|
|
275
|
+
DialogTitle as c,
|
|
276
|
+
DialogDescription as d,
|
|
277
|
+
DialogPortal as e,
|
|
278
|
+
DialogOverlay as f,
|
|
279
|
+
DialogTrigger as g
|
|
327
280
|
};
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import { r as reactExports } from "./react.mjs";
|
|
2
2
|
var count = 0;
|
|
3
|
+
var guards = null;
|
|
3
4
|
function useFocusGuards() {
|
|
4
5
|
reactExports.useEffect(() => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
if (!guards) {
|
|
7
|
+
guards = { start: createFocusGuard(), end: createFocusGuard() };
|
|
8
|
+
}
|
|
9
|
+
const { start, end } = guards;
|
|
10
|
+
if (document.body.firstElementChild !== start) {
|
|
11
|
+
document.body.insertAdjacentElement("afterbegin", start);
|
|
12
|
+
}
|
|
13
|
+
if (document.body.lastElementChild !== end) {
|
|
14
|
+
document.body.insertAdjacentElement("beforeend", end);
|
|
15
|
+
}
|
|
8
16
|
count++;
|
|
9
17
|
return () => {
|
|
10
18
|
if (count === 1) {
|
|
11
|
-
|
|
19
|
+
guards?.start.remove();
|
|
20
|
+
guards?.end.remove();
|
|
21
|
+
guards = null;
|
|
12
22
|
}
|
|
13
|
-
count
|
|
23
|
+
count = Math.max(0, count - 1);
|
|
14
24
|
};
|
|
15
25
|
}, []);
|
|
16
26
|
}
|
|
@@ -18,7 +18,7 @@ var FocusScope = reactExports.forwardRef((props, forwardedRef) => {
|
|
|
18
18
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
19
19
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
20
20
|
const lastFocusedElementRef = reactExports.useRef(null);
|
|
21
|
-
const composedRefs = useComposedRefs(forwardedRef,
|
|
21
|
+
const composedRefs = useComposedRefs(forwardedRef, setContainer);
|
|
22
22
|
const focusScope = reactExports.useRef({
|
|
23
23
|
paused: false,
|
|
24
24
|
pause() {
|
|
@@ -148,8 +148,12 @@ function getTabbableCandidates(container) {
|
|
|
148
148
|
return nodes;
|
|
149
149
|
}
|
|
150
150
|
function findVisible(elements, container) {
|
|
151
|
+
const canUseCheckVisibility = typeof container.checkVisibility === "function" && container.checkVisibility({ checkVisibilityCSS: true });
|
|
151
152
|
for (const element of elements) {
|
|
152
|
-
|
|
153
|
+
const hidden = canUseCheckVisibility ? !element.checkVisibility({ checkVisibilityCSS: true }) : isHidden(element, { upTo: container });
|
|
154
|
+
if (!hidden) {
|
|
155
|
+
return element;
|
|
156
|
+
}
|
|
153
157
|
}
|
|
154
158
|
}
|
|
155
159
|
function isHidden(node, { upTo }) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { r as reactExports,
|
|
1
|
+
import { r as reactExports, b as React2 } from "./react.mjs";
|
|
2
2
|
import { u as useLayoutEffect2 } from "./@radix-ui/react-use-layout-effect+[...].mjs";
|
|
3
|
-
var useReactId =
|
|
3
|
+
var useReactId = React2[" useId ".trim().toString()] || (() => void 0);
|
|
4
4
|
var count = 0;
|
|
5
5
|
function useId(deterministicId) {
|
|
6
6
|
const [id, setId] = reactExports.useState(useReactId());
|
|
7
7
|
useLayoutEffect2(() => {
|
|
8
8
|
setId((reactId) => reactId ?? String(count++));
|
|
9
9
|
}, [deterministicId]);
|
|
10
|
-
return
|
|
10
|
+
return id ? `radix-${id}` : "";
|
|
11
11
|
}
|
|
12
12
|
export {
|
|
13
13
|
useId as u
|
|
@@ -14,7 +14,18 @@ var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
|
14
14
|
var Popper = (props) => {
|
|
15
15
|
const { __scopePopper, children } = props;
|
|
16
16
|
const [anchor, setAnchor] = reactExports.useState(null);
|
|
17
|
-
|
|
17
|
+
const [placementState, setPlacementState] = reactExports.useState(void 0);
|
|
18
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
19
|
+
PopperProvider,
|
|
20
|
+
{
|
|
21
|
+
scope: __scopePopper,
|
|
22
|
+
anchor,
|
|
23
|
+
onAnchorChange: setAnchor,
|
|
24
|
+
placementState,
|
|
25
|
+
setPlacementState,
|
|
26
|
+
children
|
|
27
|
+
}
|
|
28
|
+
);
|
|
18
29
|
};
|
|
19
30
|
Popper.displayName = POPPER_NAME;
|
|
20
31
|
var ANCHOR_NAME = "PopperAnchor";
|
|
@@ -23,16 +34,40 @@ var PopperAnchor = reactExports.forwardRef(
|
|
|
23
34
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
24
35
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
25
36
|
const ref = reactExports.useRef(null);
|
|
26
|
-
const
|
|
37
|
+
const onAnchorChange = context.onAnchorChange;
|
|
38
|
+
const callbackRef = reactExports.useCallback(
|
|
39
|
+
(node) => {
|
|
40
|
+
ref.current = node;
|
|
41
|
+
if (node) {
|
|
42
|
+
onAnchorChange(node);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
[onAnchorChange]
|
|
46
|
+
);
|
|
47
|
+
const composedRefs = useComposedRefs(forwardedRef, callbackRef);
|
|
27
48
|
const anchorRef = reactExports.useRef(null);
|
|
28
49
|
reactExports.useEffect(() => {
|
|
50
|
+
if (!virtualRef) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
29
53
|
const previousAnchor = anchorRef.current;
|
|
30
|
-
anchorRef.current = virtualRef
|
|
54
|
+
anchorRef.current = virtualRef.current;
|
|
31
55
|
if (previousAnchor !== anchorRef.current) {
|
|
32
|
-
|
|
56
|
+
onAnchorChange(anchorRef.current);
|
|
33
57
|
}
|
|
34
58
|
});
|
|
35
|
-
|
|
59
|
+
const sideAndAlign = context.placementState && getSideAndAlignFromPlacement(context.placementState);
|
|
60
|
+
const placedSide = sideAndAlign?.[0];
|
|
61
|
+
const placedAlign = sideAndAlign?.[1];
|
|
62
|
+
return virtualRef ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
63
|
+
Primitive.div,
|
|
64
|
+
{
|
|
65
|
+
"data-radix-popper-side": placedSide,
|
|
66
|
+
"data-radix-popper-align": placedAlign,
|
|
67
|
+
...anchorProps,
|
|
68
|
+
ref: composedRefs
|
|
69
|
+
}
|
|
70
|
+
);
|
|
36
71
|
}
|
|
37
72
|
);
|
|
38
73
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
@@ -58,7 +93,7 @@ var PopperContent = reactExports.forwardRef(
|
|
|
58
93
|
} = props;
|
|
59
94
|
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
60
95
|
const [content, setContent] = reactExports.useState(null);
|
|
61
|
-
const composedRefs = useComposedRefs(forwardedRef,
|
|
96
|
+
const composedRefs = useComposedRefs(forwardedRef, setContent);
|
|
62
97
|
const [arrow$1, setArrow] = reactExports.useState(null);
|
|
63
98
|
const arrowSize = useSize(arrow$1);
|
|
64
99
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
@@ -108,9 +143,27 @@ var PopperContent = reactExports.forwardRef(
|
|
|
108
143
|
}),
|
|
109
144
|
arrow$1 && arrow({ element: arrow$1, padding: arrowPadding }),
|
|
110
145
|
transformOrigin({ arrowWidth, arrowHeight }),
|
|
111
|
-
hideWhenDetached && hide({
|
|
146
|
+
hideWhenDetached && hide({
|
|
147
|
+
strategy: "referenceHidden",
|
|
148
|
+
...detectOverflowOptions,
|
|
149
|
+
// `hide` detects whether the anchor (reference) is clipped, so when
|
|
150
|
+
// no explicit `collisionBoundary` is set we fall back to Floating
|
|
151
|
+
// UI's default clipping ancestors (e.g. a scrollable menu). This
|
|
152
|
+
// lets an occluded submenu hide once its anchor scrolls out of view
|
|
153
|
+
// (#3237). The collision/size middlewares deliberately keep the
|
|
154
|
+
// viewport-based default to avoid clamping content rendered inside
|
|
155
|
+
// transformed or overflow-clipping portal containers.
|
|
156
|
+
boundary: hasExplicitBoundaries ? detectOverflowOptions.boundary : void 0
|
|
157
|
+
})
|
|
112
158
|
]
|
|
113
159
|
});
|
|
160
|
+
const setPlacementState = context.setPlacementState;
|
|
161
|
+
useLayoutEffect2(() => {
|
|
162
|
+
setPlacementState(placement);
|
|
163
|
+
return () => {
|
|
164
|
+
setPlacementState(void 0);
|
|
165
|
+
};
|
|
166
|
+
}, [placement, setPlacementState]);
|
|
114
167
|
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
115
168
|
const handlePlaced = useCallbackRef(onPlaced);
|
|
116
169
|
useLayoutEffect2(() => {
|
|
@@ -136,7 +189,7 @@ var PopperContent = reactExports.forwardRef(
|
|
|
136
189
|
// keep off the page when measuring
|
|
137
190
|
minWidth: "max-content",
|
|
138
191
|
zIndex: contentZIndex,
|
|
139
|
-
|
|
192
|
+
"--radix-popper-transform-origin": [
|
|
140
193
|
middlewareData.transformOrigin?.x,
|
|
141
194
|
middlewareData.transformOrigin?.y
|
|
142
195
|
].join(" "),
|
|
@@ -154,6 +207,7 @@ var PopperContent = reactExports.forwardRef(
|
|
|
154
207
|
{
|
|
155
208
|
scope: __scopePopper,
|
|
156
209
|
placedSide,
|
|
210
|
+
placedAlign,
|
|
157
211
|
onArrowChange: setArrow,
|
|
158
212
|
arrowX,
|
|
159
213
|
arrowY,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "./react.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { r as reactDomExports } from "./react-dom.mjs";
|
|
3
3
|
import { P as Primitive } from "./radix-ui__react-primitive.mjs";
|
|
4
4
|
import { u as useLayoutEffect2 } from "./@radix-ui/react-use-layout-effect+[...].mjs";
|
|
5
5
|
var PORTAL_NAME = "Portal";
|
|
@@ -8,7 +8,7 @@ var Portal = reactExports.forwardRef((props, forwardedRef) => {
|
|
|
8
8
|
const [mounted, setMounted] = reactExports.useState(false);
|
|
9
9
|
useLayoutEffect2(() => setMounted(true), []);
|
|
10
10
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
11
|
-
return container ?
|
|
11
|
+
return container ? reactDomExports.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
12
12
|
});
|
|
13
13
|
Portal.displayName = PORTAL_NAME;
|
|
14
14
|
export {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { r as reactExports } from "./react.mjs";
|
|
2
|
-
import { u as useComposedRefs } from "./radix-ui__react-compose-refs.mjs";
|
|
3
2
|
import { u as useLayoutEffect2 } from "./@radix-ui/react-use-layout-effect+[...].mjs";
|
|
4
3
|
function useStateMachine(initialState, machine) {
|
|
5
4
|
return reactExports.useReducer((state, event) => {
|
|
@@ -11,7 +10,7 @@ var Presence = (props) => {
|
|
|
11
10
|
const { present, children } = props;
|
|
12
11
|
const presence = usePresence(present);
|
|
13
12
|
const child = typeof children === "function" ? children({ present: presence.isPresent }) : reactExports.Children.only(children);
|
|
14
|
-
const ref =
|
|
13
|
+
const ref = useStableComposedRefs(presence.ref, getElementRef(child));
|
|
15
14
|
const forceMount = typeof children === "function";
|
|
16
15
|
return forceMount || presence.isPresent ? reactExports.cloneElement(child, { ref }) : null;
|
|
17
16
|
};
|
|
@@ -21,6 +20,7 @@ function usePresence(present) {
|
|
|
21
20
|
const stylesRef = reactExports.useRef(null);
|
|
22
21
|
const prevPresentRef = reactExports.useRef(present);
|
|
23
22
|
const prevAnimationNameRef = reactExports.useRef("none");
|
|
23
|
+
const mountAnimationNameRef = reactExports.useRef(void 0);
|
|
24
24
|
const initialState = present ? "mounted" : "unmounted";
|
|
25
25
|
const [state, send] = useStateMachine(initialState, {
|
|
26
26
|
mounted: {
|
|
@@ -36,8 +36,12 @@ function usePresence(present) {
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
reactExports.useEffect(() => {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
if (state === "mounted") {
|
|
40
|
+
prevAnimationNameRef.current = mountAnimationNameRef.current ?? getAnimationName(stylesRef.current);
|
|
41
|
+
mountAnimationNameRef.current = void 0;
|
|
42
|
+
} else {
|
|
43
|
+
prevAnimationNameRef.current = "none";
|
|
44
|
+
}
|
|
41
45
|
}, [state]);
|
|
42
46
|
useLayoutEffect2(() => {
|
|
43
47
|
const styles = stylesRef.current;
|
|
@@ -47,6 +51,7 @@ function usePresence(present) {
|
|
|
47
51
|
const prevAnimationName = prevAnimationNameRef.current;
|
|
48
52
|
const currentAnimationName = getAnimationName(styles);
|
|
49
53
|
if (present) {
|
|
54
|
+
mountAnimationNameRef.current = currentAnimationName;
|
|
50
55
|
send("MOUNT");
|
|
51
56
|
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
|
52
57
|
send("UNMOUNT");
|
|
@@ -102,11 +107,51 @@ function usePresence(present) {
|
|
|
102
107
|
return {
|
|
103
108
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
104
109
|
ref: reactExports.useCallback((node2) => {
|
|
105
|
-
|
|
110
|
+
if (node2) {
|
|
111
|
+
const styles = getComputedStyle(node2);
|
|
112
|
+
stylesRef.current = styles;
|
|
113
|
+
mountAnimationNameRef.current = getAnimationName(styles);
|
|
114
|
+
} else {
|
|
115
|
+
stylesRef.current = null;
|
|
116
|
+
}
|
|
106
117
|
setNode(node2);
|
|
107
118
|
}, [])
|
|
108
119
|
};
|
|
109
120
|
}
|
|
121
|
+
function setRef(ref, value) {
|
|
122
|
+
if (typeof ref === "function") {
|
|
123
|
+
return ref(value);
|
|
124
|
+
} else if (ref !== null && ref !== void 0) {
|
|
125
|
+
ref.current = value;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function useStableComposedRefs(...refs) {
|
|
129
|
+
const refsRef = reactExports.useRef(refs);
|
|
130
|
+
refsRef.current = refs;
|
|
131
|
+
return reactExports.useCallback((node) => {
|
|
132
|
+
const currentRefs = refsRef.current;
|
|
133
|
+
let hasCleanup = false;
|
|
134
|
+
const cleanups = currentRefs.map((ref) => {
|
|
135
|
+
const cleanup = setRef(ref, node);
|
|
136
|
+
if (!hasCleanup && typeof cleanup === "function") {
|
|
137
|
+
hasCleanup = true;
|
|
138
|
+
}
|
|
139
|
+
return cleanup;
|
|
140
|
+
});
|
|
141
|
+
if (hasCleanup) {
|
|
142
|
+
return () => {
|
|
143
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
144
|
+
const cleanup = cleanups[i];
|
|
145
|
+
if (typeof cleanup === "function") {
|
|
146
|
+
cleanup();
|
|
147
|
+
} else {
|
|
148
|
+
setRef(currentRefs[i], null);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}, []);
|
|
154
|
+
}
|
|
110
155
|
function getAnimationName(styles) {
|
|
111
156
|
return styles?.animationName || "none";
|
|
112
157
|
}
|
|
@@ -8,6 +8,8 @@ import { P as Primitive } from "./radix-ui__react-primitive.mjs";
|
|
|
8
8
|
import { u as useCallbackRef } from "./@radix-ui/react-use-callback-ref+[...].mjs";
|
|
9
9
|
import { u as useControllableState } from "./@radix-ui/react-use-controllable-state+[...].mjs";
|
|
10
10
|
import { u as useDirection } from "./radix-ui__react-direction.mjs";
|
|
11
|
+
import { u as useLayoutEffect2 } from "./@radix-ui/react-use-layout-effect+[...].mjs";
|
|
12
|
+
import { u as useIsHydrated2 } from "./@radix-ui/react-use-is-hydrated+[...].mjs";
|
|
11
13
|
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
12
14
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
13
15
|
var GROUP_NAME = "RovingFocusGroup";
|
|
@@ -130,12 +132,21 @@ var RovingFocusGroupItem = reactExports.forwardRef(
|
|
|
130
132
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
131
133
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
132
134
|
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
135
|
+
const isHydrated = useIsHydrated2();
|
|
136
|
+
useLayoutEffect2(() => {
|
|
137
|
+
if (!isHydrated || !focusable) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
onFocusableItemAdd();
|
|
141
|
+
return () => onFocusableItemRemove();
|
|
142
|
+
}, [isHydrated, focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
133
143
|
reactExports.useEffect(() => {
|
|
134
|
-
if (focusable) {
|
|
135
|
-
|
|
136
|
-
return () => onFocusableItemRemove();
|
|
144
|
+
if (isHydrated || !focusable) {
|
|
145
|
+
return;
|
|
137
146
|
}
|
|
138
|
-
|
|
147
|
+
onFocusableItemAdd();
|
|
148
|
+
return () => onFocusableItemRemove();
|
|
149
|
+
}, [isHydrated, focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
139
150
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
140
151
|
Collection.ItemSlot,
|
|
141
152
|
{
|