@webiny/app-graphql-playground 6.3.0 → 6.4.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.
@@ -1,18 +1,26 @@
1
1
  import { createPermissionSchema } from "@webiny/app-admin";
2
- export const DEV_TOOLS_PERMISSIONS_SCHEMA = createPermissionSchema({
3
- prefix: "dev-tools",
4
- fullAccess: true,
5
- entities: [{
6
- id: "graphql-playground",
7
- title: "GraphQL Playground",
8
- permission: "dev-tools.graphql-playground.*",
9
- scopes: ["full"]
10
- }, {
11
- id: "sdk-playground",
12
- title: "SDK Playground",
13
- permission: "dev-tools.sdk-playground.*",
14
- scopes: ["full"]
15
- }]
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
+ ]
16
23
  });
24
+ export { DEV_TOOLS_PERMISSIONS_SCHEMA };
17
25
 
18
26
  //# sourceMappingURL=PermissionsSchema.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createPermissionSchema","DEV_TOOLS_PERMISSIONS_SCHEMA","prefix","fullAccess","entities","id","title","permission","scopes"],"sources":["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"],"mappings":"AAAA,SAASA,sBAAsB,QAAQ,mBAAmB;AAE1D,OAAO,MAAMC,4BAA4B,GAAGD,sBAAsB,CAAC;EAC/DE,MAAM,EAAE,WAAW;EACnBC,UAAU,EAAE,IAAI;EAChBC,QAAQ,EAAE,CACN;IACIC,EAAE,EAAE,oBAAoB;IACxBC,KAAK,EAAE,oBAAoB;IAC3BC,UAAU,EAAE,gCAAgC;IAC5CC,MAAM,EAAE,CAAC,MAAM;EACnB,CAAC,EACD;IACIH,EAAE,EAAE,gBAAgB;IACpBC,KAAK,EAAE,gBAAgB;IACvBC,UAAU,EAAE,4BAA4B;IACxCC,MAAM,EAAE,CAAC,MAAM;EACnB,CAAC;AAET,CAAC,CAAC","ignoreList":[]}
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"}
@@ -1,18 +1,15 @@
1
- import React from "react";
1
+ import react from "react";
2
2
  import { AdminConfig } from "@webiny/app-admin";
3
- import { ReactComponent as DevToolsIcon } from "@webiny/icons/developer_mode.svg";
3
+ import { ReactComponent } from "@webiny/icons/developer_mode.svg";
4
4
  import { DEV_TOOLS_PERMISSIONS_SCHEMA } from "./PermissionsSchema.js";
5
- const {
6
- Security
7
- } = AdminConfig;
8
- export const SecurityPermission = () => {
9
- return /*#__PURE__*/React.createElement(AdminConfig, null, /*#__PURE__*/React.createElement(Security.Permissions, {
10
- name: "dev-tools",
11
- title: "Dev Tools",
12
- description: "Manage Dev Tools access.",
13
- icon: /*#__PURE__*/React.createElement(DevToolsIcon, null),
14
- schema: DEV_TOOLS_PERMISSIONS_SCHEMA
15
- }));
16
- };
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 };
17
14
 
18
15
  //# sourceMappingURL=SecurityPermission.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","AdminConfig","ReactComponent","DevToolsIcon","DEV_TOOLS_PERMISSIONS_SCHEMA","Security","SecurityPermission","createElement","Permissions","name","title","description","icon","schema"],"sources":["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"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,cAAc,IAAIC,YAAY,QAAQ,kCAAkC;AACjF,SAASC,4BAA4B;AAErC,MAAM;EAAEC;AAAS,CAAC,GAAGJ,WAAW;AAEhC,OAAO,MAAMK,kBAAkB,GAAGA,CAAA,KAAM;EACpC,oBACIN,KAAA,CAAAO,aAAA,CAACN,WAAW,qBACRD,KAAA,CAAAO,aAAA,CAACF,QAAQ,CAACG,WAAW;IACjBC,IAAI,EAAC,WAAW;IAChBC,KAAK,EAAC,WAAW;IACjBC,WAAW,EAAC,0BAA0B;IACtCC,IAAI,eAAEZ,KAAA,CAAAO,aAAA,CAACJ,YAAY,MAAE,CAAE;IACvBU,MAAM,EAAET;EAA6B,CACxC,CACQ,CAAC;AAEtB,CAAC","ignoreList":[]}
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.js CHANGED
@@ -1,54 +1,53 @@
1
- import React, { memo } from "react";
1
+ import react, { memo } from "react";
2
2
  import { plugins } from "@webiny/plugins";
