fumadocs-openapi 12.1.1 → 12.3.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 (50) hide show
  1. package/css/generated/shared.css +1 -1
  2. package/dist/.translations/index.d.ts +63 -20
  3. package/dist/.translations/keys.js +63 -20
  4. package/dist/operation.d.ts +6 -1
  5. package/dist/operation.js +2 -4
  6. package/dist/packages/shared-api/dist/.translations/index.d.ts +1 -0
  7. package/dist/packages/shared-api/dist/.translations/keys.js +1 -0
  8. package/dist/packages/shared-api/dist/auto-anchor/index.js +54 -10
  9. package/dist/packages/shared-api/dist/components/accordion.js +3 -11
  10. package/dist/packages/shared-api/dist/components/collapsible.js +2 -2
  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/packages/shared-api/dist/components/select.js +8 -7
  15. package/dist/playground/auth.d.ts +5 -1
  16. package/dist/playground/auth.js +7 -2
  17. package/dist/playground/fetcher.d.ts +8 -0
  18. package/dist/playground/fetcher.js +30 -1
  19. package/dist/playground/index.d.ts +2 -1
  20. package/dist/playground/index.js +2 -1
  21. package/dist/playground/use-playground.d.ts +62 -0
  22. package/dist/playground/use-playground.js +140 -0
  23. package/dist/ui/components/dialog.js +14 -0
  24. package/dist/ui/components/endpoint.js +40 -0
  25. package/dist/ui/components/heading.js +1 -1
  26. package/dist/ui/components/schema.js +1 -1
  27. package/dist/ui/components/segmented.js +21 -0
  28. package/dist/ui/operation/index.js +267 -250
  29. package/dist/ui/playground/client.d.ts +9 -26
  30. package/dist/ui/playground/client.js +150 -389
  31. package/dist/ui/playground/components/fields.js +693 -0
  32. package/dist/ui/playground/components/oauth-panel.js +182 -0
  33. package/dist/ui/playground/components/request-panel.js +480 -0
  34. package/dist/ui/playground/components/response-panel.js +150 -0
  35. package/dist/ui/playground/components/result-display.d.ts +1 -0
  36. package/dist/ui/playground/components/result-display.js +185 -168
  37. package/dist/ui/playground/components/server-select.js +100 -89
  38. package/dist/ui/playground/components/url-bar.js +96 -0
  39. package/dist/ui/playground/status-info.js +32 -45
  40. package/dist/utils/document/load.js +1 -1
  41. package/package.json +12 -12
  42. package/dist/packages/shared-api/dist/auto-anchor/client.js +0 -20
  43. package/dist/packages/shared-api/dist/components/collapsible.d.ts +0 -7
  44. package/dist/packages/shared-api/dist/components/dialog.js +0 -55
  45. package/dist/packages/shared-api/dist/components/input.js +0 -14
  46. package/dist/packages/shared-api/dist/components/label.js +0 -11
  47. package/dist/packages/shared-api/dist/components/playground/inputs.js +0 -439
  48. package/dist/packages/shared-api/dist/components/popover.js +0 -23
  49. package/dist/packages/shared-api/dist/utils/merge-refs.js +0 -11
  50. package/dist/ui/playground/components/oauth-dialog.js +0 -259
