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
package/es5/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.12.39
4
+ * Version: v4.12.43
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -2087,7 +2087,7 @@ __webpack_require__.r(__webpack_exports__);
2087
2087
  * @packageDocumentation
2088
2088
  * @module constants
2089
2089
  */
2090
- var APP_VERSION = "4.12.39";
2090
+ var APP_VERSION = "4.12.43";
2091
2091
  // prettier-ignore
2092
2092
  var ES = "es5";
2093
2093
  var IS_ES_MODERN = false;
@@ -30635,7 +30635,13 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
30635
30635
  content: form.container
30636
30636
  });
30637
30637
  }
30638
- return (0,jodit_modules_widget_tabs_tabs__WEBPACK_IMPORTED_MODULE_3__.TabsWidget)(editor, tabs);
30638
+ var box = (0,jodit_modules_widget_tabs_tabs__WEBPACK_IMPORTED_MODULE_3__.TabsWidget)(editor, tabs);
30639
+ // Marks this popup so its tabs auto-size to their labels (see
30640
+ // `.jodit-file-selector` in tabs.less) — long localized tab captions are no
30641
+ // longer clipped — while leaving other tab popups (link, video …)
30642
+ // untouched.
30643
+ box.classList.add('jodit-file-selector');
30644
+ return box;
30639
30645
  };
30640
30646
  function val(elm, selector, value) {
30641
30647
  var child = elm.querySelector(selector);
@@ -30797,10 +30803,6 @@ function val(elm, selector, value) {
30797
30803
  tab: tab
30798
30804
  };
30799
30805
  });
30800
- Object.values(nameToTab).forEach(function(param) {
30801
- var button = param.button;
30802
- button.container.style.width = (100 / tabs.length).toFixed(10) + '%';
30803
- });
30804
30806
  var tab = !state || !state.activeTab || !nameToTab[state.activeTab] ? firstTab : state.activeTab;
30805
30807
  setActive(tab);
30806
30808
  if (state) {
@@ -33452,6 +33454,43 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__.Icon.set('eraser', (_eraser_svg_
33452
33454
 
33453
33455
 
33454
33456
 
33457
+
33458
+ /***/ }),
33459
+
33460
+ /***/ 28665:
33461
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33462
+
33463
+ "use strict";
33464
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33465
+ /* harmony export */ isAllowedMediaEmbed: function() { return /* binding */ isAllowedMediaEmbed; }
33466
+ /* harmony export */ });
33467
+ /*!
33468
+ * Jodit Editor (https://xdsoft.net/jodit/)
33469
+ * Released under MIT see LICENSE.txt in the project root for license information.
33470
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
33471
+ */ /**
33472
+ * @module plugins/clean-html
33473
+ */ // The embed URLs produced by the built-in Video button (see
33474
+ // `convertMediaUrlToVideoEmbed`): `//www.youtube.com/embed/<id>` and
33475
+ // `//player.vimeo.com/video/<id>`. `youtube-nocookie.com` is the privacy
33476
+ // variant YouTube offers for the same `/embed/` player. The `/embed/` and
33477
+ // `/video/` path prefixes are required so a bare provider link
33478
+ // (`youtube.com/@somebody`) is not treated as a player.
33479
+ var YOUTUBE_EMBED = /^(https?:)?\/\/(www\.|m\.|music\.)?youtube(-nocookie)?\.com\/embed\//i;
33480
+ var VIMEO_EMBED = /^(https?:)?\/\/player\.vimeo\.com\/video\//i;
33481
+ /**
33482
+ * Whether an `<iframe>` `src` points at a recognized YouTube/Vimeo video
33483
+ * player. Such iframes are inserted intentionally through the Video button, so
33484
+ * clean-html must not strip them (`denyTags` includes `iframe` by default) or
33485
+ * neutralize them with an empty `sandbox=""` (#1381). Arbitrary/bare iframes
33486
+ * are still removed.
33487
+ *
33488
+ * @private
33489
+ */ function isAllowedMediaEmbed(src) {
33490
+ return YOUTUBE_EMBED.test(src) || VIMEO_EMBED.test(src);
33491
+ }
33492
+
33493
+
33455
33494
  /***/ }),
33456
33495
 
33457
33496
  /***/ 37431:
@@ -33942,6 +33981,7 @@ __webpack_require__.r(__webpack_exports__);
33942
33981
  /* harmony export */ });
33943
33982
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
33944
33983
  /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
33984
+ /* harmony import */ var _is_allowed_media_embed__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28665);
33945
33985
  /*!
33946
33986
  * Jodit Editor (https://xdsoft.net/jodit/)
33947
33987
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -33950,6 +33990,7 @@ __webpack_require__.r(__webpack_exports__);
33950
33990
  * @module plugins/clean-html
33951
33991
  */
33952
33992
 
33993
+
33953
33994
  /**
33954
33995
  * Add `sandbox=""` attribute to all `<iframe>` elements in the editor content
33955
33996
  * @private
@@ -33958,6 +33999,12 @@ __webpack_require__.r(__webpack_exports__);
33958
33999
  return hadEffect;
33959
34000
  }
33960
34001
  var elm = nodeElm;
34002
+ // A trusted YouTube/Vimeo player (inserted via the Video button) must not
34003
+ // get an empty `sandbox=""` — that blocks scripts and stops playback. It
34004
+ // is served in its own third-party origin, so leave it as-is (#1381).
34005
+ if ((0,_is_allowed_media_embed__WEBPACK_IMPORTED_MODULE_2__.isAllowedMediaEmbed)((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(elm, 'src') || '')) {
34006
+ return hadEffect;
34007
+ }
33961
34008
  if (!elm.hasAttribute('sandbox')) {
33962
34009
  (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(elm, 'sandbox', '');
33963
34010
  return true;
@@ -34130,6 +34177,8 @@ function filterStyleProperties(style, allowed) {
34130
34177
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
34131
34178
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
34132
34179
  /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4040);
34180
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7909);
34181
+ /* harmony import */ var _is_allowed_media_embed__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28665);
34133
34182
  /*!
34134
34183
  * Jodit Editor (https://xdsoft.net/jodit/)
34135
34184
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -34139,6 +34188,8 @@ function filterStyleProperties(style, allowed) {
34139
34188
  */
34140
34189
 
34141
34190
 
34191
+
34192
+
34142
34193
  /**
34143
34194
  * @private
34144
34195
  */ function tryRemoveNode(jodit, nodeElm, hadEffect, allowTags, denyTags, currentSelectionNode) {
@@ -34155,7 +34206,12 @@ function filterStyleProperties(style, allowed) {
34155
34206
  if (allow && !allow[node.nodeName]) {
34156
34207
  return true;
34157
34208
  }
34158
- if (!allow && deny && deny[node.nodeName]) {
34209
+ // A YouTube/Vimeo player inserted through the Video button is trusted
34210
+ // editor content, so keep it even though `iframe` is denied by default
34211
+ // — otherwise the embed is stripped ~300ms after insertion (#1381).
34212
+ // Arbitrary/bare iframes stay denied.
34213
+ var 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') || '');
34214
+ if (!allow && deny && deny[node.nodeName] && !isTrustedEmbed) {
34159
34215
  return true;
34160
34216
  }
34161
34217
  }