@webiny/app-graphql-playground 5.34.8 → 5.35.0-beta.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 +0 -12
- package/index.js.map +1 -1
- package/package.json +12 -12
- package/plugins/Playground.js +19 -54
- package/plugins/Playground.js.map +1 -1
- package/plugins/Playground.styles.d.ts +5 -2
- package/plugins/Playground.styles.js +0 -4
- package/plugins/Playground.styles.js.map +1 -1
- package/plugins/index.js +1 -5
- package/plugins/index.js.map +1 -1
- package/plugins/settings.js.map +1 -1
package/index.js
CHANGED
|
@@ -1,31 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.GraphQLPlayground = void 0;
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
10
|
var _plugins = require("@webiny/plugins");
|
|
15
|
-
|
|
16
11
|
var _appAdmin = require("@webiny/app-admin");
|
|
17
|
-
|
|
18
12
|
var _graphql = require("./assets/graphql.svg");
|
|
19
|
-
|
|
20
13
|
var _Playground = _interopRequireDefault(require("./plugins/Playground"));
|
|
21
|
-
|
|
22
14
|
var _plugins2 = _interopRequireDefault(require("./plugins"));
|
|
23
|
-
|
|
24
15
|
var GraphQLPlaygroundExtension = function GraphQLPlaygroundExtension(_ref) {
|
|
25
16
|
var createApolloClient = _ref.createApolloClient;
|
|
26
|
-
|
|
27
17
|
_plugins.plugins.register(_plugins2.default);
|
|
28
|
-
|
|
29
18
|
return /*#__PURE__*/_react.default.createElement(_appAdmin.Plugins, null, /*#__PURE__*/_react.default.createElement(_appAdmin.AddMenu, {
|
|
30
19
|
name: "apiPlayground",
|
|
31
20
|
label: "API Playground",
|
|
@@ -41,6 +30,5 @@ var GraphQLPlaygroundExtension = function GraphQLPlaygroundExtension(_ref) {
|
|
|
41
30
|
createApolloClient: createApolloClient
|
|
42
31
|
}))));
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
var GraphQLPlayground = /*#__PURE__*/(0, _react.memo)(GraphQLPlaygroundExtension);
|
|
46
34
|
exports.GraphQLPlayground = GraphQLPlayground;
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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,0BAA4D,OAA+B;EAAA,IAAzBC,kBAAkB,QAAlBA,kBAAkB;EACtFC,gBAAO,CAACC,QAAQ,CAACC,iBAAiB,CAAC;EAEnC,oBACI,6BAAC,iBAAO,qBACJ,6BAAC,iBAAO;IACJ,IAAI,EAAE,eAAgB;IACtB,KAAK,EAAE,gBAAiB;IACxB,IAAI,EAAE,iBAAkB;IACxB,IAAI,eAAE,6BAAC,uBAAQ,OAAI;IACnB,IAAI,EAAE,CAAC,QAAQ;EAAE,EACnB,eACF,6BAAC,kBAAQ;IAAC,KAAK;IAAC,IAAI,EAAE;EAAkB,gBACpC,6BAAC,gBAAM;IAAC,KAAK,EAAE;EAAiB,gBAC5B,6BAAC,mBAAU;IAAC,kBAAkB,EAAEH;EAAmB,EAAG,CACjD,CACF,CACL;AAElB,CAAC;AAEM,IAAMI,iBAAiB,gBAAG,IAAAC,WAAI,EAACN,0BAA0B,CAAC;AAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-graphql-playground",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.35.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"author": "Webiny Ltd",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@emotion/
|
|
13
|
-
"@emotion/styled": "10.
|
|
14
|
-
"@webiny/app": "5.
|
|
15
|
-
"@webiny/app-admin": "5.
|
|
16
|
-
"@webiny/app-i18n": "5.
|
|
17
|
-
"@webiny/app-security": "5.
|
|
18
|
-
"@webiny/plugins": "5.
|
|
19
|
-
"@webiny/ui": "5.
|
|
12
|
+
"@emotion/react": "11.10.6",
|
|
13
|
+
"@emotion/styled": "11.10.6",
|
|
14
|
+
"@webiny/app": "5.35.0-beta.0",
|
|
15
|
+
"@webiny/app-admin": "5.35.0-beta.0",
|
|
16
|
+
"@webiny/app-i18n": "5.35.0-beta.0",
|
|
17
|
+
"@webiny/app-security": "5.35.0-beta.0",
|
|
18
|
+
"@webiny/plugins": "5.35.0-beta.0",
|
|
19
|
+
"@webiny/ui": "5.35.0-beta.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.19.4",
|
|
36
36
|
"@babel/preset-react": "^7.16.0",
|
|
37
37
|
"@babel/preset-typescript": "^7.18.6",
|
|
38
|
-
"@webiny/cli": "^5.
|
|
39
|
-
"@webiny/project-utils": "^5.
|
|
38
|
+
"@webiny/cli": "^5.35.0-beta.0",
|
|
39
|
+
"@webiny/project-utils": "^5.35.0-beta.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": "
|
|
63
|
+
"gitHead": "8acc9e8892842cabb3980ce0b6432fde55968d5b"
|
|
64
64
|
}
|
package/plugins/Playground.js
CHANGED
|
@@ -1,129 +1,95 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.default = void 0;
|
|
11
|
-
|
|
12
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
-
|
|
14
10
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
15
|
-
|
|
16
11
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
17
|
-
|
|
18
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
19
|
-
|
|
20
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
14
|
var _apolloLink = require("apollo-link");
|
|
23
|
-
|
|
24
15
|
var _apolloLinkContext = require("apollo-link-context");
|
|
25
|
-
|
|
26
16
|
var _loadScript = _interopRequireDefault(require("load-script"));
|
|
27
|
-
|
|
28
|
-
var _core = require("@emotion/core");
|
|
29
|
-
|
|
17
|
+
var _react2 = require("@emotion/react");
|
|
30
18
|
var _plugins = require("@webiny/plugins");
|
|
31
|
-
|
|
32
19
|
var _useI18N2 = require("@webiny/app-i18n/hooks/useI18N");
|
|
33
|
-
|
|
34
20
|
var _appSecurity = require("@webiny/app-security");
|
|
35
|
-
|
|
36
21
|
var _Progress = require("@webiny/ui/Progress");
|
|
37
|
-
|
|
38
22
|
var _Playground = require("./Playground.styles");
|
|
39
|
-
|
|
40
23
|
var _settings = require("./settings");
|
|
41
|
-
|
|
42
24
|
var _config = require("@webiny/app/config");
|
|
43
|
-
|
|
44
25
|
/**
|
|
45
26
|
* Package load-script does not have types.
|
|
46
27
|
*/
|
|
47
28
|
// @ts-ignore
|
|
29
|
+
|
|
48
30
|
var withHeaders = function withHeaders(link, headers) {
|
|
49
31
|
return _apolloLink.ApolloLink.from([(0, _apolloLinkContext.setContext)( /*#__PURE__*/function () {
|
|
50
32
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(_, req) {
|
|
51
33
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
52
|
-
while (1) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
case "end":
|
|
61
|
-
return _context.stop();
|
|
62
|
-
}
|
|
34
|
+
while (1) switch (_context.prev = _context.next) {
|
|
35
|
+
case 0:
|
|
36
|
+
return _context.abrupt("return", {
|
|
37
|
+
headers: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, req.headers), headers)
|
|
38
|
+
});
|
|
39
|
+
case 1:
|
|
40
|
+
case "end":
|
|
41
|
+
return _context.stop();
|
|
63
42
|
}
|
|
64
43
|
}, _callee);
|
|
65
44
|
}));
|
|
66
|
-
|
|
67
45
|
return function (_x, _x2) {
|
|
68
46
|
return _ref.apply(this, arguments);
|
|
69
47
|
};
|
|
70
48
|
}()), link]);
|
|
71
49
|
};
|
|
72
|
-
|
|
73
50
|
var initScripts = function initScripts() {
|
|
74
51
|
return new Promise(function (resolve) {
|
|
75
52
|
// @ts-ignore
|
|
76
53
|
if (window.GraphQLPlayground) {
|
|
77
54
|
return resolve();
|
|
78
55
|
}
|
|
79
|
-
|
|
80
56
|
return (0, _loadScript.default)("https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js", resolve);
|
|
81
57
|
});
|
|
82
58
|
};
|
|
83
|
-
|
|
84
59
|
var Playground = function Playground(_ref2) {
|
|
85
60
|
var createApolloClient = _ref2.createApolloClient;
|
|
86
|
-
|
|
87
61
|
var _useState = (0, _react.useState)(true),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
62
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
63
|
+
loading = _useState2[0],
|
|
64
|
+
setLoading = _useState2[1];
|
|
92
65
|
var _useI18N = (0, _useI18N2.useI18N)(),
|
|
93
|
-
|
|
94
|
-
|
|
66
|
+
getCurrentLocale = _useI18N.getCurrentLocale;
|
|
95
67
|
var _useSecurity = (0, _appSecurity.useSecurity)(),
|
|
96
|
-
|
|
97
|
-
|
|
68
|
+
identity = _useSecurity.identity;
|
|
98
69
|
var links = (0, _react.useRef)({});
|
|
99
70
|
var locale = getCurrentLocale("content");
|
|
100
|
-
|
|
101
71
|
var tabs = _plugins.plugins.byType("graphql-playground-tab").map(function (pl) {
|
|
102
72
|
return pl.tab({
|
|
103
73
|
locale: locale,
|
|
104
74
|
identity: identity
|
|
105
75
|
});
|
|
106
76
|
}).filter(Boolean);
|
|
107
|
-
|
|
108
77
|
var createApolloLink = (0, _react.useCallback)(function (_ref3) {
|
|
109
78
|
var endpoint = _ref3.endpoint,
|
|
110
|
-
|
|
111
|
-
var current = links.current;
|
|
112
|
-
|
|
79
|
+
headers = _ref3.headers;
|
|
80
|
+
var current = links.current;
|
|
81
|
+
// If the request endpoint is not know to us, return the first available
|
|
113
82
|
var apiUrl = _config.config.getKey("API_URL", process.env.REACT_APP_API_URL);
|
|
114
|
-
|
|
115
83
|
if (!endpoint.includes(apiUrl)) {
|
|
116
84
|
return {
|
|
117
85
|
link: withHeaders(Object.values(current)[0], headers)
|
|
118
86
|
};
|
|
119
87
|
}
|
|
120
|
-
|
|
121
88
|
if (!current[endpoint]) {
|
|
122
89
|
current[endpoint] = createApolloClient({
|
|
123
90
|
uri: endpoint
|
|
124
91
|
}).link;
|
|
125
92
|
}
|
|
126
|
-
|
|
127
93
|
return {
|
|
128
94
|
link: withHeaders(current[endpoint], headers)
|
|
129
95
|
};
|
|
@@ -147,10 +113,9 @@ var Playground = function Playground(_ref2) {
|
|
|
147
113
|
label: "Loading playground..."
|
|
148
114
|
}) : /*#__PURE__*/_react.default.createElement(_Playground.PlaygroundContainer, {
|
|
149
115
|
id: "graphql-playground"
|
|
150
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
116
|
+
}), /*#__PURE__*/_react.default.createElement(_react2.Global, {
|
|
151
117
|
styles: _Playground.playgroundDialog
|
|
152
118
|
}));
|
|
153
119
|
};
|
|
154
|
-
|
|
155
120
|
var _default = Playground;
|
|
156
121
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
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/
|
|
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/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 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,WAAW,CAAIC,IAAgB,EAAEC,OAA+B,EAAiB;EACnF,OAAOC,sBAAU,CAACC,IAAI,CAAC,CACnB,IAAAC,6BAAU;IAAA,kGAAC,iBAAOC,CAAC,EAAEC,GAAG;MAAA;QAAA;UAAA;YAAA,iCACb;cACHL,OAAO,8DACAK,GAAG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AAM,EAAEqC;EAAiB,EAAG,CAC7B;AAEnB,CAAC;AAAC,eAEaxC,UAAU;AAAA"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="web" />
|
|
3
2
|
/// <reference types="react" />
|
|
4
|
-
|
|
3
|
+
/// <reference types="web" />
|
|
4
|
+
export declare const PlaygroundContainer: import("@emotion/styled").StyledComponent<{
|
|
5
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
6
|
+
as?: import("react").ElementType<any> | undefined;
|
|
7
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
5
8
|
export declare const playgroundDialog: {
|
|
6
9
|
".ReactModalPortal": {
|
|
7
10
|
"p, a, h1, h2, h3, h4, ul, pre, code": {
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.playgroundDialog = exports.PlaygroundContainer = void 0;
|
|
9
|
-
|
|
10
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
9
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
13
|
-
|
|
14
10
|
var sharedStyles = {
|
|
15
11
|
"p, a, h1, h2, h3, h4, ul, pre, code": {
|
|
16
12
|
margin: 0,
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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,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;AAEM,IAAME,mBAAmB,oBAAGC,eAAM,EAAC,KAAK;EAAA;EAAA;AAAA,GAAE;EAC7CC,SAAS,EAAE,CAAC,CAAC;EACbC,QAAQ,EAAE,QAAQ;EAClB,aAAa;IACTC,MAAM,EAAE,oBAAoB;IAC5BX,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE,CAAC;IACVI,UAAU,EAAE,yBAAyB;IACrCO,mBAAmB,EAAE,aAAa;IAClCC,mBAAmB,EAAE,WAAW;IAChCX,KAAK,EAAE,gBAAgB;IACvBY,UAAU,EAAE,GAAG;IACfC,aAAa,EAAE,IAAI;IACnBC,WAAW,EAAE;EAAiB,GAC3BjB,YAAY;AAEvB,CAAC,CAAC;AAAC;AAEI,IAAMkB,gBAAgB,GAAG;EAC5B,mBAAmB,EAAElB;AACzB,CAAC;AAAC"}
|
package/plugins/index.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _placeholder = _interopRequireDefault(require("!!raw-loader!./placeholder.graphql"));
|
|
11
|
-
|
|
12
9
|
var _config = require("@webiny/app/config");
|
|
13
|
-
|
|
14
10
|
// @ts-ignore
|
|
11
|
+
|
|
15
12
|
var plugin = {
|
|
16
13
|
type: "graphql-playground-tab",
|
|
17
14
|
tab: function tab() {
|
|
18
15
|
var apiUrl = _config.config.getKey("API_URL", process.env.REACT_APP_API_URL);
|
|
19
|
-
|
|
20
16
|
return {
|
|
21
17
|
name: "Main API",
|
|
22
18
|
endpoint: apiUrl + "/graphql",
|
package/plugins/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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,wBAAwB;EAC9BC,GAAG,iBAAG;IACF,IAAMC,MAAM,GAAGC,cAAS,CAACC,MAAM,CAAC,SAAS,EAAEC,OAAO,CAACC,GAAG,CAACC,iBAAiB,CAAW;IACnF,OAAO;MACHC,IAAI,EAAE,UAAU;MAChBC,QAAQ,EAAEP,MAAM,GAAG,UAAU;MAC7BQ,OAAO,EAAE,CAAC,CAAC;MACXC,KAAK,EAAEC;IACX,CAAC;EACL;AACJ,CAAC;AAAC,eACa,CAACb,MAAM,CAAC;AAAA"}
|
package/plugins/settings.js.map
CHANGED
|
@@ -1 +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":";;;;;;AAAO,IAAMA,QAAa,GAAG;EACzB,
|
|
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,oBAAoB,EAAE,MAAM;EAC5B,mBAAmB,wFAAwF;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;AAAC"}
|