@redocly/openapi-docs 3.13.0-next.3 → 3.13.0-next.5

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 (46) hide show
  1. package/dist/redocly-openapi-docs.min.js +3408 -2387
  2. package/lib/components/Content/useAutoScroll.js +1 -1
  3. package/lib/components/Download/DownloadSpecification.d.ts +4 -1
  4. package/lib/components/Download/DownloadSpecification.js +4 -4
  5. package/lib/components/RedoclyOpenAPIDocs/Providers.js +1 -1
  6. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.d.ts +1 -1
  7. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
  8. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.d.ts +1 -1
  9. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js +1 -1
  10. package/lib/components/RedoclyOpenAPIDocs/types.d.ts +1 -0
  11. package/lib/components/RightPanel/RightPanel.js +1 -1
  12. package/lib/components/SideMenu/SideMenu.js +2 -2
  13. package/lib/components/SideMenu/hooks/useMenuItems.d.ts +2 -1
  14. package/lib/components/SideMenu/hooks/useMenuItems.js +1 -1
  15. package/lib/components/common/linkify.d.ts +0 -1
  16. package/lib/components/common/linkify.js +4 -4
  17. package/lib/components/common/panels.js +20 -20
  18. package/lib/constants.d.ts +1 -1
  19. package/lib/constants.js +1 -1
  20. package/lib/hoc/withRouter.js +1 -1
  21. package/lib/hooks/index.d.ts +1 -1
  22. package/lib/hooks/index.js +1 -1
  23. package/lib/index.d.ts +1 -0
  24. package/lib/index.js +1 -1
  25. package/lib/jotai/app.d.ts +1 -1
  26. package/lib/jotai/app.js +1 -1
  27. package/lib/services/config-options/normalizeOptions.js +1 -1
  28. package/lib/services/config-options/types.d.ts +0 -2
  29. package/lib/standalone.d.ts +3 -1
  30. package/lib/standalone.js +1 -1
  31. package/lib/utils/cookies.js +1 -1
  32. package/lib/utils/dom.d.ts +1 -0
  33. package/lib/utils/dom.js +1 -1
  34. package/lib/utils/helpers.js +4 -4
  35. package/lib/utils/loadAndBundleSpec.d.ts +656 -0
  36. package/lib/utils/loadAndBundleSpec.js +1 -1
  37. package/lib/utils/local-storage.js +1 -1
  38. package/lib/utils/openapi.js +1 -1
  39. package/lib/utils/session-storage.js +1 -1
  40. package/package.json +10 -7
  41. package/lib/components/Language/_tests_/LanguageDropdown.test.d.ts +0 -1
  42. package/lib/components/Language/_tests_/LanguageDropdown.test.js +0 -1
  43. package/lib/components/OperationItem/_tests_/OperationItem.test.d.ts +0 -1
  44. package/lib/components/OperationItem/_tests_/OperationItem.test.js +0 -1
  45. package/lib/components/OperationItem/_tests_/__mocks__/mock-intersection-observer.d.ts +0 -15
  46. package/lib/components/OperationItem/_tests_/__mocks__/mock-intersection-observer.js +0 -1
