jodit 4.13.25 → 4.13.26

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 (54) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +4 -4
  4. package/es2015/jodit.js +36 -11
  5. package/es2015/jodit.min.js +4 -4
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.fat.min.js +4 -4
  13. package/es2018/jodit.min.js +4 -4
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +4 -4
  18. package/es2021/jodit.js +36 -11
  19. package/es2021/jodit.min.js +4 -4
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +4 -4
  28. package/es2021.en/jodit.js +36 -11
  29. package/es2021.en/jodit.min.js +25 -25
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +36 -11
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/core/ui/popup/popup.js +13 -1
  52. package/esm/modules/toolbar/button/button.js +19 -11
  53. package/esm/modules/widget/color-picker/color-picker.js +8 -0
  54. package/package.json +1 -1
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.13.25
4
+ * Version: v4.13.26
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -2107,7 +2107,7 @@ __webpack_require__.r(__webpack_exports__);
2107
2107
  * @packageDocumentation
2108
2108
  * @module constants
2109
2109
  */
2110
- var APP_VERSION = "4.13.25";
2110
+ var APP_VERSION = "4.13.26";
2111
2111
  // prettier-ignore
2112
2112
  var ES = "es5";
2113
2113
  var IS_ES_MODERN = false;
@@ -19910,6 +19910,15 @@ var Popup = /*#__PURE__*/ function(UIGroup) {
19910
19910
  this.j.e.fire(this, 'beforeClose');
19911
19911
  this.j.e.fire('beforePopupClose', this);
19912
19912
  this.__removeGlobalListeners();
19913
+ // Blur a focused control (e.g. the color picker hex input) before
19914
+ // the container goes away. Chrome fires `blur`/`change` for a
19915
+ // removed focused element in the middle of `removeChild`, Firefox
19916
+ // does not fire them at all. Blurring first makes both browsers
19917
+ // run those handlers while the popup is still in the DOM. See #1458
19918
+ var activeElement = this.od.activeElement;
19919
+ if (activeElement && activeElement !== this.container && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_13__.Dom.isOrContains(this.container, activeElement) && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_15__.isFunction)(activeElement.blur)) {
19920
+ activeElement.blur();
19921
+ }
19913
19922
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_13__.Dom.safeRemove(this.container);
19914
19923
  return this;
19915
19924
  }
@@ -29215,15 +29224,23 @@ var ToolbarButton = /*#__PURE__*/ function(UIButton) {
29215
29224
  {
29216
29225
  key: "__closePopup",
29217
29226
  value: function __closePopup() {
29218
- if (this.openedPopup) {
29219
- this.j.e.off(this.ow, 'mousedown touchstart', this.onOutsideClick).off('escape closeAllPopups', this.onOutsideClick);
29220
- this.state.activated = false;
29221
- this.openedPopup.close();
29222
- this.openedPopup.destruct();
29223
- this.openedPopup = null;
29224
- if (this.trigger) {
29225
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_27__.attr)(this.trigger, 'aria-expanded', false);
29226
- }
29227
+ var popup = this.openedPopup;
29228
+ if (!popup) {
29229
+ return;
29230
+ }
29231
+ // Detach first: removing a popup that holds the focused element
29232
+ // makes Chrome fire `blur`/`change` on it synchronously, and a
29233
+ // handler there may call the popup's `close` callback again.
29234
+ // A re-entrant call must be a no-op, otherwise it destructs the
29235
+ // popup while the outer `removeChild` is still running and Chrome
29236
+ // throws NotFoundError. See #1458
29237
+ this.openedPopup = null;
29238
+ this.j.e.off(this.ow, 'mousedown touchstart', this.onOutsideClick).off('escape closeAllPopups', this.onOutsideClick);
29239
+ this.state.activated = false;
29240
+ popup.close();
29241
+ popup.destruct();
29242
+ if (this.trigger) {
29243
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_27__.attr)(this.trigger, 'aria-expanded', false);
29227
29244
  }
29228
29245
  }
29229
29246
  },
@@ -30820,8 +30837,15 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
30820
30837
  var extra = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.refs)(form).extra;
30821
30838
  extra.appendChild(editor.c.fromHTML('<div class="'.concat(cn, '__hex"><input data-ref="hexInput" type="text" spellcheck="false" aria-label="HEX" placeholder="#FF0000" value="').concat(valueHex || '', '"/></div>')));
30822
30839
  var hexInput = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.refs)(form).hexInput;
30840
+ // Enter applies the value and closes the popup; removing the focused
30841
+ // input then makes Chrome fire `change` on it, which would apply the
30842
+ // same color a second time and toggle it off again. See #1459
30843
+ var appliedHexValue = null;
30823
30844
  var applyHexInput = function applyHexInput() {
30824
30845
  var raw = hexInput.value.trim();
30846
+ if (raw === appliedHexValue) {
30847
+ return;
30848
+ }
30825
30849
  var isHex = /^#?[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(raw);
30826
30850
  var isRgb = /^rgba?\([\d\s.,%]+\)$/i.test(raw);
30827
30851
  if (!isHex && !isRgb) {
@@ -30829,6 +30853,7 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
30829
30853
  }
30830
30854
  var color = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.normalizeColor)(isHex && !raw.startsWith('#') ? '#' + raw : raw);
30831
30855
  if (color && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.isFunction)(callback)) {
30856
+ appliedHexValue = raw;
30832
30857
  callback(color);
30833
30858
  }
30834
30859
  };
package/es5/jodit.min.css CHANGED
@@ -1,14 +1,14 @@
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.13.25
4
+ * Version: v4.13.26
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
8
8
  /*!
9
9
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
10
10
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
11
- * Version: v4.13.25
11
+ * Version: v4.13.26
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */