@webiny/app-graphql-playground 0.0.0-mt-2 → 0.0.0-unstable.06b2ede40f

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.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import type { ApolloClient } from "apollo-client";
3
+ interface CreateApolloClientParams {
4
+ uri: string;
5
+ }
6
+ interface GraphQLPlaygroundProps {
7
+ createApolloClient(params: CreateApolloClientParams): ApolloClient<any>;
8
+ }
9
+ export declare const GraphQLPlayground: React.MemoExoticComponent<({ createApolloClient }: GraphQLPlaygroundProps) => React.JSX.Element>;
10
+ export {};
package/index.js ADDED
@@ -0,0 +1,25 @@
1
+ import React, { memo } from "react";
2
+ import { plugins } from "@webiny/plugins";
3
+ import { AdminConfig, Layout } from "@webiny/app-admin";
4
+ import Playground from "./plugins/Playground";
5
+ import playgroundPlugins from "./plugins";
6
+ const {
7
+ Route
8
+ } = AdminConfig;
9
+ const GraphQLPlaygroundExtension = ({
10
+ createApolloClient
11
+ }) => {
12
+ plugins.register(playgroundPlugins);
13
+ return /*#__PURE__*/React.createElement(AdminConfig, null, /*#__PURE__*/React.createElement(Route, {
14
+ name: "apiPlayground",
15
+ path: "/api-playground",
16
+ element: /*#__PURE__*/React.createElement(Layout, {
17
+ title: "API Playground"
18
+ }, /*#__PURE__*/React.createElement(Playground, {
19
+ createApolloClient: createApolloClient
20
+ }))
21
+ }));
22
+ };
23
+ export const GraphQLPlayground = /*#__PURE__*/memo(GraphQLPlaygroundExtension);
24
+
25
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","memo","plugins","AdminConfig","Layout","Playground","playgroundPlugins","Route","GraphQLPlaygroundExtension","createApolloClient","register","createElement","name","path","element","title","GraphQLPlayground"],"sources":["index.tsx"],"sourcesContent":["import React, { memo } from \"react\";\nimport type { ApolloClient } from \"apollo-client\";\nimport { plugins } from \"@webiny/plugins\";\nimport { AdminConfig, Layout } from \"@webiny/app-admin\";\nimport Playground from \"./plugins/Playground\";\nimport playgroundPlugins from \"./plugins\";\n\nconst { Route } = AdminConfig;\n\ninterface CreateApolloClientParams {\n uri: string;\n}\n\ninterface GraphQLPlaygroundProps {\n createApolloClient(params: CreateApolloClientParams): ApolloClient<any>;\n}\n\nconst GraphQLPlaygroundExtension = ({ createApolloClient }: GraphQLPlaygroundProps) => {\n plugins.register(playgroundPlugins);\n\n return (\n <AdminConfig>\n <Route\n name={\"apiPlayground\"}\n path={\"/api-playground\"}\n element={\n <Layout title={\"API Playground\"}>\n <Playground createApolloClient={createApolloClient} />\n </Layout>\n }\n />\n </AdminConfig>\n );\n};\n\nexport const GraphQLPlayground = memo(GraphQLPlaygroundExtension);\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AAEnC,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,WAAW,EAAEC,MAAM,QAAQ,mBAAmB;AACvD,OAAOC,UAAU;AACjB,OAAOC,iBAAiB;AAExB,MAAM;EAAEC;AAAM,CAAC,GAAGJ,WAAW;AAU7B,MAAMK,0BAA0B,GAAGA,CAAC;EAAEC;AAA2C,CAAC,KAAK;EACnFP,OAAO,CAACQ,QAAQ,CAACJ,iBAAiB,CAAC;EAEnC,oBACIN,KAAA,CAAAW,aAAA,CAACR,WAAW,qBACRH,KAAA,CAAAW,aAAA,CAACJ,KAAK;IACFK,IAAI,EAAE,eAAgB;IACtBC,IAAI,EAAE,iBAAkB;IACxBC,OAAO,eACHd,KAAA,CAAAW,aAAA,CAACP,MAAM;MAACW,KAAK,EAAE;IAAiB,gBAC5Bf,KAAA,CAAAW,aAAA,CAACN,UAAU;MAACI,kBAAkB,EAAEA;IAAmB,CAAE,CACjD;EACX,CACJ,CACQ,CAAC;AAEtB,CAAC;AAED,OAAO,MAAMO,iBAAiB,gBAAGf,IAAI,CAACO,0BAA0B,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-graphql-playground",
3
- "version": "0.0.0-mt-2",
3
+ "version": "0.0.0-unstable.06b2ede40f",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,53 +9,38 @@
9
9
  "author": "Webiny Ltd",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@emotion/core": "10.1.1",
