@webiny/app-admin 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/base/Admin.d.ts +1 -8
- package/base/Base.d.ts +1 -1
- package/base/plugins/AddGraphQLQuerySelection.d.ts +2 -2
- package/base/providers/ApolloProvider.d.ts +9 -3
- package/base/providers/TelemetryProvider.d.ts +2 -4
- package/base/providers/TelemetryProvider.js +5 -0
- package/base/providers/UiStateProvider.d.ts +1 -3
- package/base/providers/ViewCompositionProvider.d.ts +2 -4
- package/base/ui/Menu.d.ts +6 -1
- package/base/ui/Menu.js +87 -25
- package/base/ui/Navigation.d.ts +3 -5
- package/base/ui/Navigation.js +9 -26
- package/base/ui/Search.d.ts +2 -5
- package/base/ui/Tags.d.ts +1 -1
- package/base/ui/UserMenu.d.ts +2 -5
- package/components/AdminLayout.d.ts +1 -2
- package/components/AppInstaller/AppInstaller.d.ts +2 -4
- package/components/AppInstaller/Sidebar.d.ts +8 -6
- package/components/AppInstaller/Sidebar.js +9 -9
- package/components/AppInstaller/styled.d.ts +4 -4
- package/components/AppInstaller/useInstaller.d.ts +26 -9
- package/components/AppInstaller/useInstaller.js +42 -34
- package/components/EmptyView.d.ts +4 -4
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.d.ts +5 -4
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.js +2 -1
- package/components/FileManager/BottomInfoBar/UploadStatus.d.ts +5 -4
- package/components/FileManager/BottomInfoBar.d.ts +4 -2
- package/components/FileManager/DropFilesHere.d.ts +4 -3
- package/components/FileManager/DropFilesHere.js +5 -2
- package/components/FileManager/File.d.ts +7 -8
- package/components/FileManager/File.js +11 -5
- package/components/FileManager/FileDetails/Name.d.ts +7 -5
- package/components/FileManager/FileDetails/Name.js +2 -2
- package/components/FileManager/FileDetails/Tags.d.ts +7 -5
- package/components/FileManager/FileDetails/Tags.js +4 -2
- package/components/FileManager/FileDetails.d.ts +6 -8
- package/components/FileManager/FileDetails.js +14 -2
- package/components/FileManager/FileManagerContext.d.ts +12 -9
- package/components/FileManager/FileManagerContext.js +9 -7
- package/components/FileManager/FileManagerView.d.ts +2 -10
- package/components/FileManager/FileManagerView.js +19 -8
- package/components/FileManager/LeftSidebar.d.ts +6 -5
- package/components/FileManager/LeftSidebar.js +4 -4
- package/components/FileManager/NoPermissionView.d.ts +2 -2
- package/components/FileManager/NoResults.d.ts +3 -2
- package/components/FileManager/NoResults.js +5 -2
- package/components/FileManager/getFileTypePlugin.d.ts +4 -1
- package/components/FileManager/getFileTypePlugin.js +5 -0
- package/components/FileManager/getFileUploader.d.ts +2 -1
- package/components/FileManager/outputFileSelectionError.d.ts +4 -1
- package/components/FileManager/outputFileSelectionError.js +5 -0
- package/components/FileManager/types.d.ts +49 -0
- package/components/FileManager/types.js +1 -0
- package/components/FileManager.d.ts +15 -10
- package/components/FileManager.js +15 -12
- package/components/FloatingActionButton.d.ts +2 -2
- package/components/MultiImageUpload.d.ts +13 -4
- package/components/MultiImageUpload.js +15 -4
- package/components/OverlayLayout/OverlayLayout.d.ts +9 -12
- package/components/Permissions/StyledComponents.d.ts +6 -4
- package/components/RichTextEditor/RichTextEditor.d.ts +2 -2
- package/components/RichTextEditor/tools/header/index.d.ts +33 -34
- package/components/RichTextEditor/tools/header/index.js +2 -3
- package/components/RichTextEditor/tools/image/index.d.ts +36 -13
- package/components/RichTextEditor/tools/image/index.js +4 -2
- package/components/RichTextEditor/tools/image/tunes.d.ts +12 -15
- package/components/RichTextEditor/tools/image/tunes.js +2 -1
- package/components/RichTextEditor/tools/image/types.d.ts +29 -0
- package/components/RichTextEditor/tools/image/types.js +1 -0
- package/components/RichTextEditor/tools/image/ui.d.ts +33 -26
- package/components/RichTextEditor/tools/image/ui.js +24 -11
- package/components/RichTextEditor/tools/paragraph/index.d.ts +31 -31
- package/components/RichTextEditor/tools/paragraph/index.js +11 -15
- package/components/RichTextEditor/tools/textColor/index.d.ts +22 -21
- package/components/RichTextEditor/tools/textColor/index.js +3 -1
- package/components/Routes.d.ts +2 -2
- package/components/SearchUI.d.ts +4 -4
- package/components/SimpleForm/SimpleForm.d.ts +7 -9
- package/components/SimpleUI/InputField.d.ts +3 -3
- package/components/SimpleUI/InputField.js +18 -18
- package/components/SingleImageUpload.d.ts +4 -9
- package/components/SingleImageUpload.js +2 -1
- package/components/SplitView/SplitView.d.ts +5 -5
- package/hooks/useConfirmationDialog.d.ts +6 -5
- package/hooks/useConfirmationDialog.js +1 -2
- package/hooks/useDialog.d.ts +8 -3
- package/hooks/useDialog.js +1 -1
- package/hooks/useSnackbar.d.ts +6 -3
- package/package.json +17 -14
- package/plugins/FileManagerFileTypePlugin.d.ts +1 -1
- package/plugins/MenuPlugin.d.ts +3 -3
- package/plugins/fileManager/fileImage/DeleteAction.d.ts +6 -2
- package/plugins/fileManager/fileImage/EditAction.d.ts +7 -6
- package/plugins/fileManager/fileImage/EditAction.js +18 -9
- package/plugins/globalSearch/SearchBar.d.ts +13 -0
- package/plugins/globalSearch/SearchBar.js +5 -0
- package/plugins/globalSearch/SearchBarDropdown.d.ts +16 -1
- package/plugins/globalSearch/index.d.ts +2 -1
- package/plugins/globalSearch/styled.d.ts +3 -3
- package/plugins/index.d.ts +2 -1
- package/types.d.ts +8 -6
- package/ui/UIElement.d.ts +1 -1
- package/ui/UIView.d.ts +1 -1
- package/ui/elements/AccordionElement.d.ts +5 -5
- package/ui/elements/AccordionElement.js +4 -0
- package/ui/elements/ButtonElement.d.ts +3 -3
- package/ui/elements/ButtonGroupElement.d.ts +2 -2
- package/ui/elements/NavigationMenuElement.d.ts +5 -1
- package/ui/elements/NavigationMenuElement.js +3 -2
- package/ui/elements/PlaceholderElement.d.ts +2 -1
- package/ui/elements/SmallButtonElement.d.ts +1 -1
- package/ui/elements/TypographyElement.d.ts +1 -1
- package/ui/elements/form/FileManagerElement/styled.d.ts +9 -9
- package/ui/elements/form/FileManagerElement.d.ts +4 -3
- package/ui/elements/form/FormElement.d.ts +5 -5
- package/ui/elements/form/FormFieldElement.d.ts +6 -5
- package/ui/elements/form/FormFieldElement.js +5 -5
- package/ui/elements/form/InputElement.d.ts +1 -0
- package/ui/views/AdminView/HeaderSectionCenterElement.d.ts +2 -2
- package/ui/views/AdminView/HeaderSectionLeftElement.d.ts +2 -2
- package/ui/views/AdminView/HeaderSectionRightElement.d.ts +2 -2
- package/ui/views/AdminView/components/Hamburger.d.ts +2 -2
- package/ui/views/AdminView/components/Snackbar.d.ts +2 -2
- package/ui/views/FormView/FormContainerElement.d.ts +2 -2
- package/ui/views/FormView/FormFooterElement.d.ts +3 -3
- package/ui/views/FormView/FormHeaderElement.d.ts +2 -2
- package/ui/views/FormView.d.ts +1 -1
- package/ui/views/FormView.js +4 -2
- package/ui/views/OverlayView/ContentElement.d.ts +2 -2
- package/ui/views/OverlayView/HeaderElement.d.ts +5 -5
- package/ui/views/OverlayView/useOverlayView.d.ts +4 -5
- package/ui/views/OverlayView/useOverlayView.js +2 -2
- package/ui/views/OverlayView.d.ts +4 -6
- package/ui/views/SplitView/SplitViewPanelElement.d.ts +3 -3
- package/ui/views/SplitView.d.ts +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
toggleTag:
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface LeftSidebarProps {
|
|
3
|
+
toggleTag: (item: string) => void;
|
|
4
4
|
queryParams: {
|
|
5
|
-
tags:
|
|
5
|
+
tags: string[];
|
|
6
6
|
};
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
|
+
declare const LeftSidebar: React.FC<LeftSidebarProps>;
|
|
8
9
|
export default LeftSidebar;
|
|
@@ -54,9 +54,9 @@ var Tag = /*#__PURE__*/styled("div", {
|
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
function LeftSidebar(
|
|
58
|
-
var toggleTag =
|
|
59
|
-
tags =
|
|
57
|
+
var LeftSidebar = function LeftSidebar(props) {
|
|
58
|
+
var toggleTag = props.toggleTag,
|
|
59
|
+
tags = props.queryParams.tags;
|
|
60
60
|
var activeTags = Array.isArray(tags) ? tags : [];
|
|
61
61
|
|
|
62
62
|
var _useQuery = useQuery(LIST_TAGS),
|
|
@@ -90,6 +90,6 @@ function LeftSidebar(_ref) {
|
|
|
90
90
|
icon: /*#__PURE__*/React.createElement(TagIcon, null)
|
|
91
91
|
}), " ", item);
|
|
92
92
|
})));
|
|
93
|
-
}
|
|
93
|
+
};
|
|
94
94
|
|
|
95
95
|
export default LeftSidebar;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const NoPermissionView:
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const NoPermissionView: React.FC;
|
|
3
3
|
export default NoPermissionView;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const DropFilesHere: React.FC;
|
|
3
|
+
export default DropFilesHere;
|
|
@@ -6,8 +6,11 @@ var styles = /*#__PURE__*/css({
|
|
|
6
6
|
position: "absolute",
|
|
7
7
|
width: "100%"
|
|
8
8
|
}, "label:styles;");
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
var DropFilesHere = function DropFilesHere() {
|
|
10
11
|
return /*#__PURE__*/React.createElement("div", {
|
|
11
12
|
className: styles
|
|
12
13
|
}, /*#__PURE__*/React.createElement("div", null, "No results found."));
|
|
13
|
-
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default DropFilesHere;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { AdminFileManagerFileTypePlugin } from "../../types";
|
|
2
|
+
import { FileManagerFileTypePlugin } from "../../plugins/FileManagerFileTypePlugin";
|
|
3
|
+
import { FileItem } from "./types";
|
|
4
|
+
export default function getFileTypePlugin(file: FileItem): AdminFileManagerFileTypePlugin | FileManagerFileTypePlugin;
|
|
@@ -9,6 +9,11 @@ export default function getFileTypePlugin(file) {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
var fileTypePlugins = [].concat(_toConsumableArray(plugins.byType("admin-file-manager-file-type")), _toConsumableArray(plugins.byType(FileManagerFileTypePlugin.type)));
|
|
12
|
+
/**
|
|
13
|
+
* TODO: if we are searching last available plugin, we can refactor this.
|
|
14
|
+
* TODO: check out @pavel
|
|
15
|
+
*/
|
|
16
|
+
|
|
12
17
|
var plugin = null;
|
|
13
18
|
|
|
14
19
|
for (var i = 0; i < fileTypePlugins.length; i++) {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { AppFileManagerStoragePlugin } from "@webiny/app/types";
|
|
2
|
+
declare const _default: () => AppFileManagerStoragePlugin["upload"];
|
|
2
3
|
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface FileItem {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
key: string;
|
|
5
|
+
src: string;
|
|
6
|
+
size: number;
|
|
7
|
+
type: string;
|
|
8
|
+
tags: string[];
|
|
9
|
+
createdOn: string;
|
|
10
|
+
createdBy: {
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export interface CreateFileResponse {
|
|
16
|
+
fileManager: {
|
|
17
|
+
createFile: {
|
|
18
|
+
data: FileItem;
|
|
19
|
+
error?: Error | null;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface UpdateFileResponse {
|
|
24
|
+
fileManager: {
|
|
25
|
+
updateFile: {
|
|
26
|
+
data: FileItem;
|
|
27
|
+
error?: Error | null;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface ListFilesResponse {
|
|
32
|
+
fileManager: {
|
|
33
|
+
listFiles: {
|
|
34
|
+
data: FileItem[];
|
|
35
|
+
error?: Error | null;
|
|
36
|
+
meta: {
|
|
37
|
+
hasMoreItems: boolean;
|
|
38
|
+
totalItem: number;
|
|
39
|
+
cursor: string | null;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface ListFileTagsResponse {
|
|
45
|
+
fileManager: {
|
|
46
|
+
listTags: string[];
|
|
47
|
+
error: Error | null;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FileItem } from "./FileManager/types";
|
|
3
|
+
export interface ShowFileManagerCallable {
|
|
4
|
+
(onChange?: (file?: FileItem | FileItem[]) => void): void;
|
|
5
|
+
}
|
|
6
|
+
export interface FileManagerPropsChildren {
|
|
7
|
+
showFileManager: ShowFileManagerCallable;
|
|
8
|
+
}
|
|
9
|
+
export interface FileManagerProps {
|
|
10
|
+
onChange?: (files: FileItem[] | FileItem) => void;
|
|
4
11
|
onChangePick?: string[];
|
|
5
12
|
images?: boolean;
|
|
6
13
|
multiple?: boolean;
|
|
7
14
|
accept?: Array<string>;
|
|
8
|
-
children: (
|
|
9
|
-
showFileManager: any;
|
|
10
|
-
}) => React.ReactNode;
|
|
15
|
+
children: (params: FileManagerPropsChildren) => React.ReactNode;
|
|
11
16
|
maxSize?: number | string;
|
|
12
17
|
multipleMaxCount?: number;
|
|
13
18
|
multipleMaxSize?: number | string;
|
|
14
19
|
onClose?: Function;
|
|
15
|
-
onUploadCompletion?:
|
|
16
|
-
}
|
|
17
|
-
export declare
|
|
18
|
-
export
|
|
20
|
+
onUploadCompletion?: (files: FileItem[]) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare type FileManagerPortalProps = Omit<FileManagerProps, "children">;
|
|
23
|
+
export declare const FileManager: React.FC<FileManagerProps>;
|
|
@@ -8,15 +8,11 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
8
8
|
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
10
|
var _excluded = ["children"];
|
|
11
|
-
import
|
|
11
|
+
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
12
12
|
import ReactDOM from "react-dom";
|
|
13
13
|
import FileManagerView from "./FileManager/FileManagerView";
|
|
14
14
|
import pick from "lodash/pick";
|
|
15
15
|
import { FileManagerProvider } from "./FileManager/FileManagerContext";
|
|
16
|
-
var useState = React.useState,
|
|
17
|
-
useRef = React.useRef,
|
|
18
|
-
useCallback = React.useCallback,
|
|
19
|
-
useEffect = React.useEffect;
|
|
20
16
|
|
|
21
17
|
var FileManagerPortal = /*#__PURE__*/function (_React$Component) {
|
|
22
18
|
_inherits(FileManagerPortal, _React$Component);
|
|
@@ -67,15 +63,22 @@ var FileManagerPortal = /*#__PURE__*/function (_React$Component) {
|
|
|
67
63
|
var container = this.container;
|
|
68
64
|
|
|
69
65
|
var handleFileOnChange = function handleFileOnChange(files) {
|
|
66
|
+
if (!files || files.length === 0) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
70
|
var fields = Array.isArray(onChangePick) ? onChangePick : ["id", "name", "key", "src", "size", "type"];
|
|
71
71
|
|
|
72
|
-
if (Array.isArray(files)) {
|
|
73
|
-
|
|
72
|
+
if (Array.isArray(files) === true) {
|
|
73
|
+
var items = files.map(function (file) {
|
|
74
74
|
return pick(file, fields);
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
});
|
|
76
|
+
onChange(items);
|
|
77
|
+
return;
|
|
78
78
|
}
|
|
79
|
+
|
|
80
|
+
var file = pick(files, fields);
|
|
81
|
+
onChange(file);
|
|
79
82
|
};
|
|
80
83
|
|
|
81
84
|
var props = {
|
|
@@ -101,7 +104,7 @@ var FileManagerPortal = /*#__PURE__*/function (_React$Component) {
|
|
|
101
104
|
return FileManagerPortal;
|
|
102
105
|
}(React.Component);
|
|
103
106
|
|
|
104
|
-
export function FileManager(_ref) {
|
|
107
|
+
export var FileManager = function FileManager(_ref) {
|
|
105
108
|
var children = _ref.children,
|
|
106
109
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
107
110
|
|
|
@@ -130,4 +133,4 @@ export function FileManager(_ref) {
|
|
|
130
133
|
})), children({
|
|
131
134
|
showFileManager: showFileManager
|
|
132
135
|
}));
|
|
133
|
-
}
|
|
136
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const FloatingActionButton:
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const FloatingActionButton: React.FC;
|
|
3
3
|
export { FloatingActionButton };
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* TODO @ts-refactor
|
|
4
|
+
*/
|
|
5
|
+
interface Props {
|
|
6
|
+
imagePreviewProps: {
|
|
7
|
+
src: string;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
declare const MultiImageUpload: React.FC<Props>;
|
|
13
|
+
export default MultiImageUpload;
|
|
@@ -2,13 +2,22 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
2
2
|
var _excluded = ["imagePreviewProps"];
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Image } from "@webiny/app/components/Image";
|
|
5
|
-
import { MultiImageUpload as UiMultiImageUpload } from "@webiny/ui/ImageUpload";
|
|
5
|
+
import { MultiImageUpload as UiMultiImageUpload } from "@webiny/ui/ImageUpload";
|
|
6
|
+
/**
|
|
7
|
+
* TODO @ts-refactor
|
|
8
|
+
*/
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
var MultiImageUpload = function MultiImageUpload(_ref) {
|
|
8
11
|
var imagePreviewProps = _ref.imagePreviewProps,
|
|
9
12
|
multiImageUploadProps = _objectWithoutProperties(_ref, _excluded);
|
|
10
13
|
|
|
11
|
-
return /*#__PURE__*/React.createElement(UiMultiImageUpload
|
|
14
|
+
return /*#__PURE__*/React.createElement(UiMultiImageUpload
|
|
15
|
+
/**
|
|
16
|
+
* TODO @ts-refactor
|
|
17
|
+
* It appers that renderImagePreview does not exist on UiMultiImageUpload. So how did this work?
|
|
18
|
+
*/
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
, Object.assign({
|
|
12
21
|
renderImagePreview: function renderImagePreview(renderImageProps) {
|
|
13
22
|
return /*#__PURE__*/React.createElement(Image, Object.assign({
|
|
14
23
|
transform: {
|
|
@@ -17,4 +26,6 @@ export default function MultiImageUpload(_ref) {
|
|
|
17
26
|
}, imagePreviewProps, renderImageProps));
|
|
18
27
|
}
|
|
19
28
|
}, multiImageUploadProps));
|
|
20
|
-
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default MultiImageUpload;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
import { ExitHandler } from "react-transition-group/Transition";
|
|
3
|
+
interface OverlayLayoutProps {
|
|
3
4
|
barMiddle?: React.ReactNode;
|
|
4
5
|
barLeft?: React.ReactNode;
|
|
5
6
|
barRight?: React.ReactNode;
|
|
6
7
|
children: React.ReactNode;
|
|
7
|
-
onExited?:
|
|
8
|
+
onExited?: ExitHandler<HTMLElement>;
|
|
8
9
|
style?: React.CSSProperties;
|
|
9
|
-
}
|
|
10
|
-
|
|
10
|
+
}
|
|
11
|
+
interface State {
|
|
11
12
|
isVisible: boolean;
|
|
12
|
-
}
|
|
13
|
+
}
|
|
13
14
|
export declare class OverlayLayout extends React.Component<OverlayLayoutProps, State> {
|
|
14
|
-
constructor(props:
|
|
15
|
-
static defaultProps:
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
state: {
|
|
19
|
-
isVisible: boolean;
|
|
20
|
-
};
|
|
15
|
+
constructor(props: OverlayLayoutProps);
|
|
16
|
+
static defaultProps: Partial<OverlayLayoutProps>;
|
|
17
|
+
state: State;
|
|
21
18
|
hideComponent(): void;
|
|
22
19
|
componentWillUnmount(): void;
|
|
23
20
|
render(): JSX.Element;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
export declare const flexClass: string;
|
|
3
3
|
export declare const gridNoPaddingClass: string;
|
|
4
|
-
|
|
5
|
-
title:
|
|
6
|
-
}
|
|
4
|
+
interface Props {
|
|
5
|
+
title: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const PermissionInfo: React.FC<Props>;
|
|
8
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { RichTextEditorProps } from "@webiny/ui/RichTextEditor";
|
|
3
|
-
export declare const RichTextEditor:
|
|
3
|
+
export declare const RichTextEditor: React.FC<RichTextEditorProps>;
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HTMLPasteEvent } from "@editorjs/editorjs";
|
|
2
2
|
import { TextAlign, Alignment } from "../utils";
|
|
3
|
-
|
|
3
|
+
interface Typography {
|
|
4
4
|
[key: string]: {
|
|
5
5
|
label: string;
|
|
6
6
|
component: string;
|
|
7
7
|
className: string;
|
|
8
8
|
};
|
|
9
|
-
}
|
|
10
|
-
|
|
9
|
+
}
|
|
10
|
+
export interface HeaderData {
|
|
11
11
|
text: string;
|
|
12
|
-
level:
|
|
13
|
-
textAlign
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
level: number;
|
|
13
|
+
textAlign?: TextAlign;
|
|
14
|
+
alignment?: Alignment;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
interface HeaderConfig {
|
|
16
18
|
levels: number[];
|
|
17
19
|
typography: Typography;
|
|
18
|
-
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
defaultLevel?: number;
|
|
22
|
+
}
|
|
19
23
|
interface HeaderArgs {
|
|
20
24
|
data: HeaderData;
|
|
21
25
|
config: HeaderConfig;
|
|
@@ -23,15 +27,15 @@ interface HeaderArgs {
|
|
|
23
27
|
readOnly: boolean;
|
|
24
28
|
}
|
|
25
29
|
declare class Header {
|
|
26
|
-
api
|
|
27
|
-
readOnly
|
|
28
|
-
settingsButtons
|
|
29
|
-
_CSS
|
|
30
|
-
_settings
|
|
31
|
-
_data
|
|
32
|
-
_element
|
|
33
|
-
alignments
|
|
34
|
-
typography
|
|
30
|
+
private readonly api;
|
|
31
|
+
private readonly readOnly;
|
|
32
|
+
private readonly settingsButtons;
|
|
33
|
+
private readonly _CSS;
|
|
34
|
+
private readonly _settings;
|
|
35
|
+
private _data;
|
|
36
|
+
private _element;
|
|
37
|
+
private readonly alignments;
|
|
38
|
+
private readonly typography;
|
|
35
39
|
/**
|
|
36
40
|
* Render plugin`s main Element and fill it with saved data
|
|
37
41
|
*
|
|
@@ -50,7 +54,7 @@ declare class Header {
|
|
|
50
54
|
* @returns {HeaderData}
|
|
51
55
|
* @private
|
|
52
56
|
*/
|
|
53
|
-
normalizeData(data:
|
|
57
|
+
normalizeData(data: Partial<HeaderData>): HeaderData;
|
|
54
58
|
/**
|
|
55
59
|
* Return Tool's view
|
|
56
60
|
*
|
|
@@ -69,13 +73,13 @@ declare class Header {
|
|
|
69
73
|
*
|
|
70
74
|
* @param {number} level - level to set
|
|
71
75
|
*/
|
|
72
|
-
setLevel(level:
|
|
76
|
+
setLevel(level: number): void;
|
|
73
77
|
/**
|
|
74
78
|
* Callback for Block's settings buttons
|
|
75
79
|
*
|
|
76
80
|
* @param {number} alignment - level to set
|
|
77
81
|
*/
|
|
78
|
-
setAlignment(alignment:
|
|
82
|
+
setAlignment(alignment: Alignment): void;
|
|
79
83
|
/**
|
|
80
84
|
* Method that specified how to merge two Text blocks.
|
|
81
85
|
* Called by Editor.js by backspace at the beginning of the Block
|
|
@@ -83,7 +87,7 @@ declare class Header {
|
|
|
83
87
|
* @param {HeaderData} data - saved data to merger with current block
|
|
84
88
|
* @public
|
|
85
89
|
*/
|
|
86
|
-
merge(data:
|
|
90
|
+
merge(data: HeaderData): void;
|
|
87
91
|
/**
|
|
88
92
|
* Validate Text block data:
|
|
89
93
|
* - check for emptiness
|
|
@@ -92,7 +96,7 @@ declare class Header {
|
|
|
92
96
|
* @returns {boolean} false if saved data is not correct, otherwise true
|
|
93
97
|
* @public
|
|
94
98
|
*/
|
|
95
|
-
validate(blockData:
|
|
99
|
+
validate(blockData: HeaderData): boolean;
|
|
96
100
|
/**
|
|
97
101
|
* Extract Tool's data from the view
|
|
98
102
|
*
|
|
@@ -100,19 +104,14 @@ declare class Header {
|
|
|
100
104
|
* @returns {HeaderData} - saved data
|
|
101
105
|
* @public
|
|
102
106
|
*/
|
|
103
|
-
save(toolsContent:
|
|
104
|
-
text: any;
|
|
105
|
-
level: number;
|
|
106
|
-
textAlign: TextAlign.START;
|
|
107
|
-
className: any;
|
|
108
|
-
};
|
|
107
|
+
save(toolsContent: HTMLHeadingElement): HeaderData;
|
|
109
108
|
/**
|
|
110
109
|
* Extract textAlign from className
|
|
111
110
|
*
|
|
112
111
|
* @param {string} className - heading element className
|
|
113
112
|
* @returns {TextAlign} textAlign
|
|
114
113
|
*/
|
|
115
|
-
getTextAlign(className:
|
|
114
|
+
getTextAlign(className: string): TextAlign;
|
|
116
115
|
/**
|
|
117
116
|
* Allow Header to be converted to/from other blocks
|
|
118
117
|
*/
|
|
@@ -139,7 +138,7 @@ declare class Header {
|
|
|
139
138
|
* @returns {HeaderData} Current data
|
|
140
139
|
* @private
|
|
141
140
|
*/
|
|
142
|
-
get data():
|
|
141
|
+
get data(): HeaderData;
|
|
143
142
|
/**
|
|
144
143
|
* Store data in plugin:
|
|
145
144
|
* - at the this._data property
|
|
@@ -148,7 +147,7 @@ declare class Header {
|
|
|
148
147
|
* @param {HeaderData} data — data to set
|
|
149
148
|
* @private
|
|
150
149
|
*/
|
|
151
|
-
set data(data:
|
|
150
|
+
set data(data: HeaderData);
|
|
152
151
|
/**
|
|
153
152
|
* Get tag for target level
|
|
154
153
|
* By default returns second-leveled header
|
|
@@ -201,9 +200,9 @@ declare class Header {
|
|
|
201
200
|
/**
|
|
202
201
|
* Handle H1-H6 tags on paste to substitute it with header Tool
|
|
203
202
|
*
|
|
204
|
-
* @param {
|
|
203
|
+
* @param {HTMLPasteEvent} event - event with pasted content
|
|
205
204
|
*/
|
|
206
|
-
onPaste(event:
|
|
205
|
+
onPaste(event: HTMLPasteEvent): void;
|
|
207
206
|
/**
|
|
208
207
|
* Used by Editor.js paste handling API.
|
|
209
208
|
* Provides configuration to handle H1-H6 tags.
|
|
@@ -288,12 +288,11 @@ var Header = /*#__PURE__*/function () {
|
|
|
288
288
|
}, {
|
|
289
289
|
key: "merge",
|
|
290
290
|
value: function merge(data) {
|
|
291
|
-
|
|
291
|
+
this.data = {
|
|
292
292
|
text: this.data.text + data.text,
|
|
293
293
|
level: this.data.level,
|
|
294
294
|
alignment: this.data.alignment
|
|
295
295
|
};
|
|
296
|
-
this.data = newData;
|
|
297
296
|
}
|
|
298
297
|
/**
|
|
299
298
|
* Validate Text block data:
|
|
@@ -607,7 +606,7 @@ var Header = /*#__PURE__*/function () {
|
|
|
607
606
|
/**
|
|
608
607
|
* Handle H1-H6 tags on paste to substitute it with header Tool
|
|
609
608
|
*
|
|
610
|
-
* @param {
|
|
609
|
+
* @param {HTMLPasteEvent} event - event with pasted content
|
|
611
610
|
*/
|
|
612
611
|
|
|
613
612
|
}, {
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
import { API } from "@editorjs/editorjs";
|
|
2
|
+
import { Tune } from "./types";
|
|
3
|
+
interface File {
|
|
4
|
+
src: string;
|
|
5
|
+
}
|
|
6
|
+
interface GetFileSourceCallable {
|
|
7
|
+
(file: File | string): string;
|
|
8
|
+
}
|
|
9
|
+
interface OnSelectFileCallable {
|
|
10
|
+
(file: File): string;
|
|
11
|
+
}
|
|
12
|
+
interface ImageToolData {
|
|
13
|
+
caption: string;
|
|
14
|
+
file: string;
|
|
15
|
+
}
|
|
16
|
+
interface ImageToolParams {
|
|
17
|
+
data: ImageToolData;
|
|
18
|
+
config: Config;
|
|
19
|
+
api: API;
|
|
20
|
+
readOnly: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface Config {
|
|
23
|
+
getFileSrc: GetFileSourceCallable;
|
|
24
|
+
onSelectFile: OnSelectFileCallable;
|
|
25
|
+
actions: Tune[];
|
|
26
|
+
context: Record<string, any>;
|
|
27
|
+
}
|
|
1
28
|
export default class ImageTool {
|
|
2
29
|
private readonly api;
|
|
3
30
|
private readonly readOnly;
|
|
@@ -22,12 +49,7 @@ export default class ImageTool {
|
|
|
22
49
|
icon: string;
|
|
23
50
|
title: string;
|
|
24
51
|
};
|
|
25
|
-
constructor({ data, config, api, readOnly }:
|
|
26
|
-
data: any;
|
|
27
|
-
config: any;
|
|
28
|
-
api: any;
|
|
29
|
-
readOnly: any;
|
|
30
|
-
});
|
|
52
|
+
constructor({ data, config, api, readOnly }: ImageToolParams);
|
|
31
53
|
/**
|
|
32
54
|
* Renders Block content
|
|
33
55
|
*
|
|
@@ -43,7 +65,7 @@ export default class ImageTool {
|
|
|
43
65
|
*
|
|
44
66
|
* @returns {ImageToolData}
|
|
45
67
|
*/
|
|
46
|
-
save():
|
|
68
|
+
save(): ImageToolData;
|
|
47
69
|
/**
|
|
48
70
|
* Makes buttons with tunes: stretch image
|
|
49
71
|
*
|
|
@@ -51,7 +73,7 @@ export default class ImageTool {
|
|
|
51
73
|
*
|
|
52
74
|
* @returns {Element}
|
|
53
75
|
*/
|
|
54
|
-
renderSettings():
|
|
76
|
+
renderSettings(): HTMLElement;
|
|
55
77
|
/**
|
|
56
78
|
* Stores all Tool's data
|
|
57
79
|
*
|
|
@@ -59,7 +81,7 @@ export default class ImageTool {
|
|
|
59
81
|
*
|
|
60
82
|
* @param {ImageToolData} data - data in Image Tool format
|
|
61
83
|
*/
|
|
62
|
-
set data(data:
|
|
84
|
+
set data(data: ImageToolData);
|
|
63
85
|
/**
|
|
64
86
|
* Return Tool data
|
|
65
87
|
*
|
|
@@ -67,7 +89,7 @@ export default class ImageTool {
|
|
|
67
89
|
*
|
|
68
90
|
* @returns {ImageToolData}
|
|
69
91
|
*/
|
|
70
|
-
get data():
|
|
92
|
+
get data(): ImageToolData;
|
|
71
93
|
/**
|
|
72
94
|
* Set new image file
|
|
73
95
|
*
|
|
@@ -75,7 +97,7 @@ export default class ImageTool {
|
|
|
75
97
|
*
|
|
76
98
|
* @param {object} file - uploaded file data
|
|
77
99
|
*/
|
|
78
|
-
set image(file:
|
|
100
|
+
set image(file: File | string);
|
|
79
101
|
/**
|
|
80
102
|
* Callback fired when Block Tune is activated
|
|
81
103
|
*
|
|
@@ -84,7 +106,7 @@ export default class ImageTool {
|
|
|
84
106
|
* @param {string} tuneName - tune that has been clicked
|
|
85
107
|
* @returns {void}
|
|
86
108
|
*/
|
|
87
|
-
tuneToggled(tuneName:
|
|
109
|
+
tuneToggled(tuneName: string): void;
|
|
88
110
|
/**
|
|
89
111
|
* Set one tune
|
|
90
112
|
*
|
|
@@ -92,6 +114,7 @@ export default class ImageTool {
|
|
|
92
114
|
* @param {boolean} value - tune state
|
|
93
115
|
* @returns {void}
|
|
94
116
|
*/
|
|
95
|
-
setTune(tuneName:
|
|
117
|
+
setTune(tuneName: string, value: boolean): void;
|
|
96
118
|
isReadOnly(): boolean;
|
|
97
119
|
}
|
|
120
|
+
export {};
|
|
@@ -158,8 +158,10 @@ var ImageTool = /*#__PURE__*/function () {
|
|
|
158
158
|
this._data.caption = data.caption || "";
|
|
159
159
|
this.ui.fillCaption(this._data.caption);
|
|
160
160
|
Tunes.tunes.forEach(function (_ref2) {
|
|
161
|
-
var
|
|
162
|
-
var
|
|
161
|
+
var name = _ref2.name;
|
|
162
|
+
var tune = name;
|
|
163
|
+
var initialValue = data[tune];
|
|
164
|
+
var value = initialValue === true || initialValue === "true";
|
|
163
165
|
|
|
164
166
|
_this2.setTune(tune, value);
|
|
165
167
|
});
|