jodit 4.0.1 → 4.0.2
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 +10 -6
- package/es2015/jodit.css +5 -7
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +27 -24
- package/es2015/jodit.min.css +1 -1
- 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 +5 -7
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +27 -24
- package/es2018/jodit.min.css +1 -1
- 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 +5 -7
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +27 -24
- package/es2021/jodit.min.css +1 -1
- 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 +5 -7
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +27 -24
- package/es2021.en/jodit.min.css +1 -1
- 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 +7 -9
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +28 -23
- package/es5/jodit.min.css +3 -3
- 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/ui/popup/popup.js +5 -4
- package/esm/modules/context-menu/context-menu.js +5 -3
- package/esm/modules/dialog/dialog.js +5 -3
- package/esm/modules/file-browser/builders/context-menu.js +3 -1
- package/esm/modules/file-browser/data-provider.js +6 -6
- package/esm/modules/file-browser/file-browser.js +1 -5
- package/esm/modules/toolbar/button/button.d.ts +1 -1
- package/esm/plugins/inline-popup/config/items/a.d.ts +1 -1
- package/esm/plugins/inline-popup/config/items/cells.d.ts +1 -1
- package/esm/plugins/inline-popup/config/items/img.d.ts +1 -1
- package/package.json +1 -1
- package/types/modules/toolbar/button/button.d.ts +1 -1
- package/types/plugins/inline-popup/config/items/a.d.ts +1 -1
- package/types/plugins/inline-popup/config/items/cells.d.ts +1 -1
- package/types/plugins/inline-popup/config/items/img.d.ts +1 -1
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-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
export const APP_VERSION = "4.0.
|
|
6
|
+
export const APP_VERSION = "4.0.2";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -300,10 +300,11 @@ export class Popup extends UIGroup {
|
|
|
300
300
|
.off(this.container, 'scroll mousewheel', up)
|
|
301
301
|
.off(ow, 'scroll', up)
|
|
302
302
|
.off(ow, 'resize', up);
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
303
|
+
if (this.j.container.isConnected) {
|
|
304
|
+
Dom.up(this.j.container, box => {
|
|
305
|
+
box && this.j.e.off(box, 'scroll mousewheel', up);
|
|
306
|
+
});
|
|
307
|
+
}
|
|
307
308
|
}
|
|
308
309
|
/**
|
|
309
310
|
* Set ZIndex
|
|
@@ -42,7 +42,8 @@ let ContextMenu = class ContextMenu extends Popup {
|
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
44
|
show(x, y, actions) {
|
|
45
|
-
const self = this
|
|
45
|
+
const self = this;
|
|
46
|
+
self.clear();
|
|
46
47
|
if (!isArray(actions)) {
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
@@ -55,12 +56,13 @@ let ContextMenu = class ContextMenu extends Popup {
|
|
|
55
56
|
action.setMod('context', 'menu');
|
|
56
57
|
action.onAction((e) => {
|
|
57
58
|
item.exec?.call(self, e);
|
|
59
|
+
self.clear();
|
|
58
60
|
self.close();
|
|
59
61
|
return false;
|
|
60
62
|
});
|
|
61
|
-
|
|
63
|
+
this.append(action);
|
|
62
64
|
});
|
|
63
|
-
this.
|
|
65
|
+
this.open(() => ({ left: x, top: y, width: 0, height: 0 }), true);
|
|
64
66
|
}
|
|
65
67
|
};
|
|
66
68
|
ContextMenu = __decorate([
|
|
@@ -439,10 +439,12 @@ let Dialog = Dialog_1 = class Dialog extends ViewWithToolbar {
|
|
|
439
439
|
this.getMod('static') === true) {
|
|
440
440
|
return this;
|
|
441
441
|
}
|
|
442
|
+
const { e } = this;
|
|
442
443
|
/**
|
|
443
444
|
* Called up to close the window
|
|
444
445
|
*/
|
|
445
|
-
if (
|
|
446
|
+
if (e.fire(this, 'beforeClose') === false ||
|
|
447
|
+
e.fire('beforeClose', this) === false) {
|
|
446
448
|
return this;
|
|
447
449
|
}
|
|
448
450
|
this.setMod('active', false);
|
|
@@ -455,8 +457,8 @@ let Dialog = Dialog_1 = class Dialog extends ViewWithToolbar {
|
|
|
455
457
|
/**
|
|
456
458
|
* It called after the window is closed
|
|
457
459
|
*/
|
|
458
|
-
|
|
459
|
-
|
|
460
|
+
e.fire(this, 'afterClose');
|
|
461
|
+
e.fire(this.ow, 'joditCloseDialog');
|
|
460
462
|
if (this.destroyAfterClose) {
|
|
461
463
|
this.destruct();
|
|
462
464
|
}
|
|
@@ -149,7 +149,9 @@ export default (self) => {
|
|
|
149
149
|
]);
|
|
150
150
|
}, self.defaultTimeout);
|
|
151
151
|
self.e
|
|
152
|
-
.on('beforeClose', () =>
|
|
152
|
+
.on('beforeClose', () => {
|
|
153
|
+
contextmenu.close();
|
|
154
|
+
})
|
|
153
155
|
.on('beforeDestruct', () => contextmenu.destruct());
|
|
154
156
|
e.stopPropagation();
|
|
155
157
|
e.preventDefault();
|
|
@@ -19,7 +19,7 @@ import { autobind } from "jodit/esm/core/decorators/index.js";
|
|
|
19
19
|
import { FileBrowserItem } from "jodit/esm/modules/file-browser/builders/item.js";
|
|
20
20
|
import { IS_PROD } from "jodit/esm/core/constants.js";
|
|
21
21
|
export const DEFAULT_SOURCE_NAME = 'default';
|
|
22
|
-
const possibleRules = [
|
|
22
|
+
const possibleRules = new Set([
|
|
23
23
|
'allowFiles',
|
|
24
24
|
'allowFileMove',
|
|
25
25
|
'allowFileUpload',
|
|
@@ -33,7 +33,7 @@ const possibleRules = [
|
|
|
33
33
|
'allowFolderRename',
|
|
34
34
|
'allowImageResize',
|
|
35
35
|
'allowImageCrop'
|
|
36
|
-
];
|
|
36
|
+
]);
|
|
37
37
|
let DataProvider = class DataProvider {
|
|
38
38
|
constructor(parent, options) {
|
|
39
39
|
this.parent = parent;
|
|
@@ -114,13 +114,13 @@ let DataProvider = class DataProvider {
|
|
|
114
114
|
canI(action) {
|
|
115
115
|
const rule = 'allow' + action;
|
|
116
116
|
if (!IS_PROD) {
|
|
117
|
-
if (!possibleRules.
|
|
117
|
+
if (!possibleRules.has(rule)) {
|
|
118
118
|
throw error('Wrong action ' + action);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
return
|
|
121
|
+
const presetValue = this.o.permissionsPresets[rule];
|
|
122
|
+
if (presetValue !== undefined) {
|
|
123
|
+
return presetValue;
|
|
124
124
|
}
|
|
125
125
|
return (this.__currentPermissions == null ||
|
|
126
126
|
this.__currentPermissions[rule] === undefined ||
|
|
@@ -76,11 +76,7 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
|
|
|
76
76
|
minHeight: 300,
|
|
77
77
|
buttons: this.o.headerButtons ?? ['fullsize', 'dialog.close']
|
|
78
78
|
});
|
|
79
|
-
['afterClose', 'beforeOpen'].forEach(proxyEvent =>
|
|
80
|
-
dialog.events.on(dialog, proxyEvent, () => {
|
|
81
|
-
this.e.fire(proxyEvent);
|
|
82
|
-
});
|
|
83
|
-
});
|
|
79
|
+
['beforeClose', 'afterClose', 'beforeOpen'].forEach(proxyEvent => dialog.events.on(dialog, proxyEvent, () => this.e.fire(proxyEvent)));
|
|
84
80
|
dialog.setSize(this.o.width, this.o.height);
|
|
85
81
|
return dialog;
|
|
86
82
|
}
|
|
@@ -20,7 +20,7 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
|
|
|
20
20
|
theme: string;
|
|
21
21
|
currentValue: string;
|
|
22
22
|
hasTrigger: boolean;
|
|
23
|
-
size: "
|
|
23
|
+
size: "small" | "tiny" | "xsmall" | "middle" | "large";
|
|
24
24
|
name: string;
|
|
25
25
|
value: string | number | boolean; /** @override */
|
|
26
26
|
variant: import("jodit/esm/types").ButtonVariant;
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* @module plugins/inline-popup
|
|
8
8
|
*/
|
|
9
9
|
import type { IControlType, IJodit } from "jodit/esm/types";
|
|
10
|
-
declare const _default: (string | IControlType<import("jodit/esm/types").IViewBased<import("jodit/esm/types").IViewOptions> |
|
|
10
|
+
declare const _default: (string | IControlType<IJodit | import("jodit/esm/types").IViewBased<import("jodit/esm/types").IViewOptions> | import("jodit/esm/types").IFileBrowser<import("jodit/esm/types").IFileBrowserOptions>, import("jodit/esm/types").IToolbarButton>)[];
|
|
11
11
|
export default _default;
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* @module plugins/inline-popup
|
|
8
8
|
*/
|
|
9
9
|
import type { IControlType } from "jodit/esm/types";
|
|
10
|
-
declare const _default: (string | IControlType<import("jodit/esm/types").
|
|
10
|
+
declare const _default: (string | IControlType<import("jodit/esm/types").IJodit | import("jodit/esm/types").IViewBased<import("jodit/esm/types").IViewOptions> | import("jodit/esm/types").IFileBrowser<import("jodit/esm/types").IFileBrowserOptions>, import("jodit/esm/types").IToolbarButton>)[];
|
|
11
11
|
export default _default;
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { IControlType, IJodit } from "jodit/esm/types";
|
|
10
10
|
export declare const align: IControlType<IJodit>;
|
|
11
|
-
declare const _default: (string | IControlType<import("jodit/esm/types").IViewBased<import("jodit/esm/types").IViewOptions> |
|
|
11
|
+
declare const _default: (string | IControlType<IJodit | import("jodit/esm/types").IViewBased<import("jodit/esm/types").IViewOptions> | import("jodit/esm/types").IFileBrowser<import("jodit/esm/types").IFileBrowserOptions>, import("jodit/esm/types").IToolbarButton>)[];
|
|
12
12
|
export default _default;
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
|
|
|
20
20
|
theme: string;
|
|
21
21
|
currentValue: string;
|
|
22
22
|
hasTrigger: boolean;
|
|
23
|
-
size: "
|
|
23
|
+
size: "small" | "tiny" | "xsmall" | "middle" | "large";
|
|
24
24
|
name: string;
|
|
25
25
|
value: string | number | boolean; /** @override */
|
|
26
26
|
variant: import("jodit/esm/types").ButtonVariant;
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* @module plugins/inline-popup
|
|
8
8
|
*/
|
|
9
9
|
import type { IControlType, IJodit } from "jodit/esm/types";
|
|
10
|
-
declare const _default: (string | IControlType<import("jodit/esm/types").IViewBased<import("jodit/esm/types").IViewOptions> |
|
|
10
|
+
declare const _default: (string | IControlType<IJodit | import("jodit/esm/types").IViewBased<import("jodit/esm/types").IViewOptions> | import("jodit/esm/types").IFileBrowser<import("jodit/esm/types").IFileBrowserOptions>, import("jodit/esm/types").IToolbarButton>)[];
|
|
11
11
|
export default _default;
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* @module plugins/inline-popup
|
|
8
8
|
*/
|
|
9
9
|
import type { IControlType } from "jodit/esm/types";
|
|
10
|
-
declare const _default: (string | IControlType<import("jodit/esm/types").
|
|
10
|
+
declare const _default: (string | IControlType<import("jodit/esm/types").IJodit | import("jodit/esm/types").IViewBased<import("jodit/esm/types").IViewOptions> | import("jodit/esm/types").IFileBrowser<import("jodit/esm/types").IFileBrowserOptions>, import("jodit/esm/types").IToolbarButton>)[];
|
|
11
11
|
export default _default;
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { IControlType, IJodit } from "jodit/esm/types";
|
|
10
10
|
export declare const align: IControlType<IJodit>;
|
|
11
|
-
declare const _default: (string | IControlType<import("jodit/esm/types").IViewBased<import("jodit/esm/types").IViewOptions> |
|
|
11
|
+
declare const _default: (string | IControlType<IJodit | import("jodit/esm/types").IViewBased<import("jodit/esm/types").IViewOptions> | import("jodit/esm/types").IFileBrowser<import("jodit/esm/types").IFileBrowserOptions>, import("jodit/esm/types").IToolbarButton>)[];
|
|
12
12
|
export default _default;
|