13
- "@emotion/styled": "10.0.27",
14
- "@webiny/app": "0.0.0-mt-2",
15
- "@webiny/app-admin": "0.0.0-mt-2",
16
- "@webiny/app-i18n": "0.0.0-mt-2",
17
- "@webiny/app-security": "0.0.0-mt-2",
18
- "@webiny/plugins": "0.0.0-mt-2",
19
- "@webiny/react-router": "0.0.0-mt-2",
20
- "@webiny/ui": "0.0.0-mt-2",
12
+ "@emotion/react": "11.10.8",
13
+ "@emotion/styled": "11.10.6",
14
+ "@webiny/app": "0.0.0-unstable.06b2ede40f",
15
+ "@webiny/app-admin": "0.0.0-unstable.06b2ede40f",
16
+ "@webiny/app-i18n": "0.0.0-unstable.06b2ede40f",
17
+ "@webiny/app-security": "0.0.0-unstable.06b2ede40f",
18
+ "@webiny/plugins": "0.0.0-unstable.06b2ede40f",
19
+ "@webiny/ui": "0.0.0-unstable.06b2ede40f",
21
20
  "apollo-cache": "1.3.5",
22
21
  "apollo-client": "2.6.10",
23
22
  "apollo-link": "1.2.14",
24
23
  "apollo-link-context": "1.0.20",
25
24
  "apollo-utilities": "1.3.4",
26
- "graphql": "14.7.0",
25
+ "graphql": "15.9.0",
27
26
  "load-script": "1.0.0",
28
- "prop-types": "15.7.2",
29
- "react": "16.14.0",
30
- "react-dom": "16.14.0",
31
- "react-helmet": "5.2.1"
27
+ "prop-types": "15.8.1",
28
+ "react": "18.2.0",
29
+ "react-dom": "18.2.0"
32
30
  },
33
31
  "devDependencies": {
34
- "@babel/cli": "^7.5.5",
35
- "@babel/core": "^7.5.5",
36
- "@babel/plugin-proposal-class-properties": "^7.5.5",
37
- "@babel/preset-env": "^7.5.5",
38
- "@babel/preset-react": "^7.0.0",
39
- "@babel/preset-typescript": "^7.8.3",
40
- "@webiny/cli": "^0.0.0-mt-2",
41
- "@webiny/project-utils": "^0.0.0-mt-2",
42
- "babel-plugin-emotion": "^9.2.8",
43
- "babel-plugin-lodash": "^3.3.4",
44
- "rimraf": "^3.0.2",
45
- "typescript": "^4.1.3"
32
+ "@emotion/babel-plugin": "11.11.0",
33
+ "@webiny/project-utils": "0.0.0-unstable.06b2ede40f",
34
+ "rimraf": "6.0.1",
35
+ "typescript": "5.3.3"
46
36
  },
47
37
  "publishConfig": {
48
38
  "access": "public",
49
39
  "directory": "dist"
50
40
  },
51
41
  "scripts": {
52
- "build": "yarn webiny run build",
53
- "watch": "yarn webiny run watch"
54
- },
55
- "svgo": {
56
- "plugins": {
57
- "removeViewBox": false
58
- }
42
+ "build": "node ../cli/bin.js run build",
43
+ "watch": "node ../cli/bin.js run watch"
59
44
  },
60
45
  "adio": {
61
46
  "ignore": {
@@ -67,5 +52,5 @@
67
52
  ]
68
53
  }
69
54
  },
70
- "gitHead": "3c0dcfb3c22c9f83107fdb97b25014cd03d9db7d"
55
+ "gitHead": "06b2ede40fc2212a70eeafd74afd50b56fb0ce82"
71
56
  }
