@redocly/openapi-docs 3.15.0-next.0 → 3.15.0-next.10

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 (30) hide show
  1. package/dist/redocly-openapi-docs.min.js +4147 -3284
  2. package/lib/components/Download/DownloadSpecification.js +2 -2
  3. package/lib/components/ExpandAllButton/ExpandAllButton.js +1 -1
  4. package/lib/components/Language/LanguageList.js +1 -1
  5. package/lib/components/PanelItem/styled.js +1 -1
  6. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
  7. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js +1 -1
  8. package/lib/components/RedoclyOpenAPIDocs/styled.js +6 -2
  9. package/lib/components/RedoclyOpenAPIDocs/types.d.ts +3 -0
  10. package/lib/components/Replay/Replay.js +1 -1
  11. package/lib/components/RequestSamples/Example.js +1 -1
  12. package/lib/components/RequestSamples/RequestSamples.js +1 -1
  13. package/lib/components/Samples/ExampleSwitch.js +1 -1
  14. package/lib/components/SchemaCatalogLink/tests/SchemaCatalogLink.test.js +1 -1
  15. package/lib/components/ServerListDropdown/ServerListDropdown.js +1 -1
  16. package/lib/hooks/index.d.ts +1 -1
  17. package/lib/hooks/index.js +1 -1
  18. package/lib/hooks/useRouter.js +1 -1
  19. package/lib/jotai/operation.d.ts +1 -1
  20. package/lib/models/group.js +1 -1
  21. package/lib/models/types.d.ts +1 -0
  22. package/lib/services/menu/builder.js +1 -1
  23. package/lib/services/menu/tags.js +2 -2
  24. package/lib/services/types.d.ts +1 -0
  25. package/lib/standalone.js +1 -1
  26. package/lib/types/open-api.d.ts +2 -0
  27. package/lib/utils/loadAndBundleSpec.js +1 -1
  28. package/package.json +11 -9
  29. package/lib/components/RedoclyOpenAPIDocs/Error.d.ts +0 -3
  30. package/lib/components/RedoclyOpenAPIDocs/Error.js +0 -25
@@ -1,4 +1,4 @@
1
- import{jsx as e,Fragment as d,jsxs as s}from"react/jsx-runtime";import{memo as p,useCallback as f}from"react";import{DownloadIcon as x}from"@redocly/theme/icons/DownloadIcon/DownloadIcon";import{getPathPrefix as g,combineUrls as w}from"@redocly/theme/core/openapi";import{Button as b}from"@redocly/theme/components/Button/Button";import{DocumentIcon as h}from"@redocly/theme/icons/DocumentIcon/DocumentIcon";import{JsonIcon as u}from"@redocly/theme/icons/JsonIcon/JsonIcon";import{FileIcon as v}from"@redocly/theme/icons/FileIcon/FileIcon";import{useTelemetry as y}from"../../hooks/index.js";import{styled as r}from"../../styled-components.js";function k({downloadObjects:t}){const l=y(),n=g(),c=f(o=>{switch(o){case"yaml":return e(h,{});case"json":return e(u,{});default:return e(v,{})}},[]);return t?e(C,{children:(t||[]).map(({title:o,url:a,iconType:m})=>{const i=n?w(n,a):a;return s(D,{onClick:()=>{l.sendOpenapiDocsDownloadDefinitionClickedMessage()},children:[s(j,{children:[c(m),e("a",{href:i,target:"_blank",download:!0,rel:"noreferrer",children:o})]}),e("a",{href:i,target:"_blank",download:!0,rel:"noreferrer",children:e(b,{variant:"text",size:"small",icon:e(x,{})})})]},o)})}):e(d,{})}const N=p(k),D=r.div`
1
+ import{jsx as e,Fragment as d,jsxs as s}from"react/jsx-runtime";import{memo as p,useCallback as f}from"react";import{DownloadIcon as x}from"@redocly/theme/icons/DownloadIcon/DownloadIcon";import{getPathPrefix as g,combineUrls as w}from"@redocly/theme/core/openapi";import{Button as b}from"@redocly/theme/components/Button/Button";import{DocumentIcon as h}from"@redocly/theme/icons/DocumentIcon/DocumentIcon";import{JsonIcon as u}from"@redocly/theme/icons/JsonIcon/JsonIcon";import{FileIcon as v}from"@redocly/theme/icons/FileIcon/FileIcon";import{useTelemetry as y}from"../../hooks/index.js";import{styled as r}from"../../styled-components.js";function k({downloadObjects:t}){const l=y(),n=g(),c=f(o=>{switch(o){case"yaml":return e(h,{});case"json":return e(u,{});default:return e(v,{})}},[]);return t?e(C,{children:(t||[]).map(({title:o,url:a,iconType:m})=>{const i=n?w(n,a):a;return s(j,{onClick:()=>{l.sendDownloadDefinitionClickedMessage()},children:[s(D,{children:[c(m),e("a",{href:i,target:"_blank",download:!0,rel:"noreferrer",children:o})]}),e("a",{href:i,target:"_blank",download:!0,rel:"noreferrer",children:e(b,{variant:"text",size:"small",icon:e(x,{})})})]},o)})}):e(d,{})}const N=p(k),j=r.div`
2
2
  display: flex;
3
3
  align-items: baseline;
4
4
  justify-content: space-between;
@@ -10,7 +10,7 @@ import{jsx as e,Fragment as d,jsxs as s}from"react/jsx-runtime";import{memo as p
10
10
  padding-bottom: 0px;
11
11
  border-bottom: none;
12
12
  }
13
- `,j=r.span`
13
+ `,D=r.span`
14
14
  display: flex;
15
15
  width: calc(100% - 25px);
16
16
  gap: var(--spacing-xs);
@@ -1,3 +1,3 @@
1
- import{jsx as n}from"react/jsx-runtime";import{useAtom as m}from"jotai";import{MaximizeIcon as d}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:s})=>{const t=f(),[l,r]=m(x(a)),i=u(),p=()=>{const o=!l[e].expandedAll;i.sendOpenapiDocsExpandCollapseAllClickedMessage({isExpanded:o}),r({[e]:{expandedAll:o}}),s?.(o,e==="request"?"request":"responses")};return n(g,{icon:n(d,{}),iconPosition:"right",size:"small",variant:"ghost",onClick:p,children:l[e].expandedAll?t("openapi.collapseAll","Collapse all"):t("openapi.expandAll","Expand all")})},g=A(c)`
1
+ import{jsx as n}from"react/jsx-runtime";import{useAtom as m}from"jotai";import{MaximizeIcon as d}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:s})=>{const t=f(),[l,r]=m(x(a)),i=u(),p=()=>{const o=!l[e].expandedAll;i.sendExpandCollapseAllClickedMessage({isExpanded:o}),r({[e]:{expandedAll:o}}),s?.(o,e==="request"?"request":"responses")};return n(g,{icon:n(d,{}),iconPosition:"right",size:"small",variant:"ghost",onClick:p,children:l[e].expandedAll?t("openapi.collapseAll","Collapse all"):t("openapi.expandAll","Expand all")})},g=A(c)`
2
2
  margin-left: auto;
