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
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.2.35";
6
+ export const APP_VERSION = "4.2.38";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -17,7 +17,7 @@ import * as consts from "../constants.js";
17
17
  import { INSEPARABLE_TAGS, INVISIBLE_SPACE, IS_PROD } from "../constants.js";
18
18
  import { autobind } from "../decorators/index.js";
19
19
  import { Dom } from "../dom/dom.js";
20
- import { $$, attr, call, css, error, getScrollParent, scrollIntoViewIfNeeded, size, toArray } from "../helpers/index.js";
20
+ import { $$, attr, css, error, getScrollParent, scrollIntoViewIfNeeded, size, toArray } from "../helpers/index.js";
21
21
  import { isFunction, isMarker, isString } from "../helpers/checker/index.js";
22
22
  import { assert } from "../helpers/utils/assert.js";
23
23
  import { moveTheNodeAlongTheEdgeOutward } from "./helpers/move-the-node-along-the-edge-outward.js";
@@ -555,11 +555,7 @@ export class Selection {
555
555
  String(dw).indexOf('%') < 0) {
556
556
  dw += 'px';
557
557
  }
558
- call(
559
- // @ts-ignore
560
- this.j.o.resizer.forImageChangeAttributes ? attr : css, image, 'width',
561
- // @ts-ignore
562
- dw);
558
+ attr(image, 'width', dw);
563
559
  }
564
560
  if (styles && typeof styles === 'object') {
565
561
  css(image, styles);
@@ -582,7 +578,7 @@ export class Selection {
582
578
  * [[FileBrowser]] or [[Uploader]]
583
579
  * @example
584
580
  * ```javascript
585
- * var editor = Jodit.make("#redactor");
581
+ * const editor = Jodit.make("#redactor");
586
582
  * editor.e.on('afterInsertImage', function (image) {
587
583
  * image.className = 'bloghead4';
588
584
  * });
@@ -61,6 +61,7 @@ let UIForm = class UIForm extends UIGroup {
61
61
  const form = this.j.c.element('form');
62
62
  form.classList.add(this.componentName);
63
63
  attr(form, 'dir', this.j.o.direction || 'auto');
64
+ attr(form, 'novalidate', '');
64
65
  return form;
65
66
  }
66
67
  constructor(...args) {
@@ -37,6 +37,7 @@ export declare class UIInput extends UIElement implements IUIInput {
37
37
  protected onChangeValue(): void;
38
38
  protected validators: Set<IUIInputValidator>;
39
39
  validate(): boolean;
40
+ private __markInputInvalid;
40
41
  /** @override **/
41
42
  protected createContainer(options: Partial<this['state']>): HTMLElement;
42
43
  /**
@@ -116,7 +116,19 @@ let UIInput = UIInput_1 = class UIInput extends UIElement {
116
116
  }
117
117
  validate() {
118
118
  this.error = '';
119
- return toArray(this.validators).every(validator => validator(this));
119
+ const validate = toArray(this.validators).every(validator => validator(this));
120
+ this.__markInputInvalid();
121
+ return validate;
122
+ }
123
+ __markInputInvalid() {
124
+ if (this.error) {
125
+ this.nativeInput.setAttribute('aria-invalid', 'true');
126
+ this.nativeInput.setCustomValidity?.(this.error);
127
+ }
128
+ else {
129
+ this.nativeInput.removeAttribute('aria-invalid');
130
+ this.nativeInput.setCustomValidity?.('');
131
+ }
120
132
  }
121
133
  /** @override **/
122
134
  createContainer(options) {
@@ -34,6 +34,7 @@ export declare class resizer extends Plugin {
34
34
  * Click in the editor area
35
35
  */
36
36
  protected onEditorClick(e: MouseEvent): void;
37
+ protected __afterInsertImage(image: HTMLImageElement): void;
37
38
  private addEventListeners;
38
39
  private onStartResizing;
39
40
  private onEndResizing;
@@ -129,6 +129,16 @@ export class resizer extends Plugin {
129
129
  node = node.parentNode;
130
130
  }
131
131
  }
132
+ __afterInsertImage(image) {
133
+ if (this.j.o.resizer.forImageChangeAttributes) {
134
+ return;
135
+ }
136
+ const width = attr(image, 'width');
137
+ if (width && !css(image, 'width', true)) {
138
+ css(image, 'width', width);
139
+ attr(image, 'width', null);
140
+ }
141
+ }
132
142
  addEventListeners() {
133
143
  const editor = this.j;
134
144
  editor.e
@@ -424,6 +434,9 @@ export class resizer extends Plugin {
424
434
  __decorate([
425
435
  watch(':click')
426
436
  ], resizer.prototype, "onEditorClick", null);
437
+ __decorate([
438
+ watch(':afterInsertImage')
439
+ ], resizer.prototype, "__afterInsertImage", null);
427
440
  __decorate([
428
441
  autobind
429
442
  ], resizer.prototype, "onStartResizing", null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.2.35",
3
+ "version": "4.2.38",
4
4
  "description": "Jodit is an awesome and useful wysiwyg editor with filebrowser",
5
5
  "main": "esm/index.js",
6
6
  "types": "types/index.d.ts",
@@ -37,6 +37,7 @@ export declare class UIInput extends UIElement implements IUIInput {
37
37
  protected onChangeValue(): void;
38
38
  protected validators: Set<IUIInputValidator>;
39
39
  validate(): boolean;
40
+ private __markInputInvalid;
40
41
  /** @override **/
41
42
  protected createContainer(options: Partial<this['state']>): HTMLElement;
42
43
  /**
@@ -34,6 +34,7 @@ export declare class resizer extends Plugin {
34
34
  * Click in the editor area
35
35
  */
36
36
  protected onEditorClick(e: MouseEvent): void;
37
+ protected __afterInsertImage(image: HTMLImageElement): void;
37
38
  private addEventListeners;
38
39
  private onStartResizing;
39
40
  private onEndResizing;