jodit 4.16.0 → 4.16.1

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 (65) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/es2015/jodit.css +11 -1
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +4 -4
  5. package/es2015/jodit.js +31 -11
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +4 -4
  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 +4 -4
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +4 -4
  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 +11 -1
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +4 -4
  23. package/es2021/jodit.js +31 -11
  24. package/es2021/jodit.min.css +1 -1
  25. package/es2021/jodit.min.js +4 -4
  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 +11 -1
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +4 -4
  35. package/es2021.en/jodit.js +31 -11
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +4 -4
  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 +15 -2
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +34 -11
  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/plugins/iframe/config.js +4 -0
  61. package/esm/plugins/image-processor/image-processor.d.ts +5 -0
  62. package/esm/plugins/image-processor/image-processor.js +29 -2
  63. package/esm/plugins/source/source.js +3 -7
  64. package/package.json +1 -1
  65. package/types/plugins/image-processor/image-processor.d.ts +5 -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.16.0
4
+ * Version: v4.16.1
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.16.0
4
+ * Version: v4.16.1
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.16.0
4
+ * Version: v4.16.1
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.16.0
4
+ * Version: v4.16.1
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.16.0
4
+ * Version: v4.16.1
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.16.0
4
+ * Version: v4.16.1
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.16.0
4
+ * Version: v4.16.1
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
package/es5/polyfills.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.16.0
4
+ * Version: v4.16.1
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.16.0
4
+ * Version: v4.16.1
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-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.16.0";
6
+ export const APP_VERSION = "4.16.1";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -69,6 +69,10 @@ Config.prototype.iframeStyle =
69
69
  'display: block;' +
70
70
  'background: rgba(0, 0, 0, 0);' +
71
71
  '} ' +
72
+ '.jodit-wysiwyg_image-selected::selection,' +
73
+ '.jodit-wysiwyg_image-selected *:not(img)::selection{' +
74
+ 'background:transparent' +
75
+ '}' +
72
76
  '.jodit_disabled{' +
73
77
  'user-select: none;' +
74
78
  '-o-user-select: none;' +
@@ -23,6 +23,11 @@ export declare class imageProcessor extends Plugin {
23
23
  protected onBeforeSetElementValue(data: {
24
24
  value: string;
25
25
  }): void;
26
+ /**
27
+ * While the selection is an image, only the image is highlighted: Safari
28
+ * paints the rest of a block image's line with its parent's highlight. See #1528
29
+ */
30
+ private onSelectionChange;
26
31
  protected afterChange(data: {
27
32
  value: string;
28
33
  }): Promise<void>;
@@ -14,7 +14,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
14
14
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15
15
  };
16
16
  import { INVISIBLE_SPACE_REG_EXP, SOURCE_CONSUMER } from "../../core/constants.js";
17
- import { cached, debounce, watch } from "../../core/decorators/index.js";
17
+ import { autobind, cached, debounce, watch } from "../../core/decorators/index.js";
18
18
  import { Dom } from "../../core/dom/dom.js";
19
19
  import { pluginSystem } from "../../core/global.js";
20
20
  import { $$, dataBind } from "../../core/helpers/index.js";
@@ -23,12 +23,17 @@ import { dataURItoBlob } from "../../modules/uploader/helpers/data-uri-to-blob.j
23
23
  import "./config.js";
24
24
  const JODIT_IMAGE_PROCESSOR_BINDED = '__jodit_imageprocessor_binded';
25
25
  const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
26
+ const IMAGE_SELECTED = 'jodit-wysiwyg_image-selected';
26
27
  /**
27
28
  * Change editor's size after load all images
28
29
  */
29
30
  export class imageProcessor extends Plugin {
30
- afterInit(jodit) { }
31
+ afterInit(jodit) {
32
+ jodit.e.on(jodit.ed, 'selectionchange', this.onSelectionChange);
33
+ }
31
34
  beforeDestruct(jodit) {
35
+ jodit.e.off(jodit.ed, 'selectionchange', this.onSelectionChange);
36
+ jodit.editor.classList.remove(IMAGE_SELECTED);
32
37
  const buffer = cached(jodit, 'buffer');
33
38
  const list = buffer === null || buffer === void 0 ? void 0 : buffer.get(JODIT_IMAGE_BLOB_ID);
34
39
  if (buffer && list) {
@@ -59,6 +64,14 @@ export class imageProcessor extends Plugin {
59
64
  }
60
65
  }
61
66
  }
67
+ /**
68
+ * While the selection is an image, only the image is highlighted: Safari
69
+ * paints the rest of a block image's line with its parent's highlight. See #1528
70
+ */
71
+ onSelectionChange() {
72
+ const { jodit } = this;
73
+ jodit.editor.classList.toggle(IMAGE_SELECTED, isImageSelected(jodit));
74
+ }
62
75
  async afterChange(data) {
63
76
  const { jodit: editor } = this;
64
77
  if (!editor.editor) {
@@ -91,10 +104,24 @@ __decorate([
91
104
  __decorate([
92
105
  watch(':beforeSetElementValue')
93
106
  ], imageProcessor.prototype, "onBeforeSetElementValue", null);
107
+ __decorate([
108
+ autobind
109
+ ], imageProcessor.prototype, "onSelectionChange", null);
94
110
  __decorate([
95
111
  watch([':change', ':afterInit', ':changePlace']),
96
112
  debounce()
97
113
  ], imageProcessor.prototype, "afterChange", null);
114
+ function isImageSelected(jodit) {
115
+ const { sel } = jodit.s;
116
+ if (!sel || !sel.rangeCount) {
117
+ return false;
118
+ }
119
+ const { startContainer, startOffset, endContainer, endOffset } = sel.getRangeAt(0);
120
+ return (startContainer === endContainer &&
121
+ endOffset === startOffset + 1 &&
122
+ Dom.isTag(startContainer.childNodes[startOffset], 'img') &&
123
+ Dom.isOrContains(jodit.editor, startContainer));
124
+ }
98
125
  /**
99
126
  * Remove the invisible-space text beside an image, which only held a caret.
100
127
  * Selecting the image replaces the caret, and with the text still after a
@@ -271,13 +271,9 @@ export class source extends Plugin {
271
271
  return;
272
272
  }
273
273
  loading = true;
274
- loadNext(editor, editor.o.beautifyHTMLCDNUrlsJS).then(() => {
275
- // The source view was filled before the
276
- // beautifier arrived — format it now.
277
- if (addEventListener()) {
278
- this.syncValueFromWYSIWYG(true);
279
- }
280
- }, () => null);
274
+ // It formats the source view from the next time it opens:
275
+ // filling it again now would replace what was typed there
276
+ loadNext(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener, () => null);
281
277
  };
282
278
  editor.e.on('afterSetMode.source', loadBeautify);
283
279
  loadBeautify();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.16.0",
3
+ "version": "4.16.1",
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",
@@ -23,6 +23,11 @@ export declare class imageProcessor extends Plugin {
23
23
  protected onBeforeSetElementValue(data: {
24
24
  value: string;
25
25
  }): void;
26
+ /**
27
+ * While the selection is an image, only the image is highlighted: Safari
28
+ * paints the rest of a block image's line with its parent's highlight. See #1528
29
+ */
30
+ private onSelectionChange;
26
31
  protected afterChange(data: {
27
32
  value: string;
28
33
  }): Promise<void>;