@editora/core 1.0.9 → 1.0.10

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 (99) hide show
  1. package/README.md +1 -1
  2. package/dist/{A11yCheckerPlugin.native-58d12bed.mjs → A11yCheckerPlugin.native-BRdGYMju.mjs} +12 -23
  3. package/dist/{AnchorPlugin.native-289a112a.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +102 -112
  4. package/dist/{ApprovalWorkflowPlugin.native-449ce66c.mjs → ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs} +173 -209
  5. package/dist/{BackgroundColorPlugin.native-8aceb5cc.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +9 -16
  6. package/dist/BlockquotePlugin.native-57_Xcjl1.mjs +212 -0
  7. package/dist/{BlocksLibraryPlugin.native-1cc51e63.mjs → BlocksLibraryPlugin.native-5sdsXsiE.mjs} +149 -205
  8. package/dist/{BoldPlugin.native-f9d7f8e4.mjs → BoldPlugin.native-CSh_LiIJ.mjs} +11 -7
  9. package/dist/CapitalizationPlugin.native-DLV4oPmB.mjs +159 -0
  10. package/dist/ChecklistPlugin.native-BS-kMz9O.mjs +371 -0
  11. package/dist/{CitationsPlugin.native-169fb1e8.mjs → CitationsPlugin.native-DQgoCd1B.mjs} +196 -261
  12. package/dist/ClearFormattingPlugin.native-DIS6AN2t.mjs +172 -0
  13. package/dist/CodePlugin.native-C5l1IeSS.mjs +4570 -0
  14. package/dist/{CodeSamplePlugin.native-6cc0148e.mjs → CodeSamplePlugin.native-CgGoH-X4.mjs} +10 -19
  15. package/dist/{CommentsPlugin.native-03659874.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +28 -55
  16. package/dist/{ConditionalContentPlugin.native-4983143a.mjs → ConditionalContentPlugin.native-CfhY46rU.mjs} +51 -108
  17. package/dist/{ContentRulesPlugin.native-63ed405b.mjs → ContentRulesPlugin.native-vPx5nC73.mjs} +153 -200
  18. package/dist/{DataBindingPlugin.native-427e9d75.mjs → DataBindingPlugin.native-BoXwghTz.mjs} +88 -124
  19. package/dist/DirectionPlugin.native-Bl-QLFzO.mjs +153 -0
  20. package/dist/{DocSchemaPlugin.native-8e41eda0.mjs → DocSchemaPlugin.native-DUSVRHqT.mjs} +112 -166
  21. package/dist/{DocumentManagerPlugin.native-e69895ad.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +4 -4
  22. package/dist/EmbedIframePlugin.native-BF_-LjTq.mjs +740 -0
  23. package/dist/{EmojisPlugin.native-65c5ac47.mjs → EmojisPlugin.native-CitxxlWX.mjs} +6 -11
  24. package/dist/{FontFamilyPlugin.native-f9bc255a.mjs → FontFamilyPlugin.native-j8hMTbg4.mjs} +4 -7
  25. package/dist/{FontSizePlugin.native-f5647872.mjs → FontSizePlugin.native-B_jCh7dY.mjs} +10 -19
  26. package/dist/{FootnotePlugin.native-494657b3.mjs → FootnotePlugin.native-D730OGRm.mjs} +39 -77
  27. package/dist/{FullscreenPlugin.native-87ce92e9.mjs → FullscreenPlugin.native-ChXyxeNw.mjs} +1 -1
  28. package/dist/HeadingPlugin.native-DZdvubrQ.mjs +249 -0
  29. package/dist/{HistoryPlugin.native-92ed4be4.mjs → HistoryPlugin.native-D2wl32jV.mjs} +107 -143
  30. package/dist/{IndentPlugin.native-e4ee902b.mjs → IndentPlugin.native-BHixp8sP.mjs} +12 -23
  31. package/dist/{ItalicPlugin.native-7c95cfbc.mjs → ItalicPlugin.native-CmnlwFHB.mjs} +15 -11
  32. package/dist/{LineHeightPlugin.native-5668f78c.mjs → LineHeightPlugin.native-CM7iXdQj.mjs} +10 -19
  33. package/dist/{LinkPlugin.native-6df29111.mjs → LinkPlugin.native-DYCIcdTm.mjs} +5 -9
  34. package/dist/{ListPlugin.native-fe2e115a.mjs → ListPlugin.native-V7EZC1lM.mjs} +5 -9
  35. package/dist/MathPlugin.native-NwWPHVmj.mjs +369 -0
  36. package/dist/{MediaManagerPlugin.native-3cf48a00.mjs → MediaManagerPlugin.native-eOsTJFpw.mjs} +11 -21
  37. package/dist/{MentionPlugin.native-3b1e8c05.mjs → MentionPlugin.native-BMDlOqur.mjs} +45 -89
  38. package/dist/MergeTagPlugin.native-BzRVoD9-.mjs +580 -0
  39. package/dist/{PIIRedactionPlugin.native-7ab10b9f.mjs → PIIRedactionPlugin.native-g7j4jOmm.mjs} +210 -260
  40. package/dist/{PageBreakPlugin.native-1794c5fb.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +16 -31
  41. package/dist/{PreviewPlugin.native-f7b67cc0.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +6 -11
  42. package/dist/{PrintPlugin.native-f6a168c2.mjs → PrintPlugin.native-7qt5v7L5.mjs} +3 -5
  43. package/dist/{SlashCommandsPlugin.native-8d45e511.mjs → SlashCommandsPlugin.native-BiN6ODw5.mjs} +36 -71
  44. package/dist/{SmartPastePlugin.native-a6c5efec.mjs → SmartPastePlugin.native-CZAEHkyt.mjs} +173 -219
  45. package/dist/{SpecialCharactersPlugin.native-7f06d4ba.mjs → SpecialCharactersPlugin.native-DaG4b19I.mjs} +101 -85
  46. package/dist/{SpellCheckPlugin.native-04e20834.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +21 -41
  47. package/dist/{StrikethroughPlugin.native-905e9501.mjs → StrikethroughPlugin.native-V0TL4F48.mjs} +12 -30
  48. package/dist/{TablePlugin.native-7d5458c1.mjs → TablePlugin.native-DrHX-efe.mjs} +30 -58
  49. package/dist/TemplatePlugin.native-DLjFUaPW.mjs +1150 -0
  50. package/dist/{TextAlignmentPlugin.native-9357b3ed.mjs → TextAlignmentPlugin.native-sM_1s00t.mjs} +6 -11
  51. package/dist/{TextColorPlugin.native-d53ed459.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +14 -26
  52. package/dist/{TrackChangesPlugin.native-e96da509.mjs → TrackChangesPlugin.native-Bghu2q4a.mjs} +58 -115
  53. package/dist/{TranslationWorkflowPlugin.native-4e711b1e.mjs → TranslationWorkflowPlugin.native-DdF16tgT.mjs} +191 -257
  54. package/dist/{UnderlinePlugin.native-8080c998.mjs → UnderlinePlugin.native-DZzg23rv.mjs} +8 -4
  55. package/dist/{VersionDiffPlugin.native-5bbeff85.mjs → VersionDiffPlugin.native-Bvxgy--t.mjs} +26 -51
  56. package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
  57. package/dist/{anchoredPopover-5cca53ba.mjs → anchoredPopover-Bxds0VoB.mjs} +1 -1
  58. package/dist/core.css +1 -0
  59. package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
  60. package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +2 -3
  61. package/dist/editora.min.js +13 -14
  62. package/dist/editora.umd.js +13 -14
  63. package/dist/{html2canvas.esm-c51cb3b9.mjs → html2canvas.esm-AYkPY5LS.mjs} +894 -978
  64. package/dist/index-BslAFzmv.mjs +16544 -0
  65. package/dist/index-CPMGUZfB.js +10 -0
  66. package/dist/{index-7da30697.mjs → index-DBoj6QfW.mjs} +127 -164
  67. package/dist/index.cjs.js +1 -1
  68. package/dist/index.es-BYD2KEo6.mjs +6666 -0
  69. package/dist/index.esm.js +7 -12
  70. package/dist/inlineFormatting-DJ0-NZtx.mjs +97 -0
  71. package/dist/{jspdf.es.min-780c82db.mjs → jspdf.es.min-BJGtOnRT.mjs} +3784 -4808
  72. package/dist/plugin-loader.js +67 -67
  73. package/dist/{purify.es-3bdbcfc5.mjs → purify.es-CKpwg8Tk.mjs} +10 -20
  74. package/dist/webcomponent-core.js +131 -168
  75. package/dist/webcomponent-core.min.css +1 -1
  76. package/dist/webcomponent-core.min.js +139 -63
  77. package/dist/webcomponent.cjs.js +1 -1
  78. package/dist/webcomponent.esm.js +1 -1
  79. package/dist/webcomponent.js +191 -228
  80. package/dist/webcomponent.min.css +1 -1
  81. package/dist/webcomponent.min.js +1240 -1344
  82. package/package.json +1 -1
  83. package/dist/BlockquotePlugin.native-3541c714.mjs +0 -49
  84. package/dist/CapitalizationPlugin.native-42c135dc.mjs +0 -80
  85. package/dist/ChecklistPlugin.native-3b397ee9.mjs +0 -330
  86. package/dist/ClearFormattingPlugin.native-77baa514.mjs +0 -145
  87. package/dist/CodePlugin.native-989cf0aa.mjs +0 -2740
  88. package/dist/DirectionPlugin.native-4e742f42.mjs +0 -139
  89. package/dist/EmbedIframePlugin.native-55209c87.mjs +0 -568
  90. package/dist/HeadingPlugin.native-e38c4a16.mjs +0 -64
  91. package/dist/MathPlugin.native-735bbac2.mjs +0 -296
  92. package/dist/MergeTagPlugin.native-31cf7d48.mjs +0 -584
  93. package/dist/TemplatePlugin.native-580f0f63.mjs +0 -617
  94. package/dist/_commonjsHelpers-69d58be2.mjs +0 -31
  95. package/dist/documentManager-8327fb6e.mjs +0 -9166
  96. package/dist/index-072ef022.js +0 -11
  97. package/dist/index-49d31221.mjs +0 -16860
  98. package/dist/index.es-b47a189f.mjs +0 -5782
  99. package/dist/style.css +0 -1
@@ -42,28 +42,24 @@ function se(e) {
42
42
  return e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || e;
43
43
  }
44
44
  function pe(e) {
45
- if (!e)
46
- return !1;
45
+ if (!e) return !1;
47
46
  const t = e.getAttribute("data-theme") || e.getAttribute("theme");
48
47
  return t && t.toLowerCase() === "dark" ? !0 : e.classList.contains("dark") || e.classList.contains("editora-theme-dark") || e.classList.contains("rte-theme-dark");
49
48
  }
50
49
  function je(e) {
51
50
  const t = se(e);
52
- if (pe(t))
53
- return !0;
51
+ if (pe(t)) return !0;
54
52
  const o = t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
55
53
  return pe(o) ? !0 : pe(document.documentElement) || pe(document.body);
56
54
  }
57
55
  function he(e) {
58
- if (!e)
59
- return !1;
56
+ if (!e) return !1;
60
57
  const t = e.getAttribute("data-theme") || e.getAttribute("theme");
61
58
  return t && t.toLowerCase() === "acme" ? !0 : e.classList.contains("editora-theme-acme") || e.classList.contains("rte-theme-acme");
62
59
  }
63
60
  function Ie(e) {
64
61
  const t = se(e);
65
- if (he(t))
66
- return !0;
62
+ if (he(t)) return !0;
67
63
  const o = t.closest("[data-theme], [theme], .editora-theme-acme, .rte-theme-acme");
68
64
  return he(o) ? !0 : he(document.documentElement) || he(document.body);
69
65
  }
@@ -75,36 +71,29 @@ function xe(e, t) {
75
71
  e.classList.remove("rte-conditional-theme-dark", "rte-conditional-theme-acme"), o === "dark" ? e.classList.add("rte-conditional-theme-dark") : o === "acme" && e.classList.add("rte-conditional-theme-acme");
76
72
  }
77
73
  function w(e, t = !0) {
78
- if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement)
79
- return e.contentElement;
74
+ if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement) return e.contentElement;
80
75
  if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
81
76
  const n = e.editorElement;
82
- if (n.matches(A))
83
- return n;
77
+ if (n.matches(A)) return n;
84
78
  const a = n.querySelector(A);
85
- if (a instanceof HTMLElement)
86
- return a;
79
+ if (a instanceof HTMLElement) return a;
87
80
  }
88
81
  const o = window.getSelection();
89
82
  if (o && o.rangeCount > 0) {
90
83
  const n = o.getRangeAt(0).startContainer, a = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement, r = a == null ? void 0 : a.closest(A);
91
- if (r)
92
- return r;
84
+ if (r) return r;
93
85
  }
94
86
  const i = document.activeElement;
95
87
  if (i) {
96
- if (i.matches(A))
97
- return i;
88
+ if (i.matches(A)) return i;
98
89
  const n = i.closest(A);
99
- if (n)
100
- return n;
90
+ if (n) return n;
101
91
  }
102
92
  return y && y.isConnected ? y : t ? document.querySelector(A) : null;
103
93
  }
104
94
  function Ne(e) {
105
95
  const t = window.getSelection();
106
- if (!t || t.rangeCount === 0)
107
- return null;
96
+ if (!t || t.rangeCount === 0) return null;
108
97
  const o = t.getRangeAt(0);
109
98
  return e.contains(o.commonAncestorContainer) ? o.cloneRange() : null;
110
99
  }
@@ -116,8 +105,7 @@ function De(e) {
116
105
  e.dispatchEvent(new Event("input", { bubbles: !0 }));
117
106
  }
118
107
  function He(e, t) {
119
- if (t === e.innerHTML)
120
- return;
108
+ if (t === e.innerHTML) return;
121
109
  const o = window.execEditorCommand || window.executeEditorCommand;
122
110
  if (typeof o == "function")
123
111
  try {
@@ -140,15 +128,11 @@ function We(e) {
140
128
  const t = e.trim();
141
129
  if (t.startsWith('"') && t.endsWith('"') || t.startsWith("'") && t.endsWith("'"))
142
130
  return t.slice(1, -1);
143
- if (t === "true")
144
- return !0;
145
- if (t === "false")
146
- return !1;
147
- if (t === "null")
148
- return null;
131
+ if (t === "true") return !0;
132
+ if (t === "false") return !1;
133
+ if (t === "null") return null;
149
134
  const o = Number(t);
150
- if (!Number.isNaN(o) && t !== "")
151
- return o;
135
+ if (!Number.isNaN(o) && t !== "") return o;
152
136
  if (t.startsWith("[") && t.endsWith("]") || t.startsWith("{") && t.endsWith("}"))
153
137
  try {
154
138
  return JSON.parse(t);
@@ -159,8 +143,7 @@ function We(e) {
159
143
  }
160
144
  function Ze(e, t) {
161
145
  const o = e.trim();
162
- if (!o)
163
- return !0;
146
+ if (!o) return !0;
164
147
  if (o.startsWith("!")) {
165
148
  const x = o.slice(1).trim();
166
149
  return !ve(t, x);
@@ -192,8 +175,7 @@ function Ze(e, t) {
192
175
  }
193
176
  }
194
177
  function Ge() {
195
- if (typeof document == "undefined" || document.getElementById(Se))
196
- return;
178
+ if (typeof document == "undefined" || document.getElementById(Se)) return;
197
179
  const e = document.createElement("style");
198
180
  e.id = Se, e.textContent = `
199
181
  .rte-conditional-block {
@@ -809,8 +791,7 @@ function ae(e, t) {
809
791
  }
810
792
  function Je(e) {
811
793
  const t = e.querySelector('.rte-conditional-body[data-slot="if"]');
812
- if (!t)
813
- return;
794
+ if (!t) return;
814
795
  const o = /* @__PURE__ */ new Set(), i = e.querySelector(".rte-conditional-header"), n = e.querySelector(".rte-conditional-else-label"), a = e.querySelector('.rte-conditional-body[data-slot="else"]');
815
796
  i && o.add(i), o.add(t), n && o.add(n), a && o.add(a), Array.from(e.childNodes).forEach((l) => {
816
797
  if (!(l instanceof HTMLElement && o.has(l))) {
@@ -826,8 +807,7 @@ function U(e) {
826
807
  const t = window.getSelection();
827
808
  if (t && t.rangeCount > 0) {
828
809
  const n = t.getRangeAt(0).startContainer, a = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement, r = a == null ? void 0 : a.closest(P);
829
- if (r && e.contains(r))
830
- return r;
810
+ if (r && e.contains(r)) return r;
831
811
  }
832
812
  const o = document.activeElement, i = o == null ? void 0 : o.closest(P);
833
813
  return i && e.contains(i) ? i : null;
@@ -876,11 +856,9 @@ function Pe(e, t) {
876
856
  function et(e, t) {
877
857
  if (t)
878
858
  try {
879
- if (!e.isConnected)
880
- return;
859
+ if (!e.isConnected) return;
881
860
  const o = e.contains(t.startContainer), i = e.contains(t.endContainer);
882
- if (!o || !i)
883
- return;
861
+ if (!o || !i) return;
884
862
  Le(e, t);
885
863
  } catch (o) {
886
864
  }
@@ -890,13 +868,6 @@ function tt(e) {
890
868
  }
891
869
  function Re(e, t, o) {
892
870
  let i = null;
893
- if (o)
894
- try {
895
- const r = o.cloneRange();
896
- e.contains(r.commonAncestorContainer) && (i = r);
897
- } catch (r) {
898
- i = null;
899
- }
900
871
  i || (i = Ne(e)), i || (i = document.createRange(), i.selectNodeContents(e), i.collapse(!1));
901
872
  let n = null;
902
873
  i.collapsed || (n = i.extractContents()), i.insertNode(t);
@@ -987,8 +958,7 @@ function qe(e, t) {
987
958
  }
988
959
  function at(e) {
989
960
  const t = j.get(e);
990
- if (t && t.isConnected)
991
- return t;
961
+ if (t && t.isConnected) return t;
992
962
  const o = document.createElement("div");
993
963
  return o.className = u, o.setAttribute("role", "toolbar"), o.setAttribute("aria-label", "Conditional block actions"), o.innerHTML = `
994
964
  <button type="button" class="rte-conditional-float-btn" data-action="edit" title="Edit Condition" aria-label="Edit Condition">
@@ -1002,11 +972,9 @@ function at(e) {
1002
972
  }), o.addEventListener("click", (i) => {
1003
973
  var d;
1004
974
  const n = i.target, a = (d = n == null ? void 0 : n.closest("[data-action]")) == null ? void 0 : d.getAttribute("data-action");
1005
- if (!a)
1006
- return;
975
+ if (!a) return;
1007
976
  const r = E.get(e) || ne;
1008
- if (!r)
1009
- return;
977
+ if (!r) return;
1010
978
  const l = I.get(e);
1011
979
  if (!(!l || !e.contains(l))) {
1012
980
  if (a === "edit") {
@@ -1036,8 +1004,7 @@ function ye(e, t) {
1036
1004
  }
1037
1005
  function O(e) {
1038
1006
  const t = E.get(e) || ne;
1039
- if (!t)
1040
- return;
1007
+ if (!t) return;
1041
1008
  const o = U(e);
1042
1009
  if (!o || !e.contains(o) || D(e)) {
1043
1010
  I.set(e, null), F(e);
@@ -1051,8 +1018,7 @@ function rt() {
1051
1018
  e.remove(), j.delete(t), I.delete(t);
1052
1019
  return;
1053
1020
  }
1054
- if (!e.classList.contains("show"))
1055
- return;
1021
+ if (!e.classList.contains("show")) return;
1056
1022
  xe(e, t);
1057
1023
  const o = I.get(t);
1058
1024
  if (!o || !t.contains(o)) {
@@ -1063,8 +1029,7 @@ function rt() {
1063
1029
  });
1064
1030
  }
1065
1031
  function _e(e, t) {
1066
- if (!e.contains(t))
1067
- return !1;
1032
+ if (!e.contains(t)) return !1;
1068
1033
  const o = e.innerHTML, i = t.parentNode, n = t.nextSibling;
1069
1034
  t.remove(), i === e && e.innerHTML.trim() === "" && (e.innerHTML = "<p><br></p>");
1070
1035
  const a = document.createRange();
@@ -1126,13 +1091,11 @@ function L(e, t, o, i, n) {
1126
1091
  }, N = (s) => {
1127
1092
  s.target === l && C();
1128
1093
  }, Ee = (s) => {
1129
- if (s.key !== "Tab")
1130
- return;
1094
+ if (s.key !== "Tab") return;
1131
1095
  const _ = Array.from(
1132
1096
  d.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')
1133
1097
  );
1134
- if (_.length === 0)
1135
- return;
1098
+ if (_.length === 0) return;
1136
1099
  const G = _[0], ce = _[_.length - 1], z = document.activeElement;
1137
1100
  if (s.shiftKey && z === G) {
1138
1101
  s.preventDefault(), ce.focus();
@@ -1188,21 +1151,17 @@ function ct(e) {
1188
1151
  function dt(e) {
1189
1152
  ne = e, X || (X = (t) => {
1190
1153
  const o = t.target, i = o == null ? void 0 : o.closest(A);
1191
- if (!i)
1192
- return;
1154
+ if (!i) return;
1193
1155
  y = i, E.has(i) || E.set(i, e);
1194
1156
  const n = E.get(i) || e;
1195
1157
  re(i, n.labels), qe(i, k.get(i) === !0), O(i);
1196
1158
  }, document.addEventListener("focusin", X, !0)), J || (J = (t) => {
1197
1159
  var v;
1198
- if (document.querySelector(`.${c}`))
1199
- return;
1160
+ if (document.querySelector(`.${c}`)) return;
1200
1161
  const i = t.target;
1201
- if (!!(i != null && i.closest("input, textarea, select")))
1202
- return;
1162
+ if (!!(i != null && i.closest("input, textarea, select"))) return;
1203
1163
  const r = (i == null ? void 0 : i.closest(A)) || w(void 0, !1) || y;
1204
- if (!r || D(r))
1205
- return;
1164
+ if (!r || D(r)) return;
1206
1165
  const l = E.get(r) || ne || e, d = document.activeElement, x = (i == null ? void 0 : i.closest(".rte-conditional-header")) || (d == null ? void 0 : d.closest(".rte-conditional-header"));
1207
1166
  if (x && (t.key === "Enter" || t.key === " ")) {
1208
1167
  const m = x.closest(P);
@@ -1225,14 +1184,11 @@ function dt(e) {
1225
1184
  }
1226
1185
  if ((t.key === "Backspace" || t.key === "Delete") && !t.altKey && !t.ctrlKey && !t.metaKey) {
1227
1186
  const m = window.getSelection();
1228
- if (!m || m.rangeCount === 0)
1229
- return;
1187
+ if (!m || m.rangeCount === 0) return;
1230
1188
  const S = m.getRangeAt(0);
1231
- if (!S.collapsed || !r.contains(S.commonAncestorContainer))
1232
- return;
1189
+ if (!S.collapsed || !r.contains(S.commonAncestorContainer)) return;
1233
1190
  const T = (v = Ye(S.startContainer)) == null ? void 0 : v.closest(".rte-conditional-body");
1234
- if (!T || !r.contains(T))
1235
- return;
1191
+ if (!T || !r.contains(T)) return;
1236
1192
  if (t.key === "Backspace" && Me(S, T, "start")) {
1237
1193
  t.preventDefault();
1238
1194
  return;
@@ -1244,15 +1200,13 @@ function dt(e) {
1244
1200
  }
1245
1201
  }, document.addEventListener("keydown", J, !0)), ee || (ee = (t) => {
1246
1202
  const o = t.target;
1247
- if (!o || o.closest(`.${u}`))
1248
- return;
1203
+ if (!o || o.closest(`.${u}`)) return;
1249
1204
  const i = o.closest(A);
1250
1205
  if (!i) {
1251
1206
  y && F(y);
1252
1207
  return;
1253
1208
  }
1254
- if (D(i))
1255
- return;
1209
+ if (D(i)) return;
1256
1210
  y = i, E.has(i) || E.set(i, e);
1257
1211
  const n = o.closest(P);
1258
1212
  if (!n) {
@@ -1264,15 +1218,13 @@ function dt(e) {
1264
1218
  });
1265
1219
  }, document.addEventListener("mousedown", ee, !0)), Q || (Q = (t) => {
1266
1220
  const o = t.target;
1267
- if (!o || o.closest(`.${u}`))
1268
- return;
1221
+ if (!o || o.closest(`.${u}`)) return;
1269
1222
  const i = o.closest(A);
1270
1223
  if (!i) {
1271
1224
  y && F(y);
1272
1225
  return;
1273
1226
  }
1274
- if (D(i))
1275
- return;
1227
+ if (D(i)) return;
1276
1228
  y = i, E.has(i) || E.set(i, e);
1277
1229
  const n = E.get(i) || e, a = o.closest(P), r = !!o.closest(".rte-conditional-header, .rte-conditional-summary, .rte-conditional-meta, .rte-conditional-else-label");
1278
1230
  if (a && r) {
@@ -1285,8 +1237,7 @@ function dt(e) {
1285
1237
  t && t.isConnected && O(t);
1286
1238
  }, document.addEventListener("selectionchange", te)), oe || (oe = (t) => {
1287
1239
  const o = t.target, i = o == null ? void 0 : o.closest(A);
1288
- if (!i)
1289
- return;
1240
+ if (!i) return;
1290
1241
  const n = E.get(i) || ne || e;
1291
1242
  re(i, n.labels), O(i);
1292
1243
  }, document.addEventListener("input", oe, !0)), H || (H = () => {
@@ -1329,8 +1280,7 @@ const ft = (e = {}) => {
1329
1280
  commands: {
1330
1281
  conditionalContent: (o, i) => {
1331
1282
  const n = w(i);
1332
- if (!n || D(n))
1333
- return !1;
1283
+ if (!n || D(n)) return !1;
1334
1284
  y = n, E.set(n, t), re(n, t.labels);
1335
1285
  const a = o == null ? void 0 : o.target;
1336
1286
  if (a === "insert")
@@ -1340,8 +1290,7 @@ const ft = (e = {}) => {
1340
1290
  },
1341
1291
  openConditionalDialog: (o, i) => {
1342
1292
  const n = w(i);
1343
- if (!n || D(n))
1344
- return !1;
1293
+ if (!n || D(n)) return !1;
1345
1294
  y = n, E.set(n, t), re(n, t.labels);
1346
1295
  const a = o == null ? void 0 : o.target;
1347
1296
  if (a === "insert")
@@ -1351,35 +1300,30 @@ const ft = (e = {}) => {
1351
1300
  },
1352
1301
  conditionalPreview: async (o, i) => {
1353
1302
  const n = w(i);
1354
- if (!n)
1355
- return !1;
1303
+ if (!n) return !1;
1356
1304
  y = n, E.set(n, t);
1357
1305
  const a = typeof o == "boolean" ? o : k.get(n) !== !0;
1358
1306
  return await Y(n, t, a), O(n), !0;
1359
1307
  },
1360
1308
  editConditionalBlock: (o, i) => {
1361
1309
  const n = w(i);
1362
- if (!n || D(n))
1363
- return !1;
1310
+ if (!n || D(n)) return !1;
1364
1311
  y = n, E.set(n, t);
1365
1312
  const a = U(n);
1366
1313
  return a ? (L(n, t, "edit", o, a), !0) : !1;
1367
1314
  },
1368
1315
  deleteConditionalBlock: (o, i) => {
1369
1316
  const n = w(i);
1370
- if (!n || D(n))
1371
- return !1;
1317
+ if (!n || D(n)) return !1;
1372
1318
  const a = U(n);
1373
- if (!a)
1374
- return !1;
1319
+ if (!a) return !1;
1375
1320
  const r = _e(n, a);
1376
1321
  return r && O(n), r;
1377
1322
  },
1378
1323
  insertConditionalBlock: (o, i) => {
1379
1324
  var d, x, v, m;
1380
1325
  const n = w(i);
1381
- if (!n || D(n))
1382
- return !1;
1326
+ if (!n || D(n)) return !1;
1383
1327
  y = n, E.set(n, t);
1384
1328
  const a = {
1385
1329
  condition: (d = o == null ? void 0 : o.condition) != null ? d : t.defaultCondition,
@@ -1391,8 +1335,7 @@ const ft = (e = {}) => {
1391
1335
  },
1392
1336
  toggleConditionalPreview: async (o, i) => {
1393
1337
  const n = w(i);
1394
- if (!n)
1395
- return !1;
1338
+ if (!n) return !1;
1396
1339
  y = n, E.set(n, t);
1397
1340
  const a = typeof o == "boolean" ? o : k.get(n) !== !0;
1398
1341
  return await Y(n, t, a), !0;
@@ -1421,4 +1364,4 @@ const ft = (e = {}) => {
1421
1364
  export {
1422
1365
  ft as ConditionalContentPlugin
1423
1366
  };
1424
- //# sourceMappingURL=ConditionalContentPlugin.native-4983143a.mjs.map
1367
+ //# sourceMappingURL=ConditionalContentPlugin.native-CfhY46rU.mjs.map