@redocly/openapi-docs 3.17.0-next.3 → 3.17.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.
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import{jsx as o,jsxs as S}from"react/jsx-runtime";import{memo as C,useCallback as
|
|
1
|
+
import{jsx as o,jsxs as S}from"react/jsx-runtime";import{memo as C,useCallback as M,useMemo as k}from"react";import{LayoutVariant as A}from"@redocly/config";import{useAtom as j,useAtomValue as x}from"jotai";import{useWriteAtom as T}from"../../jotai/use-write-atom.js";import{SamplesMiddlePanel as D,SamplesPanel as E,Row as N,Section as b,CodeBlockPanel as P}from"../common/index.js";import{getMediaType as w}from"../../models/index.js";import{MediaTypeSamples as I}from"../PayloadSamples/index.js";import{Schema as L}from"../Schema/index.js";import{Markdown as V}from"../Markdown/index.js";import{layoutAtom as W}from"../../jotai/app.js";import{globalStoreAtom as _}from"../../jotai/store.js";import{operationStore as O}from"../../jotai/operation.js";import{styled as $}from"../../styled-components.js";import{SchemaCatalogLink as B}from"../SchemaCatalogLink/SchemaCatalogLink.js";const K=(t,i)=>{if(!t)return{};const n={schema:{$ref:t}};return i&&(n.examples={example:{$ref:i}}),n};function q({schemaRef:t,exampleRef:i,showReadOnly:n=!0,showWriteOnly:v=!1}){const s=x(W),{parser:c,options:p}=x(_),l=T(),e=k(()=>w(c,"json",!1,K(t,i),p,{operation:{pointer:"SchemaDefinitionComponent"}}),[i,p,c,t]),[f,d]=j(O(e.operation?.pointer)),y=M(r=>{if(!e.schema)return;const a=e.schema,u=a.oneOf;if(u&&e?.examples&&Object.keys(e?.examples).includes(r)){const m=u.findIndex(g=>g.title===r);m!==-1&&a&&l(O(a.operationPointer),{activeExampleName:a.oneOf?.[m]?.title,activeOneOf:{[a.pointer]:m}})}f.activeExampleName!==r&&d({activeExampleName:r})},[e?.examples,e.schema,f.activeExampleName,d,l]),h=s===A.STACKED;return o(b,{children:S(N,{layout:s,children:[S(D,{isStacked:h,children:[t&&o(B,{schemaRef:t}),e.schema?.description&&o(z,{children:o(V,{source:e.schema?.description})}),o(L,{skipWriteOnly:!v,skipReadOnly:!n,schema:e.schema,level:1})]}),o(E,{isStacked:h,children:o(P,{className:"panel-response-samples",children:o(I,{mediaType:e,onChange:y})})})]})})}const ne=C(q),z=$.div`
|
|
2
2
|
margin-bottom: var(--spacing-vertical);
|
|
3
|
-
|
|
4
|
-
padding-left: 0;
|
|
5
|
-
`;export{re as SchemaDefinition};
|
|
3
|
+
`;export{ne as SchemaDefinition};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,Fragment as l,jsxs as p}from"react/jsx-runtime";import{memo as d}from"react";import{LayoutVariant as
|
|
1
|
+
import{jsx as t,Fragment as l,jsxs as p}from"react/jsx-runtime";import{memo as d}from"react";import{LayoutVariant as u}from"@redocly/config";import{SamplesMiddlePanel as a,Row as f}from"../common/index.js";import{Markdown as h}from"../Markdown/index.js";import{ExternalDocumentation as x}from"../ExternalDocumentation/index.js";function S({item:o,layout:s}){const{externalDocs:r,ast:c,description:i}=o,e=s===u.STACKED,n=!o.parent||o.parent.type!=="tag";return p(l,{children:[t(h,{ast:c,source:i,htmlWrap:m=>t(a,{compact:!0,fullWidth:n,isStacked:e,children:m})}),r&&t(f,{children:t(a,{compact:!0,fullWidth:n,isStacked:e,children:t(x,{externalDocs:r})})})]})}const _=d(S);export{_ as SectionItem};
|
|
@@ -1,33 +1,59 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r,jsxs as t}from"react/jsx-runtime";import{memo as w,useCallback as $}from"react";import{useNavigate as y}from"react-router-dom";import{useAtomValue as z}from"jotai";import{LayoutVariant as j}from"@redocly/config";import{css as M}from"styled-components";import{Markdown as p}from"@redocly/theme/components/Markdown/Markdown";import{breakpoints as T}from"@redocly/theme/core/openapi";import{Button as C}from"@redocly/theme/components/Button/Button";import{PageActions as I}from"@redocly/theme/components/PageActions/PageActions";import{H2 as A}from"@redocly/theme/components/Typography/H2";import{LinkIcon as L}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{joinWithSeparator as P}from"../../services/history/helpers.js";import{Row as W,SamplesMiddlePanel as m,SamplesPanel as f,ShareLink as B}from"../common/index.js";import{Markdown as D}from"../Markdown/index.js";import{OperationsNavigation as H}from"./OperationsNavigation.js";import{layoutAtom as N}from"../../jotai/app.js";import{useTranslate as V}from"../../hooks/index.js";import{styled as l}from"../../styled-components.js";import{StyledShareLink as _}from"../common/linkify.js";function E({item:a,routingBasePath:i="",isExpanded:d}){const v=V(),{description:o,name:s,href:S}=a,c=y(),g=z(N),e=P(i,a.href),x=$(()=>{c(e)},[c,e]),n=!!a.items.length,k=typeof o=="object"?o?.raw:o,h=g===j.STACKED,b=k?.includes?.("{% schemaDefinition");return t(K,{expanded:d,isSchema:b,isStacked:h,children:[t(W,{layout:g,children:[t(m,{fullWidth:!n,isStacked:h,children:[t(u,{expandable:n,children:[r(B,{to:S,"aria-label":`link to ${s}`}),s,r(I,{pageSlug:e})]}),r(D,{source:o})]}),n&&r(H,{items:a.items,routingBasePath:i})]}),n&&!d&&t(O,{type:"button",variant:"text",size:"medium",onClick:x,children:["+ ",v("openapi.actions.show","Show")]})]})}const da=w(E),K=l.div`
|
|
2
2
|
padding-top: var(--spacing-lg);
|
|
3
|
-
padding-bottom: ${({expanded:
|
|
3
|
+
padding-bottom: ${({expanded:a})=>a?"var(--spacing-xxl)":""};
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Markdoc components inside markdown that use SamplesPanel should not have padding.
|
|
7
7
|
E.g. SchemaDefinition, McpTool
|
|
8
8
|
padding is added by the TagItem itself
|
|
9
9
|
*/
|
|
10
|
-
${
|
|
11
|
-
padding-left: 0;
|
|
10
|
+
${p} ${f} {
|
|
12
11
|
padding-right: 0;
|
|
12
|
+
padding-left: 0;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
${({isSchema:a,isStacked:i})=>a&&!i&&M`
|
|
16
|
+
${m} {
|
|
17
|
+
padding-left: 0;
|
|
18
|
+
padding-right: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
${p} ${m} {
|
|
22
|
+
padding-left: calc(var(--panel-gap-horizontal) * 2);
|
|
23
|
+
padding-right: var(--panel-gap-horizontal);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
${p} ${f} {
|
|
27
|
+
padding-right: calc(var(--panel-gap-horizontal) * 2);
|
|
28
|
+
padding-left: var(--panel-gap-horizontal);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
${u} {
|
|
32
|
+
padding-left: calc(var(--panel-gap-horizontal) * 2);
|
|
33
|
+
padding-right: var(--panel-gap-horizontal);
|
|
34
|
+
width: calc(100% - var(--panel-samples-width));
|
|
35
|
+
${_} {
|
|
36
|
+
left: unset;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`}
|
|
40
|
+
`,O=l(C)`
|
|
15
41
|
margin: var(--spacing-md) var(--spacing-xl) var(--spacing-xxs);
|
|
16
42
|
width: calc(100% - var(--spacing-xl) * 2);
|
|
17
43
|
|
|
18
|
-
@media screen and (min-width: ${
|
|
44
|
+
@media screen and (min-width: ${T.medium}) {
|
|
19
45
|
--button-margin-md: calc(var(--spacing-xl) * 2);
|
|
20
46
|
|
|
21
47
|
margin-left: var(--button-margin-md);
|
|
22
48
|
margin-right: var(--button-margin-md);
|
|
23
49
|
width: calc(100% - var(--button-margin-md) * 2);
|
|
24
50
|
}
|
|
25
|
-
`,
|
|
51
|
+
`,u=l(A)`
|
|
26
52
|
display: flex;
|
|
27
53
|
:hover {
|
|
28
|
-
${
|
|
54
|
+
${L} {
|
|
29
55
|
opacity: 1;
|
|
30
56
|
visibility: visible;
|
|
31
57
|
}
|
|
32
58
|
}
|
|
33
|
-
`;export{
|
|
59
|
+
`;export{da as TagItem,E as TagItemComponent};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.17.0-next.
|
|
3
|
+
"version": "3.17.0-next.4",
|
|
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.14.
|
|
24
|
+
"@redocly/openapi-core": "2.14.3",
|
|
25
25
|
"deepmerge": "^4.2.2",
|
|
26
26
|
"dompurify": "3.2.7",
|
|
27
27
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"util": "~0.12.5",
|
|
40
40
|
"web-vitals": "3.3.1",
|
|
41
41
|
"@redocly/config": "0.41.1",
|
|
42
|
-
"@redocly/replay": "0.20.0-next.
|
|
42
|
+
"@redocly/replay": "0.20.0-next.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@shikijs/transformers": "1.24.0",
|