@webiny/app-graphql-playground 5.20.0 → 5.22.0-beta.1

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.
File without changes
package/index.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { ApolloClient } from "apollo-client";
3
+ interface GraphQLPlaygroundProps {
4
+ createApolloClient({ uri: string }: {
5
+ uri: any;
6
+ }): ApolloClient<any>;
7
+ }
8
+ export declare const GraphQLPlayground: React.MemoExoticComponent<({ createApolloClient }: GraphQLPlaygroundProps) => JSX.Element>;
9
+ export {};
package/index.js ADDED
@@ -0,0 +1,27 @@
1
+ import React, { memo } from "react";
2
+ import { plugins } from "@webiny/plugins";
3
+ import { Plugins, AddMenu, AddRoute, Layout } from "@webiny/app-admin";
4
+ import { ReactComponent as InfoIcon } from "./assets/graphql.svg";
5
+ import Playground from "./plugins/Playground";
6
+ import playgroundPlugins from "./plugins";
7
+
8
+ var GraphQLPlaygroundExtension = function GraphQLPlaygroundExtension(_ref) {
9
+ var createApolloClient = _ref.createApolloClient;
10
+ plugins.register(playgroundPlugins);
11
+ return /*#__PURE__*/React.createElement(Plugins, null, /*#__PURE__*/React.createElement(AddMenu, {
12
+ name: "apiPlayground",
13
+ label: "API Playground",
14
+ path: "/api-playground",
15
+ icon: /*#__PURE__*/React.createElement(InfoIcon, null),
16
+ tags: ["footer"]
17
+ }), /*#__PURE__*/React.createElement(AddRoute, {
18
+ exact: true,
19
+ path: "/api-playground"
20
+ }, /*#__PURE__*/React.createElement(Layout, {
21
+ title: "API Playground"
22
+ }, /*#__PURE__*/React.createElement(Playground, {
23
+ createApolloClient: createApolloClient
24
+ }))));
25
+ };
26
+
27
+ export var GraphQLPlayground = /*#__PURE__*/memo(GraphQLPlaygroundExtension);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-graphql-playground",
3
- "version": "5.20.0",
3
+ "version": "5.22.0-beta.1",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,36 +9,34 @@
9
9
  "author": "Webiny Ltd",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@emotion/core": "10.1.1",
13
- "@emotion/styled": "10.0.27",
14
- "@webiny/app": "5.20.0",
15
- "@webiny/app-admin": "5.20.0",
16
- "@webiny/app-i18n": "5.20.0",
17
- "@webiny/app-security": "5.20.0",
18
- "@webiny/plugins": "5.20.0",
19
- "@webiny/react-router": "5.20.0",
20
- "@webiny/ui": "5.20.0",
12
+ "@emotion/core": "10.3.1",
13
+ "@emotion/styled": "10.3.0",
14
+ "@webiny/app": "5.22.0-beta.1",
15
+ "@webiny/app-admin": "5.22.0-beta.1",
16
+ "@webiny/app-i18n": "5.22.0-beta.1",
17
+ "@webiny/app-security": "5.22.0-beta.1",
18
+ "@webiny/plugins": "5.22.0-beta.1",
19
+ "@webiny/ui": "5.22.0-beta.1",
21
20
  "apollo-cache": "1.3.5",
22
21
  "apollo-client": "2.6.10",
23
22
  "apollo-link": "1.2.14",
24
23
  "apollo-link-context": "1.0.20",
25
24
  "apollo-utilities": "1.3.4",
26
- "graphql": "14.7.0",
25
+ "graphql": "15.8.0",
27
26
  "load-script": "1.0.0",
28
- "prop-types": "15.7.2",
27
+ "prop-types": "15.8.1",
29
28
  "react": "16.14.0",
30
- "react-dom": "16.14.0",
31
- "react-helmet": "5.2.1"
29
+ "react-dom": "16.14.0"
32
30
  },
33
31
  "devDependencies": {
34
- "@babel/cli": "^7.5.5",
35
- "@babel/core": "^7.5.5",
36
- "@babel/plugin-proposal-class-properties": "^7.5.5",
37
- "@babel/preset-env": "^7.5.5",
38
- "@babel/preset-react": "^7.0.0",
39
- "@babel/preset-typescript": "^7.8.3",
40
- "@webiny/cli": "^5.20.0",
41
- "@webiny/project-utils": "^5.20.0",
32
+ "@babel/cli": "^7.16.0",
33
+ "@babel/core": "^7.16.0",
34
+ "@babel/plugin-proposal-class-properties": "^7.16.0",
35
+ "@babel/preset-env": "^7.16.4",
36
+ "@babel/preset-react": "^7.16.0",
37
+ "@babel/preset-typescript": "^7.16.0",
38
+ "@webiny/cli": "^5.22.0-beta.1",
39
+ "@webiny/project-utils": "^5.22.0-beta.1",
42
40
  "babel-plugin-emotion": "^9.2.8",
43
41
  "babel-plugin-lodash": "^3.3.4",
44
42
  "rimraf": "^3.0.2",
@@ -52,11 +50,6 @@
52
50
  "build": "yarn webiny run build",
53
51
  "watch": "yarn webiny run watch"
54
52
  },
