fumadocs-openapi 12.2.0 → 12.4.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.
Files changed (59) hide show
  1. package/css/generated/shared.css +1 -1
  2. package/dist/.translations/index.d.ts +4 -4
  3. package/dist/.translations/keys.js +4 -4
  4. package/dist/operation.js +4 -4
  5. package/dist/packages/shared-api/dist/.translations/index.d.ts +1 -0
  6. package/dist/packages/shared-api/dist/.translations/keys.js +1 -0
  7. package/dist/packages/shared-api/dist/auto-anchor/index.js +54 -10
  8. package/dist/packages/shared-api/dist/components/accordion.js +3 -11
  9. package/dist/packages/shared-api/dist/components/collapsible.js +16 -0
  10. package/dist/packages/shared-api/dist/components/defaults.js +1 -1
  11. package/dist/packages/shared-api/dist/components/schema/client.d.ts +5 -0
  12. package/dist/packages/shared-api/dist/components/schema/client.js +408 -455
  13. package/dist/packages/shared-api/dist/components/select-tab.js +7 -12
  14. package/dist/playground/auth.d.ts +61 -7
  15. package/dist/playground/auth.js +192 -95
  16. package/dist/playground/fetcher.d.ts +1 -1
  17. package/dist/playground/index.d.ts +2 -2
  18. package/dist/playground/index.js +2 -2
  19. package/dist/playground/use-playground.d.ts +5 -3
  20. package/dist/playground/use-playground.js +22 -10
  21. package/dist/requests/generators/csharp.js +11 -21
  22. package/dist/requests/generators/curl.js +12 -14
  23. package/dist/requests/generators/go.js +22 -33
  24. package/dist/requests/generators/index.d.ts +1 -1
  25. package/dist/requests/generators/java.js +33 -37
  26. package/dist/requests/generators/javascript.js +13 -20
  27. package/dist/requests/generators/python.js +12 -17
  28. package/dist/requests/generators/rust.js +15 -20
  29. package/dist/requests/index.d.ts +1 -1
  30. package/dist/requests/media/adapter.d.ts +0 -1
  31. package/dist/requests/media/adapter.js +50 -42
  32. package/dist/requests/media/encode.d.ts +1 -1
  33. package/dist/requests/media/encode.js +1 -1
  34. package/dist/requests/string-utils.js +14 -6
  35. package/dist/ui/components/dialog.js +14 -0
  36. package/dist/ui/components/endpoint.js +11 -8
  37. package/dist/ui/components/heading.js +1 -1
  38. package/dist/ui/components/schema.js +1 -1
  39. package/dist/ui/{playground/components → components}/segmented.js +2 -2
  40. package/dist/ui/operation/index.js +262 -237
  41. package/dist/ui/operation/request-tabs.js +1 -1
  42. package/dist/ui/operation/response-tabs.js +1 -1
  43. package/dist/ui/operation/usage-tabs.js +1 -1
  44. package/dist/ui/playground/client.d.ts +1 -1
  45. package/dist/ui/playground/client.js +23 -19
  46. package/dist/ui/playground/components/fields.js +36 -15
  47. package/dist/ui/playground/components/oauth-panel.js +71 -21
  48. package/dist/ui/playground/components/request-panel.js +80 -94
  49. package/dist/ui/playground/components/response-panel.js +1 -1
  50. package/dist/ui/playground/components/result-display.js +1 -1
  51. package/dist/ui/playground/components/server-select.js +1 -1
  52. package/dist/utils/create-page.js +2 -2
  53. package/dist/utils/get-example-requests.js +1 -1
  54. package/dist/utils/use-server.d.ts +3 -3
  55. package/dist/utils/use-server.js +2 -2
  56. package/package.json +5 -5
  57. package/dist/packages/shared-api/dist/auto-anchor/client.js +0 -20
  58. package/dist/packages/shared-api/dist/components/popover.js +0 -23
  59. package/dist/packages/shared-api/dist/utils/merge-refs.js +0 -11