@@ -1 +1 @@
1
- import{useLocation as p}from"react-router-dom";import{useEffect as s}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||"/";s(()=>{if(e.pathname===o&&e.hash===""){window.scrollTo(0,0);return}const a=l(e.pathname.replace(o,"")),c=g(e.hash),i=c?r(a+c)||document.querySelector(`[id$="${l(c)}"]`):r(e.hash.replace("#",""))||r(a);i&&i.scrollIntoView()},[e,o]);const n=m(e,!1,!1);s(()=>{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 r(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{r as getElementById,g as getLegacyHash,E as useAutoScroll};
1
+ import{useLocation as p}from"react-router-dom";import{useEffect as s}from"react";import{addLeadingSlash as d,removeLeadingSlash as l,useActiveSectionId as u}from"@redocly/theme/core/openapi";import{compose as f,encodeBackSlashes as h,tryDecodeURIComponent as w}from"../../utils/index.js";import{IS_BROWSER as S}from"../../utils/dom.js";let m=!0;function v(t){const e=p(),o=t||"/";s(()=>{if(e.pathname===o&&e.hash===""){window.scrollTo(0,0);return}const a=l(e.pathname.replace(o,"")),r=g(e.hash),i=r?c(a+r)||document.querySelector(`[id$="${l(r)}"]`):c(e.hash.replace("#",""))||c(a);i&&i.scrollIntoView()},[e,o]);const n=u(e,!1,!1);s(()=>{if(n&&m){m=!1;return}if(S&&!window.location.pathname.includes(n)&&!window.location.hash.includes(n)){const a=f(d,h)(n);window.history.replaceState({},"",a)}},[n])}function c(t){return document.getElementById(w(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,v as useAutoScroll};
@@ -1,4 +1,7 @@
1
1
  import type { ReactElement } from 'react';
2
- declare function DownloadSpecificationComponent(): ReactElement;
2
+ import type { UseDownloadInfoReturnType } from './types';
3
+ declare function DownloadSpecificationComponent({ downloadObjects, }: {
4
+ downloadObjects: UseDownloadInfoReturnType;
5
+ }): ReactElement;
3
6
  export declare const DownloadSpecification: import("react").MemoExoticComponent<typeof DownloadSpecificationComponent>;
4
7
  export {};
@@ -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}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`
1
+ import{jsx as e,Fragment as m,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 w,combineUrls as g}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 y}from"@redocly/theme/icons/FileIcon/FileIcon";import{useTelemetry as v}from"../../hooks/index.js";import{styled as r}from"../../styled-components.js";function k({downloadObjects:t}){const l=v(),n=w(),c=f(o=>{switch(o){case"yaml":return e(h,{});case"json":return e(u,{});default:return e(y,{})}},[]);return t?e(I,{children:(t||[]).map(({title:o,url:i,iconType:d})=>{const a=n?g(n,i):i;return s(_,{onClick:()=>l.send({type:"openapi_docs.download_definition.clicked"}),children:[s(j,{children:[c(d),e("a",{href:a,target:"_blank",download:!0,rel:"noreferrer",children:o})]}),e("a",{href:a,target:"_blank",download:!0,rel:"noreferrer",children:e(b,{variant:"text",size:"small",icon:e(x,{})})})]},o)})}):e(m,{})}const T=p(k),_=r.div`
2
2
  display: flex;
3
3
  align-items: baseline;
4
4
  justify-content: space-between;
@@ -10,7 +10,7 @@ import{jsx as o,Fragment as p,jsxs as s}from"react/jsx-runtime";import{memo as f
10
10
  padding-bottom: 0px;
11
11
  border-bottom: none;
12
12
  }
13
- `,F=r.span`
13
+ `,j=r.span`
14
14
  display: flex;
15
15
  width: calc(100% - 25px);
16
16
  gap: var(--spacing-xs);
@@ -28,7 +28,7 @@ import{jsx as o,Fragment as p,jsxs as s}from"react/jsx-runtime";import{memo as f
28
28
  overflow: hidden;
29
29
  white-space: nowrap;
30
30
  }
31
- `,U=r.div`
31
+ `,I=r.div`
32
32
  display: flex;
33
33
  align-items: center;
34
34
  align-self: flex-start;
@@ -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{G as DownloadSpecification};
39
+ `;export{T as DownloadSpecification};
@@ -1 +1 @@
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
+ 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{html as N}from"@redocly/theme/markdoc/tags/html";import{Heading as D}from"@redocly/theme/markdoc/components/Heading/Heading";import{normalizeOptions as j,OpenAPIParser as k}from"../../services/index.js";import{SchemaDefinition as x}from"../SchemaDefinition/index.js";import{getMarkdownHeaderId as C}from"./utils.js";import{mergeInMockServer as P}from"../../models/operation.js";import{normalizeServers as M}from"../../utils/index.js";import{appStore as H,appStoreOverrideAtom as I,layoutAtom as p,environmentAtom as L,userClaimsAtom as R}from"../../jotai/app.js";import{mapObject as T}from"../../utils/object.js";import{getServerEnvName as V}from"../../utils/environments.js";import{globalStoreAtom as h}from"../../jotai/store.js";import{getDefaultOperationStore as z,operationStore as _}from"../../jotai/operation.js";const q={ignoreNamedSchemas:["java.io.ObjectStreamField"],maxDisplayedEnumValues:10,markdocOptions:{tags:{html:N.schema,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:C(m);return new S.Tag("Heading",{...t,id:e,level:n.attributes.level},m)}}},components:{SchemaDefinition:x,Heading:D}}},ne=v(({children:n,options:i,definitionUrl:t,definition:m,withState:e})=>{const l=b(()=>{const r=j(i,q),o=new k(m,t,r);return{options:r,parser:o}},[m,t,i]),a=y(()=>{const r=E(),o=l();r.set(h,o);const f=M(o.parser.definitionUrl,P(o.parser.definition?.servers||[],o.options.mockServer));r.sub(H,()=>{}),r.set(p,o.options?.layout||O.THREE_PANEL);const u=Object.fromEntries(f.map(s=>[V(s),{server:s.url,...T(s.variables||{},c=>c.default||"")}]));if(r.set(L,{environments:u}),r.set(R,e?.userClaims||{}),e&&r.set(I,{activeMimeName:e.activeMimeName,userClaims:e.userClaims,environment:e.environment,environments:e.environments}),e?.operation){const s=z(e.operation.pointer,e.operation.state.requestValues,e.operation.state.activeExampleName);r.set(_(e.operation.pointer),s)}return r},[l,e]);return g(()=>{e?.layout&&a.set(p,e?.layout)},[a,e?.layout]),d(A,{store:a,children:n})});export{ne as StoreProvider};
@@ -1,3 +1,3 @@
1
1
  import type { PropsWithChildren } from 'react';
2
2
  import type { RedoclyOpenAPIDocsProps } from './types.js';
3
- export declare function RedoclyOpenAPIDocs({ onLoaded, children, store, withCommonStyles, }: PropsWithChildren<Partial<RedoclyOpenAPIDocsProps>>): import("react/jsx-runtime").JSX.Element | null;
3
+ export declare function RedoclyOpenAPIDocs({ onLoaded, children, store, withCommonStyles, router, }: PropsWithChildren<Partial<RedoclyOpenAPIDocsProps>>): import("react/jsx-runtime").JSX.Element | null;
@@ -1 +1 @@
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
+ 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 f}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:m,onLoaded:a,children:e,options:t,layout:i,collapsedSidebar:d,parser:c,withCommonStyles:h})=>{const b=T(null),{isValid:l,licenseInfo:R}=W(m),S=w(q),u=F();V();const{contentItems:y,flatItems:g}=M({parser:c,options:t});H({sendTelemetry:p=>{const r=Object.fromEntries(Object.entries(p).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(a?.(),u.send({type:"openapi_docs.viewed",payload:{layout:i}}),!t.hideReplay){const p=g.filter(r=>r.type==="operation");S(p)}});const{hideSidebar:L,scrollYOffset:P}=t||{},n=c.definition?.info?.["x-logo"];return s(E,{children:[h&&o(I,{}),s(D,{className:"redoc-wrap",ref:b,children:[!l&&o(v,{licenseInfo:R}),!L&&s(k,{scrollYOffset:P,className:"menu-content",collapsedSidebar:!d,children:[o(_,{imageUrl:n?.url,href:n?.href||c.definition?.info?.contact?.url,altText:n?.altText,backgroundColor:n?.backgroundColor}),o(B,{items:l?y:[]})]}),s(A,{className:"api-content",id:"api-content",layout:i===f.THREE_PANEL?f.THREE_PANEL:f.STACKED,collapsedSidebar:d,children:[o(K,{items:l?y:[],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};
@@ -5,4 +5,4 @@ import type { RedocConfig } from '@redocly/config';
5
5
  export declare function loadSingle(spec: any, specUrl: any, options?: RedocConfig): Promise<OpenAPIDefinition>;
6
6
  export declare function loadAndBundleSpecOrMd(url: string, title?: string): Promise<OpenAPIDefinition>;
7
7
  export declare const AppProvider: ({ options, definitionUrl, definition, activeSampleLanguage, children, }: PropsWithChildren<AppProviderProps>) => ReactElement | null;
8
- export declare function RedoclyOpenAPIDocsStandalone({ definition, definitionUrl, options, activeItemId, activeSampleLanguage, activeDeepLink, }: RedoclyOpenAPIDocsStandaloneProps): ReactElement;
8
+ export declare function RedoclyOpenAPIDocsStandalone({ definition, definitionUrl, options, activeItemId, activeSampleLanguage, activeDeepLink, router, }: RedoclyOpenAPIDocsStandaloneProps): ReactElement;
@@ -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/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
+ import{jsx as u}from"react/jsx-runtime";import{cloneElement as w,isValidElement as v,useEffect as g,useMemo as x,useState as a}from"react";import{Loading as A}from"@redocly/theme/components/Loaders/Loading";import{useDeepCompareMemoize as D,fixSpec as L}from"./utils.js";import{argValueToBoolean as B}from"../../utils/index.js";import{RedoclyOpenAPIDocs as E}from"./RedoclyOpenAPIDocs.js";import{loadAndBundleDefinition as p,loadRedoclyConfig as O}from"../../utils/loadAndBundleSpec.js";async function C(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{L(n)}catch{}return n}function z(e,o){return e.endsWith(".md")?p({openapi:"3.0.0",info:{title:o||"",version:"1.0",description:{$ref:e}},paths:{}}):p(e)}const I=({options:e,definitionUrl:o,definition:t,activeSampleLanguage:n,children:r})=>{const[,l]=a(),[s,f]=a(!0),[d,y]=a(null),[m,h]=a(e||{});g(()=>{async function S(){f(!0);try{const c=await O();h({...e,...c}),y(await C(t,o,e))}catch(c){l(()=>{throw c})}}S()},[t,o,e]);const i=x(()=>{if(d)return{definition:d,options:m,definitionUrl:o,activeSampleLanguage:n}},D([d,o,m]));return g(()=>{i&&f(!1)},[i]),i?s?B(e?.hideLoading,!1)?null:u(A,{color:"--loading-spinner-color"}):v(r)?w(r,{store:i}):null:null};function T({definition:e,definitionUrl:o,options:t={},activeItemId:n,activeSampleLanguage:r,activeDeepLink:l,router:s}){return u(I,{definition:e,definitionUrl:o,options:t,activeItemId:n,activeSampleLanguage:r,activeDeepLink:l,children:u(E,{withCommonStyles:!0,router:s})})}export{I as AppProvider,T as RedoclyOpenAPIDocsStandalone,z as loadAndBundleSpecOrMd,C as loadSingle};
@@ -44,4 +44,5 @@ export interface RedoclyOpenAPIDocsStandaloneProps {
44
44
  activeItemId?: string;
45
45
  activeSampleLanguage?: CodeSampleConfig['lang'];
46
46
  activeDeepLink?: string;
47
+ router?: 'hash' | 'history';
47
48
  }
@@ -1 +1 @@
1
- import{jsx as e,Fragment as c,jsxs as g}from"react/jsx-runtime";import{useAtomValue as t}from"jotai";import{Panel as o}from"@redocly/theme/components/Panel/Panel";import{Markdown as f}from"@redocly/theme/components/Markdown/Markdown";import{DownloadSpecification as v}from"../Download/index.js";import{Overview as h}from"../Overview/index.js";import{LanguageList as u}from"../Language/index.js";import{ServerList as w}from"../ServerList/index.js";import{globalStoreAtom as x}from"../../jotai/store.js";import{normalizeServers as S}from"../../utils/index.js";import{mergeInMockServer as L}from"../../models/operation.js";import{languageAtom as b}from"../../jotai/app.js";import{useTranslate as j}from"../../hooks/index.js";const R=({item:{infoDefinition:r}})=>{const a=j(),{options:{hideDownloadButtons:i,mockServer:l},parser:{definition:m,definitionUrl:p}}=t(x),{languages:n,activeLanguage:d}=t(b),s=S(p,L(m.servers||[],l));return g(c,{children:[!i&&e(o,{className:"panel-download",header:a("openapi.download.description.title","Download OpenAPI description"),isExpandable:!1,children:e(v,{})}),(r?.license||r?.contact||r?.termsOfService)&&e(o,{className:"panel-overview",header:a("openapi.info.title","Overview"),isExpandable:!1,children:e(f,{children:e(h,{info:r,translate:a})})}),!!n?.length&&e(o,{className:"panel-language-list",header:a("openapi.languages.title","Languages"),isExpandable:!1,children:e(u,{languages:n,activeLanguage:d})}),!!s.length&&e(o,{className:"panel-servers-list",header:a("openapi.servers.title","Servers"),isExpandable:!1,children:e(w,{servers:s,path:"/",translate:a})})]})};export{R as RightPanel};
1
+ import{jsx as e,Fragment as f,jsxs as v}from"react/jsx-runtime";import{useAtomValue as i}from"jotai";import{Panel as o}from"@redocly/theme/components/Panel/Panel";import{Markdown as h}from"@redocly/theme/components/Markdown/Markdown";import{DownloadSpecification as u}from"../Download/index.js";import{Overview as w}from"../Overview/index.js";import{ServerList as x}from"../ServerList/index.js";import{globalStoreAtom as S}from"../../jotai/store.js";import{normalizeServers as b}from"../../utils/index.js";import{LanguageList as j}from"../Language/index.js";import{mergeInMockServer as L}from"../../models/operation.js";import{languageAtom as O}from"../../jotai/app.js";import{useTranslate as D}from"../../hooks/index.js";import{useDownloadInfo as k}from"../Download/useDownloadInfo.js";const W=({item:{infoDefinition:r}})=>{const a=D(),{options:{hideDownloadButtons:l,downloadUrls:m,mockServer:p},parser:{definition:d,definitionUrl:c}}=i(S),{languages:n,activeLanguage:g}=i(O),s=k({downloadUrls:m}),t=b(c,L(d.servers||[],p));return v(f,{children:[!l&&s&&e(o,{className:"panel-download",header:a("openapi.download.description.title","Download OpenAPI description"),isExpandable:!1,children:e(u,{downloadObjects:s})}),(r?.license||r?.contact||r?.termsOfService)&&e(o,{className:"panel-overview",header:a("openapi.info.title","Overview"),isExpandable:!1,children:e(h,{children:e(w,{info:r,translate:a})})}),!!n?.length&&e(o,{className:"panel-language-list",header:a("openapi.languages.title","Languages"),isExpandable:!1,children:e(j,{languages:n,activeLanguage:g})}),!!t.length&&e(o,{className:"panel-servers-list",header:a("openapi.servers.title","Servers"),isExpandable:!1,children:e(x,{servers:t,path:"/",translate:a})})]})};export{W as RightPanel};
@@ -1,3 +1,3 @@
1
- import{jsx as e}from"react/jsx-runtime";import{memo as t}from"react";import{Menu as n}from"@redocly/theme/components/Menu/Menu";import{useMenuItems as s}from"./hooks/useMenuItems.js";import{styled as i}from"../../styled-components.js";const p=({items:o,className:m})=>{const r=s({items:o});return e(u,{className:m,children:e(n,{items:r})})},l=t(p),u=i.div`
1
+ import{jsx as o}from"react/jsx-runtime";import{memo as s}from"react";import{useAtomValue as n}from"jotai";import{Menu as i}from"@redocly/theme/components/Menu/Menu";import{useMenuItems as p}from"./hooks/useMenuItems.js";import{styled as u}from"../../styled-components.js";import{globalOptionsAtom as a}from"../../jotai/store.js";const f=({items:t,className:e})=>{const{routingBasePath:m}=n(a),r=p({items:t,routingBasePath:m});return o(c,{className:e,children:o(i,{items:r})})},v=s(f),c=u.div`
2
2
  overflow: auto;
3
- `;export{u as MenuWrapper,l as SideMenu};
3
+ `;export{c as MenuWrapper,v as SideMenu};
@@ -2,6 +2,7 @@ import type { IMenuItem } from '../../../services/index.js';
2
2
  import type { ExtendedMenuItem } from '../types.js';
3
3
  type UseMenuItemsInput = {
4
4
  items: IMenuItem[];
5
+ routingBasePath?: string;
5
6
  };
6
- export declare function useMenuItems({ items }: UseMenuItemsInput): ExtendedMenuItem[];
7
+ export declare function useMenuItems({ items, routingBasePath }: UseMenuItemsInput): ExtendedMenuItem[];
7
8
  export {};
@@ -1 +1 @@
1
- import{useMemo as d}from"react";import{useLocation as b}from"react-router-dom";import{useActiveSectionId as l}from"@redocly/theme/core/openapi";import{pathMatchedLink as I}from"../../../utils/index.js";import{DEFAULT_WEBHOOKS_TAG_NAME as k}from"../../../constants.js";function W({items:s}){const n=b(),t=l(n,!1,!1);return d(()=>A(s,t,n),[t,s,n])}function A(s,n="",t){const o=[];return m({contentItems:s,sidebarItems:o,activeItemId:n,location:t}),o}function f(s,n="",t){return s.href?n?s.id===n:I(t,s.href):!1}function h(s,n="",t){return(s.items||[]).some(r=>f(r,n,t)||h(r,n,t))}function m(s){const{contentItems:n,sidebarItems:t,activeItemId:o,location:r}=s;let c=!0;for(const e of n){const i=f(e,o,r),a=h(e,o,r);switch(e.type){case"group":t.push({type:"separator",label:e.name,active:i,hasActiveSubItem:a}),m({...s,contentItems:e.items,sidebarItems:t});break;case"tag":const p={type:"group",label:e.name,items:[],link:e.href,active:i,hasActiveSubItem:a,modified:!0};t.push(p),m({contentItems:e.items,sidebarItems:p.items||[],activeItemId:o,location:r});break;case"operation":case"schema":e.isWebhook&&c&&e.parent.name!==k&&(t.push({type:"separator",label:"Webhooks",variant:"secondary"}),c=!1),t.push({type:"link",label:e.name,httpVerb:e.type==="schema"?"schema":e.httpVerb,link:e.href,badges:e.badges,active:i,hasActiveSubItem:a,modified:!0,deprecated:e.deprecated});break;case"section":if(e.depth===-1)continue;const u={type:e.items.length?"group":"link",label:e.name,link:e.href,items:[],active:i,hasActiveSubItem:a,modified:!0};t.push(u),e.items.length&&m({contentItems:e.items,sidebarItems:u.items,activeItemId:o,location:r});break}}}export{W as useMenuItems};
1
+ import{useMemo as h}from"react";import{useLocation as l}from"react-router-dom";import{useActiveSectionId as I}from"@redocly/theme/core/openapi";import{pathMatchedLink as k}from"../../../utils/index.js";import{DEFAULT_WEBHOOKS_TAG_NAME as A}from"../../../constants.js";import{joinWithSeparator as y}from"../../../services/history/helpers.js";function O({items:r,routingBasePath:n}){const t=l(),s=I(t,!1,!1);return h(()=>S(r,s,t,n),[s,r,t,n])}function S(r,n="",t,s){const o=[];return c({contentItems:r,sidebarItems:o,activeItemId:n,location:t,routingBasePath:s}),o}function b(r,n="",t,s){return r.href?n&&s?y(s,r.id)===n:n&&!s?r.id===n:k(t,r.href):!1}function d(r,n="",t,s){return(r.items||[]).some(i=>b(i,n,t,s)||d(i,n,t,s))}function c(r){const{contentItems:n,sidebarItems:t,activeItemId:s,location:o,routingBasePath:i}=r;let p=!0;for(const e of n){const m=b(e,s,o,i),a=d(e,s,o,i);switch(e.type){case"group":t.push({type:"separator",label:e.name,active:m,hasActiveSubItem:a}),c({...r,contentItems:e.items,sidebarItems:t});break;case"tag":const f={type:"group",label:e.name,items:[],link:e.href,active:m,hasActiveSubItem:a,modified:!0};t.push(f),c({contentItems:e.items,sidebarItems:f.items||[],activeItemId:s,location:o,routingBasePath:i});break;case"operation":case"schema":e.isWebhook&&p&&e.parent.name!==A&&(t.push({type:"separator",label:"Webhooks",variant:"secondary"}),p=!1),t.push({type:"link",label:e.name,httpVerb:e.type==="schema"?"schema":e.httpVerb,link:e.href,badges:e.badges,active:m,hasActiveSubItem:a,modified:!0,deprecated:e.deprecated});break;case"section":if(e.depth===-1)continue;const u={type:e.items.length?"group":"link",label:e.name,link:e.href,items:[],active:m,hasActiveSubItem:a,modified:!0};t.push(u),e.items.length&&c({contentItems:e.items,sidebarItems:u.items,activeItemId:s,location:o,routingBasePath:i});break}}}export{O as useMenuItems};
@@ -2,7 +2,6 @@ import type { PropsWithChildren, ReactElement } from 'react';
2
2
  export declare function Link(props: PropsWithChildren<{
3
3
  to: string;
4
4
  className?: string;
5
- security?: boolean;
6
5
  id?: string;
7
6
  'aria-label'?: string;
8
7
  }>): ReactElement | null;
@@ -1,4 +1,4 @@
1
- import{jsx as n,jsxs as c}from"react/jsx-runtime";import{useAtomValue as m}from"jotai";import{Link as d}from"react-router-dom";import{LinkIcon as e}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{globalOptionsAtom as h}from"../../jotai/store.js";import{tryDecodeURIComponent as u}from"../../utils/index.js";import{styled as f}from"../../styled-components.js";function k(i){const{routingBasePath:a,unstable_hooks:r,onDeepLinkClick:o}=m(h),t=i.security?r?.replaceSecurityLink?.({securityRequirementId:i.to}):i.to,l=o&&{onClick:s=>{s.preventDefault(),o((a||"")+t)}};return t?n(d,{"aria-label":i["aria-label"]||`link to ${t}`,id:u(i.id||""),className:i.className||"",to:t?.startsWith("#")?t:(a||"")+t,...l,children:i.children}):i.children?c("span",{"aria-label":i["aria-label"]||`link to ${t}`,className:i.className,children:[" ",i.children," "]}):null}const y=f(k)`
1
+ import{jsx as a,jsxs as s}from"react/jsx-runtime";import{useAtomValue as c}from"jotai";import{Link as m}from"react-router-dom";import{LinkIcon as n}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{globalOptionsAtom as d}from"../../jotai/store.js";import{tryDecodeURIComponent as h}from"../../utils/index.js";import{styled as f}from"../../styled-components.js";function k(i){const{routingBasePath:o,onDeepLinkClick:e}=c(d),t=i.to,r=e&&{onClick:l=>{l.preventDefault(),e((o||"")+t)}};return t?a(m,{"aria-label":i["aria-label"]||`link to ${t}`,id:h(i.id||""),className:i.className||"",to:t?.startsWith("#")?t:(o||"")+t,...r,children:i.children}):i.children?s("span",{"aria-label":i["aria-label"]||`link to ${t}`,className:i.className,children:[" ",i.children," "]}):null}const u=f(k)`
2
2
  position: absolute;
3
3
  top: 50%;
4
4
  left: 0;
@@ -6,15 +6,15 @@ import{jsx as n,jsxs as c}from"react/jsx-runtime";import{useAtomValue as m}from"
6
6
  padding-right: var(--heading-anchor-offset-right);
7
7
  z-index: 1;
8
8
 
9
- ${e} {
9
+ ${n} {
10
10
  opacity: 0;
11
11
  transition:
12
12
  visibility 0.3s linear,
13
13
  opacity 0.3s linear;
14
14
  }
15
15
 
16
- :hover ${e}, :focus ${e} {
16
+ :hover ${n}, :focus ${n} {
17
17
  visibility: visible;
18
18
  opacity: 1;
19
19
  }
20
- `;function N(i){return n(y,{...i,children:n(e,{size:"13px",color:"--heading-anchor-color"})})}export{k as Link,N as ShareLink,y as StyledShareLink};
20
+ `;function $(i){return a(u,{...i,children:a(n,{size:"13px",color:"--heading-anchor-color"})})}export{k as Link,$ as ShareLink,u as StyledShareLink};
@@ -1,26 +1,26 @@
1
- import{css as i}from"styled-components";import{LayoutVariant as p}from"@redocly/config";import{H2 as l}from"@redocly/theme/components/Typography/H2";import{Markdown as d}from"@redocly/theme/components/Markdown/Markdown";import{breakpoints as t}from"@redocly/theme/core/openapi";import{SECTION_ATTR as c}from"../../constants.js";import{styled as r}from"../../styled-components.js";const f=r.div`
2
- ${({compact:a,isStacked:o,fullWidth:e})=>{const n=a?0:"var(--spacing-vertical)";return i`
1
+ import{css as i}from"styled-components";import{LayoutVariant as l}from"@redocly/config";import{H2 as p}from"@redocly/theme/components/Typography/H2";import{Markdown as d}from"@redocly/theme/components/Markdown/Markdown";import{breakpoints as o}from"@redocly/theme/core/openapi";import{SECTION_ATTR as c}from"../../constants.js";import{styled as t}from"../../styled-components.js";const f=t.div`
2
+ ${({compact:a,isStacked:n,fullWidth:e})=>{const r=a?0:"var(--spacing-vertical)";return i`
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  width: 100%;
6
- padding: ${n} var(--panel-gap-horizontal);
6
+ padding: ${r} var(--panel-gap-horizontal);
7
7
 
8
8
  &:empty {
9
9
  display: none;
10
10
  }
11
11
 
12
- @media screen and (min-width: ${t.large}) {
13
- width: ${e||o?"100%":"calc(100% - var(--panel-samples-width))"};
14
- padding-left: ${o?"var(--panel-gap-horizontal)":"calc(var(--panel-gap-horizontal) * 2)"};
15
- padding-right: ${o?"var(--panel-gap-vertical)":"var(--panel-gap-horizontal)"};
12
+ @media screen and (min-width: ${o.large}) {
13
+ width: ${e||n?"100%":"calc(100% - var(--panel-samples-width))"};
14
+ padding-left: calc(var(--panel-gap-horizontal) * 2);
15
+ padding-right: ${n?"var(--panel-gap-vertical)":"var(--panel-gap-horizontal)"};
16
16
  padding-top: 0;
17
- padding-bottom: ${o?"var(--spacing-vertical)":0};
17
+ padding-bottom: ${n?"var(--spacing-vertical)":0};
18
18
  }
19
19
 
20
20
  @media print {
21
21
  width: 100%;
22
- padding-top: ${n};
23
- padding-bottom: ${n};
22
+ padding-top: ${r};
23
+ padding-bottom: ${r};
24
24
  }
25
25
  `}};
26
26
 
@@ -35,7 +35,7 @@ import{css as i}from"styled-components";import{LayoutVariant as p}from"@redocly/
35
35
  ${d} article :last-child {
36
36
  margin-bottom: 0;
37
37
  }
38
- `,w=r.div.attrs(a=>({[c]:a.sectionId,id:a.id}))`
38
+ `,w=t.div.attrs(a=>({[c]:a.sectionId,id:a.id}))`
39
39
  padding: 0;
40
40
  width: 100%;
41
41
 
@@ -50,7 +50,7 @@ import{css as i}from"styled-components";import{LayoutVariant as p}from"@redocly/
50
50
  min-height: initial;
51
51
  }
52
52
 
53
- @media screen and (min-width: ${t.medium}) {
53
+ @media screen and (min-width: ${o.medium}) {
54
54
  padding-top: var(--spacing-xs);
55
55
 
56
56
  ${({expanded:a})=>!a&&i`
@@ -74,16 +74,16 @@ import{css as i}from"styled-components";import{LayoutVariant as p}from"@redocly/
74
74
  border-bottom: 1px solid var(--border-color-primary);
75
75
  }
76
76
  `}
77
- ${l} {
77
+ ${p} {
78
78
  position: relative;
79
79
  }
80
- `,x=r.div`
80
+ `,x=t.div`
81
81
  color: var(--panel-samples-text-color);
82
82
  width: 100%;
83
83
  height: fit-content;
84
84
  padding-top: var(--panel-gap-vertical);
85
85
  padding-bottom: var(--panel-gap-vertical);
86
- padding-left: var(--panel-gap-horizontal);
86
+ padding-left: ${({isStacked:a})=>a?"calc(var(--panel-gap-horizontal) * 2)":"var(--panel-gap-horizontal)"};
87
87
  padding-right: var(--panel-gap-horizontal);
88
88
 
89
89
  position: sticky;
@@ -94,11 +94,11 @@ import{css as i}from"styled-components";import{LayoutVariant as p}from"@redocly/
94
94
  display: none;
95
95
  }
96
96
 
97
- @media screen and (min-width: ${t.large}) {
97
+ @media screen and (min-width: ${o.large}) {
98
98
  width: ${({isStacked:a})=>a?"100%":"var(--panel-samples-width)"};
99
99
  padding-top: 0;
100
100
  padding-bottom: 0;
101
- padding-left: ${({isStacked:a})=>a?"var(--panel-gap-vertical)":"var(--panel-gap-horizontal)"};
101
+ padding-left: ${({isStacked:a})=>a?"calc(var(--panel-gap-horizontal) * 2)":"var(--panel-gap-horizontal)"};
102
102
  padding-right: ${({isStacked:a})=>a?"var(--panel-gap-horizontal)":"calc(var(--panel-gap-horizontal) * 2)"};
103
103
  }
104
104
 
@@ -107,15 +107,15 @@ import{css as i}from"styled-components";import{LayoutVariant as p}from"@redocly/
107
107
  padding-top: var(--spacing-vertical);
108
108
  padding-bottom: var(--spacing-vertical);
109
109
  }
110
- `,y=r.div`
110
+ `,y=t.div`
111
111
  display: flex;
112
112
  flex-direction: column;
113
113
  justify-content: space-between;
114
114
  width: 100%;
115
115
  padding: 0;
116
116
 
117
- @media screen and (min-width: ${t.large}) {
118
- flex-direction: ${({layout:a})=>a!==p.STACKED?"row":"column"};
117
+ @media screen and (min-width: ${o.large}) {
118
+ flex-direction: ${({layout:a})=>a!==l.STACKED?"row":"column"};
119
119
  }
120
120
 
121
121
  @media print {
@@ -1,6 +1,5 @@
1
1
  export declare enum WindowReferenceOptions {
2
2
  ON_DEEP_LINK_CLICK = "onDeepLinkClick",
3
- REQUEST_INTERCEPTOR = "requestInterceptor",
4
3
  HOOKS = "hooks"
5
4
  }
6
5
  export declare enum MediaTypes {
@@ -23,3 +22,4 @@ export declare const LOADING_STATE: {
23
22
  LOADING: string;
24
23
  LOADED: string;
25
24
  };
25
+ export declare const REDOCLY_CONFIG_FILE = "redocly.yaml";
package/lib/constants.js CHANGED
@@ -1 +1 @@
1
- var t;(function(o){o.ON_DEEP_LINK_CLICK="onDeepLinkClick",o.REQUEST_INTERCEPTOR="requestInterceptor",o.HOOKS="hooks"})(t||(t={}));var E;(function(o){o.OCTET_STREAM="application/octet-stream",o.MULTIPART="multipart/form-data",o.URL_ENCODED="application/x-www-form-urlencoded",o.JSON="application/json",o.XML="application/xml"})(E||(E={}));const O="data-section-id",p="data-field-id",r=0,n="^ {0,3}<!-- ReDoc-Inject:\\s+?<({component}).*?/?>\\s+?-->\\s*$",c="(?:^ {0,3}<({component})([\\s\\S]*?)>([\\s\\S]*?)</\\2>|^ {0,3}<({component})([\\s\\S]*?)(?:/>|\\n{2,}))",D="(?:"+n+"|"+c+")",T="other",_="webhooks",e={NOT_LOADED:"NOT_LOADED",LOADING:"LOADING",LOADED:"LOADED"};export{D as COMPONENT_REGEXP,T as DEFAULT_TAG_SLUG,_ as DEFAULT_WEBHOOKS_TAG_NAME,p as FIELD_ATTR,r as GROUP_DEPTH,n as LEGACY_REGEXP,e as LOADING_STATE,c as MDX_COMPONENT_REGEXP,E as MediaTypes,O as SECTION_ATTR,t as WindowReferenceOptions};
1
+ var t;(function(o){o.ON_DEEP_LINK_CLICK="onDeepLinkClick",o.HOOKS="hooks"})(t||(t={}));var n;(function(o){o.OCTET_STREAM="application/octet-stream",o.MULTIPART="multipart/form-data",o.URL_ENCODED="application/x-www-form-urlencoded",o.JSON="application/json",o.XML="application/xml"})(n||(n={}));const O="data-section-id",e="data-field-id",p=0,E="^ {0,3}<!-- ReDoc-Inject:\\s+?<({component}).*?/?>\\s+?-->\\s*$",c="(?:^ {0,3}<({component})([\\s\\S]*?)>([\\s\\S]*?)</\\2>|^ {0,3}<({component})([\\s\\S]*?)(?:/>|\\n{2,}))",D="(?:"+E+"|"+c+")",_="other",r="webhooks",L={NOT_LOADED:"NOT_LOADED",LOADING:"LOADING",LOADED:"LOADED"},s="redocly.yaml";export{D as COMPONENT_REGEXP,_ as DEFAULT_TAG_SLUG,r as DEFAULT_WEBHOOKS_TAG_NAME,e as FIELD_ATTR,p as GROUP_DEPTH,E as LEGACY_REGEXP,L as LOADING_STATE,c as MDX_COMPONENT_REGEXP,n as MediaTypes,s as REDOCLY_CONFIG_FILE,O as SECTION_ATTR,t as WindowReferenceOptions};
@@ -1 +1 @@
1
- import{jsx as s}from"react/jsx-runtime";import{createElement as c}from"react";import{IS_BROWSER as f}from"@redocly/theme/core/openapi";import{useRouter as R}from"../hooks/index.js";import{getDisplayName as h}from"./utils.js";function P(r){const e=({disableRouter:i=!1,...t})=>{const o=t.basePath??"/",m=t.router??"history",{Router:u,routerProps:a}=R(m,o);return f&&!i?c(u,{...a,key:o},s(r,{...t})):s(r,{...t})};return e.displayName=`WithRouter(${h(r)})`,e}export{P as withRouter};
1
+ import{jsx as s}from"react/jsx-runtime";import{createElement as c}from"react";import{useRouter as f}from"../hooks/index.js";import{getDisplayName as R}from"./utils.js";import{IS_BROWSER as h}from"../utils/dom.js";function P(r){const e=({disableRouter:i=!1,...t})=>{const o=t.basePath??"/",m=t.router??"history",{Router:u,routerProps:a}=f(m,o);return h&&!i?c(u,{...a,key:o},s(r,{...t})):s(r,{...t})};return e.displayName=`WithRouter(${R(r)})`,e}export{P as withRouter};
@@ -2,7 +2,7 @@ export { useActivateExample } from './useActivateExample.js';
2
2
  export { useRouter } from './useRouter.js';
3
3
  export { useContentItems } from './useContentItems.js';
4
4
  export { useActiveWithFallback } from './useActiveWithFallback.js';
5
- export { useUppercase2LowercaseRedirect } from './useUppercase2LowercaseRedirect.js';
6
5
  export { useTranslate } from './useTranslate.js';
6
+ export { useUppercase2LowercaseRedirect } from './useUppercase2LowercaseRedirect.js';
7
7
  export { useTelemetry } from './useTelemetry.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{useUppercase2LowercaseRedirect as x}from"./useUppercase2LowercaseRedirect.js";import{useTranslate as i}from"./useTranslate.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,i as useTranslate,x 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{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};
package/lib/index.d.ts CHANGED
@@ -50,5 +50,6 @@ export { getValueFromMdParsedExtension } from './utils/helpers.js';
50
50
  export { ContentItem } from './components/ContentItem/index.js';
51
51
  export { ExampleSwitch } from './components/Samples/ExampleSwitch.js';
52
52
  export { CustomBadges } from './components/common/Badges.js';
53
+ export { Metadata } from './components/ApiInfo/Metadata.js';
53
54
  export { useDownloadInfo } from './components/Download/useDownloadInfo.js';
54
55
  export { SECTION_ATTR } from './constants.js';
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- import{useAtomValue as e}from"jotai";import{globalOptionsAtom as o}from"./jotai/store.js";import{simplifyAstStructure as n}from"./utils/simplifyAstStructure.js";import{getOperation as x}from"./models/operation.js";import{getServerEnvName as l}from"./utils/environments.js";import{getTagOrGroup as d}from"./models/group.js";import{generateDeepLink as c}from"./components/common/LinkToField.js";import{RequestSamples as g}from"./components/RequestSamples/RequestSamples.js";import{ResponseSamples as P}from"./components/ResponseSamples/ResponseSamples.js";import{RedocSchema as I}from"./components/pluggable/RedocSchema.js";import{RedocExample as w}from"./components/pluggable/RedocExample.js";import{RedoclyOpenAPIDocs as v}from"./components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js";import{StoreProvider as E}from"./components/RedoclyOpenAPIDocs/Providers.js";import{getMarkdownHeaderId as A}from"./components/RedoclyOpenAPIDocs/utils.js";import{safeSlugify as b}from"./utils/string.js";import{JsonPointer as L}from"./utils/JsonPointer.js";import{isOperationName as V}from"./utils/openapi.js";import{pathIncludesLink as F,normalizePath as H}from"./utils/path.js";import{saveTextBeforeHeading as z}from"./utils/saveTextBeforeHeading.js";import{OpenAPIParser as G}from"./services/OpenAPIParser.js";import{buildContentItems as _}from"./services/menu/builder.js";import{normalizeOptions as K}from"./services/config-options/normalizeOptions.js";import{makeDeepLink as U}from"./services/history/helpers.js";function p(){return e(o)}import{EmbeddedReplay as X}from"./components/Replay/EmbeddedReplay.js";import{convertOperationToReplayValue as Z}from"./components/Replay/utils.js";import{SectionContainer as ee}from"./components/SectionContent/index.js";import{Row as re}from"./components/common/panels.js";import{RightPanelContainer as pe}from"./components/SectionContent/index.js";import{Overview as ae}from"./components/Overview/index.js";import{SamplesMiddlePanel as fe,Section as xe,SamplesPanel as ie}from"./components/common/panels.js";import{Heading as se}from"./components/common/OperationItemTitle.js";import{Dropdown as ue}from"./components/common/Dropdown/index.js";import{Markdown as Se}from"./components/Markdown/index.js";import{FieldValueLabel as Oe,FieldLabel as Pe}from"./components/common/Fields/index.js";import{CodeBlockPanel as Ie}from"./components/common/index.js";import{OperationSamplesPanel as we}from"./components/OperationItem/OperationItem.js";import{ExternalDocumentation as ve}from"./components/ExternalDocumentation/index.js";import{PropertyDetails as Ee}from"./components/PropertyDetails/PropertyDetails.js";import{addMarkdownItems as Ae}from"./services/menu/markdown.js";import{getValueFromMdParsedExtension as be}from"./utils/helpers.js";import{ContentItem as Le}from"./components/ContentItem/index.js";import{ExampleSwitch as Ve}from"./components/Samples/ExampleSwitch.js";import{CustomBadges as Fe}from"./components/common/Badges.js";import{useDownloadInfo as Ne}from"./components/Download/useDownloadInfo.js";import{SECTION_ATTR as qe}from"./constants.js";export{Ie as CodeBlockPanel,Le as ContentItem,Fe as CustomBadges,ue as Dropdown,X as EmbeddedReplay,Ve as ExampleSwitch,ve as ExternalDocumentation,Pe as FieldLabel,Oe as FieldValueLabel,se as Heading,L as JsonPointer,Se as Markdown,G as OpenAPIParser,we as OperationSamplesPanel,ae as Overview,Ee as PropertyDetails,w as RedocExample,I as RedocSchema,v as RedoclyOpenAPIDocs,g as RequestSamples,P as ResponseSamples,pe as RightPanelContainer,re as Row,qe as SECTION_ATTR,fe as SamplesMiddlePanel,ie as SamplesPanel,xe as Section,ee as SectionContainer,E as StoreProvider,Ae as addMarkdownItems,_ as buildContentItems,Z as convertOperationToReplayValue,c as generateDeepLink,A as getMarkdownHeaderId,x as getOperation,l as getServerEnvName,d as getTagOrGroup,be as getValueFromMdParsedExtension,V as isOperationName,U as makeDeepLink,K as normalizeOptions,H as normalizePath,F as pathIncludesLink,b as safeSlugify,z as saveTextBeforeHeading,n as simplifyAstStructure,Ne as useDownloadInfo,p as useOpenapiDocsOptions};
1
+ import{useAtomValue as e}from"jotai";import{globalOptionsAtom as o}from"./jotai/store.js";import{simplifyAstStructure as n}from"./utils/simplifyAstStructure.js";import{getOperation as x}from"./models/operation.js";import{getServerEnvName as l}from"./utils/environments.js";import{getTagOrGroup as d}from"./models/group.js";import{generateDeepLink as c}from"./components/common/LinkToField.js";import{RequestSamples as g}from"./components/RequestSamples/RequestSamples.js";import{ResponseSamples as P}from"./components/ResponseSamples/ResponseSamples.js";import{RedocSchema as I}from"./components/pluggable/RedocSchema.js";import{RedocExample as w}from"./components/pluggable/RedocExample.js";import{RedoclyOpenAPIDocs as v}from"./components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js";import{StoreProvider as E}from"./components/RedoclyOpenAPIDocs/Providers.js";import{getMarkdownHeaderId as A}from"./components/RedoclyOpenAPIDocs/utils.js";import{safeSlugify as T}from"./utils/string.js";import{JsonPointer as h}from"./utils/JsonPointer.js";import{isOperationName as V}from"./utils/openapi.js";import{pathIncludesLink as F,normalizePath as H}from"./utils/path.js";import{saveTextBeforeHeading as z}from"./utils/saveTextBeforeHeading.js";import{OpenAPIParser as G}from"./services/OpenAPIParser.js";import{buildContentItems as _}from"./services/menu/builder.js";import{normalizeOptions as K}from"./services/config-options/normalizeOptions.js";import{makeDeepLink as U}from"./services/history/helpers.js";function p(){return e(o)}import{EmbeddedReplay as X}from"./components/Replay/EmbeddedReplay.js";import{convertOperationToReplayValue as Z}from"./components/Replay/utils.js";import{SectionContainer as ee}from"./components/SectionContent/index.js";import{Row as re}from"./components/common/panels.js";import{RightPanelContainer as pe}from"./components/SectionContent/index.js";import{Overview as ae}from"./components/Overview/index.js";import{SamplesMiddlePanel as fe,Section as xe,SamplesPanel as ie}from"./components/common/panels.js";import{Heading as se}from"./components/common/OperationItemTitle.js";import{Dropdown as ue}from"./components/common/Dropdown/index.js";import{Markdown as Se}from"./components/Markdown/index.js";import{FieldValueLabel as Oe,FieldLabel as Pe}from"./components/common/Fields/index.js";import{CodeBlockPanel as Ie}from"./components/common/index.js";import{OperationSamplesPanel as we}from"./components/OperationItem/OperationItem.js";import{ExternalDocumentation as ve}from"./components/ExternalDocumentation/index.js";import{PropertyDetails as Ee}from"./components/PropertyDetails/PropertyDetails.js";import{addMarkdownItems as Ae}from"./services/menu/markdown.js";import{getValueFromMdParsedExtension as Te}from"./utils/helpers.js";import{ContentItem as he}from"./components/ContentItem/index.js";import{ExampleSwitch as Ve}from"./components/Samples/ExampleSwitch.js";import{CustomBadges as Fe}from"./components/common/Badges.js";import{Metadata as Ne}from"./components/ApiInfo/Metadata.js";import{useDownloadInfo as qe}from"./components/Download/useDownloadInfo.js";import{SECTION_ATTR as Je}from"./constants.js";export{Ie as CodeBlockPanel,he as ContentItem,Fe as CustomBadges,ue as Dropdown,X as EmbeddedReplay,Ve as ExampleSwitch,ve as ExternalDocumentation,Pe as FieldLabel,Oe as FieldValueLabel,se as Heading,h as JsonPointer,Se as Markdown,Ne as Metadata,G as OpenAPIParser,we as OperationSamplesPanel,ae as Overview,Ee as PropertyDetails,w as RedocExample,I as RedocSchema,v as RedoclyOpenAPIDocs,g as RequestSamples,P as ResponseSamples,pe as RightPanelContainer,re as Row,Je as SECTION_ATTR,fe as SamplesMiddlePanel,ie as SamplesPanel,xe as Section,ee as SectionContainer,E as StoreProvider,Ae as addMarkdownItems,_ as buildContentItems,Z as convertOperationToReplayValue,c as generateDeepLink,A as getMarkdownHeaderId,x as getOperation,l as getServerEnvName,d as getTagOrGroup,Te as getValueFromMdParsedExtension,V as isOperationName,U as makeDeepLink,K as normalizeOptions,H as normalizePath,F as pathIncludesLink,T as safeSlugify,z as saveTextBeforeHeading,n as simplifyAstStructure,qe as useDownloadInfo,p as useOpenapiDocsOptions};
@@ -1,7 +1,7 @@
1
1
  import { LayoutVariant } from '@redocly/config';
2
2
  import type { AsyncLocalStorage } from 'node:async_hooks';
3
3
  import type { TabType } from '../models/tab.js';
4
- import { type UserClaims } from '@redocly/theme/core/openapi';
4
+ import type { UserClaims } from '@redocly/theme/core/openapi';
5
5
  declare global {
6
6
  var redoclyCookieStorage: AsyncLocalStorage<string> | undefined;
7
7
  }
package/lib/jotai/app.js CHANGED
@@ -1 +1 @@
1
- import{atom as a}from"jotai";import{atomWithStorage as v,createJSONStorage as d}from"jotai/utils";import{LayoutVariant as u}from"@redocly/config";import{IS_BROWSER as f}from"@redocly/theme/core/openapi";import{getCookie as y,removeCookie as A,setCookie as k}from"../utils/cookies.js";import{globalOptionsAtom as O}from"./store.js";import{mergeEnvData as m}from"../utils/environments.js";import{fromSessionStorage as x,safeJsonParse as S,toSessionStorage as C}from"../utils/index.js";const l={isSidebarOpened:!0,activeMimeName:"",layout:u.THREE_PANEL,language:"",environment:"",environments:{},userClaims:{}},b={getItem:e=>{const t=S(y(e,globalThis.redoclyCookieStorage?.getStore?.())),o=S(x(e));return{...l,...o,...t}},setItem:(e,t)=>{const{environments:o,...n}=t,r={environments:o};k(e,JSON.stringify(n)),C(e,JSON.stringify(r))},removeItem:e=>{A(e),sessionStorage.removeItem(e)}},s=v("redoc.appStore",l,b),g=a({}),h=a(e=>{const t=e(s),o=e(g);return m(t.environments,o?.environments||{})}),D=a(e=>{const t=e(s),o=e(g),n=m(t.environments,o?.environments||{}),r=o?.environment||t.environment,i=n[r]?r:Object.keys(n)[0];return[n[i]||{},i||""]},(e,t,{environment:o,environments:n})=>{const r=e(s);t(s,{...r,environment:o||r.environment,environments:m(r.environments||{},n)})}),K=a(e=>e(s).isSidebarOpened,(e,t,o)=>{const n=e(s);t(s,{...n,isSidebarOpened:o})}),P=a(e=>e(s).activeMimeName,(e,t,o)=>{const n=e(s);t(s,{...n,activeMimeName:o})}),W=a(e=>e(s).layout,(e,t,o=u.STACKED)=>{const n=e(s);t(s,{...n,layout:o})}),_=a(e=>e(s).userClaims,(e,t,o)=>{const n=e(s);t(s,{...n,userClaims:o})}),c=v("redoc.appSessionStore",{collapsedSidebar:!1,unsupportedFeatureScreen:!1},f?d(()=>sessionStorage):void 0),j=a(e=>e(c).collapsedSidebar,(e,t,o)=>{const n=e(c);t(c,{...n,collapsedSidebar:o})});function N({lang:e,label:t}){return(t||e).toLowerCase()}const w=a(e=>{const{codeSamples:t}=e(O),o=t.languages.map(({lang:r,label:i},p)=>({key:N({lang:r,label:i}),lang:r,title:i||r,order:p})),n=e(s).language||o[0]?.key;return{languages:o,activeLanguage:o.find(({key:r})=>r===n)?.key||o[0]?.key}},(e,t,o)=>{const n=e(s);t(s,{...n,language:o})});export{P as activeMimeNameAtom,c as appSessionStore,s as appStore,g as appStoreOverrideAtom,j as collapsedSidebarAtom,D as environmentAtom,h as environmentsAtom,N as getLangKey,K as isSidebarOpenedAtom,w as languageAtom,W as layoutAtom,_ as userClaimsAtom};
1
+ import{atom as a}from"jotai";import{atomWithStorage as v,createJSONStorage as d}from"jotai/utils";import{LayoutVariant as u}from"@redocly/config";import{getCookie as f,removeCookie as y,setCookie as A}from"../utils/cookies.js";import{globalOptionsAtom as k}from"./store.js";import{mergeEnvData as m}from"../utils/environments.js";import{fromSessionStorage as O,safeJsonParse as S,toSessionStorage as x}from"../utils/index.js";import{IS_BROWSER as C}from"../utils/dom.js";const l={isSidebarOpened:!0,activeMimeName:"",layout:u.THREE_PANEL,language:"",environment:"",environments:{},userClaims:{}},b={getItem:e=>{const t=S(f(e,globalThis.redoclyCookieStorage?.getStore?.())),o=S(O(e));return{...l,...o,...t}},setItem:(e,t)=>{const{environments:o,...n}=t,r={environments:o};A(e,JSON.stringify(n)),x(e,JSON.stringify(r))},removeItem:e=>{y(e),sessionStorage.removeItem(e)}},s=v("redoc.appStore",l,b),g=a({}),h=a(e=>{const t=e(s),o=e(g);return m(t.environments,o?.environments||{})}),D=a(e=>{const t=e(s),o=e(g),n=m(t.environments,o?.environments||{}),r=o?.environment||t.environment,i=n[r]?r:Object.keys(n)[0];return[n[i]||{},i||""]},(e,t,{environment:o,environments:n})=>{const r=e(s);t(s,{...r,environment:o||r.environment,environments:m(r.environments||{},n)})}),K=a(e=>e(s).isSidebarOpened,(e,t,o)=>{const n=e(s);t(s,{...n,isSidebarOpened:o})}),P=a(e=>e(s).activeMimeName,(e,t,o)=>{const n=e(s);t(s,{...n,activeMimeName:o})}),W=a(e=>e(s).layout,(e,t,o=u.STACKED)=>{const n=e(s);t(s,{...n,layout:o})}),_=a(e=>e(s).userClaims,(e,t,o)=>{const n=e(s);t(s,{...n,userClaims:o})}),c=v("redoc.appSessionStore",{collapsedSidebar:!1,unsupportedFeatureScreen:!1},C?d(()=>sessionStorage):void 0),j=a(e=>e(c).collapsedSidebar,(e,t,o)=>{const n=e(c);t(c,{...n,collapsedSidebar:o})});function N({lang:e,label:t}){return(t||e).toLowerCase()}const w=a(e=>{const{codeSamples:t}=e(k),o=t.languages.map(({lang:r,label:i},p)=>({key:N({lang:r,label:i}),lang:r,title:i||r,order:p})),n=e(s).language||o[0]?.key;return{languages:o,activeLanguage:o.find(({key:r})=>r===n)?.key||o[0]?.key}},(e,t,o)=>{const n=e(s);t(s,{...n,language:o})});export{P as activeMimeNameAtom,c as appSessionStore,s as appStore,g as appStoreOverrideAtom,j as collapsedSidebarAtom,D as environmentAtom,h as environmentsAtom,N as getLangKey,K as isSidebarOpenedAtom,w as languageAtom,W as layoutAtom,_ as userClaimsAtom};
@@ -1 +1 @@
1
- import{LayoutVariant as d}from"@redocly/config";import{isUndefined as m,addTrailingSlash as r}from"@redocly/theme/core/openapi";import{WindowReferenceOptions as i}from"../../constants.js";import{argValueToBoolean as o,argValueToExpandLevel as a,argValueToInt as p,argValueToNumber as c,getWindowReferenceOptions as t,normalizePath as h}from"../../utils/index.js";import{normalizeShowExtensions as u,normalizeScrollYOffset as f}from"./helpers.js";import{Languages as S}from"../code-samples/constants.js";function v(e,s){e={...s,...e,markdocOptions:{...e?.markdocOptions,components:{...s?.markdocOptions?.components,...e?.markdocOptions?.components},tags:{...s?.markdocOptions?.tags,...e?.markdocOptions?.tags},nodes:{...s?.markdocOptions?.nodes,...e?.markdocOptions?.nodes,heading:s?.markdocOptions?.nodes?.heading||e?.markdocOptions?.nodes.heading}}};const l=Array.isArray(e.ignoreNamedSchemas)?e.ignoreNamedSchemas:e.ignoreNamedSchemas?.split(",").map(n=>n.trim());return{downloadUrls:e.downloadUrls,schemaDefinitionsTagName:e.schemaDefinitionsTagName,corsProxyUrl:e.corsProxyUrl&&r(e.corsProxyUrl),hideSidebar:o(e.hideSidebar,!1),jsonSamplesExpandLevel:a(e.jsonSamplesExpandLevel,2),generatedSamplesMaxDepth:p(e.generatedSamplesMaxDepth,8),hideDownloadButtons:o(e.hideDownloadButtons,!1),hideInfoMetadata:o(e.hideInfoMetadata,!1),hideLoading:o(e.hideLoading,!1),hideSchemaTitles:o(e.hideSchemaTitles,!1),maxDisplayedEnumValues:c(e.maxDisplayedEnumValues),mockServer:e.mockServer?.url?{url:e.mockServer.url,position:e.mockServer.position||"first",description:e.mockServer.description||"Mock server"}:void 0,hideReplay:o(e.hideReplay,!1),oAuth2RedirectURI:e.oAuth2RedirectURI||null,onlyRequiredInSamples:o(e.onlyRequiredInSamples,!1),onDeepLinkClick:e.onDeepLinkClick||t(i.ON_DEEP_LINK_CLICK),requestInterceptor:e.requestInterceptor||t(i.REQUEST_INTERCEPTOR),routingBasePath:m(e.disableRouter)?"":e.routingBasePath&&h(e.routingBasePath)||"",schemasExpansionLevel:a(e.schemasExpansionLevel),feedback:e.feedback||{hide:!1},sortRequiredPropsFirst:o(e.sortRequiredPropsFirst,!1),scrollYOffset:f(e.scrollYOffset),showExtensions:u(e.showExtensions),sanitize:o(e.sanitize,!1),skipBundle:o(e.skipBundle,!1),ignoreNamedSchemas:new Set(l),markdocOptions:e?.markdocOptions,codeSamples:e.codeSamples||{languages:Object.values(S).map(n=>({lang:n}))},layout:e.layout||d.THREE_PANEL,events:e.events||{},unstable_hooks:e.unstable_hooks||t(i.HOOKS)||{},unstable_skipSamples:o(e.unstable_skipSamples,!1),unstable_externalCodeSamples:e.unstable_externalCodeSamples||[],hidePropertiesPrefix:o(e?.hidePropertiesPrefix,!1)}}export{v as normalizeOptions};
1
+ import{LayoutVariant as d}from"@redocly/config";import{isUndefined as m,addTrailingSlash as r}from"@redocly/theme/core/openapi";import{WindowReferenceOptions as i}from"../../constants.js";import{argValueToBoolean as o,argValueToExpandLevel as a,argValueToInt as p,argValueToNumber as c,getWindowReferenceOptions as t,normalizePath as h}from"../../utils/index.js";import{normalizeShowExtensions as u,normalizeScrollYOffset as f}from"./helpers.js";import{Languages as S}from"../code-samples/constants.js";function y(e,s){e={...s,...e,markdocOptions:{...e?.markdocOptions,components:{...s?.markdocOptions?.components,...e?.markdocOptions?.components},tags:{...s?.markdocOptions?.tags,...e?.markdocOptions?.tags},nodes:{...s?.markdocOptions?.nodes,...e?.markdocOptions?.nodes,heading:s?.markdocOptions?.nodes?.heading||e?.markdocOptions?.nodes.heading}}};const l=Array.isArray(e.ignoreNamedSchemas)?e.ignoreNamedSchemas:e.ignoreNamedSchemas?.split(",").map(n=>n.trim());return{downloadUrls:e.downloadUrls,schemaDefinitionsTagName:e.schemaDefinitionsTagName,corsProxyUrl:e.corsProxyUrl&&r(e.corsProxyUrl),hideSidebar:o(e.hideSidebar,!1),jsonSamplesExpandLevel:a(e.jsonSamplesExpandLevel,2),generatedSamplesMaxDepth:p(e.generatedSamplesMaxDepth,8),hideDownloadButtons:o(e.hideDownloadButtons,!1),hideInfoMetadata:o(e.hideInfoMetadata,!1),hideLoading:o(e.hideLoading,!1),hideSchemaTitles:o(e.hideSchemaTitles,!1),maxDisplayedEnumValues:c(e.maxDisplayedEnumValues),mockServer:e.mockServer?.url?{url:e.mockServer.url,position:e.mockServer.position||"first",description:e.mockServer.description||"Mock server"}:void 0,hideReplay:o(e.hideReplay,!1),oAuth2RedirectURI:e.oAuth2RedirectURI||null,onlyRequiredInSamples:o(e.onlyRequiredInSamples,!1),onDeepLinkClick:e.onDeepLinkClick||t(i.ON_DEEP_LINK_CLICK),routingBasePath:m(e.disableRouter)?"":e.routingBasePath&&h(e.routingBasePath)||"",schemasExpansionLevel:a(e.schemasExpansionLevel),feedback:e.feedback||{hide:!1},sortRequiredPropsFirst:o(e.sortRequiredPropsFirst,!1),scrollYOffset:f(e.scrollYOffset),showExtensions:u(e.showExtensions),sanitize:o(e.sanitize,!1),skipBundle:o(e.skipBundle,!1),ignoreNamedSchemas:new Set(l),markdocOptions:e?.markdocOptions,codeSamples:e.codeSamples||{languages:Object.values(S).map(n=>({lang:n}))},layout:e.layout||d.THREE_PANEL,events:e.events||{},unstable_hooks:e.unstable_hooks||t(i.HOOKS)||{},unstable_skipSamples:o(e.unstable_skipSamples,!1),unstable_externalCodeSamples:e.unstable_externalCodeSamples||[],hidePropertiesPrefix:o(e?.hidePropertiesPrefix,!1)}}export{y as normalizeOptions};
@@ -2,7 +2,6 @@ import type { CodeSamplesConfig } from '../code-samples/index.js';
2
2
  import type { HooksConfig, Unstable_ExternalCodeSample } from '../types.js';
3
3
  import type { Events } from '../../events/index.js';
4
4
  import type { LayoutVariant } from '@redocly/config';
5
- import type { OperationModel } from '../../models/types.js';
6
5
  import type { DownloadUrlsConfig } from '../../components/Download/types.js';
7
6
  import type { MarkdocOptions } from '../../components/Markdown/types.js';
8
7
  export interface Options {
@@ -15,7 +14,6 @@ export interface Options {
15
14
  hideReplay: boolean;
16
15
  oAuth2RedirectURI: string | null;
17
16
  corsProxyUrl?: string;
18
- requestInterceptor: ((req: Request, operation: OperationModel) => void) | undefined | null;
19
17
  sortRequiredPropsFirst: boolean;
20
18
  sanitize: boolean;
21
19
  hideDownloadButtons: boolean | null;
@@ -4,6 +4,8 @@ import type { StoreProviderProps } from './components/RedoclyOpenAPIDocs/types.j
4
4
  export { setSecurityDetails, setSecurityDetailsVariants } from './utils/security-details.js';
5
5
  export { setParameterValue } from './utils/parameters.js';
6
6
  export declare function hydrate(store: StoreProviderProps, element?: Element | null): void;
7
- export declare function init(definitionOrDefinitionUrl: string | OpenAPIDefinition, options?: RedocConfig, element?: Element | null): void;
7
+ export declare function init(definitionOrDefinitionUrl: string | OpenAPIDefinition, options?: RedocConfig & {
8
+ router?: 'hash' | 'history';
9
+ }, element?: Element | null): void;
8
10
  export declare const version: string;
9
11
  export declare const revision: string;
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 m,hydrateRoot as u}from"react-dom/client";import{querySelector as s}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 v,setSecurityDetailsVariants as O}from"./utils/security-details.js";import{setParameterValue as j}from"./utils/parameters.js";function _(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 d(t){const e=_(t),o={};for(const r in e){const n=r.replace(/-(.)/g,(c,a)=>a.toUpperCase());o[n]=e[r]}return o}function N(t,e=document.querySelector("redoc")){u(e,i(l,{store:t}))}function E(t,e={},o=s("redoc")){if(o===null)throw new Error('"element" argument is not provided and <redoc> tag is not found on the page');let r,n;typeof t=="string"?r=t:typeof t=="object"&&(n=t),m(o).render(p(f,{definition:n,definitionUrl:r,options:{...e,...d(o)}},["Loading..."]))}const b=__REDOCLY_API_REFERENCE_VERSION__,h=__REDOCLY_API_REFERENCE_REVISION__;function R(){const t=s("redoc");if(!t)return;const e=t.getAttribute("spec-url");e&&E(e,{},t)}R();export{N as hydrate,E as init,h as revision,j as setParameterValue,v as setSecurityDetails,O as setSecurityDetailsVariants,b 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 v,setSecurityDetailsVariants as V}from"./utils/security-details.js";import{setParameterValue as D}from"./utils/parameters.js";function _(t){const o={},e=t.attributes;for(let r=0;r<e.length;r++){const n=e[r];o[n.name]=n.value}return o}function d(t){const o=_(t),e={};for(const r in o){const n=r.replace(/-(.)/g,(c,s)=>s.toUpperCase());e[n]=o[r]}return e}function N(t,o=document.querySelector("redoc")){m(o,i(l,{store:t}))}function E(t,o={},e=a("redoc")){if(e===null)throw new Error('"element" argument is not provided and <redoc> tag is not found on the page');const{router:r,...n}=o;let c,s;typeof t=="string"?c=t:typeof t=="object"&&(s=t),u(e).render(p(f,{definition:s,definitionUrl:c,options:{...n,...d(e)},router:r??"history"},["Loading..."]))}const b=__REDOCLY_API_REFERENCE_VERSION__,C=__REDOCLY_API_REFERENCE_REVISION__;function R(){const t=a("redoc");if(!t)return;const o=t.getAttribute("spec-url");o&&E(o,{},t)}R();export{N as hydrate,E as init,C as revision,D as setParameterValue,v as setSecurityDetails,V as setSecurityDetailsVariants,b as version};
@@ -1 +1 @@
1
- import{tryDecodeURIComponent as r}from"./string.js";function s(e,c,o={path:"/"}){if(typeof document>"u")return;typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires instanceof Date?o.expires.toUTCString():o.expires),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,r).replace(/[()]/g,escape);let i="";for(const n in o)o[n]&&(i+="; "+n,o[n]!==!0&&(i+="="+String(o[n]).split(";")[0]));return document.cookie=e+"="+g(c)+i}function u(e,c){const o=typeof document<"u"?document.cookie:c,i=o?o.split("; "):[],n={};for(let p=0;p<i.length;p++){const f=i[p].split("="),d=f.slice(1).join("=");try{const t=r(f[0]);if(t in n||(n[t]=x(d)),e===t)break}catch{}}return e?n[e]:n}function C(e,c={path:"/"}){s(e,"",{...c,expires:-1})}function x(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,r)}function g(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,r)}export{u as getCookie,C as removeCookie,s as setCookie};
1
+ import{tryDecodeURIComponent as r}from"./string.js";function s(e,c,o={path:"/"}){if(typeof document>"u")return;typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires instanceof Date?o.expires.toUTCString():o.expires),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,r).replace(/[()]/g,escape);let i="";for(const n in o)o[n]&&(i+="; "+n,o[n]!==!0&&(i+="="+String(o[n]).split(";")[0]));return document.cookie=e+"="+g(c)+i}function u(e,c){const o=typeof document<"u"?document.cookie:c,i=o?o.split("; "):[],n={};for(let p=0;p<i.length;p++){const f=i[p].split("="),d=f.slice(1).join("=");try{const t=r(f[0]);if(t in n||(n[t]=x(d)),e===t)break}catch{}}return e?n[e]:""}function C(e,c={path:"/"}){s(e,"",{...c,expires:-1})}function x(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,r)}function g(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,r)}export{u as getCookie,C as removeCookie,s as setCookie};
@@ -5,3 +5,4 @@ export declare function querySelector(selector: string): Element | null;
5
5
  * un-encoded `<` or `>` characters very well, so don't feed it malformed HTML
6
6
  */
7
7
  export declare function html2Str(html: string): string;
8
+ export declare const IS_BROWSER: boolean;
package/lib/utils/dom.js CHANGED
@@ -1 +1 @@
1
- function c(e){return typeof document<"u"?document.querySelector(e):null}function h(e){return e.split(/<[^>]+>/).map(t=>t.trim()).filter(t=>t.length>0).join(" ")}typeof Element<"u"&&!Element.prototype.scrollIntoViewIfNeeded&&(Element.prototype.scrollIntoViewIfNeeded=function(e){e=arguments.length===0?!0:!!e;const t=this.parentNode,n=window.getComputedStyle(t,void 0),r=parseInt(n.getPropertyValue("border-top-width"),10),f=parseInt(n.getPropertyValue("border-left-width"),10),o=this.offsetTop-t.offsetTop<t.scrollTop,i=this.offsetTop-t.offsetTop+this.clientHeight-r>t.scrollTop+t.clientHeight,s=this.offsetLeft-t.offsetLeft<t.scrollLeft,l=this.offsetLeft-t.offsetLeft+this.clientWidth-f>t.scrollLeft+t.clientWidth,p=o&&!i;(o||i)&&e&&(t.scrollTop=this.offsetTop-t.offsetTop-t.clientHeight/2-r+this.clientHeight/2),(s||l)&&e&&(t.scrollLeft=this.offsetLeft-t.offsetLeft-t.clientWidth/2-f+this.clientWidth/2),(o||i||s||l)&&!e&&this.scrollIntoView(p)});export{h as html2Str,c as querySelector};
1
+ function c(e){return typeof document<"u"?document.querySelector(e):null}function h(e){return e.split(/<[^>]+>/).map(t=>t.trim()).filter(t=>t.length>0).join(" ")}typeof Element<"u"&&!Element.prototype.scrollIntoViewIfNeeded&&(Element.prototype.scrollIntoViewIfNeeded=function(e){e=arguments.length===0?!0:!!e;const t=this.parentNode,i=window.getComputedStyle(t,void 0),r=parseInt(i.getPropertyValue("border-top-width"),10),f=parseInt(i.getPropertyValue("border-left-width"),10),o=this.offsetTop-t.offsetTop<t.scrollTop,n=this.offsetTop-t.offsetTop+this.clientHeight-r>t.scrollTop+t.clientHeight,s=this.offsetLeft-t.offsetLeft<t.scrollLeft,l=this.offsetLeft-t.offsetLeft+this.clientWidth-f>t.scrollLeft+t.clientWidth,p=o&&!n;(o||n)&&e&&(t.scrollTop=this.offsetTop-t.offsetTop-t.clientHeight/2-r+this.clientHeight/2),(s||l)&&e&&(t.scrollLeft=this.offsetLeft-t.offsetLeft-t.clientWidth/2-f+this.clientWidth/2),(o||n||s||l)&&!e&&this.scrollIntoView(p)});const d=typeof window<"u"&&"HTMLElement"in window;export{d as IS_BROWSER,h as html2Str,c as querySelector};
@@ -1,12 +1,12 @@
1
- import{isObject as i,isString as a,IS_BROWSER as u}from"@redocly/theme/core/openapi";import{isNamedDefinition as f}from"./openapi.js";import{JsonPointer as l}from"./JsonPointer.js";import{urlParse as c}from"./url.js";function w(r,e){const t=[];for(let n=0;n<r.length-1;n++)t.push(e(r[n],!1));return r.length!==0&&t.push(e(r[r.length-1],!0)),t}function O(r,e){const t={};for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=e(r[n],n,r));return t}function y(r,e){const t=[],n=o=>{for(const s of o)t.push(s),s[e]&&n(s[e])};return n(r),t}function p(r){return r.endsWith("/")?r.substring(0,r.length-1):r}function A(r){return!isNaN(parseFloat(r))&&isFinite(r)}function b(r,e,t){const n=new RegExp(`(^|\\n)#\\s?${e}\\s*\\n`,"i"),o=new RegExp(`((\\n|^)#\\s*${e}\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)`,"i");if(n.test(r))return r.replace(o,`$1
1
+ import{isObject as i,isString as a}from"@redocly/theme/core/openapi";import{isNamedDefinition as f}from"./openapi.js";import{JsonPointer as l}from"./JsonPointer.js";import{urlParse as u}from"./url.js";import{IS_BROWSER as c}from"./dom.js";function O(r,t){const e=[];for(let n=0;n<r.length-1;n++)e.push(t(r[n],!1));return r.length!==0&&e.push(t(r[r.length-1],!0)),e}function y(r,t){const e={};for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=t(r[n],n,r));return e}function A(r,t){const e=[],n=o=>{for(const s of o)e.push(s),s[t]&&n(s[t])};return n(r),e}function p(r){return r.endsWith("/")?r.substring(0,r.length-1):r}function b(r){return!isNaN(parseFloat(r))&&isFinite(r)}function E(r,t,e){const n=new RegExp(`(^|\\n)#\\s?${t}\\s*\\n`,"i"),o=new RegExp(`((\\n|^)#\\s*${t}\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)`,"i");if(n.test(r))return r.replace(o,`$1
2
2
 
3
- ${t}
3
+ ${e}
4
4
  $4`);{const s=r===""||r.endsWith(`
5
5
 
6
6
  `)?"":r.endsWith(`
7
7
  `)?`
8
8
  `:`
9
9
 
10
- `;return`${r}${s}# ${e}
10
+ `;return`${r}${s}# ${t}
11
11
 
12
- ${t}`}}const E=r=>Array.isArray(r)&&r.some(e=>i(e)),R=r=>r.filter(e=>!!e),W=r=>i(r)&&!Array.isArray(r);function d(r){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(r)}function C(r,e){let t;if(e.startsWith("//"))t=`${c(r,!0)?.protocol||"https:"}${e}`;else if(d(e))t=e;else if(!e.startsWith("/"))t=p(r)+"/"+e;else{const n=c(r);n?(n.pathname=e,t=n.toString()):t=e}return p(t)}function I(r){return r.charAt(0).toUpperCase()+r.slice(1)}function L(r){try{if(!r)return"";const e=new URL(r);return e.search="",e.hash="",e.toString()}catch{return r}}function M(r){return r.replace(/["\\]/g,"\\$&")}function N(r){return r.replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(parseInt(t,10))).replace(/&amp;/g,"&").replace(/&quot;/g,'"')}function P(r){return r&&r.replace(/#/g,"_").toLowerCase()}function T(r,e){return e||f(r)&&l.baseName(r)||""}function j(r={},e,t){return typeof e=="string"&&(e=e.split(".")),e.reduce((n,o)=>n&&n[o]?n[o]:t,r)}function x(r){return(...e)=>e.filter(Boolean).join(r)}const z=x(".");function D(r){return u?window?.REFERENCE_DOCS_OPTIONS?.[r]:null}function F(){if(!u)return"";const r=+new Date+Math.random();try{return(!document.currentScript||!(document.currentScript.async||document.currentScript.defer))&&document.write(`<script id="dummy${r}"></script>`),(document.getElementById("dummy"+r)?.previousSibling).src}catch{return""}}const _=r=>a(r)?r:r?.raw,B=(r,e)=>{const t=r?.[`x-parsed-md-${e}`]||r?.[e];if(!t)return;if(!r?.[`x-parsed-md-${e}`]&&e!=="x-enumDescriptions")return r?.[e];if(e!=="x-enumDescriptions")return g(r,e);let n={};for(const o in t)o.startsWith("x-parsed-md")||(n[o]=t?.[`x-parsed-md-${o}`]||t?.[o]);return Object.keys(n).length?n:t};function g(r,e){const t=r?.[`x-parsed-md-${e}`]||r?.[e];return t?.raw?t:{result:t?.result||r?.[e]?.result||r?.[e],raw:r?.[e]}}function H(r,e){return e===r.length-1}function U(r,e){const t=Object.keys(r);return t.indexOf(e)===t.length-1}export{b as appendToMdHeading,R as deleteEmptyArrayItem,z as dottedString,M as escapeHTMLAttrChars,y as flattenByProp,j as get,F as getJsUrl,B as getValueFromMdParsedExtension,D as getWindowReferenceOptions,d as isAbsoluteUrl,E as isArrayOfObjects,H as isLastInArray,U as isLastProperty,W as isMergeableObject,A as isNumeric,x as joinStringFactory,O as mapValues,w as mapWithLast,_ as normalizeText,L as removeQueryStringAndHash,C as resolveUrl,P as sanitizeItemId,p as stripTrailingSlash,I as titleize,N as unescapeHTMLChars,T as useSchemaTitle};
12
+ ${e}`}}const R=r=>Array.isArray(r)&&r.some(t=>i(t)),W=r=>r.filter(t=>!!t),C=r=>i(r)&&!Array.isArray(r);function d(r){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(r)}function I(r,t){let e;if(t.startsWith("//"))e=`${u(r,!0)?.protocol||"https:"}${t}`;else if(d(t))e=t;else if(!t.startsWith("/"))e=p(r)+"/"+t;else{const n=u(r);n?(n.pathname=t,e=n.toString()):e=t}return p(e)}function L(r){return r.charAt(0).toUpperCase()+r.slice(1)}function M(r){try{if(!r)return"";const t=new URL(r);return t.search="",t.hash="",t.toString()}catch{return r}}function N(r){return r.replace(/["\\]/g,"\\$&")}function P(r){return r.replace(/&#(\d+);/g,(t,e)=>String.fromCharCode(parseInt(e,10))).replace(/&amp;/g,"&").replace(/&quot;/g,'"')}function T(r){return r&&r.replace(/#/g,"_").toLowerCase()}function j(r,t){return t||f(r)&&l.baseName(r)||""}function z(r={},t,e){return typeof t=="string"&&(t=t.split(".")),t.reduce((n,o)=>n&&n[o]?n[o]:e,r)}function x(r){return(...t)=>t.filter(Boolean).join(r)}const D=x(".");function F(r){return c?window?.REFERENCE_DOCS_OPTIONS?.[r]:null}function _(){if(!c)return"";const r=+new Date+Math.random();try{return(!document.currentScript||!(document.currentScript.async||document.currentScript.defer))&&document.write(`<script id="dummy${r}"></script>`),(document.getElementById("dummy"+r)?.previousSibling).src}catch{return""}}const B=r=>a(r)?r:r?.raw,H=(r,t)=>{const e=r?.[`x-parsed-md-${t}`]||r?.[t];if(!e)return;if(!r?.[`x-parsed-md-${t}`]&&t!=="x-enumDescriptions")return r?.[t];if(t!=="x-enumDescriptions")return g(r,t);let n={};for(const o in e)o.startsWith("x-parsed-md")||(n[o]=e?.[`x-parsed-md-${o}`]||e?.[o]);return Object.keys(n).length?n:e};function g(r,t){const e=r?.[`x-parsed-md-${t}`]||r?.[t];return e?.raw?e:{result:e?.result||r?.[t]?.result||r?.[t],raw:r?.[t]}}function U(r,t){return t===r.length-1}function V(r,t){const e=Object.keys(r);return e.indexOf(t)===e.length-1}export{E as appendToMdHeading,W as deleteEmptyArrayItem,D as dottedString,N as escapeHTMLAttrChars,A as flattenByProp,z as get,_ as getJsUrl,H as getValueFromMdParsedExtension,F as getWindowReferenceOptions,d as isAbsoluteUrl,R as isArrayOfObjects,U as isLastInArray,V as isLastProperty,C as isMergeableObject,b as isNumeric,x as joinStringFactory,y as mapValues,O as mapWithLast,B as normalizeText,M as removeQueryStringAndHash,I as resolveUrl,T as sanitizeItemId,p as stripTrailingSlash,L as titleize,P as unescapeHTMLChars,j as useSchemaTitle};