@redocly/openapi-docs 3.10.0-next.2 → 3.10.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.Examples=Examples,exports.getSerializedValue=getSerializedValue;const jsx_runtime_1=require("react/jsx-runtime"),common_1=require("../common"),utils_1=require("../../utils"),styled_1=require("./styled"),hooks_1=require("../../hooks");function Examples({field:e}){const s=(0,hooks_1.useTranslate)();return e.examples?(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[(0,jsx_runtime_1.jsxs)(common_1.FieldLabel,{children:[" ",s("openapi.examples","Examples"),": "]}),(0,jsx_runtime_1.jsx)(styled_1.ExamplesList,{children:Object.entries(e.examples).map((([s,r])=>{const i=(0,utils_1.normalizeText)(r.description);return(0,jsx_runtime_1.jsxs)(styled_1.ExampleWrap,{children:[(0,jsx_runtime_1.jsxs)(styled_1.ExampleSummary,{children:[(0,utils_1.normalizeText)(r.summary)||s," "]}),i&&(0,jsx_runtime_1.jsxs)(styled_1.ExampleDescription,{children:[i," "]}),(0,jsx_runtime_1.jsx)(common_1.ExampleValue,{children:getSerializedValue(e,r.value)})]},s)}))})]}):null}function getSerializedValue(e,s){return e.in?(0,utils_1.tryDecodeURIComponent)((0,utils_1.serializeParameterValue)(e,s)):s}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Examples=Examples,exports.getSerializedValue=getSerializedValue;const jsx_runtime_1=require("react/jsx-runtime"),common_1=require("../common"),utils_1=require("../../utils"),styled_1=require("./styled"),hooks_1=require("../../hooks"),Markdown_1=require("../Markdown");function Examples({field:e}){const r=(0,hooks_1.useTranslate)();return e.examples?(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[(0,jsx_runtime_1.jsxs)(common_1.FieldLabel,{children:[" ",r("openapi.examples","Examples"),": "]}),(0,jsx_runtime_1.jsx)(styled_1.ExamplesList,{children:Object.entries(e.examples).map((([r,s])=>{const i=(0,utils_1.normalizeText)(s.description);return(0,jsx_runtime_1.jsxs)(styled_1.ExampleWrap,{children:[(0,jsx_runtime_1.jsxs)(styled_1.ExampleSummary,{children:[(0,utils_1.normalizeText)(s.summary)||r," "]}),i&&(0,jsx_runtime_1.jsx)(Markdown_1.Markdown,{source:i}),(0,jsx_runtime_1.jsx)(common_1.ExampleValue,{children:getSerializedValue(e,s.value)})]},r)}))})]}):null}function getSerializedValue(e,r){return e.in?(0,utils_1.tryDecodeURIComponent)((0,utils_1.serializeParameterValue)(e,r)):r}
2
2
  //# sourceMappingURL=Examples.js.map
@@ -1,6 +1,5 @@
1
1
  export declare const DescriptionEnumsBlock: import("styled-components").StyledComponent<"main", any, import("@redocly/theme").MarkdownProps, never>;
2
2
  export declare const TypeWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const ExampleDescription: import("styled-components").StyledComponent<"div", any, {}, never>;
4
3
  export declare const ExampleSummary: import("styled-components").StyledComponent<"label", any, {}, never>;
5
4
  export declare const ExampleWrap: import("styled-components").StyledComponent<"div", any, {}, never>;
6
5
  export declare const ExamplesList: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,10 +1,10 @@
1
- "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FieldDescriptionWrapper=exports.ExamplesList=exports.ExampleWrap=exports.ExampleSummary=exports.ExampleDescription=exports.TypeWrapper=exports.DescriptionEnumsBlock=void 0;const styled_components_1=__importDefault(require("styled-components")),theme_1=require("@redocly/theme");exports.DescriptionEnumsBlock=(0,styled_components_1.default)(theme_1.Markdown)`
1
+ "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FieldDescriptionWrapper=exports.ExamplesList=exports.ExampleWrap=exports.ExampleSummary=exports.TypeWrapper=exports.DescriptionEnumsBlock=void 0;const styled_components_1=__importDefault(require("styled-components")),theme_1=require("@redocly/theme");exports.DescriptionEnumsBlock=(0,styled_components_1.default)(theme_1.Markdown)`
2
2
  table.md {
3
3
  margin: var(--spacing-xs) 0 0;
4
4
  }
