@redocly/reference-docs 2.17.0 → 2.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/bin/cli/commands/redocly-docs-cli.min.js +195 -155
  2. package/bin/cli/commands/redocly-docs-cli.min.js.LICENSE.txt +1 -1
  3. package/dist/console.redocly-reference-docs.min.js +2 -2
  4. package/dist/oauth2-redirect.js +1 -1
  5. package/dist/redocly-reference-docs.min.js +967 -922
  6. package/lib/components/Panel/PanelComponent.d.ts +2 -1
  7. package/lib/components/Panel/PanelComponent.js +1 -1
  8. package/lib/components/Panel/Trigger.js +1 -1
  9. package/lib/components/RedoclyReferenceDocs.js +1 -1
  10. package/lib/components/console/Console.js +1 -1
  11. package/lib/redoc-lib/src/common-elements/fields-layout.js +1 -1
  12. package/lib/redoc-lib/src/common-elements/fields.d.ts +1 -0
  13. package/lib/redoc-lib/src/common-elements/fields.js +1 -1
  14. package/lib/redoc-lib/src/common-elements/icons.d.ts +1 -0
  15. package/lib/redoc-lib/src/common-elements/icons.js +1 -1
  16. package/lib/redoc-lib/src/common-elements/linkify.d.ts +1 -0
  17. package/lib/redoc-lib/src/common-elements/linkify.js +1 -1
  18. package/lib/redoc-lib/src/components/Callbacks/CallbackDetails.js +1 -1
  19. package/lib/redoc-lib/src/components/Fields/Field.d.ts +1 -1
  20. package/lib/redoc-lib/src/components/Fields/Field.js +1 -1
  21. package/lib/redoc-lib/src/components/Fields/FieldDetails.js +1 -1
  22. package/lib/redoc-lib/src/components/Markdown/styled.elements.d.ts +2 -0
  23. package/lib/redoc-lib/src/components/Markdown/styled.elements.js +1 -1
  24. package/lib/redoc-lib/src/components/Operation/Operation.js +1 -1
  25. package/lib/redoc-lib/src/components/{helper.d.ts → RenderHook.d.ts} +0 -0
  26. package/lib/redoc-lib/src/components/RenderHook.js +2 -0
  27. package/lib/redoc-lib/src/components/SecurityRequirement/RequiredScopesRow.d.ts +4 -0
  28. package/lib/redoc-lib/src/components/SecurityRequirement/RequiredScopesRow.js +2 -0
  29. package/lib/redoc-lib/src/components/SecurityRequirement/SecurityDefs.d.ts +8 -0
  30. package/lib/redoc-lib/src/components/SecurityRequirement/SecurityDefs.js +2 -0
  31. package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirement.d.ts +9 -10
  32. package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirement.js +1 -1
  33. package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirementElement.d.ts +8 -0
  34. package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirementElement.js +2 -0
  35. package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirementPanelDescription.d.ts +8 -0
  36. package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirementPanelDescription.js +2 -0
  37. package/lib/redoc-lib/src/components/SecuritySchemes/SecuritySchemes.d.ts +3 -11
  38. package/lib/redoc-lib/src/components/SecuritySchemes/SecuritySchemes.js +1 -1
  39. package/lib/redoc-lib/src/components/SeeMore/SeeMore.d.ts +7 -0
  40. package/lib/redoc-lib/src/components/SeeMore/SeeMore.js +2 -0
  41. package/lib/redoc-lib/src/services/MenuBuilder.js +1 -1
  42. package/lib/redoc-lib/src/services/OpenAPIParser.d.ts +0 -2
  43. package/lib/redoc-lib/src/services/OpenAPIParser.js +1 -1
  44. package/lib/redoc-lib/src/services/RedocNormalizedOptions.d.ts +2 -2
  45. package/lib/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
  46. package/lib/redoc-lib/src/services/models/Schema.d.ts +0 -1
  47. package/lib/redoc-lib/src/services/models/Schema.js +1 -1
  48. package/lib/redoc-lib/src/services/models/SecurityRequirement.js +1 -1
  49. package/lib/redoc-lib/src/services/models/SecuritySchemes.js +1 -1
  50. package/lib/redoc-lib/src/types/open-api.d.ts +3 -3
  51. package/lib/redoc-lib/src/utils/openapi.d.ts +0 -2
  52. package/lib/redoc-lib/src/utils/openapi.js +1 -1
  53. package/lib/services/ProMenu.js +1 -1
  54. package/lib/services/ProStore.js +1 -1
  55. package/lib-esm/components/Panel/PanelComponent.d.ts +2 -1
  56. package/lib-esm/components/Panel/PanelComponent.js +1 -1
  57. package/lib-esm/components/Panel/Trigger.js +1 -1
  58. package/lib-esm/components/RedoclyReferenceDocs.js +1 -1
  59. package/lib-esm/components/console/Console.js +1 -1
  60. package/lib-esm/redoc-lib/src/common-elements/fields-layout.js +1 -1
  61. package/lib-esm/redoc-lib/src/common-elements/fields.d.ts +1 -0
  62. package/lib-esm/redoc-lib/src/common-elements/fields.js +1 -1
  63. package/lib-esm/redoc-lib/src/common-elements/icons.d.ts +1 -0
  64. package/lib-esm/redoc-lib/src/common-elements/icons.js +1 -1
  65. package/lib-esm/redoc-lib/src/common-elements/linkify.d.ts +1 -0
  66. package/lib-esm/redoc-lib/src/common-elements/linkify.js +1 -1
  67. package/lib-esm/redoc-lib/src/components/Callbacks/CallbackDetails.js +1 -1
  68. package/lib-esm/redoc-lib/src/components/Fields/Field.d.ts +1 -1
  69. package/lib-esm/redoc-lib/src/components/Fields/Field.js +1 -1
  70. package/lib-esm/redoc-lib/src/components/Fields/FieldDetails.js +1 -1
  71. package/lib-esm/redoc-lib/src/components/Markdown/styled.elements.d.ts +2 -0
  72. package/lib-esm/redoc-lib/src/components/Markdown/styled.elements.js +1 -1
  73. package/lib-esm/redoc-lib/src/components/Operation/Operation.js +1 -1
  74. package/lib-esm/redoc-lib/src/components/{helper.d.ts → RenderHook.d.ts} +0 -0
  75. package/lib-esm/redoc-lib/src/components/RenderHook.js +2 -0
  76. package/lib-esm/redoc-lib/src/components/SecurityRequirement/RequiredScopesRow.d.ts +4 -0
  77. package/lib-esm/redoc-lib/src/components/SecurityRequirement/RequiredScopesRow.js +2 -0
  78. package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityDefs.d.ts +8 -0
  79. package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityDefs.js +2 -0
  80. package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityRequirement.d.ts +9 -10
  81. package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityRequirement.js +1 -1
  82. package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityRequirementElement.d.ts +8 -0
  83. package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityRequirementElement.js +2 -0
  84. package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityRequirementPanelDescription.d.ts +8 -0
  85. package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityRequirementPanelDescription.js +2 -0
  86. package/lib-esm/redoc-lib/src/components/SecuritySchemes/SecuritySchemes.d.ts +3 -11
  87. package/lib-esm/redoc-lib/src/components/SecuritySchemes/SecuritySchemes.js +1 -1
  88. package/lib-esm/redoc-lib/src/components/SeeMore/SeeMore.d.ts +7 -0
  89. package/lib-esm/redoc-lib/src/components/SeeMore/SeeMore.js +2 -0
  90. package/lib-esm/redoc-lib/src/services/MenuBuilder.js +1 -1
  91. package/lib-esm/redoc-lib/src/services/OpenAPIParser.d.ts +0 -2
  92. package/lib-esm/redoc-lib/src/services/OpenAPIParser.js +1 -1
  93. package/lib-esm/redoc-lib/src/services/RedocNormalizedOptions.d.ts +2 -2
  94. package/lib-esm/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
  95. package/lib-esm/redoc-lib/src/services/models/Schema.d.ts +0 -1
  96. package/lib-esm/redoc-lib/src/services/models/Schema.js +1 -1
  97. package/lib-esm/redoc-lib/src/services/models/SecurityRequirement.js +1 -1
  98. package/lib-esm/redoc-lib/src/services/models/SecuritySchemes.js +1 -1
  99. package/lib-esm/redoc-lib/src/types/open-api.d.ts +3 -3
  100. package/lib-esm/redoc-lib/src/utils/openapi.d.ts +0 -2
  101. package/lib-esm/redoc-lib/src/utils/openapi.js +1 -1
  102. package/lib-esm/services/ProMenu.js +1 -1
  103. package/lib-esm/services/ProStore.js +1 -1
  104. package/package.json +1 -1
  105. package/lib/redoc-lib/src/components/helper.js +0 -2
  106. package/lib-esm/redoc-lib/src/components/helper.js +0 -2
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProMenu=void 0;var tslib_1=require("tslib"),redoc_lib_1=require("../redoc-lib"),mobx_1=require("mobx"),VersionedSpecStore_1=require("./VersionedSpecStore"),constants_1=require("../redoc-lib/src/services/constants"),HistoryService_1=require("../redoc-lib/src/services/HistoryService"),ProMenu=function(){function e(e,t,i,r){var n=this;Object.defineProperty(this,"definition",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"scroll",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"history",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"flatItems",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"activeRenderItemIdx",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"renderItems",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"activeItemIdx",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"sideBarOpened",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_unsubscribe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hashUnsubscribe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"getItemById",{enumerable:!0,configurable:!0,writable:!0,value:function(e){return n.flatItems.find((function(t){return t.id===e}))}}),Object.defineProperty(this,"initOnHistory",{enumerable:!0,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=n.history.currentId);var t,i=e.split(n.options.deepLinkPrefix)[0];i&&((t=n.flatItems.find((function(e){return e.id===i})))?(n.activate(t,!1,!1,!1,e),t.active=!1):i.startsWith(redoc_lib_1.SECURITY_SCHEMES_SECTION_PREFIX)&&(t=n.flatItems.find((function(e){return redoc_lib_1.SECURITY_SCHEMES_SECTION_PREFIX.startsWith(e.id)})),n.activate(t,!1,!1,!1,e),t&&(t.active=!1)))}}),Object.defineProperty(this,"updateOnHistory",{enumerable:!0,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=n.history.currentId);var t=e.split(n.options.deepLinkPrefix)[0];if(t){var i=n.flatItems.find(t.includes(redoc_lib_1.SECURITY_SCHEMES_SECTION_PREFIX)?function(e){return redoc_lib_1.SECURITY_SCHEMES_SECTION_PREFIX.startsWith(e.id)}:function(e){return e.id===t});i?n.activateAndScroll(i,!1,void 0,e):(n.scroll.prevOffsetY=0,n.scroll.scrollIntoViewBySelector("["+constants_1.SECTION_ATTR+'="'+(0,redoc_lib_1.escapeHTMLAttrChars)(t)+'"]'))}}}),Object.defineProperty(this,"updateVersionOnHistory",{enumerable:!0,configurable:!0,writable:!0,value:function(e){if("versionsInfo"in n.definition){var t=e.split("/")[0],i=n.definition.versionsInfo.findIndex((function(e){return e.id===t}));i<0&&(i=n.definition.versionsInfo.findIndex((function(e){return e.isDefault}))),n.definition.activeVersionIdx!==i&&(n.definition.changeVersion(i<0?0:i),n.updateItemsByVersionChange(!1,e));var r=t+"/"+redoc_lib_1.SECURITY_SCHEMES_SECTION_PREFIX;if(e.startsWith(r)){var o=n.flatItems.find((function(e){return r.startsWith(e.id)}));n.activate(o,!1,!0),setTimeout((function(){return n.scroll.scrollIntoViewBySelector("["+constants_1.SECTION_ATTR+'="'+(0,redoc_lib_1.escapeHTMLAttrChars)(e)+'"]')}),0)}}}}),Object.defineProperty(this,"updateOnScroll",{enumerable:!0,configurable:!0,writable:!0,value:function(e){for(var t=e?1:-1,i=n.activeItemIdx;(-1!==i||e)&&!(i>=n.flatItems.length-1&&e);){if(e){var r=!1,o=n.flatItems[i+1];switch(n.options.pagination){case"section":r=o&&("spec"===o.type||"group"===o.type||"tag"===o.type);break;case"item":r="section"!==(null==o?void 0:o.type)}var a=n.getElementAt(i+1);if(-1===i&&"tag"===n.flatItems[0].type&&(r=!1),n.scroll.isElementBellow(a)||r)break}else{var s=n.flatItems[i]&&n.flatItems[i].type;r="section"===n.options.pagination&&("spec"===s||"group"===s||"tag"===s)||"item"===n.options.pagination&&"section"!==s,a=n.getElementAt(i);if(n.scroll.isElementAbove(a)||r)break}i+=t}var l=n.flatItems[i];"none"===n.options.pagination||"section"===n.options.pagination?l&&l.active||n.activate(l,!0,!0,!1):l&&"section"===l.type&&(l.active||n.activate(l,!0,!0,!1))}}),(0,mobx_1.makeObservable)(this),this.items=e.contentItems,this.flatItems=(0,redoc_lib_1.flattenByProp)(this.items||[],"items"),this.flatItems.forEach((function(e,t){return e.absoluteIdx=t})),i.disableSidebar||this.subscribe(),this.flatItems.forEach((function(e,t){return normalizeItem(e,t,i.pagination,n.definition instanceof VersionedSpecStore_1.VersionedSpecStore,n.history)})),this.renderItems=this.buildRenderItems(0),this.activeItemIdx=-1,this.activeRenderItemIdx=-1,this.definition instanceof VersionedSpecStore_1.VersionedSpecStore&&this.history.subscribe(this.updateVersionOnHistory)}return Object.defineProperty(e,"updateOnHistory",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===e&&(e=HistoryService_1.history.currentId),e&&t.scrollIntoViewBySelector("["+constants_1.SECTION_ATTR+'="'+(0,redoc_lib_1.escapeHTMLAttrChars)(e)+'"]')}}),Object.defineProperty(e.prototype,"subscribe",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._unsubscribe=this.scroll.subscribe(this.updateOnScroll),this._hashUnsubscribe=this.history.subscribe(this.updateOnHistory)}}),Object.defineProperty(e.prototype,"toggleSidebar",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sideBarOpened=!this.sideBarOpened}}),Object.defineProperty(e.prototype,"closeSidebar",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sideBarOpened=!1}}),Object.defineProperty(e.prototype,"getElementAt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.flatItems[e];return t&&(0,redoc_lib_1.querySelector)("["+constants_1.SECTION_ATTR+'="'+(0,redoc_lib_1.escapeHTMLAttrChars)(t.id)+'"]')||null}}),Object.defineProperty(e.prototype,"getElementAtOrFirstChild",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.flatItems[e];return t&&"group"===t.type&&(t=t.items[0]),t&&(0,redoc_lib_1.querySelector)("["+constants_1.SECTION_ATTR+'="'+(0,redoc_lib_1.escapeHTMLAttrChars)(t.id)+'"]')||null}}),Object.defineProperty(e.prototype,"activeItem",{get:function(){return this.flatItems[this.activeItemIdx]||void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateItemsByVersionChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var i=this;if("versionsInfo"in this.definition){var r=this.activeItem&&this.activeItem.active?this.activeItem.absoluteIdx:-1;t=t&&withoutVersion(t)||this.activeItem&&this.activeItem.active&&withoutVersion(this.activeItem.id)||"",this.deactivate(this.activeItem),this.items=this.definition.contentItems,this.flatItems=(0,redoc_lib_1.flattenByProp)(this.items||[],"items"),this.flatItems.forEach((function(e,t){return normalizeItem(e,t,i.options.pagination,i.definition instanceof VersionedSpecStore_1.VersionedSpecStore,i.history)}));var n=t?(this.flatItems.find((function(e){return withoutVersion(e.id)===t}))||{absoluteIdx:-1}).absoluteIdx:-1;if(-1!==n&&"none"!==this.options.pagination||(this.renderItems=this.buildRenderItems(0)),this.activeItemIdx=-1,-1!==n)this.activate(this.flatItems[n],e);else if(-1!==r)this.activateAndScroll(this.flatItems[0],e);else if(e){var o=this.definition.versionsInfo[this.definition.activeVersionIdx];if(!this.history.currentId&&o.isDefault)return;this.history.replace(o.id)}}}}),Object.defineProperty(e.prototype,"buildRenderItems",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("none"===this.options.pagination)return this.items;var t=this.flatItems[e];if(t||(t=this.flatItems[0]),"spec"===t.type)return this.buildRenderItems(e+1);if("section"===t.type){var i=[],r=getParentOfType(t,"tag");if("section"===this.options.pagination&&r)return[r];if("item"===this.options.pagination&&r)return[(0,tslib_1.__assign)((0,tslib_1.__assign)({},r),{items:getLeadingSectionItems(r)})];for(var n=getParentSpecItem(t),o=(null==n?void 0:n.items)||this.items,a=0;a<o.length&&"section"===o[a].type;a++)i.push(o[a]);return i}switch(this.options.pagination){case"section":if(("operation"===t.type||"schema"===t.type)&&t.parent)return[t.parent];if("group"!==t.type)return[t];case"item":return"operation"===t.type||"schema"===t.type?[t]:[(0,tslib_1.__assign)((0,tslib_1.__assign)({},t),{items:getLeadingSectionItems(t)})];default:return[]}}}),Object.defineProperty(e.prototype,"activateBase",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,i,r){var n,o,a,s,l,c=this;if(void 0===t&&(t=!0),void 0===i&&(i=!1),(null===(n=this.activeItem)||void 0===n?void 0:n.id)===(null==e?void 0:e.id)&&!r)return t&&e&&this.history.replace(encodeURI(e.id),i),void(e&&!e.active&&e.activate());if(!e||"group"!==e.type)if(this.deactivate(this.activeItem),e){if(!(e.depth<=redoc_lib_1.GROUP_DEPTH)){this.activeItemIdx=e.absoluteIdx,t&&this.history.replace(encodeURI(e.id),i),e.activate(),e.expand();var d=new URLSearchParams(r),u="request"===d.get("t"),f="response"===d.get("t"),p=d.get("c"),b=d.get("ct"),v=d.get("in"),h=d.get("path"),m=(null==h?void 0:h.split(this.options.deepLinkSeparator))||[],I=e;if(v)for(var _=I.parameters,y=function(e){var t=null==_?void 0:_.find((function(t){return t.name===e}));null==t||t.expand(),_=null===(o=null==t?void 0:t.schema)||void 0===o?void 0:o.fields},g=0,S=m;g<S.length;g++){y(S[g])}else if(u){var O=null===(a=I.requestBody)||void 0===a?void 0:a.content;null===(s=I.activateMimeName)||void 0===s||s.call(I,b||I.activeMimeName),setTimeout((function(){var e;return c.activateField(m,null===(e=null==O?void 0:O.active)||void 0===e?void 0:e.schema)}),0)}else if(f){var P=I.responses.find((function(e){return e.code===p}));(null==P?void 0:P.expanded)||null==P||P.expand(),null===(l=I.activateMimeName)||void 0===l||l.call(I,b||I.activeMimeName),setTimeout((function(){var e,t;return c.activateField(m,null===(t=null===(e=null==P?void 0:P.content)||void 0===e?void 0:e.active)||void 0===t?void 0:t.schema)}),0)}}}else this.history.replace("",i)}}),Object.defineProperty(e.prototype,"activate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,i,r,n){var o=this;if(void 0===t&&(t=!0),void 0===i&&(i=!1),void 0===r&&(r=!0),"none"===this.options.pagination)return this.activateBase(e,t,i,n),void(!e&&this.definition instanceof VersionedSpecStore_1.VersionedSpecStore&&this.history.replace(this.definition.currentVersionId,!0));if("group"!==(null==e?void 0:e.type)){if(e&&"item"===this.options.pagination&&"tag"===e.type&&!e.description){if(e.expanded)return void e.collapse();e.expand(),e=this.flatItems[e.absoluteIdx+1]}if(this.activateBase(e,e&&t,i,n),this.activeRenderItemIdx=e?e.absoluteIdx:this.activeRenderItemIdx,this.activeRenderItemIdx>=0){var a=this.buildRenderItems(this.activeRenderItemIdx);a.some((function(e,t){return e.id!==o.renderItems[t].id}))&&(this.renderItems=a),this.renderItems[0]&&(this.activeRenderItemIdx=this.renderItems[0].absoluteIdx)}r&&setTimeout((function(){return o.scrollToActive()})),!e&&this.definition instanceof VersionedSpecStore_1.VersionedSpecStore&&this.history.replace(this.definition.currentVersionId,!0)}}}),Object.defineProperty(e.prototype,"activateField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var i,r=function(r){var n=e[r],o=r===e.length-1;if((null==t?void 0:t.hasType("array"))&&(null==t?void 0:t.items)&&(t=null==t?void 0:t.items),null==t?void 0:t.oneOf){var a=Number(n);return null==t||t.activateOneOf(a),t=null==t?void 0:t.oneOf[a],"continue"}(null==t?void 0:t.hasType("array"))&&(null==t?void 0:t.items)&&(t=null==t?void 0:t.items);var s=null===(i=null==t?void 0:t.fields)||void 0===i?void 0:i.find((function(e){return e.name===n}));o||null==s||s.expand(),t=null==s?void 0:s.schema},n=0;n<e.length-1;n++)r(n)}}),Object.defineProperty(e.prototype,"deactivate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0!==e)for(e.deactivate();void 0!==e;)e.collapse(),e=e.parent}}),Object.defineProperty(e.prototype,"activateAndScroll",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,i,r){void 0===r&&(r="");var n=r.split(this.options.deepLinkPrefix)[1],o=e&&this.getItemById(e.id)||e;this.activate(o,t,i,!1,n),this.scrollToActive(n?r:""),o&&o.items.length||this.closeSidebar()}}),Object.defineProperty(e.prototype,"scrollToActive",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e?setTimeout((function(){return t.scroll.scrollIntoViewBySelector("["+constants_1.SECTION_ATTR+'="'+(0,redoc_lib_1.escapeHTMLAttrChars)(e)+'"]')}),0):this.scroll.scrollIntoView(this.getElementAt(this.activeItemIdx))}}),Object.defineProperty(e.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(e=this._unsubscribe)||void 0===e||e.call(this),null===(t=this._hashUnsubscribe)||void 0===t||t.call(this)}}),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"flatItems",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"items",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"activeRenderItemIdx",void 0),(0,tslib_1.__decorate)([mobx_1.observable.ref],e.prototype,"renderItems",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"activeItemIdx",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"sideBarOpened",void 0),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"toggleSidebar",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"closeSidebar",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"activateBase",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"activate",null),(0,tslib_1.__decorate)([mobx_1.action.bound],e.prototype,"activateAndScroll",null),e}();function withoutVersion(e){return e.split("/").slice(1).join("/")}function getParentSpecItem(e){for(;e;){if("spec"===e.type)return e;e=e.parent}}function getParentOfType(e,t){if(e&&e.parent)return e.parent.type===t?e.parent:getParentOfType(e.parent,t)}function getLeadingSectionItems(e){for(var t=[],i=0,r=e.items;i<r.length;i++){var n=r[i];if("section"!==n.type)break;t.push(n)}return t}function normalizeItem(e,t,i,r,n){if(e.absoluteIdx=t,"none"!==i){var o=getParentOfType(e,"tag");if(e.parent&&o&&!("_id_normalized"in e)){if(r){var a=e.id.split("/"),s=a[0],l=a[1],c=withoutVersion(e.id);if("operation"===e.type&&!l.startsWith("operation"))return;e.id=s+"/"+withoutVersion(o.id)+"/"+c}else{if("operation"===e.type&&!e.id.startsWith("operation"))return;e.id=o.id+"/"+e.id}e._id_normalized=!0}}"group"!==e.type&&(e.href=n.linkForId(e.id))}exports.ProMenu=ProMenu;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProMenu=void 0;var tslib_1=require("tslib"),mobx_1=require("mobx"),redoc_lib_1=require("../redoc-lib"),VersionedSpecStore_1=require("./VersionedSpecStore"),constants_1=require("../redoc-lib/src/services/constants"),HistoryService_1=require("../redoc-lib/src/services/HistoryService"),ProMenu=function(){function e(e,t,i,r){var n=this;Object.defineProperty(this,"definition",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"scroll",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"history",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"flatItems",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"activeRenderItemIdx",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"renderItems",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"activeItemIdx",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"sideBarOpened",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_unsubscribe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hashUnsubscribe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"getItemById",{enumerable:!0,configurable:!0,writable:!0,value:function(e){return n.flatItems.find((function(t){return t.id===e}))}}),Object.defineProperty(this,"initOnHistory",{enumerable:!0,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=n.history.currentId);var t=e.split(n.options.deepLinkPrefix)[0];if(t){var i=n.flatItems.find((function(e){return e.id===t}));i&&(n.activate(i,!1,!1,!1,e),i.active=!1)}}}),Object.defineProperty(this,"updateOnHistory",{enumerable:!0,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=n.history.currentId);var t=e.split(n.options.deepLinkPrefix)[0];if(t){var i=n.flatItems.find((function(e){return e.id===t}));i?n.activateAndScroll(i,!1,void 0,e):(n.scroll.prevOffsetY=0,n.scroll.scrollIntoViewBySelector("["+constants_1.SECTION_ATTR+'="'+(0,redoc_lib_1.escapeHTMLAttrChars)(t)+'"]'))}}}),Object.defineProperty(this,"updateVersionOnHistory",{enumerable:!0,configurable:!0,writable:!0,value:function(e){if("versionsInfo"in n.definition){var t=e.split("/")[0],i=n.definition.versionsInfo.findIndex((function(e){return e.id===t}));i<0&&(i=n.definition.versionsInfo.findIndex((function(e){return e.isDefault}))),n.definition.activeVersionIdx!==i&&(n.definition.changeVersion(i<0?0:i),n.updateItemsByVersionChange(!1,e))}}}),Object.defineProperty(this,"updateOnScroll",{enumerable:!0,configurable:!0,writable:!0,value:function(e){for(var t=e?1:-1,i=n.activeItemIdx;(-1!==i||e)&&!(i>=n.flatItems.length-1&&e);){if(e){var r=!1,o=n.flatItems[i+1];switch(n.options.pagination){case"section":r=o&&("spec"===o.type||"group"===o.type||"tag"===o.type);break;case"item":r="section"!==(null==o?void 0:o.type)}var a=n.getElementAt(i+1);if(-1===i&&"tag"===n.flatItems[0].type&&(r=!1),n.scroll.isElementBellow(a)||r)break}else{var s=n.flatItems[i]&&n.flatItems[i].type;r="section"===n.options.pagination&&("spec"===s||"group"===s||"tag"===s)||"item"===n.options.pagination&&"section"!==s,a=n.getElementAt(i);if(n.scroll.isElementAbove(a)||r)break}i+=t}var l=n.flatItems[i];"none"===n.options.pagination||"section"===n.options.pagination?l&&l.active||n.activate(l,!0,!0,!1):l&&"section"===l.type&&(l.active||n.activate(l,!0,!0,!1))}}),(0,mobx_1.makeObservable)(this),this.items=e.contentItems,this.flatItems=(0,redoc_lib_1.flattenByProp)(this.items||[],"items"),this.flatItems.forEach((function(e,t){return e.absoluteIdx=t})),i.disableSidebar||this.subscribe(),this.flatItems.forEach((function(e,t){return normalizeItem(e,t,i.pagination,n.definition instanceof VersionedSpecStore_1.VersionedSpecStore,n.history)})),this.renderItems=this.buildRenderItems(0),this.activeItemIdx=-1,this.activeRenderItemIdx=-1,this.definition instanceof VersionedSpecStore_1.VersionedSpecStore&&this.history.subscribe(this.updateVersionOnHistory)}return Object.defineProperty(e,"updateOnHistory",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===e&&(e=HistoryService_1.history.currentId),e&&t.scrollIntoViewBySelector("["+constants_1.SECTION_ATTR+'="'+(0,redoc_lib_1.escapeHTMLAttrChars)(e)+'"]')}}),Object.defineProperty(e.prototype,"subscribe",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._unsubscribe=this.scroll.subscribe(this.updateOnScroll),this._hashUnsubscribe=this.history.subscribe(this.updateOnHistory)}}),Object.defineProperty(e.prototype,"toggleSidebar",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sideBarOpened=!this.sideBarOpened}}),Object.defineProperty(e.prototype,"closeSidebar",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sideBarOpened=!1}}),Object.defineProperty(e.prototype,"getElementAt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.flatItems[e];return t&&(0,redoc_lib_1.querySelector)("["+constants_1.SECTION_ATTR+'="'+(0,redoc_lib_1.escapeHTMLAttrChars)(t.id)+'"]')||null}}),Object.defineProperty(e.prototype,"getElementAtOrFirstChild",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.flatItems[e];return t&&"group"===t.type&&(t=t.items[0]),t&&(0,redoc_lib_1.querySelector)("["+constants_1.SECTION_ATTR+'="'+(0,redoc_lib_1.escapeHTMLAttrChars)(t.id)+'"]')||null}}),Object.defineProperty(e.prototype,"activeItem",{get:function(){return this.flatItems[this.activeItemIdx]||void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateItemsByVersionChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var i=this;if("versionsInfo"in this.definition){var r=this.activeItem&&this.activeItem.active?this.activeItem.absoluteIdx:-1;t=t&&withoutVersion(t)||this.activeItem&&this.activeItem.active&&withoutVersion(this.activeItem.id)||"",this.deactivate(this.activeItem),this.items=this.definition.contentItems,this.flatItems=(0,redoc_lib_1.flattenByProp)(this.items||[],"items"),this.flatItems.forEach((function(e,t){return normalizeItem(e,t,i.options.pagination,i.definition instanceof VersionedSpecStore_1.VersionedSpecStore,i.history)}));var n=t?(this.flatItems.find((function(e){return withoutVersion(e.id)===t}))||{absoluteIdx:-1}).absoluteIdx:-1;if(-1!==n&&"none"!==this.options.pagination||(this.renderItems=this.buildRenderItems(0)),this.activeItemIdx=-1,-1!==n)this.activate(this.flatItems[n],e);else if(-1!==r)this.activateAndScroll(this.flatItems[0],e);else if(e){var o=this.definition.versionsInfo[this.definition.activeVersionIdx];if(!this.history.currentId&&o.isDefault)return;this.history.replace(o.id)}}}}),Object.defineProperty(e.prototype,"buildRenderItems",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("none"===this.options.pagination)return this.items;var t=this.flatItems[e];if(t||(t=this.flatItems[0]),"spec"===t.type)return this.buildRenderItems(e+1);if("section"===t.type){var i=[],r=getParentOfType(t,"tag");if("section"===this.options.pagination&&r)return[r];if("item"===this.options.pagination&&r)return[(0,tslib_1.__assign)((0,tslib_1.__assign)({},r),{items:getLeadingSectionItems(r)})];for(var n=getParentSpecItem(t),o=(null==n?void 0:n.items)||this.items,a=0;a<o.length&&"section"===o[a].type;a++)i.push(o[a]);return i}switch(this.options.pagination){case"section":if(("operation"===t.type||"schema"===t.type)&&t.parent)return[t.parent];if("group"!==t.type)return[t];case"item":return"operation"===t.type||"schema"===t.type?[t]:[(0,tslib_1.__assign)((0,tslib_1.__assign)({},t),{items:getLeadingSectionItems(t)})];default:return[]}}}),Object.defineProperty(e.prototype,"activateBase",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,i,r){var n,o,a,s,l,c=this;if(void 0===t&&(t=!0),void 0===i&&(i=!1),(null===(n=this.activeItem)||void 0===n?void 0:n.id)===(null==e?void 0:e.id)&&!r)return t&&e&&this.history.replace(encodeURI(e.id),i),void(e&&!e.active&&e.activate());if(!e||"group"!==e.type)if(this.deactivate(this.activeItem),e){if(!(e.depth<=redoc_lib_1.GROUP_DEPTH)){this.activeItemIdx=e.absoluteIdx,t&&this.history.replace(encodeURI(e.id),i),e.activate(),e.expand();var d=new URLSearchParams(r),u="request"===d.get("t"),p="response"===d.get("t"),f=d.get("c"),b=d.get("ct"),v=d.get("in"),h=d.get("path"),m=(null==h?void 0:h.split(this.options.deepLinkSeparator))||[],I=e;if(v)for(var y=I.parameters,_=function(e){var t=null==y?void 0:y.find((function(t){return t.name===e}));null==t||t.expand(),y=null===(o=null==t?void 0:t.schema)||void 0===o?void 0:o.fields},g=0,O=m;g<O.length;g++){_(O[g])}else if(u){var x=null===(a=I.requestBody)||void 0===a?void 0:a.content;null===(s=I.activateMimeName)||void 0===s||s.call(I,b||I.activeMimeName),setTimeout((function(){var e;return c.activateField(m,null===(e=null==x?void 0:x.active)||void 0===e?void 0:e.schema)}),0)}else if(p){var S=I.responses.find((function(e){return e.code===f}));(null==S?void 0:S.expanded)||null==S||S.expand(),null===(l=I.activateMimeName)||void 0===l||l.call(I,b||I.activeMimeName),setTimeout((function(){var e,t;return c.activateField(m,null===(t=null===(e=null==S?void 0:S.content)||void 0===e?void 0:e.active)||void 0===t?void 0:t.schema)}),0)}}}else this.history.replace("",i)}}),Object.defineProperty(e.prototype,"activate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,i,r,n){var o=this;if(void 0===t&&(t=!0),void 0===i&&(i=!1),void 0===r&&(r=!0),"none"===this.options.pagination)return this.activateBase(e,t,i,n),void(!e&&this.definition instanceof VersionedSpecStore_1.VersionedSpecStore&&this.history.replace(this.definition.currentVersionId,!0));if("group"!==(null==e?void 0:e.type)){if(e&&"item"===this.options.pagination&&"tag"===e.type&&!e.description){if(e.expanded)return void e.collapse();e.expand(),e=this.flatItems[e.absoluteIdx+1]}if(this.activateBase(e,e&&t,i,n),this.activeRenderItemIdx=e?e.absoluteIdx:this.activeRenderItemIdx,this.activeRenderItemIdx>=0){var a=this.buildRenderItems(this.activeRenderItemIdx);a.some((function(e,t){return e.id!==o.renderItems[t].id}))&&(this.renderItems=a),this.renderItems[0]&&(this.activeRenderItemIdx=this.renderItems[0].absoluteIdx)}r&&setTimeout((function(){return o.scrollToActive()})),!e&&this.definition instanceof VersionedSpecStore_1.VersionedSpecStore&&this.history.replace(this.definition.currentVersionId,!0)}}}),Object.defineProperty(e.prototype,"activateField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var i,r=function(r){var n=e[r],o=r===e.length-1;if((null==t?void 0:t.hasType("array"))&&(null==t?void 0:t.items)&&(t=null==t?void 0:t.items),null==t?void 0:t.oneOf){var a=Number(n);return null==t||t.activateOneOf(a),t=null==t?void 0:t.oneOf[a],"continue"}(null==t?void 0:t.hasType("array"))&&(null==t?void 0:t.items)&&(t=null==t?void 0:t.items);var s=null===(i=null==t?void 0:t.fields)||void 0===i?void 0:i.find((function(e){return e.name===n}));o||null==s||s.expand(),t=null==s?void 0:s.schema},n=0;n<e.length-1;n++)r(n)}}),Object.defineProperty(e.prototype,"deactivate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0!==e)for(e.deactivate();void 0!==e;)e.collapse(),e=e.parent}}),Object.defineProperty(e.prototype,"activateAndScroll",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,i,r){void 0===r&&(r="");var n=r.split(this.options.deepLinkPrefix)[1],o=e&&this.getItemById(e.id)||e;this.activate(o,t,i,!1,n),this.scrollToActive(n?r:""),o&&o.items.length||this.closeSidebar()}}),Object.defineProperty(e.prototype,"scrollToActive",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e?setTimeout((function(){return t.scroll.scrollIntoViewBySelector("["+constants_1.SECTION_ATTR+'="'+(0,redoc_lib_1.escapeHTMLAttrChars)(e)+'"]')}),0):this.scroll.scrollIntoView(this.getElementAt(this.activeItemIdx))}}),Object.defineProperty(e.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(e=this._unsubscribe)||void 0===e||e.call(this),null===(t=this._hashUnsubscribe)||void 0===t||t.call(this)}}),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"flatItems",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"items",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"activeRenderItemIdx",void 0),(0,tslib_1.__decorate)([mobx_1.observable.ref],e.prototype,"renderItems",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"activeItemIdx",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"sideBarOpened",void 0),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"toggleSidebar",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"closeSidebar",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"activateBase",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"activate",null),(0,tslib_1.__decorate)([mobx_1.action.bound],e.prototype,"activateAndScroll",null),e}();function withoutVersion(e){return e.split("/").slice(1).join("/")}function getParentSpecItem(e){for(;e;){if("spec"===e.type)return e;e=e.parent}}function getParentOfType(e,t){if(e&&e.parent)return e.parent.type===t?e.parent:getParentOfType(e.parent,t)}function getLeadingSectionItems(e){for(var t=[],i=0,r=e.items;i<r.length;i++){var n=r[i];if("section"!==n.type)break;t.push(n)}return t}function normalizeItem(e,t,i,r,n){if(e.absoluteIdx=t,"none"!==i){var o=getParentOfType(e,"tag");if(e.parent&&o&&!("_id_normalized"in e)){if(r){var a=e.id.split("/"),s=a[0],l=a[1],c=withoutVersion(e.id);if("operation"===e.type&&!l.startsWith("operation"))return;e.id=s+"/"+withoutVersion(o.id)+"/"+c}else{if("operation"===e.type&&!e.id.startsWith("operation"))return;e.id=o.id+"/"+e.id}e._id_normalized=!0}}"group"!==e.type&&(e.href=n.linkForId(e.id))}exports.ProMenu=ProMenu;
2
2
  //# sourceMappingURL=ProMenu.js.map