@@ -1 +1 @@
1
- @source inline("!isDefined *:data-[collapsible=true]:order-last *:min-w-0 --- --accordion-panel-height --anchor-width --available-height --available-width --collapsible-panel-height --fd-docs-row-1 --min-height --spacing --transform-origin -mode -ms-2 -mx-3 -translate-x-1/2 -translate-y-1/2 @4xl:flex-row @4xl:items-start @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px] @container @default @fuma-translate/react @fumadocs/json-schema @fumari/stf @md:grid-cols-2 @param @private @returns @scalar/api-client-react @see @typescript-eslint/no-explicit-any [&[hidden]:not([hidden='until-found'])]:hidden [&_svg]:size-3.5 a absolute accept access access_token accordion actual adapter adapters additionalProperties again against alias align allFlows allOf allow already alt always an anchor anchorIdStartsWith anchorSegments and animate-spin anyFields anyOf apiExample apiKey apiPlayground applicable application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml applies apply are aria-label aria-live arkdown array as asSchema async at audience auth auth-specific authCodeQuery authNode authSchemes authorization authorizationCode authorizationUrl authorization_code authorize authorizes autoComplete avoid await back backdrop-blur-lg backdrop-blur-sm badgeVariants base baseDir basic be because before behavior belong bg-black/30 bg-fd-background/50 bg-fd-card bg-fd-muted bg-fd-popover bg-fd-popover/60 bg-fd-primary bg-fd-primary/10 bg-fd-secondary bg-transparent binary block blocks blue body bodyMediaType bodyNode boolean border border-0 border-b border-current border-fd-primary/20 border-s border-t border-y bottom break-all built-in bundled button buttonVariants by byteLength bytes cache cached cachedDocFiles callbacks callbacksNode can cannot case catch center change charset children class-variance-authority className cleanup client clientAuth clientAuthMethods clientCredentials clientHeight clientId clientSecret client_auth client_credentials client_error client_id client_secret cloned closed cn code codeProps codeUsages codeblock col-span-full collapsible color compiler components configuration const content contentType contentTypes cookie cookies copying core createContext createOAuthHandler createOpenAPIPageBase createProxy credentials css csv ctx current currentValue custom customise customization cva dark 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-closed:animate-fd-dialog-out data-closed:animate-fd-fade-out data-collapsible data-ending-style:h-0 data-ending-style:opacity-0 data-object-search-input data-open:animate-fd-dialog-in data-open:animate-fd-fade-in data-placeholder:text-fd-muted-foreground data-starting-style:h-0 data-starting-style:opacity-0 data-type dataEngine decoded default defaultMdxComponents defaultOpen defaultShikiFactory defaultShikiOptions defaultValue defaultValues defaults deferredValue define definitions delete deprecated depth dereference dereferenced description descriptionNode development deviceAuthorization dialog didn disable disableCache disabled disabled:cursor-not-allowed disabled:opacity-50 display displayNames disposition div do doc docCache docFilesCache docRoot docs document documents domain download downloaded drives duplicated duration-200 during dynamic dynamicSource e eading ease-out element else empty empty:hidden enabled encode encodeRequestData encoded end end-2 endpoint enforce engine ensure entries entry enum error eslint-disable eslint-disable-next-line example exampleId examples export exported extended extends fallback false fast-content-type-parse fd-page-tree-item-name fd-scroll-container fetch fetcher field fieldData fieldLabelVariants fieldName fields file filePath files filtered fine first first:border-t-0 firstItemRef fixed flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flows focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-fd-ring focus-within:[&_svg]:text-fd-primary focus-within:ring focus-within:ring-2 focus-within:ring-fd-ring focus:outline-none focus:ring focus:ring-0 focus:ring-fd-ring folder folderStyle font-medium font-mono font-normal font-semibold for form form-encoded formData format fragment from 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-6 gap-x-4 gap-x-6 gap-y-1 gap-y-4 generate generateDefault generateSchemaUI generated get getOpenAPIPageProps getSchema getSchemas getWatchPaths ghost github-dark github-light given go goes grant_type gray green grid grid-cols-1 grid-cols-[auto_1fr] group group-data-[panel-open]/accordion:rotate-90 group-data-[panel-open]:rotate-180 group/accordion groupId h-(--accordion-panel-height) h-(--collapsible-panel-height) h-10 h-9 h-[240px] h-px h1 hash hast-util-to-jsx-runtime have headNode header headers heading headingLevel headless hidden hiddenProperties highlighted highlighter holding hook hover:bg-fd-accent hover:text-fd-accent-foreground hover:underline how href html htmlFor http hydration i icon icon-sm icon-xs id idx if ignore img implicit import imports in in-popover index indexItemMatch info infoTags init initial inline-flex input inputs inset-0 inside installed instanceof instead integer interface internal into invalid is isDefined isDuplicated isDynamic isLazy isLoading isMounted isNumber isRequired issues it item items items-center items-start its j js json json-schema-typed justify-between justify-center keep key keyed keyof kind label labelClassName lang last last:border-b-0 last:mb-0 lazy leading-none leave left left-1/2 length let light like line-through link links list list-disc list-inside listed listen listener listeners load loadDocument loaderPlugin localStorage location lucide-react map mapValues marker:text-fd-muted-foreground match matching max-age max-h-(--available-height) max-h-[460px] max-w-(--available-width) max-w-[98vw] max-w-full max-w-lg may mb-1 mb-2 mb-auto md mdxComponents me-auto media mediaAdapters mediaType member merge mergeRefs message meta metaData method methods mime min-h-(--min-height,200px) min-w-0 min-w-[240px] min-w-[calc(var(--anchor-width)+--spacing(2))] modify mounted ms-auto mt-0! mt-10 mt-2 mt-3 multipart/form-data multiple must mx-1 my-0! my-1 my-1.5 my-2 my-2! my-4 name name! named namespace navigating navigation needs nested never new no no-cache node node:fs node:path noop normalizes not not-last:pb-0 not-prose note null number oauth2 oauthRedirectUrl object objectSearchOverrides objectSet objectUrl objects of off omit on onChange onClick onCopy onKeyDown onOpenChange onScrollEnd onSubmit onToken onValueChange one oneOf ones only opacity-80 open openApiData openIdConnect openapi openapiMeta opened 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 p-1 p-1.5 p-2 p-3 p-4 packages page pageData pages panelVariants 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-2 pe-2 pe-3 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 pending pendingFlowKey persist persisted picked place placeholder placeholder:text-fd-muted-foreground playground playgrounds please plugins polite popover popoverRef positions pre preferring preloadOpenAPIPage preloaded preventScroll previous primitive processor properties property props prose prose-no-margin prose-sm proxy proxyForwardCookie proxyUrl ps-1 ps-2 ps-3 ps-4.5 ps-6 pt-0 pt-1 pt-2 pt-2.5 px px-1 px-2 px-3 px-4 py-0 py-0.5 py-1 py-1.5 py-2 py-4 query querySelector quiet random raw rawSearch re-triggering react react-hooks/exhaustive-deps react/jsx-runtime read readOnly readonly record red redirect redirectUrl redirect_uri ref reference refs regenerated rehype-react relative relativePath remark remark-rehype remarkGfm remarkRehype remove removeItem removing render renderBodyField renderCodeblock renderMarkdown renderParameterField renderPopoverTrigger renderTrigger rendered renderers renders replace represents request request-body requestBody requestData requestInit requestTimeout requestUrl requests required requirement requirements res reset resize-none resolve resolveMediaAdapter resolveUrl resolved resolvedInput resolvedTheme response response-body responseNode responseTabs response_type responses rest restored result return returning returns role root rootId roots rotate-90 rounded-2xl rounded-b-none rounded-lg rounded-md rounded-sm rounded-t-md rounded-xl route s-highlight safeParse same satisfies scalar scan schema schemaId schemaPropKeys schemaUI scheme schemeId schemes scope scopes scroll scroll-m-20 scrollTop scrollTops search secondary seconds secret section sections security see segments segs select select-none selected selectedType selections selector send sends sep separator server server-to-server serverSchema serverUrl services sessionStorage set setClientAuth setError setInfo setIsJson setNextName setObjectUrl setOpen setPath setSearch setSelected setServerVariables setShow setStore setToken setType setValue shadow-lg shadow-md shadow-sm shared shiki shikiOptions show showDescription showExample showResponseSchema showSelect showTitle showing shrink-0 side sideOffset signal single size size-3.5 size-4 skipNonRequired skipReadOnly slot slotType slots sm sm:flex-row sm:gap-2 sm:justify-end sm:text-start smooth so some sr-only src stable start started state staticSource status statusInfo step stf stfSync sticky still storageKey store stored string stringify stringifyFieldKey structuredData styles submit subscribe such supported svg switch t tab tabDepth tabValues tabs tag target testQuery text text-[0.8125rem] text-blue-600 text-center text-end text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-muted-foreground/70 text-fd-popover-foreground text-fd-primary text-fd-primary-foreground text-fd-secondary-foreground text-green-500 text-green-600 text-lg text-nowrap text-orange-400 text-orange-600 text-red-400 text-red-400/80 text-red-500 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 they this through throw timeout timerRef tips title to toJsxRuntime toStaticData toc token tokenInfo tokenUrl token_type token_url tokens toolbar top top-0 top-1/2 top-10 top-2 tracking-tight transform transformPageTree transition-[height,opacity] transition-[height] transition-colors transition-transform translations tree trigger true truncate try ts type typeVariants typeof types unchanged undefined under underline unexpected union unionField unions unknown unlisted unselected up update updateInfo updated updating url usageTabs use useAnchorId useApiClient useComponents useCopyButton useFieldValue useListener useMemo useNamespace useObject useOnChange useOpenAPI useOperation usePlaygroundAuth useQuery useRef useRenderContext useResponseExamples useServer useState useStatusInfo useStf useSyncExternalStore useTheme useTranslations useTypeScriptDefinitions used username users using utf-8 v value valueSchema values variable variables variant variants via view virtual void w-0 w-14 w-[600px] w-fit w-full warn was we webhook webhooks when where will with without won wrap-break-word wrapping write writeOnly x-exclusiveCodeSample x-playground-lazy xml yellow you your 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 @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 added additional additionalProperties after again against alias align all allOf allow allowJson 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 authCodeQuery authNode authSchemes authorization authorizationCode authorizationUrl authorization_code authorization_url authorize 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 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 closeDelay closest cn code codeProps codeUsages codeblock col-span-2 col-span-full collapse collapses collapsible color compiler components compute configuration const constraints container content contentTypes control cookie cookies copy 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 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 editor edits element elements else 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 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-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 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 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 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 load loadDocument loaderPlugin loading 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 oauth oauth2 oauthRedirectUrl object objectSet objects observer obtain of off omit on onAppend onAuthorized onBack onChange onCheckedChange onClick onCopy onKeyDown onLink onNavigate onOAuth onOpenChange onRemove onReset 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 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 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 pointer-coarse:opacity-100 polite popup position pre preferred prefers preloadOpenAPIPage preloaded prev preview previous primary primitive processor prop properties property props prose prose-no-margin prose-sm 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 returned 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 sends separator server server-to-server serverSchema serverUrl services sessionStorage set setClientAuth setCode setCollapsed setDraft setError setFilter setInfo setMode setMotion setName setNextName setOAuth 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 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 still stops storageKey store stored string stringify stringifyFieldKey structuredData style styles submit subscribe 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 tokenInfo tokenUrl token_type token_url tokens toolbar top top-(--active-tab-top) top-0 top-1/2 top-2 total 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-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 up update updateInfo updated updating url usageTabs usages use useAnchorId useAnchorLink 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-[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 you your z-0 z-10 z-50");
@@ -1,86 +1,129 @@
1
1
  //#region src/.translations/index.d.ts
