@webiny/app-admin 5.23.1 → 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,16 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { API } from "@editorjs/editorjs";
|
|
2
|
+
import { ImageToolData, Tune, TuneOnChangeCallable } from "./types";
|
|
3
|
+
interface TunesParams {
|
|
4
|
+
api: API;
|
|
5
|
+
actions: Tune[];
|
|
6
|
+
onChange: TuneOnChangeCallable;
|
|
7
|
+
}
|
|
7
8
|
/**
|
|
8
9
|
* Working with Block Tunes
|
|
9
10
|
*/
|
|
10
11
|
export default class Tunes {
|
|
11
12
|
private api;
|
|
12
|
-
private actions;
|
|
13
|
-
private onChange;
|
|
13
|
+
private readonly actions;
|
|
14
|
+
private readonly onChange;
|
|
14
15
|
private buttons;
|
|
15
16
|
/**
|
|
16
17
|
* @param {object} tune - image tool Tunes managers
|
|
@@ -18,11 +19,7 @@ export default class Tunes {
|
|
|
18
19
|
* @param {object} tune.actions - list of user defined tunes
|
|
19
20
|
* @param {Function} tune.onChange - tune toggling callback
|
|
20
21
|
*/
|
|
21
|
-
constructor({ api, actions, onChange }:
|
|
22
|
-
api: any;
|
|
23
|
-
actions: any;
|
|
24
|
-
onChange: any;
|
|
25
|
-
});
|
|
22
|
+
constructor({ api, actions, onChange }: TunesParams);
|
|
26
23
|
/**
|
|
27
24
|
* Available Image tunes
|
|
28
25
|
*
|
|
@@ -46,13 +43,13 @@ export default class Tunes {
|
|
|
46
43
|
* @param {ImageToolData} toolData - generate Elements of tunes
|
|
47
44
|
* @returns {Element}
|
|
48
45
|
*/
|
|
49
|
-
render(toolData:
|
|
46
|
+
render(toolData: ImageToolData): HTMLElement;
|
|
50
47
|
/**
|
|
51
48
|
* Clicks to one of the tunes
|
|
52
49
|
*
|
|
53
50
|
* @param {string} tuneName - clicked tune name
|
|
54
51
|
* @param {Function} customFunction - function to execute on click
|
|
55
52
|
*/
|
|
56
|
-
tuneClicked(tuneName:
|
|
53
|
+
tuneClicked(tuneName: string, customFunction?: TuneOnChangeCallable): boolean;
|
|
57
54
|
}
|
|
58
55
|
export {};
|
|
@@ -83,7 +83,8 @@ var Tunes = /*#__PURE__*/function () {
|
|
|
83
83
|
_this.tuneClicked(tune.name, tune.action);
|
|
84
84
|
});
|
|
85
85
|
el.dataset.tune = tune.name;
|
|
86
|
-
|
|
86
|
+
var name = tune.name;
|
|
87
|
+
el.classList.toggle(_this.CSS.buttonActive, !!toolData[name]);
|
|
87
88
|
|
|
88
89
|
_this.buttons.push(el);
|
|
89
90
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface TuneOnChangeCallable {
|
|
2
|
+
(tune: string): boolean | void;
|
|
3
|
+
}
|
|
4
|
+
export interface Tune {
|
|
5
|
+
name: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
title: string;
|
|
8
|
+
action?: TuneOnChangeCallable;
|
|
9
|
+
}
|
|
10
|
+
export interface ImageToolData {
|
|
11
|
+
caption: string;
|
|
12
|
+
file: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ImageToolFile {
|
|
15
|
+
src: string;
|
|
16
|
+
}
|
|
17
|
+
export interface GetFileSourceCallable {
|
|
18
|
+
(file: ImageToolFile | string): string;
|
|
19
|
+
}
|
|
20
|
+
export interface OnSelectFileCallable {
|
|
21
|
+
(file: ImageToolFile): string;
|
|
22
|
+
}
|
|
23
|
+
export interface ImageToolConfig {
|
|
24
|
+
getFileSrc: GetFileSourceCallable;
|
|
25
|
+
onSelectFile: OnSelectFileCallable;
|
|
26
|
+
captionPlaceholder?: string;
|
|
27
|
+
actions: Tune[];
|
|
28
|
+
context: Record<string, any>;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
import { API } from "@editorjs/editorjs";
|
|
2
|
+
import { ImageToolConfig, ImageToolData } from "./types";
|
|
3
|
+
interface OnSelectFileCallable {
|
|
4
|
+
(): void;
|
|
5
|
+
}
|
|
6
|
+
interface UiStatus {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
}
|
|
9
|
+
interface UiParams {
|
|
10
|
+
api: API;
|
|
11
|
+
config: ImageToolConfig;
|
|
12
|
+
onSelectFile: OnSelectFileCallable;
|
|
13
|
+
readOnly: boolean;
|
|
14
|
+
}
|
|
1
15
|
/**
|
|
2
16
|
* Class for working with UI:
|
|
3
17
|
* - rendering base structure
|
|
@@ -7,9 +21,9 @@
|
|
|
7
21
|
export default class Ui {
|
|
8
22
|
private api;
|
|
9
23
|
private config;
|
|
10
|
-
private readOnly;
|
|
11
|
-
private onSelectFile;
|
|
12
|
-
nodes: {
|
|
24
|
+
private readonly readOnly;
|
|
25
|
+
private readonly onSelectFile;
|
|
26
|
+
readonly nodes: {
|
|
13
27
|
wrapper: HTMLElement;
|
|
14
28
|
imageContainer: HTMLElement;
|
|
15
29
|
fileButton: HTMLElement;
|
|
@@ -17,18 +31,13 @@ export default class Ui {
|
|
|
17
31
|
caption: HTMLElement;
|
|
18
32
|
};
|
|
19
33
|
/**
|
|
20
|
-
* @param
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
34
|
+
* @param ui - image tool Ui module
|
|
35
|
+
* @param ui.api - Editor.js API
|
|
36
|
+
* @param ui.config - user config
|
|
37
|
+
* @param ui.onSelectFile - callback for clicks on Select file button
|
|
38
|
+
* @param ui.readOnly - read-only mode flag
|
|
25
39
|
*/
|
|
26
|
-
constructor({ api, config, onSelectFile, readOnly }:
|
|
27
|
-
api: any;
|
|
28
|
-
config: any;
|
|
29
|
-
onSelectFile: any;
|
|
30
|
-
readOnly: any;
|
|
31
|
-
});
|
|
40
|
+
constructor({ api, config, onSelectFile, readOnly }: UiParams);
|
|
32
41
|
/**
|
|
33
42
|
* CSS classes
|
|
34
43
|
*
|
|
@@ -53,44 +62,41 @@ export default class Ui {
|
|
|
53
62
|
*
|
|
54
63
|
* @returns {{EMPTY: string, UPLOADING: string, FILLED: string}}
|
|
55
64
|
*/
|
|
56
|
-
static get status():
|
|
57
|
-
EMPTY: string;
|
|
58
|
-
FILLED: string;
|
|
59
|
-
};
|
|
65
|
+
static get status(): UiStatus;
|
|
60
66
|
/**
|
|
61
67
|
* Renders tool UI
|
|
62
68
|
*
|
|
63
69
|
* @param {ImageToolData} toolData - saved tool data
|
|
64
70
|
* @returns {Element}
|
|
65
71
|
*/
|
|
66
|
-
render(toolData:
|
|
72
|
+
render(toolData: ImageToolData): HTMLElement;
|
|
67
73
|
/**
|
|
68
74
|
* Creates upload-file button
|
|
69
75
|
*
|
|
70
76
|
* @returns {Element}
|
|
71
77
|
*/
|
|
72
|
-
createFileButton():
|
|
78
|
+
createFileButton(): HTMLElement;
|
|
73
79
|
/**
|
|
74
80
|
* Shows an image
|
|
75
81
|
*
|
|
76
82
|
* @param {string} url - image source
|
|
77
83
|
* @returns {void}
|
|
78
84
|
*/
|
|
79
|
-
fillImage(url:
|
|
85
|
+
fillImage(url: string): void;
|
|
80
86
|
/**
|
|
81
87
|
* Shows caption input
|
|
82
88
|
*
|
|
83
89
|
* @param {string} text - caption text
|
|
84
90
|
* @returns {void}
|
|
85
91
|
*/
|
|
86
|
-
fillCaption(text:
|
|
92
|
+
fillCaption(text: string): void;
|
|
87
93
|
/**
|
|
88
94
|
* Changes UI status
|
|
89
95
|
*
|
|
90
96
|
* @param {string} status - see {@link Ui.status} constants
|
|
91
97
|
* @returns {void}
|
|
92
98
|
*/
|
|
93
|
-
toggleStatus(status:
|
|
99
|
+
toggleStatus(status: string): void;
|
|
94
100
|
/**
|
|
95
101
|
* Apply visual representation of activated tune
|
|
96
102
|
*
|
|
@@ -98,7 +104,7 @@ export default class Ui {
|
|
|
98
104
|
* @param {boolean} status - true for enable, false for disable
|
|
99
105
|
* @returns {void}
|
|
100
106
|
*/
|
|
101
|
-
applyTune(tuneName:
|
|
107
|
+
applyTune(tuneName: string, status: boolean): void;
|
|
102
108
|
}
|
|
103
109
|
/**
|
|
104
110
|
* Helper for making Elements with attributes
|
|
@@ -106,6 +112,7 @@ export default class Ui {
|
|
|
106
112
|
* @param {string} tagName - new Element tag name
|
|
107
113
|
* @param {Array|string} classNames - list or name of CSS class
|
|
108
114
|
* @param {object} attributes - any attributes
|
|
109
|
-
* @returns {
|
|
115
|
+
* @returns {HTMLElement}
|
|
110
116
|
*/
|
|
111
|
-
export declare const make: (tagName:
|
|
117
|
+
export declare const make: (tagName: string, classNames?: string[] | string, attributes?: Record<string, string | number | boolean>) => HTMLElement;
|
|
118
|
+
export {};
|
|
@@ -11,11 +11,11 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
11
11
|
*/
|
|
12
12
|
var Ui = /*#__PURE__*/function () {
|
|
13
13
|
/**
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
14
|
+
* @param ui - image tool Ui module
|
|
15
|
+
* @param ui.api - Editor.js API
|
|
16
|
+
* @param ui.config - user config
|
|
17
|
+
* @param ui.onSelectFile - callback for clicks on Select file button
|
|
18
|
+
* @param ui.readOnly - read-only mode flag
|
|
19
19
|
*/
|
|
20
20
|
function Ui(_ref) {
|
|
21
21
|
var api = _ref.api,
|
|
@@ -204,9 +204,11 @@ var Ui = /*#__PURE__*/function () {
|
|
|
204
204
|
}, {
|
|
205
205
|
key: "fillCaption",
|
|
206
206
|
value: function fillCaption(text) {
|
|
207
|
-
if (this.nodes.caption) {
|
|
208
|
-
|
|
207
|
+
if (!this.nodes.caption) {
|
|
208
|
+
return;
|
|
209
209
|
}
|
|
210
|
+
|
|
211
|
+
this.nodes.caption.innerHTML = text;
|
|
210
212
|
}
|
|
211
213
|
/**
|
|
212
214
|
* Changes UI status
|
|
@@ -219,9 +221,12 @@ var Ui = /*#__PURE__*/function () {
|
|
|
219
221
|
key: "toggleStatus",
|
|
220
222
|
value: function toggleStatus(status) {
|
|
221
223
|
for (var statusType in Ui.status) {
|
|
222
|
-
if (Object.prototype.hasOwnProperty.call(Ui.status, statusType)) {
|
|
223
|
-
|
|
224
|
+
if (Object.prototype.hasOwnProperty.call(Ui.status, statusType) === false) {
|
|
225
|
+
continue;
|
|
224
226
|
}
|
|
227
|
+
|
|
228
|
+
var newStatus = Ui.status[statusType];
|
|
229
|
+
this.nodes.wrapper.classList.toggle("".concat(this.CSS.wrapper, "--").concat(newStatus), status === newStatus);
|
|
225
230
|
}
|
|
226
231
|
}
|
|
227
232
|
/**
|
|
@@ -255,14 +260,14 @@ var Ui = /*#__PURE__*/function () {
|
|
|
255
260
|
* @param {string} tagName - new Element tag name
|
|
256
261
|
* @param {Array|string} classNames - list or name of CSS class
|
|
257
262
|
* @param {object} attributes - any attributes
|
|
258
|
-
* @returns {
|
|
263
|
+
* @returns {HTMLElement}
|
|
259
264
|
*/
|
|
260
265
|
|
|
261
266
|
|
|
262
267
|
export { Ui as default };
|
|
263
268
|
export var make = function make(tagName) {
|
|
264
269
|
var classNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
265
|
-
var attributes = arguments.length > 2
|
|
270
|
+
var attributes = arguments.length > 2 ? arguments[2] : undefined;
|
|
266
271
|
var el = document.createElement(tagName);
|
|
267
272
|
|
|
268
273
|
if (Array.isArray(classNames)) {
|
|
@@ -273,7 +278,15 @@ export var make = function make(tagName) {
|
|
|
273
278
|
el.classList.add(classNames);
|
|
274
279
|
}
|
|
275
280
|
|
|
281
|
+
if (!attributes) {
|
|
282
|
+
return el;
|
|
283
|
+
}
|
|
284
|
+
|
|
276
285
|
for (var attrName in attributes) {
|
|
286
|
+
/**
|
|
287
|
+
* Unfortunately it is a problem to map attributes to element because element is complaining
|
|
288
|
+
* that attrName is a string, which cannot index the HTMLElement
|
|
289
|
+
*/
|
|
277
290
|
el[attrName] = attributes[attrName];
|
|
278
291
|
}
|
|
279
292
|
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PasteEvent } from "@editorjs/editorjs";
|
|
2
2
|
import { Alignment, TextAlign } from "../utils";
|
|
3
3
|
/**
|
|
4
4
|
* @typedef {object} ParagraphConfig
|
|
5
5
|
* @property {string} placeholder - placeholder for the empty paragraph
|
|
6
6
|
* @property {boolean} preserveBlank - Whether or not to keep blank paragraphs when saving editor data`
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
interface ParagraphConfig {
|
|
9
9
|
placeholder: string;
|
|
10
10
|
preserveBlank: boolean;
|
|
11
11
|
typography?: Typography;
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
13
|
/**
|
|
14
14
|
* @typedef {Object} ParagraphData
|
|
15
15
|
* @description Tool's input and output data format
|
|
16
16
|
* @property {String} text — Paragraph's content. Can include HTML tags: <a><b><i>
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
interface ParagraphData {
|
|
19
19
|
text: string;
|
|
20
20
|
textAlign: TextAlign;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
interface Typography {
|
|
23
24
|
[key: string]: {
|
|
24
25
|
label: string;
|
|
25
26
|
component: string;
|
|
26
27
|
className: string;
|
|
27
28
|
};
|
|
28
|
-
}
|
|
29
|
+
}
|
|
29
30
|
interface ParagraphArgs {
|
|
30
31
|
data: ParagraphData;
|
|
31
32
|
config: ParagraphConfig;
|
|
@@ -33,17 +34,16 @@ interface ParagraphArgs {
|
|
|
33
34
|
readOnly: boolean;
|
|
34
35
|
}
|
|
35
36
|
declare class Paragraph {
|
|
36
|
-
api
|
|
37
|
-
readOnly
|
|
38
|
-
_CSS
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
typography: Typography;
|
|
37
|
+
private readonly api;
|
|
38
|
+
private readonly readOnly;
|
|
39
|
+
private readonly _CSS;
|
|
40
|
+
private _data;
|
|
41
|
+
private readonly _element;
|
|
42
|
+
private readonly _placeholder;
|
|
43
|
+
private readonly _preserveBlank;
|
|
44
|
+
private readonly alignments;
|
|
45
|
+
private readonly settingsButtons;
|
|
46
|
+
private readonly typography;
|
|
47
47
|
/**
|
|
48
48
|
* Render plugin`s main Element and fill it with saved data
|
|
49
49
|
*
|
|
@@ -87,7 +87,7 @@ declare class Paragraph {
|
|
|
87
87
|
* @returns {ParagraphData} Current data
|
|
88
88
|
* @private
|
|
89
89
|
*/
|
|
90
|
-
get data():
|
|
90
|
+
get data(): ParagraphData;
|
|
91
91
|
/**
|
|
92
92
|
* Store data in plugin:
|
|
93
93
|
* - at the this._data property
|
|
@@ -96,7 +96,7 @@ declare class Paragraph {
|
|
|
96
96
|
* @param {ParagraphData} data — data to set
|
|
97
97
|
* @private
|
|
98
98
|
*/
|
|
99
|
-
set data(data:
|
|
99
|
+
set data(data: ParagraphData);
|
|
100
100
|
/**
|
|
101
101
|
* Used by Editor paste handling API.
|
|
102
102
|
* Provides configuration to handle P tags.
|
|
@@ -127,7 +127,7 @@ declare class Paragraph {
|
|
|
127
127
|
*
|
|
128
128
|
* @param {KeyboardEvent} e - key up event
|
|
129
129
|
*/
|
|
130
|
-
onKeyUp(e:
|
|
130
|
+
onKeyUp(e: KeyboardEvent): void;
|
|
131
131
|
/**
|
|
132
132
|
* Create Tool's view
|
|
133
133
|
* @return {HTMLElement}
|
|
@@ -139,7 +139,7 @@ declare class Paragraph {
|
|
|
139
139
|
*
|
|
140
140
|
* @returns {HTMLDivElement}
|
|
141
141
|
*/
|
|
142
|
-
render():
|
|
142
|
+
render(): HTMLDivElement;
|
|
143
143
|
/**
|
|
144
144
|
* Create Block's settings block
|
|
145
145
|
*
|
|
@@ -152,7 +152,7 @@ declare class Paragraph {
|
|
|
152
152
|
* @param {ParagraphData} data
|
|
153
153
|
* @public
|
|
154
154
|
*/
|
|
155
|
-
merge(data:
|
|
155
|
+
merge(data: ParagraphData): void;
|
|
156
156
|
/**
|
|
157
157
|
* Validate Paragraph block data:
|
|
158
158
|
* - check for emptiness
|
|
@@ -161,17 +161,17 @@ declare class Paragraph {
|
|
|
161
161
|
* @returns {boolean} false if saved data is not correct, otherwise true
|
|
162
162
|
* @public
|
|
163
163
|
*/
|
|
164
|
-
validate(savedData:
|
|
164
|
+
validate(savedData: ParagraphData): boolean;
|
|
165
165
|
/**
|
|
166
166
|
* Extract Tool's data from the view
|
|
167
167
|
* @param {HTMLDivElement} toolsContent - Paragraph tools rendered view
|
|
168
168
|
* @returns {ParagraphData} - saved data
|
|
169
169
|
* @public
|
|
170
170
|
*/
|
|
171
|
-
save(toolsContent:
|
|
172
|
-
text:
|
|
171
|
+
save(toolsContent: HTMLElement): {
|
|
172
|
+
text: string;
|
|
173
173
|
textAlign: TextAlign.START;
|
|
174
|
-
className:
|
|
174
|
+
className: string;
|
|
175
175
|
};
|
|
176
176
|
/**
|
|
177
177
|
* Extract textAlign from className
|
|
@@ -179,19 +179,19 @@ declare class Paragraph {
|
|
|
179
179
|
* @param {string} className - heading element className
|
|
180
180
|
* @returns {TextAlign} textAlign
|
|
181
181
|
*/
|
|
182
|
-
getTextAlign(className:
|
|
182
|
+
getTextAlign(className: string): TextAlign.START;
|
|
183
183
|
/**
|
|
184
184
|
* On paste callback fired from Editor.
|
|
185
185
|
*
|
|
186
186
|
* @param {PasteEvent} event - event with pasted data
|
|
187
187
|
*/
|
|
188
|
-
onPaste(event:
|
|
188
|
+
onPaste(event: PasteEvent): void;
|
|
189
189
|
/**
|
|
190
190
|
* Callback for Block's settings buttons
|
|
191
191
|
*
|
|
192
192
|
* @param {number} alignment - level to set
|
|
193
193
|
*/
|
|
194
|
-
setAlignment(alignment:
|
|
194
|
+
setAlignment(alignment: Alignment): void;
|
|
195
195
|
/**
|
|
196
196
|
* Callback for Block's settings buttons
|
|
197
197
|
*
|
|
@@ -206,6 +206,6 @@ declare class Paragraph {
|
|
|
206
206
|
* @returns {HeaderData}
|
|
207
207
|
* @private
|
|
208
208
|
*/
|
|
209
|
-
normalizeData(data
|
|
209
|
+
normalizeData(data?: Partial<ParagraphData>): ParagraphData;
|
|
210
210
|
}
|
|
211
211
|
export default Paragraph;
|
|
@@ -4,13 +4,10 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
6
|
import { ALIGNMENTS, TextAlign, ALIGNMENT_ICONS } from "../utils";
|
|
7
|
-
/**
|
|
8
|
-
* @typedef {object} ParagraphConfig
|
|
9
|
-
* @property {string} placeholder - placeholder for the empty paragraph
|
|
10
|
-
* @property {boolean} preserveBlank - Whether or not to keep blank paragraphs when saving editor data`
|
|
11
|
-
*/
|
|
12
7
|
|
|
13
8
|
var Paragraph = /*#__PURE__*/function () {
|
|
9
|
+
// private readonly _settings: any;
|
|
10
|
+
|
|
14
11
|
/**
|
|
15
12
|
* Render plugin`s main Element and fill it with saved data
|
|
16
13
|
*
|
|
@@ -34,8 +31,6 @@ var Paragraph = /*#__PURE__*/function () {
|
|
|
34
31
|
|
|
35
32
|
_defineProperty(this, "_CSS", void 0);
|
|
36
33
|
|
|
37
|
-
_defineProperty(this, "_settings", void 0);
|
|
38
|
-
|
|
39
34
|
_defineProperty(this, "_data", void 0);
|
|
40
35
|
|
|
41
36
|
_defineProperty(this, "_element", void 0);
|
|
@@ -74,8 +69,9 @@ var Paragraph = /*#__PURE__*/function () {
|
|
|
74
69
|
this._element = this.drawView();
|
|
75
70
|
this._preserveBlank = config.preserveBlank !== undefined ? config.preserveBlank : false;
|
|
76
71
|
this.settingsButtons = [];
|
|
77
|
-
this.alignments = ALIGNMENTS;
|
|
78
|
-
|
|
72
|
+
this.alignments = ALIGNMENTS; // Call the `data` setter, to properly render the view element.
|
|
73
|
+
|
|
74
|
+
this.data = this._data;
|
|
79
75
|
}
|
|
80
76
|
/**
|
|
81
77
|
* Default placeholder for Paragraph Tool
|
|
@@ -320,9 +316,9 @@ var Paragraph = /*#__PURE__*/function () {
|
|
|
320
316
|
}, {
|
|
321
317
|
key: "merge",
|
|
322
318
|
value: function merge(data) {
|
|
323
|
-
this.data = {
|
|
319
|
+
this.data = _objectSpread(_objectSpread({}, this.data), {}, {
|
|
324
320
|
text: this.data.text + data.text
|
|
325
|
-
};
|
|
321
|
+
});
|
|
326
322
|
}
|
|
327
323
|
/**
|
|
328
324
|
* Validate Paragraph block data:
|
|
@@ -382,10 +378,10 @@ var Paragraph = /*#__PURE__*/function () {
|
|
|
382
378
|
}, {
|
|
383
379
|
key: "onPaste",
|
|
384
380
|
value: function onPaste(event) {
|
|
385
|
-
var
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
381
|
+
var detail = event.detail;
|
|
382
|
+
this.data = _objectSpread(_objectSpread({}, this.data), {}, {
|
|
383
|
+
text: detail.data.innerHTML
|
|
384
|
+
});
|
|
389
385
|
}
|
|
390
386
|
/**
|
|
391
387
|
* Callback for Block's settings buttons
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { API } from "@editorjs/editorjs";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
interface Config {
|
|
3
|
+
themeColors: string[];
|
|
4
|
+
}
|
|
5
|
+
interface TextColorToolParams {
|
|
5
6
|
api: API;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
config: Config;
|
|
8
|
+
}
|
|
9
|
+
declare class TextColorTool {
|
|
10
|
+
private _state;
|
|
11
|
+
private color;
|
|
12
|
+
private readonly api;
|
|
13
|
+
private readonly tag;
|
|
14
|
+
private readonly class;
|
|
15
|
+
private colorPicker;
|
|
16
|
+
private button;
|
|
17
|
+
private readonly config;
|
|
18
|
+
private readonly _CSS;
|
|
19
|
+
constructor({ api, config }: TextColorToolParams);
|
|
18
20
|
static get isInline(): boolean;
|
|
19
21
|
/**
|
|
20
22
|
* Sanitize method returns rules to let Editor know which HTML tags it should respect.
|
|
@@ -35,19 +37,18 @@ declare class TextColorTool {
|
|
|
35
37
|
/**
|
|
36
38
|
* Finally, when button is pressed Editor calls
|
|
37
39
|
* surround method of the tool with Range object as an argument.
|
|
38
|
-
* @param range
|
|
39
40
|
*/
|
|
40
|
-
surround(range:
|
|
41
|
-
wrap(range:
|
|
42
|
-
unwrap(range:
|
|
43
|
-
showActions(mark:
|
|
41
|
+
surround(range: Range): void;
|
|
42
|
+
wrap(range: Range): void;
|
|
43
|
+
unwrap(range: Range): void;
|
|
44
|
+
showActions(mark: HTMLElement): void;
|
|
44
45
|
hideActions(): void;
|
|
45
46
|
/**
|
|
46
47
|
* CheckState method of each Inline Tool is called by Editor with current `Selection`
|
|
47
48
|
* when user selects some text
|
|
48
49
|
*/
|
|
49
50
|
checkState(): void;
|
|
50
|
-
convertToHex(color:
|
|
51
|
+
convertToHex(color: string): string;
|
|
51
52
|
clear(): void;
|
|
52
53
|
}
|
|
53
54
|
export default TextColorTool;
|
|
@@ -113,7 +113,6 @@ var TextColorTool = /*#__PURE__*/function () {
|
|
|
113
113
|
/**
|
|
114
114
|
* Finally, when button is pressed Editor calls
|
|
115
115
|
* surround method of the tool with Range object as an argument.
|
|
116
|
-
* @param range
|
|
117
116
|
*/
|
|
118
117
|
|
|
119
118
|
}, {
|
|
@@ -213,6 +212,9 @@ var TextColorTool = /*#__PURE__*/function () {
|
|
|
213
212
|
// so markup added by Inline Tool will be removed on pasting or on saving.
|
|
214
213
|
// We need this config so that `class` & `style` attributes will remain intact for "span".
|
|
215
214
|
return {
|
|
215
|
+
/**
|
|
216
|
+
* TODO: figure out the element type
|
|
217
|
+
*/
|
|
216
218
|
span: function span(el) {
|
|
217
219
|
// Respect `class` and `style` attributes if this condition is meet.
|
|
218
220
|
if (el.classList.contains(COLOR_TOOL_CLASS)) {
|
package/components/Routes.d.ts
CHANGED
package/components/SearchUI.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface SearchProps {
|
|
3
3
|
value: string;
|
|
4
4
|
onChange: (value: string) => void;
|
|
5
5
|
inputPlaceholder?: string;
|
|
6
|
-
}
|
|
7
|
-
declare const Search:
|
|
6
|
+
}
|
|
7
|
+
declare const Search: React.FC<SearchProps>;
|
|
8
8
|
export default Search;
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const title: string;
|
|
3
|
-
declare const icon: string;
|
|
4
2
|
export declare const SimpleForm: (props: {
|
|
5
3
|
children: React.ReactNode;
|
|
6
4
|
"data-testid"?: string;
|
|
7
5
|
noElevation?: boolean;
|
|
8
6
|
className?: string;
|
|
9
7
|
}) => JSX.Element;
|
|
10
|
-
|
|
8
|
+
interface SimpleFormHeaderProps {
|
|
11
9
|
title: React.ReactNode;
|
|
12
10
|
icon?: React.ReactElement<any>;
|
|
13
11
|
children?: React.ReactNode;
|
|
14
|
-
}
|
|
15
|
-
export declare const
|
|
12
|
+
}
|
|
13
|
+
export declare const SimpleFormHeader: React.FC<SimpleFormHeaderProps>;
|
|
14
|
+
interface SimpleFormFooterProps {
|
|
16
15
|
children: React.ReactNode;
|
|
17
|
-
}
|
|
18
|
-
export declare const
|
|
19
|
-
|
|
20
|
-
}) => any;
|
|
16
|
+
}
|
|
17
|
+
export declare const SimpleFormFooter: React.FC<SimpleFormFooterProps>;
|
|
18
|
+
export declare const SimpleFormContent: React.FC;
|
|
21
19
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
interface InputBoxProps {
|
|
3
3
|
value?: string | number;
|
|
4
4
|
onChange?: (value: any) => void;
|
|
5
5
|
defaultValue?: string | number;
|
|
6
6
|
[key: string]: any;
|
|
7
|
-
}
|
|
8
|
-
declare const _default: React.
|
|
7
|
+
}
|
|
8
|
+
declare const _default: React.NamedExoticComponent<InputBoxProps>;
|
|
9
9
|
export default _default;
|