@@ -1,2 +1,2 @@
1
- "use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProStore=exports.NestingGroup=void 0;var tslib_1=require("tslib"),mobx_1=require("mobx"),openapi_core_1=require("@redocly/openapi-core"),decko_1=require("decko"),redoc_lib_1=require("../redoc-lib"),history_1=require("./history"),ProMenu_1=require("./ProMenu"),SearchStore_1=require("./SearchStore"),extendTheme_1=require("./extendTheme"),pluggable_1=require("../components/pluggable"),VersionedSpecStore_1=require("./VersionedSpecStore"),check_1=(0,tslib_1.__importDefault)(require("./check")),utils_1=require("./utils"),utils_2=require("../utils"),store_types_1=require("./store-types"),types_1=require("./types"),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}),(0,mobx_1.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}}),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"active",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"expanded",void 0),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"activate",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"expand",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"collapse",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"deactivate",null),e}();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)}))}exports.NestingGroup=NestingGroup;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 redoc_lib_1.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:store_types_1.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}),(0,mobx_1.makeObservable)(this),this.initProOptions(i),redoc_lib_1.IS_BROWSER&&(this.l=(0,check_1.default)(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 history_1.FakeHistoryService(this.options):"browser"===this.options.routingStrategy?new history_1.PushStateHistoryService(this.options,r):new history_1.ProHashHistoryService(this.options,r);this.definition=r?new VersionedSpecStore_1.VersionedSpecStore(e,this.options,a.currentId.split("/")[0]):new redoc_lib_1.SpecStore(e,t,this.options),i.downloadDefinitionUrl&&(this.definition.info.downloadFileName=""),this.scroll=new redoc_lib_1.ScrollService(this.options),this.options.disableSidebar||ProMenu_1.ProMenu.updateOnHistory(a.currentId,this.scroll),this.menu=new ProMenu_1.ProMenu(this.definition,this.scroll,this.options,a),this.menu.initOnHistory(),this.options.disableSearch||this.initSearch(this.options,o),this.disposer=(0,mobx_1.observe)(this.menu,"none"===this.options.pagination?"activeItemIdx":"activeRenderItemIdx",(function(e){setTimeout((function(){return n.updateMarkOnMenu(e.newValue)}))})),(0,utils_2.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=(0,extendTheme_1.extendTheme)(e),this.options=new redoc_lib_1.RedocNormalizedOptions(this.rawOptions,DEFAULT_OPTIONS),null!=this.rawOptions.showConsole&&console.warn('"showConsole" option is deprecated. Please, use "hideTryItPanel" instead.'),this.options.showConsole=null!=this.rawOptions.hideTryItPanel?!this.rawOptions.hideTryItPanel: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||store_types_1.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||types_1.SideNavStyle.SummaryOnly,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&&(0,utils_1.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||SearchStore_1.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 SearchStore_1.RemoteSearch(global.__REDOCLY_SEARCH_URL):this.search=new SearchStore_1.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_1.VersionedSpecStore&&(0,mobx_1.observe)(this.definition,"activeVersionIdx",(function(t){var o,n,r=i.definition;null===(o=i.search)||void 0===o||o.dispose(),i.search=new SearchStore_1.DeepSearchStore(e);var a=r.versions[t.newValue]._searchIndexName;if(redoc_lib_1.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)})),redoc_lib_1.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=(0,utils_2.fromLocalStorage)("layoutVariant")||this.options.layout||this.layout,this.activeSampleLanguage=(0,utils_2.fromLocalStorage)("activeSampleLanguage")||this.options.defaultSampleLanguage,this.options.showRightPanelToggle){var e=(0,utils_2.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,(0,utils_2.toSessionStorage)("showRightPanelToggleState",JSON.stringify(this.showRightPanel))}}),Object.defineProperty(e.prototype,"toggleLayout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=store_types_1.LayoutVariant.THREE_PANEL),this.layout=e,(0,utils_2.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,(0,utils_2.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(0,tslib_1.__awaiter)(this,void 0,void 0,(function(){var r,a,s,l,p,u,c,d;return(0,tslib_1.__generator)(this,(function(h){switch(h.label){case 0:return r=this.definition.parser.definition,a=JSON.parse(JSON.stringify(r)),s=(0,tslib_1.__assign)((0,tslib_1.__assign)({},getSpecVersionObj(a)),{components:a.components,paths:(c={},c[e.path]=(d={},d[e.httpVerb]=null===(i=null===(t=a.paths)||void 0===t?void 0:t[e.path])||void 0===i?void 0:i[e.httpVerb],d.parameters=null===(n=null===(o=a.paths)||void 0===o?void 0:o[e.path])||void 0===n?void 0:n.parameters,d),c)}),l=new openapi_core_1.Config({}),p=(0,redoc_lib_1.createParsedDocument)(s),u={config:l,doc:p,dereference:!0},[4,(0,openapi_core_1.bundle)(u)];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];(0,mobx_1.observe)(l,"expanded",(function(t){return e.remark(t)}))}else"tag"===r.type&&t(r.items||[])}};t(this.menu.renderItems),"none"!==this.options.pagination&&(0,mobx_1.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);(0,utils_2.setGlobalStore)(o),o.menu.activeItemIdx=void 0!==t.menu.activeItemIdx?t.menu.activeItemIdx:-1,o.definition instanceof VersionedSpecStore_1.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(0,tslib_1.__awaiter)(this,void 0,void 0,(function(){var t,i;return(0,tslib_1.__generator)(this,(function(o){switch(o.label){case 0:return i={menu:{activeItemIdx:this.menu.activeItemIdx},definition:this.definition instanceof VersionedSpecStore_1.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()}}),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"search",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"tryItOperation",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"showRightPanel",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"layout",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"activeSampleLanguage",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"isLoading",void 0),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"onDidMount",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"toggleRightPanel",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"toggleLayout",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"disableConsole",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"enableConsole",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"tryItOut",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"setActiveSampleLanguage",null),(0,tslib_1.__decorate)([decko_1.bind,(0,decko_1.debounce)(500)],e.prototype,"activateSampleLanguage",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"startLoader",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"stopLoader",null),e}();exports.ProStore=ProStore;var DEFAULT_OPTIONS={ignoreNamedSchemas:["java.io.ObjectStreamField"],allowedMdComponents:(_a={RedocResponse:{component:pluggable_1.RedocResponse,propsSelector:function(e){return{store:e}}},PullRight:{component:pluggable_1.PullRight,propsSelector:function(){return{}}}},_a[redoc_lib_1.SECURITY_DEFINITIONS_COMPONENT_NAME]={component:redoc_lib_1.SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[redoc_lib_1.SECURITY_DEFINITIONS_JSX_NAME]={component:redoc_lib_1.SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[redoc_lib_1.SCHEMA_DEFINITION_JSX_NAME]={component:redoc_lib_1.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
+ "use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProStore=exports.NestingGroup=void 0;var tslib_1=require("tslib"),mobx_1=require("mobx"),openapi_core_1=require("@redocly/openapi-core"),decko_1=require("decko"),redoc_lib_1=require("../redoc-lib"),history_1=require("./history"),ProMenu_1=require("./ProMenu"),SearchStore_1=require("./SearchStore"),extendTheme_1=require("./extendTheme"),pluggable_1=require("../components/pluggable"),VersionedSpecStore_1=require("./VersionedSpecStore"),check_1=(0,tslib_1.__importDefault)(require("./check")),utils_1=require("./utils"),utils_2=require("../utils"),store_types_1=require("./store-types"),types_1=require("./types"),SecurityDefs_1=require("../redoc-lib/src/components/SecurityRequirement/SecurityDefs"),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}),(0,mobx_1.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}}),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"active",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"expanded",void 0),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"activate",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"expand",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"collapse",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"deactivate",null),e}();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)}))}exports.NestingGroup=NestingGroup;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 redoc_lib_1.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:store_types_1.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}),(0,mobx_1.makeObservable)(this),this.initProOptions(i),redoc_lib_1.IS_BROWSER&&(this.l=(0,check_1.default)(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 history_1.FakeHistoryService(this.options):"browser"===this.options.routingStrategy?new history_1.PushStateHistoryService(this.options,r):new history_1.ProHashHistoryService(this.options,r);this.definition=r?new VersionedSpecStore_1.VersionedSpecStore(e,this.options,a.currentId.split("/")[0]):new redoc_lib_1.SpecStore(e,t,this.options),i.downloadDefinitionUrl&&(this.definition.info.downloadFileName=""),this.scroll=new redoc_lib_1.ScrollService(this.options),this.options.disableSidebar||ProMenu_1.ProMenu.updateOnHistory(a.currentId,this.scroll),this.menu=new ProMenu_1.ProMenu(this.definition,this.scroll,this.options,a),this.menu.initOnHistory(),this.options.disableSearch||this.initSearch(this.options,o),this.disposer=(0,mobx_1.observe)(this.menu,"none"===this.options.pagination?"activeItemIdx":"activeRenderItemIdx",(function(e){setTimeout((function(){return n.updateMarkOnMenu(e.newValue)}))})),(0,utils_2.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=(0,extendTheme_1.extendTheme)(e),this.options=new redoc_lib_1.RedocNormalizedOptions(this.rawOptions,DEFAULT_OPTIONS),null!=this.rawOptions.showConsole&&console.warn('"showConsole" option is deprecated. Please, use "hideTryItPanel" instead.'),this.options.showConsole=null!=this.rawOptions.hideTryItPanel?!this.rawOptions.hideTryItPanel: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||store_types_1.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||types_1.SideNavStyle.SummaryOnly,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&&(0,utils_1.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||SearchStore_1.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 SearchStore_1.RemoteSearch(global.__REDOCLY_SEARCH_URL):this.search=new SearchStore_1.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_1.VersionedSpecStore&&(0,mobx_1.observe)(this.definition,"activeVersionIdx",(function(t){var o,n,r=i.definition;null===(o=i.search)||void 0===o||o.dispose(),i.search=new SearchStore_1.DeepSearchStore(e);var a=r.versions[t.newValue]._searchIndexName;if(redoc_lib_1.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)})),redoc_lib_1.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=(0,utils_2.fromLocalStorage)("layoutVariant")||this.options.layout||this.layout,this.activeSampleLanguage=(0,utils_2.fromLocalStorage)("activeSampleLanguage")||this.options.defaultSampleLanguage,this.options.showRightPanelToggle){var e=(0,utils_2.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,(0,utils_2.toSessionStorage)("showRightPanelToggleState",JSON.stringify(this.showRightPanel))}}),Object.defineProperty(e.prototype,"toggleLayout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=store_types_1.LayoutVariant.THREE_PANEL),this.layout=e,(0,utils_2.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,(0,utils_2.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(0,tslib_1.__awaiter)(this,void 0,void 0,(function(){var r,a,s,l,p,u,c,d;return(0,tslib_1.__generator)(this,(function(h){switch(h.label){case 0:return r=this.definition.parser.definition,a=JSON.parse(JSON.stringify(r)),s=(0,tslib_1.__assign)((0,tslib_1.__assign)({},getSpecVersionObj(a)),{components:a.components,paths:(c={},c[e.path]=(d={},d[e.httpVerb]=null===(i=null===(t=a.paths)||void 0===t?void 0:t[e.path])||void 0===i?void 0:i[e.httpVerb],d.parameters=null===(n=null===(o=a.paths)||void 0===o?void 0:o[e.path])||void 0===n?void 0:n.parameters,d),c)}),l=new openapi_core_1.Config({}),p=(0,redoc_lib_1.createParsedDocument)(s),u={config:l,doc:p,dereference:!0},[4,(0,openapi_core_1.bundle)(u)];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];(0,mobx_1.observe)(l,"expanded",(function(t){return e.remark(t)}))}else"tag"===r.type&&t(r.items||[])}};t(this.menu.renderItems),"none"!==this.options.pagination&&(0,mobx_1.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);(0,utils_2.setGlobalStore)(o),o.menu.activeItemIdx=void 0!==t.menu.activeItemIdx?t.menu.activeItemIdx:-1,o.definition instanceof VersionedSpecStore_1.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(0,tslib_1.__awaiter)(this,void 0,void 0,(function(){var t,i;return(0,tslib_1.__generator)(this,(function(o){switch(o.label){case 0:return i={menu:{activeItemIdx:this.menu.activeItemIdx},definition:this.definition instanceof VersionedSpecStore_1.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()}}),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"search",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"tryItOperation",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"showRightPanel",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"layout",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"activeSampleLanguage",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"isLoading",void 0),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"onDidMount",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"toggleRightPanel",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"toggleLayout",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"disableConsole",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"enableConsole",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"tryItOut",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"setActiveSampleLanguage",null),(0,tslib_1.__decorate)([decko_1.bind,(0,decko_1.debounce)(500)],e.prototype,"activateSampleLanguage",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"startLoader",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"stopLoader",null),e}();exports.ProStore=ProStore;var DEFAULT_OPTIONS={ignoreNamedSchemas:["java.io.ObjectStreamField"],allowedMdComponents:(_a={RedocResponse:{component:pluggable_1.RedocResponse,propsSelector:function(e){return{store:e}}},PullRight:{component:pluggable_1.PullRight,propsSelector:function(){return{}}}},_a[redoc_lib_1.SCHEMA_DEFINITION_JSX_NAME]={component:redoc_lib_1.SchemaDefinition,propsSelector:function(e){return{parser:e.definition.parser,options:e.options,layout:e.layout,showRightPanel:e.showRightPanel}}},_a[redoc_lib_1.SECURITY_DEFINITIONS_COMPONENT_NAME]={component:SecurityDefs_1.SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[redoc_lib_1.SECURITY_DEFINITIONS_JSX_NAME]={component:SecurityDefs_1.SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_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
@@ -12,5 +12,6 @@ export interface PanelComponentProps {
12
12
  header?: React.ReactNode | ((props: PanelHeaderProps) => React.ReactNode);
13
13
  dataHeaderTestId?: string;
14
14
  onToggle?: (expanded: boolean) => void;
15
+ description?: React.ReactNode;
15
16
  }
16
- export declare function PanelComponent({ expanded, renderChildrenHidden, header, dataHeaderTestId, className, children, onToggle, }: PropsWithChildren<PanelComponentProps>): JSX.Element;
17
+ export declare function PanelComponent({ expanded, renderChildrenHidden, header, dataHeaderTestId, className, children, onToggle, description, }: PropsWithChildren<PanelComponentProps>): JSX.Element;
@@ -1,2 +1,2 @@
1
- import React,{useEffect,useState}from"react";import{ShelfIcon}from"../../redoc-lib/src/common-elements";import{Header}from"./Header";import{Trigger}from"./Trigger";import{Title}from"./Title";import{PanelBody}from"./PanelBody";export function PanelComponent(e){var t=e.expanded,n=void 0===t||t,r=e.renderChildrenHidden,a=void 0!==r&&r,o=e.header,c=e.dataHeaderTestId,i=e.className,l=e.children,d=e.onToggle,m=useState(n),f=m[0],s=m[1],u=useState(!1),g=u[0],p=u[1],E=function(e){e.target instanceof HTMLAnchorElement||(p(!0),s(!f),null==d||d(!f))};return useEffect((function(){return s(n)}),[n]),React.createElement("div",{className:i},o&&("function"==typeof o?o({expanded:f,toggle:E}):React.createElement(Header,{"data-cy":c,onClick:E,isExpanded:f},React.createElement(Trigger,null,React.createElement(Title,null,o),React.createElement(ShelfIcon,{direction:f?"down":"right"})))),(f||a)&&React.createElement(PanelBody,{hidden:!f,animate:g},l))}
1
+ import React,{useEffect,useState}from"react";import{ShelfIcon}from"../../redoc-lib/src/common-elements";import{Header}from"./Header";import{Trigger}from"./Trigger";import{Title}from"./Title";import{PanelBody}from"./PanelBody";export function PanelComponent(e){var t=e.expanded,r=void 0===t||t,n=e.renderChildrenHidden,a=void 0!==n&&n,o=e.header,c=e.dataHeaderTestId,i=e.className,d=e.children,l=e.onToggle,m=e.description,f=useState(r),s=f[0],p=f[1],u=useState(!1),g=u[0],E=u[1],T=function(e){e.target instanceof HTMLAnchorElement||(E(!0),p(!s),null==l||l(!s))};return useEffect((function(){return p(r)}),[r]),React.createElement("div",{className:i},o&&("function"==typeof o?o({expanded:s,toggle:T}):React.createElement(Header,{"data-cy":c,onClick:T,isExpanded:s},React.createElement(Trigger,null,React.createElement(Title,null,o),React.createElement(ShelfIcon,{direction:s?"down":"right",mr:"10px"}),m))),(s||a)&&React.createElement(PanelBody,{hidden:!s,animate:g},d))}
2
2
  //# sourceMappingURL=PanelComponent.js.map
@@ -1,2 +1,2 @@
1
- import{__makeTemplateObject}from"tslib";import styled from"../../redoc-lib/src/styled-components";export var Trigger=styled.div(templateObject_1||(templateObject_1=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n"],["\n display: inline-flex;\n align-items: center;\n"])));var templateObject_1;
1
+ import{__makeTemplateObject}from"tslib";import styled from"../../redoc-lib/src/styled-components";export var Trigger=styled.div(templateObject_1||(templateObject_1=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"],["\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"])));var templateObject_1;
2
2
  //# sourceMappingURL=Trigger.js.map
@@ -1,2 +1,2 @@
1
- import{__decorate,__extends,__makeTemplateObject}from"tslib";import*as React from"react";import{observer}from"mobx-react";import{configure,reaction}from"mobx";import{ApiInfo,ApiLogo,argValueToBoolean,ContentItems,createGlobalStyle,ErrorBoundary,Loading,mediaCSS,mediaMap,MiddlePanel,RedocNormalizedOptions,RightPanel,SideMenu,StickyResponsiveSidebar,ZERO_BREAKPOINT}from"../redoc-lib";import{ProSearchBox,SearchField}from"./Search";import{ContinueButton}from"./NextSectionButton";import{ProStoreProvider}from"./StoreProvider";import{LayoutVariant}from"../services/store-types";import{Console}from"./console/ConsoleLazy";import{ProProviders}from"./ProProviders";import{Overlay}from"./Overlay";import{VersionedSpecStore}from"../services/VersionedSpecStore";import{VersionSwitcher}from"./VersionSwitcher";import{BackgroundStub,BackgroundStubFix,RedocWrap,ApiContentWrap,NextSectionButtonWrap,ToggleRightPanelButton,ChangeViewButton,ControlsWrap}from"./styled.elements";import{DownloadButtonWithLabel}from"../redoc-lib/src/components/DownloadButton";configure({useProxies:"ifavailable"});export var CssFixes=createGlobalStyle(templateObject_1||(templateObject_1=__makeTemplateObject(['\n div[data-section-id]::after {\n content: " ";\n display: block;\n height: 0;\n clear: both;\n visibility: hidden;\n }\n\n '," {\n ","\n }\n\n ",", "," {\n ","\n }\n\n ",", "," {\n ","\n }\n\n "," {\n ",";\n }\n"],['\n div[data-section-id]::after {\n content: " ";\n display: block;\n height: 0;\n clear: both;\n visibility: hidden;\n }\n\n '," {\n ","\n }\n\n ",", "," {\n ","\n }\n\n ",", "," {\n ","\n }\n\n "," {\n ",";\n }\n"])),RightPanel,(function(e){var t,n=e.theme,o=e.showRightPanel,a=e.layout;return mediaCSS({width:a===LayoutVariant.STACKED?"100%":"",paddingLeft:a===LayoutVariant.STACKED?n.spacing.sectionHorizontal:"",display:o?"":(t={},t[ZERO_BREAKPOINT]="",t[n.rightPanel.showAtBreakpoint]="none",t)})}),BackgroundStub,BackgroundStubFix,(function(e){var t,n=e.theme,o=e.showRightPanel,a=e.layout;return mediaCSS({display:o&&a!==LayoutVariant.STACKED?"":(t={},t[ZERO_BREAKPOINT]="",t[n.rightPanel.showAtBreakpoint]="none",t)})}),MiddlePanel,NextSectionButtonWrap,(function(e){var t,n,o,a=e.theme,r=e.showRightPanel,i=e.layout;return mediaCSS({maxWidth:r&&i===LayoutVariant.THREE_PANEL?mediaMap(a.breakpoints,[a.layout["three-panel"].middlePanelMaxWidth],(t={},t[ZERO_BREAKPOINT]=function(){return"none"},t[a.rightPanel.showAtBreakpoint]=function(e){return e},t)):"none",margin:r&&i===LayoutVariant.THREE_PANEL?mediaMap(a.breakpoints,[a.rightPanel.width,a.layout["three-panel"].middlePanelMaxWidth],(n={},n[ZERO_BREAKPOINT]=function(){return"0"},n[a.rightPanel.showAtBreakpoint]=function(e,t){return t&&"none"!==t?"0 max(calc((100% - "+e+" - "+t+"}) / 2), 0px)":"0"},n)):"0",paddingRight:i===LayoutVariant.STACKED?a.spacing.sectionHorizontal:"",width:r&&i===LayoutVariant.THREE_PANEL?"":(o={},o[ZERO_BREAKPOINT]="",o[a.rightPanel.showAtBreakpoint]="100%",o)})}),ApiContentWrap,(function(e){var t,n=e.theme,o=e.showRightPanel,a=e.layout;return mediaCSS({width:(t={},t[ZERO_BREAKPOINT]="none",t.small="calc(100% - "+n.sidebar.width+")",t),maxWidth:n.layout[a===LayoutVariant.THREE_PANEL&&o?LayoutVariant.THREE_PANEL:LayoutVariant.STACKED].maxWidth})}));var RedoclyReferenceDocs=function(e){function t(t){var n=e.call(this,t)||this;return Object.defineProperty(n,"_observer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_updatedItems",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(n,"rootElementRef",{enumerable:!0,configurable:!0,writable:!0,value:React.createRef()}),Object.defineProperty(n,"handleClose",{enumerable:!0,configurable:!0,writable:!0,value:function(){return n.props.store.tryItOut()}}),n.state={searchPopUpShown:!1,searchPopUpValue:""},n}return __extends(t,e),Object.defineProperty(t.prototype,"componentDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this.props.store.onDidMount(),this._observer=reaction((function(){return e.props.store.menu.renderItems}),(function(){e._updatedItems=!0}))}}),Object.defineProperty(t.prototype,"componentDidUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._updatedItems&&(this._updatedItems=!1,this.props.store.menu.scrollToActive())}}),Object.defineProperty(t.prototype,"componentWillUnmount",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.props.store.dispose(),this._observer()}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.props.store,n=t.definition,o=t.menu,a=t.options,r=t.search,i=t.marker,l=this.props.store,c=o.renderItems,s=a.hideDownloadButton,u=!a.hideInfoSection&&("none"===a.pagination||l.menu.activeRenderItemIdx<=0);u&&"none"!==a.pagination&&a.disableSidebar&&c[0]&&"section"!==c[0].type&&(u=!1),this.props._forceRenderInfo&&(u=!0);var p=!u&&null!==s&&!s;return React.createElement(ProProviders,{store:l},React.createElement(RedocWrap,{className:"redoc-wrap",ref:this.rootElementRef},React.createElement(Overlay,{l:l.l}),React.createElement(CssFixes,{whiteLabel:a.whiteLabel,showRightPanel:l.showRightPanel,layout:l.layout}),l.tryItOperation&&React.createElement(Console,{rootElement:this.rootElementRef.current,store:l,operation:l.tryItOperation,onClose:this.handleClose}),!a.disableSidebar&&React.createElement(StickyResponsiveSidebar,{menu:o,className:"menu-content"},!l.options.hideLogo&&React.createElement(ApiLogo,{info:n.info}),n instanceof VersionedSpecStore&&React.createElement(VersionSwitcher,{spec:n,onChange:function(e){void 0!==e.idx&&n.changeVersion(e.idx),o.updateItemsByVersionChange(!0),l.tryItOut(void 0)}}),!l.options.disableSearch&&React.createElement(SearchField,{showPopUp:function(){return e.setState({searchPopUpShown:!0})},searchValue:this.state.searchPopUpValue,marker:i,setSearchValue:function(t){return e.setState({searchPopUpValue:t})}}),React.createElement(SideMenu,{menu:o})),React.createElement(ApiContentWrap,{className:(l.isLoading?"loading ":"")+"api-content",layout:l.layout===LayoutVariant.THREE_PANEL&&l.showRightPanel?LayoutVariant.THREE_PANEL:LayoutVariant.STACKED},a.theme.layout.showDarkRightPanel&&l.showRightPanel&&l.layout!==LayoutVariant.STACKED&&React.createElement(BackgroundStub,null),u&&React.createElement(ApiInfo,{store:l}),p&&React.createElement(DownloadButtonWithLabel,{store:l}),React.createElement(ContentItems,{items:c,store:l}),a.showNextButton&&React.createElement(ContinueButton,{pagination:a.pagination,menu:o}),this.props.children),React.createElement(ControlsWrap,null,React.createElement(ToggleRightPanelButton,{store:l,isVisible:l.layout===LayoutVariant.THREE_PANEL}),React.createElement(ChangeViewButton,{store:l,isVisible:l.showRightPanel})),React.createElement(ProSearchBox,{search:r,marker:i,menu:o,onActivate:o.activateAndScroll.bind(o),options:a,shown:this.state.searchPopUpShown,hidePopUp:function(){return e.setState({searchPopUpShown:!1})},showPopUp:function(){return e.setState({searchPopUpShown:!0})},setSearchValue:function(t){return e.setState({searchPopUpValue:t})},searchValue:this.state.searchPopUpValue}),a.theme.layout.showDarkRightPanel&&l.showRightPanel&&l.layout!==LayoutVariant.STACKED&&React.createElement(BackgroundStubFix,null)))}}),t=__decorate([observer],t)}(React.Component);export{RedoclyReferenceDocs};export function RedoclyReferenceDocsStandalone(e){var t=e.definition,n=e.definitionUrl,o=e.options,a=void 0===o?{}:o,r=e.activeItemId,i=e.activeSampleLanguage,l=e.activeDeepLink,c=argValueToBoolean(a.hideLoading,!1),s=new RedocNormalizedOptions(a),u=React.createElement(ProStoreProvider,{definition:t,definitionUrl:n,options:a,activeItemId:r,activeSampleLanguage:i,activeDeepLink:l},(function(e){var t=e.loading,n=e.store;return t?c?null:React.createElement(Loading,{color:s.theme.colors.primary.main}):React.createElement(RedoclyReferenceDocs,{store:n})}));return a.disableErrorBoundary?u:React.createElement(ErrorBoundary,null,u)}var templateObject_1,RedoclyReferenceDocsMultiStandalone=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,t=e.definitions,n=e.options,o=void 0===n?{}:n,a=argValueToBoolean(o.hideLoading,!1),r=new RedocNormalizedOptions(o);return React.createElement(ErrorBoundary,null,React.createElement(ProStoreProvider,{definitions:t,options:o},(function(e){var t=e.loading,n=e.store;return t?a?null:React.createElement(Loading,{color:r.theme.colors.primary.main}):React.createElement(RedoclyReferenceDocs,{store:n})})))}}),t}(React.Component);export{RedoclyReferenceDocsMultiStandalone};
1
+ import{__decorate,__extends,__makeTemplateObject}from"tslib";import*as React from"react";import{observer}from"mobx-react";import{configure,reaction}from"mobx";import{ApiInfo,ApiLogo,argValueToBoolean,ContentItems,createGlobalStyle,ErrorBoundary,Loading,mediaCSS,mediaMap,MiddlePanel,RedocNormalizedOptions,RightPanel,SideMenu,StickyResponsiveSidebar,ZERO_BREAKPOINT}from"../redoc-lib";import{ProSearchBox,SearchField}from"./Search";import{ContinueButton}from"./NextSectionButton";import{ProStoreProvider}from"./StoreProvider";import{LayoutVariant}from"../services/store-types";import{Console}from"./console/ConsoleLazy";import{ProProviders}from"./ProProviders";import{Overlay}from"./Overlay";import{VersionedSpecStore}from"../services/VersionedSpecStore";import{VersionSwitcher}from"./VersionSwitcher";import{BackgroundStub,BackgroundStubFix,RedocWrap,ApiContentWrap,NextSectionButtonWrap,ToggleRightPanelButton,ChangeViewButton,ControlsWrap}from"./styled.elements";import{DownloadButtonWithLabel}from"../redoc-lib/src/components/DownloadButton";configure({useProxies:"ifavailable"});export var CssFixes=createGlobalStyle(templateObject_1||(templateObject_1=__makeTemplateObject(['\n div[data-section-id]::after {\n content: " ";\n display: block;\n height: 0;\n clear: both;\n visibility: hidden;\n }\n\n '," {\n ","\n }\n\n ",", "," {\n ","\n }\n\n ",", "," {\n ","\n }\n\n "," {\n ",";\n }\n"],['\n div[data-section-id]::after {\n content: " ";\n display: block;\n height: 0;\n clear: both;\n visibility: hidden;\n }\n\n '," {\n ","\n }\n\n ",", "," {\n ","\n }\n\n ",", "," {\n ","\n }\n\n "," {\n ",";\n }\n"])),RightPanel,(function(e){var t,n=e.theme,o=e.showRightPanel,a=e.layout;return mediaCSS({width:a===LayoutVariant.STACKED?"100%":"",paddingLeft:a===LayoutVariant.STACKED?n.spacing.sectionHorizontal:"",display:o?"":(t={},t[ZERO_BREAKPOINT]="",t[n.rightPanel.showAtBreakpoint]="none",t)})}),BackgroundStub,BackgroundStubFix,(function(e){var t,n=e.theme,o=e.showRightPanel,a=e.layout;return mediaCSS({display:o&&a!==LayoutVariant.STACKED?"":(t={},t[ZERO_BREAKPOINT]="",t[n.rightPanel.showAtBreakpoint]="none",t)})}),MiddlePanel,NextSectionButtonWrap,(function(e){var t,n,o,a=e.theme,r=e.showRightPanel,i=e.layout;return mediaCSS({maxWidth:r&&i===LayoutVariant.THREE_PANEL?mediaMap(a.breakpoints,[a.layout["three-panel"].middlePanelMaxWidth],(t={},t[ZERO_BREAKPOINT]=function(){return"none"},t[a.rightPanel.showAtBreakpoint]=function(e){return e},t)):"none",margin:r&&i===LayoutVariant.THREE_PANEL?mediaMap(a.breakpoints,[a.rightPanel.width,a.layout["three-panel"].middlePanelMaxWidth],(n={},n[ZERO_BREAKPOINT]=function(){return"0"},n[a.rightPanel.showAtBreakpoint]=function(e,t){return t&&"none"!==t?"0 max(calc((100% - "+e+" - "+t+"}) / 2), 0px)":"0"},n)):"0",paddingRight:i===LayoutVariant.STACKED?a.spacing.sectionHorizontal:"",width:r&&i===LayoutVariant.THREE_PANEL?"":(o={},o[ZERO_BREAKPOINT]="",o[a.rightPanel.showAtBreakpoint]="100%",o)})}),ApiContentWrap,(function(e){var t,n=e.theme,o=e.showRightPanel,a=e.layout;return mediaCSS({width:(t={},t[ZERO_BREAKPOINT]="none",t.small="calc(100% - "+n.sidebar.width+")",t),maxWidth:n.layout[a===LayoutVariant.THREE_PANEL&&o?LayoutVariant.THREE_PANEL:LayoutVariant.STACKED].maxWidth})}));var RedoclyReferenceDocs=function(e){function t(t){var n=e.call(this,t)||this;return Object.defineProperty(n,"_observer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_updatedItems",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(n,"rootElementRef",{enumerable:!0,configurable:!0,writable:!0,value:React.createRef()}),Object.defineProperty(n,"handleClose",{enumerable:!0,configurable:!0,writable:!0,value:function(){return n.props.store.tryItOut()}}),n.state={searchPopUpShown:!1,searchPopUpValue:""},n}return __extends(t,e),Object.defineProperty(t.prototype,"componentDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this.props.store.onDidMount(),this._observer=reaction((function(){return e.props.store.menu.renderItems}),(function(){e._updatedItems=!0}))}}),Object.defineProperty(t.prototype,"componentDidUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._updatedItems&&(this._updatedItems=!1,this.props.store.menu.scrollToActive())}}),Object.defineProperty(t.prototype,"componentWillUnmount",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.props.store.dispose(),this._observer()}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.props,n=t.store,o=t._forceRenderInfo,a=n.definition,r=n.menu,i=n.options,l=n.search,c=n.marker,s=i.hideDownloadButton,u=i.hideInfoSection,d=i.pagination,p=i.disableSidebar,m=r.renderItems,h="none"===d||r.activeRenderItemIdx<=0,R=!u&&h;R&&"none"!==d&&p&&m[0]&&"section"!==m[0].type&&(R=!1),o&&(R=!0);var f=!R&&null!==s&&!s&&h;return React.createElement(ProProviders,{store:n},React.createElement(RedocWrap,{className:"redoc-wrap",ref:this.rootElementRef},React.createElement(Overlay,{l:n.l}),React.createElement(CssFixes,{whiteLabel:i.whiteLabel,showRightPanel:n.showRightPanel,layout:n.layout}),n.tryItOperation&&React.createElement(Console,{rootElement:this.rootElementRef.current,store:n,operation:n.tryItOperation,onClose:this.handleClose}),!i.disableSidebar&&React.createElement(StickyResponsiveSidebar,{menu:r,className:"menu-content"},!i.hideLogo&&React.createElement(ApiLogo,{info:a.info}),a instanceof VersionedSpecStore&&React.createElement(VersionSwitcher,{spec:a,onChange:function(e){void 0!==e.idx&&a.changeVersion(e.idx),r.updateItemsByVersionChange(!0),n.tryItOut(void 0)}}),!i.disableSearch&&React.createElement(SearchField,{showPopUp:function(){return e.setState({searchPopUpShown:!0})},searchValue:this.state.searchPopUpValue,marker:c,setSearchValue:function(t){return e.setState({searchPopUpValue:t})}}),React.createElement(SideMenu,{menu:r})),React.createElement(ApiContentWrap,{className:(n.isLoading?"loading ":"")+"api-content",layout:n.layout===LayoutVariant.THREE_PANEL&&n.showRightPanel?LayoutVariant.THREE_PANEL:LayoutVariant.STACKED},i.theme.layout.showDarkRightPanel&&n.showRightPanel&&n.layout!==LayoutVariant.STACKED&&React.createElement(BackgroundStub,null),R&&React.createElement(ApiInfo,{store:n}),f&&React.createElement(DownloadButtonWithLabel,{store:n}),React.createElement(ContentItems,{items:m,store:n}),i.showNextButton&&React.createElement(ContinueButton,{pagination:i.pagination,menu:r}),this.props.children),React.createElement(ControlsWrap,null,React.createElement(ToggleRightPanelButton,{store:n,isVisible:n.layout===LayoutVariant.THREE_PANEL}),React.createElement(ChangeViewButton,{store:n,isVisible:n.showRightPanel})),React.createElement(ProSearchBox,{search:l,marker:c,menu:r,onActivate:r.activateAndScroll.bind(r),options:i,shown:this.state.searchPopUpShown,hidePopUp:function(){return e.setState({searchPopUpShown:!1})},showPopUp:function(){return e.setState({searchPopUpShown:!0})},setSearchValue:function(t){return e.setState({searchPopUpValue:t})},searchValue:this.state.searchPopUpValue}),i.theme.layout.showDarkRightPanel&&n.showRightPanel&&n.layout!==LayoutVariant.STACKED&&React.createElement(BackgroundStubFix,null)))}}),t=__decorate([observer],t)}(React.Component);export{RedoclyReferenceDocs};export function RedoclyReferenceDocsStandalone(e){var t=e.definition,n=e.definitionUrl,o=e.options,a=void 0===o?{}:o,r=e.activeItemId,i=e.activeSampleLanguage,l=e.activeDeepLink,c=argValueToBoolean(a.hideLoading,!1),s=new RedocNormalizedOptions(a),u=React.createElement(ProStoreProvider,{definition:t,definitionUrl:n,options:a,activeItemId:r,activeSampleLanguage:i,activeDeepLink:l},(function(e){var t=e.loading,n=e.store;return t?c?null:React.createElement(Loading,{color:s.theme.colors.primary.main}):React.createElement(RedoclyReferenceDocs,{store:n})}));return a.disableErrorBoundary?u:React.createElement(ErrorBoundary,null,u)}var templateObject_1,RedoclyReferenceDocsMultiStandalone=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,t=e.definitions,n=e.options,o=void 0===n?{}:n,a=argValueToBoolean(o.hideLoading,!1),r=new RedocNormalizedOptions(o);return React.createElement(ErrorBoundary,null,React.createElement(ProStoreProvider,{definitions:t,options:o},(function(e){var t=e.loading,n=e.store;return t?a?null:React.createElement(Loading,{color:r.theme.colors.primary.main}):React.createElement(RedoclyReferenceDocs,{store:n})})))}}),t}(React.Component);export{RedoclyReferenceDocsMultiStandalone};
2
2
  //# sourceMappingURL=RedoclyReferenceDocs.js.map
@@ -1,2 +1,2 @@
1
- import{__assign,__awaiter,__decorate,__extends,__generator,__makeTemplateObject,__rest}from"tslib";import*as React from"react";import{Form,useField}from"informed";import{observer}from"mobx-react";import{get,useDimensions,unescapeFormId}from"../../utils";import{CloseButton,ConsoleBody,ConsoleWrap}from"./styled.components";import{ServerChooser}from"./ServerDropdown";import{OperationParameters}from"./OperationParameters";import{ActionPanel}from"./ActionPanel";import{ResponsePanel}from"./ResponsePanel";import{RequestBody}from"./RequestBody";import{ConsoleBadges}from"./ConsoleBadges";import{AuthPanel,requiredValidator}from"./AuthPanel";import{AnalyticsEventType}from"../../services";import Swagger from"swagger-client";import{JsonPointer,ShelfIcon,CrossIcon,LockIcon}from"../../redoc-lib";import{RenderHook}from"../../redoc-lib/src/components/helper";import{l}from"../../redoc-lib/src/services/Labels";import styled from"../../redoc-lib/src/styled-components";import{CodeHeader,Panel,Header,Accordion,Trigger,Title}from"../Panel";import{OAuth2}from"../../services/OAuth2";import{PanelBody}from"../Panel/PanelBody";import{getFileNameFromHeaders,getParameters,unescapeQueryParams,updateStorage}from"./utils";import{isFileUploadMime}from"../common/FileUpload/helper";function normalizeUrlProtocol(e){return e.startsWith("//")?"https:"+e:e}var flexColumn={flex:1,display:"flex",flexDirection:"column"},Console=function(e){function t(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"formApi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"setFormApi",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=e.getState());var o=t.values,n=__rest(t,["values"]);r.formApi=e,setTimeout((function(){var e=__assign(__assign({},n),{values:__assign(__assign({},o),{query:unescapeQueryParams(o.query||{})})});r.setState({form:e})}),0)}}),Object.defineProperty(r,"handleChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){var t=e.values,o=__rest(e,["values"]),n=__assign(__assign({},o),{values:__assign(__assign({},t),{query:unescapeQueryParams(t.query||{})})});r.setState({form:n}),updateStorage(n)}}),Object.defineProperty(r,"handleTabChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){r.setState({activeTab:e})}}),Object.defineProperty(r,"handleServerChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){r.setState({server:e}),r.props.operation.setActiveServer(e)}}),Object.defineProperty(r,"handleExecute",{enumerable:!0,configurable:!0,writable:!0,value:function(){return __awaiter(r,void 0,void 0,(function(){var e,t,r,o,n,a,s,i,l,c,u,p,d,m,h,v,f,g,y,_,b,P,R,S,C,E,I,w,T,A,k,x,O,q,B,F,j,H,U,V,D,N=this;return __generator(this,(function(W){switch(W.label){case 0:if(e=this.props,t=e.store,r=e.operation,o=e.onResponse,n=this.state.form,a=n.values,s=n.invalid,this.formApi.submitForm(),s)return this.setState({shaking:!0}),setTimeout((function(){return N.setState({shaking:!1})}),1e3),null===(F=null===(B=null==t?void 0:t.options.events)||void 0===B?void 0:B.tryItSent)||void 0===F||F.call(B,{eventType:AnalyticsEventType.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:r.operationId,operationPath:r.path,operationHttpVerb:r.httpVerb,operationSummary:r.description}),[2];if(i=this.props.operation.requestBody,l=i&&i.content&&i.content.active&&i.content.active.name||"",c=a.body,/json/.test(l))try{c=JSON.parse(c)}catch(e){console.error(e)}if(this.setState({loading:!0}),u=this.state.resolvedRawSpec,p=(r.httpVerb||"").toLowerCase(),!(d=get(u,["paths",r.path,p,"servers"])||get(u,["paths",r.path,"servers"])||get(u,["servers"])))throw console.error("Servers are not specified in your OpenAPI file. You can't use Try It Out console without specifying servers. If you use OpenAPI 2, make sure you configured host and basepath"),new Error("Servers are not specified");m=d.find((function(e){return N.state.server.url.endsWith(e.url.endsWith("/")?e.url.substring(0,e.url.length-1):e.url)})),h=Date.now(),v=!!window.document.documentMode,g=a.auth,a.auth?(y=Object.keys(a.auth)[0],_=unescapeFormId(y),f=__assign(__assign({},u),{components:__assign(__assign({},u.components),{securitySchemes:__assign(__assign({},u.components.securitySchemes),(k={},k[_]=__assign(__assign({},u.components.securitySchemes[_]),{type:"openIdConnect"===u.components.securitySchemes[_].type?"oauth2":u.components.securitySchemes[_].type}),k))})}),g=__assign(__assign({},g),((x={})[_]=g[y],x))):f=__assign({},u),(b=t.options.corsProxyUrl)&&d.length&&(f.servers=d.map((function(e){return __assign(__assign({},e),{url:b+normalizeUrlProtocol(e.url)})})),f.paths=__assign(__assign({},f.paths),((O={})[r.path]=__assign(__assign({},f.paths[r.path]),((q={})[p]=__assign(__assign({},f.paths[r.path][p]),{servers:void 0}),q.servers=void 0,q)),O))),(P=(null===(H=null===(j=null==i?void 0:i.content)||void 0===j?void 0:j.active)||void 0===H?void 0:H.name)||null)&&c&&isFileUploadMime(P)&&(R=Object.values(c),c=R.length>1?R:R[0]),S=function(e,t){return function(r){return N.props.store.options.sendXUserAgentInTryIt&&(r.headers["X-User-Agent"]="Redocly Try it API console"),e?e(r,t):r}},C={userFetch:v&&require("cross-fetch").fetch,server:b?b+normalizeUrlProtocol(m.url):m.url,serverVariables:this.state.server.variables,spec:f,pathName:r.path,method:r.httpVerb,parameters:__assign(__assign(__assign(__assign({},a.path),a.query),a.header),a.cookie),securities:{authorized:g},requestBody:c,requestContentType:P,responseContentType:(null===(U=a.header)||void 0===U?void 0:U.Accept)||null,requestInterceptor:S(t.options.requestInterceptor,r)},W.label=1;case 1:return W.trys.push([1,5,8,9]),[4,Swagger.execute(C)];case 2:return E=W.sent(),(I=null==E?void 0:E.data)instanceof Blob?(isFileUploadMime(I.type)&&(E.fileInfo={rawData:I,fileName:getFileNameFromHeaders(E.headers)}),w=E,[4,I.text()]):[3,4];case 3:w.data=W.sent(),W.label=4;case 4:return null==o||o({request:C,response:E}),this.setState({response:E,error:void 0}),[3,9];case 5:return(T=W.sent())&&T.response&&T.response.data instanceof Blob?(A=T.response,[4,T.response.data.text()]):[3,7];case 6:A.data=W.sent(),null==o||o({request:C,response:T.response}),W.label=7;case 7:return this.setState({response:void 0,error:T}),[3,9];case 8:return this.setState({loading:!1,activeTab:1,time:Date.now()-h}),null===(D=null===(V=null==t?void 0:t.options.events)||void 0===V?void 0:V.tryItSent)||void 0===D||D.call(V,{eventType:AnalyticsEventType.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:r.operationId,operationPath:r.path,operationHttpVerb:r.httpVerb,operationSummary:r.description}),[7];case 9:return[2]}}))}))}}),r.state={form:{values:{path:getParameters(t.operation.parameters,"path"),cookie:getParameters(t.operation.parameters,"cookie"),header:getParameters(t.operation.parameters,"header"),query:getParameters(t.operation.parameters,"query")}},shaking:!1,loading:!1,activeTab:0,server:{}},r}return __extends(t,e),Object.defineProperty(t.prototype,"componentDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,o;return __generator(this,(function(n){switch(n.label){case 0:return e=this.props,t=e.store,r=e.operation,[4,t.dereferenceSpecForTryIt(r)];case 1:return o=n.sent(),this.setState({resolvedRawSpec:o}),this.formApi.setValues({}),[2]}}))}))}}),Object.defineProperty(t.prototype,"componentDidUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.operation!==this.props.operation&&this.setState({response:void 0,error:void 0,activeTab:0})}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,t=e.operation,r=e.className,o=e.rootElement,n=this.state,a=n.shaking,s=n.activeTab,i=n.form,l=n.response,c=n.loading,u=n.error,p=!(!l&&!u);return React.createElement(ConsoleWrapHook,{shaking:a,className:r,rootElement:o},React.createElement(CodeHeader,null,React.createElement(ConsoleBadges,{active:s,hasResponse:p,onChange:this.handleTabChange}),this.props.onClose&&React.createElement(CloseButton,{onClick:this.props.onClose}," ✕ ")),React.createElement(ConsoleBody,{hidden:0!==s},this.renderRequest()),React.createElement(ConsoleBody,{hidden:1!==s},this.renderResponse()),React.createElement(ActionPanel,{hasResponse:p,params:i.values,operation:t,loading:c,execute:this.handleExecute}))}}),Object.defineProperty(t.prototype,"renderRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t=this.props,r=t.operation,o=t.store,n=t.properties,a=t.securityDefaults,s=this.state,i=s.form,c=s.resolvedRawSpec,u=s.server,p=i.errors||{},d=p.path||p.cookie||p.header||p.query,m=c&&JsonPointer.get(c,r.pointer),h=i.values&&i.values.auth&&Object.keys(i.values.auth)[0];h&&i.values.auth[h]||(h=void 0),!h||void 0===i.values.auth[h].token&&void 0===i.values.auth[h].client_id&&void 0===i.values.auth[h].client_secret||i.values.auth[h].token&&i.values.auth[h].token.access_token||(h=void 0),h&&null!=i.values.auth[h].username&&(i.values.auth[h].username&&i.values.auth[h].password||(h=void 0));var v=r.parameters||[],f=null===(e=null==o?void 0:o.options.hooks)||void 0===e?void 0:e.ReplaceTryItSecurityPanel;return!c&&React.createElement(React.Fragment,null,"Loading...")||React.createElement(React.Fragment,null,React.createElement(Form,{onChange:this.handleChange,getApi:this.setFormApi,style:__assign(__assign({},flexColumn),{margin:0})},React.createElement(Accordion,{initialActiveIdx:r.security.length&&h?1:0},r.security.length&&React.createElement(TryItPanel,{header:l("tryItAuth"),"data-cy":"security-trigger",renderChildrenHidden:!0,error:!h&&!!p.auth,success:!!h},f?React.createElement(AuthPanelHook,{field:"auth",validate:requiredValidator},(function(e){return React.createElement(RenderHook,{Hook:f,props:{server:u,operation:r,onChange:e,OAuth2:OAuth2}})})):React.createElement(AuthPanel,{formApi:this.formApi,form:i,operation:r,activeServer:u.url,authCorsProxyUrl:o.options.authCorsProxyUrl,securityDefaults:a}))||null,r.requestBody&&React.createElement(TryItPanel,{header:l("tryItBody"),"data-cy":"body-trigger",renderChildrenHidden:!0,error:!!p.body},React.createElement(RequestBody,{validate:allowBodyErrors,console:this,body:r.requestBody,id:r.id,resolvedBody:m.requestBody,properties:n}))||null,v.length&&React.createElement(TryItPanel,{header:l("tryItParameters"),"data-cy":"parameters-trigger",error:d,renderChildrenHidden:!0},React.createElement(OperationParameters,{operation:r,values:i.values,errors:i.errors||{}}))||null)),React.createElement(ServerChooser,{operation:r,onChange:this.handleServerChange}))}}),Object.defineProperty(t.prototype,"renderResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.state,t=e.response,r=e.error,o=e.time;return React.createElement(ResponsePanel,{response:t,error:r,time:o})}}),t=__decorate([observer],t)}(React.Component);export{Console};function allowBodyErrors(){}function ConsoleWrapHook(e){var t=e.shaking,r=e.className,o=e.children,n=e.rootElement,a=useDimensions(n)[0];return React.createElement(ConsoleWrap,{shaking:t,className:r,"data-cy":"console",fullWidth:null==a?void 0:a.width},o)}function AuthPanelHook(e){var t=useField(__assign({},e)),r=t.fieldApi,o=t.render,n=t.userProps,a=r.setValue,s=n.children;return o(React.createElement(React.Fragment,null,s(a)))}export function TryItPanel(e){var t=e.header,r=e.error,o=e.success,n=__rest(e,["header","error","success"]);return React.createElement(StyledTryItPanel,__assign({},n,{header:function(e){var a=e.toggle,s=e.expanded;return React.createElement(Header,{onClick:a,isExpanded:s,"data-cy":n["data-cy"]},React.createElement(Trigger,null,React.createElement(Title,null,t),React.createElement(ShelfIcon,{direction:s?"down":"right"})),r&&React.createElement(CrossIcon,{size:"14px",color:"#ff908b"})||null,o&&React.createElement(LockIcon,{size:"14px",color:"#56ff26"})||null)}}))}var templateObject_1,StyledTryItPanel=styled(Panel)(templateObject_1||(templateObject_1=__makeTemplateObject(["\n "," {\n color: white;\n border: 1px solid ",";\n padding: 10px;\n }\n\n "," path {\n fill: white;\n }\n\n "," {\n padding: 15px 10px;\n background-color: #3e4c59;\n border: 1px solid ",";\n border-top: 0;\n }\n"],["\n "," {\n color: white;\n border: 1px solid ",";\n padding: 10px;\n }\n\n "," path {\n fill: white;\n }\n\n "," {\n padding: 15px 10px;\n background-color: #3e4c59;\n border: 1px solid ",";\n border-top: 0;\n }\n"])),Header,(function(e){return e.error?"#ff908b":"#89949f"}),ShelfIcon,PanelBody,(function(e){return e.error?"#ff908b":"#89949f"}));
1
+ import{__assign,__awaiter,__decorate,__extends,__generator,__makeTemplateObject,__rest}from"tslib";import*as React from"react";import{Form,useField}from"informed";import{observer}from"mobx-react";import{get,useDimensions,unescapeFormId}from"../../utils";import{CloseButton,ConsoleBody,ConsoleWrap}from"./styled.components";import{ServerChooser}from"./ServerDropdown";import{OperationParameters}from"./OperationParameters";import{ActionPanel}from"./ActionPanel";import{ResponsePanel}from"./ResponsePanel";import{RequestBody}from"./RequestBody";import{ConsoleBadges}from"./ConsoleBadges";import{AuthPanel,requiredValidator}from"./AuthPanel";import{AnalyticsEventType}from"../../services";import Swagger from"swagger-client";import{JsonPointer,ShelfIcon,CrossIcon,LockIcon}from"../../redoc-lib";import{RenderHook}from"../../redoc-lib/src/components/RenderHook";import{l}from"../../redoc-lib/src/services/Labels";import styled from"../../redoc-lib/src/styled-components";import{CodeHeader,Panel,Header,Accordion,Trigger,Title}from"../Panel";import{OAuth2}from"../../services/OAuth2";import{PanelBody}from"../Panel/PanelBody";import{getFileNameFromHeaders,getParameters,unescapeQueryParams,updateStorage}from"./utils";import{isFileUploadMime}from"../common/FileUpload/helper";function normalizeUrlProtocol(e){return e.startsWith("//")?"https:"+e:e}var flexColumn={flex:1,display:"flex",flexDirection:"column"},Console=function(e){function t(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"formApi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"setFormApi",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=e.getState());var o=t.values,n=__rest(t,["values"]);r.formApi=e,setTimeout((function(){var e=__assign(__assign({},n),{values:__assign(__assign({},o),{query:unescapeQueryParams(o.query||{})})});r.setState({form:e})}),0)}}),Object.defineProperty(r,"handleChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){var t=e.values,o=__rest(e,["values"]),n=__assign(__assign({},o),{values:__assign(__assign({},t),{query:unescapeQueryParams(t.query||{})})});r.setState({form:n}),updateStorage(n)}}),Object.defineProperty(r,"handleTabChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){r.setState({activeTab:e})}}),Object.defineProperty(r,"handleServerChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){r.setState({server:e}),r.props.operation.setActiveServer(e)}}),Object.defineProperty(r,"handleExecute",{enumerable:!0,configurable:!0,writable:!0,value:function(){return __awaiter(r,void 0,void 0,(function(){var e,t,r,o,n,a,s,i,l,c,u,p,d,m,h,v,f,g,y,_,b,P,R,S,C,E,I,w,T,A,k,x,O,q,B,F,j,H,U,V,D,N=this;return __generator(this,(function(W){switch(W.label){case 0:if(e=this.props,t=e.store,r=e.operation,o=e.onResponse,n=this.state.form,a=n.values,s=n.invalid,this.formApi.submitForm(),s)return this.setState({shaking:!0}),setTimeout((function(){return N.setState({shaking:!1})}),1e3),null===(F=null===(B=null==t?void 0:t.options.events)||void 0===B?void 0:B.tryItSent)||void 0===F||F.call(B,{eventType:AnalyticsEventType.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:r.operationId,operationPath:r.path,operationHttpVerb:r.httpVerb,operationSummary:r.description}),[2];if(i=this.props.operation.requestBody,l=i&&i.content&&i.content.active&&i.content.active.name||"",c=a.body,/json/.test(l))try{c=JSON.parse(c)}catch(e){console.error(e)}if(this.setState({loading:!0}),u=this.state.resolvedRawSpec,p=(r.httpVerb||"").toLowerCase(),!(d=get(u,["paths",r.path,p,"servers"])||get(u,["paths",r.path,"servers"])||get(u,["servers"])))throw console.error("Servers are not specified in your OpenAPI file. You can't use Try It Out console without specifying servers. If you use OpenAPI 2, make sure you configured host and basepath"),new Error("Servers are not specified");m=d.find((function(e){return N.state.server.url.endsWith(e.url.endsWith("/")?e.url.substring(0,e.url.length-1):e.url)})),h=Date.now(),v=!!window.document.documentMode,g=a.auth,a.auth?(y=Object.keys(a.auth)[0],_=unescapeFormId(y),f=__assign(__assign({},u),{components:__assign(__assign({},u.components),{securitySchemes:__assign(__assign({},u.components.securitySchemes),(k={},k[_]=__assign(__assign({},u.components.securitySchemes[_]),{type:"openIdConnect"===u.components.securitySchemes[_].type?"oauth2":u.components.securitySchemes[_].type}),k))})}),g=__assign(__assign({},g),((x={})[_]=g[y],x))):f=__assign({},u),(b=t.options.corsProxyUrl)&&d.length&&(f.servers=d.map((function(e){return __assign(__assign({},e),{url:b+normalizeUrlProtocol(e.url)})})),f.paths=__assign(__assign({},f.paths),((O={})[r.path]=__assign(__assign({},f.paths[r.path]),((q={})[p]=__assign(__assign({},f.paths[r.path][p]),{servers:void 0}),q.servers=void 0,q)),O))),(P=(null===(H=null===(j=null==i?void 0:i.content)||void 0===j?void 0:j.active)||void 0===H?void 0:H.name)||null)&&c&&isFileUploadMime(P)&&(R=Object.values(c),c=R.length>1?R:R[0]),S=function(e,t){return function(r){return N.props.store.options.sendXUserAgentInTryIt&&(r.headers["X-User-Agent"]="Redocly Try it API console"),e?e(r,t):r}},C={userFetch:v&&require("cross-fetch").fetch,server:b?b+normalizeUrlProtocol(m.url):m.url,serverVariables:this.state.server.variables,spec:f,pathName:r.path,method:r.httpVerb,parameters:__assign(__assign(__assign(__assign({},a.path),a.query),a.header),a.cookie),securities:{authorized:g},requestBody:c,requestContentType:P,responseContentType:(null===(U=a.header)||void 0===U?void 0:U.Accept)||null,requestInterceptor:S(t.options.requestInterceptor,r)},W.label=1;case 1:return W.trys.push([1,5,8,9]),[4,Swagger.execute(C)];case 2:return E=W.sent(),(I=null==E?void 0:E.data)instanceof Blob?(isFileUploadMime(I.type)&&(E.fileInfo={rawData:I,fileName:getFileNameFromHeaders(E.headers)}),w=E,[4,I.text()]):[3,4];case 3:w.data=W.sent(),W.label=4;case 4:return null==o||o({request:C,response:E}),this.setState({response:E,error:void 0}),[3,9];case 5:return(T=W.sent())&&T.response&&T.response.data instanceof Blob?(A=T.response,[4,T.response.data.text()]):[3,7];case 6:A.data=W.sent(),null==o||o({request:C,response:T.response}),W.label=7;case 7:return this.setState({response:void 0,error:T}),[3,9];case 8:return this.setState({loading:!1,activeTab:1,time:Date.now()-h}),null===(D=null===(V=null==t?void 0:t.options.events)||void 0===V?void 0:V.tryItSent)||void 0===D||D.call(V,{eventType:AnalyticsEventType.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:r.operationId,operationPath:r.path,operationHttpVerb:r.httpVerb,operationSummary:r.description}),[7];case 9:return[2]}}))}))}}),r.state={form:{values:{path:getParameters(t.operation.parameters,"path"),cookie:getParameters(t.operation.parameters,"cookie"),header:getParameters(t.operation.parameters,"header"),query:getParameters(t.operation.parameters,"query")}},shaking:!1,loading:!1,activeTab:0,server:{}},r}return __extends(t,e),Object.defineProperty(t.prototype,"componentDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,o;return __generator(this,(function(n){switch(n.label){case 0:return e=this.props,t=e.store,r=e.operation,[4,t.dereferenceSpecForTryIt(r)];case 1:return o=n.sent(),this.setState({resolvedRawSpec:o}),this.formApi.setValues({}),[2]}}))}))}}),Object.defineProperty(t.prototype,"componentDidUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.operation!==this.props.operation&&this.setState({response:void 0,error:void 0,activeTab:0})}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,t=e.operation,r=e.className,o=e.rootElement,n=this.state,a=n.shaking,s=n.activeTab,i=n.form,l=n.response,c=n.loading,u=n.error,p=!(!l&&!u);return React.createElement(ConsoleWrapHook,{shaking:a,className:r,rootElement:o},React.createElement(CodeHeader,null,React.createElement(ConsoleBadges,{active:s,hasResponse:p,onChange:this.handleTabChange}),this.props.onClose&&React.createElement(CloseButton,{onClick:this.props.onClose}," ✕ ")),React.createElement(ConsoleBody,{hidden:0!==s},this.renderRequest()),React.createElement(ConsoleBody,{hidden:1!==s},this.renderResponse()),React.createElement(ActionPanel,{hasResponse:p,params:i.values,operation:t,loading:c,execute:this.handleExecute}))}}),Object.defineProperty(t.prototype,"renderRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t=this.props,r=t.operation,o=t.store,n=t.properties,a=t.securityDefaults,s=this.state,i=s.form,c=s.resolvedRawSpec,u=s.server,p=i.errors||{},d=p.path||p.cookie||p.header||p.query,m=c&&JsonPointer.get(c,r.pointer),h=i.values&&i.values.auth&&Object.keys(i.values.auth)[0];h&&i.values.auth[h]||(h=void 0),!h||void 0===i.values.auth[h].token&&void 0===i.values.auth[h].client_id&&void 0===i.values.auth[h].client_secret||i.values.auth[h].token&&i.values.auth[h].token.access_token||(h=void 0),h&&null!=i.values.auth[h].username&&(i.values.auth[h].username&&i.values.auth[h].password||(h=void 0));var v=r.parameters||[],f=null===(e=null==o?void 0:o.options.hooks)||void 0===e?void 0:e.ReplaceTryItSecurityPanel;return!c&&React.createElement(React.Fragment,null,"Loading...")||React.createElement(React.Fragment,null,React.createElement(Form,{onChange:this.handleChange,getApi:this.setFormApi,style:__assign(__assign({},flexColumn),{margin:0})},React.createElement(Accordion,{initialActiveIdx:r.security.length&&h?1:0},r.security.length&&React.createElement(TryItPanel,{header:l("tryItAuth"),"data-cy":"security-trigger",renderChildrenHidden:!0,error:!h&&!!p.auth,success:!!h},f?React.createElement(AuthPanelHook,{field:"auth",validate:requiredValidator},(function(e){return React.createElement(RenderHook,{Hook:f,props:{server:u,operation:r,onChange:e,OAuth2:OAuth2}})})):React.createElement(AuthPanel,{formApi:this.formApi,form:i,operation:r,activeServer:u.url,authCorsProxyUrl:o.options.authCorsProxyUrl,securityDefaults:a}))||null,r.requestBody&&React.createElement(TryItPanel,{header:l("tryItBody"),"data-cy":"body-trigger",renderChildrenHidden:!0,error:!!p.body},React.createElement(RequestBody,{validate:allowBodyErrors,console:this,body:r.requestBody,id:r.id,resolvedBody:m.requestBody,properties:n}))||null,v.length&&React.createElement(TryItPanel,{header:l("tryItParameters"),"data-cy":"parameters-trigger",error:d,renderChildrenHidden:!0},React.createElement(OperationParameters,{operation:r,values:i.values,errors:i.errors||{}}))||null)),React.createElement(ServerChooser,{operation:r,onChange:this.handleServerChange}))}}),Object.defineProperty(t.prototype,"renderResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.state,t=e.response,r=e.error,o=e.time;return React.createElement(ResponsePanel,{response:t,error:r,time:o})}}),t=__decorate([observer],t)}(React.Component);export{Console};function allowBodyErrors(){}function ConsoleWrapHook(e){var t=e.shaking,r=e.className,o=e.children,n=e.rootElement,a=useDimensions(n)[0];return React.createElement(ConsoleWrap,{shaking:t,className:r,"data-cy":"console",fullWidth:null==a?void 0:a.width},o)}function AuthPanelHook(e){var t=useField(__assign({},e)),r=t.fieldApi,o=t.render,n=t.userProps,a=r.setValue,s=n.children;return o(React.createElement(React.Fragment,null,s(a)))}export function TryItPanel(e){var t=e.header,r=e.error,o=e.success,n=__rest(e,["header","error","success"]);return React.createElement(StyledTryItPanel,__assign({},n,{header:function(e){var a=e.toggle,s=e.expanded;return React.createElement(Header,{onClick:a,isExpanded:s,"data-cy":n["data-cy"]},React.createElement(Trigger,null,React.createElement(Title,null,t),React.createElement(ShelfIcon,{direction:s?"down":"right"})),r&&React.createElement(CrossIcon,{size:"14px",color:"#ff908b"})||null,o&&React.createElement(LockIcon,{size:"14px",color:"#56ff26"})||null)}}))}var templateObject_1,StyledTryItPanel=styled(Panel)(templateObject_1||(templateObject_1=__makeTemplateObject(["\n "," {\n color: white;\n border: 1px solid ",";\n padding: 10px;\n }\n\n "," path {\n fill: white;\n }\n\n "," {\n padding: 15px 10px;\n background-color: #3e4c59;\n border: 1px solid ",";\n border-top: 0;\n }\n"],["\n "," {\n color: white;\n border: 1px solid ",";\n padding: 10px;\n }\n\n "," path {\n fill: white;\n }\n\n "," {\n padding: 15px 10px;\n background-color: #3e4c59;\n border: 1px solid ",";\n border-top: 0;\n }\n"])),Header,(function(e){return e.error?"#ff908b":"#89949f"}),ShelfIcon,PanelBody,(function(e){return e.error?"#ff908b":"#89949f"}));
2
2
  //# sourceMappingURL=Console.js.map
