zs_library 0.3.13 → 0.3.15
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/README.md +4 -0
- package/dist/components/{Desktop → desktop}/context/config/context.d.ts +3 -3
- package/dist/components/{Desktop → desktop}/index.d.ts +2 -2
- package/dist/components/{Desktop/Items/GroupItem.d.ts → desktop/items/group-item.d.ts} +1 -1
- package/dist/components/{Desktop/Sortable.d.ts → desktop/sortable.d.ts} +2 -2
- package/dist/components/dock/dock-desktop.d.ts +8 -0
- package/dist/components/dock/dock-mobile.d.ts +10 -0
- package/dist/components/dock/index.d.ts +18 -0
- package/dist/components/dock/utils.d.ts +2 -0
- package/dist/components/index.d.ts +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +1103 -944
- package/dist/index.umd.js +97 -97
- package/dist/zs_library.css +1 -0
- package/package.json +114 -116
- package/dist/components/Editor/components/BlockTools/MediaAndEmbed/Image/index.d.ts +0 -146
- package/dist/components/Editor/components/BlockTools/MediaAndEmbed/Image/types/types.d.ts +0 -172
- package/dist/components/Editor/components/BlockTools/MediaAndEmbed/Image/ui.d.ts +0 -132
- package/dist/components/Editor/components/BlockTools/MediaAndEmbed/Image/uploader.d.ts +0 -60
- package/dist/components/Editor/components/BlockTools/MediaAndEmbed/Image/utils/dom.d.ts +0 -10
- package/dist/components/Editor/components/BlockTools/MediaAndEmbed/Image/utils/isPromise.d.ts +0 -7
- package/dist/components/Editor/components/BlockTools/TextAndTypography/Alert/index.d.ts +0 -238
- package/dist/components/Editor/components/BlockTools/TextAndTypography/Delimiter/index.d.ts +0 -270
- package/dist/components/Editor/components/BlockTools/TextAndTypography/Header/index.d.ts +0 -249
- package/dist/components/Editor/components/BlockTools/TextAndTypography/Paragraph/index.d.ts +0 -189
- package/dist/components/Editor/components/BlockTools/TextAndTypography/Paragraph/utils/makeFragment.d.ts +0 -7
- package/dist/components/Editor/components/BlockTools/TextAndTypography/Quote/index.d.ts +0 -282
- package/dist/components/Editor/components/BlockTuneTools/Delete/index.d.ts +0 -33
- package/dist/components/Editor/components/BlockTuneTools/MoveDown/index.d.ts +0 -37
- package/dist/components/Editor/components/BlockTuneTools/MoveUp/index.d.ts +0 -37
- package/dist/components/Editor/index.d.ts +0 -9
- package/dist/style.css +0 -1
- /package/dist/components/{Desktop → desktop}/config.d.ts +0 -0
- /package/dist/components/{Desktop → desktop}/context/config/hooks.d.ts +0 -0
- /package/dist/components/{Desktop → desktop}/context/state/context.d.ts +0 -0
- /package/dist/components/{Desktop → desktop}/context/state/hooks.d.ts +0 -0
- /package/dist/components/{Desktop/ContextMenu → desktop/context-menu}/index.d.ts +0 -0
- /package/dist/components/{Desktop/Items/Modal/GroupItemModal.d.ts → desktop/items/modal/group-item-modal.d.ts} +0 -0
- /package/dist/components/{Desktop/Items/Modal/InfoModal.d.ts → desktop/items/modal/info-modal.d.ts} +0 -0
- /package/dist/components/{Desktop/Items/SortableItem.d.ts → desktop/items/sortable-item.d.ts} +0 -0
- /package/dist/components/{Desktop → desktop}/style.d.ts +0 -0
- /package/dist/components/{Desktop → desktop}/theme.d.ts +0 -0
- /package/dist/components/{Desktop → desktop}/types.d.ts +0 -0
- /package/dist/components/{Desktop → desktop}/utils.d.ts +0 -0
- /package/dist/components/{MdEditor → md-editor}/i18n/index.d.ts +0 -0
- /package/dist/components/{MdEditor → md-editor}/i18n/zh_CN.d.ts +0 -0
- /package/dist/components/{MdEditor → md-editor}/index.d.ts +0 -0
- /package/dist/components/{MdEditor → md-editor}/preview.d.ts +0 -0
- /package/dist/components/{MdEditor → md-editor}/style.d.ts +0 -0
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { TunesMenuConfig } from '@editorjs/editorjs/types/tools';
|
|
2
|
-
import { ToolboxConfig, PasteConfig, BlockToolConstructorOptions, BlockTool, PasteEvent } from '@editorjs/editorjs';
|
|
3
|
-
import { ActionConfig, ImageToolData, ImageConfig } from './types/types';
|
|
4
|
-
type ImageToolConstructorOptions = BlockToolConstructorOptions<ImageToolData, ImageConfig>;
|
|
5
|
-
/**
|
|
6
|
-
* Implementation of ImageTool class
|
|
7
|
-
*/
|
|
8
|
-
export default class ImageTool implements BlockTool {
|
|
9
|
-
/**
|
|
10
|
-
* Editor.js API instance
|
|
11
|
-
*/
|
|
12
|
-
private api;
|
|
13
|
-
/**
|
|
14
|
-
* Flag indicating read-only mode
|
|
15
|
-
*/
|
|
16
|
-
private readOnly;
|
|
17
|
-
/**
|
|
18
|
-
* Current Block API instance
|
|
19
|
-
*/
|
|
20
|
-
private block;
|
|
21
|
-
/**
|
|
22
|
-
* Configuration for the ImageTool
|
|
23
|
-
*/
|
|
24
|
-
private config;
|
|
25
|
-
/**
|
|
26
|
-
* Uploader module instance
|
|
27
|
-
*/
|
|
28
|
-
private uploader;
|
|
29
|
-
/**
|
|
30
|
-
* UI module instance
|
|
31
|
-
*/
|
|
32
|
-
private ui;
|
|
33
|
-
/**
|
|
34
|
-
* Stores current block data internally
|
|
35
|
-
*/
|
|
36
|
-
private _data;
|
|
37
|
-
/**
|
|
38
|
-
* @param tool - tool properties got from editor.js
|
|
39
|
-
* @param tool.data - previously saved data
|
|
40
|
-
* @param tool.config - user config for Tool
|
|
41
|
-
* @param tool.api - Editor.js API
|
|
42
|
-
* @param tool.readOnly - read-only mode flag
|
|
43
|
-
* @param tool.block - current Block API
|
|
44
|
-
*/
|
|
45
|
-
constructor({ data, config, api, readOnly, block, }: ImageToolConstructorOptions);
|
|
46
|
-
/**
|
|
47
|
-
* Notify core that read-only mode is supported
|
|
48
|
-
*/
|
|
49
|
-
static get isReadOnlySupported(): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Get Tool toolbox settings
|
|
52
|
-
* icon - Tool icon's SVG
|
|
53
|
-
* title - title to show in toolbox
|
|
54
|
-
*/
|
|
55
|
-
static get toolbox(): ToolboxConfig;
|
|
56
|
-
/**
|
|
57
|
-
* Available image tools
|
|
58
|
-
*/
|
|
59
|
-
static get tunes(): Array<ActionConfig>;
|
|
60
|
-
/**
|
|
61
|
-
* Renders Block content
|
|
62
|
-
*/
|
|
63
|
-
render(): HTMLDivElement;
|
|
64
|
-
/**
|
|
65
|
-
* Validate data: check if Image exists
|
|
66
|
-
* @param savedData — data received after saving
|
|
67
|
-
* @returns false if saved data is not correct, otherwise true
|
|
68
|
-
*/
|
|
69
|
-
validate(savedData: ImageToolData): boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Return Block data
|
|
72
|
-
*/
|
|
73
|
-
save(): ImageToolData;
|
|
74
|
-
/**
|
|
75
|
-
* Returns configuration for block tunes: add background, add border, stretch image
|
|
76
|
-
* @returns TunesMenuConfig
|
|
77
|
-
*/
|
|
78
|
-
renderSettings(): TunesMenuConfig;
|
|
79
|
-
/**
|
|
80
|
-
* Fires after clicks on the Toolbox Image Icon
|
|
81
|
-
* Initiates click on the Select File button
|
|
82
|
-
*/
|
|
83
|
-
appendCallback(): void;
|
|
84
|
-
/**
|
|
85
|
-
* Specify paste substitutes
|
|
86
|
-
* @see {@link https://github.com/codex-team/editor.js/blob/master/docs/tools.md#paste-handling}
|
|
87
|
-
*/
|
|
88
|
-
static get pasteConfig(): PasteConfig;
|
|
89
|
-
/**
|
|
90
|
-
* Specify paste handlers
|
|
91
|
-
* @see {@link https://github.com/codex-team/editor.js/blob/master/docs/tools.md#paste-handling}
|
|
92
|
-
* @param event - editor.js custom paste event
|
|
93
|
-
* {@link https://github.com/codex-team/editor.js/blob/master/types/tools/paste-events.d.ts}
|
|
94
|
-
*/
|
|
95
|
-
onPaste(event: PasteEvent): Promise<void>;
|
|
96
|
-
/**
|
|
97
|
-
* Private methods
|
|
98
|
-
* ̿̿ ̿̿ ̿̿ ̿'̿'\̵͇̿̿\з= ( ▀ ͜͞ʖ▀) =ε/̵͇̿̿/’̿’̿ ̿ ̿̿ ̿̿ ̿̿
|
|
99
|
-
*/
|
|
100
|
-
/**
|
|
101
|
-
* Stores all Tool's data
|
|
102
|
-
* @param data - data in Image Tool format
|
|
103
|
-
*/
|
|
104
|
-
private set data(value);
|
|
105
|
-
/**
|
|
106
|
-
* Return Tool data
|
|
107
|
-
*/
|
|
108
|
-
private get data();
|
|
109
|
-
/**
|
|
110
|
-
* Set new image file
|
|
111
|
-
* @param file - uploaded file data
|
|
112
|
-
*/
|
|
113
|
-
private set image(value);
|
|
114
|
-
/**
|
|
115
|
-
* File uploading callback
|
|
116
|
-
* @param response - uploading server response
|
|
117
|
-
*/
|
|
118
|
-
private onUpload;
|
|
119
|
-
/**
|
|
120
|
-
* Handle uploader errors
|
|
121
|
-
* @param errorText - uploading error info
|
|
122
|
-
*/
|
|
123
|
-
private uploadingFailed;
|
|
124
|
-
/**
|
|
125
|
-
* Callback fired when Block Tune is activated
|
|
126
|
-
* @param tuneName - tune that has been clicked
|
|
127
|
-
*/
|
|
128
|
-
private tuneToggled;
|
|
129
|
-
/**
|
|
130
|
-
* Set one tune
|
|
131
|
-
* @param tuneName - {@link Tunes.tunes}
|
|
132
|
-
* @param value - tune state
|
|
133
|
-
*/
|
|
134
|
-
private setTune;
|
|
135
|
-
/**
|
|
136
|
-
* Show preloader and upload image file
|
|
137
|
-
* @param file - file that is currently uploading (from paste)
|
|
138
|
-
*/
|
|
139
|
-
private uploadFile;
|
|
140
|
-
/**
|
|
141
|
-
* Show preloader and upload image by target url
|
|
142
|
-
* @param url - url pasted
|
|
143
|
-
*/
|
|
144
|
-
private uploadUrl;
|
|
145
|
-
}
|
|
146
|
-
export {};
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { HTMLPasteEventDetail } from '@editorjs/editorjs';
|
|
2
|
-
/**
|
|
3
|
-
* Represents options for uploading, including a function to handle previewing.
|
|
4
|
-
*/
|
|
5
|
-
export interface UploadOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Callback function to be called when the preview is ready.
|
|
8
|
-
* @param src - The source of the preview as a string.
|
|
9
|
-
* @returns void
|
|
10
|
-
*/
|
|
11
|
-
onPreview: (src: string) => void;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* User configuration of Image block tunes. Allows to add custom tunes through the config
|
|
15
|
-
*/
|
|
16
|
-
export interface ActionConfig {
|
|
17
|
-
/**
|
|
18
|
-
* The name of the tune.
|
|
19
|
-
*/
|
|
20
|
-
name: string;
|
|
21
|
-
/**
|
|
22
|
-
* The icon for the tune. Should be an SVG string.
|
|
23
|
-
*/
|
|
24
|
-
icon: string;
|
|
25
|
-
/**
|
|
26
|
-
* The title of the tune. This will be displayed in the UI.
|
|
27
|
-
*/
|
|
28
|
-
title: string;
|
|
29
|
-
/**
|
|
30
|
-
* An optional flag indicating whether the tune is a toggle (true) or not (false).
|
|
31
|
-
*/
|
|
32
|
-
toggle?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* An optional action function to be executed when the tune is activated.
|
|
35
|
-
*/
|
|
36
|
-
action?: Function;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* UploadResponseFormat interface representing the response format expected from the backend on file uploading.
|
|
40
|
-
*/
|
|
41
|
-
export interface UploadResponseFormat<AdditionalFileData = {}> {
|
|
42
|
-
/**
|
|
43
|
-
* success - 1 for successful uploading, 0 for failure
|
|
44
|
-
*/
|
|
45
|
-
success: number;
|
|
46
|
-
/**
|
|
47
|
-
* Object with file data.
|
|
48
|
-
* 'url' is required,
|
|
49
|
-
* also can contain any additional data that will be saved and passed back
|
|
50
|
-
*/
|
|
51
|
-
file: {
|
|
52
|
-
/**
|
|
53
|
-
* The URL of the uploaded image.
|
|
54
|
-
*/
|
|
55
|
-
url: string;
|
|
56
|
-
} & AdditionalFileData;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* ImageToolData type representing the input and output data format for the image tool, including optional custome actions.
|
|
60
|
-
*/
|
|
61
|
-
export type ImageToolData<Actions = {}, AdditionalFileData = {}> = {
|
|
62
|
-
/**
|
|
63
|
-
* Caption for the image.
|
|
64
|
-
*/
|
|
65
|
-
caption: string;
|
|
66
|
-
/**
|
|
67
|
-
* Flag indicating whether the image has a border.
|
|
68
|
-
*/
|
|
69
|
-
withBorder: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Flag indicating whether the image has a background.
|
|
72
|
-
*/
|
|
73
|
-
withBackground: boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Flag indicating whether the image is stretched.
|
|
76
|
-
*/
|
|
77
|
-
stretched: boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Object containing the URL of the image file.
|
|
80
|
-
* Also can contain any additional data.
|
|
81
|
-
*/
|
|
82
|
-
file: {
|
|
83
|
-
/**
|
|
84
|
-
* The URL of the image.
|
|
85
|
-
*/
|
|
86
|
-
url: string;
|
|
87
|
-
} & AdditionalFileData;
|
|
88
|
-
} & (Actions extends Record<string, boolean> ? Actions : {});
|
|
89
|
-
/**
|
|
90
|
-
*
|
|
91
|
-
* @description Config supported by Tool
|
|
92
|
-
*/
|
|
93
|
-
export interface ImageConfig {
|
|
94
|
-
/**
|
|
95
|
-
* Endpoints for upload, whether using file or URL.
|
|
96
|
-
*/
|
|
97
|
-
endpoints: {
|
|
98
|
-
/**
|
|
99
|
-
* Endpoint for file upload.
|
|
100
|
-
*/
|
|
101
|
-
byFile?: string;
|
|
102
|
-
/**
|
|
103
|
-
* Endpoints for URL upload.
|
|
104
|
-
*/
|
|
105
|
-
byUrl?: string;
|
|
106
|
-
};
|
|
107
|
-
/**
|
|
108
|
-
* Field name for the uploaded image.
|
|
109
|
-
*/
|
|
110
|
-
field?: string;
|
|
111
|
-
/**
|
|
112
|
-
* Allowed mime-types for the uploaded image.
|
|
113
|
-
*/
|
|
114
|
-
types?: string;
|
|
115
|
-
/**
|
|
116
|
-
* Placeholder text for the caption field.
|
|
117
|
-
*/
|
|
118
|
-
captionPlaceholder?: string;
|
|
119
|
-
/**
|
|
120
|
-
* Additional data to send with requests.
|
|
121
|
-
*/
|
|
122
|
-
additionalRequestData?: object;
|
|
123
|
-
/**
|
|
124
|
-
* Additional headers to send with requests.
|
|
125
|
-
*/
|
|
126
|
-
additionalRequestHeaders?: object;
|
|
127
|
-
/**
|
|
128
|
-
* Custom content for the select file button.
|
|
129
|
-
*/
|
|
130
|
-
buttonContent?: string;
|
|
131
|
-
/**
|
|
132
|
-
* Optional custom uploader.
|
|
133
|
-
*/
|
|
134
|
-
uploader?: {
|
|
135
|
-
/**
|
|
136
|
-
* Method to upload an image by file.
|
|
137
|
-
*/
|
|
138
|
-
uploadByFile?: (file: Blob) => Promise<UploadResponseFormat>;
|
|
139
|
-
/**
|
|
140
|
-
* Method to upload an image by URL.
|
|
141
|
-
*/
|
|
142
|
-
uploadByUrl?: (url: string) => Promise<UploadResponseFormat>;
|
|
143
|
-
};
|
|
144
|
-
/**
|
|
145
|
-
* Additional actions for the tool.
|
|
146
|
-
*/
|
|
147
|
-
actions?: ActionConfig[];
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Interface representing the details of a paste event for HTML elements.
|
|
151
|
-
* Extends the `HTMLPasteEventDetail` interface to include additional data properties.
|
|
152
|
-
*/
|
|
153
|
-
export interface HTMLPasteEventDetailExtended extends HTMLPasteEventDetail {
|
|
154
|
-
/**
|
|
155
|
-
* The data property containing the source of the image and HTML element details.
|
|
156
|
-
*/
|
|
157
|
-
data: {
|
|
158
|
-
/**
|
|
159
|
-
* The source URL of the pasted image.
|
|
160
|
-
*/
|
|
161
|
-
src: string;
|
|
162
|
-
} & HTMLElement;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Parameter type of Image setter function in ImageTool
|
|
166
|
-
*/
|
|
167
|
-
export type ImageSetterParam = {
|
|
168
|
-
/**
|
|
169
|
-
* url path of the image
|
|
170
|
-
*/
|
|
171
|
-
url: string;
|
|
172
|
-
};
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { API } from '@editorjs/editorjs';
|
|
2
|
-
import { ImageToolData, ImageConfig } from './types/types';
|
|
3
|
-
/**
|
|
4
|
-
* Nodes interface representing various elements in the UI.
|
|
5
|
-
*/
|
|
6
|
-
interface Nodes {
|
|
7
|
-
/**
|
|
8
|
-
* Wrapper element in the UI.
|
|
9
|
-
*/
|
|
10
|
-
wrapper: HTMLElement;
|
|
11
|
-
/**
|
|
12
|
-
* Container for the image element in the UI.
|
|
13
|
-
*/
|
|
14
|
-
imageContainer: HTMLElement;
|
|
15
|
-
/**
|
|
16
|
-
* Button for selecting files.
|
|
17
|
-
*/
|
|
18
|
-
fileButton: HTMLElement;
|
|
19
|
-
/**
|
|
20
|
-
* Represents the image element in the UI, if one is present; otherwise, it's undefined.
|
|
21
|
-
*/
|
|
22
|
-
imageEl?: HTMLElement;
|
|
23
|
-
/**
|
|
24
|
-
* Preloader element for the image.
|
|
25
|
-
*/
|
|
26
|
-
imagePreloader: HTMLElement;
|
|
27
|
-
/**
|
|
28
|
-
* Caption element for the image.
|
|
29
|
-
*/
|
|
30
|
-
caption: HTMLElement;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* ConstructorParams interface representing parameters for the Ui class constructor.
|
|
34
|
-
*/
|
|
35
|
-
interface ConstructorParams {
|
|
36
|
-
/**
|
|
37
|
-
* Editor.js API.
|
|
38
|
-
*/
|
|
39
|
-
api: API;
|
|
40
|
-
/**
|
|
41
|
-
* Configuration for the image.
|
|
42
|
-
*/
|
|
43
|
-
config: ImageConfig;
|
|
44
|
-
/**
|
|
45
|
-
* Callback function for selecting a file.
|
|
46
|
-
*/
|
|
47
|
-
onSelectFile: () => void;
|
|
48
|
-
/**
|
|
49
|
-
* Flag indicating if the UI is in read-only mode.
|
|
50
|
-
*/
|
|
51
|
-
readOnly: boolean;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Class for working with UI:
|
|
55
|
-
* - rendering base structure
|
|
56
|
-
* - show/hide preview
|
|
57
|
-
* - apply tune view
|
|
58
|
-
*/
|
|
59
|
-
export default class Ui {
|
|
60
|
-
/**
|
|
61
|
-
* Nodes representing various elements in the UI.
|
|
62
|
-
*/
|
|
63
|
-
nodes: Nodes;
|
|
64
|
-
/**
|
|
65
|
-
* API instance for Editor.js.
|
|
66
|
-
*/
|
|
67
|
-
private api;
|
|
68
|
-
/**
|
|
69
|
-
* Configuration for the image tool.
|
|
70
|
-
*/
|
|
71
|
-
private config;
|
|
72
|
-
/**
|
|
73
|
-
* Callback function for selecting a file.
|
|
74
|
-
*/
|
|
75
|
-
private onSelectFile;
|
|
76
|
-
/**
|
|
77
|
-
* Flag indicating if the UI is in read-only mode.
|
|
78
|
-
*/
|
|
79
|
-
private readOnly;
|
|
80
|
-
/**
|
|
81
|
-
* @param ui - image tool Ui module
|
|
82
|
-
* @param ui.api - Editor.js API
|
|
83
|
-
* @param ui.config - user config
|
|
84
|
-
* @param ui.onSelectFile - callback for clicks on Select file button
|
|
85
|
-
* @param ui.readOnly - read-only mode flag
|
|
86
|
-
*/
|
|
87
|
-
constructor({ api, config, onSelectFile, readOnly }: ConstructorParams);
|
|
88
|
-
/**
|
|
89
|
-
* Apply visual representation of activated tune
|
|
90
|
-
* @param tuneName - one of available tunes {@link Tunes.tunes}
|
|
91
|
-
* @param status - true for enable, false for disable
|
|
92
|
-
*/
|
|
93
|
-
applyTune(tuneName: string, status: boolean): void;
|
|
94
|
-
/**
|
|
95
|
-
* Renders tool UI
|
|
96
|
-
* @param toolData - saved tool data
|
|
97
|
-
*/
|
|
98
|
-
render(toolData: ImageToolData): HTMLElement;
|
|
99
|
-
/**
|
|
100
|
-
* Shows uploading preloader
|
|
101
|
-
* @param src - preview source
|
|
102
|
-
*/
|
|
103
|
-
showPreloader(src: string): void;
|
|
104
|
-
/**
|
|
105
|
-
* Hide uploading preloader
|
|
106
|
-
*/
|
|
107
|
-
hidePreloader(): void;
|
|
108
|
-
/**
|
|
109
|
-
* Shows an image
|
|
110
|
-
* @param url - image source
|
|
111
|
-
*/
|
|
112
|
-
fillImage(url: string): void;
|
|
113
|
-
/**
|
|
114
|
-
* Shows caption input
|
|
115
|
-
* @param text - caption content text
|
|
116
|
-
*/
|
|
117
|
-
fillCaption(text: string): void;
|
|
118
|
-
/**
|
|
119
|
-
* CSS classes
|
|
120
|
-
*/
|
|
121
|
-
private get CSS();
|
|
122
|
-
/**
|
|
123
|
-
* Creates upload-file button
|
|
124
|
-
*/
|
|
125
|
-
private createFileButton;
|
|
126
|
-
/**
|
|
127
|
-
* Changes UI status
|
|
128
|
-
* @param status - see {@link Ui.status} constants
|
|
129
|
-
*/
|
|
130
|
-
private toggleStatus;
|
|
131
|
-
}
|
|
132
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { UploadOptions, UploadResponseFormat, ImageConfig } from './types/types';
|
|
2
|
-
/**
|
|
3
|
-
* Params interface for Uploader constructor
|
|
4
|
-
*/
|
|
5
|
-
interface UploaderParams {
|
|
6
|
-
/**
|
|
7
|
-
* Configuration for the uploader
|
|
8
|
-
*/
|
|
9
|
-
config: ImageConfig;
|
|
10
|
-
/**
|
|
11
|
-
* Handles the upload response.
|
|
12
|
-
* @param {UploadResponseFormat} response - Response format expected from the backend on file uploading.
|
|
13
|
-
* @returns {void}
|
|
14
|
-
*/
|
|
15
|
-
onUpload: (response: UploadResponseFormat) => void;
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @param error : error type
|
|
19
|
-
* @returns void
|
|
20
|
-
*/
|
|
21
|
-
onError: (error: string) => void;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Module for file uploading. Handle 3 scenarios:
|
|
25
|
-
* 1. Select file from device and upload
|
|
26
|
-
* 2. Upload by pasting URL
|
|
27
|
-
* 3. Upload by pasting file from Clipboard or by Drag'n'Drop
|
|
28
|
-
*/
|
|
29
|
-
export default class Uploader {
|
|
30
|
-
private config;
|
|
31
|
-
private onUpload;
|
|
32
|
-
private onError;
|
|
33
|
-
/**
|
|
34
|
-
* @param params - uploader module params
|
|
35
|
-
* @param params.config - image tool config
|
|
36
|
-
* @param params.onUpload - one callback for all uploading (file, url, d-n-d, pasting)
|
|
37
|
-
* @param params.onError - callback for uploading errors
|
|
38
|
-
*/
|
|
39
|
-
constructor({ config, onUpload, onError }: UploaderParams);
|
|
40
|
-
/**
|
|
41
|
-
* Handle clicks on the upload file button
|
|
42
|
-
* Fires ajax.transport()
|
|
43
|
-
* @param onPreview - callback fired when preview is ready
|
|
44
|
-
*/
|
|
45
|
-
uploadSelectedFile({ onPreview }: UploadOptions): void;
|
|
46
|
-
/**
|
|
47
|
-
* Handle clicks on the upload file button
|
|
48
|
-
* Fires ajax.post()
|
|
49
|
-
* @param url - image source url
|
|
50
|
-
*/
|
|
51
|
-
uploadByUrl(url: string): void;
|
|
52
|
-
/**
|
|
53
|
-
* Handle clicks on the upload file button
|
|
54
|
-
* Fires ajax.post()
|
|
55
|
-
* @param file - file pasted by drag-n-drop
|
|
56
|
-
* @param onPreview - file pasted by drag-n-drop
|
|
57
|
-
*/
|
|
58
|
-
uploadByFile(file: Blob, { onPreview }: UploadOptions): void;
|
|
59
|
-
}
|
|
60
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helper for making Elements with attributes
|
|
3
|
-
* @param tagName - new Element tag name
|
|
4
|
-
* @param classNames - list or name of CSS class
|
|
5
|
-
* @param attributes - any attributes
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare function make(tagName: string, classNames?: string[] | string | null, attributes?: {
|
|
9
|
-
[key: string]: string | boolean;
|
|
10
|
-
}): HTMLElement;
|
package/dist/components/Editor/components/BlockTools/MediaAndEmbed/Image/utils/isPromise.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { UploadResponseFormat } from '../types/types';
|
|
2
|
-
/**
|
|
3
|
-
* Check if passed object is a Promise
|
|
4
|
-
* @param object - object to check
|
|
5
|
-
* @returns
|
|
6
|
-
*/
|
|
7
|
-
export default function isPromise(object: Promise<UploadResponseFormat>): object is Promise<UploadResponseFormat>;
|