@editora/core 1.0.3 → 1.0.4
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 +34 -0
- package/dist/{A11yCheckerPlugin.native-CZKpi3uF.mjs → A11yCheckerPlugin.native-BRdGYMju.mjs} +225 -173
- package/dist/AnchorPlugin.native-C1Rw5m04.mjs +404 -0
- package/dist/BackgroundColorPlugin.native-BE-p9DRd.mjs +489 -0
- package/dist/ChecklistPlugin.native-nuSSEFNI.mjs +309 -0
- package/dist/ClearFormattingPlugin.native-Bq_XcTh2.mjs +140 -0
- package/dist/{CodePlugin.native-CK9d8rmt.mjs → CodePlugin.native-0Zari_zp.mjs} +329 -310
- package/dist/CodeSamplePlugin.native-B-KS1pOl.mjs +384 -0
- package/dist/CommentsPlugin.native-tMnWn8a2.mjs +723 -0
- package/dist/DirectionPlugin.native-CDnbdNyl.mjs +130 -0
- package/dist/{EmbedIframePlugin.native-ifr9KLdN.mjs → EmbedIframePlugin.native-CSWIB1jm.mjs} +154 -50
- package/dist/{EmojisPlugin.native-D6mJSnSR.mjs → EmojisPlugin.native-DxTm_DL-.mjs} +156 -103
- package/dist/FontFamilyPlugin.native-j8hMTbg4.mjs +158 -0
- package/dist/FontSizePlugin.native-B_jCh7dY.mjs +286 -0
- package/dist/FootnotePlugin.native-D730OGRm.mjs +425 -0
- package/dist/HistoryPlugin.native-DCrPdeSW.mjs +257 -0
- package/dist/IndentPlugin.native-BHixp8sP.mjs +150 -0
- package/dist/LineHeightPlugin.native-CM7iXdQj.mjs +151 -0
- package/dist/{LinkPlugin.native-BdAOV-iu.mjs → LinkPlugin.native-CS2g-G18.mjs} +128 -53
- package/dist/{ListPlugin.native-CLFU5AUQ.mjs → ListPlugin.native-V7EZC1lM.mjs} +59 -12
- package/dist/MathPlugin.native-KUxz0o8C.mjs +251 -0
- package/dist/MediaManagerPlugin.native-CgP5iInD.mjs +970 -0
- package/dist/MergeTagPlugin.native-CU9LtsfD.mjs +416 -0
- package/dist/PageBreakPlugin.native-CGiQxXqR.mjs +297 -0
- package/dist/{PrintPlugin.native-BUpm52VJ.mjs → PrintPlugin.native-7qt5v7L5.mjs} +10 -10
- package/dist/{SpecialCharactersPlugin.native-x7a2SWXc.mjs → SpecialCharactersPlugin.native-DANrbExJ.mjs} +143 -97
- package/dist/SpellCheckPlugin.native-C8bPvRHy.mjs +1019 -0
- package/dist/StrikethroughPlugin.native-0Be7j49s.mjs +73 -0
- package/dist/{TablePlugin.native-EEWXn1-s.mjs → TablePlugin.native-DrHX-efe.mjs} +149 -145
- package/dist/TemplatePlugin.native-4lKEm-WY.mjs +578 -0
- package/dist/TextAlignmentPlugin.native-sM_1s00t.mjs +108 -0
- package/dist/{TextColorPlugin.native-D6SmTglm.mjs → TextColorPlugin.native-Clgtb50j.mjs} +173 -92
- package/dist/colorSelectionApply-CK1My9N2.mjs +67 -0
- package/dist/core.css +1 -1
- package/dist/editora.min.js +31 -29
- package/dist/editora.umd.js +31 -29
- package/dist/index-CqWQFb3D.js +10 -0
- package/dist/index-OwnkG39N.mjs +2227 -0
- package/dist/index.cjs.js +14 -18
- package/dist/index.esm.js +204 -521
- package/dist/plugin-loader.js +26 -26
- package/dist/webcomponent-core.js +1286 -295
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +100 -75
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +1252 -261
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +3616 -2109
- package/index.d.ts +355 -0
- package/package.json +19 -17
- package/dist/A11yCheckerPlugin.native-CZKpi3uF.mjs.map +0 -1
- package/dist/AnchorPlugin.native-7es9PVZ9.mjs +0 -340
- package/dist/AnchorPlugin.native-7es9PVZ9.mjs.map +0 -1
- package/dist/BackgroundColorPlugin.native-Dip5uqTg.mjs +0 -449
- package/dist/BackgroundColorPlugin.native-Dip5uqTg.mjs.map +0 -1
- package/dist/BlockquotePlugin.native-JFmOLsxN.mjs.map +0 -1
- package/dist/BoldPlugin.native-BAzzoqU5.mjs.map +0 -1
- package/dist/CapitalizationPlugin.native-DOMsh5R7.mjs.map +0 -1
- package/dist/ChecklistPlugin.native-Dccs3nLe.mjs +0 -153
- package/dist/ChecklistPlugin.native-Dccs3nLe.mjs.map +0 -1
- package/dist/ClearFormattingPlugin.native-BZPDHswo.mjs +0 -27
- package/dist/ClearFormattingPlugin.native-BZPDHswo.mjs.map +0 -1
- package/dist/CodePlugin.native-CK9d8rmt.mjs.map +0 -1
- package/dist/CodeSamplePlugin.native-DMbEdO9j.mjs +0 -326
- package/dist/CodeSamplePlugin.native-DMbEdO9j.mjs.map +0 -1
- package/dist/CommentsPlugin.native-2zQV8Ia4.mjs +0 -473
- package/dist/CommentsPlugin.native-2zQV8Ia4.mjs.map +0 -1
- package/dist/DirectionPlugin.native-Be7wCzkI.mjs +0 -59
- package/dist/DirectionPlugin.native-Be7wCzkI.mjs.map +0 -1
- package/dist/DocumentManagerPlugin.native-BvZL5CSG.mjs.map +0 -1
- package/dist/EmbedIframePlugin.native-ifr9KLdN.mjs.map +0 -1
- package/dist/EmojisPlugin.native-D6mJSnSR.mjs.map +0 -1
- package/dist/FontFamilyPlugin.native-BzS_9qbM.mjs +0 -106
- package/dist/FontFamilyPlugin.native-BzS_9qbM.mjs.map +0 -1
- package/dist/FontSizePlugin.native-DkLMLPue.mjs +0 -186
- package/dist/FontSizePlugin.native-DkLMLPue.mjs.map +0 -1
- package/dist/FootnotePlugin.native-BciVc9W6.mjs +0 -128
- package/dist/FootnotePlugin.native-BciVc9W6.mjs.map +0 -1
- package/dist/FullscreenPlugin.native-ChXyxeNw.mjs.map +0 -1
- package/dist/HeadingPlugin.native-DrLYwQnQ.mjs.map +0 -1
- package/dist/HistoryPlugin.native-DoDRifCf.mjs +0 -89
- package/dist/HistoryPlugin.native-DoDRifCf.mjs.map +0 -1
- package/dist/IndentPlugin.native-CbFugPoi.mjs +0 -133
- package/dist/IndentPlugin.native-CbFugPoi.mjs.map +0 -1
- package/dist/ItalicPlugin.native-CQjjDyUL.mjs.map +0 -1
- package/dist/LineHeightPlugin.native-CWQT2FIa.mjs +0 -73
- package/dist/LineHeightPlugin.native-CWQT2FIa.mjs.map +0 -1
- package/dist/LinkPlugin.native-BdAOV-iu.mjs.map +0 -1
- package/dist/ListPlugin.native-CLFU5AUQ.mjs.map +0 -1
- package/dist/MathPlugin.native-DE_ii-LA.mjs +0 -182
- package/dist/MathPlugin.native-DE_ii-LA.mjs.map +0 -1
- package/dist/MediaManagerPlugin.native-DaYFDzNM.mjs +0 -533
- package/dist/MediaManagerPlugin.native-DaYFDzNM.mjs.map +0 -1
- package/dist/MergeTagPlugin.native-CrxyThyn.mjs +0 -178
- package/dist/MergeTagPlugin.native-CrxyThyn.mjs.map +0 -1
- package/dist/PageBreakPlugin.native-DDjcDyRW.mjs +0 -172
- package/dist/PageBreakPlugin.native-DDjcDyRW.mjs.map +0 -1
- package/dist/PreviewPlugin.native-DBvfpmIv.mjs.map +0 -1
- package/dist/PrintPlugin.native-BUpm52VJ.mjs.map +0 -1
- package/dist/SpecialCharactersPlugin.native-x7a2SWXc.mjs.map +0 -1
- package/dist/SpellCheckPlugin.native-B7yTh0iE.mjs +0 -465
- package/dist/SpellCheckPlugin.native-B7yTh0iE.mjs.map +0 -1
- package/dist/StrikethroughPlugin.native-ChaZLaXw.mjs +0 -43
- package/dist/StrikethroughPlugin.native-ChaZLaXw.mjs.map +0 -1
- package/dist/TablePlugin.native-EEWXn1-s.mjs.map +0 -1
- package/dist/TemplatePlugin.native-BlSn1c9h.mjs +0 -564
- package/dist/TemplatePlugin.native-BlSn1c9h.mjs.map +0 -1
- package/dist/TextAlignmentPlugin.native-CQIs1m7R.mjs +0 -97
- package/dist/TextAlignmentPlugin.native-CQIs1m7R.mjs.map +0 -1
- package/dist/TextColorPlugin.native-D6SmTglm.mjs.map +0 -1
- package/dist/UnderlinePlugin.native-QpIcK4L2.mjs.map +0 -1
- package/dist/documentManager-irzj9n3V.mjs.map +0 -1
- package/dist/editorContainerHelpers-C7kdWnS0.mjs.map +0 -1
- package/dist/editora.min.js.map +0 -1
- package/dist/editora.umd.js.map +0 -1
- package/dist/index-BF5RBhL9.js +0 -4
- package/dist/index-BF5RBhL9.js.map +0 -1
- package/dist/index-BPsf460l.mjs +0 -1243
- package/dist/index-BPsf460l.mjs.map +0 -1
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.es-CuicffkQ.mjs.map +0 -1
- package/dist/index.esm.js.map +0 -1
- package/dist/plugin-loader.js.map +0 -1
- package/dist/purify.es-CKpwg8Tk.mjs.map +0 -1
- package/dist/webcomponent-core.js.map +0 -1
- package/dist/webcomponent-core.min.js.map +0 -1
- package/dist/webcomponent.cjs.js.map +0 -1
- package/dist/webcomponent.esm.js.map +0 -1
- package/dist/webcomponent.js.map +0 -1
- package/dist/webcomponent.min.js.map +0 -1
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
const g = /* @__PURE__ */ new Set([
|
|
2
|
+
"P",
|
|
3
|
+
"DIV",
|
|
4
|
+
"H1",
|
|
5
|
+
"H2",
|
|
6
|
+
"H3",
|
|
7
|
+
"H4",
|
|
8
|
+
"H5",
|
|
9
|
+
"H6",
|
|
10
|
+
"LI",
|
|
11
|
+
"BLOCKQUOTE",
|
|
12
|
+
"PRE"
|
|
13
|
+
]), l = (e) => g.has(e.tagName) && e.getAttribute("contenteditable") !== "true", h = () => {
|
|
14
|
+
const e = window.getSelection();
|
|
15
|
+
if (e && e.rangeCount > 0) {
|
|
16
|
+
let t = e.getRangeAt(0).startContainer;
|
|
17
|
+
for (; t && t !== document.body; ) {
|
|
18
|
+
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
19
|
+
const r = t;
|
|
20
|
+
if (r.getAttribute("contenteditable") === "true")
|
|
21
|
+
return r;
|
|
22
|
+
}
|
|
23
|
+
t = t.parentNode;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const n = document.activeElement;
|
|
27
|
+
if (n) {
|
|
28
|
+
if (n.getAttribute("contenteditable") === "true")
|
|
29
|
+
return n;
|
|
30
|
+
const t = n.closest('[contenteditable="true"]');
|
|
31
|
+
if (t) return t;
|
|
32
|
+
}
|
|
33
|
+
return document.querySelector('[contenteditable="true"]');
|
|
34
|
+
}, u = (e) => {
|
|
35
|
+
let n = e;
|
|
36
|
+
for (; n && n !== document.body; ) {
|
|
37
|
+
if (n.nodeType === Node.ELEMENT_NODE) {
|
|
38
|
+
const t = n;
|
|
39
|
+
if (l(t)) return t;
|
|
40
|
+
if (t.getAttribute("contenteditable") === "true") break;
|
|
41
|
+
}
|
|
42
|
+
n = n.parentNode;
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}, C = (e, n) => {
|
|
46
|
+
const t = [], r = /* @__PURE__ */ new Set(), i = (o) => {
|
|
47
|
+
!o || r.has(o) || n.contains(o) && l(o) && (r.add(o), t.push(o));
|
|
48
|
+
};
|
|
49
|
+
if (e.collapsed)
|
|
50
|
+
return i(u(e.startContainer)), t;
|
|
51
|
+
const s = document.createTreeWalker(
|
|
52
|
+
n,
|
|
53
|
+
NodeFilter.SHOW_ELEMENT,
|
|
54
|
+
{
|
|
55
|
+
acceptNode: (o) => {
|
|
56
|
+
const d = o;
|
|
57
|
+
if (!l(d)) return NodeFilter.FILTER_SKIP;
|
|
58
|
+
if (typeof e.intersectsNode == "function")
|
|
59
|
+
return e.intersectsNode(d) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
60
|
+
const a = document.createRange();
|
|
61
|
+
return a.selectNodeContents(d), e.compareBoundaryPoints(Range.END_TO_START, a) > 0 && e.compareBoundaryPoints(Range.START_TO_END, a) < 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
let c = s.nextNode();
|
|
66
|
+
for (; c; )
|
|
67
|
+
i(c), c = s.nextNode();
|
|
68
|
+
return t.length === 0 && i(u(e.commonAncestorContainer)), t;
|
|
69
|
+
}, T = (e, n) => {
|
|
70
|
+
if (n === e.innerHTML) return;
|
|
71
|
+
const t = window.execEditorCommand || window.executeEditorCommand;
|
|
72
|
+
if (typeof t == "function")
|
|
73
|
+
try {
|
|
74
|
+
t("recordDomTransaction", e, n, e.innerHTML);
|
|
75
|
+
} catch (r) {
|
|
76
|
+
}
|
|
77
|
+
}, f = (e) => {
|
|
78
|
+
const n = h();
|
|
79
|
+
if (!n) return !1;
|
|
80
|
+
const t = window.getSelection();
|
|
81
|
+
if (!t || t.rangeCount === 0) return !1;
|
|
82
|
+
const r = t.getRangeAt(0);
|
|
83
|
+
if (!n.contains(r.commonAncestorContainer)) return !1;
|
|
84
|
+
const i = C(r, n);
|
|
85
|
+
if (i.length === 0) return !1;
|
|
86
|
+
const s = n.innerHTML;
|
|
87
|
+
return i.forEach((c) => {
|
|
88
|
+
e === "rtl" ? c.setAttribute("dir", "rtl") : c.removeAttribute("dir");
|
|
89
|
+
}), T(n, s), n.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
|
|
90
|
+
}, E = () => ({
|
|
91
|
+
name: "direction",
|
|
92
|
+
toolbar: [
|
|
93
|
+
{
|
|
94
|
+
label: "Left to Right",
|
|
95
|
+
command: "setDirectionLTR",
|
|
96
|
+
icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M21 18H3M21 18L18 21M21 18L18 15M13 3V12M13 3H7M13 3C13.4596 3 13.9148 3.0776 14.3394 3.22836C14.764 3.37913 15.1499 3.6001 15.4749 3.87868C15.7999 4.15726 16.0577 4.48797 16.2336 4.85195C16.4095 5.21593 16.5 5.60603 16.5 6C16.5 6.39397 16.4095 6.78407 16.2336 7.14805C16.0577 7.51203 15.7999 7.84274 15.4749 8.12132C15.1499 8.3999 14.764 8.62087 14.3394 8.77164C13.9148 8.9224 13.4596 9 13 9V3ZM9 3V12" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',
|
|
97
|
+
shortcut: "Mod-Shift-l"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: "Right to Left",
|
|
101
|
+
command: "setDirectionRTL",
|
|
102
|
+
icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M3 18H21M3 18L6 21M3 18L6 15M11 12V3H17M15 3V12M10.5 3C10.0404 3 9.58525 3.0776 9.16061 3.22836C8.73597 3.37913 8.35013 3.6001 8.02513 3.87868C7.70012 4.15726 7.44231 4.48797 7.26642 4.85195C7.09053 5.21593 7 5.60603 7 6C7 6.39397 7.09053 6.78407 7.26642 7.14805C7.44231 7.51203 7.70012 7.84274 8.02513 8.12132C8.35013 8.3999 8.73597 8.62087 9.16061 8.77164C9.58525 8.9224 10.0404 9 10.5 9L10.5 3Z" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',
|
|
103
|
+
shortcut: "Mod-Shift-r"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
commands: {
|
|
107
|
+
setDirectionLTR: () => {
|
|
108
|
+
try {
|
|
109
|
+
return f(null);
|
|
110
|
+
} catch (e) {
|
|
111
|
+
return console.error("Failed to set LTR direction:", e), !1;
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
setDirectionRTL: () => {
|
|
115
|
+
try {
|
|
116
|
+
return f("rtl");
|
|
117
|
+
} catch (e) {
|
|
118
|
+
return console.error("Failed to set RTL direction:", e), !1;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
keymap: {
|
|
123
|
+
"Mod-Shift-l": "setDirectionLTR",
|
|
124
|
+
"Mod-Shift-r": "setDirectionRTL"
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
export {
|
|
128
|
+
E as DirectionPlugin
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=DirectionPlugin.native-CDnbdNyl.mjs.map
|
package/dist/{EmbedIframePlugin.native-ifr9KLdN.mjs → EmbedIframePlugin.native-CSWIB1jm.mjs}
RENAMED
|
@@ -4,7 +4,7 @@ const D = [
|
|
|
4
4
|
{ label: "Responsive - 16x9", value: "16x9" },
|
|
5
5
|
{ label: "Responsive - 4x3", value: "4x3" },
|
|
6
6
|
{ label: "Responsive - 1x1", value: "1x1" }
|
|
7
|
-
],
|
|
7
|
+
], u = '[data-theme="dark"], .dark, .editora-theme-dark', h = /* @__PURE__ */ new WeakMap(), s = (e) => (h.has(e) || h.set(e, {
|
|
8
8
|
dialogElement: null,
|
|
9
9
|
activeTab: "general",
|
|
10
10
|
formData: {
|
|
@@ -20,7 +20,14 @@ const D = [
|
|
|
20
20
|
showBorder: !0,
|
|
21
21
|
enableScrollbar: !0
|
|
22
22
|
}
|
|
23
|
-
}),
|
|
23
|
+
}), h.get(e));
|
|
24
|
+
function q(e) {
|
|
25
|
+
if (e != null && e.matches(u) || e != null && e.closest(u))
|
|
26
|
+
return !0;
|
|
27
|
+
const t = document.activeElement;
|
|
28
|
+
return t != null && t.closest(u) ? !0 : document.body.matches(u) || document.documentElement.matches(u);
|
|
29
|
+
}
|
|
30
|
+
const H = () => ({
|
|
24
31
|
name: "embedIframe",
|
|
25
32
|
toolbar: [
|
|
26
33
|
{
|
|
@@ -32,13 +39,13 @@ const D = [
|
|
|
32
39
|
}
|
|
33
40
|
],
|
|
34
41
|
commands: {
|
|
35
|
-
openEmbedIframeDialog: (e) => (
|
|
42
|
+
openEmbedIframeDialog: (e) => (C(e), !0)
|
|
36
43
|
},
|
|
37
44
|
keymap: {
|
|
38
45
|
"Mod-Shift-e": "openEmbedIframeDialog"
|
|
39
46
|
}
|
|
40
47
|
});
|
|
41
|
-
function
|
|
48
|
+
function C(e) {
|
|
42
49
|
if (!e) {
|
|
43
50
|
const o = document.activeElement;
|
|
44
51
|
o && o.closest("[data-editora-editor]") && (e = o.closest("[data-editora-editor]"));
|
|
@@ -47,7 +54,7 @@ function k(e) {
|
|
|
47
54
|
console.warn("Editor element not found");
|
|
48
55
|
return;
|
|
49
56
|
}
|
|
50
|
-
const t =
|
|
57
|
+
const t = s(e);
|
|
51
58
|
t.formData = {
|
|
52
59
|
src: "",
|
|
53
60
|
selectedSize: "inline",
|
|
@@ -62,7 +69,7 @@ function k(e) {
|
|
|
62
69
|
enableScrollbar: !0
|
|
63
70
|
}, t.activeTab = "general";
|
|
64
71
|
const a = document.createElement("div");
|
|
65
|
-
a.className = "rte-dialog-overlay", a.onclick =
|
|
72
|
+
a.className = "rte-dialog-overlay rte-embed-iframe-overlay", q(e) && a.classList.add("rte-theme-dark"), a.onclick = () => p(e);
|
|
66
73
|
const r = document.createElement("div");
|
|
67
74
|
r.className = "rte-dialog-content embed-iframe-dialog", r.onclick = (o) => o.stopPropagation(), r.innerHTML = `
|
|
68
75
|
<div class="rte-dialog-header">
|
|
@@ -138,40 +145,40 @@ function k(e) {
|
|
|
138
145
|
<button type="button" class="rte-btn rte-btn-secondary" id="cancel-btn">Cancel</button>
|
|
139
146
|
<button type="submit" class="rte-btn rte-btn-primary" id="save-btn">Save</button>
|
|
140
147
|
</div>
|
|
141
|
-
`, a.appendChild(r), document.body.appendChild(a), t.dialogElement = a,
|
|
148
|
+
`, a.appendChild(r), document.body.appendChild(a), t.dialogElement = a, L(r, e), A(), setTimeout(() => {
|
|
142
149
|
var o;
|
|
143
150
|
(o = r.querySelector("#iframe-src")) == null || o.focus();
|
|
144
151
|
}, 100);
|
|
145
152
|
}
|
|
146
|
-
function
|
|
147
|
-
var l, i, d,
|
|
148
|
-
|
|
149
|
-
n.addEventListener("click", (
|
|
150
|
-
const
|
|
151
|
-
|
|
153
|
+
function L(e, t) {
|
|
154
|
+
var l, i, d, f;
|
|
155
|
+
s(t), (l = e.querySelector(".rte-dialog-close")) == null || l.addEventListener("click", () => p(t)), e.querySelectorAll(".rte-tab-button").forEach((n) => {
|
|
156
|
+
n.addEventListener("click", (m) => {
|
|
157
|
+
const c = m.target.getAttribute("data-tab");
|
|
158
|
+
c && $(e, c, t);
|
|
152
159
|
});
|
|
153
160
|
});
|
|
154
161
|
const a = e.querySelector("#iframe-size");
|
|
155
|
-
a == null || a.addEventListener("change", (n) =>
|
|
162
|
+
a == null || a.addEventListener("change", (n) => z(e, n.target.value, t));
|
|
156
163
|
const r = e.querySelector("#iframe-width"), o = e.querySelector("#iframe-height");
|
|
157
|
-
r == null || r.addEventListener("input", (n) =>
|
|
164
|
+
r == null || r.addEventListener("input", (n) => I(e, n.target.value, t)), o == null || o.addEventListener("input", (n) => R(e, n.target.value, t)), (i = e.querySelector("#constrain-btn")) == null || i.addEventListener("click", () => E(e, t)), (d = e.querySelector("#cancel-btn")) == null || d.addEventListener("click", () => p(t)), (f = e.querySelector("#save-btn")) == null || f.addEventListener("click", () => P(e, t));
|
|
158
165
|
}
|
|
159
|
-
function
|
|
160
|
-
const r =
|
|
166
|
+
function $(e, t, a) {
|
|
167
|
+
const r = s(a);
|
|
161
168
|
r.activeTab = t, e.querySelectorAll(".rte-tab-button").forEach((o) => {
|
|
162
169
|
o.classList.toggle("active", o.getAttribute("data-tab") === t);
|
|
163
170
|
}), e.querySelectorAll(".rte-tab-panel").forEach((o) => {
|
|
164
171
|
o.style.display = o.getAttribute("data-panel") === t ? "block" : "none";
|
|
165
172
|
});
|
|
166
173
|
}
|
|
167
|
-
function
|
|
168
|
-
const r =
|
|
174
|
+
function z(e, t, a) {
|
|
175
|
+
const r = s(a);
|
|
169
176
|
r.formData.selectedSize = t;
|
|
170
177
|
const o = e.querySelector("#dimensions-row"), l = e.querySelector("#iframe-width"), i = e.querySelector("#iframe-height");
|
|
171
178
|
t === "inline" ? (o.style.display = "flex", l.value = "100%", i.value = "400px", r.formData.width = "100%", r.formData.height = "400px") : (o.style.display = "none", r.formData.width = "100%", r.formData.height = "auto");
|
|
172
179
|
}
|
|
173
|
-
function
|
|
174
|
-
const r =
|
|
180
|
+
function I(e, t, a) {
|
|
181
|
+
const r = s(a);
|
|
175
182
|
if (r.formData.width = t, r.formData.constrainProportions && r.formData.selectedSize === "inline") {
|
|
176
183
|
const o = parseFloat(t);
|
|
177
184
|
if (!isNaN(o)) {
|
|
@@ -182,8 +189,8 @@ function C(e, t, a) {
|
|
|
182
189
|
}
|
|
183
190
|
}
|
|
184
191
|
}
|
|
185
|
-
function
|
|
186
|
-
const r =
|
|
192
|
+
function R(e, t, a) {
|
|
193
|
+
const r = s(a);
|
|
187
194
|
if (r.formData.height = t, r.formData.constrainProportions && r.formData.selectedSize === "inline") {
|
|
188
195
|
const o = parseFloat(t);
|
|
189
196
|
if (!isNaN(o)) {
|
|
@@ -194,15 +201,15 @@ function L(e, t, a) {
|
|
|
194
201
|
}
|
|
195
202
|
}
|
|
196
203
|
}
|
|
197
|
-
function
|
|
198
|
-
const a =
|
|
204
|
+
function E(e, t) {
|
|
205
|
+
const a = s(t);
|
|
199
206
|
a.formData.constrainProportions = !a.formData.constrainProportions;
|
|
200
207
|
const r = e.querySelector("#constrain-btn");
|
|
201
208
|
r && (r.textContent = a.formData.constrainProportions ? "🔒" : "🔓", r.className = `rte-constrain-btn ${a.formData.constrainProportions ? "locked" : "unlocked"}`, r.title = a.formData.constrainProportions ? "Unlock proportions" : "Lock proportions");
|
|
202
209
|
}
|
|
203
|
-
function
|
|
204
|
-
var
|
|
205
|
-
const a =
|
|
210
|
+
function P(e, t) {
|
|
211
|
+
var c, b, g, v, x, y, k, w, S;
|
|
212
|
+
const a = s(t), r = (c = e.querySelector("#iframe-src")) == null ? void 0 : c.value.trim();
|
|
206
213
|
if (!r) {
|
|
207
214
|
alert("Please enter a source URL");
|
|
208
215
|
return;
|
|
@@ -211,23 +218,23 @@ function I(e, t) {
|
|
|
211
218
|
alert("Please enter a valid URL starting with https:// or http://");
|
|
212
219
|
return;
|
|
213
220
|
}
|
|
214
|
-
const o = (
|
|
215
|
-
(
|
|
216
|
-
const d = (
|
|
217
|
-
let n = a.formData.width,
|
|
218
|
-
a.formData.selectedSize !== "inline" && (n = "100%",
|
|
221
|
+
const o = (b = e.querySelector("#iframe-name")) == null ? void 0 : b.value.trim(), l = (g = e.querySelector("#iframe-title")) == null ? void 0 : g.value.trim(), i = (v = e.querySelector("#iframe-longdesc")) == null ? void 0 : v.value.trim();
|
|
222
|
+
(x = e.querySelector("#iframe-desc-url")) == null || x.value.trim();
|
|
223
|
+
const d = (k = (y = e.querySelector("#iframe-border")) == null ? void 0 : y.checked) != null ? k : !0, f = (S = (w = e.querySelector("#iframe-scrollbar")) == null ? void 0 : w.checked) != null ? S : !0;
|
|
224
|
+
let n = a.formData.width, m = a.formData.height;
|
|
225
|
+
a.formData.selectedSize !== "inline" && (n = "100%", m = "auto"), T(t, {
|
|
219
226
|
src: r,
|
|
220
227
|
width: n,
|
|
221
|
-
height:
|
|
228
|
+
height: m,
|
|
222
229
|
aspectRatio: a.formData.selectedSize,
|
|
223
230
|
name: o || void 0,
|
|
224
231
|
title: l || void 0,
|
|
225
232
|
longDescription: i || void 0,
|
|
226
233
|
showBorder: d,
|
|
227
|
-
enableScrollbar:
|
|
228
|
-
}),
|
|
234
|
+
enableScrollbar: f
|
|
235
|
+
}), p(t);
|
|
229
236
|
}
|
|
230
|
-
function
|
|
237
|
+
function T(e, t) {
|
|
231
238
|
const a = e.querySelector('[contenteditable="true"]');
|
|
232
239
|
a && (a.focus(), setTimeout(() => {
|
|
233
240
|
const r = [
|
|
@@ -245,23 +252,23 @@ function P(e, t) {
|
|
|
245
252
|
if (!document.execCommand("insertHTML", !1, d)) {
|
|
246
253
|
const n = window.getSelection();
|
|
247
254
|
if (n && n.rangeCount > 0) {
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
for (;
|
|
254
|
-
|
|
255
|
-
|
|
255
|
+
const m = n.getRangeAt(0);
|
|
256
|
+
m.deleteContents();
|
|
257
|
+
const c = document.createElement("div");
|
|
258
|
+
c.innerHTML = d;
|
|
259
|
+
const b = document.createDocumentFragment();
|
|
260
|
+
for (; c.firstChild; )
|
|
261
|
+
b.appendChild(c.firstChild);
|
|
262
|
+
m.insertNode(b);
|
|
256
263
|
}
|
|
257
264
|
}
|
|
258
265
|
}, 10));
|
|
259
266
|
}
|
|
260
|
-
function
|
|
261
|
-
const t =
|
|
267
|
+
function p(e) {
|
|
268
|
+
const t = s(e);
|
|
262
269
|
t.dialogElement && (document.body.removeChild(t.dialogElement), t.dialogElement = null);
|
|
263
270
|
}
|
|
264
|
-
function
|
|
271
|
+
function A() {
|
|
265
272
|
if (document.getElementById("embed-iframe-dialog-styles")) return;
|
|
266
273
|
const e = document.createElement("style");
|
|
267
274
|
e.id = "embed-iframe-dialog-styles", e.textContent = `
|
|
@@ -331,6 +338,7 @@ function R() {
|
|
|
331
338
|
}
|
|
332
339
|
|
|
333
340
|
.rte-form-textarea,
|
|
341
|
+
.rte-form-input,
|
|
334
342
|
.rte-form-select {
|
|
335
343
|
width: 100%;
|
|
336
344
|
padding: 8px 12px;
|
|
@@ -342,6 +350,7 @@ function R() {
|
|
|
342
350
|
}
|
|
343
351
|
|
|
344
352
|
.rte-form-textarea:focus,
|
|
353
|
+
.rte-form-input:focus,
|
|
345
354
|
.rte-form-select:focus {
|
|
346
355
|
outline: none;
|
|
347
356
|
border-color: #0066cc;
|
|
@@ -415,6 +424,101 @@ function R() {
|
|
|
415
424
|
color: #000;
|
|
416
425
|
}
|
|
417
426
|
|
|
427
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-dialog-content {
|
|
428
|
+
background: #1f2937;
|
|
429
|
+
border: 1px solid #4b5563;
|
|
430
|
+
color: #e2e8f0;
|
|
431
|
+
box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-dialog-header,
|
|
435
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-dialog-footer {
|
|
436
|
+
background: #222d3a;
|
|
437
|
+
border-color: #3b4657;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-dialog-header h3,
|
|
441
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-form-label,
|
|
442
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-checkbox-label {
|
|
443
|
+
color: #e2e8f0;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-tab-buttons {
|
|
447
|
+
border-right-color: #3b4657;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-tab-button {
|
|
451
|
+
color: #a8b5c8;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-tab-button:hover {
|
|
455
|
+
background: #334155;
|
|
456
|
+
color: #f8fafc;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-tab-button.active {
|
|
460
|
+
background: rgba(88, 166, 255, 0.18);
|
|
461
|
+
color: #8cc6ff;
|
|
462
|
+
border-right-color: #58a6ff;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-form-input,
|
|
466
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-form-select,
|
|
467
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-form-textarea {
|
|
468
|
+
background: #111827;
|
|
469
|
+
border-color: #4b5563;
|
|
470
|
+
color: #e2e8f0;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-form-input::placeholder,
|
|
474
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-form-textarea::placeholder {
|
|
475
|
+
color: #94a3b8;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-form-input:focus,
|
|
479
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-form-select:focus,
|
|
480
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-form-textarea:focus {
|
|
481
|
+
border-color: #58a6ff;
|
|
482
|
+
box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.28);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-constrain-btn {
|
|
486
|
+
background: #111827;
|
|
487
|
+
border-color: #4b5563;
|
|
488
|
+
color: #e2e8f0;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-constrain-btn:hover {
|
|
492
|
+
background: #334155;
|
|
493
|
+
border-color: #58a6ff;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-constrain-btn.locked {
|
|
497
|
+
background: rgba(88, 166, 255, 0.22);
|
|
498
|
+
border-color: #58a6ff;
|
|
499
|
+
color: #d9ecff;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-btn-secondary {
|
|
503
|
+
background: #334155;
|
|
504
|
+
border-color: #4b5563;
|
|
505
|
+
color: #e2e8f0;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-btn-secondary:hover {
|
|
509
|
+
background: #475569;
|
|
510
|
+
border-color: #64748b;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-btn-primary {
|
|
514
|
+
background: #3b82f6;
|
|
515
|
+
color: #fff;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-btn-primary:hover {
|
|
519
|
+
background: #2563eb;
|
|
520
|
+
}
|
|
521
|
+
|
|
418
522
|
/* Responsive iframe classes */
|
|
419
523
|
.rte-iframe-21x9,
|
|
420
524
|
.rte-iframe-16x9,
|
|
@@ -456,6 +560,6 @@ function R() {
|
|
|
456
560
|
`, document.head.appendChild(e);
|
|
457
561
|
}
|
|
458
562
|
export {
|
|
459
|
-
|
|
563
|
+
H as EmbedIframePlugin
|
|
460
564
|
};
|
|
461
|
-
//# sourceMappingURL=EmbedIframePlugin.native-
|
|
565
|
+
//# sourceMappingURL=EmbedIframePlugin.native-CSWIB1jm.mjs.map
|