3
- import { useRouter, AdminConfig, AdminLayout, HasPermission } from "@webiny/app-admin";
4
- import { ReactComponent as ApiPlaygroundIcon } from "@webiny/icons/graphql_playground.svg";
5
- import { ReactComponent as DevToolsIcon } from "@webiny/icons/developer_mode.svg";
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
6
  import Playground from "./plugins/Playground.js";
7
- import playgroundPlugins from "./plugins/index.js";
7
+ import plugins_0 from "./plugins/index.js";
8
8
  import { SecurityPermission } from "./SecurityPermission.js";
9
9
  import { Routes } from "./routes.js";
10
- const {
11
- Route,
12
- Menu
13
- } = AdminConfig;
14
- const GraphQLPlaygroundExtension = ({
15
- createApolloClient
16
- }) => {
17
- const router = useRouter();
18
- plugins.register(playgroundPlugins);
19
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SecurityPermission, null), /*#__PURE__*/React.createElement(AdminConfig, null, /*#__PURE__*/React.createElement(Menu, {
20
- name: "dev-tools",
21
- hideIfEmpty: true,
22
- pin: "end",
23
- element: /*#__PURE__*/React.createElement(Menu.Item, {
24
- text: "Dev Tools",
25
- icon: /*#__PURE__*/React.createElement(Menu.Item.Icon, {
26
- label: "Dev Tools",
27
- element: /*#__PURE__*/React.createElement(DevToolsIcon, null)
28
- })
29
- })
30
- }), /*#__PURE__*/React.createElement(HasPermission, {
31
- any: ["dev-tools.*", "dev-tools.graphql-playground.*"]
32
- }, /*#__PURE__*/React.createElement(Menu, {
33
- name: "dev-tools.graphql",
34
- parent: "dev-tools",
35
- element: /*#__PURE__*/React.createElement(Menu.Link, {
36
- text: "GraphQL Playground",
37
- to: router.getLink(Routes.ApiPlayground),
38
- icon: /*#__PURE__*/React.createElement(Menu.Link.Icon, {
39
- label: "GraphQL Playground",
40
- element: /*#__PURE__*/React.createElement(ApiPlaygroundIcon, null)
41
- })
42
- })
43
- })), /*#__PURE__*/React.createElement(Route, {
44
- route: Routes.ApiPlayground,
45
- element: /*#__PURE__*/React.createElement(AdminLayout, {
46
- title: "GraphQL Playground"
47
- }, /*#__PURE__*/React.createElement(Playground, {
48
- createApolloClient: createApolloClient
49
- }))
50
- })));
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
+ })));
51
49
  };
52
- export const GraphQLPlayground = /*#__PURE__*/memo(GraphQLPlaygroundExtension);
50
+ const GraphQLPlayground = /*#__PURE__*/ memo(GraphQLPlaygroundExtension);
51
+ export { GraphQLPlayground };
53
52
 