3
3
  `;export{k as ExpandAllButton};
@@ -1 +1 @@
1
- import{jsx as a,jsxs as I}from"react/jsx-runtime";import{useLayoutEffect as T,useRef as A,useState as L,useCallback as S,memo as j,useMemo as D}from"react";import{useAtomValue as E,useSetAtom as H}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 R,layoutAtom as _}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 w}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]=L([]),[s,l]=L([]),u=P(),f=A(null),g=E(_),h=H(R),p=e=>{u.sendOpenapiDocsSelectLanguageClickedMessage({language:e})},k=e=>{h(e),p(e)},C=e=>{const m=s.findIndex(r=>r.key===e);if(m!==-1){const r=[...s],c=[...n];y(c,r,m),i(c),l(r),p(e),h(e)}},d=S(()=>{const e=f?.current?.offsetWidth;if(!e)return;const{newVisibleItems:m,newHiddenItems:r}=q(e,[...o]),c=r.findIndex(b=>b.key===t);c!==-1&&y(m,r,c),i(m),l(r)},[t,o]);T(()=>(d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[g,t]);const x=D(()=>n.length>=5||s.length?"space-between":"start",[s.length,n.length]);return I(z,{ref:f,children:[I(M,{$justifyContent:x,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:C,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 g=u===t.length-1&&s.length===0?0:B;o&&n+w+g<=o?(i.push(l),n+=w):s.push(l)}),{newVisibleItems:i,newHiddenItems:s}}function y(o,t,n){const i=o[o.length-1];i&&(o[o.length-1]=t[n],t[n]=i)}export{se as LanguageList};
1
+ import{jsx as a,jsxs as I}from"react/jsx-runtime";import{useLayoutEffect as T,useRef as A,useState as L,useCallback as S,memo as j,useMemo as E}from"react";import{useAtomValue as H,useSetAtom as V}from"jotai";import{Button as W}from"@redocly/theme/components/Button/Button";import{OverflowMenuVerticalIcon as v}from"@redocly/theme/icons/OverflowMenuVerticalIcon/OverflowMenuVerticalIcon";import{LanguageDropdown as D}from"./LanguageDropdown.js";import{languageAtom as R,layoutAtom as _}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 w}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]=L([]),[s,l]=L([]),u=P(),f=A(null),g=H(_),h=V(R),p=e=>{u.sendSelectLanguageClickedMessage({language:e})},k=e=>{h(e),p(e)},C=e=>{const m=s.findIndex(r=>r.key===e);if(m!==-1){const r=[...s],c=[...n];y(c,r,m),i(c),l(r),p(e),h(e)}},d=S(()=>{const e=f?.current?.offsetWidth;if(!e)return;const{newVisibleItems:m,newHiddenItems:r}=q(e,[...o]),c=r.findIndex(b=>b.key===t);c!==-1&&y(m,r,c),i(m),l(r)},[t,o]);T(()=>(d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[g,t]);const x=E(()=>n.length>=5||s.length?"space-between":"start",[s.length,n.length]);return I(z,{ref:f,children:[I(M,{$justifyContent:x,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(D,{activeTab:t,samples:s,onChange:C,trigger:a(W,{icon:a(v,{}),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 g=u===t.length-1&&s.length===0?0:B;o&&n+w+g<=o?(i.push(l),n+=w):s.push(l)}),{newVisibleItems:i,newHiddenItems:s}}function y(o,t,n){const i=o[o.length-1];i&&(o[o.length-1]=t[n],t[n]=i)}export{se as LanguageList};
@@ -16,7 +16,7 @@ import{CheckmarkIcon as o}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon"
16
16
  color: var(--menu-content-title-color);
17
17
  font-size: var(--h6-font-size);
18
18
  line-height: var(--line-height-xsm);
19
- `,l=t.p`
19
+ `,l=t.div`
20
20
  margin: 0;
21
21
  color: var(--text-color-secondary);
22
22
  font-size: var(--font-size-base);
@@ -1 +1 @@
1
- import{jsx as o,jsxs as s,Fragment as C}from"react/jsx-runtime";import{memo as E,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 I}from"@redocly/theme/components/SidebarLogo/SidebarLogo";import{GlobalStyle as j,useMount as D}from"@redocly/theme/core/openapi";import{StoreProvider as M}from"./Providers.js";import{Overlay as N}from"../Overlay.js";import{RedocWrap as _}from"./styled.js";import{StickyResponsiveSidebar as V}from"../StickySidebar/index.js";import{SideMenu as k}from"../SideMenu/index.js";import{Content as v}from"../Content/index.js";import{useContentItems as B,useUppercase2LowercaseRedirect as K,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,E)(({licenseKey:m,onLoaded:a,children:e,options:t,layout:i,collapsedSidebar:d,parser:c,withCommonStyles:y})=>{const b=T(null),{isValid:l,licenseInfo:g}=W(m),R=w(q),u=F();K();const{contentItems:h,flatItems:S}=B({parser:c,options:t});H({sendTelemetry:f=>{const r=Object.fromEntries(Object.entries(f).map(([O,x])=>[O.toLowerCase(),x]));u.sendOpenapiDocsPerformanceMetricsMessage({cls:r.cls,lcp:r.lcp,fcp:r.fcp,ttfb:r.ttfb})}}),D(()=>{if(a?.(),u.sendOpenapiDocsViewedMessage({layout:i}),!t.hideReplay){const f=S.filter(r=>r.type==="operation");R(f)}});const{hideSidebar:P,scrollYOffset:L}=t||{},n=c.definition?.info?.["x-logo"];return s(C,{children:[y&&o(j,{}),s(_,{className:"redoc-wrap",ref:b,children:[!l&&o(N,{licenseInfo:g}),!P&&s(V,{scrollYOffset:L,className:"menu-content",collapsedSidebar:!d,children:[o(I,{imageUrl:n?.url,href:n?.href||c.definition?.info?.contact?.url,altText:n?.altText,backgroundColor:n?.backgroundColor}),o(k,{items:l?h:[]})]}),s(A,{className:"api-content",id:"api-content",layout:i===p.THREE_PANEL?p.THREE_PANEL:p.STACKED,collapsedSidebar:d,children:[o(v,{items:l?h:[],routingBasePath:t.routingBasePath}),e]})]})]})});function ue({onLoaded:m,children:a,store:e,withCommonStyles:t,router:i}){return e?.definition?o(M,{...e,children:o(z,{onLoaded:m,basePath:e.options?.routingBasePath,licenseKey:e.options?.licenseKey,disableRouter:e.options?.disableRouter,withCommonStyles:t,router:i,children:a})}):null}export{ue as RedoclyOpenAPIDocs};
1
+ import{jsx as o,jsxs as s,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 I}from"@redocly/theme/components/SidebarLogo/SidebarLogo";import{GlobalStyle as j,useMount as M}from"@redocly/theme/core/openapi";import{StoreProvider as N}from"./Providers.js";import{Overlay as _}from"../Overlay.js";import{RedocWrap as D}from"./styled.js";import{StickyResponsiveSidebar as V}from"../StickySidebar/index.js";import{SideMenu as k}from"../SideMenu/index.js";import{Content as v}from"../Content/index.js";import{useContentItems as B,useUppercase2LowercaseRedirect as K,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:m,onLoaded:a,children:e,options:t,layout:i,collapsedSidebar:d,parser:c,withCommonStyles:y})=>{const b=T(null),{isValid:l,licenseInfo:g}=W(m),R=w(q),u=F();K();const{contentItems:h,flatItems:S}=B({parser:c,options:t});H({sendTelemetry:f=>{const r=Object.fromEntries(Object.entries(f).map(([x,C])=>[x.toLowerCase(),C]));u.sendPerformanceMetricsMessage({cls:r.cls,lcp:r.lcp,fcp:r.fcp,ttfb:r.ttfb})}}),M(()=>{if(a?.(),u.sendViewedMessage({layout:i}),!t.hideReplay){const f=S.filter(r=>r.type==="operation");R(f)}});const{hideSidebar:P,scrollYOffset:L}=t||{},n=c.definition?.info?.["x-logo"];return s(E,{children:[y&&o(j,{}),s(D,{className:"redoc-wrap",ref:b,children:[!l&&o(_,{licenseInfo:g}),!P&&s(V,{scrollYOffset:L,className:"menu-content",collapsedSidebar:!d,children:[o(I,{imageUrl:n?.url,href:n?.href||c.definition?.info?.contact?.url,altText:n?.altText,backgroundColor:n?.backgroundColor}),o(k,{items:l?h:[]})]}),s(A,{className:"api-content",id:"api-content",layout:i===p.THREE_PANEL?p.THREE_PANEL:p.STACKED,collapsedSidebar:d,children:[o(v,{items:l?h:[],routingBasePath:t.routingBasePath}),e]})]})]})});function ue({onLoaded:m,children:a,store:e,withCommonStyles:t,router:i}){return e?.definition?o(N,{...e,children:o(z,{onLoaded:m,basePath:e.options?.routingBasePath,licenseKey:e.options?.licenseKey,disableRouter:e.options?.disableRouter,withCommonStyles:t,router:i,children:a})}):null}export{ue as RedoclyOpenAPIDocs};
@@ -1 +1 @@
1
- import{jsx as s}from"react/jsx-runtime";import{cloneElement as w,isValidElement as x,useEffect as g,useMemo as A,useState as c}from"react";import{Loading as O}from"@redocly/theme/components/Loaders/Loading";import{useDeepCompareMemoize as D,fixSpec as E}from"./utils.js";import{argValueToBoolean as L}from"../../utils/index.js";import{RedoclyOpenAPIDocs as P}from"./RedoclyOpenAPIDocs.js";import{loadAndBundleDefinition as u,loadOpenapiConfig as B}from"../../utils/loadAndBundleSpec.js";import{ErrorPage as I}from"./Error.js";async function k(e,o,t){let n;if(t?.skipBundle){if(!e)throw new Error('spec must be specified when using "skipBundleAndConvert"');n=e}else n=await u(e||o);try{E(n)}catch{}return n}function _(e,o){return e.endsWith(".md")?u({openapi:"3.0.0",info:{title:o||"",version:"1.0",description:{$ref:e}},paths:{}}):u(e)}const C=({options:e,definitionUrl:o,definition:t,activeSampleLanguage:n,children:r})=>{const[i,l]=c(),[h,f]=c(!0),[d,y]=c(null),[m,S]=c(e||{});g(()=>{async function v(){f(!0);try{const p=await B();S({...e,...p}),y(await k(t,o,e))}catch(p){l(p.message)}}v()},[t,o,e]);const a=A(()=>{if(d)return{definition:d,options:m,definitionUrl:o,activeSampleLanguage:n}},D([d,o,m]));return g(()=>{a&&f(!1)},[a]),i?s(I,{description:i||"Please check path to your OpenAPI description"}):a?h?L(e?.hideLoading,!1)?null:s(O,{color:"--loading-spinner-color"}):x(r)?w(r,{store:a}):null:null};function $({definition:e,definitionUrl:o,options:t={},activeItemId:n,activeSampleLanguage:r,activeDeepLink:i,router:l}){return s(C,{definition:e,definitionUrl:o,options:t,activeItemId:n,activeSampleLanguage:r,activeDeepLink:i,children:s(P,{withCommonStyles:!0,router:l||"hash"})})}export{C as AppProvider,$ as RedoclyOpenAPIDocsStandalone,_ as loadAndBundleSpecOrMd,k as loadSingle};
1
+ import{jsx as u}from"react/jsx-runtime";import{cloneElement as w,isValidElement as x,useEffect as g,useMemo as A,useState as a}from"react";import{Loading as D}from"@redocly/theme/components/Loaders/Loading";import{useDeepCompareMemoize as L,fixSpec as O}from"./utils.js";import{argValueToBoolean as B}from"../../utils/index.js";import{RedoclyOpenAPIDocs as E}from"./RedoclyOpenAPIDocs.js";import{loadAndBundleDefinition as p,loadOpenapiConfig as C}from"../../utils/loadAndBundleSpec.js";async function I(e,o,t){let n;if(t?.skipBundle){if(!e)throw new Error('spec must be specified when using "skipBundleAndConvert"');n=e}else n=await p(e||o);try{O(n)}catch{}return n}function T(e,o){return e.endsWith(".md")?p({openapi:"3.0.0",info:{title:o||"",version:"1.0",description:{$ref:e}},paths:{}}):p(e)}const k=({options:e,definitionUrl:o,definition:t,activeSampleLanguage:n,children:r})=>{const[s,l]=a(),[h,f]=a(!0),[d,y]=a(null),[m,S]=a(e||{});g(()=>{async function v(){f(!0);try{const c=await C();S({...e,...c}),y(await I(t,o,e))}catch(c){l(c.message)}}v()},[t,o,e]);const i=A(()=>{if(d)return{definition:d,options:m,definitionUrl:o,activeSampleLanguage:n}},L([d,o,m]));return g(()=>{i&&f(!1)},[i]),s||!i?null:h?B(e?.hideLoading,!1)?null:u(D,{color:"--loading-spinner-color"}):x(r)?w(r,{store:i}):null};function W({definition:e,definitionUrl:o,options:t={},activeItemId:n,activeSampleLanguage:r,activeDeepLink:s,router:l}){return u(k,{definition:e,definitionUrl:o,options:t,activeItemId:n,activeSampleLanguage:r,activeDeepLink:s,children:u(E,{withCommonStyles:!0,router:l||"hash"})})}export{k as AppProvider,W as RedoclyOpenAPIDocsStandalone,T as loadAndBundleSpecOrMd,I as loadSingle};
@@ -1,4 +1,4 @@
1
- import{styled as t}from"../../styled-components.js";const e=t.div`
1
+ import{styled as o}from"../../styled-components.js";const i=o.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  text-align: left;
@@ -13,9 +13,13 @@ import{styled as t}from"../../styled-components.js";const e=t.div`
13
13
  font-weight: var(--font-weight-regular);
14
14
  color: var(--text-color-primary);
15
15
  -webkit-font-text-smoothing: var(--text-smoothing);
16
+ margin-top: ${({$offset:t})=>t||0}px;
16
17
 
17
18
  * {
18
19
  box-sizing: border-box;
19
20
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
20
21
  }
21
- `;export{e as RedocWrap};
22
+ [id] {
23
+ scroll-margin-top: ${({$offset:t})=>t||0}px;
24
+ }
25
+ `;export{i as RedocWrap};
@@ -29,6 +29,7 @@ export interface StoreProviderProps {
29
29
  }
30
30
  export interface AppProviderProps {
31
31
  definitionUrl?: string;
32
+ disableTelemetry?: boolean;
32
33
  definition?: GenericObject;
33
34
  options?: RedocConfig;
34
35
  activeItemId?: string;
@@ -41,9 +42,11 @@ export interface AppProviderProps {
41
42
  export interface RedoclyOpenAPIDocsStandaloneProps {
42
43
  definition?: GenericObject;
43
44
  definitionUrl?: string;
45
+ disableTelemetry?: boolean;
44
46
  options?: RedocConfig;
45
47
  activeItemId?: string;
46
48
  activeSampleLanguage?: CodeSampleConfig['lang'];
47
49
  activeDeepLink?: string;
48
50
  router?: 'hash' | 'history';
51
+ typeOfUsage?: 'html' | 'cli' | 'react' | 'docker';
49
52
  }
@@ -1 +1 @@
1
- import{jsx as o,Fragment as M,jsxs as z}from"react/jsx-runtime";import{lazy as J,memo as K,Suspense as W,useCallback as m,useRef as w,useState as H}from"react";import{useAtom as u,useAtomValue as p}from"jotai";import Q from"deepmerge";const X=J(async()=>import("@redocly/replay").then(e=>({default:e.ReplayOverlay})));import{Button as Y}from"@redocly/theme/components/Button/Button";import{useFocusTrap as Z,useModalScrollLock as $}from"@redocly/theme/core/openapi";import{RocketIcon as ee}from"@redocly/theme/icons/RocketIcon/RocketIcon";import{CircleDashIcon as te}from"@redocly/theme/icons/CircleDashIcon/CircleDashIcon";import{Portal as oe}from"@redocly/theme/components/Portal/Portal";import{useConfigureReplay as re}from"@redocly/theme/ext/useConfigureReplay";import{globalOptionsAtom as ne,globalStoreAtom as ae}from"../../jotai/store.js";import{allOperationsAtom as se,replayStateAtom as ie}from"../../jotai/replay.js";import{allOperations as le,getDefaultOperationStore as me}from"../../jotai/operation.js";import{LOADING_STATE as n}from"../../constants.js";import{environmentAtom as pe,userClaimsAtom as ce}from"../../jotai/app.js";import{convertOperationToReplayValueForRedoc as fe}from"./utils.js";import{useTranslate as ue,useTelemetry as de}from"../../hooks/index.js";import{JsonPointer as ye}from"../../utils/index.js";import{getDefaultCollectorUrl as he}from"../../utils/telemetry.js";import{createTryItOpenEvent as Oe,createTryItSentEvent as Ie}from"../../events/index.js";import{joinWithSeparator as Re}from"../../services/history/helpers.js";function ge({operation:e,corsProxyUrl:L,fullOpenApi:d}){const y=ue(),P=de(),h=w(null),{mockServer:q,oAuth2RedirectURI:E,routingBasePath:c}=p(ne),O=p(se),{parser:I,options:{events:a}}=p(ae),R=p(ce),[s,N]=H(!1),[l,g]=u(ie),[v,A]=u(le),[[,V],S]=u(pe),{config:j,refresh:T}=re({userClaims:R,info:I?.definition.info,operation:{name:e.name,path:e.path,operationId:e.operationId||"",href:e.href,method:e.httpVerb},servers:e.servers},s);Z(h),$(s);const x=m(()=>T(),[T]),k=m(({operations:t,environment:i,environments:f})=>{const _=t.reduce((C,r)=>{r.requestValues.body=r.requestValues.body instanceof URLSearchParams?Object.fromEntries(r.requestValues.body.entries()):r.requestValues.body;const{path:F,method:B}=r.apiPath,b=ye.compile(["paths",F,B]);return C[b]=Q(me(b),r),C},{});A({...v,..._}),S({environment:i,environments:f})},[v,A,S]),D=()=>{if(l!==n.LOADING){if(!s&&(P.sendOpenapiDocsTryItOpenedMessage(),a?.tryItOpen&&e)){const t=Oe({operation:e});a.tryItOpen(t)}N(!s)}l===n.NOT_LOADED&&g(n.LOADING)},G=m(t=>{if(a?.tryItSent&&e){const i=Ie({operation:e,isSuccess:t});a.tryItSent(i)}},[a,e]),U=m(t=>{if(!t)return;const i=O.find(f=>f.operationId===t);return Re(c,i?.href)},[O,c]);return d?z(M,{children:[o(Y,{onClick:D,variant:"primary",iconPosition:"left",icon:l===n.LOADING?o(te,{}):o(ee,{}),children:l===n.LOADING?y("openapi.loading","Loading..."):y("openapi.tryIt","Try it")}),s&&o(W,{children:o(oe,{mountId:"api-content",children:o("div",{ref:h,children:o(X,{activeOperationId:e.operationId||e.pointer,api:d,onRequestChange:k,onClose:D,onLoad:()=>g(n.LOADED),settings:{corsProxyUrl:L,mockServer:q,selectedEnvironment:V,apiId:I?.definition.info?.["x-metadata"]?.apiId,oAuth2RedirectURI:E,disableCollectionsTab:!0,storageKey:c,telemetry:{tracerName:"try-it",collectorUrl:he()},convertOperationToReplayValue:fe(R,j),getOperationUrl:U,onRequestReset:x},onRequestSent:G})})})})]}):null}const Me=K(ge);export{Me as Replay};
1
+ import{jsx as o,Fragment as M,jsxs as z}from"react/jsx-runtime";import{lazy as J,memo as K,Suspense as W,useCallback as m,useRef as w,useState as H}from"react";import{useAtom as u,useAtomValue as p}from"jotai";import Q from"deepmerge";const X=J(async()=>import("@redocly/replay").then(e=>({default:e.ReplayOverlay})));import{Button as Y}from"@redocly/theme/components/Button/Button";import{useFocusTrap as Z,useModalScrollLock as $}from"@redocly/theme/core/openapi";import{RocketIcon as ee}from"@redocly/theme/icons/RocketIcon/RocketIcon";import{CircleDashIcon as te}from"@redocly/theme/icons/CircleDashIcon/CircleDashIcon";import{Portal as oe}from"@redocly/theme/components/Portal/Portal";import{useConfigureReplay as re}from"@redocly/theme/ext/useConfigureReplay";import{globalOptionsAtom as ne,globalStoreAtom as ae}from"../../jotai/store.js";import{allOperationsAtom as se,replayStateAtom as ie}from"../../jotai/replay.js";import{allOperations as le,getDefaultOperationStore as me}from"../../jotai/operation.js";import{LOADING_STATE as n}from"../../constants.js";import{environmentAtom as pe,userClaimsAtom as ce}from"../../jotai/app.js";import{convertOperationToReplayValueForRedoc as fe}from"./utils.js";import{useTranslate as ue,useTelemetry as de}from"../../hooks/index.js";import{JsonPointer as ye}from"../../utils/index.js";import{getDefaultCollectorUrl as he}from"../../utils/telemetry.js";import{createTryItOpenEvent as Oe,createTryItSentEvent as Ie}from"../../events/index.js";import{joinWithSeparator as Re}from"../../services/history/helpers.js";function ge({operation:e,corsProxyUrl:L,fullOpenApi:d}){const y=ue(),P=de(),h=w(null),{mockServer:q,oAuth2RedirectURI:E,routingBasePath:c}=p(ne),O=p(se),{parser:I,options:{events:a}}=p(ae),R=p(ce),[s,N]=H(!1),[l,g]=u(ie),[v,A]=u(le),[[,V],S]=u(pe),{config:j,refresh:T}=re({userClaims:R,info:I?.definition.info,operation:{name:e.name,path:e.path,operationId:e.operationId||"",href:e.href,method:e.httpVerb},servers:e.servers},s);Z(h),$(s);const x=m(()=>T(),[T]),k=m(({operations:t,environment:i,environments:f})=>{const _=t.reduce((C,r)=>{r.requestValues.body=r.requestValues.body instanceof URLSearchParams?Object.fromEntries(r.requestValues.body.entries()):r.requestValues.body;const{path:F,method:B}=r.apiPath,b=ye.compile(["paths",F,B]);return C[b]=Q(me(b),r),C},{});A({...v,..._}),S({environment:i,environments:f})},[v,A,S]),D=()=>{if(l!==n.LOADING){if(!s&&(P.sendTryItOpenedMessage(),a?.tryItOpen&&e)){const t=Oe({operation:e});a.tryItOpen(t)}N(!s)}l===n.NOT_LOADED&&g(n.LOADING)},G=m(t=>{if(a?.tryItSent&&e){const i=Ie({operation:e,isSuccess:t});a.tryItSent(i)}},[a,e]),U=m(t=>{if(!t)return;const i=O.find(f=>f.operationId===t);return Re(c,i?.href)},[O,c]);return d?z(M,{children:[o(Y,{onClick:D,variant:"primary",iconPosition:"left",icon:l===n.LOADING?o(te,{}):o(ee,{}),children:l===n.LOADING?y("openapi.loading","Loading..."):y("openapi.tryIt","Try it")}),s&&o(W,{children:o(oe,{mountId:"api-content",children:o("div",{ref:h,children:o(X,{activeOperationId:e.operationId||e.pointer,api:d,onRequestChange:k,onClose:D,onLoad:()=>g(n.LOADED),settings:{corsProxyUrl:L,mockServer:q,selectedEnvironment:V,apiId:I?.definition.info?.["x-metadata"]?.apiId,oAuth2RedirectURI:E,disableCollectionsTab:!0,storageKey:c,telemetry:{tracerName:"try-it",collectorUrl:he()},convertOperationToReplayValue:fe(R,j),getOperationUrl:U,onRequestReset:x},onRequestSent:G})})})})]}):null}const Me=K(ge);export{Me as Replay};
@@ -1 +1 @@
1
- import{jsx as c,Fragment as f,jsxs as h}from"react/jsx-runtime";import{memo as u}from"react";import{useAtom as E}from"jotai";import{ExampleSwitch as g,useExampleKey as O}from"../Samples/index.js";import{useActivateExample as j,useTelemetry as C}from"../../hooks/index.js";import{operationStore as d}from"../../jotai/operation.js";function v({mediaType:o,mediaContent:p,renderSample:n}){const r=C(),m=o.operation.pointer,[l,x]=E(d(m)),a=o.examples||{},e=Object.keys(a),i=j(p),{exampleKey:s}=O(o.operation,a);return!e.length||e.length===1?n():h(f,{children:[c(g,{examples:a,exampleKey:s,onChange:t=>{r.sendOpenapiDocsExamplesSwitcherClickedMessage({example:t,numberOfExamples:e.length}),x({...l,activeExampleName:t,activeOneOf:{[m]:e.indexOf(t)},requestValues:{body:null}}),i(t)}}),n(s)]})}const N=u(v);export{N as Example};
1
+ import{jsx as c,Fragment as f,jsxs as h}from"react/jsx-runtime";import{memo as u}from"react";import{useAtom as E}from"jotai";import{ExampleSwitch as g,useExampleKey as O}from"../Samples/index.js";import{useActivateExample as d,useTelemetry as j}from"../../hooks/index.js";import{operationStore as C}from"../../jotai/operation.js";function v({mediaType:o,mediaContent:r,renderSample:m}){const l=j(),n=o.operation.pointer,[p,x]=E(C(n)),a=o.examples||{},e=Object.keys(a),i=d(r),{exampleKey:s}=O(o.operation,a);return!e.length||e.length===1?m():h(f,{children:[c(g,{examples:a,exampleKey:s,onChange:t=>{l.sendExamplesSwitcherClickedMessage({exampleNumber:e.indexOf(t),totalExamples:e.length}),x({...p,activeExampleName:t,activeOneOf:{[n]:e.indexOf(t)},requestValues:{body:null}}),i(t)}}),m(s)]})}const F=u(v);export{F as Example};
@@ -1,4 +1,4 @@
1
- import{jsx as o,jsxs as N}from"react/jsx-runtime";import{memo as T,useCallback as L,useMemo as k}from"react";import{useAtomValue as y,useAtom as O}from"jotai";import{PanelHeader as U}from"@redocly/theme/components/Panel/PanelHeader";import{PayloadSamples as W}from"../PayloadSamples/index.js";import{CodeSample as B}from"./CodeSample.js";import{useCodeSamples as F}from"./useCodeSamples.js";import{isPayloadSample as H}from"../../models/index.js";import{createCodeSampleCopyEvent as _,createLanguageSwitchEvent as V}from"../../events/index.js";import{globalStoreAtom as $}from"../../jotai/store.js";import{ServerListDropdown as z}from"../ServerListDropdown/index.js";import{LanguageDropdown as G}from"../Language/index.js";import{activeMimeNameAtom as J,languageAtom as K}from"../../jotai/app.js";import{Replay as A}from"../Replay/index.js";import{CodeBlockPanel as w}from"../common/index.js";import{useActiveWithFallback as Q,useTelemetry as X}from"../../hooks/index.js";import{operationStore as Y}from"../../jotai/operation.js";import{styled as S}from"../../styled-components.js";function Z({operation:a,disableFooter:P,onPanelToggle:v,...p}){const m=X(),[{activeLanguage:q,languages:c},R]=O(K),{samples:n}=F(a),{parser:d,options:{events:l,corsProxyUrl:g,hideReplay:E}}=y($),i=!P&&!a.isWebhook&&!E&&!a.hideReplay,t=!!c?.length,u=Q(n,q),j=e=>{R(e),m.sendOpenapiDocsSelectLanguageClickedMessage({language:e});const r=c?.find(s=>s.key===e);if(l?.codeSamplesLanguageSwitch&&r){const s=V({operation:a,sample:{lang:r.lang,label:r.title}});l.codeSamplesLanguageSwitch(s)}},h=y(J),{activeExampleName:C}=y(Y(a.pointer)),f=L(({lang:e,title:r})=>()=>{const s=_({operation:a,label:r,lang:e,type:"request",activeMimeName:h,activeExampleName:C});m.sendCopyCodeSnippetClickedMessage({snippetType:"request",language:e}),l?.codeSamplesCopy?.(s)},[a,m,l,h,C]),x=L(e=>{v?.(e,"request-samples")},[v]),b=()=>N(I,{isExpandable:!1,withReplay:!t&&i,children:[o(ee,{operation:a}),t&&o(G,{activeTab:u,samples:n,onChange:j}),!t&&i&&o(A,{operation:a,corsProxyUrl:g,fullOpenApi:d.definition})]}),D=k(()=>{if(i&&t)return o(ae,{children:o(A,{operation:a,corsProxyUrl:g,fullOpenApi:d.definition})})},[i,t,a,g,d.definition]),M=k(()=>n.map(e=>e.key===u?o("div",{children:H(e)?o(W,{content:e.requestBodyContent,onCopyClick:f(e),onPanelToggle:x,...p}):o(B,{lang:e.lang,source:e.source,externalSample:e,operation:a,onCopyClick:f(e),...p})},e.key+a.id):null),[u,f,x,a,p,n]);return c&&!n.length?o(w,{className:"panel-request-samples",header:b,isExpandable:!1,expanded:!1}):n.length?o(w,{className:"panel-request-samples",header:b,footer:D,isExpandable:!1,children:M}):null}const Ce=T(Z),I=S(U)`
1
+ import{jsx as o,jsxs as D}from"react/jsx-runtime";import{memo as T,useCallback as L,useMemo as k}from"react";import{useAtomValue as y,useAtom as U}from"jotai";import{PanelHeader as W}from"@redocly/theme/components/Panel/PanelHeader";import{PayloadSamples as B}from"../PayloadSamples/index.js";import{CodeSample as F}from"./CodeSample.js";import{useCodeSamples as H}from"./useCodeSamples.js";import{isPayloadSample as O}from"../../models/index.js";import{createCodeSampleCopyEvent as _,createLanguageSwitchEvent as V}from"../../events/index.js";import{globalStoreAtom as $}from"../../jotai/store.js";import{ServerListDropdown as z}from"../ServerListDropdown/index.js";import{LanguageDropdown as G}from"../Language/index.js";import{activeMimeNameAtom as J,languageAtom as K}from"../../jotai/app.js";import{Replay as A}from"../Replay/index.js";import{CodeBlockPanel as w}from"../common/index.js";import{useActiveWithFallback as Q,useTelemetry as X}from"../../hooks/index.js";import{operationStore as Y}from"../../jotai/operation.js";import{styled as S}from"../../styled-components.js";function Z({operation:a,disableFooter:P,onPanelToggle:v,...p}){const m=X(),[{activeLanguage:q,languages:c},R]=U(K),{samples:n}=H(a),{parser:d,options:{events:l,corsProxyUrl:g,hideReplay:E}}=y($),i=!P&&!a.isWebhook&&!E&&!a.hideReplay,t=!!c?.length,u=Q(n,q),j=e=>{R(e),m.sendSelectLanguageClickedMessage({language:e});const r=c?.find(s=>s.key===e);if(l?.codeSamplesLanguageSwitch&&r){const s=V({operation:a,sample:{lang:r.lang,label:r.title}});l.codeSamplesLanguageSwitch(s)}},h=y(J),{activeExampleName:C}=y(Y(a.pointer)),f=L(({lang:e,title:r})=>()=>{const s=_({operation:a,label:r,lang:e,type:"request",activeMimeName:h,activeExampleName:C});m.sendCopyCodeSnippetClickedMessage({snippetType:"request",language:e}),l?.codeSamplesCopy?.(s)},[a,m,l,h,C]),x=L(e=>{v?.(e,"request-samples")},[v]),b=()=>D(I,{isExpandable:!1,withReplay:!t&&i,children:[o(ee,{operation:a}),t&&o(G,{activeTab:u,samples:n,onChange:j}),!t&&i&&o(A,{operation:a,corsProxyUrl:g,fullOpenApi:d.definition})]}),M=k(()=>{if(i&&t)return o(ae,{children:o(A,{operation:a,corsProxyUrl:g,fullOpenApi:d.definition})})},[i,t,a,g,d.definition]),N=k(()=>n.map(e=>e.key===u?o("div",{children:O(e)?o(B,{content:e.requestBodyContent,onCopyClick:f(e),onPanelToggle:x,...p}):o(F,{lang:e.lang,source:e.source,externalSample:e,operation:a,onCopyClick:f(e),...p})},e.key+a.id):null),[u,f,x,a,p,n]);return c&&!n.length?o(w,{className:"panel-request-samples",header:b,isExpandable:!1,expanded:!1}):n.length?o(w,{className:"panel-request-samples",header:b,footer:M,isExpandable:!1,children:N}):null}const Ce=T(Z),I=S(W)`
2
2
  flex-wrap: nowrap;
3
3
  ${({withReplay:a})=>a&&"padding: var(--spacing-xs) var(--spacing-sm);"}
4
4
  `,ee=S(z)`
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import{useState as d,useEffect as h}from"react";import{MimeLabel as x,Container as v,Select as S}from"../common/index.js";import{SelectOrLabel as b}from"../SelectOrLabel/index.js";import{normalizeText as g}from"../../utils/index.js";import{useTelemetry as O}from"../../hooks/index.js";const I=({exampleKey:s,examples:o,onChange:m,className:i})=>{const c=O(),t=Object.keys(o),r=s?t.indexOf(s):0,[p,l]=d(r>-1?r:0);h(()=>l(r>-1?r:0),[s,r]);const a=t.map((e,f)=>({value:g(o[e].summary)||e,idx:f})),u=({idx:e})=>{c.sendOpenapiDocsExamplesSwitcherClickedMessage({example:t[e],numberOfExamples:t.length}),l(e),m(t[e])};return a.length<2?null:n(v,{"data-testid":"example-switch",className:i,children:n(b,{Select:S,Label:x,variant:"dark",fullWidth:!0,options:a,value:a[p]?.value,onChange:u})})};export{I as ExampleSwitch};
1
+ import{jsx as n}from"react/jsx-runtime";import{useState as d,useEffect as h}from"react";import{MimeLabel as x,Container as v,Select as S}from"../common/index.js";import{SelectOrLabel as b}from"../SelectOrLabel/index.js";import{normalizeText as g}from"../../utils/index.js";import{useTelemetry as C}from"../../hooks/index.js";const L=({exampleKey:a,examples:s,onChange:m,className:i})=>{const c=C(),r=Object.keys(s),t=a?r.indexOf(a):0,[u,l]=d(t>-1?t:0);h(()=>l(t>-1?t:0),[a,t]);const o=r.map((e,f)=>({value:g(s[e].summary)||e,idx:f})),p=({idx:e})=>{c.sendExamplesSwitcherClickedMessage({exampleNumber:e,totalExamples:r.length}),l(e),m(r[e])};return o.length<2?null:n(v,{"data-testid":"example-switch",className:i,children:n(b,{Select:S,Label:x,variant:"dark",fullWidth:!0,options:o,value:o[u]?.value,onChange:p})})};export{L as ExampleSwitch};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{render as s}from"@testing-library/react";import*as o from"jotai";import{SchemaCatalogLink as a}from"../SchemaCatalogLink";jest.mock("jotai",()=>({...jest.requireActual("jotai"),useAtomValue:jest.fn()})),describe("SchemaCatalogLink",()=>{it("should render correctly",()=>{jest.spyOn(o,"useAtomValue").mockReturnValue({parser:{definition:{"x-schema-catalog-link":"/_bundle/test.yaml"}}});const e=s(t(a,{schemaRef:"#/components/schemas/test"}));expect(e.baseElement).toMatchSnapshot()}),it("should not render if x-schema-catalog-link is not defined",()=>{jest.spyOn(o,"useAtomValue").mockReturnValue({parser:{definition:{}}});const e=s(t(a,{schemaRef:"#/components/schemas/test"}));expect(e.baseElement).toMatchSnapshot()})});
1
+ import{jsx as t}from"react/jsx-runtime";import{render as s,fireEvent as l}from"@testing-library/react";import*as o from"jotai";import{SchemaCatalogLink as a}from"../SchemaCatalogLink";jest.mock("jotai",()=>({...jest.requireActual("jotai"),useAtomValue:jest.fn()})),jest.mock("../../../utils/dom",()=>({...jest.requireActual("../../../utils/dom"),IS_BROWSER:!0})),describe("SchemaCatalogLink",()=>{beforeEach(()=>{jest.clearAllMocks(),jest.useFakeTimers(),Object.defineProperty(global,"navigator",{value:{clipboard:{writeText:jest.fn()}},writable:!0})}),afterEach(()=>{jest.useRealTimers()}),it("should render correctly",()=>{jest.spyOn(o,"useAtomValue").mockReturnValue({parser:{definition:{"x-schema-catalog-link":"/_bundle/test.yaml"}}});const e=s(t(a,{schemaRef:"#/components/schemas/test"}));expect(e.baseElement).toMatchSnapshot()}),it("should not render if x-schema-catalog-link is not defined",()=>{jest.spyOn(o,"useAtomValue").mockReturnValue({parser:{definition:{}}});const e=s(t(a,{schemaRef:"#/components/schemas/test"}));expect(e.baseElement).toMatchSnapshot()}),it("should render correctly on server",()=>{jest.mock("../../../utils/dom",()=>({...jest.requireActual("../../../utils/dom"),IS_BROWSER:jest.fn().mockReturnValue(!1)})),jest.spyOn(o,"useAtomValue").mockReturnValue({parser:{definition:{"x-schema-catalog-link":"/_bundle/test.yaml"}}});const e=s(t(a,{schemaRef:"#/components/schemas/test"}));expect(e.baseElement).toMatchSnapshot()}),it("should copy link to clipboard when copy button is clicked",async()=>{jest.mock("../../../utils/dom",()=>({...jest.requireActual("../../../utils/dom"),IS_BROWSER:jest.fn().mockReturnValue(!0)})),jest.spyOn(o,"useAtomValue").mockReturnValue({parser:{definition:{"x-schema-catalog-link":"/_bundle/test.yaml"}}});const{getByRole:e,findByText:n}=s(t(a,{schemaRef:"#/components/schemas/test"})),c=e("button");l.click(c),expect(await n("Copied!")).toBeDefined()})});
@@ -1 +1 @@
1
- import{jsx as t,jsxs as d}from"react/jsx-runtime";import{useMemo as f,useCallback as l}from"react";import{useAtom as S,useAtomValue as g}from"jotai";import{DropdownMenu as w}from"@redocly/theme/components/Dropdown/DropdownMenu";import{Dropdown as y}from"@redocly/theme/components/Dropdown/Dropdown";import{HttpVerb as k}from"../common/index.js";import{PathWrapper as A,Path as C,StyledCopyButton as b,StyledDropdownMenuItem as D}from"./styled.js";import{PanelItem as P}from"../PanelItem/index.js";import{joinWithSeparator as j}from"../../services/index.js";import{getServerDisplayName as x,replaceVariables as V}from"../../utils/index.js";import{environmentAtom as M}from"../../jotai/app.js";import{useActiveWithFallback as E,useTelemetry as N}from"../../hooks/index.js";import{getServerEnvName as p}from"../../utils/environments.js";import{createTargetServerSwitchEvent as W}from"../../events/index.js";import{globalStoreAtom as I}from"../../jotai/store.js";const X=({operation:r,className:h})=>{const n=N(),[[v],i]=S(M),{options:{events:m}}=g(I),s=E(r.servers.map(e=>({...e,key:e.url})),v.server),a=l(e=>{e.stopPropagation()},[]),c=l(e=>()=>{if(r.servers.length!==1&&(i({environment:p(e)}),n.sendOpenapiDocsSwitchServersClickedMessage({server:p(e)}),m?.targetServerSwitch&&e)){const o=W({operation:r,serverUrl:e.url});m.targetServerSwitch(o)}},[r,i,n,m]),u=f(()=>r.servers.map(e=>{const o=j(V(e),r.path);return t(D,{onAction:c(e),children:t(P,{header:x(e),title:o,actions:[t(b,{data:o,toasterPlacement:"left",onCopyClick:a},o)],active:e.url===s,withCheckmark:!0})},o)}),[r.servers,r.path,c,a,s]);return t(y,{className:h,trigger:d(A,{variant:"ghost",children:[t(k,{color:r.httpVerb,children:r.httpVerb}),t(C,{children:r.path})]}),withArrow:!0,children:t(w,{children:u})})};export{X as ServerListDropdown};
1
+ import{jsx as t,jsxs as d}from"react/jsx-runtime";import{useMemo as f,useCallback as c}from"react";import{useAtom as S,useAtomValue as g}from"jotai";import{DropdownMenu as w}from"@redocly/theme/components/Dropdown/DropdownMenu";import{Dropdown as y}from"@redocly/theme/components/Dropdown/Dropdown";import{HttpVerb as k}from"../common/index.js";import{PathWrapper as A,Path as C,StyledCopyButton as b,StyledDropdownMenuItem as P}from"./styled.js";import{PanelItem as j}from"../PanelItem/index.js";import{joinWithSeparator as x}from"../../services/index.js";import{getServerDisplayName as D,replaceVariables as V}from"../../utils/index.js";import{environmentAtom as M}from"../../jotai/app.js";import{useActiveWithFallback as E,useTelemetry as N}from"../../hooks/index.js";import{getServerEnvName as p}from"../../utils/environments.js";import{createTargetServerSwitchEvent as W}from"../../events/index.js";import{globalStoreAtom as I}from"../../jotai/store.js";const X=({operation:e,className:h})=>{const n=N(),[[v],i]=S(M),{options:{events:m}}=g(I),s=E(e.servers.map(r=>({...r,key:r.url})),v.server),a=c(r=>{r.stopPropagation()},[]),l=c(r=>()=>{if(e.servers.length!==1&&(i({environment:p(r)}),n.sendSwitchServersClickedMessage({server:p(r)}),m?.targetServerSwitch&&r)){const o=W({operation:e,serverUrl:r.url});m.targetServerSwitch(o)}},[e,i,n,m]),u=f(()=>e.servers.map(r=>{const o=x(V(r),e.path);return t(P,{onAction:l(r),children:t(j,{header:D(r),title:o,actions:[t(b,{data:o,toasterPlacement:"left",onCopyClick:a},o)],active:r.url===s,withCheckmark:!0})},o)}),[e.servers,e.path,l,a,s]);return t(y,{className:h,trigger:d(A,{variant:"ghost",children:[t(k,{color:e.httpVerb,children:e.httpVerb}),t(C,{children:e.path})]}),withArrow:!0,children:t(w,{children:u})})};export{X as ServerListDropdown};
@@ -3,6 +3,6 @@ export { useRouter } from './useRouter.js';
3
3
  export { useContentItems } from './useContentItems.js';
4
4
  export { useActiveWithFallback } from './useActiveWithFallback.js';
5
5
  export { useTranslate } from './useTranslate.js';
6
- export { useUppercase2LowercaseRedirect } from './useUppercase2LowercaseRedirect.js';
7
6
  export { useTelemetry } from './useTelemetry.js';
7
+ export { useUppercase2LowercaseRedirect } from './useUppercase2LowercaseRedirect.js';
8
8
  export { usePerformanceMetrics } from './usePerformanceMetrics.js';
@@ -1 +1 @@
1
- import{useActivateExample as o}from"./useActivateExample.js";import{useRouter as s}from"./useRouter.js";import{useContentItems as p}from"./useContentItems.js";import{useActiveWithFallback as f}from"./useActiveWithFallback.js";import{useTranslate as x}from"./useTranslate.js";import{useUppercase2LowercaseRedirect as i}from"./useUppercase2LowercaseRedirect.js";import{useTelemetry as n}from"./useTelemetry.js";import{usePerformanceMetrics as A}from"./usePerformanceMetrics.js";export{o as useActivateExample,f as useActiveWithFallback,p as useContentItems,A as usePerformanceMetrics,s as useRouter,n as useTelemetry,x as useTranslate,i as useUppercase2LowercaseRedirect};
1
+ import{useActivateExample as o}from"./useActivateExample.js";import{useRouter as s}from"./useRouter.js";import{useContentItems as p}from"./useContentItems.js";import{useActiveWithFallback as f}from"./useActiveWithFallback.js";import{useTranslate as x}from"./useTranslate.js";import{useTelemetry as i}from"./useTelemetry.js";import{useUppercase2LowercaseRedirect as n}from"./useUppercase2LowercaseRedirect.js";import{usePerformanceMetrics as A}from"./usePerformanceMetrics.js";export{o as useActivateExample,f as useActiveWithFallback,p as useContentItems,A as usePerformanceMetrics,s as useRouter,i as useTelemetry,x as useTranslate,n as useUppercase2LowercaseRedirect};
@@ -1 +1 @@
1
- import{BrowserRouter as s,HashRouter as m,MemoryRouter as n}from"react-router-dom";const u={history:s,memory:n,hash:m},a=(o,r)=>{const e=u[o],t={...o!=="memory"&&{basename:r}};return{Router:e,routerProps:t}};export{a as useRouter};
1
+ import{BrowserRouter as s,HashRouter as a,MemoryRouter as n}from"react-router-dom";const m={history:s,memory:n,hash:a},R=(e,o)=>{const r=m[e],t={...e!=="memory"&&{basename:o,feature:{v7_startTransition:!1,v7_relativeSplatPath:!1}}};return{Router:r,routerProps:t}};export{R as useRouter};
@@ -19,7 +19,7 @@ export declare function getDefaultOperationStore(pointer: string, requestValues?
19
19
  }, activeExampleName?: string): {
20
20
  activeExampleName: string | undefined;
21
21
  activeOneOf: {
22
- [x: string]: number;
22
+ [pointer]: number;
23
23
  };
24
24
  requestValues: {
25
25
  [field: string]: any;
@@ -1 +1 @@
1
- import{REDOCLY_TEAMS_RBAC as n}from"@redocly/config";import{joinWithSeparator as x}from"../services/index.js";import{getValueFromMdParsedExtension as S,safeSlugify as o}from"../utils/index.js";import{getHref as v}from"../services/menu/operation.js";import{saveTextBeforeHeading as C}from"../utils/saveTextBeforeHeading.js";function B(m,e,i){let s;i?.id&&(m==="schema"||m==="mcp")?s=x(i.id,o(e.name)):s=e.id||o(e.name);const t=e["x-displayName"]||e.name,c=e.level||1,d=e.isSchema,f=e.ast||void 0,l=C(S(e,"description")||""),a=e.items||[],h=e.externalDocs;return{id:s.toLowerCase(),type:m,parent:i,name:t,level:c,depth:0,isSchema:d,description:l,items:a,ast:f,externalDocs:h,href:v({id:s}),[n]:e[n]||i?.[n]}}export{B as getTagOrGroup};
1
+ import{REDOCLY_TEAMS_RBAC as m}from"@redocly/config";import{joinWithSeparator as h}from"../services/index.js";import{getValueFromMdParsedExtension as S,safeSlugify as o}from"../utils/index.js";import{getHref as v}from"../services/menu/operation.js";import{saveTextBeforeHeading as w}from"../utils/saveTextBeforeHeading.js";function r(i,e,s){let n;s?.id&&(i==="schema"||i==="mcp")?n=h(s.id,o(e.name)):n=e.id||o(e.name);const d=e["x-displayName"]||e.name,c=e.level||1,t=e.isSchema,f=e.ast||void 0,l=w(S(e,"description")||""),a=e.items||[],x=e.externalDocs;return{id:n.toLowerCase(),type:i,parent:s,name:d,level:c,depth:0,isSchema:t,description:l,items:a,ast:f,externalDocs:x,href:v({id:n}),[m]:e[m]||s?.[m],keywords:i==="tag"?e["x-keywords"]:void 0}}export{r as getTagOrGroup};
@@ -195,6 +195,7 @@ export type GroupModel = {
195
195
  depth: number;
196
196
  level: number;
197
197
  [REDOCLY_TEAMS_RBAC]?: Record<string, string>;
198
+ keywords?: unknown;
198
199
  };
199
200
  export type OperationMenuItem = {
200
201
  id: string;
@@ -1 +1 @@
1
- import{getTagGroupsItems as d,getTagsItems as c,getTagsWithOperations as p}from"./tags.js";import{addMarkdownItems as g}from"./markdown.js";import{flattenByProp as h,getValueFromMdParsedExtension as l}from"../../utils/index.js";import{DEFAULT_WEBHOOKS_TAG_NAME as r}from"../../constants.js";function x(o,s){const{definition:e}=o,{schemaDefinitionsTagName:i}=s,a=[{id:"",name:e?.info?.["x-seo"]?.title||e?.info?.title||"Overview",href:"/",depth:1,level:1,type:"section",infoDefinition:e.info,items:[]}],t=[...e.tags||[]];if(t.some(n=>n.name===r)||t.push({name:r}),!t.find(n=>n?.name===i)&&i&&t.push({name:i}),e["x-mcp"])for(const n of["Tools","Resources","Prompts"])e["x-mcp"][n]&&(t.find(u=>u?.name===n)||t.push({name:n}));const m=p(o,t),f=e["x-tagGroups"];return a.push(...g(l(e.info,"description")||"",void 0,1)),f&&f.length>0?a.push(...d(o,void 0,f,m,s)):a.push(...c(o,m,void 0,void 0,s)),a}function O(o,s){const e=x(o,s),i=h(e||[],"items");return{contentItems:e,flatItems:i}}export{O as buildContentItems,x as buildMenuStructure};
1
+ import{getTagGroupsItems as d,getTagsItems as c,getTagsWithOperations as p}from"./tags.js";import{addMarkdownItems as g}from"./markdown.js";import{flattenByProp as h,getValueFromMdParsedExtension as l}from"../../utils/index.js";import{DEFAULT_WEBHOOKS_TAG_NAME as r}from"../../constants.js";function x(o,s){const{definition:e}=o,{schemaDefinitionsTagName:i}=s,a=[{id:"",name:e?.info?.["x-seo"]?.title||e?.info?.title||"Overview",href:"/",depth:1,level:1,type:"section",infoDefinition:e.info,items:[],keywords:e["x-keywords"]}],t=[...e.tags||[]];if(t.some(n=>n.name===r)||t.push({name:r}),!t.find(n=>n?.name===i)&&i&&t.push({name:i}),e["x-mcp"])for(const n of["Tools","Resources","Prompts"])e["x-mcp"][n]&&(t.find(u=>u?.name===n)||t.push({name:n}));const m=p(o,t),f=e["x-tagGroups"];return a.push(...g(l(e.info,"description")||"",void 0,1)),f&&f.length>0?a.push(...d(o,void 0,f,m,s)):a.push(...c(o,m,void 0,void 0,s)),a}function E(o,s){const e=x(o,s),i=h(e||[],"items");return{contentItems:e,flatItems:i}}export{E as buildContentItems,x as buildMenuStructure};
@@ -1,2 +1,2 @@
1
- import{getTagOrGroup as d}from"../../models/group.js";import{DEFAULT_WEBHOOKS_TAG_NAME as l,GROUP_DEPTH as g}from"../../constants.js";import{getValueFromMdParsedExtension as h,isOperationName as S,JsonPointer as $,safeSlugify as N}from"../../utils/index.js";import{getOperationsItems as T}from"./operation.js";import{addMarkdownItems as x}from"./markdown.js";import{joinWithSeparator as b}from"../history/helpers.js";const y=["tools"];function k(s,c,o,e,a){let t;if(e===void 0?t=Object.keys(c):t=e.tags,!Array.isArray(t))return console.warn("Unexpected values of tags. Check tags or x-tagGroups in your definition."),[];const f=t.map(n=>c[n]?(c[n].used=!0,c[n]):(console.warn(`Non-existing tag "${n}" is added to the group "${e?.name}"`),null)),i=[];for(const n of f){if(!n)continue;const r=d("tag",n,o);if(r.depth=g+1,n.name===""){const P=[...x(h(n,"description")||"",r,r.depth+1),...T(void 0,n,r.depth+1)];i.push(...P);continue}const p=v({definition:s.definition,tag:n,parent:r,schemaDefinitionsTagName:a.schemaDefinitionsTagName}),m=w(s.definition,n,r);r.items=[...p,...m,...x(h(n,"description")||"",r,r.depth+1),...T(r,n,r.depth+1)],i.push(r)}return i.filter(({name:n,items:r})=>n!==l||r.length>0)}function R(s,c,o,e,a){const t=[];for(const f of o){const i=d("group",f,c);i.depth=g,i.items=k(s,e,i,f,a),t.push(i)}return t}function v({definition:s,tag:c,parent:o,schemaDefinitionsTagName:e}){const a=e?[e]:[];return Object.entries(s.components?.schemas||{}).map(([t,f])=>{if(!(f["x-tags"]||a).includes(c.name))return null;const n=d("schema",{name:t,"x-displayName":`${f.title||t}`,description:`{% schemaDefinition showWriteOnly="true" schemaRef="#/components/schemas/${t}" /%}`,isSchema:!0,level:2},o);return n.depth=o.depth+1,n}).filter(Boolean)}function w(s,c,o){const e=[];for(const a of y)if(s["x-mcp"]?.[a]){const t=O(a),f=[t];for(const i of s["x-mcp"]?.[a]||[])if((i.tags?.length?i.tags:f).includes(c.name)){const r=b(o.id,N(i.name)),p=d("mcp",{name:i.name,"x-displayName":i.title||i.name,description:`${i.description||""}
2
- {% mcp${t.slice(0,-1)} toolName="${i.name}" id="${r}" /%}`,isSchema:!0,level:2},o);p.depth=o.depth+1,e.push(p)}}return e}function U(s,c){const{definition:o}=s,e={},a=o["x-webhooks"]||o.webhooks,t=o["x-mcp"];for(const f of c||[])e[f.name]={...f,operations:[]};return o.paths&&u(s,o.paths,e),a&&u(s,a,e,!0),t&&E(t,e),e}function E(s,c){for(const o of y)if(s[o])for(const e of s[o]){const a=e.tags&&e.tags.length?e.tags:[O(o)];for(const t of a){let f=c[t];f===void 0&&(f={name:t,operations:[],used:!0},c[t]=f)}}}function u(s,c,o,e){for(const a of Object.keys(c||{})){const t=c[a],f=Object.keys(t).filter(S);for(const i of f){const n=t[i];if(t.$ref){const{resolved:p}=s.deref(t);u(s,{[a]:p},o,e);continue}let r=n?.tags;(!r||!r.length)&&(r=e?[l]:[""]);for(const p of r){let m=o[p];m===void 0&&(m={name:p,operations:[]},o[p]=m),!m["x-traitTag"]&&m.operations.push({...n,pathName:a,pointer:$.compile(["paths",a,i]),httpVerb:i,pathParameters:t.parameters||[],pathServers:t.servers,isWebhook:!!e})}}}}function O(s){return s.charAt(0).toUpperCase()+s.slice(1)}export{O as capitalize,R as getTagGroupsItems,k as getTagsItems,U as getTagsWithOperations};
1
+ import{getTagOrGroup as d}from"../../models/group.js";import{DEFAULT_WEBHOOKS_TAG_NAME as l,GROUP_DEPTH as g}from"../../constants.js";import{getValueFromMdParsedExtension as h,isOperationName as S,JsonPointer as k,safeSlugify as w}from"../../utils/index.js";import{getOperationsItems as T}from"./operation.js";import{addMarkdownItems as x}from"./markdown.js";import{joinWithSeparator as $}from"../history/helpers.js";const y=["tools"];function N(s,c,o,e,a){let t;if(e===void 0?t=Object.keys(c):t=e.tags,!Array.isArray(t))return console.warn("Unexpected values of tags. Check tags or x-tagGroups in your definition."),[];const f=t.map(n=>c[n]?(c[n].used=!0,c[n]):(console.warn(`Non-existing tag "${n}" is added to the group "${e?.name}"`),null)),i=[];for(const n of f){if(!n)continue;const r=d("tag",n,o);if(r.depth=g+1,n.name===""){const P=[...x(h(n,"description")||"",r,r.depth+1),...T(void 0,n,r.depth+1)];i.push(...P);continue}const p=b({definition:s.definition,tag:n,parent:r,schemaDefinitionsTagName:a.schemaDefinitionsTagName}),m=v(s.definition,n,r);r.items=[...p,...m,...x(h(n,"description")||"",r,r.depth+1),...T(r,n,r.depth+1)],i.push(r)}return i.filter(({name:n,items:r})=>n!==l||r.length>0)}function R(s,c,o,e,a){const t=[];for(const f of o){const i=d("group",f,c);i.depth=g,i.items=N(s,e,i,f,a),t.push(i)}return t}function b({definition:s,tag:c,parent:o,schemaDefinitionsTagName:e}){const a=e?[e]:[];return Object.entries(s.components?.schemas||{}).map(([t,f])=>{if(!(f["x-tags"]||a).includes(c.name))return null;const n=d("schema",{name:t,"x-displayName":`${f.title||t}`,description:`{% schemaDefinition showWriteOnly="true" schemaRef="#/components/schemas/${t}" /%}`,isSchema:!0,level:2},o);return n.depth=o.depth+1,n}).filter(Boolean)}function v(s,c,o){const e=[];for(const a of y)if(s["x-mcp"]?.[a]){const t=O(a),f=[t];for(const i of s["x-mcp"]?.[a]||[])if((i.tags?.length?i.tags:f).includes(c.name)){const r=$(o.id,w(i.name)),p=d("mcp",{name:i.name,"x-displayName":i.title||i.name,description:`${i.description||""}
2
+ {% mcp${t.slice(0,-1)} toolName="${i.name}" id="${r}" /%}`,isSchema:!0,level:2},o);p.depth=o.depth+1,e.push(p)}}return e}function U(s,c){const{definition:o}=s,e={},a=o["x-webhooks"]||o.webhooks,t=o["x-mcp"];for(const f of c||[])e[f.name]={...f,operations:[]};return o.paths&&u(s,o.paths,e),a&&u(s,a,e,!0),t&&E(t,e),e}function E(s,c){for(const o of y)if(s[o])for(const e of s[o]){const a=e.tags&&e.tags.length?e.tags:[O(o)];for(const t of a){let f=c[t];f===void 0&&(f={name:t,operations:[],used:!0},c[t]=f)}}}function u(s,c,o,e){for(const a of Object.keys(c||{})){const t=c[a],f=Object.keys(t).filter(S);for(const i of f){const n=t[i];if(t.$ref){const{resolved:p}=s.deref(t);u(s,{[a]:p},o,e);continue}let r=n?.tags;(!r||!r.length)&&(r=e?[l]:[""]);for(const p of r){let m=o[p];m===void 0&&(m={name:p,operations:[]},o[p]=m),!m["x-traitTag"]&&m.operations.push({...n,pathName:a,pointer:k.compile(["paths",a,i]),httpVerb:i,pathParameters:t.parameters||[],pathServers:t.servers,isWebhook:!!e,keywords:n["x-keywords"]})}}}}function O(s){return s.charAt(0).toUpperCase()+s.slice(1)}export{O as capitalize,R as getTagGroupsItems,N as getTagsItems,U as getTagsWithOperations};
@@ -51,6 +51,7 @@ export type ExtendedOpenAPIOperation = {
51
51
  pathServers: Array<OpenAPIServer> | undefined;
52
52
  isWebhook: boolean;
53
53
  defaultSampleName?: string | false;
54
+ keywords?: unknown;
54
55
  } & OpenAPIOperation;
55
56
  export type TagsInfoMap = Record<string, TagInfo>;
56
57
  export interface TagGroup {
package/lib/standalone.js CHANGED
@@ -1 +1 @@
1
- import{jsx as i}from"react/jsx-runtime";import{createElement as p}from"react";import{createRoot as u,hydrateRoot as m}from"react-dom/client";import{querySelector as a}from"./utils/dom.js";import{RedoclyOpenAPIDocs as l}from"./components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js";import{RedoclyOpenAPIDocsStandalone as f}from"./components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js";import{setSecurityDetails as P,setSecurityDetailsVariants as V}from"./utils/security-details.js";import{setParameterValue as D}from"./utils/parameters.js";function d(t){const e={},o=t.attributes;for(let r=0;r<o.length;r++){const n=o[r];e[n.name]=n.value}return e}function E(t){const e=d(t),o={};for(const r in e){const n=r.replace(/-(.)/g,(c,s)=>s.toUpperCase());o[n]=e[r]}return o}function A(t,e=document.querySelector("redoc")){m(e,i(l,{store:t}),{onRecoverableError:(o,r)=>{o.message.includes("Minified React error #418")||console.error(o.message,r)}})}function _(t,e={},o=a("redoc")){if(o===null)throw new Error('"element" argument is not provided and <redoc> tag is not found on the page');const{router:r,...n}=e;let c,s;typeof t=="string"?c=t:typeof t=="object"&&(s=t),u(o).render(p(f,{definition:s,definitionUrl:c,options:{...n,...E(o)},router:r??"hash"},["Loading..."]))}const N=__REDOCLY_API_REFERENCE_VERSION__,v=__REDOCLY_API_REFERENCE_REVISION__;function R(){const t=a("redoc");if(!t)return;const e=t.getAttribute("spec-url");e&&_(e,{},t)}R();export{A as hydrate,_ as init,v as revision,D as setParameterValue,P as setSecurityDetails,V as setSecurityDetailsVariants,N as version};
1
+ import{jsx as i}from"react/jsx-runtime";import{createElement as p}from"react";import{createRoot as u,hydrateRoot as m}from"react-dom/client";import{querySelector as a}from"./utils/dom.js";import{RedoclyOpenAPIDocs as l}from"./components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js";import{RedoclyOpenAPIDocsStandalone as f}from"./components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js";import{setSecurityDetails as P,setSecurityDetailsVariants as V}from"./utils/security-details.js";import{setParameterValue as D}from"./utils/parameters.js";function d(t){const e={},o=t.attributes;for(let r=0;r<o.length;r++){const n=o[r];e[n.name]=n.value}return e}function E(t){const e=d(t),o={};for(const r in e){const n=r.replace(/-(.)/g,(c,s)=>s.toUpperCase());o[n]=e[r]}return o}function A(t,e=document.querySelector("redoc")){m(e,i(l,{store:t}),{onRecoverableError:(o,r)=>{o.message.includes("Minified React error #418")||console.error(o.message,r)}})}function _(t,e={},o=a("redoc")){if(o===null)throw new Error('"element" argument is not provided and <redoc> tag is not found on the page');const{router:r,...n}={...e,...E(o)};let c,s;typeof t=="string"?c=t:typeof t=="object"&&(s=t),u(o).render(p(f,{definition:s,definitionUrl:c,options:n,router:r??"hash"},["Loading..."]))}const N=__REDOCLY_API_REFERENCE_VERSION__,v=__REDOCLY_API_REFERENCE_REVISION__;function R(){const t=a("redoc");if(!t)return;const e=t.getAttribute("spec-url");e&&_(e,{},t)}R();export{A as hydrate,_ as init,v as revision,D as setParameterValue,P as setSecurityDetails,V as setSecurityDetailsVariants,N as version};
@@ -18,6 +18,7 @@ export interface OpenAPIDefinition {
18
18
  }>;
19
19
  'x-feedback'?: any;
20
20
  'x-schema-catalog-link'?: string;
21
+ 'x-keywords'?: unknown;
21
22
  }
22
23
  export interface OpenAPIInfo extends ParsedDescriptionWithSummary {
23
24
  title: string;
@@ -361,6 +362,7 @@ export interface OpenAPITag extends ParsedDescription {
361
362
  externalDocs?: OpenAPIExternalDocumentation;
362
363
  'x-displayName'?: string;
363
364
  'x-rbac'?: Record<string, unknown>;
365
+ 'x-keywords'?: unknown;
364
366
  }
365
367
  export interface OpenAPIExternalDocumentation extends ParsedDescription {
366
368
  description?: string;
@@ -1 +1 @@
1
- import{bundle as a,loadConfig as r}from"@redocly/openapi-core";import{combineUrls as s}from"@redocly/theme/core/openapi";import{convertSwagger2OpenAPI as c}from"./convertSwagger2OpenAPI.js";import{IS_BROWSER as t}from"./dom.js";import{REDOCLY_CONFIG_FILE as f}from"../constants.js";async function w(){const o=t?window.location.origin:typeof globalThis.process<"u"?globalThis.process.cwd():"";try{return(await r({configPath:s(o,f)}))?.resolvedConfig.openapi||{}}catch{return{}}}async function b(o){const n=await r(),e={config:n,base:t?window.location.origin:typeof globalThis.process<"u"?globalThis.process.cwd():""};t&&(n.resolve.http.customFetch=globalThis.fetch),typeof o=="object"&&o!==null?e.doc=d(o):e.ref=o;const{bundle:{parsed:i}}=await a(e);return i.swagger!==void 0?c(i):i}function d(o){return{source:{absoluteRef:""},parsed:o}}export{b as loadAndBundleDefinition,w as loadOpenapiConfig};
1
+ import{bundleOas as r,createEmptyRedoclyConfig as i}from"@redocly/openapi-core/lib/bundle-oas";import{convertSwagger2OpenAPI as c}from"./convertSwagger2OpenAPI.js";import{IS_BROWSER as a}from"./dom.js";async function l(){try{return(await i())?.resolvedConfig.openapi||{}}catch{return{}}}async function p(o){const t=await i(),e={config:t,base:a?window.location.origin:typeof globalThis.process<"u"?globalThis.process.cwd():""};a&&(t.resolve.http.customFetch=globalThis.fetch),typeof o=="object"&&o!==null?e.doc=s(o):e.ref=o;const{bundle:{parsed:n}}=await r(e);return n.swagger!==void 0?c(n):n}function s(o){return{source:{absoluteRef:""},parsed:o}}export{p as loadAndBundleDefinition,l as loadOpenapiConfig};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-docs",
3
- "version": "3.15.0-next.0",
3
+ "version": "3.15.0-next.10",
4
4
  "description": "Redocly OpenAPI Docs",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -21,13 +21,13 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@markdoc/markdoc": "0.5.2",
24
- "@redocly/openapi-core": "2.3.1",
24
+ "@redocly/openapi-core": "2.8.0",
25
25
  "deepmerge": "^4.2.2",
26
26
  "dompurify": "3.2.7",
27
27
  "fast-deep-equal": "^3.1.3",
28
28
  "jotai": "^2.12.5",
29
29
  "json-pointer": "^0.6.2",
30
- "openapi-sampler": "^1.6.1",
30
+ "openapi-sampler": "1.6.2",
31
31
  "react-router-dom": "^6.21.1",
32
32
  "slugify": "^1.4.4",
33
33
  "stringify-object": "^3.3.0",
@@ -36,8 +36,8 @@
36
36
  "url-template": "^2.0.8",
37
37
  "util": "~0.12.5",
38
38
  "web-vitals": "3.3.1",
39
- "@redocly/config": "0.35.1",
40
- "@redocly/replay": "0.18.0-next.0"
39
+ "@redocly/config": "0.36.2",
40
+ "@redocly/replay": "0.18.0-next.10"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@jest/globals": "29.5.0",
@@ -53,7 +53,7 @@
53
53
  "@types/react": "^19.1.4",
54
54
  "@types/react-dom": "^19.1.4",
55
55
  "@types/styled-components": "5.1.34",
56
- "@vitejs/plugin-react": "^4.2.1",
56
+ "@vitejs/plugin-react": "5.0.4",
57
57
  "esbuild": "0.25.10",
58
58
  "jest": "29.5.0",
59
59
  "jest-environment-jsdom": "29.5.0",
@@ -72,10 +72,10 @@
72
72
  "styled-components": "5.3.11",
73
73
  "ts-jest": "29.1.2",
74
74
  "tsx": "4.20.3",
75
- "typescript": "5.6.2",
75
+ "typescript": "5.9.3",
76
76
  "url": "~0.11.0",
77
- "vite": "6.3.6",
78
- "@redocly/theme": "0.59.0-next.0"
77
+ "vite": "7.1.9",
78
+ "@redocly/theme": "0.59.0-next.9"
79
79
  },
80
80
  "scripts": {
81
81
  "start": "npm run copy-highlight-hook && vite",
@@ -85,7 +85,9 @@
85
85
  "prepare:community-source": "npx tsx scripts/prepare-community-source.ts --",
86
86
  "prepare:community-source-only": "npm run prepare:community-source --ignore /src/* private-readme.md",
87
87
  "prepare:community-dependencies": "npx tsx scripts/prepare-community-dependencies.ts",
88
+ "apply:community-source": "npx tsx scripts/apply-changes-from-community-source.ts",
88
89
  "test": "npm run prepare:community-source && cd redoc && npm install && npm run lint && npm run unit && cd ../ && jest -w 2",
90
+ "unit": "jest -w 2",
89
91
  "test:update": "jest -u",
90
92
  "test:watch": "jest --watch",
91
93
  "test:coverage": "jest --coverage",
@@ -1,3 +0,0 @@
1
- export declare function ErrorPage({ description }: {
2
- description: string;
3
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,25 +0,0 @@
1
- import{jsx as e,jsxs as r,Fragment as i}from"react/jsx-runtime";import t from"styled-components";import{GlobalStyle as a}from"@redocly/theme/core/openapi";function f({description:o}){return console.error(o),r(i,{children:[e(a,{}),r(n,{children:[e(l,{children:";("}),e(s,{children:"Something went wrong..."}),r(g,{children:["Please check the console for get more details or"," ",e("a",{target:"_blank",rel:"noopener noreferrer",href:"https://redocly.com/docs/redoc",children:"documentation"}),"."]})]})]})}const n=t.div`
2
- height: 100vh;
3
- max-width: var(--page-404-max-width);
4
- display: flex;
5
- flex-direction: column;
6
- justify-content: center;
7
- margin: var(--page-404-margin-vertical) var(--page-404-margin-horizontal);
8
- font-family: var(--page-404-font-family);
9
- gap: var(--page-404-gap);
10
- `,l=t.div`
11
- color: var(--page-404-status-text-color);
12
- font-size: var(--page-404-status-font-size);
13
- line-height: var(--page-404-status-line-height);
14
- font-weight: var(--page-404-status-font-weight);
15
- `,s=t.div`
16
- color: var(--page-404-title-text-color);
17
- font-size: var(--page-404-title-font-size);
18
- line-height: var(--page-404-title-line-height);
19
- font-weight: var(--page-404-title-font-weight);
20
- `,g=t.div`
21
- color: var(--page-404-description-text-color);
22
- font-size: var(--page-404-description-font-size);
23
- line-height: var(--page-404-description-line-height);
24
- font-weight: var(--page-404-description-font-weight);
25
- `;export{f as ErrorPage};