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
  */
@@ -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;
@@ -22858,25 +22862,38 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
22858
22862
  const { control: ctr, state } = this;
22859
22863
  this.updateSize();
22860
22864
  state.name = ctr.name;
22865
+ this.__initIconFromControl();
22866
+ if (ctr.tooltip) {
22867
+ state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
22868
+ }
22869
+ state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
22870
+ }
22871
+ __initIconFromControl() {
22872
+ const { control: ctr, state } = this;
22861
22873
  const { textIcons } = this.j.o;
22862
22874
  if (textIcons === true || (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(textIcons) && textIcons(ctr.name) || ctr.template) {
22863
22875
  state.icon = (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.UIButtonState)().icon;
22864
22876
  state.text = ctr.text || ctr.name;
22877
+ return;
22878
+ }
22879
+ if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__.isString)(ctr.icon) && ctr.icon != null) {
22880
+ state.icon = {
22881
+ name: ctr.icon.name || ctr.name,
22882
+ iconURL: ctr.icon.iconURL || '',
22883
+ fill: ctr.icon.fill || '',
22884
+ scale: ctr.icon.scale
22885
+ };
22886
+ return;
22887
+ }
22888
+ if (ctr.iconURL) {
22889
+ state.icon.iconURL = ctr.iconURL;
22865
22890
  } else {
22866
- if (ctr.iconURL) {
22867
- state.icon.iconURL = ctr.iconURL;
22868
- } else {
22869
- const name = ctr.icon || ctr.name;
22870
- state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_20__.Icon.exists(name) || this.j.o.extraIcons?.[name] ? name : '';
22871
- }
22872
- if (!ctr.iconURL && !state.icon.name) {
22873
- state.text = ctr.text || ctr.name;
22874
- }
22891
+ const name = ctr.icon || ctr.name;
22892
+ state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_20__.Icon.exists(name) || this.j.o.extraIcons?.[name] ? name : '';
22875
22893
  }
22876
- if (ctr.tooltip) {
22877
- state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
22894
+ if (!ctr.iconURL && !state.icon.name) {
22895
+ state.text = ctr.text || ctr.name;
22878
22896
  }
22879
- state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
22880
22897
  }
22881
22898
  /**
22882
22899
  * Click on trigger button