54
53
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["React","memo","plugins","useRouter","AdminConfig","AdminLayout","HasPermission","ReactComponent","ApiPlaygroundIcon","DevToolsIcon","Playground","playgroundPlugins","SecurityPermission","Routes","Route","Menu","GraphQLPlaygroundExtension","createApolloClient","router","register","createElement","Fragment","name","hideIfEmpty","pin","element","Item","text","icon","Icon","label","any","parent","Link","to","getLink","ApiPlayground","route","title","GraphQLPlayground"],"sources":["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"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AAEnC,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,SAAS,EAAEC,WAAW,EAAEC,WAAW,EAAEC,aAAa,QAAQ,mBAAmB;AACtF,SAASC,cAAc,IAAIC,iBAAiB,QAAQ,sCAAsC;AAC1F,SAASD,cAAc,IAAIE,YAAY,QAAQ,kCAAkC;AACjF,OAAOC,UAAU;AACjB,OAAOC,iBAAiB;AACxB,SAASC,kBAAkB;AAC3B,SAASC,MAAM;AAEf,MAAM;EAAEC,KAAK;EAAEC;AAAK,CAAC,GAAGX,WAAW;AAUnC,MAAMY,0BAA0B,GAAGA,CAAC;EAAEC;AAA2C,CAAC,KAAK;EACnF,MAAMC,MAAM,GAAGf,SAAS,CAAC,CAAC;EAC1BD,OAAO,CAACiB,QAAQ,CAACR,iBAAiB,CAAC;EAEnC,oBACIX,KAAA,CAAAoB,aAAA,CAAApB,KAAA,CAAAqB,QAAA,qBACIrB,KAAA,CAAAoB,aAAA,CAACR,kBAAkB,MAAE,CAAC,eACtBZ,KAAA,CAAAoB,aAAA,CAAChB,WAAW,qBACRJ,KAAA,CAAAoB,aAAA,CAACL,IAAI;IACDO,IAAI,EAAE,WAAY;IAClBC,WAAW,EAAE,IAAK;IAClBC,GAAG,EAAE,KAAM;IACXC,OAAO,eACHzB,KAAA,CAAAoB,aAAA,CAACL,IAAI,CAACW,IAAI;MACNC,IAAI,EAAE,WAAY;MAClBC,IAAI,eAAE5B,KAAA,CAAAoB,aAAA,CAACL,IAAI,CAACW,IAAI,CAACG,IAAI;QAACC,KAAK,EAAC,WAAW;QAACL,OAAO,eAAEzB,KAAA,CAAAoB,aAAA,CAACX,YAAY,MAAE;MAAE,CAAE;IAAE,CACzE;EACJ,CACJ,CAAC,eACFT,KAAA,CAAAoB,aAAA,CAACd,aAAa;IAACyB,GAAG,EAAE,CAAC,aAAa,EAAE,gCAAgC;EAAE,gBAClE/B,KAAA,CAAAoB,aAAA,CAACL,IAAI;IACDO,IAAI,EAAE,mBAAoB;IAC1BU,MAAM,EAAE,WAAY;IACpBP,OAAO,eACHzB,KAAA,CAAAoB,aAAA,CAACL,IAAI,CAACkB,IAAI;MACNN,IAAI,EAAE,oBAAqB;MAC3BO,EAAE,EAAEhB,MAAM,CAACiB,OAAO,CAACtB,MAAM,CAACuB,aAAa,CAAE;MACzCR,IAAI,eACA5B,KAAA,CAAAoB,aAAA,CAACL,IAAI,CAACkB,IAAI,CAACJ,IAAI;QACXC,KAAK,EAAC,oBAAoB;QAC1BL,OAAO,eAAEzB,KAAA,CAAAoB,aAAA,CAACZ,iBAAiB,MAAE;MAAE,CAClC;IACJ,CACJ;EACJ,CACJ,CACU,CAAC,eAEhBR,KAAA,CAAAoB,aAAA,CAACN,KAAK;IACFuB,KAAK,EAAExB,MAAM,CAACuB,aAAc;IAC5BX,OAAO,eACHzB,KAAA,CAAAoB,aAAA,CAACf,WAAW;MAACiC,KAAK,EAAE;IAAqB,gBACrCtC,KAAA,CAAAoB,aAAA,CAACV,UAAU;MAACO,kBAAkB,EAAEA;IAAmB,CAAE,CAC5C;EAChB,CACJ,CACQ,CACf,CAAC;AAEX,CAAC;AAED,OAAO,MAAMsB,iBAAiB,gBAAGtC,IAAI,CAACe,0BAA0B,CAAC","ignoreList":[]}
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-graphql-playground",
3
- "version": "6.3.0",
3
+ "version": "6.4.0-beta.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -15,24 +15,23 @@
15
15
  "dependencies": {
16
16
  "@emotion/react": "11.14.0",
17
17
  "@emotion/styled": "11.14.1",
18
- "@webiny/app": "6.3.0",
19
- "@webiny/app-admin": "6.3.0",
20
- "@webiny/icons": "6.3.0",
21
- "@webiny/plugins": "6.3.0",
22
- "@webiny/ui": "6.3.0",
18
+ "@webiny/admin-ui": "6.4.0-beta.0",
19
+ "@webiny/app": "6.4.0-beta.0",
20
+ "@webiny/app-admin": "6.4.0-beta.0",
21
+ "@webiny/icons": "6.4.0-beta.0",
22
+ "@webiny/plugins": "6.4.0-beta.0",
23
23
  "apollo-cache": "1.3.5",
24
24
  "apollo-client": "2.6.10",
25
25
  "apollo-link": "1.2.14",
26
26
  "apollo-link-context": "1.0.20",
27
27
  "apollo-utilities": "1.3.4",
28
- "graphql": "16.13.2",
28
+ "graphql": "16.14.0",
29
29
  "load-script": "2.0.0",
30
30
  "react": "18.3.1",
31
31
  "react-dom": "18.3.1"
32
32
  },
33
33
  "devDependencies": {
34
- "@emotion/babel-plugin": "11.13.5",
35
- "@webiny/build-tools": "6.3.0",
34
+ "@webiny/build-tools": "6.4.0-beta.0",
36
35
  "rimraf": "6.1.3",
37
36
  "typescript": "6.0.3"
38
37
  },
@@ -50,5 +49,5 @@
50
49
  ]
