@redocly/openapi-docs 3.13.0-next.3 → 3.13.0-next.4
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.
- package/dist/redocly-openapi-docs.min.js +3407 -2388
- package/lib/components/Content/useAutoScroll.js +1 -1
- package/lib/components/Download/DownloadSpecification.d.ts +4 -1
- package/lib/components/Download/DownloadSpecification.js +4 -4
- package/lib/components/RedoclyOpenAPIDocs/Providers.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.d.ts +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.d.ts +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/types.d.ts +1 -0
- package/lib/components/RightPanel/RightPanel.js +1 -1
- package/lib/components/SideMenu/SideMenu.js +2 -2
- package/lib/components/SideMenu/hooks/useMenuItems.d.ts +2 -1
- package/lib/components/SideMenu/hooks/useMenuItems.js +1 -1
- package/lib/components/common/linkify.d.ts +0 -1
- package/lib/components/common/linkify.js +4 -4
- package/lib/components/common/panels.js +20 -20
- package/lib/constants.d.ts +1 -1
- package/lib/constants.js +1 -1
- package/lib/hoc/withRouter.js +1 -1
- package/lib/hooks/index.d.ts +1 -1
- package/lib/hooks/index.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/jotai/app.d.ts +1 -1
- package/lib/jotai/app.js +1 -1
- package/lib/services/config-options/normalizeOptions.js +1 -1
- package/lib/services/config-options/types.d.ts +0 -2
- package/lib/standalone.d.ts +3 -1
- package/lib/standalone.js +1 -1
- package/lib/utils/cookies.js +1 -1
- package/lib/utils/dom.d.ts +1 -0
- package/lib/utils/dom.js +1 -1
- package/lib/utils/helpers.js +4 -4
- package/lib/utils/loadAndBundleSpec.d.ts +656 -0
- package/lib/utils/loadAndBundleSpec.js +1 -1
- package/lib/utils/local-storage.js +1 -1
- package/lib/utils/openapi.js +1 -1
- package/lib/utils/session-storage.js +1 -1
- package/package.json +11 -8
- package/lib/components/Language/_tests_/LanguageDropdown.test.d.ts +0 -1
- package/lib/components/Language/_tests_/LanguageDropdown.test.js +0 -1
- package/lib/components/OperationItem/_tests_/OperationItem.test.d.ts +0 -1
- package/lib/components/OperationItem/_tests_/OperationItem.test.js +0 -1
- package/lib/components/OperationItem/_tests_/__mocks__/mock-intersection-observer.d.ts +0 -15
- 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
|
|
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
|
-
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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{
|
|
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{
|
|
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
|
|
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
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as
|
|
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
|
|
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{
|
|
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
|
|
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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as
|
|
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
|
-
${
|
|
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 ${
|
|
16
|
+
:hover ${n}, :focus ${n} {
|
|
17
17
|
visibility: visible;
|
|
18
18
|
opacity: 1;
|
|
19
19
|
}
|
|
20
|
-
`;function
|
|
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
|
|
2
|
-
${({compact:a,isStacked:
|
|
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: ${
|
|
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: ${
|
|
13
|
-
width: ${e||
|
|
14
|
-
padding-left:
|
|
15
|
-
padding-right: ${
|
|
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: ${
|
|
17
|
+
padding-bottom: ${n?"var(--spacing-vertical)":0};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
@media print {
|
|
21
21
|
width: 100%;
|
|
22
|
-
padding-top: ${
|
|
23
|
-
padding-bottom: ${
|
|
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=
|
|
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: ${
|
|
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
|
-
${
|
|
77
|
+
${p} {
|
|
78
78
|
position: relative;
|
|
79
79
|
}
|
|
80
|
-
`,x=
|
|
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: ${
|
|
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-
|
|
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=
|
|
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: ${
|
|
118
|
-
flex-direction: ${({layout:a})=>a!==
|
|
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 {
|
package/lib/constants.d.ts
CHANGED
|
@@ -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.
|
|
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};
|
package/lib/hoc/withRouter.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as s}from"react/jsx-runtime";import{createElement as c}from"react";import{
|
|
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};
|
package/lib/hooks/index.d.ts
CHANGED
|
@@ -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';
|
package/lib/hooks/index.js
CHANGED
|
@@ -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{
|
|
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
|
|
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};
|
package/lib/jotai/app.d.ts
CHANGED
|
@@ -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 {
|
|
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{
|
|
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
|
|
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;
|
package/lib/standalone.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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};
|
package/lib/utils/cookies.js
CHANGED
|
@@ -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]:
|
|
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};
|
package/lib/utils/dom.d.ts
CHANGED
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,
|
|
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};
|
package/lib/utils/helpers.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{isObject as i,isString as a
|
|
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
|
-
${
|
|
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}# ${
|
|
10
|
+
`;return`${r}${s}# ${t}
|
|
11
11
|
|
|
12
|
-
${
|
|
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(/&/g,"&").replace(/"/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};
|