jodit 4.12.41 → 4.12.44

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 (71) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +4 -4
  4. package/es2015/jodit.js +99 -6
  5. package/es2015/jodit.min.js +4 -4
  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 +4 -4
  13. package/es2018/jodit.min.js +4 -4
  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 +6 -6
  18. package/es2021/jodit.js +99 -6
  19. package/es2021/jodit.min.js +6 -6
  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 +6 -6
  28. package/es2021.en/jodit.js +99 -6
  29. package/es2021.en/jodit.min.js +7 -7
  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 +99 -6
  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/config.d.ts +22 -0
  51. package/esm/config.js +21 -0
  52. package/esm/core/constants.js +1 -1
  53. package/esm/core/storage/async-storage.d.ts +2 -2
  54. package/esm/core/storage/async-storage.js +19 -1
  55. package/esm/core/storage/engines/local-storage-provider.js +6 -1
  56. package/esm/core/view/view.js +1 -1
  57. package/esm/plugins/clean-html/helpers/index.d.ts +1 -0
  58. package/esm/plugins/clean-html/helpers/index.js +1 -0
  59. package/esm/plugins/clean-html/helpers/is-allowed-media-embed.d.ts +15 -0
  60. package/esm/plugins/clean-html/helpers/is-allowed-media-embed.js +28 -0
  61. package/esm/plugins/clean-html/helpers/visitor/filters/sandbox-iframes-in-content.js +7 -0
  62. package/esm/plugins/clean-html/helpers/visitor/filters/try-remove-node.js +9 -1
  63. package/esm/types/storage.d.ts +15 -0
  64. package/esm/types/view.d.ts +8 -1
  65. package/package.json +1 -1
  66. package/types/config.d.ts +22 -0
  67. package/types/core/storage/async-storage.d.ts +2 -2
  68. package/types/plugins/clean-html/helpers/index.d.ts +1 -0
  69. package/types/plugins/clean-html/helpers/is-allowed-media-embed.d.ts +15 -0
  70. package/types/types/storage.d.ts +15 -0
  71. package/types/types/view.d.ts +8 -1
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.41
4
+ * Version: v4.12.44
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -378,6 +378,26 @@ var ConfigPrototype = {};
378
378
  /**
379
379
  * if set true, then the current mode is saved in a cookie, and is restored after a reload of the page
380
380
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_2__._)(this, "saveModeInStorage", false);
381
+ /**
382
+ * Configure the provider that backs {@link IViewBased.asyncStorage}.
383
+ *
384
+ * By default the editor's `asyncStorage` uses persistent `IndexedDB` (with an
385
+ * in-memory fallback when it is unavailable). Set `defaultProvider` to override it:
386
+ * - `'local'` — persist in `localStorage`;
387
+ * - `'memory'` — keep everything in memory (nothing survives a reload);
388
+ * - a custom {@link IAsyncStorage} implementation — plug in your own backend.
389
+ *
390
+ * ```javascript
391
+ * Jodit.make('#editor', {
392
+ * asyncStorage: { defaultProvider: 'local' }
393
+ * });
394
+ *
395
+ * // or a fully custom backend
396
+ * Jodit.make('#editor', {
397
+ * asyncStorage: { defaultProvider: myAsyncStorage }
398
+ * });
399
+ * ```
400
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_2__._)(this, "asyncStorage", {});
381
401
  /**
382
402
  * Class name that can be appended to the editable area
383
403
  *
@@ -2087,7 +2107,7 @@ __webpack_require__.r(__webpack_exports__);
2087
2107
  * @packageDocumentation
2088
2108
  * @module constants
2089
2109
  */
2090
- var APP_VERSION = "4.12.41";
2110
+ var APP_VERSION = "4.12.44";
2091
2111
  // prettier-ignore
2092
2112
  var ES = "es5";
2093
2113
  var IS_ES_MODERN = false;
