@redocly/reference-docs 2.11.8 → 2.11.12
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/bin/cli/commands/redocly-docs-cli.min.js +45 -25
- package/bin/cli/commands/redocly-docs-cli.min.js.LICENSE.txt +1 -1
- package/dist/console.redocly-reference-docs.min.js +43 -43
- package/dist/oauth2-redirect.js +1 -1
- package/dist/redocly-reference-docs.min.js +362 -342
- package/lib/components/RedoclyReferenceDocs.js +1 -1
- package/lib/components/common/Dropdown/Dropdown.js +1 -1
- package/lib/components/common/Dropdown/styled.js +1 -1
- package/lib/components/common/Dropdown/types.d.ts +0 -1
- package/lib/components/console/AuthPanel.js +1 -1
- package/lib/components/styled.elements.d.ts +1 -1
- package/lib/components/styled.elements.js +1 -1
- package/lib/redoc-lib/src/components/Markdown/Markdown.js +1 -1
- package/lib/redoc-lib/src/components/Schema/DiscriminatorDropdown.js +1 -1
- package/lib/redoc-lib/src/services/MarkdownRenderer.js +1 -1
- package/lib/redoc-lib/src/services/RedocNormalizedOptions.d.ts +0 -2
- package/lib/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
- package/lib/services/ProStore.d.ts +0 -1
- package/lib/services/ProStore.js +1 -1
- package/lib-esm/components/RedoclyReferenceDocs.js +1 -1
- package/lib-esm/components/common/Dropdown/Dropdown.js +1 -1
- package/lib-esm/components/common/Dropdown/styled.js +1 -1
- package/lib-esm/components/common/Dropdown/types.d.ts +0 -1
- package/lib-esm/components/console/AuthPanel.js +1 -1
- package/lib-esm/components/styled.elements.d.ts +1 -1
- package/lib-esm/components/styled.elements.js +1 -1
- package/lib-esm/redoc-lib/src/components/Markdown/Markdown.js +1 -1
- package/lib-esm/redoc-lib/src/components/Schema/DiscriminatorDropdown.js +1 -1
- package/lib-esm/redoc-lib/src/services/MarkdownRenderer.js +1 -1
- package/lib-esm/redoc-lib/src/services/RedocNormalizedOptions.d.ts +0 -2
- package/lib-esm/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
- package/lib-esm/services/ProStore.d.ts +0 -1
- package/lib-esm/services/ProStore.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject}from"tslib";import styled,{css}from"styled-components";import{Dropdown as DropdownComponent}from"./Dropdown";var templateObject_1,templateObject_2,templateObject_3,templateObject_4,templateObject_5,darkDropdownStyle=css(templateObject_1||(templateObject_1=__makeTemplateObject(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &,\n &:hover,\n &:focus-within {\n border: none;\n box-shadow: none;\n }\n"],["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &,\n &:hover,\n &:focus-within {\n border: none;\n box-shadow: none;\n }\n"])),(function(n){return n.theme.rightPanel.panelControlsBackgroundColor}),(function(n){return n.theme.rightPanel.panelControlsBackgroundColor}),(function(n){return n.theme.colors.text.light}));export var Dropdown=styled(DropdownComponent)(templateObject_2||(templateObject_2=__makeTemplateObject(["\n box-sizing: border-box;\n outline: none;\n display: inline-block;\n border-radius: ",";\n vertical-align: bottom;\n position: relative;\n width: ",";\n cursor: pointer;\n text-transform: none;\n\n
|
|
1
|
+
import{__makeTemplateObject}from"tslib";import styled,{css}from"styled-components";import{Dropdown as DropdownComponent}from"./Dropdown";var templateObject_1,templateObject_2,templateObject_3,templateObject_4,templateObject_5,darkDropdownStyle=css(templateObject_1||(templateObject_1=__makeTemplateObject(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &,\n &:hover,\n &:focus-within {\n border: none;\n box-shadow: none;\n }\n"],["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &,\n &:hover,\n &:focus-within {\n border: none;\n box-shadow: none;\n }\n"])),(function(n){return n.theme.rightPanel.panelControlsBackgroundColor}),(function(n){return n.theme.rightPanel.panelControlsBackgroundColor}),(function(n){return n.theme.colors.text.light}));export var Dropdown=styled(DropdownComponent)(templateObject_2||(templateObject_2=__makeTemplateObject(["\n box-sizing: border-box;\n outline: none;\n display: inline-block;\n border-radius: ",";\n vertical-align: bottom;\n position: relative;\n width: ",";\n cursor: pointer;\n text-transform: none;\n\n label {\n box-sizing: border-box;\n min-width: 90px;\n outline: none;\n display: inline-block;\n color: ",";\n border-radius: ",";\n padding: ",";\n vertical-align: bottom;\n width: ",";\n text-transform: none;\n\n line-height: inherit;\n font-size: 14px;\n font-family: inherit;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n\n &,\n &:hover,\n &:focus-within {\n border: 1px solid ",";\n box-shadow: none;\n }\n\n ",";\n }\n\n .dropdown-select {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n border: none;\n appearance: none;\n cursor: pointer;\n\n color: ",";\n line-height: inherit;\n font-size: 14px;\n font-family: inherit;\n padding: ",";\n ",";\n }\n"],["\n box-sizing: border-box;\n outline: none;\n display: inline-block;\n border-radius: ",";\n vertical-align: bottom;\n position: relative;\n width: ",";\n cursor: pointer;\n text-transform: none;\n\n label {\n box-sizing: border-box;\n min-width: 90px;\n outline: none;\n display: inline-block;\n color: ",";\n border-radius: ",";\n padding: ",";\n vertical-align: bottom;\n width: ",";\n text-transform: none;\n\n line-height: inherit;\n font-size: 14px;\n font-family: inherit;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n\n &,\n &:hover,\n &:focus-within {\n border: 1px solid ",";\n box-shadow: none;\n }\n\n ",";\n }\n\n .dropdown-select {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n border: none;\n appearance: none;\n cursor: pointer;\n\n color: ",";\n line-height: inherit;\n font-size: 14px;\n font-family: inherit;\n padding: ",";\n ",";\n }\n"])),(function(n){return n.theme.shape.borderRadius}),(function(n){return n.fullWidth?"100%":"auto"}),(function(n){return n.theme.colors.text.primary}),(function(n){return n.theme.shape.borderRadius}),(function(n){return n.dense?"2px 24px 2px 8px":"8px 26px 8px 10px"}),(function(n){return n.fullWidth?"100%":"auto"}),(function(n){return n.theme.colors.border.light}),(function(n){return"dark"===n.variant?darkDropdownStyle:""}),(function(n){return n.theme.colors.text.primary}),(function(n){return n.dense?"2px 24px 2px 8px":"8px 26px 8px 10px"}),(function(n){return"dark"===n.variant?darkDropdownStyle:""}));export var SimpleDropdown=styled(Dropdown)(templateObject_3||(templateObject_3=__makeTemplateObject(["\n svg {\n top: 60%;\n transform: translateY(-60%);\n }\n label {\n padding: 0 26px 0 4px;\n border: none;\n background: transparent;\n font-size: 14px;\n font-weight: 400;\n appearance: none;\n\n &:hover,\n &:focus-within {\n border: none;\n box-shadow: none;\n }\n }\n"],["\n svg {\n top: 60%;\n transform: translateY(-60%);\n }\n label {\n padding: 0 26px 0 4px;\n border: none;\n background: transparent;\n font-size: 14px;\n font-weight: 400;\n appearance: none;\n\n &:hover,\n &:focus-within {\n border: none;\n box-shadow: none;\n }\n }\n"])));export var CollapsingDropdown=styled(Dropdown)(templateObject_4||(templateObject_4=__makeTemplateObject(["\n svg {\n top: 60%;\n transform: translateY(-60%);\n }\n label {\n ",";\n\n height: 40px;\n border-radius: 0 "," 0 0;\n margin: 0 0 -4px;\n transition: none;\n min-width: auto;\n background: ",";\n & {\n border-bottom: 4px solid\n ",";\n\n &[open],\n &:focus-within,\n &:hover {\n background: ",";\n border-bottom: 4px solid\n ",";\n }\n }\n }\n"],["\n svg {\n top: 60%;\n transform: translateY(-60%);\n }\n label {\n ",";\n\n height: 40px;\n border-radius: 0 "," 0 0;\n margin: 0 0 -4px;\n transition: none;\n min-width: auto;\n background: ",";\n & {\n border-bottom: 4px solid\n ",";\n\n &[open],\n &:focus-within,\n &:hover {\n background: ",";\n border-bottom: 4px solid\n ",";\n }\n }\n }\n"])),darkDropdownStyle,(function(n){return n.theme.shape.borderRadius}),(function(n){var e=n.theme;return n.active?e.colors.border.dark:"none"}),(function(n){var e=n.active,o=n.theme;return e?o.colors.accent.main:"transparent"}),(function(n){return n.theme.colors.border.dark}),(function(n){var e=n.active,o=n.theme;return e?o.colors.accent.main:"transparent"}));export var VersionDropdown=styled(Dropdown)(templateObject_5||(templateObject_5=__makeTemplateObject(["\n width: 90%;\n label {\n width: 100%;\n font-weight: 600;\n color: ",";\n }\n"],["\n width: 90%;\n label {\n width: 100%;\n font-weight: 600;\n color: ",";\n }\n"])),(function(n){return n.theme.colors.text.primary}));
|
|
2
2
|
//# sourceMappingURL=styled.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign,__extends}from"tslib";import*as React from"react";import{fromSessionStorage,getSecurityDetailsOptions,toSessionStorage,escapeFormId}from"../../utils";import OAuth2TokenInput from"./OAuth2TokenInput";import{OAuth2Flow}from"./OAuth2Flow";import{OpenIDConnect}from"./OpenIDConnect";import{FormDropdown,FormTextField}from"../common/TextField";import{FormControl,FormLabel,FormWrapper}from"../common/form";import{l}from"../../redoc-lib/src/services/Labels";import{Dropdown}from"../common/Dropdown";export function requiredValidator(e){if(!e)return"Field is required"}var getCookie=function(e){var t=document.cookie.match("\\b"+e+"=([^;]*)\\b");return t?t[1]:void 0};function fromCookie(e){if("cookie"===e.in)return getCookie(e.name)}var AuthPanel=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"state",{enumerable:!0,configurable:!0,writable:!0,value:{activeScheme:0}}),Object.defineProperty(t,"handleSchemeChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){t.setState({activeScheme:e.idx}),toSessionStorage("securityRequirementName",e.value)}}),t}return __extends(t,e),Object.defineProperty(t,"getDerivedStateFromProps",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.operation.security.map((function(e){return e.schemes.map((function(e){return e.id})).join(" and ")})),r=fromSessionStorage("securityRequirementName"),o=t.findIndex((function(e){return e===r}));return{activeScheme:o<0?0:o}}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.props.securityDefaults,r=this.state.activeScheme,o=this.props.operation.security,a=o.map((function(e){return e.schemes.map((function(e){return e.id})).join(" and ")})).map((function(e,t){return{value:e,idx:t}}));return 0===a.length?null:React.createElement(React.Fragment,null,React.createElement(FormWrapper,null,a.length>1&&React.createElement(FormControl,null,React.createElement(FormLabel,null," Security scheme: "),React.createElement(Dropdown,{variant:"dark",fullWidth:!0,options:a,value:a[r].value,onChange:this.handleSchemeChange}))||null,o[r].schemes.map((function(r){var o,a,n,i,u,s,c,m=escapeFormId(r.id);if("apiKey"===r.type){var d=getSecurityDetailsOptions(m,""),p={field:"auth."+m,fullWidth:!0,initialValue:fromCookie(r)||fromSessionStorage("auth."+m)||(null==t?void 0:t[m]),initValue:fromCookie(r)||fromSessionStorage("auth."+m)||(null==t?void 0:t[m]),validate:requiredValidator,validateOnBlur:!0,validateOnChange:!0};return React.createElement(FormControl,{key:m},React.createElement(FormLabel,null," ",r.name,": "),d?React.createElement(FormDropdown,__assign({},p,{options:d})):React.createElement(FormTextField,__assign({},p,{type:"password","data-cy":"apiKey-auth-password"})))}if("http"===r.type){if("basic"===r.scheme){var f=getSecurityDetailsOptions(m,"username");p={field:"auth."+m+".username",fullWidth:!0,initialValue:fromSessionStorage("auth."+m+".username")||(null===(o=null==t?void 0:t[m])||void 0===o?void 0:o.username),initValue:fromSessionStorage("auth."+m+".username")||(null===(a=null==t?void 0:t[m])||void 0===a?void 0:a.username),validate:requiredValidator,validateOnBlur:!0,validateOnChange:!0};return React.createElement(React.Fragment,{key:m},React.createElement(FormControl,null,React.createElement(FormLabel,null," ",l("tryItAuthBasicUsername"),": "),f?React.createElement(FormDropdown,__assign({},p,{options:f})):React.createElement(FormTextField,__assign({},p))),React.createElement(FormControl,null,React.createElement(FormLabel,null," ",l("tryItAuthBasicPassword"),": "),React.createElement(FormTextField,{type:"password","data-cy":"http-auth-password",fullWidth:!0,field:"auth."+m+".password",
|
|
1
|
+
import{__assign,__extends}from"tslib";import*as React from"react";import{fromSessionStorage,getSecurityDetailsOptions,toSessionStorage,escapeFormId}from"../../utils";import OAuth2TokenInput from"./OAuth2TokenInput";import{OAuth2Flow}from"./OAuth2Flow";import{OpenIDConnect}from"./OpenIDConnect";import{FormDropdown,FormTextField}from"../common/TextField";import{FormControl,FormLabel,FormWrapper}from"../common/form";import{l}from"../../redoc-lib/src/services/Labels";import{Dropdown}from"../common/Dropdown";export function requiredValidator(e){if(!e)return"Field is required"}var getCookie=function(e){var t=document.cookie.match("\\b"+e+"=([^;]*)\\b");return t?t[1]:void 0};function fromCookie(e){if("cookie"===e.in)return getCookie(e.name)}var AuthPanel=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"state",{enumerable:!0,configurable:!0,writable:!0,value:{activeScheme:0}}),Object.defineProperty(t,"handleSchemeChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){t.setState({activeScheme:e.idx}),toSessionStorage("securityRequirementName",e.value)}}),t}return __extends(t,e),Object.defineProperty(t,"getDerivedStateFromProps",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.operation.security.map((function(e){return e.schemes.map((function(e){return e.id})).join(" and ")})),r=fromSessionStorage("securityRequirementName"),o=t.findIndex((function(e){return e===r}));return{activeScheme:o<0?0:o}}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.props.securityDefaults,r=this.state.activeScheme,o=this.props.operation.security,a=o.map((function(e){return e.schemes.map((function(e){return e.id})).join(" and ")})).map((function(e,t){return{value:e,idx:t}}));return 0===a.length?null:React.createElement(React.Fragment,null,React.createElement(FormWrapper,null,a.length>1&&React.createElement(FormControl,null,React.createElement(FormLabel,null," Security scheme: "),React.createElement(Dropdown,{variant:"dark",fullWidth:!0,options:a,value:a[r].value,onChange:this.handleSchemeChange}))||null,o[r].schemes.map((function(r){var o,a,n,i,u,s,c,m=escapeFormId(r.id);if("apiKey"===r.type){var d=getSecurityDetailsOptions(m,""),p={field:"auth."+m,fullWidth:!0,initialValue:fromCookie(r)||fromSessionStorage("auth."+m)||(null==t?void 0:t[m]),initValue:fromCookie(r)||fromSessionStorage("auth."+m)||(null==t?void 0:t[m]),validate:requiredValidator,validateOnBlur:!0,validateOnChange:!0};return React.createElement(FormControl,{key:m},React.createElement(FormLabel,null," ",r.name,": "),d?React.createElement(FormDropdown,__assign({},p,{options:d})):React.createElement(FormTextField,__assign({},p,{type:"password","data-cy":"apiKey-auth-password"})))}if("http"===r.type){if("basic"===r.scheme){var f=getSecurityDetailsOptions(m,"username");p={field:"auth."+m+".username",fullWidth:!0,initialValue:fromSessionStorage("auth."+m+".username")||(null===(o=null==t?void 0:t[m])||void 0===o?void 0:o.username),initValue:fromSessionStorage("auth."+m+".username")||(null===(a=null==t?void 0:t[m])||void 0===a?void 0:a.username),validate:requiredValidator,validateOnBlur:!0,validateOnChange:!0};return React.createElement(React.Fragment,{key:m},React.createElement(FormControl,null,React.createElement(FormLabel,null," ",l("tryItAuthBasicUsername"),": "),f?React.createElement(FormDropdown,__assign({},p,{options:f})):React.createElement(FormTextField,__assign({},p))),React.createElement(FormControl,null,React.createElement(FormLabel,null," ",l("tryItAuthBasicPassword"),": "),React.createElement(FormTextField,{type:"password","data-cy":"http-auth-password",fullWidth:!0,field:"auth."+m+".password",initialValue:fromSessionStorage("auth."+m+".password")||(null===(n=null==t?void 0:t[m])||void 0===n?void 0:n.password)||"",validateOnBlur:!0,validateOnChange:!0})))}if("bearer"===r.scheme){var h=getSecurityDetailsOptions(m,"");p={field:"auth."+m,fullWidth:!0,initialValue:fromSessionStorage("auth."+m)||(null==t?void 0:t[m]),initValue:fromSessionStorage("auth."+m)||(null==t?void 0:t[m]),validate:requiredValidator,validateOnBlur:!0,validateOnChange:!0};return React.createElement(React.Fragment,{key:m},React.createElement(FormControl,null,React.createElement(FormLabel,null," Bearer Token: "),h?React.createElement(FormDropdown,__assign({},p,{options:h})):React.createElement(FormTextField,__assign({},p,{type:"password",placeholder:"(without 'Bearer')"}))))}}else{if("oauth2"===r.type&&r.flows&&r.flows.clientCredentials)return React.createElement(OAuth2TokenInput,{key:m,flow:r.flows.clientCredentials,server:e.props.activeServer,authCorsProxyUrl:e.props.authCorsProxyUrl,id:m,form:e.props.form,formApi:e.props.formApi,clientId:r.flows.clientCredentials["x-defaultClientId"]||r["x-defaultClientId"],defaultValues:null==t?void 0:t[m]});if("oauth2"===r.type&&r.flows&&r.flows.implicit)return React.createElement(OAuth2Flow,{key:m,authorizationUrl:r.flows.implicit.authorizationUrl,authCorsProxyUrl:e.props.authCorsProxyUrl,scopes:Object.keys((null===(u=null===(i=null==r?void 0:r.flows)||void 0===i?void 0:i.implicit)||void 0===u?void 0:u.scopes)||{}),server:e.props.activeServer,id:m,form:e.props.form,formApi:e.props.formApi,clientId:r.flows.implicit["x-defaultClientId"]||r["x-defaultClientId"],flow:"implicit",defaultValues:null==t?void 0:t[m]});if("oauth2"===r.type&&r.flows&&r.flows.authorizationCode)return React.createElement(OAuth2Flow,{key:m,authorizationUrl:r.flows.authorizationCode.authorizationUrl,tokenUrl:r.flows.authorizationCode.tokenUrl,authCorsProxyUrl:e.props.authCorsProxyUrl,scopes:Object.keys((null===(s=r.flows.authorizationCode)||void 0===s?void 0:s.scopes)||{}),server:e.props.activeServer,id:m,form:e.props.form,formApi:e.props.formApi,clientId:r.flows.authorizationCode["x-defaultClientId"]||r["x-defaultClientId"],flow:"authorizationCode",usePkce:r.flows.authorizationCode["x-usePkce"],defaultValues:null==t?void 0:t[m]});if("oauth2"===r.type){var v=fromSessionStorage("auth."+m+".token")||JSON.stringify(null===(c=null==t?void 0:t[m])||void 0===c?void 0:c.token);return v=v?JSON.parse(v):{},React.createElement(React.Fragment,{key:m},React.createElement(FormControl,null,React.createElement(FormLabel,null," Access Token Type: "),React.createElement(FormTextField,{fullWidth:!0,field:"auth."+m+".token.token_type",initialValue:v.token_type||"Bearer"})),React.createElement(FormControl,null,React.createElement(FormLabel,null," Access Token: "),React.createElement(FormTextField,{type:"password",fullWidth:!0,field:"auth."+m+".token.access_token",validate:requiredValidator,initialValue:v.access_token,validateOnBlur:!0,validateOnChange:!0})))}if("openIdConnect"===r.type)return React.createElement(OpenIDConnect,{key:m,server:e.props.activeServer,authCorsProxyUrl:e.props.authCorsProxyUrl,id:m,form:e.props.form,formApi:e.props.formApi,scheme:r,clientId:r["x-defaultClientId"],defaultValues:null==t?void 0:t[m]})}}))),React.createElement("small",null,React.createElement("strong",null,"Note"),": Your credentials will be saved until the end of the browser session"))}}),t}(React.Component);export{AuthPanel};
|
|
2
2
|
//# sourceMappingURL=AuthPanel.js.map
|
|
@@ -18,4 +18,4 @@ export declare const ChangeViewButton: ({ store, isVisible, }: {
|
|
|
18
18
|
store: ProStore;
|
|
19
19
|
isVisible: boolean;
|
|
20
20
|
}) => JSX.Element | null;
|
|
21
|
-
export declare const ControlsWrap: import("styled-components").StyledComponent<"
|
|
21
|
+
export declare const ControlsWrap: import("styled-components").StyledComponent<"span", ProTheme, {}, never>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject}from"tslib";import*as React from"react";import{observer}from"mobx-react";import{styled,mediaCSS,mediaMap,ZERO_BREAKPOINT,css,Tooltip}from"../redoc-lib";import{LayoutVariant}from"../services";var ShowRightPanelSVG=styled((function(){return React.createElement("svg",{width:"15",height:"10",viewBox:"0 0 15 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M2.41421 5L5.70711 8.29289C6.09763 8.68342 6.09763 9.31658 5.7071 9.70711C5.31658 10.0976 4.68342 10.0976 4.29289 9.70711L0.292892 5.70711C-0.0976321 5.31658 -0.0976319 4.68342 0.292893 4.29289L4.29289 0.292894C4.68342 -0.0976302 5.31658 -0.09763 5.70711 0.292894C6.09763 0.683418 6.09763 1.31658 5.70711 1.70711L2.41421 5Z",fill:"#9AA6B1"}),React.createElement("path",{d:"M2 5C2 4.44772 2.44771 4 3 4L11 4C11.5523 4 12 4.44772 12 5C12 5.55229 11.5523 6 11 6L3 6C2.44771 6 2 5.55228 2 5Z",fill:"#9AA6B1"}),React.createElement("rect",{x:"15",y:"10",width:"2",height:"10",rx:"1",transform:"rotate(-180 15 10)",fill:"#9AA6B1"}))}))(templateObject_1||(templateObject_1=__makeTemplateObject(["\n position: absolute;\n"],["\n position: absolute;\n"]))),HideRightPanelSVG=styled((function(){return React.createElement("svg",{width:"15",height:"10",viewBox:"0 0 15 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M12.5858 5L9.29289 1.70711C8.90237 1.31658 8.90237 0.683417 9.29289 0.292893C9.68342 -0.097631 10.3166 -0.0976309 10.7071 0.292893L14.7071 4.29289C15.0976 4.68342 15.0976 5.31658 14.7071 5.70711L10.7071 9.70711C10.3166 10.0976 9.68342 10.0976 9.29289 9.70711C8.90237 9.31658 8.90237 8.68342 9.29289 8.29289L12.5858 5Z",fill:"#9AA6B1"}),React.createElement("path",{d:"M13 5C13 5.55229 12.5523 6 12 6L4 6C3.44772 6 3 5.55228 3 5C3 4.44771 3.44772 4 4 4L12 4C12.5523 4 13 4.44772 13 5Z",fill:"#9AA6B1"}),React.createElement("rect",{width:"2",height:"10",rx:"1",fill:"#9AA6B1"}))}))(templateObject_2||(templateObject_2=__makeTemplateObject(["\n position: absolute;\n"],["\n position: absolute;\n"])));export var StyledToggleRightPanelButton=styled.a(templateObject_3||(templateObject_3=__makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n color: '#f00';\n cursor: pointer;\n z-index: 1;\n /* Rectangle 201 */\n width: ",";\n height: ",";\n background: #e5e8eb;\n border-radius: ",";\n"],["\n display: flex;\n justify-content: center;\n align-items: center;\n color: '#f00';\n cursor: pointer;\n z-index: 1;\n /* Rectangle 201 */\n width: ",";\n height: ",";\n background: #e5e8eb;\n border-radius: ",";\n"])),(function(e){return e.theme.components.layoutControls.width}),(function(e){return e.theme.components.layoutControls.height}),(function(e){return e.theme.shape.borderRadius}));export var ToggleRightPanelButton=observer((function(e){var t=e.store,n=e.isVisible;return t.options.showRightPanelToggle&&n?React.createElement(Tooltip,{tip:t.showRightPanel?"Hide samples":"Show samples",placement:"left"},React.createElement(StyledToggleRightPanelButton,{onClick:function(){t.toggleRightPanel()}},t.showRightPanel?React.createElement(HideRightPanelSVG,null):React.createElement(ShowRightPanelSVG,null))):null}));var IntArrowIcon=function(e){return React.createElement("svg",{className:e.className,version:"1.1",viewBox:"0 0 24 24",x:"0",xmlns:"http://www.w3.org/2000/svg",y:"0","aria-hidden":"true"},React.createElement("polygon",{points:"17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "}))};export var ArrowIcon=styled(IntArrowIcon)(templateObject_4||(templateObject_4=__makeTemplateObject(["\n width: 18px;\n height: 18px;\n transform: ",";\n\n ","\n"],["\n width: 18px;\n height: 18px;\n transform: ",";\n\n ","\n"])),(function(e){return"rotate("+("left"===e.direction?"90deg":"-90deg")+")"}),(function(e){var t,n=e.theme;return mediaCSS({fill:null===(t=n.rightPanel)||void 0===t?void 0:t.textColor})}));export var RedocWrap=styled.div(templateObject_5||(templateObject_5=__makeTemplateObject(["\n display: flex;\n position: relative;\n text-align: left;\n tap-highlight-color: rgba(0, 0, 0, 0);\n text-size-adjust: 100%;\n ",";\n\n ","\n\n * {\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(255, 255, 255, 0);\n }\n"],["\n display: flex;\n position: relative;\n text-align: left;\n tap-highlight-color: rgba(0, 0, 0, 0);\n text-size-adjust: 100%;\n ",";\n\n ","\n\n * {\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(255, 255, 255, 0);\n }\n"])),(function(e){var t=e.theme;return"\n -webkit-font-smoothing: "+t.typography.smoothing+";\n "+(t.typography.optimizeSpeed?"text-rendering: optimizeSpeed !important":"")+";\n "}),(function(e){var t=e.theme;return mediaCSS({fontFamily:t.typography.fontFamily,fontSize:t.typography.fontSize,lineHeight:t.typography.lineHeight,fontWeight:t.typography.fontWeightRegular,color:t.colors.text.primary,fontSmoothing:t.typography.smoothing})}));export var ApiContentWrap=styled.div(templateObject_7||(templateObject_7=__makeTemplateObject(["\n position: relative;\n overflow: hidden;\n /* contain: layout; */\n display: flex;\n flex-direction: column;\n align-items: center;\n margin: 0 auto;\n\n ","\n"],["\n position: relative;\n overflow: hidden;\n /* contain: layout; */\n display: flex;\n flex-direction: column;\n align-items: center;\n margin: 0 auto;\n\n ","\n"])),(function(e){var t,n=e.theme,i=e.layout;return css(templateObject_6||(templateObject_6=__makeTemplateObject(["\n ",";\n\n "," {\n width: 100%;\n padding: 0;\n }\n "],["\n ",";\n\n "," {\n width: 100%;\n padding: 0;\n }\n "])),mediaCSS({width:(t={},t[ZERO_BREAKPOINT]="auto",t.small="calc(100% - "+n.sidebar.width+")",t),maxWidth:n.layout[i||LayoutVariant.THREE_PANEL].maxWidth}),n.mediaQueries.print)}));export var BackgroundStub=styled.div(templateObject_9||(templateObject_9=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n ","\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n ","\n"])),(function(e){var t,n,i=e.theme;return css(templateObject_8||(templateObject_8=__makeTemplateObject(["\n ","\n "," {\n display: none;\n }\n "],["\n ","\n "," {\n display: none;\n }\n "])),mediaCSS({background:i.rightPanel.backgroundColor,display:(t={},t[ZERO_BREAKPOINT]="none",t[i.rightPanel.showAtBreakpoint]="initial",t),left:mediaMap(i.breakpoints,[i.rightPanel.width],(n={},n[ZERO_BREAKPOINT]=function(){return"0"},n[i.rightPanel.showAtBreakpoint]=function(e){return"calc(100% - "+e+")"},n))}),i.mediaQueries.print)}));export var BackgroundStubFix=styled.div(templateObject_11||(templateObject_11=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n ","\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n ","\n"])),(function(e){var t,n,i=e.theme;return css(templateObject_10||(templateObject_10=__makeTemplateObject(["\n ","\n "," {\n display: none;\n }\n "],["\n ","\n "," {\n display: none;\n }\n "])),mediaCSS({background:i.rightPanel.backgroundColor,display:(t={},t[ZERO_BREAKPOINT]="none",t[i.rightPanel.showAtBreakpoint]="initial",t),width:mediaMap(i.breakpoints,[i.sidebar.width,i.layout["three-panel"].maxWidth],(n={},n[ZERO_BREAKPOINT]=function(){return"0"},n[i.rightPanel.showAtBreakpoint]=function(e,t){return"calc((100% - min(100% - "+e+" - "+i.components.layoutControls.width+", "+t+") - "+e+" + "+i.components.layoutControls.width+")/2 + 2px)"},n))}),i.mediaQueries.print)}));export var NextSectionButtonWrap=styled.div(templateObject_13||(templateObject_13=__makeTemplateObject(["\n padding: ",";\n align-self: flex-start;\n text-align: right;\n\n display: flex;\n flex-direction: row;\n\n ","\n"],["\n padding: ",";\n align-self: flex-start;\n text-align: right;\n\n display: flex;\n flex-direction: row;\n\n ","\n"])),(function(e){var t=e.theme;return 4*t.spacing.unit+"px "+5*t.spacing.unit+"px"}),(function(e){var t,n,i=e.theme,a=i.layout.showDarkRightPanel?i.spacing.sectionHorizontal:i.spacing.sectionHorizontal/2;return css(templateObject_12||(templateObject_12=__makeTemplateObject(["\n ","\n "],["\n ","\n "])),mediaCSS({width:mediaMap(i.breakpoints,[i.rightPanel.width],(t={},t[ZERO_BREAKPOINT]=function(){return"100%"},t[i.rightPanel.showAtBreakpoint]=function(e){return"calc(100% - "+e+")"},t)),paddingLeft:i.spacing.sectionHorizontal,paddingRight:(n={},n[ZERO_BREAKPOINT]=i.spacing.sectionHorizontal,n[i.rightPanel.showAtBreakpoint]=a,n)}))}));var templateObject_1,templateObject_2,templateObject_3,templateObject_4,templateObject_5,templateObject_6,templateObject_7,templateObject_8,templateObject_9,templateObject_10,templateObject_11,templateObject_12,templateObject_13,templateObject_14,templateObject_15,templateObject_16,templateObject_17,templateObject_18,ChangeViewSvgColumn=styled((function(){return React.createElement("svg",{width:"15",height:"20",viewBox:"0 0 15 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("line",{x1:"13.2858",y1:"5.28564",x2:"1.00005",y2:"5.28564",stroke:"#9AA6B1",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("line",{x1:"13.2858",y1:"1",x2:"1.00005",y2:"0.999998",stroke:"#9AA6B1",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("rect",{x:"14.2858",y:"20",width:"14.2857",height:"11.4286",rx:"1",transform:"rotate(-180 14.2858 20)",fill:"#9AA6B1"}))}))(templateObject_14||(templateObject_14=__makeTemplateObject(["\n position: absolute;\n"],["\n position: absolute;\n"]))),ChangeViewSvgRow=styled((function(){return React.createElement("svg",{width:"20",height:"16",viewBox:"0 0 20 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("line",{x1:"1",y1:"4",x2:"8",y2:"4",stroke:"#9AA6B1",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("line",{x1:"1",y1:"8",x2:"8",y2:"8",stroke:"#9AA6B1",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("line",{x1:"1",y1:"12",x2:"8",y2:"12",stroke:"#9AA6B1",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("rect",{x:"11",width:"9",height:"16",rx:"1",fill:"#9AA6B1"}))}))(templateObject_15||(templateObject_15=__makeTemplateObject(["\n position: absolute;\n"],["\n position: absolute;\n"]))),StyledChangeViewButton=styled.a(templateObject_16||(templateObject_16=__makeTemplateObject(["\n display: flex;\n position: relative;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n z-index: 1;\n /* Rectangle 201 */\n width: ",";\n height: ",";\n background: #e5e8eb;\n border-radius: ",";\n"],["\n display: flex;\n position: relative;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n z-index: 1;\n /* Rectangle 201 */\n width: ",";\n height: ",";\n background: #e5e8eb;\n border-radius: ",";\n"])),(function(e){return e.theme.components.layoutControls.width}),(function(e){return e.theme.components.layoutControls.height}),(function(e){return e.theme.shape.borderRadius}));export var ChangeViewButton=function(e){var t=e.store,n=e.isVisible;return t.options.showChangeLayoutButton&&n?React.createElement(Tooltip,{tip:"Change layout",placement:"left"},React.createElement(StyledChangeViewButton,{onClick:function(){t.toggleLayout(t.layout===LayoutVariant.STACKED?LayoutVariant.THREE_PANEL:LayoutVariant.STACKED)}},t.layout===LayoutVariant.STACKED?React.createElement(ChangeViewSvgRow,null):React.createElement(ChangeViewSvgColumn,null))):null};export var ControlsWrap=styled.div(templateObject_18||(templateObject_18=__makeTemplateObject(["\n position: sticky;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n top: ",";\n right: 24px;\n height: ",";\n z-index: 1;\n ","\n"],["\n position: sticky;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n top: ",";\n right: 24px;\n height: ",";\n z-index: 1;\n ","\n"])),(function(e){return e.theme.components.layoutControls.top}),(function(e){var t=e.theme;return"calc("+t.components.layoutControls.height+" * 2 + "+2*t.spacing.unit+"px)"}),(function(e){var t,n=e.theme;return css(templateObject_17||(templateObject_17=__makeTemplateObject(["\n ","\n "," {\n display: none;\n }\n "],["\n ","\n "," {\n display: none;\n }\n "])),mediaCSS({display:(t={},t[ZERO_BREAKPOINT]="none",t[n.rightPanel.showAtBreakpoint]="flex",t)}),n.mediaQueries.print)}));
|
|
1
|
+
import{__makeTemplateObject}from"tslib";import*as React from"react";import{observer}from"mobx-react";import{styled,mediaCSS,mediaMap,ZERO_BREAKPOINT,css,Tooltip}from"../redoc-lib";import{LayoutVariant}from"../services";var ShowRightPanelSVG=styled((function(){return React.createElement("svg",{width:"15",height:"10",viewBox:"0 0 15 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M2.41421 5L5.70711 8.29289C6.09763 8.68342 6.09763 9.31658 5.7071 9.70711C5.31658 10.0976 4.68342 10.0976 4.29289 9.70711L0.292892 5.70711C-0.0976321 5.31658 -0.0976319 4.68342 0.292893 4.29289L4.29289 0.292894C4.68342 -0.0976302 5.31658 -0.09763 5.70711 0.292894C6.09763 0.683418 6.09763 1.31658 5.70711 1.70711L2.41421 5Z",fill:"#9AA6B1"}),React.createElement("path",{d:"M2 5C2 4.44772 2.44771 4 3 4L11 4C11.5523 4 12 4.44772 12 5C12 5.55229 11.5523 6 11 6L3 6C2.44771 6 2 5.55228 2 5Z",fill:"#9AA6B1"}),React.createElement("rect",{x:"15",y:"10",width:"2",height:"10",rx:"1",transform:"rotate(-180 15 10)",fill:"#9AA6B1"}))}))(templateObject_1||(templateObject_1=__makeTemplateObject(["\n position: absolute;\n"],["\n position: absolute;\n"]))),HideRightPanelSVG=styled((function(){return React.createElement("svg",{width:"15",height:"10",viewBox:"0 0 15 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M12.5858 5L9.29289 1.70711C8.90237 1.31658 8.90237 0.683417 9.29289 0.292893C9.68342 -0.097631 10.3166 -0.0976309 10.7071 0.292893L14.7071 4.29289C15.0976 4.68342 15.0976 5.31658 14.7071 5.70711L10.7071 9.70711C10.3166 10.0976 9.68342 10.0976 9.29289 9.70711C8.90237 9.31658 8.90237 8.68342 9.29289 8.29289L12.5858 5Z",fill:"#9AA6B1"}),React.createElement("path",{d:"M13 5C13 5.55229 12.5523 6 12 6L4 6C3.44772 6 3 5.55228 3 5C3 4.44771 3.44772 4 4 4L12 4C12.5523 4 13 4.44772 13 5Z",fill:"#9AA6B1"}),React.createElement("rect",{width:"2",height:"10",rx:"1",fill:"#9AA6B1"}))}))(templateObject_2||(templateObject_2=__makeTemplateObject(["\n position: absolute;\n"],["\n position: absolute;\n"])));export var StyledToggleRightPanelButton=styled.a(templateObject_3||(templateObject_3=__makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n color: '#f00';\n cursor: pointer;\n z-index: 1;\n /* Rectangle 201 */\n width: ",";\n height: ",";\n background: #e5e8eb;\n border-radius: ",";\n"],["\n display: flex;\n justify-content: center;\n align-items: center;\n color: '#f00';\n cursor: pointer;\n z-index: 1;\n /* Rectangle 201 */\n width: ",";\n height: ",";\n background: #e5e8eb;\n border-radius: ",";\n"])),(function(e){return e.theme.components.layoutControls.width}),(function(e){return e.theme.components.layoutControls.height}),(function(e){return e.theme.shape.borderRadius}));export var ToggleRightPanelButton=observer((function(e){var t=e.store,n=e.isVisible;return t.options.showRightPanelToggle&&n?React.createElement(Tooltip,{tip:t.showRightPanel?"Hide samples":"Show samples",placement:"left"},React.createElement(StyledToggleRightPanelButton,{onClick:function(){t.toggleRightPanel()}},t.showRightPanel?React.createElement(HideRightPanelSVG,null):React.createElement(ShowRightPanelSVG,null))):null}));var IntArrowIcon=function(e){return React.createElement("svg",{className:e.className,version:"1.1",viewBox:"0 0 24 24",x:"0",xmlns:"http://www.w3.org/2000/svg",y:"0","aria-hidden":"true"},React.createElement("polygon",{points:"17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "}))};export var ArrowIcon=styled(IntArrowIcon)(templateObject_4||(templateObject_4=__makeTemplateObject(["\n width: 18px;\n height: 18px;\n transform: ",";\n\n ","\n"],["\n width: 18px;\n height: 18px;\n transform: ",";\n\n ","\n"])),(function(e){return"rotate("+("left"===e.direction?"90deg":"-90deg")+")"}),(function(e){var t,n=e.theme;return mediaCSS({fill:null===(t=n.rightPanel)||void 0===t?void 0:t.textColor})}));export var RedocWrap=styled.div(templateObject_5||(templateObject_5=__makeTemplateObject(["\n display: flex;\n position: relative;\n text-align: left;\n tap-highlight-color: rgba(0, 0, 0, 0);\n text-size-adjust: 100%;\n ",";\n\n ","\n\n * {\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(255, 255, 255, 0);\n }\n"],["\n display: flex;\n position: relative;\n text-align: left;\n tap-highlight-color: rgba(0, 0, 0, 0);\n text-size-adjust: 100%;\n ",";\n\n ","\n\n * {\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(255, 255, 255, 0);\n }\n"])),(function(e){var t=e.theme;return"\n -webkit-font-smoothing: "+t.typography.smoothing+";\n "+(t.typography.optimizeSpeed?"text-rendering: optimizeSpeed !important":"")+";\n "}),(function(e){var t=e.theme;return mediaCSS({fontFamily:t.typography.fontFamily,fontSize:t.typography.fontSize,lineHeight:t.typography.lineHeight,fontWeight:t.typography.fontWeightRegular,color:t.colors.text.primary,fontSmoothing:t.typography.smoothing})}));export var ApiContentWrap=styled.div(templateObject_7||(templateObject_7=__makeTemplateObject(["\n position: relative;\n overflow: hidden;\n /* contain: layout; */\n display: flex;\n flex-direction: column;\n align-items: center;\n margin: 0 auto;\n\n ","\n"],["\n position: relative;\n overflow: hidden;\n /* contain: layout; */\n display: flex;\n flex-direction: column;\n align-items: center;\n margin: 0 auto;\n\n ","\n"])),(function(e){var t,n=e.theme,a=e.layout;return css(templateObject_6||(templateObject_6=__makeTemplateObject(["\n ",";\n\n "," {\n width: 100%;\n padding: 0;\n }\n "],["\n ",";\n\n "," {\n width: 100%;\n padding: 0;\n }\n "])),mediaCSS({width:(t={},t[ZERO_BREAKPOINT]="auto",t.small="calc(100% - "+n.sidebar.width+")",t),maxWidth:n.layout[a||LayoutVariant.THREE_PANEL].maxWidth}),n.mediaQueries.print)}));export var BackgroundStub=styled.div(templateObject_9||(templateObject_9=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n ","\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n ","\n"])),(function(e){var t,n,a=e.theme;return css(templateObject_8||(templateObject_8=__makeTemplateObject(["\n ","\n "," {\n display: none;\n }\n "],["\n ","\n "," {\n display: none;\n }\n "])),mediaCSS({background:a.rightPanel.backgroundColor,display:(t={},t[ZERO_BREAKPOINT]="none",t[a.rightPanel.showAtBreakpoint]="initial",t),left:mediaMap(a.breakpoints,[a.rightPanel.width],(n={},n[ZERO_BREAKPOINT]=function(){return"0"},n[a.rightPanel.showAtBreakpoint]=function(e){return"calc(100% - "+e+")"},n))}),a.mediaQueries.print)}));export var BackgroundStubFix=styled.div(templateObject_11||(templateObject_11=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n ","\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n ","\n"])),(function(e){var t,n,a=e.theme;return css(templateObject_10||(templateObject_10=__makeTemplateObject(["\n ","\n "," {\n display: none;\n }\n "],["\n ","\n "," {\n display: none;\n }\n "])),mediaCSS({background:a.rightPanel.backgroundColor,display:(t={},t[ZERO_BREAKPOINT]="none",t[a.rightPanel.showAtBreakpoint]="initial",t),width:mediaMap(a.breakpoints,[a.sidebar.width,a.layout["three-panel"].maxWidth],(n={},n[ZERO_BREAKPOINT]=function(){return"0"},n[a.rightPanel.showAtBreakpoint]=function(e,t){return"calc((100% - min(100% - "+e+" - "+a.components.layoutControls.width+", "+t+") - "+e+" + "+a.components.layoutControls.width+")/2 + 2px)"},n))}),a.mediaQueries.print)}));export var NextSectionButtonWrap=styled.div(templateObject_13||(templateObject_13=__makeTemplateObject(["\n padding: ",";\n align-self: flex-start;\n text-align: right;\n\n display: flex;\n flex-direction: row;\n\n ","\n"],["\n padding: ",";\n align-self: flex-start;\n text-align: right;\n\n display: flex;\n flex-direction: row;\n\n ","\n"])),(function(e){var t=e.theme;return 4*t.spacing.unit+"px "+5*t.spacing.unit+"px"}),(function(e){var t,n,a=e.theme,i=a.layout.showDarkRightPanel?a.spacing.sectionHorizontal:a.spacing.sectionHorizontal/2;return css(templateObject_12||(templateObject_12=__makeTemplateObject(["\n ","\n "],["\n ","\n "])),mediaCSS({width:mediaMap(a.breakpoints,[a.rightPanel.width],(t={},t[ZERO_BREAKPOINT]=function(){return"100%"},t[a.rightPanel.showAtBreakpoint]=function(e){return"calc(100% - "+e+")"},t)),paddingLeft:a.spacing.sectionHorizontal,paddingRight:(n={},n[ZERO_BREAKPOINT]=a.spacing.sectionHorizontal,n[a.rightPanel.showAtBreakpoint]=i,n)}))}));var templateObject_1,templateObject_2,templateObject_3,templateObject_4,templateObject_5,templateObject_6,templateObject_7,templateObject_8,templateObject_9,templateObject_10,templateObject_11,templateObject_12,templateObject_13,templateObject_14,templateObject_15,templateObject_16,templateObject_17,templateObject_18,ChangeViewSvgColumn=styled((function(){return React.createElement("svg",{width:"15",height:"20",viewBox:"0 0 15 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("line",{x1:"13.2858",y1:"5.28564",x2:"1.00005",y2:"5.28564",stroke:"#9AA6B1",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("line",{x1:"13.2858",y1:"1",x2:"1.00005",y2:"0.999998",stroke:"#9AA6B1",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("rect",{x:"14.2858",y:"20",width:"14.2857",height:"11.4286",rx:"1",transform:"rotate(-180 14.2858 20)",fill:"#9AA6B1"}))}))(templateObject_14||(templateObject_14=__makeTemplateObject(["\n position: absolute;\n"],["\n position: absolute;\n"]))),ChangeViewSvgRow=styled((function(){return React.createElement("svg",{width:"20",height:"16",viewBox:"0 0 20 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("line",{x1:"1",y1:"4",x2:"8",y2:"4",stroke:"#9AA6B1",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("line",{x1:"1",y1:"8",x2:"8",y2:"8",stroke:"#9AA6B1",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("line",{x1:"1",y1:"12",x2:"8",y2:"12",stroke:"#9AA6B1",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("rect",{x:"11",width:"9",height:"16",rx:"1",fill:"#9AA6B1"}))}))(templateObject_15||(templateObject_15=__makeTemplateObject(["\n position: absolute;\n"],["\n position: absolute;\n"]))),StyledChangeViewButton=styled.a(templateObject_16||(templateObject_16=__makeTemplateObject(["\n display: flex;\n position: relative;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n z-index: 1;\n /* Rectangle 201 */\n width: ",";\n height: ",";\n background: #e5e8eb;\n border-radius: ",";\n"],["\n display: flex;\n position: relative;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n z-index: 1;\n /* Rectangle 201 */\n width: ",";\n height: ",";\n background: #e5e8eb;\n border-radius: ",";\n"])),(function(e){return e.theme.components.layoutControls.width}),(function(e){return e.theme.components.layoutControls.height}),(function(e){return e.theme.shape.borderRadius}));export var ChangeViewButton=function(e){var t=e.store,n=e.isVisible;return t.options.showChangeLayoutButton&&n?React.createElement(Tooltip,{tip:"Change layout",placement:"left"},React.createElement(StyledChangeViewButton,{onClick:function(){t.toggleLayout(t.layout===LayoutVariant.STACKED?LayoutVariant.THREE_PANEL:LayoutVariant.STACKED)}},t.layout===LayoutVariant.STACKED?React.createElement(ChangeViewSvgRow,null):React.createElement(ChangeViewSvgColumn,null))):null};export var ControlsWrap=styled.span(templateObject_18||(templateObject_18=__makeTemplateObject(["\n position: sticky;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n top: ",";\n right: 24px;\n height: ",";\n z-index: 1;\n ","\n"],["\n position: sticky;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n top: ",";\n right: 24px;\n height: ",";\n z-index: 1;\n ","\n"])),(function(e){return e.theme.components.layoutControls.top}),(function(e){var t=e.theme;return"calc("+t.components.layoutControls.height+" * 2 + "+2*t.spacing.unit+"px)"}),(function(e){var t,n=e.theme;return css(templateObject_17||(templateObject_17=__makeTemplateObject(["\n ","\n "," {\n display: none;\n }\n "],["\n ","\n "," {\n display: none;\n }\n "])),mediaCSS({display:(t={},t[ZERO_BREAKPOINT]="none",t[n.rightPanel.showAtBreakpoint]="flex",t)}),n.mediaQueries.print)}));
|
|
2
2
|
//# sourceMappingURL=styled.elements.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign,__rest}from"tslib";import React
|
|
1
|
+
import{__assign,__rest}from"tslib";import*as React from"react";import{MarkdownRenderer}from"../../services";import{SanitizedMarkdownHTML}from"./SanitizedMdBlock";export var Markdown=function(r){var e=r.source,t=__rest(r,["source"]),n=new MarkdownRenderer;return React.createElement(SanitizedMarkdownHTML,__assign({},t,{html:n.renderMd(e)}))};
|
|
2
2
|
//# sourceMappingURL=Markdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__decorate,__extends}from"tslib";import{observer}from"mobx-react";import*as React from"react";import{Dropdown}from"../../../../components/common/Dropdown";var DiscriminatorDropdown=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(r,"changeActiveChild",{enumerable:!0,configurable:!0,writable:!0,value:function(e){e.idx&&r.props.parent.activateOneOf(e.idx)}}),r}return __extends(r,e),Object.defineProperty(r.prototype,"sortOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){if(0!==r.length){var t={};r.forEach((function(e,r){t[e]=r})),e.sort((function(e,r){return t[e.value]>t[r.value]?1:-1}))}}}),Object.defineProperty(r.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,r=e.parent,t=e.enumValues;if(void 0===r.oneOf)return null;var n=r.oneOf.map((function(e,r){return{value:e.title,idx:r}})),o=n[r.activeOneOf].value;return this.sortOptions(n,t),React.createElement(Dropdown,{dense:!0,value:o,options:n,onChange:this.changeActiveChild,ariaLabel:"Example"})}}),r=__decorate([observer],r)}(React.Component);export{DiscriminatorDropdown};
|
|
1
|
+
import{__decorate,__extends}from"tslib";import{observer}from"mobx-react";import*as React from"react";import{Dropdown}from"../../../../components/common/Dropdown";var DiscriminatorDropdown=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(r,"changeActiveChild",{enumerable:!0,configurable:!0,writable:!0,value:function(e){void 0!==e.idx&&r.props.parent.activateOneOf(e.idx)}}),r}return __extends(r,e),Object.defineProperty(r.prototype,"sortOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){if(0!==r.length){var t={};r.forEach((function(e,r){t[e]=r})),e.sort((function(e,r){return t[e.value]>t[r.value]?1:-1}))}}}),Object.defineProperty(r.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,r=e.parent,t=e.enumValues;if(void 0===r.oneOf)return null;var n=r.oneOf.map((function(e,r){return{value:e.title,idx:r}})),o=n[r.activeOneOf].value;return this.sortOptions(n,t),React.createElement(Dropdown,{dense:!0,value:o,options:n,onChange:this.changeActiveChild,ariaLabel:"Example"})}}),r=__decorate([observer],r)}(React.Component);export{DiscriminatorDropdown};
|
|
2
2
|
//# sourceMappingURL=DiscriminatorDropdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign}from"tslib";import{marked}from"marked";import{highlight,safeSlugify,unescapeHTMLChars}from"../utils";var renderer=new marked.Renderer;
|
|
1
|
+
import{__assign}from"tslib";import{marked}from"marked";import{highlight,safeSlugify,unescapeHTMLChars}from"../utils";var renderer=new marked.Renderer;marked.setOptions({renderer:renderer,highlight:function(e,r){return highlight(e,r)}});export var LEGACY_REGEXP="^ {0,3}\x3c!-- ReDoc-Inject:\\s+?<({component}).*?/?>\\s+?--\x3e\\s*$";export var MDX_COMPONENT_REGEXP="(?:^ {0,3}<({component})([\\s\\S]*?)>([\\s\\S]*?)</\\2>|^ {0,3}<({component})([\\s\\S]*?)(?:/>|\\n{2,}))";export var COMPONENT_REGEXP="(?:"+LEGACY_REGEXP+"|"+MDX_COMPONENT_REGEXP+")";export function buildComponentComment(e){return"\x3c!-- ReDoc-Inject: <"+e+"> --\x3e"}var MarkdownRenderer=function(){function e(e){var r=this;Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"headings",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"currentTopHeading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headingEnhanceRenderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"originalHeadingRule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"parser",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headingRule",{enumerable:!0,configurable:!0,writable:!0,value:function(e,n,t,i){var a,o;return 1===n?r.currentTopHeading=r.saveHeading(e,n):2===n&&r.saveHeading(e,n,null===(a=r.currentTopHeading)||void 0===a?void 0:a.items,null===(o=r.currentTopHeading)||void 0===o?void 0:o.id),r.originalHeadingRule(e,n,t,i)}}),this.headingEnhanceRenderer=new marked.Renderer,this.parser=new marked.Parser,this.originalHeadingRule=this.headingEnhanceRenderer.heading.bind(this.headingEnhanceRenderer),this.headingEnhanceRenderer.heading=this.headingRule}return Object.defineProperty(e,"containsComponent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return new RegExp(COMPONENT_REGEXP.replace(/{component}/g,r),"gmi").test(e)}}),Object.defineProperty(e,"getTextBeforeHading",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=e.search(new RegExp("^(>\\s+##|##)?\\s+"+r,"m"));return n>-1?e.substring(0,n):e}}),Object.defineProperty(e.prototype,"saveHeading",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,n,t){void 0===n&&(n=this.headings),e=unescapeHTMLChars(e);var i={id:t?t+"/"+safeSlugify(e):"section/"+safeSlugify(e),name:e,level:r,items:[]};return n.push(i),i}}),Object.defineProperty(e.prototype,"flattenHeadings",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e)return[];for(var r=[],n=0,t=e;n<t.length;n++){var i=t[n];r.push(i),r.push.apply(r,this.flattenHeadings(i.items))}return r}}),Object.defineProperty(e.prototype,"attachHeadingsDescriptions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=function(e){return new RegExp("##?\\s+"+e.name.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))},n=this.flattenHeadings(this.headings);if(!(n.length<1)){for(var t=n[0],i=r(t),a=e.search(i),o=1;o<n.length;o++){var s=n[o],u=r(s),l=e.substr(a+1).search(u)+a+1;t.description=e.substring(a,l).replace(i,"").trim(),t=s,i=u,a=l}t.description=e.substring(a).replace(i,"").trim()}}}),Object.defineProperty(e.prototype,"renderMd",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){void 0===r&&(r=!1);var n=r?{renderer:this.headingEnhanceRenderer}:void 0;return marked(e.toString(),n)}}),Object.defineProperty(e.prototype,"extractHeadings",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.renderMd(e,!0),this.attachHeadingsDescriptions(e);var r=this.headings;return this.headings=[],r}}),Object.defineProperty(e.prototype,"renderMdWithComponents",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.options&&this.options.allowedMdComponents;if(!r||0===Object.keys(r).length)return[this.renderMd(e)];for(var n=Object.keys(r).join("|"),t=new RegExp(COMPONENT_REGEXP.replace(/{component}/g,n),"mig"),i=[],a=[],o=t.exec(e),s=0;o;){i.push(e.substring(s,o.index)),s=t.lastIndex;var u=r[o[1]||o[2]||o[5]],l=o[3]||o[6],d=o[4];u&&a.push({component:u.component,propsSelector:u.propsSelector,props:__assign(__assign(__assign({},parseProps(l)),u.props),{children:d})}),o=t.exec(e)}i.push(e.substring(s));for(var c=[],p=0;p<i.length;p++){var g=i[p];g&&c.push(this.renderMd(g)),a[p]&&c.push(a[p])}return c}}),e}();export{MarkdownRenderer};function parseProps(e){if(!e)return{};for(var r,n=/([\w-]+)\s*=\s*(?:{([^}]+?)}|"([^"]+?)")/gim,t={};null!==(r=n.exec(e));)if(r[3])t[r[1]]=r[3];else if(r[2]){var i=void 0;try{i=JSON.parse(r[2])}catch(e){}t[r[1]]=i}return t}
|
|
2
2
|
//# sourceMappingURL=MarkdownRenderer.js.map
|
|
@@ -53,7 +53,6 @@ interface HooksConfig {
|
|
|
53
53
|
}
|
|
54
54
|
export interface RedocRawOptions {
|
|
55
55
|
theme?: ThemeInterface;
|
|
56
|
-
extraPathPrefix?: string;
|
|
57
56
|
scrollYOffset?: number | string | (() => number);
|
|
58
57
|
hideHostname?: boolean | string;
|
|
59
58
|
hideInfoDescription?: boolean | string;
|
|
@@ -112,7 +111,6 @@ export declare class RedocNormalizedOptions {
|
|
|
112
111
|
static normalizeScrollYOffset(value: RedocRawOptions['scrollYOffset']): () => number;
|
|
113
112
|
static normalizeShowExtensions(value: RedocRawOptions['showExtensions']): string[] | boolean;
|
|
114
113
|
static normalizePayloadSampleIdx(value: RedocRawOptions['payloadSampleIdx']): number;
|
|
115
|
-
extraPathPrefix?: string;
|
|
116
114
|
theme: ResolvedThemeInterface;
|
|
117
115
|
scrollYOffset: () => number;
|
|
118
116
|
hideHostname: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign,__decorate}from"tslib";import{observable,makeObservable}from"mobx";import defaultTheme,{resolveTheme}from"../theme";import{isNumeric,mergeObjects,querySelector}from"../utils";import{setRedocLabels}from"./Labels";export function argValueToBoolean(e,a){return void 0===e?a||!1:"string"==typeof e?"false"!==e:e}function argValueToNumber(e){return"string"==typeof e?parseInt(e,10):"number"==typeof e?e:void 0}function argValueToInt(e){return"string"==typeof e?parseInt(e,10):"number"==typeof e?Math.ceil(e):void 0}function argValueToExpandLevel(e,a){return void 0===a&&(a=0),"all"===e?1/0:argValueToInt(e)||a}var RedocNormalizedOptions=function(){function e(a,t){var r,i,o,l,n,s;void 0===t&&(t={}),Object.defineProperty(this,"extraPathPrefix",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"theme",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scrollYOffset",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideHostname",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideInfoDescription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandResponses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requiredPropsFirst",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortPropsAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortEnumValuesAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortOperationsAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortTagsAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"noAutoAuth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nativeScrollbars",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathInMiddlePanel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"untrustedDefinition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideDownloadButton",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"disableSearch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showChangeLayoutButton",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onlyRequiredInSamples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showConsole",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sendXUserAgentInTryIt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"generatedPayloadSamplesMaxDepth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showExtensions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideSingleRequestSampleTab",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideRequestPayloadSample",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"menuToggle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"jsonSampleExpandLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"enumSkipQuotes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideSchemaTitles",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simpleOneOfTypeLabel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"payloadSampleIdx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandSingleSchemaField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"schemaExpansionLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"samplesTabsMaxCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unstable_tryItButtonOverride",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allowedMdComponents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandDefaultServerVariables",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandDefaultRequest",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandDefaultResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxDisplayedEnumValues",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreNamedSchemas",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unstable_ignoreMimeParameters",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unstable_externalCodeSamples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideSchemaPattern",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideOneOfDescription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),makeObservable(this);var u=null===(r=(a=__assign(__assign({},t),a)).theme)||void 0===r?void 0:r.extensionsHook;(null===(i=a.theme)||void 0===i?void 0:i.menu)&&!(null===(o=a.theme)||void 0===o?void 0:o.sidebar)&&(console.warn('Theme setting "menu" is deprecated. Rename to "sidebar"'),a.theme.sidebar=a.theme.menu),(null===(l=a.theme)||void 0===l?void 0:l.codeSample)&&!(null===(n=a.theme)||void 0===n?void 0:n.codeBlock)&&(console.warn('Theme setting "codeSample" is deprecated. Rename to "codeBlock"'),a.theme.codeBlock=a.theme.codeSample),this.theme=resolveTheme(mergeObjects({},defaultTheme,__assign(__assign({},a.theme),{extensionsHook:void 0}))),this.theme.mediaQueries={print:"@media print"};for(var b=0,d=Object.entries(this.theme.breakpoints);b<d.length;b++){var c=d[b],h=c[0],p=c[1];this.theme.mediaQueries[h]="@media screen and (min-width: "+p+")"}this.theme.extensionsHook=u,setRedocLabels(a.labels),this.scrollYOffset=e.normalizeScrollYOffset(a.scrollYOffset),this.hideHostname=e.normalizeHideHostname(a.hideHostname),this.expandResponses=e.normalizeExpandResponses(a.expandResponses),this.requiredPropsFirst=argValueToBoolean(a.requiredPropsFirst),this.sortPropsAlphabetically=argValueToBoolean(a.sortPropsAlphabetically),this.sortEnumValuesAlphabetically=argValueToBoolean(a.sortEnumValuesAlphabetically),this.sortOperationsAlphabetically=argValueToBoolean(a.sortOperationsAlphabetically),this.sortTagsAlphabetically=argValueToBoolean(a.sortTagsAlphabetically),this.noAutoAuth=argValueToBoolean(a.noAutoAuth),this.nativeScrollbars=argValueToBoolean(a.nativeScrollbars),this.pathInMiddlePanel=argValueToBoolean(a.pathInMiddlePanel),this.untrustedDefinition=argValueToBoolean(a.untrustedDefinition),this.hideDownloadButton=void 0===a.hideDownloadButton?null:argValueToBoolean(a.hideDownloadButton),this.hideInfoDescription=argValueToBoolean(a.hideInfoDescription),this.disableSearch=argValueToBoolean(a.disableSearch),this.onlyRequiredInSamples=argValueToBoolean(a.onlyRequiredInSamples),this.generatedPayloadSamplesMaxDepth=argValueToInt(a.generatedPayloadSamplesMaxDepth)||8,this.sendXUserAgentInTryIt=argValueToBoolean(a.sendXUserAgentInTryIt),this.showExtensions=e.normalizeShowExtensions(a.showExtensions),this.hideSingleRequestSampleTab=argValueToBoolean(a.hideSingleRequestSampleTab),this.hideRequestPayloadSample=argValueToBoolean(a.hideRequestPayloadSample),this.menuToggle=argValueToBoolean(a.menuToggle,!0),this.jsonSampleExpandLevel=argValueToExpandLevel(a.jsonSampleExpandLevel,2),this.enumSkipQuotes=argValueToBoolean(a.enumSkipQuotes),this.hideSchemaTitles=argValueToBoolean(a.hideSchemaTitles),this.simpleOneOfTypeLabel=argValueToBoolean(a.simpleOneOfTypeLabel),this.payloadSampleIdx=e.normalizePayloadSampleIdx(a.payloadSampleIdx),this.expandSingleSchemaField=argValueToBoolean(a.expandSingleSchemaField),this.schemaExpansionLevel=argValueToExpandLevel(a.schemaExpansionLevel),this.samplesTabsMaxCount=argValueToInt(a.samplesTabsMaxCount)||5,this.unstable_tryItButtonOverride=a.unstable_tryItButtonOverride||null,this.unstable_ignoreMimeParameters=argValueToBoolean(a.unstable_ignoreMimeParameters),this.allowedMdComponents=a.allowedMdComponents||{},this.expandDefaultServerVariables=argValueToBoolean(a.expandDefaultServerVariables),this.expandDefaultRequest=argValueToBoolean(a.expandDefaultRequest,!0),this.expandDefaultResponse=argValueToBoolean(a.expandDefaultResponse,!0),this.maxDisplayedEnumValues=argValueToNumber(a.maxDisplayedEnumValues);var m=Array.isArray(a.ignoreNamedSchemas)?a.ignoreNamedSchemas:null===(s=a.ignoreNamedSchemas)||void 0===s?void 0:s.split(",").map((function(e){return e.trim()}));this.ignoreNamedSchemas=new Set(m),this.extraPathPrefix=a.extraPathPrefix,this.unstable_externalCodeSamples=a.unstable_externalCodeSamples||[],this.hooks=a.hooks||{},this.hooks.ReplaceTryItAuthPanel&&!this.hooks.ReplaceTryItSecurityPanel&&(console.warn("[warn] ReplaceTryItAuthPanel is deprecated, use ReplaceTryItSecurityPanel instead"),this.hooks.ReplaceTryItSecurityPanel=this.hooks.ReplaceTryItAuthPanel),this.hideSchemaPattern=argValueToBoolean(a.hideSchemaPattern),this.hideOneOfDescription=argValueToBoolean(a.hideOneOfDescription)}return Object.defineProperty(e,"normalizeExpandResponses",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("all"===e)return"all";if("string"==typeof e){var a={};return e.split(",").forEach((function(e){a[e.trim()]=!0})),a}return void 0!==e&&console.warn('expandResponses must be a string but received value "'+e+'" of type '+typeof e),{}}}),Object.defineProperty(e,"normalizeHideHostname",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!e}}),Object.defineProperty(e,"normalizeScrollYOffset",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("string"==typeof e&&!isNumeric(e)){var a=querySelector(e);a||console.warn("scrollYOffset value is a selector to non-existing element. Using offset 0 by default");var t=a&&a.getBoundingClientRect().bottom||0;return function(){return t}}return"number"==typeof e||isNumeric(e)?function(){return"number"==typeof e?e:parseFloat(e)}:"function"==typeof e?function(){var a=e();return"number"!=typeof a&&console.warn('scrollYOffset should return number but returned value "'+a+'" of type '+typeof a),a}:(void 0!==e&&console.warn("Wrong value for scrollYOffset ReDoc option: should be string, number or function"),function(){return 0})}}),Object.defineProperty(e,"normalizeShowExtensions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e)return!1;if(""===e)return!0;if("string"!=typeof e)return e;switch(e){case"true":return!0;case"false":return!1;default:return e.split(",").map((function(e){return e.trim()}))}}}),Object.defineProperty(e,"normalizePayloadSampleIdx",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"number"==typeof e?Math.max(0,e):"string"==typeof e&&isFinite(e)?parseInt(e,10):0}}),__decorate([observable],e.prototype,"showConsole",void 0),e}();export{RedocNormalizedOptions};
|
|
1
|
+
import{__assign,__decorate}from"tslib";import{observable,makeObservable}from"mobx";import defaultTheme,{resolveTheme}from"../theme";import{isNumeric,mergeObjects,querySelector}from"../utils";import{setRedocLabels}from"./Labels";export function argValueToBoolean(e,a){return void 0===e?a||!1:"string"==typeof e?"false"!==e:e}function argValueToNumber(e){return"string"==typeof e?parseInt(e,10):"number"==typeof e?e:void 0}function argValueToInt(e){return"string"==typeof e?parseInt(e,10):"number"==typeof e?Math.ceil(e):void 0}function argValueToExpandLevel(e,a){return void 0===a&&(a=0),"all"===e?1/0:argValueToInt(e)||a}var RedocNormalizedOptions=function(){function e(a,t){var r,i,o,l,n,s;void 0===t&&(t={}),Object.defineProperty(this,"theme",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scrollYOffset",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideHostname",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideInfoDescription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandResponses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requiredPropsFirst",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortPropsAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortEnumValuesAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortOperationsAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortTagsAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"noAutoAuth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nativeScrollbars",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathInMiddlePanel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"untrustedDefinition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideDownloadButton",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"disableSearch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showChangeLayoutButton",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onlyRequiredInSamples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showConsole",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sendXUserAgentInTryIt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"generatedPayloadSamplesMaxDepth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showExtensions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideSingleRequestSampleTab",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideRequestPayloadSample",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"menuToggle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"jsonSampleExpandLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"enumSkipQuotes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideSchemaTitles",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simpleOneOfTypeLabel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"payloadSampleIdx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandSingleSchemaField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"schemaExpansionLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"samplesTabsMaxCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unstable_tryItButtonOverride",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allowedMdComponents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandDefaultServerVariables",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandDefaultRequest",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandDefaultResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxDisplayedEnumValues",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreNamedSchemas",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unstable_ignoreMimeParameters",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unstable_externalCodeSamples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideSchemaPattern",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideOneOfDescription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),makeObservable(this);var u=null===(r=(a=__assign(__assign({},t),a)).theme)||void 0===r?void 0:r.extensionsHook;(null===(i=a.theme)||void 0===i?void 0:i.menu)&&!(null===(o=a.theme)||void 0===o?void 0:o.sidebar)&&(console.warn('Theme setting "menu" is deprecated. Rename to "sidebar"'),a.theme.sidebar=a.theme.menu),(null===(l=a.theme)||void 0===l?void 0:l.codeSample)&&!(null===(n=a.theme)||void 0===n?void 0:n.codeBlock)&&(console.warn('Theme setting "codeSample" is deprecated. Rename to "codeBlock"'),a.theme.codeBlock=a.theme.codeSample),this.theme=resolveTheme(mergeObjects({},defaultTheme,__assign(__assign({},a.theme),{extensionsHook:void 0}))),this.theme.mediaQueries={print:"@media print"};for(var b=0,d=Object.entries(this.theme.breakpoints);b<d.length;b++){var c=d[b],p=c[0],m=c[1];this.theme.mediaQueries[p]="@media screen and (min-width: "+m+")"}this.theme.extensionsHook=u,setRedocLabels(a.labels),this.scrollYOffset=e.normalizeScrollYOffset(a.scrollYOffset),this.hideHostname=e.normalizeHideHostname(a.hideHostname),this.expandResponses=e.normalizeExpandResponses(a.expandResponses),this.requiredPropsFirst=argValueToBoolean(a.requiredPropsFirst),this.sortPropsAlphabetically=argValueToBoolean(a.sortPropsAlphabetically),this.sortEnumValuesAlphabetically=argValueToBoolean(a.sortEnumValuesAlphabetically),this.sortOperationsAlphabetically=argValueToBoolean(a.sortOperationsAlphabetically),this.sortTagsAlphabetically=argValueToBoolean(a.sortTagsAlphabetically),this.noAutoAuth=argValueToBoolean(a.noAutoAuth),this.nativeScrollbars=argValueToBoolean(a.nativeScrollbars),this.pathInMiddlePanel=argValueToBoolean(a.pathInMiddlePanel),this.untrustedDefinition=argValueToBoolean(a.untrustedDefinition),this.hideDownloadButton=void 0===a.hideDownloadButton?null:argValueToBoolean(a.hideDownloadButton),this.hideInfoDescription=argValueToBoolean(a.hideInfoDescription),this.disableSearch=argValueToBoolean(a.disableSearch),this.onlyRequiredInSamples=argValueToBoolean(a.onlyRequiredInSamples),this.generatedPayloadSamplesMaxDepth=argValueToInt(a.generatedPayloadSamplesMaxDepth)||8,this.sendXUserAgentInTryIt=argValueToBoolean(a.sendXUserAgentInTryIt),this.showExtensions=e.normalizeShowExtensions(a.showExtensions),this.hideSingleRequestSampleTab=argValueToBoolean(a.hideSingleRequestSampleTab),this.hideRequestPayloadSample=argValueToBoolean(a.hideRequestPayloadSample),this.menuToggle=argValueToBoolean(a.menuToggle,!0),this.jsonSampleExpandLevel=argValueToExpandLevel(a.jsonSampleExpandLevel,2),this.enumSkipQuotes=argValueToBoolean(a.enumSkipQuotes),this.hideSchemaTitles=argValueToBoolean(a.hideSchemaTitles),this.simpleOneOfTypeLabel=argValueToBoolean(a.simpleOneOfTypeLabel),this.payloadSampleIdx=e.normalizePayloadSampleIdx(a.payloadSampleIdx),this.expandSingleSchemaField=argValueToBoolean(a.expandSingleSchemaField),this.schemaExpansionLevel=argValueToExpandLevel(a.schemaExpansionLevel),this.samplesTabsMaxCount=argValueToInt(a.samplesTabsMaxCount)||5,this.unstable_tryItButtonOverride=a.unstable_tryItButtonOverride||null,this.unstable_ignoreMimeParameters=argValueToBoolean(a.unstable_ignoreMimeParameters),this.allowedMdComponents=a.allowedMdComponents||{},this.expandDefaultServerVariables=argValueToBoolean(a.expandDefaultServerVariables),this.expandDefaultRequest=argValueToBoolean(a.expandDefaultRequest,!0),this.expandDefaultResponse=argValueToBoolean(a.expandDefaultResponse,!0),this.maxDisplayedEnumValues=argValueToNumber(a.maxDisplayedEnumValues);var h=Array.isArray(a.ignoreNamedSchemas)?a.ignoreNamedSchemas:null===(s=a.ignoreNamedSchemas)||void 0===s?void 0:s.split(",").map((function(e){return e.trim()}));this.ignoreNamedSchemas=new Set(h),this.unstable_externalCodeSamples=a.unstable_externalCodeSamples||[],this.hooks=a.hooks||{},this.hooks.ReplaceTryItAuthPanel&&!this.hooks.ReplaceTryItSecurityPanel&&(console.warn("[warn] ReplaceTryItAuthPanel is deprecated, use ReplaceTryItSecurityPanel instead"),this.hooks.ReplaceTryItSecurityPanel=this.hooks.ReplaceTryItAuthPanel),this.hideSchemaPattern=argValueToBoolean(a.hideSchemaPattern),this.hideOneOfDescription=argValueToBoolean(a.hideOneOfDescription)}return Object.defineProperty(e,"normalizeExpandResponses",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("all"===e)return"all";if("string"==typeof e){var a={};return e.split(",").forEach((function(e){a[e.trim()]=!0})),a}return void 0!==e&&console.warn('expandResponses must be a string but received value "'+e+'" of type '+typeof e),{}}}),Object.defineProperty(e,"normalizeHideHostname",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!e}}),Object.defineProperty(e,"normalizeScrollYOffset",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("string"==typeof e&&!isNumeric(e)){var a=querySelector(e);a||console.warn("scrollYOffset value is a selector to non-existing element. Using offset 0 by default");var t=a&&a.getBoundingClientRect().bottom||0;return function(){return t}}return"number"==typeof e||isNumeric(e)?function(){return"number"==typeof e?e:parseFloat(e)}:"function"==typeof e?function(){var a=e();return"number"!=typeof a&&console.warn('scrollYOffset should return number but returned value "'+a+'" of type '+typeof a),a}:(void 0!==e&&console.warn("Wrong value for scrollYOffset ReDoc option: should be string, number or function"),function(){return 0})}}),Object.defineProperty(e,"normalizeShowExtensions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e)return!1;if(""===e)return!0;if("string"!=typeof e)return e;switch(e){case"true":return!0;case"false":return!1;default:return e.split(",").map((function(e){return e.trim()}))}}}),Object.defineProperty(e,"normalizePayloadSampleIdx",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"number"==typeof e?Math.max(0,e):"string"==typeof e&&isFinite(e)?parseInt(e,10):0}}),__decorate([observable],e.prototype,"showConsole",void 0),e}();export{RedocNormalizedOptions};
|
|
2
2
|
//# sourceMappingURL=RedocNormalizedOptions.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _a;import{__assign,__awaiter,__decorate,__generator}from"tslib";import{action,makeObservable,observable,observe}from"mobx";import{bundle,Config}from"@redocly/openapi-core";import{bind,debounce}from"decko";import{IS_BROWSER,MarkerService,RedocNormalizedOptions,ScrollService,SecurityDefs,SpecStore,SECURITY_DEFINITIONS_COMPONENT_NAME,SECURITY_DEFINITIONS_JSX_NAME,SCHEMA_DEFINITION_JSX_NAME,SchemaDefinition,createParsedDocument}from"../redoc-lib";import{FakeHistoryService,ProHashHistoryService,PushStateHistoryService}from"./history";import{ProMenu}from"./ProMenu";import{DeepSearchStore,RemoteSearch,DEFAULT_SEARCH_MAX_DEPTH}from"./SearchStore";import{extendTheme}from"./extendTheme";import{RedocResponse,PullRight}from"../components/pluggable";import{VersionedSpecStore}from"./VersionedSpecStore";import parseToken from"./check";import{normalizePath}from"./utils";import{fromSessionStorage,toSessionStorage,toLocalStorage,fromLocalStorage,setGlobalStore}from"../utils";import{LayoutVariant}from"./store-types";var global="undefined"==typeof window?{__REDOCLY_SEARCH_URL:void 0}:window,NestingGroup=function(){function e(e,t,i,o){var n=this;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"absoluteIdx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"linkable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"externalDocs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"active",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"expanded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"depth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"level",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),makeObservable(this),this.id="section/"+e,this.type="nesting-group",this.name=i||"",this.level=1,this.depth=1,this.description="",this.parent=void 0,this.expanded=!1,this.items=t,this.linkable=!!o,t.forEach((function(e){return e.parent=n})),increaseDepthDeep(t)}return Object.defineProperty(e.prototype,"activate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.active=!0}}),Object.defineProperty(e.prototype,"expand",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.expanded=!0,this.parent&&this.parent.expand()}}),Object.defineProperty(e.prototype,"collapse",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.expanded=!1}}),Object.defineProperty(e.prototype,"deactivate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.active=!1}}),__decorate([observable],e.prototype,"active",void 0),__decorate([observable],e.prototype,"expanded",void 0),__decorate([action],e.prototype,"activate",null),__decorate([action],e.prototype,"expand",null),__decorate([action],e.prototype,"collapse",null),__decorate([action],e.prototype,"deactivate",null),e}();export{NestingGroup};function increaseDepthDeep(e){Array.isArray(e)&&e.forEach((function(e){e.depth++,e.parent&&"group"===e.parent.type&&(e.depth=e.parent.depth),increaseDepthDeep(e.items)}))}var ProStore=function(){function e(e,t,i,o){var n=this;void 0===i&&(i={}),void 0===o&&(o=!0),Object.defineProperty(this,"rawOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"menu",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"definition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"marker",{enumerable:!0,configurable:!0,writable:!0,value:new MarkerService}),Object.defineProperty(this,"scroll",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"disposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"search",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tryItOperation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showRightPanel",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"layout",{enumerable:!0,configurable:!0,writable:!0,value:LayoutVariant.THREE_PANEL}),Object.defineProperty(this,"activeSampleLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isLoading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"l",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),makeObservable(this),this.initProOptions(i),IS_BROWSER&&(this.l=parseToken(i.licenseKey),this.l.then((function(e){e.valid&&e.allowed&&!e.expired||e.local||(n.menu.items=[],n.menu.flatItems=n.menu.flatItems.slice(0,1),n.menu.renderItems=[])})));var r="object"==typeof e&&"versions"in e,a=this.options.disableSidebar?new FakeHistoryService(this.options):"browser"===this.options.routingStrategy?new PushStateHistoryService(this.options,r):new ProHashHistoryService(this.options,r);this.definition=r?new VersionedSpecStore(e,this.options,a.currentId.split("/")[0]):new SpecStore(e,t,this.options),i.downloadDefinitionUrl&&(this.definition.info.downloadFileName=""),this.scroll=new ScrollService(this.options),this.options.disableSidebar||ProMenu.updateOnHistory(a.currentId,this.scroll),this.menu=new ProMenu(this.definition,this.scroll,this.options,a),this.menu.initOnHistory(),this.options.disableSearch||this.initSearch(this.options,o),this.disposer=observe(this.menu,"none"===this.options.pagination?"activeItemIdx":"activeRenderItemIdx",(function(e){setTimeout((function(){return n.updateMarkOnMenu(e.newValue)}))})),setGlobalStore(this)}return Object.defineProperty(e.prototype,"initProOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,i,o,n,r;e=deepClone(e),this.rawOptions=extendTheme(e),this.options=new RedocNormalizedOptions(this.rawOptions,DEFAULT_OPTIONS),this.options.showConsole=null===(t=this.rawOptions.showConsole)||void 0===t||t,this.options.hideRightPanel=null!==(i=this.rawOptions.hideRightPanel)&&void 0!==i&&i,this.showRightPanel=!this.options.hideRightPanel,this.options.showRightPanelToggle=null===(o=this.rawOptions.showRightPanelToggle)||void 0===o||o,this.options.showChangeLayoutButton=null===(n=this.rawOptions.showChangeLayoutButton)||void 0===n||n,this.options.layout=this.rawOptions.layout||LayoutVariant.THREE_PANEL,this.options.defaultSampleLanguage=this.rawOptions.defaultSampleLanguage||"",this.options.deepLinkSeparator=this.rawOptions.deepLinkSeparator||"/",this.options.deepLinkPrefix=this.rawOptions.deepLinkPrefix||"!",this.options.disableDeepLinks=this.rawOptions.disableDeepLinks||!1,this.options.sideNavStyle=this.rawOptions.sideNavStyle||"summary-only",this.options.whiteLabel=!!this.rawOptions.whiteLabel,this.options.hideLogo=!!this.rawOptions.hideLogo,this.options.hideInfoSection=!!this.rawOptions.hideInfoSection,this.options.oAuth2RedirectURI=this.rawOptions.oAuth2RedirectURI||null,this.options.oAuth2RedirectURI=this.rawOptions.oAuth2RedirectURI||null,this.options.events=this.rawOptions.events||{},this.options.corsProxyUrl=this.rawOptions.corsProxyUrl?addTrailingSlash(this.rawOptions.corsProxyUrl):null,this.options.authCorsProxyUrl=this.rawOptions.authCorsProxyUrl?addTrailingSlash(this.rawOptions.authCorsProxyUrl):null,this.options.theme.scrollYOffset=this.options.scrollYOffset,this.options.linkForId=this.rawOptions.linkForId||null,this.options.generateDeepLink=this.rawOptions.generateDeepLink||null,this.options.onDeepLinkClick=this.rawOptions.onDeepLinkClick||null,this.options.requestInterceptor=this.rawOptions.requestInterceptor||null,this.options.sidebarLinks=this.rawOptions.sidebarLinks||{};var a="object"==typeof this.rawOptions.layout?this.rawOptions.layout:null;if(this.options.pagination=this.rawOptions.pagination||"none",this.options.routingStrategy="none"===this.options.pagination?"hash":"browser",!(null===(r=this.rawOptions)||void 0===r?void 0:r.pagination)&&(null==a?void 0:a.scope))switch(console.warn('"layout.scope" and "routingStrategy" settings are deprecated. Please, use "pagination" instead.'),null==a?void 0:a.scope){case"all":default:this.options.pagination="none",this.options.routingStrategy="hash";break;case"section":this.options.pagination="section",this.options.routingStrategy="browser";break;case"item":this.options.pagination="item",this.options.routingStrategy="browser"}this.options.markdownItemsPagination="none",!1!==this.rawOptions.showNextButton&&(this.options.showNextButton=!0),this.options.disableSidebar=!!e.disableSidebar,this.options.disableSidebar&&(this.options.theme.sidebar.width="0px"),this.options.skipBundleAndConvert=!!e.skipBundleAndConvert,this.options.routingBasePath=e.routingBasePath&&normalizePath(e.routingBasePath)||"",this.options.searchAutoExpand=!1!==e.searchAutoExpand,this.options.extraPathPrefix=e.extraPathPrefix&&normalizePath(e.extraPathPrefix)||"",this.options.searchMode=e.searchMode||"default",this.options.ctrlFHijack=void 0===e.ctrlFHijack||e.ctrlFHijack,this.options.disablePaginationLoadingAnimation=!!e.disablePaginationLoadingAnimation||"none"===this.options.pagination,this.options.showConsole,this.options.generateCodeSamples=e.generateCodeSamples||{languages:[]},this.options.searchMaxDepth=this.rawOptions.searchMaxDepth||DEFAULT_SEARCH_MAX_DEPTH}}),Object.defineProperty(e.prototype,"initSearch",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var i=this;global.__REDOCLY_SEARCH_URL?this.search=new RemoteSearch(global.__REDOCLY_SEARCH_URL):this.search=new DeepSearchStore(e),t&&setTimeout((function(){var e;return null===(e=i.search)||void 0===e?void 0:e.indexItems(i.menu.items)}),50),this.definition instanceof VersionedSpecStore&&observe(this.definition,"activeVersionIdx",(function(t){var o,n,r=i.definition;null===(o=i.search)||void 0===o||o.dispose(),i.search=new DeepSearchStore(e);var a=r.versions[t.newValue]._searchIndexName;if(IS_BROWSER&&a){var s=r.versions[t.newValue]._searchIndexName,l=new URL(window.location.href);l.pathname=joinURLs(i.options.routingBasePath,s),null===(n=i.search)||void 0===n||n.fromExternalJS(l.toString(),__redoc_state.searchIndexExport),i.observeAllAndRemark()}else setTimeout((function(){var e;null===(e=i.search)||void 0===e||e.indexItems(i.menu.items)}),0)})),IS_BROWSER&&this.observeAllAndRemark()}}),Object.defineProperty(e.prototype,"onDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.menu.updateOnHistory(),this.updateMarkOnMenu(this.menu.activeItemIdx),this.layout=fromLocalStorage("layoutVariant")||this.options.layout||this.layout,this.activeSampleLanguage=fromLocalStorage("activeSampleLanguage")||this.options.defaultSampleLanguage,this.options.showRightPanelToggle){var e=fromSessionStorage("showRightPanelToggleState");e&&(this.showRightPanel="true"===e)}}}),Object.defineProperty(e.prototype,"toggleRightPanel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.showRightPanel=null!=e?e:!this.showRightPanel,toSessionStorage("showRightPanelToggleState",JSON.stringify(this.showRightPanel))}}),Object.defineProperty(e.prototype,"toggleLayout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=LayoutVariant.THREE_PANEL),this.layout=e,toLocalStorage("layoutVariant",e)}}),Object.defineProperty(e.prototype,"disableConsole",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.options.showConsole=!1}}),Object.defineProperty(e.prototype,"enableConsole",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.options.showConsole=!0}}),Object.defineProperty(e.prototype,"tryItOut",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.tryItOperation=e}}),Object.defineProperty(e.prototype,"setActiveSampleLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.activeSampleLanguage===e)return this.stopLoader();this.activeSampleLanguage=e,toLocalStorage("activeSampleLanguage",e)}}),Object.defineProperty(e.prototype,"activateSampleLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setActiveSampleLanguage(e)}}),Object.defineProperty(e.prototype,"startLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isLoading||(this.isLoading=!0)}}),Object.defineProperty(e.prototype,"stopLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isLoading&&(this.isLoading=!1)}}),Object.defineProperty(e.prototype,"dereferenceSpecForTryIt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,i,o,n;return __awaiter(this,void 0,void 0,(function(){var r,a,s,l,p,u,c;return __generator(this,(function(h){switch(h.label){case 0:return r=this.definition.parser.definition,a=JSON.parse(JSON.stringify(r)),s=__assign(__assign({},getSpecVersionObj(a)),{components:a.components,paths:(u={},u[e.path]=(c={},c[e.httpVerb]=null===(i=null===(t=a.paths)||void 0===t?void 0:t[e.path])||void 0===i?void 0:i[e.httpVerb],c.parameters=null===(n=null===(o=a.paths)||void 0===o?void 0:o[e.path])||void 0===n?void 0:n.parameters,c),u)}),l=new Config({}),p=createParsedDocument(s),[4,bundle({config:l,doc:p,dereference:!0})];case 1:return h.sent(),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"observeAllAndRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=function(i){for(var o=0,n=i;o<n.length;o++){var r=n[o];if("operation"===r.type)for(var a=0,s=r.responses;a<s.length;a++){var l=s[a];observe(l,"expanded",(function(t){return e.remark(t)}))}else"tag"===r.type&&t(r.items||[])}};t(this.menu.renderItems),"none"!==this.options.pagination&&observe(this.menu,"renderItems",(function(){return t(e.menu.renderItems)}))}}),Object.defineProperty(e.prototype,"remark",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.newValue&&setTimeout((function(){return t.marker.mark()}),0)}}),Object.defineProperty(e,"fromJS",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var i,o=new e(t.definition.data,t.definition.url,t.options,!1);setGlobalStore(o),o.menu.activeItemIdx=void 0!==t.menu.activeItemIdx?t.menu.activeItemIdx:-1,o.definition instanceof VersionedSpecStore&&t.definition.activeVersionIdx&&(o.definition.activeVersionIdx=t.definition.activeVersionIdx||0);var n=o.menu.flatItems[o.menu.activeItemIdx];if(n&&o.menu.activate(n,!1),!o.options.disableSearch){var r=new URL(window.location.href);r.pathname=t.searchIndexPath&&t.searchIndexPath.startsWith("/")?t.searchIndexPath:r.pathname+(r.pathname.endsWith("/")?"":"/")+t.searchIndexPath,null===(i=o.search)||void 0===i||i.fromExternalJS(r.toString(),t.searchIndexExport)}return t.tryItOperationId&&(o.tryItOperation=o.menu.flatItems.find((function(e){return e.id===t.tryItOperationId}))),setTimeout((function(){return o.observeAllAndRemark()}),0),o}}),Object.defineProperty(e.prototype,"toJS",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return __awaiter(this,void 0,void 0,(function(){var t,i;return __generator(this,(function(o){switch(o.label){case 0:return i={menu:{activeItemIdx:this.menu.activeItemIdx},definition:this.definition instanceof VersionedSpecStore?{url:void 0,data:this.definition.toJS()}:{url:this.definition.parser.definitionUrl,data:this.definition.parser.definition}},this.search?[4,this.search.toJS()]:[3,2];case 1:return t=o.sent(),[3,3];case 2:t=void 0,o.label=3;case 3:return[2,(i.searchIndex=t,i.options=this.rawOptions,i.tryItOperationId=null===(e=this.tryItOperation)||void 0===e?void 0:e.id,i)]}}))}))}}),Object.defineProperty(e.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.scroll.dispose(),this.menu.dispose(),this.search&&this.search.dispose(),this.disposer()}}),Object.defineProperty(e.prototype,"updateMarkOnMenu",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=Math.max(0,e),i=Math.min(this.menu.flatItems.length,t+5),o=[],n=t;n<i;n++){(r=this.menu.getElementAt(n))&&(r&&o.push(r))}if("item"===this.options.pagination){var r,a=(this.menu.flatItems[e]||{}).parent;if(null==a?void 0:a.absoluteIdx)(r=this.menu.getElementAt(a.absoluteIdx))&&o.push(r)}this.marker.addOnly(o),this.marker.mark()}}),__decorate([observable],e.prototype,"search",void 0),__decorate([observable],e.prototype,"tryItOperation",void 0),__decorate([observable],e.prototype,"showRightPanel",void 0),__decorate([observable],e.prototype,"layout",void 0),__decorate([observable],e.prototype,"activeSampleLanguage",void 0),__decorate([observable],e.prototype,"isLoading",void 0),__decorate([action],e.prototype,"onDidMount",null),__decorate([action],e.prototype,"toggleRightPanel",null),__decorate([action],e.prototype,"toggleLayout",null),__decorate([action],e.prototype,"disableConsole",null),__decorate([action],e.prototype,"enableConsole",null),__decorate([action],e.prototype,"tryItOut",null),__decorate([action],e.prototype,"setActiveSampleLanguage",null),__decorate([bind,debounce(500)],e.prototype,"activateSampleLanguage",null),__decorate([action],e.prototype,"startLoader",null),__decorate([action],e.prototype,"stopLoader",null),e}();export{ProStore};var DEFAULT_OPTIONS={ignoreNamedSchemas:["java.io.ObjectStreamField"],allowedMdComponents:(_a={RedocResponse:{component:RedocResponse,propsSelector:function(e){return{store:e}}},PullRight:{component:PullRight,propsSelector:function(){return{}}}},_a[SECURITY_DEFINITIONS_COMPONENT_NAME]={component:SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[SECURITY_DEFINITIONS_JSX_NAME]={component:SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[SCHEMA_DEFINITION_JSX_NAME]={component:SchemaDefinition,propsSelector:function(e){return{parser:e.definition.parser,options:e.options,layout:e.layout,showRightPanel:e.showRightPanel}}},_a)};function joinURLs(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),t.startsWith("/")&&(t=t.substring(1)),e+"/"+t}function addTrailingSlash(e){return e.endsWith("/")?e:e+"/"}function getSpecVersionObj(e){return e.openapi?{openapi:e.openapi}:e.swagger?{swagger:e.swagger}:void 0}function deepClone(e){if("object"!=typeof e||null===e)return e;var t=Array.isArray(e)?[]:{};for(var i in e){var o=e[i];t[i]=deepClone(o)}return t}
|
|
1
|
+
var _a;import{__assign,__awaiter,__decorate,__generator}from"tslib";import{action,makeObservable,observable,observe}from"mobx";import{bundle,Config}from"@redocly/openapi-core";import{bind,debounce}from"decko";import{IS_BROWSER,MarkerService,RedocNormalizedOptions,ScrollService,SecurityDefs,SpecStore,SECURITY_DEFINITIONS_COMPONENT_NAME,SECURITY_DEFINITIONS_JSX_NAME,SCHEMA_DEFINITION_JSX_NAME,SchemaDefinition,createParsedDocument}from"../redoc-lib";import{FakeHistoryService,ProHashHistoryService,PushStateHistoryService}from"./history";import{ProMenu}from"./ProMenu";import{DeepSearchStore,RemoteSearch,DEFAULT_SEARCH_MAX_DEPTH}from"./SearchStore";import{extendTheme}from"./extendTheme";import{RedocResponse,PullRight}from"../components/pluggable";import{VersionedSpecStore}from"./VersionedSpecStore";import parseToken from"./check";import{normalizePath}from"./utils";import{fromSessionStorage,toSessionStorage,toLocalStorage,fromLocalStorage,setGlobalStore}from"../utils";import{LayoutVariant}from"./store-types";var global="undefined"==typeof window?{__REDOCLY_SEARCH_URL:void 0}:window,NestingGroup=function(){function e(e,t,i,o){var n=this;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"absoluteIdx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"linkable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"externalDocs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"active",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"expanded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"depth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"level",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),makeObservable(this),this.id="section/"+e,this.type="nesting-group",this.name=i||"",this.level=1,this.depth=1,this.description="",this.parent=void 0,this.expanded=!1,this.items=t,this.linkable=!!o,t.forEach((function(e){return e.parent=n})),increaseDepthDeep(t)}return Object.defineProperty(e.prototype,"activate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.active=!0}}),Object.defineProperty(e.prototype,"expand",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.expanded=!0,this.parent&&this.parent.expand()}}),Object.defineProperty(e.prototype,"collapse",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.expanded=!1}}),Object.defineProperty(e.prototype,"deactivate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.active=!1}}),__decorate([observable],e.prototype,"active",void 0),__decorate([observable],e.prototype,"expanded",void 0),__decorate([action],e.prototype,"activate",null),__decorate([action],e.prototype,"expand",null),__decorate([action],e.prototype,"collapse",null),__decorate([action],e.prototype,"deactivate",null),e}();export{NestingGroup};function increaseDepthDeep(e){Array.isArray(e)&&e.forEach((function(e){e.depth++,e.parent&&"group"===e.parent.type&&(e.depth=e.parent.depth),increaseDepthDeep(e.items)}))}var ProStore=function(){function e(e,t,i,o){var n=this;void 0===i&&(i={}),void 0===o&&(o=!0),Object.defineProperty(this,"rawOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"menu",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"definition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"marker",{enumerable:!0,configurable:!0,writable:!0,value:new MarkerService}),Object.defineProperty(this,"scroll",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"disposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"search",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tryItOperation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showRightPanel",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"layout",{enumerable:!0,configurable:!0,writable:!0,value:LayoutVariant.THREE_PANEL}),Object.defineProperty(this,"activeSampleLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isLoading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"l",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),makeObservable(this),this.initProOptions(i),IS_BROWSER&&(this.l=parseToken(i.licenseKey),this.l.then((function(e){e.valid&&e.allowed&&!e.expired||e.local||(n.menu.items=[],n.menu.flatItems=n.menu.flatItems.slice(0,1),n.menu.renderItems=[])})));var r="object"==typeof e&&"versions"in e,a=this.options.disableSidebar?new FakeHistoryService(this.options):"browser"===this.options.routingStrategy?new PushStateHistoryService(this.options,r):new ProHashHistoryService(this.options,r);this.definition=r?new VersionedSpecStore(e,this.options,a.currentId.split("/")[0]):new SpecStore(e,t,this.options),i.downloadDefinitionUrl&&(this.definition.info.downloadFileName=""),this.scroll=new ScrollService(this.options),this.options.disableSidebar||ProMenu.updateOnHistory(a.currentId,this.scroll),this.menu=new ProMenu(this.definition,this.scroll,this.options,a),this.menu.initOnHistory(),this.options.disableSearch||this.initSearch(this.options,o),this.disposer=observe(this.menu,"none"===this.options.pagination?"activeItemIdx":"activeRenderItemIdx",(function(e){setTimeout((function(){return n.updateMarkOnMenu(e.newValue)}))})),setGlobalStore(this)}return Object.defineProperty(e.prototype,"initProOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,i,o,n,r;e=deepClone(e),this.rawOptions=extendTheme(e),this.options=new RedocNormalizedOptions(this.rawOptions,DEFAULT_OPTIONS),this.options.showConsole=null===(t=this.rawOptions.showConsole)||void 0===t||t,this.options.hideRightPanel=null!==(i=this.rawOptions.hideRightPanel)&&void 0!==i&&i,this.showRightPanel=!this.options.hideRightPanel,this.options.showRightPanelToggle=null===(o=this.rawOptions.showRightPanelToggle)||void 0===o||o,this.options.showChangeLayoutButton=null===(n=this.rawOptions.showChangeLayoutButton)||void 0===n||n,this.options.layout=this.rawOptions.layout||LayoutVariant.THREE_PANEL,this.options.defaultSampleLanguage=this.rawOptions.defaultSampleLanguage||"",this.options.deepLinkSeparator=this.rawOptions.deepLinkSeparator||"/",this.options.deepLinkPrefix=this.rawOptions.deepLinkPrefix||"!",this.options.disableDeepLinks=this.rawOptions.disableDeepLinks||!1,this.options.sideNavStyle=this.rawOptions.sideNavStyle||"summary-only",this.options.whiteLabel=!!this.rawOptions.whiteLabel,this.options.hideLogo=!!this.rawOptions.hideLogo,this.options.hideInfoSection=!!this.rawOptions.hideInfoSection,this.options.oAuth2RedirectURI=this.rawOptions.oAuth2RedirectURI||null,this.options.oAuth2RedirectURI=this.rawOptions.oAuth2RedirectURI||null,this.options.events=this.rawOptions.events||{},this.options.corsProxyUrl=this.rawOptions.corsProxyUrl?addTrailingSlash(this.rawOptions.corsProxyUrl):null,this.options.authCorsProxyUrl=this.rawOptions.authCorsProxyUrl?addTrailingSlash(this.rawOptions.authCorsProxyUrl):null,this.options.theme.scrollYOffset=this.options.scrollYOffset,this.options.linkForId=this.rawOptions.linkForId||null,this.options.generateDeepLink=this.rawOptions.generateDeepLink||null,this.options.onDeepLinkClick=this.rawOptions.onDeepLinkClick||null,this.options.requestInterceptor=this.rawOptions.requestInterceptor||null,this.options.sidebarLinks=this.rawOptions.sidebarLinks||{};var a="object"==typeof this.rawOptions.layout?this.rawOptions.layout:null;if(this.options.pagination=this.rawOptions.pagination||"none",this.options.routingStrategy="none"===this.options.pagination?"hash":"browser",!(null===(r=this.rawOptions)||void 0===r?void 0:r.pagination)&&(null==a?void 0:a.scope))switch(console.warn('"layout.scope" and "routingStrategy" settings are deprecated. Please, use "pagination" instead.'),null==a?void 0:a.scope){case"all":default:this.options.pagination="none",this.options.routingStrategy="hash";break;case"section":this.options.pagination="section",this.options.routingStrategy="browser";break;case"item":this.options.pagination="item",this.options.routingStrategy="browser"}this.options.markdownItemsPagination="none",!1!==this.rawOptions.showNextButton&&(this.options.showNextButton=!0),this.options.disableSidebar=!!e.disableSidebar,this.options.disableSidebar&&(this.options.theme.sidebar.width="0px"),this.options.skipBundleAndConvert=!!e.skipBundleAndConvert,this.options.routingBasePath=e.routingBasePath&&normalizePath(e.routingBasePath)||"",this.options.searchAutoExpand=!1!==e.searchAutoExpand,this.options.searchMode=e.searchMode||"default",this.options.ctrlFHijack=void 0===e.ctrlFHijack||e.ctrlFHijack,this.options.disablePaginationLoadingAnimation=!!e.disablePaginationLoadingAnimation||"none"===this.options.pagination,this.options.showConsole,this.options.generateCodeSamples=e.generateCodeSamples||{languages:[]},this.options.searchMaxDepth=this.rawOptions.searchMaxDepth||DEFAULT_SEARCH_MAX_DEPTH}}),Object.defineProperty(e.prototype,"initSearch",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var i=this;global.__REDOCLY_SEARCH_URL?this.search=new RemoteSearch(global.__REDOCLY_SEARCH_URL):this.search=new DeepSearchStore(e),t&&setTimeout((function(){var e;return null===(e=i.search)||void 0===e?void 0:e.indexItems(i.menu.items)}),50),this.definition instanceof VersionedSpecStore&&observe(this.definition,"activeVersionIdx",(function(t){var o,n,r=i.definition;null===(o=i.search)||void 0===o||o.dispose(),i.search=new DeepSearchStore(e);var a=r.versions[t.newValue]._searchIndexName;if(IS_BROWSER&&a){var s=r.versions[t.newValue]._searchIndexName,l=new URL(window.location.href);l.pathname=joinURLs(i.options.routingBasePath,s),null===(n=i.search)||void 0===n||n.fromExternalJS(l.toString(),__redoc_state.searchIndexExport),i.observeAllAndRemark()}else setTimeout((function(){var e;null===(e=i.search)||void 0===e||e.indexItems(i.menu.items)}),0)})),IS_BROWSER&&this.observeAllAndRemark()}}),Object.defineProperty(e.prototype,"onDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.menu.updateOnHistory(),this.updateMarkOnMenu(this.menu.activeItemIdx),this.layout=fromLocalStorage("layoutVariant")||this.options.layout||this.layout,this.activeSampleLanguage=fromLocalStorage("activeSampleLanguage")||this.options.defaultSampleLanguage,this.options.showRightPanelToggle){var e=fromSessionStorage("showRightPanelToggleState");e&&(this.showRightPanel="true"===e)}}}),Object.defineProperty(e.prototype,"toggleRightPanel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.showRightPanel=null!=e?e:!this.showRightPanel,toSessionStorage("showRightPanelToggleState",JSON.stringify(this.showRightPanel))}}),Object.defineProperty(e.prototype,"toggleLayout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=LayoutVariant.THREE_PANEL),this.layout=e,toLocalStorage("layoutVariant",e)}}),Object.defineProperty(e.prototype,"disableConsole",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.options.showConsole=!1}}),Object.defineProperty(e.prototype,"enableConsole",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.options.showConsole=!0}}),Object.defineProperty(e.prototype,"tryItOut",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.tryItOperation=e}}),Object.defineProperty(e.prototype,"setActiveSampleLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.activeSampleLanguage===e)return this.stopLoader();this.activeSampleLanguage=e,toLocalStorage("activeSampleLanguage",e)}}),Object.defineProperty(e.prototype,"activateSampleLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setActiveSampleLanguage(e)}}),Object.defineProperty(e.prototype,"startLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isLoading||(this.isLoading=!0)}}),Object.defineProperty(e.prototype,"stopLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isLoading&&(this.isLoading=!1)}}),Object.defineProperty(e.prototype,"dereferenceSpecForTryIt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,i,o,n;return __awaiter(this,void 0,void 0,(function(){var r,a,s,l,p,u,c;return __generator(this,(function(h){switch(h.label){case 0:return r=this.definition.parser.definition,a=JSON.parse(JSON.stringify(r)),s=__assign(__assign({},getSpecVersionObj(a)),{components:a.components,paths:(u={},u[e.path]=(c={},c[e.httpVerb]=null===(i=null===(t=a.paths)||void 0===t?void 0:t[e.path])||void 0===i?void 0:i[e.httpVerb],c.parameters=null===(n=null===(o=a.paths)||void 0===o?void 0:o[e.path])||void 0===n?void 0:n.parameters,c),u)}),l=new Config({}),p=createParsedDocument(s),[4,bundle({config:l,doc:p,dereference:!0})];case 1:return h.sent(),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"observeAllAndRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=function(i){for(var o=0,n=i;o<n.length;o++){var r=n[o];if("operation"===r.type)for(var a=0,s=r.responses;a<s.length;a++){var l=s[a];observe(l,"expanded",(function(t){return e.remark(t)}))}else"tag"===r.type&&t(r.items||[])}};t(this.menu.renderItems),"none"!==this.options.pagination&&observe(this.menu,"renderItems",(function(){return t(e.menu.renderItems)}))}}),Object.defineProperty(e.prototype,"remark",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.newValue&&setTimeout((function(){return t.marker.mark()}),0)}}),Object.defineProperty(e,"fromJS",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var i,o=new e(t.definition.data,t.definition.url,t.options,!1);setGlobalStore(o),o.menu.activeItemIdx=void 0!==t.menu.activeItemIdx?t.menu.activeItemIdx:-1,o.definition instanceof VersionedSpecStore&&t.definition.activeVersionIdx&&(o.definition.activeVersionIdx=t.definition.activeVersionIdx||0);var n=o.menu.flatItems[o.menu.activeItemIdx];if(n&&o.menu.activate(n,!1),!o.options.disableSearch){var r=new URL(window.location.href);r.pathname=t.searchIndexPath&&t.searchIndexPath.startsWith("/")?t.searchIndexPath:r.pathname+(r.pathname.endsWith("/")?"":"/")+t.searchIndexPath,null===(i=o.search)||void 0===i||i.fromExternalJS(r.toString(),t.searchIndexExport)}return t.tryItOperationId&&(o.tryItOperation=o.menu.flatItems.find((function(e){return e.id===t.tryItOperationId}))),setTimeout((function(){return o.observeAllAndRemark()}),0),o}}),Object.defineProperty(e.prototype,"toJS",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return __awaiter(this,void 0,void 0,(function(){var t,i;return __generator(this,(function(o){switch(o.label){case 0:return i={menu:{activeItemIdx:this.menu.activeItemIdx},definition:this.definition instanceof VersionedSpecStore?{url:void 0,data:this.definition.toJS()}:{url:this.definition.parser.definitionUrl,data:this.definition.parser.definition}},this.search?[4,this.search.toJS()]:[3,2];case 1:return t=o.sent(),[3,3];case 2:t=void 0,o.label=3;case 3:return[2,(i.searchIndex=t,i.options=this.rawOptions,i.tryItOperationId=null===(e=this.tryItOperation)||void 0===e?void 0:e.id,i)]}}))}))}}),Object.defineProperty(e.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.scroll.dispose(),this.menu.dispose(),this.search&&this.search.dispose(),this.disposer()}}),Object.defineProperty(e.prototype,"updateMarkOnMenu",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=Math.max(0,e),i=Math.min(this.menu.flatItems.length,t+5),o=[],n=t;n<i;n++){(r=this.menu.getElementAt(n))&&(r&&o.push(r))}if("item"===this.options.pagination){var r,a=(this.menu.flatItems[e]||{}).parent;if(null==a?void 0:a.absoluteIdx)(r=this.menu.getElementAt(a.absoluteIdx))&&o.push(r)}this.marker.addOnly(o),this.marker.mark()}}),__decorate([observable],e.prototype,"search",void 0),__decorate([observable],e.prototype,"tryItOperation",void 0),__decorate([observable],e.prototype,"showRightPanel",void 0),__decorate([observable],e.prototype,"layout",void 0),__decorate([observable],e.prototype,"activeSampleLanguage",void 0),__decorate([observable],e.prototype,"isLoading",void 0),__decorate([action],e.prototype,"onDidMount",null),__decorate([action],e.prototype,"toggleRightPanel",null),__decorate([action],e.prototype,"toggleLayout",null),__decorate([action],e.prototype,"disableConsole",null),__decorate([action],e.prototype,"enableConsole",null),__decorate([action],e.prototype,"tryItOut",null),__decorate([action],e.prototype,"setActiveSampleLanguage",null),__decorate([bind,debounce(500)],e.prototype,"activateSampleLanguage",null),__decorate([action],e.prototype,"startLoader",null),__decorate([action],e.prototype,"stopLoader",null),e}();export{ProStore};var DEFAULT_OPTIONS={ignoreNamedSchemas:["java.io.ObjectStreamField"],allowedMdComponents:(_a={RedocResponse:{component:RedocResponse,propsSelector:function(e){return{store:e}}},PullRight:{component:PullRight,propsSelector:function(){return{}}}},_a[SECURITY_DEFINITIONS_COMPONENT_NAME]={component:SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[SECURITY_DEFINITIONS_JSX_NAME]={component:SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[SCHEMA_DEFINITION_JSX_NAME]={component:SchemaDefinition,propsSelector:function(e){return{parser:e.definition.parser,options:e.options,layout:e.layout,showRightPanel:e.showRightPanel}}},_a)};function joinURLs(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),t.startsWith("/")&&(t=t.substring(1)),e+"/"+t}function addTrailingSlash(e){return e.endsWith("/")?e:e+"/"}function getSpecVersionObj(e){return e.openapi?{openapi:e.openapi}:e.swagger?{swagger:e.swagger}:void 0}function deepClone(e){if("object"!=typeof e||null===e)return e;var t=Array.isArray(e)?[]:{};for(var i in e){var o=e[i];t[i]=deepClone(o)}return t}
|
|
2
2
|
//# sourceMappingURL=ProStore.js.map
|