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
package/es2021/jodit.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
  */
@@ -1758,7 +1758,7 @@ __webpack_require__.r(__webpack_exports__);
1758
1758
  * ```
1759
1759
  * @packageDocumentation
1760
1760
  * @module constants
1761
- */ const APP_VERSION = "4.11.2";
1761
+ */ const APP_VERSION = "4.11.4";
1762
1762
  // prettier-ignore
1763
1763
  const ES = "es2021";
1764
1764
  const IS_ES_MODERN = true;
@@ -13125,7 +13125,8 @@ const UIButtonState = ()=>({
13125
13125
  icon: {
13126
13126
  name: 'empty',
13127
13127
  fill: '',
13128
- iconURL: ''
13128
+ iconURL: '',
13129
+ scale: undefined
13129
13130
  },
13130
13131
  tooltip: '',
13131
13132
  text: '',
@@ -15277,13 +15278,13 @@ class Icon {
15277
15278
  return;
15278
15279
  }
15279
15280
  let iconElement;
15280
- const { name, iconURL, fill } = icon;
15281
+ const { name, iconURL, fill, scale } = icon;
15281
15282
  const clearName = name.replace(/[^a-zA-Z0-9]/g, '_');
15282
15283
  let iconFromEvent;
15283
15284
  if (!/<svg/.test(name)) {
15284
15285
  iconFromEvent = jodit.o.getIcon?.(name, clearName);
15285
15286
  }
15286
- const cacheKey = `${name}${iconURL}${fill}${iconFromEvent ?? ''}`;
15287
+ const cacheKey = `${name}${iconURL}${fill}${scale ?? ''}${iconFromEvent ?? ''}`;
15287
15288
  if (jodit.o.cache && this.__cache.has(cacheKey)) {
15288
15289
  return this.__cache.get(cacheKey)?.cloneNode(true);
15289
15290
  }
@@ -15302,6 +15303,9 @@ class Icon {
15302
15303
  if (iconElement) {
15303
15304
  iconElement.classList.add('jodit-icon');
15304
15305
  iconElement.style.fill = fill;
15306
+ if (scale != null) {
15307
+ iconElement.style.transform = `scale(${scale})`;
15308
+ }
15305
15309
  jodit.o.cache && this.__cache.set(cacheKey, iconElement.cloneNode(true));
15306
15310
  }
15307
15311
  return iconElement;
@@ -22878,25 +22882,38 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
22878
22882
  const { control: ctr, state } = this;
22879
22883
  this.updateSize();
22880
22884
  state.name = ctr.name;
22885
+ this.__initIconFromControl();
22886
+ if (ctr.tooltip) {
22887
+ state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
22888
+ }
22889
+ state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
22890
+ }
22891
+ __initIconFromControl() {
22892
+ const { control: ctr, state } = this;
22881
22893
  const { textIcons } = this.j.o;
22882
22894
  if (textIcons === true || (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(textIcons) && textIcons(ctr.name) || ctr.template) {
22883
22895
  state.icon = (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.UIButtonState)().icon;
22884
22896
  state.text = ctr.text || ctr.name;
22897
+ return;
22898
+ }
22899
+ if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__.isString)(ctr.icon) && ctr.icon != null) {
22900
+ state.icon = {
22901
+ name: ctr.icon.name || ctr.name,
22902
+ iconURL: ctr.icon.iconURL || '',
22903
+ fill: ctr.icon.fill || '',
22904
+ scale: ctr.icon.scale
22905
+ };
22906
+ return;
22907
+ }
22908
+ if (ctr.iconURL) {
22909
+ state.icon.iconURL = ctr.iconURL;
22885
22910
  } else {
22886
- if (ctr.iconURL) {
22887
- state.icon.iconURL = ctr.iconURL;
22888
- } else {
22889
- const name = ctr.icon || ctr.name;
22890
- state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_20__.Icon.exists(name) || this.j.o.extraIcons?.[name] ? name : '';
22891
- }
22892
- if (!ctr.iconURL && !state.icon.name) {
22893
- state.text = ctr.text || ctr.name;
22894
- }
22911
+ const name = ctr.icon || ctr.name;
22912
+ state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_20__.Icon.exists(name) || this.j.o.extraIcons?.[name] ? name : '';
22895
22913
  }
22896
- if (ctr.tooltip) {
22897
- state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
22914
+ if (!ctr.iconURL && !state.icon.name) {
22915
+ state.text = ctr.text || ctr.name;
22898
22916
  }
22899
- state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
22900
22917
  }
22901
22918
  /**
22902
22919
  * Click on trigger button