5
5
  `,exports.TypeWrapper=styled_components_1.default.div`
6
6
  line-height: 20px;
7
- `,exports.ExampleDescription=styled_components_1.default.div``,exports.ExampleSummary=styled_components_1.default.label`
7
+ `,exports.ExampleSummary=styled_components_1.default.label`
8
8
  display: block;
9
9
  font-size: inherit;
10
10
  margin-bottom: 0.2em;
@@ -1,3 +1,3 @@
1
1
  export declare function useOtelTelemetry(): {
2
- send(action: "error" | "page.viewed" | "search.ai.query" | "search.query" | "search.result.clicked" | "openapi_docs.viewed" | "openapi_docs.performance_metrics" | "openapi_docs.download_definition.clicked" | "openapi_docs.select_language.clicked" | "openapi_docs.expand_collapse_all.clicked" | "openapi_docs.copy_code_snippet.clicked" | "openapi_docs.switch_servers.clicked" | "openapi_docs.examples_switcher.clicked" | "openapi_docs.try_it.opened" | "asyncapi_docs.performance_metrics" | "asyncapi_docs.viewed" | "asyncapi_docs.switch_message.clicked" | "asyncapi_docs.switch_example.clicked" | "asyncapi_docs.message.clicked", data: unknown): void;
2
+ send(action: "error" | "page.viewed" | "search.ai.query" | "search.query" | "feedback.sent" | "search.result.clicked" | "openapi_docs.viewed" | "openapi_docs.performance_metrics" | "openapi_docs.download_definition.clicked" | "openapi_docs.select_language.clicked" | "openapi_docs.expand_collapse_all.clicked" | "openapi_docs.copy_code_snippet.clicked" | "openapi_docs.switch_servers.clicked" | "openapi_docs.examples_switcher.clicked" | "openapi_docs.try_it.opened" | "asyncapi_docs.performance_metrics" | "asyncapi_docs.viewed" | "asyncapi_docs.switch_message.clicked" | "asyncapi_docs.switch_example.clicked" | "asyncapi_docs.message.clicked", data: unknown): void;
3
3
  };
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getValueFromMdParsedExtension=exports.normalizeText=exports.dottedString=exports.isMergeableObject=exports.deleteEmptyArrayItem=exports.isArrayOfObjects=void 0,exports.mapWithLast=mapWithLast,exports.mapValues=mapValues,exports.flattenByProp=flattenByProp,exports.stripTrailingSlash=stripTrailingSlash,exports.isNumeric=isNumeric,exports.appendToMdHeading=appendToMdHeading,exports.isAbsoluteUrl=isAbsoluteUrl,exports.resolveUrl=resolveUrl,exports.titleize=titleize,exports.removeQueryStringAndHash=removeQueryStringAndHash,exports.escapeHTMLAttrChars=escapeHTMLAttrChars,exports.unescapeHTMLChars=unescapeHTMLChars,exports.sanitizeItemId=sanitizeItemId,exports.useSchemaTitle=useSchemaTitle,exports.get=get,exports.joinStringFactory=joinStringFactory,exports.getWindowReferenceOptions=getWindowReferenceOptions,exports.getJsUrl=getJsUrl,exports.isLastInArray=isLastInArray,exports.isLastProperty=isLastProperty;const url_1=require("url"),theme_1=require("@redocly/theme"),openapi_1=require("./openapi"),JsonPointer_1=require("./JsonPointer");function mapWithLast(e,t){const r=[];for(let n=0;n<e.length-1;n++)r.push(t(e[n],!1));return 0!==e.length&&r.push(t(e[e.length-1],!0)),r}function mapValues(e,t){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=t(e[n],n,e));return r}function flattenByProp(e,t){const r=[],n=e=>{for(const s of e)r.push(s),s[t]&&n(s[t])};return n(e),r}function stripTrailingSlash(e){return e.endsWith("/")?e.substring(0,e.length-1):e}function isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}function appendToMdHeading(e,t,r){const n=new RegExp(`(^|\\n)#\\s?${t}\\s*\\n`,"i"),s=new RegExp(`((\\n|^)#\\s*${t}\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)`,"i");if(n.test(e))return e.replace(s,`$1\n\n${r}\n$4`);{const n=""===e||e.endsWith("\n\n")?"":e.endsWith("\n")?"\n":"\n\n";return`${e}${n}# ${t}\n\n${r}`}}const isArrayOfObjects=e=>Array.isArray(e)&&e.some((e=>(0,theme_1.isObject)(e)));exports.isArrayOfObjects=isArrayOfObjects;const deleteEmptyArrayItem=e=>e.filter((e=>!!e));exports.deleteEmptyArrayItem=deleteEmptyArrayItem;const isMergeableObject=e=>(0,theme_1.isObject)(e)&&!Array.isArray(e);function isAbsoluteUrl(e){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(e)}function resolveUrl(e,t){let r;if(t.startsWith("//")){const{protocol:n}=(0,url_1.parse)(e);r=`${n||"https:"}${t}`}else if(isAbsoluteUrl(t))r=t;else if(t.startsWith("/")){const n=(0,url_1.parse)(e);r=(0,url_1.format)(Object.assign(Object.assign({},n),{pathname:t}))}else r=stripTrailingSlash(e)+"/"+t;return stripTrailingSlash(r)}function titleize(e){return e.charAt(0).toUpperCase()+e.slice(1)}function removeQueryStringAndHash(e){try{const t=parseURL(e);return t.search="",t.hash="",t.toString()}catch(t){return e}}function parseURL(e){return"undefined"==typeof URL?new(require("url").URL)(e):new URL(e)}function escapeHTMLAttrChars(e){return e.replace(/["\\]/g,"\\$&")}function unescapeHTMLChars(e){return e.replace(/&#(\d+);/g,((e,t)=>String.fromCharCode(parseInt(t,10)))).replace(/&amp;/g,"&").replace(/&quot;/g,'"')}function sanitizeItemId(e){return e&&e.replace(/#/g,"_").toLowerCase()}function useSchemaTitle(e,t){return t||(0,openapi_1.isNamedDefinition)(e)&&JsonPointer_1.JsonPointer.baseName(e)||""}function get(e={},t,r){return"string"==typeof t&&(t=t.split(".")),t.reduce(((e,t)=>e&&e[t]?e[t]:r),e)}function joinStringFactory(e){return(...t)=>t.filter(Boolean).join(e)}function getWindowReferenceOptions(e){var t;return theme_1.IS_BROWSER?null===(t=null===window||void 0===window?void 0:window.REFERENCE_DOCS_OPTIONS)||void 0===t?void 0:t[e]:null}function getJsUrl(){var e;if(!theme_1.IS_BROWSER)return"";const t=+new Date+Math.random();try{return document.currentScript&&(document.currentScript.async||document.currentScript.defer)||document.write(`<script id="dummy${t}"><\/script>`),(null===(e=document.getElementById("dummy"+t))||void 0===e?void 0:e.previousSibling).src}catch(e){return""}}exports.isMergeableObject=isMergeableObject,exports.dottedString=joinStringFactory(".");const normalizeText=e=>(0,theme_1.isString)(e)?e:null==e?void 0:e.raw;exports.normalizeText=normalizeText;const getValueFromMdParsedExtension=(e,t)=>{const r=(null==e?void 0:e[`x-parsed-md-${t}`])||(null==e?void 0:e[t]);if(!(null==e?void 0:e[`x-parsed-md-${t}`]))return null==e?void 0:e[t];if("x-enumDescriptions"!==t)return normalizeMarkdownValue(e,t);let n={};for(const e in r)e.startsWith("x-parsed-md")||(n[e]=(null==r?void 0:r[`x-parsed-md-${e}`])||(null==r?void 0:r[e]));return Object.keys(n).length?n:r};function normalizeMarkdownValue(e,t){var r;const n=(null==e?void 0:e[`x-parsed-md-${t}`])||(null==e?void 0:e[t]);return(null==n?void 0:n.raw)?n:{result:(null==n?void 0:n.result)||(null===(r=null==e?void 0:e[t])||void 0===r?void 0:r.result)||(null==e?void 0:e[t]),raw:null==e?void 0:e[t]}}function isLastInArray(e,t){return t===e.length-1}function isLastProperty(e,t){const r=Object.keys(e);return r.indexOf(t)===r.length-1}exports.getValueFromMdParsedExtension=getValueFromMdParsedExtension;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getValueFromMdParsedExtension=exports.normalizeText=exports.dottedString=exports.isMergeableObject=exports.deleteEmptyArrayItem=exports.isArrayOfObjects=void 0,exports.mapWithLast=mapWithLast,exports.mapValues=mapValues,exports.flattenByProp=flattenByProp,exports.stripTrailingSlash=stripTrailingSlash,exports.isNumeric=isNumeric,exports.appendToMdHeading=appendToMdHeading,exports.isAbsoluteUrl=isAbsoluteUrl,exports.resolveUrl=resolveUrl,exports.titleize=titleize,exports.removeQueryStringAndHash=removeQueryStringAndHash,exports.escapeHTMLAttrChars=escapeHTMLAttrChars,exports.unescapeHTMLChars=unescapeHTMLChars,exports.sanitizeItemId=sanitizeItemId,exports.useSchemaTitle=useSchemaTitle,exports.get=get,exports.joinStringFactory=joinStringFactory,exports.getWindowReferenceOptions=getWindowReferenceOptions,exports.getJsUrl=getJsUrl,exports.isLastInArray=isLastInArray,exports.isLastProperty=isLastProperty;const url_1=require("url"),theme_1=require("@redocly/theme"),openapi_1=require("./openapi"),JsonPointer_1=require("./JsonPointer");function mapWithLast(e,t){const r=[];for(let n=0;n<e.length-1;n++)r.push(t(e[n],!1));return 0!==e.length&&r.push(t(e[e.length-1],!0)),r}function mapValues(e,t){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=t(e[n],n,e));return r}function flattenByProp(e,t){const r=[],n=e=>{for(const s of e)r.push(s),s[t]&&n(s[t])};return n(e),r}function stripTrailingSlash(e){return e.endsWith("/")?e.substring(0,e.length-1):e}function isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}function appendToMdHeading(e,t,r){const n=new RegExp(`(^|\\n)#\\s?${t}\\s*\\n`,"i"),s=new RegExp(`((\\n|^)#\\s*${t}\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)`,"i");if(n.test(e))return e.replace(s,`$1\n\n${r}\n$4`);{const n=""===e||e.endsWith("\n\n")?"":e.endsWith("\n")?"\n":"\n\n";return`${e}${n}# ${t}\n\n${r}`}}const isArrayOfObjects=e=>Array.isArray(e)&&e.some((e=>(0,theme_1.isObject)(e)));exports.isArrayOfObjects=isArrayOfObjects;const deleteEmptyArrayItem=e=>e.filter((e=>!!e));exports.deleteEmptyArrayItem=deleteEmptyArrayItem;const isMergeableObject=e=>(0,theme_1.isObject)(e)&&!Array.isArray(e);function isAbsoluteUrl(e){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(e)}function resolveUrl(e,t){let r;if(t.startsWith("//")){const{protocol:n}=(0,url_1.parse)(e);r=`${n||"https:"}${t}`}else if(isAbsoluteUrl(t))r=t;else if(t.startsWith("/")){const n=(0,url_1.parse)(e);r=(0,url_1.format)(Object.assign(Object.assign({},n),{pathname:t}))}else r=stripTrailingSlash(e)+"/"+t;return stripTrailingSlash(r)}function titleize(e){return e.charAt(0).toUpperCase()+e.slice(1)}function removeQueryStringAndHash(e){try{const t=parseURL(e);return t.search="",t.hash="",t.toString()}catch(t){return e}}function parseURL(e){return"undefined"==typeof URL?new(require("url").URL)(e):new URL(e)}function escapeHTMLAttrChars(e){return e.replace(/["\\]/g,"\\$&")}function unescapeHTMLChars(e){return e.replace(/&#(\d+);/g,((e,t)=>String.fromCharCode(parseInt(t,10)))).replace(/&amp;/g,"&").replace(/&quot;/g,'"')}function sanitizeItemId(e){return e&&e.replace(/#/g,"_").toLowerCase()}function useSchemaTitle(e,t){return t||(0,openapi_1.isNamedDefinition)(e)&&JsonPointer_1.JsonPointer.baseName(e)||""}function get(e={},t,r){return"string"==typeof t&&(t=t.split(".")),t.reduce(((e,t)=>e&&e[t]?e[t]:r),e)}function joinStringFactory(e){return(...t)=>t.filter(Boolean).join(e)}function getWindowReferenceOptions(e){var t;return theme_1.IS_BROWSER?null===(t=null===window||void 0===window?void 0:window.REFERENCE_DOCS_OPTIONS)||void 0===t?void 0:t[e]:null}function getJsUrl(){var e;if(!theme_1.IS_BROWSER)return"";const t=+new Date+Math.random();try{return document.currentScript&&(document.currentScript.async||document.currentScript.defer)||document.write(`<script id="dummy${t}"><\/script>`),(null===(e=document.getElementById("dummy"+t))||void 0===e?void 0:e.previousSibling).src}catch(e){return""}}exports.isMergeableObject=isMergeableObject,exports.dottedString=joinStringFactory(".");const normalizeText=e=>(0,theme_1.isString)(e)?e:null==e?void 0:e.raw;exports.normalizeText=normalizeText;const getValueFromMdParsedExtension=(e,t)=>{const r=(null==e?void 0:e[`x-parsed-md-${t}`])||(null==e?void 0:e[t]);if(!r)return;if(!(null==e?void 0:e[`x-parsed-md-${t}`])&&"x-enumDescriptions"!==t)return null==e?void 0:e[t];if("x-enumDescriptions"!==t)return normalizeMarkdownValue(e,t);let n={};for(const e in r)e.startsWith("x-parsed-md")||(n[e]=(null==r?void 0:r[`x-parsed-md-${e}`])||(null==r?void 0:r[e]));return Object.keys(n).length?n:r};function normalizeMarkdownValue(e,t){var r;const n=(null==e?void 0:e[`x-parsed-md-${t}`])||(null==e?void 0:e[t]);return(null==n?void 0:n.raw)?n:{result:(null==n?void 0:n.result)||(null===(r=null==e?void 0:e[t])||void 0===r?void 0:r.result)||(null==e?void 0:e[t]),raw:null==e?void 0:e[t]}}function isLastInArray(e,t){return t===e.length-1}function isLastProperty(e,t){const r=Object.keys(e);return r.indexOf(t)===r.length-1}exports.getValueFromMdParsedExtension=getValueFromMdParsedExtension;
2
2
  //# sourceMappingURL=helpers.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as _jsxs,jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import{ExampleValue,FieldLabel}from"../common";import{tryDecodeURIComponent,normalizeText,serializeParameterValue}from"../../utils";import{ExampleWrap,ExamplesList,ExampleSummary,ExampleDescription}from"./styled";import{useTranslate}from"../../hooks";export function Examples({field:e}){const r=useTranslate();return e.examples?_jsxs(_Fragment,{children:[_jsxs(FieldLabel,{children:[" ",r("openapi.examples","Examples"),": "]}),_jsx(ExamplesList,{children:Object.entries(e.examples).map((([r,a])=>{const l=normalizeText(a.description);return _jsxs(ExampleWrap,{children:[_jsxs(ExampleSummary,{children:[normalizeText(a.summary)||r," "]}),l&&_jsxs(ExampleDescription,{children:[l," "]}),_jsx(ExampleValue,{children:getSerializedValue(e,a.value)})]},r)}))})]}):null}export function getSerializedValue(e,r){return e.in?tryDecodeURIComponent(serializeParameterValue(e,r)):r}
1
+ import{jsxs as _jsxs,jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import{ExampleValue,FieldLabel}from"../common";import{tryDecodeURIComponent,normalizeText,serializeParameterValue}from"../../utils";import{ExampleWrap,ExamplesList,ExampleSummary}from"./styled";import{useTranslate}from"../../hooks";import{Markdown}from"../Markdown";export function Examples({field:e}){const r=useTranslate();return e.examples?_jsxs(_Fragment,{children:[_jsxs(FieldLabel,{children:[" ",r("openapi.examples","Examples"),": "]}),_jsx(ExamplesList,{children:Object.entries(e.examples).map((([r,a])=>{const m=normalizeText(a.description);return _jsxs(ExampleWrap,{children:[_jsxs(ExampleSummary,{children:[normalizeText(a.summary)||r," "]}),m&&_jsx(Markdown,{source:m}),_jsx(ExampleValue,{children:getSerializedValue(e,a.value)})]},r)}))})]}):null}export function getSerializedValue(e,r){return e.in?tryDecodeURIComponent(serializeParameterValue(e,r)):r}
2
2
  //# sourceMappingURL=Examples.js.map
@@ -1,6 +1,5 @@
1
1
  export declare const DescriptionEnumsBlock: import("styled-components").StyledComponent<"main", any, import("@redocly/theme").MarkdownProps, never>;
2
2
  export declare const TypeWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const ExampleDescription: import("styled-components").StyledComponent<"div", any, {}, never>;
4
3
  export declare const ExampleSummary: import("styled-components").StyledComponent<"label", any, {}, never>;
5
4
  export declare const ExampleWrap: import("styled-components").StyledComponent<"div", any, {}, never>;
6
5
  export declare const ExamplesList: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -4,7 +4,7 @@ import styled from"styled-components";import{Markdown as MarkdownWrapper}from"@r
4
4
  }
5
5
  `;export const TypeWrapper=styled.div`
6
6
  line-height: 20px;
7
- `;export const ExampleDescription=styled.div``;export const ExampleSummary=styled.label`
7
+ `;export const ExampleSummary=styled.label`
8
8
  display: block;
9
9
  font-size: inherit;
10
10
  margin-bottom: 0.2em;
@@ -1,3 +1,3 @@
1
1
  export declare function useOtelTelemetry(): {
2
- send(action: "error" | "page.viewed" | "search.ai.query" | "search.query" | "search.result.clicked" | "openapi_docs.viewed" | "openapi_docs.performance_metrics" | "openapi_docs.download_definition.clicked" | "openapi_docs.select_language.clicked" | "openapi_docs.expand_collapse_all.clicked" | "openapi_docs.copy_code_snippet.clicked" | "openapi_docs.switch_servers.clicked" | "openapi_docs.examples_switcher.clicked" | "openapi_docs.try_it.opened" | "asyncapi_docs.performance_metrics" | "asyncapi_docs.viewed" | "asyncapi_docs.switch_message.clicked" | "asyncapi_docs.switch_example.clicked" | "asyncapi_docs.message.clicked", data: unknown): void;
2
+ send(action: "error" | "page.viewed" | "search.ai.query" | "search.query" | "feedback.sent" | "search.result.clicked" | "openapi_docs.viewed" | "openapi_docs.performance_metrics" | "openapi_docs.download_definition.clicked" | "openapi_docs.select_language.clicked" | "openapi_docs.expand_collapse_all.clicked" | "openapi_docs.copy_code_snippet.clicked" | "openapi_docs.switch_servers.clicked" | "openapi_docs.examples_switcher.clicked" | "openapi_docs.try_it.opened" | "asyncapi_docs.performance_metrics" | "asyncapi_docs.viewed" | "asyncapi_docs.switch_message.clicked" | "asyncapi_docs.switch_example.clicked" | "asyncapi_docs.message.clicked", data: unknown): void;
3
3
  };
@@ -1,2 +1,2 @@
1
- import{format,parse}from"url";import{IS_BROWSER,isObject,isString}from"@redocly/theme";import{isNamedDefinition}from"./openapi";import{JsonPointer}from"./JsonPointer";export function mapWithLast(t,e){const r=[];for(let n=0;n<t.length-1;n++)r.push(e(t[n],!1));return 0!==t.length&&r.push(e(t[t.length-1],!0)),r}export function mapValues(t,e){const r={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=e(t[n],n,t));return r}export function flattenByProp(t,e){const r=[],n=t=>{for(const o of t)r.push(o),o[e]&&n(o[e])};return n(t),r}export function stripTrailingSlash(t){return t.endsWith("/")?t.substring(0,t.length-1):t}export function isNumeric(t){return!isNaN(parseFloat(t))&&isFinite(t)}export function appendToMdHeading(t,e,r){const n=new RegExp(`(^|\\n)#\\s?${e}\\s*\\n`,"i"),o=new RegExp(`((\\n|^)#\\s*${e}\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)`,"i");if(n.test(t))return t.replace(o,`$1\n\n${r}\n$4`);{const n=""===t||t.endsWith("\n\n")?"":t.endsWith("\n")?"\n":"\n\n";return`${t}${n}# ${e}\n\n${r}`}}export const isArrayOfObjects=t=>Array.isArray(t)&&t.some((t=>isObject(t)));export const deleteEmptyArrayItem=t=>t.filter((t=>!!t));export const isMergeableObject=t=>isObject(t)&&!Array.isArray(t);export function isAbsoluteUrl(t){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(t)}export function resolveUrl(t,e){let r;if(e.startsWith("//")){const{protocol:n}=parse(t);r=`${n||"https:"}${e}`}else if(isAbsoluteUrl(e))r=e;else if(e.startsWith("/")){const n=parse(t);r=format(Object.assign(Object.assign({},n),{pathname:e}))}else r=stripTrailingSlash(t)+"/"+e;return stripTrailingSlash(r)}export function titleize(t){return t.charAt(0).toUpperCase()+t.slice(1)}export function removeQueryStringAndHash(t){try{const e=parseURL(t);return e.search="",e.hash="",e.toString()}catch(e){return t}}function parseURL(t){return"undefined"==typeof URL?new(require("url").URL)(t):new URL(t)}export function escapeHTMLAttrChars(t){return t.replace(/["\\]/g,"\\$&")}export function unescapeHTMLChars(t){return t.replace(/&#(\d+);/g,((t,e)=>String.fromCharCode(parseInt(e,10)))).replace(/&amp;/g,"&").replace(/&quot;/g,'"')}export function sanitizeItemId(t){return t&&t.replace(/#/g,"_").toLowerCase()}export function useSchemaTitle(t,e){return e||isNamedDefinition(t)&&JsonPointer.baseName(t)||""}export function get(t={},e,r){return"string"==typeof e&&(e=e.split(".")),e.reduce(((t,e)=>t&&t[e]?t[e]:r),t)}export function joinStringFactory(t){return(...e)=>e.filter(Boolean).join(t)}export const dottedString=joinStringFactory(".");export function getWindowReferenceOptions(t){var e;return IS_BROWSER?null===(e=null===window||void 0===window?void 0:window.REFERENCE_DOCS_OPTIONS)||void 0===e?void 0:e[t]:null}export function getJsUrl(){var t;if(!IS_BROWSER)return"";const e=+new Date+Math.random();try{return document.currentScript&&(document.currentScript.async||document.currentScript.defer)||document.write(`<script id="dummy${e}"><\/script>`),(null===(t=document.getElementById("dummy"+e))||void 0===t?void 0:t.previousSibling).src}catch(t){return""}}export const normalizeText=t=>isString(t)?t:null==t?void 0:t.raw;export const getValueFromMdParsedExtension=(t,e)=>{const r=(null==t?void 0:t[`x-parsed-md-${e}`])||(null==t?void 0:t[e]);if(!(null==t?void 0:t[`x-parsed-md-${e}`]))return null==t?void 0:t[e];if("x-enumDescriptions"!==e)return normalizeMarkdownValue(t,e);let n={};for(const t in r)t.startsWith("x-parsed-md")||(n[t]=(null==r?void 0:r[`x-parsed-md-${t}`])||(null==r?void 0:r[t]));return Object.keys(n).length?n:r};function normalizeMarkdownValue(t,e){var r;const n=(null==t?void 0:t[`x-parsed-md-${e}`])||(null==t?void 0:t[e]);return(null==n?void 0:n.raw)?n:{result:(null==n?void 0:n.result)||(null===(r=null==t?void 0:t[e])||void 0===r?void 0:r.result)||(null==t?void 0:t[e]),raw:null==t?void 0:t[e]}}export function isLastInArray(t,e){return e===t.length-1}export function isLastProperty(t,e){const r=Object.keys(t);return r.indexOf(e)===r.length-1}
1
+ import{format,parse}from"url";import{IS_BROWSER,isObject,isString}from"@redocly/theme";import{isNamedDefinition}from"./openapi";import{JsonPointer}from"./JsonPointer";export function mapWithLast(t,e){const r=[];for(let n=0;n<t.length-1;n++)r.push(e(t[n],!1));return 0!==t.length&&r.push(e(t[t.length-1],!0)),r}export function mapValues(t,e){const r={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=e(t[n],n,t));return r}export function flattenByProp(t,e){const r=[],n=t=>{for(const o of t)r.push(o),o[e]&&n(o[e])};return n(t),r}export function stripTrailingSlash(t){return t.endsWith("/")?t.substring(0,t.length-1):t}export function isNumeric(t){return!isNaN(parseFloat(t))&&isFinite(t)}export function appendToMdHeading(t,e,r){const n=new RegExp(`(^|\\n)#\\s?${e}\\s*\\n`,"i"),o=new RegExp(`((\\n|^)#\\s*${e}\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)`,"i");if(n.test(t))return t.replace(o,`$1\n\n${r}\n$4`);{const n=""===t||t.endsWith("\n\n")?"":t.endsWith("\n")?"\n":"\n\n";return`${t}${n}# ${e}\n\n${r}`}}export const isArrayOfObjects=t=>Array.isArray(t)&&t.some((t=>isObject(t)));export const deleteEmptyArrayItem=t=>t.filter((t=>!!t));export const isMergeableObject=t=>isObject(t)&&!Array.isArray(t);export function isAbsoluteUrl(t){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(t)}export function resolveUrl(t,e){let r;if(e.startsWith("//")){const{protocol:n}=parse(t);r=`${n||"https:"}${e}`}else if(isAbsoluteUrl(e))r=e;else if(e.startsWith("/")){const n=parse(t);r=format(Object.assign(Object.assign({},n),{pathname:e}))}else r=stripTrailingSlash(t)+"/"+e;return stripTrailingSlash(r)}export function titleize(t){return t.charAt(0).toUpperCase()+t.slice(1)}export function removeQueryStringAndHash(t){try{const e=parseURL(t);return e.search="",e.hash="",e.toString()}catch(e){return t}}function parseURL(t){return"undefined"==typeof URL?new(require("url").URL)(t):new URL(t)}export function escapeHTMLAttrChars(t){return t.replace(/["\\]/g,"\\$&")}export function unescapeHTMLChars(t){return t.replace(/&#(\d+);/g,((t,e)=>String.fromCharCode(parseInt(e,10)))).replace(/&amp;/g,"&").replace(/&quot;/g,'"')}export function sanitizeItemId(t){return t&&t.replace(/#/g,"_").toLowerCase()}export function useSchemaTitle(t,e){return e||isNamedDefinition(t)&&JsonPointer.baseName(t)||""}export function get(t={},e,r){return"string"==typeof e&&(e=e.split(".")),e.reduce(((t,e)=>t&&t[e]?t[e]:r),t)}export function joinStringFactory(t){return(...e)=>e.filter(Boolean).join(t)}export const dottedString=joinStringFactory(".");export function getWindowReferenceOptions(t){var e;return IS_BROWSER?null===(e=null===window||void 0===window?void 0:window.REFERENCE_DOCS_OPTIONS)||void 0===e?void 0:e[t]:null}export function getJsUrl(){var t;if(!IS_BROWSER)return"";const e=+new Date+Math.random();try{return document.currentScript&&(document.currentScript.async||document.currentScript.defer)||document.write(`<script id="dummy${e}"><\/script>`),(null===(t=document.getElementById("dummy"+e))||void 0===t?void 0:t.previousSibling).src}catch(t){return""}}export const normalizeText=t=>isString(t)?t:null==t?void 0:t.raw;export const getValueFromMdParsedExtension=(t,e)=>{const r=(null==t?void 0:t[`x-parsed-md-${e}`])||(null==t?void 0:t[e]);if(!r)return;if(!(null==t?void 0:t[`x-parsed-md-${e}`])&&"x-enumDescriptions"!==e)return null==t?void 0:t[e];if("x-enumDescriptions"!==e)return normalizeMarkdownValue(t,e);let n={};for(const t in r)t.startsWith("x-parsed-md")||(n[t]=(null==r?void 0:r[`x-parsed-md-${t}`])||(null==r?void 0:r[t]));return Object.keys(n).length?n:r};function normalizeMarkdownValue(t,e){var r;const n=(null==t?void 0:t[`x-parsed-md-${e}`])||(null==t?void 0:t[e]);return(null==n?void 0:n.raw)?n:{result:(null==n?void 0:n.result)||(null===(r=null==t?void 0:t[e])||void 0===r?void 0:r.result)||(null==t?void 0:t[e]),raw:null==t?void 0:t[e]}}export function isLastInArray(t,e){return e===t.length-1}export function isLastProperty(t,e){const r=Object.keys(t);return r.indexOf(e)===r.length-1}
2
2
  //# sourceMappingURL=helpers.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-docs",
3
- "version": "3.10.0-next.2",
3
+ "version": "3.10.0-next.4",
4
4
  "description": "Redocly OpenAPI Docs",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -46,7 +46,7 @@
46
46
  "util": "~0.12.5",
47
47
  "web-vitals": "3.3.1",
48
48
  "@redocly/config": "0.24.1",
49
- "@redocly/replay": "0.13.0-next.2"
49
+ "@redocly/replay": "0.13.0-next.3"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@shikijs/transformers": "1.24.0",
@@ -92,7 +92,7 @@
92
92
  "webpack": "5.94.0",
93
93
  "webpack-cli": "5.1.4",
94
94
  "webpack-dev-server": "5.1.0",
95
- "@redocly/theme": "0.54.0-next.2"
95
+ "@redocly/theme": "0.54.0-next.3"
96
96
  },
97
97
  "scripts": {
98
98
  "start": "npm run copy-highlight-hook && webpack serve --mode=development --hot",