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.
Files changed (69) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/es2015/jodit.css +5 -2
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +6 -6
  5. package/es2015/jodit.js +35 -18
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +4 -4
  8. package/es2015/plugins/debug/debug.css +1 -1
  9. package/es2015/plugins/debug/debug.js +1 -1
  10. package/es2015/plugins/debug/debug.min.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +6 -6
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +4 -4
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  20. package/es2021/jodit.css +5 -2
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +7 -7
  23. package/es2021/jodit.js +34 -17
  24. package/es2021/jodit.min.css +1 -1
  25. package/es2021/jodit.min.js +5 -5
  26. package/es2021/plugins/debug/debug.css +1 -1
  27. package/es2021/plugins/debug/debug.js +1 -1
  28. package/es2021/plugins/debug/debug.min.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  32. package/es2021.en/jodit.css +5 -2
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +5 -5
  35. package/es2021.en/jodit.js +34 -17
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +5 -5
  38. package/es2021.en/plugins/debug/debug.css +1 -1
  39. package/es2021.en/plugins/debug/debug.js +1 -1
  40. package/es2021.en/plugins/debug/debug.min.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  44. package/es5/jodit.css +8 -5
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +38 -18
  48. package/es5/jodit.min.css +3 -3
  49. package/es5/jodit.min.js +2 -2
  50. package/es5/plugins/debug/debug.css +1 -1
  51. package/es5/plugins/debug/debug.js +1 -1
  52. package/es5/plugins/debug/debug.min.js +1 -1
  53. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  56. package/es5/polyfills.fat.min.js +1 -1
  57. package/es5/polyfills.js +1 -1
  58. package/es5/polyfills.min.js +1 -1
  59. package/esm/core/constants.js +1 -1
  60. package/esm/core/ui/button/button/button.js +2 -1
  61. package/esm/core/ui/icon.js +5 -2
  62. package/esm/modules/toolbar/button/button.d.ts +1 -0
  63. package/esm/modules/toolbar/button/button.js +29 -19
  64. package/esm/types/toolbar.d.ts +2 -2
  65. package/esm/types/ui.d.ts +1 -0
  66. package/package.json +1 -1
  67. package/types/modules/toolbar/button/button.d.ts +1 -0
  68. package/types/types/toolbar.d.ts +2 -2
  69. package/types/types/ui.d.ts +1 -0
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.11.2
4
+ * Version: v4.11.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.11.2
4
+ * Version: v4.11.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.11.2
4
+ * Version: v4.11.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.11.2
4
+ * Version: v4.11.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.11.2
4
+ * Version: v4.11.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.11.2
4
+ * Version: v4.11.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.11.2
4
+ * Version: v4.11.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
package/es5/polyfills.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.11.2
4
+ * Version: v4.11.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.11.2
4
+ * Version: v4.11.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -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.2";
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;
@@ -36,7 +36,8 @@ export const UIButtonState = () => ({
36
36
  icon: {
37
37
  name: 'empty',
38
38
  fill: '',
39
- iconURL: ''
39
+ iconURL: '',
40
+ scale: undefined
40
41
  },
41
42
  tooltip: '',
42
43
  text: '',
@@ -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
  }
@@ -61,6 +61,7 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
61
61
  * Init constant data from control
62
62
  */
63
63
  protected __initFromControl(): void;
64
+ private __initIconFromControl;
64
65
  /**
65
66
  * Click on trigger button
66
67
  */
@@ -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
- if (ctr.iconURL) {
210
- state.icon.iconURL = ctr.iconURL;
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.tooltip) {
224
- state.tooltip = isFunction(ctr.tooltip)
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
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.11.2",
3
+ "version": "4.11.4",
4
4
  "description": "Jodit is an awesome and useful wysiwyg editor with filebrowser",
5
5
  "main": "esm/index.js",
6
6
  "types": "types/index.d.ts",
@@ -61,6 +61,7 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
61
61
  * Init constant data from control
62
62
  */
63
63
  protected __initFromControl(): void;
64
+ private __initIconFromControl;
64
65
  /**
65
66
  * Click on trigger button
66
67
  */
@@ -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
@@ -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 {