@@ -14997,9 +15017,23 @@ var AsyncStorage = /*#__PURE__*/ function() {
14997
15017
  {
14998
15018
  key: "makeStorage",
14999
15019
  value: function makeStorage() {
15000
- var persistentOrStrategy = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, suffix = arguments.length > 1 ? arguments[1] : void 0;
15020
+ var persistentOrStrategy = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, suffix = arguments.length > 1 ? arguments[1] : void 0, options = arguments.length > 2 ? arguments[2] : void 0;
15001
15021
  var provider = undefined;
15002
15022
  var storage = null;
15023
+ // An explicit `defaultProvider` overrides the strategy-based selection
15024
+ // below and decides which provider backs the storage.
15025
+ var defaultProvider = options === null || options === void 0 ? void 0 : options.defaultProvider;
15026
+ if (defaultProvider != null) {
15027
+ if (defaultProvider === 'local') {
15028
+ provider = (0,_engines_local_storage_provider__WEBPACK_IMPORTED_MODULE_7__.canUsePersistentStorage)('localStorage') ? new _engines_local_storage_provider__WEBPACK_IMPORTED_MODULE_7__.LocalStorageProvider(_storage__WEBPACK_IMPORTED_MODULE_9__.StorageKey + (suffix || '')) : new _engines_memory_storage_provider__WEBPACK_IMPORTED_MODULE_8__.MemoryStorageProvider();
15029
+ } else if (defaultProvider === 'memory') {
15030
+ provider = new _engines_memory_storage_provider__WEBPACK_IMPORTED_MODULE_8__.MemoryStorageProvider();
15031
+ } else {
15032
+ // A custom IAsyncStorage implementation, used as-is.
15033
+ provider = defaultProvider;
15034
+ }
15035
+ return new AsyncStorage(Promise.resolve(provider), suffix);
15036
+ }
15003
15037
  if (persistentOrStrategy === 'localStorage' || persistentOrStrategy === 'sessionStorage') {
15004
15038
  if ((0,_engines_local_storage_provider__WEBPACK_IMPORTED_MODULE_7__.canUsePersistentStorage)(persistentOrStrategy)) {
15005
15039
  provider = new _engines_local_storage_provider__WEBPACK_IMPORTED_MODULE_7__.LocalStorageProvider(_storage__WEBPACK_IMPORTED_MODULE_9__.StorageKey + (suffix || ''), persistentOrStrategy);
@@ -15728,7 +15762,12 @@ function clearUseIndexedDBCache() {
15728
15762
  key: "delete",
15729
15763
  value: function _delete(key) {
15730
15764
  try {
15731
- this.storage.removeItem(this.rootKey);
15765
+ var buffer = this.storage.getItem(this.rootKey);
15766
+ if (buffer) {
15767
+ var json = JSON.parse(buffer);
15768
+ delete json[key];
15769
+ this.storage.setItem(this.rootKey, JSON.stringify(json));
15770
+ }
15732
15771
  } catch (unused) {}
15733
15772
  return this;
15734
15773
  }
@@ -20269,7 +20308,7 @@ var View = /*#__PURE__*/ function(Component) {
20269
20308
  get: /**
20270
20309
  * Container for persistent set/get value
20271
20310
  */ function get() {
20272
- return jodit_core_storage_async_storage__WEBPACK_IMPORTED_MODULE_21__.AsyncStorage.makeStorage(true, this.id);
20311
+ return jodit_core_storage_async_storage__WEBPACK_IMPORTED_MODULE_21__.AsyncStorage.makeStorage(true, this.id, this.o.asyncStorage);
20273
20312
  }
20274
20313
  },
20275
20314
  {
@@ -33454,6 +33493,43 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__.Icon.set('eraser', (_eraser_svg_
33454
33493
 
33455
33494
 
33456
33495
 
33496
+
33497
+ /***/ }),
33498
+
33499
+ /***/ 28665:
33500
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33501
+
33502
+ "use strict";
33503
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33504
+ /* harmony export */ isAllowedMediaEmbed: function() { return /* binding */ isAllowedMediaEmbed; }
33505
+ /* harmony export */ });
33506
+ /*!
33507
+ * Jodit Editor (https://xdsoft.net/jodit/)
33508
+ * Released under MIT see LICENSE.txt in the project root for license information.
33509
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
33510
+ */ /**
33511
+ * @module plugins/clean-html
33512
+ */ // The embed URLs produced by the built-in Video button (see
33513
+ // `convertMediaUrlToVideoEmbed`): `//www.youtube.com/embed/<id>` and
33514
+ // `//player.vimeo.com/video/<id>`. `youtube-nocookie.com` is the privacy
33515
+ // variant YouTube offers for the same `/embed/` player. The `/embed/` and
33516
+ // `/video/` path prefixes are required so a bare provider link
33517
+ // (`youtube.com/@somebody`) is not treated as a player.
33518
+ var YOUTUBE_EMBED = /^(https?:)?\/\/(www\.|m\.|music\.)?youtube(-nocookie)?\.com\/embed\//i;
33519
+ var VIMEO_EMBED = /^(https?:)?\/\/player\.vimeo\.com\/video\//i;
33520
+ /**
33521
+ * Whether an `<iframe>` `src` points at a recognized YouTube/Vimeo video
33522
+ * player. Such iframes are inserted intentionally through the Video button, so
33523
+ * clean-html must not strip them (`denyTags` includes `iframe` by default) or
33524
+ * neutralize them with an empty `sandbox=""` (#1381). Arbitrary/bare iframes
33525
+ * are still removed.
33526
+ *
33527
+ * @private
33528
+ */ function isAllowedMediaEmbed(src) {
33529
+ return YOUTUBE_EMBED.test(src) || VIMEO_EMBED.test(src);
33530
+ }
33531
+
33532
+
33457
33533
  /***/ }),
33458
33534
 
33459
33535
  /***/ 37431:
@@ -33944,6 +34020,7 @@ __webpack_require__.r(__webpack_exports__);
33944
34020
  /* harmony export */ });
33945
34021
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
33946
34022
  /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
34023
+ /* harmony import */ var _is_allowed_media_embed__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28665);
33947
34024
  /*!
33948
34025
  * Jodit Editor (https://xdsoft.net/jodit/)
33949
34026
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -33952,6 +34029,7 @@ __webpack_require__.r(__webpack_exports__);
33952
34029
  * @module plugins/clean-html
33953
34030
  */
