jodit 4.11.3 → 4.11.5

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 (72) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/es2015/jodit.css +21 -3
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +14 -14
  5. package/es2015/jodit.js +97 -22
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +5 -5
  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 +7 -7
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +14 -14
  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 +21 -3
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +8 -8
  23. package/es2021/jodit.js +96 -21
  24. package/es2021/jodit.min.css +1 -1
  25. package/es2021/jodit.min.js +6 -6
  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 +21 -3
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +7 -7
  35. package/es2021.en/jodit.js +96 -21
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +6 -6
  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 +29 -6
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +112 -28
  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/core/ui/progress-bar/progress-bar.d.ts +9 -0
  63. package/esm/core/ui/progress-bar/progress-bar.js +53 -0
  64. package/esm/modules/toolbar/button/button.d.ts +1 -0
  65. package/esm/modules/toolbar/button/button.js +29 -19
  66. package/esm/types/toolbar.d.ts +12 -2
  67. package/esm/types/ui.d.ts +1 -0
  68. package/package.json +1 -1
  69. package/types/core/ui/progress-bar/progress-bar.d.ts +9 -0
  70. package/types/modules/toolbar/button/button.d.ts +1 -0
  71. package/types/types/toolbar.d.ts +12 -2
  72. package/types/types/ui.d.ts +1 -0
