@redocly/api-docs 0.2.0-next.5 → 0.2.0-next.7

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 (173) hide show
  1. package/lib/RedocStandalone.d.ts +38 -0
  2. package/lib/RedocStandalone.js +1 -0
  3. package/lib/RedoclyApiDocs.js +1 -1
  4. package/lib/RedoclyApiDocsStandalone.d.ts +2 -0
  5. package/lib/RedoclyApiDocsStandalone.js +3 -3
  6. package/lib/adapters/asyncapi/items/overview/content.js +1 -1
  7. package/lib/adapters/graphql/group/utils.js +1 -1
  8. package/lib/adapters/graphql/utils/createApiItem.js +1 -1
  9. package/lib/adapters/openapi/build-code-sample-source.d.ts +1 -1
  10. package/lib/adapters/openapi/build-code-sample-source.js +1 -1
  11. package/lib/adapters/openapi/configure/merge-utils.d.ts +1 -1
  12. package/lib/adapters/openapi/configure/resolve-request-values.js +1 -1
  13. package/lib/adapters/openapi/index.js +1 -1
  14. package/lib/adapters/openapi/items/operation/content.js +1 -1
  15. package/lib/adapters/openapi/items/operation/item.js +1 -1
  16. package/lib/adapters/openapi/items/overview/content.js +1 -1
  17. package/lib/adapters/openapi/utils/merge-mock-server.d.ts +2 -2
  18. package/lib/adapters/utils/markdoc.d.ts +4 -1
  19. package/lib/adapters/utils/markdoc.js +1 -1
  20. package/lib/components/ErrorBoundary.d.ts +4 -2
  21. package/lib/components/ErrorBoundary.js +1 -1
  22. package/lib/components/Header/HeaderItem.js +5 -5
  23. package/lib/components/Header/HeaderPageActions.d.ts +4 -0
  24. package/lib/components/Header/HeaderPageActions.js +1 -0
  25. package/lib/components/Header/PageActions.d.ts +4 -0
  26. package/lib/components/Header/PageActions.js +11 -0
  27. package/lib/components/ItemContent/sections/MessagesSection.js +1 -1
  28. package/lib/components/Mcp/McpPrompt.js +1 -1
  29. package/lib/components/Mcp/McpTool.js +1 -1
  30. package/lib/components/Mcp/utils.d.ts +1 -1
  31. package/lib/components/Mcp/utils.js +1 -1
  32. package/lib/components/Schema/styled.js +4 -4
  33. package/lib/components/Schema/views/ArrayRenderer.js +1 -1
  34. package/lib/components/Schema/views/DiscriminatorPropertyRow.js +1 -1
  35. package/lib/components/Schema/views/Examples.js +1 -1
  36. package/lib/components/Search/index.d.ts +15 -0
  37. package/lib/components/Search/index.js +1 -0
  38. package/lib/components/Security/SecurityFlowDetail.js +1 -1
  39. package/lib/components/Security/styled.js +7 -7
  40. package/lib/components/StickySidebar/FloatingButton.d.ts +1 -0
  41. package/lib/components/StickySidebar/FloatingButton.js +32 -0
  42. package/lib/components/StickySidebar/RedoclyAttributionLogo.d.ts +5 -0
  43. package/lib/components/StickySidebar/RedoclyAttributionLogo.js +1 -0
  44. package/lib/components/StickySidebar/StickySidebar.js +33 -9
  45. package/lib/components/common/Breadcrumbs.js +2 -2
  46. package/lib/components/common/ResponseCodeTabs.js +1 -1
  47. package/lib/components/common/Tag.js +1 -1
  48. package/lib/components/common/ViewNested.js +2 -2
  49. package/lib/components/graphql/GraphQLFieldView.js +1 -1
  50. package/lib/components/graphql/RequiresScopesModal.js +3 -3
  51. package/lib/components/graphql/sections/GraphQLArgsSection.js +1 -1
  52. package/lib/components/markdoc/SchemaDefinition.js +1 -1
  53. package/lib/components/panels/ExampleItem/CodeSampleItem.js +1 -1
  54. package/lib/components/panels/ExampleItem/ResponseExampleItem.js +1 -1
  55. package/lib/components/panels/ExampleItem/SecuritySchemeSelector.d.ts +9 -0
  56. package/lib/components/panels/ExampleItem/SecuritySchemeSelector.js +1 -0
  57. package/lib/components/panels/ExampleItem/ServerDropdown.js +1 -1
  58. package/lib/components/panels/ExampleItem/generate-request-sample.d.ts +28 -0
  59. package/lib/components/panels/ExampleItem/generate-request-sample.js +1 -0
  60. package/lib/components/panels/ExampleItem/styled.d.ts +1 -49
  61. package/lib/components/panels/ExampleItem/useActiveServer.d.ts +17 -0
  62. package/lib/components/panels/ExampleItem/useActiveServer.js +1 -0
  63. package/lib/components/panels/ExampleItem/useCodeSampleLanguages.d.ts +23 -0
  64. package/lib/components/panels/ExampleItem/useCodeSampleLanguages.js +1 -0
  65. package/lib/components/panels/ExampleItem/useReplayRequestState.d.ts +18 -0
  66. package/lib/components/panels/ExampleItem/useReplayRequestState.js +1 -0
  67. package/lib/components/panels/ExampleItem/useTryItFooter.d.ts +3 -0
  68. package/lib/components/panels/ExampleItem/useTryItFooter.js +7 -0
  69. package/lib/components/panels/GroupPanelItem.js +1 -1
  70. package/lib/components/panels/LanguageItem/LanguagePanelItem.js +5 -1
  71. package/lib/components/panels/LanguageItem/styled.js +17 -14
  72. package/lib/components/panels/McpExamplePanelItem.js +2 -2
  73. package/lib/components/panels/McpPanelItem.js +2 -2
  74. package/lib/components/panels/ServerItem/ServerItem.js +1 -1
  75. package/lib/components/panels/asyncapi/BrokerItem/BrokerModal.js +1 -1
  76. package/lib/components/panels/asyncapi/BrokerItem/BrokerPanelItem.js +1 -1
  77. package/lib/components/panels/shared-panel-styles.js +1 -1
  78. package/lib/components/panels/styled.js +1 -1
  79. package/lib/components/pluggable/RedocResponseSamples.js +1 -1
  80. package/lib/hoc/withLicenseGate.d.ts +5 -0
  81. package/lib/hoc/withLicenseGate.js +1 -0
  82. package/lib/hoc/withStoreProvider.d.ts +2 -0
  83. package/lib/hoc/withStoreProvider.js +1 -1
  84. package/lib/hooks/useCopySpecSlice.d.ts +9 -0
  85. package/lib/hooks/useCopySpecSlice.js +1 -0
  86. package/lib/hooks/useInitialTelemetry.d.ts +2 -0
  87. package/lib/hooks/useInitialTelemetry.js +1 -0
  88. package/lib/hooks/useLicense.js +1 -1
  89. package/lib/hooks/useLicenseGate.d.ts +6 -0
  90. package/lib/hooks/useLicenseGate.js +1 -0
  91. package/lib/hooks/useScrollSpyUrlSync.js +1 -1
  92. package/lib/index.d.ts +6 -1
  93. package/lib/index.js +1 -1
  94. package/lib/jotai/app.d.ts +6 -0
  95. package/lib/jotai/app.js +1 -1
  96. package/lib/jotai/examples.js +1 -1
  97. package/lib/jotai/store.d.ts +4 -0
  98. package/lib/jotai/store.js +1 -1
  99. package/lib/options/editionOverrides.d.ts +3 -0
  100. package/lib/options/editionOverrides.js +1 -0
  101. package/lib/options/helpers.d.ts +1 -2
  102. package/lib/options/helpers.js +1 -1
  103. package/lib/options/normalizeOptions.d.ts +1 -1
  104. package/lib/options/normalizeOptions.js +1 -1
  105. package/lib/options/standaloneLayoutVars.d.ts +3 -0
  106. package/lib/options/standaloneLayoutVars.js +1 -0
  107. package/lib/pages/ItemPage.js +4 -2
  108. package/lib/services/code-samples/apply-env-variables.d.ts +8 -0
  109. package/lib/services/code-samples/apply-env-variables.js +1 -0
  110. package/lib/services/code-samples/builder.js +1 -1
  111. package/lib/services/code-samples/language-availability.d.ts +4 -0
  112. package/lib/services/code-samples/language-availability.js +1 -0
  113. package/lib/services/code-samples/{replay/normalize-servers.d.ts → normalize-servers.d.ts} +1 -1
  114. package/lib/services/code-samples/normalize-servers.js +1 -0
  115. package/lib/services/code-samples/replay/from-openapi-document.d.ts +8 -1
  116. package/lib/services/code-samples/replay/from-openapi-document.js +1 -1
  117. package/lib/services/code-samples/replay/index.d.ts +1 -1
  118. package/lib/services/code-samples/replay/index.js +1 -1
  119. package/lib/services/code-samples/replay/replay-predefined-env.d.ts +1 -2
  120. package/lib/services/code-samples/replay/replay-predefined-env.js +1 -1
  121. package/lib/services/code-samples/server-env.d.ts +3 -0
  122. package/lib/services/code-samples/server-env.js +1 -0
  123. package/lib/services/code-samples/source.d.ts +3 -3
  124. package/lib/services/license/check.d.ts +1 -0
  125. package/lib/services/license/check.js +1 -1
  126. package/lib/services/operation-samples/index.js +1 -1
  127. package/lib/services/search/indexer.d.ts +9 -0
  128. package/lib/services/search/indexer.js +1 -0
  129. package/lib/services/search/types.d.ts +27 -0
  130. package/lib/services/search/types.js +0 -0
  131. package/lib/services/spec-slice/assistant-links.d.ts +9 -0
  132. package/lib/services/spec-slice/assistant-links.js +5 -0
  133. package/lib/services/spec-slice/asyncapi-slice.d.ts +5 -0
  134. package/lib/services/spec-slice/asyncapi-slice.js +1 -0
  135. package/lib/services/spec-slice/clone-strip.d.ts +1 -0
  136. package/lib/services/spec-slice/clone-strip.js +1 -0
  137. package/lib/services/spec-slice/component-closure.d.ts +6 -0
  138. package/lib/services/spec-slice/component-closure.js +1 -0
  139. package/lib/services/spec-slice/graphql-slice.d.ts +2 -0
  140. package/lib/services/spec-slice/graphql-slice.js +1 -0
  141. package/lib/services/spec-slice/index.d.ts +6 -0
  142. package/lib/services/spec-slice/index.js +1 -0
  143. package/lib/services/spec-slice/openapi-slice.d.ts +6 -0
  144. package/lib/services/spec-slice/openapi-slice.js +1 -0
  145. package/lib/services/spec-slice/resolve-scope.d.ts +4 -0
  146. package/lib/services/spec-slice/resolve-scope.js +1 -0
  147. package/lib/services/spec-slice/types.d.ts +37 -0
  148. package/lib/services/spec-slice/types.js +0 -0
  149. package/lib/standalone.d.ts +19 -0
  150. package/lib/standalone.js +2 -0
  151. package/lib/standaloneThemeConfig.d.ts +3 -0
  152. package/lib/standaloneThemeConfig.js +1 -0
  153. package/lib/telemetry/RedocTelemetry.d.ts +3 -0
  154. package/lib/telemetry/RedocTelemetry.js +1 -1
  155. package/lib/telemetry/defaults.d.ts +2 -0
  156. package/lib/telemetry/defaults.js +1 -0
  157. package/lib/types/code-samples-config.d.ts +68 -0
  158. package/lib/types/code-samples-config.js +0 -0
  159. package/lib/types/common.d.ts +1 -1
  160. package/lib/types/content.d.ts +4 -3
  161. package/lib/types/edition-config.d.ts +4 -0
  162. package/lib/types/edition-config.js +0 -0
  163. package/lib/types/events.d.ts +2 -2
  164. package/lib/types/openapi.d.ts +2 -1
  165. package/lib/types/options.d.ts +24 -88
  166. package/lib/utils/compose.d.ts +1 -0
  167. package/lib/utils/deep-link.d.ts +1 -0
  168. package/lib/utils/deep-link.js +1 -1
  169. package/lib/utils/extract-extensions.js +1 -1
  170. package/lib/utils/x-logo.d.ts +13 -0
  171. package/lib/utils/x-logo.js +1 -0
  172. package/package.json +19 -8
  173. package/lib/services/code-samples/replay/normalize-servers.js +0 -1
@@ -1 +1 @@
1
- import{jsx as t,jsxs as o}from"react/jsx-runtime";import{memo as b,useMemo as n}from"react";import{useAtomValue as j}from"jotai";import{storeAtom as v}from"../../jotai/store.js";import{useSpecTranslate as I}from"../../hooks/useTranslate.js";import{SchemaView as s}from"../Schema/SchemaView.js";import{ContentWrapper as r}from"../common/ContentWrapper.js";import{DeepLinkAnchor as h}from"../common/DeepLinkAnchor.js";import{Markdown as w}from"../common/Markdown.js";import{getDeepLinkId as d}from"../../utils/deep-link.js";import{DeepLinkSectionContext as f,useDeepLinkUrl as S}from"../../hooks/useDeepLinkSection.js";import{McpSection as C,McpSubRow as m,McpTitle as x,McpTitleWrapper as D}from"./styled.js";import{buildMcpExamplePanel as M,useMcpDescriptionAst as O}from"./utils.js";function y({name:u}){const a=j(v),p=I(),e=n(()=>a.mcp?.tools?.find(P=>P.name===u),[a.mcp,u]),l=O(e?.description),k=n(()=>e?.inputSchema?[M(e.inputSchema,"Input example")]:void 0,[e?.inputSchema]),L=n(()=>e?.outputSchema?[M(e.outputSchema,"Output example")]:void 0,[e?.outputSchema]),c=S("input-schema"),T=n(()=>({t:"input-schema"}),[]),i=S("output-schema"),A=n(()=>({t:"output-schema"}),[]);return e?o(C,{children:[t(r,{children:o(m,{children:[o("p",{children:[p("openapi.mcp.toolName","Tool name"),": ",t("code",{children:e.name})]}),l?t(w,{source:l}):null]})}),e.inputSchema&&t(r,{panels:k,children:o(m,{children:[t(D,{id:d(c),children:o(x,{children:[c&&t(h,{to:c,label:"link to Input schema"}),p("openapi.mcp.inputSchema","Input schema")]})}),t(f.Provider,{value:T,children:t(s,{schema:e.inputSchema,expandByDefault:!0})})]})}),e.outputSchema&&t(r,{panels:L,children:o(m,{children:[t(D,{id:d(i),children:o(x,{children:[i&&t(h,{to:i,label:"link to Output schema"}),p("openapi.mcp.outputSchema","Output schema")]})}),t(f.Provider,{value:A,children:t(s,{schema:e.outputSchema,expandByDefault:!0})})]})})]}):null}const H=b(y);export{H as McpTool};
1
+ import{jsx as t,jsxs as o}from"react/jsx-runtime";import{memo as b,useMemo as n}from"react";import{useAtomValue as j}from"jotai";import{storeAtom as v}from"../../jotai/store.js";import{useSpecTranslate as w}from"../../hooks/useTranslate.js";import{SchemaView as l}from"../Schema/SchemaView.js";import{ContentWrapper as r}from"../common/ContentWrapper.js";import{DeepLinkAnchor as h}from"../common/DeepLinkAnchor.js";import{Markdown as C}from"../common/Markdown.js";import{getDeepLinkId as d}from"../../utils/deep-link.js";import{DeepLinkSectionContext as f,useDeepLinkUrl as S}from"../../hooks/useDeepLinkSection.js";import{McpSection as I,McpSubRow as u,McpTitle as D,McpTitleWrapper as M}from"./styled.js";import{buildMcpExamplePanel as k,useMcpDescriptionAst as y}from"./utils.js";function B({name:m}){const a=j(v),p=w(),e=n(()=>a.mcp?.tools?.find(P=>P.name===m),[a.mcp,m]),s=y(e?.description),x=n(()=>e?.inputSchema?[k(e.inputSchema,"input")]:void 0,[e?.inputSchema]),L=n(()=>e?.outputSchema?[k(e.outputSchema,"output")]:void 0,[e?.outputSchema]),c=S("input-schema"),T=n(()=>({t:"input-schema"}),[]),i=S("output-schema"),A=n(()=>({t:"output-schema"}),[]);return e?o(I,{children:[t(r,{children:o(u,{children:[o("p",{children:[p("openapi.mcp.toolName","Tool name"),": ",t("code",{children:e.name})]}),s?t(C,{source:s}):null]})}),e.inputSchema&&t(r,{panels:x,children:o(u,{children:[t(M,{id:d(c),children:o(D,{children:[c&&t(h,{to:c,label:"link to Input schema"}),p("openapi.mcp.inputSchema","Input schema")]})}),t(f.Provider,{value:T,children:t(l,{schema:e.inputSchema,expandByDefault:!0})})]})}),e.outputSchema&&t(r,{panels:L,children:o(u,{children:[t(M,{id:d(i),children:o(D,{children:[i&&t(h,{to:i,label:"link to Output schema"}),p("openapi.mcp.outputSchema","Output schema")]})}),t(f.Provider,{value:A,children:t(l,{schema:e.outputSchema,expandByDefault:!0})})]})})]}):null}const H=b(B);export{H as McpTool};
@@ -2,6 +2,6 @@ import type { McpExampleNode } from '../../types/content.js';
2
2
  import type { McpPromptArgument, McpResource, OpenAPISchema } from '../../types/openapi.js';
