@redocly/openapi-docs 3.7.0-next.2 → 3.7.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,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.VirtualList=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),react_router_dom_1=require("react-router-dom"),theme_1=require("@redocly/theme"),VirtualListComponent=({items:e=[],renderItem:t,routingBasePath:r})=>{const a=r||"/",n=(0,react_router_dom_1.useLocation)(),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.VirtualList=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),react_router_dom_1=require("react-router-dom"),theme_1=require("@redocly/theme"),INITIAL_VISIBLE_ITEMS=3,BUFFER_ITEMS=1,FULL_LIST_DELAY=1e3,VirtualListComponent=({items:e=[],renderItem:t,routingBasePath:r})=>{const a=r||"/",n=(0,react_router_dom_1.useLocation)(),s=(0,theme_1.removeLeadingSlash)(n.pathname.replace(a,"")),o=(0,react_1.useMemo)((()=>{const t=new Map(e.map(((e,t)=>[(0,theme_1.removeLeadingSlash)(e.href),t])));return e=>e?t.get(e):void 0}),[e]),u=(0,react_1.useCallback)((t=>{const r=o(t);return{start:Math.max(0,r?r-1:0),end:Math.min(e.length,r?r+1+1:3)}}),[o,e.length]),[i,m]=(0,react_1.useState)((()=>{const{start:t,end:r}=u(s);return e.slice(t,r)}));return(0,react_1.useEffect)((()=>{const t=setTimeout((()=>{m(e)}),1e3);return()=>clearTimeout(t)}),[e]),(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:i.map(t)})};exports.VirtualList=(0,react_1.memo)(VirtualListComponent);
|
|
2
2
|
//# sourceMappingURL=VirtualList.js.map
|
package/lib/services/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.cryptoLib=void 0,exports.isSameMime=isSameMime,exports.normalizeMimeType=normalizeMimeType,exports.unescapeServerVariables=unescapeServerVariables,exports.arrayMergeStrategy=arrayMergeStrategy,exports.isEmptyObject=isEmptyObject,exports.deepClone=deepClone;const deepmerge_1=__importDefault(require("deepmerge")),theme_1=require("@redocly/theme"),utils_1=require("../utils");function isSameMime(e,r){return!(!e||!r)&&normalizeMimeType(e)===normalizeMimeType(r)}function normalizeMimeType(e){if(!e)return;const r=e.split(";")[0].toLowerCase(),[t,i]=r.split("/");if(void 0===i)return t;return`${t}/${i.split("+").pop()}`}function unescapeServerVariables(e){const r=new RegExp("%7B","g"),t=new RegExp("%7D","g");return e.replace(r,"{").replace(t,"}").replace("///","//")}function arrayMergeStrategy(e,r){if(!e.length||!hasObjectOrArray(e))return r;const t=e.filter((e=>Object.keys(e).length>0));return r.forEach((function(r,i){(0,utils_1.isMergeableObject)(r)?t[i]=(0,deepmerge_1.default)(e[i],r,{arrayMerge:arrayMergeStrategy}):Array.isArray(r)?t.push(r):t[i]=r})),t}const hasObjectOrArray=e=>e.some((e=>(0,theme_1.isObject)(e)&&Object.keys(e).length>0));function isEmptyObject(e){return!!e&&0===Object.keys(e).length}function deepClone(e){if("object"!=typeof e||null===e)return e;const r=Array.isArray(e)?[]:{};for(const t in e){const i=e[t];r[t]=deepClone(i)}return r}exports.cryptoLib="undefined"!=typeof window&&(window.crypto||window.msCrypto)||void 0;
|
|
1
|
+
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.cryptoLib=void 0,exports.isSameMime=isSameMime,exports.normalizeMimeType=normalizeMimeType,exports.unescapeServerVariables=unescapeServerVariables,exports.arrayMergeStrategy=arrayMergeStrategy,exports.isEmptyObject=isEmptyObject,exports.deepClone=deepClone;const deepmerge_1=__importDefault(require("deepmerge")),theme_1=require("@redocly/theme"),utils_1=require("../utils");function isSameMime(e,r){return!(!e||!r)&&normalizeMimeType(e)===normalizeMimeType(r)}function normalizeMimeType(e){if(!e)return;const r=e.split(";")[0].toLowerCase(),[t,i]=r.split("/");if(void 0===i)return t;return`${t}/${i.split("+").pop()}`}function unescapeServerVariables(e){const r=new RegExp("%7B","g"),t=new RegExp("%7D","g");return e.replace(r,"{").replace(t,"}").replace("///","//").replace("./",".")}function arrayMergeStrategy(e,r){if(!e.length||!hasObjectOrArray(e))return r;const t=e.filter((e=>Object.keys(e).length>0));return r.forEach((function(r,i){(0,utils_1.isMergeableObject)(r)?t[i]=(0,deepmerge_1.default)(e[i],r,{arrayMerge:arrayMergeStrategy}):Array.isArray(r)?t.push(r):t[i]=r})),t}const hasObjectOrArray=e=>e.some((e=>(0,theme_1.isObject)(e)&&Object.keys(e).length>0));function isEmptyObject(e){return!!e&&0===Object.keys(e).length}function deepClone(e){if("object"!=typeof e||null===e)return e;const r=Array.isArray(e)?[]:{};for(const t in e){const i=e[t];r[t]=deepClone(i)}return r}exports.cryptoLib="undefined"!=typeof window&&(window.crypto||window.msCrypto)||void 0;
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as _Fragment,jsx as _jsx}from"react/jsx-runtime";import{useCallback,memo,useEffect,useState}from"react";import{useLocation}from"react-router-dom";import{removeLeadingSlash}from"@redocly/theme";const VirtualListComponent=({items:e=[],renderItem:t,routingBasePath:
|
|
1
|
+
import{Fragment as _Fragment,jsx as _jsx}from"react/jsx-runtime";import{useCallback,memo,useEffect,useState,useMemo}from"react";import{useLocation}from"react-router-dom";import{removeLeadingSlash}from"@redocly/theme";const INITIAL_VISIBLE_ITEMS=3,BUFFER_ITEMS=1,FULL_LIST_DELAY=1e3,VirtualListComponent=({items:e=[],renderItem:t,routingBasePath:r})=>{const a=r||"/",o=useLocation(),n=removeLeadingSlash(o.pathname.replace(a,"")),s=useMemo((()=>{const t=new Map(e.map(((e,t)=>[removeLeadingSlash(e.href),t])));return e=>e?t.get(e):void 0}),[e]),m=useCallback((t=>{const r=s(t);return{start:Math.max(0,r?r-1:0),end:Math.min(e.length,r?r+1+1:3)}}),[s,e.length]),[i,u]=useState((()=>{const{start:t,end:r}=m(n);return e.slice(t,r)}));return useEffect((()=>{const t=setTimeout((()=>{u(e)}),1e3);return()=>clearTimeout(t)}),[e]),_jsx(_Fragment,{children:i.map(t)})};export const VirtualList=memo(VirtualListComponent);
|
|
2
2
|
//# sourceMappingURL=VirtualList.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import merge from"deepmerge";import{isObject}from"@redocly/theme";import{isMergeableObject}from"../utils";export function isSameMime(e,r){return!(!e||!r)&&normalizeMimeType(e)===normalizeMimeType(r)}export function normalizeMimeType(e){if(!e)return;const r=e.split(";")[0].toLowerCase(),[t,n]=r.split("/");if(void 0===n)return t;return`${t}/${n.split("+").pop()}`}export function unescapeServerVariables(e){const r=new RegExp("%7B","g"),t=new RegExp("%7D","g");return e.replace(r,"{").replace(t,"}").replace("///","//")}export function arrayMergeStrategy(e,r){if(!e.length||!hasObjectOrArray(e))return r;const t=e.filter((e=>Object.keys(e).length>0));return r.forEach((function(r,n){isMergeableObject(r)?t[n]=merge(e[n],r,{arrayMerge:arrayMergeStrategy}):Array.isArray(r)?t.push(r):t[n]=r})),t}const hasObjectOrArray=e=>e.some((e=>isObject(e)&&Object.keys(e).length>0));export function isEmptyObject(e){return!!e&&0===Object.keys(e).length}export const cryptoLib="undefined"!=typeof window&&(window.crypto||window.msCrypto)||void 0;export function deepClone(e){if("object"!=typeof e||null===e)return e;const r=Array.isArray(e)?[]:{};for(const t in e){const n=e[t];r[t]=deepClone(n)}return r}
|
|
1
|
+
import merge from"deepmerge";import{isObject}from"@redocly/theme";import{isMergeableObject}from"../utils";export function isSameMime(e,r){return!(!e||!r)&&normalizeMimeType(e)===normalizeMimeType(r)}export function normalizeMimeType(e){if(!e)return;const r=e.split(";")[0].toLowerCase(),[t,n]=r.split("/");if(void 0===n)return t;return`${t}/${n.split("+").pop()}`}export function unescapeServerVariables(e){const r=new RegExp("%7B","g"),t=new RegExp("%7D","g");return e.replace(r,"{").replace(t,"}").replace("///","//").replace("./",".")}export function arrayMergeStrategy(e,r){if(!e.length||!hasObjectOrArray(e))return r;const t=e.filter((e=>Object.keys(e).length>0));return r.forEach((function(r,n){isMergeableObject(r)?t[n]=merge(e[n],r,{arrayMerge:arrayMergeStrategy}):Array.isArray(r)?t.push(r):t[n]=r})),t}const hasObjectOrArray=e=>e.some((e=>isObject(e)&&Object.keys(e).length>0));export function isEmptyObject(e){return!!e&&0===Object.keys(e).length}export const cryptoLib="undefined"!=typeof window&&(window.crypto||window.msCrypto)||void 0;export function deepClone(e){if("object"!=typeof e||null===e)return e;const r=Array.isArray(e)?[]:{};for(const t in e){const n=e[t];r[t]=deepClone(n)}return r}
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.7.0-next.
|
|
3
|
+
"version": "3.7.0-next.4",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"url": "~0.11.0",
|
|
44
44
|
"url-template": "^2.0.8",
|
|
45
45
|
"util": "~0.12.5",
|
|
46
|
-
"@redocly/config": "0.
|
|
47
|
-
"@redocly/replay": "0.10.0-next.
|
|
46
|
+
"@redocly/config": "0.21.0",
|
|
47
|
+
"@redocly/replay": "0.10.0-next.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@shikijs/transformers": "1.24.0",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"webpack": "5.94.0",
|
|
96
96
|
"webpack-cli": "5.1.4",
|
|
97
97
|
"webpack-dev-server": "5.1.0",
|
|
98
|
-
"@redocly/theme": "0.51.0-next.
|
|
98
|
+
"@redocly/theme": "0.51.0-next.2"
|
|
99
99
|
},
|
|
100
100
|
"scripts": {
|
|
101
101
|
"start": "npm run copy-highlight-hook && webpack serve --mode=development --hot",
|