@redocly/openapi-docs 3.12.0-next.7 → 3.12.0-next.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/redocly-openapi-docs.min.js +7169 -7169
  2. package/lib/components/ApiInfo/ApiInfo.d.ts +1 -1
  3. package/lib/components/ApiInfo/ApiInfo.js +1 -1
  4. package/lib/components/ApiInfo/Metadata.d.ts +1 -1
  5. package/lib/components/ApiInfo/Metadata.js +1 -1
  6. package/lib/components/ApiInfo/styled.js +6 -6
  7. package/lib/components/CallbackSamples/CallbackSamples.d.ts +1 -1
  8. package/lib/components/CallbackSamples/CallbackSamples.js +1 -1
  9. package/lib/components/Callbacks/CallbackDetails.d.ts +1 -1
  10. package/lib/components/Callbacks/CallbackDetails.js +1 -1
  11. package/lib/components/Callbacks/CallbackSummary.d.ts +2 -1
  12. package/lib/components/Callbacks/CallbackSummary.js +2 -2
  13. package/lib/components/Callbacks/styled.js +1 -1
  14. package/lib/components/Content/useAutoScroll.js +1 -1
  15. package/lib/components/ContentItem/useIsExpanded.js +1 -1
  16. package/lib/components/ContentItems/VirtualList.js +1 -1
  17. package/lib/components/ContentItems/useScrollOnRender.js +1 -1
  18. package/lib/components/Discriminator/Discriminator.d.ts +1 -1
  19. package/lib/components/Download/DownloadSpecification.js +2 -2
  20. package/lib/components/ExpandAllButton/ExpandAllButton.js +2 -2
  21. package/lib/components/ExternalDocumentation/ExternalDocumentation.js +1 -1
  22. package/lib/components/Language/LanguageDropdown.js +1 -1
  23. package/lib/components/Language/LanguageItem.js +1 -1
  24. package/lib/components/Language/LanguageList.js +1 -1
  25. package/lib/components/Language/styled.js +9 -9
  26. package/lib/components/Markdown/Markdown.js +1 -1
  27. package/lib/components/OperationItem/OperationItem.js +3 -3
  28. package/lib/components/Overview/Overview.d.ts +1 -1
  29. package/lib/components/Overview/Overview.js +1 -1
  30. package/lib/components/PageFooter/PageFooter.js +1 -1
  31. package/lib/components/Panel/ResponsePanel.js +1 -1
  32. package/lib/components/PanelItem/styled.js +1 -1
  33. package/lib/components/PayloadSamples/ExampleValue.js +1 -1
  34. package/lib/components/PayloadSamples/styled.js +1 -1
  35. package/lib/components/PropertyDetails/Extensions.js +1 -1
  36. package/lib/components/PropertyDetails/FieldDetails.js +1 -1
  37. package/lib/components/PropertyDetails/styled.js +1 -1
  38. package/lib/components/PropertyDetails/types.d.ts +1 -1
  39. package/lib/components/RedoclyOpenAPIDocs/Providers.js +1 -1
  40. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
  41. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js +1 -1
  42. package/lib/components/RedoclyOpenAPIDocs/types.d.ts +2 -2
  43. package/lib/components/Replay/Replay.js +1 -1
  44. package/lib/components/Replay/utils.d.ts +1 -1
  45. package/lib/components/Replay/utils.js +1 -1
  46. package/lib/components/Request/types.d.ts +1 -1
  47. package/lib/components/RequestParameters/ParametersGroup.js +1 -1
  48. package/lib/components/RequestSamples/CodeSample.js +1 -1
  49. package/lib/components/RequestSamples/RequestSamples.js +1 -1
  50. package/lib/components/ResponseSamples/Summary.js +1 -1
  51. package/lib/components/RightPanel/RightPanel.js +1 -1
  52. package/lib/components/Schema/helpers.js +1 -1
  53. package/lib/components/SchemaDefinition/SchemaDefinition.js +1 -1
  54. package/lib/components/SectionContent/SectionContent.js +5 -5
  55. package/lib/components/SectionItem/SectionItem.d.ts +1 -1
  56. package/lib/components/SectionItem/SectionItem.js +1 -1
  57. package/lib/components/Security/OAuthScopes.js +1 -1
  58. package/lib/components/Security/Security.js +1 -1
  59. package/lib/components/Security/SecurityButton.js +2 -2
  60. package/lib/components/Security/SecurityModal.js +5 -5
  61. package/lib/components/ServerList/ServerList.js +1 -1
  62. package/lib/components/ServerList/types.d.ts +1 -1
  63. package/lib/components/ServerListDropdown/ServerListDropdown.js +1 -1
  64. package/lib/components/ServerListDropdown/styled.js +6 -6
  65. package/lib/components/SideMenu/SideMenu.js +1 -1
  66. package/lib/components/SideMenu/hooks/useMenuItems.js +1 -1
  67. package/lib/components/StickySidebar/SidebarActions.js +2 -2
  68. package/lib/components/StickySidebar/StickyResponsiveSidebar.js +3 -3
  69. package/lib/components/Tabs/Tabs.js +1 -1
  70. package/lib/components/Tabs/useTabsState.js +1 -1
  71. package/lib/components/TagItem/OperationNavigationItems.d.ts +1 -1
  72. package/lib/components/TagItem/OperationsNavigation.js +1 -1
  73. package/lib/components/TagItem/TagItem.js +7 -7
  74. package/lib/components/TagItem/styled.js +1 -1
  75. package/lib/components/ViewNested/ViewNested.js +1 -1
  76. package/lib/components/common/Badges.js +1 -1
  77. package/lib/components/common/BodyContent/BodyContent.js +1 -1
  78. package/lib/components/common/CodeBlockPanel.js +3 -3
  79. package/lib/components/common/Dropdown/Dropdown.d.ts +1 -1
  80. package/lib/components/common/Dropdown/Dropdown.js +4 -4
  81. package/lib/components/common/ExpandableExample/ExpandableExample.js +1 -1
  82. package/lib/components/common/Extensions.js +1 -1
  83. package/lib/components/common/Fields/fields-layout.js +1 -1
  84. package/lib/components/common/Fields/fields.js +1 -1
  85. package/lib/components/common/LinkToField.js +1 -1
  86. package/lib/components/common/OperationItemTitle.js +3 -3
  87. package/lib/components/common/SchemaSelection/SchemaSelection.d.ts +1 -1
  88. package/lib/components/common/SchemaSelection/SchemaSelection.js +1 -1
  89. package/lib/components/common/Select/styled.js +1 -1
  90. package/lib/components/common/Skeleton/Skeleton.js +1 -1
  91. package/lib/components/common/linkify.js +1 -1
  92. package/lib/components/common/panels.js +5 -5
  93. package/lib/components/common/styled.js +1 -1
  94. package/lib/hoc/types.d.ts +1 -1
  95. package/lib/hoc/withRouter.js +1 -1
  96. package/lib/hooks/usePerformanceMetrics.js +1 -1
  97. package/lib/hooks/useTelemetry.d.ts +1 -1
  98. package/lib/hooks/useTelemetry.js +1 -1
  99. package/lib/hooks/useTranslate.d.ts +1 -1
  100. package/lib/hooks/useTranslate.js +1 -1
  101. package/lib/jotai/app.d.ts +2 -2
  102. package/lib/jotai/app.js +1 -1
  103. package/lib/models/callback.d.ts +1 -1
  104. package/lib/models/operation.d.ts +1 -1
  105. package/lib/models/operation.js +1 -1
  106. package/lib/models/schema.js +1 -1
  107. package/lib/services/OpenAPIParser.js +1 -1
  108. package/lib/services/code-samples/generator.d.ts +1 -1
  109. package/lib/services/code-samples/generator.js +1 -1
  110. package/lib/services/code-samples/httpsnippet/targets/csharp/httpclient.js +1 -1
  111. package/lib/services/config-options/normalizeOptions.js +1 -1
  112. package/lib/services/config-options/types.d.ts +1 -1
  113. package/lib/services/menu/markdown.js +1 -1
  114. package/lib/services/utils.js +1 -1
  115. package/lib/utils/configure-helpers.d.ts +1 -1
  116. package/lib/utils/configure-helpers.js +1 -1
  117. package/lib/utils/helpers.js +2 -2
  118. package/lib/utils/loadAndBundleSpec.js +1 -1
  119. package/lib/utils/local-storage.js +1 -1
  120. package/lib/utils/openapi.js +1 -1
  121. package/lib/utils/saveTextBeforeHeading.js +1 -1
  122. package/lib/utils/security-details.js +1 -1
  123. package/lib/utils/session-storage.js +1 -1
  124. package/lib/utils/telemetry.js +1 -1
  125. package/package.json +2 -3
@@ -1,4 +1,4 @@
1
- import { LayoutVariant } from '@redocly/theme';
1
+ import { LayoutVariant } from '@redocly/config';
2
2
  import type { ReactElement } from 'react';
3
3
  import type { GroupModel } from '../../models/index.js';
