@webiny/app-graphql-playground 0.0.0-unstable.78f581c1d2 β†’ 0.0.0-unstable.7be00a75a9

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.
@@ -0,0 +1,15 @@
1
+ export declare const DEV_TOOLS_PERMISSIONS_SCHEMA: {
2
+ readonly prefix: "dev-tools";
3
+ readonly fullAccess: true;
4
+ readonly entities: [{
5
+ readonly id: "graphql-playground";
6
+ readonly title: "GraphQL Playground";
7
+ readonly permission: "dev-tools.graphql-playground.*";
8
+ readonly scopes: ["full"];
9
+ }, {
10
+ readonly id: "sdk-playground";
11
+ readonly title: "SDK Playground";
12
+ readonly permission: "dev-tools.sdk-playground.*";
13
+ readonly scopes: ["full"];
14
+ }];
15
+ };
@@ -0,0 +1,26 @@
1
+ import { createPermissionSchema } from "@webiny/app-admin";
2
+ const DEV_TOOLS_PERMISSIONS_SCHEMA = createPermissionSchema({
3
+ prefix: "dev-tools",
4
+ fullAccess: true,
5
+ entities: [
6
+ {
7
+ id: "graphql-playground",
8
+ title: "GraphQL Playground",
9
+ permission: "dev-tools.graphql-playground.*",
10
+ scopes: [
11
+ "full"
12
+ ]
13
+ },
14
+ {
15
+ id: "sdk-playground",
16
+ title: "SDK Playground",
17
+ permission: "dev-tools.sdk-playground.*",
18
+ scopes: [
19
+ "full"
20
+ ]
21
+ }
22
+ ]
23
+ });
24
+ export { DEV_TOOLS_PERMISSIONS_SCHEMA };
25
+
26
+ //# sourceMappingURL=PermissionsSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PermissionsSchema.js","sources":["../src/PermissionsSchema.ts"],"sourcesContent":["import { createPermissionSchema } from \"@webiny/app-admin\";\n\nexport const DEV_TOOLS_PERMISSIONS_SCHEMA = createPermissionSchema({\n prefix: \"dev-tools\",\n fullAccess: true,\n entities: [\n {\n id: \"graphql-playground\",\n title: \"GraphQL Playground\",\n permission: \"dev-tools.graphql-playground.*\",\n scopes: [\"full\"]\n },\n {\n id: \"sdk-playground\",\n title: \"SDK Playground\",\n permission: \"dev-tools.sdk-playground.*\",\n scopes: [\"full\"]\n }\n ]\n});\n"],"names":["DEV_TOOLS_PERMISSIONS_SCHEMA","createPermissionSchema"],"mappings":";AAEO,MAAMA,+BAA+BC,uBAAuB;IAC/D,QAAQ;IACR,YAAY;IACZ,UAAU;QACN;YACI,IAAI;YACJ,OAAO;YACP,YAAY;YACZ,QAAQ;gBAAC;aAAO;QACpB;QACA;YACI,IAAI;YACJ,OAAO;YACP,YAAY;YACZ,QAAQ;gBAAC;aAAO;QACpB;KACH;AACL"}
package/README.md CHANGED
@@ -1 +1,11 @@
1
1
  # @webiny/app-graphql-playground
