@tonyclaw/agent-inspector 3.0.17 → 3.0.19

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.
Files changed (99) hide show
  1. package/.output/cli.js +1255 -504
  2. package/.output/nitro.json +3 -3
  3. package/.output/public/assets/CompareDrawer-DR3WgrId.js +1 -0
  4. package/.output/public/assets/ProxyViewerContainer-B7PZaz5j.js +127 -0
  5. package/.output/public/assets/ReplayDialog-Bt9jgdvJ.js +1 -0
  6. package/.output/public/assets/RequestAnatomy-C-4630lw.js +1 -0
  7. package/.output/public/assets/ResponseView-f_JrN1iQ.js +3 -0
  8. package/.output/public/assets/StreamingChunkSequence-D8dBm1d8.js +1 -0
  9. package/.output/public/assets/_sessionId-CtoSDXDC.js +1 -0
  10. package/.output/public/assets/index-B-rVc2xu.js +12 -0
  11. package/.output/public/assets/index-B3YOj8-_.css +1 -0
  12. package/.output/public/assets/{index-DPc2wzgW.js → index-BNCySZM-.js} +1 -1
  13. package/.output/public/assets/index-BtCnkWve.js +1 -0
  14. package/.output/public/assets/json-viewer-DT6QQY81.js +1 -0
  15. package/.output/server/_chunks/ssr-renderer.mjs +18 -2
  16. package/.output/server/_libs/@radix-ui/react-dismissable-layer+[...].mjs +165 -31
  17. package/.output/server/_libs/@radix-ui/react-use-callback-ref+[...].mjs +1 -1
  18. package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +2 -2
  19. package/.output/server/_libs/@radix-ui/react-use-is-hydrated+[...].mjs +28 -1
  20. package/.output/server/_libs/mistralai__mistralai.mjs +1 -1
  21. package/.output/server/_libs/modelcontextprotocol__server.mjs +11571 -8127
  22. package/.output/server/_libs/radix-ui__primitive.mjs +1 -1
  23. package/.output/server/_libs/radix-ui__react-collapsible.mjs +1 -1
  24. package/.output/server/_libs/radix-ui__react-collection.mjs +8 -8
  25. package/.output/server/_libs/radix-ui__react-compose-refs.mjs +0 -1
  26. package/.output/server/_libs/radix-ui__react-context.mjs +4 -18
  27. package/.output/server/_libs/radix-ui__react-dialog.mjs +41 -88
  28. package/.output/server/_libs/radix-ui__react-focus-guards.mjs +15 -5
  29. package/.output/server/_libs/radix-ui__react-focus-scope.mjs +6 -2
  30. package/.output/server/_libs/radix-ui__react-id.mjs +3 -3
  31. package/.output/server/_libs/radix-ui__react-popper.mjs +62 -8
  32. package/.output/server/_libs/radix-ui__react-portal.mjs +2 -2
  33. package/.output/server/_libs/radix-ui__react-presence.mjs +50 -5
  34. package/.output/server/_libs/radix-ui__react-roving-focus.mjs +15 -4
  35. package/.output/server/_libs/radix-ui__react-scroll-area.mjs +30 -20
  36. package/.output/server/_libs/radix-ui__react-select.mjs +167 -123
  37. package/.output/server/_libs/radix-ui__react-slot.mjs +74 -41
  38. package/.output/server/_libs/radix-ui__react-tabs.mjs +6 -1
  39. package/.output/server/_libs/radix-ui__react-tooltip.mjs +6 -3
  40. package/.output/server/_libs/react-dom.mjs +13 -15
  41. package/.output/server/_libs/react.mjs +45 -45
  42. package/.output/server/_libs/srvx.mjs +409 -53
  43. package/.output/server/_libs/swr.mjs +10 -2
  44. package/.output/server/_libs/tailwind-merge.mjs +286 -41
  45. package/.output/server/_libs/tanstack__history.mjs +9 -13
  46. package/.output/server/_libs/tanstack__react-router.mjs +788 -1092
  47. package/.output/server/_libs/tanstack__react-store.mjs +1 -1
  48. package/.output/server/_libs/tanstack__react-virtual.mjs +82 -7
  49. package/.output/server/_libs/tanstack__router-core.mjs +1841 -2060
  50. package/.output/server/_libs/tanstack__virtual-core.mjs +116 -45
  51. package/.output/server/_libs/use-sync-external-store.mjs +1 -1
  52. package/.output/server/_libs/zod-to-json-schema.mjs +1 -1
  53. package/.output/server/_libs/zod.mjs +5085 -200
  54. package/.output/server/{_sessionId-DL2JQJwR.mjs → _sessionId-DbRqqzqz.mjs} +30 -32
  55. package/.output/server/_ssr/{CompareDrawer-hPTOTmyU.mjs → CompareDrawer-CVhUSZu1.mjs} +29 -31
  56. package/.output/server/_ssr/{ProxyViewerContainer-k0mFaufl.mjs → ProxyViewerContainer-BNnDYtc5.mjs} +106 -71
  57. package/.output/server/_ssr/{ReplayDialog-t6QdwnZh.mjs → ReplayDialog-DVkGajZU.mjs} +30 -32
  58. package/.output/server/_ssr/{RequestAnatomy-BnvWxyac.mjs → RequestAnatomy-_FIfVjDR.mjs} +29 -31
  59. package/.output/server/_ssr/{ResponseView-BhhozRRl.mjs → ResponseView-Bnv5ejVA.mjs} +29 -31
  60. package/.output/server/_ssr/{StreamingChunkSequence-Dl_laTbX.mjs → StreamingChunkSequence-vtwzxw7A.mjs} +29 -31
  61. package/.output/server/_ssr/empty-plugin-adapters-BFgPZ6_d.mjs +6 -0
  62. package/.output/server/_ssr/{index-D1-t1D8F.mjs → index-DFJbRoyq.mjs} +31 -33
  63. package/.output/server/_ssr/index.mjs +1102 -784
  64. package/.output/server/_ssr/{json-viewer-D5Lh2yBU.mjs → json-viewer-BkweASh3.mjs} +29 -31
  65. package/.output/server/_ssr/{router-DaLFEeWW.mjs → router-gFd3g7WM.mjs} +10 -7
  66. package/.output/server/_tanstack-start-manifest_v-DeLutIlq.mjs +4 -0
  67. package/.output/server/index.mjs +85 -103
  68. package/package.json +17 -8
  69. package/src/components/clients/ClientLogo.tsx +5 -1
  70. package/src/components/proxy-viewer/LogEntry.tsx +54 -19
  71. package/src/components/proxy-viewer/RequestToolsPanel.tsx +1 -0
  72. package/src/components/proxy-viewer/ResponseView.tsx +1 -0
  73. package/src/components/proxy-viewer/StreamingChunkSequence.tsx +1 -0
  74. package/src/components/proxy-viewer/TurnGroup.tsx +1 -0
  75. package/src/components/proxy-viewer/anatomy/SegmentBar.tsx +1 -0
  76. package/src/components/proxy-viewer/formats/anthropic/ContentBlocks.tsx +4 -0
  77. package/src/components/proxy-viewer/formats/anthropic/ResponseView.tsx +1 -0
  78. package/src/components/proxy-viewer/formats/openai/ResponseView.tsx +2 -0
  79. package/src/components/proxy-viewer/logEntryVisibility.ts +22 -0
  80. package/src/components/ui/dialog.tsx +1 -1
  81. package/src/components/ui/json-viewer.tsx +2 -0
  82. package/src/components/ui/select.tsx +1 -1
  83. package/src/router.tsx +9 -0
  84. package/.output/public/assets/CompareDrawer-Lx-WeJNC.js +0 -1
  85. package/.output/public/assets/ProxyViewerContainer-BNehwMI0.js +0 -106
  86. package/.output/public/assets/ReplayDialog-CADaXFPE.js +0 -1
  87. package/.output/public/assets/RequestAnatomy-CGoL8ACh.js +0 -1
  88. package/.output/public/assets/ResponseView-BSwM1dCH.js +0 -3
  89. package/.output/public/assets/StreamingChunkSequence-qhWtSx3D.js +0 -1
  90. package/.output/public/assets/_sessionId-2uq_HB8p.js +0 -1
  91. package/.output/public/assets/index-BHXN1Fsx.css +0 -1
  92. package/.output/public/assets/index-T0u1foYL.js +0 -1
  93. package/.output/public/assets/json-viewer-uIwLntt-.js +0 -1
  94. package/.output/public/assets/main-DuFBHsus.js +0 -18
  95. package/.output/server/_libs/@radix-ui/react-use-escape-keydown+[...].mjs +0 -17
  96. package/.output/server/_libs/cfworker__json-schema.mjs +0 -1
  97. package/.output/server/_libs/tiny-invariant.mjs +0 -12
  98. package/.output/server/_libs/tiny-warning.mjs +0 -5
  99. package/.output/server/_tanstack-start-manifest_v-DsSiD2gY.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 { a as React, j as jsxRuntimeExports } from "./react.mjs";
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 = React.useRef(null);
15
- const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
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 = React.forwardRef(
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 = React.forwardRef(
33
+ const CollectionItemSlot = reactExports.forwardRef(
34
34
  (props, forwardedRef) => {
35
35
  const { scope, children, ...itemData } = props;
36
- const ref = React.useRef(null);
36
+ const ref = reactExports.useRef(null);
37
37
  const composedRefs = useComposedRefs(forwardedRef, ref);
38
38
  const context = useCollectionContext(ITEM_SLOT_NAME, scope);
39
- React.useEffect(() => {
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 = React.useCallback(() => {
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}]`));
@@ -34,6 +34,5 @@ function useComposedRefs(...refs) {
34
34
  return reactExports.useCallback(composeRefs(...refs), refs);
35
35
  }
36
36
  export {
37
- composeRefs as c,
38
37
  useComposedRefs as u
39
38
  };
@@ -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, a as createContext2 } from "./radix-ui__react-context.mjs";
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$1 } from "./radix-ui__react-portal.mjs";
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$1, { asChild: true, container, children: child }) })) });
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: forwardedRef,
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: true,
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.jsxs(jsxRuntimeExports.Fragment, { children: [
208
- /* @__PURE__ */ jsxRuntimeExports.jsx(
209
- FocusScope,
210
- {
211
- asChild: true,
212
- loop: true,
213
- trapped: trapFocus,
214
- onMountAutoFocus: onOpenAutoFocus,
215
- onUnmountAutoFocus: onCloseAutoFocus,
216
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
217
- DismissableLayer,
218
- {
219
- role: "dialog",
220
- id: context.contentId,
221
- "aria-describedby": context.descriptionId,
222
- "aria-labelledby": context.titleId,
223
- "data-state": getState(context.open),
224
- ...contentProps,
225
- ref: composedRefs,
226
- onDismiss: () => context.onOpenChange(false)
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
- Content as C,
320
- Description as D,
321
- Overlay as O,
322
- Portal as P,
323
- Root as R,
324
- Title as T,
325
- Close as a,
326
- Trigger as b
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
- const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
6
- document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
7
- document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
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
- document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
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, (node) => setContainer(node));
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
- if (!isHidden(element, { upTo: container })) return element;
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, R as React } from "./react.mjs";
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 = React[" useId ".trim().toString()] || (() => void 0);
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 deterministicId || (id ? `radix-${id}` : "");
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
- return /* @__PURE__ */ jsxRuntimeExports.jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
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 composedRefs = useComposedRefs(forwardedRef, ref);
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?.current || ref.current;
54
+ anchorRef.current = virtualRef.current;
31
55
  if (previousAnchor !== anchorRef.current) {
32
- context.onAnchorChange(anchorRef.current);
56
+ onAnchorChange(anchorRef.current);
33
57
  }
34
58
  });
35
- return virtualRef ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
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, (node) => setContent(node));
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({ strategy: "referenceHidden", ...detectOverflowOptions })
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
- ["--radix-popper-transform-origin"]: [
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 { a as ReactDOM } from "./react-dom.mjs";
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 ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
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 = useComposedRefs(presence.ref, getElementRef(child));
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
- const currentAnimationName = getAnimationName(stylesRef.current);
40
- prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
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
- stylesRef.current = node2 ? getComputedStyle(node2) : null;
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
- onFocusableItemAdd();
136
- return () => onFocusableItemRemove();
144
+ if (isHydrated || !focusable) {
145
+ return;
137
146
  }
138
- }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
147
+ onFocusableItemAdd();
148
+ return () => onFocusableItemRemove();
149
+ }, [isHydrated, focusable, onFocusableItemAdd, onFocusableItemRemove]);
139
150
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
140
151
  Collection.ItemSlot,
141
152
  {