@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,28 @@
|
|
|
1
|
+
import { r as reactExports, j as jsxRuntimeExports } from "./react.mjs";
|
|
2
|
+
import { P as Primitive } from "./radix-ui__react-primitive.mjs";
|
|
3
|
+
var NAME = "Separator";
|
|
4
|
+
var DEFAULT_ORIENTATION = "horizontal";
|
|
5
|
+
var ORIENTATIONS = ["horizontal", "vertical"];
|
|
6
|
+
var Separator = reactExports.forwardRef((props, forwardedRef) => {
|
|
7
|
+
const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;
|
|
8
|
+
const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;
|
|
9
|
+
const ariaOrientation = orientation === "vertical" ? orientation : void 0;
|
|
10
|
+
const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
|
|
11
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12
|
+
Primitive.div,
|
|
13
|
+
{
|
|
14
|
+
"data-orientation": orientation,
|
|
15
|
+
...semanticProps,
|
|
16
|
+
...domProps,
|
|
17
|
+
ref: forwardedRef
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
Separator.displayName = NAME;
|
|
22
|
+
function isValidOrientation(orientation) {
|
|
23
|
+
return ORIENTATIONS.includes(orientation);
|
|
24
|
+
}
|
|
25
|
+
var Root = Separator;
|
|
26
|
+
export {
|
|
27
|
+
Root as R
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { r as reactExports, j as jsxRuntimeExports } from "./react.mjs";
|
|
2
|
+
import { c as composeRefs } from "./radix-ui__react-compose-refs.mjs";
|
|
3
|
+
// @__NO_SIDE_EFFECTS__
|
|
4
|
+
function createSlot(ownerName) {
|
|
5
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
6
|
+
const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
|
|
7
|
+
const { children, ...slotProps } = props;
|
|
8
|
+
const childrenArray = reactExports.Children.toArray(children);
|
|
9
|
+
const slottable = childrenArray.find(isSlottable);
|
|
10
|
+
if (slottable) {
|
|
11
|
+
const newElement = slottable.props.children;
|
|
12
|
+
const newChildren = childrenArray.map((child) => {
|
|
13
|
+
if (child === slottable) {
|
|
14
|
+
if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
|
|
15
|
+
return reactExports.isValidElement(newElement) ? newElement.props.children : null;
|
|
16
|
+
} else {
|
|
17
|
+
return child;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null });
|
|
21
|
+
}
|
|
22
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
23
|
+
});
|
|
24
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
25
|
+
return Slot2;
|
|
26
|
+
}
|
|
27
|
+
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
28
|
+
// @__NO_SIDE_EFFECTS__
|
|
29
|
+
function createSlotClone(ownerName) {
|
|
30
|
+
const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
|
|
31
|
+
const { children, ...slotProps } = props;
|
|
32
|
+
if (reactExports.isValidElement(children)) {
|
|
33
|
+
const childrenRef = getElementRef(children);
|
|
34
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
35
|
+
if (children.type !== reactExports.Fragment) {
|
|
36
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
37
|
+
}
|
|
38
|
+
return reactExports.cloneElement(children, props2);
|
|
39
|
+
}
|
|
40
|
+
return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null;
|
|
41
|
+
});
|
|
42
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
43
|
+
return SlotClone;
|
|
44
|
+
}
|
|
45
|
+
var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
|
|
46
|
+
// @__NO_SIDE_EFFECTS__
|
|
47
|
+
function createSlottable(ownerName) {
|
|
48
|
+
const Slottable2 = ({ children }) => {
|
|
49
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children });
|
|
50
|
+
};
|
|
51
|
+
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
52
|
+
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
53
|
+
return Slottable2;
|
|
54
|
+
}
|
|
55
|
+
function isSlottable(child) {
|
|
56
|
+
return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
57
|
+
}
|
|
58
|
+
function mergeProps(slotProps, childProps) {
|
|
59
|
+
const overrideProps = { ...childProps };
|
|
60
|
+
for (const propName in childProps) {
|
|
61
|
+
const slotPropValue = slotProps[propName];
|
|
62
|
+
const childPropValue = childProps[propName];
|
|
63
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
64
|
+
if (isHandler) {
|
|
65
|
+
if (slotPropValue && childPropValue) {
|
|
66
|
+
overrideProps[propName] = (...args) => {
|
|
67
|
+
const result = childPropValue(...args);
|
|
68
|
+
slotPropValue(...args);
|
|
69
|
+
return result;
|
|
70
|
+
};
|
|
71
|
+
} else if (slotPropValue) {
|
|
72
|
+
overrideProps[propName] = slotPropValue;
|
|
73
|
+
}
|
|
74
|
+
} else if (propName === "style") {
|
|
75
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
76
|
+
} else if (propName === "className") {
|
|
77
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return { ...slotProps, ...overrideProps };
|
|
81
|
+
}
|
|
82
|
+
function getElementRef(element) {
|
|
83
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
84
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
85
|
+
if (mayWarn) {
|
|
86
|
+
return element.ref;
|
|
87
|
+
}
|
|
88
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
89
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
90
|
+
if (mayWarn) {
|
|
91
|
+
return element.props.ref;
|
|
92
|
+
}
|
|
93
|
+
return element.props.ref || element.ref;
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
Slot as S,
|
|
97
|
+
createSlottable as a,
|
|
98
|
+
createSlot as c
|
|
99
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { r as reactExports, j as jsxRuntimeExports } from "./react.mjs";
|
|
2
|
+
import { c as composeEventHandlers } from "./radix-ui__primitive.mjs";
|
|
3
|
+
import { c as createContextScope } from "./radix-ui__react-context.mjs";
|
|
4
|
+
import { R as Root, I as Item, c as createRovingFocusGroupScope } from "./radix-ui__react-roving-focus.mjs";
|
|
5
|
+
import { P as Presence } from "./radix-ui__react-presence.mjs";
|
|
6
|
+
import { P as Primitive } from "./radix-ui__react-primitive.mjs";
|
|
7
|
+
import { u as useDirection } from "./radix-ui__react-direction.mjs";
|
|
8
|
+
import { u as useControllableState } from "./@radix-ui/react-use-controllable-state+[...].mjs";
|
|
9
|
+
import { u as useId } from "./radix-ui__react-id.mjs";
|
|
10
|
+
var TABS_NAME = "Tabs";
|
|
11
|
+
var [createTabsContext] = createContextScope(TABS_NAME, [
|
|
12
|
+
createRovingFocusGroupScope
|
|
13
|
+
]);
|
|
14
|
+
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
15
|
+
var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);
|
|
16
|
+
var Tabs = reactExports.forwardRef(
|
|
17
|
+
(props, forwardedRef) => {
|
|
18
|
+
const {
|
|
19
|
+
__scopeTabs,
|
|
20
|
+
value: valueProp,
|
|
21
|
+
onValueChange,
|
|
22
|
+
defaultValue,
|
|
23
|
+
orientation = "horizontal",
|
|
24
|
+
dir,
|
|
25
|
+
activationMode = "automatic",
|
|
26
|
+
...tabsProps
|
|
27
|
+
} = props;
|
|
28
|
+
const direction = useDirection(dir);
|
|
29
|
+
const [value, setValue] = useControllableState({
|
|
30
|
+
prop: valueProp,
|
|
31
|
+
onChange: onValueChange,
|
|
32
|
+
defaultProp: defaultValue ?? "",
|
|
33
|
+
caller: TABS_NAME
|
|
34
|
+
});
|
|
35
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
36
|
+
TabsProvider,
|
|
37
|
+
{
|
|
38
|
+
scope: __scopeTabs,
|
|
39
|
+
baseId: useId(),
|
|
40
|
+
value,
|
|
41
|
+
onValueChange: setValue,
|
|
42
|
+
orientation,
|
|
43
|
+
dir: direction,
|
|
44
|
+
activationMode,
|
|
45
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
46
|
+
Primitive.div,
|
|
47
|
+
{
|
|
48
|
+
dir: direction,
|
|
49
|
+
"data-orientation": orientation,
|
|
50
|
+
...tabsProps,
|
|
51
|
+
ref: forwardedRef
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
Tabs.displayName = TABS_NAME;
|
|
59
|
+
var TAB_LIST_NAME = "TabsList";
|
|
60
|
+
var TabsList = reactExports.forwardRef(
|
|
61
|
+
(props, forwardedRef) => {
|
|
62
|
+
const { __scopeTabs, loop = true, ...listProps } = props;
|
|
63
|
+
const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
|
|
64
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
|
65
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
66
|
+
Root,
|
|
67
|
+
{
|
|
68
|
+
asChild: true,
|
|
69
|
+
...rovingFocusGroupScope,
|
|
70
|
+
orientation: context.orientation,
|
|
71
|
+
dir: context.dir,
|
|
72
|
+
loop,
|
|
73
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
74
|
+
Primitive.div,
|
|
75
|
+
{
|
|
76
|
+
role: "tablist",
|
|
77
|
+
"aria-orientation": context.orientation,
|
|
78
|
+
...listProps,
|
|
79
|
+
ref: forwardedRef
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
TabsList.displayName = TAB_LIST_NAME;
|
|
87
|
+
var TRIGGER_NAME = "TabsTrigger";
|
|
88
|
+
var TabsTrigger = reactExports.forwardRef(
|
|
89
|
+
(props, forwardedRef) => {
|
|
90
|
+
const { __scopeTabs, value, disabled = false, ...triggerProps } = props;
|
|
91
|
+
const context = useTabsContext(TRIGGER_NAME, __scopeTabs);
|
|
92
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
|
93
|
+
const triggerId = makeTriggerId(context.baseId, value);
|
|
94
|
+
const contentId = makeContentId(context.baseId, value);
|
|
95
|
+
const isSelected = value === context.value;
|
|
96
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
97
|
+
Item,
|
|
98
|
+
{
|
|
99
|
+
asChild: true,
|
|
100
|
+
...rovingFocusGroupScope,
|
|
101
|
+
focusable: !disabled,
|
|
102
|
+
active: isSelected,
|
|
103
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
104
|
+
Primitive.button,
|
|
105
|
+
{
|
|
106
|
+
type: "button",
|
|
107
|
+
role: "tab",
|
|
108
|
+
"aria-selected": isSelected,
|
|
109
|
+
"aria-controls": contentId,
|
|
110
|
+
"data-state": isSelected ? "active" : "inactive",
|
|
111
|
+
"data-disabled": disabled ? "" : void 0,
|
|
112
|
+
disabled,
|
|
113
|
+
id: triggerId,
|
|
114
|
+
...triggerProps,
|
|
115
|
+
ref: forwardedRef,
|
|
116
|
+
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
117
|
+
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
118
|
+
context.onValueChange(value);
|
|
119
|
+
} else {
|
|
120
|
+
event.preventDefault();
|
|
121
|
+
}
|
|
122
|
+
}),
|
|
123
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
124
|
+
if ([" ", "Enter"].includes(event.key)) context.onValueChange(value);
|
|
125
|
+
}),
|
|
126
|
+
onFocus: composeEventHandlers(props.onFocus, () => {
|
|
127
|
+
const isAutomaticActivation = context.activationMode !== "manual";
|
|
128
|
+
if (!isSelected && !disabled && isAutomaticActivation) {
|
|
129
|
+
context.onValueChange(value);
|
|
130
|
+
}
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
TabsTrigger.displayName = TRIGGER_NAME;
|
|
139
|
+
var CONTENT_NAME = "TabsContent";
|
|
140
|
+
var TabsContent = reactExports.forwardRef(
|
|
141
|
+
(props, forwardedRef) => {
|
|
142
|
+
const { __scopeTabs, value, forceMount, children, ...contentProps } = props;
|
|
143
|
+
const context = useTabsContext(CONTENT_NAME, __scopeTabs);
|
|
144
|
+
const triggerId = makeTriggerId(context.baseId, value);
|
|
145
|
+
const contentId = makeContentId(context.baseId, value);
|
|
146
|
+
const isSelected = value === context.value;
|
|
147
|
+
const isMountAnimationPreventedRef = reactExports.useRef(isSelected);
|
|
148
|
+
reactExports.useEffect(() => {
|
|
149
|
+
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
150
|
+
return () => cancelAnimationFrame(rAF);
|
|
151
|
+
}, []);
|
|
152
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
153
|
+
Primitive.div,
|
|
154
|
+
{
|
|
155
|
+
"data-state": isSelected ? "active" : "inactive",
|
|
156
|
+
"data-orientation": context.orientation,
|
|
157
|
+
role: "tabpanel",
|
|
158
|
+
"aria-labelledby": triggerId,
|
|
159
|
+
hidden: !present,
|
|
160
|
+
id: contentId,
|
|
161
|
+
tabIndex: 0,
|
|
162
|
+
...contentProps,
|
|
163
|
+
ref: forwardedRef,
|
|
164
|
+
style: {
|
|
165
|
+
...props.style,
|
|
166
|
+
animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0
|
|
167
|
+
},
|
|
168
|
+
children: present && children
|
|
169
|
+
}
|
|
170
|
+
) });
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
TabsContent.displayName = CONTENT_NAME;
|
|
174
|
+
function makeTriggerId(baseId, value) {
|
|
175
|
+
return `${baseId}-trigger-${value}`;
|
|
176
|
+
}
|
|
177
|
+
function makeContentId(baseId, value) {
|
|
178
|
+
return `${baseId}-content-${value}`;
|
|
179
|
+
}
|
|
180
|
+
var Root2 = Tabs;
|
|
181
|
+
var List = TabsList;
|
|
182
|
+
var Trigger = TabsTrigger;
|
|
183
|
+
var Content = TabsContent;
|
|
184
|
+
export {
|
|
185
|
+
Content as C,
|
|
186
|
+
List as L,
|
|
187
|
+
Root2 as R,
|
|
188
|
+
Trigger as T
|
|
189
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|