jodit 4.12.39 → 4.12.43

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 +12 -0
  2. package/es2015/jodit.css +13 -1
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +4 -4
  5. package/es2015/jodit.js +64 -7
  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 +13 -1
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +4 -4
  23. package/es2021/jodit.js +64 -7
  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 +13 -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 +64 -7
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +5 -5
  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 +18 -2
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +64 -8
  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/modules/widget/file-selector/file-selector.js +7 -1
  61. package/esm/modules/widget/tabs/tabs.js +0 -3
  62. package/esm/plugins/clean-html/helpers/index.d.ts +1 -0
  63. package/esm/plugins/clean-html/helpers/index.js +1 -0
  64. package/esm/plugins/clean-html/helpers/is-allowed-media-embed.d.ts +15 -0
  65. package/esm/plugins/clean-html/helpers/is-allowed-media-embed.js +28 -0
  66. package/esm/plugins/clean-html/helpers/visitor/filters/sandbox-iframes-in-content.js +7 -0
  67. package/esm/plugins/clean-html/helpers/visitor/filters/try-remove-node.js +9 -1
  68. package/package.json +1 -1
  69. package/types/plugins/clean-html/helpers/index.d.ts +1 -0
  70. package/types/plugins/clean-html/helpers/is-allowed-media-embed.d.ts +15 -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.12.39
4
+ * Version: v4.12.43
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1823,7 +1823,7 @@ __webpack_require__.r(__webpack_exports__);
1823
1823
  * ```
1824
1824
  * @packageDocumentation
1825
1825
  * @module constants
1826
- */ const APP_VERSION = "4.12.39";
1826
+ */ const APP_VERSION = "4.12.43";
1827
1827
  // prettier-ignore
1828
1828
  const ES = "es2021";
1829
1829
  const IS_ES_MODERN = true;
@@ -25296,7 +25296,13 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
25296
25296
  content: form.container
25297
25297
  });
25298
25298
  }
25299
- return (0,jodit_modules_widget_tabs_tabs__WEBPACK_IMPORTED_MODULE_3__.TabsWidget)(editor, tabs);
25299
+ const box = (0,jodit_modules_widget_tabs_tabs__WEBPACK_IMPORTED_MODULE_3__.TabsWidget)(editor, tabs);
25300
+ // Marks this popup so its tabs auto-size to their labels (see
25301
+ // `.jodit-file-selector` in tabs.less) — long localized tab captions are no
25302
+ // longer clipped — while leaving other tab popups (link, video …)
25303
+ // untouched.
25304
+ box.classList.add('jodit-file-selector');
25305
+ return box;
25300
25306
  };
25301
25307
  function val(elm, selector, value) {
25302
25308
  const child = elm.querySelector(selector);
@@ -25452,9 +25458,6 @@ function val(elm, selector, value) {
25452
25458
  tab
25453
25459
  };
25454
25460
  });
25455
- Object.values(nameToTab).forEach(({ button })=>{
25456
- button.container.style.width = (100 / tabs.length).toFixed(10) + '%';
25457
- });
25458
25461
  const tab = !state || !state.activeTab || !nameToTab[state.activeTab] ? firstTab : state.activeTab;
25459
25462
  setActive(tab);
25460
25463
  if (state) {
@@ -27766,6 +27769,43 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__.Icon.set('eraser', (_eraser_svg_
27766
27769
 
27767
27770
 
27768
27771
 
27772
+
27773
+ /***/ }),
27774
+
27775
+ /***/ 28665:
27776
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
27777
+
27778
+ "use strict";
27779
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
27780
+ /* harmony export */ isAllowedMediaEmbed: function() { return /* binding */ isAllowedMediaEmbed; }
27781
+ /* harmony export */ });
27782
+ /*!
27783
+ * Jodit Editor (https://xdsoft.net/jodit/)
27784
+ * Released under MIT see LICENSE.txt in the project root for license information.
27785
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
27786
+ */ /**
27787
+ * @module plugins/clean-html
27788
+ */ // The embed URLs produced by the built-in Video button (see
27789
+ // `convertMediaUrlToVideoEmbed`): `//www.youtube.com/embed/<id>` and
27790
+ // `//player.vimeo.com/video/<id>`. `youtube-nocookie.com` is the privacy
27791
+ // variant YouTube offers for the same `/embed/` player. The `/embed/` and
27792
+ // `/video/` path prefixes are required so a bare provider link
27793
+ // (`youtube.com/@somebody`) is not treated as a player.
27794
+ const YOUTUBE_EMBED = /^(https?:)?\/\/(www\.|m\.|music\.)?youtube(-nocookie)?\.com\/embed\//i;
27795
+ const VIMEO_EMBED = /^(https?:)?\/\/player\.vimeo\.com\/video\//i;
27796
+ /**
27797
+ * Whether an `<iframe>` `src` points at a recognized YouTube/Vimeo video
27798
+ * player. Such iframes are inserted intentionally through the Video button, so
27799
+ * clean-html must not strip them (`denyTags` includes `iframe` by default) or
27800
+ * neutralize them with an empty `sandbox=""` (#1381). Arbitrary/bare iframes
27801
+ * are still removed.
27802
+ *
27803
+ * @private
27804
+ */ function isAllowedMediaEmbed(src) {
27805
+ return YOUTUBE_EMBED.test(src) || VIMEO_EMBED.test(src);
27806
+ }
27807
+
27808
+
27769
27809
  /***/ }),