@@ -1,2 +1,2 @@
1
- var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k;import{__makeTemplateObject}from"tslib";import styled,{css,extensionsHook,mediaCSS,ZERO_BREAKPOINT}from"../styled-components";import{deprecatedCss}from"./mixins";export var PropertiesTableCaption=styled.caption(templateObject_1||(templateObject_1=__makeTemplateObject(["\n text-align: right;\n font-size: 0.9em;\n font-weight: normal;\n color: ",";\n"],["\n text-align: right;\n font-size: 0.9em;\n font-weight: normal;\n color: ",";\n"])),(function(n){return n.theme.colors.text.secondary}));var templateObject_1,templateObject_2,templateObject_3,templateObject_4,templateObject_5,templateObject_6,templateObject_7,templateObject_8,templateObject_9,templateObject_10,repeatingGradient=css(templateObject_2||(templateObject_2=__makeTemplateObject(["\n repeating-linear-gradient(0deg,\n ",",\n "," 3px,\n transparent 3px,\n transparent 5px,\n "," 5px);\n"],["\n repeating-linear-gradient(0deg,\n ",",\n "," 3px,\n transparent 3px,\n transparent 5px,\n "," 5px);\n"])),(function(n){return n.theme.schema.linesColor}),(function(n){return n.theme.schema.linesColor}),(function(n){return n.theme.schema.linesColor}));export var PropertyCell=styled.td(templateObject_3||(templateObject_3=__makeTemplateObject(["\n box-sizing: border-box;\n position: relative;\n padding: 10px;\n background-image: ",";\n background-repeat: no-repeat;\n background-size: 1px 100%;\n\n ","\n\n tr:first-of-type > & {\n background-image: ",";\n background-position: 0 10px;\n padding-top: 0;\n }\n\n tr.last > & {\n background-image: ",";\n padding-bottom: 0;\n ",";\n }\n\n tr.last + tr > & {\n background: none;\n }\n\n tr.last:first-child > & {\n background-image: ",";\n ",";\n }\n"],["\n box-sizing: border-box;\n position: relative;\n padding: 10px;\n background-image: ",";\n background-repeat: no-repeat;\n background-size: 1px 100%;\n\n ","\n\n tr:first-of-type > & {\n background-image: ",";\n background-position: 0 10px;\n padding-top: 0;\n }\n\n tr.last > & {\n background-image: ",";\n padding-bottom: 0;\n ",";\n }\n\n tr.last + tr > & {\n background: none;\n }\n\n tr.last:first-child > & {\n background-image: ",";\n ",";\n }\n"])),repeatingGradient,mediaCSS({display:(_a={},_a[ZERO_BREAKPOINT]="block",_a.small="table-cell",_a),overflow:(_b={},_b[ZERO_BREAKPOINT]="hidden",_b.small="initial",_b),padding:(_c={},_c[ZERO_BREAKPOINT]="0 20px",_c.small="10px",_c),marginBottom:(_d={},_d[ZERO_BREAKPOINT]="2px",_d.small=0,_d)}),repeatingGradient,repeatingGradient,mediaCSS({backgroundSize:(_e={},_e[ZERO_BREAKPOINT]="0.9px 100%",_e.small="0.9px 22px",_e)}),repeatingGradient,mediaCSS({backgroundSize:(_f={},_f[ZERO_BREAKPOINT]="0.9px 100%",_f.small="0.9px 20px",_f),backgroundPosition:(_g={},_g[ZERO_BREAKPOINT]="0 20px",_g.small="0 0",_g)}));export var PropertyCellWithInner=styled(PropertyCell)(templateObject_4||(templateObject_4=__makeTemplateObject(["\n padding: 0;\n"],["\n padding: 0;\n"])));export var PropertyNameCell=styled(PropertyCell)(templateObject_5||(templateObject_5=__makeTemplateObject(["\n vertical-align: top;\n line-height: 23px;\n white-space: nowrap;\n font-size: 14px;\n ","\n\n &.deprecated {\n ",";\n }\n\n ",";\n\n ",";\n .field-name {\n display: inline-flex;\n align-items: center;\n }\n"],["\n vertical-align: top;\n line-height: 23px;\n white-space: nowrap;\n font-size: 14px;\n ","\n\n &.deprecated {\n ",";\n }\n\n ",";\n\n ",";\n .field-name {\n display: inline-flex;\n align-items: center;\n }\n"])),(function(n){var e=n.theme;return mediaCSS({fontFamily:e.typography.fieldName.fontFamily})}),deprecatedCss,(function(n){return"field"!==n.kind?"font-style: italic":""}),extensionsHook("PropertyNameCell"));export var PropertyDetailsCell=styled.td(templateObject_6||(templateObject_6=__makeTemplateObject(["\n box-sizing: border-box;\n vertical-align: top;\n\n tr.expanded & {\n border-bottom: none;\n }\n\n tr.last > & {\n border: none;\n background-position: top left;\n background-repeat: no-repeat;\n background-size: 1px 100%;\n padding-bottom: 0;\n\n /* workaround for discriminator dropdown oveflowing scrolling container,\n fixes the issue for the last item in the schema only */\n & > div > div.dropdown > .dropdown-selector-content {\n position: relative;\n }\n }\n\n tr:first-of-type > & {\n padding-top: 0;\n }\n\n ","\n\n ",";\n"],["\n box-sizing: border-box;\n vertical-align: top;\n\n tr.expanded & {\n border-bottom: none;\n }\n\n tr.last > & {\n border: none;\n background-position: top left;\n background-repeat: no-repeat;\n background-size: 1px 100%;\n padding-bottom: 0;\n\n /* workaround for discriminator dropdown oveflowing scrolling container,\n fixes the issue for the last item in the schema only */\n & > div > div.dropdown > .dropdown-selector-content {\n position: relative;\n }\n }\n\n tr:first-of-type > & {\n padding-top: 0;\n }\n\n ","\n\n ",";\n"])),(function(n){var e,t,r,a=n.theme;return mediaCSS({borderBottom:(e={},e[ZERO_BREAKPOINT]="none",e.small="1px solid "+a.colors.border.light,e),borderLeft:(t={},t[ZERO_BREAKPOINT]="1px solid "+a.schema.linesColor,t.small="none",t),padding:(r={},r[ZERO_BREAKPOINT]="0 20px",r.small="10px 0",r),width:a.schema.defaultDetailsWidth,minWidth:"200px"})}),extensionsHook("PropertyDetailsCell"));export var PropertyBullet=styled.span(templateObject_7||(templateObject_7=__makeTemplateObject(["\n margin-right: 10px;\n ","\n\n &::before {\n content: '';\n display: inline-block;\n vertical-align: middle;\n width: 10px;\n height: 1px;\n background: ",";\n }\n\n ","\n\n ",";\n"],["\n margin-right: 10px;\n ","\n\n &::before {\n content: '';\n display: inline-block;\n vertical-align: middle;\n width: 10px;\n height: 1px;\n background: ",";\n }\n\n ","\n\n ",";\n"])),(function(n){var e=n.theme;return mediaCSS({color:e.schema.linesColor,fontFamily:e.typography.code.fontFamily})}),(function(n){return n.theme.schema.linesColor}),(function(n){var e,t,r=n.theme;return mediaCSS({width:r.schema.defaultDetailsWidth,borderLeft:(e={},e[ZERO_BREAKPOINT]="1px dashed "+r.schema.linesColor,e.small="none",e),padding:(t={},t[ZERO_BREAKPOINT]="5px 10px",t.small="10px",t)})}),extensionsHook("PropertyDetailsCell"));export var InnerPropertiesWrap=styled.div(templateObject_8||(templateObject_8=__makeTemplateObject(["\n padding: ",";\n"],["\n padding: ",";\n"])),(function(n){return n.theme.schema.nestingSpacing}));export var PropertiesTableWrap=styled.div(templateObject_9||(templateObject_9=__makeTemplateObject(["\n display: block;\n overflow-x: auto;\n padding: 5px; /* hack to show overflown anchor icons */\n margin: -5px;\n"],["\n display: block;\n overflow-x: auto;\n padding: 5px; /* hack to show overflown anchor icons */\n margin: -5px;\n"])));export var PropertiesTable=styled.table(templateObject_10||(templateObject_10=__makeTemplateObject(["\n border-collapse: separate;\n border-radius: ",";\n width: 100%;\n ","\n > tr, > tbody > tr {\n ","\n }\n\n > tr {\n vertical-align: middle;\n }\n\n ","\n\n &\n ",",\n &\n ","\n ","\n ",",\n &\n ","\n ","\n ","\n ","\n "," {\n margin-left: ",";\n margin-bottom: ",";\n background: ",";\n border-radius: ",";\n }\n\n &\n ","\n ",",\n &\n ","\n ","\n ","\n ",",\n &\n ","\n ","\n ","\n ","\n ","\n "," {\n background: #ffffff;\n }\n"],["\n border-collapse: separate;\n border-radius: ",";\n width: 100%;\n ","\n > tr, > tbody > tr {\n ","\n }\n\n > tr {\n vertical-align: middle;\n }\n\n ","\n\n &\n ",",\n &\n ","\n ","\n ",",\n &\n ","\n ","\n ","\n ","\n "," {\n margin-left: ",";\n margin-bottom: ",";\n background: ",";\n border-radius: ",";\n }\n\n &\n ","\n ",",\n &\n ","\n ","\n ","\n ",",\n &\n ","\n ","\n ","\n ","\n ","\n "," {\n background: #ffffff;\n }\n"])),(function(n){return n.theme.shape.borderRadius}),(function(n){var e,t=n.theme;return mediaCSS({fontSize:t.typography.fontSize,display:(e={},e[ZERO_BREAKPOINT]="block",e.small="table",e)})}),mediaCSS({display:(_h={},_h[ZERO_BREAKPOINT]="block",_h.small="table-row",_h),marginBottom:(_j={},_j[ZERO_BREAKPOINT]="2px",_j.small=0,_j),borderSpacing:(_k={},_k[ZERO_BREAKPOINT]=0,_k.small="0 2px",_k)}),(function(n){return"\n @media screen and (max-width: "+n.theme.breakpoints[0]+") and (-ms-high-contrast:none) {\n td {\n float: left;\n width: 100%;\n }\n }\n "}),InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,(function(n){return n.theme.schema.nestingSpacing}),(function(n){return n.theme.schema.nestingSpacing}),(function(n){return n.theme.schema.nestedBackground}),(function(n){return n.theme.components.panels.borderRadius}),InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap);
1
+ var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k;import{__makeTemplateObject}from"tslib";import styled,{css,extensionsHook,mediaCSS,ZERO_BREAKPOINT}from"../styled-components";import{deprecatedCss}from"./mixins";export var PropertiesTableCaption=styled.caption(templateObject_1||(templateObject_1=__makeTemplateObject(["\n text-align: right;\n font-size: 0.9em;\n font-weight: normal;\n color: ",";\n"],["\n text-align: right;\n font-size: 0.9em;\n font-weight: normal;\n color: ",";\n"])),(function(n){return n.theme.colors.text.secondary}));var templateObject_1,templateObject_2,templateObject_3,templateObject_4,templateObject_5,templateObject_6,templateObject_7,templateObject_8,templateObject_9,templateObject_10,templateObject_11,repeatingGradient=css(templateObject_2||(templateObject_2=__makeTemplateObject(["\n repeating-linear-gradient(0deg,\n ",",\n "," 3px,\n transparent 3px,\n transparent 5px,\n "," 5px);\n"],["\n repeating-linear-gradient(0deg,\n ",",\n "," 3px,\n transparent 3px,\n transparent 5px,\n "," 5px);\n"])),(function(n){return n.theme.schema.linesColor}),(function(n){return n.theme.schema.linesColor}),(function(n){return n.theme.schema.linesColor}));export var PropertyCell=styled.td(templateObject_3||(templateObject_3=__makeTemplateObject(["\n box-sizing: border-box;\n position: relative;\n padding: 10px;\n background-image: ",";\n background-repeat: no-repeat;\n background-size: 1px 100%;\n\n ","\n\n tr:first-of-type > & {\n background-image: ",";\n background-position: 0 10px;\n padding-top: 0;\n }\n\n tr.last > & {\n background-image: ",";\n padding-bottom: 0;\n ",";\n }\n\n tr.last + tr > & {\n background: none;\n }\n\n tr.last:first-child > & {\n background-image: ",";\n ",";\n }\n"],["\n box-sizing: border-box;\n position: relative;\n padding: 10px;\n background-image: ",";\n background-repeat: no-repeat;\n background-size: 1px 100%;\n\n ","\n\n tr:first-of-type > & {\n background-image: ",";\n background-position: 0 10px;\n padding-top: 0;\n }\n\n tr.last > & {\n background-image: ",";\n padding-bottom: 0;\n ",";\n }\n\n tr.last + tr > & {\n background: none;\n }\n\n tr.last:first-child > & {\n background-image: ",";\n ",";\n }\n"])),repeatingGradient,mediaCSS({display:(_a={},_a[ZERO_BREAKPOINT]="block",_a.small="table-cell",_a),overflow:(_b={},_b[ZERO_BREAKPOINT]="hidden",_b.small="initial",_b),padding:(_c={},_c[ZERO_BREAKPOINT]="0 20px",_c.small="10px",_c),marginBottom:(_d={},_d[ZERO_BREAKPOINT]="2px",_d.small=0,_d)}),repeatingGradient,repeatingGradient,mediaCSS({backgroundSize:(_e={},_e[ZERO_BREAKPOINT]="0.9px 100%",_e.small="0.9px 22px",_e)}),repeatingGradient,mediaCSS({backgroundSize:(_f={},_f[ZERO_BREAKPOINT]="0.9px 100%",_f.small="0.9px 20px",_f),backgroundPosition:(_g={},_g[ZERO_BREAKPOINT]="0 20px",_g.small="0 0",_g)}));export var PropertyCellWithInner=styled(PropertyCell)(templateObject_4||(templateObject_4=__makeTemplateObject(["\n padding: 0;\n"],["\n padding: 0;\n"])));export var PropertyNameCell=styled(PropertyCell)(templateObject_6||(templateObject_6=__makeTemplateObject(["\n vertical-align: top;\n line-height: 23px;\n white-space: nowrap;\n font-size: 14px;\n ","\n\n &.deprecated {\n ",";\n }\n\n ","\n\n ",";\n .field-name {\n display: inline-flex;\n align-items: center;\n }\n"],["\n vertical-align: top;\n line-height: 23px;\n white-space: nowrap;\n font-size: 14px;\n ","\n\n &.deprecated {\n ",";\n }\n\n ","\n\n ",";\n .field-name {\n display: inline-flex;\n align-items: center;\n }\n"])),(function(n){var e=n.theme;return mediaCSS({fontFamily:e.typography.fieldName.fontFamily})}),deprecatedCss,(function(n){return"patternProperties"===n.kind&&css(templateObject_5||(templateObject_5=__makeTemplateObject(["\n span.field-name {\n white-space: break-spaces;\n text-align: left;\n display: inline-table;\n line-height: 1.5;\n }\n "],["\n span.field-name {\n white-space: break-spaces;\n text-align: left;\n display: inline-table;\n line-height: 1.5;\n }\n "])))}),extensionsHook("PropertyNameCell"));export var PropertyDetailsCell=styled.td(templateObject_7||(templateObject_7=__makeTemplateObject(["\n box-sizing: border-box;\n vertical-align: top;\n\n tr.expanded & {\n border-bottom: none;\n }\n\n tr.last > & {\n border: none;\n background-position: top left;\n background-repeat: no-repeat;\n background-size: 1px 100%;\n padding-bottom: 0;\n\n /* workaround for discriminator dropdown oveflowing scrolling container,\n fixes the issue for the last item in the schema only */\n & > div > div.dropdown > .dropdown-selector-content {\n position: relative;\n }\n }\n\n tr:first-of-type > & {\n padding-top: 0;\n }\n\n ","\n\n ",";\n"],["\n box-sizing: border-box;\n vertical-align: top;\n\n tr.expanded & {\n border-bottom: none;\n }\n\n tr.last > & {\n border: none;\n background-position: top left;\n background-repeat: no-repeat;\n background-size: 1px 100%;\n padding-bottom: 0;\n\n /* workaround for discriminator dropdown oveflowing scrolling container,\n fixes the issue for the last item in the schema only */\n & > div > div.dropdown > .dropdown-selector-content {\n position: relative;\n }\n }\n\n tr:first-of-type > & {\n padding-top: 0;\n }\n\n ","\n\n ",";\n"])),(function(n){var e,t,r,a=n.theme;return mediaCSS({borderBottom:(e={},e[ZERO_BREAKPOINT]="none",e.small="1px solid "+a.colors.border.light,e),borderLeft:(t={},t[ZERO_BREAKPOINT]="1px solid "+a.schema.linesColor,t.small="none",t),padding:(r={},r[ZERO_BREAKPOINT]="0 20px",r.small="10px 0",r),width:a.schema.defaultDetailsWidth,minWidth:"200px"})}),extensionsHook("PropertyDetailsCell"));export var PropertyBullet=styled.span(templateObject_8||(templateObject_8=__makeTemplateObject(["\n margin-right: 10px;\n ","\n\n &::before {\n content: '';\n display: inline-block;\n vertical-align: middle;\n width: 10px;\n height: 1px;\n background: ",";\n }\n\n ","\n\n ",";\n"],["\n margin-right: 10px;\n ","\n\n &::before {\n content: '';\n display: inline-block;\n vertical-align: middle;\n width: 10px;\n height: 1px;\n background: ",";\n }\n\n ","\n\n ",";\n"])),(function(n){var e=n.theme;return mediaCSS({color:e.schema.linesColor,fontFamily:e.typography.code.fontFamily})}),(function(n){return n.theme.schema.linesColor}),(function(n){var e,t,r=n.theme;return mediaCSS({width:r.schema.defaultDetailsWidth,borderLeft:(e={},e[ZERO_BREAKPOINT]="1px dashed "+r.schema.linesColor,e.small="none",e),padding:(t={},t[ZERO_BREAKPOINT]="5px 10px",t.small="10px",t)})}),extensionsHook("PropertyDetailsCell"));export var InnerPropertiesWrap=styled.div(templateObject_9||(templateObject_9=__makeTemplateObject(["\n padding: ",";\n"],["\n padding: ",";\n"])),(function(n){return n.theme.schema.nestingSpacing}));export var PropertiesTableWrap=styled.div(templateObject_10||(templateObject_10=__makeTemplateObject(["\n display: block;\n overflow-x: auto;\n padding: 5px; /* hack to show overflown anchor icons */\n margin: -5px;\n"],["\n display: block;\n overflow-x: auto;\n padding: 5px; /* hack to show overflown anchor icons */\n margin: -5px;\n"])));export var PropertiesTable=styled.table(templateObject_11||(templateObject_11=__makeTemplateObject(["\n border-collapse: separate;\n border-radius: ",";\n width: 100%;\n ","\n > tr, > tbody > tr {\n ","\n }\n\n > tr {\n vertical-align: middle;\n }\n\n ","\n\n &\n ",",\n &\n ","\n ","\n ",",\n &\n ","\n ","\n ","\n ","\n "," {\n margin-left: ",";\n margin-bottom: ",";\n background: ",";\n border-radius: ",";\n }\n\n &\n ","\n ",",\n &\n ","\n ","\n ","\n ",",\n &\n ","\n ","\n ","\n ","\n ","\n "," {\n background: #ffffff;\n }\n"],["\n border-collapse: separate;\n border-radius: ",";\n width: 100%;\n ","\n > tr, > tbody > tr {\n ","\n }\n\n > tr {\n vertical-align: middle;\n }\n\n ","\n\n &\n ",",\n &\n ","\n ","\n ",",\n &\n ","\n ","\n ","\n ","\n "," {\n margin-left: ",";\n margin-bottom: ",";\n background: ",";\n border-radius: ",";\n }\n\n &\n ","\n ",",\n &\n ","\n ","\n ","\n ",",\n &\n ","\n ","\n ","\n ","\n ","\n "," {\n background: #ffffff;\n }\n"])),(function(n){return n.theme.shape.borderRadius}),(function(n){var e,t=n.theme;return mediaCSS({fontSize:t.typography.fontSize,display:(e={},e[ZERO_BREAKPOINT]="block",e.small="table",e)})}),mediaCSS({display:(_h={},_h[ZERO_BREAKPOINT]="block",_h.small="table-row",_h),marginBottom:(_j={},_j[ZERO_BREAKPOINT]="2px",_j.small=0,_j),borderSpacing:(_k={},_k[ZERO_BREAKPOINT]=0,_k.small="0 2px",_k)}),(function(n){return"\n @media screen and (max-width: "+n.theme.breakpoints[0]+") and (-ms-high-contrast:none) {\n td {\n float: left;\n width: 100%;\n }\n }\n "}),InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,(function(n){return n.theme.schema.nestingSpacing}),(function(n){return n.theme.schema.nestingSpacing}),(function(n){return n.theme.schema.nestedBackground}),(function(n){return n.theme.components.panels.borderRadius}),InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap,InnerPropertiesWrap);
2
2
  //# sourceMappingURL=fields-layout.js.map