2
+
3
+ > [!NOTE]
4
+ > This package is part of the [Webiny](https://www.webiny.com) monorepo.
5
+ > It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
6
+
7
+ πŸ“˜ **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
8
+
9
+ ---
10
+
11
+ _This README file is automatically generated during the publish process._
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const SecurityPermission: () => React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ import react from "react";
2
+ import { AdminConfig } from "@webiny/app-admin";
3
+ import { ReactComponent } from "@webiny/icons/developer_mode.svg";
4
+ import { DEV_TOOLS_PERMISSIONS_SCHEMA } from "./PermissionsSchema.js";
5
+ const { Security: Security } = AdminConfig;
6
+ const SecurityPermission = ()=>/*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(Security.Permissions, {
7
+ name: "dev-tools",
8
+ title: "Dev Tools",
9
+ description: "Manage Dev Tools access.",
10
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
11
+ schema: DEV_TOOLS_PERMISSIONS_SCHEMA
12
+ }));
13
+ export { SecurityPermission };
14
+
15
+ //# sourceMappingURL=SecurityPermission.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityPermission.js","sources":["../src/SecurityPermission.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"@webiny/app-admin\";\nimport { ReactComponent as DevToolsIcon } from \"@webiny/icons/developer_mode.svg\";\nimport { DEV_TOOLS_PERMISSIONS_SCHEMA } from \"./PermissionsSchema.js\";\n\nconst { Security } = AdminConfig;\n\nexport const SecurityPermission = () => {\n return (\n <AdminConfig>\n <Security.Permissions\n name=\"dev-tools\"\n title=\"Dev Tools\"\n description=\"Manage Dev Tools access.\"\n icon={<DevToolsIcon />}\n schema={DEV_TOOLS_PERMISSIONS_SCHEMA}\n />\n </AdminConfig>\n );\n};\n"],"names":["Security","AdminConfig","SecurityPermission","DevToolsIcon","DEV_TOOLS_PERMISSIONS_SCHEMA"],"mappings":";;;;AAKA,MAAM,EAAEA,UAAAA,QAAQ,EAAE,GAAGC;AAEd,MAAMC,qBAAqB,IACvB,WAAP,GACI,oBAACD,aAAWA,MAAAA,WAAAA,GACR,oBAACD,SAAS,WAAW;QACjB,MAAK;QACL,OAAM;QACN,aAAY;QACZ,oBAAM,oBAACG,gBAAYA;QACnB,QAAQC"}
@@ -0,0 +1,14 @@
1
+ import __rslib_svgr_url__0__ from "../static/svg/graphql.c5a8b511.svg";
2
+ import * as __rspack_external_react from "react";
3
+ const SvgGraphql = (props)=>/*#__PURE__*/ __rspack_external_react.createElement("svg", {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ viewBox: "0 0 24 24",
6
+ ...props
7
+ }, /*#__PURE__*/ __rspack_external_react.createElement("path", {
8
+ d: "m14.051 2.751 4.935 2.85a2.144 2.144 0 0 1 3.409.4 2.146 2.146 0 0 1-1.354 3.151v5.699a2.132 2.132 0 0 1 1.348 3.15 2.143 2.143 0 0 1-3.453.353l-4.905 2.832a2.14 2.14 0 1 1-4.171.678q0-.309.088-.609l-4.936-2.847a2.14 2.14 0 1 1-2.052-3.559l.001-5.699A2.14 2.14 0 0 1 1.604 6a2.143 2.143 0 0 1 3.407-.405l4.938-2.85A2.138 2.138 0 0 1 12 0a2.137 2.137 0 0 1 2.051 2.751m-.515.877a1 1 0 0 1-.058.058l6.461 11.19c.026-.009.056-.016.082-.023V9.146a2.135 2.135 0 0 1-1.558-2.588l.019-.072zm-3.015.059-.06-.06-4.946 2.852a2.136 2.136 0 0 1-1.461 2.645l-.076.021v5.708l.084.023 6.461-11.19zm2.076.507c-.39.112-.803.112-1.192 0l-6.46 11.189c.294.283.502.645.6 1.041h12.911c.097-.398.307-.761.603-1.044zm.986 16.227 4.913-2.838a2 2 0 0 1-.038-.142H5.542l-.021.083 4.939 2.852a2.13 2.13 0 0 1 1.54-.653c.627 0 1.19.269 1.583.698"
9
+ }));
10
+ const graphql = __rslib_svgr_url__0__;
11
+ export default graphql;
12
+ export { SvgGraphql as ReactComponent };
13
+
14
+ //# sourceMappingURL=graphql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assets/graphql.js","sources":["../../src/assets/graphql.svg"],"sourcesContent":["import * as React from \"react\";\nconst SvgGraphql = props => <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" {...props}><path d=\"m14.051 2.751 4.935 2.85a2.144 2.144 0 0 1 3.409.4 2.146 2.146 0 0 1-1.354 3.151v5.699a2.132 2.132 0 0 1 1.348 3.15 2.143 2.143 0 0 1-3.453.353l-4.905 2.832a2.14 2.14 0 1 1-4.171.678q0-.309.088-.609l-4.936-2.847a2.14 2.14 0 1 1-2.052-3.559l.001-5.699A2.14 2.14 0 0 1 1.604 6a2.143 2.143 0 0 1 3.407-.405l4.938-2.85A2.138 2.138 0 0 1 12 0a2.137 2.137 0 0 1 2.051 2.751m-.515.877a1 1 0 0 1-.058.058l6.461 11.19c.026-.009.056-.016.082-.023V9.146a2.135 2.135 0 0 1-1.558-2.588l.019-.072zm-3.015.059-.06-.06-4.946 2.852a2.136 2.136 0 0 1-1.461 2.645l-.076.021v5.708l.084.023 6.461-11.19zm2.076.507c-.39.112-.803.112-1.192 0l-6.46 11.189c.294.283.502.645.6 1.041h12.911c.097-.398.307-.761.603-1.044zm.986 16.227 4.913-2.838a2 2 0 0 1-.038-.142H5.542l-.021.083 4.939 2.852a2.13 2.13 0 0 1 1.54-.653c.627 0 1.19.269 1.583.698\" /></svg>;\nexport { SvgGraphql as ReactComponent };\nexport default \"__RSLIB_SVGR_AUTO_PUBLIC_PATH__static/svg/graphql.c5a8b511.svg\";"],"names":["SvgGraphql","props"],"mappings":";;AACA,MAAMA,aAAaC,CAAAA,QAAAA,WAAAA,GAAS,sCAAC;QAAI,OAAM;QAA6B,SAAQ;QAAa,GAAGA,KAAK;qBAAE,sCAAC;QAAK,GAAE;;AAE3G"}
package/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import React from "react";
2
- import { ApolloClient } from "apollo-client";
2
+ import type { ApolloClient } from "apollo-client";
3
3
  interface CreateApolloClientParams {
4
4
  uri: string;
5
5
  }
6
6
  interface GraphQLPlaygroundProps {
7
7
  createApolloClient(params: CreateApolloClientParams): ApolloClient<any>;
8
8
  }
9
- export declare const GraphQLPlayground: React.NamedExoticComponent<GraphQLPlaygroundProps>;
9
+ export declare const GraphQLPlayground: React.MemoExoticComponent<({ createApolloClient }: GraphQLPlaygroundProps) => React.JSX.Element>;
10
10
  export {};
package/index.js CHANGED
@@ -1,46 +1,53 @@
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"));
23
-
24
- var GraphQLPlaygroundExtension = function GraphQLPlaygroundExtension(_ref) {
25
- var createApolloClient = _ref.createApolloClient;
26
-
27
- _plugins.plugins.register(_plugins2.default);
28
-
29
- return /*#__PURE__*/_react.default.createElement(_appAdmin.Plugins, null, /*#__PURE__*/_react.default.createElement(_appAdmin.AddMenu, {
30
- name: "apiPlayground",
31
- label: "API Playground",
32
- path: "/api-playground",
33
- icon: /*#__PURE__*/_react.default.createElement(_graphql.ReactComponent, null),
34
- tags: ["footer"]
35
- }), /*#__PURE__*/_react.default.createElement(_appAdmin.AddRoute, {
36
- exact: true,
37
- path: "/api-playground"
38
- }, /*#__PURE__*/_react.default.createElement(_appAdmin.Layout, {
39
- title: "API Playground"
40
- }, /*#__PURE__*/_react.default.createElement(_Playground.default, {
41
- createApolloClient: createApolloClient
42
- }))));
1
+ import react, { memo } from "react";
2
+ import { plugins } from "@webiny/plugins";
3
+ import { AdminConfig, AdminLayout, HasPermission, useRouter } from "@webiny/app-admin";
4
+ import { ReactComponent } from "@webiny/icons/graphql_playground.svg";
5
+ import { ReactComponent as developer_mode_svg_ReactComponent } from "@webiny/icons/developer_mode.svg";
6
+ import Playground from "./plugins/Playground.js";
7
+ import plugins_0 from "./plugins/index.js";
8
+ import { SecurityPermission } from "./SecurityPermission.js";
9
+ import { Routes } from "./routes.js";
10
+ const { Route: Route, Menu: Menu } = AdminConfig;
11
+ const GraphQLPlaygroundExtension = ({ createApolloClient })=>{
12
+ const router = useRouter();
13
+ plugins.register(plugins_0);
14
+ return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(SecurityPermission, null), /*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(Menu, {
15
+ name: "dev-tools",
16
+ hideIfEmpty: true,
17
+ pin: "end",
18
+ element: /*#__PURE__*/ react.createElement(Menu.Item, {
19
+ text: "Dev Tools",
20
+ icon: /*#__PURE__*/ react.createElement(Menu.Item.Icon, {
21
+ label: "Dev Tools",
22
+ element: /*#__PURE__*/ react.createElement(developer_mode_svg_ReactComponent, null)
23
+ })
24
+ })
25
+ }), /*#__PURE__*/ react.createElement(HasPermission, {
26
+ any: [
27
+ "dev-tools.*",
28
+ "dev-tools.graphql-playground.*"
29
+ ]
30
+ }, /*#__PURE__*/ react.createElement(Menu, {
31
+ name: "dev-tools.graphql",
32
+ parent: "dev-tools",
33
+ element: /*#__PURE__*/ react.createElement(Menu.Link, {
34
+ text: "GraphQL Playground",
35
+ to: router.getLink(Routes.ApiPlayground),
36
+ icon: /*#__PURE__*/ react.createElement(Menu.Link.Icon, {
37
+ label: "GraphQL Playground",
38
+ element: /*#__PURE__*/ react.createElement(ReactComponent, null)
39
+ })
40
+ })
41
+ })), /*#__PURE__*/ react.createElement(Route, {
42
+ route: Routes.ApiPlayground,
43
+ element: /*#__PURE__*/ react.createElement(AdminLayout, {
44
+ title: "GraphQL Playground"
45
+ }, /*#__PURE__*/ react.createElement(Playground, {
46
+ createApolloClient: createApolloClient
47
+ }))
48
+ })));
43
49
  };
