@editora/core 1.0.7 → 1.0.9
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.
- package/README.md +5 -0
- package/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-58d12bed.mjs} +23 -12
- package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-289a112a.mjs} +112 -102
- package/dist/ApprovalWorkflowPlugin.native-449ce66c.mjs +1115 -0
- package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-8aceb5cc.mjs} +16 -9
- package/dist/{BlockquotePlugin.native-JFmOLsxN.mjs → BlockquotePlugin.native-3541c714.mjs} +3 -2
- package/dist/BlocksLibraryPlugin.native-1cc51e63.mjs +1386 -0
- package/dist/{BoldPlugin.native-BAzzoqU5.mjs → BoldPlugin.native-f9d7f8e4.mjs} +1 -1
- package/dist/{CapitalizationPlugin.native-DOMsh5R7.mjs → CapitalizationPlugin.native-42c135dc.mjs} +3 -2
- package/dist/{ChecklistPlugin.native-nuSSEFNI.mjs → ChecklistPlugin.native-3b397ee9.mjs} +43 -22
- package/dist/CitationsPlugin.native-169fb1e8.mjs +1532 -0
- package/dist/{ClearFormattingPlugin.native-Bq_XcTh2.mjs → ClearFormattingPlugin.native-77baa514.mjs} +11 -6
- package/dist/{CodePlugin.native-DlpTPdkd.mjs → CodePlugin.native-989cf0aa.mjs} +629 -580
- package/dist/{CodeSamplePlugin.native-CgGoH-X4.mjs → CodeSamplePlugin.native-6cc0148e.mjs} +19 -10
- package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-03659874.mjs} +55 -28
- package/dist/ConditionalContentPlugin.native-4983143a.mjs +1424 -0
- package/dist/ContentRulesPlugin.native-63ed405b.mjs +1149 -0
- package/dist/DataBindingPlugin.native-427e9d75.mjs +956 -0
- package/dist/{DirectionPlugin.native-CDnbdNyl.mjs → DirectionPlugin.native-4e742f42.mjs} +19 -10
- package/dist/DocSchemaPlugin.native-8e41eda0.mjs +1382 -0
- package/dist/{DocumentManagerPlugin.native-C2cs_1w4.mjs → DocumentManagerPlugin.native-e69895ad.mjs} +4 -4
- package/dist/{EmbedIframePlugin.native-DKJx2OS7.mjs → EmbedIframePlugin.native-55209c87.mjs} +70 -70
- package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-65c5ac47.mjs} +11 -6
- package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-f9bc255a.mjs} +7 -4
- package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-f5647872.mjs} +19 -10
- package/dist/{FootnotePlugin.native-D730OGRm.mjs → FootnotePlugin.native-494657b3.mjs} +77 -39
- package/dist/{FullscreenPlugin.native-ChXyxeNw.mjs → FullscreenPlugin.native-87ce92e9.mjs} +1 -1
- package/dist/{HeadingPlugin.native-DrLYwQnQ.mjs → HeadingPlugin.native-e38c4a16.mjs} +1 -1
- package/dist/{HistoryPlugin.native-TDnVMsEO.mjs → HistoryPlugin.native-92ed4be4.mjs} +43 -22
- package/dist/{IndentPlugin.native-BHixp8sP.mjs → IndentPlugin.native-e4ee902b.mjs} +23 -12
- package/dist/{ItalicPlugin.native-CQjjDyUL.mjs → ItalicPlugin.native-7c95cfbc.mjs} +1 -1
- package/dist/{LineHeightPlugin.native-CM7iXdQj.mjs → LineHeightPlugin.native-5668f78c.mjs} +19 -10
- package/dist/{LinkPlugin.native-DYCIcdTm.mjs → LinkPlugin.native-6df29111.mjs} +9 -5
- package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-fe2e115a.mjs} +9 -5
- package/dist/{MathPlugin.native-f_mDp8VL.mjs → MathPlugin.native-735bbac2.mjs} +9 -5
- package/dist/{MediaManagerPlugin.native-BiXiK8FC.mjs → MediaManagerPlugin.native-3cf48a00.mjs} +219 -207
- package/dist/MentionPlugin.native-3b1e8c05.mjs +778 -0
- package/dist/{MergeTagPlugin.native-C3eOfEgw.mjs → MergeTagPlugin.native-31cf7d48.mjs} +51 -26
- package/dist/PIIRedactionPlugin.native-7ab10b9f.mjs +1449 -0
- package/dist/{PageBreakPlugin.native-CXdX5fAv.mjs → PageBreakPlugin.native-1794c5fb.mjs} +67 -52
- package/dist/{PreviewPlugin.native-DBvfpmIv.mjs → PreviewPlugin.native-f7b67cc0.mjs} +38 -33
- package/dist/{PrintPlugin.native-7qt5v7L5.mjs → PrintPlugin.native-f6a168c2.mjs} +5 -3
- package/dist/SlashCommandsPlugin.native-8d45e511.mjs +790 -0
- package/dist/SmartPastePlugin.native-a6c5efec.mjs +1447 -0
- package/dist/{SpecialCharactersPlugin.native-CZDato89.mjs → SpecialCharactersPlugin.native-7f06d4ba.mjs} +17 -9
- package/dist/{SpellCheckPlugin.native-BZB9AewP.mjs → SpellCheckPlugin.native-04e20834.mjs} +41 -21
- package/dist/{StrikethroughPlugin.native-0Be7j49s.mjs → StrikethroughPlugin.native-905e9501.mjs} +9 -5
- package/dist/{TablePlugin.native-DrHX-efe.mjs → TablePlugin.native-7d5458c1.mjs} +58 -30
- package/dist/{TemplatePlugin.native-CrpfKRJ8.mjs → TemplatePlugin.native-580f0f63.mjs} +32 -17
- package/dist/{TextAlignmentPlugin.native-sM_1s00t.mjs → TextAlignmentPlugin.native-9357b3ed.mjs} +11 -6
- package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-d53ed459.mjs} +26 -14
- package/dist/TrackChangesPlugin.native-e96da509.mjs +818 -0
- package/dist/TranslationWorkflowPlugin.native-4e711b1e.mjs +1797 -0
- package/dist/{UnderlinePlugin.native-QpIcK4L2.mjs → UnderlinePlugin.native-8080c998.mjs} +1 -1
- package/dist/VersionDiffPlugin.native-5bbeff85.mjs +801 -0
- package/dist/_commonjsHelpers-69d58be2.mjs +31 -0
- package/dist/{anchoredPopover-Bxds0VoB.mjs → anchoredPopover-5cca53ba.mjs} +1 -1
- package/dist/documentManager-8327fb6e.mjs +9166 -0
- package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +3 -2
- package/dist/editora.min.js +14 -13
- package/dist/editora.umd.js +14 -13
- package/dist/{html2canvas.esm-AYkPY5LS.mjs → html2canvas.esm-c51cb3b9.mjs} +978 -894
- package/dist/index-072ef022.js +11 -0
- package/dist/index-49d31221.mjs +16860 -0
- package/dist/{index-yzU4NdPT.mjs → index-7da30697.mjs} +490 -358
- package/dist/index.cjs.js +1 -1
- package/dist/index.es-b47a189f.mjs +5782 -0
- package/dist/index.esm.js +12 -7
- package/dist/{jspdf.es.min-BJGtOnRT.mjs → jspdf.es.min-780c82db.mjs} +4808 -3784
- package/dist/plugin-loader.js +77 -40
- package/dist/{purify.es-CKpwg8Tk.mjs → purify.es-3bdbcfc5.mjs} +20 -10
- package/dist/style.css +1 -0
- package/dist/webcomponent-core.js +546 -414
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +40 -39
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +484 -315
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +6035 -558
- package/package.json +11 -5
- package/dist/_commonjsHelpers-DOllISpa.mjs +0 -32
- package/dist/core.css +0 -1
- package/dist/documentManager-vQ1VkbUY.mjs +0 -8418
- package/dist/index-BpE6GFbz.js +0 -10
- package/dist/index-BslAFzmv.mjs +0 -16544
- package/dist/index.es-BYD2KEo6.mjs +0 -6666
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
const u = '.rte-page-break[data-type="page-break"]',
|
|
1
|
+
const u = '.rte-page-break[data-type="page-break"]', f = ".rte-content, .editora-content";
|
|
2
2
|
let p = null, m = !1;
|
|
3
3
|
const h = (e, n) => {
|
|
4
|
-
if (n === e.innerHTML)
|
|
4
|
+
if (n === e.innerHTML)
|
|
5
|
+
return;
|
|
5
6
|
const t = window.execEditorCommand || window.executeEditorCommand;
|
|
6
7
|
if (typeof t == "function")
|
|
7
8
|
try {
|
|
8
9
|
t("recordDomTransaction", e, n, e.innerHTML);
|
|
9
10
|
} catch (r) {
|
|
10
11
|
}
|
|
11
|
-
},
|
|
12
|
+
}, x = /* @__PURE__ */ new Set([
|
|
12
13
|
"DIV",
|
|
13
14
|
"P",
|
|
14
15
|
"BLOCKQUOTE",
|
|
@@ -22,7 +23,7 @@ const h = (e, n) => {
|
|
|
22
23
|
"LI",
|
|
23
24
|
"TD",
|
|
24
25
|
"TH"
|
|
25
|
-
]),
|
|
26
|
+
]), N = () => {
|
|
26
27
|
p || typeof document == "undefined" || (p = document.createElement("style"), p.textContent = `
|
|
27
28
|
.rte-page-break {
|
|
28
29
|
display: block;
|
|
@@ -95,28 +96,30 @@ const h = (e, n) => {
|
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
`, document.head.appendChild(p));
|
|
98
|
-
},
|
|
99
|
+
}, T = () => {
|
|
99
100
|
const e = window.getSelection();
|
|
100
|
-
if (!e || e.rangeCount === 0)
|
|
101
|
+
if (!e || e.rangeCount === 0)
|
|
102
|
+
return null;
|
|
101
103
|
const n = e.getRangeAt(0), t = n.startContainer.nodeType === Node.ELEMENT_NODE ? n.startContainer : n.startContainer.parentElement;
|
|
102
|
-
return (t == null ? void 0 : t.closest(
|
|
103
|
-
},
|
|
104
|
-
const e =
|
|
105
|
-
if (e)
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
return (t == null ? void 0 : t.closest(f)) || null;
|
|
105
|
+
}, w = () => {
|
|
106
|
+
const e = T();
|
|
107
|
+
if (e)
|
|
108
|
+
return e;
|
|
109
|
+
const n = document.activeElement, t = n == null ? void 0 : n.closest(f);
|
|
110
|
+
return t || document.querySelector(f);
|
|
108
111
|
}, E = (e, n) => {
|
|
109
112
|
let t = e;
|
|
110
113
|
for (; t && t !== n; ) {
|
|
111
114
|
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
112
115
|
const r = t;
|
|
113
|
-
if (
|
|
116
|
+
if (x.has(r.tagName))
|
|
114
117
|
return r;
|
|
115
118
|
}
|
|
116
119
|
t = t.parentNode;
|
|
117
120
|
}
|
|
118
121
|
return null;
|
|
119
|
-
},
|
|
122
|
+
}, C = () => {
|
|
120
123
|
const e = document.createElement("div");
|
|
121
124
|
return e.className = "rte-page-break", e.setAttribute("data-page-break", "true"), e.setAttribute("data-type", "page-break"), e.setAttribute("contenteditable", "false"), e.setAttribute("tabindex", "0"), e.setAttribute("role", "separator"), e.setAttribute("aria-label", "Page break"), e;
|
|
122
125
|
}, S = (e) => {
|
|
@@ -130,7 +133,7 @@ const h = (e, n) => {
|
|
|
130
133
|
const r = t;
|
|
131
134
|
t = t.previousElementSibling, r.remove();
|
|
132
135
|
}
|
|
133
|
-
},
|
|
136
|
+
}, v = (e) => {
|
|
134
137
|
var r;
|
|
135
138
|
const n = e.nextElementSibling;
|
|
136
139
|
if (n && !n.matches(u))
|
|
@@ -139,12 +142,14 @@ const h = (e, n) => {
|
|
|
139
142
|
return t.innerHTML = "<br>", (r = e.parentNode) == null || r.insertBefore(t, e.nextSibling), t;
|
|
140
143
|
}, d = (e) => {
|
|
141
144
|
const n = window.getSelection();
|
|
142
|
-
if (!n)
|
|
145
|
+
if (!n)
|
|
146
|
+
return;
|
|
143
147
|
const t = document.createRange();
|
|
144
148
|
e.nodeType, Node.TEXT_NODE, t.setStart(e, 0), t.collapse(!0), n.removeAllRanges(), n.addRange(t);
|
|
145
149
|
}, b = (e) => {
|
|
146
150
|
const n = window.getSelection();
|
|
147
|
-
if (!n)
|
|
151
|
+
if (!n)
|
|
152
|
+
return;
|
|
148
153
|
const t = document.createRange();
|
|
149
154
|
if (e.nodeType === Node.TEXT_NODE) {
|
|
150
155
|
const r = e;
|
|
@@ -152,7 +157,7 @@ const h = (e, n) => {
|
|
|
152
157
|
} else
|
|
153
158
|
t.selectNodeContents(e), t.collapse(!1);
|
|
154
159
|
n.removeAllRanges(), n.addRange(t);
|
|
155
|
-
},
|
|
160
|
+
}, g = (e, n) => {
|
|
156
161
|
let t = e;
|
|
157
162
|
for (; t; ) {
|
|
158
163
|
if (!(t instanceof HTMLElement && t.matches(u)))
|
|
@@ -160,19 +165,23 @@ const h = (e, n) => {
|
|
|
160
165
|
t = n === "previous" ? t.previousSibling : t.nextSibling;
|
|
161
166
|
}
|
|
162
167
|
return null;
|
|
163
|
-
},
|
|
168
|
+
}, A = (e) => {
|
|
164
169
|
const n = window.getSelection();
|
|
165
|
-
if (!n || !e.parentNode)
|
|
170
|
+
if (!n || !e.parentNode)
|
|
171
|
+
return;
|
|
166
172
|
const t = e.parentNode, r = Array.from(t.childNodes).indexOf(e);
|
|
167
|
-
if (r < 0)
|
|
173
|
+
if (r < 0)
|
|
174
|
+
return;
|
|
168
175
|
const o = document.createRange();
|
|
169
176
|
o.setStart(t, r), o.setEnd(t, r + 1), n.removeAllRanges(), n.addRange(o), e.focus({ preventScroll: !0 });
|
|
170
|
-
},
|
|
171
|
-
if (e.collapsed || e.startContainer !== e.endContainer || e.endOffset !== e.startOffset + 1 || !(e.startContainer instanceof Element || e.startContainer instanceof DocumentFragment))
|
|
177
|
+
}, y = (e) => {
|
|
178
|
+
if (e.collapsed || e.startContainer !== e.endContainer || e.endOffset !== e.startOffset + 1 || !(e.startContainer instanceof Element || e.startContainer instanceof DocumentFragment))
|
|
179
|
+
return null;
|
|
172
180
|
const n = e.startContainer.childNodes[e.startOffset];
|
|
173
181
|
return n instanceof HTMLElement && n.matches(u) ? n : null;
|
|
174
|
-
},
|
|
175
|
-
if (!e.collapsed)
|
|
182
|
+
}, B = (e, n, t) => {
|
|
183
|
+
if (!e.collapsed)
|
|
184
|
+
return null;
|
|
176
185
|
const { startContainer: r, startOffset: o } = e, a = (i) => i instanceof HTMLElement && i.matches(u) ? i : null, s = (i) => {
|
|
177
186
|
if (r.nodeType === Node.ELEMENT_NODE) {
|
|
178
187
|
const l = r;
|
|
@@ -187,7 +196,8 @@ const h = (e, n) => {
|
|
|
187
196
|
let c = r;
|
|
188
197
|
for (; c && c !== n; ) {
|
|
189
198
|
const l = i === "previous" ? c.previousSibling : c.nextSibling;
|
|
190
|
-
if (l)
|
|
199
|
+
if (l)
|
|
200
|
+
return l;
|
|
191
201
|
c = c.parentNode;
|
|
192
202
|
}
|
|
193
203
|
return null;
|
|
@@ -208,11 +218,11 @@ const h = (e, n) => {
|
|
|
208
218
|
}
|
|
209
219
|
}
|
|
210
220
|
return a(s(t === "Backspace" ? "previous" : "next"));
|
|
211
|
-
},
|
|
221
|
+
}, k = (e, n) => {
|
|
212
222
|
var c;
|
|
213
|
-
const t = e.closest(
|
|
223
|
+
const t = e.closest(f), r = (c = t == null ? void 0 : t.innerHTML) != null ? c : "", o = e.previousSibling, a = e.nextSibling;
|
|
214
224
|
e.remove();
|
|
215
|
-
const s =
|
|
225
|
+
const s = g(o, "previous"), i = g(a, "next");
|
|
216
226
|
if (n === "Backspace") {
|
|
217
227
|
if (s)
|
|
218
228
|
b(s);
|
|
@@ -231,76 +241,81 @@ const h = (e, n) => {
|
|
|
231
241
|
l.innerHTML = "<br>", t.appendChild(l), d(l);
|
|
232
242
|
}
|
|
233
243
|
return t && (h(t, r), t.dispatchEvent(new Event("input", { bubbles: !0 }))), !0;
|
|
234
|
-
},
|
|
235
|
-
const e =
|
|
236
|
-
if (!e)
|
|
244
|
+
}, D = () => {
|
|
245
|
+
const e = w();
|
|
246
|
+
if (!e)
|
|
247
|
+
return !1;
|
|
237
248
|
const n = e.innerHTML, t = window.getSelection();
|
|
238
|
-
if (!t)
|
|
249
|
+
if (!t)
|
|
250
|
+
return !1;
|
|
239
251
|
let r;
|
|
240
252
|
t.rangeCount > 0 && e.contains(t.getRangeAt(0).commonAncestorContainer) ? r = t.getRangeAt(0) : (r = document.createRange(), r.selectNodeContents(e), r.collapse(!1), t.removeAllRanges(), t.addRange(r));
|
|
241
|
-
const o = E(r.endContainer, e) || E(r.startContainer, e), a =
|
|
253
|
+
const o = E(r.endContainer, e) || E(r.startContainer, e), a = C();
|
|
242
254
|
o && o.parentNode ? o.parentNode.insertBefore(a, o.nextSibling) : e.appendChild(a), S(a);
|
|
243
|
-
const s =
|
|
255
|
+
const s = v(a);
|
|
244
256
|
return d(s), h(e, n), e.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
|
|
245
|
-
},
|
|
257
|
+
}, R = () => {
|
|
246
258
|
m || typeof document == "undefined" || (m = !0, document.addEventListener("click", (e) => {
|
|
247
259
|
const n = e.target, t = n == null ? void 0 : n.closest(u);
|
|
248
|
-
t && (e.preventDefault(), e.stopPropagation(),
|
|
260
|
+
t && (e.preventDefault(), e.stopPropagation(), A(t));
|
|
249
261
|
}), document.addEventListener("keydown", (e) => {
|
|
250
262
|
const n = e.key;
|
|
251
263
|
if (!["Backspace", "Delete", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n))
|
|
252
264
|
return;
|
|
253
265
|
const t = window.getSelection();
|
|
254
|
-
if (!t || t.rangeCount === 0)
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
266
|
+
if (!t || t.rangeCount === 0)
|
|
267
|
+
return;
|
|
268
|
+
const r = t.getRangeAt(0), o = w();
|
|
269
|
+
if (!o || !o.contains(r.commonAncestorContainer))
|
|
270
|
+
return;
|
|
271
|
+
const a = y(r);
|
|
258
272
|
if (a) {
|
|
259
273
|
if (n === "Backspace" || n === "Delete") {
|
|
260
|
-
e.preventDefault(), e.stopPropagation(),
|
|
274
|
+
e.preventDefault(), e.stopPropagation(), k(a, n);
|
|
261
275
|
return;
|
|
262
276
|
}
|
|
263
277
|
if (n === "ArrowRight" || n === "ArrowDown") {
|
|
264
278
|
e.preventDefault();
|
|
265
|
-
const s =
|
|
279
|
+
const s = g(a.nextSibling, "next") || v(a);
|
|
266
280
|
d(s);
|
|
267
281
|
return;
|
|
268
282
|
}
|
|
269
283
|
if (n === "ArrowLeft" || n === "ArrowUp") {
|
|
270
284
|
e.preventDefault();
|
|
271
|
-
const s =
|
|
285
|
+
const s = g(a.previousSibling, "previous");
|
|
272
286
|
s ? b(s) : d(o);
|
|
273
287
|
return;
|
|
274
288
|
}
|
|
275
289
|
}
|
|
276
290
|
if (n === "Backspace" || n === "Delete") {
|
|
277
|
-
const s =
|
|
291
|
+
const s = B(
|
|
278
292
|
r,
|
|
279
293
|
o,
|
|
280
294
|
n
|
|
281
295
|
);
|
|
282
|
-
if (!s)
|
|
283
|
-
|
|
296
|
+
if (!s)
|
|
297
|
+
return;
|
|
298
|
+
e.preventDefault(), e.stopPropagation(), k(s, n);
|
|
284
299
|
}
|
|
285
300
|
}));
|
|
286
|
-
},
|
|
301
|
+
}, P = () => (N(), R(), {
|
|
287
302
|
name: "pageBreak",
|
|
288
303
|
toolbar: [
|
|
289
304
|
{
|
|
290
305
|
label: "Page Break",
|
|
291
306
|
command: "insertPageBreak",
|
|
292
|
-
icon: '<svg
|
|
307
|
+
icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><path d="M5 5H19" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/><path d="M5 9H19" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/><path d="M5 15H19" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-dasharray="3.2 3.2"/><path d="M5 19H19" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/></svg>',
|
|
293
308
|
shortcut: "Mod-Enter"
|
|
294
309
|
}
|
|
295
310
|
],
|
|
296
311
|
commands: {
|
|
297
|
-
insertPageBreak:
|
|
312
|
+
insertPageBreak: D
|
|
298
313
|
},
|
|
299
314
|
keymap: {
|
|
300
315
|
"Mod-Enter": "insertPageBreak"
|
|
301
316
|
}
|
|
302
317
|
});
|
|
303
318
|
export {
|
|
304
|
-
|
|
319
|
+
P as PageBreakPlugin
|
|
305
320
|
};
|
|
306
|
-
//# sourceMappingURL=PageBreakPlugin.native-
|
|
321
|
+
//# sourceMappingURL=PageBreakPlugin.native-1794c5fb.mjs.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
let c = !1;
|
|
2
2
|
const g = () => {
|
|
3
|
-
if (typeof document == "undefined")
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
if (typeof document == "undefined")
|
|
4
|
+
return;
|
|
5
|
+
const i = "rte-preview-plugin-styles";
|
|
6
|
+
if (document.getElementById(i))
|
|
7
|
+
return;
|
|
6
8
|
const t = document.createElement("style");
|
|
7
|
-
t.id =
|
|
9
|
+
t.id = i, t.textContent = `
|
|
8
10
|
/* Preview Editor Dialog Styles */
|
|
9
11
|
.rte-preview-editor-overlay {
|
|
10
12
|
position: fixed !important;
|
|
@@ -225,14 +227,14 @@ const g = () => {
|
|
|
225
227
|
}
|
|
226
228
|
`, document.head.appendChild(t);
|
|
227
229
|
}, v = () => {
|
|
228
|
-
const
|
|
229
|
-
if (
|
|
230
|
-
let e =
|
|
230
|
+
const i = window.getSelection();
|
|
231
|
+
if (i && i.rangeCount > 0) {
|
|
232
|
+
let e = i.getRangeAt(0).startContainer;
|
|
231
233
|
for (; e && e !== document.body; ) {
|
|
232
234
|
if (e.nodeType === Node.ELEMENT_NODE) {
|
|
233
|
-
const
|
|
234
|
-
if (
|
|
235
|
-
return
|
|
235
|
+
const n = e;
|
|
236
|
+
if (n.getAttribute("contenteditable") === "true")
|
|
237
|
+
return n;
|
|
236
238
|
}
|
|
237
239
|
e = e.parentNode;
|
|
238
240
|
}
|
|
@@ -242,40 +244,43 @@ const g = () => {
|
|
|
242
244
|
if (t.getAttribute("contenteditable") === "true")
|
|
243
245
|
return t;
|
|
244
246
|
const e = t.closest('[contenteditable="true"]');
|
|
245
|
-
if (e)
|
|
247
|
+
if (e)
|
|
248
|
+
return e;
|
|
246
249
|
}
|
|
247
250
|
return document.querySelector('[contenteditable="true"]');
|
|
248
251
|
}, h = () => {
|
|
249
|
-
const
|
|
250
|
-
if (!
|
|
251
|
-
|
|
252
|
+
const i = v();
|
|
253
|
+
if (!i)
|
|
254
|
+
return "";
|
|
255
|
+
const t = i.cloneNode(!0);
|
|
252
256
|
return [
|
|
253
257
|
".rte-floating-toolbar",
|
|
254
258
|
".rte-selection-marker",
|
|
255
259
|
".rte-toolbar",
|
|
256
260
|
".rte-resize-handle",
|
|
257
261
|
"[data-rte-internal]"
|
|
258
|
-
].forEach((
|
|
259
|
-
t.querySelectorAll(
|
|
262
|
+
].forEach((n) => {
|
|
263
|
+
t.querySelectorAll(n).forEach((r) => r.remove());
|
|
260
264
|
}), t.innerHTML;
|
|
261
|
-
}, w = (
|
|
265
|
+
}, w = (i) => {
|
|
262
266
|
const t = document.createElement("div");
|
|
263
|
-
return t.innerHTML =
|
|
267
|
+
return t.innerHTML = i, t.querySelectorAll(
|
|
264
268
|
'script, iframe[src^="javascript:"], object, embed, form[action^="javascript:"]'
|
|
265
|
-
).forEach((
|
|
266
|
-
Array.from(
|
|
267
|
-
|
|
268
|
-
});
|
|
269
|
+
).forEach((r) => r.remove()), t.querySelectorAll("*").forEach((r) => {
|
|
270
|
+
Array.from(r.attributes).forEach((o) => {
|
|
271
|
+
o.name.startsWith("on") && r.removeAttribute(o.name), (o.name === "href" || o.name === "src") && o.value.startsWith("javascript:") && r.removeAttribute(o.name), o.name.toLowerCase() === "contenteditable" && r.removeAttribute(o.name);
|
|
272
|
+
}), r.setAttribute("contenteditable", "false");
|
|
269
273
|
}), t.innerHTML;
|
|
270
274
|
}, u = () => {
|
|
271
|
-
if (typeof window == "undefined" || c)
|
|
275
|
+
if (typeof window == "undefined" || c)
|
|
276
|
+
return;
|
|
272
277
|
c = !0, g();
|
|
273
|
-
const
|
|
278
|
+
const i = h(), t = w(i), e = document.createElement("div");
|
|
274
279
|
e.className = "rte-preview-editor-overlay", e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.setAttribute("aria-labelledby", "preview-editor-title");
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
|
|
280
|
+
const n = document.createElement("div");
|
|
281
|
+
n.className = "rte-preview-editor-modal";
|
|
282
|
+
const r = document.createElement("div");
|
|
283
|
+
r.className = "rte-preview-editor-header", r.innerHTML = `
|
|
279
284
|
<h2 id="preview-editor-title">Preview Editor</h2>
|
|
280
285
|
<div class="rte-preview-editor-header-actions">
|
|
281
286
|
<button class="rte-preview-editor-close-btn" aria-label="Close preview editor">
|
|
@@ -286,17 +291,17 @@ const g = () => {
|
|
|
286
291
|
</button>
|
|
287
292
|
</div>
|
|
288
293
|
`;
|
|
289
|
-
const
|
|
290
|
-
|
|
294
|
+
const o = document.createElement("div");
|
|
295
|
+
o.className = "rte-preview-editor-body";
|
|
291
296
|
const a = document.createElement("div");
|
|
292
297
|
a.className = "rte-preview-editor-content";
|
|
293
298
|
const l = document.createElement("div");
|
|
294
|
-
l.className = "rte-preview-editor-light-editor", l.innerHTML = t, a.appendChild(l),
|
|
299
|
+
l.className = "rte-preview-editor-light-editor", l.innerHTML = t, a.appendChild(l), o.appendChild(a), n.appendChild(r), n.appendChild(o), e.appendChild(n);
|
|
295
300
|
const p = () => {
|
|
296
301
|
e.parentNode && e.parentNode.removeChild(e), c = !1, document.removeEventListener("keydown", s);
|
|
297
302
|
}, s = (d) => {
|
|
298
303
|
d.key === "Escape" && (d.preventDefault(), d.stopPropagation(), p());
|
|
299
|
-
}, m =
|
|
304
|
+
}, m = r.querySelector(".rte-preview-editor-close-btn");
|
|
300
305
|
m && m.addEventListener("click", (d) => {
|
|
301
306
|
d.preventDefault(), d.stopPropagation(), p();
|
|
302
307
|
}), e.addEventListener("click", (d) => {
|
|
@@ -319,4 +324,4 @@ const g = () => {
|
|
|
319
324
|
export {
|
|
320
325
|
f as PreviewPlugin
|
|
321
326
|
};
|
|
322
|
-
//# sourceMappingURL=PreviewPlugin.native-
|
|
327
|
+
//# sourceMappingURL=PreviewPlugin.native-f7b67cc0.mjs.map
|
|
@@ -240,7 +240,8 @@ const g = () => `
|
|
|
240
240
|
}
|
|
241
241
|
`, p = () => {
|
|
242
242
|
var d;
|
|
243
|
-
if (typeof window == "undefined")
|
|
243
|
+
if (typeof window == "undefined")
|
|
244
|
+
return !1;
|
|
244
245
|
const a = (() => {
|
|
245
246
|
const i = window.getSelection();
|
|
246
247
|
if (i && i.rangeCount > 0) {
|
|
@@ -259,7 +260,8 @@ const g = () => `
|
|
|
259
260
|
if (n.getAttribute("contenteditable") === "true")
|
|
260
261
|
return n;
|
|
261
262
|
const t = n.closest('[contenteditable="true"]');
|
|
262
|
-
if (t)
|
|
263
|
+
if (t)
|
|
264
|
+
return t;
|
|
263
265
|
}
|
|
264
266
|
return document.querySelector('[contenteditable="true"]');
|
|
265
267
|
})();
|
|
@@ -308,4 +310,4 @@ const g = () => `
|
|
|
308
310
|
export {
|
|
309
311
|
b as PrintPlugin
|
|
310
312
|
};
|
|
311
|
-
//# sourceMappingURL=PrintPlugin.native-
|
|
313
|
+
//# sourceMappingURL=PrintPlugin.native-f6a168c2.mjs.map
|