@tonyclaw/llm-inspector 1.6.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/.output/nitro.json +17 -0
- package/.output/public/assets/alibaba-TTwafVwX.svg +1 -0
- package/.output/public/assets/index-B3RwBPLW.css +1 -0
- package/.output/public/assets/index-s4lwsWvq.js +97 -0
- package/.output/public/assets/main-Cp8AM0Pa.js +17 -0
- package/.output/public/assets/minimax-BPMzvuL-.jpeg +0 -0
- package/.output/public/assets/qwen-CONDcHqt.png +0 -0
- package/.output/public/assets/zhipuai-BPNAnxo-.svg +219 -0
- package/.output/server/_chunks/ssr-renderer.mjs +17 -0
- package/.output/server/_libs/@radix-ui/react-accessible-icon+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-dismissable-layer+[...].mjs +210 -0
- package/.output/server/_libs/@radix-ui/react-navigation-menu+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-one-time-password-field+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-password-toggle-field+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-use-callback-ref+[...].mjs +11 -0
- package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +69 -0
- package/.output/server/_libs/@radix-ui/react-use-effect-event+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-use-escape-keydown+[...].mjs +17 -0
- package/.output/server/_libs/@radix-ui/react-use-is-hydrated+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-use-layout-effect+[...].mjs +6 -0
- package/.output/server/_libs/@radix-ui/react-visually-hidden+[...].mjs +34 -0
- package/.output/server/_libs/ajv-formats.mjs +330 -0
- package/.output/server/_libs/ajv.mjs +11444 -0
- package/.output/server/_libs/aria-hidden.mjs +122 -0
- package/.output/server/_libs/atomically.mjs +152 -0
- package/.output/server/_libs/bail.mjs +8 -0
- package/.output/server/_libs/character-entities.mjs +2130 -0
- package/.output/server/_libs/class-variance-authority.mjs +44 -0
- package/.output/server/_libs/clsx.mjs +16 -0
- package/.output/server/_libs/comma-separated-tokens.mjs +10 -0
- package/.output/server/_libs/conf.mjs +635 -0
- package/.output/server/_libs/cookie-es.mjs +58 -0
- package/.output/server/_libs/core-util-is.mjs +75 -0
- package/.output/server/_libs/croner.mjs +1 -0
- package/.output/server/_libs/crossws.mjs +1 -0
- package/.output/server/_libs/debounce-fn.mjs +69 -0
- package/.output/server/_libs/decode-named-character-reference+[...].mjs +8 -0
- package/.output/server/_libs/detect-node-es.mjs +1 -0
- package/.output/server/_libs/devlop.mjs +8 -0
- package/.output/server/_libs/dot-prop.mjs +265 -0
- package/.output/server/_libs/env-paths.mjs +57 -0
- package/.output/server/_libs/estree-util-is-identifier-name.mjs +11 -0
- package/.output/server/_libs/extend.mjs +97 -0
- package/.output/server/_libs/fast-deep-equal.mjs +38 -0
- package/.output/server/_libs/fast-uri.mjs +812 -0
- package/.output/server/_libs/floating-ui__core.mjs +725 -0
- package/.output/server/_libs/floating-ui__dom.mjs +622 -0
- package/.output/server/_libs/floating-ui__react-dom.mjs +292 -0
- package/.output/server/_libs/floating-ui__utils.mjs +320 -0
- package/.output/server/_libs/get-nonce.mjs +9 -0
- package/.output/server/_libs/h3-v2.mjs +276 -0
- package/.output/server/_libs/h3.mjs +400 -0
- package/.output/server/_libs/hast-util-to-jsx-runtime.mjs +388 -0
- package/.output/server/_libs/hast-util-whitespace.mjs +10 -0
- package/.output/server/_libs/hookable.mjs +1 -0
- package/.output/server/_libs/html-url-attributes.mjs +26 -0
- package/.output/server/_libs/immediate.mjs +74 -0
- package/.output/server/_libs/inherits.mjs +50 -0
- package/.output/server/_libs/inline-style-parser.mjs +142 -0
- package/.output/server/_libs/is-plain-obj.mjs +10 -0
- package/.output/server/_libs/isarray.mjs +14 -0
- package/.output/server/_libs/isbot.mjs +20 -0
- package/.output/server/_libs/json-schema-traverse.mjs +180 -0
- package/.output/server/_libs/jszip.mjs +3049 -0
- package/.output/server/_libs/lie.mjs +273 -0
- package/.output/server/_libs/lucide-react.mjs +368 -0
- package/.output/server/_libs/mdast-util-from-markdown.mjs +717 -0
- package/.output/server/_libs/mdast-util-to-hast.mjs +710 -0
- package/.output/server/_libs/mdast-util-to-string.mjs +38 -0
- package/.output/server/_libs/micromark-core-commonmark.mjs +2259 -0
- package/.output/server/_libs/micromark-factory-destination.mjs +94 -0
- package/.output/server/_libs/micromark-factory-label.mjs +63 -0
- package/.output/server/_libs/micromark-factory-space.mjs +24 -0
- package/.output/server/_libs/micromark-factory-title.mjs +65 -0
- package/.output/server/_libs/micromark-factory-whitespace.mjs +22 -0
- package/.output/server/_libs/micromark-util-character.mjs +44 -0
- package/.output/server/_libs/micromark-util-chunked.mjs +36 -0
- package/.output/server/_libs/micromark-util-classify-character+[...].mjs +12 -0
- package/.output/server/_libs/micromark-util-combine-extensions+[...].mjs +41 -0
- package/.output/server/_libs/micromark-util-decode-numeric-character-reference+[...].mjs +19 -0
- package/.output/server/_libs/micromark-util-decode-string.mjs +21 -0
- package/.output/server/_libs/micromark-util-encode.mjs +1 -0
- package/.output/server/_libs/micromark-util-html-tag-name.mjs +69 -0
- package/.output/server/_libs/micromark-util-normalize-identifier+[...].mjs +6 -0
- package/.output/server/_libs/micromark-util-resolve-all.mjs +15 -0
- package/.output/server/_libs/micromark-util-sanitize-uri.mjs +41 -0
- package/.output/server/_libs/micromark-util-subtokenize.mjs +346 -0
- package/.output/server/_libs/micromark.mjs +906 -0
- package/.output/server/_libs/mimic-function.mjs +47 -0
- package/.output/server/_libs/ohash.mjs +1 -0
- package/.output/server/_libs/pako.mjs +4223 -0
- package/.output/server/_libs/process-nextick-args.mjs +48 -0
- package/.output/server/_libs/property-information.mjs +1209 -0
- package/.output/server/_libs/radix-ui.mjs +1 -0
- package/.output/server/_libs/radix-ui__number.mjs +6 -0
- package/.output/server/_libs/radix-ui__primitive.mjs +11 -0
- package/.output/server/_libs/radix-ui__react-accordion.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-alert-dialog.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-arrow.mjs +23 -0
- package/.output/server/_libs/radix-ui__react-aspect-ratio.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-avatar.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-checkbox.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-collapsible.mjs +144 -0
- package/.output/server/_libs/radix-ui__react-collection.mjs +69 -0
- package/.output/server/_libs/radix-ui__react-compose-refs.mjs +39 -0
- package/.output/server/_libs/radix-ui__react-context-menu.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-context.mjs +78 -0
- package/.output/server/_libs/radix-ui__react-dialog.mjs +325 -0
- package/.output/server/_libs/radix-ui__react-direction.mjs +9 -0
- package/.output/server/_libs/radix-ui__react-dropdown-menu.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-focus-guards.mjs +29 -0
- package/.output/server/_libs/radix-ui__react-focus-scope.mjs +206 -0
- package/.output/server/_libs/radix-ui__react-form.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-hover-card.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-id.mjs +14 -0
- package/.output/server/_libs/radix-ui__react-label.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-menu.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-menubar.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-popover.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-popper.mjs +286 -0
- package/.output/server/_libs/radix-ui__react-portal.mjs +16 -0
- package/.output/server/_libs/radix-ui__react-presence.mjs +128 -0
- package/.output/server/_libs/radix-ui__react-primitive.mjs +42 -0
- package/.output/server/_libs/radix-ui__react-progress.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-radio-group.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-roving-focus.mjs +224 -0
- package/.output/server/_libs/radix-ui__react-scroll-area.mjs +721 -0
- package/.output/server/_libs/radix-ui__react-select.mjs +1163 -0
- package/.output/server/_libs/radix-ui__react-separator.mjs +28 -0
- package/.output/server/_libs/radix-ui__react-slider.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-slot.mjs +99 -0
- package/.output/server/_libs/radix-ui__react-switch.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-tabs.mjs +189 -0
- package/.output/server/_libs/radix-ui__react-toast.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-toggle-group.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-toggle.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-toolbar.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-tooltip.mjs +495 -0
- package/.output/server/_libs/radix-ui__react-use-previous.mjs +14 -0
- package/.output/server/_libs/radix-ui__react-use-size.mjs +39 -0
- package/.output/server/_libs/react-dom.mjs +9935 -0
- package/.output/server/_libs/react-markdown.mjs +147 -0
- package/.output/server/_libs/react-remove-scroll-bar.mjs +82 -0
- package/.output/server/_libs/react-remove-scroll.mjs +328 -0
- package/.output/server/_libs/react-style-singleton.mjs +69 -0
- package/.output/server/_libs/react.mjs +515 -0
- package/.output/server/_libs/readable-stream.mjs +1518 -0
- package/.output/server/_libs/remark-parse.mjs +19 -0
- package/.output/server/_libs/remark-rehype.mjs +21 -0
- package/.output/server/_libs/rou3.mjs +8 -0
- package/.output/server/_libs/safe-buffer.mjs +64 -0
- package/.output/server/_libs/semver.mjs +1984 -0
- package/.output/server/_libs/seroval-plugins.mjs +58 -0
- package/.output/server/_libs/seroval.mjs +1765 -0
- package/.output/server/_libs/setimmediate.mjs +1 -0
- package/.output/server/_libs/space-separated-tokens.mjs +6 -0
- package/.output/server/_libs/srvx.mjs +334 -0
- package/.output/server/_libs/stubborn-fs.mjs +91 -0
- package/.output/server/_libs/stubborn-utils.mjs +66 -0
- package/.output/server/_libs/style-to-js.mjs +72 -0
- package/.output/server/_libs/style-to-object.mjs +38 -0
- package/.output/server/_libs/tailwind-merge.mjs +3010 -0
- package/.output/server/_libs/tanstack__history.mjs +217 -0
- package/.output/server/_libs/tanstack__react-router.mjs +1480 -0
- package/.output/server/_libs/tanstack__react-store.mjs +1 -0
- package/.output/server/_libs/tanstack__react-virtual.mjs +44 -0
- package/.output/server/_libs/tanstack__router-core.mjs +4827 -0
- package/.output/server/_libs/tanstack__store.mjs +1 -0
- package/.output/server/_libs/tanstack__virtual-core.mjs +1225 -0
- package/.output/server/_libs/tiny-invariant.mjs +12 -0
- package/.output/server/_libs/tiny-warning.mjs +5 -0
- package/.output/server/_libs/trim-lines.mjs +41 -0
- package/.output/server/_libs/trough.mjs +85 -0
- package/.output/server/_libs/tslib.mjs +576 -0
- package/.output/server/_libs/ufo.mjs +54 -0
- package/.output/server/_libs/uint8array-extras.mjs +69 -0
- package/.output/server/_libs/unctx.mjs +1 -0
- package/.output/server/_libs/ungap__structured-clone.mjs +212 -0
- package/.output/server/_libs/unified.mjs +661 -0
- package/.output/server/_libs/unist-util-is.mjs +100 -0
- package/.output/server/_libs/unist-util-position.mjs +27 -0
- package/.output/server/_libs/unist-util-stringify-position.mjs +27 -0
- package/.output/server/_libs/unist-util-visit-parents.mjs +82 -0
- package/.output/server/_libs/unist-util-visit.mjs +24 -0
- package/.output/server/_libs/unstorage.mjs +1 -0
- package/.output/server/_libs/use-callback-ref.mjs +66 -0
- package/.output/server/_libs/use-sidecar.mjs +106 -0
- package/.output/server/_libs/use-sync-external-store.mjs +1 -0
- package/.output/server/_libs/util-deprecate.mjs +12 -0
- package/.output/server/_libs/vfile-message.mjs +138 -0
- package/.output/server/_libs/vfile.mjs +467 -0
- package/.output/server/_libs/when-exit.mjs +53 -0
- package/.output/server/_libs/zod.mjs +4460 -0
- package/.output/server/_ssr/index-ByCLZu7J.mjs +3061 -0
- package/.output/server/_ssr/index.mjs +1176 -0
- package/.output/server/_ssr/router-Bq_mxeNz.mjs +2872 -0
- package/.output/server/_ssr/start-HYkvq4Ni.mjs +4 -0
- package/.output/server/_tanstack-start-manifest_v-C4E0e9my.mjs +4 -0
- package/.output/server/index.mjs +393 -0
- package/README.md +196 -0
- package/package.json +91 -0
- package/src/assets/logos/alibaba.svg +1 -0
- package/src/assets/logos/anthropic.svg +1 -0
- package/src/assets/logos/deepseek.svg +1 -0
- package/src/assets/logos/minimax.jpeg +0 -0
- package/src/assets/logos/openai.svg +1 -0
- package/src/assets/logos/qwen.png +0 -0
- package/src/assets/logos/zhipuai.svg +219 -0
- package/src/cli.ts +68 -0
- package/src/components/ProxyViewer.tsx +325 -0
- package/src/components/ProxyViewerContainer.tsx +211 -0
- package/src/components/providers/ProviderCard.tsx +186 -0
- package/src/components/providers/ProviderForm.tsx +259 -0
- package/src/components/providers/ProviderLogo.tsx +111 -0
- package/src/components/providers/ProvidersPanel.tsx +259 -0
- package/src/components/providers/SettingsDialog.tsx +39 -0
- package/src/components/proxy-viewer/ConversationGroup.tsx +68 -0
- package/src/components/proxy-viewer/ConversationHeader.tsx +141 -0
- package/src/components/proxy-viewer/LogEntry.tsx +225 -0
- package/src/components/proxy-viewer/LogEntryHeader.tsx +250 -0
- package/src/components/proxy-viewer/ReplayDialog.tsx +208 -0
- package/src/components/proxy-viewer/ResponseView.tsx +161 -0
- package/src/components/proxy-viewer/StreamingChunkSequence.tsx +171 -0
- package/src/components/proxy-viewer/formats/anthropic/ContentBlocks.tsx +139 -0
- package/src/components/proxy-viewer/formats/anthropic/ResponseView.tsx +64 -0
- package/src/components/proxy-viewer/formats/index.tsx +24 -0
- package/src/components/proxy-viewer/formats/openai/ResponseView.tsx +80 -0
- package/src/components/proxy-viewer/index.ts +8 -0
- package/src/components/ui/badge.tsx +47 -0
- package/src/components/ui/button.tsx +47 -0
- package/src/components/ui/collapsible.tsx +21 -0
- package/src/components/ui/dialog.tsx +129 -0
- package/src/components/ui/json-viewer.tsx +464 -0
- package/src/components/ui/scroll-area.tsx +54 -0
- package/src/components/ui/select.tsx +178 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/tabs.tsx +88 -0
- package/src/components/ui/tooltip.tsx +51 -0
- package/src/index.css +11 -0
- package/src/lib/export-logs.ts +51 -0
- package/src/lib/utils.ts +22 -0
- package/src/proxy/chunkStorage.ts +118 -0
- package/src/proxy/constants.ts +36 -0
- package/src/proxy/formats/anthropic/anthropicProvider.ts +75 -0
- package/src/proxy/formats/anthropic/handler.ts +74 -0
- package/src/proxy/formats/anthropic/index.ts +14 -0
- package/src/proxy/formats/anthropic/register.ts +4 -0
- package/src/proxy/formats/anthropic/schemas.ts +217 -0
- package/src/proxy/formats/anthropic/stream.ts +167 -0
- package/src/proxy/formats/handler.ts +46 -0
- package/src/proxy/formats/index.ts +12 -0
- package/src/proxy/formats/jsonSchema.ts +24 -0
- package/src/proxy/formats/openai/alibabaProvider.ts +38 -0
- package/src/proxy/formats/openai/handler.ts +70 -0
- package/src/proxy/formats/openai/index.ts +25 -0
- package/src/proxy/formats/openai/provider.ts +50 -0
- package/src/proxy/formats/openai/register.ts +4 -0
- package/src/proxy/formats/openai/schemas.ts +150 -0
- package/src/proxy/formats/openai/stream.ts +153 -0
- package/src/proxy/formats/protocol.ts +50 -0
- package/src/proxy/formats/providerRegistry.ts +51 -0
- package/src/proxy/formats/providers/index.ts +3 -0
- package/src/proxy/formats/registry.ts +61 -0
- package/src/proxy/handler.ts +389 -0
- package/src/proxy/logIndex.ts +187 -0
- package/src/proxy/logger.ts +99 -0
- package/src/proxy/providers.ts +234 -0
- package/src/proxy/schemas.ts +160 -0
- package/src/proxy/socketTracker.ts +158 -0
- package/src/proxy/store.ts +386 -0
- package/src/router.tsx +16 -0
- package/src/routes/__root.tsx +38 -0
- package/src/routes/api/config.paths.ts +14 -0
- package/src/routes/api/health.ts +11 -0
- package/src/routes/api/logs.$id.chunks.ts +36 -0
- package/src/routes/api/logs.$id.replay.ts +262 -0
- package/src/routes/api/logs.$id.ts +22 -0
- package/src/routes/api/logs.stream.ts +64 -0
- package/src/routes/api/logs.ts +30 -0
- package/src/routes/api/models.ts +10 -0
- package/src/routes/api/providers.$providerId.ts +45 -0
- package/src/routes/api/providers.ts +37 -0
- package/src/routes/api/sessions.ts +10 -0
- package/src/routes/index.tsx +6 -0
- package/src/routes/proxy/$.ts +15 -0
- package/styles/globals.css +121 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { r as reactExports, j as jsxRuntimeExports } from "./react.mjs";
|
|
2
|
+
import { u as useFloating, o as offset, s as shift, f as flip, a as size, b as arrow, h as hide, l as limitShift } from "./floating-ui__react-dom.mjs";
|
|
3
|
+
import { R as Root } from "./radix-ui__react-arrow.mjs";
|
|
4
|
+
import { u as useComposedRefs } from "./radix-ui__react-compose-refs.mjs";
|
|
5
|
+
import { c as createContextScope } from "./radix-ui__react-context.mjs";
|
|
6
|
+
import { P as Primitive } from "./radix-ui__react-primitive.mjs";
|
|
7
|
+
import { u as useCallbackRef } from "./@radix-ui/react-use-callback-ref+[...].mjs";
|
|
8
|
+
import { u as useLayoutEffect2 } from "./@radix-ui/react-use-layout-effect+[...].mjs";
|
|
9
|
+
import { u as useSize } from "./radix-ui__react-use-size.mjs";
|
|
10
|
+
import { d as autoUpdate } from "./floating-ui__dom.mjs";
|
|
11
|
+
var POPPER_NAME = "Popper";
|
|
12
|
+
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
13
|
+
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
14
|
+
var Popper = (props) => {
|
|
15
|
+
const { __scopePopper, children } = props;
|
|
16
|
+
const [anchor, setAnchor] = reactExports.useState(null);
|
|
17
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
18
|
+
};
|
|
19
|
+
Popper.displayName = POPPER_NAME;
|
|
20
|
+
var ANCHOR_NAME = "PopperAnchor";
|
|
21
|
+
var PopperAnchor = reactExports.forwardRef(
|
|
22
|
+
(props, forwardedRef) => {
|
|
23
|
+
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
24
|
+
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
25
|
+
const ref = reactExports.useRef(null);
|
|
26
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
27
|
+
const anchorRef = reactExports.useRef(null);
|
|
28
|
+
reactExports.useEffect(() => {
|
|
29
|
+
const previousAnchor = anchorRef.current;
|
|
30
|
+
anchorRef.current = virtualRef?.current || ref.current;
|
|
31
|
+
if (previousAnchor !== anchorRef.current) {
|
|
32
|
+
context.onAnchorChange(anchorRef.current);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return virtualRef ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
PopperAnchor.displayName = ANCHOR_NAME;
|
|
39
|
+
var CONTENT_NAME = "PopperContent";
|
|
40
|
+
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
41
|
+
var PopperContent = reactExports.forwardRef(
|
|
42
|
+
(props, forwardedRef) => {
|
|
43
|
+
const {
|
|
44
|
+
__scopePopper,
|
|
45
|
+
side = "bottom",
|
|
46
|
+
sideOffset = 0,
|
|
47
|
+
align = "center",
|
|
48
|
+
alignOffset = 0,
|
|
49
|
+
arrowPadding = 0,
|
|
50
|
+
avoidCollisions = true,
|
|
51
|
+
collisionBoundary = [],
|
|
52
|
+
collisionPadding: collisionPaddingProp = 0,
|
|
53
|
+
sticky = "partial",
|
|
54
|
+
hideWhenDetached = false,
|
|
55
|
+
updatePositionStrategy = "optimized",
|
|
56
|
+
onPlaced,
|
|
57
|
+
...contentProps
|
|
58
|
+
} = props;
|
|
59
|
+
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
60
|
+
const [content, setContent] = reactExports.useState(null);
|
|
61
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
62
|
+
const [arrow$1, setArrow] = reactExports.useState(null);
|
|
63
|
+
const arrowSize = useSize(arrow$1);
|
|
64
|
+
const arrowWidth = arrowSize?.width ?? 0;
|
|
65
|
+
const arrowHeight = arrowSize?.height ?? 0;
|
|
66
|
+
const desiredPlacement = side + (align !== "center" ? "-" + align : "");
|
|
67
|
+
const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
|
|
68
|
+
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
|
|
69
|
+
const hasExplicitBoundaries = boundary.length > 0;
|
|
70
|
+
const detectOverflowOptions = {
|
|
71
|
+
padding: collisionPadding,
|
|
72
|
+
boundary: boundary.filter(isNotNull),
|
|
73
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
74
|
+
altBoundary: hasExplicitBoundaries
|
|
75
|
+
};
|
|
76
|
+
const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
|
|
77
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
78
|
+
strategy: "fixed",
|
|
79
|
+
placement: desiredPlacement,
|
|
80
|
+
whileElementsMounted: (...args) => {
|
|
81
|
+
const cleanup = autoUpdate(...args, {
|
|
82
|
+
animationFrame: updatePositionStrategy === "always"
|
|
83
|
+
});
|
|
84
|
+
return cleanup;
|
|
85
|
+
},
|
|
86
|
+
elements: {
|
|
87
|
+
reference: context.anchor
|
|
88
|
+
},
|
|
89
|
+
middleware: [
|
|
90
|
+
offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
|
|
91
|
+
avoidCollisions && shift({
|
|
92
|
+
mainAxis: true,
|
|
93
|
+
crossAxis: false,
|
|
94
|
+
limiter: sticky === "partial" ? limitShift() : void 0,
|
|
95
|
+
...detectOverflowOptions
|
|
96
|
+
}),
|
|
97
|
+
avoidCollisions && flip({ ...detectOverflowOptions }),
|
|
98
|
+
size({
|
|
99
|
+
...detectOverflowOptions,
|
|
100
|
+
apply: ({ elements, rects, availableWidth, availableHeight }) => {
|
|
101
|
+
const { width: anchorWidth, height: anchorHeight } = rects.reference;
|
|
102
|
+
const contentStyle = elements.floating.style;
|
|
103
|
+
contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
|
|
104
|
+
contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
|
|
105
|
+
contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
|
|
106
|
+
contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
|
|
107
|
+
}
|
|
108
|
+
}),
|
|
109
|
+
arrow$1 && arrow({ element: arrow$1, padding: arrowPadding }),
|
|
110
|
+
transformOrigin({ arrowWidth, arrowHeight }),
|
|
111
|
+
hideWhenDetached && hide({ strategy: "referenceHidden", ...detectOverflowOptions })
|
|
112
|
+
]
|
|
113
|
+
});
|
|
114
|
+
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
115
|
+
const handlePlaced = useCallbackRef(onPlaced);
|
|
116
|
+
useLayoutEffect2(() => {
|
|
117
|
+
if (isPositioned) {
|
|
118
|
+
handlePlaced?.();
|
|
119
|
+
}
|
|
120
|
+
}, [isPositioned, handlePlaced]);
|
|
121
|
+
const arrowX = middlewareData.arrow?.x;
|
|
122
|
+
const arrowY = middlewareData.arrow?.y;
|
|
123
|
+
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
124
|
+
const [contentZIndex, setContentZIndex] = reactExports.useState();
|
|
125
|
+
useLayoutEffect2(() => {
|
|
126
|
+
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
127
|
+
}, [content]);
|
|
128
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
ref: refs.setFloating,
|
|
132
|
+
"data-radix-popper-content-wrapper": "",
|
|
133
|
+
style: {
|
|
134
|
+
...floatingStyles,
|
|
135
|
+
transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
|
|
136
|
+
// keep off the page when measuring
|
|
137
|
+
minWidth: "max-content",
|
|
138
|
+
zIndex: contentZIndex,
|
|
139
|
+
["--radix-popper-transform-origin"]: [
|
|
140
|
+
middlewareData.transformOrigin?.x,
|
|
141
|
+
middlewareData.transformOrigin?.y
|
|
142
|
+
].join(" "),
|
|
143
|
+
// hide the content if using the hide middleware and should be hidden
|
|
144
|
+
// set visibility to hidden and disable pointer events so the UI behaves
|
|
145
|
+
// as if the PopperContent isn't there at all
|
|
146
|
+
...middlewareData.hide?.referenceHidden && {
|
|
147
|
+
visibility: "hidden",
|
|
148
|
+
pointerEvents: "none"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
dir: props.dir,
|
|
152
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
153
|
+
PopperContentProvider,
|
|
154
|
+
{
|
|
155
|
+
scope: __scopePopper,
|
|
156
|
+
placedSide,
|
|
157
|
+
onArrowChange: setArrow,
|
|
158
|
+
arrowX,
|
|
159
|
+
arrowY,
|
|
160
|
+
shouldHideArrow: cannotCenterArrow,
|
|
161
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
162
|
+
Primitive.div,
|
|
163
|
+
{
|
|
164
|
+
"data-side": placedSide,
|
|
165
|
+
"data-align": placedAlign,
|
|
166
|
+
...contentProps,
|
|
167
|
+
ref: composedRefs,
|
|
168
|
+
style: {
|
|
169
|
+
...contentProps.style,
|
|
170
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
171
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
172
|
+
animation: !isPositioned ? "none" : void 0
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
PopperContent.displayName = CONTENT_NAME;
|
|
183
|
+
var ARROW_NAME = "PopperArrow";
|
|
184
|
+
var OPPOSITE_SIDE = {
|
|
185
|
+
top: "bottom",
|
|
186
|
+
right: "left",
|
|
187
|
+
bottom: "top",
|
|
188
|
+
left: "right"
|
|
189
|
+
};
|
|
190
|
+
var PopperArrow = reactExports.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
191
|
+
const { __scopePopper, ...arrowProps } = props;
|
|
192
|
+
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
193
|
+
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
194
|
+
return (
|
|
195
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
196
|
+
// doesn't report size as we'd expect on SVG elements.
|
|
197
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
198
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
199
|
+
"span",
|
|
200
|
+
{
|
|
201
|
+
ref: contentContext.onArrowChange,
|
|
202
|
+
style: {
|
|
203
|
+
position: "absolute",
|
|
204
|
+
left: contentContext.arrowX,
|
|
205
|
+
top: contentContext.arrowY,
|
|
206
|
+
[baseSide]: 0,
|
|
207
|
+
transformOrigin: {
|
|
208
|
+
top: "",
|
|
209
|
+
right: "0 0",
|
|
210
|
+
bottom: "center 0",
|
|
211
|
+
left: "100% 0"
|
|
212
|
+
}[contentContext.placedSide],
|
|
213
|
+
transform: {
|
|
214
|
+
top: "translateY(100%)",
|
|
215
|
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
216
|
+
bottom: `rotate(180deg)`,
|
|
217
|
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
218
|
+
}[contentContext.placedSide],
|
|
219
|
+
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
220
|
+
},
|
|
221
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
222
|
+
Root,
|
|
223
|
+
{
|
|
224
|
+
...arrowProps,
|
|
225
|
+
ref: forwardedRef,
|
|
226
|
+
style: {
|
|
227
|
+
...arrowProps.style,
|
|
228
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
|
229
|
+
display: "block"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
)
|
|
233
|
+
}
|
|
234
|
+
)
|
|
235
|
+
);
|
|
236
|
+
});
|
|
237
|
+
PopperArrow.displayName = ARROW_NAME;
|
|
238
|
+
function isNotNull(value) {
|
|
239
|
+
return value !== null;
|
|
240
|
+
}
|
|
241
|
+
var transformOrigin = (options) => ({
|
|
242
|
+
name: "transformOrigin",
|
|
243
|
+
options,
|
|
244
|
+
fn(data) {
|
|
245
|
+
const { placement, rects, middlewareData } = data;
|
|
246
|
+
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
247
|
+
const isArrowHidden = cannotCenterArrow;
|
|
248
|
+
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
249
|
+
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
250
|
+
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
251
|
+
const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
|
|
252
|
+
const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
|
|
253
|
+
const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
|
|
254
|
+
let x = "";
|
|
255
|
+
let y = "";
|
|
256
|
+
if (placedSide === "bottom") {
|
|
257
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
258
|
+
y = `${-arrowHeight}px`;
|
|
259
|
+
} else if (placedSide === "top") {
|
|
260
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
261
|
+
y = `${rects.floating.height + arrowHeight}px`;
|
|
262
|
+
} else if (placedSide === "right") {
|
|
263
|
+
x = `${-arrowHeight}px`;
|
|
264
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
265
|
+
} else if (placedSide === "left") {
|
|
266
|
+
x = `${rects.floating.width + arrowHeight}px`;
|
|
267
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
268
|
+
}
|
|
269
|
+
return { data: { x, y } };
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
function getSideAndAlignFromPlacement(placement) {
|
|
273
|
+
const [side, align = "center"] = placement.split("-");
|
|
274
|
+
return [side, align];
|
|
275
|
+
}
|
|
276
|
+
var Root2 = Popper;
|
|
277
|
+
var Anchor = PopperAnchor;
|
|
278
|
+
var Content = PopperContent;
|
|
279
|
+
var Arrow = PopperArrow;
|
|
280
|
+
export {
|
|
281
|
+
Anchor as A,
|
|
282
|
+
Content as C,
|
|
283
|
+
Root2 as R,
|
|
284
|
+
Arrow as a,
|
|
285
|
+
createPopperScope as c
|
|
286
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { r as reactExports, j as jsxRuntimeExports } from "./react.mjs";
|
|
2
|
+
import { a as ReactDOM } from "./react-dom.mjs";
|
|
3
|
+
import { P as Primitive } from "./radix-ui__react-primitive.mjs";
|
|
4
|
+
import { u as useLayoutEffect2 } from "./@radix-ui/react-use-layout-effect+[...].mjs";
|
|
5
|
+
var PORTAL_NAME = "Portal";
|
|
6
|
+
var Portal = reactExports.forwardRef((props, forwardedRef) => {
|
|
7
|
+
const { container: containerProp, ...portalProps } = props;
|
|
8
|
+
const [mounted, setMounted] = reactExports.useState(false);
|
|
9
|
+
useLayoutEffect2(() => setMounted(true), []);
|
|
10
|
+
const container = containerProp || mounted && globalThis?.document?.body;
|
|
11
|
+
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
12
|
+
});
|
|
13
|
+
Portal.displayName = PORTAL_NAME;
|
|
14
|
+
export {
|
|
15
|
+
Portal as P
|
|
16
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { r as reactExports } from "./react.mjs";
|
|
2
|
+
import { u as useComposedRefs } from "./radix-ui__react-compose-refs.mjs";
|
|
3
|
+
import { u as useLayoutEffect2 } from "./@radix-ui/react-use-layout-effect+[...].mjs";
|
|
4
|
+
function useStateMachine(initialState, machine) {
|
|
5
|
+
return reactExports.useReducer((state, event) => {
|
|
6
|
+
const nextState = machine[state][event];
|
|
7
|
+
return nextState ?? state;
|
|
8
|
+
}, initialState);
|
|
9
|
+
}
|
|
10
|
+
var Presence = (props) => {
|
|
11
|
+
const { present, children } = props;
|
|
12
|
+
const presence = usePresence(present);
|
|
13
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : reactExports.Children.only(children);
|
|
14
|
+
const ref = useComposedRefs(presence.ref, getElementRef(child));
|
|
15
|
+
const forceMount = typeof children === "function";
|
|
16
|
+
return forceMount || presence.isPresent ? reactExports.cloneElement(child, { ref }) : null;
|
|
17
|
+
};
|
|
18
|
+
Presence.displayName = "Presence";
|
|
19
|
+
function usePresence(present) {
|
|
20
|
+
const [node, setNode] = reactExports.useState();
|
|
21
|
+
const stylesRef = reactExports.useRef(null);
|
|
22
|
+
const prevPresentRef = reactExports.useRef(present);
|
|
23
|
+
const prevAnimationNameRef = reactExports.useRef("none");
|
|
24
|
+
const initialState = present ? "mounted" : "unmounted";
|
|
25
|
+
const [state, send] = useStateMachine(initialState, {
|
|
26
|
+
mounted: {
|
|
27
|
+
UNMOUNT: "unmounted",
|
|
28
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
29
|
+
},
|
|
30
|
+
unmountSuspended: {
|
|
31
|
+
MOUNT: "mounted",
|
|
32
|
+
ANIMATION_END: "unmounted"
|
|
33
|
+
},
|
|
34
|
+
unmounted: {
|
|
35
|
+
MOUNT: "mounted"
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
reactExports.useEffect(() => {
|
|
39
|
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
40
|
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
41
|
+
}, [state]);
|
|
42
|
+
useLayoutEffect2(() => {
|
|
43
|
+
const styles = stylesRef.current;
|
|
44
|
+
const wasPresent = prevPresentRef.current;
|
|
45
|
+
const hasPresentChanged = wasPresent !== present;
|
|
46
|
+
if (hasPresentChanged) {
|
|
47
|
+
const prevAnimationName = prevAnimationNameRef.current;
|
|
48
|
+
const currentAnimationName = getAnimationName(styles);
|
|
49
|
+
if (present) {
|
|
50
|
+
send("MOUNT");
|
|
51
|
+
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
|
52
|
+
send("UNMOUNT");
|
|
53
|
+
} else {
|
|
54
|
+
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
55
|
+
if (wasPresent && isAnimating) {
|
|
56
|
+
send("ANIMATION_OUT");
|
|
57
|
+
} else {
|
|
58
|
+
send("UNMOUNT");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
prevPresentRef.current = present;
|
|
62
|
+
}
|
|
63
|
+
}, [present, send]);
|
|
64
|
+
useLayoutEffect2(() => {
|
|
65
|
+
if (node) {
|
|
66
|
+
let timeoutId;
|
|
67
|
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
68
|
+
const handleAnimationEnd = (event) => {
|
|
69
|
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
70
|
+
const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
|
|
71
|
+
if (event.target === node && isCurrentAnimation) {
|
|
72
|
+
send("ANIMATION_END");
|
|
73
|
+
if (!prevPresentRef.current) {
|
|
74
|
+
const currentFillMode = node.style.animationFillMode;
|
|
75
|
+
node.style.animationFillMode = "forwards";
|
|
76
|
+
timeoutId = ownerWindow.setTimeout(() => {
|
|
77
|
+
if (node.style.animationFillMode === "forwards") {
|
|
78
|
+
node.style.animationFillMode = currentFillMode;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const handleAnimationStart = (event) => {
|
|
85
|
+
if (event.target === node) {
|
|
86
|
+
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
node.addEventListener("animationstart", handleAnimationStart);
|
|
90
|
+
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
91
|
+
node.addEventListener("animationend", handleAnimationEnd);
|
|
92
|
+
return () => {
|
|
93
|
+
ownerWindow.clearTimeout(timeoutId);
|
|
94
|
+
node.removeEventListener("animationstart", handleAnimationStart);
|
|
95
|
+
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
96
|
+
node.removeEventListener("animationend", handleAnimationEnd);
|
|
97
|
+
};
|
|
98
|
+
} else {
|
|
99
|
+
send("ANIMATION_END");
|
|
100
|
+
}
|
|
101
|
+
}, [node, send]);
|
|
102
|
+
return {
|
|
103
|
+
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
104
|
+
ref: reactExports.useCallback((node2) => {
|
|
105
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
106
|
+
setNode(node2);
|
|
107
|
+
}, [])
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function getAnimationName(styles) {
|
|
111
|
+
return styles?.animationName || "none";
|
|
112
|
+
}
|
|
113
|
+
function getElementRef(element) {
|
|
114
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
115
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
116
|
+
if (mayWarn) {
|
|
117
|
+
return element.ref;
|
|
118
|
+
}
|
|
119
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
120
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
121
|
+
if (mayWarn) {
|
|
122
|
+
return element.props.ref;
|
|
123
|
+
}
|
|
124
|
+
return element.props.ref || element.ref;
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
Presence as P
|
|
128
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { r as reactExports, j as jsxRuntimeExports } from "./react.mjs";
|
|
2
|
+
import { r as reactDomExports } from "./react-dom.mjs";
|
|
3
|
+
import { c as createSlot } from "./radix-ui__react-slot.mjs";
|
|
4
|
+
var NODES = [
|
|
5
|
+
"a",
|
|
6
|
+
"button",
|
|
7
|
+
"div",
|
|
8
|
+
"form",
|
|
9
|
+
"h2",
|
|
10
|
+
"h3",
|
|
11
|
+
"img",
|
|
12
|
+
"input",
|
|
13
|
+
"label",
|
|
14
|
+
"li",
|
|
15
|
+
"nav",
|
|
16
|
+
"ol",
|
|
17
|
+
"p",
|
|
18
|
+
"select",
|
|
19
|
+
"span",
|
|
20
|
+
"svg",
|
|
21
|
+
"ul"
|
|
22
|
+
];
|
|
23
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
24
|
+
const Slot = createSlot(`Primitive.${node}`);
|
|
25
|
+
const Node = reactExports.forwardRef((props, forwardedRef) => {
|
|
26
|
+
const { asChild, ...primitiveProps } = props;
|
|
27
|
+
const Comp = asChild ? Slot : node;
|
|
28
|
+
if (typeof window !== "undefined") {
|
|
29
|
+
window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
|
|
30
|
+
}
|
|
31
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
32
|
+
});
|
|
33
|
+
Node.displayName = `Primitive.${node}`;
|
|
34
|
+
return { ...primitive, [node]: Node };
|
|
35
|
+
}, {});
|
|
36
|
+
function dispatchDiscreteCustomEvent(target, event) {
|
|
37
|
+
if (target) reactDomExports.flushSync(() => target.dispatchEvent(event));
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
Primitive as P,
|
|
41
|
+
dispatchDiscreteCustomEvent as d
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|