jodit-pro-react 5.5.52 → 5.5.53

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-JS4ICKC5.mjs";
3
+ } from "./chunk-TE7OPFFK.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.37";
196
+ APP_VERSION = "4.12.38";
197
197
  ES = "es2020";
198
198
  IS_ES_MODERN = true;
199
199
  IS_ES_NEXT = true;
@@ -2404,6 +2404,9 @@ var init_append_script = __esm({
2404
2404
  async: true,
2405
2405
  src: completeUrl(url2)
2406
2406
  });
2407
+ if (jodit.o.nonce) {
2408
+ script.setAttribute("nonce", jodit.o.nonce);
2409
+ }
2407
2410
  jodit.e.one(script, "error", reject).one(script, "load", resolve);
2408
2411
  jodit.od.body.appendChild(script);
2409
2412
  });
@@ -2417,6 +2420,9 @@ var init_append_script = __esm({
2417
2420
  link2.rel = "stylesheet";
2418
2421
  link2.media = "all";
2419
2422
  link2.crossOrigin = "anonymous";
2423
+ if (jodit.o.nonce) {
2424
+ link2.setAttribute("nonce", jodit.o.nonce);
2425
+ }
2420
2426
  const callback = () => resolve(link2);
2421
2427
  !jodit.isInDestruct && jodit.e.on(link2, "load", callback).on(link2, "error", reject);
2422
2428
  link2.href = completeUrl(url2);
@@ -2906,6 +2912,9 @@ function getContainer(jodit, classFunc, tag = "div", createInsideEditor = false)
2906
2912
  const box = c70.element(tag, {
2907
2913
  className: `jodit jodit-${kebabCase(name)}-container jodit-box`
2908
2914
  });
2915
+ if (view.o.nonce && (tag === "style" || tag === "script")) {
2916
+ box.setAttribute("nonce", view.o.nonce);
2917
+ }
2909
2918
  box.classList.add(`jodit_theme_${view.o.theme || "default"}`);
2910
2919
  body.appendChild(box);
2911
2920
  data[key3] = box;
@@ -3652,6 +3661,7 @@ var init_config = __esm({
3652
3661
  this.ownerDocument = globalDocument;
3653
3662
  this.ownerWindow = globalWindow;
3654
3663
  this.shadowRoot = null;
3664
+ this.nonce = "";
3655
3665
  this.zIndex = 0;
3656
3666
  this.readonly = false;
3657
3667
  this.disabled = false;
@@ -25489,6 +25499,7 @@ Config.prototype.link = {
25489
25499
  followOnDblClick: false,
25490
25500
  processVideoLink: true,
25491
25501
  processPastedLink: true,
25502
+ deriveUrlFromText: false,
25492
25503
  noFollowCheckbox: true,
25493
25504
  openInNewTabCheckbox: true,
25494
25505
  openInNewTabCheckboxDefaultChecked: false,
@@ -25671,6 +25682,9 @@ var link = class extends Plugin {
25671
25682
  insert.textContent = i18n2("Update");
25672
25683
  } else {
25673
25684
  Dom.hide(unlink);
25685
+ if (jodit.o.link.deriveUrlFromText && url_input && !isImageContent && !url_input.value.trim()) {
25686
+ url_input.value = guessUrlFromText(content_input.value);
25687
+ }
25674
25688
  if (openInNewTabCheckbox && target_checkbox) {
25675
25689
  target_checkbox.checked = openInNewTabCheckboxDefaultChecked;
25676
25690
  }
@@ -25784,6 +25798,22 @@ __decorate52([
25784
25798
  autobind
25785
25799
  ], link.prototype, "__onClickReadOnlyLink", null);
25786
25800
  pluginSystem.add("link", link);
25801
+ function guessUrlFromText(text2) {
25802
+ const value = text2.trim();
25803
+ if (!value || /\s/.test(value)) {
25804
+ return "";
25805
+ }
25806
+ if (/^(https?:|mailto:|tel:|ftp:|#|\/|\.{1,2}\/)/i.test(value)) {
25807
+ return value;
25808
+ }
25809
+ if (/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
25810
+ return `mailto:${value}`;
25811
+ }
25812
+ if (/^[a-z0-9-]+(\.[a-z0-9-]+)+(\/\S*)?$/i.test(value)) {
25813
+ return `https://${value}`;
25814
+ }
25815
+ return "";
25816
+ }
25787
25817
  function writeClasses(modeClassName, className_input, className_select, a75) {
25788
25818
  var _a2;
25789
25819
  if (modeClassName && (className_input !== null && className_input !== void 0 ? className_input : className_select)) {
@@ -2,7 +2,7 @@ import {
2
2
  Config,
3
3
  JoditEditor_default,
4
4
  n
5
- } from "./chunk-JS4ICKC5.mjs";
5
+ } from "./chunk-TE7OPFFK.mjs";
6
6
 
7
7
  // src/index.ts
8
8
  var index_default = JoditEditor_default;