diff --git a/docs/demo/demo.b13313c0a7d166929de3.js b/docs/demo/demo.b13313c0a7d166929de3.js new file mode 100644 index 0000000..880eb13 --- /dev/null +++ b/docs/demo/demo.b13313c0a7d166929de3.js @@ -0,0 +1 @@ +webpackJsonp([1],{116:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s,c=function(){function e(e,t){for(var n,r=0;r div":{height:"100%"},body:{height:"100%",margin:"0",padding:"0",fontFamily:'-apple-system,BlinkMacSystemFont,"Segoe UI",Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",helvetica,sans-serif;',lineHeight:"1.4",fontSize:"1em"},"ul, ol":{margin:".5rem 0",padding:"0","& li":{marginLeft:"1.5rem"}},"h3, h4, h5, h6":{margin:"0",fontWeight:"400"},a:{color:e.text.link+"",textDecoration:"none","&:hover":{transition:"color .25s",color:(0,a.default)(e.text.link).lighten(.1)+"",textDecoration:"underline"}}}}}.bind(void 0))},123:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0;var r=n(467),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.clone=i.default},227:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),o=r(i),a=n(185),u=r(a),l=n(269),s=document.body.appendChild(document.createElement("div"));u.default.render(o.default.createElement(l.Demo,null),s)},228:function(e,t,n){"use strict";function r(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}Object.defineProperty(t,"__esModule",{value:!0}),t.styles=void 0;var i=n(6),o=n(20),a=function(e){return e&&e.__esModule?e:{default:e}}(o);t.styles=(0,i.createSheet)(function(e){var t=e.text,n=e.backgrounds;e.sizes;return r(void 0,void 0),{bodyContent:{display:"table",width:"100%",padding:"1rem 0",boxSizing:"border-box"},tabs:{"& > div":{display:"inline-block",padding:"1rem 2rem",cursor:"pointer","&:not($active)":{color:(0,a.default)(t.default).lighten(.5)+""}}},active:{backgroundColor:n.schema+"",borderRadius:"1rem 1rem 0 0"}}}.bind(void 0))},229:function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}Object.defineProperty(t,"__esModule",{value:!0}),t.styles=void 0;var o=n(6),a=n(77);t.styles=(0,o.createSheet)(function(e){var t,n,o=e.backgrounds,u=e.borders,l=e.sizes;return i(void 0,void 0),n={bodySchema:{width:"100%",borderSpacing:"0",padding:"10px 50px 10px 20px",boxSizing:"border-box",borderRadius:"10px",fontSize:"14.5px"},even:{backgroundColor:o.default+""},odd:{backgroundColor:o.schema+""},subset:(t={},r(t,"& + ."+a.styles.classes.property+":not(."+a.styles.classes.last+")",r({},"& ."+a.styles.classes.name+"::after",{content:'""',borderLeft:"1px solid "+u.default,position:"absolute",bottom:"0",left:"0",height:"100%"})),r(t,"& > td",{borderLeft:"1px solid "+u.default}),r(t,"& > td > table",{marginLeft:"12px"}),r(t,"."+a.styles.classes.last+" + & > td",{borderLeft:"none"}),t),array:{fontFamily:"monospace",padding:"5px 10px"},hasTabs:{borderTopLeftRadius:0}},r(n,"@media (max-width: "+l.breakpoint+")",{bodySchema:{paddingRight:"22px",fontSize:"0.8rem"}}),r(n,"isAdditional",{textAlign:"left",fontStyle:"italic"}),n}.bind(void 0))},230:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l,s=function(){function e(e,t){for(var n,r=0;r span":{color:"white",padding:"2px 10px",cursor:"pointer"}},hovered:{"&$buttons":{transition:"all .2s",opacity:"1"}}}}.bind(void 0))},243:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u,l=function(){function e(e,t){for(var n,r=0;r h3":{display:"inline-block",margin:"0 1.5rem .5rem 0"},"& h4":{fontSize:"smaller",textTransform:"uppercase",color:(0,u.default)(n.default).lighten(.5)+"",borderBottom:"1px solid "+t.default,marginTop:"1rem"}}},"@media (max-width: "+o.breakpoint+")",{method:{padding:"1rem",margin:0}})}.bind(void 0))},247:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l,s=function(){function e(e,t){for(var n,r=0;r div + div",{borderTop:"1px solid "+o.default}),r(t,"& a",{color:u.default+"",padding:".7rem 1rem","&:hover":{color:(0,l.default)(u.default).lighten(.1)+"",transition:"all .2s"}}),t)},"@media (max-width: "+s.breakpoint+")",{navigation:{display:"block",width:"100%",height:"auto",right:"100%",zIndex:"99",transition:"right .5s"},isOpen:{position:"relative",right:0}})}.bind(void 0))},251:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u,l=function(){function e(e,t){for(var n,r=0;r")),d.default.createElement(E.default,{constraints:u,type:r,isRequired:f}),(x&&x.length||s||a||l)&&d.default.createElement("div",{className:m.additionalInfo},x&&this.renderEnumValues(x,O),void 0!==s&&this.renderDefaultValue(s),a&&d.default.createElement("div",null,d.default.createElement(w.default,{isInline:!0,description:a})),l&&d.default.createElement(v.default,l))))}},{key:"renderEnumValues",value:function(e,t){var n=this,r=this.props.classes;return d.default.createElement("div",null,d.default.createElement("span",null,"Valid values:"),e.map(function(e){return i(this,n),d.default.createElement("span",{key:e,className:r.enum},e)}.bind(this)),t&&d.default.createElement("a",{onClick:this.displayAllEnums},"..."))}},{key:"displayAllEnums",value:function(){this.setState({isEnumTrimmed:!1})}},{key:"renderDefaultValue",value:function(e){var t;return"number"==typeof e||"string"==typeof e?t=e:"boolean"==typeof e?t=e.toString():Array.isArray(e)&&(t="["+e.join(", ")+"]"),d.default.createElement("div",{className:"default"},"Default: ",d.default.createElement("span",null,t))}}]),t}(f.PureComponent))||s;t.default=T,T.propTypes={name:b.default.string.isRequired,type:b.default.arrayOf(b.default.string).isRequired,subtype:b.default.string,title:b.default.string,description:b.default.string,constraints:b.default.shape({format:b.default.string,exclusiveMinimum:b.default.number,exclusiveMaximum:b.default.number,maximum:b.default.number,maxItems:b.default.number,maxLength:b.default.number,maxProperties:b.default.number,minimum:b.default.number,minItems:b.default.number,minLength:b.default.number,minProperties:b.default.number,multipleOf:b.default.number,pattern:b.default.string,uniqueItems:b.default.bool}),docs:b.default.shape({description:b.default.string,url:b.default.string.isRequired}),enumValues:b.default.array,defaultValue:b.default.any,isRequired:b.default.bool,isOpen:b.default.bool,isLast:b.default.bool,onClick:b.default.func,classes:b.default.object,attributes:b.default.object}},260:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l,s=function(){function e(e,t){for(var n,r=0;r=parseInt(e,10)}}]),t}(c.PureComponent))||l;t.default=O,O.propTypes={response:y.default.shape({code:y.default.string,description:y.default.string,schema:y.default.array,examples:y.default.array}),classes:y.default.object,initialSchemaTreeDepth:y.default.number}},262:function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}Object.defineProperty(t,"__esModule",{value:!0}),t.styles=void 0;var o=n(6),a=n(76);t.styles=(0,o.createSheet)(function(e){e.shades;return i(void 0,void 0),{response:{marginBottom:"5px",bodyContent:{margin:"10px 0 20px 20px"}},info:r({padding:"10px",fontSize:"0.9rem"},"& "+a.styles.classes.indicator,{marginRight:"10px"}),isClickable:{cursor:"pointer"},code:{paddingRight:"20px"},success:{"& $code":{color:"rgb(76, 204, 79)"}},error:{"& $code":{color:"rgb(235, 15, 40)"}}}}.bind(void 0))},263:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l,s=function(){function e(e,t){for(var n,r=0;r li > span":{fontWeight:600}}}}.bind(void 0))},265:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l,s=function(){function e(e,t){for(var n,r=0;rt?1:0}function i(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return u[n]-u[r]}function o(e,t){return e.type===t.type?r(e.title,t.title):i(e.type,t.type)}function a(e){switch(e){case"alpha":return o;case!1:default:return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.sortByAlphabet=r,t.sortByHttpMethod=i,t.sortByUIMethod=o,t.getSortingFunction=a;var u={GET:1,POST:2,PUT:3,DELETE:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8}},273:function(e,t,n){"use strict";function r(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t "+t):a.push("≤ "+r):a.push("≥ "+i),a}Object.defineProperty(t,"__esModule",{value:!0}),t.getConstraintHints=r},277:function(e,t,n){"use strict";function r(e){if(!e)return[];var t=e.minProperties,n=e.maxProperties,r=[];return void 0!==n&&void 0!==t?n===t?r.push(t+" properties"):r.push(t+"-"+n+" properties"):void 0===t?void 0!==n&&r.push("at most "+n+" properties"):r.push("at least "+t+" properties"),r}Object.defineProperty(t,"__esModule",{value:!0}),t.getConstraintHints=r},278:function(e,t,n){"use strict";function r(e){if(!e)return[];var t=e.pattern,n=e.minLength,r=e.maxLength,i=[];return t&&i.push("/"+t+"/"),void 0!==r&&void 0!==n?r===n?i.push(n+" chars"):i.push(n+"-"+r+" chars"):void 0===n?void 0!==r&&i.push("at most "+r+" chars"):i.push("at least "+n+" chars"),i}Object.defineProperty(t,"__esModule",{value:!0}),t.getConstraintHints=r},279:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t span > span":{padding:"2px",backgroundColor:(0,u.default)(t.default).lighten(.1)+"",marginLeft:"5px"}},property:{"&:first-child":{"& $name::after":{content:'""',borderLeft:"1px solid "+t.default,position:"absolute",bottom:"0",left:"0",height:"51%"}},"&:last-child, &$last":{"& $name::after":{content:'""',borderLeft:"1px solid "+t.default,position:"absolute",top:"0",left:"0",height:"50%"}},"&:only-of-type":{"& $name::after":{border:"none"}},"&:first-child$last":{"& $name::after":{border:"none"}},"& + &":{"& $info":{borderTop:"1px solid "+t.default},"& $name::after":{content:'""',borderLeft:"1px solid "+t.default,position:"absolute",bottom:"0",left:"0",height:"100%"}}},required:{marginLeft:"10px",color:"red"},isClickable:{cursor:"pointer",fontWeight:600},isAdditional:{fontStyle:"italic"},last:{},enum:i({},s),default:i({},s),indicator:{},format:{},subType:{}}}.bind(void 0))}},[649]); \ No newline at end of file diff --git a/docs/demo/demo.d73ff4397f0035ac6394.js b/docs/demo/demo.d73ff4397f0035ac6394.js deleted file mode 100644 index 1270e18..0000000 --- a/docs/demo/demo.d73ff4397f0035ac6394.js +++ /dev/null @@ -1 +0,0 @@ -webpackJsonp([1],{116:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s,c=function(){function e(e,t){for(var n,r=0;r div":{height:"100%"},body:{height:"100%",margin:"0",padding:"0",fontFamily:'-apple-system,BlinkMacSystemFont,"Segoe UI",Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",helvetica,sans-serif;',lineHeight:"1.4",fontSize:"1em"},"ul, ol":{margin:".5rem 0",padding:"0","& li":{marginLeft:"1.5rem"}},"h3, h4, h5, h6":{margin:"0",fontWeight:"400"},a:{color:e.text.link+"",textDecoration:"none","&:hover":{transition:"color .25s",color:(0,a.default)(e.text.link).lighten(.1)+"",textDecoration:"underline"}}}}}.bind(void 0))},123:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0;var r=n(467),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.clone=i.default},227:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),o=r(i),a=n(185),u=r(a),l=n(269),s=document.body.appendChild(document.createElement("div"));u.default.render(o.default.createElement(l.Demo,null),s)},228:function(e,t,n){"use strict";function r(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}Object.defineProperty(t,"__esModule",{value:!0}),t.styles=void 0;var i=n(6),o=n(20),a=function(e){return e&&e.__esModule?e:{default:e}}(o);t.styles=(0,i.createSheet)(function(e){var t=e.text,n=e.backgrounds;e.sizes;return r(void 0,void 0),{bodyContent:{display:"table",width:"100%",padding:"1rem 0",boxSizing:"border-box"},tabs:{"& > div":{display:"inline-block",padding:"1rem 2rem",cursor:"pointer","&:not($active)":{color:(0,a.default)(t.default).lighten(.5)+""}}},active:{backgroundColor:n.schema+"",borderRadius:"1rem 1rem 0 0"}}}.bind(void 0))},229:function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}Object.defineProperty(t,"__esModule",{value:!0}),t.styles=void 0;var o=n(6),a=n(77);t.styles=(0,o.createSheet)(function(e){var t,n,o=e.backgrounds,u=e.borders,l=e.sizes;return i(void 0,void 0),n={bodySchema:{width:"100%",borderSpacing:"0",padding:"10px 50px 10px 20px",boxSizing:"border-box",borderRadius:"10px",fontSize:"14.5px"},even:{backgroundColor:o.default+""},odd:{backgroundColor:o.schema+""},subset:(t={},r(t,"& + ."+a.styles.classes.property+":not(."+a.styles.classes.last+")",r({},"& ."+a.styles.classes.name+"::after",{content:'""',borderLeft:"1px solid "+u.default,position:"absolute",bottom:"0",left:"0",height:"100%"})),r(t,"& > td",{borderLeft:"1px solid "+u.default}),r(t,"."+a.styles.classes.last+" + & > td",{borderLeft:"none"}),t),array:{fontFamily:"monospace",padding:"5px 10px"},hasTabs:{borderTopLeftRadius:0}},r(n,"@media (max-width: "+l.breakpoint+")",{bodySchema:{paddingRight:"10px",fontSize:"0.8rem"}}),r(n,"isAdditional",{textAlign:"left",fontStyle:"italic"}),n}.bind(void 0))},230:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l,s=function(){function e(e,t){for(var n,r=0;r span":{color:"white",padding:"2px 10px",cursor:"pointer"}},hovered:{"&$buttons":{transition:"all .2s",opacity:"1"}}}}.bind(void 0))},243:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u,l=function(){function e(e,t){for(var n,r=0;r h3":{display:"inline-block",marginBottom:"15px"},"& h4":{fontSize:"smaller",textTransform:"uppercase",color:(0,u.default)(n.default).lighten(.5)+"",borderBottom:"1px solid "+t.default,marginTop:"20px"}}},"@media (max-width: "+o.breakpoint+")",{method:{padding:"1rem",margin:0}})}.bind(void 0))},247:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l,s=function(){function e(e,t){for(var n,r=0;r div + div",{borderTop:"1px solid "+o.default}),r(t,"& a",{color:u.default+"",padding:".7rem 1rem","&:hover":{color:(0,l.default)(u.default).lighten(.1)+"",transition:"all .2s"}}),t)},"@media (max-width: "+s.breakpoint+")",{navigation:{display:"block",width:"100%",height:"auto",right:"100%",zIndex:"99",transition:"right .5s"},isOpen:{position:"relative",right:0}})}.bind(void 0))},251:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u,l=function(){function e(e,t){for(var n,r=0;r")),d.default.createElement(E.default,{constraints:u,type:r,isRequired:f}),(x&&x.length||s||a||l)&&d.default.createElement("div",{className:m.additionalInfo},x&&this.renderEnumValues(x,O),void 0!==s&&this.renderDefaultValue(s),a&&d.default.createElement("div",null,d.default.createElement(w.default,{isInline:!0,description:a})),l&&d.default.createElement(v.default,l))))}},{key:"renderEnumValues",value:function(e,t){var n=this,r=this.props.classes;return d.default.createElement("div",null,d.default.createElement("span",null,"Valid values:"),e.map(function(e){return i(this,n),d.default.createElement("span",{key:e,className:r.enum},e)}.bind(this)),t&&d.default.createElement("a",{onClick:this.displayAllEnums},"..."))}},{key:"displayAllEnums",value:function(){this.setState({isEnumTrimmed:!1})}},{key:"renderDefaultValue",value:function(e){var t;return"number"==typeof e||"string"==typeof e?t=e:"boolean"==typeof e?t=e.toString():Array.isArray(e)&&(t="["+e.join(", ")+"]"),d.default.createElement("div",{className:"default"},"Default: ",d.default.createElement("span",null,t))}}]),t}(f.PureComponent))||s;t.default=T,T.propTypes={name:b.default.string.isRequired,type:b.default.arrayOf(b.default.string).isRequired,subtype:b.default.string,title:b.default.string,description:b.default.string,constraints:b.default.shape({format:b.default.string,exclusiveMinimum:b.default.number,exclusiveMaximum:b.default.number,maximum:b.default.number,maxItems:b.default.number,maxLength:b.default.number,maxProperties:b.default.number,minimum:b.default.number,minItems:b.default.number,minLength:b.default.number,minProperties:b.default.number,multipleOf:b.default.number,pattern:b.default.string,uniqueItems:b.default.bool}),docs:b.default.shape({description:b.default.string,url:b.default.string.isRequired}),enumValues:b.default.array,defaultValue:b.default.any,isRequired:b.default.bool,isOpen:b.default.bool,isLast:b.default.bool,onClick:b.default.func,classes:b.default.object,attributes:b.default.object}},260:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l,s=function(){function e(e,t){for(var n,r=0;r=parseInt(e,10)}}]),t}(c.PureComponent))||l;t.default=O,O.propTypes={response:y.default.shape({code:y.default.string,description:y.default.string,schema:y.default.array,examples:y.default.array}),classes:y.default.object,initialSchemaTreeDepth:y.default.number}},262:function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}Object.defineProperty(t,"__esModule",{value:!0}),t.styles=void 0;var o=n(6),a=n(76);t.styles=(0,o.createSheet)(function(e){e.shades;return i(void 0,void 0),{response:{marginBottom:"5px",bodyContent:{margin:"10px 0 20px 20px"}},info:r({padding:"10px",fontSize:"0.9rem"},"& "+a.styles.classes.indicator,{marginRight:"10px"}),isClickable:{cursor:"pointer"},code:{paddingRight:"20px"},success:{"& $code":{color:"rgb(76, 204, 79)"}},error:{"& $code":{color:"rgb(235, 15, 40)"}}}}.bind(void 0))},263:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l,s=function(){function e(e,t){for(var n,r=0;r li > span":{fontWeight:600}}}}.bind(void 0))},265:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l,s=function(){function e(e,t){for(var n,r=0;rt?1:0}function i(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return u[n]-u[r]}function o(e,t){return e.type===t.type?r(e.title,t.title):i(e.type,t.type)}function a(e){switch(e){case"alpha":return o;case!1:default:return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.sortByAlphabet=r,t.sortByHttpMethod=i,t.sortByUIMethod=o,t.getSortingFunction=a;var u={GET:1,POST:2,PUT:3,DELETE:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8}},273:function(e,t,n){"use strict";function r(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t "+t):a.push("≤ "+r):a.push("≥ "+i),a}Object.defineProperty(t,"__esModule",{value:!0}),t.getConstraintHints=r},277:function(e,t,n){"use strict";function r(e){if(!e)return[];var t=e.minProperties,n=e.maxProperties,r=[];return void 0!==n&&void 0!==t?n===t?r.push(t+" properties"):r.push(t+"-"+n+" properties"):void 0===t?void 0!==n&&r.push("at most "+n+" properties"):r.push("at least "+t+" properties"),r}Object.defineProperty(t,"__esModule",{value:!0}),t.getConstraintHints=r},278:function(e,t,n){"use strict";function r(e){if(!e)return[];var t=e.pattern,n=e.minLength,r=e.maxLength,i=[];return t&&i.push("/"+t+"/"),void 0!==r&&void 0!==n?r===n?i.push(n+" chars"):i.push(n+"-"+r+" chars"):void 0===n?void 0!==r&&i.push("at most "+r+" chars"):i.push("at least "+n+" chars"),i}Object.defineProperty(t,"__esModule",{value:!0}),t.getConstraintHints=r},279:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t span > span":{padding:"2px",backgroundColor:(0,u.default)(t.default).lighten(.1)+"",marginLeft:"5px"}},property:{"&:first-child":{"& $name::after":{content:'""',borderLeft:"1px solid "+t.default,position:"absolute",bottom:"0",left:"0",height:"51%"}},"&:last-child, &$last":{"& $name::after":{content:'""',borderLeft:"1px solid "+t.default,position:"absolute",top:"0",left:"0",height:"50%"}},"&:only-of-type":{"& $name::after":{border:"none"}},"&:first-child$last":{"& $name::after":{border:"none"}},"& + &":{"& $info":{borderTop:"1px solid "+t.default},"& $name::after":{content:'""',borderLeft:"1px solid "+t.default,position:"absolute",bottom:"0",left:"0",height:"100%"}}},required:{marginLeft:"10px",color:"red"},isClickable:{cursor:"pointer",fontWeight:600},isAdditional:{fontStyle:"italic"},last:{},enum:i({},s),default:i({},s),indicator:{},format:{},subType:{}}}.bind(void 0))}},[649]); \ No newline at end of file diff --git a/docs/demo/index.html b/docs/demo/index.html index 7d892ed..155b46a 100644 --- a/docs/demo/index.html +++ b/docs/demo/index.html @@ -5,5 +5,5 @@ - + diff --git a/docs/demo/manifest.81c1f8c28d950ee22175.js b/docs/demo/manifest.5c1a17bfabe9dba82773.js similarity index 95% rename from docs/demo/manifest.81c1f8c28d950ee22175.js rename to docs/demo/manifest.5c1a17bfabe9dba82773.js index 819cb15..b8bd335 100644 --- a/docs/demo/manifest.81c1f8c28d950ee22175.js +++ b/docs/demo/manifest.5c1a17bfabe9dba82773.js @@ -1 +1 @@ -!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,u){for(var i,a,f,l=0,s=[];l ({ borderLeft: `1px solid ${borders.default}` }, + [`& > td > table`]: { + marginLeft: '12px' + }, + [`.${property.classes.last} + & > td`]: { borderLeft: 'none' } @@ -43,13 +47,14 @@ export const styles = createSheet(({ backgrounds, borders, sizes }) => ({ fontFamily: 'monospace', padding: '5px 10px' }, + 'hasTabs': { borderTopLeftRadius: 0 }, [`@media (max-width: ${sizes.breakpoint})`]: { 'bodySchema': { - paddingRight: '10px', + paddingRight: '22px', fontSize: '0.8rem' } }, diff --git a/src/components/Endpoints/Endpoint.js b/src/components/Endpoints/Endpoint.js index 9b15a97..ee6e54c 100644 --- a/src/components/Endpoints/Endpoint.js +++ b/src/components/Endpoints/Endpoint.js @@ -15,7 +15,7 @@ export default class Endpoint extends PureComponent { return (
- {description &&
} + {description &&
{description}
}
) diff --git a/src/components/Endpoints/Endpoint.style.js b/src/components/Endpoints/Endpoint.style.js index 590ea21..1b8e8be 100644 --- a/src/components/Endpoints/Endpoint.style.js +++ b/src/components/Endpoints/Endpoint.style.js @@ -2,10 +2,18 @@ import { createSheet } from '../../theme' export const styles = createSheet(({borders, text, sizes}) => ({ endpoint: { - lineHeight: '200%' + lineHeight: '1.4', + '& + &': { + marginTop: '.5rem' + } }, readonly: { + fontSize: '.8rem', + fontFamily: 'monospace', + lineHeight: '1.4', + padding: '.25rem', width: '100%', + boxSizing: 'border-box', '&:focus': { outline: 'none' } diff --git a/src/components/Endpoints/Endpoints.style.js b/src/components/Endpoints/Endpoints.style.js index ec36c01..460d46d 100644 --- a/src/components/Endpoints/Endpoints.style.js +++ b/src/components/Endpoints/Endpoints.style.js @@ -3,8 +3,17 @@ import c from 'color' export const styles = createSheet(({borders, backgrounds, text, sizes}) => ({ endpoints: { - minWidth: '300px', - backgroundColor: `${c(backgrounds.schema).darken(0.1)}`, - padding: '15px' + minWidth: '30rem', + backgroundColor: `${c(backgrounds.schema)}`, + padding: '.5rem', + boxShadow: '2px 2px 1rem rgba(0,0,0,0.25)', + borderRadius: '.5rem' + }, + + [`@media (max-width: ${sizes.breakpoint})`]: { + 'endpoints': { + minWidth: 'auto', + width: '100%' + } } })) diff --git a/src/components/Indicator/Indicator.styles.js b/src/components/Indicator/Indicator.styles.js index 8ee9687..3e93077 100644 --- a/src/components/Indicator/Indicator.styles.js +++ b/src/components/Indicator/Indicator.styles.js @@ -12,6 +12,10 @@ export const styles = createSheet(({ shades }) => ({ marginLeft: '1em' }, + '&:hover': { + cursor: 'pointer' + }, + '&$up img': { transform: 'rotate(180deg)' }, '&$right img': { transform: 'rotate(-90deg)' } }, diff --git a/src/components/Method/Method.styles.js b/src/components/Method/Method.styles.js index b3b3871..105725c 100644 --- a/src/components/Method/Method.styles.js +++ b/src/components/Method/Method.styles.js @@ -9,7 +9,7 @@ export const styles = createSheet(({ borders, text, sizes }) => ({ '& > h3': { display: 'inline-block', - marginBottom: '15px' + margin: '0 1.5rem .5rem 0' }, '& h4': { @@ -17,7 +17,7 @@ export const styles = createSheet(({ borders, text, sizes }) => ({ textTransform: 'uppercase', color: `${c(text.default).lighten(0.5)}`, borderBottom: `1px solid ${borders.default}`, - marginTop: '20px' + marginTop: '1rem' } }, diff --git a/src/components/Method/MethodEndpoints.js b/src/components/Method/MethodEndpoints.js index f30b839..3869d88 100644 --- a/src/components/Method/MethodEndpoints.js +++ b/src/components/Method/MethodEndpoints.js @@ -26,7 +26,7 @@ export default class MethodEndpoints extends PureComponent { } return ( -
+
{type} {path} diff --git a/src/components/Method/MethodEndpoints.styles.js b/src/components/Method/MethodEndpoints.styles.js index 9baa353..391d6a7 100644 --- a/src/components/Method/MethodEndpoints.styles.js +++ b/src/components/Method/MethodEndpoints.styles.js @@ -1,12 +1,17 @@ import { createSheet } from '../../theme' export const styles = createSheet(({borders, text, sizes}) => ({ - methodPath: { + methodEndpoints: { display: 'inline-block', fontFamily: 'monospace', - marginLeft: '30px', + fontSize: '1.2rem', + margin: '0 0 .5rem', position: 'relative', + '&:hover': { + textDecoration: 'underline' + }, + '& .methodType': { textTransform: 'uppercase', marginRight: '10px', @@ -31,9 +36,19 @@ export const styles = createSheet(({borders, text, sizes}) => ({ display: 'none' }, expanded: { - // outline: '1px solid red', display: 'block', position: 'absolute', - backgroundColor: 'white' + top: '1.6rem', + left: '0', + zIndex: '5' + }, + + [`@media (max-width: ${sizes.breakpoint})`]: { + 'methodEndpoints': { + display: 'block' + }, + expanded: { + width: 'calc(100% - 1rem)' + } } }))