@redocly/openapi-docs 3.21.0-next.1 → 3.21.0-next.2
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as s,Fragment as C}from"react/jsx-runtime";import{memo as S,useMemo as L}from"react";import{useAtomValue as N}from"jotai";import{LinkIcon as j}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{RecursiveLabel as x,Tag as g,AccessLabel as q,RequiredLabel as A,StyledBadge as M,CustomBadges as R,renderBadge as y}from"../common/index.js";import{ExternalDocumentation as V}from"../ExternalDocumentation/index.js";import{Markdown as $}from"../Markdown/index.js";import{FieldDetail as m}from"./FieldDetail.js";import{Extensions as _}from"./Extensions.js";import{EnumValues as I}from"./EnumValues.js";import{Examples as O,getSerializedValue as G}from"./Examples.js";import{globalOptionsAtom as H}from"../../jotai/store.js";import{SchemaTypeInfo as n}from"./SchemaTypeInfo.js";import{LinkToField as J}from"../common/LinkToField.js";import{Pattern as K}from"./Pattern.js";import{getAccessModeLabelText as Q}from"../RenderHook/index.js";import{useTranslate as U}from"../../hooks/index.js";import{styled as i}from"../../styled-components.js";import{splitBadgesByPosition as W}from"../../utils/index.js";function X({field:
|
|
1
|
+
import{jsx as e,jsxs as s,Fragment as C}from"react/jsx-runtime";import{memo as S,useMemo as L}from"react";import{useAtomValue as N}from"jotai";import{LinkIcon as j}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{RecursiveLabel as x,Tag as g,AccessLabel as q,RequiredLabel as A,StyledBadge as M,CustomBadges as R,renderBadge as y}from"../common/index.js";import{ExternalDocumentation as V}from"../ExternalDocumentation/index.js";import{Markdown as $}from"../Markdown/index.js";import{FieldDetail as m}from"./FieldDetail.js";import{Extensions as _}from"./Extensions.js";import{EnumValues as I}from"./EnumValues.js";import{Examples as O,getSerializedValue as G}from"./Examples.js";import{globalOptionsAtom as H}from"../../jotai/store.js";import{SchemaTypeInfo as n}from"./SchemaTypeInfo.js";import{LinkToField as J}from"../common/LinkToField.js";import{Pattern as K}from"./Pattern.js";import{getAccessModeLabelText as Q}from"../RenderHook/index.js";import{useTranslate as U}from"../../hooks/index.js";import{styled as i}from"../../styled-components.js";import{splitBadgesByPosition as W}from"../../utils/index.js";function X({field:r,renderDiscriminatorSwitch:v,deepLink:c,fieldParentsName:b=[]}){const t=U(),{hidePropertiesPrefix:w,hideSchemaTitles:D}=N(H),{schema:a,description:P,example:d,deprecated:B,examples:p,kind:f,required:F,name:l,badges:k}=r,z=r.in==="header",E=L(()=>{if(d!==void 0||p!==void 0){if(p!==void 0)return e(O,{field:r});{const o=!!r.in;return e(m,{label:`${t("openapi.example","Example")}:`,value:G(r,r.example),raw:o})}}else return null},[d,p,r,t]),h=Q(r.schema),{before:u,after:T}=W(k);return s(C,{children:[s(Y,{children:[l&&s(ee,{children:[c&&e(J,{to:c}),e(ae,{children:e(R,{badges:u,children:s(re,{children:[!w&&b.map(o=>o+".\u200B"),e(te,{className:"schema-name",children:l})]})})})]}),!l&&u.map(y),e(n,{type:a.typePrefix+a.displayType}),e(n,{type:a.displayFormat&&`(${a.displayFormat})`}),e(n,{type:a.contentEncoding}),e(n,{type:a.title&&!D?`(${a.title})`:""}),a.constraints?.map(o=>e(n,{type:o},o)),B&&e(M,{deprecated:!0,children:t("openapi.badges.deprecated","Deprecated")}),e(K,{pattern:a.pattern}),f==="additionalProperties"&&e(g,{children:t("openapi.additionalProperties","additional property")}),f==="patternProperties"&&e(g,{children:t("openapi.patternProperties","pattern property")}),h&&e(q,{children:h}),F&&e(A,{children:t("openapi.required","required")}),a.isCircular&&e(x,{children:t("openapi.recursive","Recursive")}),T.map(y)]}),a.isComplex&&e(x,{children:t("openapi.complex","Complex")}),e(Z,{source:P}),e(m,{raw:z,type:"default",label:t("openapi.default","Default"),value:a.default}),e(I,{type:a.type,values:a["x-enumDescriptions"]||a.enum}),E,e(_,{extensions:{...r.extensions,...a.extensions}}),a.externalDocs&&e(V,{externalDocs:a.externalDocs,compact:!0}),v?.(),e(m,{label:t("openapi.value","Value"),value:r.const||void 0})]})}const Pe=S(X),Y=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
gap: calc(var(--spacing-xxs) / 4) var(--spacing-xxs);
|
|
@@ -23,6 +23,10 @@ import{jsx as e,jsxs as s,Fragment as C}from"react/jsx-runtime";import{memo as S
|
|
|
23
23
|
overflow-wrap: break-word;
|
|
24
24
|
white-space: pre-wrap;
|
|
25
25
|
|
|
26
|
+
> a {
|
|
27
|
+
padding-right: var(--schema-nested-hyperlink-offset);
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
:hover {
|
|
27
31
|
${j} {
|
|
28
32
|
opacity: 1;
|
|
@@ -30,18 +34,18 @@ import{jsx as e,jsxs as s,Fragment as C}from"react/jsx-runtime";import{memo as S
|
|
|
30
34
|
background-color: var(--bg-color);
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
|
-
`,
|
|
37
|
+
`,ae=i.span`
|
|
34
38
|
display: inline-flex;
|
|
35
39
|
align-items: center;
|
|
36
40
|
gap: var(--spacing-xxs);
|
|
37
41
|
flex-wrap: wrap;
|
|
38
42
|
max-width: 100%;
|
|
39
|
-
`,
|
|
43
|
+
`,re=i.span`
|
|
40
44
|
display: inline;
|
|
41
45
|
`,te=i.span`
|
|
42
46
|
font-family: var(--font-family-monospaced);
|
|
43
47
|
font-weight: var(--font-weight-semibold);
|
|
44
48
|
font-size: var(--schemas-property-name-font-size);
|
|
45
49
|
line-height: var(--schemas-property-name-line-height);
|
|
46
|
-
color: var(--text-color-
|
|
50
|
+
color: var(--color-primary-text, var(--schema-name-color-legacy));
|
|
47
51
|
`;export{Pe as FieldDetails};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,Fragment as B,jsxs as M}from"react/jsx-runtime";import{lazy as z,memo as H,Suspense as J,useCallback as m,useRef as K,useState as W}from"react";import{useAtom as d,useAtomValue as p}from"jotai";import Q from"deepmerge";const X=z(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/use-configure-replay";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 de,useTelemetry as ue}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";import{HTTPSnippet as ge}from"../../services/code-samples/httpsnippet/index.js";function ve({operation:e,corsProxyUrl:
|
|
1
|
+
import{jsx as o,Fragment as B,jsxs as M}from"react/jsx-runtime";import{lazy as z,memo as H,Suspense as J,useCallback as m,useRef as K,useState as W}from"react";import{useAtom as d,useAtomValue as p}from"jotai";import Q from"deepmerge";const X=z(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/use-configure-replay";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 de,useTelemetry as ue}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";import{HTTPSnippet as ge}from"../../services/code-samples/httpsnippet/index.js";function ve({operation:e,corsProxyUrl:V,fullOpenApi:u}){const y=de(),q=ue(),h=K(null),O=p(ne),{oAuth2RedirectURI:E,routingBasePath:c}=O,I=p(se),{parser:R,options:{events:a}}=p(ae),g=p(ce),[s,N]=W(!1),[l,v]=d(ie),[A,S]=d(le),[[,j],T]=d(pe),{config:D,refresh:b}=re({userClaims:g,info:R?.definition.info,operation:{name:e.name,path:e.path,operationId:e.operationId||"",href:e.href,method:e.httpVerb},servers:e.servers},s);Z(h),$(s);const x=m(()=>b(),[b]),_=m(({operations:t,environment:i,environments:f})=>{const k=t.reduce((L,r)=>{r.requestValues.body=r.requestValues.body instanceof URLSearchParams?Object.fromEntries(r.requestValues.body.entries()):r.requestValues.body;const{path:w,method:F}=r.apiPath,P=ye.compile(["paths",w,F]);return L[P]=Q(me(P),r),L},{});S({...A,...k}),T({environment:i,environments:f})},[A,S,T]),C=()=>{if(l!==n.LOADING){if(!s&&(q.sendTryItOpenedMessage([{id:"try-it-opened",object:"try_it",uri:typeof window<"u"?window.location.href:""}]),a?.tryItOpen&&e)){const t=Oe({operation:e});a.tryItOpen(t)}N(!s)}l===n.NOT_LOADED&&v(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=I.find(f=>f.operationId===t);return Re(c,i?.href)},[I,c]);return u?M(B,{children:[o(Y,{onClick:C,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(J,{children:o(oe,{mountId:"api-content",children:o("div",{ref:h,children:o(X,{activeOperationId:e.operationId||e.pointer,api:u,onRequestChange:_,onClose:C,onLoad:()=>v(n.LOADED),settings:{corsProxyUrl:V,selectedEnvironment:j,apiId:R?.definition.info?.["x-metadata"]?.apiId,oAuth2RedirectURI:E,disableCollectionsTab:!0,storageKey:c,telemetry:{tracerName:"try-it",collectorUrl:he()},HTTPSnippet:ge,convertOperationToReplayValue:fe(g,D,O),dynamicReplayValues:D,getOperationUrl:U,onRequestReset:x},onRequestSent:G})})})})]}):null}const ze=H(ve);export{ze as Replay};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Fragment as d}from"react";import{SecurityIcon as f}from"@redocly/theme/icons/SecurityIcon/SecurityIcon";import{Panel as u}from"@redocly/theme/components/Panel/Panel";import{Button as b}from"@redocly/theme/components/Button/Button";import{Tooltip as y}from"@redocly/theme/components/Tooltip/Tooltip";import{WarningFilledIcon as x}from"@redocly/theme/icons/WarningFilledIcon/WarningFilledIcon";import{useTranslate as w}from"../../hooks/index.js";import{styled as r}from"../../styled-components.js";import{deprecatedCss as S}from"../common/index.js";import{RequiredScopes as j}from"./RequiredScopes.js";function W({securities:a,onClick:m}){const i=w();return e(T,{header:()=>o(B,{children:[e(f,{}),e(D,{children:i("openapi.security","Security")}),e(C,{onClick:m,variant:"link",children:i("openapi.viewSecurityDetails","View details")})]}),isExpandable:!1,children:e(H,{children:a.map((t,n)=>{const s=a.length>1&&t.schemes.length>1,h=t.schemes.map(({id:c,scopes:g,deprecated:l=!1},v)=>o(d,{children:[o(k,{deprecated:l,children:[c,l&&e(y,{tip:i("openapi.badges.deprecated","Deprecated"),children:e(x,{color:"var(--badge-deprecated-bg-color)"})})]}),e(j,{scopes:g}),v<t.schemes.length-1&&e(p,{children:" and "})]},c));return o(d,{children:[s?"(":"",h,s?")":"",n<a.length-1&&e(p,{children:" or "})]},n)})})})}const k=r.span`
|
|
2
2
|
${({deprecated:a})=>a&&S}
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
align-items: center;
|
|
@@ -13,7 +13,7 @@ import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Fragment as d}from"reac
|
|
|
13
13
|
align-items: center;
|
|
14
14
|
justify-content: space-between;
|
|
15
15
|
gap: var(--spacing-xs);
|
|
16
|
-
color: var(--
|
|
16
|
+
color: var(--color-primary-base, var(--security-header-color-legacy));
|
|
17
17
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
18
18
|
background-color: var(--layer-color);
|
|
19
19
|
border-bottom: var(--panel-border);
|
|
@@ -22,4 +22,4 @@ import{jsx as a,jsxs as c}from"react/jsx-runtime";import{useAtomValue as m}from"
|
|
|
22
22
|
top: 0;
|
|
23
23
|
transform: translate(-100%);
|
|
24
24
|
}
|
|
25
|
-
`;function N(i){return a(b,{...i,children:a(o,{
|
|
25
|
+
`;function N(i){return a(b,{...i,children:a(o,{color:"--heading-anchor-color",size:"20px"})})}export{u as Link,N as ShareLink,b as StyledShareLink};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.21.0-next.
|
|
3
|
+
"version": "3.21.0-next.2",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@markdoc/markdoc": "0.5.2",
|
|
24
|
-
"@redocly/openapi-core": "2.
|
|
24
|
+
"@redocly/openapi-core": "2.30.2",
|
|
25
25
|
"deepmerge": "^4.2.2",
|
|
26
26
|
"dompurify": "3.4.0",
|
|
27
27
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"util": "~0.12.5",
|
|
40
40
|
"web-vitals": "3.3.1",
|
|
41
41
|
"@redocly/config": "0.48.1",
|
|
42
|
-
"@redocly/redoc-opentelemetry": "0.0
|
|
43
|
-
"@redocly/replay": "0.24.0-next.
|
|
42
|
+
"@redocly/redoc-opentelemetry": "0.1.0",
|
|
43
|
+
"@redocly/replay": "0.24.0-next.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@shikijs/transformers": "3.21.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"url": "~0.11.0",
|
|
73
73
|
"vite": "7.2.6",
|
|
74
74
|
"vitest": "4.0.10",
|
|
75
|
-
"@redocly/theme": "0.65.0-next.
|
|
75
|
+
"@redocly/theme": "0.65.0-next.2"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"start": "pnpm run copy-highlight-hook && vite",
|