jodit-pro-react 5.5.57 → 5.5.59

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JoditEditor_default
3
- } from "./chunk-RQKFGSMC.mjs";
3
+ } from "./chunk-AMUUJ25V.mjs";
4
4
  export {
5
5
  JoditEditor_default as default
6
6
  };
@@ -193,7 +193,7 @@ var APP_VERSION, ES, IS_ES_MODERN, IS_ES_NEXT, IS_PROD, IS_TEST, FAT_MODE, HOMEP
193
193
  var init_constants = __esm({
194
194
  "node_modules/jodit/esm/core/constants.js"() {
195
195
  "use strict";
196
- APP_VERSION = "4.12.41";
196
+ APP_VERSION = "4.12.43";
197
197
  ES = "es2020";
198
198
  IS_ES_MODERN = true;
199
199
  IS_ES_NEXT = true;
@@ -20128,6 +20128,13 @@ function getHash(tags) {
20128
20128
  return false;
20129
20129
  }
20130
20130
 
20131
+ // node_modules/jodit/esm/plugins/clean-html/helpers/is-allowed-media-embed.js
20132
+ var YOUTUBE_EMBED = /^(https?:)?\/\/(www\.|m\.|music\.)?youtube(-nocookie)?\.com\/embed\//i;
20133
+ var VIMEO_EMBED = /^(https?:)?\/\/player\.vimeo\.com\/video\//i;
20134
+ function isAllowedMediaEmbed(src) {
20135
+ return YOUTUBE_EMBED.test(src) || VIMEO_EMBED.test(src);
20136
+ }
20137
+
20131
20138
  // node_modules/jodit/esm/plugins/clean-html/helpers/remove-format/remove-format-for-collapsed-selection.js
20132
20139
  init_constants();
20133
20140
  init_dom();
@@ -20396,6 +20403,9 @@ function sandboxIframesInContent(jodit, nodeElm, hadEffect) {
20396
20403
  return hadEffect;
20397
20404
  }
20398
20405
  const elm = nodeElm;
20406
+ if (isAllowedMediaEmbed(attr(elm, "src") || "")) {
20407
+ return hadEffect;
20408
+ }
20399
20409
  if (!elm.hasAttribute("sandbox")) {
20400
20410
  attr(elm, "sandbox", "");
20401
20411
  return true;
@@ -20484,6 +20494,7 @@ function filterStyleProperties(style, allowed) {
20484
20494
  init_constants();
20485
20495
  init_dom();
20486
20496
  init_trim();
20497
+ init_attr();
20487
20498
  function tryRemoveNode(jodit, nodeElm, hadEffect, allowTags, denyTags, currentSelectionNode) {
20488
20499
  if (isRemovableNode(jodit, nodeElm, currentSelectionNode, allowTags, denyTags)) {
20489
20500
  Dom.safeRemove(nodeElm);
@@ -20496,7 +20507,8 @@ function isRemovableNode(jodit, node, current, allow, deny) {
20496
20507
  if (allow && !allow[node.nodeName]) {
20497
20508
  return true;
20498
20509
  }
20499
- if (!allow && deny && deny[node.nodeName]) {
20510
+ const isTrustedEmbed = node.nodeName === "IFRAME" && isAllowedMediaEmbed(attr(node, "src") || "");
20511
+ if (!allow && deny && deny[node.nodeName] && !isTrustedEmbed) {
20500
20512
  return true;
20501
20513
  }
20502
20514
  }
@@ -45011,6 +45023,7 @@ _7([watch("style")], p30.prototype, "__updateStyles", null), p30 = x6 = _7([comp
45011
45023
 
45012
45024
  // node_modules/jodit-pro/esm/plugins/button-generator/ui/generator/button-generator.js
45013
45025
  init_decorators();
45026
+ init_helpers();
45014
45027
  init_assert();
45015
45028
 
45016
45029
  // node_modules/jodit-pro/esm/plugins/button-generator/assets/styles.json.js
@@ -45093,10 +45106,10 @@ var r35 = class r36 extends UIElement {
45093
45106
  <input type='range' min='8' max='28' name='fontSize' placeholder='~Font Size~'/>
45094
45107
  <div class='&__checkboxes'>
45095
45108
  <label>
45096
- <input type='checkbox' name='fontWeight'/> bold
45109
+ <input type='checkbox' name='fontWeight'/> ~bold~
45097
45110
  </label>
45098
45111
  <label>
45099
- <input type='checkbox' name='fontItalic'/> italic
45112
+ <input type='checkbox' name='fontItalic'/> ~italic~
45100
45113
  </label>
45101
45114
  </div>
45102
45115
  </div>
@@ -45252,11 +45265,11 @@ h27 = p31([component], h27);
45252
45265
  var u30 = Object.defineProperty;
45253
45266
  var p32 = (i54, t48) => u30(i54, "name", { value: t48, configurable: true });
45254
45267
  var a40;
45255
- var b13 = function(i54, t48, e42, o57) {
45256
- var s50 = arguments.length, r59 = s50 < 3 ? t48 : o57 === null ? o57 = Object.getOwnPropertyDescriptor(t48, e42) : o57, n57;
45257
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r59 = Reflect.decorate(i54, t48, e42, o57);
45258
- else for (var f50 = i54.length - 1; f50 >= 0; f50--) (n57 = i54[f50]) && (r59 = (s50 < 3 ? n57(r59) : s50 > 3 ? n57(t48, e42, r59) : n57(t48, e42)) || r59);
45259
- return s50 > 3 && r59 && Object.defineProperty(t48, e42, r59), r59;
45268
+ var b13 = function(i54, t48, e42, r59) {
45269
+ var s50 = arguments.length, o57 = s50 < 3 ? t48 : r59 === null ? r59 = Object.getOwnPropertyDescriptor(t48, e42) : r59, n57;
45270
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o57 = Reflect.decorate(i54, t48, e42, r59);
45271
+ else for (var f50 = i54.length - 1; f50 >= 0; f50--) (n57 = i54[f50]) && (o57 = (s50 < 3 ? n57(o57) : s50 > 3 ? n57(t48, e42, o57) : n57(t48, e42)) || o57);
45272
+ return s50 > 3 && o57 && Object.defineProperty(t48, e42, o57), o57;
45260
45273
  };
45261
45274
  var l27;
45262
45275
  var d24 = l27 = (a40 = class extends UIElement {
@@ -45276,23 +45289,23 @@ var d24 = l27 = (a40 = class extends UIElement {
45276
45289
  super(t48), this.state = { text: "", className: "", href: "", bgEnd: "#5cbf2a", bgStart: "#44c767", borderColor: "#18ab29", borderRadius: 28, borderSize: 1, boxShadow: false, boxShadowBlurRadius: 0, boxShadowColor: "#3dc21b", boxShadowInset: false, boxShadowOffsetX: 0, boxShadowOffsetY: 0, boxShadowSpreadRadius: 0, fontColor: "#fff", fontFamily: "Arial", fontSize: 17, fontStyle: false, fontWeight: false, fontItalic: false, paddingX: 31, paddingY: 16, previewBgColor: "#f5f5f5", solid: true, textShadow: true, textShadowBlurRadius: 0, textShadowColor: "#2f6627", textShadowOffsetX: 0, textShadowOffsetY: 1 }, this.preview = new h27(this.j, this.state, this.updateState), this.form = new h26(this.j, this.state, this.updateState), this.generateLibrary();
45277
45290
  const e42 = this.getElm("preview");
45278
45291
  assert(e42 != null, "preview element does not exists"), e42.appendChild(this.preview.container);
45279
- const o57 = this.getElm("form");
45280
- assert(o57 != null, "form element does not exists"), o57.appendChild(this.form.container);
45292
+ const r59 = this.getElm("form");
45293
+ assert(r59 != null, "form element does not exists"), r59.appendChild(this.form.container);
45281
45294
  }
45282
45295
  generateLibrary() {
45283
45296
  const t48 = new UIGroup(this.j);
45284
- s27.map(l27.mapKey).forEach((o57) => {
45285
- const s50 = new p30(this.j, o57);
45297
+ s27.map((r59) => l27.mapKey(r59, this.j)).forEach((r59) => {
45298
+ const s50 = new p30(this.j, r59);
45286
45299
  s50.setMod("mode", "library"), t48.append(s50), this.j.e.on(s50.container, "click", () => {
45287
- const { text: r59 } = this.state;
45288
- Object.assign(this.state, o57), Object.assign(this.state, { className: "", text: r59 }), this.update();
45300
+ const { text: o57 } = this.state;
45301
+ Object.assign(this.state, r59), Object.assign(this.state, { className: "", text: o57 }), this.update();
45289
45302
  });
45290
45303
  });
45291
45304
  const e42 = this.getElm("library");
45292
45305
  assert(e42 != null, "library element does not exists"), e42.appendChild(t48.container);
45293
45306
  }
45294
- static mapKey(t48) {
45295
- return { bgEnd: t48.be, bgStart: t48.bs, borderColor: t48.bc, borderRadius: t48.br, borderSize: t48.bse, boxShadow: t48.bsh, boxShadowBlurRadius: t48.bsbr, boxShadowColor: t48.bsc, boxShadowInset: t48.bsi, boxShadowOffsetX: t48.bsox, boxShadowOffsetY: t48.bsoy, boxShadowSpreadRadius: t48.bssr, fontColor: t48.fc, fontFamily: t48.ff, fontSize: t48.fs, fontStyle: t48.fse, fontWeight: t48.fw, paddingX: t48.px, paddingY: t48.py, previewBgColor: t48.pbc, solid: t48.s, text: t48.t, textShadow: t48.ts, textShadowBlurRadius: t48.tsbr, textShadowColor: t48.tsc, textShadowOffsetX: t48.tsox, textShadowOffsetY: t48.tsoy };
45307
+ static mapKey(t48, e42) {
45308
+ return { bgEnd: t48.be, bgStart: t48.bs, borderColor: t48.bc, borderRadius: t48.br, borderSize: t48.bse, boxShadow: t48.bsh, boxShadowBlurRadius: t48.bsbr, boxShadowColor: t48.bsc, boxShadowInset: t48.bsi, boxShadowOffsetX: t48.bsox, boxShadowOffsetY: t48.bsoy, boxShadowSpreadRadius: t48.bssr, fontColor: t48.fc, fontFamily: t48.ff, fontSize: t48.fs, fontStyle: t48.fse, fontWeight: t48.fw, paddingX: t48.px, paddingY: t48.py, previewBgColor: t48.pbc, solid: t48.s, text: isString(t48.t) ? e42.i18n(t48.t) : t48.t, textShadow: t48.ts, textShadowBlurRadius: t48.tsbr, textShadowColor: t48.tsc, textShadowOffsetX: t48.tsox, textShadowOffsetY: t48.tsoy };
45296
45309
  }
45297
45310
  updateState(t48, e42) {
45298
45311
  this.state[t48] = e42, this.update();
@@ -53287,6 +53300,7 @@ jodit/esm/plugins/bold/bold.js:
53287
53300
  jodit/esm/plugins/class-span/class-span.js:
53288
53301
  jodit/esm/plugins/clean-html/config.js:
53289
53302
  jodit/esm/plugins/clean-html/helpers/get-hash.js:
53303
+ jodit/esm/plugins/clean-html/helpers/is-allowed-media-embed.js:
53290
53304
  jodit/esm/plugins/clean-html/helpers/remove-format/remove-format-for-collapsed-selection.js:
53291
53305
  jodit/esm/plugins/clean-html/helpers/remove-format/remove-format-for-selection.js:
53292
53306
  jodit/esm/plugins/clean-html/helpers/visitor/filters/allow-attributes.js:
@@ -2,7 +2,7 @@ import {
2
2
  Config,
3
3
  JoditEditor_default,
4
4
  n
5
- } from "./chunk-RQKFGSMC.mjs";
5
+ } from "./chunk-AMUUJ25V.mjs";
6
6
 
7
7
  // src/index.ts
8
8
  var index_default = JoditEditor_default;