51
50
  }
52
51
  },
53
- "gitHead": "7cefe15431dbd65504e1f58147dc9e55bcbfa693"
52
+ "gitHead": "a545d7529828af07d08d49c3da1bcb967483b9ce"
54
53
  }
@@ -1,94 +1,74 @@
1
- import React, { Fragment, useEffect, useRef, useCallback, useState } from "react";
1
+ import react, { Fragment, useCallback, useEffect, useRef, useState } from "react";
2
2
  import { ApolloLink } from "apollo-link";
3
3
  import { setContext } from "apollo-link-context";
4
- import loadScript from "load-script";
4
+ import load_script from "load-script";
5
5
  import { Global } from "@emotion/react";
6
6
  import { plugins } from "@webiny/plugins";
7
7
  import { useIdentity } from "@webiny/app-admin";
8
- import { CircularProgress } from "@webiny/ui/Progress/index.js";
9
- import { playgroundDialog, PlaygroundContainer } from "./Playground.styles.js";
8
+ import { OverlayLoader } from "@webiny/admin-ui";
9
+ import { PlaygroundContainer, playgroundDialog } from "./Playground.styles.js";
10
10
  import { settings } from "./settings.js";
11
- import { config as appConfig } from "@webiny/app/config.js";
11
+ import { config } from "@webiny/app/config.js";
12
12
  import { ORIGINAL_GQL_PLAYGROUND_URL, PATCHED_GQL_PLAYGROUND_URL } from "./constants.js";
13
- const withHeaders = (link, headers) => {
14
- return ApolloLink.from([setContext(async (_, req) => {
15
- return {
16
- headers: {
17
- ...req.headers,
18
- ...headers
19
- }
20
- };
21
- }), link]);
22
- };
23
- const initScripts = () => {
24
- return new Promise(resolve => {
25
- // @ts-expect-error
26
- if (window.GraphQLPlayground) {
27
- return resolve();
28
- }
29
- loadScript(PATCHED_GQL_PLAYGROUND_URL, err => {
30
- if (err) {
31
- return loadScript(ORIGINAL_GQL_PLAYGROUND_URL, resolve);
32
- }
33
- resolve();
34
- });
35
- });
36
- };
37
- const Playground = ({
38
- createApolloClient
39
- }) => {
40
- const [loading, setLoading] = useState(true);
41
- const {
42
- identity
43
- } = useIdentity();
44
- const links = useRef({});
45
- const tabs = plugins.byType("graphql-playground-tab").map(pl => pl.tab({
46
- identity: identity
47
- })).filter(Boolean);
48
- const createApolloLink = useCallback(({
49
- endpoint,
50
- headers
51
- }) => {
52
- const current = links.current;
53
- // If the request endpoint is not know to us, return the first available
54
- const apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
55
- if (!endpoint.includes(apiUrl)) {
56
- return {
57
- link: withHeaders(Object.values(current)[0], headers)
58
- };
59
- }
60
- if (!current[endpoint]) {
61
- current[endpoint] = createApolloClient({
62
- uri: endpoint
63
- }).link;
64
- }
65
- return {
66
- link: withHeaders(current[endpoint], headers)
67
- };
68
- }, []);
69
- useEffect(() => {
70
- initScripts().then(() => {
71
- setLoading(false);
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
+ });
72
28
  });
73
- }, []);
74
- useEffect(() => {
75
- if (!loading) {
76
- // @ts-expect-error
77
- window.GraphQLPlayground.init(document.getElementById("graphql-playground"), {
78
- tabs,
79
- createApolloLink,
80
- settings
81
- });
82
- }
83
- }, [loading]);
84
- return /*#__PURE__*/React.createElement(Fragment, null, loading ? /*#__PURE__*/React.createElement(CircularProgress, {
85
- label: "Loading playground..."
86
- }) : /*#__PURE__*/React.createElement(PlaygroundContainer, {
87
- id: "graphql-playground"
88
- }), /*#__PURE__*/React.createElement(Global, {
89
- styles: playgroundDialog
90
- }));
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
+ }));
91
70
  };