@@ -1,5 +1,10 @@
1
- /// <reference types="react" />
2
- declare const Playground: ({ createApolloClient }: {
3
- createApolloClient: any;
4
- }) => JSX.Element;
1
+ import React from "react";
2
+ import type ApolloClient from "apollo-client";
3
+ interface CreateApolloClientParams {
4
+ uri: string;
5
+ }
6
+ interface PlaygroundProps {
7
+ createApolloClient: (params: CreateApolloClientParams) => ApolloClient<any>;
8
+ }
9
+ declare const Playground: ({ createApolloClient }: PlaygroundProps) => React.JSX.Element;
5
10
  export default Playground;
@@ -1,110 +1,93 @@
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
1
  import React, { Fragment, useEffect, useRef, useCallback, useState } from "react";
6
2
  import { ApolloLink } from "apollo-link";
7
3
  import { setContext } from "apollo-link-context";
4
+ /**
5
+ * Package load-script does not have types.
6
+ */
7
+ // @ts-expect-error
8
8
  import loadScript from "load-script";
9
- import { Global } from "@emotion/core";
9
+ import { Global } from "@emotion/react";
10
10
  import { plugins } from "@webiny/plugins";
11
11
  import { useI18N } from "@webiny/app-i18n/hooks/useI18N";
12
12
  import { useSecurity } from "@webiny/app-security";
13
13
  import { CircularProgress } from "@webiny/ui/Progress";
14
14
  import { playgroundDialog, PlaygroundContainer } from "./Playground.styles";
15
15
  import { settings } from "./settings";
16
-
17
- var withHeaders = function withHeaders(link, headers) {
18
- return ApolloLink.from([setContext( /*#__PURE__*/function () {
19
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_, req) {
20
- return _regeneratorRuntime.wrap(function _callee$(_context) {
21
- while (1) {
22
- switch (_context.prev = _context.next) {
23
- case 0:
24
- return _context.abrupt("return", {
25
- headers: _objectSpread(_objectSpread({}, req.headers), headers)
26
- });
27
-
28
- case 1:
29
- case "end":
30
- return _context.stop();
31
- }
32
- }
33
- }, _callee);
34
- }));
35
-
36
- return function (_x, _x2) {
37
- return _ref.apply(this, arguments);
16
+ import { config as appConfig } from "@webiny/app/config";
17
+ import { ORIGINAL_GQL_PLAYGROUND_URL, PATCHED_GQL_PLAYGROUND_URL } from "./constants";
18
+ const withHeaders = (link, headers) => {
19
+ return ApolloLink.from([setContext(async (_, req) => {
20
+ return {
21
+ headers: {
22
+ ...req.headers,
23
+ ...headers
24
+ }
38
25
  };
39
- }()), link]);
26
+ }), link]);
40
27
  };
