@editora/core 1.0.6 → 1.0.8
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/LICENSE +21 -0
- package/dist/{AnchorPlugin.native-C1Rw5m04.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +129 -105
- package/dist/ApprovalWorkflowPlugin.native-C3jtAYjG.mjs +1076 -0
- package/dist/{BackgroundColorPlugin.native-BE-p9DRd.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +119 -122
- package/dist/BlocksLibraryPlugin.native-HMWKxWNs.mjs +1327 -0
- package/dist/CitationsPlugin.native-BnU0qCwR.mjs +1464 -0
- package/dist/CodePlugin.native-DlpTPdkd.mjs +2691 -0
- package/dist/{CommentsPlugin.native-tMnWn8a2.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +153 -135
- package/dist/ConditionalContentPlugin.native-CfhY46rU.mjs +1367 -0
- package/dist/ContentRulesPlugin.native-nBLQ8QFZ.mjs +1099 -0
- package/dist/DataBindingPlugin.native-jQ1JPRTp.mjs +917 -0
- package/dist/DocSchemaPlugin.native-CHOge18O.mjs +1325 -0
- package/dist/{DocumentManagerPlugin.native-BvZL5CSG.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +43 -43
- package/dist/{EmbedIframePlugin.native-CSWIB1jm.mjs → EmbedIframePlugin.native-DKJx2OS7.mjs} +61 -58
- package/dist/{EmojisPlugin.native-DxTm_DL-.mjs → EmojisPlugin.native-CitxxlWX.mjs} +135 -104
- package/dist/{LinkPlugin.native-CS2g-G18.mjs → LinkPlugin.native-DYCIcdTm.mjs} +47 -45
- package/dist/{MathPlugin.native-KUxz0o8C.mjs → MathPlugin.native-f_mDp8VL.mjs} +149 -108
- package/dist/{MediaManagerPlugin.native-CgP5iInD.mjs → MediaManagerPlugin.native-BiXiK8FC.mjs} +238 -217
- package/dist/MentionPlugin.native-BMDlOqur.mjs +734 -0
- package/dist/MergeTagPlugin.native-C3eOfEgw.mjs +559 -0
- package/dist/PIIRedactionPlugin.native-DcsjmtV1.mjs +1396 -0
- package/dist/{PageBreakPlugin.native-CGiQxXqR.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +86 -77
- package/dist/{PreviewPlugin.native-DBvfpmIv.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +30 -30
- package/dist/SlashCommandsPlugin.native-CmxvMEaE.mjs +755 -0
- package/dist/SmartPastePlugin.native-BOKKtF07.mjs +1398 -0
- package/dist/{SpecialCharactersPlugin.native-DANrbExJ.mjs → SpecialCharactersPlugin.native-CZDato89.mjs} +143 -98
- package/dist/{SpellCheckPlugin.native-C8bPvRHy.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +239 -219
- package/dist/{TemplatePlugin.native-4lKEm-WY.mjs → TemplatePlugin.native-CrpfKRJ8.mjs} +167 -143
- package/dist/{TextColorPlugin.native-Clgtb50j.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +134 -118
- package/dist/TrackChangesPlugin.native-Bghu2q4a.mjs +761 -0
- package/dist/TranslationWorkflowPlugin.native-Bz6jDGvj.mjs +1728 -0
- package/dist/VersionDiffPlugin.native-Bvxgy--t.mjs +776 -0
- package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
- package/dist/anchoredPopover-Bxds0VoB.mjs +110 -0
- package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
- package/dist/editora.min.js +13 -13
- package/dist/editora.umd.js +13 -13
- package/dist/html2canvas.esm-AYkPY5LS.mjs +4803 -0
- package/dist/index-BslAFzmv.mjs +16544 -0
- package/dist/index-D1LOqg5C.js +10 -0
- package/dist/{index-OwnkG39N.mjs → index-DqC57IEH.mjs} +438 -328
- package/dist/index.cjs.js +1 -1
- package/dist/{index.es-CuicffkQ.mjs → index.es-BYD2KEo6.mjs} +5 -4
- package/dist/index.esm.js +2 -2
- package/dist/jspdf.es.min-BJGtOnRT.mjs +7890 -0
- package/dist/plugin-loader.js +77 -40
- package/dist/webcomponent-core.js +456 -346
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +87 -107
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +503 -356
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +6003 -658
- package/package.json +2 -2
- package/dist/CodePlugin.native-B263UI8O.mjs +0 -2173
- package/dist/MergeTagPlugin.native-DIGWhdnF.mjs +0 -419
- package/dist/colorSelectionApply-CK1My9N2.mjs +0 -67
- package/dist/documentManager-irzj9n3V.mjs +0 -37627
- package/dist/index-CqWQFb3D.js +0 -10
|
@@ -1,6 +1,14 @@
|
|
|
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
|
-
const
|
|
3
|
+
const h = (e, n) => {
|
|
4
|
+
if (n === e.innerHTML) return;
|
|
5
|
+
const t = window.execEditorCommand || window.executeEditorCommand;
|
|
6
|
+
if (typeof t == "function")
|
|
7
|
+
try {
|
|
8
|
+
t("recordDomTransaction", e, n, e.innerHTML);
|
|
9
|
+
} catch (r) {
|
|
10
|
+
}
|
|
11
|
+
}, x = /* @__PURE__ */ new Set([
|
|
4
12
|
"DIV",
|
|
5
13
|
"P",
|
|
6
14
|
"BLOCKQUOTE",
|
|
@@ -14,7 +22,7 @@ const v = /* @__PURE__ */ new Set([
|
|
|
14
22
|
"LI",
|
|
15
23
|
"TD",
|
|
16
24
|
"TH"
|
|
17
|
-
]),
|
|
25
|
+
]), N = () => {
|
|
18
26
|
p || typeof document == "undefined" || (p = document.createElement("style"), p.textContent = `
|
|
19
27
|
.rte-page-break {
|
|
20
28
|
display: block;
|
|
@@ -87,28 +95,28 @@ const v = /* @__PURE__ */ new Set([
|
|
|
87
95
|
}
|
|
88
96
|
}
|
|
89
97
|
`, document.head.appendChild(p));
|
|
90
|
-
},
|
|
98
|
+
}, T = () => {
|
|
91
99
|
const e = window.getSelection();
|
|
92
100
|
if (!e || e.rangeCount === 0) return null;
|
|
93
101
|
const n = e.getRangeAt(0), t = n.startContainer.nodeType === Node.ELEMENT_NODE ? n.startContainer : n.startContainer.parentElement;
|
|
94
|
-
return (t == null ? void 0 : t.closest(
|
|
95
|
-
},
|
|
96
|
-
const e =
|
|
102
|
+
return (t == null ? void 0 : t.closest(f)) || null;
|
|
103
|
+
}, w = () => {
|
|
104
|
+
const e = T();
|
|
97
105
|
if (e) return e;
|
|
98
|
-
const n = document.activeElement, t = n == null ? void 0 : n.closest(
|
|
99
|
-
return t || document.querySelector(
|
|
100
|
-
},
|
|
106
|
+
const n = document.activeElement, t = n == null ? void 0 : n.closest(f);
|
|
107
|
+
return t || document.querySelector(f);
|
|
108
|
+
}, E = (e, n) => {
|
|
101
109
|
let t = e;
|
|
102
110
|
for (; t && t !== n; ) {
|
|
103
111
|
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
104
112
|
const r = t;
|
|
105
|
-
if (
|
|
113
|
+
if (x.has(r.tagName))
|
|
106
114
|
return r;
|
|
107
115
|
}
|
|
108
116
|
t = t.parentNode;
|
|
109
117
|
}
|
|
110
118
|
return null;
|
|
111
|
-
},
|
|
119
|
+
}, C = () => {
|
|
112
120
|
const e = document.createElement("div");
|
|
113
121
|
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;
|
|
114
122
|
}, S = (e) => {
|
|
@@ -122,7 +130,7 @@ const v = /* @__PURE__ */ new Set([
|
|
|
122
130
|
const r = t;
|
|
123
131
|
t = t.previousElementSibling, r.remove();
|
|
124
132
|
}
|
|
125
|
-
},
|
|
133
|
+
}, v = (e) => {
|
|
126
134
|
var r;
|
|
127
135
|
const n = e.nextElementSibling;
|
|
128
136
|
if (n && !n.matches(u))
|
|
@@ -144,7 +152,7 @@ const v = /* @__PURE__ */ new Set([
|
|
|
144
152
|
} else
|
|
145
153
|
t.selectNodeContents(e), t.collapse(!1);
|
|
146
154
|
n.removeAllRanges(), n.addRange(t);
|
|
147
|
-
},
|
|
155
|
+
}, g = (e, n) => {
|
|
148
156
|
let t = e;
|
|
149
157
|
for (; t; ) {
|
|
150
158
|
if (!(t instanceof HTMLElement && t.matches(u)))
|
|
@@ -159,81 +167,82 @@ const v = /* @__PURE__ */ new Set([
|
|
|
159
167
|
if (r < 0) return;
|
|
160
168
|
const o = document.createRange();
|
|
161
169
|
o.setStart(t, r), o.setEnd(t, r + 1), n.removeAllRanges(), n.addRange(o), e.focus({ preventScroll: !0 });
|
|
162
|
-
},
|
|
170
|
+
}, y = (e) => {
|
|
163
171
|
if (e.collapsed || e.startContainer !== e.endContainer || e.endOffset !== e.startOffset + 1 || !(e.startContainer instanceof Element || e.startContainer instanceof DocumentFragment)) return null;
|
|
164
172
|
const n = e.startContainer.childNodes[e.startOffset];
|
|
165
173
|
return n instanceof HTMLElement && n.matches(u) ? n : null;
|
|
166
|
-
},
|
|
174
|
+
}, B = (e, n, t) => {
|
|
167
175
|
if (!e.collapsed) return null;
|
|
168
|
-
const { startContainer: r, startOffset: o } = e,
|
|
176
|
+
const { startContainer: r, startOffset: o } = e, a = (i) => i instanceof HTMLElement && i.matches(u) ? i : null, s = (i) => {
|
|
169
177
|
if (r.nodeType === Node.ELEMENT_NODE) {
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
178
|
+
const l = r;
|
|
179
|
+
if (i === "previous") {
|
|
172
180
|
if (o > 0)
|
|
173
|
-
return
|
|
174
|
-
} else if (o <
|
|
175
|
-
return
|
|
181
|
+
return l.childNodes[o - 1] || null;
|
|
182
|
+
} else if (o < l.childNodes.length)
|
|
183
|
+
return l.childNodes[o] || null;
|
|
176
184
|
}
|
|
177
|
-
if (r.nodeType === Node.TEXT_NODE && (
|
|
185
|
+
if (r.nodeType === Node.TEXT_NODE && (i === "previous" && o < r.data.length || i === "next" && o > 0))
|
|
178
186
|
return null;
|
|
179
|
-
let
|
|
180
|
-
for (;
|
|
181
|
-
const
|
|
182
|
-
if (
|
|
183
|
-
|
|
187
|
+
let c = r;
|
|
188
|
+
for (; c && c !== n; ) {
|
|
189
|
+
const l = i === "previous" ? c.previousSibling : c.nextSibling;
|
|
190
|
+
if (l) return l;
|
|
191
|
+
c = c.parentNode;
|
|
184
192
|
}
|
|
185
193
|
return null;
|
|
186
194
|
};
|
|
187
195
|
if (r.nodeType === Node.ELEMENT_NODE) {
|
|
188
|
-
const
|
|
189
|
-
return t === "Backspace" && o > 0 ? i
|
|
196
|
+
const i = r;
|
|
197
|
+
return t === "Backspace" && o > 0 ? a(i.childNodes[o - 1] || null) : t === "Delete" ? a(i.childNodes[o] || null) : null;
|
|
190
198
|
}
|
|
191
199
|
if (r.nodeType === Node.TEXT_NODE) {
|
|
192
|
-
const
|
|
200
|
+
const i = r;
|
|
193
201
|
if (t === "Backspace" && o === 0) {
|
|
194
|
-
const
|
|
195
|
-
return
|
|
202
|
+
const c = a(i.previousSibling);
|
|
203
|
+
return c || a(s("previous"));
|
|
196
204
|
}
|
|
197
|
-
if (t === "Delete" && o ===
|
|
198
|
-
const
|
|
199
|
-
return
|
|
205
|
+
if (t === "Delete" && o === i.data.length) {
|
|
206
|
+
const c = a(i.nextSibling);
|
|
207
|
+
return c || a(s("next"));
|
|
200
208
|
}
|
|
201
209
|
}
|
|
202
|
-
return
|
|
203
|
-
},
|
|
204
|
-
|
|
210
|
+
return a(s(t === "Backspace" ? "previous" : "next"));
|
|
211
|
+
}, k = (e, n) => {
|
|
212
|
+
var c;
|
|
213
|
+
const t = e.closest(f), r = (c = t == null ? void 0 : t.innerHTML) != null ? c : "", o = e.previousSibling, a = e.nextSibling;
|
|
205
214
|
e.remove();
|
|
206
|
-
const
|
|
215
|
+
const s = g(o, "previous"), i = g(a, "next");
|
|
207
216
|
if (n === "Backspace") {
|
|
208
|
-
if (
|
|
209
|
-
b(
|
|
210
|
-
else if (
|
|
211
|
-
d(
|
|
217
|
+
if (s)
|
|
218
|
+
b(s);
|
|
219
|
+
else if (i)
|
|
220
|
+
d(i);
|
|
212
221
|
else if (t) {
|
|
213
|
-
const
|
|
214
|
-
|
|
222
|
+
const l = document.createElement("p");
|
|
223
|
+
l.innerHTML = "<br>", t.appendChild(l), d(l);
|
|
215
224
|
}
|
|
216
|
-
} else if (
|
|
217
|
-
d(
|
|
218
|
-
else if (
|
|
219
|
-
b(
|
|
225
|
+
} else if (i)
|
|
226
|
+
d(i);
|
|
227
|
+
else if (s)
|
|
228
|
+
b(s);
|
|
220
229
|
else if (t) {
|
|
221
|
-
const
|
|
222
|
-
|
|
230
|
+
const l = document.createElement("p");
|
|
231
|
+
l.innerHTML = "<br>", t.appendChild(l), d(l);
|
|
223
232
|
}
|
|
224
|
-
return t && t.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
|
|
225
|
-
},
|
|
226
|
-
const e =
|
|
233
|
+
return t && (h(t, r), t.dispatchEvent(new Event("input", { bubbles: !0 }))), !0;
|
|
234
|
+
}, D = () => {
|
|
235
|
+
const e = w();
|
|
227
236
|
if (!e) return !1;
|
|
228
|
-
const n = window.getSelection();
|
|
229
|
-
if (!
|
|
230
|
-
let
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
const
|
|
235
|
-
return d(
|
|
236
|
-
},
|
|
237
|
+
const n = e.innerHTML, t = window.getSelection();
|
|
238
|
+
if (!t) return !1;
|
|
239
|
+
let r;
|
|
240
|
+
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 = C();
|
|
242
|
+
o && o.parentNode ? o.parentNode.insertBefore(a, o.nextSibling) : e.appendChild(a), S(a);
|
|
243
|
+
const s = v(a);
|
|
244
|
+
return d(s), h(e, n), e.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
|
|
245
|
+
}, R = () => {
|
|
237
246
|
m || typeof document == "undefined" || (m = !0, document.addEventListener("click", (e) => {
|
|
238
247
|
const n = e.target, t = n == null ? void 0 : n.closest(u);
|
|
239
248
|
t && (e.preventDefault(), e.stopPropagation(), A(t));
|
|
@@ -243,55 +252,55 @@ const v = /* @__PURE__ */ new Set([
|
|
|
243
252
|
return;
|
|
244
253
|
const t = window.getSelection();
|
|
245
254
|
if (!t || t.rangeCount === 0) return;
|
|
246
|
-
const r = t.getRangeAt(0), o =
|
|
255
|
+
const r = t.getRangeAt(0), o = w();
|
|
247
256
|
if (!o || !o.contains(r.commonAncestorContainer)) return;
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
257
|
+
const a = y(r);
|
|
258
|
+
if (a) {
|
|
250
259
|
if (n === "Backspace" || n === "Delete") {
|
|
251
|
-
e.preventDefault(), e.stopPropagation(),
|
|
260
|
+
e.preventDefault(), e.stopPropagation(), k(a, n);
|
|
252
261
|
return;
|
|
253
262
|
}
|
|
254
263
|
if (n === "ArrowRight" || n === "ArrowDown") {
|
|
255
264
|
e.preventDefault();
|
|
256
|
-
const s =
|
|
265
|
+
const s = g(a.nextSibling, "next") || v(a);
|
|
257
266
|
d(s);
|
|
258
267
|
return;
|
|
259
268
|
}
|
|
260
269
|
if (n === "ArrowLeft" || n === "ArrowUp") {
|
|
261
270
|
e.preventDefault();
|
|
262
|
-
const s =
|
|
271
|
+
const s = g(a.previousSibling, "previous");
|
|
263
272
|
s ? b(s) : d(o);
|
|
264
273
|
return;
|
|
265
274
|
}
|
|
266
275
|
}
|
|
267
276
|
if (n === "Backspace" || n === "Delete") {
|
|
268
|
-
const s =
|
|
277
|
+
const s = B(
|
|
269
278
|
r,
|
|
270
279
|
o,
|
|
271
280
|
n
|
|
272
281
|
);
|
|
273
282
|
if (!s) return;
|
|
274
|
-
e.preventDefault(), e.stopPropagation(),
|
|
283
|
+
e.preventDefault(), e.stopPropagation(), k(s, n);
|
|
275
284
|
}
|
|
276
285
|
}));
|
|
277
|
-
},
|
|
286
|
+
}, P = () => (N(), R(), {
|
|
278
287
|
name: "pageBreak",
|
|
279
288
|
toolbar: [
|
|
280
289
|
{
|
|
281
290
|
label: "Page Break",
|
|
282
291
|
command: "insertPageBreak",
|
|
283
|
-
icon: '<svg
|
|
292
|
+
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>',
|
|
284
293
|
shortcut: "Mod-Enter"
|
|
285
294
|
}
|
|
286
295
|
],
|
|
287
296
|
commands: {
|
|
288
|
-
insertPageBreak:
|
|
297
|
+
insertPageBreak: D
|
|
289
298
|
},
|
|
290
299
|
keymap: {
|
|
291
300
|
"Mod-Enter": "insertPageBreak"
|
|
292
301
|
}
|
|
293
302
|
});
|
|
294
303
|
export {
|
|
295
|
-
|
|
304
|
+
P as PageBreakPlugin
|
|
296
305
|
};
|
|
297
|
-
//# sourceMappingURL=PageBreakPlugin.native-
|
|
306
|
+
//# sourceMappingURL=PageBreakPlugin.native-DijGuHJZ.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
let c = !1;
|
|
2
2
|
const g = () => {
|
|
3
3
|
if (typeof document == "undefined") return;
|
|
4
|
-
const
|
|
5
|
-
if (document.getElementById(
|
|
4
|
+
const i = "rte-preview-plugin-styles";
|
|
5
|
+
if (document.getElementById(i)) return;
|
|
6
6
|
const t = document.createElement("style");
|
|
7
|
-
t.id =
|
|
7
|
+
t.id = i, t.textContent = `
|
|
8
8
|
/* Preview Editor Dialog Styles */
|
|
9
9
|
.rte-preview-editor-overlay {
|
|
10
10
|
position: fixed !important;
|
|
@@ -225,14 +225,14 @@ const g = () => {
|
|
|
225
225
|
}
|
|
226
226
|
`, document.head.appendChild(t);
|
|
227
227
|
}, v = () => {
|
|
228
|
-
const
|
|
229
|
-
if (
|
|
230
|
-
let e =
|
|
228
|
+
const i = window.getSelection();
|
|
229
|
+
if (i && i.rangeCount > 0) {
|
|
230
|
+
let e = i.getRangeAt(0).startContainer;
|
|
231
231
|
for (; e && e !== document.body; ) {
|
|
232
232
|
if (e.nodeType === Node.ELEMENT_NODE) {
|
|
233
|
-
const
|
|
234
|
-
if (
|
|
235
|
-
return
|
|
233
|
+
const n = e;
|
|
234
|
+
if (n.getAttribute("contenteditable") === "true")
|
|
235
|
+
return n;
|
|
236
236
|
}
|
|
237
237
|
e = e.parentNode;
|
|
238
238
|
}
|
|
@@ -246,36 +246,36 @@ const g = () => {
|
|
|
246
246
|
}
|
|
247
247
|
return document.querySelector('[contenteditable="true"]');
|
|
248
248
|
}, h = () => {
|
|
249
|
-
const
|
|
250
|
-
if (!
|
|
251
|
-
const t =
|
|
249
|
+
const i = v();
|
|
250
|
+
if (!i) return "";
|
|
251
|
+
const t = i.cloneNode(!0);
|
|
252
252
|
return [
|
|
253
253
|
".rte-floating-toolbar",
|
|
254
254
|
".rte-selection-marker",
|
|
255
255
|
".rte-toolbar",
|
|
256
256
|
".rte-resize-handle",
|
|
257
257
|
"[data-rte-internal]"
|
|
258
|
-
].forEach((
|
|
259
|
-
t.querySelectorAll(
|
|
258
|
+
].forEach((n) => {
|
|
259
|
+
t.querySelectorAll(n).forEach((r) => r.remove());
|
|
260
260
|
}), t.innerHTML;
|
|
261
|
-
}, w = (
|
|
261
|
+
}, w = (i) => {
|
|
262
262
|
const t = document.createElement("div");
|
|
263
|
-
return t.innerHTML =
|
|
263
|
+
return t.innerHTML = i, t.querySelectorAll(
|
|
264
264
|
'script, iframe[src^="javascript:"], object, embed, form[action^="javascript:"]'
|
|
265
|
-
).forEach((
|
|
266
|
-
Array.from(
|
|
267
|
-
|
|
268
|
-
});
|
|
265
|
+
).forEach((r) => r.remove()), t.querySelectorAll("*").forEach((r) => {
|
|
266
|
+
Array.from(r.attributes).forEach((o) => {
|
|
267
|
+
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);
|
|
268
|
+
}), r.setAttribute("contenteditable", "false");
|
|
269
269
|
}), t.innerHTML;
|
|
270
270
|
}, u = () => {
|
|
271
271
|
if (typeof window == "undefined" || c) return;
|
|
272
272
|
c = !0, g();
|
|
273
|
-
const
|
|
273
|
+
const i = h(), t = w(i), e = document.createElement("div");
|
|
274
274
|
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
|
-
|
|
275
|
+
const n = document.createElement("div");
|
|
276
|
+
n.className = "rte-preview-editor-modal";
|
|
277
|
+
const r = document.createElement("div");
|
|
278
|
+
r.className = "rte-preview-editor-header", r.innerHTML = `
|
|
279
279
|
<h2 id="preview-editor-title">Preview Editor</h2>
|
|
280
280
|
<div class="rte-preview-editor-header-actions">
|
|
281
281
|
<button class="rte-preview-editor-close-btn" aria-label="Close preview editor">
|
|
@@ -286,17 +286,17 @@ const g = () => {
|
|
|
286
286
|
</button>
|
|
287
287
|
</div>
|
|
288
288
|
`;
|
|
289
|
-
const
|
|
290
|
-
|
|
289
|
+
const o = document.createElement("div");
|
|
290
|
+
o.className = "rte-preview-editor-body";
|
|
291
291
|
const a = document.createElement("div");
|
|
292
292
|
a.className = "rte-preview-editor-content";
|
|
293
293
|
const l = document.createElement("div");
|
|
294
|
-
l.className = "rte-preview-editor-light-editor", l.innerHTML = t, a.appendChild(l),
|
|
294
|
+
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
295
|
const p = () => {
|
|
296
296
|
e.parentNode && e.parentNode.removeChild(e), c = !1, document.removeEventListener("keydown", s);
|
|
297
297
|
}, s = (d) => {
|
|
298
298
|
d.key === "Escape" && (d.preventDefault(), d.stopPropagation(), p());
|
|
299
|
-
}, m =
|
|
299
|
+
}, m = r.querySelector(".rte-preview-editor-close-btn");
|
|
300
300
|
m && m.addEventListener("click", (d) => {
|
|
301
301
|
d.preventDefault(), d.stopPropagation(), p();
|
|
302
302
|
}), e.addEventListener("click", (d) => {
|
|
@@ -319,4 +319,4 @@ const g = () => {
|
|
|
319
319
|
export {
|
|
320
320
|
f as PreviewPlugin
|
|
321
321
|
};
|
|
322
|
-
//# sourceMappingURL=PreviewPlugin.native-
|
|
322
|
+
//# sourceMappingURL=PreviewPlugin.native-WuIwOAOR.mjs.map
|