92
- export default Playground;
71
+ const plugins_Playground = Playground;
72
+ export default plugins_Playground;
93
73
 
94
74
  //# sourceMappingURL=Playground.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Fragment","useEffect","useRef","useCallback","useState","ApolloLink","setContext","loadScript","Global","plugins","useIdentity","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","identity","links","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\";\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 { CircularProgress } from \"@webiny/ui/Progress/index.js\";\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 <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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","ignoreList":[]}
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,47 +1,43 @@
1
- import _styled from "@emotion/styled/base";
1
+ import styled from "@emotion/styled";
2
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
- }
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
+ }
20
20
  };
21
- export const PlaygroundContainer = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
22
- target: "e1o47c380"
23
- } : {
24
- target: "e1o47c380",
25
- label: "PlaygroundContainer"
26
- })({
27
- marginTop: -3,
28
- overflow: "hidden",
29
- ".playground": {
30
- height: "calc(100vh - 45px)",
31
- margin: 0,
32
- padding: 0,
33
- fontFamily: "'Open Sans', sans-serif",
34
- WebkitFontSmoothing: "antialiased",
35
- MozOsxFontSmoothing: "grayscale",
36
- color: "rgba(0,0,0,.8)",
37
- lineHeight: 1.5,
38
- letterSpacing: 0.53,
39
- marginRight: "-1px !important",
40
- ...sharedStyles
41
- }
42
- }, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBsYXlncm91bmQuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNCbUMiLCJmaWxlIjoiUGxheWdyb3VuZC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcblxuY29uc3Qgc2hhcmVkU3R5bGVzID0ge1xuICAgIFwicCwgYSwgaDEsIGgyLCBoMywgaDQsIHVsLCBwcmUsIGNvZGVcIjoge1xuICAgICAgICBtYXJnaW46IDAsXG4gICAgICAgIHBhZGRpbmc6IDAsXG4gICAgICAgIGNvbG9yOiBcImluaGVyaXRcIlxuICAgIH0sXG4gICAgXCJhOmFjdGl2ZSwgYTpmb2N1cywgYnV0dG9uOmZvY3VzLCBpbnB1dDpmb2N1c1wiOiB7XG4gICAgICAgIG91dGxpbmU6IFwibm9uZVwiXG4gICAgfSxcbiAgICBcImlucHV0LCBidXR0b24sIHN1Ym1pdFwiOiB7XG4gICAgICAgIGJvcmRlcjogXCJub25lXCJcbiAgICB9LFxuICAgIFwiaW5wdXQsIGJ1dHRvbiwgcHJlXCI6IHtcbiAgICAgICAgZm9udEZhbWlseTogXCInT3BlbiBTYW5zJywgc2Fucy1zZXJpZlwiXG4gICAgfSxcbiAgICBjb2RlOiB7XG4gICAgICAgIGZvbnRGYW1pbHk6IFwiQ29uc29sYXMsIG1vbm9zcGFjZVwiXG4gICAgfVxufTtcblxuZXhwb3J0IGNvbnN0IFBsYXlncm91bmRDb250YWluZXIgPSBzdHlsZWQoXCJkaXZcIikoe1xuICAgIG1hcmdpblRvcDogLTMsXG4gICAgb3ZlcmZsb3c6IFwiaGlkZGVuXCIsXG4gICAgXCIucGxheWdyb3VuZFwiOiB7XG4gICAgICAgIGhlaWdodDogXCJjYWxjKDEwMHZoIC0gNDVweClcIixcbiAgICAgICAgbWFyZ2luOiAwLFxuICAgICAgICBwYWRkaW5nOiAwLFxuICAgICAgICBmb250RmFtaWx5OiBcIidPcGVuIFNhbnMnLCBzYW5zLXNlcmlmXCIsXG4gICAgICAgIFdlYmtpdEZvbnRTbW9vdGhpbmc6IFwiYW50aWFsaWFzZWRcIixcbiAgICAgICAgTW96T3N4Rm9udFNtb290aGluZzogXCJncmF5c2NhbGVcIixcbiAgICAgICAgY29sb3I6IFwicmdiYSgwLDAsMCwuOClcIixcbiAgICAgICAgbGluZUhlaWdodDogMS41LFxuICAgICAgICBsZXR0ZXJTcGFjaW5nOiAwLjUzLFxuICAgICAgICBtYXJnaW5SaWdodDogXCItMXB4ICFpbXBvcnRhbnRcIixcbiAgICAgICAgLi4uc2hhcmVkU3R5bGVzXG4gICAgfVxufSk7XG5cbmV4cG9ydCBjb25zdCBwbGF5Z3JvdW5kRGlhbG9nID0ge1xuICAgIFwiLlJlYWN0TW9kYWxQb3J0YWxcIjogc2hhcmVkU3R5bGVzXG59O1xuIl19 */");
43
- export const playgroundDialog = {
44
- ".ReactModalPortal": 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
+ }
37
+ });
38
+ const playgroundDialog = {
39
+ ".ReactModalPortal": sharedStyles
45
40
  };