2
2
  export type Translations = {
3
- "Access Token(playground)": string;
3
+ "1 item(playground)": string;
4
+ "Accepted(playground status info)": string;
5
+ "Add Item(playground)": string;
6
+ "Add(playground)": string;
4
7
  "Authenticate using username and password.(OAuth dialog)": string;
5
8
  "Authenticate with 3rd party services(OAuth dialog)": string;
6
9
  "Authenticate with device.(OAuth dialog)": string;
7
10
  "Authorization code(OAuth dialog)": string;
8
- "Authorization(OAuth dialog)": string;
9
11
  "Authorization(operation page)": string;
10
12
  "Authorization(playground)": string;
11
13
  "Authorization(security scheme)": string;
14
+ "Authorize(OAuth dialog)": string;
12
15
  "Authorize(playground)": string;
16
+ "Back(playground)": string;
17
+ "Bad Gateway(playground status info)": string;
13
18
  "Bad Request(playground status info)": string;
14
19
  "Basic <token>(security scheme)": string;
15
20
  "Bearer <token>(security scheme)": string;
16
21
  "Binary response body, {length} bytes(playground result display)": string;
22
+ "Body(playground result display)": string;
17
23
  "Body(playground)": string;
24
+ "Breadcrumb(playground)": string;
18
25
  "Callbacks(operation page)": string;
19
- "Client Authentication(OAuth dialog)": string;
26
+ "Check the server URL. If the API does not allow cross-origin requests from this site, a proxy is needed.(playground result display)": string;
27
+ "Choose a file(playground)": string;
28
+ "Clear(playground result display)": string;
20
29
  "Client Credentials(OAuth dialog)": string;
21
- "Client Error(playground result display)": string;
22
- "Client ID(OAuth dialog)": string;
23
- "Client Secret(OAuth dialog)": string;
24
- "Close JSON Editor(playground)": string;
25
- "Close(playground result display)": string;
30
+ "Close(operation page)": string;
31
+ "Close(playground)": string;
32
+ "Conflict(playground status info)": string;
26
33
  "Cookie Parameters(operation page)": string;
27
34
  "Cookies(playground)": string;
28
- "Copy(TypeScript definitions)": string;
35
+ "Created(playground status info)": string;
29
36
  "Default(operation page)": string;
37
+ "Default(schema UI)": string;
30
38
  "Deprecated(operation page)": string;
39
+ "Deprecated(playground)": string;
31
40
  "Deprecated(security scheme)": string;
32
41
  "Device Authorization(OAuth dialog)": string;
33
42
  "Download(playground result display)": string;
43
+ "Editor(playground)": string;
44
+ "Empty response body(playground result display)": string;
34
45
  "Empty(operation page)": string;
46
+ "Enter Property Name(playground)": string;
35
47
  "Enter Value(playground server select)": string;
36
- "Enter value(OAuth dialog)": string;
48
+ "Enter value(playground)": string;
37
49
  "Error(playground status info)": string;
38
50
  "Example Requests(operation page)": string;
39
51
  "Example {key}(operation page)": string;
40
52
  "Example(operation page)": string;
53
+ "Example(playground)": string;
54
+ "Example(schema UI)": string;
41
55
  "Failed to fetch token(playground)": string;
42
56
  "Fetching token...(playground)": string;
57
+ "Field Info(playground)": string;
43
58
  "Forbidden(playground status info)": string;
59
+ "Form(playground)": string;
60
+ "Format(schema UI)": string;
61
+ "Found(playground status info)": string;
44
62
  "Header Parameters(operation page)": string;
45
63
  "Header(playground)": string;
46
64
  "Headers(playground result display)": string;
47
65
  "Implicit(OAuth dialog)": string;
48
- "In(security scheme)": string;
49
66
  "Include the client ID and secret in the token request body.(OAuth dialog)": string;
50
67
  "Intended for the server-to-server authentication.(OAuth dialog)": string;
51
68
  "Internal Server Error(playground status info)": string;
69
+ "Items(schema UI)": string;
70
+ "Length(schema UI)": string;
71
+ "Match(schema UI)": string;
72
+ "Method Not Allowed(playground status info)": string;
73
+ "Moved Permanently(playground status info)": string;
74
+ "No Content(playground status info)": string;
75
+ "No example available.(playground)": string;
52
76
  "Not Found(playground status info)": string;
53
- "Obtain the access token for API.(OAuth dialog)": string;
54
- "Open JSON Editor(playground)": string;
77
+ "Not Modified(playground status info)": string;
78
+ "Not set(playground)": string;
79
+ "OK(playground status info)": string;
55
80
  "OpenID Connect is not supported at the moment, you can still set an access token here.(playground)": string;
56
81
  "OpenID Connect(security scheme)": string;
57
- "Password(OAuth dialog)": string;
58
82
  "Path Parameters(operation page)": string;
59
83
  "Path(playground)": string;
84
+ "Property Name(playground)": string;
60
85
  "Query Parameters(operation page)": string;
61
86
  "Query(playground)": string;
87
+ "Range(schema UI)": string;
88
+ "Redirect(playground status info)": string;
89
+ "Remove Item(playground)(aria-label)": string;
90
+ "Remove(playground)": string;
62
91
  "Request Body(operation page)": string;
92
+ "Request Failed(playground result display)": string;
93
+ "Request(playground)": string;
63
94
  "Resource Owner Password Flow(OAuth dialog)": string;
64
95
  "Response Body(operation page)": string;
96
+ "Response(playground)": string;
65
97
  "Retrieve the access token directly.(OAuth dialog)": string;
98
+ "Schema(playground)": string;
66
99
  "Scope(security scheme)": string;
67
- "Select a flow(OAuth dialog)": string;
100
+ "Scopes(OAuth dialog)": string;
101
+ "Select(playground)": string;
102
+ "Send a request to see its response.(playground)": string;
68
103
  "Send as Basic Auth header(OAuth dialog)": string;
69
104
  "Send client credentials in body(OAuth dialog)": string;
70
105
  "Send the client ID and secret in the Authorization header.(OAuth dialog)": string;
71
106
  "Send(playground)": string;
107
+ "Sending request...(playground)": string;
72
108
  "Server URL(playground server select)": string;
73
- "Submit(OAuth dialog)": string;
109
+ "Service Unavailable(playground status info)": string;
110
+ "Show Property(playground)": string;
74
111
  "Successful(playground status info)": string;
112
+ "Switch Field(playground)": string;
75
113
  "Test(scalar API client)": string;
76
- "The base URL of your API endpoint.(playground server select)": string;
77
114
  "The client ID of your OAuth application.(OAuth dialog)": string;
78
115
  "The client secret of your OAuth application.(OAuth dialog)": string;
79
- "TypeScript Definitions(TypeScript definitions)": string;
116
+ "This endpoint has no parameters.(playground)": string;
117
+ "Too Many Requests(playground status info)": string;
118
+ "Try in Playground(playground)": string;
119
+ "Type(playground)": string;
80
120
  "Unauthorized(playground status info)": string;
121
+ "Unprocessable Content(playground status info)": string;
122
+ "Unset(playground)": string;
81
123
  "Unsupported(OAuth dialog)": string;
82
124
  "Use the {name} type in TypeScript.(TypeScript definitions)": string;
83
- "Username(OAuth dialog)": string;
84
- "loading...(playground server select)": string;
125
+ "Variables(playground server select)": string;
126
+ "You will be redirected to authorize, then back to this page.(OAuth dialog)": string;
127
+ "{count} items(playground)": string;
85
128
  };