@@ -1 +1 @@
1
- @source inline("!isDefined !readOnly !renderBodyField !required !supported *:data-[collapsible=true]:order-last *: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 --available-width --collapsible-panel-height --fd-docs-row-1 --min-height --spacing --transform-origin -mode -ms-0.5 -mx-3 -translate-x-1/2 -translate-y-1/2 -z-1 @4xl:flex-row @4xl:items-start @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px] @container @default @deprecated @fuma-translate/react @fumadocs/json-schema @fumari/stf @max-sm:bg-fd-secondary/50 @max-sm:border @max-sm:empty:w-2 @max-sm:mx-4 @max-sm:overflow-hidden @max-sm:pb-1.5 @max-sm:pb-3 @max-sm:pe-2 @max-sm:rounded-lg @md:block @md:grid-cols-2 @param @private @returns @scalar/api-client-react @see @sm:-me-2 @sm:-me-2.5 @sm:border-s @sm:grid-cols-[minmax(9rem,1fr)_minmax(0,2fr)] @sm:min-h-10 @sm:pe-7.5 @sm:pe-8 @typescript-eslint/no-explicit-any [&[hidden]:not([hidden='until-found'])]:hidden [&_*]:inline [&_a]:underline [&_code]:font-mono [&_svg]:size-3 [&_svg]:size-3.5 [grid-area:1/1] [scrollbar-width:none] a above absolute accept access access_token accordion actions active:scale-[0.97] actual adapter adapters added additionalProperties after again against alias align all allOf allow allowJson already alt always among an anchor anchorIdStartsWith anchorSegments and animate-spin animates any anyFields anyOf anyway apiExample apiKey apiPlayground appearance-none applicable application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml applies apply are aria-checked aria-current aria-label aria-live aria-pressed aria-pressed:bg-fd-background aria-pressed:ring-1 aria-pressed:ring-fd-border aria-pressed:shadow-sm aria-pressed:text-fd-foreground arkdown array arrow as asSchema async at audience auth authCodeQuery authNode authSchemes authorization authorizationCode authorizationUrl authorization_code authorization_url authorize authorizes autoComplete avoid await back backdrop-blur-[1px] backdrop-blur-lg backdrop-blur-sm backdrop-blur-xs background badgeVariants bar base baseDir basic be before behavior belong bg-amber-500 bg-amber-500/10 bg-black/30 bg-black/40 bg-blue-500 bg-current/10 bg-fd-background bg-fd-background/50 bg-fd-card bg-fd-card/70 bg-fd-muted bg-fd-popover bg-fd-popover/60 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 blocks blue body bodyMediaType bodyNode bodyUrlRef boolean border border-0 border-b border-current border-fd-muted-foreground/50 border-fd-primary border-fd-primary/20 border-s border-t bottom bottom-0 box break-all built-in bundled but button buttonVariants by bytes cache cached cachedDocFiles callbacks callbacksNode can candidates cannot case catch cell center ch change changes charset check checkbox checked children class class-variance-authority className cleanup clearResponse click client clientAuth clientCredentials clientHeight clientId clientSecret client_auth client_credentials client_error client_id client_secret cloned closeDelay closed cn code codeProps codeUsages codeblock col-span-full collapsible color compiler components compute configuration const constraints content contentTypes control cookie cookies copying core count createContext createOAuthHandler createOpenAPIPageBase createProxy credentials cross-origin crumbClassName css csv ctx current currentValue cursor-pointer custom customise customization cva dark dark:aria-pressed:bg-fd-accent dark:bg-fd-accent dark:text-amber-400 dark:text-blue-400 dark:text-green-400 dark:text-orange-400 dark:text-red-400 dark:text-yellow-400 data data-[closed]:animate-fd-popover-out data-[disabled]:opacity-50 data-[disabled]:pointer-events-none data-[highlighted]:bg-fd-accent data-[highlighted]:text-fd-accent-foreground data-[open]:animate-fd-popover-in data-[open]:border-b-0 data-[popup-open]:text-fd-accent-foreground data-active:text-fd-foreground data-closed:animate-fd-dialog-out data-closed:animate-fd-fade-out data-collapsible 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.98] data-object-search-input data-open:animate-fd-dialog-in data-open:animate-fd-fade-in data-placeholder:text-fd-muted-foreground data-popup-open:bg-fd-accent data-popup-open:text-fd-accent-foreground data-popup-open:text-fd-foreground 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 decoded default defaultMdxComponents defaultShikiFactory defaultShikiOptions defaultValue defaultValues defaults deferredValue define definitions delay delay-150 delete deprecated depth dereference dereferenced description descriptionNode descriptions development deviceAuthorization dialog didn directories disable disableCache disabled disabled:cursor-not-allowed disabled:opacity-50 disabled:opacity-80 display displayNames disposition div do doc docCache docFilesCache docRoot docs document documented documents does doesn domain download downloaded drives duplicated duration duration-150 duration-200 duration-250 during dynamic dynamicSource e eading ease-[cubic-bezier(0.16,1,0.3,1)] ease-out edge edited editor edits element elements else empty empty:hidden enabled encode encodeRequestData encoded end end-2 endpoint enforce engine ensure entries entry enum err error eslint-disable eslint-disable-next-line even example examples exclusiveMax exclusiveMin export exported extended extends fades fallback false fast-content-type-parse fd-page-tree-item-name fd-scroll-container fetch fetchOptions fetcher field field-sizing-content fieldData fieldLabelVariants fieldName fields file fileName filePath files fill-current filling fills filtered first first:border-t-0 firstItemRef fixed flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flowInfo flowReturned flows focus-visible:bg-fd-accent focus-visible:bg-fd-primary/15 focus-visible:bg-fd-secondary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-2 focus-visible:ring-fd-primary/30 focus-visible:ring-fd-ring focus-visible:ring-fd-ring/50 focus-visible:ring-fd-ring/60 focus-visible:ring-inset focus-within:[&_svg]:text-fd-primary focus-within:ring-2 focus-within:ring-fd-ring focus:outline-none focus:ring focus:ring-0 focus:ring-fd-ring folder folderStyle follow font-light font-medium font-mono font-normal font-sans font-semibold for form form-encoded format forward fragment from from-fd-popover fs full fumadocs-core/source fumadocs-core/toc fumadocs-openapi-oauth fumadocs-ui/mdx fumadocs:openapi fumadocs_openapi_requests fumadocs_openapi_responses function gap-0.5 gap-1 gap-1.5 gap-2 gap-2.5 gap-24 gap-3 gap-4 gap-x-3 gap-x-6 gap-y-1 gap-y-4 generate generateDefault generateSchemaUI generated get getOpenAPIPageProps getPreferredType getSchema getSchemas getWatchPaths ghost github-dark github-light given go goes going grant_type gray green grid grid-cols-1 grid-cols-[auto_minmax(0,1fr)] grid-cols-[minmax(0,2fr)_minmax(0,3fr)] group group-data-[panel-open]/accordion:rotate-90 group-data-popup-open:rotate-180 group-hover/nav:translate-x-0.5 group-hover:translate-x-px group/accordion group/nav group/row groupId h-(--accordion-panel-height) h-(--active-tab-height) h-(--collapsible-panel-height) h-10 h-12 h-5 h-6 h-7 h-8 h-9 h-[240px] h-auto h-full h-px h1 has has-focus-visible:bg-fd-secondary has-focus-visible:ring-1 has-focus-visible:ring-fd-ring/60 has-focus-visible:ring-inset hasSecret hash hast-util-to-jsx-runtime have headNode header headers heading headingLevel headless here hidden hiddenKeys hiddenProperties highlighted highlighter hint holding holds hook hover hover:bg-fd-accent hover:bg-fd-accent/40 hover:bg-fd-primary/15 hover:bg-transparent hover:text-fd-accent-foreground hover:text-fd-foreground hover:underline how href html htmlFor http hydration i icon icon-sm icon-xs iconButtonClassName id idx if ignore img implicit import imports in in-popover including index indexItemMatch indicator info infoTags init initAuth initial inline inline-flex input inputMode inputs inset-0 inset-x-0 inside installed instanceof instead integer interface internal into invalid invisible is isDefined isDuplicated isDynamic isLazy isLoading isMac isNumber isRequired isSending issues it item itemSchema items items-baseline items-center items-start items-stretch its itself j js json json-schema-typed justify-between justify-center justify-end kB keep keeping key keyed keyof keys kind label labelClassName labelled lang last last:border-b-0 last:mb-0 last:shrink-0 lazy leading-none leading-relaxed leave left left-0 left-1/2 length let light like line-through link links list list-disc list-inside listed listen listener listeners load loadDocument loaderPlugin loading localStorage location long lucide-react map mapValues marked marker:text-fd-muted-foreground match matching max max-age max-h-(--available-height) max-h-[460px] max-h-[min(18rem,30vh)] max-h-none max-md:hidden max-w-(--available-width) max-w-1/2 max-w-40 max-w-60 max-w-64 max-w-[98vw] max-w-[calc(100vw-2rem)] max-w-full max-w-lg may mb-2 mb-3 mb-auto md md:border-s md:grid-cols-[minmax(0,11fr)_minmax(0,9fr)] md:hidden mdxComponents me-1 me-auto media mediaAdapters mediaType member members merge mergeRefs message meta metaData metaKey method methods milliseconds mime min min-h-(--min-height,200px) 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-[240px] min-w-[calc(var(--anchor-width)+--spacing(2))] mode motion motion-reduce:transition-none motion-reduce:transition-opacity motion-safe:-translate-x-6 motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0.16,1,0.3,1)] 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: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 ms ms-auto mt-0! mt-0.5 mt-1 mt-1.5 mt-10 mt-2 mt-2.5 mt-3 multipart/form-data multiple must mx-1 mx-3 mx-px my-0 my-0! my-1 my-1.5 my-2 my-2! my-4 name name! named namespace nav navigating navigation navigator needs nested never new next next/previous no no-cache noValidate node node:fs node:path noop normalizes not not-prose note null number oauth oauth2 oauthRedirectUrl object objectSearchOverrides objectSet objects obtain of off omit on onAppend onAuthorized onBack onChange onCheckedChange onClick onCopy onKeyDown onNavigate onOAuth onOpenChange onRemove onReset onRoot onScrollEnd onSelect onSubmit onToken onValueChange one oneOf ones only opacity-0 opacity-80 open openApiData openIdConnect openOnHover openapi openapiMeta opened opening opens operation options or orange order-last origin origin-(--transform-origin) other otherwise out outline outline-none output over overflow-auto overflow-hidden overflow-x-auto overflow-y-auto overflow-y-hidden overview own p-0 p-0.5 p-1 p-1.5 p-2 p-2.5 p-3 p-4 p-6 packages padding page pageData pages panel panelCodeBlock panels param parameter parameterLabel parameterNode parameters params parent parentPathIndex parents parsed part parts party pass password path pathIndex pathItem pathName pathnameFromRequest pattern patternProperties payload pb-0 pb-1 pb-2 pb-3 pe-1 pe-1.5 pe-2 pe-3 pe-4 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 pending pendingFlowKey persisted picked pill placed placeholder placeholder:text-fd-muted-foreground placeholder:text-fd-muted-foreground/70 placeholder:text-fd-primary/50 playground playgrounds please plugins polite popover popoverRef position positions pre preferred prefers preloadOpenAPIPage preloaded prev preventScroll preview previous primary primitive processor properties property props prose prose-no-margin prose-sm proxy proxyForwardCookie proxyUrl ps-1 ps-1.5 ps-2 ps-3 ps-3.5 ps-4 ps-4.5 ps-6 pt-0 pt-1.5 pt-2 pt-2.5 px 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-4 query querySelector quiet random range raw rawSearch re-triggering react react-hooks/exhaustive-deps react/jsx-runtime read read-only readOnly readonly record red redirect redirectUrl redirect_uri redirected redirects ref reference refs regenerated rehype-react relative relativePath remark remark-rehype remarkGfm remarkRehype removable removal remove removeItem removed removing render renderBodyField renderCodeblock renderMarkdown renderParameterField renderPopoverTrigger renderTrigger rendered renderers renders replace represents request request-body requestBody requestData requestInit requestTimeout requestUrl requested requests required requirement requirements res reserved reset resize-none resolve resolveMediaAdapter resolveUrl resolved resolvedInput resolvedTheme response response-body responseNode responseTabs response_type responses rest restored result return returned returning returns revoked right ring-1 ring-fd-border role root rootId roots rotate-90 rounded rounded-2xl rounded-[5px] rounded-full rounded-lg rounded-md rounded-none rounded-sm rounded-xl route row rowButtonClassName rows s s-highlight safeParse same satisfies scalar scan schema schemaId schemaKeys schemaPropKeys schemaUI scheme schemeId schemes scope scopeOptions scopes scroll scroll-m-20 scrollArrowClassName scrollTop scrollTops search secondary seconds secret section sectionIcons sectionNames sections security see segments segs select select-none selected selectedType selections selector selectors selects send sends sep separator server server-to-server serverSchema serverUrl services sessionStorage set setClientAuth setCode setDraft setError setInfo setMode setMotion setName setNextName setOAuth setOpen setOrigin setPath setResponse setScopes setSearch setSelected setSending setServerVariables setShow setStack setStore setType setValue setView shadow-lg shadow-md shadow-none shadow-sm shared shiki shikiOptions show showDescription showExample showResponseSchema showSelect showTitle showing shown shrink shrink-0 sibling siblings side sideOffset signal single size size-2 size-3 size-3.5 size-4 size-5 skipNonRequired skipReadOnly sliding slot slotClassName slotType slots sm sm:-translate-x-1/2 sm:-translate-y-1/2 sm:border sm:flex-row sm:gap-2 sm:h-[min(52rem,calc(100dvh-3rem))] sm:inline sm:inset-auto sm:justify-end sm:left-1/2 sm:mb-4 sm:mx-4 sm:ps-5 sm:px-4 sm:rounded-2xl sm:shadow-2xl sm:text-start sm:top-1/2 sm:w-[min(80rem,calc(100vw-3rem))] smooth so some something spellCheck sr-only src stable stack stacked start started starting starting:opacity-0 state staticSource status statusInfo stays step stf sticky still storageKey store stored string stringify stringifyFieldKey structuredData style styles submit subscribe such supported svg switch switches sync syncExample synced t tPlayground tab tabDepth tabValues tables tabs tabular-nums tag takes target tell text text-4xl text-[0.8125rem] text-amber-600 text-blue-600 text-center text-end 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-primary-foreground/60 text-fd-secondary-foreground text-green-600 text-lg text-nowrap text-orange-400 text-orange-600 text-red-400 text-red-400/80 text-red-600 text-sm text-start text-xs text-yellow-600 text/css text/csv text/html text/plain that the their them themes then they this through throw timeout timer timerRef tips title to to-transparent toJsxRuntime toStaticData toc toggled token tokenInfo tokenUrl token_type token_url tokens toolbar top top-(--active-tab-top) top-0 top-1/2 top-10 top-2 tracking-tight transform transformAuthInputs transformPageTree transition-[background-color,scale] transition-[height,opacity] transition-[height] transition-[opacity,scale] transition-[translate,width] transition-colors transition-opacity transition-transform transitionClassName translate-x-(--active-tab-left) translations tree trigger true truncate try ts type typeClassName typeVariants typeof types unchanged undefined under underline unexpected union unionField unions unique unit unknown unlisted unselected unset up update updateInfo updated updating url usageTabs usages use useAnchorId useApiClient useComponents useCopyButton useFieldValue useListener useMemo useNamespace useObject useOnChange useOpenAPI useOperation usePlaygroundAuth useQuery useRef useRenderContext useResolvedSchema useResponseExamples useServer useState useStatusInfo useStf useSyncExternalStore useTheme useTranslations useTypeScriptDefinitions used username users using v value valueSchema values variable variables variant variants via view viewportProps virtual void w-(--active-tab-width) w-0 w-7 w-72 w-[600px] w-[min(26rem,calc(100vw-2rem))] w-auto w-fit w-full warn was we webhook webhooks when where while whitespace-pre width will with without won would wrap-break-word wrapping write writeOnly x-exclusiveCodeSample x-playground-lazy xml yellow you your z-0 z-10 z-20 z-50");
1
+ @source inline("!collapsed !isDefined !readOnly !renderBodyField !required !supported *:data-[collapsible=true]:order-last *: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-row-1 --fd-docs-row-3 --spacing --transform-origin -mode -ms-0.5 -my-1 -translate-x-1/2 -translate-y-1/2 -z-1 @4xl:flex-row @4xl:items-start @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px] @container @default @deprecated @fuma-translate/react @fumadocs/json-schema @fumari/stf @max-sm:bg-fd-secondary/50 @max-sm:border @max-sm:empty:w-2 @max-sm:mx-4 @max-sm:overflow-hidden @max-sm:pb-1.5 @max-sm:pb-3 @max-sm:pe-2 @max-sm:rounded-lg @max-xl:basis-full @max-xl:border-t @max-xl:flex-1 @max-xl:ps-1.5 @md:block @md:grid-cols-2 @param @private @returns @scalar/api-client-react @see @sm:-me-2 @sm:-me-2.5 @sm:border-s @sm:grid-cols-[minmax(9rem,1fr)_minmax(0,2fr)] @sm:min-h-10 @sm:pe-7.5 @sm:pe-8 @typescript-eslint/no-explicit-any @xl:w-40 [&[hidden]:not([hidden='until-found'])]:hidden [&_*]:inline [&_a]:underline [&_code]:font-mono [&_svg]:size-3 [&_svg]:size-3.5 [--fd-docs-row-1:0px] [--fd-docs-row-3:0px] [grid-area:1/1] [scrollbar-width:none] a above absolute accept access access_token accordion actions active:scale-[0.97] actual adapter adapters add added additional additionalProperties after again against alias align all allOf allow allowJson allowed already alt among an anchor anchorSegments and animate-spin animates any anyFields anyOf anyway apiExample apiKey apiPlayground appearance-none application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml applies apply are aria-checked aria-current aria-expanded aria-expanded:decoration-solid aria-expanded:text-fd-accent-foreground aria-hidden aria-label aria-live aria-pressed aria-pressed:bg-fd-background aria-pressed:ring-1 aria-pressed:ring-fd-border aria-pressed:shadow-sm aria-pressed:text-fd-foreground arkdown array arrow as async at audience auth authNode authProviders authSchemes authorization authorizationCode authorizationUrl authorization_code authorization_url authorize authorized authorizes auto-cols-[minmax(0,max-content)] autoComplete available avoid await back backdrop-blur-[1px] backdrop-blur-sm backdrop-blur-xs background badgeVariants bar base baseDir basic basis-full be before behavior below between bg-amber-500 bg-amber-500/10 bg-black/30 bg-black/40 bg-blue-500 bg-current/10 bg-fd-background bg-fd-background/50 bg-fd-card bg-fd-card/70 bg-fd-muted 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 blocks blue body bodyMediaType bodyNode bodyUrlRef boolean border border-0 border-b border-current border-dashed border-fd-muted-foreground/50 border-fd-primary border-fd-primary/20 border-s border-t bottom bottom-0 box box-content breadcrumbs break-all built-in builtinProviders bundled but button buttonVariants by bytes cache cached cachedDocFiles callbacks callbacksNode can candidates cannot card case catch cell center ch change changes charset check checkbox checked chevron chevronClassName children class class-variance-authority className cleanup clearResponse click client clientAuth clientCredentials clientId clientSecret clientWidth client_auth client_credentials client_error client_id client_secret cloned close closeDelay closest cn code codeProps codeUsages codeblock col-span-2 col-span-full collapse collapses collapsible color come compiler component components compute configuration const constraints container content contentTypes contents control cookie cookies copy copyable copying core count createContext createOAuthHandler createOpenAPIPageBase createProxy credentials cross-origin crumbClassName crumbs css csv ctx current currentValue cursor-pointer cursor-text custom customise customization cva dark dark:aria-pressed:bg-fd-accent dark:bg-fd-accent dark:text-amber-400 dark:text-blue-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-closed:animate-fd-dialog-out data-closed:animate-fd-fade-out data-collapsible 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-open:animate-fd-dialog-in data-open:animate-fd-fade-in data-placeholder:text-fd-muted-foreground data-popup-open:bg-fd-accent data-popup-open:text-fd-accent-foreground data-popup-open:text-fd-foreground 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 defaultMdxComponents defaultShikiFactory defaultShikiOptions defaultValue defaultValues defaults define definitions delay delay-150 delete deprecated depth dereference dereferenced described describes description descriptionNode descriptions development deviceAuthorization dialog didn direction directories disable disableCache disabled disabled:cursor-not-allowed disabled:opacity-50 disabled:opacity-80 display displayNames disposition div do doc docCache docFilesCache docRoot docs document documented documents does doesn domain don download downloaded drives drop duplicated duration duration-150 duration-200 duration-250 during dynamic dynamicSource e each eading ease-[cubic-bezier(0.16,1,0.3,1)] ease-[cubic-bezier(0.22,1,0.36,1)] ease-out edge edited editing editor edits element elements else emit empty empty:hidden enabled encode encodeRequestData encoded end end-2 endpoint enforce engine entries entry enum err error eslint-disable eslint-disable-next-line even example examples exclusiveMax exclusiveMin expand export exported expressions extended extends fades fallback false fast-content-type-parse fd-page-tree-item-name fd-scroll-container fetch fetchOptions fetcher field field-sizing-content fieldData fieldLabelVariants fieldName fields file fileName filePath files fill-current filling fills filter filterable finishes first first:border-t-0 first:mt-0 fixed 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-1 focus-visible:ring-2 focus-visible:ring-fd-primary/30 focus-visible:ring-fd-ring focus-visible:ring-fd-ring/50 focus-visible:ring-fd-ring/60 focus-visible:ring-inset focus-within:ring-1 focus-within:ring-fd-ring focus:outline-none focus:ring focus:ring-0 focus:ring-fd-ring folder folderStyle follow font-light font-medium font-mono font-normal font-sans font-semibold for form form-encoded format forward fragment from from-fd-popover fs full fumadocs-core/source fumadocs-core/toc fumadocs-openapi-flow fumadocs-openapi-oauth fumadocs-ui/mdx fumadocs:openapi fumadocs_openapi_requests fumadocs_openapi_responses 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 generated get getLink getOpenAPIPageProps getPreferredType getSchema getSchemas getWatchPaths gets ghost github-dark github-light given go goes going grant_type gray green grid grid-cols-1 grid-cols-[auto_minmax(0,1fr)] grid-cols-[auto_minmax(0,1fr)_auto] grid-cols-[minmax(0,2fr)_minmax(0,3fr)] grid-flow-col group group-data-[panel-open]/accordion:rotate-90 group-data-popup-open:rotate-180 group-hover/nav: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/property group/row groupId h-(--accordion-panel-height) h-(--active-tab-height) h-(--collapsible-panel-height) h-10 h-12 h-5 h-6 h-7 h-8 h-9 h-[240px] h-auto h-full h-px h1 handle handles has has-focus-visible:bg-fd-secondary has-focus-visible:ring-1 has-focus-visible:ring-fd-ring/60 has-focus-visible:ring-inset hasSecret hash hast-util-to-jsx-runtime have headNode header headerRef headers heading headingLevel headless here hidden hiddenKeys hiddenProperties highlighted highlighter hint holding holds hook hover hover:bg-fd-accent hover:bg-fd-accent/40 hover:bg-fd-primary/15 hover:bg-transparent hover:text-fd-accent-foreground hover:text-fd-foreground how href html htmlFor http hydration i icon icon-sm icon-xs iconButtonClassName id idx if img implicit import imports in 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 internal into invalid invisible is isDefined isDynamic isExpanded isHighlighted isLazy isLoading isMac isNumber isRequired isSending isn issues it item itemSchema items items-baseline items-center items-start items-stretch its itself js json json-schema-typed justify-between justify-center justify-end kB keep keeping keeps kept key keyed keyof keys kind label labelClassName labelled lang larger last last:border-b-0 last:shrink-0 layout layouts lazy leading-5 leading-none leading-relaxed leave leaving left left-0 left-1/2 length let light like line-through link links list listed listen listener listeners loadDocument loaderPlugin loading loads localStorage location long longer lucide-react map mapValues margin margins marked match matching max max-age max-h-(--available-height) max-h-[min(18rem,30vh)] max-h-none max-md:hidden max-w-1/2 max-w-40 max-w-60 max-w-64 max-w-72 max-w-[calc(100vw-2rem)] max-w-full max-w-lg may mb-2 mb-3 md md:border-s md:grid-cols-[minmax(0,11fr)_minmax(0,9fr)] md:hidden mdxComponents me-1 me-auto measure measured media mediaAdapters mediaType member members menu menuItems merge message meta 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))] mode motion motion-reduce:transition-none motion-reduce:transition-opacity motion-safe:-translate-x-6 motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0.16,1,0.3,1)] 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: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 ms ms-1 ms-1.5 ms-auto mt-0! mt-0.5 mt-1 mt-1.5 mt-10 mt-2 mt-2.5 multipart/form-data multiple must mx-1 mx-3 mx-px my-0 my-0! my-1 my-3 name name! named names namespace narrow nav navigator nearest needs nested never new next next/previous no no-cache noValidate node node:fs node:path noop normalizes not not-prose note null number oauth2 oauthOrigin oauthPanelProvider oauthRedirectUrl object objectGet objects observer obtain of off omit omitted on onAppend onAuthorize onBack onChange onCheckedChange onClick onCopy onKeyDown onLink onMount onNavigate onOpenChange onRemove onReset onReturn onRoot onSelect onSubmit onToken onValueChange one oneOf ones only opacity-0 opacity-80 open openApiData openIdConnect openOnHover openapi openapiMeta opened opening opens operation options or orange order-last origin origin-(--transform-origin) other otherwise out outline outline-none output outside over overflow-auto overflow-clip overflow-hidden overflow-x-auto overflow-y-auto overview own p-0 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 panels param parameter parameterLabel parameterNode parameters params parent parentIndex parents parsed parts party pass password path pathItem pathnameFromRequest pattern patternProperties payload pb-1 pb-2 pb-3 pe-1 pe-1.5 pe-2 pe-3 pe-4 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 pending pendingFlowKey pendingOAuthKey persisted pill placed placeholder placeholder:text-fd-muted-foreground placeholder:text-fd-muted-foreground/70 placeholder:text-fd-primary/50 playground playgrounds please plugins pointer-coarse:opacity-100 polite popup pre preferred prefers prefixed preloadOpenAPIPage preloaded prev preventDefault preview previous primary primitive processor prop properties property props prose prose-no-margin prose-sm provider providers 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 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 query quiet random range raw react react-dom react-hooks/exhaustive-deps react/jsx-runtime read read-only readOnly readonly record red redirect redirectUrl redirect_uri redirected redirects ref reference refs regenerated rehype-react relative relativePath remark remark-rehype remarkGfm remarkRehype remounted removable removal remove removeItem removed removing render renderBodyField renderCodeblock renderMarkdown renderParameterField rendered renderers renders replace replaces represents request request-body requestBody requestData requestInit requestTimeout requestUrl requested requests required requirement requirements res reserved reset resize-none resized resolve resolveMediaAdapter resolveUrl resolved resolvedInput resolvedTheme response response-body responseNode responseTabs response_type responses rest restored result return returnQuery returned returnedScheme returning returns revoked right ring-1 ring-fd-border role room root rootId rotate-90 rounded rounded-[5px] rounded-full rounded-lg rounded-md rounded-none rounded-sm rounded-xl route row row-span-2 rowButtonClassName rows runtime s safeParse same satisfies scalar scan schema schemaId schemaKeys schemaPropKeys schemaUI schemas scheme schemeId schemes scope scopeOptions scopes screen screens scroll scroll-m-20 scroll-mt-[calc(var(--fd-docs-row-3,0px)+1rem)] scrollArrowClassName scrollMarginClassName search secondary seconds secret section sectionIcons sectionNames sections security see segments segs select select-none selected selectedType selector selectors selects self-center send sending sends separator server server-to-server serverSchema serverUrl services sessionStorage set setAuthorizing setClientAuth setCode setCollapsed setDraft setError setFilter setInfo setMode setMotion setName setNextName setOpen setOrigin setResponse setScopes setSelected setSending setServerVariables setShow setStack setStore setType setValue setView shadow-lg shadow-md shadow-none shadow-sm share shared shared-api/auto-anchor shiki shikiOptions shorten show showDescription showExample showResponseSchema showSelect showTitle shown shrink shrink-0 sibling siblings side sideOffset signal signing single size size-2 size-3 size-3.5 size-4 size-5 skipNonRequired skipReadOnly slashes slides sliding slot slotClassName slotType slots sm sm:-translate-x-1/2 sm:-translate-y-1/2 sm:border sm:flex-row sm:gap-2 sm:h-[min(52rem,calc(100dvh-3rem))] sm:inline sm:inset-auto sm:justify-end 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:text-start sm:top-1/2 sm:w-[min(64rem,calc(100vw-3rem))] sm:w-[min(80rem,calc(100vw-3rem))] smaller smooth so some something space spellCheck sr-only src stable stack stacked start started starting starting:opacity-0 starts state staticSource status statusInfo stays step stf sticky stops storageKey store stored string stringSchema stringify stringifyFieldKey structuredData style styles submit subscribe subscribeNever such supported svg switch switches sync syncExample synced t tPlayground tab tables tabs tabular-nums tagClassName takes target tell text text-4xl text-[0.8125rem] text-amber-600 text-blue-600 text-center text-end 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-primary-foreground/60 text-fd-secondary-foreground text-green-600 text-lg text-nowrap text-orange-600 text-red-400 text-red-400/80 text-red-600 text-sm text-start text-xs text-yellow-600 text/css text/csv text/html text/plain texts than that the their them themes then they this through throw timeout timer timerRef tips title to to-transparent toJsxRuntime toStaticData toc toggle toggled token tokenUrl token_type token_url tokens toolbar top top-(--active-tab-top) top-0 top-1/2 top-2 total tracking-tight transform transformPageTree transition-[background-color,scale] transition-[height,opacity] transition-[height] transition-[opacity,scale] transition-[translate,width] transition-colors transition-opacity transition-shadow transition-transform transitionClassName translate-x-(--active-tab-left) translations tree true truncate try ts type typeClassName typeof types unchanged undefined under underline underline-offset-4 unexpected union unionField unions unique unit unknown unlisted unset update updateInfo updated updating url usageTabs usages use useAnchorId useAnchorLink useApiClient useComponents useCopyButton useFieldValue useListener useMemo useNamespace useObject useOnChange useOpenAPI useOperation useQuery useRef useRenderContext useResolvedSchema useResponseExamples useServer useState useStatusInfo useStf useSyncExternalStore useTheme useTranslations useTypeScriptDefinitions used username users using v value valueSchema values variable variables variant variants via view viewportProps virtual void w-(--active-tab-width) w-0 w-7 w-72 w-[min(26rem,calc(100vw-2rem))] w-auto w-fit w-full w-max warn we webhook webhooks when where while whitespace-pre width widths will window with without won would wrap-anywhere wrap-break-word wrapping write writeOnly x-exclusiveCodeSample x-playground-lazy xml yellow your z-0 z-10 z-50");
@@ -3,6 +3,7 @@ export type Translations = {
3
3
  "1 item(playground)": string;
4
4
  "Accepted(playground status info)": string;
5
5
  "Add Item(playground)": string;
6
+ "Add this to the allowed redirect URIs of your OAuth application.(OAuth dialog)": string;
6
7
  "Add(playground)": string;
7
8
  "Authenticate using username and password.(OAuth dialog)": string;
8
9
  "Authenticate with 3rd party services(OAuth dialog)": string;
@@ -27,11 +28,13 @@ export type Translations = {
27
28
  "Choose a file(playground)": string;
28
29
  "Clear(playground result display)": string;
29
30
  "Client Credentials(OAuth dialog)": string;
31
+ "Close(operation page)": string;
30
32
  "Close(playground)": string;
31
33
  "Conflict(playground status info)": string;
32
34
  "Cookie Parameters(operation page)": string;
33
35
  "Cookies(playground)": string;
34
- "Copy(TypeScript definitions)": string;
36
+ "Copied(playground)(aria-label)": string;
37
+ "Copy(playground)(aria-label)": string;
35
38
  "Created(playground status info)": string;
36
39
  "Default(operation page)": string;
37
40
  "Default(schema UI)": string;
@@ -63,7 +66,6 @@ export type Translations = {
63
66
  "Header(playground)": string;
64
67
  "Headers(playground result display)": string;
65
68
  "Implicit(OAuth dialog)": string;
66
- "In(security scheme)": string;
67
69
  "Include the client ID and secret in the token request body.(OAuth dialog)": string;
68
70
  "Intended for the server-to-server authentication.(OAuth dialog)": string;
69
71
  "Internal Server Error(playground status info)": string;
@@ -78,7 +80,6 @@ export type Translations = {
78
80
  "Not Modified(playground status info)": string;
79
81
  "Not set(playground)": string;
80
82
  "OK(playground status info)": string;
81
- "OpenID Connect is not supported at the moment, you can still set an access token here.(playground)": string;
82
83
  "OpenID Connect(security scheme)": string;
83
84
  "Path Parameters(operation page)": string;
84
85
  "Path(playground)": string;
@@ -118,7 +119,6 @@ export type Translations = {
118
119
  "Too Many Requests(playground status info)": string;
119
120
  "Try in Playground(playground)": string;
120
121
  "Type(playground)": string;
121
- "TypeScript Definitions(TypeScript definitions)": string;
122
122
  "Unauthorized(playground status info)": string;
123
123
  "Unprocessable Content(playground status info)": string;
124
124
  "Unset(playground)": string;
@@ -3,6 +3,7 @@ var keys_default = [
3
3
  "1 item(playground)",
4
4
  "Accepted(playground status info)",
5
5
  "Add Item(playground)",
6
+ "Add this to the allowed redirect URIs of your OAuth application.(OAuth dialog)",
6
7
  "Add(playground)",
7
8
  "Authenticate using username and password.(OAuth dialog)",
8
9
  "Authenticate with 3rd party services(OAuth dialog)",
@@ -27,11 +28,13 @@ var keys_default = [
27
28
  "Choose a file(playground)",
28
29
  "Clear(playground result display)",
29
30
  "Client Credentials(OAuth dialog)",
31
+ "Close(operation page)",
30
32
  "Close(playground)",
31
33
  "Conflict(playground status info)",
32
34
  "Cookie Parameters(operation page)",
33
35
  "Cookies(playground)",
34
- "Copy(TypeScript definitions)",
36
+ "Copied(playground)(aria-label)",
37
+ "Copy(playground)(aria-label)",
35
38
  "Created(playground status info)",
36
39
  "Default(operation page)",
37
40
  "Default(schema UI)",
@@ -63,7 +66,6 @@ var keys_default = [
63
66
  "Header(playground)",
64
67
  "Headers(playground result display)",
65
68
  "Implicit(OAuth dialog)",
66
- "In(security scheme)",
67
69
  "Include the client ID and secret in the token request body.(OAuth dialog)",
68
70
  "Intended for the server-to-server authentication.(OAuth dialog)",
69
71
  "Internal Server Error(playground status info)",
@@ -78,7 +80,6 @@ var keys_default = [
78
80
  "Not Modified(playground status info)",
79
81
  "Not set(playground)",
80
82
  "OK(playground status info)",
81
- "OpenID Connect is not supported at the moment, you can still set an access token here.(playground)",
82
83
  "OpenID Connect(security scheme)",
83
84
  "Path Parameters(operation page)",
84
85
  "Path(playground)",
@@ -118,7 +119,6 @@ var keys_default = [
118
119
  "Too Many Requests(playground status info)",
119
120
  "Try in Playground(playground)",
120
121
  "Type(playground)",
121
- "TypeScript Definitions(TypeScript definitions)",
122
122
  "Unauthorized(playground status info)",
123
123
  "Unprocessable Content(playground status info)",
124
124
  "Unset(playground)",
package/dist/operation.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { createCodeUsageGeneratorRegistry, pathnameFromRequest } from "./requests/generators/index.js";
3
- import { joinURL } from "./packages/shared-api/dist/utils/url.js";
4
- import { ServerProvider, useServer } from "./utils/use-server.js";
5
- import { useOpenAPI } from "./utils/create-page.js";
6
3
  import { idToTitle } from "./packages/shared-api/dist/utils/id-to-title.js";
7
- import { getExampleValue, getPreferredType, methodKeys } from "./utils/schema.js";
4
+ import { joinURL } from "./packages/shared-api/dist/utils/url.js";
8
5
  import { encodeRequestData } from "./requests/media/encode.js";
6
+ import { getExampleValue, getPreferredType, methodKeys } from "./utils/schema.js";
9
7
  import { getExampleRequests } from "./utils/get-example-requests.js";
8
+ import { ServerProvider, useServer } from "./utils/use-server.js";
9
+ import { useOpenAPI } from "./utils/create-page.js";
10
10
  import { createContext, use, useMemo, useSyncExternalStore } from "react";
11
11
  import { getRaw } from "@scalar/json-magic/magic-proxy";
12
12
  import { sample } from "@fumadocs/json-schema";
@@ -22,6 +22,7 @@ export type Translations = {
22
22
  "Remove Item(playground)(aria-label)": string;
23
23
  "Select(playground)": string;
24
24
  "Selected(playground)": string;
25
+ "Show Path(schema UI)(aria-label)": string;
25
26
  "Show Property(playground)": string;
26
27
  "Unset(playground)": string;
27
28
  "Upload(playground)": string;
@@ -21,6 +21,7 @@ var keys_default = [
21
21
  "Remove Item(playground)(aria-label)",
22
22
  "Select(playground)",
23
23
  "Selected(playground)",
24
+ "Show Path(schema UI)(aria-label)",
24
25
  "Show Property(playground)",
25
26
  "Unset(playground)",
26
27
  "Upload(playground)",
@@ -1,17 +1,61 @@
1
+ "use client";
2
+ import { createContext, use, useCallback, useEffect, useEffectEvent, useRef, useSyncExternalStore } from "react";
3
+ import { jsx } from "react/jsx-runtime";
1
4
  import { slug } from "github-slugger";
2
5
  //#region ../shared-api/dist/auto-anchor/index.js
3
- /** slugify segments, append `\0` to keep segment as-is */
4
- function anchorSegments(...segs) {
5
- const mapped = [];
6
- for (const seg of segs) if (seg.startsWith("\0")) mapped.push(seg.slice(1));
7
- else if (seg.length > 0) mapped.push(slug(seg));
8
- return mapped.join(".");
6
+ const AnchorContext = createContext("");
7
+ /** Append segments to the anchor IDs below */
8
+ function AnchorSection({ segments, children }) {
9
+ return /* @__PURE__ */ jsx(AnchorContext, {
10
+ value: useAnchorId(segments),
11
+ children
12
+ });
13
+ }
14
+ function useAnchorId(segments) {
15
+ if (!segments) return null;
16
+ let id = use(AnchorContext);
17
+ for (const segment of segments) {
18
+ const slugged = slug(segment);
19
+ if (slugged) id = id ? `${id}.${slugged}` : slugged;
20
+ }
21
+ return id;
9
22
  }
10
23
  /**
11
- * Check if `id1` starts with `id2`
24
+ * Call `onLink` to reveal the anchor section whenever the URL hash links into it.
25
+ *
26
+ * Returns a ref for the revealed content, scrolling to the hash once it renders when the browser couldn't.
12
27
  */
13
- function anchorIdStartsWith(id1, id2) {
14
- return id1 === id2 || id1.startsWith(`${id2}.`);
28
+ function useAnchorLink(segments, onLink) {
29
+ const id = useAnchorId(segments);
30
+ const linked = useSyncExternalStore(subscribeHash, () => {
31
+ const hash = getHash();
32
+ return id !== null && (hash === id || hash.startsWith(`${id}.`)) ? hash : null;
33
+ }, () => null);
34
+ const link = useEffectEvent(onLink);
35
+ const scroll = useRef(false);
36
+ useEffect(() => {
37
+ if (!linked) return;
38
+ scroll.current = !document.getElementById(linked);
39
+ link();
40
+ }, [linked]);
41
+ return useCallback((element) => {
42
+ if (!element || !scroll.current) return;
43
+ scroll.current = false;
44
+ (document.getElementById(getHash()) ?? element).scrollIntoView();
45
+ }, []);
46
+ }
47
+ /** the URL hash, decoded like the browser does to find its target */
48
+ function getHash() {
49
+ const hash = window.location.hash.slice(1);
50
+ try {
51
+ return decodeURIComponent(hash);
52
+ } catch {
53
+ return hash;
54
+ }
55
+ }
56
+ function subscribeHash(onChange) {
57
+ window.addEventListener("hashchange", onChange);
58
+ return () => window.removeEventListener("hashchange", onChange);
15
59
  }
16
60
  //#endregion
17
- export { anchorIdStartsWith, anchorSegments };
61
+ export { AnchorSection, useAnchorId, useAnchorLink };
@@ -1,8 +1,7 @@
1
1
  "use client";
2
2
  import { cn } from "../utils/cn.js";
3
- import { anchorIdStartsWith } from "../auto-anchor/index.js";
4
- import { AnchorSection, useAnchorId } from "../auto-anchor/client.js";
5
- import { createContext, use, useEffect, useMemo, useState } from "react";
3
+ import { AnchorSection, useAnchorLink } from "../auto-anchor/index.js";
4
+ import { createContext, use, useMemo, useState } from "react";
6
5
  import { jsx, jsxs } from "react/jsx-runtime";
7
6
  import { ChevronRight } from "lucide-react";
8
7
  import { Accordion } from "@base-ui/react/accordion";
@@ -29,14 +28,7 @@ function Accordions({ type = "single", defaultValue, ...props }) {
29
28
  }
30
29
  function AccordionItem({ value, className, anchorSegments, ...props }) {
31
30
  const ctx = use(Context);
32
- const id = useAnchorId(anchorSegments ?? false);
33
- useEffect(() => {
34
- if (id && anchorIdStartsWith(window.location.hash.slice(1), id)) ctx.setValue([value]);
35
- }, [
36
- value,
37
- id,
38
- ctx
39
- ]);
31
+ useAnchorLink(anchorSegments ?? false, () => ctx.setValue([value]));
40
32
  const content = /* @__PURE__ */ jsx(Accordion.Item, {
41
33
  value,
42
34
  className: cn("scroll-m-20 border-b last:border-b-0", className),
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { cn } from "../utils/cn.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { Collapsible } from "@base-ui/react/collapsible";
5
+ //#region ../shared-api/dist/components/collapsible.js
6
+ const Collapsible$1 = Collapsible.Root;
7
+ Collapsible.Trigger;
8
+ function CollapsibleContent({ children, className, ...props }) {
9
+ return /* @__PURE__ */ jsx(Collapsible.Panel, {
10
+ ...props,
11
+ className: (s) => cn("overflow-hidden [&[hidden]:not([hidden='until-found'])]:hidden h-(--collapsible-panel-height) transition-[height,opacity] data-starting-style:opacity-0 data-starting-style:h-0 data-ending-style:h-0 data-ending-style:opacity-0", typeof className === "function" ? className(s) : className),
12
+ children
13
+ });
14
+ }
15
+ //#endregion
16
+ export { Collapsible$1 as Collapsible, CollapsibleContent };
@@ -51,7 +51,7 @@ function createProcessor(CodeBlock) {
51
51
  }
52
52
  const mdxComponents = {
53
53
  ...defaultMdxComponents,
54
- img: void 0,
54
+ img: "img",
55
55
  pre: Pre
56
56
  };
57
57
  function rehypeReact() {
@@ -1,12 +1,17 @@
1
1
  import { ReactNode } from "react";
2
2
  import { SchemaUIGeneratedData } from "@fumadocs/json-schema/react";
3
3
  //#region ../shared-api/dist/components/schema/client.d.ts
4
+ //#region src/components/schema/client.d.ts
4
5
  export interface SchemaUIProps {
5
6
  /** anchor ID of the root schema, links to a property are resolved against it */
6
7
  rootId: string;
7
8
  name: string;
8
9
  required?: boolean;
9
10
  as?: 'property' | 'body';
11
+ /** selects the variant of the root schema, like its media type, shown above the breadcrumbs */
12
+ selector?: ReactNode;
13
+ /** actions of the root schema, like copying its type definitions */
14
+ actions?: ReactNode;
10
15
  generated: SchemaUIGeneratedData;
11
16
  }
12
17
  //#endregion