@webiny/app 5.23.0 → 5.24.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/contexts/Ui/index.d.ts +4 -3
- package/hooks/useAutocomplete/useAutocomplete.d.ts +6 -1
- package/hooks/useAutocomplete/useAutocomplete.js +1 -4
- package/hooks/useDataList/functions/getData.d.ts +1 -1
- package/hooks/useDataList/functions/getError.d.ts +1 -1
- package/hooks/useDataList/functions/getMeta.d.ts +1 -1
- package/hooks/useDataList/functions/searchDataByKey.d.ts +1 -1
- package/hooks/useDataList/useDataList.js +4 -0
- package/hooks/useDataList/utils/prepareLoadListParams.d.ts +1 -1
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +13 -4
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +3 -3
- package/hooks/useHandler.d.ts +11 -1
- package/hooks/useHandler.js +4 -0
- package/hooks/useHandlers.d.ts +1 -1
- package/hooks/useHandlers.js +3 -0
- package/package.json +10 -9
- package/plugins/AddQuerySelectionPlugin.d.ts +1 -1
- package/plugins/ApolloCacheObjectIdPlugin.d.ts +1 -1
- package/plugins/ApolloDynamicLink.d.ts +3 -2
- package/plugins/ApolloLinkPlugin.d.ts +2 -2
- package/plugins/ConsoleLinkPlugin.js +3 -2
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +6 -5
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +3 -3
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +2 -2
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +5 -4
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +3 -4
- package/types.d.ts +18 -4
package/contexts/Ui/index.d.ts
CHANGED
|
@@ -21,7 +21,8 @@ export declare class UiProvider extends React.Component<Props, State> {
|
|
|
21
21
|
setData: (setter: Function) => void;
|
|
22
22
|
render(): JSX.Element;
|
|
23
23
|
}
|
|
24
|
-
export
|
|
25
|
-
children:
|
|
26
|
-
}
|
|
24
|
+
export interface UiConsumerProps {
|
|
25
|
+
children: React.ReactElement;
|
|
26
|
+
}
|
|
27
|
+
export declare const UiConsumer: React.FC<UiConsumerProps>;
|
|
27
28
|
export {};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { DocumentNode } from "graphql";
|
|
1
2
|
interface UseAutocompleteHook {
|
|
2
3
|
options: any[];
|
|
3
4
|
onInput(value: string): void;
|
|
4
5
|
}
|
|
5
|
-
|
|
6
|
+
interface Props {
|
|
7
|
+
query: DocumentNode;
|
|
8
|
+
search?: string | ((value: string) => string);
|
|
9
|
+
}
|
|
10
|
+
export declare const useAutocomplete: (props: Props) => UseAutocompleteHook;
|
|
6
11
|
export {};
|
|
@@ -2,12 +2,9 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
|
2
2
|
import _debounce from "lodash/debounce";
|
|
3
3
|
import { useDataList } from "../useDataList";
|
|
4
4
|
export var useAutocomplete = function useAutocomplete(props) {
|
|
5
|
-
var useDataListProps = props.query ? props : {
|
|
6
|
-
query: props
|
|
7
|
-
};
|
|
8
5
|
var dataList = useDataList(_objectSpread({
|
|
9
6
|
useRouter: false
|
|
10
|
-
},
|
|
7
|
+
}, props));
|
|
11
8
|
return {
|
|
12
9
|
options: dataList.data || [],
|
|
13
10
|
onInput: _debounce(function (query) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (response:
|
|
1
|
+
declare const _default: (response: Record<string, string>) => string;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (response:
|
|
1
|
+
declare const _default: (response: Record<string, string>) => string;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (response:
|
|
1
|
+
declare const _default: (response: Record<string, string>) => string;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const searchDataByKey: (searchKey:
|
|
1
|
+
declare const searchDataByKey: (searchKey: string, object: Record<string, any>) => string | null;
|
|
2
2
|
export default searchDataByKey;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
interface Params {
|
|
2
|
+
sort: string;
|
|
3
|
+
search: string;
|
|
4
|
+
where: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
interface Location {
|
|
7
|
+
search: string;
|
|
8
|
+
}
|
|
9
|
+
interface Options {
|
|
10
|
+
history: Location[];
|
|
11
|
+
location: Location;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: (params: Params, options: Options) => void;
|
|
5
14
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export default (function (params,
|
|
2
|
-
var history =
|
|
3
|
-
location =
|
|
1
|
+
export default (function (params, options) {
|
|
2
|
+
var history = options.history,
|
|
3
|
+
location = options.location;
|
|
4
4
|
var paramsClone = Object.assign({}, params);
|
|
5
5
|
["sort", "search", "where"].forEach(function (key) {
|
|
6
6
|
if (typeof paramsClone[key] === "object") {
|
package/hooks/useHandler.d.ts
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* TODO: figure out any types.
|
|
3
|
+
*/
|
|
4
|
+
interface Props {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
interface Factory {
|
|
8
|
+
(...args: any): any;
|
|
9
|
+
}
|
|
10
|
+
export declare function useHandler(props: Props, factory: Factory): (...args: any) => any;
|
|
11
|
+
export {};
|
package/hooks/useHandler.js
CHANGED
package/hooks/useHandlers.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ declare type HandlerFactories = {
|
|
|
7
7
|
declare type Handlers = {
|
|
8
8
|
[K in keyof HandlerFactories]: (...params: any[]) => any;
|
|
9
9
|
};
|
|
10
|
-
export declare function useHandlers(props: HandlerProps, factories: HandlerFactories):
|
|
10
|
+
export declare function useHandlers<H = Handlers>(props: HandlerProps, factories: HandlerFactories): H;
|
|
11
11
|
export {};
|
package/hooks/useHandlers.js
CHANGED
|
@@ -4,6 +4,9 @@ export function useHandlers(props, factories) {
|
|
|
4
4
|
var handlersRef = useRef(function () {
|
|
5
5
|
var names = Object.keys(factories);
|
|
6
6
|
return names.reduce(function (handlers, name) {
|
|
7
|
+
/**
|
|
8
|
+
* TODO: figure out args types
|
|
9
|
+
*/
|
|
7
10
|
handlers[name] = function () {
|
|
8
11
|
var handler = factories[name](propsRef.current);
|
|
9
12
|
return handler.apply(void 0, arguments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.24.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"@babel/runtime": "7.16.7",
|
|
19
19
|
"@emotion/styled": "10.3.0",
|
|
20
20
|
"@types/react": "16.14.2",
|
|
21
|
-
"@webiny/i18n": "5.
|
|
22
|
-
"@webiny/i18n-react": "5.
|
|
23
|
-
"@webiny/plugins": "5.
|
|
24
|
-
"@webiny/react-router": "5.
|
|
25
|
-
"@webiny/ui": "5.
|
|
21
|
+
"@webiny/i18n": "5.24.0-beta.0",
|
|
22
|
+
"@webiny/i18n-react": "5.24.0-beta.0",
|
|
23
|
+
"@webiny/plugins": "5.24.0-beta.0",
|
|
24
|
+
"@webiny/react-router": "5.24.0-beta.0",
|
|
25
|
+
"@webiny/ui": "5.24.0-beta.0",
|
|
26
26
|
"apollo-cache": "1.3.5",
|
|
27
27
|
"apollo-cache-inmemory": "1.6.6",
|
|
28
28
|
"apollo-client": "2.6.10",
|
|
@@ -46,8 +46,9 @@
|
|
|
46
46
|
"@babel/preset-env": "^7.16.4",
|
|
47
47
|
"@babel/preset-react": "^7.16.0",
|
|
48
48
|
"@babel/preset-typescript": "^7.16.0",
|
|
49
|
-
"@
|
|
50
|
-
"@webiny/
|
|
49
|
+
"@types/warning": "^3.0.0",
|
|
50
|
+
"@webiny/cli": "^5.24.0-beta.0",
|
|
51
|
+
"@webiny/project-utils": "^5.24.0-beta.0",
|
|
51
52
|
"babel-plugin-lodash": "^3.3.4",
|
|
52
53
|
"rimraf": "^3.0.2",
|
|
53
54
|
"typescript": "^4.1.3"
|
|
@@ -67,5 +68,5 @@
|
|
|
67
68
|
]
|
|
68
69
|
}
|
|
69
70
|
},
|
|
70
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "05b90b92bbaf2ef3adf275d008c4641580cf5f42"
|
|
71
72
|
}
|
|
@@ -7,7 +7,7 @@ interface Config {
|
|
|
7
7
|
addSelection: DocumentNode;
|
|
8
8
|
}
|
|
9
9
|
export declare class AddQuerySelectionPlugin extends ApolloLinkPlugin {
|
|
10
|
-
private config;
|
|
10
|
+
private readonly config;
|
|
11
11
|
constructor(config: Config);
|
|
12
12
|
createLink(): ApolloLink;
|
|
13
13
|
addSelectionToQuery(operationName: string, query: DocumentNode): void;
|
|
@@ -8,7 +8,7 @@ interface Callable<T> {
|
|
|
8
8
|
}
|
|
9
9
|
export declare class ApolloCacheObjectIdPlugin<T extends Object = Object> extends Plugin {
|
|
10
10
|
static readonly type = "cache-get-object-id";
|
|
11
|
-
private _getObjectId;
|
|
11
|
+
private readonly _getObjectId;
|
|
12
12
|
constructor(getObjectId?: Callable<T>);
|
|
13
13
|
getObjectId(data: T): any;
|
|
14
14
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ApolloLink } from "apollo-link";
|
|
1
|
+
import { ApolloLink, NextLink } from "apollo-link";
|
|
2
|
+
import { Operation } from "apollo-link/lib/types";
|
|
2
3
|
export declare class ApolloDynamicLink extends ApolloLink {
|
|
3
4
|
private cache;
|
|
4
|
-
request(operation:
|
|
5
|
+
request(operation: Operation, forward: NextLink): any;
|
|
5
6
|
}
|
|
@@ -5,8 +5,8 @@ interface ApolloLinkFactory {
|
|
|
5
5
|
}
|
|
6
6
|
export declare class ApolloLinkPlugin extends Plugin {
|
|
7
7
|
static readonly type = "apollo-link";
|
|
8
|
-
readonly cacheKey:
|
|
9
|
-
private factory;
|
|
8
|
+
readonly cacheKey: string;
|
|
9
|
+
private readonly factory;
|
|
10
10
|
private cache;
|
|
11
11
|
constructor(factory?: ApolloLinkFactory);
|
|
12
12
|
createLink(): ApolloLink;
|
|
@@ -5,10 +5,10 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
6
6
|
import { ApolloLink } from "apollo-link";
|
|
7
7
|
import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
|
|
8
|
+
|
|
8
9
|
/**
|
|
9
10
|
* This link checks for presence of `extensions.console` in the response and logs all items to browser console.
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
12
|
export var ConsoleLinkPlugin = /*#__PURE__*/function (_ApolloLinkPlugin) {
|
|
13
13
|
_inherits(ConsoleLinkPlugin, _ApolloLinkPlugin);
|
|
14
14
|
|
|
@@ -24,7 +24,8 @@ export var ConsoleLinkPlugin = /*#__PURE__*/function (_ApolloLinkPlugin) {
|
|
|
24
24
|
key: "createLink",
|
|
25
25
|
value: function createLink() {
|
|
26
26
|
return new ApolloLink(function (operation, forward) {
|
|
27
|
-
var
|
|
27
|
+
var firstDefinition = operation.query.definitions[0];
|
|
28
|
+
var isQuery = firstDefinition["operation"] === "query";
|
|
28
29
|
return forward(operation).map(function (data) {
|
|
29
30
|
if (data.extensions && Array.isArray(data.extensions.console) && data.extensions.console.length) {
|
|
30
31
|
var variables = isQuery ? JSON.stringify(operation.variables) : "{ see request details in the Network tab }";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
query:
|
|
4
|
-
networkError: any
|
|
5
|
-
}
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface Props {
|
|
3
|
+
query: string;
|
|
4
|
+
networkError: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
declare const ErrorOverlay: React.FC<Props>;
|
|
6
7
|
export default ErrorOverlay;
|
|
@@ -13,9 +13,9 @@ import { ReactComponent as CloseIcon } from "./assets/close_24px.svg";
|
|
|
13
13
|
var t = i18n.ns("app/graphql/error-overlay");
|
|
14
14
|
var ENVIRONMENT_VARIABLES_ARTICLE_LINK = "https://www.webiny.com/docs/how-to-guides/environment-variables";
|
|
15
15
|
|
|
16
|
-
var ErrorOverlay = function ErrorOverlay(
|
|
17
|
-
var query =
|
|
18
|
-
networkError =
|
|
16
|
+
var ErrorOverlay = function ErrorOverlay(props) {
|
|
17
|
+
var query = props.query,
|
|
18
|
+
networkError = props.networkError;
|
|
19
19
|
|
|
20
20
|
var _useState = useState(true),
|
|
21
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const OverlayWrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "
|
|
3
|
-
export declare const Pre: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, "
|
|
2
|
+
export declare const OverlayWrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "title" | "style" | "children" | "slot" | "id" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "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" | "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">, object>;
|
|
3
|
+
export declare const Pre: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, "className" | "title" | "style" | "children" | "slot" | "id" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "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" | "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">, object>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
query:
|
|
3
|
-
networkError: any
|
|
4
|
-
}
|
|
1
|
+
interface Params {
|
|
2
|
+
query: string;
|
|
3
|
+
networkError: Record<string, any>;
|
|
4
|
+
}
|
|
5
|
+
declare const createErrorOverlay: (params: Params) => void;
|
|
5
6
|
export default createErrorOverlay;
|
|
@@ -2,11 +2,10 @@ import React from "react";
|
|
|
2
2
|
import { render } from "react-dom";
|
|
3
3
|
import ErrorOverlay from "./ErrorOverlay";
|
|
4
4
|
|
|
5
|
-
var createErrorOverlay = function createErrorOverlay(
|
|
6
|
-
var query =
|
|
7
|
-
networkError =
|
|
5
|
+
var createErrorOverlay = function createErrorOverlay(params) {
|
|
6
|
+
var query = params.query,
|
|
7
|
+
networkError = params.networkError; // If the element already present in DOM, return immediately.
|
|
8
8
|
|
|
9
|
-
// If the element already present in DOM, return immediately.
|
|
10
9
|
if (document.getElementById("overlay-root")) {
|
|
11
10
|
return;
|
|
12
11
|
} // Create root element to hold React tree.
|
package/types.d.ts
CHANGED
|
@@ -2,6 +2,20 @@ import * as React from "react";
|
|
|
2
2
|
import { Plugin } from "@webiny/plugins/types";
|
|
3
3
|
import { ApolloClient } from "apollo-client";
|
|
4
4
|
import { CSSProperties } from "react";
|
|
5
|
+
export interface FileItem {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
key: string;
|
|
9
|
+
src: string;
|
|
10
|
+
size: number;
|
|
11
|
+
type: string;
|
|
12
|
+
tags: string[];
|
|
13
|
+
createdOn: string;
|
|
14
|
+
createdBy: {
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}
|
|
5
19
|
export declare type WebinyInitPlugin = Plugin & {
|
|
6
20
|
type: "webiny-init";
|
|
7
21
|
init(): void;
|
|
@@ -15,14 +29,14 @@ export declare type UiStatePlugin = Plugin & {
|
|
|
15
29
|
};
|
|
16
30
|
export declare type FileUploaderPlugin = Plugin & {
|
|
17
31
|
type: "file-uploader";
|
|
18
|
-
upload(file:
|
|
32
|
+
upload(file: FileItem, options: UploadOptions): Promise<any>;
|
|
19
33
|
};
|
|
20
34
|
export declare type AppFileManagerStoragePlugin = Plugin & {
|
|
21
35
|
type: "app-file-manager-storage";
|
|
22
|
-
upload(file:
|
|
36
|
+
upload(file: FileItem, options: UploadOptions): Promise<any>;
|
|
23
37
|
};
|
|
24
38
|
export { Plugin };
|
|
25
|
-
export
|
|
39
|
+
export interface ImageProps {
|
|
26
40
|
src: string;
|
|
27
41
|
preset?: string;
|
|
28
42
|
transform?: {
|
|
@@ -35,7 +49,7 @@ export declare type ImageProps = {
|
|
|
35
49
|
title?: string;
|
|
36
50
|
alt?: string;
|
|
37
51
|
style?: CSSProperties;
|
|
38
|
-
}
|
|
52
|
+
}
|
|
39
53
|
/**
|
|
40
54
|
* "getImageSrc" has to be defined as a separate property, so its functionality can be reused outside of
|
|
41
55
|
* the Image component. This is ideal in cases where manual creation of image src is needed.
|