@@ -7,6 +7,7 @@ export declare const TypeName: import("styled-components").StyledComponent<"span
7
7
  export declare const TypeTitle: import("styled-components").StyledComponent<"span", import("../../../services/extendTheme").ProTheme, {}, never>;
8
8
  export declare const TypeFormat: import("styled-components").StyledComponent<"span", import("../../../services/extendTheme").ProTheme, {}, never>;
9
9
  export declare const RequiredLabel: import("styled-components").StyledComponent<"div", import("../../../services/extendTheme").ProTheme, {}, never>;
10
+ export declare const PropertyLabel: import("styled-components").StyledComponent<"div", import("../../../services/extendTheme").ProTheme, {}, never>;
10
11
  export declare const RecursiveLabel: import("styled-components").StyledComponent<"span", import("../../../services/extendTheme").ProTheme, {}, never>;
11
12
  export declare const AccessModeLabel: import("styled-components").StyledComponent<"span", import("../../../services/extendTheme").ProTheme, {}, never>;
12
13
  export declare const ExampleValue: import("styled-components").StyledComponent<"span", import("../../../services/extendTheme").ProTheme, {}, never>;
@@ -1,2 +1,2 @@
1
- import{__makeTemplateObject}from"tslib";import styled,{extensionsHook,mediaCSS}from"../styled-components";import{PropertyNameCell}from"./fields-layout";import{ShelfIcon}from"./icons";export var ClickablePropertyNameCell=styled(PropertyNameCell)(templateObject_1||(templateObject_1=__makeTemplateObject(["\n button {\n background-color: transparent;\n border: 0;\n outline: 0;\n cursor: pointer;\n padding: 0;\n ","\n &:focus {\n font-weight: ",";\n }\n }\n "," {\n margin-left: 4px;\n height: ",";\n width: ",";\n fill: ",";\n margin-top: -1px;\n }\n\n ",";\n"],["\n button {\n background-color: transparent;\n border: 0;\n outline: 0;\n cursor: pointer;\n padding: 0;\n ","\n &:focus {\n font-weight: ",";\n }\n }\n "," {\n margin-left: 4px;\n height: ",";\n width: ",";\n fill: ",";\n margin-top: -1px;\n }\n\n ",";\n"])),(function(e){var t=e.theme;return mediaCSS({fontFamily:t.typography.fieldName.fontFamily,fontSize:t.typography.fieldName.fontSize,color:t.colors.text.primary})}),(function(e){return e.theme.typography.fontWeightBold}),ShelfIcon,(function(e){return e.theme.schema.caretSize}),(function(e){return e.theme.schema.caretSize}),(function(e){return e.theme.schema.caretColor}),extensionsHook("ClickablePropertyNameCell"));export var FieldLabel=styled.span(templateObject_2||(templateObject_2=__makeTemplateObject(["\n vertical-align: middle;\n line-height: 20px;\n ",";\n"],["\n vertical-align: middle;\n line-height: 20px;\n ",";\n"])),(function(e){var t=e.theme;return mediaCSS({fontSize:t.typography.fieldName.fontSize})}));export var TypePrefix=styled(FieldLabel)(templateObject_3||(templateObject_3=__makeTemplateObject(["\n color: ",";\n"],["\n color: ",";\n"])),(function(e){return e.theme.schema.typeNameColor}));export var TypeName=styled(FieldLabel)(templateObject_4||(templateObject_4=__makeTemplateObject(["\n color: ",";\n"],["\n color: ",";\n"])),(function(e){return e.theme.schema.typeNameColor}));export var TypeTitle=styled(FieldLabel)(templateObject_5||(templateObject_5=__makeTemplateObject(["\n color: ",";\n word-break: break-word;\n"],["\n color: ",";\n word-break: break-word;\n"])),(function(e){return e.theme.schema.typeTitleColor}));export var TypeFormat=TypeName;export var RequiredLabel=styled(FieldLabel.withComponent("div"))(templateObject_6||(templateObject_6=__makeTemplateObject(["\n color: ",";\n font-size: ",";\n font-weight: normal;\n line-height: 1;\n display: block;\n"],["\n color: ",";\n font-size: ",";\n font-weight: normal;\n line-height: 1;\n display: block;\n"])),(function(e){return e.theme.schema.requireLabelColor}),(function(e){return e.theme.schema.labelsTextSize}));export var RecursiveLabel=styled(FieldLabel)(templateObject_7||(templateObject_7=__makeTemplateObject(["\n color: ",";\n font-size: 13px;\n"],["\n color: ",";\n font-size: 13px;\n"])),(function(e){return e.theme.colors.warning.main}));export var AccessModeLabel=RecursiveLabel;export var ExampleValue=styled(FieldLabel)(templateObject_8||(templateObject_8=__makeTemplateObject(["\n border-radius: ",";\n ","\n\n ","\n\n & + & {\n margin-left: 0;\n }\n ",";\n line-height: 1.2em;\n display: inline-flex;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n"],["\n border-radius: ",";\n ","\n\n ","\n\n & + & {\n margin-left: 0;\n }\n ",";\n line-height: 1.2em;\n display: inline-flex;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n"])),(function(e){return e.theme.shape.borderRadius}),(function(e){var t=e.theme;return"\n background-color: "+t.colors.secondary.light+";\n color: "+t.colors.text.primary+";\n padding: 1px "+t.spacing.unit+"px;\n border: 1px solid "+t.colors.border.light+";\n font-size: 12px;\n "}),(function(e){var t=e.theme;return mediaCSS({fontFamily:t.typography.fieldName.fontFamily})}),extensionsHook("ExampleValue"));export var ExtensionValue=styled(ExampleValue)(templateObject_9||(templateObject_9=__makeTemplateObject([""],[""])));export var ConstraintItem=styled(FieldLabel)(templateObject_10||(templateObject_10=__makeTemplateObject(["\n border-radius: ",";\n ","\n\n ","\n\n & + & {\n margin-left: 0;\n }\n ",";\n"],["\n border-radius: ",";\n ","\n\n ","\n\n & + & {\n margin-left: 0;\n }\n ",";\n"])),(function(e){return e.theme.shape.borderRadius}),(function(e){var t=e.theme;return"\n background-color: "+t.colors.secondary.light+";\n color: "+t.colors.accent.dark+";\n margin: 0 "+t.spacing.unit+"px;\n padding: 1px "+t.spacing.unit+"px;\n border: 1px solid "+t.colors.border.light+";\n font-size: 12px;\n "}),(function(e){var t=e.theme;return mediaCSS({fontFamily:t.typography.fieldName.fontFamily})}),extensionsHook("ConstraintItem"));export var PatternLabel=styled(ConstraintItem)(templateObject_11||(templateObject_11=__makeTemplateObject([""],[""])));export var ToggleButton=styled.button(templateObject_12||(templateObject_12=__makeTemplateObject(["\n background-color: transparent;\n border: 0;\n color: ",";\n margin-left: ","px;\n border-radius: ",";\n cursor: pointer;\n outline-color: ",";\n font-size: 12px;\n"],["\n background-color: transparent;\n border: 0;\n color: ",";\n margin-left: ","px;\n border-radius: ",";\n cursor: pointer;\n outline-color: ",";\n font-size: 12px;\n"])),(function(e){return e.theme.colors.text.secondary}),(function(e){return e.theme.spacing.unit}),(function(e){return e.theme.shape.borderRadius}),(function(e){return e.theme.colors.text.secondary}));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;
1
+ import{__makeTemplateObject}from"tslib";import styled,{extensionsHook,mediaCSS}from"../styled-components";import{PropertyNameCell}from"./fields-layout";import{ShelfIcon}from"./icons";export var ClickablePropertyNameCell=styled(PropertyNameCell)(templateObject_1||(templateObject_1=__makeTemplateObject(["\n button {\n background-color: transparent;\n border: 0;\n outline: 0;\n cursor: pointer;\n padding: 0 10px 0 0;\n ","\n &:focus {\n font-weight: ",";\n }\n }\n "," {\n margin-left: 4px;\n height: ",";\n width: ",";\n fill: ",";\n margin-top: -1px;\n }\n\n ",";\n"],["\n button {\n background-color: transparent;\n border: 0;\n outline: 0;\n cursor: pointer;\n padding: 0 10px 0 0;\n ","\n &:focus {\n font-weight: ",";\n }\n }\n "," {\n margin-left: 4px;\n height: ",";\n width: ",";\n fill: ",";\n margin-top: -1px;\n }\n\n ",";\n"])),(function(e){var t=e.theme;return mediaCSS({fontFamily:t.typography.fieldName.fontFamily,fontSize:t.typography.fieldName.fontSize,color:t.colors.text.primary})}),(function(e){return e.theme.typography.fontWeightBold}),ShelfIcon,(function(e){return e.theme.schema.caretSize}),(function(e){return e.theme.schema.caretSize}),(function(e){return e.theme.schema.caretColor}),extensionsHook("ClickablePropertyNameCell"));export var FieldLabel=styled.span(templateObject_2||(templateObject_2=__makeTemplateObject(["\n vertical-align: middle;\n line-height: 20px;\n ",";\n"],["\n vertical-align: middle;\n line-height: 20px;\n ",";\n"])),(function(e){var t=e.theme;return mediaCSS({fontSize:t.typography.fieldName.fontSize})}));export var TypePrefix=styled(FieldLabel)(templateObject_3||(templateObject_3=__makeTemplateObject(["\n color: ",";\n"],["\n color: ",";\n"])),(function(e){return e.theme.schema.typeNameColor}));export var TypeName=styled(FieldLabel)(templateObject_4||(templateObject_4=__makeTemplateObject(["\n color: ",";\n"],["\n color: ",";\n"])),(function(e){return e.theme.schema.typeNameColor}));export var TypeTitle=styled(FieldLabel)(templateObject_5||(templateObject_5=__makeTemplateObject(["\n color: ",";\n word-break: break-word;\n"],["\n color: ",";\n word-break: break-word;\n"])),(function(e){return e.theme.schema.typeTitleColor}));export var TypeFormat=TypeName;export var RequiredLabel=styled(FieldLabel.withComponent("div"))(templateObject_6||(templateObject_6=__makeTemplateObject(["\n color: ",";\n font-size: ",";\n font-weight: normal;\n line-height: 1;\n display: block;\n"],["\n color: ",";\n font-size: ",";\n font-weight: normal;\n line-height: 1;\n display: block;\n"])),(function(e){return e.theme.schema.requireLabelColor}),(function(e){return e.theme.schema.labelsTextSize}));export var PropertyLabel=styled(RequiredLabel)(templateObject_7||(templateObject_7=__makeTemplateObject(["\n color: ",";\n"],["\n color: ",";\n"])),(function(e){return e.theme.colors.text.secondary}));export var RecursiveLabel=styled(FieldLabel)(templateObject_8||(templateObject_8=__makeTemplateObject(["\n color: ",";\n font-size: 13px;\n"],["\n color: ",";\n font-size: 13px;\n"])),(function(e){return e.theme.colors.warning.main}));export var AccessModeLabel=RecursiveLabel;export var ExampleValue=styled(FieldLabel)(templateObject_9||(templateObject_9=__makeTemplateObject(["\n border-radius: ",";\n ","\n\n ","\n\n & + & {\n margin-left: 0;\n }\n ",";\n line-height: 1.2em;\n display: inline-flex;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n"],["\n border-radius: ",";\n ","\n\n ","\n\n & + & {\n margin-left: 0;\n }\n ",";\n line-height: 1.2em;\n display: inline-flex;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n"])),(function(e){return e.theme.shape.borderRadius}),(function(e){var t=e.theme;return"\n background-color: "+t.colors.secondary.light+";\n color: "+t.colors.text.primary+";\n padding: 1px "+t.spacing.unit+"px;\n border: 1px solid "+t.colors.border.light+";\n font-size: 12px;\n "}),(function(e){var t=e.theme;return mediaCSS({fontFamily:t.typography.fieldName.fontFamily})}),extensionsHook("ExampleValue"));export var ExtensionValue=styled(ExampleValue)(templateObject_10||(templateObject_10=__makeTemplateObject([""],[""])));export var ConstraintItem=styled(FieldLabel)(templateObject_11||(templateObject_11=__makeTemplateObject(["\n border-radius: ",";\n ","\n\n ","\n\n & + & {\n margin-left: 0;\n }\n ",";\n"],["\n border-radius: ",";\n ","\n\n ","\n\n & + & {\n margin-left: 0;\n }\n ",";\n"])),(function(e){return e.theme.shape.borderRadius}),(function(e){var t=e.theme;return"\n background-color: "+t.colors.secondary.light+";\n color: "+t.colors.accent.dark+";\n margin: 0 "+t.spacing.unit+"px;\n padding: 1px "+t.spacing.unit+"px;\n border: 1px solid "+t.colors.border.light+";\n font-size: 12px;\n "}),(function(e){var t=e.theme;return mediaCSS({fontFamily:t.typography.fieldName.fontFamily})}),extensionsHook("ConstraintItem"));export var PatternLabel=styled(ConstraintItem)(templateObject_12||(templateObject_12=__makeTemplateObject([""],[""])));export var ToggleButton=styled.button(templateObject_13||(templateObject_13=__makeTemplateObject(["\n background-color: transparent;\n border: 0;\n color: ",";\n margin-left: ","px;\n border-radius: ",";\n cursor: pointer;\n outline-color: ",";\n font-size: 12px;\n"],["\n background-color: transparent;\n border: 0;\n color: ",";\n margin-left: ","px;\n border-radius: ",";\n cursor: pointer;\n outline-color: ",";\n font-size: 12px;\n"])),(function(e){return e.theme.colors.text.secondary}),(function(e){return e.theme.spacing.unit}),(function(e){return e.theme.shape.borderRadius}),(function(e){return e.theme.colors.text.secondary}));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;
2
2
  //# sourceMappingURL=fields.js.map