4
4
  export declare function ApiInfo({ item, layout, }: {
@@ -1 +1 @@
1
- import{jsxs as r,jsx as e}from"react/jsx-runtime";import{useAtomValue as A}from"jotai";import{AfterOpenApiTitle as h,LayoutVariant as D}from"@redocly/theme";import{SamplesMiddlePanel as k,Row as M}from"../common/index.js";import{ExternalDocumentation as S}from"../ExternalDocumentation/index.js";import{Markdown as s}from"../Markdown/index.js";import{ApiHeader as T}from"./styled.js";import{globalStoreAtom as j}from"../../jotai/store.js";import{saveTextBeforeHeading as v}from"../../utils/saveTextBeforeHeading.js";import{getValueFromMdParsedExtension as m}from"../../utils/helpers.js";import{RenderHook as y}from"../RenderHook/index.js";import{Metadata as H}from"./Metadata.js";import{useTranslate as g}from"../../hooks/index.js";function N({item:l,layout:t}){const d=g(),{options:{unstable_hooks:p,hideInfoMetadata:c},parser:{definition:f}}=A(j),o=l.infoDefinition;if(!o)return null;const i=v(m(o,"description")||""),n=m(o,"summary")||void 0,a=f?.externalDocs||o?.externalDocs,u=o.version&&r("span",{children:["(",o.version,")"]})||null,x=t===D.STACKED;return e(M,{layout:t,children:r(k,{fullWidth:!0,className:"api-info",isStacked:x,children:[r(T,{children:[o.title," ",u]}),e(y,{Hook:h||p?.AfterApiTitle,props:{info:o}}),n&&e(s,{source:n,"data-role":"redoc-summary"}),i&&e(s,{source:i,"data-role":"redoc-description"}),a&&e(S,{externalDocs:a}),!c&&e(H,{metadata:o["x-metadata"],translate:d})]})})}export{N as ApiInfo};
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useAtomValue as A}from"jotai";import{LayoutVariant as h}from"@redocly/config";import{AfterOpenApiTitle as D}from"@redocly/theme/components/OpenApiDocs/hooks/AfterOpenApiTitle";import{SamplesMiddlePanel as k,Row as M}from"../common/index.js";import{ExternalDocumentation as S}from"../ExternalDocumentation/index.js";import{Markdown as s}from"../Markdown/index.js";import{ApiHeader as T}from"./styled.js";import{globalStoreAtom as j}from"../../jotai/store.js";import{saveTextBeforeHeading as v}from"../../utils/saveTextBeforeHeading.js";import{getValueFromMdParsedExtension as m}from"../../utils/helpers.js";import{RenderHook as y}from"../RenderHook/index.js";import{Metadata as H}from"./Metadata.js";import{useTranslate as g}from"../../hooks/index.js";function O({item:l,layout:t}){const d=g(),{options:{unstable_hooks:p,hideInfoMetadata:c},parser:{definition:f}}=A(j),o=l.infoDefinition;if(!o)return null;const i=v(m(o,"description")||""),n=m(o,"summary")||void 0,a=f?.externalDocs||o?.externalDocs,u=o.version&&e("span",{children:["(",o.version,")"]})||null,x=t===h.STACKED;return r(M,{layout:t,children:e(k,{fullWidth:!0,className:"api-info",isStacked:x,children:[e(T,{children:[o.title," ",u]}),r(y,{Hook:D||p?.AfterApiTitle,props:{info:o}}),n&&r(s,{source:n,"data-role":"redoc-summary"}),i&&r(s,{source:i,"data-role":"redoc-description"}),a&&r(S,{externalDocs:a}),!c&&r(H,{metadata:o["x-metadata"],translate:d})]})})}export{O as ApiInfo};
@@ -1,4 +1,4 @@
1
- import type { TFunction } from '@redocly/theme';
1
+ import type { TFunction } from '@redocly/theme/core/openapi';
2
2
  import type { ReactElement } from 'react';
3
3
  import type { OpenAPIInfo } from '../../types/index.js';
4
4
  interface MetadataProps {
@@ -1 +1 @@
1
- import{jsx as t,jsxs as i}from"react/jsx-runtime";import{useMemo as c}from"react";import{Markdown as d,H3 as a,isNotNull as p}from"@redocly/theme";const s=["title","description"];function f([r,e]){return s.includes(r)?null:Array.isArray(e)?{key:r,value:e.filter(n=>typeof n!="object").join(", ")}:typeof e=="object"?null:{key:r,value:e}}function j({metadata:r,translate:e}){const n=c(()=>Object.entries(r||{}).map(f).filter(p),[r]);return r?i(d,{children:[t(a,{children:e("openapi.info.metadata.title","Metadata")}),i("table",{className:"md",children:[t("thead",{children:i("tr",{children:[t("th",{scope:"col",children:e("openapi.key","Key")}),t("th",{scope:"col",children:e("openapi.value","Value")})]})}),t("tbody",{children:n.map(({key:o,value:l})=>i("tr",{children:[t("td",{children:o}),t("td",{children:`${l}`})]},o))})]})]}):null}export{j as Metadata};
1
+ import{jsx as t,jsxs as i}from"react/jsx-runtime";import{useMemo as c}from"react";import{Markdown as d}from"@redocly/theme/components/Markdown/Markdown";import{H3 as a}from"@redocly/theme/components/Typography/H3";import{isNotNull as p}from"@redocly/theme/core/openapi";const s=["title","description"];function f([e,r]){return s.includes(e)?null:Array.isArray(r)?{key:e,value:r.filter(n=>typeof n!="object").join(", ")}:typeof r=="object"?null:{key:e,value:r}}function b({metadata:e,translate:r}){const n=c(()=>Object.entries(e||{}).map(f).filter(p),[e]);return e?i(d,{children:[t(a,{children:r("openapi.info.metadata.title","Metadata")}),i("table",{className:"md",children:[t("thead",{children:i("tr",{children:[t("th",{scope:"col",children:r("openapi.key","Key")}),t("th",{scope:"col",children:r("openapi.value","Value")})]})}),t("tbody",{children:n.map(({key:o,value:l})=>i("tr",{children:[t("td",{children:o}),t("td",{children:`${l}`})]},o))})]})]}):null}export{b as Metadata};
@@ -1,10 +1,10 @@
1
- import{H1 as n,Markdown as e}from"@redocly/theme";import{styled as o}from"../../styled-components.js";const t=15,i=o(n)`
1
+ import{H1 as n}from"@redocly/theme/components/Typography/H1";import{Markdown as r}from"@redocly/theme/components/Markdown/Markdown";import{styled as o}from"../../styled-components.js";const t=15,p=o(n)`
2
2
  margin-top: 0;
3
3
  margin-bottom: 0;
4
- & + ${e} {
4
+ & + ${r} {
5
5
  margin-top: var(--h1-margin-bottom);
6
6
  }
7
- `,p=o.span`
7
+ `,d=o.span`
8
8
  &::before {
9
9
  content: '|';
10
10
  display: inline-block;
@@ -16,11 +16,11 @@ import{H1 as n,Markdown as e}from"@redocly/theme";import{styled as o}from"../../
16
16
  &:last-child::after {
17
17
  display: none;
18
18
  }
19
- `,d=o.div`
20
- overflow: hidden;
21
19
  `,l=o.div`
20
+ overflow: hidden;
21
+ `,m=o.div`
22
22
  display: flex;
23
23
  flex-wrap: wrap;
24
24
  // hide separator on new lines: idea from https://stackoverflow.com/a/31732902/1749888
25
25
  margin-left: -${t}px;
26
- `;export{i as ApiHeader,p as InfoSpan,l as InfoSpanBox,d as InfoSpanBoxWrap};
26
+ `;export{p as ApiHeader,d as InfoSpan,m as InfoSpanBox,l as InfoSpanBoxWrap};
@@ -1,4 +1,4 @@
1
- import type { TFunction } from '@redocly/theme';
1
+ import type { TFunction } from '@redocly/theme/core/openapi';
2
2
  import type { OperationModel } from '../../models';
3
3
  export interface CallbackSamplesProps {
4
4
  callback: OperationModel;
@@ -1,4 +1,4 @@
1
- import{jsx as r,jsxs as n}from"react/jsx-runtime";import{memo as t}from"react";import{PanelHeader as s}from"@redocly/theme";import{PayloadSamples as l}from"../PayloadSamples/index.js";import{ServerListDropdown as d}from"../ServerListDropdown/index.js";import{CodeBlockPanel as i}from"../common/index.js";import{styled as o}from"../../styled-components.js";function p({callback:e,translate:a}){return e?.hasSamples?r(i,{className:"panel-callback-samples",header:()=>n(c,{isExpandable:!1,children:[r(f,{operation:e}),r(m,{children:a("openapi.payload","Payload")})]}),isExpandable:!1,children:e?.payload?.requestBodyContent&&r(l,{content:e.payload.requestBodyContent})}):null}const C=t(p),m=o.div`
1
+ import{jsx as r,jsxs as n}from"react/jsx-runtime";import{memo as t}from"react";import{PanelHeader as s}from"@redocly/theme/components/Panel/PanelHeader";import{PayloadSamples as l}from"../PayloadSamples/index.js";import{ServerListDropdown as d}from"../ServerListDropdown/index.js";import{CodeBlockPanel as i}from"../common/index.js";import{styled as o}from"../../styled-components.js";function p({callback:e,translate:a}){return e?.hasSamples?r(i,{className:"panel-callback-samples",header:()=>n(c,{isExpandable:!1,children:[r(f,{operation:e}),r(m,{children:a("openapi.payload","Payload")})]}),isExpandable:!1,children:e?.payload?.requestBodyContent&&r(l,{content:e.payload.requestBodyContent})}):null}const C=t(p),m=o.div`
2
2
  font-size: var(--font-size-sm);
3
3
  font-style: normal;
4
4
  font-weight: var(--font-weight-regular);
@@ -1,4 +1,4 @@
1
- import type { TFunction } from '@redocly/theme';
1
+ import type { TFunction } from '@redocly/theme/core/openapi';
2
2
  import type { OperationModel } from '../../models/index.js';
3
3
  export interface CallbackDetailsProps {
4
4
  operation: OperationModel;
@@ -1,4 +1,4 @@
1
- import{jsx as l,jsxs as s,Fragment as t}from"react/jsx-runtime";import{memo as r,useCallback as m}from"react";import{LinkIcon as p}from"@redocly/theme";import{OperationResponseList as d}from"../Responses/index.js";import{RequestDetails as k}from"../Request/RequestDetails.js";import{LinkToField as a}from"../common/LinkToField.js";import{makeDeepLink as c}from"../../services/index.js";import{styled as b}from"../../styled-components.js";function f({operation:e,translate:i}){const n=m(o=>s(h,{children:[l(a,{to:c(e.id,`${e.callbackId}/callback-response&c=${o.key}`)}),i("openapi.callbackResponse","Callback Response")]}),[e.callbackId,e.id,i]);return s(t,{children:[l(k,{operation:e,title:s(t,{children:[l(a,{to:c(e.id,`${e.callbackId}/callback-request`)}),i("openapi.callbackRequest","Callback Request")]})}),e.responses?.length?l(d,{responses:e.responses,operationId:e.id,operationPointer:e.pointer,callbackId:e.callbackId,renderTitle:n}):null]})}const j=r(f),h=b.h4`
1
+ import{jsx as l,jsxs as s,Fragment as t}from"react/jsx-runtime";import{memo as r,useCallback as m}from"react";import{LinkIcon as p}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{OperationResponseList as d}from"../Responses/index.js";import{RequestDetails as k}from"../Request/RequestDetails.js";import{LinkToField as a}from"../common/LinkToField.js";import{makeDeepLink as c}from"../../services/index.js";import{styled as b}from"../../styled-components.js";function f({operation:e,translate:i}){const n=m(o=>s(h,{children:[l(a,{to:c(e.id,`${e.callbackId}/callback-response&c=${o.key}`)}),i("openapi.callbackResponse","Callback Response")]}),[e.callbackId,e.id,i]);return s(t,{children:[l(k,{operation:e,title:s(t,{children:[l(a,{to:c(e.id,`${e.callbackId}/callback-request`)}),i("openapi.callbackRequest","Callback Request")]})}),e.responses?.length?l(d,{responses:e.responses,operationId:e.id,operationPointer:e.pointer,callbackId:e.callbackId,renderTitle:n}):null]})}const j=r(f),h=b.h4`
2
2
  position: relative;
3
3
  font-size: var(--font-size-lg);
4
4
  font-weight: var(--h4-font-weight);
@@ -1,6 +1,7 @@
1
1
  import type { ReactElement } from 'react';
2
- import type { PanelHeaderProps, TFunction } from '@redocly/theme';
2
+ import type { TFunction } from '@redocly/theme/core/openapi';
3
3
  import type { OperationModel } from '../../models/index.js';
4
+ import { type PanelHeaderProps } from '@redocly/theme/components/Panel/PanelHeader';
4
5
  export interface CallbackTitleProps extends PanelHeaderProps {
5
6
  callback: OperationModel;
6
7
  translate: TFunction;
@@ -1,4 +1,4 @@
1
- import{jsx as r,jsxs as o}from"react/jsx-runtime";import{PanelHeader as p,Badge as d}from"@redocly/theme";import{Trigger as f}from"../Panel/index.js";import{HttpVerb as g}from"../common/index.js";import{makeDeepLink as b}from"../../services/index.js";import{shortenHTTPVerb as h}from"../../utils/index.js";import{CallbackTitle as k}from"./styled.js";import{CircleIcon as v}from"../PropertyDetails/PlusCircleIcon.js";import{LinkToField as u}from"../common/LinkToField.js";import{styled as n}from"../../styled-components.js";function B({expanded:e=!1,toggle:t,callback:{name:l,httpVerb:a,deprecated:i,callbackId:c,id:s},translate:m}){return o(x,{expanded:e,onClick:t,children:[r(u,{to:b(s,`callbacks/${c}`)}),o(f,{children:[r(y,{children:r(v,{sign:e?"-":"+"})}),r(k,{deprecated:i,children:l}),r(g,{color:a,children:h(a)}),i?r(d,{deprecated:!0,children:m("openapi.badges.deprecated","Deprecated")}):null]})]})}const x=n(p)`
1
+ import{jsx as r,jsxs as o}from"react/jsx-runtime";import{PanelHeader as p}from"@redocly/theme/components/Panel/PanelHeader";import{Badge as d}from"@redocly/theme/components/Badge/Badge";import{Trigger as f}from"../Panel/index.js";import{HttpVerb as g}from"../common/index.js";import{makeDeepLink as b}from"../../services/index.js";import{shortenHTTPVerb as h}from"../../utils/index.js";import{CallbackTitle as k}from"./styled.js";import{CircleIcon as v}from"../PropertyDetails/PlusCircleIcon.js";import{LinkToField as u}from"../common/LinkToField.js";import{styled as n}from"../../styled-components.js";function F({expanded:e=!1,toggle:t,callback:{name:l,httpVerb:i,deprecated:a,callbackId:c,id:s},translate:m}){return o(x,{expanded:e,onClick:t,children:[r(u,{to:b(s,`callbacks/${c}`)}),o(f,{children:[r(y,{children:r(v,{sign:e?"-":"+"})}),r(k,{deprecated:a,children:l}),r(g,{color:i,children:h(i)}),a?r(d,{deprecated:!0,children:m("openapi.badges.deprecated","Deprecated")}):null]})]})}const x=n(p)`
2
2
  padding: var(--spacing-sm) 0 var(--spacing-sm) calc(var(--spacing-unit) / 2);
3
3
  margin: 0;
4
4
  line-height: var(--line-height-base);
@@ -15,4 +15,4 @@ import{jsx as r,jsxs as o}from"react/jsx-runtime";import{PanelHeader as p,Badge
15
15
  font-size: var(--font-size-base);
16
16
  font-family: var(--font-family-base);
17
17
  line-height: var(--line-height-base);
18
- `;export{B as CallbackSummary};
18
+ `;export{F as CallbackSummary};
@@ -1,4 +1,4 @@
1
- import{PanelHeaderTitle as t}from"@redocly/theme";import{styled as o}from"../../styled-components.js";const a=o(t)`
1
+ import{PanelHeaderTitle as t}from"@redocly/theme/components/Panel/PanelHeaderTitle";import{styled as o}from"../../styled-components.js";const a=o(t)`
2
2
  text-decoration: ${({deprecated:e})=>e?"line-through":"none"};
3
3
  margin: 0 4px;
4
4
  vertical-align: middle;
@@ -1 +1 @@
1
- import{useLocation as p}from"react-router-dom";import{useEffect as i}from"react";import{addLeadingSlash as u,IS_BROWSER as m,useActiveSectionId as f,removeLeadingSlash as l}from"@redocly/theme";import{compose as h,encodeBackSlashes as w,tryDecodeURIComponent as S}from"../../utils/index.js";let d=!0;function E(t){const e=p(),o=t||"/";i(()=>{if(e.pathname===o&&e.hash===""){window.scrollTo(0,0);return}const a=l(e.pathname.replace(o,"")),r=g(e.hash),s=r?c(a+r)||document.querySelector(`[id$="${l(r)}"]`):c(e.hash.replace("#","").toLowerCase())||c(a);s&&s.scrollIntoView()},[e,o]);const n=f(e,!1,!1);i(()=>{if(n&&d){d=!1;return}if(m&&!window.location.pathname.includes(n)&&!window.location.hash.includes(n)){const a=h(u,w)(n);window.history.replaceState({},"",a)}},[n])}function c(t){return document.getElementById(S(t))}function g(t){const e=["#tag","#operation","#paths"];for(const o of e)if(t.includes(o))return t.replace(o,"").toLowerCase();return""}export{c as getElementById,g as getLegacyHash,E as useAutoScroll};
1
+ import{useLocation as p}from"react-router-dom";import{useEffect as i}from"react";import{addLeadingSlash as u,removeLeadingSlash as l,useActiveSectionId as m,IS_BROWSER as f}from"@redocly/theme/core/openapi";import{compose as h,encodeBackSlashes as w,tryDecodeURIComponent as S}from"../../utils/index.js";let d=!0;function E(t){const e=p(),o=t||"/";i(()=>{if(e.pathname===o&&e.hash===""){window.scrollTo(0,0);return}const a=l(e.pathname.replace(o,"")),r=g(e.hash),s=r?c(a+r)||document.querySelector(`[id$="${l(r)}"]`):c(e.hash.replace("#","").toLowerCase())||c(a);s&&s.scrollIntoView()},[e,o]);const n=m(e,!1,!1);i(()=>{if(n&&d){d=!1;return}if(f&&!window.location.pathname.includes(n)&&!window.location.hash.includes(n)){const a=h(u,w)(n);window.history.replaceState({},"",a)}},[n])}function c(t){return document.getElementById(S(t))}function g(t){const e=["#tag","#operation","#paths"];for(const o of e)if(t.includes(o))return t.replace(o,"").toLowerCase();return""}export{c as getElementById,g as getLegacyHash,E as useAutoScroll};
@@ -1 +1 @@
1
- import{useMemo as a}from"react";import{useLocation as f}from"react-router-dom";import{removeLeadingSlash as h}from"@redocly/theme";import{tryDecodeURIComponent as m,normalizePath as l}from"../../utils/index.js";import{getLegacyHash as d}from"../Content/useAutoScroll.js";function v({item:o,routingBasePath:s}){const n=f(),c=a(()=>m(l(n.pathname.replace(s,""))),[n.pathname,s]),p=a(()=>{const e=[],t=i=>{i.forEach(r=>{e.push(r),r.items?.length&&t(r.items)})};return t([o]),e},[o]);return o.type!=="tag"?!1:p.map(e=>e.href).some(e=>{const t=d(n.hash);return[e,m(e)].includes(c)||t&&(e.endsWith(t)||e===h(t))})}export{v as useIsExpanded};
1
+ import{useMemo as a}from"react";import{useLocation as f}from"react-router-dom";import{removeLeadingSlash as h}from"@redocly/theme/core/openapi";import{tryDecodeURIComponent as m,normalizePath as l}from"../../utils/index.js";import{getLegacyHash as d}from"../Content/useAutoScroll.js";function v({item:o,routingBasePath:s}){const n=f(),c=a(()=>m(l(n.pathname.replace(s,""))),[n.pathname,s]),p=a(()=>{const e=[],t=i=>{i.forEach(r=>{e.push(r),r.items?.length&&t(r.items)})};return t([o]),e},[o]);return o.type!=="tag"?!1:p.map(e=>e.href).some(e=>{const t=d(n.hash);return[e,m(e)].includes(c)||t&&(e.endsWith(t)||e===h(t))})}export{v as useIsExpanded};
@@ -1 +1 @@
1
- import{Fragment as f,jsx as h}from"react/jsx-runtime";import{useCallback as g,memo as M,useEffect as _,useState as x,useMemo as E}from"react";import{useLocation as S}from"react-router-dom";import{removeLeadingSlash as r}from"@redocly/theme";const T=3,a=1,b=1e3,F=({items:e=[],renderItem:c,routingBasePath:i})=>{const m=i||"/",u=S(),l=r(u.pathname.replace(m,"")),s=E(()=>{const n=new Map(e.map((t,o)=>[r(t.href),o]));return t=>t?n.get(t):void 0},[e]),I=g(n=>{const t=s(n),o=Math.max(0,t?t-a:0),L=Math.min(e.length,t?t+a+1:T);return{start:o,end:L}},[s,e.length]),[p,d]=x(()=>{const{start:n,end:t}=I(l);return e.slice(n,t)});return _(()=>{const n=setTimeout(()=>{d(e)},b);return()=>clearTimeout(n)},[e]),h(f,{children:p.map(c)})},B=M(F);export{B as VirtualList};
1
+ import{Fragment as f,jsx as h}from"react/jsx-runtime";import{useCallback as g,memo as M,useEffect as _,useState as x,useMemo as E}from"react";import{useLocation as S}from"react-router-dom";import{removeLeadingSlash as r}from"@redocly/theme/core/openapi";const T=3,a=1,b=1e3,F=({items:e=[],renderItem:c,routingBasePath:i})=>{const m=i||"/",u=S(),l=r(u.pathname.replace(m,"")),s=E(()=>{const n=new Map(e.map((t,o)=>[r(t.href),o]));return t=>t?n.get(t):void 0},[e]),I=g(n=>{const t=s(n),o=Math.max(0,t?t-a:0),L=Math.min(e.length,t?t+a+1:T);return{start:o,end:L}},[s,e.length]),[p,d]=x(()=>{const{start:n,end:t}=I(l);return e.slice(n,t)});return _(()=>{const n=setTimeout(()=>{d(e)},b);return()=>clearTimeout(n)},[e]),h(f,{children:p.map(c)})},B=M(F);export{B as VirtualList};
@@ -1 +1 @@
1
- import{useEffect as l,useRef as i}from"react";import{useLocation as s}from"react-router-dom";import{removeLeadingSlash as n}from"@redocly/theme";import{getElementById as a}from"../Content/useAutoScroll.js";function m(r,c){const e=i(null),o=s(),f=n(o.pathname.replace(c,""));return l(()=>{if(e.current&&r.href&&n(r.href)===f&&(typeof e?.current?.scrollIntoView=="function"&&e.current.scrollIntoView(),o.hash)){const t=a(o.hash.replace("#","").toLowerCase());t&&t.scrollIntoView()}},[]),e}var w=m;export{w as default};
1
+ import{useEffect as l,useRef as i}from"react";import{useLocation as s}from"react-router-dom";import{removeLeadingSlash as n}from"@redocly/theme/core/openapi";import{getElementById as a}from"../Content/useAutoScroll.js";function m(r,c){const e=i(null),o=s(),f=n(o.pathname.replace(c,""));return l(()=>{if(e.current&&r.href&&n(r.href)===f&&(typeof e?.current?.scrollIntoView=="function"&&e.current.scrollIntoView(),o.hash)){const t=a(o.hash.replace("#","").toLowerCase());t&&t.scrollIntoView()}},[]),e}var w=m;export{w as default};
@@ -1,4 +1,4 @@
1
- import type { TFunction } from '@redocly/theme';
1
+ import type { TFunction } from '@redocly/theme/core/openapi';
2
2
  import type { SchemaModel } from '../../models/index.js';
3
3
  interface DiscriminatorDropdownProps {
4
4
  activeOneOfIdx: number;
@@ -1,4 +1,4 @@
1
- import{jsx as o,Fragment as p,jsxs as s}from"react/jsx-runtime";import{memo as f,useCallback as w}from"react";import{useAtomValue as x}from"jotai";import{DownloadIcon as b,DocumentIcon as u,JsonIcon as g,Button as h,FileIcon as y,getPathPrefix as v,combineUrls as j}from"@redocly/theme";import{useDownloadInfo as k}from"./useDownloadInfo.js";import{globalStoreAtom as _}from"../../jotai/store.js";import{useTelemetry as I}from"../../hooks/index.js";import{styled as r}from"../../styled-components.js";function D(){const l=I(),{options:c}=x(_),n=v(),t=k({downloadUrls:c.downloadUrls}),d=w(e=>{switch(e){case"yaml":return o(u,{});case"json":return o(g,{});default:return o(y,{})}},[]);return t?o(U,{children:(t||[]).map(({title:e,url:a,iconType:m})=>{const i=n?j(n,a):a;return s(C,{onClick:()=>l.send({type:"openapi_docs.download_definition.clicked"}),children:[s(F,{children:[d(m),o("a",{href:i,target:"_blank",download:!0,rel:"noreferrer",children:e})]}),o("a",{href:i,target:"_blank",download:!0,rel:"noreferrer",children:o(h,{variant:"text",size:"small",icon:o(b,{})})})]},e)})}):o(p,{})}const T=f(D),C=r.div`
1
+ import{jsx as o,Fragment as p,jsxs as s}from"react/jsx-runtime";import{memo as f,useCallback as w}from"react";import{useAtomValue as x}from"jotai";import{DownloadIcon as b}from"@redocly/theme/icons/DownloadIcon/DownloadIcon";import{getPathPrefix as u,combineUrls as g}from"@redocly/theme/core/openapi";import{Button as h}from"@redocly/theme/components/Button/Button";import{DocumentIcon as y}from"@redocly/theme/icons/DocumentIcon/DocumentIcon";import{JsonIcon as v}from"@redocly/theme/icons/JsonIcon/JsonIcon";import{FileIcon as j}from"@redocly/theme/icons/FileIcon/FileIcon";import{useDownloadInfo as k}from"./useDownloadInfo.js";import{globalStoreAtom as _}from"../../jotai/store.js";import{useTelemetry as I}from"../../hooks/index.js";import{styled as r}from"../../styled-components.js";function D(){const l=I(),{options:c}=x(_),t=u(),n=k({downloadUrls:c.downloadUrls}),d=w(e=>{switch(e){case"yaml":return o(y,{});case"json":return o(v,{});default:return o(j,{})}},[]);return n?o(U,{children:(n||[]).map(({title:e,url:a,iconType:m})=>{const i=t?g(t,a):a;return s(C,{onClick:()=>l.send({type:"openapi_docs.download_definition.clicked"}),children:[s(F,{children:[d(m),o("a",{href:i,target:"_blank",download:!0,rel:"noreferrer",children:e})]}),o("a",{href:i,target:"_blank",download:!0,rel:"noreferrer",children:o(h,{variant:"text",size:"small",icon:o(b,{})})})]},e)})}):o(p,{})}const G=f(D),C=r.div`
2
2
  display: flex;
3
3
  align-items: baseline;
4
4
  justify-content: space-between;
@@ -36,4 +36,4 @@ import{jsx as o,Fragment as p,jsxs as s}from"react/jsx-runtime";import{memo as f
36
36
  flex-direction: column;
37
37
  gap: var(--spacing-sm);
38
38
  font-size: var(--font-size-base);
39
- `;export{T as DownloadSpecification};
39
+ `;export{G as DownloadSpecification};
@@ -1,3 +1,3 @@
1
- import{jsx as n}from"react/jsx-runtime";import{Button as d,MaximizeIcon as m}from"@redocly/theme";import{useAtom as c}from"jotai";import{operationStore as x}from"../../jotai/operation.js";import{useTelemetry as u,useTranslate as f}from"../../hooks/index.js";import{styled as A}from"../../styled-components.js";const j=({operationPointer:a,type:e,onPanelToggle:s})=>{const t=f(),[l,r]=c(x(a)),p=u(),i=()=>{const o=!l[e].expandedAll;p.send({type:"openapi_docs.expand_collapse_all.clicked",payload:{is_expanded:o}}),r({[e]:{expandedAll:o}}),s?.(o,e==="request"?"request":"responses")};return n(g,{icon:n(m,{}),iconPosition:"right",size:"small",variant:"ghost",onClick:i,children:l[e].expandedAll?t("openapi.collapseAll","Collapse all"):t("openapi.expandAll","Expand all")})},g=A(d)`
1
+ import{jsx as n}from"react/jsx-runtime";import{useAtom as d}from"jotai";import{MaximizeIcon as m}from"@redocly/theme/icons/MaximizeIcon/MaximizeIcon";import{Button as c}from"@redocly/theme/components/Button/Button";import{operationStore as x}from"../../jotai/operation.js";import{useTelemetry as u,useTranslate as f}from"../../hooks/index.js";import{styled as A}from"../../styled-components.js";const k=({operationPointer:a,type:e,onPanelToggle:r})=>{const t=f(),[l,s]=d(x(a)),p=u(),i=()=>{const o=!l[e].expandedAll;p.send({type:"openapi_docs.expand_collapse_all.clicked",payload:{is_expanded:o}}),s({[e]:{expandedAll:o}}),r?.(o,e==="request"?"request":"responses")};return n(g,{icon:n(m,{}),iconPosition:"right",size:"small",variant:"ghost",onClick:i,children:l[e].expandedAll?t("openapi.collapseAll","Collapse all"):t("openapi.expandAll","Expand all")})},g=A(c)`
2
2
  margin-left: auto;
3
- `;export{j as ExpandAllButton};
3
+ `;export{k as ExpandAllButton};
@@ -1,4 +1,4 @@
1
- import{jsx as n}from"react/jsx-runtime";import{memo as i}from"react";import{markdownLinksCss as m}from"@redocly/theme";import{normalizeText as a}from"../../utils/index.js";import{styled as e}from"../../styled-components.js";const l=e.div`
1
+ import{jsx as n}from"react/jsx-runtime";import{memo as i}from"react";import{markdownLinksCss as m}from"@redocly/theme/components/Markdown/styles/links";import{normalizeText as a}from"../../utils/index.js";import{styled as e}from"../../styled-components.js";const l=e.div`
2
2
  ${m};
3
3
  ${({compact:r})=>r?"":"margin: var(--spacing-sm) 0 0"}
4
4
  `;function p({externalDocs:r,compact:o}){if(!r||!r.url)return null;const t=a(r.description);return n(l,{compact:o,"data-testid":"external-documentation",children:n("a",{href:r.url,target:"_blank",rel:"noreferrer","aria-label":t||r.url,children:t||r.url})})}const k=i(p);export{k as ExternalDocumentation};
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import{useCallback as h,useMemo as s}from"react";import{Dropdown as k,DropdownMenu as y}from"@redocly/theme";import{LanguageItem as D}from"./LanguageItem.js";import{DropdownTriggerButton as x,StyledDropdownMenuItem as A}from"./styled.js";const v=({samples:o,activeTab:t,onChange:e,trigger:l,width:i,withArrow:f=!0,withCheckmark:d=!0,withIcon:c=!0})=>{const g=h(r=>()=>{const p=o.find(({key:a})=>a===r.key);p&&e(p.key)},[e,o]),m=s(()=>o.map(r=>n(A,{$width:i,onAction:g(r),children:n(D,{item:r,active:t===r.key,withCheckmark:d,withIcon:c})},r.key)),[t,g,o,i,d,c]),w=o.find(({key:r})=>r===t),u=l||n(x,{variant:"ghost",children:w?.title});return m.length>1?n(k,{trigger:u,withArrow:f,alignment:"end",children:n(y,{children:m})}):u};export{v as LanguageDropdown};
1
+ import{jsx as t}from"react/jsx-runtime";import{useCallback as h,useMemo as s}from"react";import{Dropdown as k}from"@redocly/theme/components/Dropdown/Dropdown";import{DropdownMenu as y}from"@redocly/theme/components/Dropdown/DropdownMenu";import{LanguageItem as D}from"./LanguageItem.js";import{DropdownTriggerButton as x,StyledDropdownMenuItem as A}from"./styled.js";const B=({samples:o,activeTab:n,onChange:e,trigger:l,width:i,withArrow:f=!0,withCheckmark:d=!0,withIcon:c=!0})=>{const m=h(r=>()=>{const u=o.find(({key:a})=>a===r.key);u&&e(u.key)},[e,o]),g=s(()=>o.map(r=>t(A,{$width:i,onAction:m(r),children:t(D,{item:r,active:n===r.key,withCheckmark:d,withIcon:c})},r.key)),[n,m,o,i,d,c]),w=o.find(({key:r})=>r===n),p=l||t(x,{variant:"ghost",children:w?.title});return g.length>1?t(k,{trigger:p,withArrow:f,alignment:"end",children:t(y,{children:g})}):p};export{B as LanguageDropdown};
@@ -1 +1 @@
1
- import{jsx as o,jsxs as a,Fragment as e}from"react/jsx-runtime";import{CheckmarkIcon as p}from"@redocly/theme";import{CurlIcon as f}from"../../icons/CurlIcon/index.js";import{CSharpIcon as n}from"../../icons/CSharpIcon/index.js";import{NodeJSIcon as l}from"../../icons/NodeJSIcon/index.js";import{JavaScriptIcon as I}from"../../icons/JavaScriptIcon/index.js";import{PythonIcon as s}from"../../icons/PythonIcon/index.js";import{RIcon as g}from"../../icons/RIcon/index.js";import{RubyIcon as h}from"../../icons/RubyIcon/index.js";import{PHPIcon as u}from"../../icons/PHPIcon/index.js";import{GOIcon as d}from"../../icons/GOIcon/index.js";import{JavaIcon as m}from"../../icons/JavaIcon/index.js";import{PayloadIcon as P}from"../../icons/PayloadIcon/index.js";import{LanguageIcon as y,LanguageTitle as C,LanguageTitleContainer as J}from"./styled.js";const j={Payload:o(P,{}),curl:o(f,{}),"C#":o(n,{}),"C#+Newtonsoft":o(n,{}),"Node.js":o(l,{}),JavaScript:o(I,{}),Python:o(s,{}),R:o(g,{}),Ruby:o(h,{}),PHP:o(u,{}),Go:o(d,{}),Java:o(m,{}),"Java8+Apache":o(m,{})},A=({item:r,active:t,withCheckmark:c,withIcon:i})=>a(e,{children:[a(J,{children:[i&&o(y,{children:j[r.lang]}),o(C,{active:t,title:r.title,children:r.title})]}),c&&t&&o(p,{})]});export{A as LanguageItem};
1
+ import{jsx as o,jsxs as a,Fragment as e}from"react/jsx-runtime";import{CheckmarkIcon as p}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon";import{CurlIcon as f}from"../../icons/CurlIcon/index.js";import{CSharpIcon as n}from"../../icons/CSharpIcon/index.js";import{NodeJSIcon as l}from"../../icons/NodeJSIcon/index.js";import{JavaScriptIcon as I}from"../../icons/JavaScriptIcon/index.js";import{PythonIcon as s}from"../../icons/PythonIcon/index.js";import{RIcon as g}from"../../icons/RIcon/index.js";import{RubyIcon as h}from"../../icons/RubyIcon/index.js";import{PHPIcon as u}from"../../icons/PHPIcon/index.js";import{GOIcon as d}from"../../icons/GOIcon/index.js";import{JavaIcon as m}from"../../icons/JavaIcon/index.js";import{PayloadIcon as P}from"../../icons/PayloadIcon/index.js";import{LanguageIcon as y,LanguageTitle as C,LanguageTitleContainer as J}from"./styled.js";const j={Payload:o(P,{}),curl:o(f,{}),"C#":o(n,{}),"C#+Newtonsoft":o(n,{}),"Node.js":o(l,{}),JavaScript:o(I,{}),Python:o(s,{}),R:o(g,{}),Ruby:o(h,{}),PHP:o(u,{}),Go:o(d,{}),Java:o(m,{}),"Java8+Apache":o(m,{})},A=({item:r,active:t,withCheckmark:c,withIcon:i})=>a(e,{children:[a(J,{children:[i&&o(y,{children:j[r.lang]}),o(C,{active:t,title:r.title,children:r.title})]}),c&&t&&o(p,{})]});export{A as LanguageItem};
@@ -1 +1 @@
1
- import{jsx as a,jsxs as I}from"react/jsx-runtime";import{useLayoutEffect as T,useRef as A,useState as y,useCallback as _,memo as j,useMemo as E}from"react";import{useAtomValue as H,useSetAtom as S}from"jotai";import{Button as V,OverflowMenuVerticalIcon as W}from"@redocly/theme";import{LanguageDropdown as v}from"./LanguageDropdown.js";import{languageAtom as D,layoutAtom as R}from"../../jotai/app.js";import{LanguageListContainer as M,LanguageListItem as O,Container as z}from"./styled.js";import{LanguageItem as G}from"./LanguageItem.js";import{DROPDOWN_TRIGGER_WIDTH as B,ITEM_WIDTH as L}from"./constants.js";import{LanguageListSkeleton as N}from"../common/Skeleton/LanguageListSkeleton.js";import{useTelemetry as P}from"../../hooks/index.js";function $({languages:o,activeLanguage:t}){const[n,i]=y([]),[s,l]=y([]),u=P(),d=A(null),f=H(R),h=S(D),p=e=>{u.send({type:"openapi_docs.select_language.clicked",payload:{language:e}})},k=e=>{h(e),p(e)},x=e=>{const c=s.findIndex(r=>r.key===e);if(c!==-1){const r=[...s],m=[...n];w(m,r,c),i(m),l(r),p(e),h(e)}},g=_(()=>{const e=d?.current?.offsetWidth;if(!e)return;const{newVisibleItems:c,newHiddenItems:r}=q(e,[...o]),m=r.findIndex(b=>b.key===t);m!==-1&&w(c,r,m),i(c),l(r)},[t,o]);T(()=>(g(),window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}),[f,t]);const C=E(()=>n.length>=5||s.length?"space-between":"start",[s.length,n.length]);return I(z,{ref:d,children:[I(M,{$justifyContent:C,children:[!n.length&&a(N,{}),n.map(e=>a(O,{onClick:()=>k(e.key),active:t===e.key,children:a(G,{item:e,withIcon:!0})},e.key))]}),s.length?a(v,{activeTab:t,samples:s,onChange:x,trigger:a(V,{icon:a(W,{}),variant:"text",style:{height:"100%"}}),withArrow:!1,withCheckmark:!1,width:156}):null]})}const oe=j($);function q(o,t){let n=0;const i=[],s=[];return t.forEach((l,u)=>{const f=u===t.length-1&&s.length===0?0:B;o&&n+L+f<=o?(i.push(l),n+=L):s.push(l)}),{newVisibleItems:i,newHiddenItems:s}}function w(o,t,n){const i=o[o.length-1];i&&(o[o.length-1]=t[n],t[n]=i)}export{oe as LanguageList};
1
+ import{jsx as a,jsxs as I}from"react/jsx-runtime";import{useLayoutEffect as T,useRef as A,useState as y,useCallback as _,memo as j,useMemo as E}from"react";import{useAtomValue as H,useSetAtom as S}from"jotai";import{Button as V}from"@redocly/theme/components/Button/Button";import{OverflowMenuVerticalIcon as W}from"@redocly/theme/icons/OverflowMenuVerticalIcon/OverflowMenuVerticalIcon";import{LanguageDropdown as v}from"./LanguageDropdown.js";import{languageAtom as D,layoutAtom as R}from"../../jotai/app.js";import{LanguageListContainer as M,LanguageListItem as O,Container as z}from"./styled.js";import{LanguageItem as G}from"./LanguageItem.js";import{DROPDOWN_TRIGGER_WIDTH as B,ITEM_WIDTH as L}from"./constants.js";import{LanguageListSkeleton as N}from"../common/Skeleton/LanguageListSkeleton.js";import{useTelemetry as P}from"../../hooks/index.js";function $({languages:o,activeLanguage:t}){const[n,i]=y([]),[s,l]=y([]),u=P(),d=A(null),f=H(R),h=S(D),p=e=>{u.send({type:"openapi_docs.select_language.clicked",payload:{language:e}})},k=e=>{h(e),p(e)},x=e=>{const m=s.findIndex(r=>r.key===e);if(m!==-1){const r=[...s],c=[...n];w(c,r,m),i(c),l(r),p(e),h(e)}},g=_(()=>{const e=d?.current?.offsetWidth;if(!e)return;const{newVisibleItems:m,newHiddenItems:r}=q(e,[...o]),c=r.findIndex(b=>b.key===t);c!==-1&&w(m,r,c),i(m),l(r)},[t,o]);T(()=>(g(),window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}),[f,t]);const C=E(()=>n.length>=5||s.length?"space-between":"start",[s.length,n.length]);return I(z,{ref:d,children:[I(M,{$justifyContent:C,children:[!n.length&&a(N,{}),n.map(e=>a(O,{onClick:()=>k(e.key),active:t===e.key,children:a(G,{item:e,withIcon:!0})},e.key))]}),s.length?a(v,{activeTab:t,samples:s,onChange:x,trigger:a(V,{icon:a(W,{}),variant:"text",style:{height:"100%"}}),withArrow:!1,withCheckmark:!1,width:156}):null]})}const se=j($);function q(o,t){let n=0;const i=[],s=[];return t.forEach((l,u)=>{const f=u===t.length-1&&s.length===0?0:B;o&&n+L+f<=o?(i.push(l),n+=L):s.push(l)}),{newVisibleItems:i,newHiddenItems:s}}function w(o,t,n){const i=o[o.length-1];i&&(o[o.length-1]=t[n],t[n]=i)}export{se as LanguageList};
@@ -1,8 +1,8 @@
1
- import{css as i}from"styled-components";import{Button as r,DropdownMenuItem as n}from"@redocly/theme";import{ITEM_WIDTH as o}from"./constants.js";import{styled as t}from"../../styled-components.js";const l=t.span`
1
+ import{css as i}from"styled-components";import{Button as r}from"@redocly/theme/components/Button/Button";import{DropdownMenuItem as n}from"@redocly/theme/components/Dropdown/DropdownMenuItem";import{ITEM_WIDTH as o}from"./constants.js";import{styled as t}from"../../styled-components.js";const d=t.span`
2
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  align-items: center;
5
- `,d=t.span`
5
+ `,g=t.span`
6
6
  max-width: 150px;
7
7
  text-overflow: ellipsis;
8
8
  overflow: hidden;
@@ -11,14 +11,14 @@ import{css as i}from"styled-components";import{Button as r,DropdownMenuItem as n
11
11
  font-size: var(--font-size-base);
12
12
  line-height: var(--line-height-base);
13
13
  font-weight: ${({active:e})=>e?"var(--font-weight-medium)":"var(--font-weight-regular)"};
14
- `,g=t.span`
14
+ `,x=t.span`
15
15
  width: 100%;
16
16
  display: inherit;
17
17
  gap: inherit;
18
18
  flex-direction: inherit;
19
19
  justify-content: inherit;
20
20
  align-items: inherit;
21
- `,x=t.span`
21
+ `,f=t.span`
22
22
  width: 24px;
23
23
  height: 24px;
24
24
  display: flex;
@@ -26,12 +26,12 @@ import{css as i}from"styled-components";import{Button as r,DropdownMenuItem as n
26
26
  justify-content: center;
27
27
  flex-shrink: 0;
28
28
  overflow: hidden;
29
- `,f=t.div`
29
+ `,h=t.div`
30
30
  display: flex;
31
31
  justify-content: ${({$justifyContent:e="start"})=>e};
32
32
  align-items: center;
33
33
  width: 100%;
34
- `,h=t.button`
34
+ `,u=t.button`
35
35
  background: none;
36
36
  border: none;
37
37
  width: ${o}px;
@@ -62,7 +62,7 @@ import{css as i}from"styled-components";import{Button as r,DropdownMenuItem as n
62
62
  border-bottom-right-radius: calc(var(--border-radius) / 2);
63
63
  }
64
64
  `}
65
- `,u=t(n)`
65
+ `,m=t(n)`
66
66
  display: flex;
67
67
  justify-content: space-between;
68
68
  align-items: center;
@@ -71,11 +71,11 @@ import{css as i}from"styled-components";import{Button as r,DropdownMenuItem as n
71
71
  var(--spacing-sm);
72
72
  width: ${({$width:e=204})=>e}px;
73
73
  fill: var(--menu-content-color-active);
74
- `,m=t(r)`
74
+ `,v=t(r)`
75
75
  display: inline-flex;
76
76
 
77
77
  line-height: var(--line-height-base);
78
78
  font-size: var(--font-size-base);
79
79
  font-weight: var(--font-weight-medium);
80
80
  cursor: pointer;
81
- `;export{l as Container,m as DropdownTriggerButton,x as LanguageIcon,f as LanguageListContainer,h as LanguageListItem,d as LanguageTitle,g as LanguageTitleContainer,u as StyledDropdownMenuItem};
81
+ `;export{d as Container,v as DropdownTriggerButton,f as LanguageIcon,h as LanguageListContainer,u as LanguageListItem,g as LanguageTitle,x as LanguageTitleContainer,m as StyledDropdownMenuItem};
@@ -1 +1 @@
1
- import{jsx as l,Fragment as A}from"react/jsx-runtime";import g,{Fragment as h}from"react";import e from"@markdoc/markdoc";import{useAtomValue as b}from"jotai";import y from"dompurify";import{Markdown as _,isString as z}from"@redocly/theme";import{globalOptionsAtom as R}from"../../jotai/store.js";const S=["OpenApiResponse","OpenApiRequestBody"],T=({source:n,ast:m,htmlWrap:c,markdocOptions:f,...d})=>{const a=b(R);if(!n&&!m)return null;const s=Object.keys(a?.markdocOptions||{}).length?a?.markdocOptions:f,i=s&&{tags:s?.tags,nodes:s?.nodes,partials:s?.partials,variables:s?.variables,functions:s?.functions},u=s&&{components:s?.components};let r;if(n)if(z(n)){const t=a?.unstable_hooks?.sanitize?a.unstable_hooks?.sanitize?.(n):a?.sanitize?y.sanitize(n):n,o=e.parse(t);r=e.transform(o,i)}else{const t=e.Ast.fromJSON(typeof n.result=="object"?JSON.stringify(n.result):n.result);Array.isArray(t)?r=e.transform(t,i):r=e.transform(t,i)}else m&&(r=e.transform(m,i));const p=t=>{const o=e.renderers.react(t,g,u);return l(_,{...d,children:o,as:"div"})};if(!c)return p(r);const O=t=>t.attributes?.htmlWrap!==!1&&!S.includes(t?.name),k=(t,o)=>t?c(p(o)):p(o);return r=Array.isArray(r)?r:r.children,l(A,{children:r.map((t,o)=>l(h,{children:k(O(t),t)},t?.attributes?.id||o))})};export{T as Markdown};
1
+ import{jsx as l,Fragment as A}from"react/jsx-runtime";import g,{Fragment as h}from"react";import e from"@markdoc/markdoc";import{useAtomValue as b}from"jotai";import y from"dompurify";import{isString as _}from"@redocly/theme/core/openapi";import{Markdown as z}from"@redocly/theme/components/Markdown/Markdown";import{globalOptionsAtom as R}from"../../jotai/store.js";const S=["OpenApiResponse","OpenApiRequestBody"],W=({source:n,ast:m,htmlWrap:f,markdocOptions:c,...d})=>{const i=b(R);if(!n&&!m)return null;const s=Object.keys(i?.markdocOptions||{}).length?i?.markdocOptions:c,a=s&&{tags:s?.tags,nodes:s?.nodes,partials:s?.partials,variables:s?.variables,functions:s?.functions},u=s&&{components:s?.components};let r;if(n)if(_(n)){const t=i?.unstable_hooks?.sanitize?i.unstable_hooks?.sanitize?.(n):i?.sanitize?y.sanitize(n):n,o=e.parse(t);r=e.transform(o,a)}else{const t=e.Ast.fromJSON(typeof n.result=="object"?JSON.stringify(n.result):n.result);Array.isArray(t)?r=e.transform(t,a):r=e.transform(t,a)}else m&&(r=e.transform(m,a));const p=t=>{const o=e.renderers.react(t,g,u);return l(z,{...d,children:o,as:"div"})};if(!f)return p(r);const O=t=>t.attributes?.htmlWrap!==!1&&!S.includes(t?.name),k=(t,o)=>t?f(p(o)):p(o);return r=Array.isArray(r)?r:r.children,l(A,{children:r.map((t,o)=>l(h,{children:k(O(t),t)},t?.attributes?.id||o))})};export{W as Markdown};
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as N}from"react/jsx-runtime";import{memo as V,useState as w,useCallback as F,useMemo as j}from"react";import{useAtomValue as g}from"jotai";import{Feedback as K,LayoutVariant as $,BeforeOpenApiOperation as z,AfterOpenApiOperation as G}from"@redocly/theme";import{SamplesMiddlePanel as r,SamplesPanel as J,ShareLink as Q,Row as B,CustomBadges as U}from"../common/index.js";import{CallbacksList as X}from"../Callbacks/index.js";import{CallbackSamples as Y}from"../CallbackSamples/index.js";import{RequestSamples as Z}from"../RequestSamples/index.js";import{OperationResponseList as ee}from"../Responses/index.js";import{ResponseSamples as ae}from"../ResponseSamples/index.js";import{makeDeepLink as te,joinWithSeparator as oe}from"../../services/index.js";import{layoutAtom as ne,userClaimsAtom as se}from"../../jotai/app.js";import{globalOptionsAtom as le,globalStoreAtom as re}from"../../jotai/store.js";import{getOperation as ie}from"../../models/operation.js";import{RenderHook as L}from"../RenderHook/index.js";import{Heading as ce,Title as pe}from"../common/OperationItemTitle.js";import{LinkToField as de}from"../common/LinkToField.js";import{RequestDetails as me}from"../Request/RequestDetails.js";import{StyledBadge as I}from"../common/Badges.js";import{useTranslate as ge}from"../../hooks/index.js";import{styled as k}from"../../styled-components.js";import{createPanelToggleEvent as ke}from"../../events/index.js";function be({item:{operationDefinition:f,parent:S,href:b}}){const s=ge(),{parser:v,options:l}=g(re),{events:y}=g(le),x=g(se),n=g(ne),[c,W]=w(),{unstable_hooks:T,feedback:p}=l,a=j(()=>ie(v,f,S,l,b,void 0,x),[b,f,l,S,v,x]),{name:C,deprecated:H,isWebhook:_,badges:q}=a||{},o=n===$.STACKED,O=p?.type||"sentiment",R=p?.hide!==!0,[u,D]=w(null),A=F(m=>{c!==m&&W(m)},[c]),d=F((m,P)=>{if(!P)return;const M=ke({operation:a,isExpanded:m,panelType:P});y?.panelToggle?.(M)},[y,a]),E=j(()=>R?e(ue,{children:e(K,{type:O,settings:p.settings,path:oe(l.routingBasePath,a.href)})}):null,[R,O,p.settings,l.routingBasePath,a.href]);return t(he,{layout:n,children:[e(i,{layout:n,children:t(r,{isStacked:o,children:[e(L,{Hook:z||T?.BeforeOperation,props:{operation:a}}),t(ce,{"data-testid":"operation-item-header",children:[e(Q,{to:b,"aria-label":`link to ${C}`}),e(U,{badges:q,children:C}),H&&e(I,{deprecated:!0,children:s("openapi.badges.deprecated","Deprecated")}),_&&e(I,{children:s("openapi.badges.webhook","Webhook")})]})]})}),t(i,{layout:n,children:[e(r,{isStacked:o,children:e(me,{operation:a,translate:s,onPanelToggle:d})}),e(h,{isStacked:o,"data-testid":"samples-block",className:"panel-container-request-samples",children:e(Z,{operation:a,onPanelToggle:d})})]}),t(i,{layout:n,children:[e(r,{isStacked:o,children:a.responses?.length?e(ee,{responses:a.responses,operationId:a.id,operationPointer:a.pointer,callbackId:a.callbackId,activeResponseTab:c,onTabChange:A,onPanelToggle:d}):null}),e(h,{isStacked:o,"data-testid":"samples-block",className:"panel-container-response-samples",children:e(ae,{operation:a,activeResponseTab:c,onTabChange:A,onPanelToggle:d})})]}),t(i,{layout:n,children:[t(r,{isStacked:o,children:[a.callbacks?.length?t(N,{children:[t(pe,{children:[e(de,{to:te(a.id,"callbacks")}),s("openapi.callbacks","Callbacks")]}),e(X,{callbacks:a.callbacks,onExpand:D,selectedCallback:u})]}):null,e(L,{Hook:G||T?.AfterOperation,props:{operation:a}})]}),u?e(h,{isStacked:o,"data-testid":"samples-block",children:e(Y,{callback:u,translate:s})}):null]}),e(i,{layout:n,children:e(r,{isStacked:o,fullWidth:!0,children:E})})]})}const Ee=V(be),h=k(J)`
1
+ import{jsx as e,jsxs as t,Fragment as N}from"react/jsx-runtime";import{memo as V,useState as w,useCallback as F,useMemo as j}from"react";import{useAtomValue as g}from"jotai";import{LayoutVariant as K}from"@redocly/config";import{AfterOpenApiOperation as $}from"@redocly/theme/components/OpenApiDocs/hooks/AfterOpenApiOperation";import{BeforeOpenApiOperation as z}from"@redocly/theme/components/OpenApiDocs/hooks/BeforeOpenApiOperation";import{Feedback as G}from"@redocly/theme/components/Feedback/Feedback";import{SamplesMiddlePanel as i,SamplesPanel as J,ShareLink as Q,Row as B,CustomBadges as U}from"../common/index.js";import{CallbacksList as X}from"../Callbacks/index.js";import{CallbackSamples as Y}from"../CallbackSamples/index.js";import{RequestSamples as Z}from"../RequestSamples/index.js";import{OperationResponseList as ee}from"../Responses/index.js";import{ResponseSamples as ae}from"../ResponseSamples/index.js";import{makeDeepLink as te,joinWithSeparator as oe}from"../../services/index.js";import{layoutAtom as ne,userClaimsAtom as se}from"../../jotai/app.js";import{globalOptionsAtom as re,globalStoreAtom as ie}from"../../jotai/store.js";import{getOperation as le}from"../../models/operation.js";import{RenderHook as L}from"../RenderHook/index.js";import{Heading as ce,Title as pe}from"../common/OperationItemTitle.js";import{LinkToField as de}from"../common/LinkToField.js";import{RequestDetails as me}from"../Request/RequestDetails.js";import{StyledBadge as I}from"../common/Badges.js";import{useTranslate as ge}from"../../hooks/index.js";import{styled as k}from"../../styled-components.js";import{createPanelToggleEvent as ke}from"../../events/index.js";function be({item:{operationDefinition:f,parent:S,href:b}}){const s=ge(),{parser:v,options:r}=g(ie),{events:y}=g(re),x=g(se),n=g(ne),[c,W]=w(),{unstable_hooks:T,feedback:p}=r,a=j(()=>le(v,f,S,r,b,void 0,x),[b,f,r,S,v,x]),{name:C,deprecated:H,isWebhook:_,badges:q}=a||{},o=n===K.STACKED,O=p?.type||"sentiment",R=p?.hide!==!0,[u,D]=w(null),A=F(m=>{c!==m&&W(m)},[c]),d=F((m,P)=>{if(!P)return;const M=ke({operation:a,isExpanded:m,panelType:P});y?.panelToggle?.(M)},[y,a]),E=j(()=>R?e(ue,{children:e(G,{type:O,settings:p.settings,path:oe(r.routingBasePath,a.href)})}):null,[R,O,p.settings,r.routingBasePath,a.href]);return t(he,{layout:n,children:[e(l,{layout:n,children:t(i,{isStacked:o,children:[e(L,{Hook:z||T?.BeforeOperation,props:{operation:a}}),t(ce,{"data-testid":"operation-item-header",children:[e(Q,{to:b,"aria-label":`link to ${C}`}),e(U,{badges:q,children:C}),H&&e(I,{deprecated:!0,children:s("openapi.badges.deprecated","Deprecated")}),_&&e(I,{children:s("openapi.badges.webhook","Webhook")})]})]})}),t(l,{layout:n,children:[e(i,{isStacked:o,children:e(me,{operation:a,translate:s,onPanelToggle:d})}),e(h,{isStacked:o,"data-testid":"samples-block",className:"panel-container-request-samples",children:e(Z,{operation:a,onPanelToggle:d})})]}),t(l,{layout:n,children:[e(i,{isStacked:o,children:a.responses?.length?e(ee,{responses:a.responses,operationId:a.id,operationPointer:a.pointer,callbackId:a.callbackId,activeResponseTab:c,onTabChange:A,onPanelToggle:d}):null}),e(h,{isStacked:o,"data-testid":"samples-block",className:"panel-container-response-samples",children:e(ae,{operation:a,activeResponseTab:c,onTabChange:A,onPanelToggle:d})})]}),t(l,{layout:n,children:[t(i,{isStacked:o,children:[a.callbacks?.length?t(N,{children:[t(pe,{children:[e(de,{to:te(a.id,"callbacks")}),s("openapi.callbacks","Callbacks")]}),e(X,{callbacks:a.callbacks,onExpand:D,selectedCallback:u})]}):null,e(L,{Hook:$||T?.AfterOperation,props:{operation:a}})]}),u?e(h,{isStacked:o,"data-testid":"samples-block",children:e(Y,{callback:u,translate:s})}):null]}),e(l,{layout:n,children:e(i,{isStacked:o,fullWidth:!0,children:E})})]})}const Ve=V(be),h=k(J)`
2
2
  margin-left: auto;
3
3
  --code-block-padding: var(--spacing-xs) 0 var(--spacing-xs) 20px;
4
4
  `,ue=k.div`
@@ -16,6 +16,6 @@ import{jsx as e,jsxs as t,Fragment as N}from"react/jsx-runtime";import{memo as V
16
16
  flex-direction: column;
17
17
  align-items: flex-start;
18
18
  padding: var(--spacing-base) 0 calc(var(--spacing-xl) + var(--spacing-xs));
19
- `,i=k(B)`
19
+ `,l=k(B)`
20
20
  margin: calc(var(--spacing-unit) * 2) 0;
21
- `;export{Ee as OperationItem,h as OperationSamplesPanel};
21
+ `;export{Ve as OperationItem,h as OperationSamplesPanel};
@@ -1,4 +1,4 @@
1
- import type { TFunction } from '@redocly/theme';
1
+ import type { TFunction } from '@redocly/theme/core/openapi';
2
2
  import type { ReactElement } from 'react';
3
3
  import type { OpenAPIInfo } from '../../types/index.js';
4
4
  type OverviewProps = {
@@ -1 +1 @@
1
- import{jsx as t,jsxs as m,Fragment as u}from"react/jsx-runtime";import{CopyButton as d,NewTabButton as c,EmailButton as h}from"@redocly/theme";import{PanelItem as a,PanelItemDescription as n,PanelItemsList as p}from"../PanelItem/index.js";function O({info:e,translate:r}){const l=e.contact&&e.contact.url&&t(a,{header:t(n,{children:r("openapi.info.contact.url","URL")}),title:t("a",{href:e.contact.url,target:"_blank",rel:"noreferrer",children:e.contact.url}),actions:[t(c,{data:e.contact.url},"NewTabButton")]})||null,i=e.contact&&e.contact.email&&t(a,{header:t(n,{children:e.contact.name||r("openapi.info.contact.name","E-mail")}),title:t("a",{href:"mailto:"+e.contact.email,children:e.contact.email}),actions:[t(d,{data:e.contact.email},"CopyButton"),t(h,{data:e.contact.email},"EmailButton")]})||null,s=e.license&&t(a,{header:t(n,{children:r("openapi.info.license","License")}),title:e.license.identifier?e.license.identifier:t("a",{href:e.license.url,target:"_blank",rel:"noreferrer",children:e.license.name}),actions:[t(c,{data:e.license.url||""},"NewTabButton")]})||null,o=e.termsOfService&&t(a,{title:t("a",{href:e.termsOfService,target:"_blank",rel:"noreferrer",children:r("openapi.info.termsOfService","Terms of Service")}),actions:[t(c,{data:e.termsOfService},e.termsOfService)]})||null;return t(u,{children:m(p,{children:[l,i,s,o]})})}export{O as Overview};
1
+ import{jsx as t,jsxs as s,Fragment as u}from"react/jsx-runtime";import{CopyButton as d}from"@redocly/theme/components/Buttons/CopyButton";import{NewTabButton as c}from"@redocly/theme/components/Buttons/NewTabButton";import{EmailButton as p}from"@redocly/theme/components/Buttons/EmailButton";import{PanelItem as a,PanelItemDescription as n,PanelItemsList as h}from"../PanelItem/index.js";function _({info:e,translate:r}){const l=e.contact&&e.contact.url&&t(a,{header:t(n,{children:r("openapi.info.contact.url","URL")}),title:t("a",{href:e.contact.url,target:"_blank",rel:"noreferrer",children:e.contact.url}),actions:[t(c,{data:e.contact.url},"NewTabButton")]})||null,i=e.contact&&e.contact.email&&t(a,{header:t(n,{children:e.contact.name||r("openapi.info.contact.name","E-mail")}),title:t("a",{href:"mailto:"+e.contact.email,children:e.contact.email}),actions:[t(d,{data:e.contact.email},"CopyButton"),t(p,{data:e.contact.email},"EmailButton")]})||null,o=e.license&&t(a,{header:t(n,{children:r("openapi.info.license","License")}),title:e.license.identifier?e.license.identifier:t("a",{href:e.license.url,target:"_blank",rel:"noreferrer",children:e.license.name}),actions:[t(c,{data:e.license.url||""},"NewTabButton")]})||null,m=e.termsOfService&&t(a,{title:t("a",{href:e.termsOfService,target:"_blank",rel:"noreferrer",children:r("openapi.info.termsOfService","Terms of Service")}),actions:[t(c,{data:e.termsOfService},e.termsOfService)]})||null;return t(u,{children:s(h,{children:[l,i,o,m]})})}export{_ as Overview};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{OpenApiFooter as r}from"@redocly/theme";import{memo as t}from"react";import{useAtomValue as n}from"jotai";import{globalOptionsAtom as m}from"../../jotai/store.js";import{RenderHook as p}from"../RenderHook/index.js";function s(){const{unstable_hooks:{MiddlePanelFooter:o}}=n(m);switch(!0){case!!o:return e(p,{Hook:o,props:void 0});case!!r:return e(r,{});default:return null}}const d=t(s);export{d as PageFooter,s as PageFooterComponent};
1
+ import{jsx as e}from"react/jsx-runtime";import{memo as t}from"react";import{useAtomValue as n}from"jotai";import{OpenApiFooter as r}from"@redocly/theme/components/OpenApiDocs/hooks/OpenApiFooter";import{globalOptionsAtom as m}from"../../jotai/store.js";import{RenderHook as p}from"../RenderHook/index.js";function s(){const{unstable_hooks:{MiddlePanelFooter:o}}=n(m);switch(!0){case!!o:return e(p,{Hook:o,props:void 0});case!!r:return e(r,{});default:return null}}const d=t(s);export{d as PageFooter,s as PageFooterComponent};
@@ -1,4 +1,4 @@
1
- import{Panel as o}from"@redocly/theme";import{FieldsGroupHeader as e}from"../common/headers.js";import{Trigger as r}from"./Trigger.js";import{styled as t}from"../../styled-components.js";const i=t(o)`
1
+ import{Panel as o}from"@redocly/theme/components/Panel/Panel";import{FieldsGroupHeader as e}from"../common/headers.js";import{Trigger as r}from"./Trigger.js";import{styled as t}from"../../styled-components.js";const i=t(o)`
2
2
  ${e} {
3
3
  &:first-child {
4
4
  margin-top: 0;
@@ -1,4 +1,4 @@
1
- import{CheckmarkIcon as o}from"@redocly/theme";import{styled as t}from"../../styled-components.js";const r=t.span`
1
+ import{CheckmarkIcon as o}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon";import{styled as t}from"../../styled-components.js";const r=t.span`
2
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  align-items: center;
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import{useAtomValue as i}from"jotai";import{JsonViewer as m}from"@redocly/theme";import{isFormUrlEncoded as a,isJsonLike as c,langFromMime as d,urlFormEncodePayload as f}from"../../utils/index.js";import{globalOptionsAtom as p}from"../../jotai/store.js";import{StyledCodeBlock as g}from"./styled.js";function y({value:o,mimeType:r,encoding:t,onCopyClick:e,onPanelToggle:l}){const{jsonSamplesExpandLevel:s}=i(p);return c(r)?n(m,{data:o,expandLevel:s,onCopyClick:e,onPanelToggle:l}):(typeof o=="object"&&(a(r)?o=f(o,t):o=JSON.stringify(o,null,2)),n(g,{lang:d(r),source:o,header:{className:"code-block-header",controls:{copy:{onClick:e}}}}))}export{y as ExampleValue};
1
+ import{jsx as n}from"react/jsx-runtime";import{useAtomValue as i}from"jotai";import{JsonViewer as m}from"@redocly/theme/components/JsonViewer/JsonViewer";import{isFormUrlEncoded as a,isJsonLike as c,langFromMime as d,urlFormEncodePayload as f}from"../../utils/index.js";import{globalOptionsAtom as p}from"../../jotai/store.js";import{StyledCodeBlock as g}from"./styled.js";function y({value:o,mimeType:r,encoding:t,onCopyClick:e,onPanelToggle:l}){const{jsonSamplesExpandLevel:s}=i(p);return c(r)?n(m,{data:o,expandLevel:s,onCopyClick:e,onPanelToggle:l}):(typeof o=="object"&&(a(r)?o=f(o,t):o=JSON.stringify(o,null,2)),n(g,{lang:d(r),source:o,header:{className:"code-block-header",controls:{copy:{onClick:e}}}}))}export{y as ExampleValue};
@@ -1,4 +1,4 @@
1
- import{CodeBlock as e}from"@redocly/theme";import{styled as o}from"../../styled-components.js";const a=o.span`
1
+ import{CodeBlock as e}from"@redocly/theme/components/CodeBlock/CodeBlock";import{styled as o}from"../../styled-components.js";const a=o.span`
2
2
  font-size: 12px;
3
3
  position: absolute;
4
4
  z-index: 1;
@@ -1,3 +1,3 @@
1
- import{jsxs as t,jsx as n,Fragment as s}from"react/jsx-runtime";import{memo as i}from"react";import{useAtomValue as a}from"jotai";import{Markdown as e}from"@redocly/theme";import{ExtensionValue as p,FieldLabel as l}from"../common/index.js";import{globalOptionsAtom as f}from"../../jotai/store.js";import{styled as c}from"../../styled-components.js";const d=c(e)`
1
+ import{jsxs as t,jsx as n,Fragment as s}from"react/jsx-runtime";import{memo as i}from"react";import{useAtomValue as a}from"jotai";import{Markdown as e}from"@redocly/theme/components/Markdown/Markdown";import{ExtensionValue as p,FieldLabel as l}from"../common/index.js";import{globalOptionsAtom as f}from"../../jotai/store.js";import{styled as c}from"../../styled-components.js";const d=c(e)`
2
2
  margin: 2px 0;
3
3
  `;function g({extensions:r}){const{showExtensions:m}=a(f);return m?n(s,{children:Object.keys(r).map(o=>t(d,{children:[t(l,{children:[o.substring(2),": "]})," ",n(p,{children:typeof r[o]=="string"?r[o]:JSON.stringify(r[o])})]},o))}):null}const F=i(g);export{F as Extensions};
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as p,Fragment as E}from"react/jsx-runtime";import{memo as T,useMemo as k}from"react";import{useAtomValue as S}from"jotai";import{LinkIcon as L}from"@redocly/theme";import{RecursiveLabel as h,Tag as x,AccessLabel as j,RequiredLabel as q,StyledBadge as A}from"../common/index.js";import{ExternalDocumentation as C}from"../ExternalDocumentation/index.js";import{Markdown as M}from"../Markdown/index.js";import{FieldDetail as l}from"./FieldDetail.js";import{Extensions as R}from"./Extensions.js";import{EnumValues as V}from"./EnumValues.js";import{Examples as $,getSerializedValue as N}from"./Examples.js";import{globalOptionsAtom as _}from"../../jotai/store.js";import{SchemaTypeInfo as i}from"./SchemaTypeInfo.js";import{LinkToField as B}from"../common/LinkToField.js";import{Pattern as I}from"./Pattern.js";import{getAccessModeLabelText as O}from"../RenderHook/index.js";import{useTranslate as G}from"../../hooks/index.js";import{styled as n}from"../../styled-components.js";function H({field:t,renderDiscriminatorSwitch:v,deepLink:m,fieldParentsName:y=[]}){const a=G(),{hidePropertiesPrefix:g,hideSchemaTitles:b}=S(_),{schema:r,description:w,example:c,deprecated:D,examples:s,kind:d,required:F,name:f}=t,P=t.in==="header",z=k(()=>{if(c!==void 0||s!==void 0){if(s!==void 0)return e($,{field:t});{const o=!!t.in;return e(l,{label:`${a("openapi.example","Example")}:`,value:N(t,t.example),raw:o})}}else return null},[c,s,t,a]),u=O(t.schema);return p(E,{children:[p(J,{children:[f&&p(Q,{children:[m&&e(B,{to:m}),!g&&y.map(o=>o+".\u200B"),e(U,{className:"schema-name",children:f})]}),e(i,{type:r.typePrefix+r.displayType}),e(i,{type:r.displayFormat&&`(${r.displayFormat})`}),e(i,{type:r.contentEncoding}),e(i,{type:r.title&&!b?`(${r.title})`:""}),r.constraints?.map(o=>e(i,{type:o},o)),D&&e(A,{deprecated:!0,children:a("openapi.badges.deprecated","Deprecated")}),e(I,{pattern:r.pattern}),d==="additionalProperties"&&e(x,{children:a("openapi.additionalProperties","additional property")}),d==="patternProperties"&&e(x,{children:a("openapi.patternProperties","pattern property")}),u&&e(j,{children:u}),F&&e(q,{children:a("openapi.required","required")}),r.isCircular&&e(h,{children:a("openapi.recursive","Recursive")})]}),r.isComplex&&e(h,{children:a("openapi.complex","Complex")}),e(K,{source:w}),e(l,{raw:P,type:"default",label:a("openapi.default","Default"),value:r.default}),e(V,{type:r.type,values:r["x-enumDescriptions"]||r.enum}),z,e(R,{extensions:{...t.extensions,...r.extensions}}),r.externalDocs&&e(C,{externalDocs:r.externalDocs,compact:!0}),v?.(),e(l,{label:a("openapi.value","Value"),value:t.const||void 0})]})}const ue=T(H),J=n.div`
1
+ import{jsx as e,jsxs as p,Fragment as E}from"react/jsx-runtime";import{memo as T,useMemo as k}from"react";import{useAtomValue as S}from"jotai";import{LinkIcon as L}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{RecursiveLabel as h,Tag as x,AccessLabel as j,RequiredLabel as q,StyledBadge as A}from"../common/index.js";import{ExternalDocumentation as C}from"../ExternalDocumentation/index.js";import{Markdown as M}from"../Markdown/index.js";import{FieldDetail as l}from"./FieldDetail.js";import{Extensions as R}from"./Extensions.js";import{EnumValues as V}from"./EnumValues.js";import{Examples as $,getSerializedValue as N}from"./Examples.js";import{globalOptionsAtom as _}from"../../jotai/store.js";import{SchemaTypeInfo as i}from"./SchemaTypeInfo.js";import{LinkToField as B}from"../common/LinkToField.js";import{Pattern as I}from"./Pattern.js";import{getAccessModeLabelText as O}from"../RenderHook/index.js";import{useTranslate as G}from"../../hooks/index.js";import{styled as n}from"../../styled-components.js";function H({field:t,renderDiscriminatorSwitch:v,deepLink:m,fieldParentsName:y=[]}){const a=G(),{hidePropertiesPrefix:g,hideSchemaTitles:b}=S(_),{schema:r,description:w,example:c,deprecated:D,examples:s,kind:d,required:F,name:f}=t,P=t.in==="header",z=k(()=>{if(c!==void 0||s!==void 0){if(s!==void 0)return e($,{field:t});{const o=!!t.in;return e(l,{label:`${a("openapi.example","Example")}:`,value:N(t,t.example),raw:o})}}else return null},[c,s,t,a]),u=O(t.schema);return p(E,{children:[p(J,{children:[f&&p(Q,{children:[m&&e(B,{to:m}),!g&&y.map(o=>o+".\u200B"),e(U,{className:"schema-name",children:f})]}),e(i,{type:r.typePrefix+r.displayType}),e(i,{type:r.displayFormat&&`(${r.displayFormat})`}),e(i,{type:r.contentEncoding}),e(i,{type:r.title&&!b?`(${r.title})`:""}),r.constraints?.map(o=>e(i,{type:o},o)),D&&e(A,{deprecated:!0,children:a("openapi.badges.deprecated","Deprecated")}),e(I,{pattern:r.pattern}),d==="additionalProperties"&&e(x,{children:a("openapi.additionalProperties","additional property")}),d==="patternProperties"&&e(x,{children:a("openapi.patternProperties","pattern property")}),u&&e(j,{children:u}),F&&e(q,{children:a("openapi.required","required")}),r.isCircular&&e(h,{children:a("openapi.recursive","Recursive")})]}),r.isComplex&&e(h,{children:a("openapi.complex","Complex")}),e(K,{source:w}),e(l,{raw:P,type:"default",label:a("openapi.default","Default"),value:r.default}),e(V,{type:r.type,values:r["x-enumDescriptions"]||r.enum}),z,e(R,{extensions:{...t.extensions,...r.extensions}}),r.externalDocs&&e(C,{externalDocs:r.externalDocs,compact:!0}),v?.(),e(l,{label:a("openapi.value","Value"),value:t.const||void 0})]})}const ue=T(H),J=n.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  gap: calc(var(--spacing-xxs) / 4) var(--spacing-xxs);
@@ -1,4 +1,4 @@
1
- import{Markdown as o}from"@redocly/theme";import{styled as e}from"../../styled-components.js";const i=e(o)`
1
+ import{Markdown as o}from"@redocly/theme/components/Markdown/Markdown";import{styled as e}from"../../styled-components.js";const i=e(o)`
2
2
  table.md {
3
3
  margin: var(--spacing-xs) 0 0;
4
4
  }
@@ -1,4 +1,4 @@
1
- import type { TFunction } from '@redocly/theme';
1
+ import type { TFunction } from '@redocly/theme/core/openapi';
2
2
  import type { ReactElement } from 'react';
3
3
  import type { SchemaOptions, OneOfChangeParams } from '../Schema/index.js';
4
4
  import type { FieldModel } from '../../models/index.js';
@@ -1 +1 @@
1
- import{jsx as d}from"react/jsx-runtime";import{memo as v,useCallback as g,useEffect as b,useMemo as y}from"react";import S from"@markdoc/markdoc";import{LayoutVariant as O,markdoc as E}from"@redocly/theme";import{createStore as A,Provider as N}from"jotai";import{normalizeOptions as k,OpenAPIParser as D}from"../../services/index.js";import{getMarkdownHeaderId as j}from"./utils.js";import{normalizeServers as x}from"../../utils/index.js";import{SchemaDefinition as C}from"../SchemaDefinition/index.js";import{appStore as P,appStoreOverrideAtom as H,environmentAtom as M,layoutAtom as l,userClaimsAtom as I}from"../../jotai/app.js";import{mapObject as L}from"../../utils/object.js";import{mergeInMockServer as R}from"../../models/operation.js";import{getDefaultOperationStore as T,operationStore as V}from"../../jotai/operation.js";import{getServerEnvName as z}from"../../utils/environments.js";import{globalStoreAtom as _}from"../../jotai/store.js";const q={ignoreNamedSchemas:["java.io.ObjectStreamField"],maxDisplayedEnumValues:10,markdocOptions:{tags:{schemaDefinition:{render:"SchemaDefinition",attributes:{schemaRef:{type:String},exampleRef:{type:String},showReadOnly:{type:Boolean},showWriteOnly:{type:Boolean},htmlWrap:{type:String,default:!1}}}},nodes:{heading:{children:["inline"],attributes:{id:{type:String},level:{type:Number,required:!0,default:1}},transform(n,i){const t=n.transformAttributes(i),m=n.transformChildren(i),e=typeof t.id=="string"?t.id:j(m);return new S.Tag("Heading",{...t,id:e,level:n.attributes.level},m)}}},components:{SchemaDefinition:C,Heading:E.components.Heading}}},re=v(({children:n,options:i,definitionUrl:t,definition:m,withState:e})=>{const p=g(()=>{const r=k(i,q),o=new D(m,t,r);return{options:r,parser:o}},[m,t,i]),a=y(()=>{const r=A(),o=p();r.set(_,o);const c=x(o.parser.definitionUrl,R(o.parser.definition?.servers||[],o.options.mockServer)),u=Object.fromEntries(c.map(s=>[z(s),{server:s.url,...L(s.variables||{},f=>f.default||"")}]));if(r.sub(P,()=>{}),r.set(l,o.options?.layout||O.THREE_PANEL),r.set(M,{environments:u}),r.set(I,e?.userClaims||{}),e&&r.set(H,{environment:e.environment,environments:e.environments,activeMimeName:e.activeMimeName,userClaims:e.userClaims}),e?.operation){const s=T(e.operation.pointer,e.operation.state.requestValues,e.operation.state.activeExampleName);r.set(V(e.operation.pointer),s)}return r},[p,e]);return b(()=>{e?.layout&&a.set(l,e?.layout)},[a,e?.layout]),d(N,{store:a,children:n})});export{re as StoreProvider};
1
+ import{jsx as d}from"react/jsx-runtime";import{memo as v,useCallback as b,useEffect as g,useMemo as y}from"react";import S from"@markdoc/markdoc";import{LayoutVariant as O}from"@redocly/config";import{createStore as E,Provider as A}from"jotai";import{Heading as N}from"@redocly/theme/markdoc/components/Heading/Heading";import{normalizeOptions as D,OpenAPIParser as j}from"../../services/index.js";import{getMarkdownHeaderId as k}from"./utils.js";import{normalizeServers as x}from"../../utils/index.js";import{SchemaDefinition as C}from"../SchemaDefinition/index.js";import{appStore as P,appStoreOverrideAtom as M,environmentAtom as H,layoutAtom as l,userClaimsAtom as I}from"../../jotai/app.js";import{mapObject as L}from"../../utils/object.js";import{mergeInMockServer as R}from"../../models/operation.js";import{getDefaultOperationStore as T,operationStore as V}from"../../jotai/operation.js";import{getServerEnvName as z}from"../../utils/environments.js";import{globalStoreAtom as _}from"../../jotai/store.js";const q={ignoreNamedSchemas:["java.io.ObjectStreamField"],maxDisplayedEnumValues:10,markdocOptions:{tags:{schemaDefinition:{render:"SchemaDefinition",attributes:{schemaRef:{type:String},exampleRef:{type:String},showReadOnly:{type:Boolean},showWriteOnly:{type:Boolean},htmlWrap:{type:String,default:!1}}}},nodes:{heading:{children:["inline"],attributes:{id:{type:String},level:{type:Number,required:!0,default:1}},transform(n,i){const t=n.transformAttributes(i),m=n.transformChildren(i),e=typeof t.id=="string"?t.id:k(m);return new S.Tag("Heading",{...t,id:e,level:n.attributes.level},m)}}},components:{SchemaDefinition:C,Heading:N}}},oe=v(({children:n,options:i,definitionUrl:t,definition:m,withState:e})=>{const p=b(()=>{const r=D(i,q),o=new j(m,t,r);return{options:r,parser:o}},[m,t,i]),a=y(()=>{const r=E(),o=p();r.set(_,o);const u=x(o.parser.definitionUrl,R(o.parser.definition?.servers||[],o.options.mockServer)),f=Object.fromEntries(u.map(s=>[z(s),{server:s.url,...L(s.variables||{},c=>c.default||"")}]));if(r.sub(P,()=>{}),r.set(l,o.options?.layout||O.THREE_PANEL),r.set(H,{environments:f}),r.set(I,e?.userClaims||{}),e&&r.set(M,{environment:e.environment,environments:e.environments,activeMimeName:e.activeMimeName,userClaims:e.userClaims}),e?.operation){const s=T(e.operation.pointer,e.operation.state.requestValues,e.operation.state.activeExampleName);r.set(V(e.operation.pointer),s)}return r},[p,e]);return g(()=>{e?.layout&&a.set(l,e?.layout)},[a,e?.layout]),d(A,{store:a,children:n})});export{oe as StoreProvider};
@@ -1 +1 @@
1
- import{jsx as o,jsxs as i,Fragment as E}from"react/jsx-runtime";import{memo as O,useRef as T}from"react";import{GlobalStyle as w,LayoutVariant as p,SidebarLogo as A,ThreePanelLayout as _,useMount as I}from"@redocly/theme";import{useSetAtom as j}from"jotai";import{StoreProvider as N}from"./Providers.js";import{Overlay as v}from"../Overlay.js";import{RedocWrap as D}from"./styled.js";import{StickyResponsiveSidebar as k}from"../StickySidebar/index.js";import{SideMenu as B}from"../SideMenu/index.js";import{Content as K}from"../Content/index.js";import{useContentItems as M,useUppercase2LowercaseRedirect as V,useTelemetry as F,usePerformanceMetrics as H}from"../../hooks/index.js";import{withRouter as U}from"../../hoc/withRouter.js";import{withStore as Y}from"../../hoc/withStore.js";import{compose as G}from"../../utils/index.js";import{useLicense as W}from"../../hooks/useLicense.js";import{allOperationsAtom as q}from"../../jotai/replay.js";const z=G(U,Y,O)(({licenseKey:s,onLoaded:a,children:e,options:t,layout:f,collapsedSidebar:d,parser:m,withCommonStyles:h})=>{const b=T(null),{isValid:c,licenseInfo:R}=W(s),S=j(q),u=F();V();const{contentItems:y,flatItems:g}=M({parser:m,options:t});H({sendTelemetry:l=>{const r=Object.fromEntries(Object.entries(l).map(([x,C])=>[x.toLowerCase(),C]));u.send({type:"openapi_docs.performance_metrics",payload:{cls:r.cls,lcp:r.lcp,fcp:r.fcp,ttfb:r.ttfb}})}}),I(()=>{if(a?.(),u.send({type:"openapi_docs.viewed",payload:{layout:f}}),!t.hideReplay){const l=g.filter(r=>r.type==="operation");S(l)}});const{hideSidebar:L,scrollYOffset:P}=t||{},n=m.definition?.info?.["x-logo"];return i(E,{children:[h&&o(w,{}),i(D,{className:"redoc-wrap",ref:b,children:[!c&&o(v,{licenseInfo:R}),!L&&i(k,{scrollYOffset:P,className:"menu-content",collapsedSidebar:!d,children:[o(A,{imageUrl:n?.url,href:n?.href||m.definition?.info?.contact?.url,altText:n?.altText,backgroundColor:n?.backgroundColor}),o(B,{items:c?y:[]})]}),i(_,{className:"api-content",id:"api-content",layout:f===p.THREE_PANEL?p.THREE_PANEL:p.STACKED,collapsedSidebar:d,children:[o(K,{items:c?y:[],routingBasePath:t.routingBasePath}),e]})]})]})});function pe({onLoaded:s,children:a,store:e,withCommonStyles:t}){return e?.definition?o(N,{...e,children:o(z,{onLoaded:s,basePath:e.options?.routingBasePath,licenseKey:e.options?.licenseKey,disableRouter:e.options?.disableRouter,withCommonStyles:t,children:a})}):null}export{pe as RedoclyOpenAPIDocs};
1
+ import{jsx as o,jsxs as n,Fragment as E}from"react/jsx-runtime";import{memo as O,useRef as T}from"react";import{LayoutVariant as p}from"@redocly/config";import{useSetAtom as w}from"jotai";import{ThreePanelLayout as A}from"@redocly/theme/layouts/ThreePanelLayout";import{SidebarLogo as _}from"@redocly/theme/components/SidebarLogo/SidebarLogo";import{GlobalStyle as I,useMount as j}from"@redocly/theme/core/openapi";import{StoreProvider as N}from"./Providers.js";import{Overlay as v}from"../Overlay.js";import{RedocWrap as D}from"./styled.js";import{StickyResponsiveSidebar as k}from"../StickySidebar/index.js";import{SideMenu as B}from"../SideMenu/index.js";import{Content as K}from"../Content/index.js";import{useContentItems as M,useUppercase2LowercaseRedirect as V,useTelemetry as F,usePerformanceMetrics as H}from"../../hooks/index.js";import{withRouter as U}from"../../hoc/withRouter.js";import{withStore as Y}from"../../hoc/withStore.js";import{compose as G}from"../../utils/index.js";import{useLicense as W}from"../../hooks/useLicense.js";import{allOperationsAtom as q}from"../../jotai/replay.js";const z=G(U,Y,O)(({licenseKey:s,onLoaded:m,children:e,options:t,layout:f,collapsedSidebar:d,parser:a,withCommonStyles:h})=>{const b=T(null),{isValid:c,licenseInfo:R}=W(s),S=w(q),u=F();V();const{contentItems:y,flatItems:g}=M({parser:a,options:t});H({sendTelemetry:l=>{const r=Object.fromEntries(Object.entries(l).map(([x,C])=>[x.toLowerCase(),C]));u.send({type:"openapi_docs.performance_metrics",payload:{cls:r.cls,lcp:r.lcp,fcp:r.fcp,ttfb:r.ttfb}})}}),j(()=>{if(m?.(),u.send({type:"openapi_docs.viewed",payload:{layout:f}}),!t.hideReplay){const l=g.filter(r=>r.type==="operation");S(l)}});const{hideSidebar:L,scrollYOffset:P}=t||{},i=a.definition?.info?.["x-logo"];return n(E,{children:[h&&o(I,{}),n(D,{className:"redoc-wrap",ref:b,children:[!c&&o(v,{licenseInfo:R}),!L&&n(k,{scrollYOffset:P,className:"menu-content",collapsedSidebar:!d,children:[o(_,{imageUrl:i?.url,href:i?.href||a.definition?.info?.contact?.url,altText:i?.altText,backgroundColor:i?.backgroundColor}),o(B,{items:c?y:[]})]}),n(A,{className:"api-content",id:"api-content",layout:f===p.THREE_PANEL?p.THREE_PANEL:p.STACKED,collapsedSidebar:d,children:[o(K,{items:c?y:[],routingBasePath:t.routingBasePath}),e]})]})]})});function ue({onLoaded:s,children:m,store:e,withCommonStyles:t}){return e?.definition?o(N,{...e,children:o(z,{onLoaded:s,basePath:e.options?.routingBasePath,licenseKey:e.options?.licenseKey,disableRouter:e.options?.disableRouter,withCommonStyles:t,children:m})}):null}export{ue as RedoclyOpenAPIDocs};
@@ -1 +1 @@
1
- import{jsx as s}from"react/jsx-runtime";import{cloneElement as S,isValidElement as w,useEffect as f,useMemo as x,useState as d}from"react";import{Loading as y}from"@redocly/theme";import{useDeepCompareMemoize as v,fixSpec as A}from"./utils.js";import{argValueToBoolean as D}from"../../utils/index.js";import{RedoclyOpenAPIDocs as I}from"./RedoclyOpenAPIDocs.js";import{loadAndBundleDefinition as u}from"../../utils/loadAndBundleSpec.js";async function k(e,n,t){let o;if(t?.skipBundle){if(!e)throw new Error('spec must be specified when using "skipBundleAndConvert"');o=e}else o=await u(e||n);try{A(o)}catch{}return o}function _(e,n){return e.endsWith(".md")?u({openapi:"3.0.0",info:{title:n||"",version:"1.0",description:{$ref:e}},paths:{}}):u(e)}const B=({options:e,definitionUrl:n,definition:t,activeSampleLanguage:o,children:r})=>{const[,l]=d(),[m,c]=d(!0),[i,p]=d(null);f(()=>{async function h(){c(!0);try{p(await k(t,n,e))}catch(g){l(()=>{throw g})}}h()},[t,n,e]);const a=x(()=>{if(i)return e?.unstable_hooks?.onInit&&e.unstable_hooks?.onInit?.({store:{definition:i,options:e,definitionUrl:n,activeSampleLanguage:o}}),{definition:i,options:e,definitionUrl:n,activeSampleLanguage:o}},v([i,e,n]));return f(()=>{a&&c(!1)},[a]),a?m?D(e?.hideLoading,!1)?null:s(y,{color:"--loading-spinner-color"}):w(r)?S(r,{store:a}):null:null};function j({definition:e,definitionUrl:n,options:t={},activeItemId:o,activeSampleLanguage:r,activeDeepLink:l}){return s(B,{definition:e,definitionUrl:n,options:t,activeItemId:o,activeSampleLanguage:r,activeDeepLink:l,children:s(I,{withCommonStyles:!0})})}export{B as AppProvider,j as RedoclyOpenAPIDocsStandalone,_ as loadAndBundleSpecOrMd,k as loadSingle};
1
+ import{jsx as s}from"react/jsx-runtime";import{cloneElement as S,isValidElement as w,useEffect as f,useMemo as x,useState as d}from"react";import{Loading as y}from"@redocly/theme/components/Loaders/Loading";import{useDeepCompareMemoize as v,fixSpec as A}from"./utils.js";import{argValueToBoolean as D}from"../../utils/index.js";import{RedoclyOpenAPIDocs as I}from"./RedoclyOpenAPIDocs.js";import{loadAndBundleDefinition as u}from"../../utils/loadAndBundleSpec.js";async function k(e,n,t){let o;if(t?.skipBundle){if(!e)throw new Error('spec must be specified when using "skipBundleAndConvert"');o=e}else o=await u(e||n);try{A(o)}catch{}return o}function _(e,n){return e.endsWith(".md")?u({openapi:"3.0.0",info:{title:n||"",version:"1.0",description:{$ref:e}},paths:{}}):u(e)}const B=({options:e,definitionUrl:n,definition:t,activeSampleLanguage:o,children:r})=>{const[,l]=d(),[m,c]=d(!0),[i,p]=d(null);f(()=>{async function h(){c(!0);try{p(await k(t,n,e))}catch(g){l(()=>{throw g})}}h()},[t,n,e]);const a=x(()=>{if(i)return e?.unstable_hooks?.onInit&&e.unstable_hooks?.onInit?.({store:{definition:i,options:e,definitionUrl:n,activeSampleLanguage:o}}),{definition:i,options:e,definitionUrl:n,activeSampleLanguage:o}},v([i,e,n]));return f(()=>{a&&c(!1)},[a]),a?m?D(e?.hideLoading,!1)?null:s(y,{color:"--loading-spinner-color"}):w(r)?S(r,{store:a}):null:null};function j({definition:e,definitionUrl:n,options:t={},activeItemId:o,activeSampleLanguage:r,activeDeepLink:l}){return s(B,{definition:e,definitionUrl:n,options:t,activeItemId:o,activeSampleLanguage:r,activeDeepLink:l,children:s(I,{withCommonStyles:!0})})}export{B as AppProvider,j as RedoclyOpenAPIDocsStandalone,_ as loadAndBundleSpecOrMd,k as loadSingle};
@@ -1,6 +1,6 @@
1
- import type { LayoutVariant, UserClaims } from '@redocly/theme';
1
+ import type { UserClaims } from '@redocly/theme/core/openapi';
2
2
  import type { CodeSampleConfig } from '../../services/index.js';
3
- import type { RedocConfig } from '@redocly/config';
3
+ import type { RedocConfig, LayoutVariant } from '@redocly/config';
4
4
  import type { OpenAPIDefinition } from '../../types/index.js';
5
5
  import type { RoutingProps, StoreProps } from '../../hoc/types.js';
6
6
  import type { OperationStore } from '../../jotai/operation';
@@ -1 +1 @@
1
- import{jsx as r,Fragment as U,jsxs as F}from"react/jsx-runtime";import{lazy as B,memo as z,Suspense as J,useCallback as u,useRef as K,useState as M}from"react";import{Button as w,CircleDashIcon as H,Portal as Q,RocketIcon as W,useFocusTrap as X,useModalScrollLock as Y}from"@redocly/theme";import{useAtom as d,useAtomValue as c}from"jotai";import Z from"deepmerge";const $=B(async()=>import("@redocly/replay").then(t=>({default:t.ReplayOverlay})));import{globalOptionsAtom as ee,globalStoreAtom as te}from"../../jotai/store.js";import{allOperationsAtom as oe,replayStateAtom as re}from"../../jotai/replay.js";import{allOperations as ne,getDefaultOperationStore as ae}from"../../jotai/operation.js";import{LOADING_STATE as a}from"../../constants.js";import{environmentAtom as se,userClaimsAtom as ie}from"../../jotai/app.js";import{convertOperationToReplayValueForRedoc as le}from"./utils.js";import{useTranslate as me,useTelemetry as ce}from"../../hooks/index.js";import{JsonPointer as pe}from"../../utils/index.js";import{getDefaultCollectorUrl as ue}from"../../utils/telemetry.js";import{createTryItOpenEvent as de,createTryItSentEvent as ye}from"../../events/index.js";function fe({operation:t,corsProxyUrl:D,fullOpenApi:y}){const f=me(),C=ce(),O=K(null),{mockServer:L,oAuth2RedirectURI:b,routingBasePath:p}=c(ee),I=c(oe),{parser:P,options:{events:s}}=c(te),N=c(ie),[l,E]=M(!1),[m,h]=d(re),[g,v]=d(ne),[[,V],A]=d(se);X(O),Y(l);const _=u(({operations:e,environment:o,environments:i})=>{const j=e.reduce((S,n)=>{n.requestValues.body=n.requestValues.body instanceof URLSearchParams?Object.fromEntries(n.requestValues.body.entries()):n.requestValues.body;const{path:k,method:G}=n.apiPath,T=pe.compile(["paths",k,G]);return S[T]=Z(ae(T),n),S},{});v({...g,...j}),A({environment:o,environments:i})},[g,v,A]),R=()=>{if(m!==a.LOADING){if(!l&&(C.send({type:"openapi_docs.try_it.opened"}),s?.tryItOpen&&t)){const e=de({operation:t});s.tryItOpen(e)}E(!l)}m===a.NOT_LOADED&&h(a.LOADING)},q=u(e=>{if(s?.tryItSent&&t){const o=ye({operation:t,isSuccess:e});s.tryItSent(o)}},[s,t]),x=u(e=>{if(!e)return;const o=I.find(i=>i.operationId===e);return p+o?.href},[I,p]);return y?F(U,{children:[r(w,{onClick:R,variant:"primary",iconPosition:"left",icon:m===a.LOADING?r(H,{}):r(W,{}),children:m===a.LOADING?f("openapi.loading","Loading..."):f("openapi.tryIt","Try it")}),l&&r(J,{children:r(Q,{mountId:"api-content",children:r("div",{ref:O,children:r($,{activeOperationId:t.operationId||t.pointer,api:y,onRequestChange:_,onClose:R,onLoad:()=>h(a.LOADED),settings:{corsProxyUrl:D,mockServer:L,environment:V,apiId:P?.definition.info?.["x-metadata"]?.apiId,oAuth2RedirectURI:b,disableCollectionsTab:!0,storageKey:p,telemetry:{tracerName:"try-it",collectorUrl:ue()},convertOperationToReplayValue:(e,o,i)=>le(N)(e,o,i),getOperationUrl:x},onRequestSent:q})})})})]}):null}const Ee=z(fe);export{Ee as Replay};
1
+ import{jsx as r,Fragment as U,jsxs as F}from"react/jsx-runtime";import{lazy as B,memo as z,Suspense as J,useCallback as u,useRef as K,useState as M}from"react";import{useAtom as f,useAtomValue as p}from"jotai";import w from"deepmerge";const H=B(async()=>import("@redocly/replay").then(t=>({default:t.ReplayOverlay})));import{Button as Q}from"@redocly/theme/components/Button/Button";import{useFocusTrap as W,useModalScrollLock as X}from"@redocly/theme/core/openapi";import{RocketIcon as Y}from"@redocly/theme/icons/RocketIcon/RocketIcon";import{CircleDashIcon as Z}from"@redocly/theme/icons/CircleDashIcon/CircleDashIcon";import{Portal as $}from"@redocly/theme/components/Portal/Portal";import{globalOptionsAtom as ee,globalStoreAtom as te}from"../../jotai/store.js";import{allOperationsAtom as oe,replayStateAtom as re}from"../../jotai/replay.js";import{allOperations as ne,getDefaultOperationStore as ae}from"../../jotai/operation.js";import{LOADING_STATE as a}from"../../constants.js";import{environmentAtom as se,userClaimsAtom as ie}from"../../jotai/app.js";import{convertOperationToReplayValueForRedoc as le}from"./utils.js";import{useTranslate as me,useTelemetry as pe}from"../../hooks/index.js";import{JsonPointer as ce}from"../../utils/index.js";import{getDefaultCollectorUrl as ue}from"../../utils/telemetry.js";import{createTryItOpenEvent as fe,createTryItSentEvent as de}from"../../events/index.js";function ye({operation:t,corsProxyUrl:D,fullOpenApi:d}){const y=me(),C=pe(),O=K(null),{mockServer:L,oAuth2RedirectURI:b,routingBasePath:c}=p(ee),I=p(oe),{parser:P,options:{events:s}}=p(te),N=p(ie),[l,E]=M(!1),[m,h]=f(re),[g,v]=f(ne),[[,V],A]=f(se);W(O),X(l);const _=u(({operations:e,environment:o,environments:i})=>{const j=e.reduce((S,n)=>{n.requestValues.body=n.requestValues.body instanceof URLSearchParams?Object.fromEntries(n.requestValues.body.entries()):n.requestValues.body;const{path:k,method:G}=n.apiPath,T=ce.compile(["paths",k,G]);return S[T]=w(ae(T),n),S},{});v({...g,...j}),A({environment:o,environments:i})},[g,v,A]),R=()=>{if(m!==a.LOADING){if(!l&&(C.send({type:"openapi_docs.try_it.opened"}),s?.tryItOpen&&t)){const e=fe({operation:t});s.tryItOpen(e)}E(!l)}m===a.NOT_LOADED&&h(a.LOADING)},q=u(e=>{if(s?.tryItSent&&t){const o=de({operation:t,isSuccess:e});s.tryItSent(o)}},[s,t]),x=u(e=>{if(!e)return;const o=I.find(i=>i.operationId===e);return c+o?.href},[I,c]);return d?F(U,{children:[r(Q,{onClick:R,variant:"primary",iconPosition:"left",icon:m===a.LOADING?r(Z,{}):r(Y,{}),children:m===a.LOADING?y("openapi.loading","Loading..."):y("openapi.tryIt","Try it")}),l&&r(J,{children:r($,{mountId:"api-content",children:r("div",{ref:O,children:r(H,{activeOperationId:t.operationId||t.pointer,api:d,onRequestChange:_,onClose:R,onLoad:()=>h(a.LOADED),settings:{corsProxyUrl:D,mockServer:L,environment:V,apiId:P?.definition.info?.["x-metadata"]?.apiId,oAuth2RedirectURI:b,disableCollectionsTab:!0,storageKey:c,telemetry:{tracerName:"try-it",collectorUrl:ue()},convertOperationToReplayValue:(e,o,i)=>le(N)(e,o,i),getOperationUrl:x},onRequestSent:q})})})})]}):null}const xe=z(ye);export{xe as Replay};
@@ -1,7 +1,7 @@
1
- import type { UserClaims } from '@redocly/theme';
2
1
  import type { OpenAPIDefinition } from '../../types/index.js';
3
2
  import type { OperationStore } from '../../jotai/operation.js';
4
3
  import type { AppStore } from '../../jotai/app.js';
4
+ import { type UserClaims } from '@redocly/theme/core/openapi';
5
5
  import { type SecurityRequirement } from '../../models/index.js';
6
6
  export declare function convertOperationToReplayValue(path: string, method: string, openAPI: OpenAPIDefinition, userClaims?: UserClaims, operationState?: OperationStore, appState?: AppStore): {
7
7
  id: string;
@@ -1 +1 @@
1
- import{isPrimitive as x}from"@redocly/theme";import{getOperation as h}from"../../models/index.js";import{normalizeOptions as v,OpenAPIParser as b}from"../../services/index.js";import{JsonPointer as E}from"../../utils/index.js";function O(t,a,n,r,e,c){if(!n)return;const i=new b(n),s=i.definition.paths?.[t],d=s?.[a],m=h(i,{...d,pathName:t,httpVerb:a,pathParameters:s.parameters||[],pathServers:s.servers||[]},void 0,v({}),"",{isCallback:!1},r);if(!m)return;const f=c?.activeMimeName||"application/json";return{id:m.id,name:m.name,method:m.httpVerb,operationId:m.operationId,parameters:N(m.parameters,e?.requestValues),body:w(m.requestBody,n,e?.requestValues?.body?{activeExampleName:e?.activeExampleName,[f]:e?.requestValues?.body}:e?.activeExampleName?{activeExampleName:e?.activeExampleName}:void 0),path:m.path,href:m.href,servers:m.servers,security:y(m.security),responses:Object.fromEntries(m.responses.map(u=>[u.code,{code:u.code,description:u.description,mediaTypes:u.content?.mediaTypes.reduce((l,o)=>(l[o.name]={name:o.name,schema:p(o.schema?.rawSchema,n)},l),{})}]))}}function P(t){return function(a,n,r){const e=O(a,n,r,t);if(e)return{...e,operationId:e.operationId||E.compile(["paths",e.path,e.method])}}}function N(t,a){const n=new Set,r=t.map(e=>(n.add(e.in+":"+e.name),{name:e.name,in:e.in,required:e.required,description:e.description,example:a?.[String(e.in)]?.[e.name]||e.example,schema:e.schema}));for(const[e,c]of Object.entries(a||{}))for(const[i,s]of Object.entries(c||{}))n.has(e+":"+i)||r.push({name:i,in:e,required:!1,description:"",example:String(s),schema:void 0});return r}function V({type:t,format:a,enum:n}){return t==="string"&&(a==="binary"||a==="base64")?"file":t==="object"?"multiline":n.length>0?"select":"text"}function g(t,a){const n=t[0]?.example||t[0]?.examples;if(n)return n;if(t.schema?.example)return t.schema.example;const r=a?.default?.value||a?.default?.rawValue;return r?.[t.name]?x(r?.[t.name])?String(r?.[t.name]):JSON.stringify(r?.[t.name]):""}function w(t,a,n){if(!t||!t.content?.mediaTypes){if(!n)return;const{activeExampleName:r,...e}=n;return{activeExampleName:r,mediaTypes:Object.fromEntries(Object.entries(e).map(([c,i])=>[c,{name:c,examples:{default:{value:i}},schema:{},parameters:[]}]))}}return{required:t.required,activeExampleName:n?.activeExampleName,mediaTypes:t.content.mediaTypes.reduce((r,e)=>{const c=e.schema,i=n?.[e.name]?{default:{value:n?.[e.name],rawValue:n?.[e.name],mime:e.name}}:e.examples||e.formExamples;return r[e.name]={name:e.name,examples:i,schema:p(e.schema?.rawSchema,a),parameters:c?.fields?.map(s=>({inputType:V(s.schema),name:s.name,example:g(s,i)}))},r},{})}}function p(t,a){if(!(!t||!a))return{...t,components:a?.components||{}}}function y(t){if(t)return t.map(({schemes:a})=>a.map(n=>{const r={id:n.id,type:n.type,in:n.in,openIdConnectUrl:n.openIdConnectUrl,scopes:n.scopes,scheme:n.scheme,name:n.name,flows:n.flows,"x-defaultAccessToken":n["x-defaultAccessToken"],"x-defaultTokenType":n["x-defaultTokenType"],"x-defaultClientId":n["x-defaultClientId"],"x-defaultClientSecret":n["x-defaultClientSecret"],"x-defaultUsername":n["x-defaultUsername"],"x-defaultPassword":n["x-defaultPassword"]};return Object.keys(r).forEach(e=>r[e]===void 0&&delete r[e]),r}))}export{O as convertOperationToReplayValue,P as convertOperationToReplayValueForRedoc,y as convertRequestSecurity};
1
+ import{isPrimitive as x}from"@redocly/theme/core/openapi";import{getOperation as h}from"../../models/index.js";import{normalizeOptions as v,OpenAPIParser as b}from"../../services/index.js";import{JsonPointer as E}from"../../utils/index.js";function O(t,a,n,r,e,c){if(!n)return;const i=new b(n),s=i.definition.paths?.[t],d=s?.[a],m=h(i,{...d,pathName:t,httpVerb:a,pathParameters:s.parameters||[],pathServers:s.servers||[]},void 0,v({}),"",{isCallback:!1},r);if(!m)return;const f=c?.activeMimeName||"application/json";return{id:m.id,name:m.name,method:m.httpVerb,operationId:m.operationId,parameters:N(m.parameters,e?.requestValues),body:w(m.requestBody,n,e?.requestValues?.body?{activeExampleName:e?.activeExampleName,[f]:e?.requestValues?.body}:e?.activeExampleName?{activeExampleName:e?.activeExampleName}:void 0),path:m.path,href:m.href,servers:m.servers,security:y(m.security),responses:Object.fromEntries(m.responses.map(u=>[u.code,{code:u.code,description:u.description,mediaTypes:u.content?.mediaTypes.reduce((l,o)=>(l[o.name]={name:o.name,schema:p(o.schema?.rawSchema,n)},l),{})}]))}}function P(t){return function(a,n,r){const e=O(a,n,r,t);if(e)return{...e,operationId:e.operationId||E.compile(["paths",e.path,e.method])}}}function N(t,a){const n=new Set,r=t.map(e=>(n.add(e.in+":"+e.name),{name:e.name,in:e.in,required:e.required,description:e.description,example:a?.[String(e.in)]?.[e.name]||e.example,schema:e.schema}));for(const[e,c]of Object.entries(a||{}))for(const[i,s]of Object.entries(c||{}))n.has(e+":"+i)||r.push({name:i,in:e,required:!1,description:"",example:String(s),schema:void 0});return r}function V({type:t,format:a,enum:n}){return t==="string"&&(a==="binary"||a==="base64")?"file":t==="object"?"multiline":n.length>0?"select":"text"}function g(t,a){const n=t[0]?.example||t[0]?.examples;if(n)return n;if(t.schema?.example)return t.schema.example;const r=a?.default?.value||a?.default?.rawValue;return r?.[t.name]?x(r?.[t.name])?String(r?.[t.name]):JSON.stringify(r?.[t.name]):""}function w(t,a,n){if(!t||!t.content?.mediaTypes){if(!n)return;const{activeExampleName:r,...e}=n;return{activeExampleName:r,mediaTypes:Object.fromEntries(Object.entries(e).map(([c,i])=>[c,{name:c,examples:{default:{value:i}},schema:{},parameters:[]}]))}}return{required:t.required,activeExampleName:n?.activeExampleName,mediaTypes:t.content.mediaTypes.reduce((r,e)=>{const c=e.schema,i=n?.[e.name]?{default:{value:n?.[e.name],rawValue:n?.[e.name],mime:e.name}}:e.examples||e.formExamples;return r[e.name]={name:e.name,examples:i,schema:p(e.schema?.rawSchema,a),parameters:c?.fields?.map(s=>({inputType:V(s.schema),name:s.name,example:g(s,i)}))},r},{})}}function p(t,a){if(!(!t||!a))return{...t,components:a?.components||{}}}function y(t){if(t)return t.map(({schemes:a})=>a.map(n=>{const r={id:n.id,type:n.type,in:n.in,openIdConnectUrl:n.openIdConnectUrl,scopes:n.scopes,scheme:n.scheme,name:n.name,flows:n.flows,"x-defaultAccessToken":n["x-defaultAccessToken"],"x-defaultTokenType":n["x-defaultTokenType"],"x-defaultClientId":n["x-defaultClientId"],"x-defaultClientSecret":n["x-defaultClientSecret"],"x-defaultUsername":n["x-defaultUsername"],"x-defaultPassword":n["x-defaultPassword"]};return Object.keys(r).forEach(e=>r[e]===void 0&&delete r[e]),r}))}export{O as convertOperationToReplayValue,P as convertOperationToReplayValueForRedoc,y as convertRequestSecurity};
@@ -1,4 +1,4 @@
1
- import type { TFunction } from '@redocly/theme';
1
+ import type { TFunction } from '@redocly/theme/core/openapi';
2
2
  import type { ReactNode } from 'react';
3
3
  import type { OperationModel } from '../../models';
4
4
  import type { PanelType } from '../../events/types';