55
- "svgo": {
56
- "plugins": {
57
- "removeViewBox": false
58
- }
59
- },
60
53
  "adio": {
61
54
  "ignore": {
62
55
  "src": [
@@ -67,5 +60,5 @@
67
60
  ]
68
61
  }
69
62
  },
70
- "gitHead": "816632961750d4ae7f3af0d32d4e8a46c3f287a6"
63
+ "gitHead": "b651010b23f28b3ce1c27130713322ce65b32dcd"
71
64
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export declare const PlaygroundContainer: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "hidden" | "dir" | "slot" | "style" | "title" | "color" | "translate" | "children" | "defaultValue" | "id" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css">, object>;
2
+ export declare const PlaygroundContainer: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css">, object>;
3
3
  export declare const playgroundDialog: {
4
4
  ".ReactModalPortal": {
5
5
  "p, a, h1, h2, h3, h4, ul, pre, code": {
@@ -1,17 +1,8 @@
1
- import ApolloClient from "apollo-client";
2
- import { RoutePlugin } from "@webiny/app/types";
3
- import { UIViewPlugin } from "@webiny/app-admin/ui/UIView";
4
- import { NavigationView } from "@webiny/app-admin/ui/views/NavigationView";
5
- declare type GraphQLPlaygroundOptions = {
6
- createApolloClient(params: {
7
- uri: string;
8
- }): ApolloClient<any>;
9
- };
10
- declare const _default: (options: GraphQLPlaygroundOptions) => (RoutePlugin | import("@webiny/plugins/types").Plugin<{
1
+ declare const _default: import("@webiny/plugins/types").Plugin<{
11
2
  type: "graphql-playground-tab";
12
3
  tab(params: {
13
4
  locale: string;
14
5
  identity: import("@webiny/app-security/types").SecurityIdentity;
15
6
  }): import("../types").GraphQLPlaygroundTab;
16
- }> | UIViewPlugin<NavigationView>)[];
7
+ }>[];
17
8
  export default _default;
package/plugins/index.js CHANGED
@@ -1,48 +1,15 @@
1
- import React from "react";
2
- import Helmet from "react-helmet";
3
- import { Route } from "@webiny/react-router";
4
- import { AdminLayout } from "@webiny/app-admin/components/AdminLayout";
5
- import { ReactComponent as InfoIcon } from "@svgr/webpack!./graphql.svg";
6
- import Playground from "./Playground";
7
1
  // @ts-ignore
8
2
  import placeholder from "!!raw-loader!./placeholder.graphql";
9
- import { NavigationMenuElement } from "@webiny/app-admin/ui/elements/NavigationMenuElement";
10
- import { UIViewPlugin } from "@webiny/app-admin/ui/UIView";
11
- import { NavigationView } from "@webiny/app-admin/ui/views/NavigationView";
12
3
  import { config as appConfig } from "@webiny/app/config";
13
- // @ts-ignore
14
- export default (function (options) {
15
- return [new UIViewPlugin(NavigationView, function (view) {
16
- view.getFooterElement().addMenuElement(new NavigationMenuElement("apiPlayground", {
17
- label: "API Playground",
18
- icon: /*#__PURE__*/React.createElement(InfoIcon, null),
19
- path: "/api-playground",
20
- onClick: function onClick() {
21
- view.getNavigationHook().hideMenu();
22
- }
23
- }));
24
- }), {
25
- name: "route-api-playground",
26
- type: "route",
27
- route: /*#__PURE__*/React.createElement(Route, {
28
- exact: true,
29
- path: "/api-playground",
30
- render: function render() {
31
- return /*#__PURE__*/React.createElement(AdminLayout, null, /*#__PURE__*/React.createElement(Helmet, null, /*#__PURE__*/React.createElement("title", null, "API Playground")), /*#__PURE__*/React.createElement(Playground, {
32
- createApolloClient: options.createApolloClient
33
- }));
34
- }
35
- })
36
- }, {
37
- type: "graphql-playground-tab",
38
- tab: function tab() {
39
- var apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
40
- return {
41
- name: "Main API",
42
- endpoint: apiUrl + "/graphql",
43
- headers: {},
44
- query: placeholder
45
- };
46
- }
47
- }];
48
- });
4
+ export default [{
5
+ type: "graphql-playground-tab",
6
+ tab: function tab() {
7
+ var apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
8
+ return {
9
+ name: "Main API",
10
+ endpoint: apiUrl + "/graphql",
11
+ headers: {},
12
+ query: placeholder
13
+ };
14
+ }
15
+ }];