jodit 4.2.35 → 4.2.38

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 (70) hide show
  1. package/CHANGELOG.md +17 -5
  2. package/es2015/jodit.css +4 -3
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +32 -9
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +2 -2
  8. package/es2015/plugins/debug/debug.js +1 -1
  9. package/es2015/plugins/debug/debug.min.js +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  13. package/es2018/jodit.css +4 -3
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +2 -2
  16. package/es2018/jodit.js +32 -9
  17. package/es2018/jodit.min.css +1 -1
  18. package/es2018/jodit.min.js +2 -2
  19. package/es2018/plugins/debug/debug.js +1 -1
  20. package/es2018/plugins/debug/debug.min.js +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  22. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  23. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  24. package/es2021/jodit.css +4 -3
  25. package/es2021/jodit.fat.min.css +1 -1
  26. package/es2021/jodit.fat.min.js +2 -2
  27. package/es2021/jodit.js +31 -9
  28. package/es2021/jodit.min.css +1 -1
  29. package/es2021/jodit.min.js +2 -2
  30. package/es2021/plugins/debug/debug.js +1 -1
  31. package/es2021/plugins/debug/debug.min.js +1 -1
  32. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  33. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  34. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  35. package/es2021.en/jodit.css +4 -3
  36. package/es2021.en/jodit.fat.min.css +1 -1
  37. package/es2021.en/jodit.fat.min.js +2 -2
  38. package/es2021.en/jodit.js +31 -9
  39. package/es2021.en/jodit.min.css +1 -1
  40. package/es2021.en/jodit.min.js +2 -2
  41. package/es2021.en/plugins/debug/debug.js +1 -1
  42. package/es2021.en/plugins/debug/debug.min.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  44. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  45. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  46. package/es5/164.fat.min.js +1 -1
  47. package/es5/164.min.js +1 -1
  48. package/es5/5.fat.min.js +1 -1
  49. package/es5/5.min.js +1 -1
  50. package/es5/jodit.css +4 -4
  51. package/es5/jodit.fat.min.css +1 -1
  52. package/es5/jodit.fat.min.js +2 -2
  53. package/es5/jodit.js +34 -9
  54. package/es5/jodit.min.css +3 -3
  55. package/es5/jodit.min.js +2 -2
  56. package/es5/plugins/debug/debug.js +1 -1
  57. package/es5/plugins/debug/debug.min.js +1 -1
  58. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  59. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  60. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  61. package/esm/core/constants.js +1 -1
  62. package/esm/core/selection/selection.js +3 -7
  63. package/esm/core/ui/form/form.js +1 -0
  64. package/esm/core/ui/form/inputs/input/input.d.ts +1 -0
  65. package/esm/core/ui/form/inputs/input/input.js +13 -1
  66. package/esm/plugins/resizer/resizer.d.ts +1 -0
  67. package/esm/plugins/resizer/resizer.js +13 -0
  68. package/package.json +1 -1
  69. package/types/core/ui/form/inputs/input/input.d.ts +1 -0
  70. package/types/plugins/resizer/resizer.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.2.35
4
+ * Version: v4.2.38
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1735,7 +1735,7 @@ __webpack_require__.r(__webpack_exports__);
1735
1735
  * Released under MIT see LICENSE.txt in the project root for license information.
1736
1736
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1737
1737
  */
1738
- const APP_VERSION = "4.2.35";
1738
+ const APP_VERSION = "4.2.38";
1739
1739
  // prettier-ignore
1740
1740
  const ES = "es2015";
1741
1741
  const IS_ES_MODERN = true;
@@ -10655,11 +10655,7 @@ class Selection {
10655
10655
  String(dw).indexOf('%') < 0) {
10656
10656
  dw += 'px';
10657
10657
  }
10658
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.call)(
10659
- // @ts-ignore
10660
- this.j.o.resizer.forImageChangeAttributes ? jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr : jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.css, image, 'width',
10661
- // @ts-ignore
10662
- dw);
10658
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(image, 'width', dw);
10663
10659
  }
10664
10660
  if (styles && typeof styles === 'object') {
10665
10661
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.css)(image, styles);
@@ -10682,7 +10678,7 @@ class Selection {
10682
10678
  * [[FileBrowser]] or [[Uploader]]
10683
10679
  * @example
10684
10680
  * ```javascript
10685
- * var editor = Jodit.make("#redactor");
10681
+ * const editor = Jodit.make("#redactor");
10686
10682
  * editor.e.on('afterInsertImage', function (image) {
10687
10683
  * image.className = 'bloghead4';
10688
10684
  * });
@@ -13866,6 +13862,7 @@ let UIForm = class UIForm extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MO
13866
13862
  const form = this.j.c.element('form');
13867
13863
  form.classList.add(this.componentName);
13868
13864
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(form, 'dir', this.j.o.direction || 'auto');
13865
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(form, 'novalidate', '');
13869
13866
  return form;
13870
13867
  }
13871
13868
  constructor(...args) {
@@ -14281,7 +14278,20 @@ let UIInput = UIInput_1 = class UIInput extends jodit_core_ui_element__WEBPACK_I
14281
14278
  }
14282
14279
  validate() {
14283
14280
  this.error = '';
14284
- return (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__/* .toArray */ .$)(this.validators).every(validator => validator(this));
14281
+ const validate = (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__/* .toArray */ .$)(this.validators).every(validator => validator(this));
14282
+ this.__markInputInvalid();
14283
+ return validate;
14284
+ }
14285
+ __markInputInvalid() {
14286
+ var _a, _b, _c, _d;
14287
+ if (this.error) {
14288
+ this.nativeInput.setAttribute('aria-invalid', 'true');
14289
+ (_b = (_a = this.nativeInput).setCustomValidity) === null || _b === void 0 ? void 0 : _b.call(_a, this.error);
14290
+ }
14291
+ else {
14292
+ this.nativeInput.removeAttribute('aria-invalid');
14293
+ (_d = (_c = this.nativeInput).setCustomValidity) === null || _d === void 0 ? void 0 : _d.call(_c, '');
14294
+ }
14285
14295
  }
14286
14296
  /** @override **/
14287
14297
  createContainer(options) {
@@ -37601,6 +37611,16 @@ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_5__/* .P
37601
37611
  node = node.parentNode;
37602
37612
  }
37603
37613
  }
37614
+ __afterInsertImage(image) {
37615
+ if (this.j.o.resizer.forImageChangeAttributes) {
37616
+ return;
37617
+ }
37618
+ const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(image, 'width');
37619
+ if (width && !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.css)(image, 'width', true)) {
37620
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.css)(image, 'width', width);
37621
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(image, 'width', null);
37622
+ }
37623
+ }
37604
37624
  addEventListeners() {
37605
37625
  const editor = this.j;
37606
37626
  editor.e
@@ -37896,6 +37916,9 @@ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_5__/* .P
37896
37916
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
37897
37917
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)(':click')
37898
37918
  ], resizer.prototype, "onEditorClick", null);
37919
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
37920
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)(':afterInsertImage')
37921
+ ], resizer.prototype, "__afterInsertImage", null);
37899
37922
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
37900
37923
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
37901
37924
  ], resizer.prototype, "onStartResizing", null);