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/es5/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
  */
@@ -2022,7 +2022,7 @@ __webpack_require__.r(__webpack_exports__);
2022
2022
  * @packageDocumentation
2023
2023
  * @module constants
2024
2024
  */
2025
- var APP_VERSION = "4.11.2";
2025
+ var APP_VERSION = "4.11.4";
2026
2026
  // prettier-ignore
2027
2027
  var ES = "es5";
2028
2028
  var IS_ES_MODERN = false;
@@ -15537,7 +15537,8 @@ var UIButtonState = function UIButtonState() {
15537
15537
  icon: {
15538
15538
  name: 'empty',
15539
15539
  fill: '',
15540
- iconURL: ''
15540
+ iconURL: '',
15541
+ scale: undefined
15541
15542
  },
15542
15543
  tooltip: '',
15543
15544
  text: '',
@@ -18464,14 +18465,14 @@ var Icon = /*#__PURE__*/ function() {
18464
18465
  return;
18465
18466
  }
18466
18467
  var iconElement;
18467
- var name = icon.name, iconURL = icon.iconURL, fill = icon.fill;
18468
+ var name = icon.name, iconURL = icon.iconURL, fill = icon.fill, scale = icon.scale;
18468
18469
  var clearName = name.replace(/[^a-zA-Z0-9]/g, '_');
18469
18470
  var iconFromEvent;
18470
18471
  if (!/<svg/.test(name)) {
18471
18472
  var _jodit_o_getIcon, _jodit_o;
18472
18473
  iconFromEvent = (_jodit_o_getIcon = (_jodit_o = jodit.o).getIcon) === null || _jodit_o_getIcon === void 0 ? void 0 : _jodit_o_getIcon.call(_jodit_o, name, clearName);
18473
18474
  }
18474
- var cacheKey = "".concat(name).concat(iconURL).concat(fill).concat(iconFromEvent !== null && iconFromEvent !== void 0 ? iconFromEvent : '');
18475
+ var cacheKey = "".concat(name).concat(iconURL).concat(fill).concat(scale !== null && scale !== void 0 ? scale : '').concat(iconFromEvent !== null && iconFromEvent !== void 0 ? iconFromEvent : '');
18475
18476
  if (jodit.o.cache && this.__cache.has(cacheKey)) {
18476
18477
  var _this___cache_get;
18477
18478
  return (_this___cache_get = this.__cache.get(cacheKey)) === null || _this___cache_get === void 0 ? void 0 : _this___cache_get.cloneNode(true);
@@ -18492,6 +18493,9 @@ var Icon = /*#__PURE__*/ function() {
18492
18493
  if (iconElement) {
18493
18494
  iconElement.classList.add('jodit-icon');
18494
18495
  iconElement.style.fill = fill;
18496
+ if (scale != null) {
18497
+ iconElement.style.transform = "scale(".concat(scale, ")");
18498
+ }
18495
18499
  jodit.o.cache && this.__cache.set(cacheKey, iconElement.cloneNode(true));
18496
18500
  }
18497
18501
  return iconElement;
@@ -27774,26 +27778,42 @@ var ToolbarButton = /*#__PURE__*/ function(UIButton) {
27774
27778
  var _this = this, ctr = _this.control, state = _this.state;
27775
27779
  this.updateSize();
27776
27780
  state.name = ctr.name;
27781
+ this.__initIconFromControl();
27782
+ if (ctr.tooltip) {
27783
+ state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_19__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
27784
+ }
27785
+ state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
27786
+ }
27787
+ },
27788
+ {
27789
+ key: "__initIconFromControl",
27790
+ value: function __initIconFromControl() {
27791
+ var _this = this, ctr = _this.control, state = _this.state;
27777
27792
  var textIcons = this.j.o.textIcons;
27778
27793
  if (textIcons === true || (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_19__.isFunction)(textIcons) && textIcons(ctr.name) || ctr.template) {
27779
27794
  state.icon = (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_28__.UIButtonState)().icon;
27780
27795
  state.text = ctr.text || ctr.name;
27796
+ return;
27797
+ }
27798
+ if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_22__.isString)(ctr.icon) && ctr.icon != null) {
27799
+ state.icon = {
27800
+ name: ctr.icon.name || ctr.name,
27801
+ iconURL: ctr.icon.iconURL || '',
27802
+ fill: ctr.icon.fill || '',
27803
+ scale: ctr.icon.scale
27804
+ };
27805
+ return;
27806
+ }
27807
+ if (ctr.iconURL) {
27808
+ state.icon.iconURL = ctr.iconURL;
27781
27809
  } else {
27782
- if (ctr.iconURL) {
27783
- state.icon.iconURL = ctr.iconURL;
27784
- } else {
27785
- var _this_j_o_extraIcons;
27786
- var name = ctr.icon || ctr.name;
27787
- state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_30__.Icon.exists(name) || ((_this_j_o_extraIcons = this.j.o.extraIcons) === null || _this_j_o_extraIcons === void 0 ? void 0 : _this_j_o_extraIcons[name]) ? name : '';
27788
- }
27789
- if (!ctr.iconURL && !state.icon.name) {
27790
- state.text = ctr.text || ctr.name;
27791
- }
27810
+ var _this_j_o_extraIcons;
27811
+ var name = ctr.icon || ctr.name;
27812
+ state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_30__.Icon.exists(name) || ((_this_j_o_extraIcons = this.j.o.extraIcons) === null || _this_j_o_extraIcons === void 0 ? void 0 : _this_j_o_extraIcons[name]) ? name : '';
27792
27813
  }
27793
- if (ctr.tooltip) {
27794
- state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_19__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
27814
+ if (!ctr.iconURL && !state.icon.name) {
27815
+ state.text = ctr.text || ctr.name;
27795
27816
  }
27796
- state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
27797
27817
  }
27798
27818
  },
27799
27819
  {