@redocly/openapi-docs 3.14.0-next.13 → 3.14.0-next.15

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.
Files changed (44) hide show
  1. package/dist/redocly-openapi-docs.min.js +2163 -2093
  2. package/lib/components/ContentItem/ContentItem.js +1 -1
  3. package/lib/components/ContentItems/Items.js +1 -1
  4. package/lib/components/ContentItems/helpers.js +1 -1
  5. package/lib/components/McpOverview/McpOverview.d.ts +5 -0
  6. package/lib/components/McpOverview/McpOverview.js +16 -0
  7. package/lib/components/McpOverview/index.d.ts +1 -0
  8. package/lib/components/McpOverview/index.js +1 -0
  9. package/lib/components/McpTool/McpTool.d.ts +6 -0
  10. package/lib/components/McpTool/McpTool.js +9 -0
  11. package/lib/components/McpTool/index.d.ts +1 -0
  12. package/lib/components/McpTool/index.js +1 -0
  13. package/lib/components/PanelItem/styled.js +1 -0
  14. package/lib/components/RedoclyOpenAPIDocs/Error.d.ts +3 -0
  15. package/lib/components/RedoclyOpenAPIDocs/Error.js +25 -0
  16. package/lib/components/RedoclyOpenAPIDocs/Providers.js +1 -1
  17. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js +1 -1
  18. package/lib/components/RightPanel/RightPanel.js +1 -1
  19. package/lib/components/SectionItem/SectionItem.d.ts +1 -1
  20. package/lib/components/ServerList/ServerDescriptionTooltip.d.ts +4 -0
  21. package/lib/components/ServerList/ServerDescriptionTooltip.js +1 -0
  22. package/lib/components/ServerList/ServerList.js +14 -9
  23. package/lib/components/ServerListDropdown/ServerListDropdown.js +1 -1
  24. package/lib/components/SideMenu/hooks/useMenuItems.js +1 -1
  25. package/lib/components/TagItem/OperationNavigationItems.js +3 -3
  26. package/lib/components/TagItem/OperationsNavigation.js +2 -2
  27. package/lib/components/TagItem/TagItem.js +17 -7
  28. package/lib/components/TagItem/types.d.ts +2 -2
  29. package/lib/models/group.js +1 -1
  30. package/lib/models/types.d.ts +2 -0
  31. package/lib/services/menu/builder.js +1 -1
  32. package/lib/services/menu/tags.d.ts +1 -0
  33. package/lib/services/menu/tags.js +2 -1
  34. package/lib/services/types.d.ts +1 -1
  35. package/lib/standalone.js +1 -1
  36. package/lib/types/open-api.d.ts +47 -0
  37. package/lib/utils/helpers.d.ts +2 -0
  38. package/lib/utils/helpers.js +4 -4
  39. package/lib/utils/loadAndBundleSpec.js +1 -1
  40. package/lib/utils/mcp.d.ts +3 -0
  41. package/lib/utils/mcp.js +1 -0
  42. package/lib/utils/menu.d.ts +2 -0
  43. package/lib/utils/menu.js +1 -0
  44. package/package.json +4 -4
