@editora/core 1.0.8 → 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.
- package/README.md +6 -1
- package/dist/{ApprovalWorkflowPlugin.native-C3jtAYjG.mjs → ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs} +136 -133
- package/dist/BlockquotePlugin.native-57_Xcjl1.mjs +212 -0
- package/dist/{BlocksLibraryPlugin.native-HMWKxWNs.mjs → BlocksLibraryPlugin.native-5sdsXsiE.mjs} +90 -87
- package/dist/{BoldPlugin.native-BAzzoqU5.mjs → BoldPlugin.native-CSh_LiIJ.mjs} +11 -7
- package/dist/CapitalizationPlugin.native-DLV4oPmB.mjs +159 -0
- package/dist/ChecklistPlugin.native-BS-kMz9O.mjs +371 -0
- package/dist/{CitationsPlugin.native-BnU0qCwR.mjs → CitationsPlugin.native-DQgoCd1B.mjs} +132 -129
- package/dist/ClearFormattingPlugin.native-DIS6AN2t.mjs +172 -0
- package/dist/CodePlugin.native-C5l1IeSS.mjs +4570 -0
- package/dist/{ContentRulesPlugin.native-nBLQ8QFZ.mjs → ContentRulesPlugin.native-vPx5nC73.mjs} +105 -102
- package/dist/{DataBindingPlugin.native-jQ1JPRTp.mjs → DataBindingPlugin.native-BoXwghTz.mjs} +49 -46
- package/dist/DirectionPlugin.native-Bl-QLFzO.mjs +153 -0
- package/dist/{DocSchemaPlugin.native-CHOge18O.mjs → DocSchemaPlugin.native-DUSVRHqT.mjs} +55 -52
- package/dist/{EmbedIframePlugin.native-DKJx2OS7.mjs → EmbedIframePlugin.native-BF_-LjTq.mjs} +287 -115
- package/dist/HeadingPlugin.native-DZdvubrQ.mjs +249 -0
- package/dist/{HistoryPlugin.native-TDnVMsEO.mjs → HistoryPlugin.native-D2wl32jV.mjs} +88 -103
- package/dist/{ItalicPlugin.native-CQjjDyUL.mjs → ItalicPlugin.native-CmnlwFHB.mjs} +15 -11
- package/dist/MathPlugin.native-NwWPHVmj.mjs +369 -0
- package/dist/{MediaManagerPlugin.native-BiXiK8FC.mjs → MediaManagerPlugin.native-eOsTJFpw.mjs} +204 -202
- package/dist/MergeTagPlugin.native-BzRVoD9-.mjs +580 -0
- package/dist/{PIIRedactionPlugin.native-DcsjmtV1.mjs → PIIRedactionPlugin.native-g7j4jOmm.mjs} +158 -155
- package/dist/{SlashCommandsPlugin.native-CmxvMEaE.mjs → SlashCommandsPlugin.native-BiN6ODw5.mjs} +2 -2
- package/dist/{SmartPastePlugin.native-BOKKtF07.mjs → SmartPastePlugin.native-CZAEHkyt.mjs} +127 -124
- package/dist/{SpecialCharactersPlugin.native-CZDato89.mjs → SpecialCharactersPlugin.native-DaG4b19I.mjs} +100 -76
- package/dist/{StrikethroughPlugin.native-0Be7j49s.mjs → StrikethroughPlugin.native-V0TL4F48.mjs} +12 -26
- package/dist/TemplatePlugin.native-DLjFUaPW.mjs +1150 -0
- package/dist/{TranslationWorkflowPlugin.native-Bz6jDGvj.mjs → TranslationWorkflowPlugin.native-DdF16tgT.mjs} +104 -101
- package/dist/{UnderlinePlugin.native-QpIcK4L2.mjs → UnderlinePlugin.native-DZzg23rv.mjs} +8 -4
- package/dist/editora.min.js +1 -1
- package/dist/editora.umd.js +1 -1
- package/dist/index-CPMGUZfB.js +10 -0
- package/dist/{index-DqC57IEH.mjs → index-DBoj6QfW.mjs} +17 -15
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/inlineFormatting-DJ0-NZtx.mjs +97 -0
- package/dist/plugin-loader.js +37 -37
- package/dist/webcomponent-core.js +18 -16
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +139 -62
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +50 -48
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1174 -1071
- package/package.json +11 -5
- package/LICENSE +0 -21
- package/dist/BlockquotePlugin.native-JFmOLsxN.mjs +0 -48
- package/dist/CapitalizationPlugin.native-DOMsh5R7.mjs +0 -79
- package/dist/ChecklistPlugin.native-nuSSEFNI.mjs +0 -309
- package/dist/ClearFormattingPlugin.native-Bq_XcTh2.mjs +0 -140
- package/dist/CodePlugin.native-DlpTPdkd.mjs +0 -2691
- package/dist/DirectionPlugin.native-CDnbdNyl.mjs +0 -130
- package/dist/HeadingPlugin.native-DrLYwQnQ.mjs +0 -64
- package/dist/MathPlugin.native-f_mDp8VL.mjs +0 -292
- package/dist/MergeTagPlugin.native-C3eOfEgw.mjs +0 -559
- package/dist/TemplatePlugin.native-CrpfKRJ8.mjs +0 -602
- package/dist/index-D1LOqg5C.js +0 -10
package/dist/{EmbedIframePlugin.native-DKJx2OS7.mjs → EmbedIframePlugin.native-BF_-LjTq.mjs}
RENAMED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
const
|
|
1
|
+
const q = [
|
|
2
2
|
{ label: "Inline Value", value: "inline" },
|
|
3
3
|
{ label: "Responsive - 21x9", value: "21x9" },
|
|
4
4
|
{ label: "Responsive - 16x9", value: "16x9" },
|
|
5
5
|
{ label: "Responsive - 4x3", value: "4x3" },
|
|
6
6
|
{ label: "Responsive - 1x1", value: "1x1" }
|
|
7
|
-
],
|
|
7
|
+
], p = '[data-theme="dark"], .dark, .editora-theme-dark';
|
|
8
|
+
let c = null;
|
|
9
|
+
const y = /* @__PURE__ */ new WeakMap(), d = (e) => (y.has(e) || y.set(e, {
|
|
8
10
|
dialogElement: null,
|
|
9
11
|
escapeHandler: null,
|
|
12
|
+
savedRange: null,
|
|
10
13
|
activeTab: "general",
|
|
11
14
|
formData: {
|
|
12
15
|
src: "",
|
|
@@ -21,15 +24,197 @@ const D = [
|
|
|
21
24
|
showBorder: !0,
|
|
22
25
|
enableScrollbar: !0
|
|
23
26
|
}
|
|
24
|
-
}),
|
|
25
|
-
function
|
|
26
|
-
if (e != null && e.matches(
|
|
27
|
+
}), y.get(e));
|
|
28
|
+
function A(e) {
|
|
29
|
+
if (e != null && e.matches(p) || e != null && e.closest(p))
|
|
27
30
|
return !0;
|
|
28
31
|
const t = document.activeElement;
|
|
29
|
-
return t != null && t.closest(
|
|
32
|
+
return t != null && t.closest(p) ? !0 : document.body.matches(p) || document.documentElement.matches(p);
|
|
30
33
|
}
|
|
31
|
-
|
|
34
|
+
function T(e) {
|
|
35
|
+
return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
|
|
36
|
+
}
|
|
37
|
+
function M(e) {
|
|
38
|
+
const t = e == null ? void 0 : e.editorElement;
|
|
39
|
+
if (t instanceof HTMLElement) return t;
|
|
40
|
+
const r = e == null ? void 0 : e.contentElement;
|
|
41
|
+
if (r instanceof HTMLElement) {
|
|
42
|
+
const i = r.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor");
|
|
43
|
+
return i instanceof HTMLElement ? i : r;
|
|
44
|
+
}
|
|
45
|
+
const o = window.__editoraCommandEditorRoot;
|
|
46
|
+
if (o instanceof HTMLElement) return o;
|
|
47
|
+
const n = window.getSelection();
|
|
48
|
+
if (n && n.rangeCount > 0) {
|
|
49
|
+
const i = T(n.getRangeAt(0).startContainer), l = i == null ? void 0 : i.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor");
|
|
50
|
+
if (l instanceof HTMLElement) return l;
|
|
51
|
+
}
|
|
52
|
+
const a = document.activeElement;
|
|
53
|
+
if (a instanceof HTMLElement) {
|
|
54
|
+
const i = a.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor");
|
|
55
|
+
if (i instanceof HTMLElement) return i;
|
|
56
|
+
}
|
|
57
|
+
return document.querySelector("[data-editora-editor], .rte-editor, .editora-editor, editora-editor");
|
|
58
|
+
}
|
|
59
|
+
function I(e) {
|
|
60
|
+
return e.getAttribute("contenteditable") === "true" ? e : e.querySelector('.rte-content, .editora-content, [contenteditable="true"]');
|
|
61
|
+
}
|
|
62
|
+
function v(e) {
|
|
63
|
+
const t = T(e);
|
|
64
|
+
return t == null ? void 0 : t.closest('.rte-content, .editora-content, [contenteditable="true"]');
|
|
65
|
+
}
|
|
66
|
+
function j(e) {
|
|
67
|
+
const t = window.getSelection();
|
|
68
|
+
if (!t || t.rangeCount === 0) return null;
|
|
69
|
+
const r = t.getRangeAt(0);
|
|
70
|
+
return !e.contains(r.startContainer) || !e.contains(r.endContainer) ? null : r.cloneRange();
|
|
71
|
+
}
|
|
72
|
+
function H(e, t, r) {
|
|
73
|
+
if (t !== r) {
|
|
74
|
+
if (typeof window.execEditorCommand == "function") {
|
|
75
|
+
window.execEditorCommand("recordDomTransaction", e, t, r);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (typeof window.executeEditorCommand == "function")
|
|
79
|
+
try {
|
|
80
|
+
window.executeEditorCommand("recordDomTransaction", { editor: e, beforeHTML: t, afterHTML: r });
|
|
81
|
+
} catch (o) {
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function z(e, t) {
|
|
86
|
+
let r = t;
|
|
87
|
+
for (; r && r.parentNode && r.parentNode !== e; )
|
|
88
|
+
r = r.parentNode;
|
|
89
|
+
return r && r.parentNode === e ? r : null;
|
|
90
|
+
}
|
|
91
|
+
function L(e, t) {
|
|
92
|
+
return e.tagName !== "P" ? !1 : Array.from(e.childNodes).every((r) => {
|
|
93
|
+
var o;
|
|
94
|
+
return r === t ? !0 : r.nodeType === Node.ELEMENT_NODE ? r.tagName === "BR" : r.nodeType === Node.TEXT_NODE && !((o = r.textContent) != null && o.trim());
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function P(e) {
|
|
98
|
+
if (!(e instanceof Element)) return null;
|
|
99
|
+
const t = e.closest("iframe");
|
|
100
|
+
if (t instanceof HTMLIFrameElement) {
|
|
101
|
+
const a = v(t);
|
|
102
|
+
if (!a) return null;
|
|
103
|
+
const i = t.parentElement;
|
|
104
|
+
return i && i.parentElement === a && L(i, t) ? i : t;
|
|
105
|
+
}
|
|
106
|
+
const r = e.closest("p");
|
|
107
|
+
if (!(r instanceof HTMLElement)) return null;
|
|
108
|
+
const o = v(r);
|
|
109
|
+
if (!o || r.parentElement !== o) return null;
|
|
110
|
+
const n = Array.from(r.children).find(
|
|
111
|
+
(a) => a instanceof HTMLIFrameElement
|
|
112
|
+
);
|
|
113
|
+
return n && L(r, n) ? r : null;
|
|
114
|
+
}
|
|
115
|
+
function b() {
|
|
116
|
+
var e;
|
|
117
|
+
c && (c.classList.remove("rte-selected-embed-object"), (e = c.querySelector("iframe")) == null || e.removeAttribute("data-rte-selected-object"), c instanceof HTMLIFrameElement && c.removeAttribute("data-rte-selected-object"), c = null);
|
|
118
|
+
}
|
|
119
|
+
function O(e) {
|
|
120
|
+
if (c === e) return;
|
|
121
|
+
b(), c = e, e.classList.add("rte-selected-embed-object");
|
|
122
|
+
const t = e instanceof HTMLIFrameElement ? e : e.querySelector("iframe");
|
|
123
|
+
t == null || t.setAttribute("data-rte-selected-object", "true");
|
|
124
|
+
const r = window.getSelection();
|
|
125
|
+
if (!r) return;
|
|
126
|
+
const o = document.createRange();
|
|
127
|
+
o.selectNode(e), r.removeAllRanges(), r.addRange(o);
|
|
128
|
+
}
|
|
129
|
+
function B(e, t) {
|
|
130
|
+
const r = window.getSelection();
|
|
131
|
+
if (!r) return;
|
|
132
|
+
const o = document.createRange();
|
|
133
|
+
t && t.parentNode === e ? o.setStartBefore(t) : (o.selectNodeContents(e), o.collapse(!1)), o.collapse(!0), r.removeAllRanges(), r.addRange(o);
|
|
134
|
+
}
|
|
135
|
+
function U(e) {
|
|
136
|
+
if (e.childNodes.length > 0) return;
|
|
137
|
+
const t = document.createElement("p");
|
|
138
|
+
t.appendChild(document.createElement("br")), e.appendChild(t);
|
|
139
|
+
}
|
|
140
|
+
function _() {
|
|
141
|
+
if (!c || !c.isConnected)
|
|
142
|
+
return b(), !1;
|
|
143
|
+
const e = c, t = v(e);
|
|
144
|
+
if (!t)
|
|
145
|
+
return b(), !1;
|
|
146
|
+
const r = t.innerHTML, o = e.nextSibling;
|
|
147
|
+
e.remove(), U(t), b(), B(t, o);
|
|
148
|
+
const n = t.innerHTML;
|
|
149
|
+
return H(t, r, n), t.dispatchEvent(new window.Event("input", { bubbles: !0 })), r !== n;
|
|
150
|
+
}
|
|
151
|
+
function N() {
|
|
152
|
+
if (document.getElementById("embed-iframe-object-selection-styles")) return;
|
|
153
|
+
const e = document.createElement("style");
|
|
154
|
+
e.id = "embed-iframe-object-selection-styles", e.textContent = `
|
|
155
|
+
.rte-selected-embed-object {
|
|
156
|
+
outline: 2px solid #2563eb;
|
|
157
|
+
outline-offset: 3px;
|
|
158
|
+
border-radius: 4px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.rte-content iframe,
|
|
162
|
+
.editora-content iframe,
|
|
163
|
+
[contenteditable="true"] iframe {
|
|
164
|
+
pointer-events: none;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.rte-selected-embed-object iframe,
|
|
168
|
+
iframe.rte-selected-embed-object {
|
|
169
|
+
box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.28);
|
|
170
|
+
}
|
|
171
|
+
`, document.head.appendChild(e);
|
|
172
|
+
}
|
|
173
|
+
function $() {
|
|
174
|
+
typeof window == "undefined" || window.__embedIframeObjectSelectionInitialized || (window.__embedIframeObjectSelectionInitialized = !0, N(), document.addEventListener("pointerdown", (e) => {
|
|
175
|
+
var r, o;
|
|
176
|
+
const t = P(e.target);
|
|
177
|
+
if (!t) {
|
|
178
|
+
const n = e.target;
|
|
179
|
+
(r = n == null ? void 0 : n.closest) != null && r.call(n, ".rte-embed-iframe-overlay") || b();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
e.preventDefault(), (o = v(t)) == null || o.focus(), O(t);
|
|
183
|
+
}, !0), document.addEventListener("keydown", (e) => {
|
|
184
|
+
if (c) {
|
|
185
|
+
if (e.key === "Escape") {
|
|
186
|
+
b();
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
e.key !== "Backspace" && e.key !== "Delete" || (e.preventDefault(), e.stopPropagation(), _());
|
|
190
|
+
}
|
|
191
|
+
}, !0));
|
|
192
|
+
}
|
|
193
|
+
function F(e) {
|
|
194
|
+
try {
|
|
195
|
+
const t = new URL(e), r = t.hostname.replace(/^www\./, "");
|
|
196
|
+
if (r === "youtu.be") {
|
|
197
|
+
const o = t.pathname.split("/").filter(Boolean)[0];
|
|
198
|
+
if (o) return `https://www.youtube.com/embed/${encodeURIComponent(o)}`;
|
|
199
|
+
}
|
|
200
|
+
if (r === "youtube.com" || r === "m.youtube.com") {
|
|
201
|
+
const o = t.searchParams.get("v");
|
|
202
|
+
if (o) return `https://www.youtube.com/embed/${encodeURIComponent(o)}`;
|
|
203
|
+
const n = t.pathname.match(/^\/embed\/([^/]+)/);
|
|
204
|
+
if (n != null && n[1]) return `https://www.youtube.com/embed/${encodeURIComponent(n[1])}`;
|
|
205
|
+
}
|
|
206
|
+
if (r === "vimeo.com") {
|
|
207
|
+
const o = t.pathname.split("/").filter(Boolean)[0];
|
|
208
|
+
if (o && /^\d+$/.test(o)) return `https://player.vimeo.com/video/${o}`;
|
|
209
|
+
}
|
|
210
|
+
return e;
|
|
211
|
+
} catch (t) {
|
|
212
|
+
return e;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
const te = () => ({
|
|
32
216
|
name: "embedIframe",
|
|
217
|
+
init: $,
|
|
33
218
|
toolbar: [
|
|
34
219
|
{
|
|
35
220
|
label: "Embed Content",
|
|
@@ -40,13 +225,13 @@ const A = () => ({
|
|
|
40
225
|
}
|
|
41
226
|
],
|
|
42
227
|
commands: {
|
|
43
|
-
openEmbedIframeDialog: (e) => (
|
|
228
|
+
openEmbedIframeDialog: (e, t) => (Z(M(t) || void 0), !0)
|
|
44
229
|
},
|
|
45
230
|
keymap: {
|
|
46
231
|
"Mod-Shift-e": "openEmbedIframeDialog"
|
|
47
232
|
}
|
|
48
233
|
});
|
|
49
|
-
function
|
|
234
|
+
function Z(e) {
|
|
50
235
|
if (!e) {
|
|
51
236
|
const a = document.activeElement;
|
|
52
237
|
a && a.closest("[data-editora-editor]") && (e = a.closest("[data-editora-editor]"));
|
|
@@ -55,8 +240,8 @@ function L(e) {
|
|
|
55
240
|
console.warn("Editor element not found");
|
|
56
241
|
return;
|
|
57
242
|
}
|
|
58
|
-
const t =
|
|
59
|
-
t.formData = {
|
|
243
|
+
const t = d(e), r = I(e);
|
|
244
|
+
t.savedRange = r ? j(r) : null, t.formData = {
|
|
60
245
|
src: "",
|
|
61
246
|
selectedSize: "inline",
|
|
62
247
|
width: "100%",
|
|
@@ -70,9 +255,9 @@ function L(e) {
|
|
|
70
255
|
enableScrollbar: !0
|
|
71
256
|
}, t.activeTab = "general";
|
|
72
257
|
const o = document.createElement("div");
|
|
73
|
-
o.className = "rte-dialog-overlay rte-embed-iframe-overlay",
|
|
74
|
-
const
|
|
75
|
-
|
|
258
|
+
o.className = "rte-dialog-overlay rte-embed-iframe-overlay", A(e) && o.classList.add("rte-theme-dark"), o.onclick = () => h(e);
|
|
259
|
+
const n = document.createElement("div");
|
|
260
|
+
n.className = "rte-dialog-content embed-iframe-dialog", n.onclick = (a) => a.stopPropagation(), n.innerHTML = `
|
|
76
261
|
<div class="rte-dialog-header">
|
|
77
262
|
<h3>Embed Iframe</h3>
|
|
78
263
|
<button class="rte-dialog-close">×</button>
|
|
@@ -92,7 +277,7 @@ function L(e) {
|
|
|
92
277
|
<div class="rte-form-group">
|
|
93
278
|
<label class="rte-form-label">Size</label>
|
|
94
279
|
<select class="rte-form-select" id="iframe-size">
|
|
95
|
-
${
|
|
280
|
+
${q.map((a) => `<option value="${a.value}">${a.label}</option>`).join("")}
|
|
96
281
|
</select>
|
|
97
282
|
</div>
|
|
98
283
|
<div class="rte-form-row" id="dimensions-row">
|
|
@@ -146,133 +331,120 @@ function L(e) {
|
|
|
146
331
|
<button type="button" class="rte-btn rte-btn-secondary" id="cancel-btn">Cancel</button>
|
|
147
332
|
<button type="submit" class="rte-btn rte-btn-primary" id="save-btn">Save</button>
|
|
148
333
|
</div>
|
|
149
|
-
`, o.appendChild(
|
|
150
|
-
a.key === "Escape" && (a.preventDefault(), a.stopPropagation(),
|
|
151
|
-
}, document.addEventListener("keydown", t.escapeHandler, !0),
|
|
334
|
+
`, o.appendChild(n), document.body.appendChild(o), t.dialogElement = o, t.escapeHandler = (a) => {
|
|
335
|
+
a.key === "Escape" && (a.preventDefault(), a.stopPropagation(), h(e));
|
|
336
|
+
}, document.addEventListener("keydown", t.escapeHandler, !0), V(n, e), ee(), setTimeout(() => {
|
|
152
337
|
var a;
|
|
153
|
-
(a =
|
|
338
|
+
(a = n.querySelector("#iframe-src")) == null || a.focus();
|
|
154
339
|
}, 100);
|
|
155
340
|
}
|
|
156
|
-
function
|
|
157
|
-
var
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
|
|
341
|
+
function V(e, t) {
|
|
342
|
+
var a, i, l, u;
|
|
343
|
+
d(t), (a = e.querySelector(".rte-dialog-close")) == null || a.addEventListener("click", () => h(t)), e.querySelectorAll(".rte-tab-button").forEach((s) => {
|
|
344
|
+
s.addEventListener("click", (f) => {
|
|
345
|
+
const m = f.target.getAttribute("data-tab");
|
|
346
|
+
m && W(e, m, t);
|
|
162
347
|
});
|
|
163
348
|
});
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
const
|
|
167
|
-
|
|
349
|
+
const r = e.querySelector("#iframe-size");
|
|
350
|
+
r == null || r.addEventListener("change", (s) => G(e, s.target.value, t));
|
|
351
|
+
const o = e.querySelector("#iframe-width"), n = e.querySelector("#iframe-height");
|
|
352
|
+
o == null || o.addEventListener("input", (s) => K(e, s.target.value, t)), n == null || n.addEventListener("input", (s) => X(e, s.target.value, t)), (i = e.querySelector("#constrain-btn")) == null || i.addEventListener("click", () => J(e, t)), (l = e.querySelector("#cancel-btn")) == null || l.addEventListener("click", () => h(t)), (u = e.querySelector("#save-btn")) == null || u.addEventListener("click", () => Q(e, t));
|
|
168
353
|
}
|
|
169
|
-
function
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}), e.querySelectorAll(".rte-tab-panel").forEach((
|
|
174
|
-
|
|
354
|
+
function W(e, t, r) {
|
|
355
|
+
const o = d(r);
|
|
356
|
+
o.activeTab = t, e.querySelectorAll(".rte-tab-button").forEach((n) => {
|
|
357
|
+
n.classList.toggle("active", n.getAttribute("data-tab") === t);
|
|
358
|
+
}), e.querySelectorAll(".rte-tab-panel").forEach((n) => {
|
|
359
|
+
n.style.display = n.getAttribute("data-panel") === t ? "block" : "none";
|
|
175
360
|
});
|
|
176
361
|
}
|
|
177
|
-
function
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
const
|
|
181
|
-
t === "inline" ? (
|
|
362
|
+
function G(e, t, r) {
|
|
363
|
+
const o = d(r);
|
|
364
|
+
o.formData.selectedSize = t;
|
|
365
|
+
const n = e.querySelector("#dimensions-row"), a = e.querySelector("#iframe-width"), i = e.querySelector("#iframe-height");
|
|
366
|
+
t === "inline" ? (n.style.display = "flex", a.value = "100%", i.value = "400px", o.formData.width = "100%", o.formData.height = "400px") : (n.style.display = "none", o.formData.width = "100%", o.formData.height = "auto");
|
|
182
367
|
}
|
|
183
|
-
function
|
|
184
|
-
const
|
|
185
|
-
if (
|
|
186
|
-
const
|
|
187
|
-
if (!isNaN(
|
|
188
|
-
const
|
|
189
|
-
|
|
368
|
+
function K(e, t, r) {
|
|
369
|
+
const o = d(r);
|
|
370
|
+
if (o.formData.width = t, o.formData.constrainProportions && o.formData.selectedSize === "inline") {
|
|
371
|
+
const n = parseFloat(t);
|
|
372
|
+
if (!isNaN(n)) {
|
|
373
|
+
const a = n * 9 / 16;
|
|
374
|
+
o.formData.height = `${a}px`;
|
|
190
375
|
const i = e.querySelector("#iframe-height");
|
|
191
|
-
i && (i.value =
|
|
376
|
+
i && (i.value = o.formData.height);
|
|
192
377
|
}
|
|
193
378
|
}
|
|
194
379
|
}
|
|
195
|
-
function
|
|
196
|
-
const
|
|
197
|
-
if (
|
|
198
|
-
const
|
|
199
|
-
if (!isNaN(
|
|
200
|
-
const
|
|
201
|
-
|
|
380
|
+
function X(e, t, r) {
|
|
381
|
+
const o = d(r);
|
|
382
|
+
if (o.formData.height = t, o.formData.constrainProportions && o.formData.selectedSize === "inline") {
|
|
383
|
+
const n = parseFloat(t);
|
|
384
|
+
if (!isNaN(n)) {
|
|
385
|
+
const a = n * 16 / 9;
|
|
386
|
+
o.formData.width = `${a}px`;
|
|
202
387
|
const i = e.querySelector("#iframe-width");
|
|
203
|
-
i && (i.value =
|
|
388
|
+
i && (i.value = o.formData.width);
|
|
204
389
|
}
|
|
205
390
|
}
|
|
206
391
|
}
|
|
207
|
-
function
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
|
|
392
|
+
function J(e, t) {
|
|
393
|
+
const r = d(t);
|
|
394
|
+
r.formData.constrainProportions = !r.formData.constrainProportions;
|
|
395
|
+
const o = e.querySelector("#constrain-btn");
|
|
396
|
+
o && (o.textContent = r.formData.constrainProportions ? "🔒" : "🔓", o.className = `rte-constrain-btn ${r.formData.constrainProportions ? "locked" : "unlocked"}`, o.title = r.formData.constrainProportions ? "Unlock proportions" : "Lock proportions");
|
|
212
397
|
}
|
|
213
|
-
function
|
|
214
|
-
var
|
|
215
|
-
const
|
|
216
|
-
if (!
|
|
398
|
+
function Q(e, t) {
|
|
399
|
+
var g, x, w, k, S, E, D, C, R;
|
|
400
|
+
const r = d(t), o = (g = e.querySelector("#iframe-src")) == null ? void 0 : g.value.trim();
|
|
401
|
+
if (!o) {
|
|
217
402
|
alert("Please enter a source URL");
|
|
218
403
|
return;
|
|
219
404
|
}
|
|
220
|
-
if (!
|
|
405
|
+
if (!o.startsWith("https://") && !o.startsWith("http://")) {
|
|
221
406
|
alert("Please enter a valid URL starting with https:// or http://");
|
|
222
407
|
return;
|
|
223
408
|
}
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
src: r,
|
|
230
|
-
width: n,
|
|
409
|
+
const n = (x = e.querySelector("#iframe-name")) == null ? void 0 : x.value.trim(), a = (w = e.querySelector("#iframe-title")) == null ? void 0 : w.value.trim(), i = (k = e.querySelector("#iframe-longdesc")) == null ? void 0 : k.value.trim(), l = (S = e.querySelector("#iframe-desc-url")) == null ? void 0 : S.value.trim(), u = (D = (E = e.querySelector("#iframe-border")) == null ? void 0 : E.checked) != null ? D : !0, s = (R = (C = e.querySelector("#iframe-scrollbar")) == null ? void 0 : C.checked) != null ? R : !0;
|
|
410
|
+
let f = r.formData.width, m = r.formData.height;
|
|
411
|
+
r.formData.selectedSize !== "inline" && (f = "100%", m = "auto"), Y(t, {
|
|
412
|
+
src: o,
|
|
413
|
+
width: f,
|
|
231
414
|
height: m,
|
|
232
|
-
aspectRatio:
|
|
233
|
-
name:
|
|
234
|
-
title:
|
|
415
|
+
aspectRatio: r.formData.selectedSize,
|
|
416
|
+
name: n || void 0,
|
|
417
|
+
title: a || void 0,
|
|
235
418
|
longDescription: i || void 0,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
419
|
+
descriptionUrl: l || void 0,
|
|
420
|
+
showBorder: u,
|
|
421
|
+
enableScrollbar: s
|
|
422
|
+
}), h(t);
|
|
239
423
|
}
|
|
240
|
-
function
|
|
241
|
-
const o = e
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
if (n && n.rangeCount > 0) {
|
|
258
|
-
const m = n.getRangeAt(0);
|
|
259
|
-
m.deleteContents();
|
|
260
|
-
const c = document.createElement("div");
|
|
261
|
-
c.innerHTML = d;
|
|
262
|
-
const b = document.createDocumentFragment();
|
|
263
|
-
for (; c.firstChild; )
|
|
264
|
-
b.appendChild(c.firstChild);
|
|
265
|
-
m.insertNode(b);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}, 10));
|
|
424
|
+
function Y(e, t) {
|
|
425
|
+
const r = d(e), o = I(e);
|
|
426
|
+
if (!o) return;
|
|
427
|
+
const n = o.innerHTML, a = document.createElement("iframe");
|
|
428
|
+
a.src = F(t.src), a.width = t.width, a.height = t.height, a.allowFullscreen = !0, a.setAttribute("frameborder", t.showBorder ? "1" : "0"), a.setAttribute("scrolling", t.enableScrollbar ? "auto" : "no"), a.setAttribute("data-aspect-ratio", t.aspectRatio), t.aspectRatio !== "inline" && a.classList.add(`rte-iframe-${t.aspectRatio}`), t.name && (a.name = t.name), t.title && (a.title = t.title), t.longDescription && a.setAttribute("data-long-description", t.longDescription), t.descriptionUrl && a.setAttribute("longdesc", t.descriptionUrl);
|
|
429
|
+
const i = document.createElement("p");
|
|
430
|
+
i.appendChild(a), i.appendChild(document.createElement("br"));
|
|
431
|
+
const l = r.savedRange && o.contains(r.savedRange.commonAncestorContainer) ? r.savedRange : document.createRange();
|
|
432
|
+
(!r.savedRange || !o.contains(r.savedRange.commonAncestorContainer)) && (l.selectNodeContents(o), l.collapse(!1));
|
|
433
|
+
const u = z(o, l.startContainer), s = u ? u.nextSibling : null;
|
|
434
|
+
o.insertBefore(i, s);
|
|
435
|
+
const f = document.createRange();
|
|
436
|
+
f.setStartAfter(i), f.collapse(!0);
|
|
437
|
+
const m = window.getSelection();
|
|
438
|
+
m && (m.removeAllRanges(), m.addRange(f)), r.savedRange = null;
|
|
439
|
+
const g = o.innerHTML;
|
|
440
|
+
H(o, n, g), o.dispatchEvent(new window.Event("input", { bubbles: !0 }));
|
|
269
441
|
}
|
|
270
|
-
function
|
|
271
|
-
const t =
|
|
272
|
-
t.escapeHandler && (document.removeEventListener("keydown", t.escapeHandler, !0), t.escapeHandler = null), t.dialogElement && (t.dialogElement.remove(), t.dialogElement = null);
|
|
442
|
+
function h(e) {
|
|
443
|
+
const t = d(e);
|
|
444
|
+
t.savedRange = null, t.escapeHandler && (document.removeEventListener("keydown", t.escapeHandler, !0), t.escapeHandler = null), t.dialogElement && (t.dialogElement.remove(), t.dialogElement = null);
|
|
273
445
|
}
|
|
274
|
-
function
|
|
275
|
-
if (document.getElementById("embed-iframe-dialog-styles")) return;
|
|
446
|
+
function ee() {
|
|
447
|
+
if (N(), document.getElementById("embed-iframe-dialog-styles")) return;
|
|
276
448
|
const e = document.createElement("style");
|
|
277
449
|
e.id = "embed-iframe-dialog-styles", e.textContent = `
|
|
278
450
|
/* Embed Iframe Dialog Styles */
|
|
@@ -563,6 +735,6 @@ function T() {
|
|
|
563
735
|
`, document.head.appendChild(e);
|
|
564
736
|
}
|
|
565
737
|
export {
|
|
566
|
-
|
|
738
|
+
te as EmbedIframePlugin
|
|
567
739
|
};
|
|
568
|
-
//# sourceMappingURL=EmbedIframePlugin.native-
|
|
740
|
+
//# sourceMappingURL=EmbedIframePlugin.native-BF_-LjTq.mjs.map
|