3
3
  export declare function useMcpDescriptionAst(description: unknown): unknown;
4
4
  export declare function sampleSchema(schema: OpenAPISchema): unknown;
5
- export declare function buildMcpExamplePanel(schema: OpenAPISchema, headerTitle: string): McpExampleNode;
5
+ export declare function buildMcpExamplePanel(schema: OpenAPISchema, example: 'input' | 'output' | 'arguments'): McpExampleNode;
6
6
  export declare function buildResourceContentPanel(resource: McpResource): McpExampleNode | null;
7
7
  export declare function buildPromptArgumentsSchema(args: McpPromptArgument[]): OpenAPISchema | null;
@@ -1 +1 @@
1
- import{useMemo as i}from"react";import*as p from"openapi-sampler";import{panelKind as o}from"../../types/common.js";import{resolveMarkdocHeadingIds as u}from"../../adapters/utils/markdoc.js";import{useMarkdownAdapter as m}from"../../contexts/markdownAdapter.js";import{useHashItemId as a}from"../../hooks/useDeepLinkSection.js";function M(t){const e=m(),n=a();return i(()=>{if(!t)return null;const r=e.parse(t);return n&&r&&typeof r=="object"&&u(r,n),r},[e,t,n])}function d(t){try{return p.sample(t,{quiet:!0})}catch{return{}}}function b(t,e){return{children:[{kind:o.MCP_EXAMPLE,headerTitle:e,data:d(t)}]}}function h(t){const e=t.text??t.blob;return e===void 0?null:{children:[{kind:o.MCP_EXAMPLE,headerTitle:"Resource content",data:e,language:t.mimeType}]}}function P(t){return t.length?{type:"object",properties:Object.fromEntries(t.map(e=>[e.name,{type:"string",example:e.example??"string",description:typeof e.description=="string"?e.description:void 0}])),required:t.filter(e=>e.required).map(e=>e.name)}:null}export{b as buildMcpExamplePanel,P as buildPromptArgumentsSchema,h as buildResourceContentPanel,d as sampleSchema,M as useMcpDescriptionAst};
1
+ import{useMemo as i}from"react";import*as o from"openapi-sampler";import{panelKind as p}from"../../types/common.js";import{resolveMarkdocHeadingIds as a}from"../../adapters/utils/markdoc.js";import{useMarkdownAdapter as m}from"../../contexts/markdownAdapter.js";import{useHashItemId as u}from"../../hooks/useDeepLinkSection.js";function h(t){const e=m(),r=u();return i(()=>{if(!t)return null;const n=e.parse(t);return r&&n&&typeof n=="object"&&a(n,r),n},[e,t,r])}function l(t){try{return o.sample(t,{quiet:!0})}catch{return{}}}function E(t,e){return{children:[{kind:p.MCP_EXAMPLE,headerTitleTranslationKey:e==="output"?"openapi.mcp.outputExample":e==="arguments"?"openapi.mcp.argumentsExample":"openapi.mcp.inputExample",data:l(t)}]}}function M(t){const e=t.text??t.blob;return e===void 0?null:{children:[{kind:p.MCP_EXAMPLE,headerTitleTranslationKey:"openapi.mcp.exampleTitle",data:e,language:t.mimeType}]}}function b(t){return t.length?{type:"object",properties:Object.fromEntries(t.map(e=>[e.name,{type:"string",example:e.example??"string",description:typeof e.description=="string"?e.description:void 0}])),required:t.filter(e=>e.required).map(e=>e.name)}:null}export{E as buildMcpExamplePanel,b as buildPromptArgumentsSchema,M as buildResourceContentPanel,l as sampleSchema,h as useMcpDescriptionAst};
@@ -97,7 +97,7 @@ import{styled as r}from"styled-components";import{Link as i}from"react-router";i
97
97
  font-family: var(--font-family-monospaced);
98
98
  font-size: var(--font-size-sm);
99
99
  line-height: var(--line-height-sm);
100
- border-radius: var(--border-radius);
100
+ border-radius: var(--tag-border-radius);
101
101
  color: var(--text-color-secondary);
102
102
  display: inline-flex;
103
103
  word-break: var(--code-word-break);
@@ -173,7 +173,7 @@ import{styled as r}from"styled-components";import{Link as i}from"react-router";i
173
173
  flex-basis: 100%;
174
174
  min-width: 0;
175
175
  border: 1px solid var(--border-color-secondary);
176
- border-radius: var(--border-radius);
176
+ border-radius: var(--border-radius-xl);
177
177
  overflow: hidden;
178
178
  `,F=r.div`
179
179
  display: flex;
@@ -270,7 +270,7 @@ import{styled as r}from"styled-components";import{Link as i}from"react-router";i
270
270
  width: 100%;
271
271
  `,Y=r.span`
272
272
  padding: 0 var(--spacing-xs);
273
- border-radius: var(--border-radius);
273
+ border-radius: var(--tag-border-radius);
274
274
  border: 1px solid var(--border-color-secondary);
275
275
  background-color: var(--bg-color);
276
276
  font-size: var(--font-size-sm);
@@ -305,7 +305,7 @@ import{styled as r}from"styled-components";import{Link as i}from"react-router";i
305
305
  color: var(--tag-basic-content-color);
306
306
  padding: 0 var(--spacing-xs);
307
307
  border: 1px solid var(--border-color-secondary);
308
- border-radius: var(--border-radius);
308
+ border-radius: var(--tag-border-radius);
309
309
  margin: var(--spacing-xxs) 0 var(--spacing-xs);
310
310
  position: relative;
311
311
  width: fit-content;
