jodit 4.0.0-beta.94 → 4.0.0-beta.98
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/CHANGELOG.md +13 -5
- package/README.md +5 -5
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +89 -73
- package/es2015/jodit.min.js +2 -2
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +89 -73
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/debug/debug.js +1 -1
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +89 -73
- package/es2021/jodit.min.js +2 -2
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +89 -73
- package/es2021.en/jodit.min.js +2 -2
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +93 -73
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/helpers/string/ucfirst.js +1 -1
- package/esm/core/helpers/utils/index.d.ts +0 -1
- package/esm/core/helpers/utils/index.js +0 -1
- package/esm/core/selection/interface.d.ts +1 -1
- package/esm/core/ui/form/inputs/area/area.d.ts +1 -1
- package/esm/core/ui/form/inputs/area/area.js +1 -1
- package/esm/core/ui/form/inputs/checkbox/checkbox.d.ts +1 -1
- package/esm/core/ui/form/inputs/checkbox/checkbox.js +1 -1
- package/esm/core/ui/form/inputs/file/file.d.ts +1 -1
- package/esm/core/ui/form/inputs/file/file.js +1 -1
- package/esm/core/ui/form/inputs/index.d.ts +1 -1
- package/esm/core/ui/form/inputs/index.js +1 -1
- package/esm/core/ui/form/inputs/input/input.d.ts +1 -1
- package/esm/core/ui/form/inputs/input/input.js +1 -1
- package/esm/core/ui/form/inputs/select/select.d.ts +1 -1
- package/esm/core/ui/form/inputs/select/select.js +1 -1
- package/esm/core/view/view.d.ts +1 -0
- package/esm/core/view/view.js +4 -1
- package/esm/jodit.d.ts +2 -1
- package/esm/jodit.js +6 -0
- package/esm/modules/messages/messages.d.ts +28 -0
- package/esm/modules/messages/messages.js +28 -0
- package/esm/modules/table/table.d.ts +4 -2
- package/esm/modules/table/table.js +2 -0
- package/esm/modules/uploader/helpers/send.js +6 -1
- package/esm/modules/widget/color-picker/color-picker.d.ts +1 -1
- package/esm/modules/widget/color-picker/color-picker.js +1 -1
- package/esm/modules/widget/file-selector/file-selector.d.ts +1 -18
- package/esm/modules/widget/file-selector/file-selector.js +12 -19
- package/esm/modules/widget/tabs/tabs.d.ts +17 -6
- package/esm/modules/widget/tabs/tabs.js +17 -6
- package/package.json +1 -1
- package/types/core/helpers/utils/index.d.ts +0 -1
- package/types/core/selection/interface.d.ts +1 -1
- package/types/core/ui/form/inputs/area/area.d.ts +1 -1
- package/types/core/ui/form/inputs/checkbox/checkbox.d.ts +1 -1
- package/types/core/ui/form/inputs/file/file.d.ts +1 -1
- package/types/core/ui/form/inputs/index.d.ts +1 -1
- package/types/core/ui/form/inputs/input/input.d.ts +1 -1
- package/types/core/ui/form/inputs/select/select.d.ts +1 -1
- package/types/core/view/view.d.ts +1 -0
- package/types/jodit.d.ts +2 -1
- package/types/modules/messages/messages.d.ts +28 -0
- package/types/modules/table/table.d.ts +4 -2
- package/types/modules/widget/color-picker/color-picker.d.ts +1 -1
- package/types/modules/widget/file-selector/file-selector.d.ts +1 -18
- package/types/modules/widget/tabs/tabs.d.ts +17 -6
- package/esm/core/helpers/utils/val.d.ts +0 -9
- package/esm/core/helpers/utils/val.js +0 -18
- package/types/core/helpers/utils/val.d.ts +0 -9
package/esm/core/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
export const APP_VERSION = "4.0.0-beta.
|
|
6
|
+
export const APP_VERSION = "4.0.0-beta.98";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
import type { ICommitStyle } from "jodit/esm/types";
|
|
7
6
|
/**
|
|
8
7
|
* @module selection
|
|
9
8
|
*/
|
|
9
|
+
import type { ICommitStyle } from "jodit/esm/types";
|
|
10
10
|
declare module 'jodit/types/events' {
|
|
11
11
|
interface IEventEmitter {
|
|
12
12
|
/**
|
|
@@ -15,7 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
15
15
|
};
|
|
16
16
|
var UITextArea_1;
|
|
17
17
|
/**
|
|
18
|
-
* @module ui/form
|
|
18
|
+
* @module ui/form
|
|
19
19
|
*/
|
|
20
20
|
import { UIInput } from "jodit/esm/core/ui/form/inputs/input/input.js";
|
|
21
21
|
import { component } from "jodit/esm/core/decorators/component/component.js";
|
|
@@ -15,7 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
15
15
|
};
|
|
16
16
|
var UICheckbox_1;
|
|
17
17
|
/**
|
|
18
|
-
* @module ui/form
|
|
18
|
+
* @module ui/form
|
|
19
19
|
*/
|
|
20
20
|
import { UIInput } from "jodit/esm/core/ui/form/inputs/input/input.js";
|
|
21
21
|
import { component, watch, hook } from "jodit/esm/core/decorators/index.js";
|
|
@@ -14,7 +14,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
14
14
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
* @module ui/form
|
|
17
|
+
* @module ui/form
|
|
18
18
|
*/
|
|
19
19
|
import { UIInput } from "jodit/esm/core/ui/form/inputs/input/input.js";
|
|
20
20
|
import { component } from "jodit/esm/core/decorators/component/component.js";
|
|
@@ -15,7 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
15
15
|
};
|
|
16
16
|
var UIInput_1;
|
|
17
17
|
/**
|
|
18
|
-
* @module ui/form
|
|
18
|
+
* @module ui/form
|
|
19
19
|
*/
|
|
20
20
|
import { UIElement } from "jodit/esm/core/ui/element.js";
|
|
21
21
|
import { attr } from "jodit/esm/core/helpers/utils/index.js";
|
|
@@ -15,7 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
15
15
|
};
|
|
16
16
|
var UISelect_1;
|
|
17
17
|
/**
|
|
18
|
-
* @module ui/form
|
|
18
|
+
* @module ui/form
|
|
19
19
|
*/
|
|
20
20
|
import { attr } from "jodit/esm/core/helpers/utils/attr.js";
|
|
21
21
|
import { component } from "jodit/esm/core/decorators/component/component.js";
|
package/esm/core/view/view.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export declare abstract class View extends Component implements IViewBased, Mods
|
|
|
46
46
|
*/
|
|
47
47
|
get buffer(): IStorage;
|
|
48
48
|
get message(): IMessages;
|
|
49
|
+
protected getMessageModule(container: HTMLElement): IMessages;
|
|
49
50
|
/**
|
|
50
51
|
* Container for persistent set/get value
|
|
51
52
|
*/
|
package/esm/core/view/view.js
CHANGED
|
@@ -49,7 +49,10 @@ let View = View_1 = class View extends Component {
|
|
|
49
49
|
return Storage.makeStorage();
|
|
50
50
|
}
|
|
51
51
|
get message() {
|
|
52
|
-
return
|
|
52
|
+
return this.getMessageModule(this.container);
|
|
53
|
+
}
|
|
54
|
+
getMessageModule(container) {
|
|
55
|
+
return new UIMessages(this, container);
|
|
53
56
|
}
|
|
54
57
|
/**
|
|
55
58
|
* Container for persistent set/get value
|
package/esm/jodit.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
* @module jodit
|
|
10
10
|
*/
|
|
11
|
-
import type { CustomCommand, IDictionary, IPluginSystem, IStatusBar, IWorkPlace, Modes, IFileBrowser, IJodit, IUploader, ICreate, CanPromise, IHistory, AjaxOptions, IResponse } from "jodit/esm/types";
|
|
11
|
+
import type { CustomCommand, IDictionary, IPluginSystem, IStatusBar, IWorkPlace, Modes, IFileBrowser, IJodit, IUploader, ICreate, CanPromise, IHistory, AjaxOptions, IResponse, IMessages } from "jodit/esm/types";
|
|
12
12
|
import type * as Modules from "jodit/esm/modules";
|
|
13
13
|
import { Config } from "jodit/esm/config";
|
|
14
14
|
import * as constants from "jodit/esm/core/constants";
|
|
@@ -104,6 +104,7 @@ export declare class Jodit extends ViewWithToolbar implements IJodit, Dlgs {
|
|
|
104
104
|
* workplace It contains source and wysiwyg editors
|
|
105
105
|
*/
|
|
106
106
|
get workplace(): HTMLDivElement;
|
|
107
|
+
get message(): IMessages;
|
|
107
108
|
/**
|
|
108
109
|
* Statusbar module
|
|
109
110
|
*/
|
package/esm/jodit.js
CHANGED
|
@@ -140,6 +140,9 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
|
|
|
140
140
|
get workplace() {
|
|
141
141
|
return this.currentPlace.workplace;
|
|
142
142
|
}
|
|
143
|
+
get message() {
|
|
144
|
+
return this.getMessageModule(this.workplace);
|
|
145
|
+
}
|
|
143
146
|
/**
|
|
144
147
|
* Statusbar module
|
|
145
148
|
*/
|
|
@@ -1227,6 +1230,9 @@ Jodit.core = {
|
|
|
1227
1230
|
__decorate([
|
|
1228
1231
|
cache
|
|
1229
1232
|
], Jodit.prototype, "createInside", null);
|
|
1233
|
+
__decorate([
|
|
1234
|
+
cache
|
|
1235
|
+
], Jodit.prototype, "message", null);
|
|
1230
1236
|
__decorate([
|
|
1231
1237
|
cache
|
|
1232
1238
|
], Jodit.prototype, "s", null);
|
|
@@ -25,9 +25,37 @@ export declare class UIMessages extends UIGroup implements IMessages {
|
|
|
25
25
|
defaultTimeout: number;
|
|
26
26
|
defaultOffset: number;
|
|
27
27
|
});
|
|
28
|
+
/**
|
|
29
|
+
* Show popup info message in the lower right corner of the container
|
|
30
|
+
* ```js
|
|
31
|
+
* const jodit = Jodit.make('#editor');
|
|
32
|
+
* jodit.info('Hello world', 3000);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
28
35
|
info(text: string, timeout?: number): void;
|
|
36
|
+
/**
|
|
37
|
+
* Show popup success message in the lower right corner of the container
|
|
38
|
+
* ```js
|
|
39
|
+
* const jodit = Jodit.make('#editor');
|
|
40
|
+
* jodit.success('Hello world', 3000);
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
29
43
|
success(text: string, timeout?: number): void;
|
|
44
|
+
/**
|
|
45
|
+
* Show popup error message in the lower right corner of the container
|
|
46
|
+
* ```js
|
|
47
|
+
* const jodit = Jodit.make('#editor');
|
|
48
|
+
* jodit.error('Hello world', 3000);
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
30
51
|
error(text: string, timeout?: number): void;
|
|
52
|
+
/**
|
|
53
|
+
* Show popup message in the lower right corner of the container
|
|
54
|
+
* ```js
|
|
55
|
+
* const jodit = Jodit.make('#editor');
|
|
56
|
+
* jodit.message('Hello world', 'info', 3000);
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
31
59
|
message(text: string, variant?: MessageVariant, timeout?: number): void;
|
|
32
60
|
private __message;
|
|
33
61
|
private __getRemoveCallback;
|
|
@@ -38,15 +38,43 @@ let UIMessages = class UIMessages extends UIGroup {
|
|
|
38
38
|
this.options = options;
|
|
39
39
|
this.__messages = new Set();
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Show popup info message in the lower right corner of the container
|
|
43
|
+
* ```js
|
|
44
|
+
* const jodit = Jodit.make('#editor');
|
|
45
|
+
* jodit.info('Hello world', 3000);
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
41
48
|
info(text, timeout) {
|
|
42
49
|
this.__message(text, 'info', timeout);
|
|
43
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Show popup success message in the lower right corner of the container
|
|
53
|
+
* ```js
|
|
54
|
+
* const jodit = Jodit.make('#editor');
|
|
55
|
+
* jodit.success('Hello world', 3000);
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
44
58
|
success(text, timeout) {
|
|
45
59
|
this.__message(text, 'success', timeout);
|
|
46
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Show popup error message in the lower right corner of the container
|
|
63
|
+
* ```js
|
|
64
|
+
* const jodit = Jodit.make('#editor');
|
|
65
|
+
* jodit.error('Hello world', 3000);
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
47
68
|
error(text, timeout) {
|
|
48
69
|
this.__message(text, 'error', timeout);
|
|
49
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Show popup message in the lower right corner of the container
|
|
73
|
+
* ```js
|
|
74
|
+
* const jodit = Jodit.make('#editor');
|
|
75
|
+
* jodit.message('Hello world', 'info', 3000);
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
50
78
|
message(text, variant, timeout) {
|
|
51
79
|
this.__message(text, variant, timeout);
|
|
52
80
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
* @module modules/table
|
|
10
10
|
*/
|
|
11
|
-
import type { ICreate, IJodit } from "jodit/esm/types";
|
|
11
|
+
import type { ICreate, IJodit, Prettify } from "jodit/esm/types";
|
|
12
12
|
import { ViewComponent } from "jodit/esm/core/component";
|
|
13
13
|
export declare class Table extends ViewComponent<IJodit> {
|
|
14
14
|
/** @override */
|
|
@@ -45,11 +45,13 @@ export declare class Table extends ViewComponent<IJodit> {
|
|
|
45
45
|
/**
|
|
46
46
|
* Inserts a new line after row what contains the selected cell
|
|
47
47
|
*
|
|
48
|
+
* @param table - Working table
|
|
48
49
|
* @param line - Insert a new line after/before this
|
|
49
50
|
* line contains the selected cell
|
|
50
51
|
* @param after - Insert a new line after line contains the selected cell
|
|
52
|
+
* @param create - Instance of Create class
|
|
51
53
|
*/
|
|
52
|
-
static appendRow(table: HTMLTableElement, line: false | HTMLTableRowElement, after: boolean, create: ICreate): void;
|
|
54
|
+
static appendRow(table: HTMLTableElement, line: false | HTMLTableRowElement, after: boolean, create: Prettify<Pick<ICreate, 'element'>>): void;
|
|
53
55
|
/**
|
|
54
56
|
* Remove row
|
|
55
57
|
*/
|
|
@@ -156,9 +156,11 @@ export class Table extends ViewComponent {
|
|
|
156
156
|
/**
|
|
157
157
|
* Inserts a new line after row what contains the selected cell
|
|
158
158
|
*
|
|
159
|
+
* @param table - Working table
|
|
159
160
|
* @param line - Insert a new line after/before this
|
|
160
161
|
* line contains the selected cell
|
|
161
162
|
* @param after - Insert a new line after line contains the selected cell
|
|
163
|
+
* @param create - Instance of Create class
|
|
162
164
|
*/
|
|
163
165
|
static appendRow(table, line, after, create) {
|
|
164
166
|
let row;
|
|
@@ -56,7 +56,12 @@ export function send(uploader, data) {
|
|
|
56
56
|
.send()
|
|
57
57
|
.then(resp => resp.json())
|
|
58
58
|
.catch(error => {
|
|
59
|
-
|
|
59
|
+
return {
|
|
60
|
+
success: false,
|
|
61
|
+
data: {
|
|
62
|
+
messages: [error]
|
|
63
|
+
}
|
|
64
|
+
};
|
|
60
65
|
})
|
|
61
66
|
.finally(() => {
|
|
62
67
|
ajax.destruct();
|
|
@@ -17,7 +17,7 @@ import type { IJodit } from "jodit/esm/types";
|
|
|
17
17
|
* @param coldColor - Color value ex. #fff or rgb(123, 123, 123) or rgba(123, 123, 123, 1)
|
|
18
18
|
* @example
|
|
19
19
|
* ```javascript
|
|
20
|
-
*
|
|
20
|
+
* const tabs = TabsWidget(editor, {
|
|
21
21
|
* 'Text' : ColorPickerWidget(editor, function (color) {
|
|
22
22
|
* box.style.color = color;
|
|
23
23
|
* }, box.style.color),
|
|
@@ -20,7 +20,7 @@ Icon.set('palette', paletteIcon);
|
|
|
20
20
|
* @param coldColor - Color value ex. #fff or rgb(123, 123, 123) or rgba(123, 123, 123, 1)
|
|
21
21
|
* @example
|
|
22
22
|
* ```javascript
|
|
23
|
-
*
|
|
23
|
+
* const tabs = TabsWidget(editor, {
|
|
24
24
|
* 'Text' : ColorPickerWidget(editor, function (color) {
|
|
25
25
|
* box.style.color = color;
|
|
26
26
|
* }, box.style.color),
|
|
@@ -28,27 +28,10 @@ interface ImageSelectorCallbacks {
|
|
|
28
28
|
* Generate 3 tabs
|
|
29
29
|
* upload - Use Drag and Drop
|
|
30
30
|
* url - By specifying the image url
|
|
31
|
-
* filebrowser - After opening the file browser
|
|
31
|
+
* filebrowser - After opening the file browser. In the absence of one of the parameters will be less tabs
|
|
32
32
|
*
|
|
33
33
|
* @param callbacks - Object with keys `url`, `upload` and `filebrowser`, values which are callback
|
|
34
34
|
* functions with different parameters
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```javascript
|
|
38
|
-
* let widget = new Jodit.modules.Widget(editor);
|
|
39
|
-
*
|
|
40
|
-
* return widget.c('ImageSelector', {
|
|
41
|
-
* url: function (url, alt) {
|
|
42
|
-
* editor.selections.insertImage(url);
|
|
43
|
-
* },
|
|
44
|
-
* upload: function (images) {
|
|
45
|
-
* editor.selections.insertImage(images[0]);
|
|
46
|
-
* },
|
|
47
|
-
* filebrowser: function (images) {
|
|
48
|
-
* editor.selections.insertImage(images[0]);
|
|
49
|
-
* }
|
|
50
|
-
* }, image);
|
|
51
|
-
* ```
|
|
52
35
|
*/
|
|
53
36
|
export declare const FileSelectorWidget: (editor: IJodit, callbacks: ImageSelectorCallbacks, elm: HTMLElement | null, close: () => void, isImage?: boolean) => HTMLDivElement;
|
|
54
37
|
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
import { isFunction, $$, attr
|
|
6
|
+
import { isFunction, $$, attr } from "jodit/esm/core/helpers/index.js";
|
|
7
7
|
import { Dom } from "jodit/esm/core/dom/dom.js";
|
|
8
8
|
import { UIBlock, UIForm, UIInput, UIButton } from "jodit/esm/core/ui/index.js";
|
|
9
9
|
import { TabsWidget } from "jodit/esm/modules/widget/tabs/tabs.js";
|
|
@@ -11,27 +11,10 @@ import { TabsWidget } from "jodit/esm/modules/widget/tabs/tabs.js";
|
|
|
11
11
|
* Generate 3 tabs
|
|
12
12
|
* upload - Use Drag and Drop
|
|
13
13
|
* url - By specifying the image url
|
|
14
|
-
* filebrowser - After opening the file browser
|
|
14
|
+
* filebrowser - After opening the file browser. In the absence of one of the parameters will be less tabs
|
|
15
15
|
*
|
|
16
16
|
* @param callbacks - Object with keys `url`, `upload` and `filebrowser`, values which are callback
|
|
17
17
|
* functions with different parameters
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```javascript
|
|
21
|
-
* let widget = new Jodit.modules.Widget(editor);
|
|
22
|
-
*
|
|
23
|
-
* return widget.c('ImageSelector', {
|
|
24
|
-
* url: function (url, alt) {
|
|
25
|
-
* editor.selections.insertImage(url);
|
|
26
|
-
* },
|
|
27
|
-
* upload: function (images) {
|
|
28
|
-
* editor.selections.insertImage(images[0]);
|
|
29
|
-
* },
|
|
30
|
-
* filebrowser: function (images) {
|
|
31
|
-
* editor.selections.insertImage(images[0]);
|
|
32
|
-
* }
|
|
33
|
-
* }, image);
|
|
34
|
-
* ```
|
|
35
18
|
*/
|
|
36
19
|
export const FileSelectorWidget = (editor, callbacks, elm, close, isImage = true) => {
|
|
37
20
|
let currentImage;
|
|
@@ -122,3 +105,13 @@ export const FileSelectorWidget = (editor, callbacks, elm, close, isImage = true
|
|
|
122
105
|
}
|
|
123
106
|
return TabsWidget(editor, tabs);
|
|
124
107
|
};
|
|
108
|
+
function val(elm, selector, value) {
|
|
109
|
+
const child = elm.querySelector(selector);
|
|
110
|
+
if (!child) {
|
|
111
|
+
return '';
|
|
112
|
+
}
|
|
113
|
+
if (value) {
|
|
114
|
+
child.value = value;
|
|
115
|
+
}
|
|
116
|
+
return child.value;
|
|
117
|
+
}
|
|
@@ -24,12 +24,23 @@ export interface TabOption {
|
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* ```javascript
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
27
|
+
* const editor = Jodit.make('#editor');
|
|
28
|
+
* const tabs = Jodit.modules.TabsWidget(editor, [
|
|
29
|
+
* { name: 'Images', content: '<div>Images</div>' },
|
|
30
|
+
* {
|
|
31
|
+
* name: 'Title 2',
|
|
32
|
+
* content: editor.c.fromHTML('<div>Some content</div>')
|
|
33
|
+
* },
|
|
34
|
+
* {
|
|
35
|
+
* name: 'Color Picker',
|
|
36
|
+
* content: ColorPickerWidget(
|
|
37
|
+
* editor,
|
|
38
|
+
* function (color) {
|
|
39
|
+
* box.style.color = color;
|
|
40
|
+
* },
|
|
41
|
+
* box.style.color
|
|
42
|
+
* )
|
|
43
|
+
* }
|
|
33
44
|
* ]);
|
|
34
45
|
* ```
|
|
35
46
|
*/
|
|
@@ -21,12 +21,23 @@ import { Dom } from "jodit/esm/core/dom/dom.js";
|
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```javascript
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
24
|
+
* const editor = Jodit.make('#editor');
|
|
25
|
+
* const tabs = Jodit.modules.TabsWidget(editor, [
|
|
26
|
+
* { name: 'Images', content: '<div>Images</div>' },
|
|
27
|
+
* {
|
|
28
|
+
* name: 'Title 2',
|
|
29
|
+
* content: editor.c.fromHTML('<div>Some content</div>')
|
|
30
|
+
* },
|
|
31
|
+
* {
|
|
32
|
+
* name: 'Color Picker',
|
|
33
|
+
* content: ColorPickerWidget(
|
|
34
|
+
* editor,
|
|
35
|
+
* function (color) {
|
|
36
|
+
* box.style.color = color;
|
|
37
|
+
* },
|
|
38
|
+
* box.style.color
|
|
39
|
+
* )
|
|
40
|
+
* }
|
|
30
41
|
* ]);
|
|
31
42
|
* ```
|
|
32
43
|
*/
|
package/package.json
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
import type { ICommitStyle } from "jodit/esm/types";
|
|
7
6
|
/**
|
|
8
7
|
* @module selection
|
|
9
8
|
*/
|
|
9
|
+
import type { ICommitStyle } from "jodit/esm/types";
|
|
10
10
|
declare module 'jodit/types/events' {
|
|
11
11
|
interface IEventEmitter {
|
|
12
12
|
/**
|