graphql-engine/docs/_static/graphiql/graphiql.min.js

2 lines
663 KiB
JavaScript
Raw Normal View History

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).GraphiQL=e()}}(function(){return function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n||e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){(function(t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DocExplorer=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=d("undefined"!=typeof window?window.React:void 0!==t?t.React:null),a=d(e("prop-types")),s=e("graphql"),u=d(e("./DocExplorer/FieldDoc")),l=d(e("./DocExplorer/SchemaDoc")),c=d(e("./DocExplorer/SearchBox")),f=d(e("./DocExplorer/SearchResults")),p=d(e("./DocExplorer/TypeDoc"));function d(e){return e&&e.__esModule?e:{default:e}}var h={name:"Schema",title:"Documentation Explorer"};(n.DocExplorer=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.handleNavBackClick=function(){e.state.navStack.length>1&&e.setState({navStack:e.state.navStack.slice(0,-1)})},e.handleClickTypeOrField=function(t){e.showDoc(t)},e.handleSearch=function(t){e.showSearch(t)},e.state={navStack:[h]},e}return function(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)}(t,o.default.Component),i(t,[{key:"shouldComponentUpdate",value:function(e,t){return this.props.schema!==e.schema||this.state.navStack!==t.navStack}},{key:"render",value:function(){var e=this.props.schema,t=this.state.navStack,n=t[t.length-1],r=void 0;r=void 0===e?o.default.createElement("div",{className:"spinner-container"},o.default.createElement("div",{className:"spinner"})):e?n.search?o.default.createElement(f.default,{searchValue:n.search,withinType:n.def,schema:e,onClickType:this.handleClickTypeOrField,onClickField:this.handleClickTypeOrField}):1===t.length?o.default.createElement(l.default,{schema:e,onClickType:this.handleClickTypeOrField}):(0,s.isType)(n.def)?o.default.createElement(p.default,{schema:e,type:n.def,onClickType:this.handleClickTypeOrField,onClickField:this.handleClickTypeOrField}):o.default.createElement(u.default,{field:n.def,onClickType:this.handleClickTypeOrField}):o.default.createElement("div",{className:"error-container"},"No Schema Available");var i=1===t.length||(0,s.isType)(n.def)&&n.def.getFields,a=void 0;return t.length>1&&(a=t[t.length-2].name),o.default.createElement("div",{className:"doc-explorer",key:n.name},o.default.createElement("div",{className:"doc-explorer-title-bar"},a&&o.default.createElement("div",{className:"doc-explorer-back",onClick:this.handleNavBackClick},a),o.default.createElement("div",{className:"doc-explorer-title"},n.title||n.name),o.default.createElement("div",{className:"doc-explorer-rhs"},this.props.children)),o.default.createElement("div",{className:"