41
-
42
- var initScripts = function initScripts() {
43
- return new Promise(function (resolve) {
44
- // @ts-ignore
28
+ const initScripts = () => {
29
+ return new Promise(resolve => {
30
+ // @ts-expect-error
45
31
  if (window.GraphQLPlayground) {
46
32
  return resolve();
47
33
  }
48
-
49
- return loadScript("https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js", resolve);
34
+ loadScript(PATCHED_GQL_PLAYGROUND_URL, err => {
35
+ if (err) {
36
+ return loadScript(ORIGINAL_GQL_PLAYGROUND_URL, resolve);
37
+ }
38
+ resolve();
39
+ });
50
40
  });
51
41
  };
52
-
53
- var Playground = function Playground(_ref2) {
54
- var createApolloClient = _ref2.createApolloClient;
55
-
56
- var _useState = useState(true),
57
- _useState2 = _slicedToArray(_useState, 2),
58
- loading = _useState2[0],
59
- setLoading = _useState2[1];
60
-
61
- var _useI18N = useI18N(),
62
- getCurrentLocale = _useI18N.getCurrentLocale;
63
-
64
- var _useSecurity = useSecurity(),
65
- identity = _useSecurity.identity;
66
-
67
- var links = useRef({});
68
- var locale = getCurrentLocale("content");
69
- var tabs = plugins.byType("graphql-playground-tab").map(function (pl) {
70
- return pl.tab({
71
- locale: locale,
72
- identity: identity
73
- });
74
- }).filter(Boolean);
75
- var createApolloLink = useCallback(function (_ref3) {
76
- var endpoint = _ref3.endpoint,
77
- headers = _ref3.headers;
78
-
42
+ const Playground = ({
43
+ createApolloClient
44
+ }) => {
45
+ const [loading, setLoading] = useState(true);
46
+ const {
47
+ getCurrentLocale
48
+ } = useI18N();
49
+ const {
50
+ identity
51
+ } = useSecurity();
52
+ const links = useRef({});
53
+ const locale = getCurrentLocale("content");
54
+ const tabs = plugins.byType("graphql-playground-tab").map(pl => pl.tab({
55
+ locale: locale,
56
+ identity: identity
57
+ })).filter(Boolean);
58
+ const createApolloLink = useCallback(({
59
+ endpoint,
60
+ headers
61
+ }) => {
62
+ const current = links.current;
79
63
  // If the request endpoint is not know to us, return the first available
80
- if (!endpoint.includes(process.env.REACT_APP_API_URL)) {
64
+ const apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
65
+ if (!endpoint.includes(apiUrl)) {
81
66
  return {
82
- link: withHeaders(Object.values(links.current)[0], headers)
67
+ link: withHeaders(Object.values(current)[0], headers)
83
68
  };
84
69
  }
85
-
86
- if (!links.current[endpoint]) {
87
- links.current[endpoint] = createApolloClient({
70
+ if (!current[endpoint]) {
71
+ current[endpoint] = createApolloClient({
88
72
  uri: endpoint
89
73
  }).link;
90
74
  }
91
-
92
75
  return {
93
- link: withHeaders(links.current[endpoint], headers)
76
+ link: withHeaders(current[endpoint], headers)
94
77
  };
95
78
  }, []);
96
- useEffect(function () {
97
- initScripts().then(function () {
79
+ useEffect(() => {
80
+ initScripts().then(() => {
98
81
  setLoading(false);
99
82
  });
100
83
  }, []);
101
- useEffect(function () {
84
+ useEffect(() => {
102
85
  if (!loading) {
103
- // @ts-ignore
86
+ // @ts-expect-error
104
87
  window.GraphQLPlayground.init(document.getElementById("graphql-playground"), {
105
- tabs: tabs,
106
- createApolloLink: createApolloLink,
107
- settings: settings
88
+ tabs,
89
+ createApolloLink,
90
+ settings
108
91
  });
109
92
  }
110
93
  }, [loading]);
@@ -116,5 +99,6 @@ var Playground = function Playground(_ref2) {
116
99
  styles: playgroundDialog
117
100
  }));
118
101
  };
102
+ export default Playground;
119
103
 
120
- export default Playground;
104
+ //# sourceMappingURL=Playground.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Fragment","useEffect","useRef","useCallback","useState","ApolloLink","setContext","loadScript","Global","plugins","useI18N","useSecurity","CircularProgress","playgroundDialog","PlaygroundContainer","settings","config","appConfig","ORIGINAL_GQL_PLAYGROUND_URL","PATCHED_GQL_PLAYGROUND_URL","withHeaders","link","headers","from","_","req","initScripts","Promise","resolve","window","GraphQLPlayground","err","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","createElement","label","id","styles"],"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-expect-error\nimport loadScript from \"load-script\";\nimport { Global } from \"@emotion/react\";\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 type ApolloClient from \"apollo-client\";\nimport type { GraphQLPlaygroundTabPlugin } from \"~/types\";\nimport type { SecurityIdentity } from \"@webiny/app-security/types\";\nimport { ORIGINAL_GQL_PLAYGROUND_URL, PATCHED_GQL_PLAYGROUND_URL } from \"./constants\";\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-expect-error\n if (window.GraphQLPlayground) {\n return resolve();\n }\n\n loadScript(PATCHED_GQL_PLAYGROUND_URL, (err: Error) => {\n if (err) {\n return loadScript(ORIGINAL_GQL_PLAYGROUND_URL, resolve);\n }\n\n resolve();\n });\n });\n};\n\ninterface CreateApolloClientParams {\n uri: string;\n}\n\ninterface PlaygroundProps {\n createApolloClient: (params: CreateApolloClientParams) => ApolloClient<any>;\n}\n\ninterface CreateApolloLinkCallableParams {\n endpoint: string;\n headers: Record<string, string>;\n}\n\ninterface CreateApolloLinkCallableResult {\n link: ApolloLink;\n}\n\ninterface CreateApolloLinkCallable {\n (params: CreateApolloLinkCallableParams): CreateApolloLinkCallableResult;\n}\n\nconst Playground = ({ createApolloClient }: PlaygroundProps) => {\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<CreateApolloLinkCallable>(({ 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) as string;\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-expect-error\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,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACjF,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,UAAU,QAAQ,qBAAqB;AAChD;AACA;AACA;AACA;AACA,OAAOC,UAAU,MAAM,aAAa;AACpC,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,OAAO,QAAQ,gCAAgC;AACxD,SAASC,WAAW,QAAQ,sBAAsB;AAClD,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,gBAAg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AChBhC;MACJ,CAAC,CAAC;IACN;EACJ,CAAC,EAAE,CAACmB,OAAO,CAAC,CAAC;EAEb,oBACInC,KAAA,CAAAgE,aAAA,CAAC/D,QAAQ,QACJkC,OAAO,gBACJnC,KAAA,CAAAgE,aAAA,CAACnD,gBAAgB;IAACoD,KAAK,EAAE;EAAwB,CAAE,CAAC,gBAEpDjE,KAAA,CAAAgE,aAAA,CAACjD,mBAAmB;IAACmD,EAAE,EAAE;EAAqB,CAAE,CACnD,eACDlE,KAAA,CAAAgE,aAAA,CAACvD,MAAM;IAAC0D,MAAM,EAAErD;EAAiB,CAAE,CAC7B,CAAC;AAEnB,CAAC;AAED,eAAemB,UAAU","ignoreList":[]}
@@ -1,5 +1,8 @@
1
1
  /// <reference types="react" />
2
- export declare const PlaygroundContainer: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "hidden" | "dir" | "slot" | "style" | "title" | "color" | "translate" | "children" | "defaultValue" | "id" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css">, object>;
2
+ export declare const PlaygroundContainer: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
3
6
  export declare const playgroundDialog: {
4
7
  ".ReactModalPortal": {
5
8
  "p, a, h1, h2, h3, h4, ul, pre, code": {
@@ -1,6 +1,5 @@
1
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
- import styled from "@emotion/styled";
3
- var sharedStyles = {
1
+ import _styled from "@emotion/styled/base";
2
+ const sharedStyles = {
4
3
  "p, a, h1, h2, h3, h4, ul, pre, code": {
5
4
  margin: 0,
6
5
  padding: 0,
@@ -19,14 +18,16 @@ var sharedStyles = {
19
18
  fontFamily: "Consolas, monospace"
20
19
  }
21
20
  };
22
- export var PlaygroundContainer = /*#__PURE__*/styled("div", {
21
+ export const PlaygroundContainer = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
22
+ target: "e1o47c380"
23
+ } : {
23
24
  target: "e1o47c380",
24
25
  label: "PlaygroundContainer"
25
26
  })({
26
27
  marginTop: -3,
27
28
  overflow: "hidden",
28
- ".playground": _objectSpread({
29
- height: "calc(100vh - 64px)",
29
+ ".playground": {
30
+ height: "calc(100vh - 45px)",
30
31
  margin: 0,
31
32
  padding: 0,
32
33
  fontFamily: "'Open Sans', sans-serif",
@@ -35,9 +36,12 @@ export var PlaygroundContainer = /*#__PURE__*/styled("div", {
35
36
  color: "rgba(0,0,0,.8)",
36
37
  lineHeight: 1.5,
37
38
  letterSpacing: 0.53,
38
- marginRight: "-1px !important"
39
- }, sharedStyles)
40
- });
41
- export var playgroundDialog = {
39
+ marginRight: "-1px !important",
40
+ ...sharedStyles
41
+ }
42
+ }, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBsYXlncm91bmQuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNCbUMiLCJmaWxlIjoiUGxheWdyb3VuZC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkI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c2NhbGVcIixcbiAgICAgICAgY29sb3I6IFwicmdiYSgwLDAsMCwuOClcIixcbiAgICAgICAgbGluZUhlaWdodDogMS41LFxuICAgICAgICBsZXR0ZXJTcGFjaW5nOiAwLjUzLFxuICAgICAgICBtYXJnaW5SaWdodDogXCItMXB4ICFpbXBvcnRhbnRcIixcbiAgICAgICAgLi4uc2hhcmVkU3R5bGVzXG4gICAgfVxufSk7XG5cbmV4cG9ydCBjb25zdCBwbGF5Z3JvdW5kRGlhbG9nID0ge1xuICAgIFwiLlJlYWN0TW9kYWxQb3J0YWxcIjogc2hhcmVkU3R5bGVzXG59O1xuIl19 */");
43
+ export const playgroundDialog = {
42
44
  ".ReactModalPortal": sharedStyles
43
- };
45
+ };
46
+
47
+ //# sourceMappingURL=Playground.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sharedStyles","margin","padding","color","outline","border","fontFamily","code","PlaygroundContainer","_styled","process","env","NODE_ENV","target","label","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 - 45px)\",\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":";AAEA,MAAMA,YAAY,GAAG;EACjB,qCAAqC,EAAE;IACnCC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE,CAAC;IACVC,KAAK,EAAE;EACX,CAAC;EACD,8CAA8C,EAAE;IAC5CC,OAAO,EAAE;EACb,CAAC;EACD,uBAAuB,EAAE;IACrBC,MAAM,EAAE;EACZ,CAAC;EACD,oBAAoB,EAAE;IAClBC,UAAU,EAAE;EAChB,CAAC;EACDC,IAAI,EAAE;IACFD,UAAU,EAAE;EAChB;AACJ,CAAC;AAED,OAAO,MAAME,mBAAmB,gBAAGC,OAAA,CAAO,KAAK,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAC;EAC7CC,SAAS,EAAE,CAAC,CAAC;EACbC,QAAQ,EAAE,QAAQ;EAClB,aAAa,EAAE;IACXC,MAAM,EAAE,oBAAoB;IAC5BhB,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE,CAAC;IACVI,UAAU,EAAE,yBAAyB;IACrCY,mBAAmB,EAAE,aAAa;IAClCC,mBAAmB,EAAE,WAAW;IAChChB,KAAK,EAAE,gBAAgB;IACvBiB,UAAU,EAAE,GAAG;IACfC,aAAa,EAAE,IAAI;IACnBC,WAAW,EAAE,iBAAiB;IAC9B,GAAGtB;EACP;AACJ,CAAC,EAAAU,OAAA,CAAAC,GAAA,CAAAC,QAAA,2tDAAC;AAEF,OAAO,MAAMW,gBAAgB,GAAG;EAC5B,mBAAmB,EAAEvB;AACzB,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export declare const ORIGINAL_GQL_PLAYGROUND_URL = "https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js";
2
+ export declare const PATCHED_GQL_PLAYGROUND_URL = "https://webiny-public.s3.us-east-2.amazonaws.com/project-scripts/gql-playground-mw-1.7.42-patched.js";
@@ -0,0 +1,4 @@
1
+ export const ORIGINAL_GQL_PLAYGROUND_URL = "https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js";
2
+ export const PATCHED_GQL_PLAYGROUND_URL = "https://webiny-public.s3.us-east-2.amazonaws.com/project-scripts/gql-playground-mw-1.7.42-patched.js";
3
+
4
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ORIGINAL_GQL_PLAYGROUND_URL","PATCHED_GQL_PLAYGROUND_URL"],"sources":["constants.ts"],"sourcesContent":["export const ORIGINAL_GQL_PLAYGROUND_URL =\n \"https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js\";\n\nexport const PATCHED_GQL_PLAYGROUND_URL =\n \"https://webiny-public.s3.us-east-2.amazonaws.com/project-scripts/gql-playground-mw-1.7.42-patched.js\";\n"],"mappings":"AAAA,OAAO,MAAMA,2BAA2B,GACpC,2GAA2G;AAE/G,OAAO,MAAMC,0BAA0B,GACnC,sGAAsG","ignoreList":[]}
@@ -1,17 +1,3 @@
1
- import ApolloClient from "apollo-client";
2
- import { RoutePlugin } from "@webiny/app/types";
3
- import { UIViewPlugin } from "@webiny/app-admin/ui/UIView";
4
- import { NavigationView } from "@webiny/app-admin/ui/views/NavigationView";
5
- declare type GraphQLPlaygroundOptions = {
6
- createApolloClient(params: {
7
- uri: string;
8
- }): ApolloClient<any>;
9
- };
10
- declare const _default: (options: GraphQLPlaygroundOptions) => (RoutePlugin | import("@webiny/plugins/types").Plugin<{
11
- type: "graphql-playground-tab";
12
- tab(params: {
13
- locale: string;
14
- identity: import("@webiny/app-security/types").SecurityIdentity;
15
- }): import("../types").GraphQLPlaygroundTab;
16
- }> | UIViewPlugin<NavigationView>)[];
1
+ import type { GraphQLPlaygroundTabPlugin } from "../types";
2
+ declare const _default: GraphQLPlaygroundTabPlugin[];
17
3
  export default _default;
package/plugins/index.js CHANGED
@@ -1,46 +1,18 @@
1
- import React from "react";
2
- import Helmet from "react-helmet";
3
- import { Route } from "@webiny/react-router";
4
- import { AdminLayout } from "@webiny/app-admin/components/AdminLayout";
5
- import { ReactComponent as InfoIcon } from "@svgr/webpack!./graphql.svg";
6
- import Playground from "./Playground";
7
- // @ts-ignore
1
+ // @ts-expect-error
8
2
  import placeholder from "!!raw-loader!./placeholder.graphql";
9
- import { NavigationMenuElement } from "@webiny/app-admin/ui/elements/NavigationMenuElement";
10
- import { UIViewPlugin } from "@webiny/app-admin/ui/UIView";
11
- import { NavigationView } from "@webiny/app-admin/ui/views/NavigationView";
12
- // @ts-ignore
13
- export default (function (options) {
14
- return [new UIViewPlugin(NavigationView, function (view) {
15
- view.getFooterElement().addMenuElement(new NavigationMenuElement("apiPlayground", {
16
- label: "API Playground",
17
- icon: /*#__PURE__*/React.createElement(InfoIcon, null),
18
- path: "/api-playground",
19
- onClick: function onClick() {
20
- view.getNavigationHook().hideMenu();
21
- }
22
- }));
23
- }), {
24
- name: "route-api-playground",
25
- type: "route",
26
- route: /*#__PURE__*/React.createElement(Route, {
27
- exact: true,
28
- path: "/api-playground",
29
- render: function render() {
30
- return /*#__PURE__*/React.createElement(AdminLayout, null, /*#__PURE__*/React.createElement(Helmet, null, /*#__PURE__*/React.createElement("title", null, "API Playground")), /*#__PURE__*/React.createElement(Playground, {
31
- createApolloClient: options.createApolloClient
32
- }));
33
- }
34
- })
35
- }, {
36
- type: "graphql-playground-tab",
37
- tab: function tab() {
38
- return {
39
- name: "Main API",
40
- endpoint: process.env.REACT_APP_API_URL + "/graphql",
41
- headers: {},
42
- query: placeholder
43
- };
44
- }
45
- }];
46
- });
3
+ import { config as appConfig } from "@webiny/app/config";
4
+ const plugin = {
5
+ type: "graphql-playground-tab",
6
+ tab() {
7
+ const apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
8
+ return {
9
+ name: "Main API",
10
+ endpoint: apiUrl + "/graphql",
11
+ headers: {},
12
+ query: placeholder
13
+ };
14
+ }
15
+ };
16
+ export default [plugin];
17
+
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["placeholder","config","appConfig","plugin","type","tab","apiUrl","getKey","process","env","REACT_APP_API_URL","name","endpoint","headers","query"],"sources":["index.tsx"],"sourcesContent":["import type { GraphQLPlaygroundTabPlugin } from \"~/types\";\n// @ts-expect-error\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":"AACA;AACA,OAAOA,WAAW,MAAM,oCAAoC;AAC5D,SAASC,MAAM,IAAIC,SAAS,QAAQ,oBAAoB;AAExD,MAAMC,MAAkC,GAAG;EACvCC,IAAI,EAAE,wBAAwB;EAC9BC,GAAGA,CAAA,EAAG;IACF,MAAMC,MAAM,GAAGJ,SAAS,CAACK,MAAM,CAAC,SAAS,EAAEC,OAAO,CAACC,GAAG,CAACC,iBAAiB,CAAW;IACnF,OAAO;MACHC,IAAI,EAAE,UAAU;MAChBC,QAAQ,EAAEN,MAAM,GAAG,UAAU;MAC7BO,OAAO,EAAE,CAAC,CAAC;MACXC,KAAK,EAAEd;IACX,CAAC;EACL;AACJ,CAAC;AACD,eAAe,CAACG,MAAM,CAAC","ignoreList":[]}
@@ -1,6 +1,6 @@
1
- export var settings = {
1
+ export const settings = {
2
2
  "editor.cursorShape": "line",
3
- "editor.fontFamily": "'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace",
3
+ "editor.fontFamily": `'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace`,
4
4
  "editor.fontSize": 14,
5
5
  "editor.reuseHeaders": true,
6
6
  "editor.theme": "dark",
@@ -15,4 +15,6 @@ export var settings = {
15
15
  "schema.polling.interval": 2000000,
16
16
  "tracing.hideTracingResponse": true,
17
17
  "queryPlan.hideQueryPlanResponse": true
18
- };
18
+ };
19
+
20
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
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":"AAAA,OAAO,MAAMA,QAAa,GAAG;EACzB,oBAAoB,EAAE,MAAM;EAC5B,mBAAmB,EAAE,sFAAsF;EAC3G,iBAAiB,EAAE,EAAE;EACrB,qBAAqB,EAAE,IAAI;EAC3B,cAAc,EAAE,MAAM;EACtB,qBAAqB,EAAE,KAAK;EAC5B,qBAAqB,EAAE,EAAE;EACzB,mBAAmB,EAAE,CAAC;EACtB,kBAAkB,EAAE,KAAK;EACzB,qBAAqB,EAAE,MAAM;EAC7B,wBAAwB,EAAE,IAAI;EAC9B,uBAAuB,EAAE,KAAK;EAC9B,+BAA+B,EAAE,aAAa;EAC9C,yBAAyB,EAAE,OAAO;EAClC,6BAA6B,EAAE,IAAI;EACnC,iCAAiC,EAAE;AACvC,CAAC","ignoreList":[]}
package/types.d.ts CHANGED
@@ -1,15 +1,16 @@
1
- import { Plugin } from "@webiny/plugins/types";
2
- import { SecurityIdentity } from "@webiny/app-security/types";
3
- export declare type GraphQLPlaygroundTab = {
1
+ import type { Plugin } from "@webiny/plugins/types";
2
+ import type { SecurityIdentity } from "@webiny/app-security/types";
3
+ export interface GraphQLPlaygroundTabParams {
4
+ locale: string;
5
+ identity: SecurityIdentity;
6
+ }
7
+ export interface GraphQLPlaygroundTab {
4
8
  name: string;
5
9
  endpoint: string;
6
10
  headers: Record<string, string>;
7
11
  query: string;
8
- };
9
- export declare type GraphQLPlaygroundTabPlugin = Plugin<{
12
+ }
13
+ export type GraphQLPlaygroundTabPlugin = Plugin<{
10
14
  type: "graphql-playground-tab";
11
- tab(params: {
12
- locale: string;
13
- identity: SecurityIdentity;
14
- }): GraphQLPlaygroundTab;
15
+ tab: (params: GraphQLPlaygroundTabParams) => GraphQLPlaygroundTab | null;
15
16
  }>;
package/types.js CHANGED
@@ -1 +1,3 @@
1
- export {};
1
+ export {};
2
+
3
+ //# sourceMappingURL=types.js.map
package/types.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { Plugin } from \"@webiny/plugins/types\";\nimport type { 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":"","ignoreList":[]}
File without changes