@redocly/openapi-docs 3.2.11-rc.3 → 3.2.11

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,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Metadata=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),theme_1=require("@redocly/theme"),helpers_1=require("../../utils/helpers"),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}){const t=(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:"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:"Key"}),(0,jsx_runtime_1.jsx)("th",{scope:"col",children:"Value"})]})}),(0,jsx_runtime_1.jsx)("tbody",{children:t.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:"string"==typeof t&&(0,helpers_1.isAbsoluteUrl)(t)?(0,jsx_runtime_1.jsx)("a",{href:t,target:"_blank",rel:"noreferrer",children:t}):String(t)})]},e)))})]})]}):null}exports.Metadata=Metadata;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Metadata=void 0;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}){const t=(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:"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:"Key"}),(0,jsx_runtime_1.jsx)("th",{scope:"col",children:"Value"})]})}),(0,jsx_runtime_1.jsx)("tbody",{children:t.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}exports.Metadata=Metadata;
2
2
  //# sourceMappingURL=Metadata.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useAutoScroll=void 0;const react_router_dom_1=require("react-router-dom"),react_1=require("react"),theme_1=require("@redocly/theme"),utils_1=require("../../utils");let initialPageLoad=!0;function useAutoScroll(e){const t=(0,react_router_dom_1.useLocation)(),o=(0,theme_1.addTrailingSlash)(e)||"/";(0,react_1.useLayoutEffect)((()=>{if(t.pathname===o&&""===t.hash)window.scrollTo(0,0);else{const e=t.hash.replace("#","").toLowerCase()||(0,utils_1.normalizePath)(t.pathname).replace(o,""),a=document.getElementById(decodeURIComponent(e));a&&a.scrollIntoView()}}),[t,o]);const a=(0,theme_1.useActiveSectionId)(t,!1,!1);(0,react_1.useEffect)((()=>{if(a&&initialPageLoad)initialPageLoad=!1;else if(theme_1.IS_BROWSER&&!window.location.pathname.includes(a)&&!window.location.hash.includes(a)){const e=(0,utils_1.compose)(theme_1.addLeadingSlash,utils_1.encodeBackSlashes)(a);window.history.replaceState({},"",e)}}),[a])}exports.useAutoScroll=useAutoScroll;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useAutoScroll=void 0;const react_router_dom_1=require("react-router-dom"),react_1=require("react"),theme_1=require("@redocly/theme"),utils_1=require("../../utils");let initialPageLoad=!0;function useAutoScroll(e){const t=(0,react_router_dom_1.useLocation)(),o=e||"/";(0,react_1.useLayoutEffect)((()=>{if(t.pathname===o&&""===t.hash)window.scrollTo(0,0);else{const e=t.hash.replace("#","").toLowerCase()||(0,theme_1.removeLeadingSlash)(t.pathname.replace(o,"")),a=document.getElementById(decodeURIComponent(e));a&&a.scrollIntoView()}}),[t,o]);const a=(0,theme_1.useActiveSectionId)(t,!1,!1);(0,react_1.useEffect)((()=>{if(a&&initialPageLoad)initialPageLoad=!1;else if(theme_1.IS_BROWSER&&!window.location.pathname.includes(a)&&!window.location.hash.includes(a)){const e=(0,utils_1.compose)(theme_1.addLeadingSlash,utils_1.encodeBackSlashes)(a);window.history.replaceState({},"",e)}}),[a])}exports.useAutoScroll=useAutoScroll;
2
2
  //# sourceMappingURL=useAutoScroll.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";import{isAbsoluteUrl}from"../../utils/helpers";const FILTER_OUT_KEYS=["title","description"];function metadataMap([e,r]){return FILTER_OUT_KEYS.includes(e)?null:Array.isArray(r)?{key:e,value:r.filter((e=>"object"!=typeof e)).join(", ")}:"object"==typeof r?null:{key:e,value:r}}export function Metadata({metadata:e}){const r=useMemo((()=>Object.entries(e||{}).map(metadataMap).filter(isNotNull)),[e]);return e?_jsxs(MarkdownWrapper,{children:[_jsx(H3,{children:"Metadata"}),_jsxs("table",{className:"md",children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsx("th",{scope:"col",children:"Key"}),_jsx("th",{scope:"col",children:"Value"})]})}),_jsx("tbody",{children:r.map((({key:e,value:r})=>_jsxs("tr",{children:[_jsx("td",{children:e}),_jsx("td",{children:"string"==typeof r&&isAbsoluteUrl(r)?_jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:r}):String(r)})]},e)))})]})]}):null}
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}){const t=useMemo((()=>Object.entries(e||{}).map(metadataMap).filter(isNotNull)),[e]);return e?_jsxs(MarkdownWrapper,{children:[_jsx(H3,{children:"Metadata"}),_jsxs("table",{className:"md",children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsx("th",{scope:"col",children:"Key"}),_jsx("th",{scope:"col",children:"Value"})]})}),_jsx("tbody",{children:t.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{useLocation}from"react-router-dom";import{useEffect,useLayoutEffect}from"react";import{addTrailingSlash,addLeadingSlash,IS_BROWSER,useActiveSectionId}from"@redocly/theme";import{compose,encodeBackSlashes,normalizePath}from"../../utils";let initialPageLoad=!0;export function useAutoScroll(e){const o=useLocation(),a=addTrailingSlash(e)||"/";useLayoutEffect((()=>{if(o.pathname===a&&""===o.hash)window.scrollTo(0,0);else{const e=o.hash.replace("#","").toLowerCase()||normalizePath(o.pathname).replace(a,""),t=document.getElementById(decodeURIComponent(e));t&&t.scrollIntoView()}}),[o,a]);const t=useActiveSectionId(o,!1,!1);useEffect((()=>{if(t&&initialPageLoad)initialPageLoad=!1;else if(IS_BROWSER&&!window.location.pathname.includes(t)&&!window.location.hash.includes(t)){const e=compose(addLeadingSlash,encodeBackSlashes)(t);window.history.replaceState({},"",e)}}),[t])}
1
+ import{useLocation}from"react-router-dom";import{useEffect,useLayoutEffect}from"react";import{addLeadingSlash,IS_BROWSER,useActiveSectionId,removeLeadingSlash}from"@redocly/theme";import{compose,encodeBackSlashes}from"../../utils";let initialPageLoad=!0;export function useAutoScroll(e){const o=useLocation(),t=e||"/";useLayoutEffect((()=>{if(o.pathname===t&&""===o.hash)window.scrollTo(0,0);else{const e=o.hash.replace("#","").toLowerCase()||removeLeadingSlash(o.pathname.replace(t,"")),a=document.getElementById(decodeURIComponent(e));a&&a.scrollIntoView()}}),[o,t]);const a=useActiveSectionId(o,!1,!1);useEffect((()=>{if(a&&initialPageLoad)initialPageLoad=!1;else if(IS_BROWSER&&!window.location.pathname.includes(a)&&!window.location.hash.includes(a)){const e=compose(addLeadingSlash,encodeBackSlashes)(a);window.history.replaceState({},"",e)}}),[a])}
2
2
  //# sourceMappingURL=useAutoScroll.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-docs",
3
- "version": "3.2.11-rc.3",
3
+ "version": "3.2.11",
4
4
  "description": "Redocly OpenAPI Docs",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -44,8 +44,8 @@
44
44
  "url": "~0.11.0",
45
45
  "url-template": "^2.0.8",
46
46
  "util": "~0.12.5",
47
- "@redocly/config": "0.8.1",
48
- "@redocly/replay": "0.3.13"
47
+ "@redocly/replay": "0.3.14",
48
+ "@redocly/config": "0.8.1"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@testing-library/jest-dom": "6.1.5",
@@ -92,7 +92,7 @@
92
92
  "webpack": "5.91.0",
93
93
  "webpack-cli": "5.1.4",
94
94
  "webpack-dev-server": "4.15.2",
95
- "@redocly/theme": "0.38.8"
95
+ "@redocly/theme": "0.39.0"
96
96
  },
97
97
  "scripts": {
98
98
  "start": "webpack serve --mode=development --hot",