41
+ export { PlaygroundContainer, playgroundDialog };
46
42
 
47
43
  //# sourceMappingURL=Playground.styles.js.map
@@ -1 +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":[]}
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"}
@@ -1,4 +1,5 @@
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";
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 };
3
4
 
4
5
  //# sourceMappingURL=constants.js.map
@@ -1 +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
+ {"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"}
package/plugins/index.js CHANGED
@@ -1,18 +1,20 @@
1
- // @ts-expect-error
2
- import placeholder from "!!raw-loader!./placeholder.graphql";
3
- import { config as appConfig } from "@webiny/app/config.js";
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
- }
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
+ }
15
14
  };
16
- export default [plugin];
15
+ const plugins = [
16
+ plugins_plugin
17
+ ];
18
+ export default plugins;
17
19
 
18
20
  //# sourceMappingURL=index.js.map
@@ -1 +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.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"],"mappings":"AACA;AACA,OAAOA,WAAW,MAAM,oCAAoC;AAC5D,SAASC,MAAM,IAAIC,SAAS,QAAQ,uBAAuB;AAE3D,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
+ {"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,20 +1,21 @@
1
- export 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
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
18
18
  };
19
+ export { settings };
19
20
 
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":"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":[]}
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.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { Route } from "@webiny/app-admin";
2
- export const Routes = {
3
- ApiPlayground: new Route({
4
- name: "ApiPlayground",
5
- path: "/api-playground"
6
- })
2
+ const Routes = {
3
+ ApiPlayground: new Route({
4
+ name: "ApiPlayground",
5
+ path: "/api-playground"
6
+ })
7
7
  };
8
+ export { Routes };
8
9
 
9
10
  //# sourceMappingURL=routes.js.map
package/routes.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["Route","Routes","ApiPlayground","name","path"],"sources":["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"],"mappings":"AAAA,SAASA,KAAK,QAAQ,mBAAmB;AAEzC,OAAO,MAAMC,MAAM,GAAG;EAClBC,aAAa,EAAE,IAAIF,KAAK,CAAC;IACrBG,IAAI,EAAE,eAAe;IACrBC,IAAI,EAAE;EACV,CAAC;AACL,CAAC","ignoreList":[]}
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.js CHANGED
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=types.js.map
package/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { Identity } from \"@webiny/app-admin/domain/Identity.js\";\nimport type { Plugin } from \"@webiny/plugins/types.js\";\n\nexport interface GraphQLPlaygroundTabParams {\n identity: Identity;\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":[]}