@editora/core 1.0.18 → 1.0.19
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/dist/{CodePlugin.native-BH-K4xmW.mjs → CodePlugin.native-BcVqm5MS.mjs} +64 -65
- package/dist/{CodePlugin.native-hNgfXlfS.mjs → CodePlugin.native-Rgxx2Igx.mjs} +2708 -1225
- package/dist/{DocumentManagerPlugin.native-iFip6s4Q.mjs → DocumentManagerPlugin.native-B8K-Oqom.mjs} +12 -11
- package/dist/{PreviewPlugin.native-CiR51jql.mjs → PreviewPlugin.native-Dyht8mGi.mjs} +48 -51
- package/dist/{TablePlugin.native-BjIxYZ2X.mjs → TablePlugin.native-C1YZ372P.mjs} +156 -147
- package/dist/TemplatePlugin.native-BDV2eik2.mjs +628 -0
- package/dist/{documentManager-BcBIv5P-.mjs → documentManager-BWK_-KJp.mjs} +524 -526
- package/dist/editora.min.js +17 -17
- package/dist/editora.umd.js +17 -17
- package/dist/index-CclXYzUB.js +12 -0
- package/dist/{index-XsYC_KdJ.mjs → index-DeUjxpKd.mjs} +406 -386
- package/dist/index.cjs.js +4 -4
- package/dist/index.esm.js +19 -16
- package/dist/plugin-loader.js +4 -4
- package/dist/purify.es-BHa5gZB7.mjs +1481 -0
- package/dist/sanitizeHtml-DA0ajC6k.mjs +17 -0
- package/dist/webcomponent-core.js +376 -362
- package/dist/webcomponent-core.min.js +91 -89
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +2 -2
- package/dist/webcomponent.js +382 -368
- package/dist/webcomponent.min.js +968 -967
- package/index.d.ts +9 -0
- package/package.json +1 -1
- package/dist/TemplatePlugin.native-D6n5RUnC.mjs +0 -1176
- package/dist/index-_eKRBZPq.js +0 -12
package/dist/{DocumentManagerPlugin.native-iFip6s4Q.mjs → DocumentManagerPlugin.native-B8K-Oqom.mjs}
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { s as u } from "./sanitizeHtml-DA0ajC6k.mjs";
|
|
2
|
+
const d = "rte-document-manager-styles", s = `
|
|
2
3
|
.rte-toolbar-button[data-busy="true"],
|
|
3
4
|
.rte-docmgr-toolbar-button[data-busy="true"] {
|
|
4
5
|
position: relative;
|
|
@@ -28,13 +29,13 @@ const d = "rte-document-manager-styles", u = `
|
|
|
28
29
|
to { transform: rotate(360deg); }
|
|
29
30
|
}
|
|
30
31
|
`;
|
|
31
|
-
function
|
|
32
|
+
function p() {
|
|
32
33
|
if (typeof document == "undefined" || document.getElementById(d)) return;
|
|
33
34
|
const a = document.createElement("style");
|
|
34
|
-
a.id = d, a.textContent =
|
|
35
|
+
a.id = d, a.textContent = s, document.head.appendChild(a);
|
|
35
36
|
}
|
|
36
37
|
async function l(a) {
|
|
37
|
-
|
|
38
|
+
p();
|
|
38
39
|
const t = typeof window != "undefined" ? window.__editoraLastCommandButton : null;
|
|
39
40
|
t && (t.disabled = !0, t.setAttribute("data-busy", "true"), t.setAttribute("aria-busy", "true"));
|
|
40
41
|
try {
|
|
@@ -43,7 +44,7 @@ async function l(a) {
|
|
|
43
44
|
t && (t.disabled = !1, t.removeAttribute("data-busy"), t.removeAttribute("aria-busy"));
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
|
-
const
|
|
47
|
+
const m = () => ({
|
|
47
48
|
name: "document-manager",
|
|
48
49
|
toolbar: [
|
|
49
50
|
{
|
|
@@ -93,8 +94,8 @@ const p = () => ({
|
|
|
93
94
|
try {
|
|
94
95
|
const n = a();
|
|
95
96
|
if (n) {
|
|
96
|
-
const { importFromWord: i } = await import("./documentManager-
|
|
97
|
-
n.innerHTML = c, n.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
97
|
+
const { importFromWord: i } = await import("./documentManager-BWK_-KJp.mjs"), c = await i(r);
|
|
98
|
+
n.innerHTML = u(c), n.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
98
99
|
}
|
|
99
100
|
} catch (n) {
|
|
100
101
|
console.error("Import failed:", n), alert("Failed to import Word document. Please check the console for details.");
|
|
@@ -119,7 +120,7 @@ const p = () => ({
|
|
|
119
120
|
try {
|
|
120
121
|
const t = a();
|
|
121
122
|
if (t) {
|
|
122
|
-
const e = t.innerHTML, { exportToWord: r } = await import("./documentManager-
|
|
123
|
+
const e = t.innerHTML, { exportToWord: r } = await import("./documentManager-BWK_-KJp.mjs");
|
|
123
124
|
await r(e, "document.docx");
|
|
124
125
|
}
|
|
125
126
|
return !0;
|
|
@@ -146,7 +147,7 @@ const p = () => ({
|
|
|
146
147
|
try {
|
|
147
148
|
const t = a();
|
|
148
149
|
if (t) {
|
|
149
|
-
const e = t.innerHTML, { exportToPdf: r } = await import("./documentManager-
|
|
150
|
+
const e = t.innerHTML, { exportToPdf: r } = await import("./documentManager-BWK_-KJp.mjs");
|
|
150
151
|
await r(e, "document.pdf", t);
|
|
151
152
|
} else
|
|
152
153
|
console.error("PDF Export: No editor element found"), alert("No active editor found. Please click in the editor area first.");
|
|
@@ -160,6 +161,6 @@ const p = () => ({
|
|
|
160
161
|
keymap: {}
|
|
161
162
|
});
|
|
162
163
|
export {
|
|
163
|
-
|
|
164
|
+
m as DocumentManagerPlugin
|
|
164
165
|
};
|
|
165
|
-
//# sourceMappingURL=DocumentManagerPlugin.native-
|
|
166
|
+
//# sourceMappingURL=DocumentManagerPlugin.native-B8K-Oqom.mjs.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { i as h } from "./dialogHelpers-DBf7WqYH.mjs";
|
|
2
|
+
import { s as v } from "./sanitizeHtml-DA0ajC6k.mjs";
|
|
3
|
+
let l = !1, d = null;
|
|
4
|
+
const w = () => {
|
|
4
5
|
if (typeof document == "undefined") return;
|
|
5
|
-
const
|
|
6
|
-
if (document.getElementById(
|
|
6
|
+
const r = "rte-preview-plugin-styles";
|
|
7
|
+
if (document.getElementById(r)) return;
|
|
7
8
|
const t = document.createElement("style");
|
|
8
|
-
t.id =
|
|
9
|
+
t.id = r, t.textContent = `
|
|
9
10
|
/* Preview Editor Dialog Styles */
|
|
10
11
|
.rte-preview-editor-overlay {
|
|
11
12
|
position: fixed !important;
|
|
@@ -225,15 +226,15 @@ const h = () => {
|
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
228
|
`, document.head.appendChild(t);
|
|
228
|
-
},
|
|
229
|
-
const
|
|
230
|
-
if (
|
|
231
|
-
let e =
|
|
229
|
+
}, u = () => {
|
|
230
|
+
const r = window.getSelection();
|
|
231
|
+
if (r && r.rangeCount > 0) {
|
|
232
|
+
let e = r.getRangeAt(0).startContainer;
|
|
232
233
|
for (; e && e !== document.body; ) {
|
|
233
234
|
if (e.nodeType === Node.ELEMENT_NODE) {
|
|
234
|
-
const
|
|
235
|
-
if (
|
|
236
|
-
return
|
|
235
|
+
const i = e;
|
|
236
|
+
if (i.getAttribute("contenteditable") === "true")
|
|
237
|
+
return i;
|
|
237
238
|
}
|
|
238
239
|
e = e.parentNode;
|
|
239
240
|
}
|
|
@@ -246,37 +247,33 @@ const h = () => {
|
|
|
246
247
|
if (e) return e;
|
|
247
248
|
}
|
|
248
249
|
return document.querySelector('[contenteditable="true"]');
|
|
249
|
-
},
|
|
250
|
-
const
|
|
251
|
-
if (!
|
|
252
|
-
const t =
|
|
250
|
+
}, f = () => {
|
|
251
|
+
const r = u();
|
|
252
|
+
if (!r) return "";
|
|
253
|
+
const t = r.cloneNode(!0);
|
|
253
254
|
return [
|
|
254
255
|
".rte-floating-toolbar",
|
|
255
256
|
".rte-selection-marker",
|
|
256
257
|
".rte-toolbar",
|
|
257
258
|
".rte-resize-handle",
|
|
258
259
|
"[data-rte-internal]"
|
|
259
|
-
].forEach((
|
|
260
|
-
t.querySelectorAll(
|
|
260
|
+
].forEach((i) => {
|
|
261
|
+
t.querySelectorAll(i).forEach((n) => n.remove());
|
|
261
262
|
}), t.innerHTML;
|
|
262
|
-
},
|
|
263
|
-
const t = document.createElement("
|
|
264
|
-
return t.innerHTML =
|
|
265
|
-
|
|
266
|
-
).forEach((r) => r.remove()), t.querySelectorAll("*").forEach((r) => {
|
|
267
|
-
Array.from(r.attributes).forEach((o) => {
|
|
268
|
-
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);
|
|
269
|
-
}), r.setAttribute("contenteditable", "false");
|
|
263
|
+
}, x = (r) => {
|
|
264
|
+
const t = document.createElement("template");
|
|
265
|
+
return t.innerHTML = v(r), t.content.querySelectorAll("*").forEach((e) => {
|
|
266
|
+
e.setAttribute("contenteditable", "false");
|
|
270
267
|
}), t.innerHTML;
|
|
271
268
|
}, b = () => {
|
|
272
|
-
if (typeof window == "undefined" ||
|
|
273
|
-
|
|
274
|
-
const
|
|
275
|
-
|
|
269
|
+
if (typeof window == "undefined" || l) return;
|
|
270
|
+
l = !0, w();
|
|
271
|
+
const r = f(), t = x(r), e = document.createElement("div");
|
|
272
|
+
h(e), e.className = "rte-preview-editor-overlay", e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.setAttribute("aria-labelledby", "preview-editor-title");
|
|
273
|
+
const i = document.createElement("div");
|
|
274
|
+
i.className = "rte-preview-editor-modal";
|
|
276
275
|
const n = document.createElement("div");
|
|
277
|
-
n.className = "rte-preview-editor-
|
|
278
|
-
const r = document.createElement("div");
|
|
279
|
-
r.className = "rte-preview-editor-header", r.innerHTML = `
|
|
276
|
+
n.className = "rte-preview-editor-header", n.innerHTML = `
|
|
280
277
|
<h2 id="preview-editor-title">Preview Editor</h2>
|
|
281
278
|
<div class="rte-preview-editor-header-actions">
|
|
282
279
|
<button class="rte-preview-editor-close-btn" aria-label="Close preview editor">
|
|
@@ -287,25 +284,25 @@ const h = () => {
|
|
|
287
284
|
</button>
|
|
288
285
|
</div>
|
|
289
286
|
`;
|
|
290
|
-
const
|
|
291
|
-
|
|
287
|
+
const p = document.createElement("div");
|
|
288
|
+
p.className = "rte-preview-editor-body";
|
|
292
289
|
const c = document.createElement("div");
|
|
293
290
|
c.className = "rte-preview-editor-content";
|
|
294
291
|
const s = document.createElement("div");
|
|
295
|
-
s.className = "rte-preview-editor-light-editor", s.innerHTML = t, c.appendChild(s),
|
|
296
|
-
const
|
|
297
|
-
e.parentNode && e.parentNode.removeChild(e),
|
|
292
|
+
s.className = "rte-preview-editor-light-editor", s.innerHTML = t, c.appendChild(s), p.appendChild(c), i.appendChild(n), i.appendChild(p), e.appendChild(i);
|
|
293
|
+
const a = () => {
|
|
294
|
+
e.parentNode && e.parentNode.removeChild(e), l = !1, d = null, document.removeEventListener("keydown", m);
|
|
298
295
|
};
|
|
299
|
-
|
|
300
|
-
const m = (
|
|
301
|
-
|
|
302
|
-
}, g =
|
|
303
|
-
g && g.addEventListener("click", (
|
|
304
|
-
|
|
305
|
-
}), e.addEventListener("click", (
|
|
306
|
-
|
|
296
|
+
d = a;
|
|
297
|
+
const m = (o) => {
|
|
298
|
+
o.key === "Escape" && (o.preventDefault(), o.stopPropagation(), a());
|
|
299
|
+
}, g = n.querySelector(".rte-preview-editor-close-btn");
|
|
300
|
+
g && g.addEventListener("click", (o) => {
|
|
301
|
+
o.preventDefault(), o.stopPropagation(), a();
|
|
302
|
+
}), e.addEventListener("click", (o) => {
|
|
303
|
+
o.target === e && a();
|
|
307
304
|
}), document.addEventListener("keydown", m), document.body.appendChild(e);
|
|
308
|
-
},
|
|
305
|
+
}, E = () => ({
|
|
309
306
|
name: "preview",
|
|
310
307
|
toolbar: [
|
|
311
308
|
{
|
|
@@ -315,11 +312,11 @@ const h = () => {
|
|
|
315
312
|
}
|
|
316
313
|
],
|
|
317
314
|
commands: {
|
|
318
|
-
togglePreview: () => (
|
|
315
|
+
togglePreview: () => (l ? d == null || d() : b(), !0)
|
|
319
316
|
},
|
|
320
317
|
keymap: {}
|
|
321
318
|
});
|
|
322
319
|
export {
|
|
323
|
-
|
|
320
|
+
E as PreviewPlugin
|
|
324
321
|
};
|
|
325
|
-
//# sourceMappingURL=PreviewPlugin.native-
|
|
322
|
+
//# sourceMappingURL=PreviewPlugin.native-Dyht8mGi.mjs.map
|