@@ -6,6 +6,7 @@ export interface ShelfIconProps {
6
6
  color?: string;
7
7
  direction: 'left' | 'right' | 'up' | 'down';
8
8
  style?: React.CSSProperties;
9
+ mr?: string;
9
10
  }
10
11
  export declare const ShelfIcon: import("styled-components").StyledComponent<({ className, style }: ShelfIconProps) => JSX.Element, import("../../../services/extendTheme").ProTheme, {}, never>;
11
12
  declare function CrossIconInt({ className }: {
@@ -1,2 +1,2 @@
1
- import{__makeTemplateObject}from"tslib";import*as React from"react";import styled from"../styled-components";var directionMap={right:"0deg",down:"90deg",left:"180deg",up:"270deg"},IntShelfIcon=function(e){var t=e.className,n=e.style;return React.createElement("svg",{className:t,style:n,viewBox:"0 0 4.25 7",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},React.createElement("path",{d:"M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"}),React.createElement("path",{d:"M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"}))};export var ShelfIcon=styled(IntShelfIcon)(templateObject_1||(templateObject_1=__makeTemplateObject(["\n height: ",";\n width: ",";\n vertical-align: middle;\n float: ",";\n transition: transform 0.2s ease-out;\n transform: rotateZ(",");\n fill: ",";\n"],["\n height: ",";\n width: ",";\n vertical-align: middle;\n float: ",";\n transition: transform 0.2s ease-out;\n transform: rotateZ(",");\n fill: ",";\n"])),(function(e){return e.size||"9px"}),(function(e){return e.size||"9px"}),(function(e){return e.float||""}),(function(e){return directionMap[e.direction||"down"]}),(function(e){var t=e.color,n=e.theme;return t&&n.colors.responses[t]&&n.colors.responses[t].color||t}));function CrossIconInt(e){var t=e.className;return React.createElement("svg",{className:t,version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"122.879px",height:"122.879px",viewBox:"0 0 122.879 122.879"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M61.44,0c33.933,0,61.439,27.507,61.439,61.439 s-27.506,61.439-61.439,61.439C27.507,122.879,0,95.372,0,61.439S27.507,0,61.44,0L61.44,0z M73.451,39.151 c2.75-2.793,7.221-2.805,9.986-0.027c2.764,2.776,2.775,7.292,0.027,10.083L71.4,61.445l12.076,12.249 c2.729,2.77,2.689,7.257-0.08,10.022c-2.773,2.765-7.23,2.758-9.955-0.013L61.446,71.54L49.428,83.728 c-2.75,2.793-7.22,2.805-9.986,0.027c-2.763-2.776-2.776-7.293-0.027-10.084L51.48,61.434L39.403,49.185 c-2.728-2.769-2.689-7.256,0.082-10.022c2.772-2.765,7.229-2.758,9.953,0.013l11.997,12.165L73.451,39.151L73.451,39.151z"}))}export var CrossIcon=styled(CrossIconInt)(templateObject_2||(templateObject_2=__makeTemplateObject(["\n height: ",";\n width: ",";\n vertical-align: middle;\n float: ",";\n transition: transform 0.2s ease-out;\n path {\n fill: ",";\n }\n"],["\n height: ",";\n width: ",";\n vertical-align: middle;\n float: ",";\n transition: transform 0.2s ease-out;\n path {\n fill: ",";\n }\n"])),(function(e){return e.size||"9px"}),(function(e){return e.size||"9px"}),(function(e){return e.float||""}),(function(e){var t=e.color,n=e.theme;return t&&n.colors.responses[t]&&n.colors.responses[t].color||t}));function LockIconInt(e){var t=e.className;return React.createElement("svg",{className:t,version:"1.1",viewBox:"0 0 100 100"},React.createElement("g",{display:"none"},React.createElement("path",{display:"inline",d:"M94.5 49.7c0-7.8-5-14.5-12-16.9C78 19.1 65.2 9.3 50 9.3c-15.1 0-27.9 9.9-32.4 23.5C10.6 35.1 5.5 41.8 5.5 49.7c0 9.9 8 17.9 17.9 17.9V34.9c3.6-11.3 14.2-19.4 26.6-19.4 12.4 0 22.9 8.1 26.6 19.2v30.7c-1.3 2.7-8.8 17.6-18.7 18 -0.8-2.1-2.8-3.6-5.1-3.6 -3 0-5.5 2.5-5.5 5.5 0 3 2.5 5.5 5.5 5.5 2.4 0 4.4-1.5 5.1-3.6 11.8-0.4 20-16 21.9-19.8C88.2 65.7 94.5 58.4 94.5 49.7z"})),React.createElement("g",{display:"none"},React.createElement("path",{display:"inline",d:"M63.3 12.4V8.7c0-1.2-1.2-2.2-2.7-2.2 -1.5 0-2.7 1-2.7 2.2v1.9c-0.8-0.1-1.5-0.2-2.3-0.2H44.4c-9.2 0-16.7 7.6-16.7 16.9v49.3c0 9.3 7.5 16.9 16.7 16.9h11.1c9.2 0 16.7-7.6 16.7-16.9V27.3C72.3 20.8 68.6 15.2 63.3 12.4zM56.6 84.9H43.3v-4.2h13.4V84.9zM65.2 67.4c-0.2 0.2-4.7 5.4-15.4 5.4 -10.5 0-16.4-5-16.7-5.2 -0.7-0.6-0.8-1.8-0.2-2.5 0.6-0.7 1.8-0.8 2.5-0.2 0 0 5.2 4.3 14.3 4.3 8.9 0 12.5-4 12.7-4.1 0.6-0.7 1.8-0.8 2.5-0.2C65.8 65.5 65.9 66.6 65.2 67.4zM66.4 51.6c0 3.1-2.4 5.6-5.3 5.6H39.2c-3 0-5.3-2.5-5.3-5.6v-25c0-3.1 2.4-5.6 5.3-5.6h21.9c3 0 5.3 2.5 5.3 5.6V51.6z"})),React.createElement("g",{display:"none"},React.createElement("path",{display:"inline",d:"M63.4 9.7H36.6c-5.4 0-9.8 4.5-9.8 10v60.7c0 5.5 4.4 10 9.8 10h26.8c5.4 0 9.8-4.5 9.8-10V19.7C73.2 14.2 68.8 9.7 63.4 9.7zM50 85c-2.6 0-4.8-2.1-4.8-4.8s2.1-4.8 4.8-4.8c2.6 0 4.8 2.1 4.8 4.8S52.6 85 50 85zM67.1 71.5H32.9V20.8h34.3V71.5z"})),React.createElement("path",{d:"M16.1 45.4V92.5h67.8V45.4H16.1zM53.9 70.9v12.4h-7.4V70.9c-3.2-1.4-5.4-4.6-5.4-8.2 0-5 4-9 9-9 5 0 9 4.1 9 9C59.3 66.3 57.1 69.5 53.9 70.9zM37.2 39.8c-0.3 0-1.4-2.9-1.4-2.9 -0.5-1.5-0.7-3-0.7-4.6 0-8.4 6.8-15.2 15.2-15.2 8.4 0 15.2 6.8 15.2 15.2 0 1.6-0.2 3.1-0.7 4.6l0 0 0 0c0 0-1.1 2.9-1.4 2.9 -0.3 0 10.4 0 10.6 0l0 0c0.8-2.4 1.2-4.9 1.2-7.5C75.1 18.6 64 7.5 50.3 7.5c-13.7 0-24.8 11.1-24.8 24.8 0 2.5 0.4 5.1 1.2 7.5C26.6 39.8 37.5 39.8 37.2 39.8z"}))}export var LockIcon=styled(LockIconInt)(templateObject_3||(templateObject_3=__makeTemplateObject(["\n height: ",";\n width: ",";\n vertical-align: middle;\n float: ",";\n transition: transform 0.2s ease-out;\n path {\n fill: ",";\n }\n"],["\n height: ",";\n width: ",";\n vertical-align: middle;\n float: ",";\n transition: transform 0.2s ease-out;\n path {\n fill: ",";\n }\n"])),(function(e){return e.size||"9px"}),(function(e){return e.size||"9px"}),(function(e){return e.float||""}),(function(e){var t=e.color,n=e.theme;return t&&n.colors.responses[t]&&n.colors.responses[t].color||t}));var FileIconInt=function(e){var t=e.className;return React.createElement("svg",{className:t,viewBox:"0 0 368.553 368.553",xmlSpace:"preserve"},React.createElement("path",{d:"M239.68 0H42.695v368.553h283.164V86.811L239.68 0zm4.377 25.7 56.288 56.701h-56.288V25.7zM57.695 353.553V15h171.362v82.401h81.802v256.151H57.695v.001z"}),React.createElement("path",{d:"M86.435 82.401H208.31v15H86.435zM86.435 151.122H282.12v15H86.435zM86.435 219.843H282.12v15H86.435zM86.435 288.563H282.12v15H86.435z"}))};export var FileIcon=styled(FileIconInt)(templateObject_4||(templateObject_4=__makeTemplateObject(["\n vertical-align: middle;\n height: ",";\n width: ",";\n path {\n fill: ",";\n }\n"],["\n vertical-align: middle;\n height: ",";\n width: ",";\n path {\n fill: ",";\n }\n"])),(function(e){return e.size||"15px"}),(function(e){return e.size||"15px"}),(function(e){var t=e.color,n=e.theme;return t&&n.colors.secondary[t]||t}));var templateObject_1,templateObject_2,templateObject_3,templateObject_4,templateObject_5,LinkIconInt=function(e){var t=e.className;return React.createElement("svg",{className:t,viewBox:"0 0 16 16","aria-hidden":"true"},React.createElement("path",{fillRule:"evenodd",fill:"currentColor",d:"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"}))};export var LinkIcon=styled(LinkIconInt)(templateObject_5||(templateObject_5=__makeTemplateObject(["\n vertical-align: middle;\n ",";\n ",";\n color: ",";\n &:active,\n &:visited {\n color: ",";\n }\n"],["\n vertical-align: middle;\n ",";\n ",";\n color: ",";\n &:active,\n &:visited {\n color: ",";\n }\n"])),(function(e){return e.size?"height:"+e.size:""}),(function(e){return e.size?"width:"+e.size:""}),(function(e){return e.theme.colors.primary.main}),(function(e){return e.theme.colors.text.primary}));
1
+ import{__makeTemplateObject}from"tslib";import*as React from"react";import styled from"../styled-components";var directionMap={right:"0deg",down:"90deg",left:"180deg",up:"270deg"},IntShelfIcon=function(e){var t=e.className,n=e.style;return React.createElement("svg",{className:t,style:n,viewBox:"0 0 4.25 7",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},React.createElement("path",{d:"M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"}),React.createElement("path",{d:"M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"}))};export var ShelfIcon=styled(IntShelfIcon)(templateObject_1||(templateObject_1=__makeTemplateObject(["\n height: ",";\n width: ",";\n vertical-align: middle;\n float: ",";\n transition: transform 0.2s ease-out;\n transform: rotateZ(",");\n fill: ",";\n margin-right: ",";\n"],["\n height: ",";\n width: ",";\n vertical-align: middle;\n float: ",";\n transition: transform 0.2s ease-out;\n transform: rotateZ(",");\n fill: ",";\n margin-right: ",";\n"])),(function(e){return e.size||"9px"}),(function(e){return e.size||"9px"}),(function(e){return e.float||""}),(function(e){return directionMap[e.direction||"down"]}),(function(e){var t=e.color,n=e.theme;return t&&n.colors.responses[t]&&n.colors.responses[t].color||t}),(function(e){return e.mr}));function CrossIconInt(e){var t=e.className;return React.createElement("svg",{className:t,version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"122.879px",height:"122.879px",viewBox:"0 0 122.879 122.879"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M61.44,0c33.933,0,61.439,27.507,61.439,61.439 s-27.506,61.439-61.439,61.439C27.507,122.879,0,95.372,0,61.439S27.507,0,61.44,0L61.44,0z M73.451,39.151 c2.75-2.793,7.221-2.805,9.986-0.027c2.764,2.776,2.775,7.292,0.027,10.083L71.4,61.445l12.076,12.249 c2.729,2.77,2.689,7.257-0.08,10.022c-2.773,2.765-7.23,2.758-9.955-0.013L61.446,71.54L49.428,83.728 c-2.75,2.793-7.22,2.805-9.986,0.027c-2.763-2.776-2.776-7.293-0.027-10.084L51.48,61.434L39.403,49.185 c-2.728-2.769-2.689-7.256,0.082-10.022c2.772-2.765,7.229-2.758,9.953,0.013l11.997,12.165L73.451,39.151L73.451,39.151z"}))}export var CrossIcon=styled(CrossIconInt)(templateObject_2||(templateObject_2=__makeTemplateObject(["\n height: ",";\n width: ",";\n vertical-align: middle;\n float: ",";\n transition: transform 0.2s ease-out;\n path {\n fill: ",";\n }\n"],["\n height: ",";\n width: ",";\n vertical-align: middle;\n float: ",";\n transition: transform 0.2s ease-out;\n path {\n fill: ",";\n }\n"])),(function(e){return e.size||"9px"}),(function(e){return e.size||"9px"}),(function(e){return e.float||""}),(function(e){var t=e.color,n=e.theme;return t&&n.colors.responses[t]&&n.colors.responses[t].color||t}));function LockIconInt(e){var t=e.className;return React.createElement("svg",{className:t,version:"1.1",viewBox:"0 0 100 100"},React.createElement("g",{display:"none"},React.createElement("path",{display:"inline",d:"M94.5 49.7c0-7.8-5-14.5-12-16.9C78 19.1 65.2 9.3 50 9.3c-15.1 0-27.9 9.9-32.4 23.5C10.6 35.1 5.5 41.8 5.5 49.7c0 9.9 8 17.9 17.9 17.9V34.9c3.6-11.3 14.2-19.4 26.6-19.4 12.4 0 22.9 8.1 26.6 19.2v30.7c-1.3 2.7-8.8 17.6-18.7 18 -0.8-2.1-2.8-3.6-5.1-3.6 -3 0-5.5 2.5-5.5 5.5 0 3 2.5 5.5 5.5 5.5 2.4 0 4.4-1.5 5.1-3.6 11.8-0.4 20-16 21.9-19.8C88.2 65.7 94.5 58.4 94.5 49.7z"})),React.createElement("g",{display:"none"},React.createElement("path",{display:"inline",d:"M63.3 12.4V8.7c0-1.2-1.2-2.2-2.7-2.2 -1.5 0-2.7 1-2.7 2.2v1.9c-0.8-0.1-1.5-0.2-2.3-0.2H44.4c-9.2 0-16.7 7.6-16.7 16.9v49.3c0 9.3 7.5 16.9 16.7 16.9h11.1c9.2 0 16.7-7.6 16.7-16.9V27.3C72.3 20.8 68.6 15.2 63.3 12.4zM56.6 84.9H43.3v-4.2h13.4V84.9zM65.2 67.4c-0.2 0.2-4.7 5.4-15.4 5.4 -10.5 0-16.4-5-16.7-5.2 -0.7-0.6-0.8-1.8-0.2-2.5 0.6-0.7 1.8-0.8 2.5-0.2 0 0 5.2 4.3 14.3 4.3 8.9 0 12.5-4 12.7-4.1 0.6-0.7 1.8-0.8 2.5-0.2C65.8 65.5 65.9 66.6 65.2 67.4zM66.4 51.6c0 3.1-2.4 5.6-5.3 5.6H39.2c-3 0-5.3-2.5-5.3-5.6v-25c0-3.1 2.4-5.6 5.3-5.6h21.9c3 0 5.3 2.5 5.3 5.6V51.6z"})),React.createElement("g",{display:"none"},React.createElement("path",{display:"inline",d:"M63.4 9.7H36.6c-5.4 0-9.8 4.5-9.8 10v60.7c0 5.5 4.4 10 9.8 10h26.8c5.4 0 9.8-4.5 9.8-10V19.7C73.2 14.2 68.8 9.7 63.4 9.7zM50 85c-2.6 0-4.8-2.1-4.8-4.8s2.1-4.8 4.8-4.8c2.6 0 4.8 2.1 4.8 4.8S52.6 85 50 85zM67.1 71.5H32.9V20.8h34.3V71.5z"})),React.createElement("path",{d:"M16.1 45.4V92.5h67.8V45.4H16.1zM53.9 70.9v12.4h-7.4V70.9c-3.2-1.4-5.4-4.6-5.4-8.2 0-5 4-9 9-9 5 0 9 4.1 9 9C59.3 66.3 57.1 69.5 53.9 70.9zM37.2 39.8c-0.3 0-1.4-2.9-1.4-2.9 -0.5-1.5-0.7-3-0.7-4.6 0-8.4 6.8-15.2 15.2-15.2 8.4 0 15.2 6.8 15.2 15.2 0 1.6-0.2 3.1-0.7 4.6l0 0 0 0c0 0-1.1 2.9-1.4 2.9 -0.3 0 10.4 0 10.6 0l0 0c0.8-2.4 1.2-4.9 1.2-7.5C75.1 18.6 64 7.5 50.3 7.5c-13.7 0-24.8 11.1-24.8 24.8 0 2.5 0.4 5.1 1.2 7.5C26.6 39.8 37.5 39.8 37.2 39.8z"}))}export var LockIcon=styled(LockIconInt)(templateObject_3||(templateObject_3=__makeTemplateObject(["\n height: ",";\n width: ",";\n vertical-align: middle;\n float: ",";\n transition: transform 0.2s ease-out;\n path {\n fill: ",";\n }\n"],["\n height: ",";\n width: ",";\n vertical-align: middle;\n float: ",";\n transition: transform 0.2s ease-out;\n path {\n fill: ",";\n }\n"])),(function(e){return e.size||"9px"}),(function(e){return e.size||"9px"}),(function(e){return e.float||""}),(function(e){var t=e.color,n=e.theme;return t&&n.colors.responses[t]&&n.colors.responses[t].color||t}));var FileIconInt=function(e){var t=e.className;return React.createElement("svg",{className:t,viewBox:"0 0 368.553 368.553",xmlSpace:"preserve"},React.createElement("path",{d:"M239.68 0H42.695v368.553h283.164V86.811L239.68 0zm4.377 25.7 56.288 56.701h-56.288V25.7zM57.695 353.553V15h171.362v82.401h81.802v256.151H57.695v.001z"}),React.createElement("path",{d:"M86.435 82.401H208.31v15H86.435zM86.435 151.122H282.12v15H86.435zM86.435 219.843H282.12v15H86.435zM86.435 288.563H282.12v15H86.435z"}))};export var FileIcon=styled(FileIconInt)(templateObject_4||(templateObject_4=__makeTemplateObject(["\n vertical-align: middle;\n height: ",";\n width: ",";\n path {\n fill: ",";\n }\n"],["\n vertical-align: middle;\n height: ",";\n width: ",";\n path {\n fill: ",";\n }\n"])),(function(e){return e.size||"15px"}),(function(e){return e.size||"15px"}),(function(e){var t=e.color,n=e.theme;return t&&n.colors.secondary[t]||t}));var templateObject_1,templateObject_2,templateObject_3,templateObject_4,templateObject_5,LinkIconInt=function(e){var t=e.className;return React.createElement("svg",{className:t,viewBox:"0 0 16 16","aria-hidden":"true"},React.createElement("path",{fillRule:"evenodd",fill:"currentColor",d:"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"}))};export var LinkIcon=styled(LinkIconInt)(templateObject_5||(templateObject_5=__makeTemplateObject(["\n vertical-align: middle;\n ",";\n ",";\n color: ",";\n &:active,\n &:visited {\n color: ",";\n }\n"],["\n vertical-align: middle;\n ",";\n ",";\n color: ",";\n &:active,\n &:visited {\n color: ",";\n }\n"])),(function(e){return e.size?"height:"+e.size:""}),(function(e){return e.size?"width:"+e.size:""}),(function(e){return e.theme.colors.primary.main}),(function(e){return e.theme.colors.text.primary}));
2
2
  //# sourceMappingURL=icons.js.map
@@ -6,6 +6,7 @@ export declare const linkifyMixin: (className: string, size: string) => FlattenS
6
6
  export declare function Link(props: PropsWithChildren<{
7
7
  to: string;
8
8
  className?: string;
9
+ security?: boolean;
9
10
  }>): JSX.Element | null;
10
11
  export declare function ShareLink(props: {
11
12
  to: string;
@@ -1,2 +1,2 @@
1
- import{__makeTemplateObject}from"tslib";import React,{useCallback}from"react";import{useStore}from"../components/StoreBuilder";import styled,{css}from"../styled-components";import{SECURITY_SCHEMES_SECTION_PREFIX}from"../utils";import{LinkIcon}from"./icons";export function userIsForcingNavigation(n){return 0!==n.button||n.altKey||n.ctrlKey||n.metaKey||n.shiftKey}export var linkifyMixin=function(n,e){return css(templateObject_1||(templateObject_1=__makeTemplateObject(["\n "," {\n cursor: pointer;\n line-height: inherit;\n display: inline-block;\n outline: 0;\n position: absolute;\n padding-right: 4px;\n transform: translateX(-100%);\n }\n\n "," "," {\n width: ",";\n height: ",";\n visibility: hidden;\n display: inline-block;\n vertical-align: middle;\n }\n\n h1:hover\n > ","\n ",",\n h2:hover\n > ","\n ",",\n ",":hover\n "," {\n visibility: visible;\n }\n\n ",":focus "," {\n visibility: visible;\n }\n"],["\n "," {\n cursor: pointer;\n line-height: inherit;\n display: inline-block;\n outline: 0;\n position: absolute;\n padding-right: 4px;\n transform: translateX(-100%);\n }\n\n "," "," {\n width: ",";\n height: ",";\n visibility: hidden;\n display: inline-block;\n vertical-align: middle;\n }\n\n h1:hover\n > ","\n ",",\n h2:hover\n > ","\n ",",\n ",":hover\n "," {\n visibility: visible;\n }\n\n ",":focus "," {\n visibility: visible;\n }\n"])),n,n,LinkIcon,e,e,n,LinkIcon,n,LinkIcon,n,LinkIcon,n,LinkIcon)};export function Link(n){var e,i,t,l,o,r=useCallback((function(e,i){i.defaultPrevented||userIsForcingNavigation(i)||(i.preventDefault(),e.replace(encodeURI(n.to)))}),[n.to]),a=useStore(),c=null===(i=null==a?void 0:(e=a.menu.history).linkForId)||void 0===i?void 0:i.call(e,n.to);return n.to.startsWith(SECURITY_SCHEMES_SECTION_PREFIX)&&(null===(t=null==a?void 0:a.options.hooks)||void 0===t?void 0:t.replaceSecurityLink)&&(c=null===(o=null===(l=a.options.hooks)||void 0===l?void 0:l.replaceSecurityLink)||void 0===o?void 0:o.call(l,{securityRequirementId:n.to.replace(SECURITY_SCHEMES_SECTION_PREFIX,"")})),c?React.createElement("a",{className:n.className,href:c,onClick:r.bind(this,null==a?void 0:a.menu.history),"aria-label":n.to},n.children):n.children?React.createElement("div",{className:n.className}," ",n.children," "):null}var templateObject_1,templateObject_2,StyledShareLink=styled(Link)(templateObject_2||(templateObject_2=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),linkifyMixin("&","18px"));export function ShareLink(n){return React.createElement(StyledShareLink,{to:n.to},React.createElement(LinkIcon,null))}
1
+ import{__makeTemplateObject}from"tslib";import React,{useCallback}from"react";import{useStore}from"../components/StoreBuilder";import styled,{css}from"../styled-components";import{LinkIcon}from"./icons";export function userIsForcingNavigation(n){return 0!==n.button||n.altKey||n.ctrlKey||n.metaKey||n.shiftKey}export var linkifyMixin=function(n,e){return css(templateObject_1||(templateObject_1=__makeTemplateObject(["\n "," {\n cursor: pointer;\n line-height: inherit;\n display: inline-block;\n outline: 0;\n position: absolute;\n padding-right: 4px;\n transform: translateX(-100%);\n }\n\n "," "," {\n width: ",";\n height: ",";\n visibility: hidden;\n display: inline-block;\n vertical-align: middle;\n }\n\n h1:hover\n > ","\n ",",\n h2:hover\n > ","\n ",",\n ",":hover\n "," {\n visibility: visible;\n }\n\n ",":focus "," {\n visibility: visible;\n }\n"],["\n "," {\n cursor: pointer;\n line-height: inherit;\n display: inline-block;\n outline: 0;\n position: absolute;\n padding-right: 4px;\n transform: translateX(-100%);\n }\n\n "," "," {\n width: ",";\n height: ",";\n visibility: hidden;\n display: inline-block;\n vertical-align: middle;\n }\n\n h1:hover\n > ","\n ",",\n h2:hover\n > ","\n ",",\n ",":hover\n "," {\n visibility: visible;\n }\n\n ",":focus "," {\n visibility: visible;\n }\n"])),n,n,LinkIcon,e,e,n,LinkIcon,n,LinkIcon,n,LinkIcon,n,LinkIcon)};export function Link(n){var e,i,t,l,o=useCallback((function(e,i){i.defaultPrevented||userIsForcingNavigation(i)||(i.preventDefault(),e.replace(encodeURI(n.to)))}),[n.to]),r=useStore();if(n.security){var a=null===(e=null==r?void 0:r.options.hooks)||void 0===e?void 0:e.replaceSecurityLink;l=a&&a({securityRequirementId:n.to})}else l=null===(t=null==r?void 0:(i=r.menu.history).linkForId)||void 0===t?void 0:t.call(i,n.to);return l?React.createElement("a",{className:n.className,href:l,onClick:o.bind(this,null==r?void 0:r.menu.history),"aria-label":n.to},n.children):n.children?React.createElement("span",{className:n.className}," ",n.children," "):null}var templateObject_1,templateObject_2,StyledShareLink=styled(Link)(templateObject_2||(templateObject_2=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),linkifyMixin("&","18px"));export function ShareLink(n){return React.createElement(StyledShareLink,{to:n.to},React.createElement(LinkIcon,null))}
2
2
  //# sourceMappingURL=linkify.js.map
@@ -1,2 +1,2 @@
1
- import{__decorate,__extends,__makeTemplateObject}from"tslib";import{observer}from"mobx-react";import*as React from"react";import{Endpoint}from"../../../../components/Endpoint";import styled from"../../styled-components";import{ExternalDocumentation}from"../ExternalDocumentation/ExternalDocumentation";import{Extensions}from"../Fields/Extensions";import{Markdown}from"../Markdown/Markdown";import{Parameters}from"../Parameters/Parameters";import{ResponsesList}from"../Responses/ResponsesList";import{SecurityRequirements}from"../SecurityRequirement/SecurityRequirement";import{ContentPanel}from"../../../../components/Panel";import{l}from"../../services/Labels";var CallbackDetails=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t,n,r=this.props.operation,o=r.description,a=r.externalDocs,s=!(!o&&!a);return React.createElement(React.Fragment,null,s&&React.createElement(Description,null,void 0!==o&&React.createElement(Markdown,{source:o}),a&&React.createElement(ExternalDocumentation,{externalDocs:a})),React.createElement(Endpoint,{operation:this.props.operation,compact:!0}),Object.keys(r.extensions||{}).length?React.createElement(Extensions,{extensions:r.extensions}):null,(null===(e=r.security)||void 0===e?void 0:e.length)||(null===(t=r.parameters)||void 0===t?void 0:t.length)||r.requestBody?React.createElement(ContentPanel,{header:l("request")},React.createElement(SecurityRequirements,{securities:r.security}),React.createElement(Parameters,{parameters:r.parameters,body:r.requestBody})):null,(null===(n=r.responses)||void 0===n?void 0:n.length)?React.createElement(ContentPanel,{header:l("callbackResponses")},React.createElement(ResponsesList,{responses:r.responses})):null)}}),t=__decorate([observer],t)}(React.Component);export{CallbackDetails};var templateObject_1,Description=styled.div(templateObject_1||(templateObject_1=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),(function(e){return 3*e.theme.spacing.unit}));
1
+ import{__decorate,__extends,__makeTemplateObject}from"tslib";import{observer}from"mobx-react";import*as React from"react";import{Endpoint}from"../../../../components/Endpoint";import styled from"../../styled-components";import{ExternalDocumentation}from"../ExternalDocumentation/ExternalDocumentation";import{Extensions}from"../Fields/Extensions";import{Markdown}from"../Markdown/Markdown";import{Parameters}from"../Parameters/Parameters";import{ResponsesList}from"../Responses/ResponsesList";import{SecurityRequirements}from"../SecurityRequirement/SecurityRequirement";import{ContentPanel}from"../../../../components/Panel";import{l}from"../../services/Labels";var CallbackDetails=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t,n,r=this.props.operation,o=r.description,a=r.externalDocs,s=!(!o&&!a);return React.createElement(React.Fragment,null,s&&React.createElement(Description,null,void 0!==o&&React.createElement(Markdown,{source:o}),a&&React.createElement(ExternalDocumentation,{externalDocs:a})),React.createElement(Endpoint,{operation:this.props.operation,compact:!0}),Object.keys(r.extensions||{}).length?React.createElement(Extensions,{extensions:r.extensions}):null,(null===(e=r.security)||void 0===e?void 0:e.length)?React.createElement(SecurityRequirements,{securities:r.security}):null,(null===(t=r.parameters)||void 0===t?void 0:t.length)||r.requestBody?React.createElement(ContentPanel,{header:l("request")},React.createElement(Parameters,{parameters:r.parameters,body:r.requestBody})):null,(null===(n=r.responses)||void 0===n?void 0:n.length)?React.createElement(ContentPanel,{header:l("callbackResponses")},React.createElement(ResponsesList,{responses:r.responses})):null)}}),t=__decorate([observer],t)}(React.Component);export{CallbackDetails};var templateObject_1,Description=styled.div(templateObject_1||(templateObject_1=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),(function(e){return 3*e.theme.spacing.unit}));
2
2
  //# sourceMappingURL=CallbackDetails.js.map
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
3
2
  import type { FieldModel } from '../../services/models';
3
+ import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
4
4
  import type { SchemaOptions } from '../Schema/types';
5
5
  export interface FieldProps extends SchemaOptions {
6
6
  className?: string;
@@ -1,2 +1,2 @@
1
- import{__assign,__decorate,__extends}from"tslib";import{observer}from"mobx-react";import*as React from"react";import{ClickablePropertyNameCell,RequiredLabel}from"../../common-elements/fields";import{FieldDetails}from"./FieldDetails";import{InnerPropertiesWrap,PropertyCellWithInner,PropertyDetailsCell,PropertyNameCell}from"../../common-elements/fields-layout";import{ShelfIcon}from"../../common-elements/";import{ShareLinkToField}from"../../common-elements/LinkToField";import{Schema}from"../Schema/Schema";import{OptionsContext}from"../OptionsProvider";var Field=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"toggle",{enumerable:!0,configurable:!0,writable:!0,value:function(){void 0===t.props.field.expanded&&t.props.expandByDefault?t.props.field.collapse():t.props.field.toggle()}}),Object.defineProperty(t,"handleKeyPress",{enumerable:!0,configurable:!0,writable:!0,value:function(e){"Enter"===e.key&&(e.preventDefault(),t.toggle())}}),t}return __extends(t,e),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,t=e.className,r=void 0===t?"":t,l=e.field,a=e.isLast,n=e.expandByDefault,i=e.showAccessMode,o=l.name,s=l.deprecated,c=l.required,m=l.kind,p=!l.schema.isPrimitive&&!l.schema.isCircular,d=void 0===l.expanded?n:l.expanded,u=p?React.createElement(ClickablePropertyNameCell,{className:s?"deprecated":"",kind:m,title:o},React.createElement("button",{onClick:this.toggle,onKeyPress:this.handleKeyPress,"aria-label":"expand properties"},React.createElement("span",{className:"field-name"},this.context.disableDeepLinks?null:React.createElement(ShareLinkToField,{field:l}),o),React.createElement(ShelfIcon,{direction:d?"down":"right"})),c&&React.createElement(RequiredLabel,null," required ")):React.createElement(PropertyNameCell,{className:s?"deprecated":void 0,kind:m,title:o},React.createElement("span",{className:"field-name"},this.context.disableDeepLinks?null:React.createElement(ShareLinkToField,{field:l}),o),c&&React.createElement(RequiredLabel,null," required "));return React.createElement(React.Fragment,null,React.createElement("tr",{className:a?"last "+r:r},u,React.createElement(PropertyDetailsCell,null,React.createElement(FieldDetails,__assign({},this.props)))),d&&p&&React.createElement("tr",{key:l.name+"inner"},React.createElement(PropertyCellWithInner,{colSpan:2},React.createElement(InnerPropertiesWrap,null,React.createElement(Schema,{schema:l.schema,skipReadOnly:this.props.skipReadOnly,skipWriteOnly:this.props.skipWriteOnly,showTitle:this.props.showTitle,level:this.props.level,showAccessMode:i})))))}}),Object.defineProperty(t,"contextType",{enumerable:!0,configurable:!0,writable:!0,value:OptionsContext}),t=__decorate([observer],t)}(React.Component);export{Field};
1
+ import{__assign,__decorate,__extends}from"tslib";import{observer}from"mobx-react";import*as React from"react";import{ClickablePropertyNameCell,PropertyLabel,RequiredLabel}from"../../common-elements/fields";import{FieldDetails}from"./FieldDetails";import{InnerPropertiesWrap,PropertyCellWithInner,PropertyDetailsCell,PropertyNameCell}from"../../common-elements/fields-layout";import{ShelfIcon}from"../../common-elements/";import{ShareLinkToField}from"../../common-elements/LinkToField";import{Schema}from"../Schema/Schema";import{OptionsContext}from"../OptionsProvider";var Field=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"toggle",{enumerable:!0,configurable:!0,writable:!0,value:function(){void 0===t.props.field.expanded&&t.props.expandByDefault?t.props.field.collapse():t.props.field.toggle()}}),Object.defineProperty(t,"handleKeyPress",{enumerable:!0,configurable:!0,writable:!0,value:function(e){"Enter"===e.key&&(e.preventDefault(),t.toggle())}}),t}return __extends(t,e),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,t=e.className,r=void 0===t?"":t,a=e.field,l=e.isLast,n=e.expandByDefault,i=e.showAccessMode,o=a.name,c=a.deprecated,s=a.required,p=a.kind,m=!a.schema.isPrimitive&&!a.schema.isCircular,d=void 0===a.expanded?n:a.expanded,u=React.createElement(React.Fragment,null,"additionalProperties"===p&&React.createElement(PropertyLabel,null,"additional property"),"patternProperties"===p&&React.createElement(PropertyLabel,null,"pattern property"),s&&React.createElement(RequiredLabel,null,"required")),f=m?React.createElement(ClickablePropertyNameCell,{className:c?"deprecated":"",kind:p,title:o},React.createElement("button",{onClick:this.toggle,onKeyPress:this.handleKeyPress,"aria-label":"expand properties"},React.createElement("span",{className:"field-name"},this.context.disableDeepLinks?null:React.createElement(ShareLinkToField,{field:a}),o),React.createElement(ShelfIcon,{direction:d?"down":"right"})),u):React.createElement(PropertyNameCell,{className:c?"deprecated":void 0,kind:p,title:o},React.createElement("span",{className:"field-name"},this.context.disableDeepLinks?null:React.createElement(ShareLinkToField,{field:a}),o),u);return React.createElement(React.Fragment,null,React.createElement("tr",{className:l?"last "+r:r},f,React.createElement(PropertyDetailsCell,null,React.createElement(FieldDetails,__assign({},this.props)))),d&&m&&React.createElement("tr",{key:a.name+"inner"},React.createElement(PropertyCellWithInner,{colSpan:2},React.createElement(InnerPropertiesWrap,null,React.createElement(Schema,{schema:a.schema,skipReadOnly:this.props.skipReadOnly,skipWriteOnly:this.props.skipWriteOnly,showTitle:this.props.showTitle,level:this.props.level,showAccessMode:i})))))}}),Object.defineProperty(t,"contextType",{enumerable:!0,configurable:!0,writable:!0,value:OptionsContext}),t=__decorate([observer],t)}(React.Component);export{Field};
2
2
  //# sourceMappingURL=Field.js.map