@redocly/openapi-docs 3.7.0-rc.1 → 3.8.0-next.0
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 +1270 -1291
- package/lib/components/ApiInfo/ApiInfo.js +1 -1
- package/lib/components/ApiInfo/Metadata.js +1 -1
- package/lib/components/Overview/Overview.js +1 -1
- package/lib/services/types.d.ts +0 -3
- package/lib-esm/components/ApiInfo/ApiInfo.js +1 -1
- package/lib-esm/components/ApiInfo/Metadata.js +1 -1
- package/lib-esm/components/Overview/Overview.js +1 -1
- package/lib-esm/services/types.d.ts +0 -3
- package/package.json +8 -10
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApiInfo=ApiInfo;const jsx_runtime_1=require("react/jsx-runtime"),jotai_1=require("jotai"),theme_1=require("@redocly/theme"),app_1=require("../../jotai/app"),common_1=require("../common"),ExternalDocumentation_1=require("../ExternalDocumentation"),Markdown_1=require("../Markdown"),styled_1=require("./styled"),store_1=require("../../jotai/store"),saveTextBeforeHeading_1=require("../../utils/saveTextBeforeHeading"),helpers_1=require("../../utils/helpers"),RenderHook_1=require("../RenderHook"),Metadata_1=require("./Metadata"),hooks_1=require("../../hooks");function ApiInfo({item:e}){const r=(0,hooks_1.useTranslate)(),{options:{unstable_hooks:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApiInfo=ApiInfo;const jsx_runtime_1=require("react/jsx-runtime"),jotai_1=require("jotai"),theme_1=require("@redocly/theme"),app_1=require("../../jotai/app"),common_1=require("../common"),ExternalDocumentation_1=require("../ExternalDocumentation"),Markdown_1=require("../Markdown"),styled_1=require("./styled"),store_1=require("../../jotai/store"),saveTextBeforeHeading_1=require("../../utils/saveTextBeforeHeading"),helpers_1=require("../../utils/helpers"),RenderHook_1=require("../RenderHook"),Metadata_1=require("./Metadata"),hooks_1=require("../../hooks");function ApiInfo({item:e}){const r=(0,hooks_1.useTranslate)(),{options:{unstable_hooks:t,hideInfoMetadata:o},parser:{definition:a}}=(0,jotai_1.useAtomValue)(store_1.globalStoreAtom),i=(0,jotai_1.useAtomValue)(app_1.layoutAtom),n=e.infoDefinition;if(!n)return null;const s=(0,saveTextBeforeHeading_1.saveTextBeforeHeading)((0,helpers_1.getValueFromMdParsedExtension)(n,"description")||""),u=(0,helpers_1.getValueFromMdParsedExtension)(n,"summary")||void 0,_=null==a?void 0:a.externalDocs,l=n.version&&(0,jsx_runtime_1.jsxs)("span",{children:["(",n.version,")"]})||null,d=i===theme_1.LayoutVariant.STACKED;return(0,jsx_runtime_1.jsx)(common_1.Row,{layout:i,children:(0,jsx_runtime_1.jsxs)(common_1.SamplesMiddlePanel,{fullWidth:!0,className:"api-info",isStacked:d,children:[(0,jsx_runtime_1.jsxs)(styled_1.ApiHeader,{children:[n.title," ",l]}),(0,jsx_runtime_1.jsx)(RenderHook_1.RenderHook,{Hook:theme_1.AfterOpenApiTitle||(null==t?void 0:t.AfterApiTitle),props:{info:n}}),u&&(0,jsx_runtime_1.jsx)(Markdown_1.Markdown,{source:u,"data-role":"redoc-summary"}),s&&(0,jsx_runtime_1.jsx)(Markdown_1.Markdown,{source:s,"data-role":"redoc-description"}),_&&(0,jsx_runtime_1.jsx)(ExternalDocumentation_1.ExternalDocumentation,{externalDocs:_}),!o&&(0,jsx_runtime_1.jsx)(Metadata_1.Metadata,{metadata:n["x-metadata"],translate:r})]})})}
|
|
2
2
|
//# sourceMappingURL=ApiInfo.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Metadata=Metadata;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),theme_1=require("@redocly/theme"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Metadata=Metadata;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),theme_1=require("@redocly/theme"),FILTER_OUT_KEYS=["title","description"];function metadataMap([e,t]){return FILTER_OUT_KEYS.includes(e)?null:Array.isArray(t)?{key:e,value:t.filter((e=>"object"!=typeof e)).join(", ")}:"object"==typeof t?null:{key:e,value:t}}function Metadata({metadata:e,translate:t}){const r=(0,react_1.useMemo)((()=>Object.entries(e||{}).map(metadataMap).filter(theme_1.isNotNull)),[e]);return e?(0,jsx_runtime_1.jsxs)(theme_1.Markdown,{children:[(0,jsx_runtime_1.jsx)(theme_1.H3,{children:t("openapi.info.metadata.title","Metadata")}),(0,jsx_runtime_1.jsxs)("table",{className:"md",children:[(0,jsx_runtime_1.jsx)("thead",{children:(0,jsx_runtime_1.jsxs)("tr",{children:[(0,jsx_runtime_1.jsx)("th",{scope:"col",children:t("openapi.key","Key")}),(0,jsx_runtime_1.jsx)("th",{scope:"col",children:t("openapi.value","Value")})]})}),(0,jsx_runtime_1.jsx)("tbody",{children:r.map((({key:e,value:t})=>(0,jsx_runtime_1.jsxs)("tr",{children:[(0,jsx_runtime_1.jsx)("td",{children:e}),(0,jsx_runtime_1.jsx)("td",{children:`${t}`})]},e)))})]})]}):null}
|
|
2
2
|
//# sourceMappingURL=Metadata.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Overview=Overview;const jsx_runtime_1=require("react/jsx-runtime"),theme_1=require("@redocly/theme"),PanelItem_1=require("../PanelItem");function Overview({info:e,translate:t}){
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Overview=Overview;const jsx_runtime_1=require("react/jsx-runtime"),theme_1=require("@redocly/theme"),PanelItem_1=require("../PanelItem");function Overview({info:e,translate:t}){const n=e.contact&&e.contact.url&&(0,jsx_runtime_1.jsx)(PanelItem_1.PanelItem,{header:(0,jsx_runtime_1.jsx)(PanelItem_1.PanelItemDescription,{children:t("openapi.info.contact.url","URL")}),title:(0,jsx_runtime_1.jsx)("a",{href:e.contact.url,target:"_blank",rel:"noreferrer",children:e.contact.url}),actions:[(0,jsx_runtime_1.jsx)(theme_1.NewTabButton,{data:e.contact.url},"NewTabButton")]})||null,r=e.contact&&e.contact.email&&(0,jsx_runtime_1.jsx)(PanelItem_1.PanelItem,{header:(0,jsx_runtime_1.jsx)(PanelItem_1.PanelItemDescription,{children:e.contact.name||t("openapi.info.contact.name","E-mail")}),title:(0,jsx_runtime_1.jsx)("a",{href:"mailto:"+e.contact.email,children:e.contact.email}),actions:[(0,jsx_runtime_1.jsx)(theme_1.CopyButton,{data:e.contact.email},"CopyButton"),(0,jsx_runtime_1.jsx)(theme_1.EmailButton,{data:e.contact.email},"EmailButton")]})||null,i=e.license&&(0,jsx_runtime_1.jsx)(PanelItem_1.PanelItem,{header:(0,jsx_runtime_1.jsx)(PanelItem_1.PanelItemDescription,{children:t("openapi.info.license","License")}),title:e.license.identifier?e.license.identifier:(0,jsx_runtime_1.jsx)("a",{href:e.license.url,target:"_blank",rel:"noreferrer",children:e.license.name}),actions:[(0,jsx_runtime_1.jsx)(theme_1.NewTabButton,{data:e.license.url||""},"NewTabButton")]})||null,a=e.termsOfService&&(0,jsx_runtime_1.jsx)(PanelItem_1.PanelItem,{title:(0,jsx_runtime_1.jsx)("a",{href:e.termsOfService,target:"_blank",rel:"noreferrer",children:t("openapi.info.termsOfService","Terms of Service")}),actions:[(0,jsx_runtime_1.jsx)(theme_1.NewTabButton,{data:e.termsOfService},e.termsOfService)]})||null;return(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:(0,jsx_runtime_1.jsxs)(PanelItem_1.PanelItemsList,{children:[n,r,i,a]})})}
|
|
2
2
|
//# sourceMappingURL=Overview.js.map
|
package/lib/services/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as _jsxs,jsx as _jsx}from"react/jsx-runtime";import{useAtomValue}from"jotai";import{AfterOpenApiTitle,
|
|
1
|
+
import{jsxs as _jsxs,jsx as _jsx}from"react/jsx-runtime";import{useAtomValue}from"jotai";import{AfterOpenApiTitle,LayoutVariant}from"@redocly/theme";import{layoutAtom}from"../../jotai/app";import{SamplesMiddlePanel,Row}from"../common";import{ExternalDocumentation}from"../ExternalDocumentation";import{Markdown}from"../Markdown";import{ApiHeader}from"./styled";import{globalStoreAtom}from"../../jotai/store";import{saveTextBeforeHeading}from"../../utils/saveTextBeforeHeading";import{getValueFromMdParsedExtension}from"../../utils/helpers";import{RenderHook}from"../RenderHook";import{Metadata}from"./Metadata";import{useTranslate}from"../../hooks";export function ApiInfo({item:e}){const o=useTranslate(),{options:{unstable_hooks:t,hideInfoMetadata:r},parser:{definition:a}}=useAtomValue(globalStoreAtom),i=useAtomValue(layoutAtom),n=e.infoDefinition;if(!n)return null;const s=saveTextBeforeHeading(getValueFromMdParsedExtension(n,"description")||""),m=getValueFromMdParsedExtension(n,"summary")||void 0,l=null==a?void 0:a.externalDocs,d=n.version&&_jsxs("span",{children:["(",n.version,")"]})||null,p=i===LayoutVariant.STACKED;return _jsx(Row,{layout:i,children:_jsxs(SamplesMiddlePanel,{fullWidth:!0,className:"api-info",isStacked:p,children:[_jsxs(ApiHeader,{children:[n.title," ",d]}),_jsx(RenderHook,{Hook:AfterOpenApiTitle||(null==t?void 0:t.AfterApiTitle),props:{info:n}}),m&&_jsx(Markdown,{source:m,"data-role":"redoc-summary"}),s&&_jsx(Markdown,{source:s,"data-role":"redoc-description"}),l&&_jsx(ExternalDocumentation,{externalDocs:l}),!r&&_jsx(Metadata,{metadata:n["x-metadata"],translate:o})]})})}
|
|
2
2
|
//# sourceMappingURL=ApiInfo.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useMemo}from"react";import{Markdown as MarkdownWrapper,H3,isNotNull}from"@redocly/theme";
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useMemo}from"react";import{Markdown as MarkdownWrapper,H3,isNotNull}from"@redocly/theme";const FILTER_OUT_KEYS=["title","description"];function metadataMap([e,t]){return FILTER_OUT_KEYS.includes(e)?null:Array.isArray(t)?{key:e,value:t.filter((e=>"object"!=typeof e)).join(", ")}:"object"==typeof t?null:{key:e,value:t}}export function Metadata({metadata:e,translate:t}){const a=useMemo((()=>Object.entries(e||{}).map(metadataMap).filter(isNotNull)),[e]);return e?_jsxs(MarkdownWrapper,{children:[_jsx(H3,{children:t("openapi.info.metadata.title","Metadata")}),_jsxs("table",{className:"md",children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsx("th",{scope:"col",children:t("openapi.key","Key")}),_jsx("th",{scope:"col",children:t("openapi.value","Value")})]})}),_jsx("tbody",{children:a.map((({key:e,value:t})=>_jsxs("tr",{children:[_jsx("td",{children:e}),_jsx("td",{children:`${t}`})]},e)))})]})]}):null}
|
|
2
2
|
//# sourceMappingURL=Metadata.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{CopyButton,NewTabButton,EmailButton}from"@redocly/theme";import{PanelItem,PanelItemDescription,PanelItemsList}from"../PanelItem";export function Overview({info:e,translate:t}){
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{CopyButton,NewTabButton,EmailButton}from"@redocly/theme";import{PanelItem,PanelItemDescription,PanelItemsList}from"../PanelItem";export function Overview({info:e,translate:t}){const n=e.contact&&e.contact.url&&_jsx(PanelItem,{header:_jsx(PanelItemDescription,{children:t("openapi.info.contact.url","URL")}),title:_jsx("a",{href:e.contact.url,target:"_blank",rel:"noreferrer",children:e.contact.url}),actions:[_jsx(NewTabButton,{data:e.contact.url},"NewTabButton")]})||null,a=e.contact&&e.contact.email&&_jsx(PanelItem,{header:_jsx(PanelItemDescription,{children:e.contact.name||t("openapi.info.contact.name","E-mail")}),title:_jsx("a",{href:"mailto:"+e.contact.email,children:e.contact.email}),actions:[_jsx(CopyButton,{data:e.contact.email},"CopyButton"),_jsx(EmailButton,{data:e.contact.email},"EmailButton")]})||null,r=e.license&&_jsx(PanelItem,{header:_jsx(PanelItemDescription,{children:t("openapi.info.license","License")}),title:e.license.identifier?e.license.identifier:_jsx("a",{href:e.license.url,target:"_blank",rel:"noreferrer",children:e.license.name}),actions:[_jsx(NewTabButton,{data:e.license.url||""},"NewTabButton")]})||null,i=e.termsOfService&&_jsx(PanelItem,{title:_jsx("a",{href:e.termsOfService,target:"_blank",rel:"noreferrer",children:t("openapi.info.termsOfService","Terms of Service")}),actions:[_jsx(NewTabButton,{data:e.termsOfService},e.termsOfService)]})||null;return _jsx(_Fragment,{children:_jsxs(PanelItemsList,{children:[n,a,r,i]})})}
|
|
2
2
|
//# sourceMappingURL=Overview.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0-next.0",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"openapi-docs": "bin.js"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@redocly/theme": ">=0.
|
|
19
|
+
"@redocly/theme": ">=0.52.0-next.0",
|
|
20
20
|
"core-js": "^3.1.4",
|
|
21
21
|
"react": "^18.0.0",
|
|
22
22
|
"react-dom": "^18.0.0",
|
|
@@ -24,16 +24,15 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@markdoc/markdoc": "0.5.1",
|
|
27
|
-
"@redocly/openapi-core": "1.
|
|
27
|
+
"@redocly/openapi-core": "1.32.2",
|
|
28
28
|
"deepmerge": "^4.2.2",
|
|
29
|
-
"dompurify": "2.
|
|
29
|
+
"dompurify": "3.2.4",
|
|
30
30
|
"fast-deep-equal": "^3.1.3",
|
|
31
31
|
"jotai": "^2.4.2",
|
|
32
32
|
"json-pointer": "^0.6.2",
|
|
33
33
|
"jstoxml": "^5.0.2",
|
|
34
34
|
"openapi-sampler": "^1.6.1",
|
|
35
35
|
"path-browserify": "^1.0.1",
|
|
36
|
-
"prismjs": "1.29.0",
|
|
37
36
|
"react-router-dom": "^6.21.1",
|
|
38
37
|
"slugify": "^1.4.4",
|
|
39
38
|
"stringify-object": "^3.3.0",
|
|
@@ -44,8 +43,8 @@
|
|
|
44
43
|
"url-template": "^2.0.8",
|
|
45
44
|
"util": "~0.12.5",
|
|
46
45
|
"web-vitals": "3.3.1",
|
|
47
|
-
"@redocly/config": "0.22.
|
|
48
|
-
"@redocly/replay": "0.
|
|
46
|
+
"@redocly/config": "0.22.1",
|
|
47
|
+
"@redocly/replay": "0.11.0-next.0"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
51
50
|
"@shikijs/transformers": "1.24.0",
|
|
@@ -53,13 +52,12 @@
|
|
|
53
52
|
"@testing-library/react": "14.1.2",
|
|
54
53
|
"@testing-library/react-hooks": "^8.0.1",
|
|
55
54
|
"@testing-library/user-event": "14.5.1",
|
|
56
|
-
"@types/dompurify": "2.
|
|
55
|
+
"@types/dompurify": "3.2.0",
|
|
57
56
|
"@types/jest": "29.5.11",
|
|
58
57
|
"@types/jest-when": "3.5.5",
|
|
59
58
|
"@types/json-pointer": "1.0.34",
|
|
60
59
|
"@types/json-schema": "^7.0.15",
|
|
61
60
|
"@types/node": "22.10.5",
|
|
62
|
-
"@types/prismjs": "1.26.4",
|
|
63
61
|
"@types/react": "18.3.9",
|
|
64
62
|
"@types/react-dom": "18.3.5",
|
|
65
63
|
"@types/styled-components": "5.1.34",
|
|
@@ -96,7 +94,7 @@
|
|
|
96
94
|
"webpack": "5.94.0",
|
|
97
95
|
"webpack-cli": "5.1.4",
|
|
98
96
|
"webpack-dev-server": "5.1.0",
|
|
99
|
-
"@redocly/theme": "0.
|
|
97
|
+
"@redocly/theme": "0.52.0-next.0"
|
|
100
98
|
},
|
|
101
99
|
"scripts": {
|
|
102
100
|
"start": "npm run copy-highlight-hook && webpack serve --mode=development --hot",
|