package/es2015/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.3
4
+ * Version: v4.11.5
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1764,7 +1764,7 @@ __webpack_require__.r(__webpack_exports__);
1764
1764
  * ```
1765
1765
  * @packageDocumentation
1766
1766
  * @module constants
1767
- */ const APP_VERSION = "4.11.3";
1767
+ */ const APP_VERSION = "4.11.5";
1768
1768
  // prettier-ignore
1769
1769
  const ES = "es2015";
1770
1770
  const IS_ES_MODERN = true;
@@ -13212,7 +13212,8 @@ const UIButtonState = ()=>({
13212
13212
  icon: {
13213
13213
  name: 'empty',
13214
13214
  fill: '',
13215
- iconURL: ''
13215
+ iconURL: '',
13216
+ scale: undefined
13216
13217
  },
13217
13218
  tooltip: '',
13218
13219
  text: '',
@@ -15385,14 +15386,14 @@ class Icon {
15385
15386
  return;
15386
15387
  }
15387
15388
  let iconElement;
15388
- const { name, iconURL, fill } = icon;
15389
+ const { name, iconURL, fill, scale } = icon;
15389
15390
  const clearName = name.replace(/[^a-zA-Z0-9]/g, '_');
15390
15391
  let iconFromEvent;
15391
15392
  if (!/<svg/.test(name)) {
15392
15393
  var _jodit_o_getIcon, _jodit_o;
15393
15394
  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);
15394
15395
  }
15395
- const cacheKey = `${name}${iconURL}${fill}${iconFromEvent !== null && iconFromEvent !== void 0 ? iconFromEvent : ''}`;
15396
+ const cacheKey = `${name}${iconURL}${fill}${scale !== null && scale !== void 0 ? scale : ''}${iconFromEvent !== null && iconFromEvent !== void 0 ? iconFromEvent : ''}`;
15396
15397
  if (jodit.o.cache && this.__cache.has(cacheKey)) {
15397
15398
  var _this___cache_get;
15398
15399
  return (_this___cache_get = this.__cache.get(cacheKey)) === null || _this___cache_get === void 0 ? void 0 : _this___cache_get.cloneNode(true);
@@ -15413,6 +15414,9 @@ class Icon {
15413
15414
  if (iconElement) {
15414
15415
  iconElement.classList.add('jodit-icon');
15415
15416
  iconElement.style.fill = fill;
15417
+ if (scale != null) {
15418
+ iconElement.style.transform = `scale(${scale})`;
15419
+ }
15416
15420
  jodit.o.cache && this.__cache.set(cacheKey, iconElement.cloneNode(true));
15417
15421
  }
15418
15422
  return iconElement;
@@ -15830,8 +15834,13 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_11__.UIGr
15830
15834
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15831
15835
  /* harmony export */ ProgressBar: function() { return /* binding */ ProgressBar; }
15832
15836
  /* harmony export */ });
15833
- /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
15834
- /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(96007);
15837
+ /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
15838
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
15839
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
15840
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23599);
15841
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(80991);
15842
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96007);
15843
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(29434);
15835
15844
  /*!
15836
15845
  * Jodit Editor (https://xdsoft.net/jodit/)
15837
15846
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -15843,7 +15852,12 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_11__.UIGr
15843
15852
  */
15844
15853
 
15845
15854
 
15846
- class ProgressBar extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_1__.UIElement {
15855
+
15856
+
15857
+
15858
+
15859
+
15860
+ class ProgressBar extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_5__.UIElement {
15847
15861
  /** @override */ className() {
15848
15862
  return 'ProgressBar';
15849
15863
  }
@@ -15858,17 +15872,65 @@ class ProgressBar extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_1__.UIE
15858
15872
  return this;
15859
15873
  }
15860
15874
  hide() {
15861
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(this.container);
15875
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(this.container);
15862
15876
  return this;
15863
15877
  }
15864
15878
  progress(percentage) {
15865
15879
  this.container.style.width = percentage.toFixed(2) + '%';
15866
15880
  return this;
15867
15881
  }
15882
+ showFileUploadAnimation(from, to) {
15883
+ this.__cleanUpAnimation();
15884
+ const box = (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.getContainer)(this.j, ProgressBar);
15885
+ const pos = (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__.position)(this.j.container, this.j);
15886
+ const el = this.j.c.div(this.getFullElName('file-animation'));
15887
+ const iconSvg = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_6__.Icon.get('file', '');
15888
+ if (iconSvg) {
15889
+ el.innerHTML = iconSvg;
15890
+ }
15891
+ const start = from !== null && from !== void 0 ? from : {
15892
+ x: pos.width / 2,
15893
+ y: 0
15894
+ };
15895
+ const end = to !== null && to !== void 0 ? to : {
15896
+ x: start.x + 60,
15897
+ y: start.y - 80
15898
+ };
15899
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(el, {
15900
+ left: pos.left + start.x,
15901
+ top: pos.top + start.y
15902
+ });
15903
+ box.appendChild(el);
15904
+ this.__animationElement = el;
15905
+ // Force reflow before starting transition
15906
+ // eslint-disable-next-line no-unused-expressions
15907
+ el.offsetWidth;
15908
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(el, {
15909
+ left: pos.left + end.x,
15910
+ top: pos.top + end.y,
15911
+ opacity: 0,
15912
+ transform: 'scale(0.4)'
15913
+ });
15914
+ const onEnd = ()=>{
15915
+ el.removeEventListener('transitionend', onEnd);
15916
+ this.__cleanUpAnimation();
15917
+ };
15918
+ el.addEventListener('transitionend', onEnd);
15919
+ }
15920
+ __cleanUpAnimation() {
15921
+ if (this.__animationElement) {
15922
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(this.__animationElement);
15923
+ this.__animationElement = null;
15924
+ }
15925
+ }
15868
15926
  destruct() {
15927
+ this.__cleanUpAnimation();
15869
15928
  this.hide();
15870
15929
  return super.destruct();
15871
15930
  }
15931
+ constructor(...args){
15932
+ super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__animationElement", null);
15933
+ }
15872
15934
  }
15873
15935
 
15874
15936
 
@@ -23047,26 +23109,39 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
23047
23109
  const { control: ctr, state } = this;
23048
23110
  this.updateSize();
23049
23111
  state.name = ctr.name;
23112
+ this.__initIconFromControl();
23113
+ if (ctr.tooltip) {
23114
+ state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_11__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
23115
+ }
23116
+ state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
23117
+ }
23118
+ __initIconFromControl() {
23119
+ const { control: ctr, state } = this;
23050
23120
  const { textIcons } = this.j.o;
23051
23121
  if (textIcons === true || (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_11__.isFunction)(textIcons) && textIcons(ctr.name) || ctr.template) {
23052
23122
  state.icon = (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.UIButtonState)().icon;
23053
23123
  state.text = ctr.text || ctr.name;
23124
+ return;
23125
+ }
23126
+ if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_14__.isString)(ctr.icon) && ctr.icon != null) {
23127
+ state.icon = {
23128
+ name: ctr.icon.name || ctr.name,
23129
+ iconURL: ctr.icon.iconURL || '',
23130
+ fill: ctr.icon.fill || '',
23131
+ scale: ctr.icon.scale
23132
+ };
23133
+ return;
23134
+ }
23135
+ if (ctr.iconURL) {
23136
+ state.icon.iconURL = ctr.iconURL;
23054
23137
  } else {
23055
- if (ctr.iconURL) {
23056
- state.icon.iconURL = ctr.iconURL;
23057
- } else {
23058
- var _this_j_o_extraIcons;
23059
- const name = ctr.icon || ctr.name;
23060
- state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_22__.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 : '';
23061
- }
23062
- if (!ctr.iconURL && !state.icon.name) {
23063
- state.text = ctr.text || ctr.name;
23064
- }
23138
+ var _this_j_o_extraIcons;
23139
+ const name = ctr.icon || ctr.name;
23140
+ state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_22__.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 : '';
23065
23141
  }
23066
- if (ctr.tooltip) {
23067
- state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_11__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
23142
+ if (!ctr.iconURL && !state.icon.name) {
23143
+ state.text = ctr.text || ctr.name;
23068
23144
  }
23069
- state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
23070
23145
  }
23071
23146
  /**
23072
23147
  * Click on trigger button