50
+ const GraphQLPlayground = /*#__PURE__*/ memo(GraphQLPlaygroundExtension);
51
+ export { GraphQLPlayground };
44
52
 
45
- var GraphQLPlayground = /*#__PURE__*/(0, _react.memo)(GraphQLPlaygroundExtension);
46
- exports.GraphQLPlayground = GraphQLPlayground;
53
+ //# sourceMappingURL=index.js.map
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":";;;;;;;;;;;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"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.tsx"],"sourcesContent":["import React, { memo } from \"react\";\nimport type { ApolloClient } from \"apollo-client\";\nimport { plugins } from \"@webiny/plugins\";\nimport { useRouter, AdminConfig, AdminLayout, HasPermission } from \"@webiny/app-admin\";\nimport { ReactComponent as ApiPlaygroundIcon } from \"@webiny/icons/graphql_playground.svg\";\nimport { ReactComponent as DevToolsIcon } from \"@webiny/icons/developer_mode.svg\";\nimport Playground from \"./plugins/Playground.js\";\nimport playgroundPlugins from \"./plugins/index.js\";\nimport { SecurityPermission } from \"./SecurityPermission.js\";\nimport { Routes } from \"~/routes.js\";\n\nconst { Route, Menu } = AdminConfig;\n\ninterface CreateApolloClientParams {\n uri: string;\n}\n\ninterface GraphQLPlaygroundProps {\n createApolloClient(params: CreateApolloClientParams): ApolloClient<any>;\n}\n\nconst GraphQLPlaygroundExtension = ({ createApolloClient }: GraphQLPlaygroundProps) => {\n const router = useRouter();\n plugins.register(playgroundPlugins);\n\n return (\n <>\n <SecurityPermission />\n <AdminConfig>\n <Menu\n name={\"dev-tools\"}\n hideIfEmpty={true}\n pin={\"end\"}\n element={\n <Menu.Item\n text={\"Dev Tools\"}\n icon={<Menu.Item.Icon label=\"Dev Tools\" element={<DevToolsIcon />} />}\n />\n }\n />\n <HasPermission any={[\"dev-tools.*\", \"dev-tools.graphql-playground.*\"]}>\n <Menu\n name={\"dev-tools.graphql\"}\n parent={\"dev-tools\"}\n element={\n <Menu.Link\n text={\"GraphQL Playground\"}\n to={router.getLink(Routes.ApiPlayground)}\n icon={\n <Menu.Link.Icon\n label=\"GraphQL Playground\"\n element={<ApiPlaygroundIcon />}\n />\n }\n />\n }\n />\n </HasPermission>\n\n <Route\n route={Routes.ApiPlayground}\n element={\n <AdminLayout title={\"GraphQL Playground\"}>\n <Playground createApolloClient={createApolloClient} />\n </AdminLayout>\n }\n />\n </AdminConfig>\n </>\n );\n};\n\nexport const GraphQLPlayground = memo(GraphQLPlaygroundExtension);\n"],"names":["Route","Menu","AdminConfig","GraphQLPlaygroundExtension","createApolloClient","router","useRouter","plugins","playgroundPlugins","SecurityPermission","DevToolsIcon","HasPermission","Routes","ApiPlaygroundIcon","AdminLayout","Playground","GraphQLPlayground","memo"],"mappings":";;;;;;;;;AAWA,MAAM,EAAEA,OAAAA,KAAK,EAAEC,MAAAA,IAAI,EAAE,GAAGC;AAUxB,MAAMC,6BAA6B,CAAC,EAAEC,kBAAkB,EAA0B;IAC9E,MAAMC,SAASC;IACfC,QAAQ,QAAQ,CAACC;IAEjB,OAAO,WAAP,GACI,wDACI,oBAACC,oBAAkBA,OAAAA,WAAAA,GACnB,oBAACP,aAAWA,MAAAA,WAAAA,GACR,oBAACD,MAAIA;QACD,MAAM;QACN,aAAa;QACb,KAAK;QACL,uBACI,oBAACA,KAAK,IAAI;YACN,MAAM;YACN,oBAAM,oBAACA,KAAK,IAAI,CAAC,IAAI;gBAAC,OAAM;gBAAY,uBAAS,oBAACS,mCAAYA;;;sBAI1E,oBAACC,eAAaA;QAAC,KAAK;YAAC;YAAe;SAAiC;qBACjE,oBAACV,MAAIA;QACD,MAAM;QACN,QAAQ;QACR,uBACI,oBAACA,KAAK,IAAI;YACN,MAAM;YACN,IAAII,OAAO,OAAO,CAACO,OAAO,aAAa;YACvC,oBACI,oBAACX,KAAK,IAAI,CAAC,IAAI;gBACX,OAAM;gBACN,uBAAS,oBAACY,gBAAiBA;;;uBAQnD,oBAACb,OAAKA;QACF,OAAOY,OAAO,aAAa;QAC3B,uBACI,oBAACE,aAAWA;YAAC,OAAO;yBAChB,oBAACC,YAAUA;YAAC,oBAAoBX;;;AAO5D;AAEO,MAAMY,oBAAoB,WAAHA,GAAGC,KAAKd"}
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@webiny/app-graphql-playground",
3
- "version": "0.0.0-unstable.78f581c1d2",
4
- "main": "index.js",
3
+ "version": "0.0.0-unstable.7be00a75a9",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": "./index.js",
7
+ "./*": "./*"
8
+ },
5
9
  "repository": {
6
10
  "type": "git",
7
11
  "url": "https://github.com/webiny/webiny-js.git"
@@ -9,46 +13,30 @@
9
13
  "author": "Webiny Ltd",
10
14
  "license": "MIT",
11
15
  "dependencies": {
12
- "@emotion/core": "10.3.1",
13
- "@emotion/styled": "10.3.0",
14
- "@webiny/app": "0.0.0-unstable.78f581c1d2",
15
- "@webiny/app-admin": "0.0.0-unstable.78f581c1d2",
16
- "@webiny/app-i18n": "0.0.0-unstable.78f581c1d2",
17
- "@webiny/app-security": "0.0.0-unstable.78f581c1d2",
18
- "@webiny/plugins": "0.0.0-unstable.78f581c1d2",
19
- "@webiny/ui": "0.0.0-unstable.78f581c1d2",
16
+ "@emotion/react": "11.14.0",
17
+ "@emotion/styled": "11.14.1",
18
+ "@webiny/admin-ui": "0.0.0-unstable.7be00a75a9",
19
+ "@webiny/app": "0.0.0-unstable.7be00a75a9",
20
+ "@webiny/app-admin": "0.0.0-unstable.7be00a75a9",
21
+ "@webiny/icons": "0.0.0-unstable.7be00a75a9",
22
+ "@webiny/plugins": "0.0.0-unstable.7be00a75a9",
20
23
  "apollo-cache": "1.3.5",
21
24
  "apollo-client": "2.6.10",
22
25
  "apollo-link": "1.2.14",
23
26
  "apollo-link-context": "1.0.20",
24
27
  "apollo-utilities": "1.3.4",
25
- "graphql": "15.8.0",
26
- "load-script": "1.0.0",
27
- "prop-types": "15.8.1",
28
- "react": "17.0.2",
29
- "react-dom": "17.0.2"
28
+ "graphql": "16.14.0",
29
+ "load-script": "2.0.0",
30
+ "react": "18.3.1",
31
+ "react-dom": "18.3.1"
30
32
  },
31
33
  "devDependencies": {
32
- "@babel/cli": "^7.19.3",
33
- "@babel/core": "^7.19.3",
34
- "@babel/plugin-proposal-class-properties": "^7.16.0",
35
- "@babel/preset-env": "^7.19.4",
36
- "@babel/preset-react": "^7.16.0",
37
- "@babel/preset-typescript": "^7.18.6",
38
- "@webiny/cli": "^0.0.0-unstable.78f581c1d2",
39
- "@webiny/project-utils": "^0.0.0-unstable.78f581c1d2",
40
- "babel-plugin-emotion": "^9.2.8",
41
- "babel-plugin-lodash": "^3.3.4",
42
- "rimraf": "^3.0.2",
43
- "typescript": "4.7.4"
34
+ "@webiny/build-tools": "0.0.0-unstable.7be00a75a9",
35
+ "rimraf": "6.1.3",
36
+ "typescript": "6.0.3"
44
37
  },
45
38
  "publishConfig": {
46
- "access": "public",
47
- "directory": "dist"
48
- },
49
- "scripts": {
50
- "build": "yarn webiny run build",
51
- "watch": "yarn webiny run watch"
39
+ "access": "public"
52
40
  },
53
41
  "adio": {
54
42
  "ignore": {
@@ -60,5 +48,8 @@
60
48
  ]
61
49
  }
62
50
  },
