@redocly/reference-docs 2.2.3 → 2.4.0-rc.3
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/CHANGELOG.md +33 -0
- package/bin/cli/commands/redocly-docs-cli.min.js +61 -53
- package/dist/console.redocly-reference-docs.min.js +6 -6
- package/dist/oauth2-redirect.js +2 -2
- package/dist/redocly-reference-docs.min.js +38 -30
- package/lib/components/Endpoint/Endpoint.js +1 -1
- package/lib/components/Overlay.js +1 -1
- package/lib/components/Panel/ResponsePanel.js +1 -1
- package/lib/components/RedoclyReferenceDocs.js +1 -1
- package/lib/components/Search/ProSearchBox.js +1 -1
- package/lib/components/Search/SearchField.js +1 -1
- package/lib/components/Search/styled.js +1 -1
- package/lib/components/StoreProvider.js +1 -1
- package/lib/components/console/AuthPanel.d.ts +0 -2
- package/lib/components/console/AuthPanel.js +1 -1
- package/lib/components/console/CodemirrorInput.d.ts +1 -0
- package/lib/components/console/CodemirrorInput.js +1 -1
- package/lib/components/console/Console.d.ts +1 -6
- package/lib/components/console/Console.js +1 -1
- package/lib/components/console/OAuth2Flow.d.ts +0 -2
- package/lib/components/console/OAuth2Flow.js +1 -1
- package/lib/components/console/OAuth2TokenInput.d.ts +0 -2
- package/lib/components/console/OAuth2TokenInput.js +1 -1
- package/lib/components/console/OpenIDConnect.d.ts +0 -2
- package/lib/components/console/OpenIDConnect.js +1 -1
- package/lib/components/console/RequestBody.js +1 -1
- package/lib/components/console/ServerDropdown.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/redoc-lib/src/common-elements/PrismDiv.js +1 -1
- package/lib/redoc-lib/src/common-elements/dropdown.d.ts +2 -0
- package/lib/redoc-lib/src/common-elements/icons.js +1 -1
- package/lib/redoc-lib/src/common-elements/samples.js +1 -1
- package/lib/redoc-lib/src/components/ContentItems/ContentItems.js +1 -1
- package/lib/redoc-lib/src/components/Markdown/SanitizedMdBlock.js +1 -1
- package/lib/redoc-lib/src/components/Markdown/styled.elements.d.ts +4 -0
- package/lib/redoc-lib/src/components/Markdown/styled.elements.js +1 -1
- package/lib/redoc-lib/src/components/Operation/Operation.d.ts +1 -1
- package/lib/redoc-lib/src/components/Operation/Operation.js +1 -1
- package/lib/redoc-lib/src/components/Schema/ObjectSchema.js +1 -1
- package/lib/redoc-lib/src/components/SearchBox/SearchBox.js +1 -1
- package/lib/redoc-lib/src/components/SideMenu/MenuItem.d.ts +1 -0
- package/lib/redoc-lib/src/components/SideMenu/MenuItem.js +1 -1
- package/lib/redoc-lib/src/components/SideMenu/MenuItems.js +1 -1
- package/lib/redoc-lib/src/components/SideMenu/styled.elements.js +1 -1
- package/lib/redoc-lib/src/components/SourceCode/SourceCode.js +1 -1
- package/lib/redoc-lib/src/services/Labels.d.ts +1 -0
- package/lib/redoc-lib/src/services/Labels.js +1 -1
- package/lib/redoc-lib/src/services/MenuBuilder.d.ts +10 -1
- package/lib/redoc-lib/src/services/MenuBuilder.js +1 -1
- package/lib/redoc-lib/src/services/OpenAPIParser.js +1 -1
- package/lib/redoc-lib/src/services/RedocNormalizedOptions.d.ts +18 -1
- package/lib/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
- package/lib/redoc-lib/src/services/models/Operation.d.ts +3 -0
- package/lib/redoc-lib/src/services/models/Operation.js +1 -1
- package/lib/redoc-lib/src/types/open-api.d.ts +0 -2
- package/lib/redoc-lib/src/utils/openapi.d.ts +1 -0
- package/lib/redoc-lib/src/utils/openapi.js +1 -1
- package/lib/services/ProMenu.js +1 -1
- package/lib/services/ProStore.d.ts +8 -26
- package/lib/services/ProStore.js +1 -1
- package/lib/services/history/ProHashHistoryService.js +1 -1
- package/lib/services/history/PushStateHistoryService.js +1 -1
- package/lib/services/history/helpers.js +1 -1
- package/lib/services/store-types.d.ts +4 -2
- package/lib/services/store-types.js +1 -1
- package/lib/standalone.d.ts +4 -0
- package/lib/standalone.js +1 -1
- package/lib-esm/components/Endpoint/Endpoint.js +1 -1
- package/lib-esm/components/Overlay.js +1 -1
- package/lib-esm/components/Panel/ResponsePanel.js +1 -1
- package/lib-esm/components/RedoclyReferenceDocs.js +1 -1
- package/lib-esm/components/Search/ProSearchBox.js +1 -1
- package/lib-esm/components/Search/SearchField.js +1 -1
- package/lib-esm/components/Search/styled.js +1 -1
- package/lib-esm/components/StoreProvider.js +1 -1
- package/lib-esm/components/console/AuthPanel.d.ts +0 -2
- package/lib-esm/components/console/AuthPanel.js +1 -1
- package/lib-esm/components/console/CodemirrorInput.d.ts +1 -0
- package/lib-esm/components/console/CodemirrorInput.js +1 -1
- package/lib-esm/components/console/Console.d.ts +1 -6
- package/lib-esm/components/console/Console.js +1 -1
- package/lib-esm/components/console/OAuth2Flow.d.ts +0 -2
- package/lib-esm/components/console/OAuth2Flow.js +1 -1
- package/lib-esm/components/console/OAuth2TokenInput.d.ts +0 -2
- package/lib-esm/components/console/OAuth2TokenInput.js +1 -1
- package/lib-esm/components/console/OpenIDConnect.d.ts +0 -2
- package/lib-esm/components/console/OpenIDConnect.js +1 -1
- package/lib-esm/components/console/RequestBody.js +1 -1
- package/lib-esm/components/console/ServerDropdown.js +1 -1
- package/lib-esm/index.d.ts +1 -1
- package/lib-esm/redoc-lib/src/common-elements/PrismDiv.js +1 -1
- package/lib-esm/redoc-lib/src/common-elements/dropdown.d.ts +2 -0
- package/lib-esm/redoc-lib/src/common-elements/icons.js +1 -1
- package/lib-esm/redoc-lib/src/common-elements/samples.js +1 -1
- package/lib-esm/redoc-lib/src/components/ContentItems/ContentItems.js +1 -1
- package/lib-esm/redoc-lib/src/components/Markdown/SanitizedMdBlock.js +1 -1
- package/lib-esm/redoc-lib/src/components/Markdown/styled.elements.d.ts +4 -0
- package/lib-esm/redoc-lib/src/components/Markdown/styled.elements.js +1 -1
- package/lib-esm/redoc-lib/src/components/Operation/Operation.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Operation/Operation.js +1 -1
- package/lib-esm/redoc-lib/src/components/Schema/ObjectSchema.js +1 -1
- package/lib-esm/redoc-lib/src/components/SearchBox/SearchBox.js +1 -1
- package/lib-esm/redoc-lib/src/components/SideMenu/MenuItem.d.ts +1 -0
- package/lib-esm/redoc-lib/src/components/SideMenu/MenuItem.js +1 -1
- package/lib-esm/redoc-lib/src/components/SideMenu/MenuItems.js +1 -1
- package/lib-esm/redoc-lib/src/components/SideMenu/styled.elements.js +1 -1
- package/lib-esm/redoc-lib/src/components/SourceCode/SourceCode.js +1 -1
- package/lib-esm/redoc-lib/src/services/Labels.d.ts +1 -0
- package/lib-esm/redoc-lib/src/services/Labels.js +1 -1
- package/lib-esm/redoc-lib/src/services/MenuBuilder.d.ts +10 -1
- package/lib-esm/redoc-lib/src/services/MenuBuilder.js +1 -1
- package/lib-esm/redoc-lib/src/services/OpenAPIParser.js +1 -1
- package/lib-esm/redoc-lib/src/services/RedocNormalizedOptions.d.ts +18 -1
- package/lib-esm/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
- package/lib-esm/redoc-lib/src/services/models/Operation.d.ts +3 -0
- package/lib-esm/redoc-lib/src/services/models/Operation.js +1 -1
- package/lib-esm/redoc-lib/src/types/open-api.d.ts +0 -2
- package/lib-esm/redoc-lib/src/utils/openapi.d.ts +1 -0
- package/lib-esm/redoc-lib/src/utils/openapi.js +1 -1
- package/lib-esm/services/ProMenu.js +1 -1
- package/lib-esm/services/ProStore.d.ts +8 -26
- package/lib-esm/services/ProStore.js +1 -1
- package/lib-esm/services/history/ProHashHistoryService.js +1 -1
- package/lib-esm/services/history/PushStateHistoryService.js +1 -1
- package/lib-esm/services/history/helpers.js +1 -1
- package/lib-esm/services/store-types.d.ts +4 -2
- package/lib-esm/services/store-types.js +1 -1
- package/lib-esm/standalone.d.ts +4 -0
- package/lib-esm/standalone.js +1 -1
- package/package.json +4 -5
|
@@ -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{debounce}from"lodash";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,SEARCH_MAX_DEPTH}from"./SearchStore";import{extendTheme}from"./extendTheme";import{RedocResponse,PullRight}from"../components/pluggable";import{MultipleSpecsStore}from"./MultipleSpecsStore";import{VersionedSpecStore}from"./VersionedSpecStore";import parseToken from"./check";import{normalizePath}from"./utils";import{fromStorage,toStorage,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,"dereferencedRawSpec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prevDerefKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"l",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"activateSampleLanguage",{enumerable:!0,configurable:!0,writable:!0,value:debounce((function(e){return n.setActiveSampleLanguage(e)}),500)}),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=Array.isArray(e),a=e&&Array.isArray(e.versions),s=this.options.disableSidebar?new FakeHistoryService(this.options):"browser"===this.options.routingStrategy?new PushStateHistoryService(this.options,r||a):new ProHashHistoryService(this.options,r||a);this.definition=r?new MultipleSpecsStore(e,this.options):a?new VersionedSpecStore(e,this.options,s.currentId.split("/")[0]):new SpecStore(e,t,this.options),i.downloadSpecUrl&&(this.definition.info.downloadLink=i.downloadSpecUrl,this.definition.info.downloadFileName=""),this.scroll=new ScrollService(this.options),this.options.disableSidebar||ProMenu.updateOnHistory(s.currentId,this.scroll),this.menu=new ProMenu(this.definition,this.scroll,this.options,s),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":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";break;default:this.options.pagination="none",this.options.routingStrategy="hash"}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||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=fromStorage("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,toStorage("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,"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,t){var i,o,n,r;return __awaiter(this,void 0,void 0,(function(){var a,s,l,p,u,c,h,d;return __generator(this,(function(b){switch(b.label){case 0:return(a=e+"/"+t.path+"/"+t.httpVerb)===this.prevDerefKey&&this.dereferencedRawSpec?[2,this.dereferencedRawSpec]:(this.dereferencedRawSpec=void 0,this.prevDerefKey=a,s=void 0!==e&&this.definition.specs?this.definition.specs[e].parser.definition:this.definition.parser.definition,l=JSON.parse(JSON.stringify(s)),p=__assign(__assign({},getSpecVersionObj(l)),{components:l.components,paths:(h={},h[t.path]=(d={},d[t.httpVerb]=null===(o=null===(i=l.paths)||void 0===i?void 0:i[t.path])||void 0===o?void 0:o[t.httpVerb],d.parameters=null===(r=null===(n=l.paths)||void 0===n?void 0:n[t.path])||void 0===r?void 0:r.parameters,d),h)}),u=new Config({}),c=createParsedDocument(p),[4,bundle({config:u,doc:c,dereference:!0})]);case 1:return b.sent(),this.dereferencedRawSpec=l,[2,l]}}))}))}}),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 MultipleSpecsStore||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,i=Math.max(0,e),o=Math.min(this.menu.flatItems.length,i+5),n=[],r=i;r<o;r++){var a;(a=this.menu.getElementAt(r))&&(a&&n.push(a))}"item"===this.options.pagination&&(this.menu.flatItems[e]&&this.menu.flatItems[e].parent&&(a=this.menu.getElementAt(null===(t=this.menu.flatItems[e].parent)||void 0===t?void 0:t.absoluteIdx))&&n.push(a));this.marker.addOnly(n),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([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{debounce}from"lodash";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,SEARCH_MAX_DEPTH}from"./SearchStore";import{extendTheme}from"./extendTheme";import{RedocResponse,PullRight}from"../components/pluggable";import{MultipleSpecsStore}from"./MultipleSpecsStore";import{VersionedSpecStore}from"./VersionedSpecStore";import parseToken from"./check";import{normalizePath}from"./utils";import{fromStorage,toStorage,toLocalStorage,fromLocalStorage,setGlobalStore}from"../utils";import{LayoutVariant}from"./store-types";var global="undefined"==typeof window?{__REDOCLY_SEARCH_URL:void 0}:window,ProStore=function(){function e(e,t,i,o){var n=this;void 0===i&&(i={}),void 0===o&&(o=!1),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,"dereferencedRawSpec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prevDerefKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"l",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"activateSampleLanguage",{enumerable:!0,configurable:!0,writable:!0,value:debounce((function(e){return n.setActiveSampleLanguage(e)}),500)}),makeObservable(this),setGlobalStore(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=Array.isArray(e),a=e&&Array.isArray(e.versions),s=this.options.disableSidebar?new FakeHistoryService(this.options):"browser"===this.options.routingStrategy?new PushStateHistoryService(this.options,r||a):new ProHashHistoryService(this.options,r||a);this.definition=r?new MultipleSpecsStore(e,this.options):a?new VersionedSpecStore(e,this.options,s.currentId.split("/")[0]):new SpecStore(e,t,this.options),i.downloadSpecUrl&&(this.definition.info.downloadLink=i.downloadSpecUrl,this.definition.info.downloadFileName=""),this.scroll=new ScrollService(this.options),this.options.disableSidebar||ProMenu.updateOnHistory(s.currentId,this.scroll),this.menu=new ProMenu(this.definition,this.scroll,this.options,s),"hash"===i.routingStrategy&&o?setTimeout((function(){return n.menu.initOnHistory()})):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)}))}))}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.hideTagInfo=!!this.rawOptions.hideTagInfo,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=void 0!==this.rawOptions.routingStrategy?this.rawOptions.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":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";break;default:this.options.pagination="none",this.options.routingStrategy="hash"}this.options.markdownItemsPagination=e.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.generateCodeSamples=e.generateCodeSamples||{languages:[]},this.options.searchMaxDepth=this.rawOptions.searchMaxDepth||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=fromStorage("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,toStorage("showRightPanelToggleState",JSON.stringify(this.showRightPanel))}}),Object.defineProperty(e.prototype,"disableRightPanel",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.showRightPanel=!1,this.options.showRightPanelToggle=!1}}),Object.defineProperty(e.prototype,"enableRightPanel",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.options.showRightPanelToggle=!0;var e=fromStorage("showRightPanelToggleState");e&&(this.showRightPanel="true"===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,"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,"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,"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,t){var i,o,n,r;return __awaiter(this,void 0,void 0,(function(){var a,s,l,p,h,u,c,d;return __generator(this,(function(f){switch(f.label){case 0:return(a=e+"/"+t.path+"/"+t.httpVerb)===this.prevDerefKey&&this.dereferencedRawSpec?[2,this.dereferencedRawSpec]:(this.dereferencedRawSpec=void 0,this.prevDerefKey=a,s=void 0!==e&&this.definition.specs?this.definition.specs[e].parser.definition:this.definition.parser.definition,l=JSON.parse(JSON.stringify(s)),p=__assign(__assign({},getSpecVersionObj(l)),{components:l.components,paths:(c={},c[t.path]=(d={},d[t.httpVerb]=null===(o=null===(i=l.paths)||void 0===i?void 0:i[t.path])||void 0===o?void 0:o[t.httpVerb],d.parameters=null===(r=null===(n=l.paths)||void 0===n?void 0:n[t.path])||void 0===r?void 0:r.parameters,d),c)}),h=new Config({}),u=createParsedDocument(p),[4,bundle({config:h,doc:u,dereference:!0})]);case 1:return f.sent(),this.dereferencedRawSpec=l,[2,l]}}))}))}}),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,!0);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&&"hash"!==o.options.routingStrategy&&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 MultipleSpecsStore||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,i=Math.max(0,e),o=Math.min(this.menu.flatItems.length,i+5),n=[],r=i;r<o;r++){var a;(a=this.menu.getElementAt(r))&&(a&&n.push(a))}"item"===this.options.pagination&&(this.menu.flatItems[e]&&this.menu.flatItems[e].parent&&(a=this.menu.getElementAt(null===(t=this.menu.flatItems[e].parent)||void 0===t?void 0:t.absoluteIdx))&&n.push(a));this.marker.addOnly(n),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,"disableRightPanel",null),__decorate([action],e.prototype,"enableRightPanel",null),__decorate([action],e.prototype,"disableConsole",null),__decorate([action],e.prototype,"enableConsole",null),__decorate([action],e.prototype,"toggleLayout",null),__decorate([action],e.prototype,"tryItOut",null),__decorate([action],e.prototype,"setActiveSampleLanguage",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
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{bind,debounce}from"decko";import{EventEmitter}from"eventemitter3";import{IS_BROWSER}from"../../redoc-lib";import{isSameHash}from"./helpers";var ProHashHistoryService=function(){function e(e,t){var r=this;Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"multiSpec",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emiter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"basePath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"emit",{enumerable:!0,configurable:!0,writable:!0,value:function(){r._emiter.emit("popstate",r.currentId)}});var i=e.routingBasePath||"";this.basePath=i.endsWith("/")?i.substring(0,i.length-1):i,this.basePath.startsWith("/")&&(this.basePath=this.basePath.substring(1)),this._emiter=new EventEmitter,this.bind()}return Object.defineProperty(e.prototype,"currentId",{get:function(){if(!IS_BROWSER)return"";var e=decodeURIComponent(window.location.hash.substr(1)),t=window.location.pathname.substring(1);return
|
|
1
|
+
import{__decorate}from"tslib";import{bind,debounce}from"decko";import{EventEmitter}from"eventemitter3";import{IS_BROWSER}from"../../redoc-lib";import{isSameHash}from"./helpers";var ProHashHistoryService=function(){function e(e,t){var r=this;Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"multiSpec",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emiter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"basePath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"emit",{enumerable:!0,configurable:!0,writable:!0,value:function(){r._emiter.emit("popstate",r.currentId)}});var i=e.routingBasePath||"";this.basePath=i.endsWith("/")?i.substring(0,i.length-1):i,this.basePath.startsWith("/")&&(this.basePath=this.basePath.substring(1)),this._emiter=new EventEmitter,this.bind()}return Object.defineProperty(e.prototype,"currentId",{get:function(){if(!IS_BROWSER)return"";var e=decodeURIComponent(window.location.hash.substr(1)),t=window.location.pathname.substring(1);return(t.startsWith(this.basePath+"/")||t===this.basePath)&&(t=t.substring(this.basePath.length+1)),t.endsWith("/")&&(t=t.substring(0,t.length-1)),e&&e.startsWith("operation/")?this.multiSpec?t.split("/")[0]+"/"+e:e:t?t+(e?"/"+e:""):e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"makeUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r="";return IS_BROWSER&&(r=window.location.search),(e.startsWith("/")?"/"+(this.basePath?this.basePath+"/":"")+e.substring(1):e)+r+(t?"#"+t:"")}}),Object.defineProperty(e.prototype,"linkForId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!e)return"";if(""===e)return this.makeUrl("","");var t="";return this.multiSpec&&(t="/"+e.split("/")[0],e=e.split("/").slice(1).join("/")),this.makeUrl(t,e)}}),Object.defineProperty(e.prototype,"generateDeepLink",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(t)return t+this.options.deepLinkPrefix+e}}),Object.defineProperty(e.prototype,"subscribe",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._emiter.addListener("popstate",e);return function(){return t.removeListener("popstate",e)}}}),Object.defineProperty(e.prototype,"bind",{enumerable:!1,configurable:!0,writable:!0,value:function(){IS_BROWSER&&(window.addEventListener("popstate",this.emit,!1),window.addEventListener("hashchange",this.emit,!1))}}),Object.defineProperty(e.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){IS_BROWSER&&(window.removeEventListener("popstate",this.emit),window.removeEventListener("hashchange",this.emit))}}),Object.defineProperty(e.prototype,"replace",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(void 0===t&&(t=!1),t)return this.replaceDebounced(e);this.replaceNow(e,t)}}),Object.defineProperty(e.prototype,"replaceForField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;if(void 0===t&&(t=!1),IS_BROWSER&&e){var i,n=new URL(e,window.location.href);i=n,t?window.history.replaceState(null,"",i):(window.history.pushState(null,"",i),r.emit())}}}),Object.defineProperty(e.prototype,"replaceNow",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(void 0===t&&(t=!1),IS_BROWSER&&null!=e&&!isSameHash(e,this.currentId)){var r=new URL(this.linkForId(e),window.location.href);t?IS_BROWSER&&window.history.replaceState(null,"",r.href):IS_BROWSER&&(window.history.pushState(null,"",r.href),this.emit())}}}),Object.defineProperty(e.prototype,"replaceDebounced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.replaceNow(e,!0)}}),__decorate([bind],e.prototype,"replace",null),__decorate([bind],e.prototype,"replaceForField",null),__decorate([bind,debounce],e.prototype,"replaceDebounced",null),e}();export{ProHashHistoryService};
|
|
2
2
|
//# sourceMappingURL=ProHashHistoryService.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{bind,debounce}from"decko";import{EventEmitter}from"eventemitter3";import{IS_BROWSER}from"../../redoc-lib";import{isSameHash,joinWithSeparator}from"./helpers";var PushStateHistoryService=function(){function e(e,t){var i=this;Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"multispec",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emiter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"basePath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"markdownItemsPagination",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pagination",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"emit",{enumerable:!0,configurable:!0,writable:!0,value:function(){i._emiter.emit("popstate",i.currentId)}});var r=e.routingBasePath;this.markdownItemsPagination=e.markdownItemsPagination,this.pagination=e.pagination,this.basePath=r.endsWith("/")?r.substring(0,r.length-1):r,this.basePath.startsWith("/")&&(this.basePath=this.basePath.substring(1)),this._emiter=new EventEmitter,this.bind()}return Object.defineProperty(e.prototype,"currentId",{get:function(){if(!IS_BROWSER)return"";var e=decodeURIComponent(window.location.hash.substr(1)),t=window.location.pathname.substring(1);return t.startsWith(this.basePath+"/")&&(t=t.substring(this.basePath.length+1)),t.endsWith("/")&&(t=t.substring(0,t.length-1)),e&&e.startsWith("operation/")?joinWithSeparator(t,e,"/"):t?"item"===this.pagination&&e.startsWith(this.options.deepLinkPrefix)?joinWithSeparator(t,e,this.options.deepLinkPrefix):joinWithSeparator(t,e,"/"):e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"makeUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var i,r="";return IS_BROWSER&&(r=window.location.search),i=e.startsWith("/")?"/"+joinWithSeparator(this.basePath,e.substring(1),"/"):e,joinWithSeparator(i+r,t,"#")}}),Object.defineProperty(e.prototype,"generateDeepLink",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return t?t+("item"===this.options.pagination?"#":"")+this.options.deepLinkPrefix+e:null}}),Object.defineProperty(e.prototype,"linkForId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e&&(e=""),""===e)return this.makeUrl("/","");var t="";if(this.multispec&&(t="/"+e.split("/")[0],e=e.split("/").slice(1).join("/")),e.startsWith("operation/")){if(this.multispec&&IS_BROWSER){var i=window.location.pathname.substring(1);i.startsWith(this.basePath)&&(i=i.substring(this.basePath.length)).startsWith("/")&&(i=i.substring(1));var r="/"+i.split("/")[0];return t===r?this.makeUrl("",e):this.makeUrl(i.replace(r,t),e)}return this.makeUrl("",e)}var n,
|
|
1
|
+
import{__decorate}from"tslib";import{bind,debounce}from"decko";import{EventEmitter}from"eventemitter3";import{IS_BROWSER}from"../../redoc-lib";import{isSameHash,joinWithSeparator}from"./helpers";var PushStateHistoryService=function(){function e(e,t){var i=this;Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"multispec",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emiter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"basePath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"markdownItemsPagination",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pagination",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"emit",{enumerable:!0,configurable:!0,writable:!0,value:function(){i._emiter.emit("popstate",i.currentId)}});var r=e.routingBasePath;this.markdownItemsPagination=e.markdownItemsPagination,this.pagination=e.pagination,this.basePath=r.endsWith("/")?r.substring(0,r.length-1):r,this.basePath.startsWith("/")&&(this.basePath=this.basePath.substring(1)),this._emiter=new EventEmitter,this.bind()}return Object.defineProperty(e.prototype,"currentId",{get:function(){if(!IS_BROWSER)return"";var e=decodeURIComponent(window.location.hash.substr(1)),t=decodeURIComponent(window.location.pathname.substring(1));return t.startsWith(this.basePath+"/")&&(t=t.substring(this.basePath.length+1)),t.endsWith("/")&&(t=t.substring(0,t.length-1)),e&&e.startsWith("operation/")?joinWithSeparator(t,e,"/"):t?"item"===this.pagination&&e.startsWith(this.options.deepLinkPrefix)?joinWithSeparator(t,e,this.options.deepLinkPrefix):joinWithSeparator(t,e,"/"):e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"makeUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var i,r="";return IS_BROWSER&&(r=window.location.search),i=e.startsWith("/")?"/"+joinWithSeparator(this.basePath,e.substring(1),"/"):e,joinWithSeparator(i+r,t,"#")}}),Object.defineProperty(e.prototype,"generateDeepLink",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return t?t+("item"===this.options.pagination?"#":"")+this.options.deepLinkPrefix+e:null}}),Object.defineProperty(e.prototype,"linkForId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e&&(e=""),""===e)return this.makeUrl("/","");var t="";if(this.multispec&&(t="/"+e.split("/")[0],e=e.split("/").slice(1).join("/")),e.startsWith("operation/")){if(this.multispec&&IS_BROWSER){var i=window.location.pathname.substring(1);i.startsWith(this.basePath)&&(i=i.substring(this.basePath.length)).startsWith("/")&&(i=i.substring(1));var r="/"+i.split("/")[0];return t===r?this.makeUrl("",e):this.makeUrl(i.replace(r,t),e)}return this.makeUrl("",e)}var n,o=t,a="";if(e.startsWith("section/")||!e){var s=(e||"").split("/")[1];s&&"section"===this.markdownItemsPagination?(o=t+"/section/"+s,a=e):(o=t+"/",a=e)}if(e.startsWith("group/")){var l=e.match(/group\/(.*)\/(paths\/.*\/\w+|operation\/[^/]*)/);if(l)o=t+"/group/"+l[1],a=l[2]||"";else o=t+"/"+e,a=""}"section"===this.pagination&&e.startsWith("tag/")&&(o=t+"/"+(n=e.split("/")).slice(0,2).join("/"),a=n.slice(2).join("/"));"item"===this.pagination&&e.startsWith("tag/")&&(o=t+"/"+e,"section"===(n=e.split("/"))[2]&&(o=t+"/"+n.slice(0,2).join("/"),a=n.slice(2).join("/")));return this.makeUrl(o,a)}}),Object.defineProperty(e.prototype,"subscribe",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._emiter.addListener("popstate",e);return function(){return t.removeListener("popstate",e)}}}),Object.defineProperty(e.prototype,"bind",{enumerable:!1,configurable:!0,writable:!0,value:function(){IS_BROWSER&&window.addEventListener("popstate",this.emit,!1)}}),Object.defineProperty(e.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){IS_BROWSER&&window.removeEventListener("popstate",this.emit)}}),Object.defineProperty(e.prototype,"replace",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(void 0===t&&(t=!1),t)return this.replaceDebounced(e);this.replaceNow(e,t)}}),Object.defineProperty(e.prototype,"replaceForField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(void 0===t&&(t=!1),IS_BROWSER&&e){var i,r=new URL(e,window.location.href);i=r,t&&window.history.replaceState(null,"",i),window.history.pushState(null,"",i),this.emit()}}}),Object.defineProperty(e.prototype,"replaceNow",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(void 0===t&&(t=!1),IS_BROWSER&&null!=e&&!isSameHash(e,this.currentId)){var i=new URL(this.linkForId(e),window.location.href);t?IS_BROWSER&&window.history.replaceState(null,"",i.href):IS_BROWSER&&(window.history.pushState(null,"",i.href),this.emit())}}}),Object.defineProperty(e.prototype,"replaceDebounced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.replaceNow(e,!0)}}),__decorate([bind],e.prototype,"replace",null),__decorate([bind],e.prototype,"replaceForField",null),__decorate([bind,debounce],e.prototype,"replaceDebounced",null),e}();export{PushStateHistoryService};
|
|
2
2
|
//# sourceMappingURL=PushStateHistoryService.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{stringify as stringifyQueryString}from"query-string";export function isSameHash(e,i){return e===i||"#"+e===i||e==="#"+i}function
|
|
1
|
+
import{stringify as stringifyQueryString}from"query-string";export function isSameHash(e,i){return e===i||"#"+e===i||e==="#"+i}var getContextTypeIndex=function(e){var i,o,n,d,t,l,r,s,v,p,u,a,c,y,f;if(!e.in)return"request"===e.deps.type&&(null===(n=null===(o=null===(i=e.deps.operation)||void 0===i?void 0:i.requestBody)||void 0===o?void 0:o.content)||void 0===n?void 0:n.mediaTypes)?(null===(l=null===(t=null===(d=e.deps.operation)||void 0===d?void 0:d.requestBody)||void 0===t?void 0:t.content)||void 0===l?void 0:l.mediaTypes.length)>1?null===(v=null===(s=null===(r=e.deps.operation)||void 0===r?void 0:r.requestBody)||void 0===s?void 0:s.content)||void 0===v?void 0:v.active:void 0:"response"===e.deps.type&&(null===(u=null===(p=e.deps.response)||void 0===p?void 0:p.content)||void 0===u?void 0:u.mediaTypes)&&(null===(c=null===(a=e.deps.response)||void 0===a?void 0:a.content)||void 0===c?void 0:c.mediaTypes.length)>1?null===(f=null===(y=e.deps.response)||void 0===y?void 0:y.content)||void 0===f?void 0:f.active:void 0};export function constructFieldDeepFragment(e){var i,o,n,d;if(!e)return null;if(!e.deps.operation)return null;if(null===(i=e.deps.operation)||void 0===i?void 0:i.isCallback)return null;var t={t:e.deps.type,in:e.in||e.deps.in,c:"response"===e.deps.type?null===(o=e.deps.response)||void 0===o?void 0:o.code:void 0,cb:(null===(n=e.deps.operation)||void 0===n?void 0:n.isCallback)?null===(d=e.deps.operation)||void 0===d?void 0:d.id:void 0,ct:getContextTypeIndex(e),path:e.fieldFullPath};return stringifyQueryString(t,{encode:!1})}export function joinWithSeparator(e,i,o){return void 0===e&&(e=""),void 0===i&&(i=""),void 0===o&&(o="/"),e.endsWith(o)&&(e=e.slice(0,-o.length)),i.startsWith(o)&&(i=i.slice(o.length)),e&&i?e+o+i:e+i}
|
|
2
2
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -8,12 +8,13 @@ export declare enum AnalyticsEventType {
|
|
|
8
8
|
OperationServerExpanded = "OperationServerExpanded",
|
|
9
9
|
PanelToggle = "PanelToggle",
|
|
10
10
|
TryItOpen = "TryItOpen",
|
|
11
|
+
LoadingCompleted = "LoadingCompleted",
|
|
11
12
|
TryItSent = "TryItSent"
|
|
12
13
|
}
|
|
13
14
|
export interface AnalyticsEvent {
|
|
14
15
|
eventType: AnalyticsEventType;
|
|
15
|
-
resource: 'Redocly_CodeSample' | 'Redocly_Operation' | 'Redocly_OperationTryIt';
|
|
16
|
-
action: 'LanguageSwitched' | 'PanelToggled' | 'Opened' | 'NavigatedOverrideLink' | 'Sent' | 'ValidationFailed';
|
|
16
|
+
resource: 'Redocly_CodeSample' | 'Redocly_Operation' | 'Redocly_OperationTryIt' | 'Redocly_ReferenceDocs';
|
|
17
|
+
action: 'LanguageSwitched' | 'PanelToggled' | 'Opened' | 'NavigatedOverrideLink' | 'Sent' | 'ValidationFailed' | 'Loaded';
|
|
17
18
|
operationId?: string;
|
|
18
19
|
operationPath: string;
|
|
19
20
|
operationHttpVerb: string;
|
|
@@ -38,5 +39,6 @@ export declare type Events = {
|
|
|
38
39
|
tryItOpen?: (event: TryItOpenedEvent) => void;
|
|
39
40
|
tryItSent?: (event: TryItOpenedEvent) => void;
|
|
40
41
|
panelToggle?: (event: PanelToggleEvent) => void;
|
|
42
|
+
loadingCompleted?: (event: Pick<AnalyticsEvent, 'action' | 'eventType' | 'resource'>) => void;
|
|
41
43
|
};
|
|
42
44
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var LayoutVariant;!function(e){e.STACKED="stacked",e.THREE_PANEL="three-panel"}(LayoutVariant||(LayoutVariant={}));export var AnalyticsEventType;!function(e){e.CodeSampleLanguageSwitched="CodeSampleLanguageSwitched",e.CodeSampleCopied="CodeSampleCopied",e.OperationServerExpanded="OperationServerExpanded",e.PanelToggle="PanelToggle",e.TryItOpen="TryItOpen",e.TryItSent="TryItSent"}(AnalyticsEventType||(AnalyticsEventType={}));
|
|
1
|
+
export var LayoutVariant;!function(e){e.STACKED="stacked",e.THREE_PANEL="three-panel"}(LayoutVariant||(LayoutVariant={}));export var AnalyticsEventType;!function(e){e.CodeSampleLanguageSwitched="CodeSampleLanguageSwitched",e.CodeSampleCopied="CodeSampleCopied",e.OperationServerExpanded="OperationServerExpanded",e.PanelToggle="PanelToggle",e.TryItOpen="TryItOpen",e.LoadingCompleted="LoadingCompleted",e.TryItSent="TryItSent"}(AnalyticsEventType||(AnalyticsEventType={}));
|
|
2
2
|
//# sourceMappingURL=store-types.js.map
|
package/lib-esm/standalone.d.ts
CHANGED
|
@@ -18,6 +18,10 @@ import { LayoutVariant } from './services/store-types';
|
|
|
18
18
|
export { setSecurityDetails, setParameterValue, setSecurityDetailsVariants } from './utils';
|
|
19
19
|
export declare function toggleLayout(layout?: LayoutVariant): void;
|
|
20
20
|
export declare function toggleRightPanel(value?: boolean): void;
|
|
21
|
+
export declare function disableRightPanel(): void;
|
|
22
|
+
export declare function enableRightPanel(): void;
|
|
23
|
+
export declare function disableConsole(): void;
|
|
24
|
+
export declare function enableConsole(): void;
|
|
21
25
|
export declare function hydrate(state: ProStoreState, element?: Element | null): void;
|
|
22
26
|
export declare function init(definitionOrDefinitionUrl: string | any, options?: RedocProRawOptions, element?: Element | null, callback?: () => void): void;
|
|
23
27
|
export declare function setPublicPath(path: string): void;
|
package/lib-esm/standalone.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign}from"tslib";import"core-js/es/array/find-index";import"core-js/es/array/find";import"core-js/es/array/includes";import"core-js/es/map";import"core-js/es/number/is-integer";import"core-js/es/object/assign";import"core-js/es/object/entries";import"core-js/es/object/is";import"core-js/es/object/values";import"core-js/es/promise";import"core-js/es/string/ends-with";import"core-js/es/string/starts-with";import"core-js/es/symbol";import"unfetch/polyfill/index";import"url-polyfill";import{dirname}from"path";import*as React from"react";import{hydrate as hydrateComponent,render}from"react-dom";import{querySelector,IS_BROWSER}from"./redoc-lib";import{ProStore}from"./services/ProStore";import{LayoutVariant}from"./services/store-types";import{RedoclyReferenceDocs,RedoclyReferenceDocsStandalone,RedoclyReferenceDocsMultiStandalone}from"./components/RedoclyReferenceDocs";import{getGlobalStore}from"./utils";export{setSecurityDetails,setParameterValue,setSecurityDetailsVariants}from"./utils";export function toggleLayout(e){var
|
|
1
|
+
import{__assign}from"tslib";import"core-js/es/array/find-index";import"core-js/es/array/find";import"core-js/es/array/includes";import"core-js/es/map";import"core-js/es/number/is-integer";import"core-js/es/object/assign";import"core-js/es/object/entries";import"core-js/es/object/is";import"core-js/es/object/values";import"core-js/es/promise";import"core-js/es/string/ends-with";import"core-js/es/string/starts-with";import"core-js/es/symbol";import"unfetch/polyfill/index";import"url-polyfill";import{dirname}from"path";import*as React from"react";import{hydrate as hydrateComponent,render}from"react-dom";import{querySelector,IS_BROWSER}from"./redoc-lib";import{ProStore}from"./services/ProStore";import{LayoutVariant}from"./services/store-types";import{RedoclyReferenceDocs,RedoclyReferenceDocsStandalone,RedoclyReferenceDocsMultiStandalone}from"./components/RedoclyReferenceDocs";import{getGlobalStore,fromStorage}from"./utils";export{setSecurityDetails,setParameterValue,setSecurityDetailsVariants}from"./utils";export function toggleLayout(e){var t=getGlobalStore();t&&t.toggleLayout((null!=e?e:t.layout===LayoutVariant.STACKED)?LayoutVariant.THREE_PANEL:LayoutVariant.STACKED)}export function toggleRightPanel(e){var t=getGlobalStore();t&&t.toggleRightPanel(e)}export function disableRightPanel(){var e=getGlobalStore();e&&(e.showRightPanel=!1,e.options.showRightPanelToggle=!1)}export function enableRightPanel(){var e=getGlobalStore();if(e){e.options.showRightPanelToggle=!0;var t=fromStorage("showRightPanelToggleState");t?e.toggleRightPanel("true"===t):e.toggleRightPanel(!0)}}export function disableConsole(){var e=getGlobalStore();e&&e.disableConsole()}export function enableConsole(){var e=getGlobalStore();e&&e.enableConsole()}var url=getJsUrl(),__dirname=url?dirname(url)+"/":"";function attributesMap(e){for(var t={},r=e.attributes,o=0;o<r.length;o++){var n=r[o];t[n.name]=n.value}return t}function parseOptionsFromElement(e){var t=attributesMap(e),r={};for(var o in t){r[o.replace(/-(.)/g,(function(e,t){return t.toUpperCase()}))]=t[o]}return r}export function hydrate(e,t){void 0===t&&(t=document.querySelector("redoc"));var r=ProStore.fromJS(e);hydrateComponent(React.createElement(RedoclyReferenceDocs,{store:r}),t)}export function init(e,t,r,o){if(void 0===t&&(t={}),void 0===r&&(r=querySelector("redoc")),null===r)throw new Error('"element" argument is not provided and <redoc> tag is not found on the page');var n,i;Array.isArray(e)||e&&e.versions?render(React.createElement(RedoclyReferenceDocsMultiStandalone,{definitions:e,options:__assign(__assign({},t),parseOptionsFromElement(r))},["Loading..."]),r,o):("string"==typeof e?n=e:"object"==typeof e&&(i=e),render(React.createElement(RedoclyReferenceDocsStandalone,{definition:i,definitionUrl:n,options:__assign(__assign({},t),parseOptionsFromElement(r))},["Loading..."]),r,o))}export function setPublicPath(e){__webpack_public_path__=e}export var version=__REDOCLY_API_REFERENCE_VERSION__;export var revision=__REDOCLY_API_REFERENCE_REVISION__;function autoInit(){var e=querySelector("redoc");if(e){var t=e.getAttribute("spec-url");t&&init(t,{},e)}}function getJsUrl(){var e;if(!IS_BROWSER)return"";var t=+new Date+Math.random();try{return document.currentScript&&(document.currentScript.async||document.currentScript.defer)||document.write('<script id="dummy'+t+'"><\/script>'),(null===(e=document.getElementById("dummy"+t))||void 0===e?void 0:e.previousSibling).src}catch(e){return""}}IS_BROWSER&&setPublicPath(__dirname),autoInit();
|
|
2
2
|
//# sourceMappingURL=standalone.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/reference-docs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0-rc.3",
|
|
4
4
|
"description": "Redocly Reference Docs",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"reference-docs": "bin/cli/commands/redocly-docs-cli.min.js"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@redocly/openapi-core": "^1.0.0-beta.
|
|
18
|
+
"@redocly/openapi-core": "^1.0.0-beta.67",
|
|
19
19
|
"@redocly/react-dropdown-aria": "2.0.12",
|
|
20
20
|
"@redocly/vscode-json-languageservice": "3.4.9",
|
|
21
21
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.2",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"handlebars": "^4.7.6",
|
|
30
30
|
"hotkeys-js": "^3.7.6",
|
|
31
31
|
"informed": "3.33.0",
|
|
32
|
-
"js-yaml": "^3.13.0",
|
|
33
32
|
"json-pointer": "^0.6.0",
|
|
34
33
|
"kleur": "^3.0.3",
|
|
35
34
|
"lunr": "^2.3.8",
|
|
@@ -147,6 +146,7 @@
|
|
|
147
146
|
"husky": "^7.0.0",
|
|
148
147
|
"jest": "^26.6.3",
|
|
149
148
|
"jest-styled-components": "^7.0.4",
|
|
149
|
+
"js-yaml": "^4.1.0",
|
|
150
150
|
"json-schema": "^0.2.5",
|
|
151
151
|
"lodash": "^4.17.20",
|
|
152
152
|
"mobx": "^6.3.2",
|
|
@@ -170,8 +170,7 @@
|
|
|
170
170
|
"webpack-cli": "^3.3.10",
|
|
171
171
|
"webpack-dev-server": "^3.11.0",
|
|
172
172
|
"worker-loader": "^2.0.0",
|
|
173
|
-
"workerize-loader": "^1.3.0"
|
|
174
|
-
"yaml-js": "^0.2.3"
|
|
173
|
+
"workerize-loader": "^1.3.0"
|
|
175
174
|
},
|
|
176
175
|
"jest": {
|
|
177
176
|
"verbose": true,
|