@@ -1 +1 @@
1
- import{jsx as r,jsxs as i}from"react/jsx-runtime";import{useAtomValue as I}from"jotai";import{ArrayWrapper as A,ArrayLabel as g,ArrayClosingLabel as b,ArrayLabelValue as l,ArrayLine as c,SchemaTypeLabel as O,PropertyList as x}from"../styled.js";import{globalOptionsAtom as C}from"../../../jotai/store.js";import{isWithinExpansionLevel as F}from"../../../utils/expansion.js";import{PropertyRenderer as R}from"./PropertyRenderer.js";import{ObjectRenderer as B}from"./ObjectRenderer.js";import{PropertyFieldRow as j}from"./PropertyFieldRow.js";function D(s){return!s||s.length===0?s:[...s.slice(0,-1),s[s.length-1]+"[]"]}function _({property:s,level:o,fieldParentsName:d,skipReadOnly:p,skipWriteOnly:m,onOneOfChange:h}){const{schemasExpansionLevel:w}=I(C),n=s.items;if(!n||n.length===0)return r(O,{children:"array"});const L=F(o,w,1),y=D(d),f=o===1,u=n.some(e=>e.isTupleItem||e.isAdditionalItems),t=n[0];if(!u&&n.length===1&&t&&t.switcher){const e=r(R,{property:t,level:o+1,fieldParentsName:y,skipReadOnly:p,skipWriteOnly:m,onOneOfChange:h});return f?i(A,{children:[i(g,{children:[r(l,{children:"Array ["}),r(c,{})]}),e,i(b,{className:"array-closing-label",children:[r(c,{}),r(l,{children:"]"})]})]}):e}if(!u&&n.length===1&&t&&t.properties){const e=r(B,{property:t,level:o,fieldParentsName:y,skipReadOnly:p,skipWriteOnly:m,onOneOfChange:h});return f?i(A,{children:[i(g,{children:[r(l,{children:"Array ["}),r(c,{})]}),e,i(b,{className:"array-closing-label",children:[r(c,{}),r(l,{children:"]"})]})]}):e}return u||n.length>1?r(x,{children:n.map((e,a)=>r(j,{name:e.isAdditionalItems?`[${a}...]`:`[${a}]`,property:e,level:o,expandByDefault:L,isFirst:a===0,fieldParentsName:d,skipReadOnly:p,skipWriteOnly:m,onOneOfChange:h},a))}):t&&!t.switcher&&!t.properties&&!f?r(x,{children:r(j,{name:"[i]",property:t,level:o,expandByDefault:L,isFirst:!0,fieldParentsName:d,skipReadOnly:p,skipWriteOnly:m,onOneOfChange:h})}):i(A,{children:[i(g,{children:[r(l,{children:"Array ["}),r(c,{})]}),n.map((e,a)=>r(R,{property:e,level:o+1,fieldParentsName:y,skipReadOnly:p,skipWriteOnly:m,onOneOfChange:h},a)),i(b,{className:"array-closing-label",children:[r(c,{}),r(l,{children:"]"})]})]})}export{_ as ArrayRenderer};
1
+ import{jsx as r,jsxs as n}from"react/jsx-runtime";import{useAtomValue as I}from"jotai";import{ArrayWrapper as u,ArrayLabel as A,ArrayClosingLabel as b,ArrayLabelValue as o,ArrayLine as l,SchemaTypeLabel as N,PropertyList as L}from"../styled.js";import{globalOptionsAtom as O}from"../../../jotai/store.js";import{appendArraySuffix as P}from"../../../utils/deep-link.js";import{isWithinExpansionLevel as C}from"../../../utils/expansion.js";import{PropertyRenderer as x}from"./PropertyRenderer.js";import{ObjectRenderer as F}from"./ObjectRenderer.js";import{PropertyFieldRow as R}from"./PropertyFieldRow.js";function $({property:j,level:s,fieldParentsName:d,skipReadOnly:p,skipWriteOnly:c,onOneOfChange:m}){const{schemasExpansionLevel:w}=I(O),i=j.items;if(!i||i.length===0)return r(N,{children:"array"});const g=C(s,w,1),h=d&&P(d),y=s===1,f=i.some(e=>e.isTupleItem||e.isAdditionalItems),t=i[0];if(!f&&i.length===1&&t&&t.switcher){const e=r(x,{property:t,level:s+1,fieldParentsName:h,skipReadOnly:p,skipWriteOnly:c,onOneOfChange:m});return y?n(u,{children:[n(A,{children:[r(o,{children:"Array ["}),r(l,{})]}),e,n(b,{className:"array-closing-label",children:[r(l,{}),r(o,{children:"]"})]})]}):e}if(!f&&i.length===1&&t&&t.properties){const e=r(F,{property:t,level:s,fieldParentsName:h,skipReadOnly:p,skipWriteOnly:c,onOneOfChange:m});return y?n(u,{children:[n(A,{children:[r(o,{children:"Array ["}),r(l,{})]}),e,n(b,{className:"array-closing-label",children:[r(l,{}),r(o,{children:"]"})]})]}):e}return f||i.length>1?r(L,{children:i.map((e,a)=>r(R,{name:e.isAdditionalItems?`[${a}...]`:`[${a}]`,property:e,level:s,expandByDefault:g,isFirst:a===0,fieldParentsName:d,skipReadOnly:p,skipWriteOnly:c,onOneOfChange:m},a))}):t&&!t.switcher&&!t.properties&&!y?r(L,{children:r(R,{name:"[i]",property:t,level:s,expandByDefault:g,isFirst:!0,fieldParentsName:d,skipReadOnly:p,skipWriteOnly:c,onOneOfChange:m})}):n(u,{children:[n(A,{children:[r(o,{children:"Array ["}),r(l,{})]}),i.map((e,a)=>r(x,{property:e,level:s+1,fieldParentsName:h,skipReadOnly:p,skipWriteOnly:c,onOneOfChange:m},a)),n(b,{className:"array-closing-label",children:[r(l,{}),r(o,{children:"]"})]})]})}export{$ as ArrayRenderer};
@@ -1 +1 @@
1
- import{jsx as r,jsxs as t}from"react/jsx-runtime";import{useAtomValue as w}from"jotai";import{PropertyItem as T,Row as B,NameWrapper as R,PropertyName as j,RequiredLabel as k,SchemaTypeLabel as F,SwitcherWrapper as q,SwitcherBadge as A,FieldDetail as m,FieldDetailLabel as o,FieldDetailValue as I,DefaultValueTag as N,ExampleValueTag as C,ExampleJsonViewer as _,ParentPrefix as O}from"../styled.js";import{isStructuredExample as W}from"../../../types/schema.js";import{SchemaDescription as $}from"../SchemaDescription.js";import{SchemaEnumValues as J}from"./SchemaEnumValues.js";import{SchemaEnumDescriptions as M}from"./SchemaEnumDescriptions.js";import{getDiscriminatorEnumRender as z,getSchemaEnumRowLabel as G}from"../utils.js";import{SchemaVariantSelector as H}from"./SchemaVariantSelector.js";import{SchemaTitleLabel as K}from"./SchemaTitleLabel.js";import{Pattern as Q}from"./Pattern.js";import{DeepLinkAnchor as U}from"../../common/DeepLinkAnchor.js";import{getDeepLinkId as X,stripVariantMarkers as Y}from"../../../utils/deep-link.js";import{globalOptionsAtom as Z}from"../../../jotai/store.js";import{useSchemaFieldDeepLink as ee}from"../hooks/useSchemaFieldDeepLink.js";import{useSpecTranslate as re}from"../../../hooks/useTranslate.js";import{SECTION_ATTR as te}from"../../../constants/openapi.js";import{renderPropertyBadge as u}from"../../common/Badge.js";import{splitBadgesByPosition as ie}from"../../../utils/split-badges-by-position.js";function Ee({fieldName:a,property:e,isFirst:h,mappingKeys:f,optionEntries:p,activeIdx:x,fieldParentsName:s=[],onSelect:g}){const{hidePropertiesPrefix:D,jsonSamplesExpandLevel:S}=w(Z),i=re(),{enumDescriptions:c,enumValues:n}=z(e,f),b=G(e.type,n.length),L=e.const!==void 0&&e.const!=="",y=[...s,a].join("/"),l=ee(y),{before:E,after:V}=ie(e.badges);return t(T,{$isFirst:h,id:X(l),children:[t(B,{children:[t(R,{children:[l&&r(U,{to:l,label:`link to ${a}`,variant:"field"}),!D&&s.map((P,v)=>{const d=Y(P);return d?t(O,{children:[d,".","\u200B"]},v):null}),E.map(u),r(j,{className:"schema-name",children:a})]}),r(F,{children:e.type}),r(K,{title:e.title,schemaName:e.schemaName}),e.isRequired?r(k,{children:i("required","required")}):null,V.map(u)]}),r($,{value:e.description}),e.default!==void 0?t(m,{children:[t(o,{children:[i("default","Default"),":"]}),r(N,{children:e.default})]}):null,c?r(M,{values:c}):n.length>0?r(J,{label:b,values:n}):null,e.example!==void 0?t(m,{children:[t(o,{children:[i("example","Example"),":"]}),W(e.example)?r(_,{data:e.example,expandLevel:S,controls:!1}):r(C,{children:e.example})]}):null,r(Q,{pattern:e.pattern}),t(q,{[te]:"switcher",children:[r(A,{children:"Discriminator"}),r(H,{optionEntries:p,activeIndex:x,onChange:g,"data-testid":"discriminator-schema"})]}),L?t(m,{children:[t(o,{children:[i("value","Value"),":"]}),r(I,{children:e.const})]}):null]})}export{Ee as DiscriminatorPropertyRow};
1
+ import{jsx as r,jsxs as t}from"react/jsx-runtime";import{useAtomValue as w}from"jotai";import{PropertyItem as T,Row as B,NameWrapper as R,PropertyName as j,RequiredLabel as k,SchemaTypeLabel as F,SwitcherWrapper as q,SwitcherBadge as A,FieldDetail as m,FieldDetailLabel as o,FieldDetailValue as I,DefaultValueTag as N,ExampleValueTag as C,ExampleJsonViewer as _,ParentPrefix as O}from"../styled.js";import{isStructuredExample as W}from"../../../types/schema.js";import{SchemaDescription as $}from"../SchemaDescription.js";import{SchemaEnumValues as J}from"./SchemaEnumValues.js";import{SchemaEnumDescriptions as M}from"./SchemaEnumDescriptions.js";import{getDiscriminatorEnumRender as z,getSchemaEnumRowLabel as G}from"../utils.js";import{SchemaVariantSelector as H}from"./SchemaVariantSelector.js";import{SchemaTitleLabel as K}from"./SchemaTitleLabel.js";import{Pattern as Q}from"./Pattern.js";import{DeepLinkAnchor as U}from"../../common/DeepLinkAnchor.js";import{getDeepLinkId as X,stripVariantMarkers as Y}from"../../../utils/deep-link.js";import{globalOptionsAtom as Z}from"../../../jotai/store.js";import{useSchemaFieldDeepLink as ee}from"../hooks/useSchemaFieldDeepLink.js";import{useSpecTranslate as re}from"../../../hooks/useTranslate.js";import{SECTION_ATTR as te}from"../../../constants/openapi.js";import{renderPropertyBadge as u}from"../../common/Badge.js";import{splitBadgesByPosition as ie}from"../../../utils/split-badges-by-position.js";function Ee({fieldName:a,property:e,isFirst:h,mappingKeys:f,optionEntries:p,activeIdx:x,fieldParentsName:s=[],onSelect:g}){const{hidePropertiesPrefix:D,jsonSamplesExpandLevel:S}=w(Z),i=re(),{enumDescriptions:c,enumValues:n}=z(e,f),b=G(e.type,n.length),L=e.const!==void 0&&e.const!=="",y=[...s,a].join("/"),l=ee(y),{before:E,after:V}=ie(e.badges);return t(T,{$isFirst:h,id:X(l),children:[t(B,{children:[t(R,{children:[l&&r(U,{to:l,label:`link to ${a}`,variant:"field"}),!D&&s.map((P,v)=>{const d=Y(P);return d?t(O,{children:[d,".","\u200B"]},v):null}),E.map(u),r(j,{className:"schema-name",children:a})]}),r(F,{children:e.type}),r(K,{title:e.title,schemaName:e.schemaName}),e.isRequired?r(k,{children:i("required","required")}):null,V.map(u)]}),r($,{value:e.description}),e.default!==void 0?t(m,{children:[t(o,{children:[i("default","Default"),":"]}),r(N,{children:e.default})]}):null,c?r(M,{values:c}):n.length>0?r(J,{label:b,values:n}):null,e.example!==void 0?t(m,{children:[t(o,{children:[i("example","Example"),":"]}),W(e.example)?r(_,{data:e.example,expandLevel:S,controls:!1}):r(C,{children:e.example})]}):null,r(Q,{pattern:e.pattern}),t(q,{[te]:"switcher",children:[r(A,{children:i("discriminator","Discriminator")}),r(H,{optionEntries:p,activeIndex:x,onChange:g,"data-testid":"discriminator-schema"})]}),L?t(m,{children:[t(o,{children:[i("value","Value"),":"]}),r(I,{children:e.const})]}):null]})}export{Ee as DiscriminatorPropertyRow};
@@ -1 +1 @@
1
- import{Fragment as s,jsx as e,jsxs as t}from"react/jsx-runtime";import{FieldDetail as a,FieldDetailLabel as m,ExamplesList as u,ExampleItem as c,ExampleSummary as d,ExampleDescription as o}from"../styled.js";import{ExpandableExample as p}from"./ExpandableExample.js";function f({examples:n}){if(!n)return null;const l=Object.entries(n);return l.length===0?null:t(s,{children:[e(a,{children:e(m,{children:"Examples:"})}),e(u,{children:l.map(([i,r])=>t(c,{children:[e(d,{children:r.summary||i}),r.description?e(o,{children:r.description}):null,r.value!==void 0?e(p,{value:r.value}):null]},i))})]})}export{f as Examples};
1
+ import{Fragment as a,jsx as r,jsxs as n}from"react/jsx-runtime";import{useSpecTranslate as m}from"../../../hooks/useTranslate.js";import{FieldDetail as c,FieldDetailLabel as o,ExamplesList as u,ExampleItem as p,ExampleSummary as d,ExampleDescription as x}from"../styled.js";import{ExpandableExample as f}from"./ExpandableExample.js";function b({examples:l}){const s=m();if(!l)return null;const i=Object.entries(l);return i.length===0?null:n(a,{children:[r(c,{children:n(o,{children:[s("examples","Examples"),":"]})}),r(u,{children:i.map(([t,e])=>n(p,{children:[r(d,{children:e.summary||t}),e.description?r(x,{children:e.description}):null,e.value!==void 0?r(f,{value:e.value}):null]},t))})]})}export{b as Examples};
@@ -0,0 +1,15 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { ApiItem, ApiStore } from '../../types/store.js';
3
+ export type SearchProps = {
4
+ items: ApiItem[];
5
+ store: ApiStore;
6
+ basePath: string;
7
+ /** Bundled definition — enables `$ref` resolution for schema-field results. */
8
+ document?: Record<string, unknown>;
9
+ };
10
+ /**
11
+ * Search ships only in the open-source Redoc (`index.ce.ts` and the `.ce`
12
+ * files it re-exports replace this stub there); enterprise search is provided
13
+ * by the portal.
14
+ */
15
+ export declare function Search(_props: SearchProps): ReactElement | null;
@@ -0,0 +1 @@
1
+ function n(r){return null}export{n as Search};
@@ -1 +1 @@
1
- import{Fragment as p,jsx as e,jsxs as l}from"react/jsx-runtime";import{useState as T}from"react";import{ChevronRightIcon as z}from"@redocly/theme/icons/ChevronRightIcon/ChevronRightIcon";import{useSpecTranslate as R}from"../../hooks/useTranslate.js";import{normalizeScopes as g}from"../../utils/security-scope.js";import{Markdown as C}from"../common/Markdown.js";import{OptionalScopesChevron as A,OptionalScopesList as x,OptionalScopesToggle as L,DeprecatedBadge as D,FlowDescription as I,FlowProperties as j,FlowTitle as k,FlowTitleWrapper as M,FlowTypeBody as _,FlowTypeName as $,FlowTypeSection as q,FlowTypeTag as P,FlowWrapper as E,PropertyLabel as B,PropertyRow as H,PropertyValue as N,SchemeLink as s,ScopesLabel as W,ScopesList as K,ScopesSection as v}from"./styled.js";import{ScopeTagWithTooltip as b}from"./ScopeTagWithTooltip.js";const w=24;function ce({scheme:r}){const t=R(),{type:o,name:n}=r;return!o||!n?null:l(E,{children:[l(M,{children:[e(k,{children:n}),r.deprecated&&e(D,{children:t("badges.deprecated","deprecated")})]}),r.description&&e(I,{children:typeof r.description=="string"?r.description:e(C,{source:r.description})}),l(j,{children:[o==="http"&&e(V,{scheme:r,translate:t}),o==="apiKey"&&e(X,{scheme:r,translate:t}),o==="oauth2"&&e(G,{scheme:r,translate:t}),o==="openIdConnect"&&e(Q,{scheme:r,translate:t})]})]})}function V({scheme:r,translate:t}){return l(p,{children:[e(a,{label:t("httpAuthorizationScheme","HTTP Authorization Scheme"),value:r.type}),e(a,{label:t("bearerFormat","Bearer Format"),value:r.bearerFormat}),e(h,{scopes:r.scopes,translate:t})]})}function X({scheme:r,translate:t}){const o=r.in?`${r.in.charAt(0).toUpperCase()+r.in.slice(1)} `:"";return l(p,{children:[e(a,{label:`${o}${t("parameterName","parameter name")}:`,value:r.paramName}),e(h,{scopes:r.scopes,translate:t})]})}function G({scheme:r,translate:t}){const o=r.flows;if(!o)return e(p,{});const n=Z(o),i=Object.entries(o).filter(([,c])=>c!=null);return l(p,{children:[r.oauth2MetadataUrl&&e(a,{label:`${t("oauth2MetadataUrl","OAuth2 Metadata URL")}:`,value:e(s,{href:r.oauth2MetadataUrl,target:"_blank",rel:"noopener noreferrer",children:r.oauth2MetadataUrl})}),i.map(([c,u])=>e(J,{flowType:c,flow:u,requiredScopes:r.scopes,translate:t},c)),e(h,{scopes:r.scopes,scopeDescriptions:n,translate:t})]})}function J({flowType:r,flow:t,requiredScopes:o,translate:n}){const[i,c]=T(!1),{authorizationUrl:u,tokenUrl:f,refreshUrl:S,deviceAuthorizationUrl:m,scopes:O}=t,U=Y(o,O),y=()=>{c(d=>!d)};return l(q,{children:[l(P,{children:[e("span",{children:n("flowType","Flow type")}),e($,{children:r})]}),l(_,{children:[u&&e(a,{label:`${n("authorizationUrl","Authorization URL")}:`,value:e(s,{href:u,children:u})}),m&&e(a,{label:`${n("deviceAuthorizationUrl","Device Authorization URL")}:`,value:e(s,{href:m,children:m})}),f&&e(a,{label:`${n("tokenUrl","Token URL")}:`,value:e(s,{href:f,children:f})}),S&&e(a,{label:`${n("refreshUrl","Refresh URL")}:`,value:e(s,{href:S,children:S})}),U.length>0&&l(v,{children:[l(L,{type:"button",onClick:y,children:[i?"Hide optional scopes":"Show optional scopes",e(A,{isOpen:i,children:e(z,{size:"var(--font-size-base)",color:"var(--tree-content-color-default)"})})]}),e(x,{isOpen:i,children:U.map(([d,F])=>e(a,{label:e(b,{text:d,maxChars:w,large:!0}),value:F||" "},d))})]})]})]})}function Q({scheme:r,translate:t}){return l(p,{children:[r.openIdConnectUrl&&e(a,{label:t("connectUrl","Connect URL"),value:e(s,{href:r.openIdConnectUrl,target:"_blank",rel:"noopener noreferrer",children:r.openIdConnectUrl})}),e(h,{scopes:r.scopes,translate:t})]})}function a({label:r,value:t}){return t?l(H,{children:[e(B,{children:r}),e(N,{children:t})]}):null}function Y(r,t){if(!t)return[];const o=new Set(g(r));return Object.entries(t).filter(([n])=>!o.has(n.trim()))}function h({scopes:r,scopeDescriptions:t,translate:o}){const n=g(r);return n.length===0?null:t&&t.size>0?l(p,{children:[e(a,{label:o("requiredScopes","Required scopes"),value:" "}),n.map(i=>e(a,{label:e(b,{text:i,maxChars:w,large:!0}),value:t.get(i)||" "},i))]}):l(v,{children:[e(W,{children:o("requiredScopes","Required scopes")}),e(K,{children:n.map(i=>e(b,{text:i,maxChars:w,large:!0},i))})]})}function Z(r){if(!r)return null;const t=new Map;return Object.values(r).forEach(o=>{o?.scopes&&Object.entries(o.scopes).forEach(([n,i])=>{const c=n.trim();!c||t.has(c)||t.set(c,i)})}),t.size>0?t:null}export{ce as SecurityFlowDetail};
1
+ import{Fragment as p,jsx as e,jsxs as i}from"react/jsx-runtime";import{useState as T}from"react";import{ChevronRightIcon as z}from"@redocly/theme/icons/ChevronRightIcon/ChevronRightIcon";import{useSpecTranslate as R}from"../../hooks/useTranslate.js";import{normalizeScopes as g}from"../../utils/security-scope.js";import{Markdown as C}from"../common/Markdown.js";import{OptionalScopesChevron as A,OptionalScopesList as x,OptionalScopesToggle as L,DeprecatedBadge as D,FlowDescription as I,FlowProperties as j,FlowTitle as k,FlowTitleWrapper as M,FlowTypeBody as _,FlowTypeName as $,FlowTypeSection as q,FlowTypeTag as P,FlowWrapper as E,PropertyLabel as B,PropertyRow as H,PropertyValue as N,SchemeLink as s,ScopesLabel as W,ScopesList as K,ScopesSection as O}from"./styled.js";import{ScopeTagWithTooltip as b}from"./ScopeTagWithTooltip.js";const w=24;function ce({scheme:r}){const o=R(),{type:t,name:n}=r;return!t||!n?null:i(E,{children:[i(M,{children:[e(k,{children:n}),r.deprecated&&e(D,{children:o("badges.deprecated","deprecated")})]}),r.description&&e(I,{children:typeof r.description=="string"?r.description:e(C,{source:r.description})}),i(j,{children:[t==="http"&&e(V,{scheme:r,translate:o}),t==="apiKey"&&e(X,{scheme:r,translate:o}),t==="oauth2"&&e(G,{scheme:r,translate:o}),t==="openIdConnect"&&e(Q,{scheme:r,translate:o})]})]})}function V({scheme:r,translate:o}){return i(p,{children:[e(a,{label:o("httpAuthorizationScheme","HTTP Authorization Scheme"),value:r.type}),e(a,{label:o("bearerFormat","Bearer Format"),value:r.bearerFormat}),e(h,{scopes:r.scopes,translate:o})]})}function X({scheme:r,translate:o}){const t=r.in?`${r.in.charAt(0).toUpperCase()+r.in.slice(1)} `:"";return i(p,{children:[e(a,{label:`${t}${o("parameterName","parameter name")}:`,value:r.paramName}),e(h,{scopes:r.scopes,translate:o})]})}function G({scheme:r,translate:o}){const t=r.flows;if(!t)return e(p,{});const n=Z(t),l=Object.entries(t).filter(([,c])=>c!=null);return i(p,{children:[r.oauth2MetadataUrl&&e(a,{label:`${o("oauth2MetadataUrl","OAuth2 Metadata URL")}:`,value:e(s,{href:r.oauth2MetadataUrl,target:"_blank",rel:"noopener noreferrer",children:r.oauth2MetadataUrl})}),l.map(([c,u])=>e(J,{flowType:c,flow:u,requiredScopes:r.scopes,translate:o},c)),e(h,{scopes:r.scopes,scopeDescriptions:n,translate:o})]})}function J({flowType:r,flow:o,requiredScopes:t,translate:n}){const[l,c]=T(!1),{authorizationUrl:u,tokenUrl:f,refreshUrl:S,deviceAuthorizationUrl:m,scopes:v}=o,U=Y(t,v),y=()=>{c(d=>!d)};return i(q,{children:[i(P,{children:[e("span",{children:n("flowType","Flow type")}),e($,{children:r})]}),i(_,{children:[u&&e(a,{label:`${n("authorizationUrl","Authorization URL")}:`,value:e(s,{href:u,children:u})}),m&&e(a,{label:`${n("deviceAuthorizationUrl","Device Authorization URL")}:`,value:e(s,{href:m,children:m})}),f&&e(a,{label:`${n("tokenUrl","Token URL")}:`,value:e(s,{href:f,children:f})}),S&&e(a,{label:`${n("refreshUrl","Refresh URL")}:`,value:e(s,{href:S,children:S})}),U.length>0&&i(O,{children:[i(L,{type:"button",onClick:y,children:[l?n("hideOptionalScopes","Hide optional scopes"):n("showOptionalScopes","Show optional scopes"),e(A,{isOpen:l,children:e(z,{size:"var(--font-size-base)",color:"var(--tree-content-color-default)"})})]}),e(x,{isOpen:l,children:U.map(([d,F])=>e(a,{label:e(b,{text:d,maxChars:w,large:!0}),value:F||" "},d))})]})]})]})}function Q({scheme:r,translate:o}){return i(p,{children:[r.openIdConnectUrl&&e(a,{label:o("connectUrl","Connect URL"),value:e(s,{href:r.openIdConnectUrl,target:"_blank",rel:"noopener noreferrer",children:r.openIdConnectUrl})}),e(h,{scopes:r.scopes,translate:o})]})}function a({label:r,value:o}){return o?i(H,{children:[e(B,{children:r}),e(N,{children:o})]}):null}function Y(r,o){if(!o)return[];const t=new Set(g(r));return Object.entries(o).filter(([n])=>!t.has(n.trim()))}function h({scopes:r,scopeDescriptions:o,translate:t}){const n=g(r);return n.length===0?null:o&&o.size>0?i(p,{children:[e(a,{label:t("requiredScopes","Required scopes"),value:" "}),n.map(l=>e(a,{label:e(b,{text:l,maxChars:w,large:!0}),value:o.get(l)||" "},l))]}):i(O,{children:[e(W,{children:t("requiredScopes","Required scopes")}),e(K,{children:n.map(l=>e(b,{text:l,maxChars:w,large:!0},l))})]})}function Z(r){if(!r)return null;const o=new Map;return Object.values(r).forEach(t=>{t?.scopes&&Object.entries(t.scopes).forEach(([n,l])=>{const c=n.trim();!c||o.has(c)||o.set(c,l)})}),o.size>0?o:null}export{ce as SecurityFlowDetail};
@@ -7,7 +7,7 @@ import{styled as r}from"styled-components";import{Panel as a}from"@redocly/theme
7
7
  &&& {
8
8
  margin-bottom: var(--spacing-lg);
9
9
  }
