jodit 4.11.2 → 4.11.4
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 +41 -0
- package/es2015/jodit.css +5 -2
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +6 -6
- package/es2015/jodit.js +35 -18
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +4 -4
- package/es2015/plugins/debug/debug.css +1 -1
- 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.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +6 -6
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +4 -4
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +5 -2
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +7 -7
- package/es2021/jodit.js +34 -17
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +5 -5
- package/es2021/plugins/debug/debug.css +1 -1
- 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 -2
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +5 -5
- package/es2021.en/jodit.js +34 -17
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +5 -5
- package/es2021.en/plugins/debug/debug.css +1 -1
- 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 +8 -5
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +38 -18
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- 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/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/ui/button/button/button.js +2 -1
- package/esm/core/ui/icon.js +5 -2
- package/esm/modules/toolbar/button/button.d.ts +1 -0
- package/esm/modules/toolbar/button/button.js +29 -19
- package/esm/types/toolbar.d.ts +2 -2
- package/esm/types/ui.d.ts +1 -0
- package/package.json +1 -1
- package/types/modules/toolbar/button/button.d.ts +1 -0
- package/types/types/toolbar.d.ts +2 -2
- package/types/types/ui.d.ts +1 -0
package/es5/polyfills.fat.min.js
CHANGED
package/es5/polyfills.js
CHANGED
package/es5/polyfills.min.js
CHANGED
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-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
export const APP_VERSION = "4.11.
|
|
6
|
+
export const APP_VERSION = "4.11.4";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
package/esm/core/ui/icon.js
CHANGED
|
@@ -50,13 +50,13 @@ export class Icon {
|
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
let iconElement;
|
|
53
|
-
const { name, iconURL, fill } = icon;
|
|
53
|
+
const { name, iconURL, fill, scale } = icon;
|
|
54
54
|
const clearName = name.replace(/[^a-zA-Z0-9]/g, '_');
|
|
55
55
|
let iconFromEvent;
|
|
56
56
|
if (!/<svg/.test(name)) {
|
|
57
57
|
iconFromEvent = (_b = (_a = jodit.o).getIcon) === null || _b === void 0 ? void 0 : _b.call(_a, name, clearName);
|
|
58
58
|
}
|
|
59
|
-
const cacheKey = `${name}${iconURL}${fill}${iconFromEvent !== null && iconFromEvent !== void 0 ? iconFromEvent : ''}`;
|
|
59
|
+
const cacheKey = `${name}${iconURL}${fill}${scale !== null && scale !== void 0 ? scale : ''}${iconFromEvent !== null && iconFromEvent !== void 0 ? iconFromEvent : ''}`;
|
|
60
60
|
if (jodit.o.cache && this.__cache.has(cacheKey)) {
|
|
61
61
|
return (_c = this.__cache.get(cacheKey)) === null || _c === void 0 ? void 0 : _c.cloneNode(true);
|
|
62
62
|
}
|
|
@@ -80,6 +80,9 @@ export class Icon {
|
|
|
80
80
|
if (iconElement) {
|
|
81
81
|
iconElement.classList.add('jodit-icon');
|
|
82
82
|
iconElement.style.fill = fill;
|
|
83
|
+
if (scale != null) {
|
|
84
|
+
iconElement.style.transform = `scale(${scale})`;
|
|
85
|
+
}
|
|
83
86
|
jodit.o.cache &&
|
|
84
87
|
this.__cache.set(cacheKey, iconElement.cloneNode(true));
|
|
85
88
|
}
|
|
@@ -194,38 +194,48 @@ let ToolbarButton = class ToolbarButton extends UIButton {
|
|
|
194
194
|
* Init constant data from control
|
|
195
195
|
*/
|
|
196
196
|
__initFromControl() {
|
|
197
|
-
var _a;
|
|
198
197
|
const { control: ctr, state } = this;
|
|
199
198
|
this.updateSize();
|
|
200
199
|
state.name = ctr.name;
|
|
200
|
+
this.__initIconFromControl();
|
|
201
|
+
if (ctr.tooltip) {
|
|
202
|
+
state.tooltip = isFunction(ctr.tooltip)
|
|
203
|
+
? ctr.tooltip(this.j, ctr, this)
|
|
204
|
+
: ctr.tooltip;
|
|
205
|
+
}
|
|
206
|
+
state.hasTrigger = Boolean(ctr.list || (ctr.popup && ctr.exec));
|
|
207
|
+
}
|
|
208
|
+
__initIconFromControl() {
|
|
209
|
+
var _a;
|
|
210
|
+
const { control: ctr, state } = this;
|
|
201
211
|
const { textIcons } = this.j.o;
|
|
202
212
|
if (textIcons === true ||
|
|
203
213
|
(isFunction(textIcons) && textIcons(ctr.name)) ||
|
|
204
214
|
ctr.template) {
|
|
205
215
|
state.icon = UIButtonState().icon;
|
|
206
216
|
state.text = ctr.text || ctr.name;
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (!isString(ctr.icon) && ctr.icon != null) {
|
|
220
|
+
state.icon = {
|
|
221
|
+
name: ctr.icon.name || ctr.name,
|
|
222
|
+
iconURL: ctr.icon.iconURL || '',
|
|
223
|
+
fill: ctr.icon.fill || '',
|
|
224
|
+
scale: ctr.icon.scale
|
|
225
|
+
};
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (ctr.iconURL) {
|
|
229
|
+
state.icon.iconURL = ctr.iconURL;
|
|
207
230
|
}
|
|
208
231
|
else {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
else {
|
|
213
|
-
const name = ctr.icon || ctr.name;
|
|
214
|
-
state.icon.name =
|
|
215
|
-
Icon.exists(name) || ((_a = this.j.o.extraIcons) === null || _a === void 0 ? void 0 : _a[name])
|
|
216
|
-
? name
|
|
217
|
-
: '';
|
|
218
|
-
}
|
|
219
|
-
if (!ctr.iconURL && !state.icon.name) {
|
|
220
|
-
state.text = ctr.text || ctr.name;
|
|
221
|
-
}
|
|
232
|
+
const name = ctr.icon || ctr.name;
|
|
233
|
+
state.icon.name =
|
|
234
|
+
Icon.exists(name) || ((_a = this.j.o.extraIcons) === null || _a === void 0 ? void 0 : _a[name]) ? name : '';
|
|
222
235
|
}
|
|
223
|
-
if (ctr.
|
|
224
|
-
state.
|
|
225
|
-
? ctr.tooltip(this.j, ctr, this)
|
|
226
|
-
: ctr.tooltip;
|
|
236
|
+
if (!ctr.iconURL && !state.icon.name) {
|
|
237
|
+
state.text = ctr.text || ctr.name;
|
|
227
238
|
}
|
|
228
|
-
state.hasTrigger = Boolean(ctr.list || (ctr.popup && ctr.exec));
|
|
229
239
|
}
|
|
230
240
|
/**
|
|
231
241
|
* Click on trigger button
|
package/esm/types/toolbar.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module types
|
|
8
8
|
*/
|
|
9
9
|
import type { IFileBrowser } from "./file-browser";
|
|
10
|
-
import type { IUIButton, IUIElement, IUIList } from "./ui";
|
|
10
|
+
import type { IUIButton, IUIElement, IUIIconState, IUIList } from "./ui";
|
|
11
11
|
import type { IViewBased } from "./view";
|
|
12
12
|
import type { IJodit } from "./jodit";
|
|
13
13
|
import type { Modes, IDictionary, HTMLTagNames, Nullable, IContainer, IComponent, IBound } from "./types";
|
|
@@ -136,7 +136,7 @@ interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser
|
|
|
136
136
|
* })
|
|
137
137
|
* ```
|
|
138
138
|
*/
|
|
139
|
-
icon?: string;
|
|
139
|
+
icon?: string | IUIIconState;
|
|
140
140
|
/**
|
|
141
141
|
* Use this property if you want set background image for the button. This icon can be 16 * 16 px in SVG or
|
|
142
142
|
* another image formats
|
package/esm/types/ui.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export interface IUIIconState {
|
|
|
30
30
|
name: string;
|
|
31
31
|
iconURL: string;
|
|
32
32
|
fill: string;
|
|
33
|
+
scale: number | undefined;
|
|
33
34
|
}
|
|
34
35
|
export type ButtonVariant = 'initial' | 'outline' | 'default' | 'primary' | 'secondary' | 'success' | 'danger';
|
|
35
36
|
export interface IUIButtonState {
|
package/package.json
CHANGED
package/types/types/toolbar.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module types
|
|
8
8
|
*/
|
|
9
9
|
import type { IFileBrowser } from "./file-browser";
|
|
10
|
-
import type { IUIButton, IUIElement, IUIList } from "./ui";
|
|
10
|
+
import type { IUIButton, IUIElement, IUIIconState, IUIList } from "./ui";
|
|
11
11
|
import type { IViewBased } from "./view";
|
|
12
12
|
import type { IJodit } from "./jodit";
|
|
13
13
|
import type { Modes, IDictionary, HTMLTagNames, Nullable, IContainer, IComponent, IBound } from "./types";
|
|
@@ -136,7 +136,7 @@ interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser
|
|
|
136
136
|
* })
|
|
137
137
|
* ```
|
|
138
138
|
*/
|
|
139
|
-
icon?: string;
|
|
139
|
+
icon?: string | IUIIconState;
|
|
140
140
|
/**
|
|
141
141
|
* Use this property if you want set background image for the button. This icon can be 16 * 16 px in SVG or
|
|
142
142
|
* another image formats
|
package/types/types/ui.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export interface IUIIconState {
|
|
|
30
30
|
name: string;
|
|
31
31
|
iconURL: string;
|
|
32
32
|
fill: string;
|
|
33
|
+
scale: number | undefined;
|
|
33
34
|
}
|
|
34
35
|
export type ButtonVariant = 'initial' | 'outline' | 'default' | 'primary' | 'secondary' | 'success' | 'danger';
|
|
35
36
|
export interface IUIButtonState {
|