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
@@ -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
  */
@@ -1758,7 +1758,7 @@ __webpack_require__.r(__webpack_exports__);
1758
1758
  * ```
1759
1759
  * @packageDocumentation
1760
1760
  * @module constants
1761
- */ const APP_VERSION = "4.11.3";
1761
+ */ const APP_VERSION = "4.11.5";
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;
@@ -15716,8 +15720,13 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_9__.UIGro
15716
15720
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15717
15721
  /* harmony export */ ProgressBar: function() { return /* binding */ ProgressBar; }
15718
15722
  /* harmony export */ });
15719
- /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
15720
- /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(96007);
15723
+ /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
15724
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
15725
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
15726
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23599);
15727
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(80991);
15728
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96007);
15729
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(29434);
15721
15730
  /*!
15722
15731
  * Jodit Editor (https://xdsoft.net/jodit/)
15723
15732
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -15729,7 +15738,12 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_9__.UIGro
15729
15738
  */
15730
15739
 
15731
15740
 
15732
- class ProgressBar extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_1__.UIElement {
15741
+
15742
+
15743
+
15744
+
15745
+
15746
+ class ProgressBar extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_5__.UIElement {
15733
15747
  /** @override */ className() {
15734
15748
  return 'ProgressBar';
15735
15749
  }
@@ -15744,17 +15758,65 @@ class ProgressBar extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_1__.UIE
15744
15758
  return this;
15745
15759
  }
15746
15760
  hide() {
15747
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(this.container);
15761
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(this.container);
15748
15762
  return this;
15749
15763
  }
15750
15764
  progress(percentage) {
15751
15765
  this.container.style.width = percentage.toFixed(2) + '%';
15752
15766
  return this;
15753
15767
  }
15768
+ showFileUploadAnimation(from, to) {
15769
+ this.__cleanUpAnimation();
15770
+ const box = (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.getContainer)(this.j, ProgressBar);
15771
+ const pos = (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__.position)(this.j.container, this.j);
15772
+ const el = this.j.c.div(this.getFullElName('file-animation'));
15773
+ const iconSvg = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_6__.Icon.get('file', '');
15774
+ if (iconSvg) {
15775
+ el.innerHTML = iconSvg;
15776
+ }
15777
+ const start = from ?? {
15778
+ x: pos.width / 2,
15779
+ y: 0
15780
+ };
15781
+ const end = to ?? {
15782
+ x: start.x + 60,
15783
+ y: start.y - 80
15784
+ };
15785
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(el, {
15786
+ left: pos.left + start.x,
15787
+ top: pos.top + start.y
15788
+ });
15789
+ box.appendChild(el);
15790
+ this.__animationElement = el;
15791
+ // Force reflow before starting transition
15792
+ // eslint-disable-next-line no-unused-expressions
15793
+ el.offsetWidth;
15794
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(el, {
15795
+ left: pos.left + end.x,
15796
+ top: pos.top + end.y,
15797
+ opacity: 0,
15798
+ transform: 'scale(0.4)'
15799
+ });
15800
+ const onEnd = ()=>{
15801
+ el.removeEventListener('transitionend', onEnd);
15802
+ this.__cleanUpAnimation();
15803
+ };
15804
+ el.addEventListener('transitionend', onEnd);
15805
+ }
15806
+ __cleanUpAnimation() {
15807
+ if (this.__animationElement) {
15808
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(this.__animationElement);
15809
+ this.__animationElement = null;
15810
+ }
15811
+ }
15754
15812
  destruct() {
15813
+ this.__cleanUpAnimation();
15755
15814
  this.hide();
15756
15815
  return super.destruct();
15757
15816
  }
15817
+ constructor(...args){
15818
+ super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__animationElement", null);
15819
+ }
15758
15820
  }
15759
15821
 
15760
15822
 
@@ -22858,25 +22920,38 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
22858
22920
  const { control: ctr, state } = this;
22859
22921
  this.updateSize();
22860
22922
  state.name = ctr.name;
22923
+ this.__initIconFromControl();
22924
+ if (ctr.tooltip) {
22925
+ state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
22926
+ }
22927
+ state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
22928
+ }
22929
+ __initIconFromControl() {
22930
+ const { control: ctr, state } = this;
22861
22931
  const { textIcons } = this.j.o;
22862
22932
  if (textIcons === true || (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(textIcons) && textIcons(ctr.name) || ctr.template) {
22863
22933
  state.icon = (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.UIButtonState)().icon;
22864
22934
  state.text = ctr.text || ctr.name;
22935
+ return;
22936
+ }
22937
+ if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__.isString)(ctr.icon) && ctr.icon != null) {
22938
+ state.icon = {
22939
+ name: ctr.icon.name || ctr.name,
22940
+ iconURL: ctr.icon.iconURL || '',
22941
+ fill: ctr.icon.fill || '',
22942
+ scale: ctr.icon.scale
22943
+ };
22944
+ return;
22945
+ }
22946
+ if (ctr.iconURL) {
22947
+ state.icon.iconURL = ctr.iconURL;
22865
22948
  } 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
- }
22949
+ const name = ctr.icon || ctr.name;
22950
+ state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_20__.Icon.exists(name) || this.j.o.extraIcons?.[name] ? name : '';
22875
22951
  }
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;
22952
+ if (!ctr.iconURL && !state.icon.name) {
22953
+ state.text = ctr.text || ctr.name;
22878
22954
  }
22879
- state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
22880
22955
  }
22881
22956
  /**
22882
22957
  * Click on trigger button