10
- `,d=r.div`
10
+ `,g=r.div`
11
11
  display: flex;
12
12
  align-items: center;
13
13
  justify-content: space-between;
@@ -18,7 +18,7 @@ import{styled as r}from"styled-components";import{Panel as a}from"@redocly/theme
18
18
  border-bottom: var(--panel-border, 1px solid var(--border-color-primary));
19
19
  border-radius: var(--panel-border-radius, var(--border-radius))
20
20
  var(--panel-border-radius, var(--border-radius)) 0 0;
21
- `,g=r(e)`
21
+ `,d=r(e)`
22
22
  margin-left: auto;
23
23
  font-size: var(--font-size-sm);
24
24
  `,v=r.span`
@@ -53,14 +53,14 @@ import{styled as r}from"styled-components";import{Panel as a}from"@redocly/theme
53
53
  position: fixed;
54
54
  width: 100vw;
55
55
  height: 100vh;
56
- z-index: var(--z-index-popover, 1000);
56
+ z-index: var(--z-index-popover, 200);
57
57
  left: 0;
58
58
  top: 0;
59
59
  pointer-events: auto;
60
60
  `,y=r.div`
61
61
  background: var(--bg-color);
62
62
  box-shadow: var(--bg-raised-shadow, 0 8px 32px rgba(0, 0, 0, 0.15));
63
- border-radius: var(--border-radius-lg, 12px);
63
+ border-radius: var(--border-radius-lg);
64
64
  padding: var(--spacing-lg);
65
65
  display: flex;
66
66
  flex-direction: column;
@@ -170,7 +170,7 @@ import{styled as r}from"styled-components";import{Panel as a}from"@redocly/theme
170
170
  font-size: var(--font-size-sm);
171
171
  font-family: var(--font-family-monospaced);
172
172
  padding: 0 var(--spacing-xxs);
173
- border-radius: var(--border-radius);
173
+ border-radius: var(--tag-border-radius);
174
174
  background: var(--tag-bg-color, var(--border-color-secondary));
175
175
  color: var(--text-color-secondary);
176
176
  `,V=r.button`
@@ -199,7 +199,7 @@ import{styled as r}from"styled-components";import{Panel as a}from"@redocly/theme
199
199
  transform: ${o=>o.isOpen?"rotate(90deg)":"rotate(0deg)"};
200
200
  transition: transform 0.3s ease-in-out;
201
201
  `,i=r.div`
202
- border-radius: var(--border-radius);
202
+ border-radius: var(--tag-border-radius);
203
203
  padding: 0 var(--spacing-xxs);
204
204
  font-family: var(--font-family-monospaced);
205
205
  font-size: var(--font-size-sm);
@@ -216,4 +216,4 @@ import{styled as r}from"styled-components";import{Panel as a}from"@redocly/theme
216
216
  display: inline-flex;
217
217
  align-items: center;
218
218
  gap: var(--spacing-xxs);
219
- `;export{u as CloseButton,f as Conjunction,A as DeprecatedBadge,T as FlowDescription,F as FlowProperties,S as FlowTitle,k as FlowTitleWrapper,O as FlowTypeBody,L as FlowTypeName,B as FlowTypeSection,R as FlowTypeTag,z as FlowWrapper,h as ModalBackground,w as ModalTitle,y as ModalWrapper,I as OptionalScopesChevron,H as OptionalScopesList,V as OptionalScopesToggle,j as PropertyLabel,P as PropertyRow,$ as PropertyValue,C as SchemeLink,m as SchemeName,b as ScopeInline,N as ScopeTag,M as ScopesLabel,W as ScopesList,D as ScopesSection,d as SecurityHeader,x as SecurityList,c as SecurityPanel,i as Tag,v as Title,g as ViewDetailsButton};
219
+ `;export{u as CloseButton,f as Conjunction,A as DeprecatedBadge,T as FlowDescription,F as FlowProperties,S as FlowTitle,k as FlowTitleWrapper,O as FlowTypeBody,L as FlowTypeName,B as FlowTypeSection,R as FlowTypeTag,z as FlowWrapper,h as ModalBackground,w as ModalTitle,y as ModalWrapper,I as OptionalScopesChevron,H as OptionalScopesList,V as OptionalScopesToggle,j as PropertyLabel,P as PropertyRow,$ as PropertyValue,C as SchemeLink,m as SchemeName,b as ScopeInline,N as ScopeTag,M as ScopesLabel,W as ScopesList,D as ScopesSection,g as SecurityHeader,x as SecurityList,c as SecurityPanel,i as Tag,v as Title,d as ViewDetailsButton};
@@ -0,0 +1 @@
1
+ export declare const FloatingButton: () => React.JSX.Element;
@@ -0,0 +1,32 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{useCallback as n}from"react";import{useAtom as i}from"jotai";import{styled as a}from"styled-components";import{breakpoints as s}from"@redocly/theme/core/openapi";import{MenuIcon as p}from"@redocly/theme/icons/MenuIcon/MenuIcon";import{CloseIcon as l}from"@redocly/theme/icons/CloseIcon/CloseIcon";import{isSidebarOpenedAtom as d}from"../../jotai/app.js";const h=()=>{const[o,r]=i(d),t=n(()=>{r(!o)},[o,r]);return e(m,{type:"button",onClick:t,"aria-label":o?"Close navigation menu":"Open navigation menu","aria-expanded":o,"data-testid":"floating-button",children:o?e(l,{size:"24px"}):e(p,{size:"24px"})})},m=a.button`
2
+ border: none;
3
+ outline: none;
4
+ user-select: none;
5
+ background-color: var(--sidebar-bg-color, #fff);
6
+ color: var(--color-primary-base, var(--color-blueberry-6));
7
+ display: none;
8
+ align-items: center;
9
+ justify-content: center;
10
+ cursor: pointer;
11
+ position: fixed;
12
+ right: 20px;
13
+ bottom: 44px;
14
+ z-index: 100;
15
+ border-radius: 50%;
16
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
17
+ width: 60px;
18
+ height: 60px;
19
+ padding: 0;
20
+
21
+ svg path {
22
+ fill: var(--color-primary-base, var(--color-blueberry-6));
23
+ }
24
+
25
+ @media screen and (max-width: ${s.small}) {
26
+ display: flex;
27
+ }
28
+
29
+ @media print {
30
+ display: none;
31
+ }
32
+ `;export{h as FloatingButton};
@@ -0,0 +1,5 @@
1
+ import type { ReactElement } from 'react';
2
+ /** Redocly logo for the community edition's sidebar attribution. Hidden until mounted; removed if the CDN image fails to load. */
3
+ export declare function RedoclyAttributionLogo({ full }: {
4
+ full?: boolean;
5
+ }): ReactElement | null;
@@ -0,0 +1 @@
1
+ import{jsx as s}from"react/jsx-runtime";import{useEffect as e,useState as l}from"react";function n({full:t=!1}){const[r,o]=l(!1);return e(()=>{o(!0)},[]),r?s("img",{alt:"redocly logo",onError:()=>o(!1),src:t?"https://cdn.redoc.ly/redoc/logo-mini-full.svg":"https://cdn.redoc.ly/redoc/logo-mini.svg"}):null}export{n as RedoclyAttributionLogo};
@@ -1,22 +1,46 @@
1
- import{jsx as a,jsxs as t}from"react/jsx-runtime";import{memo as s}from"react";import{styled as d,css as o}from"styled-components";import{SidebarActions as n}from"./SidebarActions.js";function l({className:r,children:e,collapsedSidebar:i=!1}){return t(c,{className:r,$collapsedSidebar:i,children:[i?null:e,a(n,{})]})}const b=s(l),c=d.div`
1
+ import{Fragment as f,jsx as d,jsxs as s}from"react/jsx-runtime";import{memo as g,useCallback as b,useEffect as u}from"react";import{styled as x,css as m}from"styled-components";import{useAtom as v}from"jotai";import{breakpoints as c}from"@redocly/theme/core/openapi";import{isSidebarOpenedAtom as w}from"../../jotai/app.js";import{useBodyScrollLock as S}from"../../hooks/useBodyScrollLock.js";import{SidebarActions as y}from"./SidebarActions.js";import{FloatingButton as L}from"./FloatingButton.js";const k=["menu-item-type-group","menu-item-type-drilldown"];function E({className:i,children:l,collapsedSidebar:r=!1}){const[e,a]=v(w);u(()=>{if(!e)return;const t=window.matchMedia(`(min-width: ${c.small})`),o=()=>{t.matches&&a(!1)};return o(),t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[e,a]),S(e);const p=b(t=>{if(!e)return;const o=t.target.closest("a");if(!o)return;const n=o.closest('[data-component-name="Menu/MenuItem"]');n&&k.some(h=>n.classList.contains(h))||a(!1)},[e,a]);return s(f,{children:[s(_,{className:i,$collapsedSidebar:r,$open:e,onClick:p,children:[r&&!e?null:l,d(y,{})]}),d(L,{})]})}const z=g(E),_=x.div`
2
2
  flex-shrink: 0;
3
3
  overflow-y: auto;
4
4
  overflow-x: hidden;
5
- position: sticky;
6
5
  top: var(--navbar-height, 0px);
7
6
  height: calc(100vh - var(--navbar-height, 0px));
8
- display: flex;
7
+ height: calc(100dvh - var(--navbar-height, 0px));
9
8
  flex-direction: column;
