fumadocs-openapi 12.6.6 → 12.6.8
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/css/generated/shared.css +1 -1
- package/dist/operation.js +14 -3
- package/dist/packages/shared-api/dist/components/dialog.js +1 -1
- package/dist/packages/shared-api/dist/components/playground/fields.js +13 -13
- package/dist/packages/shared-api/dist/components/playground/json-editor.js +1 -1
- package/dist/packages/shared-api/dist/components/playground/panels.js +1 -1
- package/dist/packages/shared-api/dist/components/playground/param-input.js +1 -1
- package/dist/packages/shared-api/dist/components/playground/server-select.js +4 -4
- package/dist/packages/shared-api/dist/components/schema/client.js +5 -5
- package/dist/packages/shared-api/dist/components/segmented.js +1 -1
- package/dist/packages/shared-api/dist/components/select.js +2 -2
- package/dist/packages/shared-api/dist/utils/id-to-title.js +2 -7
- package/dist/packages/shared-api/dist/utils/use-server-store.js +9 -4
- package/dist/playground/auth.js +12 -5
- package/dist/requests/media/adapter.d.ts +1 -1
- package/dist/ui/operation/index.js +2 -2
- package/dist/ui/operation/usage-tabs.js +3 -2
- package/dist/ui/playground/components/auth.js +10 -2
- package/dist/ui/scalar/client.js +8 -4
- package/dist/utils/get-example-requests.js +1 -2
- package/dist/utils/pages/to-text.js +1 -1
- package/package.json +5 -5
package/css/generated/shared.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@source inline("!collapsed !headers !isSecret !readOnly !renderBodyField !required !returned *:flex-1 *:justify-center *:min-w-0 --accordion-panel-height --active-tab-height --active-tab-left --active-tab-top --active-tab-width --anchor-width --available-height --collapsible-panel-height --fd-docs-height --fd-docs-row-3 --spacing --transform-origin -me-3 -mode -ms-0.5 -ms-2 -mt-1 -my-1 -z-1 @4xl:flex @4xl:flex-col @4xl:flex-row @4xl:items-start @4xl:max-h-[calc(var(--fd-docs-height,100dvh)-var(--fd-docs-row-3,0px)-2rem)] @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-3,0px)+1rem)] @4xl:w-[400px] @container @default @defaultValue @deprecated @fuma-translate/react @fumadocs/json-schema @fumari/stf @max-sm:bg-fd-secondary/50 @max-sm:border @max-sm:mx-4 @max-sm:overflow-hidden @max-sm:pb-1.5 @max-sm:pb-3 @max-sm:pt-2 @max-sm:rounded-lg @max-xl:basis-full @max-xl:border-t @max-xl:flex-1 @max-xl:ps-1.5 @md:block @param @returns @scalar/api-client-react @see @sm:border-s @sm:flex @sm:grid-cols-[minmax(9rem,1fr)_minmax(0,2fr)] @sm:min-h-10 @sm:min-w-0 @xl:w-40 [&>div:has(>figcaption)]:h-10 [&[hidden]:not([hidden='until-found'])]:hidden [&_a]:underline [&_code]:font-mono [&_figcaption]:font-medium [&_figcaption]:overflow-visible [&_figcaption]:text-[0.8125rem] [&_figcaption]:text-fd-foreground [&_figcaption]:text-xs [&_svg]:size-3 [&_svg]:size-3.5 [--fd-docs-row-3:0px] [grid-area:1/1] [scrollbar-width:none] a abort above absolute accept access access_token accordion accordions across action actions active:scale-[0.97] activity actual adapter adapters add addLogEntry added adding additional additionalProperties adds after again against alias align aligns all allOf allow allowCopy allowJson allowed already also alt among an anchor anchorSegments and animate-spin animates another any anyFields anyOf apiExample apiKey apiPlayground appearance-none application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml applied applies apply are aren aria-checked aria-current aria-expanded aria-expanded:bg-fd-accent aria-expanded:decoration-solid aria-expanded:text-fd-accent-foreground aria-hidden aria-label aria-live aria-pressed arkdown array arrow arrows as aside async at audience auth authNode authProviders authSchemes authenticate authorization authorizationCode authorizationUrl authorization_code authorization_pending authorization_url authorize authorized authorizes auto-cols-[minmax(0,max-content)] autoComplete available avoid await away back backdrop-blur-[1px] backdrop-blur-xs badgeVariants bar base basic basis-full be bearer before behavior below beside between bg-amber-500 bg-amber-500/10 bg-black/40 bg-blue-500 bg-current/10 bg-fd-accent bg-fd-background bg-fd-card bg-fd-card/70 bg-fd-muted bg-fd-muted-foreground bg-fd-muted-foreground/50 bg-fd-popover bg-fd-primary bg-fd-primary/10 bg-fd-secondary bg-green-500 bg-linear-to-b bg-linear-to-t bg-red-500 bg-transparent binary block blocked blocks blue body bodyMediaType bodyNode bodyUrlRef boolean border border-0 border-b border-b-0 border-current border-dashed border-fd-border/60 border-fd-muted-foreground/50 border-fd-primary border-s border-t border-x-0 bottom bottom-0 box box-content breadcrumbs break-all browser browsers built-in builtinAuthProviders builtinProviders bundled busy but button buttonVariants buttons by bytes cache cached cachedDocFiles callbacks callbacksNode came can cancel cancelled candidates cannot caption captionCodeBlock captioned card cardCodeBlock cards case catch cause cell center certificate ch challenge change changes changing charset check checkbox checked chevron chevronClassName children chosen class class-variance-authority className cleanup clear clearResponse click clicking client client-rendered clientAuth clientCredentials clientId clientSecret clientWidth client_auth client_credentials client_error client_id client_secret clients cloned close closeDelay closed closest cn code codeProps codeUsages code_challenge code_challenge_method code_verifier codeblock col-span-2 col-span-full col-start-2 collapse collapses color colors column come component components compute confidential config configUrl configuration configurations connecting connection const constraints consumers container content contentTypes contents control controller controllerRef controls cookie cookieString cookies copies copy copyable copying core count covered covers createContext createOAuthHandler createOpenAPIPage createOpenAPIPageBase createProxy created credentials cross-origin crumbClassName crumbs css csv ctions ctx current currentValue cursor-help cursor-pointer cursor-text custom customise customization cyan dark dark:bg-fd-accent dark:text-amber-400 dark:text-blue-400 dark:text-cyan-400 dark:text-green-400 dark:text-orange-400 dark:text-red-400 dark:text-yellow-400 data data-[disabled]:opacity-50 data-[disabled]:pointer-events-none data-[highlighted]:bg-fd-accent data-[highlighted]:text-fd-accent-foreground data-active:text-fd-foreground data-checked data-checked:bg-fd-primary data-checked:bg-fd-primary-foreground data-checked:text-fd-accent-foreground data-checked:translate-x-3 data-empty:hidden data-ending-style:duration-150 data-ending-style:h-0 data-ending-style:opacity-0 data-ending-style:scale-95 data-ending-style:scale-[0.97] data-ending-style:scale-[0.98] data-highlighted:bg-fd-accent data-highlighted:text-fd-accent-foreground data-placeholder:text-fd-muted-foreground data-popup-open:bg-fd-accent data-popup-open:text-fd-accent-foreground data-popup-open:underline data-starting-style:h-0 data-starting-style:opacity-0 data-starting-style:scale-95 data-starting-style:scale-[0.98] dataEngine decimal declare decode decoration-dotted default defaultColor defaultMdxComponents defaultShikiFactory defaultShikiOptions defaultValue defaultValues defaults define definitions delay delay-150 delete deprecated depth dereference dereferenced described describes description descriptionNode descriptions detail details device deviceAuthorization deviceAuthorizationUrl device_authorization_url device_code devices dialog didn direction directories disable disableCache disabled disabled:cursor-not-allowed disabled:opacity-50 disabled:opacity-80 discovered discovering display displayNames disposition div doc docCache docFilesCache docRoot docs document documents does doesn domain don download downloaded drives drop duplicated duration duration-150 duration-200 duration-250 duration-300 during dynamic dynamicSource e each eading early ease-[cubic-bezier(0.16,1,0.3,1)] ease-[cubic-bezier(0.22,1,0.36,1)] ease-out edge edit edited editing editor edits element elements else empty enabled encode encodeRequestData end ending endpoint endpoints ends enforce engine enter entered entries entry enum err error error_description errors eslint-disable-next-line even every example exampleCardClassName exampleCodeBlock examples exclusiveMax exclusiveMin expand expanded expands expected expiresAt expires_in export exported expressions extended extends fades failed fallback false fast-content-type-parse fd-page-tree-item-name fd-scroll-container fetch fetchOptions fetcher field field-sizing-content fieldData fieldName fields file fileName files fill-current filled filling fills filter filterable finally finishes finishing first first:border-t-0 first:mt-0 fixed flattened flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flow-root flowInfo flowReturned flows flushSync focus-visible:bg-fd-accent focus-visible:bg-fd-accent/40 focus-visible:bg-fd-primary/15 focus-visible:bg-fd-secondary focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-primary/30 focus-visible:ring-fd-ring focus-visible:ring-inset focus-visible:text-fd-accent-foreground focus-within:ring-1 focus-within:ring-fd-ring focus:outline-none focus:ring focus:ring-0 focus:ring-fd-ring follow font-light font-medium font-mono font-normal font-sans font-semibold for form form-encoded format forward fragment frameworks from from-fd-popover full fumadocs-core/highlight fumadocs-core/source fumadocs-core/toc fumadocs-openapi-flow fumadocs-openapi-oauth fumadocs-openapi-oauth-returned fumadocs-ui/mdx fumadocs:openapi fumadocs_openapi_requests function gap-0.5 gap-1 gap-1.5 gap-2 gap-2.5 gap-24 gap-3 gap-4 gap-x-2 gap-x-3 gap-x-6 gap-y-1 gap-y-4 generate generateDefault generateSchemaUI generateTypeScriptDefinitions generated generators get getLink getOpenAPIPageProps getPageProps getPreferredType getRaw getSchema getSchemas getState gets ghost github-dark github-light given gives go goes going grant_type grant_types_supported grants gray green grid grid-cols-[auto_minmax(0,1fr)] grid-cols-[auto_minmax(0,1fr)_auto] grid-cols-[minmax(0,1fr)_auto] grid-cols-[minmax(0,2fr)_minmax(0,3fr)] grid-flow-col grid-rows-[auto_minmax(0,1fr)] group group-data-[panel-open]/accordion:rotate-90 group-data-popup-open:rotate-180 group-hover/nav:translate-x-0.5 group-hover/open:translate-x-0.5 group-hover/property:opacity-100 group-hover:translate-x-0.5 group-hover:translate-x-px group/accordion group/nav group/open group/property group/row h-(--accordion-panel-height) h-(--active-tab-height) h-(--collapsible-panel-height) h-10 h-12 h-4 h-6 h-7 h-8 h-9 h-[calc(--spacing(10)-1px)] h-full h-px h1 handle handled handles happens has has-focus-visible:bg-fd-secondary hasVariables hash have headNode header headerRef headers heading headingLevel headless here hidden hiddenKeys highlighted highlighter highlights hint holding hook hour hour12 hover hover:bg-fd-accent hover:bg-fd-accent/40 hover:bg-fd-accent/50 hover:bg-fd-primary/15 hover:text-fd-accent-foreground hover:underline how href html htmlFor http hydration i icon icon-sm icon-xs iconButtonClassName id idx if img implicit import imports in includeDocument including index indicator info infoTags init initAuth initial inline inline-flex input inputMode inputs inset-0 inset-x-0 inside installed instanceof instead integer interface interval into invalid invisible is isCopied isDynamic isExpanded isHighlighted isLazy isLoading isMac isNumber isSecret isSending isn issues it item itemSchema itemToStringValue items items-baseline items-center items-start items-stretch its itself js json json-schema-typed justify-between justify-center justify-end k kB keep keeps kept key keyboard keyed keyof keys kind label labelled lang language languages larger last last:border-b-0 last:shrink-0 lasts latest layout layouts lazy leading-5 leading-[1.375rem] leading-relaxed leave leaving left left-0 length let light like line line-clamp-3 line-through link links list listed listener listeners literal live load loadDocument loaded loaderPlugin loading loads location lock locked log long longer looks lucide-react make many map mapValues margin margins marked masked match matches matching max max-age max-h-(--available-height) max-h-[min(18rem,30vh)] max-h-[min(var(--available-height),20rem)] max-h-none max-md:hidden max-w-1/2 max-w-40 max-w-60 max-w-64 max-w-72 max-w-80 max-w-[calc(100vw-2rem)] max-w-full maxEntries may mb-3 mb-4 md md:border-s md:grid-cols-[minmax(0,11fr)_minmax(0,9fr)] md:hidden me-1 me-2 me-auto measure measured measures media mediaAdapters mediaType member members memoized menu menuItems merge message messages metaData metaKey method methods milliseconds mime min min-h-0 min-h-10 min-h-11 min-h-60 min-h-9 min-h-full min-w-0 min-w-16 min-w-40 min-w-[calc(var(--anchor-width)+--spacing(2))] minute mode more motion motion-reduce:transition-none motion-reduce:transition-opacity motion-safe:-translate-x-6 motion-safe:animate-pulse motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0.16,1,0.3,1)] motion-safe:starting:-translate-x-2 motion-safe:starting:-translate-x-6 motion-safe:starting:-translate-y-4 motion-safe:starting:opacity-0 motion-safe:starting:scale-0 motion-safe:starting:scale-150 motion-safe:starting:translate-x-2 motion-safe:starting:translate-x-6 motion-safe:starting:translate-y-1 motion-safe:starting:translate-y-4 motion-safe:transition-[opacity,translate] motion-safe:transition-opacity motion-safe:transition-transform motionClassNames mounted move moves ms ms-1 ms-1.5 ms-auto mt-0! mt-0.5 mt-1 mt-1.5 mt-10 mt-2.5 mt-px multi-type multipart/form-data multiple must muted mutual mutualTLS mx-3 mx-px my-0! my-1 my-3 name name! nameClassName named names namespace narrow nav navigate navigated navigator nearest needs nested network never new next next/previous nextId no no-cache noValidate node noop noreferrer normalizes not not-first:border-s not-prose note now null number oauth oauth2 oauthRedirectUrl object objectGet objects observer obtain of off ok older omit omitted on onAppend onAuthorize onBack onCancel onChange onCheckedChange onClear onClick onCopy onKeyDown onLink onNavigate onOpenChange onRemove onReset onReturn onRoot onSelect onSubmit onUserCode onValueChange once one oneOf ones only opacity-0 opacity-60 opacity-80 open openApiData openIdConnect openIdConnectUrl openNested openOnHover openOnInputClick openapi openapiMeta opened opening opens operation optional options or orange origin origin-(--transform-origin) other others otherwise out outline-none output outside over overflow-auto overflow-clip overflow-hidden overflow-x-auto overflow-y-auto override overview own p-0.5 p-1 p-1.5 p-2 p-2.5 p-3 p-4 p-5 p-6 packages padding page pageData pages panel panelCodeBlock panelKey panelTopCodeBlock panels param parameter parameterLabel parameterNode parameters params parent parentIndex parents parsed parts party pass password paste path pathItem pathnameFromRequest pattern patternProperties payload pb-1 pb-2 pb-2.5 pb-3 pe-1 pe-1.5 pe-2 pe-3 pe-4 pendingFlowKey per persisted pill place placed placeholder placeholder:font-sans placeholder:text-fd-muted-foreground placeholder:text-fd-muted-foreground/70 placeholder:text-fd-primary/50 plain playground playgrounds please plugins pointer-coarse:opacity-100 polite poll polling popover pops popup port position postForm pre preferred prefers preloadOpenAPIPage preloaded presents prev preventDefault preview previous primary primitive private processor prop properties property props prose prose-no-margin prose-sm prose-xs provider providers proxied proxy proxyForwardCookie proxyUrl ps-1 ps-1.5 ps-3 ps-3.5 ps-4 ps-6 pt-1.5 pt-2 pt-2.5 public px-1 px-1.5 px-2 px-2.5 px-3 px-4 py-0 py-0.5 py-1 py-1.5 py-2 py-2.5 py-3 py-6 py-8 q query quiet random range raw reach react react-dom react-hooks/exhaustive-deps read read-only readOnly readers readonly reads received record red redirect redirectUrl redirect_uri redirected redirects ref reference refs regenerated rejected rejects rel relative reloading remark remark-rehype remarkGfm remarkRehype remounted removable removal remove removeItem removed render renderAPIExampleUsageTabs renderBodyField renderCodeblock renderDefault renderMarkdown renderParameterField rendered renderers renders replace replaces represents request request-body requestBody requestData requestInit requestTimeout requestUrl requested requesting requests required requirement requirements res reset resize-none resized resolve resolveMediaAdapter resolveUrl resolved resolvedInput resolvedTheme resolves respond response response-body responseNode responseTabs response_type responses rest restore restored result return returned returnedFlow returnedScheme returnedUrl returning returns reversed revoked right ring-1 ring-3 ring-fd-border ring-green-500/20 role room root rootId rounded-[5px] rounded-full rounded-lg rounded-md rounded-none rounded-sm rounded-xl route row row-span-2 row-start-1 row-start-2 rowButtonClassName rows run runtime s safeParse same sample satisfies says scalar scan schema schemaId schemaKeys schemaUI schemas scheme schemeId schemes scope scopeOptions scopes scopes_supported screen screens scroll scroll-m-20 scroll-mt-[calc(var(--fd-docs-row-3,0px)+1rem)] scrollArrowClassName scrollMarginClassName scrolling search second secondary seconds secret secretSchema secrets section sectionIcons sectionNames sections security see segment segmentClassName segments segs select select-all select-none selectExample selectable selected selectedCodeUsages selectedType selecting selection selector selectors selects self-center self-stretch send sender sending sends sent server server-to-server serverSchema serverUrl servers services session sessionStorage set setAuthorizing setClientAuth setCode setCollapsed setDraft setFilter setIndex setInfo setMode setMotion setName setOpen setResponse setScopes setSelected setSelectedFor setSending setServerVariables setShowSchema setStack setType setUserCode setValue setView several shadow-lg shadow-md shadow-none shadow-sm share shared shared-api/auto-anchor shared-api/source shiki shikiOptions shortcut shorten show showDescription showExample showResponseSchema showTitle shown shows shrink shrink-0 shrinks sibling siblings side sideOffset signal signing single sits size size-2 size-3 size-3.5 size-4 size-5 skipNonRequired skipReadOnly slashes slides sliding slots slow_down sm sm:-translate-x-1/2 sm:-translate-y-1/2 sm:border sm:h-[min(52rem,calc(100dvh-3rem))] sm:inline sm:inset-auto sm:left-1/2 sm:max-h-[min(52rem,calc(100dvh-3rem))] sm:mb-4 sm:mx-4 sm:ps-5 sm:px-4 sm:rounded-2xl sm:shadow-2xl sm:top-1/2 sm:w-[min(64rem,calc(100vw-3rem))] sm:w-[min(80rem,calc(100vw-3rem))] small smaller smooth so some something space spellCheck sr-only src stable stack start started starting starting:opacity-0 starts state staticSource status statusInfo stay stays step stf sticky still stops storage storageKey storageKeyPrefix store stored string stringifyFieldKey structuredData style styles submit subscribe subscribeNever successful such suggestions summary suspends svg switch switches switching sync syncExample synced t tPlayground tab tabIndex tabs tabular-nums tag tagClassName taken takes target telling text text-4xl text-[0.8125rem] text-amber-600 text-blue-600 text-center text-cyan-600 text-fd-accent-foreground text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-muted-foreground/60 text-fd-muted-foreground/70 text-fd-popover-foreground text-fd-primary text-fd-primary-foreground text-fd-secondary-foreground text-green-600 text-nowrap text-orange-600 text-red-400 text-red-600 text-sm text-start text-xl text-xs text-yellow-600 text/css text/csv text/html text/plain texts than that the their them themes then there they this three through throw time timeFormat timeout timer timerRef tips title titleBarClassName tls to to-transparent toStaticData toVirtualFiles toc toggle toggled token tokenUrl token_type token_url top top-(--active-tab-top) top-0 total tracking-tight tracking-widest transform transformPageTree transition-[background-color,scale] transition-[height,opacity] transition-[height] transition-[opacity,scale] transition-[translate,background-color] transition-[translate,width] transition-colors transition-opacity transition-shadow transition-transform transitionClassName translate-x-(--active-tab-left) translations trigger true truncate truncating try turns type typeClassName typeof types typing undefined under underline underline-offset-4 union unionField unions unique unit unknown unless unset unsetting until up update updateInfo updated updating url urn:ietf:params:oauth:grant-type:device_code usage usageTabs usages use useAnchorId useAnchorLink useApiClient useComponents useCopyButton useDataEngine useFieldValue useListener useMemo useNamespace useOnChange useOpenAPI useOperation useQuery useRef useRenderContext useResolvedSchema useResponseExamples useSchemaUtils useServer useState useStf useSyncExternalStore useTheme useTranslations userCode user_code username users using v value valueSchema values variable variables variant variants verification verificationUri verificationUriComplete verification_uri verifier via view viewportClassName viewportProps views virtual void w-(--active-tab-width) w-6 w-7 w-72 w-[min(26rem,calc(100vw-2rem))] w-auto w-fit w-full w-max warn warning was we webhook webhooks what when where while whitespace-pre whitespace-pre-wrap whole whose why width widths will window with without would wrap wrap-anywhere wrap-break-word wrapping write writeOnly written x-exclusiveCodeSample x-playground-lazy xml yellow yet your z-0 z-10 z-50");
|
|
1
|
+
@source inline("!collapsed !headers !isSecret !readOnly !renderBodyField !required !returned *:flex-1 *:justify-center *:min-w-0 --accordion-panel-height --active-tab-height --active-tab-left --active-tab-top --active-tab-width --anchor-width --available-height --collapsible-panel-height --fd-docs-height --fd-docs-row-3 --spacing --transform-origin -me-3 -mode -ms-0.5 -ms-2 -mt-1 -my-1 -z-1 @4xl:flex @4xl:flex-col @4xl:flex-row @4xl:items-start @4xl:max-h-[calc(var(--fd-docs-height,100dvh)-var(--fd-docs-row-3,0px)-2rem)] @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-3,0px)+1rem)] @4xl:w-[400px] @container @default @defaultValue @deprecated @fuma-translate/react @fumadocs/json-schema @fumari/stf @max-sm:bg-fd-secondary/50 @max-sm:border @max-sm:mx-4 @max-sm:overflow-hidden @max-sm:pb-1.5 @max-sm:pb-3 @max-sm:pt-2 @max-sm:rounded-lg @max-xl:basis-full @max-xl:border-t @max-xl:flex-1 @max-xl:ps-1.5 @md:block @param @returns @scalar/api-client-react @see @sm:border-s @sm:flex @sm:grid-cols-[minmax(9rem,1fr)_minmax(0,2fr)] @sm:min-h-10 @sm:min-w-0 @xl:w-40 [&>div:has(>figcaption)]:h-10 [&[hidden]:not([hidden='until-found'])]:hidden [&_a]:underline [&_code]:font-mono [&_figcaption]:font-medium [&_figcaption]:overflow-visible [&_figcaption]:text-[0.8125rem] [&_figcaption]:text-fd-foreground [&_figcaption]:text-xs [&_svg]:size-3 [&_svg]:size-3.5 [--fd-docs-row-3:0px] [grid-area:1/1] [scrollbar-width:none] a abort about above absolute accept access access_token accordion accordions across action actions active:scale-[0.97] activity actual adapter adapters add addLogEntry added adding additional additionalProperties adds after again against alias align aligns all allOf allow allowCopy allowJson allowed already also alt among an anchor anchorSegments and animate-spin animates another any anyFields anyOf apiExample apiKey apiPlayground appearance-none application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml applied applies apply are aren aria-checked aria-current aria-expanded aria-expanded:bg-fd-accent aria-expanded:decoration-solid aria-expanded:text-fd-accent-foreground aria-hidden aria-label aria-live aria-pressed arkdown array arrow arrows as aside async at audience auth authNode authProviders authSchemes authenticate authorization authorizationCode authorizationUrl authorization_code authorization_pending authorization_url authorize authorized authorizes auto-cols-[minmax(0,max-content)] autoComplete available avoid await away back backdrop-blur-[1px] backdrop-blur-xs badgeVariants bar base basic basis-full be bearer before behavior below beside between bg-amber-500 bg-amber-500/10 bg-black/40 bg-blue-500 bg-current/10 bg-fd-accent bg-fd-background bg-fd-card bg-fd-card/70 bg-fd-muted bg-fd-muted-foreground bg-fd-muted-foreground/50 bg-fd-popover bg-fd-primary bg-fd-primary/10 bg-fd-secondary bg-green-500 bg-linear-to-b bg-linear-to-t bg-red-500 bg-transparent binary block blocked blocks blue body bodyMediaType bodyNode bodyUrlRef boolean border border-0 border-b border-b-0 border-current border-dashed border-fd-border/60 border-fd-muted-foreground/50 border-fd-primary border-s border-t border-x-0 bottom bottom-0 box box-content breadcrumbs break-all browser browsers built-in builtinAuthProviders builtinProviders bundled busy but button buttonVariants buttons by bytes cache cached cachedDocFiles callbacks callbacksNode came can cancel cancelled candidates cannot caption captionCodeBlock captioned card cardCodeBlock cards case catch cause cell center certificate ch challenge change changes changing charset check checkbox checked chevron chevronClassName children chosen class class-variance-authority className cleanup clear clearResponse click clicking client client-rendered clientAuth clientCredentials clientId clientSecret clientWidth client_auth client_credentials client_error client_id client_secret clients cloned close closeDelay closed closest cn code codeProps codeUsages code_challenge code_challenge_method code_verifier codeblock col-span-2 col-span-full col-start-2 collapse collapses color colors column come component components compute confidential config configUrl configuration configurations connecting connection const constraints consumers container content contentTypes contents control controller controllerRef controls cookie cookieString cookies copies copy copyable copying core could count covered covers createContext createOAuthHandler createOpenAPIPage createOpenAPIPageBase createProxy created credentials cross-origin crumbClassName crumbs css csv ctions ctx current currentValue cursor-help cursor-pointer cursor-text custom customise customization cyan dark dark-mode dark:bg-fd-accent dark:text-amber-400 dark:text-blue-400 dark:text-cyan-400 dark:text-green-400 dark:text-orange-400 dark:text-red-400 dark:text-yellow-400 data data-[disabled]:opacity-50 data-[disabled]:pointer-events-none data-[highlighted]:bg-fd-accent data-[highlighted]:text-fd-accent-foreground data-active:text-fd-foreground data-checked data-checked:bg-fd-primary data-checked:bg-fd-primary-foreground data-checked:text-fd-accent-foreground data-checked:translate-x-3 data-empty:hidden data-ending-style:duration-150 data-ending-style:h-0 data-ending-style:opacity-0 data-ending-style:scale-95 data-ending-style:scale-[0.97] data-ending-style:scale-[0.98] data-highlighted:bg-fd-accent data-highlighted:text-fd-accent-foreground data-placeholder:text-fd-muted-foreground data-popup-open:bg-fd-accent data-popup-open:text-fd-accent-foreground data-popup-open:underline data-starting-style:h-0 data-starting-style:opacity-0 data-starting-style:scale-95 data-starting-style:scale-[0.98] dataEngine decimal declare decode decoration-dotted default defaultColor defaultMdxComponents defaultShikiFactory defaultShikiOptions defaultValue defaultValues defaults define definitions delay delay-150 delete deprecated depth dereference dereferenced described describes description descriptionNode descriptions detail details device deviceAuthorization deviceAuthorizationUrl device_authorization_url device_code devices dialog didn direction directories disable disableCache disabled disabled:cursor-not-allowed disabled:opacity-50 disabled:opacity-80 discovered discovering display displayNames disposition div doc docCache docFilesCache docRoot docs document documents does doesn domain don download downloaded drives drop duplicated duration duration-150 duration-200 duration-250 duration-300 dynamic dynamicSource e each eading early ease-[cubic-bezier(0.16,1,0.3,1)] ease-[cubic-bezier(0.22,1,0.36,1)] ease-out edge edit edited editing editor edits element elements else empty enabled encode encodeRequestData end ending endpoint endpoints ends enforce engine enter entered entries entry enum err error error_description errors eslint-disable-next-line even every example exampleCardClassName exampleCodeBlock examples exclusiveMax exclusiveMin expand expanded expands expected expiresAt expires_in export exported expressions extended extends fades failed fallback false fast-content-type-parse fd-page-tree-item-name fd-scroll-container fetch fetchOptions fetcher field field-sizing-content fieldData fieldName fields file fileName files fill-current filled filling fills filter filterable finally finishes finishing first first:border-t-0 first:mt-0 fixed flattened flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flow-root flowInfo flowReturned flows flushSync focus-visible:bg-fd-accent focus-visible:bg-fd-accent/40 focus-visible:bg-fd-primary/15 focus-visible:bg-fd-secondary focus-visible:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-fd-primary/30 focus-visible:ring-fd-ring focus-visible:ring-inset focus-visible:text-fd-accent-foreground focus-within:ring-1 focus-within:ring-fd-ring focus:outline-hidden focus:ring focus:ring-0 focus:ring-fd-ring follow font-light font-medium font-mono font-normal font-sans font-semibold for form form-encoded format forward fragment frameworks from from-fd-popover full fumadocs-core/highlight fumadocs-core/source fumadocs-core/toc fumadocs-openapi-flow fumadocs-openapi-oauth fumadocs-openapi-oauth-returned fumadocs-ui/mdx fumadocs:openapi fumadocs_openapi_requests function gap-0.5 gap-1 gap-1.5 gap-2 gap-2.5 gap-24 gap-3 gap-4 gap-x-2 gap-x-3 gap-x-6 gap-y-1 gap-y-4 generate generateDefault generateSchemaUI generateTypeScriptDefinitions generated generators get getLink getOpenAPIPageProps getPageProps getPreferredType getRaw getSchema getSchemas getState gets ghost github-dark github-light given gives go goes going grant_type grant_types_supported grants gray green grid grid-cols-[auto_minmax(0,1fr)] grid-cols-[auto_minmax(0,1fr)_auto] grid-cols-[minmax(0,1fr)_auto] grid-cols-[minmax(0,2fr)_minmax(0,3fr)] grid-flow-col grid-rows-[auto_minmax(0,1fr)] group group-data-[panel-open]/accordion:rotate-90 group-data-popup-open:rotate-180 group-hover/nav:translate-x-0.5 group-hover/open:translate-x-0.5 group-hover/property:opacity-100 group-hover:translate-x-0.5 group-hover:translate-x-px group/accordion group/nav group/open group/property group/row h-(--accordion-panel-height) h-(--active-tab-height) h-(--collapsible-panel-height) h-10 h-12 h-4 h-6 h-7 h-8 h-9 h-[calc(--spacing(10)-1px)] h-full h-px h1 handle handled handles happens has has-focus-visible:bg-fd-secondary hasVariables hash have headNode header headerRef headers heading headingLevel headless here hidden hiddenKeys highlighted highlighter highlights hint holding hook hour hour12 hover hover:bg-fd-accent hover:bg-fd-accent/40 hover:bg-fd-accent/50 hover:bg-fd-primary/15 hover:text-fd-accent-foreground hover:underline how href html htmlFor http i icon icon-sm icon-xs iconButtonClassName id idx if img implicit import imports in includeDocument including index indicator info infoTags init initAuth initial inline inline-flex input inputMode inputs inset-0 inset-x-0 inside installed instanceof instead integer interface interval into invalid invisible is isCopied isDynamic isExpanded isHighlighted isLazy isLoading isMac isNumber isSecret isSending isn issues it item itemSchema itemToStringValue items items-baseline items-center items-start items-stretch its itself js json json-schema-typed justify-between justify-center justify-end k kB keep keeps kept key keyboard keyed keyof keys kind label labelled lang language languages larger last last:border-b-0 last:shrink-0 lasts latest layout layouts lazy leading-5 leading-[1.375rem] leading-relaxed leave leaving left left-0 length let light light-mode like line line-clamp-3 line-through link links list listed listener listeners literal live load loadDocument loaded loaderPlugin loading loads location lock locked log long longer looks lowercase lucide-react make malformed many map mapValues margin margins marked masked match matches matching max max-age max-h-(--available-height) max-h-[min(18rem,30vh)] max-h-[min(var(--available-height),20rem)] max-h-none max-md:hidden max-w-1/2 max-w-40 max-w-60 max-w-64 max-w-72 max-w-80 max-w-[calc(100vw-2rem)] max-w-full maxEntries may mb-3 mb-4 md md:border-s md:grid-cols-[minmax(0,11fr)_minmax(0,9fr)] md:hidden me-1 me-2 me-auto measure measured measures media mediaAdapters mediaType member members memoized menu menuItems merge message messages metaData metaKey method methods milliseconds mime min min-h-0 min-h-10 min-h-11 min-h-60 min-h-9 min-h-full min-w-0 min-w-16 min-w-40 min-w-[calc(var(--anchor-width)+--spacing(2))] minute mode more motion motion-reduce:transition-none motion-reduce:transition-opacity motion-safe:-translate-x-6 motion-safe:animate-pulse motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0.16,1,0.3,1)] motion-safe:starting:-translate-x-2 motion-safe:starting:-translate-x-6 motion-safe:starting:-translate-y-4 motion-safe:starting:opacity-0 motion-safe:starting:scale-0 motion-safe:starting:scale-150 motion-safe:starting:translate-x-2 motion-safe:starting:translate-x-6 motion-safe:starting:translate-y-1 motion-safe:starting:translate-y-4 motion-safe:transition-[opacity,translate] motion-safe:transition-opacity motion-safe:transition-transform motionClassNames mounts move moves ms ms-1 ms-1.5 ms-auto mt-0! mt-0.5 mt-1 mt-1.5 mt-10 mt-2.5 mt-px multi-type multipart/form-data multiple must muted mutual mutualTLS mx-3 mx-px my-0! my-1 my-3 name name! nameClassName named names namespace narrow nav navigate navigated navigator nearest needs nested network never new next next/previous nextId no no-cache noValidate node noreferrer normalizes not not-first:border-s not-prose note now null number oauth oauth2 oauthRedirectUrl object objectGet objects observer obtain of off ok older omit omitted on onAppend onAuthorize onBack onCancel onChange onCheckedChange onClear onClick onCopy onKeyDown onLink onNavigate onOpenChange onRemove onReset onReturn onRoot onSelect onSubmit onUserCode onValueChange once one oneOf ones only opacity-0 opacity-60 opacity-80 open openApiData openIdConnect openIdConnectUrl openNested openOnHover openOnInputClick openapi openapiMeta opened opening opens operation optional options or orange origin origin-(--transform-origin) other others otherwise out outline-hidden output outside over overflow-auto overflow-clip overflow-hidden overflow-x-auto overflow-y-auto override overview own p-0.5 p-1 p-1.5 p-2 p-2.5 p-3 p-4 p-5 p-6 packages padding page pageData pages panel panelCodeBlock panelKey panelTopCodeBlock panels param parameter parameterLabel parameterNode parameters params parent parentIndex parents parsed parts party pass password paste patch path pathItem pathnameFromRequest pattern patternProperties payload pb-1 pb-2 pb-2.5 pb-3 pe-1 pe-1.5 pe-2 pe-3 pe-4 pendingFlowKey per persisted pill place placed placeholder placeholder:font-sans placeholder:text-fd-muted-foreground placeholder:text-fd-muted-foreground/70 placeholder:text-fd-primary/50 plain playground playgrounds please plugins pointer-coarse:opacity-100 polite poll polling popover pops popup port position postForm pre preferred prefers preloadOpenAPIPage preloaded presents prev preventDefault preview previous primary primitive private processor prop properties property props prose prose-no-margin prose-sm prose-xs provider providers proxied proxy proxyForwardCookie proxyUrl ps-1 ps-1.5 ps-3 ps-3.5 ps-4 ps-6 pt-1.5 pt-2 pt-2.5 public px-1 px-1.5 px-2 px-2.5 px-3 px-4 py-0 py-0.5 py-1 py-1.5 py-2 py-2.5 py-3 py-6 py-8 q query quiet random range raw reach react react-dom react-hooks/exhaustive-deps read read-only readOnly readers readonly reads received record red redirect redirectUrl redirect_uri redirected redirects ref reference refs regenerated rejected rejects rel relative reloading remark remark-rehype remarkGfm remarkRehype remembered remounted removable removal remove removeItem removed render renderAPIExampleUsageTabs renderBodyField renderCodeblock renderDefault renderMarkdown renderParameterField rendered renderers renders replace replaces represents request request-body requestBody requestData requestInit requestTimeout requestUrl requested requesting requests required requirement requirements res reset resize-none resized resolve resolveMediaAdapter resolveUrl resolved resolvedInput resolvedTheme resolves respond response response-body responseNode responseTabs response_type responses rest restore restored result return returned returnedFlow returnedScheme returnedUrl returning returns reversed revoked right ring-1 ring-3 ring-fd-border ring-green-500/20 role room root rootId rounded-[5px] rounded-full rounded-lg rounded-md rounded-none rounded-sm rounded-xl route row row-span-2 row-start-1 row-start-2 rowButtonClassName rows run runtime s safeParse same sample satisfies says scalar scan schema schemaId schemaKeys schemaUI schemas scheme schemeId schemes scope scopeOptions scopes scopes_supported screen screens scroll scroll-m-20 scroll-mt-[calc(var(--fd-docs-row-3,0px)+1rem)] scrollArrowClassName scrollMarginClassName scrolling search second secondary seconds secret secretSchema secrets section sectionIcons sectionNames sections security see segment segmentClassName segments segs select select-all select-none selectExample selectable selected selectedCodeUsages selectedType selecting selection selector selectors selects self-center self-stretch send sender sending sends sent server server-to-server serverSchema serverUrl servers services session sessionStorage set setAuthorizing setClientAuth setCode setCollapsed setDraft setFilter setIndex setInfo setMode setMotion setName setOpen setResponse setScopes setSelected setSelectedFor setSending setServerVariables setShowSchema setStack setType setUserCode setValue setView several shadow-lg shadow-md shadow-none shadow-sm share shared shared-api/auto-anchor shared-api/source shiki shikiOptions shortcut shorten show showDescription showExample showResponseSchema showTitle shown shows shrink shrink-0 shrinks sibling siblings side sideOffset signal signing single sits size size-2 size-3 size-3.5 size-4 size-5 skipNonRequired skipReadOnly slashes slides sliding slots slow_down sm sm:-translate-x-1/2 sm:-translate-y-1/2 sm:border sm:h-[min(52rem,calc(100dvh-3rem))] sm:inline sm:inset-auto sm:left-1/2 sm:max-h-[min(52rem,calc(100dvh-3rem))] sm:mb-4 sm:mx-4 sm:ps-5 sm:px-4 sm:rounded-2xl sm:shadow-2xl sm:top-1/2 sm:w-[min(64rem,calc(100vw-3rem))] sm:w-[min(80rem,calc(100vw-3rem))] small smaller smooth so some something space spellCheck sr-only src stable stack start started starting starting:opacity-0 starts state staticSource status statusInfo stay stays step stf sticky still stops storage storageKey storageKeyPrefix store stored string stringifyFieldKey structuredData style styles submit subscribe subscribeNever successful such suggestions summary suspends svg switch switches switching sync syncExample synced t tPlayground tab tabIndex tabs tabular-nums tag tagClassName taken takes target telling text text-4xl text-[0.8125rem] text-amber-600 text-blue-600 text-center text-cyan-600 text-fd-accent-foreground text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-muted-foreground/60 text-fd-muted-foreground/70 text-fd-popover-foreground text-fd-primary text-fd-primary-foreground text-fd-secondary-foreground text-green-600 text-nowrap text-orange-600 text-red-400 text-red-600 text-sm text-start text-xl text-xs text-yellow-600 text/css text/csv text/html text/plain texts than that the their them themes then there they this three through throw time timeFormat timeout timer timerRef tips title titleBarClassName tls to to-transparent toStaticData toVirtualFiles toc toggle toggled token tokenUrl token_type token_url top top-(--active-tab-top) top-0 total tracking-tight tracking-widest transform transformPageTree transition-[background-color,scale] transition-[height,opacity] transition-[height] transition-[opacity,scale] transition-[translate,background-color] transition-[translate,width] transition-colors transition-opacity transition-shadow transition-transform transitionClassName translate-x-(--active-tab-left) translations trigger true truncate truncating try turns type typeClassName typeof types typing undefined under underline underline-offset-4 undici union unionField unions unique unit unknown unless unset unsetting until up update updateInfo updated updating upper url urn:ietf:params:oauth:grant-type:device_code usage usageTabs usages use useAnchorId useAnchorLink useApiClient useComponents useCopyButton useDataEngine useEffect useFieldValue useListener useMemo useNamespace useOnChange useOpenAPI useOperation useQuery useRef useRenderContext useResolvedSchema useResponseExamples useSchemaUtils useServer useState useStf useSyncExternalStore useTheme useTranslations userCode user_code username users using v value valueSchema values variable variables variant variants verification verificationUri verificationUriComplete verification_uri verifier via view viewportClassName viewportProps views virtual void w-(--active-tab-width) w-6 w-7 w-72 w-[min(26rem,calc(100vw-2rem))] w-auto w-fit w-full w-max warn warning warns was we webhook webhooks what when where which while whitespace-pre whitespace-pre-wrap whole whose why width widths will window with without would wrap wrap-anywhere wrap-break-word wrapping write writeOnly written x-exclusiveCodeSample x-playground-lazy xml yellow yet your z-0 z-10 z-50");
|
package/dist/operation.js
CHANGED
|
@@ -20,6 +20,17 @@ const parameterLocations = [
|
|
|
20
20
|
"header",
|
|
21
21
|
"cookie"
|
|
22
22
|
];
|
|
23
|
+
/** a sequential media type with only `itemSchema` has the array of its items as its content (OpenAPI 3.2) */
|
|
24
|
+
function resolveMedia(media) {
|
|
25
|
+
if (media.schema || !media.itemSchema) return media;
|
|
26
|
+
return {
|
|
27
|
+
...media,
|
|
28
|
+
schema: {
|
|
29
|
+
type: "array",
|
|
30
|
+
items: media.itemSchema
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
23
34
|
function OperationProvider({ type = "operation", path, method, operation, pathItem, children }) {
|
|
24
35
|
const runtime = useOpenAPI();
|
|
25
36
|
const state = useMemo(() => {
|
|
@@ -28,7 +39,7 @@ function OperationProvider({ type = "operation", path, method, operation, pathIt
|
|
|
28
39
|
let requestBody;
|
|
29
40
|
if (body?.content && Object.keys(body.content).length > 0) {
|
|
30
41
|
const content = {};
|
|
31
|
-
for (const [mediaType, item] of Object.entries(body.content)) content[mediaType] = resolve(item);
|
|
42
|
+
for (const [mediaType, item] of Object.entries(body.content)) content[mediaType] = resolveMedia(resolve(item));
|
|
32
43
|
requestBody = {
|
|
33
44
|
description: body.description,
|
|
34
45
|
required: body.required,
|
|
@@ -69,7 +80,7 @@ function OperationProvider({ type = "operation", path, method, operation, pathIt
|
|
|
69
80
|
for (const [status, item] of Object.entries(operation.responses ?? {})) {
|
|
70
81
|
const response = resolve(item);
|
|
71
82
|
const content = {};
|
|
72
|
-
for (const [mediaType, media] of Object.entries(response.content ?? {})) content[mediaType] = resolve(media);
|
|
83
|
+
for (const [mediaType, media] of Object.entries(response.content ?? {})) content[mediaType] = resolveMedia(resolve(media));
|
|
73
84
|
responses.push({
|
|
74
85
|
status,
|
|
75
86
|
response,
|
|
@@ -104,7 +115,7 @@ function OperationProvider({ type = "operation", path, method, operation, pathIt
|
|
|
104
115
|
const examples = getExampleRequests({
|
|
105
116
|
path,
|
|
106
117
|
method,
|
|
107
|
-
|
|
118
|
+
requestBody,
|
|
108
119
|
parameters: resolvedParameters,
|
|
109
120
|
mediaAdapters: runtime.mediaAdapters
|
|
110
121
|
});
|
|
@@ -9,7 +9,7 @@ import { Dialog } from "@base-ui/react/dialog";
|
|
|
9
9
|
/** the popup of a dialog, a window on larger screens and the full screen on smaller ones */
|
|
10
10
|
function DialogPopup({ className, children }) {
|
|
11
11
|
return /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, { className: "fixed inset-0 z-50 bg-black/40 backdrop-blur-xs transition-opacity duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0" }), /* @__PURE__ */ jsx(Dialog.Popup, {
|
|
12
|
-
className: cn("fixed inset-0 z-50 flex flex-col overflow-hidden bg-fd-background text-fd-foreground outline-
|
|
12
|
+
className: cn("fixed inset-0 z-50 flex flex-col overflow-hidden bg-fd-background text-fd-foreground outline-hidden transition-[opacity,scale] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] data-ending-style:scale-[0.98] data-ending-style:opacity-0 data-ending-style:duration-150 data-starting-style:scale-[0.98] data-starting-style:opacity-0 motion-reduce:transition-opacity sm:inset-auto sm:top-1/2 sm:left-1/2 sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-2xl sm:border sm:shadow-2xl", className),
|
|
13
13
|
children
|
|
14
14
|
})] });
|
|
15
15
|
}
|
|
@@ -17,7 +17,7 @@ import { Autocomplete } from "@base-ui/react/autocomplete";
|
|
|
17
17
|
import { Popover } from "@base-ui/react/popover";
|
|
18
18
|
// ../shared-api/dist/components/playground/fields.js
|
|
19
19
|
/** a segment of the type pill, the type or an action on the field */
|
|
20
|
-
const segmentClassName = "flex items-center transition-colors not-first:border-s hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:bg-fd-accent focus-visible:outline-
|
|
20
|
+
const segmentClassName = "flex items-center transition-colors not-first:border-s hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:bg-fd-accent focus-visible:outline-hidden data-popup-open:bg-fd-accent data-popup-open:text-fd-accent-foreground";
|
|
21
21
|
/** the type of a field and the actions on it, like changing its type or unsetting it */
|
|
22
22
|
function TypePill({ type, action, quiet = false }) {
|
|
23
23
|
return /* @__PURE__ */ jsxs("span", {
|
|
@@ -29,7 +29,7 @@ function TypePill({ type, action, quiet = false }) {
|
|
|
29
29
|
}) : type, action]
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
const rowButtonClassName = "flex h-10 w-full items-center gap-2 px-4 text-[0.8125rem] text-fd-muted-foreground transition-colors hover:bg-fd-accent/40 hover:text-fd-accent-foreground focus-visible:bg-fd-secondary focus-visible:text-fd-accent-foreground focus-visible:outline-
|
|
32
|
+
const rowButtonClassName = "flex h-10 w-full items-center gap-2 px-4 text-[0.8125rem] text-fd-muted-foreground transition-colors hover:bg-fd-accent/40 hover:text-fd-accent-foreground focus-visible:bg-fd-secondary focus-visible:text-fd-accent-foreground focus-visible:outline-hidden";
|
|
33
33
|
function getType(field) {
|
|
34
34
|
if (typeof field.type === "string") return field.type;
|
|
35
35
|
if (field.properties || field.patternProperties || field.additionalProperties) return "object";
|
|
@@ -190,7 +190,7 @@ function Row({ name, required = false, info, htmlFor, readOnly = false, quiet =
|
|
|
190
190
|
delay: 200,
|
|
191
191
|
closeDelay: 100,
|
|
192
192
|
title: name,
|
|
193
|
-
className: cn(nameClassName, "cursor-help rounded-sm decoration-dotted underline-offset-4 hover:underline focus-visible:outline-
|
|
193
|
+
className: cn(nameClassName, "cursor-help rounded-sm decoration-dotted underline-offset-4 hover:underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-fd-ring data-popup-open:underline"),
|
|
194
194
|
children: name
|
|
195
195
|
}),
|
|
196
196
|
/* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
@@ -199,7 +199,7 @@ function Row({ name, required = false, info, htmlFor, readOnly = false, quiet =
|
|
|
199
199
|
sideOffset: 6,
|
|
200
200
|
className: "z-50",
|
|
201
201
|
children: /* @__PURE__ */ jsx(Popover.Popup, {
|
|
202
|
-
className: "w-72 max-w-[calc(100vw-2rem)] origin-(--transform-origin) wrap-break-word rounded-xl border bg-fd-popover p-3 text-fd-popover-foreground shadow-lg outline-
|
|
202
|
+
className: "w-72 max-w-[calc(100vw-2rem)] origin-(--transform-origin) wrap-break-word rounded-xl border bg-fd-popover p-3 text-fd-popover-foreground shadow-lg outline-hidden transition-[opacity,scale] duration-150 ease-out data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:transition-none",
|
|
203
203
|
children: info
|
|
204
204
|
})
|
|
205
205
|
}) })
|
|
@@ -384,7 +384,7 @@ function FieldValue({ id, fieldName, field }) {
|
|
|
384
384
|
if (!isNumber) setValue(e.target.value);
|
|
385
385
|
else setValue(Number.isNaN(e.target.valueAsNumber) ? void 0 : e.target.valueAsNumber);
|
|
386
386
|
},
|
|
387
|
-
className: "min-w-0 flex-1 bg-transparent px-3 text-fd-foreground outline-
|
|
387
|
+
className: "min-w-0 flex-1 bg-transparent px-3 text-fd-foreground outline-hidden placeholder:text-fd-muted-foreground/70"
|
|
388
388
|
});
|
|
389
389
|
}
|
|
390
390
|
/** an object or array, opened in its own panel */
|
|
@@ -414,7 +414,7 @@ function NavRow({ fieldName, field, type, required, marked = required, name, des
|
|
|
414
414
|
id,
|
|
415
415
|
type: "button",
|
|
416
416
|
onClick: onNavigate,
|
|
417
|
-
className: "flex min-w-0 flex-1 items-center px-3 text-start outline-
|
|
417
|
+
className: "flex min-w-0 flex-1 items-center px-3 text-start outline-hidden",
|
|
418
418
|
children: preview !== null ? /* @__PURE__ */ jsx("span", {
|
|
419
419
|
className: "truncate font-mono text-xs",
|
|
420
420
|
children: preview
|
|
@@ -433,7 +433,7 @@ function CellSelect({ id, items, value, onValueChange, placeholder }) {
|
|
|
433
433
|
onValueChange: (v) => v !== null && onValueChange(v),
|
|
434
434
|
children: [/* @__PURE__ */ jsx(Select.Trigger, {
|
|
435
435
|
id,
|
|
436
|
-
className: "flex min-w-0 flex-1 cursor-pointer items-center px-3 text-start text-fd-foreground outline-
|
|
436
|
+
className: "flex min-w-0 flex-1 cursor-pointer items-center px-3 text-start text-fd-foreground outline-hidden data-placeholder:text-fd-muted-foreground",
|
|
437
437
|
children: /* @__PURE__ */ jsxs("span", {
|
|
438
438
|
className: "flex min-w-0 flex-1 items-center justify-between gap-2 font-mono text-xs",
|
|
439
439
|
children: [/* @__PURE__ */ jsx(SelectValue, {
|
|
@@ -474,7 +474,7 @@ function CellAutocomplete({ id, items, value, onValueChange, placeholder }) {
|
|
|
474
474
|
id,
|
|
475
475
|
spellCheck: false,
|
|
476
476
|
placeholder,
|
|
477
|
-
className: "min-w-0 flex-1 self-stretch bg-transparent px-3 text-fd-foreground outline-
|
|
477
|
+
className: "min-w-0 flex-1 self-stretch bg-transparent px-3 text-fd-foreground outline-hidden placeholder:text-fd-muted-foreground/70"
|
|
478
478
|
})
|
|
479
479
|
}), /* @__PURE__ */ jsx(Autocomplete.Portal, { children: /* @__PURE__ */ jsx(Autocomplete.Positioner, {
|
|
480
480
|
align: "start",
|
|
@@ -484,7 +484,7 @@ function CellAutocomplete({ id, items, value, onValueChange, placeholder }) {
|
|
|
484
484
|
className: "max-h-[min(var(--available-height),20rem)] min-w-[calc(var(--anchor-width)+--spacing(2))] overflow-y-auto rounded-lg border bg-fd-popover p-1 text-fd-popover-foreground shadow-md data-empty:hidden",
|
|
485
485
|
children: /* @__PURE__ */ jsx(Autocomplete.List, { children: (item) => /* @__PURE__ */ jsxs(Autocomplete.Item, {
|
|
486
486
|
value: item,
|
|
487
|
-
className: "flex select-none items-center gap-2 rounded-md px-2 py-1.5 text-[0.8125rem] outline-
|
|
487
|
+
className: "flex select-none items-center gap-2 rounded-md px-2 py-1.5 text-[0.8125rem] outline-hidden data-highlighted:bg-fd-accent data-highlighted:text-fd-accent-foreground",
|
|
488
488
|
children: [item.label, item.value === value && /* @__PURE__ */ jsx(Check, { className: "ms-auto size-3.5 shrink-0 text-fd-primary" })]
|
|
489
489
|
}, item.value) })
|
|
490
490
|
})
|
|
@@ -557,7 +557,7 @@ function CheckRow({ name, checked, onCheckedChange, children }) {
|
|
|
557
557
|
role: "checkbox",
|
|
558
558
|
"aria-checked": checked,
|
|
559
559
|
onClick: () => onCheckedChange(!checked),
|
|
560
|
-
className: "flex min-w-0 flex-1 items-center gap-2 px-3 text-start outline-
|
|
560
|
+
className: "flex min-w-0 flex-1 items-center gap-2 px-3 text-start outline-hidden",
|
|
561
561
|
children: [/* @__PURE__ */ jsx("span", {
|
|
562
562
|
className: "min-w-0 flex-1 truncate text-fd-muted-foreground",
|
|
563
563
|
children
|
|
@@ -615,7 +615,7 @@ function QuietRow({ name, fieldName, field, description, type, onNavigate }) {
|
|
|
615
615
|
type: "button",
|
|
616
616
|
"aria-label": label,
|
|
617
617
|
onClick: edit,
|
|
618
|
-
className: "flex min-w-0 flex-1 items-center px-3 text-start text-fd-muted-foreground/70 outline-
|
|
618
|
+
className: "flex min-w-0 flex-1 items-center px-3 text-start text-fd-muted-foreground/70 outline-hidden",
|
|
619
619
|
children: hint !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
620
620
|
className: cn("truncate", (typeof hint !== "string" || getOptions(field)) && "font-mono text-xs"),
|
|
621
621
|
children: valueLabel(hint)
|
|
@@ -711,7 +711,7 @@ function ObjectRows({ fieldName, field, onNavigate }) {
|
|
|
711
711
|
value: null,
|
|
712
712
|
onValueChange: (v) => v !== null && onAppend(v),
|
|
713
713
|
children: [/* @__PURE__ */ jsxs(Select.Trigger, {
|
|
714
|
-
className: cn(rowButtonClassName, "cursor-pointer
|
|
714
|
+
className: cn(rowButtonClassName, "cursor-pointer", isDynamic && "border-b"),
|
|
715
715
|
children: [/* @__PURE__ */ jsx(Plus, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ jsxs("span", {
|
|
716
716
|
className: "flex min-w-0 items-center gap-1.5",
|
|
717
717
|
children: [/* @__PURE__ */ jsx(SelectValue, {
|
|
@@ -752,7 +752,7 @@ function NewPropertyRow({ onAppend }) {
|
|
|
752
752
|
e.preventDefault();
|
|
753
753
|
add();
|
|
754
754
|
},
|
|
755
|
-
className: "h-10 min-w-0 flex-1 bg-transparent font-mono text-[0.8125rem] outline-
|
|
755
|
+
className: "h-10 min-w-0 flex-1 bg-transparent font-mono text-[0.8125rem] outline-hidden placeholder:text-fd-muted-foreground/70"
|
|
756
756
|
}),
|
|
757
757
|
/* @__PURE__ */ jsx("button", {
|
|
758
758
|
type: "button",
|
|
@@ -40,7 +40,7 @@ function JsonEditor({ fieldName }) {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
className: "min-h-60 w-full resize-none bg-transparent px-4 py-3 font-mono text-[0.8125rem] leading-relaxed outline-
|
|
43
|
+
className: "min-h-60 w-full resize-none bg-transparent px-4 py-3 font-mono text-[0.8125rem] leading-relaxed outline-hidden field-sizing-content"
|
|
44
44
|
}), draft.error && /* @__PURE__ */ jsx("p", {
|
|
45
45
|
className: "border-t px-4 py-2 font-mono text-xs text-red-400",
|
|
46
46
|
children: draft.error
|
|
@@ -109,7 +109,7 @@ function Panel({ id, motion, nav, children }) {
|
|
|
109
109
|
}, id)]
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
|
-
const crumbClassName = "truncate rounded-md px-1.5 py-1 text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:outline-
|
|
112
|
+
const crumbClassName = "truncate rounded-md px-1.5 py-1 text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-fd-ring";
|
|
113
113
|
/** the bar on top of a panel, going back to the overview from `root` */
|
|
114
114
|
function PanelNav({ root, onRoot, onBack, end, children }) {
|
|
115
115
|
const t = useTranslations({ note: "playground" });
|
|
@@ -4,7 +4,7 @@ import { cn } from "../../utils/cn.js";
|
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { useFieldValue } from "@fumari/stf";
|
|
6
6
|
// ../shared-api/dist/components/playground/param-input.js
|
|
7
|
-
const className = "mx-px rounded-md bg-fd-primary/10 px-1.5 py-0.5 text-fd-primary outline-
|
|
7
|
+
const className = "mx-px rounded-md bg-fd-primary/10 px-1.5 py-0.5 text-fd-primary outline-hidden transition-colors placeholder:text-fd-primary/50 hover:bg-fd-primary/15 focus-visible:bg-fd-primary/15 focus-visible:ring-2 focus-visible:ring-fd-primary/30";
|
|
8
8
|
/** a parameter of a URL edited in place, like `{id}` of `/users/{id}` */
|
|
9
9
|
function ParamInput({ fieldName, name, schema = true, description }) {
|
|
10
10
|
const resolved = useResolvedSchema(schema);
|
|
@@ -17,7 +17,7 @@ function ServerPopover({ label, title, options, value, onValueChange, className,
|
|
|
17
17
|
open,
|
|
18
18
|
onOpenChange: setOpen,
|
|
19
19
|
children: [/* @__PURE__ */ jsxs(Popover.Trigger, {
|
|
20
|
-
className: cn("group flex min-w-0 shrink items-center gap-1.5 rounded-lg px-1.5 py-1 text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:outline-
|
|
20
|
+
className: cn("group flex min-w-0 shrink items-center gap-1.5 rounded-lg px-1.5 py-1 text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-fd-ring data-popup-open:bg-fd-accent data-popup-open:text-fd-accent-foreground", className),
|
|
21
21
|
children: [/* @__PURE__ */ jsx("span", {
|
|
22
22
|
className: "truncate",
|
|
23
23
|
children: label
|
|
@@ -28,7 +28,7 @@ function ServerPopover({ label, title, options, value, onValueChange, className,
|
|
|
28
28
|
sideOffset: 8,
|
|
29
29
|
className: "z-50",
|
|
30
30
|
children: /* @__PURE__ */ jsxs(Popover.Popup, {
|
|
31
|
-
className: "flex max-h-(--available-height) w-[min(26rem,calc(100vw-2rem))] origin-(--transform-origin) flex-col overflow-y-auto rounded-xl border bg-fd-popover p-1 text-sm text-fd-popover-foreground shadow-lg transition-[opacity,scale] duration-150 ease-out outline-
|
|
31
|
+
className: "flex max-h-(--available-height) w-[min(26rem,calc(100vw-2rem))] origin-(--transform-origin) flex-col overflow-y-auto rounded-xl border bg-fd-popover p-1 text-sm text-fd-popover-foreground shadow-lg transition-[opacity,scale] duration-150 ease-out outline-hidden data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0",
|
|
32
32
|
children: [
|
|
33
33
|
/* @__PURE__ */ jsx("p", {
|
|
34
34
|
className: "px-2.5 pt-1.5 pb-1 text-xs font-medium text-fd-muted-foreground",
|
|
@@ -43,7 +43,7 @@ function ServerPopover({ label, title, options, value, onValueChange, className,
|
|
|
43
43
|
if (!selected) onValueChange(option.value);
|
|
44
44
|
if (!option.hasVariables) setOpen(false);
|
|
45
45
|
},
|
|
46
|
-
className: cn("flex w-full items-start gap-2 rounded-lg px-2.5 py-2 text-start focus-visible:ring-2 focus-visible:ring-fd-ring focus-visible:outline-
|
|
46
|
+
className: cn("flex w-full items-start gap-2 rounded-lg px-2.5 py-2 text-start focus-visible:ring-2 focus-visible:ring-fd-ring focus-visible:outline-hidden focus-visible:ring-inset", selected ? "bg-fd-accent text-fd-accent-foreground" : "hover:bg-fd-accent/50 hover:text-fd-accent-foreground"),
|
|
47
47
|
children: [/* @__PURE__ */ jsx("span", {
|
|
48
48
|
className: "min-w-0 flex-1",
|
|
49
49
|
children: option.label
|
|
@@ -123,7 +123,7 @@ function VariableInput({ fieldName, variable }) {
|
|
|
123
123
|
value: value ?? "",
|
|
124
124
|
onChange: (e) => setValue(e.target.value),
|
|
125
125
|
placeholder: example ?? t("Enter Value"),
|
|
126
|
-
className: cn("h-8 w-full rounded-md border bg-fd-secondary px-2 font-mono text-[0.8125rem] text-fd-secondary-foreground outline-
|
|
126
|
+
className: cn("h-8 w-full rounded-md border bg-fd-secondary px-2 font-mono text-[0.8125rem] text-fd-secondary-foreground outline-hidden placeholder:text-fd-muted-foreground focus-visible:ring-2 focus-visible:ring-fd-ring", example === void 0 && "placeholder:font-sans")
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
export { ServerPopover, ServerVariables };
|
|
@@ -14,7 +14,7 @@ import { SchemaUIProvider, useSchemaUI } from "@fumadocs/json-schema/react/clien
|
|
|
14
14
|
// ../shared-api/dist/components/schema/client.js
|
|
15
15
|
const TypeContext = createContext(null);
|
|
16
16
|
const typeClassName = "font-mono text-xs text-fd-muted-foreground";
|
|
17
|
-
const crumbClassName = "truncate rounded-md px-1.5 py-1 text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:outline-
|
|
17
|
+
const crumbClassName = "truncate rounded-md px-1.5 py-1 text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-fd-ring data-popup-open:bg-fd-accent";
|
|
18
18
|
const chevronClassName = "size-3.5 shrink-0 text-fd-muted-foreground/60";
|
|
19
19
|
/** below the sticky headers of docs layouts */
|
|
20
20
|
const scrollMarginClassName = "scroll-mt-[calc(var(--fd-docs-row-3,0px)+1rem)]";
|
|
@@ -161,7 +161,7 @@ function SchemaCard({ from = 0, id, selector, actions, className }) {
|
|
|
161
161
|
}),
|
|
162
162
|
"aria-label": t("Filter Properties"),
|
|
163
163
|
placeholder: t("Filter Properties"),
|
|
164
|
-
className: "min-w-0 flex-1 bg-transparent text-[0.8125rem] text-fd-foreground outline-
|
|
164
|
+
className: "min-w-0 flex-1 bg-transparent text-[0.8125rem] text-fd-foreground outline-hidden placeholder:text-fd-muted-foreground"
|
|
165
165
|
})]
|
|
166
166
|
}), actions]
|
|
167
167
|
})
|
|
@@ -216,7 +216,7 @@ function Breadcrumbs({ from, unions, onBack }) {
|
|
|
216
216
|
if (i > from && i <= from + hidden) {
|
|
217
217
|
menuItems.push(/* @__PURE__ */ jsx(Menu.Item, {
|
|
218
218
|
onClick: () => onBack(i),
|
|
219
|
-
className: "truncate rounded-md px-2 py-1.5 outline-
|
|
219
|
+
className: "truncate rounded-md px-2 py-1.5 outline-hidden data-highlighted:bg-fd-accent data-highlighted:text-fd-accent-foreground",
|
|
220
220
|
children: name
|
|
221
221
|
}, i));
|
|
222
222
|
continue;
|
|
@@ -246,7 +246,7 @@ function Breadcrumbs({ from, unions, onBack }) {
|
|
|
246
246
|
sideOffset: 4,
|
|
247
247
|
className: "z-50",
|
|
248
248
|
children: /* @__PURE__ */ jsx(Menu.Popup, {
|
|
249
|
-
className: "flex max-h-(--available-height) max-w-72 min-w-40 origin-(--transform-origin) flex-col overflow-y-auto rounded-xl border bg-fd-popover p-1 font-mono text-[0.8125rem] text-fd-popover-foreground shadow-lg outline-
|
|
249
|
+
className: "flex max-h-(--available-height) max-w-72 min-w-40 origin-(--transform-origin) flex-col overflow-y-auto rounded-xl border bg-fd-popover p-1 font-mono text-[0.8125rem] text-fd-popover-foreground shadow-lg outline-hidden transition-[opacity,scale] duration-150 ease-[cubic-bezier(0.22,1,0.36,1)] data-ending-style:scale-[0.97] data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:transition-none",
|
|
250
250
|
children: menuItems
|
|
251
251
|
})
|
|
252
252
|
}) })] })]
|
|
@@ -471,7 +471,7 @@ function OpenTag({ label, value, open: { name, $ref } }) {
|
|
|
471
471
|
type: "button",
|
|
472
472
|
"aria-expanded": isExpanded?.(name, $ref),
|
|
473
473
|
onClick: () => open(name, $ref),
|
|
474
|
-
className: cn(tagClassName, "group/open inline-flex max-w-full items-center gap-1.5 text-start transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:outline-
|
|
474
|
+
className: cn(tagClassName, "group/open inline-flex max-w-full items-center gap-1.5 text-start transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-fd-ring aria-expanded:bg-fd-accent"),
|
|
475
475
|
children: [
|
|
476
476
|
/* @__PURE__ */ jsx("span", {
|
|
477
477
|
className: "not-prose shrink-0 text-fd-muted-foreground",
|
|
@@ -12,7 +12,7 @@ function SegmentedList({ items, className, ...props }) {
|
|
|
12
12
|
className: cn("relative z-0 flex items-center rounded-lg bg-fd-secondary p-0.5 text-xs font-medium", className),
|
|
13
13
|
children: [items.map((item) => /* @__PURE__ */ jsx(Tabs.Tab, {
|
|
14
14
|
value: item.value,
|
|
15
|
-
className: "inline-flex h-6 items-center gap-1.5 rounded-md px-2 text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground focus-visible:outline-
|
|
15
|
+
className: "inline-flex h-6 items-center gap-1.5 rounded-md px-2 text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-fd-ring data-active:text-fd-foreground",
|
|
16
16
|
children: item.label
|
|
17
17
|
}, item.value)), /* @__PURE__ */ jsx(Tabs.Indicator, { className: "absolute top-(--active-tab-top) left-0 -z-1 h-(--active-tab-height) w-(--active-tab-width) translate-x-(--active-tab-left) rounded-md bg-fd-background shadow-sm ring-1 ring-fd-border transition-[translate,width] duration-250 ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none dark:bg-fd-accent" })]
|
|
18
18
|
});
|
|
@@ -10,7 +10,7 @@ const SelectValue = Select$1.Value;
|
|
|
10
10
|
function SelectTrigger({ className, children, ref, ...props }) {
|
|
11
11
|
return /* @__PURE__ */ jsxs(Select$1.Trigger, {
|
|
12
12
|
ref,
|
|
13
|
-
className: cn("flex items-center w-full rounded-md border p-2 gap-2 text-start text-sm text-fd-secondary-foreground bg-fd-secondary hover:bg-fd-accent focus:outline-
|
|
13
|
+
className: cn("flex items-center w-full rounded-md border p-2 gap-2 text-start text-sm text-fd-secondary-foreground bg-fd-secondary hover:bg-fd-accent focus:outline-hidden focus:ring focus:ring-fd-ring disabled:cursor-not-allowed disabled:opacity-50 data-placeholder:text-fd-muted-foreground", className),
|
|
14
14
|
...props,
|
|
15
15
|
children: [children, /* @__PURE__ */ jsx(Select$1.Icon, {
|
|
16
16
|
className: "ms-auto text-fd-muted-foreground shrink-0",
|
|
@@ -60,7 +60,7 @@ function SelectItem({ className, children, description, ref, ...props }) {
|
|
|
60
60
|
const text = /* @__PURE__ */ jsx(Select$1.ItemText, { children });
|
|
61
61
|
return /* @__PURE__ */ jsxs(Select$1.Item, {
|
|
62
62
|
ref,
|
|
63
|
-
className: cn("flex select-none flex-row items-center gap-2 rounded-md py-1.5 px-2 text-sm outline-
|
|
63
|
+
className: cn("flex select-none flex-row items-center gap-2 rounded-md py-1.5 px-2 text-sm outline-hidden data-[highlighted]:bg-fd-accent data-[highlighted]:text-fd-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
64
64
|
...props,
|
|
65
65
|
children: [description ? /* @__PURE__ */ jsxs("div", {
|
|
66
66
|
className: "flex flex-col",
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
// ../shared-api/dist/utils/id-to-title.js
|
|
2
2
|
function idToTitle(id) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
else if (c === ".") result = [];
|
|
6
|
-
else if (/^[A-Z]$/.test(c) && result.at(-1) !== " ") result.push(" ", c);
|
|
7
|
-
else if (c === "-") result.push(" ");
|
|
8
|
-
else result.push(c);
|
|
9
|
-
return result.join("");
|
|
3
|
+
const title = id.slice(id.lastIndexOf(".") + 1).replaceAll("-", " ").replace(/([a-z0-9])(?=[A-Z][A-Za-z0-9])/g, "$1 ").replace(/([A-Z]{2,})([A-Z][a-z])/g, "$1 $2");
|
|
4
|
+
return title.charAt(0).toLocaleUpperCase() + title.slice(1);
|
|
10
5
|
}
|
|
11
6
|
export { idToTitle };
|
|
@@ -11,9 +11,9 @@ function useServerStore({ storageKey, keyOf, resolve, defaultKey }) {
|
|
|
11
11
|
useEffect(() => {
|
|
12
12
|
if (restored.current === storageKey) return;
|
|
13
13
|
restored.current = storageKey;
|
|
14
|
-
const cached = localStorage.getItem(storageKey);
|
|
15
|
-
if (!cached) return;
|
|
16
14
|
try {
|
|
15
|
+
const cached = localStorage.getItem(storageKey);
|
|
16
|
+
if (!cached) return;
|
|
17
17
|
const value = JSON.parse(cached);
|
|
18
18
|
if (!isPlainObject(value) || !isPlainObject(value.variables)) return;
|
|
19
19
|
const server = resolve(keyOf(value));
|
|
@@ -32,7 +32,7 @@ function useServerStore({ storageKey, keyOf, resolve, defaultKey }) {
|
|
|
32
32
|
setServer(key) {
|
|
33
33
|
const next = resolve(key);
|
|
34
34
|
if (!next) return;
|
|
35
|
-
|
|
35
|
+
store(storageKey, next);
|
|
36
36
|
setServer(next);
|
|
37
37
|
},
|
|
38
38
|
setServerVariables(variables) {
|
|
@@ -42,7 +42,7 @@ function useServerStore({ storageKey, keyOf, resolve, defaultKey }) {
|
|
|
42
42
|
...prev,
|
|
43
43
|
variables
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
store(storageKey, next);
|
|
46
46
|
return next;
|
|
47
47
|
});
|
|
48
48
|
}
|
|
@@ -52,4 +52,9 @@ function useServerStore({ storageKey, keyOf, resolve, defaultKey }) {
|
|
|
52
52
|
storageKey
|
|
53
53
|
]);
|
|
54
54
|
}
|
|
55
|
+
function store(key, value) {
|
|
56
|
+
try {
|
|
57
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
58
|
+
} catch {}
|
|
59
|
+
}
|
|
55
60
|
export { useServerStore };
|
package/dist/playground/auth.js
CHANGED
|
@@ -245,7 +245,7 @@ function useAuthRedirect(field, onReturn) {
|
|
|
245
245
|
let returnedFlow;
|
|
246
246
|
const subscribeNever = () => () => {};
|
|
247
247
|
function getReturnedFlow() {
|
|
248
|
-
if (returnedFlow === void 0) {
|
|
248
|
+
if (returnedFlow === void 0) try {
|
|
249
249
|
const stored = sessionStorage.getItem(pendingFlowKey);
|
|
250
250
|
const returnedUrl = sessionStorage.getItem("fumadocs-openapi-oauth-returned");
|
|
251
251
|
sessionStorage.removeItem(pendingFlowKey);
|
|
@@ -254,6 +254,8 @@ function getReturnedFlow() {
|
|
|
254
254
|
...JSON.parse(stored),
|
|
255
255
|
url: new URL(returnedUrl ?? window.location.href)
|
|
256
256
|
} : null;
|
|
257
|
+
} catch {
|
|
258
|
+
returnedFlow = null;
|
|
257
259
|
}
|
|
258
260
|
return returnedFlow ?? void 0;
|
|
259
261
|
}
|
|
@@ -485,7 +487,9 @@ function useAuthFields(engine, { operation, providers, transform } = {}) {
|
|
|
485
487
|
for (const field of fields) {
|
|
486
488
|
if (!arrayStartsWith(key, field.fieldName) && !arrayStartsWith(field.fieldName, key)) continue;
|
|
487
489
|
const value = page.get(field.fieldName);
|
|
488
|
-
|
|
490
|
+
try {
|
|
491
|
+
if (value != null) sessionStorage.setItem(field.storageKey, JSON.stringify(value));
|
|
492
|
+
} catch {}
|
|
489
493
|
}
|
|
490
494
|
}
|
|
491
495
|
});
|
|
@@ -507,9 +511,12 @@ function useAuthFields(engine, { operation, providers, transform } = {}) {
|
|
|
507
511
|
}, [page, fields]),
|
|
508
512
|
init: useCallback(() => {
|
|
509
513
|
for (const field of fields) page.init(field.fieldName, () => {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
514
|
+
try {
|
|
515
|
+
const stored = sessionStorage.getItem(field.storageKey);
|
|
516
|
+
const parsed = stored ? JSON.parse(stored) : void 0;
|
|
517
|
+
if (typeof parsed === typeof field.defaultValue) return parsed;
|
|
518
|
+
} catch {}
|
|
519
|
+
return field.defaultValue;
|
|
513
520
|
});
|
|
514
521
|
return () => {};
|
|
515
522
|
}, [page, fields])
|
|
@@ -39,7 +39,7 @@ export interface MediaAdapter {
|
|
|
39
39
|
* @param lang - name of programming language.
|
|
40
40
|
* @param ctx - context passed from the generator of programming language.
|
|
41
41
|
*
|
|
42
|
-
* @returns code that inits a `body` variable, or undefined
|
|
42
|
+
* @returns code that inits a `body` variable, or `undefined` to leave the body out of the example for that language.
|
|
43
43
|
*/
|
|
44
44
|
generateExample: (data: {
|
|
45
45
|
body: unknown;
|
|
@@ -452,7 +452,7 @@ function Callback({ item, path, headingLevel }) {
|
|
|
452
452
|
open,
|
|
453
453
|
onOpenChange: setOpen,
|
|
454
454
|
children: [/* @__PURE__ */ jsxs(Dialog.Trigger, {
|
|
455
|
-
className: "group grid w-full grid-cols-[auto_minmax(0,1fr)_auto] items-baseline gap-x-2 gap-y-1 border-t px-4 py-3 text-start transition-colors first:border-t-0 hover:bg-fd-accent/40 focus-visible:bg-fd-accent/40 focus-visible:outline-
|
|
455
|
+
className: "group grid w-full grid-cols-[auto_minmax(0,1fr)_auto] items-baseline gap-x-2 gap-y-1 border-t px-4 py-3 text-start transition-colors first:border-t-0 hover:bg-fd-accent/40 focus-visible:bg-fd-accent/40 focus-visible:outline-hidden",
|
|
456
456
|
children: [
|
|
457
457
|
/* @__PURE__ */ jsx("span", {
|
|
458
458
|
className: "col-span-2 font-mono text-[0.8125rem] font-medium",
|
|
@@ -513,7 +513,7 @@ function Callback({ item, path, headingLevel }) {
|
|
|
513
513
|
/** browsers can't send the methods `fetch()` forbids, like TRACE */
|
|
514
514
|
function canFetch(method) {
|
|
515
515
|
try {
|
|
516
|
-
new Request("http://localhost", { method });
|
|
516
|
+
new Request("http://localhost", { method: method.toUpperCase() });
|
|
517
517
|
return true;
|
|
518
518
|
} catch {
|
|
519
519
|
return false;
|
|
@@ -126,7 +126,8 @@ function ResponseTabsDefaultContent({ tabs }) {
|
|
|
126
126
|
const tab = tabs.find((item) => item.code === code) ?? tabs[0];
|
|
127
127
|
const examples = tab.examples ?? [];
|
|
128
128
|
const example = examples.at(index);
|
|
129
|
-
const
|
|
129
|
+
const media = tab.mediaType ? resolve(tab.response.content?.[tab.mediaType]) : void 0;
|
|
130
|
+
const schema = media?.schema ?? media?.itemSchema;
|
|
130
131
|
let body;
|
|
131
132
|
let text;
|
|
132
133
|
if (showSchema && schema !== void 0) {
|
|
@@ -177,7 +178,7 @@ function ResponseTabsDefaultContent({ tabs }) {
|
|
|
177
178
|
children: [t("Schema"), /* @__PURE__ */ jsx(Switch.Root, {
|
|
178
179
|
checked: showSchema,
|
|
179
180
|
onCheckedChange: setShowSchema,
|
|
180
|
-
className: "inline-flex h-4 w-7 shrink-0 items-center rounded-full bg-fd-accent p-0.5 transition-colors focus-visible:outline-
|
|
181
|
+
className: "inline-flex h-4 w-7 shrink-0 items-center rounded-full bg-fd-accent p-0.5 transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-fd-ring data-checked:bg-fd-primary motion-reduce:transition-none",
|
|
181
182
|
children: /* @__PURE__ */ jsx(Switch.Thumb, { className: "size-3 rounded-full bg-fd-muted-foreground transition-[translate,background-color] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] data-checked:translate-x-3 data-checked:bg-fd-primary-foreground motion-reduce:transition-none" })
|
|
182
183
|
})]
|
|
183
184
|
}), /* @__PURE__ */ jsx(ExampleSelect, {
|
|
@@ -122,7 +122,13 @@ function OAuthForm({ field, flows, close }) {
|
|
|
122
122
|
const [scopes, setScopes] = useState(() => new Set(field.scopes));
|
|
123
123
|
const [userCode, setUserCode] = useState();
|
|
124
124
|
const controllerRef = useRef(null);
|
|
125
|
-
const stf = useStf({ defaultValues: () =>
|
|
125
|
+
const stf = useStf({ defaultValues: () => {
|
|
126
|
+
try {
|
|
127
|
+
return JSON.parse(localStorage.getItem(storageKey) ?? "{}");
|
|
128
|
+
} catch {
|
|
129
|
+
return {};
|
|
130
|
+
}
|
|
131
|
+
} });
|
|
126
132
|
const flowInfo = {
|
|
127
133
|
authorizationCode: {
|
|
128
134
|
name: t("Authorization code"),
|
|
@@ -152,7 +158,9 @@ function OAuthForm({ field, flows, close }) {
|
|
|
152
158
|
for (const scope of field.scopes) scopeOptions[scope] ??= "";
|
|
153
159
|
const query = useQuery(async () => {
|
|
154
160
|
const credentials = stf.dataEngine.getData();
|
|
155
|
-
|
|
161
|
+
try {
|
|
162
|
+
localStorage.setItem(storageKey, JSON.stringify({ clientId: credentials.clientId }));
|
|
163
|
+
} catch {}
|
|
156
164
|
const controller = controllerRef.current = new AbortController();
|
|
157
165
|
try {
|
|
158
166
|
const token = await requestOAuthToken(field.scheme, type, {
|
package/dist/ui/scalar/client.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn } from "../../utils/cn.js";
|
|
3
3
|
import { MethodLabel } from "../components/method-label.js";
|
|
4
4
|
import { useOpenAPI } from "../../utils/create-page.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useEffect } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useTranslations } from "@fuma-translate/react";
|
|
8
8
|
import { buttonVariants } from "fumadocs-ui/components/ui/button";
|
|
@@ -10,15 +10,19 @@ import { useApiClient } from "@scalar/api-client-react";
|
|
|
10
10
|
import { useTheme } from "fumadocs-ui/provider/base";
|
|
11
11
|
import "@scalar/api-client-react/style.css";
|
|
12
12
|
// src/ui/scalar/client.tsx
|
|
13
|
-
const noop = () => () => {};
|
|
14
13
|
function ScalarPlayground({ path, method }) {
|
|
15
14
|
const { resolvedTheme } = useTheme();
|
|
16
15
|
const { bundled } = useOpenAPI().doc;
|
|
17
16
|
const t = useTranslations({ note: "scalar API client" });
|
|
18
|
-
const mounted = useSyncExternalStore(noop, () => true, () => false);
|
|
19
17
|
const client = useApiClient({ configuration: { content: bundled } });
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!resolvedTheme) return;
|
|
20
|
+
const className = `${resolvedTheme}-mode`;
|
|
21
|
+
document.body.classList.add(className);
|
|
22
|
+
return () => document.body.classList.remove(className);
|
|
23
|
+
}, [resolvedTheme]);
|
|
20
24
|
return /* @__PURE__ */ jsxs("div", {
|
|
21
|
-
className:
|
|
25
|
+
className: "flex flex-row items-center gap-2.5 p-3 rounded-xl border bg-fd-card text-fd-card-foreground not-prose",
|
|
22
26
|
children: [
|
|
23
27
|
/* @__PURE__ */ jsx(MethodLabel, {
|
|
24
28
|
className: "text-xs",
|
|
@@ -3,8 +3,7 @@ import { getExampleValue, getPreferredType, pickExample } from "./schema.js";
|
|
|
3
3
|
import { getRaw } from "@scalar/json-magic/magic-proxy";
|
|
4
4
|
import { dereference, sample } from "@fumadocs/json-schema";
|
|
5
5
|
// src/utils/get-example-requests.ts
|
|
6
|
-
function getExampleRequests({ path, method, mediaAdapters,
|
|
7
|
-
const requestBody = dereference(operation.requestBody);
|
|
6
|
+
function getExampleRequests({ path, method, mediaAdapters, requestBody, parameters }) {
|
|
8
7
|
const media = requestBody?.content ? getPreferredType(requestBody.content) : null;
|
|
9
8
|
const bodyOfType = media ? dereference(requestBody.content[media]) : null;
|
|
10
9
|
if (bodyOfType?.examples) {
|
|
@@ -28,7 +28,7 @@ function toText(entry, doc, options = {}) {
|
|
|
28
28
|
...data,
|
|
29
29
|
...extend?._openapi
|
|
30
30
|
}
|
|
31
|
-
}, pageContent(pageProps), options);
|
|
31
|
+
}, includeDescription && entry.type === "page" && entry.info.description ? `${entry.info.description}\n\n${pageContent(pageProps)}` : pageContent(pageProps), options);
|
|
32
32
|
}
|
|
33
33
|
function generateDocument(frontmatter, content, options) {
|
|
34
34
|
const { addGeneratedComment = true, imports } = options;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "12.6.
|
|
3
|
+
"version": "12.6.8",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@base-ui/react": "^1.9.0",
|
|
58
58
|
"@fuma-translate/react": "^1.0.2",
|
|
59
|
-
"@fumadocs/json-schema": "^0.3.
|
|
59
|
+
"@fumadocs/json-schema": "^0.3.6",
|
|
60
60
|
"@fumari/json-schema-ts": "^1.0.2",
|
|
61
61
|
"@fumari/stf": "^1.1.2",
|
|
62
62
|
"@scalar/json-magic": "^0.19.0",
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"@types/react-dom": "^19.3.0",
|
|
81
81
|
"fast-content-type-parse": "^4.0.1",
|
|
82
82
|
"fuma-cli": "^0.3.4",
|
|
83
|
-
"fumadocs-core": "16.19.
|
|
84
|
-
"fumadocs-ui": "npm:@fumadocs/base-ui@16.19.
|
|
83
|
+
"fumadocs-core": "16.19.8",
|
|
84
|
+
"fumadocs-ui": "npm:@fumadocs/base-ui@16.19.8",
|
|
85
85
|
"json-schema-typed": "^9.0.0",
|
|
86
|
-
"shared-api": "0.2.
|
|
86
|
+
"shared-api": "0.2.17",
|
|
87
87
|
"tsconfig": "0.0.0",
|
|
88
88
|
"tsdown": "0.23.7",
|
|
89
89
|
"xml-js": "^1.6.11"
|