@webiny/app-graphql-playground 5.27.0-beta.0 → 5.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,27 +1,46 @@
1
- import React, { memo } from "react";
2
- import { plugins } from "@webiny/plugins";
3
- import { Plugins, AddMenu, AddRoute, Layout } from "@webiny/app-admin";
4
- import { ReactComponent as InfoIcon } from "./assets/graphql.svg";
5
- import Playground from "./plugins/Playground";
6
- import playgroundPlugins from "./plugins";
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.GraphQLPlayground = void 0;
11
+
12
+ var _react = _interopRequireWildcard(require("react"));
13
+
14
+ var _plugins = require("@webiny/plugins");
15
+
16
+ var _appAdmin = require("@webiny/app-admin");
17
+
18
+ var _graphql = require("./assets/graphql.svg");
19
+
20
+ var _Playground = _interopRequireDefault(require("./plugins/Playground"));
21
+
22
+ var _plugins2 = _interopRequireDefault(require("./plugins"));
7
23
 
8
24
  var GraphQLPlaygroundExtension = function GraphQLPlaygroundExtension(_ref) {
9
25
  var createApolloClient = _ref.createApolloClient;
10
- plugins.register(playgroundPlugins);
11
- return /*#__PURE__*/React.createElement(Plugins, null, /*#__PURE__*/React.createElement(AddMenu, {
26
+
27
+ _plugins.plugins.register(_plugins2.default);
28
+
29
+ return /*#__PURE__*/_react.default.createElement(_appAdmin.Plugins, null, /*#__PURE__*/_react.default.createElement(_appAdmin.AddMenu, {
12
30
  name: "apiPlayground",
13
31
  label: "API Playground",
14
32
  path: "/api-playground",
15
- icon: /*#__PURE__*/React.createElement(InfoIcon, null),
33
+ icon: /*#__PURE__*/_react.default.createElement(_graphql.ReactComponent, null),
16
34
  tags: ["footer"]
17
- }), /*#__PURE__*/React.createElement(AddRoute, {
35
+ }), /*#__PURE__*/_react.default.createElement(_appAdmin.AddRoute, {
18
36
  exact: true,
19
37
  path: "/api-playground"
20
- }, /*#__PURE__*/React.createElement(Layout, {
38
+ }, /*#__PURE__*/_react.default.createElement(_appAdmin.Layout, {
21
39
  title: "API Playground"
22
- }, /*#__PURE__*/React.createElement(Playground, {
40
+ }, /*#__PURE__*/_react.default.createElement(_Playground.default, {
23
41
  createApolloClient: createApolloClient
24
42
  }))));
25
43
  };
26
44
 
27
- export var GraphQLPlayground = /*#__PURE__*/memo(GraphQLPlaygroundExtension);
45
+ var GraphQLPlayground = /*#__PURE__*/(0, _react.memo)(GraphQLPlaygroundExtension);
46
+ exports.GraphQLPlayground = GraphQLPlayground;
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","memo","plugins","Plugins","AddMenu","AddRoute","Layout","ReactComponent","InfoIcon","Playground","playgroundPlugins","GraphQLPlaygroundExtension","createApolloClient","register","GraphQLPlayground"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,IAAhB,QAA4B,OAA5B;AAEA,SAASC,OAAT,QAAwB,iBAAxB;AACA,SAASC,OAAT,EAAkBC,OAAlB,EAA2BC,QAA3B,EAAqCC,MAArC,QAAmD,mBAAnD;AACA,SAASC,cAAc,IAAIC,QAA3B;AACA,OAAOC,UAAP;AACA,OAAOC,iBAAP;;AASA,IAAMC,0BAA4D,GAAG,SAA/DA,0BAA+D,OAA4B;AAAA,MAAzBC,kBAAyB,QAAzBA,kBAAyB;AAC7FV,EAAAA,OAAO,CAACW,QAAR,CAAiBH,iBAAjB;AAEA,sBACI,oBAAC,OAAD,qBACI,oBAAC,OAAD;AACI,IAAA,IAAI,EAAE,eADV;AAEI,IAAA,KAAK,EAAE,gBAFX;AAGI,IAAA,IAAI,EAAE,iBAHV;AAII,IAAA,IAAI,eAAE,oBAAC,QAAD,OAJV;AAKI,IAAA,IAAI,EAAE,CAAC,QAAD;AALV,IADJ,eAQI,oBAAC,QAAD;AAAU,IAAA,KAAK,MAAf;AAAgB,IAAA,IAAI,EAAE;AAAtB,kBACI,oBAAC,MAAD;AAAQ,IAAA,KAAK,EAAE;AAAf,kBACI,oBAAC,UAAD;AAAY,IAAA,kBAAkB,EAAEE;AAAhC,IADJ,CADJ,CARJ,CADJ;AAgBH,CAnBD;;AAqBA,OAAO,IAAME,iBAAiB,gBAAGb,IAAI,CAACU,0BAAD,CAA9B","sourcesContent":["import React, { memo } from \"react\";\nimport { ApolloClient } from \"apollo-client\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Plugins, AddMenu, AddRoute, Layout } from \"@webiny/app-admin\";\nimport { ReactComponent as InfoIcon } from \"./assets/graphql.svg\";\nimport Playground from \"./plugins/Playground\";\nimport playgroundPlugins from \"./plugins\";\n\ninterface CreateApolloClientParams {\n uri: string;\n}\ninterface GraphQLPlaygroundProps {\n createApolloClient(params: CreateApolloClientParams): ApolloClient<any>;\n}\n\nconst GraphQLPlaygroundExtension: React.FC<GraphQLPlaygroundProps> = ({ createApolloClient }) => {\n plugins.register(playgroundPlugins);\n\n return (\n <Plugins>\n <AddMenu\n name={\"apiPlayground\"}\n label={\"API Playground\"}\n path={\"/api-playground\"}\n icon={<InfoIcon />}\n tags={[\"footer\"]}\n />\n <AddRoute exact path={\"/api-playground\"}>\n <Layout title={\"API Playground\"}>\n <Playground createApolloClient={createApolloClient} />\n </Layout>\n </AddRoute>\n </Plugins>\n );\n};\n\nexport const GraphQLPlayground = memo(GraphQLPlaygroundExtension);\n"]}
1
+ {"version":3,"names":["GraphQLPlaygroundExtension","createApolloClient","plugins","register","playgroundPlugins","GraphQLPlayground","memo"],"sources":["index.tsx"],"sourcesContent":["import React, { memo } from \"react\";\nimport { ApolloClient } from \"apollo-client\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Plugins, AddMenu, AddRoute, Layout } from \"@webiny/app-admin\";\nimport { ReactComponent as InfoIcon } from \"./assets/graphql.svg\";\nimport Playground from \"./plugins/Playground\";\nimport playgroundPlugins from \"./plugins\";\n\ninterface CreateApolloClientParams {\n uri: string;\n}\ninterface GraphQLPlaygroundProps {\n createApolloClient(params: CreateApolloClientParams): ApolloClient<any>;\n}\n\nconst GraphQLPlaygroundExtension: React.FC<GraphQLPlaygroundProps> = ({ createApolloClient }) => {\n plugins.register(playgroundPlugins);\n\n return (\n <Plugins>\n <AddMenu\n name={\"apiPlayground\"}\n label={\"API Playground\"}\n path={\"/api-playground\"}\n icon={<InfoIcon />}\n tags={[\"footer\"]}\n />\n <AddRoute exact path={\"/api-playground\"}>\n <Layout title={\"API Playground\"}>\n <Playground createApolloClient={createApolloClient} />\n </Layout>\n </AddRoute>\n </Plugins>\n );\n};\n\nexport const GraphQLPlayground = memo(GraphQLPlaygroundExtension);\n"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AASA,IAAMA,0BAA4D,GAAG,SAA/DA,0BAA+D,OAA4B;EAAA,IAAzBC,kBAAyB,QAAzBA,kBAAyB;;EAC7FC,gBAAA,CAAQC,QAAR,CAAiBC,iBAAjB;;EAEA,oBACI,6BAAC,iBAAD,qBACI,6BAAC,iBAAD;IACI,IAAI,EAAE,eADV;IAEI,KAAK,EAAE,gBAFX;IAGI,IAAI,EAAE,iBAHV;IAII,IAAI,eAAE,6BAAC,uBAAD,OAJV;IAKI,IAAI,EAAE,CAAC,QAAD;EALV,EADJ,eAQI,6BAAC,kBAAD;IAAU,KAAK,MAAf;IAAgB,IAAI,EAAE;EAAtB,gBACI,6BAAC,gBAAD;IAAQ,KAAK,EAAE;EAAf,gBACI,6BAAC,mBAAD;IAAY,kBAAkB,EAAEH;EAAhC,EADJ,CADJ,CARJ,CADJ;AAgBH,CAnBD;;AAqBO,IAAMI,iBAAiB,gBAAG,IAAAC,WAAA,EAAKN,0BAAL,CAA1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-graphql-playground",
3
- "version": "5.27.0-beta.0",
3
+ "version": "5.28.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,12 +11,12 @@
11
11
  "dependencies": {
12
12
  "@emotion/core": "10.3.1",
13
13
  "@emotion/styled": "10.3.0",
14
- "@webiny/app": "5.27.0-beta.0",
15
- "@webiny/app-admin": "5.27.0-beta.0",
16
- "@webiny/app-i18n": "5.27.0-beta.0",
17
- "@webiny/app-security": "5.27.0-beta.0",
18
- "@webiny/plugins": "5.27.0-beta.0",
19
- "@webiny/ui": "5.27.0-beta.0",
14
+ "@webiny/app": "5.28.0",
15
+ "@webiny/app-admin": "5.28.0",
16
+ "@webiny/app-i18n": "5.28.0",
17
+ "@webiny/app-security": "5.28.0",
18
+ "@webiny/plugins": "5.28.0",
19
+ "@webiny/ui": "5.28.0",
20
20
  "apollo-cache": "1.3.5",
21
21
  "apollo-client": "2.6.10",
22
22
  "apollo-link": "1.2.14",
@@ -35,8 +35,8 @@
35
35
  "@babel/preset-env": "^7.16.4",
36
36
  "@babel/preset-react": "^7.16.0",
37
37
  "@babel/preset-typescript": "^7.16.0",
38
- "@webiny/cli": "^5.27.0-beta.0",
39
- "@webiny/project-utils": "^5.27.0-beta.0",
38
+ "@webiny/cli": "^5.28.0",
39
+ "@webiny/project-utils": "^5.28.0",
40
40
  "babel-plugin-emotion": "^9.2.8",
41
41
  "babel-plugin-lodash": "^3.3.4",
42
42
  "rimraf": "^3.0.2",
@@ -60,5 +60,5 @@
60
60
  ]
61
61
  }
62
62
  },
63
- "gitHead": "9e557dd294ae37cf84f17e0e8158c2ed16e2d415"
63
+ "gitHead": "9fd082a2e4a0e0116ee5a07e2a9ca385e8ac0173"
64
64
  }
@@ -1,34 +1,59 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
3
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
- import _regeneratorRuntime from "@babel/runtime/regenerator";
5
- import React, { Fragment, useEffect, useRef, useCallback, useState } from "react";
6
- import { ApolloLink } from "apollo-link";
7
- import { setContext } from "apollo-link-context";
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.default = void 0;
11
+
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
+
14
+ var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
15
+
16
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
17
+
18
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
19
+
20
+ var _react = _interopRequireWildcard(require("react"));
21
+
22
+ var _apolloLink = require("apollo-link");
23
+
24
+ var _apolloLinkContext = require("apollo-link-context");
25
+
26
+ var _loadScript = _interopRequireDefault(require("load-script"));
27
+
28
+ var _core = require("@emotion/core");
29
+
30
+ var _plugins = require("@webiny/plugins");
31
+
32
+ var _useI18N2 = require("@webiny/app-i18n/hooks/useI18N");
33
+
34
+ var _appSecurity = require("@webiny/app-security");
35
+
36
+ var _Progress = require("@webiny/ui/Progress");
37
+
38
+ var _Playground = require("./Playground.styles");
39
+
40
+ var _settings = require("./settings");
41
+
42
+ var _config = require("@webiny/app/config");
43
+
8
44
  /**
9
45
  * Package load-script does not have types.
10
46
  */
11
47
  // @ts-ignore
12
-
13
- import loadScript from "load-script";
14
- import { Global } from "@emotion/core";
15
- import { plugins } from "@webiny/plugins";
16
- import { useI18N } from "@webiny/app-i18n/hooks/useI18N";
17
- import { useSecurity } from "@webiny/app-security";
18
- import { CircularProgress } from "@webiny/ui/Progress";
19
- import { playgroundDialog, PlaygroundContainer } from "./Playground.styles";
20
- import { settings } from "./settings";
21
- import { config as appConfig } from "@webiny/app/config";
22
-
23
48
  var withHeaders = function withHeaders(link, headers) {
24
- return ApolloLink.from([setContext( /*#__PURE__*/function () {
25
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_, req) {
26
- return _regeneratorRuntime.wrap(function _callee$(_context) {
49
+ return _apolloLink.ApolloLink.from([(0, _apolloLinkContext.setContext)( /*#__PURE__*/function () {
50
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(_, req) {
51
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
27
52
  while (1) {
28
53
  switch (_context.prev = _context.next) {
29
54
  case 0:
30
55
  return _context.abrupt("return", {
31
- headers: _objectSpread(_objectSpread({}, req.headers), headers)
56
+ headers: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, req.headers), headers)
32
57
  });
33
58
 
34
59
  case 1:
@@ -52,38 +77,40 @@ var initScripts = function initScripts() {
52
77
  return resolve();
53
78
  }
54
79
 
55
- return loadScript("https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js", resolve);
80
+ return (0, _loadScript.default)("https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js", resolve);
56
81
  });
57
82
  };
58
83
 
59
84
  var Playground = function Playground(_ref2) {
60
85
  var createApolloClient = _ref2.createApolloClient;
61
86
 
62
- var _useState = useState(true),
63
- _useState2 = _slicedToArray(_useState, 2),
87
+ var _useState = (0, _react.useState)(true),
88
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
64
89
  loading = _useState2[0],
65
90
  setLoading = _useState2[1];
66
91
 
67
- var _useI18N = useI18N(),
92
+ var _useI18N = (0, _useI18N2.useI18N)(),
68
93
  getCurrentLocale = _useI18N.getCurrentLocale;
69
94
 
70
- var _useSecurity = useSecurity(),
95
+ var _useSecurity = (0, _appSecurity.useSecurity)(),
71
96
  identity = _useSecurity.identity;
72
97
 
73
- var links = useRef({});
98
+ var links = (0, _react.useRef)({});
74
99
  var locale = getCurrentLocale("content");
75
- var tabs = plugins.byType("graphql-playground-tab").map(function (pl) {
100
+
101
+ var tabs = _plugins.plugins.byType("graphql-playground-tab").map(function (pl) {
76
102
  return pl.tab({
77
103
  locale: locale,
78
104
  identity: identity
79
105
  });
80
106
  }).filter(Boolean);
81
- var createApolloLink = useCallback(function (_ref3) {
107
+
108
+ var createApolloLink = (0, _react.useCallback)(function (_ref3) {
82
109
  var endpoint = _ref3.endpoint,
83
110
  headers = _ref3.headers;
84
111
  var current = links.current; // If the request endpoint is not know to us, return the first available
85
112
 
86
- var apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
113
+ var apiUrl = _config.config.getKey("API_URL", process.env.REACT_APP_API_URL);
87
114
 
88
115
  if (!endpoint.includes(apiUrl)) {
89
116
  return {
@@ -101,28 +128,29 @@ var Playground = function Playground(_ref2) {
101
128
  link: withHeaders(current[endpoint], headers)
102
129
  };
103
130
  }, []);
104
- useEffect(function () {
131
+ (0, _react.useEffect)(function () {
105
132
  initScripts().then(function () {
106
133
  setLoading(false);
107
134
  });
108
135
  }, []);
109
- useEffect(function () {
136
+ (0, _react.useEffect)(function () {
110
137
  if (!loading) {
111
138
  // @ts-ignore
112
139
  window.GraphQLPlayground.init(document.getElementById("graphql-playground"), {
113
140
  tabs: tabs,
114
141
  createApolloLink: createApolloLink,
115
- settings: settings
142
+ settings: _settings.settings
116
143
  });
117
144
  }
118
145
  }, [loading]);
119
- return /*#__PURE__*/React.createElement(Fragment, null, loading ? /*#__PURE__*/React.createElement(CircularProgress, {
146
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, loading ? /*#__PURE__*/_react.default.createElement(_Progress.CircularProgress, {
120
147
  label: "Loading playground..."
121
- }) : /*#__PURE__*/React.createElement(PlaygroundContainer, {
148
+ }) : /*#__PURE__*/_react.default.createElement(_Playground.PlaygroundContainer, {
122
149
  id: "graphql-playground"
123
- }), /*#__PURE__*/React.createElement(Global, {
124
- styles: playgroundDialog
150
+ }), /*#__PURE__*/_react.default.createElement(_core.Global, {
151
+ styles: _Playground.playgroundDialog
125
152
  }));
126
153
  };
127
154
 
128
- export default Playground;
155
+ var _default = Playground;
156
+ exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["Playground.tsx"],"names":["React","Fragment","useEffect","useRef","useCallback","useState","ApolloLink","setContext","loadScript","Global","plugins","useI18N","useSecurity","CircularProgress","playgroundDialog","PlaygroundContainer","settings","config","appConfig","withHeaders","link","headers","from","_","req","initScripts","Promise","resolve","window","GraphQLPlayground","Playground","createApolloClient","loading","setLoading","getCurrentLocale","identity","links","locale","tabs","byType","map","pl","tab","filter","Boolean","createApolloLink","endpoint","current","apiUrl","getKey","process","env","REACT_APP_API_URL","includes","Object","values","uri","then","init","document","getElementById"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,EAA6CC,WAA7C,EAA0DC,QAA1D,QAA0E,OAA1E;AACA,SAASC,UAAT,QAA2B,aAA3B;AACA,SAASC,UAAT,QAA2B,qBAA3B;AACA;AACA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,aAAvB;AACA,SAASC,MAAT,QAAuB,eAAvB;AACA,SAASC,OAAT,QAAwB,iBAAxB;AACA,SAASC,OAAT,QAAwB,gCAAxB;AACA,SAASC,WAAT,QAA4B,sBAA5B;AACA,SAASC,gBAAT,QAAiC,qBAAjC;AACA,SAASC,gBAAT,EAA2BC,mBAA3B;AACA,SAASC,QAAT;AACA,SAASC,MAAM,IAAIC,SAAnB,QAAoC,oBAApC;;AAKA,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAACC,IAAD,EAAmBC,OAAnB,EAAmE;AACnF,SAAOf,UAAU,CAACgB,IAAX,CAAgB,CACnBf,UAAU;AAAA,wEAAC,iBAAOgB,CAAP,EAAUC,GAAV;AAAA;AAAA;AAAA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ATM,CAAT;AAWA,sBACI,oBAAC,QAAD,QACKA,OAAO,gBACJ,oBAAC,gBAAD;AAAkB,IAAA,KAAK,EAAE;AAAzB,IADI,gBAGJ,oBAAC,mBAAD;AAAqB,IAAA,EAAE,EAAE;AAAzB,IAJR,eAMI,oBAAC,MAAD;AAAQ,IAAA,MAAM,EAAElB;AAAhB,IANJ,CADJ;AAUH,CA9DD;;AAgEA,eAAegB,UAAf","sourcesContent":["import React, { Fragment, useEffect, useRef, useCallback, useState } from \"react\";\nimport { ApolloLink } from \"apollo-link\";\nimport { setContext } from \"apollo-link-context\";\n/**\n * Package load-script does not have types.\n */\n// @ts-ignore\nimport loadScript from \"load-script\";\nimport { Global } from \"@emotion/core\";\nimport { plugins } from \"@webiny/plugins\";\nimport { useI18N } from \"@webiny/app-i18n/hooks/useI18N\";\nimport { useSecurity } from \"@webiny/app-security\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { playgroundDialog, PlaygroundContainer } from \"./Playground.styles\";\nimport { settings } from \"./settings\";\nimport { config as appConfig } from \"@webiny/app/config\";\nimport ApolloClient from \"apollo-client\";\nimport { GraphQLPlaygroundTabPlugin } from \"~/types\";\nimport { SecurityIdentity } from \"@webiny/app-security/types\";\n\nconst withHeaders = (link: ApolloLink, headers: Record<string, string>): ApolloLink => {\n return ApolloLink.from([\n setContext(async (_, req) => {\n return {\n headers: {\n ...req.headers,\n ...headers\n }\n };\n }),\n link\n ]);\n};\n\nconst initScripts = () => {\n return new Promise((resolve: any) => {\n // @ts-ignore\n if (window.GraphQLPlayground) {\n return resolve();\n }\n\n return loadScript(\n \"https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js\",\n resolve\n );\n });\n};\n\ninterface CreateApolloClientParams {\n uri: string;\n}\ninterface PlaygroundProps {\n createApolloClient: (params: CreateApolloClientParams) => ApolloClient<any>;\n}\nconst Playground: React.FC<PlaygroundProps> = ({ createApolloClient }) => {\n const [loading, setLoading] = useState(true);\n const { getCurrentLocale } = useI18N();\n const { identity } = useSecurity();\n const links = useRef<Record<string, ApolloLink>>({});\n\n const locale = getCurrentLocale(\"content\");\n\n const tabs = plugins\n .byType<GraphQLPlaygroundTabPlugin>(\"graphql-playground-tab\")\n .map(pl =>\n pl.tab({\n locale: locale as string,\n identity: identity as SecurityIdentity\n })\n )\n .filter(Boolean);\n\n const createApolloLink = useCallback(({ endpoint, headers }) => {\n const current = links.current;\n // If the request endpoint is not know to us, return the first available\n const apiUrl = appConfig.getKey(\"API_URL\", process.env.REACT_APP_API_URL);\n if (!endpoint.includes(apiUrl)) {\n return { link: withHeaders(Object.values(current)[0], headers) };\n }\n\n if (!current[endpoint]) {\n current[endpoint] = createApolloClient({ uri: endpoint }).link;\n }\n\n return {\n link: withHeaders(current[endpoint], headers)\n };\n }, []);\n\n useEffect(() => {\n initScripts().then(() => {\n setLoading(false);\n });\n }, []);\n\n useEffect(() => {\n if (!loading) {\n // @ts-ignore\n window.GraphQLPlayground.init(document.getElementById(\"graphql-playground\"), {\n tabs,\n createApolloLink,\n settings\n });\n }\n }, [loading]);\n\n return (\n <Fragment>\n {loading ? (\n <CircularProgress label={\"Loading playground...\"} />\n ) : (\n <PlaygroundContainer id={\"graphql-playground\"} />\n )}\n <Global styles={playgroundDialog} />\n </Fragment>\n );\n};\n\nexport default Playground;\n"]}
1
+ {"version":3,"names":["withHeaders","link","headers","ApolloLink","from","setContext","_","req","initScripts","Promise","resolve","window","GraphQLPlayground","loadScript","Playground","createApolloClient","useState","loading","setLoading","useI18N","getCurrentLocale","useSecurity","identity","links","useRef","locale","tabs","plugins","byType","map","pl","tab","filter","Boolean","createApolloLink","useCallback","endpoint","current","apiUrl","appConfig","getKey","process","env","REACT_APP_API_URL","includes","Object","values","uri","useEffect","then","init","document","getElementById","settings","playgroundDialog"],"sources":["Playground.tsx"],"sourcesContent":["import React, { Fragment, useEffect, useRef, useCallback, useState } from \"react\";\nimport { ApolloLink } from \"apollo-link\";\nimport { setContext } from \"apollo-link-context\";\n/**\n * Package load-script does not have types.\n */\n// @ts-ignore\nimport loadScript from \"load-script\";\nimport { Global } from \"@emotion/core\";\nimport { plugins } from \"@webiny/plugins\";\nimport { useI18N } from \"@webiny/app-i18n/hooks/useI18N\";\nimport { useSecurity } from \"@webiny/app-security\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { playgroundDialog, PlaygroundContainer } from \"./Playground.styles\";\nimport { settings } from \"./settings\";\nimport { config as appConfig } from \"@webiny/app/config\";\nimport ApolloClient from \"apollo-client\";\nimport { GraphQLPlaygroundTabPlugin } from \"~/types\";\nimport { SecurityIdentity } from \"@webiny/app-security/types\";\n\nconst withHeaders = (link: ApolloLink, headers: Record<string, string>): ApolloLink => {\n return ApolloLink.from([\n setContext(async (_, req) => {\n return {\n headers: {\n ...req.headers,\n ...headers\n }\n };\n }),\n link\n ]);\n};\n\nconst initScripts = () => {\n return new Promise((resolve: any) => {\n // @ts-ignore\n if (window.GraphQLPlayground) {\n return resolve();\n }\n\n return loadScript(\n \"https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js\",\n resolve\n );\n });\n};\n\ninterface CreateApolloClientParams {\n uri: string;\n}\ninterface PlaygroundProps {\n createApolloClient: (params: CreateApolloClientParams) => ApolloClient<any>;\n}\nconst Playground: React.FC<PlaygroundProps> = ({ createApolloClient }) => {\n const [loading, setLoading] = useState(true);\n const { getCurrentLocale } = useI18N();\n const { identity } = useSecurity();\n const links = useRef<Record<string, ApolloLink>>({});\n\n const locale = getCurrentLocale(\"content\");\n\n const tabs = plugins\n .byType<GraphQLPlaygroundTabPlugin>(\"graphql-playground-tab\")\n .map(pl =>\n pl.tab({\n locale: locale as string,\n identity: identity as SecurityIdentity\n })\n )\n .filter(Boolean);\n\n const createApolloLink = useCallback(({ endpoint, headers }) => {\n const current = links.current;\n // If the request endpoint is not know to us, return the first available\n const apiUrl = appConfig.getKey(\"API_URL\", process.env.REACT_APP_API_URL);\n if (!endpoint.includes(apiUrl)) {\n return { link: withHeaders(Object.values(current)[0], headers) };\n }\n\n if (!current[endpoint]) {\n current[endpoint] = createApolloClient({ uri: endpoint }).link;\n }\n\n return {\n link: withHeaders(current[endpoint], headers)\n };\n }, []);\n\n useEffect(() => {\n initScripts().then(() => {\n setLoading(false);\n });\n }, []);\n\n useEffect(() => {\n if (!loading) {\n // @ts-ignore\n window.GraphQLPlayground.init(document.getElementById(\"graphql-playground\"), {\n tabs,\n createApolloLink,\n settings\n });\n }\n }, [loading]);\n\n return (\n <Fragment>\n {loading ? (\n <CircularProgress label={\"Loading playground...\"} />\n ) : (\n <PlaygroundContainer id={\"graphql-playground\"} />\n )}\n <Global styles={playgroundDialog} />\n </Fragment>\n );\n};\n\nexport default Playground;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAZA;AACA;AACA;AACA;AAcA,IAAMA,WAAW,GAAG,SAAdA,WAAc,CAACC,IAAD,EAAmBC,OAAnB,EAAmE;EACnF,OAAOC,sBAAA,CAAWC,IAAX,CAAgB,CACnB,IAAAC,6BAAA;IAAA,kGAAW,iBAAOC,CAAP,EAAUC,GAAV;MAAA;QAAA;UAAA;YAAA;cAAA,iCACA;gBACHL,OAAO,8DACAK,GAAG,CAACL,OADJ,GAEAA,OAFA;cADJ,CADA;;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA;IAAA,CAAX;;IAAA;MAAA;IAAA;EAAA,IADmB,EASnBD,IATmB,CAAhB,CAAP;AAWH,CAZD;;AAcA,IAAMO,WAAW,GAAG,SAAdA,WAAc,GAAM;EACtB,OAAO,IAAIC,OAAJ,CAAY,UAACC,OAAD,EAAkB;IACjC;IACA,IAAIC,MAAM,CAACC,iBAAX,EAA8B;MAC1B,OAAOF,OAAO,EAAd;IACH;;IAED,OAAO,IAAAG,mBAAA,EACH,2GADG,EAEHH,OAFG,CAAP;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CAACD,QAAD,CAAZ,EAAwB;MACpBC,OAAO,CAACD,QAAD,CAAP,GAAoBrB,kBAAkB,CAAC;QAAEgC,GAAG,EAAEX;MAAP,CAAD,CAAlB,CAAsCnC,IAA1D;IACH;;IAED,OAAO;MACHA,IAAI,EAAED,WAAW,CAACqC,OAAO,CAACD,QAAD,CAAR,EAAoBlC,OAApB;IADd,CAAP;EAGH,CAfwB,EAetB,EAfsB,CAAzB;EAiBA,IAAA8C,gBAAA,EAAU,YAAM;IACZxC,WAAW,GAAGyC,IAAd,CAAmB,YAAM;MACrB/B,UAAU,CAAC,KAAD,CAAV;IACH,CAFD;EAGH,CAJD,EAIG,EAJH;EAMA,IAAA8B,gBAAA,EAAU,YAAM;IACZ,IAAI,CAAC/B,OAAL,EAAc;MACV;MACAN,MAAM,CAACC,iBAAP,CAAyBsC,IAAzB,CAA8BC,QAAQ,CAACC,cAAT,CAAwB,oBAAxB,CAA9B,EAA6E;QACzE1B,IAAI,EAAJA,IADyE;QAEzEQ,gBAAgB,EAAhBA,gBAFyE;QAGzEmB,QAAQ,EAARA;MAHyE,CAA7E;IAKH;EACJ,CATD,EASG,CAACpC,OAAD,CATH;EAWA,oBACI,6BAAC,eAAD,QACKA,OAAO,gBACJ,6BAAC,0BAAD;IAAkB,KAAK,EAAE;EAAzB,EADI,gBAGJ,6BAAC,+BAAD;IAAqB,EAAE,EAAE;EAAzB,EAJR,eAMI,6BAAC,YAAD;IAAQ,MAAM,EAAEqC;EAAhB,EANJ,CADJ;AAUH,CA9DD;;eAgEexC,U"}
@@ -1,5 +1,16 @@
1
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
- import styled from "@emotion/styled";
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.playgroundDialog = exports.PlaygroundContainer = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _styled = _interopRequireDefault(require("@emotion/styled"));
13
+
3
14
  var sharedStyles = {
4
15
  "p, a, h1, h2, h3, h4, ul, pre, code": {
5
16
  margin: 0,
@@ -19,13 +30,13 @@ var sharedStyles = {
19
30
  fontFamily: "Consolas, monospace"
20
31
  }
21
32
  };
22
- export var PlaygroundContainer = /*#__PURE__*/styled("div", {
33
+ var PlaygroundContainer = /*#__PURE__*/(0, _styled.default)("div", {
23
34
  target: "e1o47c380",
24
35
  label: "PlaygroundContainer"
25
36
  })({
26
37
  marginTop: -3,
27
38
  overflow: "hidden",
28
- ".playground": _objectSpread({
39
+ ".playground": (0, _objectSpread2.default)({
29
40
  height: "calc(100vh - 64px)",
30
41
  margin: 0,
31
42
  padding: 0,
@@ -38,6 +49,8 @@ export var PlaygroundContainer = /*#__PURE__*/styled("div", {
38
49
  marginRight: "-1px !important"
39
50
  }, sharedStyles)
40
51
  });
41
- export var playgroundDialog = {
52
+ exports.PlaygroundContainer = PlaygroundContainer;
53
+ var playgroundDialog = {
42
54
  ".ReactModalPortal": sharedStyles
43
- };
55
+ };
56
+ exports.playgroundDialog = playgroundDialog;
@@ -1 +1 @@
1
- {"version":3,"sources":["Playground.styles.ts"],"names":["styled","sharedStyles","margin","padding","color","outline","border","fontFamily","code","PlaygroundContainer","marginTop","overflow","height","WebkitFontSmoothing","MozOsxFontSmoothing","lineHeight","letterSpacing","marginRight","playgroundDialog"],"mappings":";AAAA,OAAOA,MAAP,MAAmB,iBAAnB;AAEA,IAAMC,YAAY,GAAG;AACjB,yCAAuC;AACnCC,IAAAA,MAAM,EAAE,CAD2B;AAEnCC,IAAAA,OAAO,EAAE,CAF0B;AAGnCC,IAAAA,KAAK,EAAE;AAH4B,GADtB;AAMjB,kDAAgD;AAC5CC,IAAAA,OAAO,EAAE;AADmC,GAN/B;AASjB,2BAAyB;AACrBC,IAAAA,MAAM,EAAE;AADa,GATR;AAYjB,wBAAsB;AAClBC,IAAAA,UAAU,EAAE;AADM,GAZL;AAejBC,EAAAA,IAAI,EAAE;AACFD,IAAAA,UAAU,EAAE;AADV;AAfW,CAArB;AAoBA,OAAO,IAAME,mBAAmB,gBAAGT,MAAH,CAAU,KAAV;AAAA;AAAA;AAAA,GAAiB;AAC7CU,EAAAA,SAAS,EAAE,CAAC,CADiC;AAE7CC,EAAAA,QAAQ,EAAE,QAFmC;AAG7C;AACIC,IAAAA,MAAM,EAAE,oBADZ;AAEIV,IAAAA,MAAM,EAAE,CAFZ;AAGIC,IAAAA,OAAO,EAAE,CAHb;AAIII,IAAAA,UAAU,EAAE,yBAJhB;AAKIM,IAAAA,mBAAmB,EAAE,aALzB;AAMIC,IAAAA,mBAAmB,EAAE,WANzB;AAOIV,IAAAA,KAAK,EAAE,gBAPX;AAQIW,IAAAA,UAAU,EAAE,GARhB;AASIC,IAAAA,aAAa,EAAE,IATnB;AAUIC,IAAAA,WAAW,EAAE;AAVjB,KAWOhB,YAXP;AAH6C,CAAjB,CAAzB;AAkBP,OAAO,IAAMiB,gBAAgB,GAAG;AAC5B,uBAAqBjB;AADO,CAAzB","sourcesContent":["import styled from \"@emotion/styled\";\n\nconst sharedStyles = {\n \"p, a, h1, h2, h3, h4, ul, pre, code\": {\n margin: 0,\n padding: 0,\n color: \"inherit\"\n },\n \"a:active, a:focus, button:focus, input:focus\": {\n outline: \"none\"\n },\n \"input, button, submit\": {\n border: \"none\"\n },\n \"input, button, pre\": {\n fontFamily: \"'Open Sans', sans-serif\"\n },\n code: {\n fontFamily: \"Consolas, monospace\"\n }\n};\n\nexport const PlaygroundContainer = styled(\"div\")({\n marginTop: -3,\n overflow: \"hidden\",\n \".playground\": {\n height: \"calc(100vh - 64px)\",\n margin: 0,\n padding: 0,\n fontFamily: \"'Open Sans', sans-serif\",\n WebkitFontSmoothing: \"antialiased\",\n MozOsxFontSmoothing: \"grayscale\",\n color: \"rgba(0,0,0,.8)\",\n lineHeight: 1.5,\n letterSpacing: 0.53,\n marginRight: \"-1px !important\",\n ...sharedStyles\n }\n});\n\nexport const playgroundDialog = {\n \".ReactModalPortal\": sharedStyles\n};\n"]}
1
+ {"version":3,"names":["sharedStyles","margin","padding","color","outline","border","fontFamily","code","PlaygroundContainer","styled","marginTop","overflow","height","WebkitFontSmoothing","MozOsxFontSmoothing","lineHeight","letterSpacing","marginRight","playgroundDialog"],"sources":["Playground.styles.ts"],"sourcesContent":["import styled from \"@emotion/styled\";\n\nconst sharedStyles = {\n \"p, a, h1, h2, h3, h4, ul, pre, code\": {\n margin: 0,\n padding: 0,\n color: \"inherit\"\n },\n \"a:active, a:focus, button:focus, input:focus\": {\n outline: \"none\"\n },\n \"input, button, submit\": {\n border: \"none\"\n },\n \"input, button, pre\": {\n fontFamily: \"'Open Sans', sans-serif\"\n },\n code: {\n fontFamily: \"Consolas, monospace\"\n }\n};\n\nexport const PlaygroundContainer = styled(\"div\")({\n marginTop: -3,\n overflow: \"hidden\",\n \".playground\": {\n height: \"calc(100vh - 64px)\",\n margin: 0,\n padding: 0,\n fontFamily: \"'Open Sans', sans-serif\",\n WebkitFontSmoothing: \"antialiased\",\n MozOsxFontSmoothing: \"grayscale\",\n color: \"rgba(0,0,0,.8)\",\n lineHeight: 1.5,\n letterSpacing: 0.53,\n marginRight: \"-1px !important\",\n ...sharedStyles\n }\n});\n\nexport const playgroundDialog = {\n \".ReactModalPortal\": sharedStyles\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AAEA,IAAMA,YAAY,GAAG;EACjB,uCAAuC;IACnCC,MAAM,EAAE,CAD2B;IAEnCC,OAAO,EAAE,CAF0B;IAGnCC,KAAK,EAAE;EAH4B,CADtB;EAMjB,gDAAgD;IAC5CC,OAAO,EAAE;EADmC,CAN/B;EASjB,yBAAyB;IACrBC,MAAM,EAAE;EADa,CATR;EAYjB,sBAAsB;IAClBC,UAAU,EAAE;EADM,CAZL;EAejBC,IAAI,EAAE;IACFD,UAAU,EAAE;EADV;AAfW,CAArB;AAoBO,IAAME,mBAAmB,oBAAGC,eAAH,EAAU,KAAV;EAAA;EAAA;AAAA,GAAiB;EAC7CC,SAAS,EAAE,CAAC,CADiC;EAE7CC,QAAQ,EAAE,QAFmC;EAG7C;IACIC,MAAM,EAAE,oBADZ;IAEIX,MAAM,EAAE,CAFZ;IAGIC,OAAO,EAAE,CAHb;IAIII,UAAU,EAAE,yBAJhB;IAKIO,mBAAmB,EAAE,aALzB;IAMIC,mBAAmB,EAAE,WANzB;IAOIX,KAAK,EAAE,gBAPX;IAQIY,UAAU,EAAE,GARhB;IASIC,aAAa,EAAE,IATnB;IAUIC,WAAW,EAAE;EAVjB,GAWOjB,YAXP;AAH6C,CAAjB,CAAzB;;AAkBA,IAAMkB,gBAAgB,GAAG;EAC5B,qBAAqBlB;AADO,CAAzB"}
package/plugins/index.js CHANGED
@@ -1,16 +1,29 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _placeholder = _interopRequireDefault(require("!!raw-loader!./placeholder.graphql"));
11
+
12
+ var _config = require("@webiny/app/config");
13
+
1
14
  // @ts-ignore
2
- import placeholder from "!!raw-loader!./placeholder.graphql";
3
- import { config as appConfig } from "@webiny/app/config";
4
15
  var plugin = {
5
16
  type: "graphql-playground-tab",
6
17
  tab: function tab() {
7
- var apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
18
+ var apiUrl = _config.config.getKey("API_URL", process.env.REACT_APP_API_URL);
19
+
8
20
  return {
9
21
  name: "Main API",
10
22
  endpoint: apiUrl + "/graphql",
11
23
  headers: {},
12
- query: placeholder
24
+ query: _placeholder.default
13
25
  };
14
26
  }
15
27
  };
16
- export default [plugin];
28
+ var _default = [plugin];
29
+ exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":["placeholder","config","appConfig","plugin","type","tab","apiUrl","getKey","process","env","REACT_APP_API_URL","name","endpoint","headers","query"],"mappings":"AACA;AACA,OAAOA,WAAP,MAAwB,oCAAxB;AACA,SAASC,MAAM,IAAIC,SAAnB,QAAoC,oBAApC;AAEA,IAAMC,MAAkC,GAAG;AACvCC,EAAAA,IAAI,EAAE,wBADiC;AAEvCC,EAAAA,GAFuC,iBAEjC;AACF,QAAMC,MAAM,GAAGJ,SAAS,CAACK,MAAV,CAAiB,SAAjB,EAA4BC,OAAO,CAACC,GAAR,CAAYC,iBAAxC,CAAf;AACA,WAAO;AACHC,MAAAA,IAAI,EAAE,UADH;AAEHC,MAAAA,QAAQ,EAAEN,MAAM,GAAG,UAFhB;AAGHO,MAAAA,OAAO,EAAE,EAHN;AAIHC,MAAAA,KAAK,EAAEd;AAJJ,KAAP;AAMH;AAVsC,CAA3C;AAYA,eAAe,CAACG,MAAD,CAAf","sourcesContent":["import { GraphQLPlaygroundTabPlugin } from \"~/types\";\n// @ts-ignore\nimport placeholder from \"!!raw-loader!./placeholder.graphql\";\nimport { config as appConfig } from \"@webiny/app/config\";\n\nconst plugin: GraphQLPlaygroundTabPlugin = {\n type: \"graphql-playground-tab\",\n tab() {\n const apiUrl = appConfig.getKey(\"API_URL\", process.env.REACT_APP_API_URL) as string;\n return {\n name: \"Main API\",\n endpoint: apiUrl + \"/graphql\",\n headers: {},\n query: placeholder\n };\n }\n};\nexport default [plugin];\n"]}
1
+ {"version":3,"names":["plugin","type","tab","apiUrl","appConfig","getKey","process","env","REACT_APP_API_URL","name","endpoint","headers","query","placeholder"],"sources":["index.tsx"],"sourcesContent":["import { GraphQLPlaygroundTabPlugin } from \"~/types\";\n// @ts-ignore\nimport placeholder from \"!!raw-loader!./placeholder.graphql\";\nimport { config as appConfig } from \"@webiny/app/config\";\n\nconst plugin: GraphQLPlaygroundTabPlugin = {\n type: \"graphql-playground-tab\",\n tab() {\n const apiUrl = appConfig.getKey(\"API_URL\", process.env.REACT_APP_API_URL) as string;\n return {\n name: \"Main API\",\n endpoint: apiUrl + \"/graphql\",\n headers: {},\n query: placeholder\n };\n }\n};\nexport default [plugin];\n"],"mappings":";;;;;;;;;AAEA;;AACA;;AAFA;AAIA,IAAMA,MAAkC,GAAG;EACvCC,IAAI,EAAE,wBADiC;EAEvCC,GAFuC,iBAEjC;IACF,IAAMC,MAAM,GAAGC,cAAA,CAAUC,MAAV,CAAiB,SAAjB,EAA4BC,OAAO,CAACC,GAAR,CAAYC,iBAAxC,CAAf;;IACA,OAAO;MACHC,IAAI,EAAE,UADH;MAEHC,QAAQ,EAAEP,MAAM,GAAG,UAFhB;MAGHQ,OAAO,EAAE,EAHN;MAIHC,KAAK,EAAEC;IAJJ,CAAP;EAMH;AAVsC,CAA3C;eAYe,CAACb,MAAD,C"}
@@ -1,4 +1,10 @@
1
- export var settings = {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.settings = void 0;
7
+ var settings = {
2
8
  "editor.cursorShape": "line",
3
9
  "editor.fontFamily": "'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace",
4
10
  "editor.fontSize": 14,
@@ -15,4 +21,5 @@ export var settings = {
15
21
  "schema.polling.interval": 2000000,
16
22
  "tracing.hideTracingResponse": true,
17
23
  "queryPlan.hideQueryPlanResponse": true
18
- };
24
+ };
25
+ exports.settings = settings;
@@ -1 +1 @@
1
- {"version":3,"sources":["settings.ts"],"names":["settings"],"mappings":"AAAA,OAAO,IAAMA,QAAa,GAAG;AACzB,wBAAsB,MADG;AAEzB,6GAFyB;AAGzB,qBAAmB,EAHM;AAIzB,yBAAuB,IAJE;AAKzB,kBAAgB,MALS;AAMzB,yBAAuB,KANE;AAOzB,yBAAuB,EAPE;AAQzB,uBAAqB,CARI;AASzB,sBAAoB,KATK;AAUzB,yBAAuB,MAVE;AAWzB,4BAA0B,IAXD;AAYzB,2BAAyB,KAZA;AAazB,mCAAiC,aAbR;AAczB,6BAA2B,OAdF;AAezB,iCAA+B,IAfN;AAgBzB,qCAAmC;AAhBV,CAAtB","sourcesContent":["export const settings: any = {\n \"editor.cursorShape\": \"line\",\n \"editor.fontFamily\": `'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace`,\n \"editor.fontSize\": 14,\n \"editor.reuseHeaders\": true,\n \"editor.theme\": \"dark\",\n \"general.betaUpdates\": false,\n \"prettier.printWidth\": 80,\n \"prettier.tabWidth\": 2,\n \"prettier.useTabs\": false,\n \"request.credentials\": \"omit\",\n \"schema.disableComments\": true,\n \"schema.polling.enable\": false,\n \"schema.polling.endpointFilter\": \"*localhost*\",\n \"schema.polling.interval\": 2000000,\n \"tracing.hideTracingResponse\": true,\n \"queryPlan.hideQueryPlanResponse\": true\n};\n"]}
1
+ {"version":3,"names":["settings"],"sources":["settings.ts"],"sourcesContent":["export const settings: any = {\n \"editor.cursorShape\": \"line\",\n \"editor.fontFamily\": `'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace`,\n \"editor.fontSize\": 14,\n \"editor.reuseHeaders\": true,\n \"editor.theme\": \"dark\",\n \"general.betaUpdates\": false,\n \"prettier.printWidth\": 80,\n \"prettier.tabWidth\": 2,\n \"prettier.useTabs\": false,\n \"request.credentials\": \"omit\",\n \"schema.disableComments\": true,\n \"schema.polling.enable\": false,\n \"schema.polling.endpointFilter\": \"*localhost*\",\n \"schema.polling.interval\": 2000000,\n \"tracing.hideTracingResponse\": true,\n \"queryPlan.hideQueryPlanResponse\": true\n};\n"],"mappings":";;;;;;AAAO,IAAMA,QAAa,GAAG;EACzB,sBAAsB,MADG;EAEzB,2GAFyB;EAGzB,mBAAmB,EAHM;EAIzB,uBAAuB,IAJE;EAKzB,gBAAgB,MALS;EAMzB,uBAAuB,KANE;EAOzB,uBAAuB,EAPE;EAQzB,qBAAqB,CARI;EASzB,oBAAoB,KATK;EAUzB,uBAAuB,MAVE;EAWzB,0BAA0B,IAXD;EAYzB,yBAAyB,KAZA;EAazB,iCAAiC,aAbR;EAczB,2BAA2B,OAdF;EAezB,+BAA+B,IAfN;EAgBzB,mCAAmC;AAhBV,CAAtB"}
package/types.js CHANGED
@@ -1 +1,5 @@
1
- export {};
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/types\";\nimport { SecurityIdentity } from \"@webiny/app-security/types\";\n\nexport interface GraphQLPlaygroundTabParams {\n locale: string;\n identity: SecurityIdentity;\n}\nexport interface GraphQLPlaygroundTab {\n name: string;\n endpoint: string;\n headers: Record<string, string>;\n query: string;\n}\n\nexport type GraphQLPlaygroundTabPlugin = Plugin<{\n type: \"graphql-playground-tab\";\n tab: (params: GraphQLPlaygroundTabParams) => GraphQLPlaygroundTab | null;\n}>;\n"],"mappings":""}