86
129
  //#endregion
@@ -1,87 +1,130 @@
1
1
  //#region src/.translations/keys.json
2
2
  var keys_default = [
3
- "Access Token(playground)",
3
+ "1 item(playground)",
4
+ "Accepted(playground status info)",
5
+ "Add Item(playground)",
6
+ "Add(playground)",
4
7
  "Authenticate using username and password.(OAuth dialog)",
5
8
  "Authenticate with 3rd party services(OAuth dialog)",
6
9
  "Authenticate with device.(OAuth dialog)",
7
10
  "Authorization code(OAuth dialog)",
8
- "Authorization(OAuth dialog)",
9
11
  "Authorization(operation page)",
10
12
  "Authorization(playground)",
11
13
  "Authorization(security scheme)",
14
+ "Authorize(OAuth dialog)",
12
15
  "Authorize(playground)",
16
+ "Back(playground)",
17
+ "Bad Gateway(playground status info)",
13
18
  "Bad Request(playground status info)",
14
19
  "Basic <token>(security scheme)",
15
20
  "Bearer <token>(security scheme)",
16
21
  "Binary response body, {length} bytes(playground result display)",
22
+ "Body(playground result display)",
17
23
  "Body(playground)",
24
+ "Breadcrumb(playground)",
18
25
  "Callbacks(operation page)",
19
- "Client Authentication(OAuth dialog)",
26
+ "Check the server URL. If the API does not allow cross-origin requests from this site, a proxy is needed.(playground result display)",
27
+ "Choose a file(playground)",
28
+ "Clear(playground result display)",
20
29
  "Client Credentials(OAuth dialog)",
21
- "Client Error(playground result display)",
22
- "Client ID(OAuth dialog)",
23
- "Client Secret(OAuth dialog)",
24
- "Close JSON Editor(playground)",
25
- "Close(playground result display)",
30
+ "Close(operation page)",
31
+ "Close(playground)",
32
+ "Conflict(playground status info)",
26
33
  "Cookie Parameters(operation page)",
27
34
  "Cookies(playground)",
28
- "Copy(TypeScript definitions)",
35
+ "Created(playground status info)",
29
36
  "Default(operation page)",
37
+ "Default(schema UI)",
30
38
  "Deprecated(operation page)",
39
+ "Deprecated(playground)",
31
40
  "Deprecated(security scheme)",
32
41
  "Device Authorization(OAuth dialog)",
33
42
  "Download(playground result display)",
43
+ "Editor(playground)",
44
+ "Empty response body(playground result display)",
34
45
  "Empty(operation page)",
46
+ "Enter Property Name(playground)",
35
47
  "Enter Value(playground server select)",
36
- "Enter value(OAuth dialog)",
48
+ "Enter value(playground)",
37
49
  "Error(playground status info)",
38
50
  "Example Requests(operation page)",
39
51
  "Example {key}(operation page)",
40
52
  "Example(operation page)",
53
+ "Example(playground)",
54
+ "Example(schema UI)",
41
55
  "Failed to fetch token(playground)",
42
56
  "Fetching token...(playground)",
57
+ "Field Info(playground)",
43
58
  "Forbidden(playground status info)",
59
+ "Form(playground)",
60
+ "Format(schema UI)",
61
+ "Found(playground status info)",
44
62
  "Header Parameters(operation page)",
45
63
  "Header(playground)",
46
64
  "Headers(playground result display)",
47
65
  "Implicit(OAuth dialog)",
48
- "In(security scheme)",
49
66
  "Include the client ID and secret in the token request body.(OAuth dialog)",
50
67
  "Intended for the server-to-server authentication.(OAuth dialog)",
51
68
  "Internal Server Error(playground status info)",
69
+ "Items(schema UI)",
70
+ "Length(schema UI)",
71
+ "Match(schema UI)",
72
+ "Method Not Allowed(playground status info)",
73
+ "Moved Permanently(playground status info)",
74
+ "No Content(playground status info)",
75
+ "No example available.(playground)",
52
76
  "Not Found(playground status info)",
53
- "Obtain the access token for API.(OAuth dialog)",
54
- "Open JSON Editor(playground)",
77
+ "Not Modified(playground status info)",
78
+ "Not set(playground)",
79
+ "OK(playground status info)",
55
80
  "OpenID Connect is not supported at the moment, you can still set an access token here.(playground)",
56
81
  "OpenID Connect(security scheme)",
57
- "Password(OAuth dialog)",
58
82
  "Path Parameters(operation page)",
59
83
  "Path(playground)",
84
+ "Property Name(playground)",
60
85
  "Query Parameters(operation page)",
61
86
  "Query(playground)",
87
+ "Range(schema UI)",
88
+ "Redirect(playground status info)",
89
+ "Remove Item(playground)(aria-label)",
90
+ "Remove(playground)",
62
91
  "Request Body(operation page)",
92
+ "Request Failed(playground result display)",
93
+ "Request(playground)",
63
94
  "Resource Owner Password Flow(OAuth dialog)",
64
95
  "Response Body(operation page)",
96
+ "Response(playground)",
65
97
  "Retrieve the access token directly.(OAuth dialog)",
98
+ "Schema(playground)",
66
99
  "Scope(security scheme)",
67
- "Select a flow(OAuth dialog)",
100
+ "Scopes(OAuth dialog)",
101
+ "Select(playground)",
102
+ "Send a request to see its response.(playground)",
68
103
  "Send as Basic Auth header(OAuth dialog)",
69
104
  "Send client credentials in body(OAuth dialog)",
70
105
  "Send the client ID and secret in the Authorization header.(OAuth dialog)",
71
106
  "Send(playground)",
107
+ "Sending request...(playground)",
72
108
  "Server URL(playground server select)",
73
- "Submit(OAuth dialog)",
109
+ "Service Unavailable(playground status info)",
110
+ "Show Property(playground)",
74
111
  "Successful(playground status info)",
112
+ "Switch Field(playground)",
75
113
  "Test(scalar API client)",
76
- "The base URL of your API endpoint.(playground server select)",
77
114
  "The client ID of your OAuth application.(OAuth dialog)",
78
115
  "The client secret of your OAuth application.(OAuth dialog)",
79
- "TypeScript Definitions(TypeScript definitions)",
116
+ "This endpoint has no parameters.(playground)",
117
+ "Too Many Requests(playground status info)",
118
+ "Try in Playground(playground)",
119
+ "Type(playground)",
80
120
  "Unauthorized(playground status info)",
121
+ "Unprocessable Content(playground status info)",
122
+ "Unset(playground)",
81
123
  "Unsupported(OAuth dialog)",
82
124
  "Use the {name} type in TypeScript.(TypeScript definitions)",
83
- "Username(OAuth dialog)",
84
- "loading...(playground server select)"
125
+ "Variables(playground server select)",
126
+ "You will be redirected to authorize, then back to this page.(OAuth dialog)",
127
+ "{count} items(playground)"
85
128
  ];