27770
27810
 
27771
27811
  /***/ 37431:
@@ -28254,6 +28294,7 @@ __webpack_require__.r(__webpack_exports__);
28254
28294
  /* harmony export */ });
28255
28295
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
28256
28296
  /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
28297
+ /* harmony import */ var _is_allowed_media_embed__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28665);
28257
28298
  /*!
28258
28299
  * Jodit Editor (https://xdsoft.net/jodit/)
28259
28300
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -28262,6 +28303,7 @@ __webpack_require__.r(__webpack_exports__);
28262
28303
  * @module plugins/clean-html
28263
28304
  */
28264
28305
 
28306
+
28265
28307
  /**
28266
28308
  * Add `sandbox=""` attribute to all `<iframe>` elements in the editor content
28267
28309
  * @private
@@ -28270,6 +28312,12 @@ __webpack_require__.r(__webpack_exports__);
28270
28312
  return hadEffect;
28271
28313
  }
28272
28314
  const elm = nodeElm;
28315
+ // A trusted YouTube/Vimeo player (inserted via the Video button) must not
28316
+ // get an empty `sandbox=""` — that blocks scripts and stops playback. It
28317
+ // is served in its own third-party origin, so leave it as-is (#1381).
28318
+ if ((0,_is_allowed_media_embed__WEBPACK_IMPORTED_MODULE_2__.isAllowedMediaEmbed)((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(elm, 'src') || '')) {
28319
+ return hadEffect;
28320
+ }
28273
28321
  if (!elm.hasAttribute('sandbox')) {
28274
28322
  (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(elm, 'sandbox', '');
28275
28323
  return true;
@@ -28406,6 +28454,8 @@ function filterStyleProperties(style, allowed) {
28406
28454
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
28407
28455
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
28408
28456
  /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4040);
28457
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7909);
28458
+ /* harmony import */ var _is_allowed_media_embed__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28665);
28409
28459
  /*!
28410
28460
  * Jodit Editor (https://xdsoft.net/jodit/)
28411
28461
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -28415,6 +28465,8 @@ function filterStyleProperties(style, allowed) {
28415
28465
  */
28416
28466
 
28417
28467
 
28468
+
28469
+
28418
28470
  /**
28419
28471
  * @private
28420
28472
  */ function tryRemoveNode(jodit, nodeElm, hadEffect, allowTags, denyTags, currentSelectionNode) {
@@ -28431,7 +28483,12 @@ function filterStyleProperties(style, allowed) {
28431
28483
  if (allow && !allow[node.nodeName]) {
28432
28484
  return true;
28433
28485
  }
28434
- if (!allow && deny && deny[node.nodeName]) {
28486
+ // A YouTube/Vimeo player inserted through the Video button is trusted
28487
+ // editor content, so keep it even though `iframe` is denied by default
28488
+ // — otherwise the embed is stripped ~300ms after insertion (#1381).
28489
+ // Arbitrary/bare iframes stay denied.
28490
+ const isTrustedEmbed = node.nodeName === 'IFRAME' && (0,_is_allowed_media_embed__WEBPACK_IMPORTED_MODULE_4__.isAllowedMediaEmbed)((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__.attr)(node, 'src') || '');
28491
+ if (!allow && deny && deny[node.nodeName] && !isTrustedEmbed) {
28435
28492
  return true;
28436
28493
  }
28437
28494
  }