jodit 4.14.5 → 4.14.7

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 (57) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +5 -5
  4. package/es2015/jodit.js +92 -61
  5. package/es2015/jodit.min.js +5 -5
  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 +5 -5
  13. package/es2018/jodit.min.js +5 -5
  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 +5 -5
  18. package/es2021/jodit.js +92 -61
  19. package/es2021/jodit.min.js +5 -5
  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 +5 -5
  28. package/es2021.en/jodit.js +92 -61
  29. package/es2021.en/jodit.min.js +5 -5
  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 +92 -61
  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/modules/file-browser/builders/context-menu.js +1 -1
  52. package/esm/plugins/iframe/iframe.js +28 -9
  53. package/esm/styles/icons/download.svg.js +1 -0
  54. package/esm/styles/icons/index.d.ts +1 -1
  55. package/esm/styles/icons/index.js +2 -1
  56. package/package.json +1 -1
  57. package/types/styles/icons/index.d.ts +1 -1
@@ -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.14.5
4
+ * Version: v4.14.7
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.14.5
4
+ * Version: v4.14.7
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.14.5
4
+ * Version: v4.14.7
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.14.5
4
+ * Version: v4.14.7
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.14.5
4
+ * Version: v4.14.7
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.14.5
4
+ * Version: v4.14.7
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.14.5
4
+ * Version: v4.14.7
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.14.5
4
+ * Version: v4.14.7
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.14.5
4
+ * Version: v4.14.7
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.14.5";
6
+ export const APP_VERSION = "4.14.7";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -139,7 +139,7 @@ export default (self) => {
139
139
  }
140
140
  : false,
141
141
  {
142
- icon: 'upload',
142
+ icon: 'download',
143
143
  title: 'Download',
144
144
  exec: () => {
145
145
  const url = ga('href');
@@ -101,6 +101,26 @@ export function iframe(editor) {
101
101
  }
102
102
  return html;
103
103
  };
104
+ /**
105
+ * Replace the whole iframe document with the given HTML.
106
+ *
107
+ * The markup is parsed in an inert document first (no browsing
108
+ * context: scripts do not run, sub-resources are not fetched),
109
+ * sanitized there via `safeHTML`, and only then moved into the
110
+ * live document. `document.write` on the live document would
111
+ * execute inline scripts and event handlers while parsing,
112
+ * before the sanitizer had a chance to strip them, and the
113
+ * iframe is same-origin with the host page by default.
114
+ * A `<script>` the cleaner is configured to keep still never
115
+ * executes: nodes coming from an inert parser are flagged
116
+ * "already started", exactly like `innerHTML`.
117
+ * See GHSA-w3xv-x3fm-59ph.
118
+ */
119
+ const replaceDocument = (html) => {
120
+ const inert = new DOMParser().parseFromString(html, 'text/html');
121
+ editor.e.fire('safeHTML', inert.documentElement);
122
+ doc.replaceChild(doc.adoptNode(inert.documentElement), doc.documentElement);
123
+ };
104
124
  if (docMode) {
105
125
  const tag = editor.element.tagName;
106
126
  if (tag !== 'TEXTAREA' && tag !== 'INPUT') {
@@ -117,21 +137,20 @@ export function iframe(editor) {
117
137
  const old = doc.documentElement.outerHTML;
118
138
  if (clearMarkers(old) !==
119
139
  clearMarkers(value)) {
120
- doc.open();
121
- doc.write(editor.o.iframeDoctype +
122
- clearMarkers(value));
123
- doc.close();
140
+ replaceDocument(clearMarkers(value));
124
141
  editor.editor = doc.body;
125
- editor.e.fire('safeHTML', editor.editor);
126
142
  toggleEditable();
127
143
  editor.e.fire('prepareWYSIWYGEditor');
128
144
  editor.e.stopPropagation('beforeSetNativeEditorValue');
129
145
  }
146
+ return true;
130
147
  }
131
- else {
132
- doc.body.innerHTML = value;
133
- }
134
- return true;
148
+ // A partial value goes through the regular
149
+ // path: `clean-html` sanitizes it and the
150
+ // editor assigns it to `doc.body` via
151
+ // `innerHTML`. Writing the raw value here
152
+ // would fire its event handlers first.
153
+ return false;
135
154
  }, { top: true });
136
155
  }
137
156
  editor.editor = doc.body;
@@ -0,0 +1 @@
1
+ export default "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 1792\"> <path d=\"M1344 1344q0-26-19-45t-45-19-45 19-19 45 19 45 45 19 45-19 19-45zm256 0q0-26-19-45t-45-19-45 19-19 45 19 45 45 19 45-19 19-45zm128-224v320q0 40-28 68t-68 28h-1472q-40 0-68-28t-28-68v-320q0-40 28-68t68-28h465l135 136q58 56 136 56t136-56l136-136h464q40 0 68 28t28 68zm-325-569q17 41-14 70l-448 448q-18 19-45 19t-45-19l-448-448q-31-29-14-70 17-39 59-39h256v-448q0-26 19-45t45-19h256q26 0 45 19t19 45v448h256q42 0 59 39z\"/> </svg> ";
@@ -8,4 +8,4 @@
8
8
  * @packageDocumentation
9
9
  * @module icons
10
10
  */
11
- export { angle_down, angle_left, angle_right, angle_up, bin, cancel, center, check, chevron, dots, eye, file, folder, info_circle, left, lock, ok, pencil, plus, resize_handler, right, save, settings, unlock, update, upload, valign };
11
+ export { angle_down, angle_left, angle_right, angle_up, bin, cancel, center, check, chevron, dots, download, eye, file, folder, info_circle, left, lock, ok, pencil, plus, resize_handler, right, save, settings, unlock, update, upload, valign };
@@ -18,6 +18,7 @@ import center from "./center.svg.js";
18
18
  import check from "./check.svg.js";
19
19
  import chevron from "./chevron.svg.js";
20
20
  import dots from "./dots.svg.js";
21
+ import download from "./download.svg.js";
21
22
  import eye from "./eye.svg.js";
22
23
  import file from "./file.svg.js";
23
24
  import folder from "./folder.svg.js";
@@ -35,4 +36,4 @@ import unlock from "./unlock.svg.js";
35
36
  import update from "./update.svg.js";
36
37
  import upload from "./upload.svg.js";
37
38
  import valign from "./valign.svg.js";
38
- export { angle_down, angle_left, angle_right, angle_up, bin, cancel, center, check, chevron, dots, eye, file, folder, info_circle, left, lock, ok, pencil, plus, resize_handler, right, save, settings, unlock, update, upload, valign };
39
+ export { angle_down, angle_left, angle_right, angle_up, bin, cancel, center, check, chevron, dots, download, eye, file, folder, info_circle, left, lock, ok, pencil, plus, resize_handler, right, save, settings, unlock, update, upload, valign };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.14.5",
3
+ "version": "4.14.7",
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",
@@ -8,4 +8,4 @@
8
8
  * @packageDocumentation
9
9
  * @module icons
10
10
  */
11
- export { angle_down, angle_left, angle_right, angle_up, bin, cancel, center, check, chevron, dots, eye, file, folder, info_circle, left, lock, ok, pencil, plus, resize_handler, right, save, settings, unlock, update, upload, valign };
11
+ export { angle_down, angle_left, angle_right, angle_up, bin, cancel, center, check, chevron, dots, download, eye, file, folder, info_circle, left, lock, ok, pencil, plus, resize_handler, right, save, settings, unlock, update, upload, valign };