63
- "gitHead": "78f581c1d2e5e6936aa11b9452a66d2a3652a1b2"
51
+ "gitHead": "8476da73b653c89cc1474d968baf55c1b0ae0e5f",
52
+ "webiny": {
53
+ "publishFrom": "dist"
54
+ }
64
55
  }
@@ -1,10 +1,10 @@
1
1
  import React from "react";
2
- import ApolloClient from "apollo-client";
2
+ import type ApolloClient from "apollo-client";
3
3
  interface CreateApolloClientParams {
4
4
  uri: string;
5
5
  }
6
6
  interface PlaygroundProps {
7
7
  createApolloClient: (params: CreateApolloClientParams) => ApolloClient<any>;
8
8
  }
9
- declare const Playground: React.FC<PlaygroundProps>;
9
+ declare const Playground: ({ createApolloClient }: PlaygroundProps) => React.JSX.Element;
10
10
  export default Playground;
@@ -1,156 +1,74 @@
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
-
44
- /**
45
- * Package load-script does not have types.
46
- */
47
- // @ts-ignore
48
- var withHeaders = function withHeaders(link, headers) {
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) {
52
- while (1) {
53
- switch (_context.prev = _context.next) {
54
- case 0:
55
- return _context.abrupt("return", {
56
- headers: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, req.headers), headers)
57
- });
58
-
59
- case 1:
60
- case "end":
61
- return _context.stop();
62
- }
63
- }
64
- }, _callee);
65
- }));
66
-
67
- return function (_x, _x2) {
68
- return _ref.apply(this, arguments);
69
- };
70
- }()), link]);
71
- };
72
-
73
- var initScripts = function initScripts() {
74
- return new Promise(function (resolve) {
75
- // @ts-ignore
76
- if (window.GraphQLPlayground) {
77
- return resolve();
78
- }
79
-
80
- return (0, _loadScript.default)("https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js", resolve);
81
- });
82
- };
83
-
84
- var Playground = function Playground(_ref2) {
85
- var createApolloClient = _ref2.createApolloClient;
86
-
87
- var _useState = (0, _react.useState)(true),
88
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
89
- loading = _useState2[0],
90
- setLoading = _useState2[1];
91
-
92
- var _useI18N = (0, _useI18N2.useI18N)(),
93
- getCurrentLocale = _useI18N.getCurrentLocale;
94
-
95
- var _useSecurity = (0, _appSecurity.useSecurity)(),
96
- identity = _useSecurity.identity;
97
-
98
- var links = (0, _react.useRef)({});
99
- var locale = getCurrentLocale("content");
100
-
101
- var tabs = _plugins.plugins.byType("graphql-playground-tab").map(function (pl) {
102
- return pl.tab({
103
- locale: locale,
104
- identity: identity
105
- });
106
- }).filter(Boolean);
107
-
108
- var createApolloLink = (0, _react.useCallback)(function (_ref3) {
109
- var endpoint = _ref3.endpoint,
110
- headers = _ref3.headers;
111
- var current = links.current; // If the request endpoint is not know to us, return the first available
112
-
113
- var apiUrl = _config.config.getKey("API_URL", process.env.REACT_APP_API_URL);
114
-
115
- if (!endpoint.includes(apiUrl)) {
116
- return {
117
- link: withHeaders(Object.values(current)[0], headers)
118
- };
119
- }
120
-
121
- if (!current[endpoint]) {
122
- current[endpoint] = createApolloClient({
123
- uri: endpoint
124
- }).link;
125
- }
126
-
127
- return {
128
- link: withHeaders(current[endpoint], headers)
129
- };
130
- }, []);
131
- (0, _react.useEffect)(function () {
132
- initScripts().then(function () {
133
- setLoading(false);
1
+ import react, { Fragment, useCallback, useEffect, useRef, useState } from "react";
2
+ import { ApolloLink } from "apollo-link";
3
+ import { setContext } from "apollo-link-context";
4
+ import load_script from "load-script";
5
+ import { Global } from "@emotion/react";
6
+ import { plugins } from "@webiny/plugins";
7
+ import { useIdentity } from "@webiny/app-admin";
8
+ import { OverlayLoader } from "@webiny/admin-ui";
9
+ import { PlaygroundContainer, playgroundDialog } from "./Playground.styles.js";
10
+ import { settings } from "./settings.js";
11
+ import { config } from "@webiny/app/config.js";
12
+ import { ORIGINAL_GQL_PLAYGROUND_URL, PATCHED_GQL_PLAYGROUND_URL } from "./constants.js";
13
+ const withHeaders = (link, headers)=>ApolloLink.from([
14
+ setContext(async (_, req)=>({
15
+ headers: {
16
+ ...req.headers,
17
+ ...headers
18
+ }
19
+ })),
20
+ link
21
+ ]);
22
+ const initScripts = ()=>new Promise((resolve)=>{
23
+ if (window.GraphQLPlayground) return resolve();
24
+ load_script(PATCHED_GQL_PLAYGROUND_URL, (err)=>{
25
+ if (err) return load_script(ORIGINAL_GQL_PLAYGROUND_URL, resolve);
26
+ resolve();
27
+ });
134
28
  });
135
- }, []);
136
- (0, _react.useEffect)(function () {
137
- if (!loading) {
138
- // @ts-ignore
139
- window.GraphQLPlayground.init(document.getElementById("graphql-playground"), {
140
- tabs: tabs,
141
- createApolloLink: createApolloLink,
142
- settings: _settings.settings
143
- });
144
- }
145
- }, [loading]);
146
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, loading ? /*#__PURE__*/_react.default.createElement(_Progress.CircularProgress, {
147
- label: "Loading playground..."
148
- }) : /*#__PURE__*/_react.default.createElement(_Playground.PlaygroundContainer, {
149
- id: "graphql-playground"
150
- }), /*#__PURE__*/_react.default.createElement(_core.Global, {
151
- styles: _Playground.playgroundDialog
152
- }));
29
+ const Playground = ({ createApolloClient })=>{
30
+ const [loading, setLoading] = useState(true);
31
+ const { identity } = useIdentity();
32
+ const links = useRef({});
33
+ const tabs = plugins.byType("graphql-playground-tab").map((pl)=>pl.tab({
34
+ identity: identity
35
+ })).filter(Boolean);
36
+ const createApolloLink = useCallback(({ endpoint, headers })=>{
37
+ const current = links.current;
38
+ const apiUrl = config.getKey("API_URL", process.env.REACT_APP_API_URL);
39
+ if (!endpoint.includes(apiUrl)) return {
40
+ link: withHeaders(Object.values(current)[0], headers)
41
+ };
42
+ if (!current[endpoint]) current[endpoint] = createApolloClient({
43
+ uri: endpoint
44
+ }).link;
45
+ return {
46
+ link: withHeaders(current[endpoint], headers)
47
+ };
48
+ }, []);
49
+ useEffect(()=>{
50
+ initScripts().then(()=>{
51
+ setLoading(false);
52
+ });
53
+ }, []);
54
+ useEffect(()=>{
55
+ if (!loading) window.GraphQLPlayground.init(document.getElementById("graphql-playground"), {
56
+ tabs,
57
+ createApolloLink,
58
+ settings: settings
59
+ });
60
+ }, [
61
+ loading
62
+ ]);
63
+ return /*#__PURE__*/ react.createElement(Fragment, null, loading ? /*#__PURE__*/ react.createElement(OverlayLoader, {
64
+ text: "Loading playground..."
65
+ }) : /*#__PURE__*/ react.createElement(PlaygroundContainer, {
66
+ id: "graphql-playground"
67
+ }), /*#__PURE__*/ react.createElement(Global, {
68
+ styles: playgroundDialog
69
+ }));
153
70
  };
71
+ const plugins_Playground = Playground;
72
+ export default plugins_Playground;
154
73
 
155
- var _default = Playground;
156
- exports.default = _default;
74
+ //# sourceMappingURL=Playground.js.map
@@ -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/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":"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"}
1
+ {"version":3,"file":"plugins/Playground.js","sources":["../../src/plugins/Playground.tsx"],"sourcesContent":["import React, { Fragment, useEffect, useRef, useCallback, useState } from \"react\";\nimport { ApolloLink } from \"apollo-link\";\nimport { setContext } from \"apollo-link-context\";\nimport loadScript from \"load-script\";\nimport { Global } from \"@emotion/react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { useIdentity } from \"@webiny/app-admin\";\nimport type { Identity } from \"@webiny/app-admin/domain/Identity.js\";\nimport { OverlayLoader } from \"@webiny/admin-ui\";\nimport { playgroundDialog, PlaygroundContainer } from \"./Playground.styles.js\";\nimport { settings } from \"./settings.js\";\nimport { config as appConfig } from \"@webiny/app/config.js\";\nimport type ApolloClient from \"apollo-client\";\nimport type { GraphQLPlaygroundTabPlugin } from \"~/types.js\";\nimport { ORIGINAL_GQL_PLAYGROUND_URL, PATCHED_GQL_PLAYGROUND_URL } from \"./constants.js\";\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 => {\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 { identity } = useIdentity();\n const links = useRef<Record<string, ApolloLink>>({});\n\n const tabs = plugins\n .byType<GraphQLPlaygroundTabPlugin>(\"graphql-playground-tab\")\n .map(pl =>\n pl.tab({\n identity: identity as Identity\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 <OverlayLoader text={\"Loading playground...\"} />\n ) : (\n <PlaygroundContainer id={\"graphql-playground\"} />\n )}\n <Global styles={playgroundDialog} />\n </Fragment>\n );\n};\n\nexport default Playground;\n"],"names":["withHeaders","link","headers","ApolloLink","setContext","_","req","initScripts","Promise","resolve","window","loadScript","PATCHED_GQL_PLAYGROUND_URL","err","ORIGINAL_GQL_PLAYGROUND_URL","Playground","createApolloClient","loading","setLoading","useState","identity","useIdentity","links","useRef","tabs","plugins","pl","Boolean","createApolloLink","useCallback","endpoint","current","apiUrl","appConfig","process","Object","useEffect","document","settings","Fragment","OverlayLoader","PlaygroundContainer","Global","playgroundDialog"],"mappings":";;;;;;;;;;;;AAgBA,MAAMA,cAAc,CAACC,MAAkBC,UAC5BC,WAAW,IAAI,CAAC;QACnBC,WAAW,OAAOC,GAAGC,MACV;gBACH,SAAS;oBACL,GAAGA,IAAI,OAAO;oBACd,GAAGJ,OAAO;gBACd;YACJ;QAEJD;KACH;AAGL,MAAMM,cAAc,IACT,IAAIC,QAAQ,CAACC;QAEhB,IAAIC,OAAO,iBAAiB,EACxB,OAAOD;QAGXE,YAAWC,4BAA4BC,CAAAA;YACnC,IAAIA,KACA,OAAOF,YAAWG,6BAA6BL;YAGnDA;QACJ;IACJ;AAwBJ,MAAMM,aAAa,CAAC,EAAEC,kBAAkB,EAAmB;IACvD,MAAM,CAACC,SAASC,WAAW,GAAGC,SAAS;IACvC,MAAM,EAAEC,QAAQ,EAAE,GAAGC;IACrB,MAAMC,QAAQC,OAAmC,CAAC;IAElD,MAAMC,OAAOC,QAAAA,MACF,CAA6B,0BACnC,GAAG,CAACC,CAAAA,KACDA,GAAG,GAAG,CAAC;YACH,UAAUN;QACd,IAEH,MAAM,CAACO;IAEZ,MAAMC,mBAAmBC,YAAsC,CAAC,EAAEC,QAAQ,EAAE5B,OAAO,EAAE;QACjF,MAAM6B,UAAUT,MAAM,OAAO;QAE7B,MAAMU,SAASC,OAAAA,MAAgB,CAAC,WAAWC,QAAQ,GAAG,CAAC,iBAAiB;QACxE,IAAI,CAACJ,SAAS,QAAQ,CAACE,SACnB,OAAO;YAAE,MAAMhC,YAAYmC,OAAO,MAAM,CAACJ,QAAQ,CAAC,EAAE,EAAE7B;QAAS;QAGnE,IAAI,CAAC6B,OAAO,CAACD,SAAS,EAClBC,OAAO,CAACD,SAAS,GAAGd,mBAAmB;YAAE,KAAKc;QAAS,GAAG,IAAI;QAGlE,OAAO;YACH,MAAM9B,YAAY+B,OAAO,CAACD,SAAS,EAAE5B;QACzC;IACJ,GAAG,EAAE;IAELkC,UAAU;QACN7B,cAAc,IAAI,CAAC;YACfW,WAAW;QACf;IACJ,GAAG,EAAE;IAELkB,UAAU;QACN,IAAI,CAACnB,SAEDP,OAAO,iBAAiB,CAAC,IAAI,CAAC2B,SAAS,cAAc,CAAC,uBAAuB;YACzEb;YACAI;YACAU,UAAQA;QACZ;IAER,GAAG;QAACrB;KAAQ;IAEZ,OAAO,WAAP,GACI,oBAACsB,UAAQA,MACJtB,UAAU,WAAVA,GACG,oBAACuB,eAAaA;QAAC,MAAM;uBAErB,oBAACC,qBAAmBA;QAAC,IAAI;sBAE7B,oBAACC,QAAMA;QAAC,QAAQC;;AAG5B;AAEA,2BAAe5B"}
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
2
- /// <reference types="web" />
3
- /// <reference types="react" />
4
- export declare const PlaygroundContainer: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
1
+ export declare const PlaygroundContainer: import("@emotion/styled").StyledComponent<{
2
+ theme?: import("@emotion/react").Theme;
3
+ as?: React.ElementType;
4
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
5
  export declare const playgroundDialog: {
6
6
  ".ReactModalPortal": {
7
7
  "p, a, h1, h2, h3, h4, ul, pre, code": {
@@ -1,56 +1,43 @@
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
-
14
- var sharedStyles = {
15
- "p, a, h1, h2, h3, h4, ul, pre, code": {
16
- margin: 0,
17
- padding: 0,
18
- color: "inherit"
19
- },
20
- "a:active, a:focus, button:focus, input:focus": {
21
- outline: "none"
22
- },
23
- "input, button, submit": {
24
- border: "none"
25
- },
26
- "input, button, pre": {
27
- fontFamily: "'Open Sans', sans-serif"
28
- },
29
- code: {
30
- fontFamily: "Consolas, monospace"
31
- }
1
+ import styled from "@emotion/styled";
2
+ const sharedStyles = {
3
+ "p, a, h1, h2, h3, h4, ul, pre, code": {
4
+ margin: 0,
5
+ padding: 0,
6
+ color: "inherit"
7
+ },
8
+ "a:active, a:focus, button:focus, input:focus": {
9
+ outline: "none"
10
+ },
11
+ "input, button, submit": {
12
+ border: "none"
13
+ },
14
+ "input, button, pre": {
15
+ fontFamily: "'Open Sans', sans-serif"
16
+ },
17
+ code: {
18
+ fontFamily: "Consolas, monospace"
19
+ }
32
20
  };
33
- var PlaygroundContainer = /*#__PURE__*/(0, _styled.default)("div", {
34
- target: "e1o47c380",
35
- label: "PlaygroundContainer"
36
- })({
37
- marginTop: -3,
38
- overflow: "hidden",
39
- ".playground": (0, _objectSpread2.default)({
40
- height: "calc(100vh - 64px)",
41
- margin: 0,
42
- padding: 0,
43
- fontFamily: "'Open Sans', sans-serif",
44
- WebkitFontSmoothing: "antialiased",
45
- MozOsxFontSmoothing: "grayscale",
46
- color: "rgba(0,0,0,.8)",
47
- lineHeight: 1.5,
48
- letterSpacing: 0.53,
49
- marginRight: "-1px !important"
50
- }, sharedStyles)
21
+ const PlaygroundContainer = styled("div")({
22
+ marginTop: -3,
23
+ overflow: "hidden",
24
+ ".playground": {
25
+ height: "calc(100vh - 45px)",
26
+ margin: 0,
27
+ padding: 0,
28
+ fontFamily: "'Open Sans', sans-serif",
29
+ WebkitFontSmoothing: "antialiased",
30
+ MozOsxFontSmoothing: "grayscale",
31
+ color: "rgba(0,0,0,.8)",
32
+ lineHeight: 1.5,
33
+ letterSpacing: 0.53,
34
+ marginRight: "-1px !important",
35
+ ...sharedStyles
36
+ }
51
37
  });
52
- exports.PlaygroundContainer = PlaygroundContainer;
53
- var playgroundDialog = {
54
- ".ReactModalPortal": sharedStyles
38
+ const playgroundDialog = {
39
+ ".ReactModalPortal": sharedStyles
55
40
  };
56
- exports.playgroundDialog = playgroundDialog;
41
+ export { PlaygroundContainer, playgroundDialog };
42
+
43
+ //# sourceMappingURL=Playground.styles.js.map
@@ -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":";;;;;;;;;;;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"}
1
+ {"version":3,"file":"plugins/Playground.styles.js","sources":["../../src/plugins/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"],"names":["sharedStyles","PlaygroundContainer","styled","playgroundDialog"],"mappings":";AAEA,MAAMA,eAAe;IACjB,uCAAuC;QACnC,QAAQ;QACR,SAAS;QACT,OAAO;IACX;IACA,gDAAgD;QAC5C,SAAS;IACb;IACA,yBAAyB;QACrB,QAAQ;IACZ;IACA,sBAAsB;QAClB,YAAY;IAChB;IACA,MAAM;QACF,YAAY;IAChB;AACJ;AAEO,MAAMC,sBAAsBC,OAAO,OAAO;IAC7C,WAAW;IACX,UAAU;IACV,eAAe;QACX,QAAQ;QACR,QAAQ;QACR,SAAS;QACT,YAAY;QACZ,qBAAqB;QACrB,qBAAqB;QACrB,OAAO;QACP,YAAY;QACZ,eAAe;QACf,aAAa;QACb,GAAGF,YAAY;IACnB;AACJ;AAEO,MAAMG,mBAAmB;IAC5B,qBAAqBH;AACzB"}
@@ -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,5 @@
1
+ const ORIGINAL_GQL_PLAYGROUND_URL = "https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js";
2
+ 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
+ export { ORIGINAL_GQL_PLAYGROUND_URL, PATCHED_GQL_PLAYGROUND_URL };
4
+
5
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins/constants.js","sources":["../../src/plugins/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"],"names":["ORIGINAL_GQL_PLAYGROUND_URL","PATCHED_GQL_PLAYGROUND_URL"],"mappings":"AAAO,MAAMA,8BACT;AAEG,MAAMC,6BACT"}
@@ -1,3 +1,3 @@
1
- import { GraphQLPlaygroundTabPlugin } from "../types";
1
+ import type { GraphQLPlaygroundTabPlugin } from "../types.js";
2
2
  declare const _default: GraphQLPlaygroundTabPlugin[];
3
3
  export default _default;
package/plugins/index.js CHANGED
@@ -1,29 +1,20 @@
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
-
14
- // @ts-ignore
15
- var plugin = {
16
- type: "graphql-playground-tab",
17
- tab: function tab() {
18
- var apiUrl = _config.config.getKey("API_URL", process.env.REACT_APP_API_URL);
19
-
20
- return {
21
- name: "Main API",
22
- endpoint: apiUrl + "/graphql",
23
- headers: {},
24
- query: _placeholder.default
25
- };
26
- }
1
+ import _raw_loader_placeholder_graphql from "!!raw-loader!./placeholder.graphql";
2
+ import { config } from "@webiny/app/config.js";
3
+ const plugins_plugin = {
4
+ type: "graphql-playground-tab",
5
+ tab () {
6
+ const apiUrl = config.getKey("API_URL", process.env.REACT_APP_API_URL);
7
+ return {
8
+ name: "Main API",
9
+ endpoint: apiUrl + "/graphql",
10
+ headers: {},
11
+ query: _raw_loader_placeholder_graphql
12
+ };
13
+ }
27
14
  };
28
- var _default = [plugin];
29
- exports.default = _default;
15
+ const plugins = [
16
+ plugins_plugin
17
+ ];
18
+ export default plugins;
19
+
20
+ //# sourceMappingURL=index.js.map
@@ -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":";;;;;;;;;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
+ {"version":3,"file":"plugins/index.js","sources":["../../src/plugins/index.tsx"],"sourcesContent":["import type { GraphQLPlaygroundTabPlugin } from \"~/types.js\";\n// @ts-expect-error\nimport placeholder from \"!!raw-loader!./placeholder.graphql\";\nimport { config as appConfig } from \"@webiny/app/config.js\";\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"],"names":["plugin","apiUrl","appConfig","process","placeholder"],"mappings":";;AAKA,MAAMA,iBAAqC;IACvC,MAAM;IACN;QACI,MAAMC,SAASC,OAAAA,MAAgB,CAAC,WAAWC,QAAQ,GAAG,CAAC,iBAAiB;QACxE,OAAO;YACH,MAAM;YACN,UAAUF,SAAS;YACnB,SAAS,CAAC;YACV,OAAOG;QACX;IACJ;AACJ;AACA,gBAAe;IAACJ;CAAO"}
@@ -1,25 +1,21 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.settings = void 0;
7
- var settings = {
8
- "editor.cursorShape": "line",
9
- "editor.fontFamily": "'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace",
10
- "editor.fontSize": 14,
11
- "editor.reuseHeaders": true,
12
- "editor.theme": "dark",
13
- "general.betaUpdates": false,
14
- "prettier.printWidth": 80,
15
- "prettier.tabWidth": 2,
16
- "prettier.useTabs": false,
17
- "request.credentials": "omit",
18
- "schema.disableComments": true,
19
- "schema.polling.enable": false,
20
- "schema.polling.endpointFilter": "*localhost*",
21
- "schema.polling.interval": 2000000,
22
- "tracing.hideTracingResponse": true,
23
- "queryPlan.hideQueryPlanResponse": true
1
+ const settings = {
2
+ "editor.cursorShape": "line",
3
+ "editor.fontFamily": "'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace",
4
+ "editor.fontSize": 14,
5
+ "editor.reuseHeaders": true,
6
+ "editor.theme": "dark",
7
+ "general.betaUpdates": false,
8
+ "prettier.printWidth": 80,
9
+ "prettier.tabWidth": 2,
10
+ "prettier.useTabs": false,
11
+ "request.credentials": "omit",
12
+ "schema.disableComments": true,
13
+ "schema.polling.enable": false,
14
+ "schema.polling.endpointFilter": "*localhost*",
15
+ "schema.polling.interval": 2000000,
16
+ "tracing.hideTracingResponse": true,
17
+ "queryPlan.hideQueryPlanResponse": true
24
18
  };
25
- exports.settings = settings;
19
+ export { settings };
20
+
21
+ //# sourceMappingURL=settings.js.map
@@ -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,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"}
1
+ {"version":3,"file":"plugins/settings.js","sources":["../../src/plugins/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"],"names":["settings"],"mappings":"AAAO,MAAMA,WAAgB;IACzB,sBAAsB;IACtB,qBAAqB;IACrB,mBAAmB;IACnB,uBAAuB;IACvB,gBAAgB;IAChB,uBAAuB;IACvB,uBAAuB;IACvB,qBAAqB;IACrB,oBAAoB;IACpB,uBAAuB;IACvB,0BAA0B;IAC1B,yBAAyB;IACzB,iCAAiC;IACjC,2BAA2B;IAC3B,+BAA+B;IAC/B,mCAAmC;AACvC"}
package/routes.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { Route } from "@webiny/app-admin";
2
+ export declare const Routes: {
3
+ ApiPlayground: Route<undefined>;
4
+ };
package/routes.js ADDED
@@ -0,0 +1,10 @@
1
+ import { Route } from "@webiny/app-admin";
2
+ const Routes = {
3
+ ApiPlayground: new Route({
4
+ name: "ApiPlayground",
5
+ path: "/api-playground"
6
+ })
7
+ };
8
+ export { Routes };
9
+
10
+ //# sourceMappingURL=routes.js.map
package/routes.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.js","sources":["../src/routes.ts"],"sourcesContent":["import { Route } from \"@webiny/app-admin\";\n\nexport const Routes = {\n ApiPlayground: new Route({\n name: \"ApiPlayground\",\n path: \"/api-playground\"\n })\n};\n"],"names":["Routes","Route"],"mappings":";AAEO,MAAMA,SAAS;IAClB,eAAe,IAAIC,MAAM;QACrB,MAAM;QACN,MAAM;IACV;AACJ"}
@@ -0,0 +1 @@
1
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M14.051 2.751l4.935 2.85c.816-.859 2.173-.893 3.032-.077.148.14.274.301.377.477.589 1.028.232 2.339-.796 2.928-.174.1-.361.175-.558.223v5.699c1.146.273 1.854 1.423 1.58 2.569-.048.204-.127.4-.232.581-.592 1.023-1.901 1.374-2.927.782-.196-.113-.375-.259-.526-.429l-4.905 2.832c.372 1.124-.238 2.335-1.361 2.706-.217.071-.442.108-.67.108-1.181.001-2.139-.955-2.14-2.136 0-.205.029-.41.088-.609l-4.936-2.847c-.816.854-2.171.887-3.026.07-.854-.816-.886-2.171-.07-3.026.283-.297.646-.506 1.044-.603l.001-5.699c-1.15-.276-1.858-1.433-1.581-2.584.047-.198.123-.389.224-.566.592-1.024 1.902-1.374 2.927-.782.177.101.339.228.48.377l4.938-2.85C9.613 1.612 10.26.423 11.39.088 11.587.029 11.794 0 12 0c1.181-.001 2.139.954 2.14 2.134.001.209-.03.418-.089.617zm-.515.877c-.019.021-.037.039-.058.058l6.461 11.19c.026-.009.056-.016.082-.023V9.146c-1.145-.283-1.842-1.442-1.558-2.588.006-.024.012-.049.019-.072l-4.946-2.858zm-3.015.059l-.06-.06-4.946 2.852c.327 1.135-.327 2.318-1.461 2.645-.026.008-.051.014-.076.021v5.708l.084.023 6.461-11.19-.002.001zm2.076.507c-.39.112-.803.112-1.192 0l-6.46 11.189c.294.283.502.645.6 1.041h12.911c.097-.398.307-.761.603-1.044L12.597 4.194zm.986 16.227l4.913-2.838c-.015-.047-.027-.094-.038-.142H5.542l-.021.083 4.939 2.852c.388-.404.934-.653 1.54-.653.627 0 1.19.269 1.583.698z"/></svg>
package/types.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { Plugin } from "@webiny/plugins/types";
2
- import { SecurityIdentity } from "@webiny/app-security/types";
1
+ import type { Identity } from "@webiny/app-admin/domain/Identity.js";
2
+ import type { Plugin } from "@webiny/plugins/types.js";
3
3
  export interface GraphQLPlaygroundTabParams {
4
- locale: string;
5
- identity: SecurityIdentity;
4
+ identity: Identity;
6
5
  }
7
6
  export interface GraphQLPlaygroundTab {
8
7
  name: string;
@@ -10,7 +9,7 @@ export interface GraphQLPlaygroundTab {
10
9
  headers: Record<string, string>;
11
10
  query: string;
12
11
  }
13
- export declare type GraphQLPlaygroundTabPlugin = Plugin<{
12
+ export type GraphQLPlaygroundTabPlugin = Plugin<{
14
13
  type: "graphql-playground-tab";
15
14
  tab: (params: GraphQLPlaygroundTabParams) => GraphQLPlaygroundTab | null;
16
15
  }>;
package/types.js CHANGED
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
package/types.js.map DELETED
@@ -1 +0,0 @@
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":""}