@redocly/openapi-docs 3.14.0-next.2 → 3.14.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 +1478 -1478
- package/lib/components/Replay/Replay.js +1 -1
- package/lib/components/TagItem/TagItem.js +6 -6
- package/lib/components/common/linkify.js +4 -4
- package/lib/constants.d.ts +4 -0
- package/lib/constants.js +1 -1
- package/lib/services/history/helpers.js +1 -1
- package/lib/utils/path.js +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,Fragment as M,jsxs as z}from"react/jsx-runtime";import{lazy as J,memo as K,Suspense as
|
|
1
|
+
import{jsx as o,Fragment as M,jsxs as z}from"react/jsx-runtime";import{lazy as J,memo as K,Suspense as W,useCallback as m,useRef as w,useState as H}from"react";import{useAtom as u,useAtomValue as p}from"jotai";import Q from"deepmerge";const X=J(async()=>import("@redocly/replay").then(e=>({default:e.ReplayOverlay})));import{Button as Y}from"@redocly/theme/components/Button/Button";import{useFocusTrap as Z,useModalScrollLock as $}from"@redocly/theme/core/openapi";import{RocketIcon as ee}from"@redocly/theme/icons/RocketIcon/RocketIcon";import{CircleDashIcon as te}from"@redocly/theme/icons/CircleDashIcon/CircleDashIcon";import{Portal as oe}from"@redocly/theme/components/Portal/Portal";import{useConfigureReplay as re}from"@redocly/theme/ext/useConfigureReplay";import{globalOptionsAtom as ne,globalStoreAtom as ae}from"../../jotai/store.js";import{allOperationsAtom as se,replayStateAtom as ie}from"../../jotai/replay.js";import{allOperations as le,getDefaultOperationStore as me}from"../../jotai/operation.js";import{LOADING_STATE as n}from"../../constants.js";import{environmentAtom as pe,userClaimsAtom as ce}from"../../jotai/app.js";import{convertOperationToReplayValueForRedoc as fe}from"./utils.js";import{useTranslate as ue,useTelemetry as de}from"../../hooks/index.js";import{JsonPointer as ye}from"../../utils/index.js";import{getDefaultCollectorUrl as he}from"../../utils/telemetry.js";import{createTryItOpenEvent as Oe,createTryItSentEvent as Ie}from"../../events/index.js";import{joinWithSeparator as Re}from"../../services/history/helpers.js";function ge({operation:e,corsProxyUrl:b,fullOpenApi:d}){const y=ue(),L=de(),h=w(null),{mockServer:P,oAuth2RedirectURI:q,routingBasePath:c}=p(ne),O=p(se),{parser:E,options:{events:a}}=p(ae),I=p(ce),[s,N]=H(!1),[l,R]=u(ie),[g,v]=u(le),[[,V],A]=u(pe),{config:j,refresh:S}=re({userClaims:I,operation:{name:e.name,path:e.path,operationId:e.operationId||"",href:e.href,method:e.httpVerb},servers:e.servers},s);Z(h),$(s);const x=m(()=>S(),[S]),k=m(({operations:t,environment:i,environments:f})=>{const _=t.reduce((D,r)=>{r.requestValues.body=r.requestValues.body instanceof URLSearchParams?Object.fromEntries(r.requestValues.body.entries()):r.requestValues.body;const{path:F,method:B}=r.apiPath,C=ye.compile(["paths",F,B]);return D[C]=Q(me(C),r),D},{});v({...g,..._}),A({environment:i,environments:f})},[g,v,A]),T=()=>{if(l!==n.LOADING){if(!s&&(L.sendOpenapiDocsTryItOpenedMessage(),a?.tryItOpen&&e)){const t=Oe({operation:e});a.tryItOpen(t)}N(!s)}l===n.NOT_LOADED&&R(n.LOADING)},G=m(t=>{if(a?.tryItSent&&e){const i=Ie({operation:e,isSuccess:t});a.tryItSent(i)}},[a,e]),U=m(t=>{if(!t)return;const i=O.find(f=>f.operationId===t);return Re(c,i?.href)},[O,c]);return d?z(M,{children:[o(Y,{onClick:T,variant:"primary",iconPosition:"left",icon:l===n.LOADING?o(te,{}):o(ee,{}),children:l===n.LOADING?y("openapi.loading","Loading..."):y("openapi.tryIt","Try it")}),s&&o(W,{children:o(oe,{mountId:"api-content",children:o("div",{ref:h,children:o(X,{activeOperationId:e.operationId||e.pointer,api:d,onRequestChange:k,onClose:T,onLoad:()=>R(n.LOADED),settings:{corsProxyUrl:b,mockServer:P,selectedEnvironment:V,apiId:E?.definition.info?.["x-metadata"]?.apiId,oAuth2RedirectURI:q,disableCollectionsTab:!0,storageKey:c,telemetry:{tracerName:"try-it",collectorUrl:he()},convertOperationToReplayValue:fe(I,j),getOperationUrl:U,onRequestReset:x},onRequestSent:G})})})})]}):null}const Me=K(ge);export{Me as Replay};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{jsx as a,jsxs as o}from"react/jsx-runtime";import{memo as h,useCallback as v}from"react";import{useNavigate as x}from"react-router-dom";import{useAtomValue as b}from"jotai";import{LayoutVariant as k}from"@redocly/config";import{breakpoints as
|
|
1
|
+
import{jsx as a,jsxs as o}from"react/jsx-runtime";import{memo as h,useCallback as v}from"react";import{useNavigate as x}from"react-router-dom";import{useAtomValue as b}from"jotai";import{LayoutVariant as k}from"@redocly/config";import{breakpoints as S}from"@redocly/theme/core/openapi";import{Button as y}from"@redocly/theme/components/Button/Button";import{PageActions as w}from"@redocly/theme/components/PageActions/PageActions";import{H2 as j}from"@redocly/theme/components/Typography/H2";import{LinkIcon as C}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{joinWithSeparator as A}from"../../services/history/helpers.js";import{Row as I,SamplesMiddlePanel as T,ShareLink as $}from"../common/index.js";import{Markdown as B}from"../Markdown/index.js";import{OperationsNavigation as L}from"./OperationsNavigation.js";import{layoutAtom as W}from"../../jotai/app.js";import{useTranslate as H}from"../../hooks/index.js";import{styled as n}from"../../styled-components.js";function M({item:t,routingBasePath:m="",isExpanded:e}){const l=H(),{description:d,name:s,href:g}=t,p=x(),c=b(W),i=A(m,t.href),u=v(()=>{p(i)},[p,i]),r=!!t.items.length,f=c===k.STACKED;return o(N,{expanded:e,children:[o(I,{layout:c,children:[o(T,{fullWidth:!r,isStacked:f,children:[o(V,{children:[a($,{to:g,"aria-label":`link to ${s}`}),s,a(w,{pageSlug:i})]}),a(B,{source:d})]}),r&&a(L,{items:t.items,routingBasePath:m})]}),r&&!e&&o(P,{type:"button",variant:"text",size:"medium",onClick:u,children:["+ ",l("openapi.actions.show","Show")]})]})}const ot=h(M),N=n.div`
|
|
2
2
|
padding-top: var(--spacing-lg);
|
|
3
3
|
padding-bottom: ${({expanded:t})=>t?"var(--spacing-xxl)":""};
|
|
4
|
-
`,P=n(
|
|
4
|
+
`,P=n(y)`
|
|
5
5
|
margin: var(--spacing-md) var(--spacing-xl) var(--spacing-xxs);
|
|
6
6
|
width: calc(100% - var(--spacing-xl) * 2);
|
|
7
7
|
|
|
8
|
-
@media screen and (min-width: ${
|
|
8
|
+
@media screen and (min-width: ${S.medium}) {
|
|
9
9
|
--button-margin-md: calc(var(--spacing-xl) * 2);
|
|
10
10
|
|
|
11
11
|
margin-left: var(--button-margin-md);
|
|
12
12
|
margin-right: var(--button-margin-md);
|
|
13
13
|
width: calc(100% - var(--button-margin-md) * 2);
|
|
14
14
|
}
|
|
15
|
-
`,V=n(
|
|
15
|
+
`,V=n(j)`
|
|
16
16
|
display: flex;
|
|
17
17
|
:hover {
|
|
18
|
-
${
|
|
18
|
+
${C} {
|
|
19
19
|
opacity: 1;
|
|
20
20
|
visibility: visible;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
`;export{
|
|
23
|
+
`;export{ot as TagItem,M as TagItemComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n,jsxs as c}from"react/jsx-runtime";import{useAtomValue as m}from"jotai";import{Link as h}from"react-router-dom";import{LinkIcon as o}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{globalOptionsAtom as d}from"../../jotai/store.js";import{tryDecodeURIComponent as f}from"../../utils/index.js";import{styled as k}from"../../styled-components.js";import{joinWithSeparator as r}from"../../services/history/helpers.js";function u(i){const{routingBasePath:a,onDeepLinkClick:e}=m(d),t=i.to,l=e&&{onClick:s=>{s.preventDefault(),e(r(a||"",t))}};return t?n(h,{"aria-label":i["aria-label"]||`link to ${t}`,id:f(i.id||""),className:i.className||"",to:t?.startsWith("#")?t:r(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 b=k(u)`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 50%;
|
|
4
4
|
left: 0;
|
|
@@ -6,15 +6,15 @@ import{jsx as a,jsxs as s}from"react/jsx-runtime";import{useAtomValue as c}from"
|
|
|
6
6
|
padding-right: var(--heading-anchor-offset-right);
|
|
7
7
|
z-index: 1;
|
|
8
8
|
|
|
9
|
-
${
|
|
9
|
+
${o} {
|
|
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 ${o}, :focus ${o} {
|
|
17
17
|
visibility: visible;
|
|
18
18
|
opacity: 1;
|
|
19
19
|
}
|
|
20
|
-
`;function
|
|
20
|
+
`;function N(i){return n(b,{...i,children:n(o,{size:"13px",color:"--heading-anchor-color"})})}export{u as Link,N as ShareLink,b as StyledShareLink};
|
package/lib/constants.d.ts
CHANGED
|
@@ -23,3 +23,7 @@ export declare const LOADING_STATE: {
|
|
|
23
23
|
LOADED: string;
|
|
24
24
|
};
|
|
25
25
|
export declare const REDOCLY_CONFIG_FILE = "redocly.yaml";
|
|
26
|
+
export declare const DISABLE_DEEP_LINK_IF_FIELDS_EXIST: string[];
|
|
27
|
+
export declare const SEARCH_LIMIT = 100;
|
|
28
|
+
export declare const HIGHLIGHTED_TEXT_MAX_LENGTH = 150;
|
|
29
|
+
export declare const SEARCH_INDEX_FIELDS: string[];
|
package/lib/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var o;(function(t){t.ON_DEEP_LINK_CLICK="onDeepLinkClick",t.HOOKS="hooks"})(o||(o={}));var E;(function(t){t.OCTET_STREAM="application/octet-stream",t.MULTIPART="multipart/form-data",t.URL_ENCODED="application/x-www-form-urlencoded",t.JSON="application/json",t.XML="application/xml"})(E||(E={}));const p="data-section-id",r="data-field-id",_=0,e="^ {0,3}<!-- ReDoc-Inject:\\s+?<({component}).*?/?>\\s+?-->\\s*$",n="(?:^ {0,3}<({component})([\\s\\S]*?)>([\\s\\S]*?)</\\2>|^ {0,3}<({component})([\\s\\S]*?)(?:/>|\\n{2,}))",c="(?:"+e+"|"+n+")",a="other",D="webhooks",s={NOT_LOADED:"NOT_LOADED",LOADING:"LOADING",LOADED:"LOADED"},L="redocly.yaml",O=["title"],T=100,A=150,I=["text","title","path","httpPath","parameters[]:name","parameters[]:description","parameters[]:place","parameters[]:path"];export{c as COMPONENT_REGEXP,a as DEFAULT_TAG_SLUG,D as DEFAULT_WEBHOOKS_TAG_NAME,O as DISABLE_DEEP_LINK_IF_FIELDS_EXIST,r as FIELD_ATTR,_ as GROUP_DEPTH,A as HIGHLIGHTED_TEXT_MAX_LENGTH,e as LEGACY_REGEXP,s as LOADING_STATE,n as MDX_COMPONENT_REGEXP,E as MediaTypes,L as REDOCLY_CONFIG_FILE,I as SEARCH_INDEX_FIELDS,T as SEARCH_LIMIT,p as SECTION_ATTR,o as WindowReferenceOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{encodeBackSlashes as o,queryString as s}from"../../utils/index.js";import{getActiveMediaType as r}from"../../models/mediaContent.js";function d(e,n){return e===n||"#"+e===n||e==="#"+n}function p(e,n){if(!e.in){if(e.deps.type==="request"&&e.deps.operation?.requestBody?.content?.mediaTypes)return e.deps.operation?.requestBody?.content?.mediaTypes.length>1?e.deps.operation?.requestBody?.content&&r(e.deps.operation.requestBody.content,n).name:void 0;if(e.deps.type==="response"&&e.deps.response?.content?.mediaTypes)return e.deps.response?.content?.mediaTypes.length>1?e.deps.response?.content&&r(e.deps.response.content,n).name:void 0}}function
|
|
1
|
+
import{encodeBackSlashes as o,queryString as s}from"../../utils/index.js";import{getActiveMediaType as r}from"../../models/mediaContent.js";function d(e,n){return e===n||"#"+e===n||e==="#"+n}function p(e,n){if(!e.in){if(e.deps.type==="request"&&e.deps.operation?.requestBody?.content?.mediaTypes)return e.deps.operation?.requestBody?.content?.mediaTypes.length>1?e.deps.operation?.requestBody?.content&&r(e.deps.operation.requestBody.content,n).name:void 0;if(e.deps.type==="response"&&e.deps.response?.content?.mediaTypes)return e.deps.response?.content?.mediaTypes.length>1?e.deps.response?.content&&r(e.deps.response.content,n).name:void 0}}function y(e,n){if(!e)return"";const t={t:e.deps.type,in:e.in||e.deps.in,c:e.deps.type==="response"?e.deps.response?.code:void 0,cb:e.deps.operation?.isCallback?e.deps.operation.callbackId:void 0,ct:p(e,n),path:e.fieldFullPath};return s.stringify(t,{encode:!1,sort:!1})}function c(e="",n="",t="/"){return e.endsWith(t)&&e!==t&&(e=e.slice(0,-t.length)),n.startsWith(t)&&(n=n.slice(t.length)),!e||!n||e===t?e+n:e+t+n}function a(e,n){return e=o(e),(`/${e}#`+c(e,n)).toLowerCase()}export{y as constructFieldDeepFragment,d as isSameHash,c as joinWithSeparator,a as makeDeepLink};
|
package/lib/utils/path.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{tryDecodeURIComponent as n}from"./string.js";function o(e,r){return r?n(e.pathname+e.hash).includes(n(r.toLowerCase())):!1}function
|
|
1
|
+
import{tryDecodeURIComponent as n}from"./string.js";function o(e,r){return r?n(e.pathname+e.hash).includes(n(r.toLowerCase())):!1}function h(e,r=""){const t=n(r.toLowerCase());return n(e.pathname)===t||n(e.hash)===t||n(e.pathname+e.hash)===t}function i(e){return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e.startsWith("/")||(e="/"+e),e}export{i as normalizePath,o as pathIncludesLink,h as pathMatchedLink};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.14.0-next.
|
|
3
|
+
"version": "3.14.0-next.4",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"url-template": "^2.0.8",
|
|
37
37
|
"util": "~0.12.5",
|
|
38
38
|
"web-vitals": "3.3.1",
|
|
39
|
-
"@redocly/config": "0.
|
|
40
|
-
"@redocly/replay": "0.17.0-next.
|
|
39
|
+
"@redocly/config": "0.31.0",
|
|
40
|
+
"@redocly/replay": "0.17.0-next.4"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@jest/globals": "29.5.0",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"typescript": "5.6.2",
|
|
76
76
|
"url": "~0.11.0",
|
|
77
77
|
"vite": "^6.3.5",
|
|
78
|
-
"@redocly/theme": "0.58.0-next.
|
|
78
|
+
"@redocly/theme": "0.58.0-next.3"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"start": "npm run copy-highlight-hook && vite",
|