86
129
  //#endregion
87
130
  export { keys_default as default };
@@ -5,8 +5,13 @@ import { ReactNode } from "react";
5
5
  //#region src/operation.d.ts
6
6
  export interface OperationParameters {
7
7
  in: 'path' | 'query' | 'header' | 'cookie';
8
- items: ParameterObject[];
8
+ items: OperationParameter[];
9
9
  }
10
+ /** a resolved parameter, with the `name` and `in` required by OpenAPI */
11
+ export type OperationParameter = ParameterObject & {
12
+ name: string;
13
+ in: OperationParameters['in'];
14
+ };
10
15
  export interface OperationSecurity {
11
16
  key: string;
12
17
  scopes: string[];
package/dist/operation.js CHANGED
@@ -36,7 +36,6 @@ function OperationProvider({ type = "operation", path, method, operation, pathIt
36
36
  };
37
37
  }
38
38
  const resolvedParameters = [];
39
- const groups = {};
40
39
  const keys = /* @__PURE__ */ new Set();
41
40
  for (const list of [operation.parameters, pathItem.parameters]) for (const item of list ?? []) {
42
41
  const param = resolve(item);
@@ -44,12 +43,11 @@ function OperationProvider({ type = "operation", path, method, operation, pathIt
44
43
  if (keys.has(key)) continue;
45
44
  keys.add(key);
46
45
  resolvedParameters.push(param);
47
- (groups[param.in] ??= []).push(param);
48
46
  }
49
47
  const parameters = [];
50
48
  for (const location of parameterLocations) {
51
- const items = groups[location];
52
- if (items) parameters.push({
49
+ const items = resolvedParameters.filter((param) => param.in === location && param.name !== void 0);
50
+ if (items.length > 0) parameters.push({
53
51
  in: location,
54
52
  items
55
53
  });
@@ -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),
@@ -4,7 +4,7 @@ import { jsx } from "react/jsx-runtime";
4
4
  import { Collapsible } from "@base-ui/react/collapsible";
5
5
  //#region ../shared-api/dist/components/collapsible.js
6
6
  const Collapsible$1 = Collapsible.Root;
7
- const CollapsibleTrigger = Collapsible.Trigger;
7
+ Collapsible.Trigger;
8
8
  function CollapsibleContent({ children, className, ...props }) {
9
9
  return /* @__PURE__ */ jsx(Collapsible.Panel, {
10
10
  ...props,
@@ -13,4 +13,4 @@ function CollapsibleContent({ children, className, ...props }) {
13
13
  });
14
14
  }
15
15
  //#endregion
16
- export { Collapsible$1 as Collapsible, CollapsibleContent, CollapsibleTrigger };
16
+ export { Collapsible$1 as Collapsible, CollapsibleContent };
@@ -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