10
9
  background: var(--sidebar-bg-color, #fff);
11
10
  border-right: 1px solid var(--sidebar-border-color, #e0e0e0);
12
11
 
13
- ${({$collapsedSidebar:r})=>r?o`
14
- width: auto;
15
- `:o`
16
- width: var(--sidebar-width, 260px);
17
- `}
12
+ [data-component-name='SidebarLogo/SidebarLogo'] {
13
+ padding: var(--spacing-md, 16px) var(--spacing-sm, 12px);
14
+ }
15
+
16
+ [data-component-name='SidebarLogo/SidebarLogo'] img {
17
+ /* Keep the logo compact inside the full-width mobile drawer. */
18
+ max-width: min(140px, var(--sidebar-logo-max-width, 285px));
19
+ }
20
+
21
+ /* Mobile: full-width drawer toggled by the floating hamburger button. */
22
+ position: fixed;
23
+ z-index: 20;
24
+ width: 100%;
25
+ display: ${({$open:i})=>i?"flex":"none"};
26
+
27
+ @media screen and (min-width: ${c.small}) {
28
+ position: sticky;
29
+ z-index: auto;
30
+ display: flex;
31
+
32
+ [data-component-name='SidebarLogo/SidebarLogo'] img {
33
+ max-width: var(--sidebar-logo-max-width, 285px);
34
+ }
35
+
36
+ ${({$collapsedSidebar:i})=>i?m`
37
+ width: auto;
38
+ `:m`
39
+ width: var(--sidebar-width, 260px);
40
+ `}
41
+ }
18
42
 
19
43
  @media print {
20
44
  display: none;
21
45
  }
22
- `;export{b as StickySidebar};
46
+ `;export{z as StickySidebar};
@@ -1,4 +1,4 @@
1
- import{Fragment as m,jsx as n,jsxs as u}from"react/jsx-runtime";import{Fragment as T,useCallback as E,useLayoutEffect as M,useMemo as z,useRef as B,useState as R}from"react";import{styled as c}from"styled-components";import{Dropdown as _}from"@redocly/theme/components/Dropdown/Dropdown";import{DropdownMenu as k}from"@redocly/theme/components/Dropdown/DropdownMenu";import{DropdownMenuItem as D}from"@redocly/theme/components/Dropdown/DropdownMenuItem";import{Tooltip as F}from"@redocly/theme/components/Tooltip/Tooltip";import{trimText as S}from"@redocly/theme/core/openapi";import{calculateMaxLength as P}from"../../utils/calculateMaxLength.js";const b=25,O=3,j=16;function g({breadcrumb:e,onClick:r,maxLength:t}){const o=e.name.length>t,a=S(e.name,t);return n(F,{tip:e.name,placement:"bottom",disabled:!o,children:n(y,{onClick:()=>r(e.href),children:a})})}function G({breadcrumbs:e,onClick:r,maxLength:t}){const o=e[0],a=e[e.length-1],d=e.slice(1,-1);return u(m,{children:[n(g,{breadcrumb:o,onClick:r,maxLength:t}),n(f,{children:"/"}),n(_,{trigger:n(I,{children:"..."}),closeOnClick:!0,alignment:"end",children:n(k,{children:d.map(i=>n(D,{onAction:()=>r(i.href),children:i.name},i.href))})}),n(f,{children:"/"}),n(g,{breadcrumb:a,onClick:r,maxLength:t})]})}function H({breadcrumbs:e,onClick:r,maxLength:t}){return n(m,{children:e.map((o,a)=>u(T,{children:[n(g,{breadcrumb:o,onClick:r,maxLength:t}),a!==e.length-1&&n(f,{children:"/"})]},o.href))})}function $({breadcrumbs:e,onClick:r}){const t=B(null),o=B(null),[a,d]=R(b),i=e.length>O,x=z(()=>i?[e[0],e[e.length-1]]:e,[e,i]),p=E(()=>{const s=t.current,l=s?.parentElement;if(!s||!l||!o.current)return;const v=getComputedStyle(l),C=parseFloat(v.paddingLeft||"0")+parseFloat(v.paddingRight||"0");let h=l.clientWidth-C;const w=l.parentElement?.querySelector('[data-component-name="PageActions/PageActions"]');if(w){const L=w.getBoundingClientRect().left-s.getBoundingClientRect().left-j;L>0&&(h=Math.min(h,L))}const A=P(x,h,i,o.current);d(A)},[x,i]);return M(()=>{p();const s=new ResizeObserver(p),l=t.current?.parentElement;return l&&s.observe(l),()=>{s.disconnect()}},[p]),e.length?u(m,{children:[n(N,{ref:o,"aria-hidden":"true"}),n(W,{ref:t,"data-component-name":"Breadcrumbs",children:i?n(G,{breadcrumbs:e,onClick:r,maxLength:a}):n(H,{breadcrumbs:e,onClick:r,maxLength:a})})]}):null}const N=c.span`
1
+ import{Fragment as m,jsx as n,jsxs as u}from"react/jsx-runtime";import{Fragment as T,useCallback as E,useLayoutEffect as M,useMemo as z,useRef as B,useState as R}from"react";import{styled as c}from"styled-components";import{Dropdown as _}from"@redocly/theme/components/Dropdown/Dropdown";import{DropdownMenu as b}from"@redocly/theme/components/Dropdown/DropdownMenu";import{DropdownMenuItem as k}from"@redocly/theme/components/Dropdown/DropdownMenuItem";import{Tooltip as D}from"@redocly/theme/components/Tooltip/Tooltip";import{trimText as F}from"@redocly/theme/core/openapi";import{calculateMaxLength as S}from"../../utils/calculateMaxLength.js";const P=25,O=3,j=16;function g({breadcrumb:e,onClick:r,maxLength:t}){const o=e.name.length>t,a=F(e.name,t);return n(D,{tip:e.name,placement:"bottom",disabled:!o,children:n(y,{onClick:()=>r(e.href),children:a})})}function G({breadcrumbs:e,onClick:r,maxLength:t}){const o=e[0],a=e[e.length-1],d=e.slice(1,-1);return u(m,{children:[n(g,{breadcrumb:o,onClick:r,maxLength:t}),n(f,{children:"/"}),n(_,{trigger:n(I,{children:"..."}),closeOnClick:!0,alignment:"end",children:n(b,{children:d.map(i=>n(k,{onAction:()=>r(i.href),children:i.name},i.href))})}),n(f,{children:"/"}),n(g,{breadcrumb:a,onClick:r,maxLength:t})]})}function H({breadcrumbs:e,onClick:r,maxLength:t}){return n(m,{children:e.map((o,a)=>u(T,{children:[n(g,{breadcrumb:o,onClick:r,maxLength:t}),a!==e.length-1&&n(f,{children:"/"})]},o.href))})}function $({breadcrumbs:e,onClick:r}){const t=B(null),o=B(null),[a,d]=R(P),i=e.length>O,x=z(()=>i?[e[0],e[e.length-1]]:e,[e,i]),p=E(()=>{const s=t.current,l=s?.parentElement;if(!s||!l||!o.current)return;const v=getComputedStyle(l),C=parseFloat(v.paddingLeft||"0")+parseFloat(v.paddingRight||"0");let h=l.clientWidth-C;const w=l.parentElement?.querySelector('[data-component-name="PageActions/PageActions"]');if(w){const L=w.getBoundingClientRect().left-s.getBoundingClientRect().left-j;L>0&&(h=Math.min(h,L))}const A=S(x,h,i,o.current);d(A)},[x,i]);return M(()=>{p();const s=new ResizeObserver(p),l=t.current?.parentElement;return l&&s.observe(l),()=>{s.disconnect()}},[p]),e.length?u(m,{children:[n(N,{ref:o,"aria-hidden":"true"}),n(W,{ref:t,"data-component-name":"Breadcrumbs",children:i?n(G,{breadcrumbs:e,onClick:r,maxLength:a}):n(H,{breadcrumbs:e,onClick:r,maxLength:a})})]}):null}const N=c.span`
2
2
  position: absolute;
3
3
  visibility: hidden;
4
4
  white-space: nowrap;
@@ -19,7 +19,7 @@ import{Fragment as m,jsx as n,jsxs as u}from"react/jsx-runtime";import{Fragment
19
19
  font-size: var(--font-size-sm);
20
20
  line-height: var(--line-height-sm);
21
21
  color: var(--text-color-secondary);
22
- border-radius: var(--border-radius);
22
+ border-radius: var(--breadcrumbs-border-radius);
23
23
  cursor: pointer;
24
24
  padding: 1px calc(var(--spacing-xxs) / 2);
25
25
  overflow: hidden;
@@ -9,7 +9,7 @@ import{styled as o}from"styled-components";function e(r){return r.startsWith("2"
9
9
  align-items: center;
10
10
  padding: 0 var(--spacing-sm);
11
11
  height: 24px;
12
- border-radius: var(--border-radius);
12
+ border-radius: var(--border-radius-md);
13
13
  border: none;
14
14
  cursor: pointer;
15
15
  font-family: var(--font-family-base);
@@ -4,7 +4,7 @@ import{styled as r}from"styled-components";const o=r.span`
4
4
  font-family: var(--font-family-monospaced);
5
5
  font-size: var(--font-size-sm);
6
6
  line-height: var(--line-height-sm);
7
- border-radius: var(--border-radius);
7
+ border-radius: var(--tag-border-radius);
8
8
  color: var(--text-color-secondary);
9
9
  display: inline-flex;
10
10
  word-break: var(--code-word-break);
@@ -1,4 +1,4 @@
1
- import{Fragment as c,jsx as e,jsxs as l}from"react/jsx-runtime";import{styled as a,css as d}from"styled-components";import{memo as $,useState as j}from"react";import{isUndefined as N}from"@redocly/theme/core/openapi";import{cycleColorsByLevel as C}from"../Schema/utils.js";import{NestedToggleButton as L}from"./NestedToggleButton.js";function S({expandByDefault:r,level:g,expandable:f=!1,expandText:v,hideText:x,hideDivider:h=!1,children:s,expandedAll:i,isNestedArray:n}){const[b,u]=j((r||n)??!1),o=N(i)?b:i,t=o?C(g):void 0;if(!f)return s;const y=()=>{u(w=>!w)};return n?l(c,{children:[e(_,{children:"Array ["}),e(m,{$isArrayInsideArray:n,className:"view-nested-wrapper",children:e(p,{color:t,children:s})})]}):e(c,{children:l(m,{$divider:!h&&!o,className:"view-nested-wrapper",children:[e(V,{expanded:o,label:o?x||"":v||"",color:t,onClick:y}),o&&e(p,{color:t,children:s})]})})}const I=$(S),V=a(L)`
1
+ import{Fragment as c,jsx as e,jsxs as l}from"react/jsx-runtime";import{styled as a,css as d}from"styled-components";import{memo as $,useState as j}from"react";import{isUndefined as N}from"@redocly/theme/core/openapi";import{cycleColorsByLevel as C}from"../Schema/utils.js";import{NestedToggleButton as L}from"./NestedToggleButton.js";function S({expandByDefault:r,level:g,expandable:f=!1,expandText:v,hideText:x,hideDivider:h=!1,children:s,expandedAll:i,isNestedArray:t}){const[b,u]=j((r||t)??!1),o=N(i)?b:i,n=o?C(g):void 0;if(!f)return s;const y=()=>{u(w=>!w)};return t?l(c,{children:[e(_,{children:"Array ["}),e(m,{$isArrayInsideArray:t,className:"view-nested-wrapper",children:e(p,{color:n,children:s})})]}):e(c,{children:l(m,{$divider:!h&&!o,className:"view-nested-wrapper",children:[e(V,{expanded:o,label:o?x||"":v||"",color:n,onClick:y}),o&&e(p,{color:n,children:s})]})})}const I=$(S),V=a(L)`
2
2
  margin: var(--spacing-xxs) 0 var(--spacing-xs);
3
3
  width: 100%;
4
4
  `,p=a.div`
@@ -22,7 +22,7 @@ import{Fragment as c,jsx as e,jsxs as l}from"react/jsx-runtime";import{styled as
22
22
  `}
23
23
  `,_=a.span`
24
24
  padding: 0 var(--spacing-xs);
25
- border-radius: var(--border-radius);
25
+ border-radius: var(--tag-border-radius);
26
26
  border: 1px solid var(--border-color-secondary);
27
27
  background-color: var(--bg-color);
28
28
  font-size: var(--font-size-sm);
@@ -1 +1 @@
1
- import{jsx as n,jsxs as d}from"react/jsx-runtime";import{useState as $,useEffect as z,memo as J,useMemo as f,useRef as K}from"react";import{useAtomValue as H}from"jotai";import{Admonition as X}from"@redocly/theme/components/Admonition/Admonition";import{FieldWrapper as Y,FieldNameBox as Z,FieldName as ee,ExpandableFieldBody as ne,PanelAnnotation as F,InlineCode as re}from"./styled.js";import{ViewNested as G}from"./ViewNested.js";import{LazyMount as V}from"../common/LazyMount.js";import{GraphQLTypeViewByName as oe}from"./GraphQLTypeView.js";import{GraphQLReturnTypeDetails as te}from"./GraphQLReturnTypeDetails.js";import{GraphQLArgumentsSection as se}from"./GraphQLArgumentsSection.js";import{RequiresScopesButton as ae}from"./RequiresScopesButton.js";import{renderDescription as ie}from"./renderDescription.js";import{Markdown as pe}from"../common/Markdown.js";import{DeepLinkAnchor as me}from"../common/DeepLinkAnchor.js";import{buildGraphqlSuffix as ce,getDeepLinkId as de,isGraphqlDeepLinkAncestor as le}from"../../utils/deep-link.js";import{useDeepLinkUrl as ue}from"../../hooks/useDeepLinkSection.js";import{useSpecTranslate as he}from"../../hooks/useTranslate.js";import{globalOptionsAtom as ge}from"../../jotai/store.js";import{graphqlTypeLookupAtom as fe}from"../../jotai/graphql.js";import{mergeRequiresScopes as xe}from"../../utils/graphql-scopes.js";import{countNamedTypeFields as Le,isGraphqlFieldExpandable as ye}from"../../utils/graphql-type-expansion.js";import{isWithinExpansionLevel as Te}from"../../utils/expansion.js";import{useMarkdownAdapter as Ee}from"../../index.js";import{useUrlHash as qe}from"../../hooks/useUrlHash.js";const B=72;function ke({field:e,contrast:x,isArgument:t,fieldExpandLevel:s,parentTypeName:r,parentRequiresScopes:l,expanded:a}){const{fieldExpandLevel:M,schemasExpansionLevel:b}=H(ge),L=H(fe),y=Ee(),o=he(),T=s+1,i=r?`${r}.${e.name}`:e.name,u=qe(),E=K(u);u&&(E.current=u);const p=le(E.current,i),m=Te(s,b,0),[I,q]=$(void 0),[Q,k]=$(void 0);z(()=>{q(void 0),k(void 0)},[a]);const h=I??a??(p||m),w=Q??a??(p||m),A=!!e.deprecationReason,D=f(()=>e.deprecationReason?y.parse(e.deprecationReason)??null:null,[e.deprecationReason,y]),U=!!t&&!!e.required,c=e.args??[],v=c.length>0,_=Le(e.type.name,L)*B,j=c.length*B,R=ye(e,s,M,L),C=!R||!h,N=t?r?`arg-${r}-${e.name}`:`arg-${e.name}`:r?`${r}-${e.name}`:e.name,O=c.map(S=>({name:S.name,required:!!S.required})),P=f(()=>l!==void 0?xe(e.requiresScopes,l):null,[e.requiresScopes,l]),W=f(()=>ce({t:t?"argument":"field",path:i,arg:t?e.name:void 0}),[i,t,e.name]),g=ue(W);return n("div",{id:de(g)??N,children:d(Y,{$showBorder:C,children:[d(Z,{children:[g&&n(me,{to:g,label:`link to ${e.name}`,variant:"field"}),n(ee,{$isDeprecated:A,children:e.name}),n(te,{typeRef:e.type,inline:!v,deprecated:A,required:U})]}),e.defaultValue!==void 0&&d(F,{children:[o("defaultValue","Default"),":"," ",n(re,{children:JSON.stringify(e.defaultValue)})]}),e.description&&n(F,{children:ie(e.description)}),D&&n(X,{type:"warning",name:o("deprecationReason","Deprecation reason"),children:n(pe,{source:D})}),R&&d(ne,{$contrast:!x,children:[v&&n(G,{expanded:w,level:s,expandText:o("arguments.show","Show arguments"),collapseText:o("arguments.hide","Hide arguments"),collapsedArgs:O,onClick:()=>k(!w),children:n(V,{forceMount:p||m,estimatedHeight:j,children:n(se,{args:c,fieldExpandLevel:T,parentName:i,expanded:a})})}),n(G,{expanded:h,level:s,expandText:o("returnTypes.show","Show return type"),collapseText:o("returnTypes.hide","Hide return type"),onClick:()=>q(!h),children:n(V,{forceMount:p||m,estimatedHeight:_,children:n(oe,{typeName:e.type.name,contrast:!x,fieldExpandLevel:T,expanded:a,parentPath:i})})})]}),n(ae,{directive:P})]})})}const ze=J(ke);export{ze as GraphQLFieldView};
1
+ import{jsx as n,jsxs as d}from"react/jsx-runtime";import{useState as $,useEffect as z,memo as J,useMemo as f,useRef as K}from"react";import{useAtomValue as H}from"jotai";import{Admonition as X}from"@redocly/theme/components/Admonition/Admonition";import{FieldWrapper as Y,FieldNameBox as Z,FieldName as ee,ExpandableFieldBody as ne,PanelAnnotation as F,InlineCode as re}from"./styled.js";import{ViewNested as G}from"./ViewNested.js";import{LazyMount as V}from"../common/LazyMount.js";import{GraphQLTypeViewByName as oe}from"./GraphQLTypeView.js";import{GraphQLReturnTypeDetails as te}from"./GraphQLReturnTypeDetails.js";import{GraphQLArgumentsSection as se}from"./GraphQLArgumentsSection.js";import{RequiresScopesButton as ae}from"./RequiresScopesButton.js";import{renderDescription as ie}from"./renderDescription.js";import{Markdown as pe}from"../common/Markdown.js";import{DeepLinkAnchor as me}from"../common/DeepLinkAnchor.js";import{buildGraphqlSuffix as ce,getDeepLinkId as de,isGraphqlDeepLinkAncestor as le}from"../../utils/deep-link.js";import{useDeepLinkUrl as ue}from"../../hooks/useDeepLinkSection.js";import{useSpecTranslate as he}from"../../hooks/useTranslate.js";import{globalOptionsAtom as ge}from"../../jotai/store.js";import{graphqlTypeLookupAtom as fe}from"../../jotai/graphql.js";import{mergeRequiresScopes as xe}from"../../utils/graphql-scopes.js";import{countNamedTypeFields as Le,isGraphqlFieldExpandable as ye}from"../../utils/graphql-type-expansion.js";import{isWithinExpansionLevel as Te}from"../../utils/expansion.js";import{useMarkdownAdapter as Ee}from"../../contexts/markdownAdapter.js";import{useUrlHash as qe}from"../../hooks/useUrlHash.js";const B=72;function ke({field:e,contrast:x,isArgument:t,fieldExpandLevel:s,parentTypeName:r,parentRequiresScopes:l,expanded:a}){const{fieldExpandLevel:M,schemasExpansionLevel:b}=H(ge),L=H(fe),y=Ee(),o=he(),T=s+1,i=r?`${r}.${e.name}`:e.name,u=qe(),E=K(u);u&&(E.current=u);const p=le(E.current,i),m=Te(s,b,0),[I,q]=$(void 0),[Q,k]=$(void 0);z(()=>{q(void 0),k(void 0)},[a]);const h=I??a??(p||m),w=Q??a??(p||m),A=!!e.deprecationReason,D=f(()=>e.deprecationReason?y.parse(e.deprecationReason)??null:null,[e.deprecationReason,y]),U=!!t&&!!e.required,c=e.args??[],v=c.length>0,_=Le(e.type.name,L)*B,j=c.length*B,R=ye(e,s,M,L),C=!R||!h,N=t?r?`arg-${r}-${e.name}`:`arg-${e.name}`:r?`${r}-${e.name}`:e.name,O=c.map(S=>({name:S.name,required:!!S.required})),P=f(()=>l!==void 0?xe(e.requiresScopes,l):null,[e.requiresScopes,l]),W=f(()=>ce({t:t?"argument":"field",path:i,arg:t?e.name:void 0}),[i,t,e.name]),g=ue(W);return n("div",{id:de(g)??N,children:d(Y,{$showBorder:C,children:[d(Z,{children:[g&&n(me,{to:g,label:`link to ${e.name}`,variant:"field"}),n(ee,{$isDeprecated:A,children:e.name}),n(te,{typeRef:e.type,inline:!v,deprecated:A,required:U})]}),e.defaultValue!==void 0&&d(F,{children:[o("defaultValue","Default"),":"," ",n(re,{children:JSON.stringify(e.defaultValue)})]}),e.description&&n(F,{children:ie(e.description)}),D&&n(X,{type:"warning",name:o("deprecationReason","Deprecation reason"),children:n(pe,{source:D})}),R&&d(ne,{$contrast:!x,children:[v&&n(G,{expanded:w,level:s,expandText:o("arguments.show","Show arguments"),collapseText:o("arguments.hide","Hide arguments"),collapsedArgs:O,onClick:()=>k(!w),children:n(V,{forceMount:p||m,estimatedHeight:j,children:n(se,{args:c,fieldExpandLevel:T,parentName:i,expanded:a})})}),n(G,{expanded:h,level:s,expandText:o("returnTypes.show","Show return type"),collapseText:o("returnTypes.hide","Hide return type"),onClick:()=>q(!h),children:n(V,{forceMount:p||m,estimatedHeight:_,children:n(oe,{typeName:e.type.name,contrast:!x,fieldExpandLevel:T,expanded:a,parentPath:i})})})]}),n(ae,{directive:P})]})})}const ze=J(ke);export{ze as GraphQLFieldView};
@@ -3,14 +3,14 @@ import{jsx as r,jsxs as a}from"react/jsx-runtime";import{useRef as b,memo as u,F
3
3
  position: fixed;
4
4
  width: 100vw;
5
5
  height: 100vh;
6
- z-index: var(--z-index-popover, 1000);
6
+ z-index: var(--z-index-popover, 200);
7
7
  left: 0;
8
8
  top: 0;
9
9
  pointer-events: auto;
10
10
  `,B=o.div`
11
11
  background: var(--bg-color);
12
12
  box-shadow: var(--bg-raised-shadow, 0 8px 32px rgba(0, 0, 0, 0.15));
13
- border-radius: var(--border-radius-lg, 12px);
13
+ border-radius: var(--border-radius-lg);
14
14
  padding: var(--spacing-lg);
15
15
  display: flex;
16
16
  flex-direction: column;
@@ -58,7 +58,7 @@ import{jsx as r,jsxs as a}from"react/jsx-runtime";import{useRef as b,memo as u,F
58
58
  line-height: var(--line-height-base);
59
59
  font-family: var(--font-family-monospaced);
60
60
  padding: 0 var(--spacing-xxs, 4px);
61
- border-radius: var(--border-radius);
61
+ border-radius: var(--tag-border-radius);
62
62
  background: var(--tag-bg-color, var(--border-color-secondary));
63
63
  color: var(--text-color-secondary);
64
64
  `,T=o.p`
@@ -1,4 +1,4 @@
1
- import{Fragment as p,jsx as r,jsxs as u}from"react/jsx-runtime";import{useMemo as v}from"react";import{useAtomValue as s}from"jotai";import{styled as y}from"styled-components";import{Admonition as b}from"@redocly/theme/components/Admonition/Admonition";import{graphqlDirectiveDataAtom as F,graphqlOperationAtom as N,graphqlOperationKey as D,graphqlTypeLookupAtom as E}from"../../../jotai/graphql.js";import{GraphQLFieldView as x}from"../GraphQLFieldView.js";import{renderDescription as R}from"../renderDescription.js";import{Markdown as T}from"../../common/Markdown.js";import{FieldNameBox as S,FieldName as k,PanelAnnotation as q,InlineCode as L}from"../styled.js";import{useSpecTranslate as O}from"../../../hooks/useTranslate.js";import{useCollapsibleEntryKey as w,useExpandableSection as V,useRegisterCollapsibleEntry as j}from"../../../hooks/useExpandableSection.js";import{isGraphqlFieldExpandable as C}from"../../../utils/graphql-type-expansion.js";import{globalOptionsAtom as G}from"../../../jotai/store.js";import{useMarkdownAdapter as M}from"../../../index.js";function ae({node:e}){const{fieldExpandLevel:o}=s(G),d=s(E),a=s(N(D(e.graphqlOperationType,e.graphqlFieldName))),i=!!e.graphqlTypeName&&e.graphqlOperationType==null&&e.graphqlFieldName==null,f=s(F(i?e.graphqlTypeName??"":"")),t=a?.args??null,l=f?.args??null,h=(t?.length?t:l)??null,g=!!h&&h.some(n=>C(n,0,o,d)),m=V(e.variant,g);if(j(w(g?e.variant:void 0),!!m),t&&t.length>0)return r(p,{children:t.map(n=>r(x,{field:n,isArgument:!0,fieldExpandLevel:0,parentTypeName:e.graphqlFieldName,parentRequiresScopes:a?a.requiresScopes??null:void 0,expanded:m},n.name))});if(l&&l.length>0){const n=`@${f?.name}`;return r(p,{children:l.map(A=>r(x,{field:A,isArgument:!0,fieldExpandLevel:0,parentTypeName:n,expanded:m},A.name))})}const c=e.graphqlSchema;return!Array.isArray(c)||c.length===0?r(p,{}):r(p,{children:c.map(n=>r(_,{arg:n},n.name))})}function _({arg:e}){const o=O(),d=!!e.deprecationReason,a=M(),i=v(()=>e.deprecationReason?a.parse(e.deprecationReason)??null:null,[e.deprecationReason,a]);return u(z,{children:[u(S,{children:[r(k,{$isDeprecated:d,children:e.name}),r(B,{children:e.type})]}),e.defaultValue!==void 0&&u(q,{children:[o("defaultValue","Default"),":"," ",r(L,{children:JSON.stringify(e.defaultValue)})]}),e.description!=null&&e.description!==""&&r(q,{children:R(e.description)}),i&&r(b,{type:"warning",name:o("deprecationReason","Deprecation reason"),children:r(T,{source:i})})]})}const z=y.div`
1
+ import{Fragment as p,jsx as r,jsxs as u}from"react/jsx-runtime";import{useMemo as v}from"react";import{useAtomValue as s}from"jotai";import{styled as y}from"styled-components";import{Admonition as b}from"@redocly/theme/components/Admonition/Admonition";import{graphqlDirectiveDataAtom as F,graphqlOperationAtom as N,graphqlOperationKey as D,graphqlTypeLookupAtom as E}from"../../../jotai/graphql.js";import{GraphQLFieldView as x}from"../GraphQLFieldView.js";import{renderDescription as R}from"../renderDescription.js";import{Markdown as T}from"../../common/Markdown.js";import{FieldNameBox as S,FieldName as k,PanelAnnotation as q,InlineCode as L}from"../styled.js";import{useSpecTranslate as O}from"../../../hooks/useTranslate.js";import{useCollapsibleEntryKey as w,useExpandableSection as V,useRegisterCollapsibleEntry as j}from"../../../hooks/useExpandableSection.js";import{isGraphqlFieldExpandable as C}from"../../../utils/graphql-type-expansion.js";import{globalOptionsAtom as G}from"../../../jotai/store.js";import{useMarkdownAdapter as M}from"../../../contexts/markdownAdapter.js";function ae({node:e}){const{fieldExpandLevel:o}=s(G),d=s(E),a=s(N(D(e.graphqlOperationType,e.graphqlFieldName))),i=!!e.graphqlTypeName&&e.graphqlOperationType==null&&e.graphqlFieldName==null,f=s(F(i?e.graphqlTypeName??"":"")),t=a?.args??null,l=f?.args??null,h=(t?.length?t:l)??null,g=!!h&&h.some(n=>C(n,0,o,d)),m=V(e.variant,g);if(j(w(g?e.variant:void 0),!!m),t&&t.length>0)return r(p,{children:t.map(n=>r(x,{field:n,isArgument:!0,fieldExpandLevel:0,parentTypeName:e.graphqlFieldName,parentRequiresScopes:a?a.requiresScopes??null:void 0,expanded:m},n.name))});if(l&&l.length>0){const n=`@${f?.name}`;return r(p,{children:l.map(A=>r(x,{field:A,isArgument:!0,fieldExpandLevel:0,parentTypeName:n,expanded:m},A.name))})}const c=e.graphqlSchema;return!Array.isArray(c)||c.length===0?r(p,{}):r(p,{children:c.map(n=>r(_,{arg:n},n.name))})}function _({arg:e}){const o=O(),d=!!e.deprecationReason,a=M(),i=v(()=>e.deprecationReason?a.parse(e.deprecationReason)??null:null,[e.deprecationReason,a]);return u(z,{children:[u(S,{children:[r(k,{$isDeprecated:d,children:e.name}),r(B,{children:e.type})]}),e.defaultValue!==void 0&&u(q,{children:[o("defaultValue","Default"),":"," ",r(L,{children:JSON.stringify(e.defaultValue)})]}),e.description!=null&&e.description!==""&&r(q,{children:R(e.description)}),i&&r(b,{type:"warning",name:o("deprecationReason","Deprecation reason"),children:r(T,{source:i})})]})}const z=y.div`
2
2
  padding: var(--spacing-base) 0;
3
3
  border-bottom: 1px solid var(--border-color-primary);
4
4
  `,B=y.span`
@@ -1,4 +1,4 @@
1
- import{Fragment as y,jsx as n,jsxs as v}from"react/jsx-runtime";import{memo as g,useMemo as s}from"react";import{styled as k}from"styled-components";import{useAtomValue as D}from"jotai";import{panelKind as P}from"../../types/common.js";import{refPointerToStoreId as d}from"../../utils/refPointer.js";import{DeepLinkSectionContext as j}from"../../hooks/useDeepLinkSection.js";import{schemaEntryAtom as E}from"../../jotai/schema.js";import{useResolvedExamples as I}from"../ItemContent/hooks.js";import{SchemaView as C}from"../Schema/SchemaView.js";import{Markdown as O}from"../common/Markdown.js";import{ContentWrapper as w}from"../common/ContentWrapper.js";import{SchemaCatalogLink as L}from"../SchemaCatalogLink.js";import{detectJsonSchemaType as T,isPrimitiveLikeSchema as _}from"../../services/schema/propertyBuilder.js";function b(e){const m=e.type||T(e);return!_(e,m)}function A({schemaRef:e,exampleRef:m,showReadOnly:f=!0,showWriteOnly:u=!1}){const t=d(e),a=d(m),r=D(E(t??"")),c=s(()=>a?[a]:void 0,[a]),h=I(t,c,"response","application/json"),S=s(()=>({pathOnly:!0}),[]),p=s(()=>{const o=r?.data,i=o?.description;if(!(!i||typeof i=="string"&&!i.trim()||!o||!b(o)))return i},[r?.data]),l=h.length>0,x=s(()=>!t||!r||!l?void 0:[{children:[{kind:P.RESPONSE,schemaId:t,exampleIds:c,headerTitle:"",examples:[]}]}],[t,r,l,c]);return!t||!r?n(y,{}):n("div",{"data-testid":"schema-definition",children:v(w,{panels:x,children:[e&&n(L,{schemaRef:e}),p?n(F,{children:n(O,{source:p})}):null,n(j.Provider,{value:S,children:n(C,{expandByDefault:!0,level:1,schemaId:t,skipReadOnly:!f,skipWriteOnly:!u})})]})})}const X=g(A),F=k.div`
1
+ import{Fragment as y,jsx as r,jsxs as v}from"react/jsx-runtime";import{memo as g,useMemo as s}from"react";import{styled as k}from"styled-components";import{useAtomValue as D}from"jotai";import{panelKind as P}from"../../types/common.js";import{refPointerToStoreId as d}from"../../utils/refPointer.js";import{DeepLinkSectionContext as j}from"../../hooks/useDeepLinkSection.js";import{schemaEntryAtom as E}from"../../jotai/schema.js";import{useResolvedExamples as I}from"../ItemContent/hooks.js";import{SchemaView as C}from"../Schema/SchemaView.js";import{Markdown as O}from"../common/Markdown.js";import{ContentWrapper as w}from"../common/ContentWrapper.js";import{SchemaCatalogLink as L}from"../SchemaCatalogLink.js";import{detectJsonSchemaType as T,isPrimitiveLikeSchema as _}from"../../services/schema/propertyBuilder.js";function b(e){const m=e.type||T(e);return!_(e,m)}function A({schemaRef:e,exampleRef:m,showReadOnly:f=!0,showWriteOnly:u=!1}){const t=d(e),a=d(m),n=D(E(t??"")),c=s(()=>a?[a]:void 0,[a]),h=I(t,c,"response","application/json"),S=s(()=>({pathOnly:!0}),[]),p=s(()=>{const o=n?.data,i=o?.description;if(!(!i||typeof i=="string"&&!i.trim()||!o||!b(o)))return i},[n?.data]),l=h.length>0,x=s(()=>!t||!n||!l?void 0:[{children:[{kind:P.RESPONSE,schemaId:t,exampleIds:c,hideHeaderTitle:!0,examples:[]}]}],[t,n,l,c]);return!t||!n?r(y,{}):r("div",{"data-testid":"schema-definition",children:v(w,{panels:x,children:[e&&r(L,{schemaRef:e}),p?r(F,{children:r(O,{source:p})}):null,r(j.Provider,{value:S,children:r(C,{expandByDefault:!0,level:1,schemaId:t,skipReadOnly:!f,skipWriteOnly:!u})})]})})}const X=g(A),F=k.div`
2
2
  margin-bottom: var(--spacing-vertical);
3
3
  p:last-child {
4
4
  margin-bottom: 0;
@@ -1 +1 @@
1
- import{Fragment as je,jsx as n,jsxs as ie}from"react/jsx-runtime";import{useState as Ge,useMemo as m,useCallback as W,useEffect as Fe,useContext as We}from"react";import{useAtom as ce}from"jotai";import{useAtomValue as L,useSetAtom as _e}from"jotai";import{buildCodeSampleHAR as He,tryGenerateCodeSample as ze,mapReplayAtomValuesToHarRequestValues as Je,useCodeSampleResolvers as Ye}from"../../../services/code-samples/index.js";import{findExampleIdByKey as Qe}from"../../../services/code-samples/example-key.js";import{exampleStoreAtom as Xe}from"../../../jotai/examples.js";import{itemStoreAtom as Ze,itemStoreFieldAtom as et}from"../../../jotai/itemStore.js";import{ItemIdContext as tt}from"../../../hooks/useDeepLinkSection.js";import{DEFAULT_LANGUAGES as pe,getGeneratorKey as rt,getLangKey as B,getSyntaxHighlightLang as at}from"../../../utils/languages.js";import{useSpecTranslate as ot}from"../../../hooks/useTranslate.js";import{CodeBlockPanel as st,StyledCodeBlock as nt}from"../styled.js";import{useResolvedExamples as lt}from"../../ItemContent/hooks.js";import{languageAtom as it,environmentAtom as ct,selectedSecuritySchemeIdxAtom as pt,requestValuesAtom as mt}from"../../../jotai/app.js";import{useActiveVariantSchemaId as dt,useSchemaVariantSelection as ut,useMediaTypeContent as yt}from"./hooks.js";import{isSequentialMediaType as ft}from"../../../utils/media-type.js";import{isRecord as me}from"../../../adapters/helpers.js";import{updateObjectProperties as ht}from"../../../adapters/openapi/configure/merge-utils.js";import{useCopyCodeTelemetry as St}from"../../../hooks/useCopyCodeTelemetry.js";import{VariantPicker as gt,ExampleDescription as vt,ExampleSelector as xt,MediaTypeSelector as kt,PanelDropdownSelect as bt,PayloadDisplay as Et}from"./selectors.js";import{LanguageDropdown as Vt}from"../LanguageItem/LanguageDropdown.js";import{StyledPanelHeader as At,TryItPanelFooter as Ct}from"./styled.js";import{MediaTypeRow as qt}from"./styled.js";import{ServerDropdown as Lt}from"./ServerDropdown.js";import{replaceServerVariables as It,serverMatchesUrl as Tt}from"../../../services/code-samples/server-variables.js";import{globalOptionsAtom as Rt}from"../../../jotai/store.js";import{createLanguageSwitchEvent as Ut}from"../../../events/languageSwitch.js";import{createCodeSampleCopyEvent as $t}from"../../../events/codeSampleCopy.js";import{Replay as Dt}from"../../Replay/index.js";import{useOpenApiDefinition as Ot}from"../../../hoc/withReplayPrefetch.js";import{pickReplayDefinitionDownloadUrl as Pt}from"../../../utils/fetch-openapi-definition.js";const _=pe.find(r=>r.key==="payload")??pe[0],de=[{key:_.key,lang:_.lang,title:_.label}];function Sr({node:r}){const[{activeLanguage:g,languages:c},v]=ce(it),s=L(Rt),x=ot(),ue=Ot(),K=r.isWebhook?"payload":g||"curl",H=Ye(),t=r.source,E=r.definitionSamples,ye=L(mt),S=L(Xe),fe=`${t.method.toLowerCase()}:${t.path}`,I=ye[fe],z=I?.activeExampleName,T=typeof z=="string"?z:void 0,{mediaTypes:J,activeMediaType:d,effectiveSchemaId:R,effectiveExampleIds:i,onMediaTypeChange:he}=yt(r),Se=r.isWebhook?"response":"request",ge=ut(i?.length?void 0:R),ve=dt(R),xe=ft(d)?R:ve,Y=lt(xe,i,Se,d),Q=We(tt)??"",U=_e(Ze(Q)),ke=L(et({itemId:Q,key:"activeExampleKey"}));Fe(()=>{if(!T)return;const e=S[T]?.key??T;U({activeExampleKey:e})},[T,S,U]);const k=`${d}|${i?.join(",")}`,X=Qe(i,ke||void 0,e=>S[e]),Z=X?i?.indexOf(X)??-1:-1,[$,ee]=Ge({contentKey:k,idx:0}),V=Z>=0?Z:$.contentKey===k?$.idx:0;($.idx!==V||$.contentKey!==k)&&ee({contentKey:k,idx:V});const be=W(e=>{ee({contentKey:k,idx:e});const a=i?.[e],o=a?S[a]?.key:void 0;U({activeExampleKey:o??""})},[k,i,S,U]),A=Y[V]??Y[0],te=(i?.length??0)>0||!!R,D=m(()=>{if(!E?.length)return E;const e=new Set((c??[]).map(a=>a.key));return E.filter(a=>e.has(B(a)))},[E,c]),f=m(()=>{const e=(c??[]).map(({key:o,lang:l,title:q})=>({key:o,lang:l,title:q}));let a=te?e:e.filter(o=>o.key!=="payload");if(r.isWebhook){const o=new Set(D?.map(l=>B(l))??[]);a=a.filter(l=>l.key==="payload"||o.has(l.key))}return a},[te,c,r.isWebhook,D]),u=m(()=>(f.some(e=>e.key===K)?K:f[0]?.key)??"curl",[f,K]),O=L(ct),{activeServerUrl:re,activeServerSpecUrl:h}=m(()=>{const e=O[0].server,a=e?r.servers?.find(l=>Tt(l,e)):void 0;if(e&&a)return{activeServerUrl:e,activeServerSpecUrl:a.url};const o=r.servers?.[0];return o?{activeServerUrl:It(o),activeServerSpecUrl:o.url}:{activeServerUrl:t.servers[0]?.url,activeServerSpecUrl:t.servers[0]?.url}},[O,r.servers,t.servers]),[M,Ee]=ce(pt),p=t.securityGroups,Ve=!!(p&&p.length>1),ae=m(()=>{if(!p?.length)return;const e=p.length>1?p[M]??p[0]:p[0];return Object.keys(e)},[p,M]),oe=m(()=>{const e=Je(I??{});return t.requestValues?.security?{...e,security:t.requestValues.security}:e},[I,t.requestValues?.security]),C=I?.body,P=i?.[V],w=P?S[P]?.key??P:void 0,b=m(()=>{const e=t.requestValues?.serverBody;return(h&&e?.[h])??t.requestValues?.body},[h,t.requestValues?.body,t.requestValues?.serverBody]),Ae=m(()=>C!==void 0?wt(C):b!==void 0?A===void 0?b:me(A)&&me(b)?ht(A,b):b:A,[C,A,b]),Ce=m(()=>{if(u==="payload")return"";const e=D?.find(y=>B(y)===u);if(e){let y=e.source;const F=t.requestValues?.envVariables,Be=t.requestValues?.serverEnvVariables,Ke={...F,...h&&Be?.[h]};for(const[Me,Ne]of Object.entries(Ke))y=y.replaceAll(`{{${Me}}}`,Ne);return y}const a=He(t,{serverUrl:re,mediaType:d,environment:O[0]??{},requestValues:oe,activeSecuritySchemeIds:ae,replayBody:C,exampleName:w},{skipOptionalParameters:s.codeSamples?.skipOptionalParameters,withOAuth2Call:s.codeSamples?.withOAuth2Call,generatedPayloadSamplesMaxDepth:s.generatedSamplesMaxDepth},H),o=s.codeSamples?.languages?.find(y=>y.key===u),l=ze(o?rt(o):u,a,o?.options);if(l.kind==="unsupported-language")return`// ${x("unsupportedLanguage","Language is not supported.")}`;if(l.kind==="error")return console.error(l.error),`// ${x("failedToGenerateCodeSample","Failed to generate code sample.")}`;let q=l.source;const Oe=t.requestValues?.envVariables,Pe=t.requestValues?.serverEnvVariables,we={...Oe,...h&&Pe?.[h]};for(const[y,F]of Object.entries(we))q=q.replaceAll(`{{${y}}}`,F);return q},[u,D,t,re,h,d,O,s,H,oe,ae,C,w,x]),N=f.find(e=>e.key===u)??f[0],se=E?.find(e=>B(e)===u),j=se?.lang??N?.lang,qe=j&&at(j),ne=St("request"),Le=W(e=>()=>{ne(e)(),s.events?.codeSamplesCopy?.($t({operation:{id:`${t.method}:${t.path}`,path:t.path,httpVerb:t.method,name:`${t.method.toUpperCase()} ${t.path}`},type:"request",lang:e??"",label:N?.title??"",activeMimeName:d??"",activeExampleName:w}))},[ne,s.events,t.method,t.path,N,d,w]),Ie=W(e=>{v(e);const a=(r.isWebhook?de:f).find(o=>o.key===e);s.events?.codeSamplesLanguageSwitch&&a&&s.events.codeSamplesLanguageSwitch(Ut({operation:{id:`${t.method}:${t.path}`,path:t.path,httpVerb:t.method,name:`${t.method.toUpperCase()} ${t.path}`},sample:{lang:a.lang,label:a.title}}))},[v,f,r.isWebhook,s.events,t.method,t.path]),Te=t.method,Re=t.path,le=!(s.hideReplay||r.hideReplay)&&!r.isWebhook&&!!(ue??Pt(s.downloadUrls)),G=u==="payload",Ue=!G&&!!se,$e=(i?.length??0)>0,De=m(()=>le?n(Ct,{children:n(Dt,{node:r})}):void 0,[le,r]);return n(je,{children:ie(st,{className:"panel-request-samples",footer:De,header:()=>ie(At,{isExpandable:!1,children:[n(Lt,{servers:r.servers??[],method:Te,path:Re}),n(Vt,{activeTab:u,samples:r.isWebhook?de:f,onChange:Ie})]}),isExpandable:!1,children:[Ve&&p&&n(Bt,{requirements:p,activeIdx:M,onSelect:Ee}),J.length>1&&n(kt,{mediaTypes:J,value:d,onChange:he,label:G?x("contentType","Payload media type"):x("contentType","Request media type")}),!Ue&&!$e&&n(gt,{selection:ge}),n(xt,{exampleIds:i,selectedIdx:V,onSelect:be}),n(vt,{description:S[P??""]?.description}),G?n(Et,{payload:Ae,emptyMessage:`// ${x("noRequestPayload","No request payload")}`,mediaType:d,snippetType:"request"}):n(nt,{lang:qe,source:Ce,header:{className:"code-block-header",controls:{copy:{onClick:Le(j)}}}})]})})}function wt(r){if(typeof r!="string")return r;const g=r.trim();if(!g)return r;try{const c=JSON.parse(g);if(c!==null&&typeof c=="object")return c}catch{}return r}function Bt({requirements:r,activeIdx:g,onSelect:c}){return n(qt,{children:n(bt,{value:String(g),onChange:v=>c(Number(v)),"aria-label":"Security scheme",options:r.map((v,s)=>({key:String(s),value:String(s),label:Object.keys(v).join(" + ")||`Scheme ${s+1}`}))})})}export{Sr as CodeSampleItem};
1
+ import{Fragment as le,jsx as s,jsxs as j}from"react/jsx-runtime";import{useState as ce,useMemo as T,useCallback as V,useContext as de}from"react";import{useEffect as ue}from"react";import{useAtomValue as I,useSetAtom as ye}from"jotai";import{applyEnvVariables as fe}from"../../../services/code-samples/apply-env-variables.js";import{findExampleIdByKey as he}from"../../../services/code-samples/example-key.js";import{itemStoreAtom as Se,itemStoreFieldAtom as ge}from"../../../jotai/itemStore.js";import{ItemIdContext as xe}from"../../../hooks/useDeepLinkSection.js";import{useSpecTranslate as ve}from"../../../hooks/useTranslate.js";import{CodeBlockPanel as Ce,StyledCodeBlock as Ee}from"../styled.js";import{useResolvedExamples as be}from"../../ItemContent/hooks.js";import{getLangKey as G,getSyntaxHighlightLang as Ie}from"../../../utils/languages.js";import{selectedSecuritySchemeIdxAtom as qe}from"../../../jotai/app.js";import{exampleStoreAtom as Le}from"../../../jotai/examples.js";import{useActiveVariantSchemaId as ke,useSchemaVariantSelection as Te,useMediaTypeContent as Ve}from"./hooks.js";import{isSequentialMediaType as Ae}from"../../../utils/media-type.js";import{isRecord as O}from"../../../adapters/helpers.js";import{updateObjectProperties as Be}from"../../../adapters/openapi/configure/merge-utils.js";import{useCopyCodeTelemetry as $e}from"../../../hooks/useCopyCodeTelemetry.js";import{VariantPicker as Ke,ExampleDescription as Ne,ExampleSelector as Pe,MediaTypeSelector as Ue,PayloadDisplay as Me}from"./selectors.js";import{LanguageDropdown as Re}from"../LanguageItem/LanguageDropdown.js";import{StyledPanelHeader as we}from"./styled.js";import{ServerDropdown as De}from"./ServerDropdown.js";import{globalOptionsAtom as Fe}from"../../../jotai/store.js";import{createLanguageSwitchEvent as je}from"../../../events/languageSwitch.js";import{createCodeSampleCopyEvent as Ge}from"../../../events/codeSampleCopy.js";import{useActiveServer as Oe}from"./useActiveServer.js";import{useCodeSampleLanguages as We,WEBHOOK_LANGUAGE_SAMPLES as W}from"./useCodeSampleLanguages.js";import{useReplayRequestState as _e}from"./useReplayRequestState.js";import{useTryItFooter as He}from"./useTryItFooter.js";import{generateRequestSample as ze}from"./generate-request-sample.js";import{SecuritySchemeSelector as Je}from"./SecuritySchemeSelector.js";function Tt({node:o}){const l=I(Fe),d=ve(),e=o.source,c=I(Le),{mediaTypes:A,activeMediaType:n,effectiveSchemaId:x,effectiveExampleIds:a,onMediaTypeChange:_}=Ve(o),H=o.isWebhook?"response":"request",z=Te(a?.length?void 0:x),J=ke(x),Q=Ae(n)?x:J,B=be(Q,a,H,n),$=de(xe)??"",v=ye(Se($)),X=I(ge({itemId:$,key:"activeExampleKey"})),r=_e(e),Y=He(o);ue(()=>{if(!r.exampleName)return;const t=c[r.exampleName]?.key??r.exampleName;v({activeExampleKey:t})},[r.exampleName,c,v]);const u=`${n}|${a?.join(",")}`,K=he(a,X||void 0,t=>c[t]),N=K?a?.indexOf(K)??-1:-1,[C,P]=ce({contentKey:u,idx:0}),f=N>=0?N:C.contentKey===u?C.idx:0;(C.idx!==f||C.contentKey!==u)&&P({contentKey:u,idx:f});const Z=V(t=>{P({contentKey:u,idx:t});const i=a?.[t],g=i?c[i]?.key:void 0;v({activeExampleKey:g??""})},[u,a,c,v]),h=B[f]??B[0],ee=(a?.length??0)>0||!!x,{languages:S,filteredDefinitionSamples:U,activeLanguage:m,setLanguage:M}=We(o,ee),p=Oe(o),R=I(qe),w=e.securityGroups,E=a?.[f],b=E?c[E]?.key??E:void 0,y=T(()=>{const t=e.requestValues?.serverBody;return(p.specUrl&&t?.[p.specUrl])??e.requestValues?.body},[p.specUrl,e.requestValues?.body,e.requestValues?.serverBody]),te=T(()=>r.displayBody!==void 0?r.displayBody:y!==void 0?h===void 0?y:O(h)&&O(y)?Be(h,y):y:h,[r.displayBody,h,y]),oe=T(()=>{if(m==="payload")return"";const t=U?.find(g=>G(g)===m);if(t)return fe(t.source,e.requestValues,p.specUrl);let i;return i=ze({source:e,activeLanguage:m,serverUrl:p.url,activeServerSpecUrl:p.specUrl,mediaType:n,environment:p.environment[0]??{},harRequestValues:r.harRequestValues,securityGroups:w,securityIdx:R,replayBody:r.body,exampleName:b,options:l,resolvers:r.resolvers,translate:d}),i??`// ${d("unsupportedLanguage","Language is not supported.")}`},[m,U,e,p,d,n,r,w,R,b,l]),q=S.find(t=>t.key===m)??S[0],D=o.definitionSamples?.find(t=>G(t)===m),L=D?.lang??q?.lang,ae=L&&Ie(L),F=$e("request"),re=V(t=>()=>{F(t)(),l.events?.codeSamplesCopy?.(Ge({operation:{id:`${e.method}:${e.path}`,path:e.path,httpVerb:e.method,name:`${e.method.toUpperCase()} ${e.path}`},type:"request",lang:t??"",label:q?.title??"",activeMimeName:n??"",activeExampleName:b}))},[F,l.events,e.method,e.path,q,n,b]),se=V(t=>{M(t);const i=(o.isWebhook?W:S).find(g=>g.key===t);l.events?.codeSamplesLanguageSwitch&&i&&l.events.codeSamplesLanguageSwitch(je({operation:{id:`${e.method}:${e.path}`,path:e.path,httpVerb:e.method,name:`${e.method.toUpperCase()} ${e.path}`},sample:{lang:i.lang,label:i.title}}))},[M,S,o.isWebhook,l.events,e.method,e.path]),ne=e.method,ie=e.path,k=m==="payload",me=!k&&!!D,pe=(a?.length??0)>0;return s(le,{children:j(Ce,{className:"panel-request-samples",footer:Y,header:()=>j(we,{isExpandable:!1,children:[s(De,{servers:o.servers??[],method:ne,path:ie}),s(Re,{activeTab:m,samples:o.isWebhook?W:S,onChange:se})]}),isExpandable:!1,children:[s(Je,{requirements:e.securityGroups}),A.length>1&&s(Ue,{mediaTypes:A,value:n,onChange:_,label:k?d("contentType","Payload media type"):d("contentType","Request media type")}),!me&&!pe&&s(Ke,{selection:z}),s(Pe,{exampleIds:a,selectedIdx:f,onSelect:Z}),s(Ne,{description:c[E??""]?.description}),k?s(Me,{payload:te,emptyMessage:`// ${d("noRequestPayload","No request payload")}`,mediaType:n,snippetType:"request"}):s(Ee,{lang:ae,source:oe,header:{className:"code-block-header",controls:{copy:{onClick:re(L)}}}})]})})}export{Tt as CodeSampleItem};
@@ -1 +1 @@
1
- import{Fragment as Z,jsx as a,jsxs as B}from"react/jsx-runtime";import{useState as D,useMemo as H,useCallback as O,useContext as ee}from"react";import{useAtom as te,useAtomValue as M,useSetAtom as oe}from"jotai";import{PanelHeaderTitle as ne}from"@redocly/theme/components/Panel/PanelHeaderTitle";import{CodeBlockPanel as se}from"../styled.js";import{findExampleIdByKey as T}from"../../../services/code-samples/example-key.js";import{useResolvedExamples as ae,useExampleEntries as ie}from"../../ItemContent/hooks.js";import{useBodySamplingSchemaId as de,useSchemaVariantSelection as ce}from"./hooks.js";import{activeMediaTypeAtom as pe}from"../../../jotai/app.js";import{exampleStoreAtom as me}from"../../../jotai/examples.js";import{itemStoreAtom as le,itemStoreFieldAtom as F}from"../../../jotai/itemStore.js";import{ItemIdContext as re}from"../../../hooks/useDeepLinkSection.js";import{VariantPicker as ye,ExampleDescription as fe,ExampleSelector as xe,MediaTypeSelector as ue,PayloadDisplay as he}from"./selectors.js";import{ResponsePanelHeader as Te}from"./styled.js";import{ResponseCodesTabList as Ie,ResponseCodeTab as ve}from"../../common/ResponseCodeTabs.js";import{useSpecTranslate as Ce}from"../../../hooks/useTranslate.js";function Se(n,e,y){if(e===void 0||!n?.length)return;const d=s=>y[s];for(const s of n){for(const[I,v]of Object.entries(s.mediaTypeContent??{}))if(T(v.exampleIds,e,d))return{code:s.code,mediaType:I};if(T(s.exampleIds,e,d))return{code:s.code}}}function Ne({node:n}){const{responseCodes:e}=n,y=Ce(),d=ee(re)??"",s=oe(le(d)),I=M(F({itemId:d,key:"activeResponseCode"})),v=M(F({itemId:d,key:"activeExampleKey"})),c=M(me),p=H(()=>Se(e,n.exampleKey,c),[e,n.exampleKey,c]),f=I||p?.code||e?.[0]?.code,i=e?.find(t=>t.code===f)??e?.[0],m=H(()=>i?.mediaTypeContent?Object.keys(i.mediaTypeContent):i?.mediaTypes??[],[i]),[C,N]=te(pe),[V,_]=D(!1),S=p&&p.code===f&&p.mediaType&&m.includes(p.mediaType)?p.mediaType:void 0,u=!V&&S?S:C&&m.includes(C)?C:S??m[0],R=i?.mediaTypeContent?.[u??""],K=!!e?.length,E=R?.schemaId??i?.schemaId??(K?void 0:n.schemaId),o=R?.exampleIds??i?.exampleIds??(K?void 0:n.exampleIds),G=!e?.length||!!(E||o?.length),g=m.length>0?u??m[0]:"application/json",L=ce(o?.length?void 0:E),U=de(E,g),k=ae(U,o,"response",g),q=ie(o),h=`${f}|${u}|${o?.join(",")}`,b=T(o,v||void 0,t=>c[t]),j=b?o?.indexOf(b)??-1:-1,A=T(o,n.exampleKey,t=>c[t]),P=A?o?.indexOf(A)??-1:-1,[w,$]=D({}),l=w[h],x=j>=0?j:l?.picked?l.idx:P>=0?P:l?.idx??0;if(!l||l.idx!==x){const t=l?.picked??!1;$(r=>({...r,[h]:{idx:x,picked:t}}))}const z=O(t=>{$(Y=>({...Y,[h]:{idx:t,picked:!0}}));const r=o?.[t],X=r?c[r]?.key:void 0;s({activeExampleKey:X??""})},[h,o,c,s]),J=k[x]??k[0],Q=q[x]?.description,W=O(()=>{if(!(!n.headerTitle&&!e?.length))return B(Te,{children:[a(ne,{children:n.headerTitle}),e&&e.length>0&&a(Ie,{children:e.map(t=>{const r=t.code===(f??e[0]?.code);return a(ve,{type:"button",$active:r,$code:t.code,onClick:()=>s({activeResponseCode:t.code}),children:t.code},t.code)})})]})},[e,f,n.headerTitle,s]);return k.length===0&&!e?.length?a(Z,{}):B(se,{className:"panel-response-samples",header:W,isExpandable:!1,children:[a(ue,{mediaTypes:m,value:u,onChange:t=>{_(!0),N(t)},label:y("contentType","Response media type")}),!o?.length&&a(ye,{selection:L}),a(xe,{exampleIds:o,selectedIdx:x,onSelect:z}),a(fe,{description:Q}),a(he,{payload:J,emptyMessage:G?`// ${y("noResponseExample","No response sample")}`:y("noResponseContent","No content"),mediaType:g})]})}export{Ne as ResponseExampleItem};
1
+ import{Fragment as Z,jsx as a,jsxs as $}from"react/jsx-runtime";import{useState as B,useMemo as D,useCallback as O,useContext as ee}from"react";import{useAtom as te,useAtomValue as R,useSetAtom as oe}from"jotai";import{PanelHeaderTitle as ne}from"@redocly/theme/components/Panel/PanelHeaderTitle";import{CodeBlockPanel as se}from"../styled.js";import{findExampleIdByKey as T}from"../../../services/code-samples/example-key.js";import{useResolvedExamples as ae,useExampleEntries as ie}from"../../ItemContent/hooks.js";import{useBodySamplingSchemaId as de,useSchemaVariantSelection as ce}from"./hooks.js";import{activeMediaTypeAtom as pe}from"../../../jotai/app.js";import{exampleStoreAtom as me}from"../../../jotai/examples.js";import{itemStoreAtom as re,itemStoreFieldAtom as F}from"../../../jotai/itemStore.js";import{ItemIdContext as le}from"../../../hooks/useDeepLinkSection.js";import{VariantPicker as ye,ExampleDescription as fe,ExampleSelector as xe,MediaTypeSelector as ue,PayloadDisplay as he}from"./selectors.js";import{ResponsePanelHeader as Te}from"./styled.js";import{ResponseCodesTabList as Ie,ResponseCodeTab as ve}from"../../common/ResponseCodeTabs.js";import{useSpecTranslate as Ce}from"../../../hooks/useTranslate.js";function Se(n,e,i){if(e===void 0||!n?.length)return;const c=s=>i[s];for(const s of n){for(const[I,v]of Object.entries(s.mediaTypeContent??{}))if(T(v.exampleIds,e,c))return{code:s.code,mediaType:I};if(T(s.exampleIds,e,c))return{code:s.code}}}function Ne({node:n}){const{responseCodes:e}=n,i=Ce(),c=ee(le)??"",s=oe(re(c)),I=R(F({itemId:c,key:"activeResponseCode"})),v=R(F({itemId:c,key:"activeExampleKey"})),p=R(me),m=D(()=>Se(e,n.exampleKey,p),[e,n.exampleKey,p]),f=I||m?.code||e?.[0]?.code,d=e?.find(t=>t.code===f)??e?.[0],r=D(()=>d?.mediaTypeContent?Object.keys(d.mediaTypeContent):d?.mediaTypes??[],[d]),[C,N]=te(pe),[V,_]=B(!1),S=m&&m.code===f&&m.mediaType&&r.includes(m.mediaType)?m.mediaType:void 0,u=!V&&S?S:C&&r.includes(C)?C:S??r[0],M=d?.mediaTypeContent?.[u??""],K=!!e?.length,E=M?.schemaId??d?.schemaId??(K?void 0:n.schemaId),o=M?.exampleIds??d?.exampleIds??(K?void 0:n.exampleIds),G=!e?.length||!!(E||o?.length),g=r.length>0?u??r[0]:"application/json",L=ce(o?.length?void 0:E),U=de(E,g),k=ae(U,o,"response",g),q=ie(o),h=`${f}|${u}|${o?.join(",")}`,b=T(o,v||void 0,t=>p[t]),j=b?o?.indexOf(b)??-1:-1,A=T(o,n.exampleKey,t=>p[t]),H=A?o?.indexOf(A)??-1:-1,[w,P]=B({}),l=w[h],x=j>=0?j:l?.picked?l.idx:H>=0?H:l?.idx??0;if(!l||l.idx!==x){const t=l?.picked??!1;P(y=>({...y,[h]:{idx:x,picked:t}}))}const z=O(t=>{P(Y=>({...Y,[h]:{idx:t,picked:!0}}));const y=o?.[t],X=y?p[y]?.key:void 0;s({activeExampleKey:X??""})},[h,o,p,s]),J=k[x]??k[0],Q=q[x]?.description,W=O(()=>{if(!(n.hideHeaderTitle&&!e?.length))return $(Te,{children:[!n.hideHeaderTitle&&a(ne,{children:i("response","Response")}),e&&e.length>0&&a(Ie,{children:e.map(t=>{const y=t.code===(f??e[0]?.code);return a(ve,{type:"button",$active:y,$code:t.code,onClick:()=>s({activeResponseCode:t.code}),children:t.code},t.code)})})]})},[e,f,n.hideHeaderTitle,s,i]);return k.length===0&&!e?.length?a(Z,{}):$(se,{className:"panel-response-samples",header:W,isExpandable:!1,children:[a(ue,{mediaTypes:r,value:u,onChange:t=>{_(!0),N(t)},label:i("contentType","Response media type")}),!o?.length&&a(ye,{selection:L}),a(xe,{exampleIds:o,selectedIdx:x,onSelect:z}),a(fe,{description:Q}),a(he,{payload:J,emptyMessage:G?`// ${i("noResponseExample","No response sample")}`:i("noResponseContent","No content"),mediaType:g})]})}export{Ne as ResponseExampleItem};
@@ -0,0 +1,9 @@
1
+ import type { ReactElement } from 'react';
2
+ /**
3
+ * Picks which OpenAPI `security` AND-group the generated code sample is built
4
+ * against. Renders nothing unless the operation declares more than one group —
5
+ * with a single group there is nothing to choose.
6
+ */
7
+ export declare function SecuritySchemeSelector({ requirements, }: {
8
+ requirements?: Array<Record<string, string[]>>;
9
+ }): ReactElement | null;
@@ -0,0 +1 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{useAtom as m}from"jotai";import{selectedSecuritySchemeIdxAtom as n}from"../../../jotai/app.js";import{PanelDropdownSelect as l}from"./selectors.js";import{MediaTypeRow as a}from"./styled.js";function h({requirements:e}){const[c,i]=m(n);return!e||e.length<=1?null:r(a,{children:r(l,{value:String(c),onChange:t=>i(Number(t)),"aria-label":"Security scheme",options:e.map((t,o)=>({key:String(o),value:String(o),label:Object.keys(t).join(" + ")||`Scheme ${o+1}`}))})})}export{h as SecuritySchemeSelector};