@@ -1,12 +1,12 @@
1
- import{isObject as i,isString as a}from"@redocly/theme/core/openapi";import{isNamedDefinition as f}from"./openapi.js";import{JsonPointer as l}from"./JsonPointer.js";import{urlParse as u}from"./url.js";import{IS_BROWSER as c}from"./dom.js";function O(r,t){const e=[];for(let n=0;n<r.length-1;n++)e.push(t(r[n],!1));return r.length!==0&&e.push(t(r[r.length-1],!0)),e}function y(r,t){const e={};for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=t(r[n],n,r));return e}function A(r,t){const e=[],n=o=>{for(const s of o)e.push(s),s[t]&&n(s[t])};return n(r),e}function p(r){return r.endsWith("/")?r.substring(0,r.length-1):r}function b(r){return!isNaN(parseFloat(r))&&isFinite(r)}function E(r,t,e){const n=new RegExp(`(^|\\n)#\\s?${t}\\s*\\n`,"i"),o=new RegExp(`((\\n|^)#\\s*${t}\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)`,"i");if(n.test(r))return r.replace(o,`$1
1
+ import{isObject as i,isString as a}from"@redocly/theme/core/openapi";import{isNamedDefinition as f}from"./openapi.js";import{JsonPointer as l}from"./JsonPointer.js";import{urlParse as u}from"./url.js";import{IS_BROWSER as c}from"./dom.js";function O(r,e){const t=[];for(let n=0;n<r.length-1;n++)t.push(e(r[n],!1));return r.length!==0&&t.push(e(r[r.length-1],!0)),t}function y(r,e){const t={};for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=e(r[n],n,r));return t}function A(r,e){const t=[],n=o=>{for(const s of o)t.push(s),s[e]&&n(s[e])};return n(r),t}function p(r){return r.endsWith("/")?r.substring(0,r.length-1):r}function b(r){return!isNaN(parseFloat(r))&&isFinite(r)}function E(r,e,t){const n=new RegExp(`(^|\\n)#\\s?${e}\\s*\\n`,"i"),o=new RegExp(`((\\n|^)#\\s*${e}\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)`,"i");if(n.test(r))return r.replace(o,`$1
2
2
 
3
- ${e}
3
+ ${t}
4
4
  $4`);{const s=r===""||r.endsWith(`
5
5
 
6
6
  `)?"":r.endsWith(`
7
7
  `)?`
8
8
  `:`
9
9
 
10
- `;return`${r}${s}# ${t}
10
+ `;return`${r}${s}# ${e}
11
11
 
12
- ${e}`}}const R=r=>Array.isArray(r)&&r.some(t=>i(t)),W=r=>r.filter(t=>!!t),C=r=>i(r)&&!Array.isArray(r);function d(r){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(r)}function I(r,t){let e;if(t.startsWith("//"))e=`${u(r,!0)?.protocol||"https:"}${t}`;else if(d(t))e=t;else if(!t.startsWith("/"))e=p(r)+"/"+t;else{const n=u(r);n?(n.pathname=t,e=n.toString()):e=t}return p(e)}function L(r){return r.charAt(0).toUpperCase()+r.slice(1)}function M(r){try{if(!r)return"";const t=new URL(r);return t.search="",t.hash="",t.toString()}catch{return r}}function N(r){return r.replace(/["\\]/g,"\\$&")}function P(r){return r.replace(/&#(\d+);/g,(t,e)=>String.fromCharCode(parseInt(e,10))).replace(/&amp;/g,"&").replace(/&quot;/g,'"')}function T(r){return r&&r.replace(/#/g,"_").toLowerCase()}function j(r,t){return t||f(r)&&l.baseName(r)||""}function z(r={},t,e){return typeof t=="string"&&(t=t.split(".")),t.reduce((n,o)=>n&&n[o]?n[o]:e,r)}function x(r){return(...t)=>t.filter(Boolean).join(r)}const D=x(".");function F(r){return c?window?.REFERENCE_DOCS_OPTIONS?.[r]:null}function _(){if(!c)return"";const r=+new Date+Math.random();try{return(!document.currentScript||!(document.currentScript.async||document.currentScript.defer))&&document.write(`<script id="dummy${r}"></script>`),(document.getElementById("dummy"+r)?.previousSibling).src}catch{return""}}const B=r=>a(r)?r:r?.raw,H=(r,t)=>{const e=r?.[`x-parsed-md-${t}`]||r?.[t];if(!e)return;if(!r?.[`x-parsed-md-${t}`]&&t!=="x-enumDescriptions")return r?.[t];if(t!=="x-enumDescriptions")return g(r,t);let n={};for(const o in e)o.startsWith("x-parsed-md")||(n[o]=e?.[`x-parsed-md-${o}`]||e?.[o]);return Object.keys(n).length?n:e};function g(r,t){const e=r?.[`x-parsed-md-${t}`]||r?.[t];return e?.raw?e:{result:e?.result||r?.[t]?.result||r?.[t],raw:r?.[t]}}function U(r,t){return t===r.length-1}function V(r,t){const e=Object.keys(r);return e.indexOf(t)===e.length-1}export{E as appendToMdHeading,W as deleteEmptyArrayItem,D as dottedString,N as escapeHTMLAttrChars,A as flattenByProp,z as get,_ as getJsUrl,H as getValueFromMdParsedExtension,F as getWindowReferenceOptions,d as isAbsoluteUrl,R as isArrayOfObjects,U as isLastInArray,V as isLastProperty,C as isMergeableObject,b as isNumeric,x as joinStringFactory,y as mapValues,O as mapWithLast,B as normalizeText,M as removeQueryStringAndHash,I as resolveUrl,T as sanitizeItemId,p as stripTrailingSlash,L as titleize,P as unescapeHTMLChars,j as useSchemaTitle};
12
+ ${t}`}}const R=r=>Array.isArray(r)&&r.some(e=>i(e)),W=r=>r.filter(e=>!!e),C=r=>i(r)&&!Array.isArray(r);function d(r){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(r)}function I(r,e){let t;if(e.startsWith("//"))t=`${u(r,!0)?.protocol||"https:"}${e}`;else if(d(e))t=e;else if(!e.startsWith("/"))t=p(r)+"/"+e;else{const n=u(r);n?(n.pathname=e,t=n.toString()):t=e}return p(t)}function N(r){return r.charAt(0).toUpperCase()+r.slice(1)}function L(r){try{if(!r)return"";const e=new URL(r);return e.search="",e.hash="",e.toString()}catch{return r}}function M(r){return r.replace(/["\\]/g,"\\$&")}function P(r){return r.replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(parseInt(t,10))).replace(/&amp;/g,"&").replace(/&quot;/g,'"')}function T(r){return r&&r.replace(/#/g,"_").toLowerCase()}function j(r,e){return e||f(r)&&l.baseName(r)||""}function z(r={},e,t){return typeof e=="string"&&(e=e.split(".")),e.reduce((n,o)=>n&&n[o]?n[o]:t,r)}function x(r){return(...e)=>e.filter(Boolean).join(r)}const D=x(".");function F(r){return c?window?.REFERENCE_DOCS_OPTIONS?.[r]:null}function _(){if(!c)return"";const r=+new Date+Math.random();try{return(!document.currentScript||!(document.currentScript.async||document.currentScript.defer))&&document.write(`<script id="dummy${r}"></script>`),(document.getElementById("dummy"+r)?.previousSibling).src}catch{return""}}const B=r=>a(r)?r:r?.raw,H=(r,e)=>{const t=r?.[`x-parsed-md-${e}`]||r?.[e];if(!t)return;if(!r?.[`x-parsed-md-${e}`]&&e!=="x-enumDescriptions")return r?.[e];if(e!=="x-enumDescriptions")return m(r,e);let n={};for(const o in t)o.startsWith("x-parsed-md")||(n[o]=t?.[`x-parsed-md-${o}`]||t?.[o]);return Object.keys(n).length?n:t};function U(r){return r.name||r.description}function m(r,e){const t=r?.[`x-parsed-md-${e}`]||r?.[e];return t?.raw?t:{result:t?.result||r?.[e]?.result||r?.[e],raw:r?.[e]}}function V(r,e){return e===r.length-1}function v(r,e){const t=Object.keys(r);return t.indexOf(e)===t.length-1}export{E as appendToMdHeading,W as deleteEmptyArrayItem,D as dottedString,M as escapeHTMLAttrChars,A as flattenByProp,z as get,_ as getJsUrl,U as getServerDisplayName,H as getValueFromMdParsedExtension,F as getWindowReferenceOptions,d as isAbsoluteUrl,R as isArrayOfObjects,V as isLastInArray,v as isLastProperty,C as isMergeableObject,b as isNumeric,x as joinStringFactory,y as mapValues,O as mapWithLast,B as normalizeText,L as removeQueryStringAndHash,I as resolveUrl,T as sanitizeItemId,p as stripTrailingSlash,N as titleize,P as unescapeHTMLChars,j as useSchemaTitle};
@@ -1 +1 @@
1
- import{bundle as a,loadConfig as r}from"@redocly/openapi-core";import{combineUrls as s}from"@redocly/theme/core/openapi";import{convertSwagger2OpenAPI as c}from"./convertSwagger2OpenAPI.js";import{IS_BROWSER as t}from"./dom.js";import{REDOCLY_CONFIG_FILE as f}from"../constants.js";async function w(){const o=t?window.location.origin:typeof globalThis.process<"u"?globalThis.process.cwd():"";try{return(await r({configPath:s(o,f)}))?.resolvedConfig.openapi||{}}catch(n){return console.warn("Error loading redocly.yaml",n),{}}}async function b(o){const n=await r(),e={config:n,base:t?window.location.origin:typeof globalThis.process<"u"?globalThis.process.cwd():""};t&&(n.resolve.http.customFetch=globalThis.fetch),typeof o=="object"&&o!==null?e.doc=l(o):e.ref=o;const{bundle:{parsed:i}}=await a(e);return i.swagger!==void 0?c(i):i}function l(o){return{source:{absoluteRef:""},parsed:o}}export{b as loadAndBundleDefinition,w as loadOpenapiConfig};
1
+ import{bundle as a,loadConfig as r}from"@redocly/openapi-core";import{combineUrls as s}from"@redocly/theme/core/openapi";import{convertSwagger2OpenAPI as c}from"./convertSwagger2OpenAPI.js";import{IS_BROWSER as t}from"./dom.js";import{REDOCLY_CONFIG_FILE as f}from"../constants.js";async function w(){const o=t?window.location.origin:typeof globalThis.process<"u"?globalThis.process.cwd():"";try{return(await r({configPath:s(o,f)}))?.resolvedConfig.openapi||{}}catch{return{}}}async function b(o){const n=await r(),e={config:n,base:t?window.location.origin:typeof globalThis.process<"u"?globalThis.process.cwd():""};t&&(n.resolve.http.customFetch=globalThis.fetch),typeof o=="object"&&o!==null?e.doc=d(o):e.ref=o;const{bundle:{parsed:i}}=await a(e);return i.swagger!==void 0?c(i):i}function d(o){return{source:{absoluteRef:""},parsed:o}}export{b as loadAndBundleDefinition,w as loadOpenapiConfig};
@@ -0,0 +1,3 @@
1
+ export declare const MCP_SERVER_CAPABILITIES: string[];
2
+ export declare const MCP_SERVER_EXPERIMENTAL_CAPABILITIES = "experimental";
3
+ export declare const PAGE_ACTIONS_MCP: "mcp-cursor"[];
@@ -0,0 +1 @@
1
+ const o=["tools","resources","prompts","logging","subscribe","completions"],s="experimental",e=["mcp-cursor"];export{o as MCP_SERVER_CAPABILITIES,s as MCP_SERVER_EXPERIMENTAL_CAPABILITIES,e as PAGE_ACTIONS_MCP};
@@ -0,0 +1,2 @@
1
+ import type { IMenuItem } from '../services/types';
2
+ export declare function isRenderableMenuItem(item: IMenuItem): boolean;
@@ -0,0 +1 @@
1
+ function n(e){return e.type==="operation"||e.type==="schema"||e.type==="mcp"}export{n as isRenderableMenuItem};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-docs",
3
- "version": "3.14.0-next.13",
3
+ "version": "3.14.0-next.15",
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.2.2",
24
+ "@redocly/openapi-core": "2.3.1",
25
25
  "deepmerge": "^4.2.2",
26
26
  "dompurify": "3.2.7",
27
27
  "fast-deep-equal": "^3.1.3",
@@ -37,7 +37,7 @@
37
37
  "util": "~0.12.5",
38
38
  "web-vitals": "3.3.1",
39
39
  "@redocly/config": "0.35.0",
40
- "@redocly/replay": "0.17.0-next.12"
40
+ "@redocly/replay": "0.17.0-next.14"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@jest/globals": "29.5.0",
@@ -75,7 +75,7 @@
75
75
  "typescript": "5.6.2",
76
76
  "url": "~0.11.0",
77
77
  "vite": "6.3.6",
78
- "@redocly/theme": "0.58.0-next.9"
78
+ "@redocly/theme": "0.58.0-next.11"
79
79
  },
80
80
  "scripts": {
81
81
  "start": "npm run copy-highlight-hook && vite",