33954
34031
 
34032
+
33955
34033
  /**
33956
34034
  * Add `sandbox=""` attribute to all `<iframe>` elements in the editor content
33957
34035
  * @private
@@ -33960,6 +34038,12 @@ __webpack_require__.r(__webpack_exports__);
33960
34038
  return hadEffect;
33961
34039
  }
33962
34040
  var elm = nodeElm;
34041
+ // A trusted YouTube/Vimeo player (inserted via the Video button) must not
34042
+ // get an empty `sandbox=""` — that blocks scripts and stops playback. It
34043
+ // is served in its own third-party origin, so leave it as-is (#1381).
34044
+ if ((0,_is_allowed_media_embed__WEBPACK_IMPORTED_MODULE_2__.isAllowedMediaEmbed)((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(elm, 'src') || '')) {
34045
+ return hadEffect;
34046
+ }
33963
34047
  if (!elm.hasAttribute('sandbox')) {
33964
34048
  (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(elm, 'sandbox', '');
33965
34049
  return true;
@@ -34132,6 +34216,8 @@ function filterStyleProperties(style, allowed) {
34132
34216
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
34133
34217
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
34134
34218
  /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4040);
34219
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7909);
34220
+ /* harmony import */ var _is_allowed_media_embed__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28665);
34135
34221
  /*!
34136
34222
  * Jodit Editor (https://xdsoft.net/jodit/)
34137
34223
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -34141,6 +34227,8 @@ function filterStyleProperties(style, allowed) {
34141
34227
  */
34142
34228
 
34143
34229
 
34230
+
34231
+
34144
34232
  /**
34145
34233
  * @private
34146
34234
  */ function tryRemoveNode(jodit, nodeElm, hadEffect, allowTags, denyTags, currentSelectionNode) {
@@ -34157,7 +34245,12 @@ function filterStyleProperties(style, allowed) {
34157
34245
  if (allow && !allow[node.nodeName]) {
34158
34246
  return true;
34159
34247
  }
34160
- if (!allow && deny && deny[node.nodeName]) {
34248
+ // A YouTube/Vimeo player inserted through the Video button is trusted
34249
+ // editor content, so keep it even though `iframe` is denied by default
34250
+ // — otherwise the embed is stripped ~300ms after insertion (#1381).
34251
+ // Arbitrary/bare iframes stay denied.
34252
+ 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') || '');
34253
+ if (!allow && deny && deny[node.nodeName] && !isTrustedEmbed) {
34161
34254
  return true;
34162
34255
  }
34163
34256
  }
package/es5/jodit.min.css CHANGED
@@ -1,14 +1,14 @@
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.41
4
+ * Version: v4.12.44
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
8
8
  /*!
9
9
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
10
10
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
11
- * Version: v4.12.41
11
+ * Version: v4.12.44
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */