@editora/core 1.0.9 → 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.
Files changed (99) hide show
  1. package/README.md +1 -1
  2. package/dist/{A11yCheckerPlugin.native-58d12bed.mjs → A11yCheckerPlugin.native-BRdGYMju.mjs} +12 -23
  3. package/dist/{AnchorPlugin.native-289a112a.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +102 -112
  4. package/dist/{ApprovalWorkflowPlugin.native-449ce66c.mjs → ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs} +173 -209
  5. package/dist/{BackgroundColorPlugin.native-8aceb5cc.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +9 -16
  6. package/dist/BlockquotePlugin.native-57_Xcjl1.mjs +212 -0
  7. package/dist/{BlocksLibraryPlugin.native-1cc51e63.mjs → BlocksLibraryPlugin.native-5sdsXsiE.mjs} +149 -205
  8. package/dist/{BoldPlugin.native-f9d7f8e4.mjs → BoldPlugin.native-CSh_LiIJ.mjs} +11 -7
  9. package/dist/CapitalizationPlugin.native-DLV4oPmB.mjs +159 -0
  10. package/dist/ChecklistPlugin.native-BS-kMz9O.mjs +371 -0
  11. package/dist/{CitationsPlugin.native-169fb1e8.mjs → CitationsPlugin.native-DQgoCd1B.mjs} +196 -261
  12. package/dist/ClearFormattingPlugin.native-DIS6AN2t.mjs +172 -0
  13. package/dist/CodePlugin.native-C5l1IeSS.mjs +4570 -0
  14. package/dist/{CodeSamplePlugin.native-6cc0148e.mjs → CodeSamplePlugin.native-CgGoH-X4.mjs} +10 -19
  15. package/dist/{CommentsPlugin.native-03659874.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +28 -55
  16. package/dist/{ConditionalContentPlugin.native-4983143a.mjs → ConditionalContentPlugin.native-CfhY46rU.mjs} +51 -108
  17. package/dist/{ContentRulesPlugin.native-63ed405b.mjs → ContentRulesPlugin.native-vPx5nC73.mjs} +153 -200
  18. package/dist/{DataBindingPlugin.native-427e9d75.mjs → DataBindingPlugin.native-BoXwghTz.mjs} +88 -124
  19. package/dist/DirectionPlugin.native-Bl-QLFzO.mjs +153 -0
  20. package/dist/{DocSchemaPlugin.native-8e41eda0.mjs → DocSchemaPlugin.native-DUSVRHqT.mjs} +112 -166
  21. package/dist/{DocumentManagerPlugin.native-e69895ad.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +4 -4
  22. package/dist/EmbedIframePlugin.native-BF_-LjTq.mjs +740 -0
  23. package/dist/{EmojisPlugin.native-65c5ac47.mjs → EmojisPlugin.native-CitxxlWX.mjs} +6 -11
  24. package/dist/{FontFamilyPlugin.native-f9bc255a.mjs → FontFamilyPlugin.native-j8hMTbg4.mjs} +4 -7
  25. package/dist/{FontSizePlugin.native-f5647872.mjs → FontSizePlugin.native-B_jCh7dY.mjs} +10 -19
  26. package/dist/{FootnotePlugin.native-494657b3.mjs → FootnotePlugin.native-D730OGRm.mjs} +39 -77
  27. package/dist/{FullscreenPlugin.native-87ce92e9.mjs → FullscreenPlugin.native-ChXyxeNw.mjs} +1 -1
  28. package/dist/HeadingPlugin.native-DZdvubrQ.mjs +249 -0
  29. package/dist/{HistoryPlugin.native-92ed4be4.mjs → HistoryPlugin.native-D2wl32jV.mjs} +107 -143
  30. package/dist/{IndentPlugin.native-e4ee902b.mjs → IndentPlugin.native-BHixp8sP.mjs} +12 -23
  31. package/dist/{ItalicPlugin.native-7c95cfbc.mjs → ItalicPlugin.native-CmnlwFHB.mjs} +15 -11
  32. package/dist/{LineHeightPlugin.native-5668f78c.mjs → LineHeightPlugin.native-CM7iXdQj.mjs} +10 -19
  33. package/dist/{LinkPlugin.native-6df29111.mjs → LinkPlugin.native-DYCIcdTm.mjs} +5 -9
  34. package/dist/{ListPlugin.native-fe2e115a.mjs → ListPlugin.native-V7EZC1lM.mjs} +5 -9
  35. package/dist/MathPlugin.native-NwWPHVmj.mjs +369 -0
  36. package/dist/{MediaManagerPlugin.native-3cf48a00.mjs → MediaManagerPlugin.native-eOsTJFpw.mjs} +11 -21
  37. package/dist/{MentionPlugin.native-3b1e8c05.mjs → MentionPlugin.native-BMDlOqur.mjs} +45 -89
  38. package/dist/MergeTagPlugin.native-BzRVoD9-.mjs +580 -0
  39. package/dist/{PIIRedactionPlugin.native-7ab10b9f.mjs → PIIRedactionPlugin.native-g7j4jOmm.mjs} +210 -260
  40. package/dist/{PageBreakPlugin.native-1794c5fb.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +16 -31
  41. package/dist/{PreviewPlugin.native-f7b67cc0.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +6 -11
  42. package/dist/{PrintPlugin.native-f6a168c2.mjs → PrintPlugin.native-7qt5v7L5.mjs} +3 -5
  43. package/dist/{SlashCommandsPlugin.native-8d45e511.mjs → SlashCommandsPlugin.native-BiN6ODw5.mjs} +36 -71
  44. package/dist/{SmartPastePlugin.native-a6c5efec.mjs → SmartPastePlugin.native-CZAEHkyt.mjs} +173 -219
  45. package/dist/{SpecialCharactersPlugin.native-7f06d4ba.mjs → SpecialCharactersPlugin.native-DaG4b19I.mjs} +101 -85
  46. package/dist/{SpellCheckPlugin.native-04e20834.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +21 -41
  47. package/dist/{StrikethroughPlugin.native-905e9501.mjs → StrikethroughPlugin.native-V0TL4F48.mjs} +12 -30
  48. package/dist/{TablePlugin.native-7d5458c1.mjs → TablePlugin.native-DrHX-efe.mjs} +30 -58
  49. package/dist/TemplatePlugin.native-DLjFUaPW.mjs +1150 -0
  50. package/dist/{TextAlignmentPlugin.native-9357b3ed.mjs → TextAlignmentPlugin.native-sM_1s00t.mjs} +6 -11
  51. package/dist/{TextColorPlugin.native-d53ed459.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +14 -26
  52. package/dist/{TrackChangesPlugin.native-e96da509.mjs → TrackChangesPlugin.native-Bghu2q4a.mjs} +58 -115
  53. package/dist/{TranslationWorkflowPlugin.native-4e711b1e.mjs → TranslationWorkflowPlugin.native-DdF16tgT.mjs} +191 -257
  54. package/dist/{UnderlinePlugin.native-8080c998.mjs → UnderlinePlugin.native-DZzg23rv.mjs} +8 -4
  55. package/dist/{VersionDiffPlugin.native-5bbeff85.mjs → VersionDiffPlugin.native-Bvxgy--t.mjs} +26 -51
  56. package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
  57. package/dist/{anchoredPopover-5cca53ba.mjs → anchoredPopover-Bxds0VoB.mjs} +1 -1
  58. package/dist/core.css +1 -0
  59. package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
  60. package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +2 -3
  61. package/dist/editora.min.js +13 -14
  62. package/dist/editora.umd.js +13 -14
  63. package/dist/{html2canvas.esm-c51cb3b9.mjs → html2canvas.esm-AYkPY5LS.mjs} +894 -978
  64. package/dist/index-BslAFzmv.mjs +16544 -0
  65. package/dist/index-CPMGUZfB.js +10 -0
  66. package/dist/{index-7da30697.mjs → index-DBoj6QfW.mjs} +127 -164
  67. package/dist/index.cjs.js +1 -1
  68. package/dist/index.es-BYD2KEo6.mjs +6666 -0
  69. package/dist/index.esm.js +7 -12
  70. package/dist/inlineFormatting-DJ0-NZtx.mjs +97 -0
  71. package/dist/{jspdf.es.min-780c82db.mjs → jspdf.es.min-BJGtOnRT.mjs} +3784 -4808
  72. package/dist/plugin-loader.js +67 -67
  73. package/dist/{purify.es-3bdbcfc5.mjs → purify.es-CKpwg8Tk.mjs} +10 -20
  74. package/dist/webcomponent-core.js +131 -168
  75. package/dist/webcomponent-core.min.css +1 -1
  76. package/dist/webcomponent-core.min.js +139 -63
  77. package/dist/webcomponent.cjs.js +1 -1
  78. package/dist/webcomponent.esm.js +1 -1
  79. package/dist/webcomponent.js +191 -228
  80. package/dist/webcomponent.min.css +1 -1
  81. package/dist/webcomponent.min.js +1240 -1344
  82. package/package.json +1 -1
  83. package/dist/BlockquotePlugin.native-3541c714.mjs +0 -49
  84. package/dist/CapitalizationPlugin.native-42c135dc.mjs +0 -80
  85. package/dist/ChecklistPlugin.native-3b397ee9.mjs +0 -330
  86. package/dist/ClearFormattingPlugin.native-77baa514.mjs +0 -145
  87. package/dist/CodePlugin.native-989cf0aa.mjs +0 -2740
  88. package/dist/DirectionPlugin.native-4e742f42.mjs +0 -139
  89. package/dist/EmbedIframePlugin.native-55209c87.mjs +0 -568
  90. package/dist/HeadingPlugin.native-e38c4a16.mjs +0 -64
  91. package/dist/MathPlugin.native-735bbac2.mjs +0 -296
  92. package/dist/MergeTagPlugin.native-31cf7d48.mjs +0 -584
  93. package/dist/TemplatePlugin.native-580f0f63.mjs +0 -617
  94. package/dist/_commonjsHelpers-69d58be2.mjs +0 -31
  95. package/dist/documentManager-8327fb6e.mjs +0 -9166
  96. package/dist/index-072ef022.js +0 -11
  97. package/dist/index-49d31221.mjs +0 -16860
  98. package/dist/index.es-b47a189f.mjs +0 -5782
  99. package/dist/style.css +0 -1
@@ -0,0 +1,740 @@
1
+ const q = [
2
+ { label: "Inline Value", value: "inline" },
3
+ { label: "Responsive - 21x9", value: "21x9" },
4
+ { label: "Responsive - 16x9", value: "16x9" },
5
+ { label: "Responsive - 4x3", value: "4x3" },
6
+ { label: "Responsive - 1x1", value: "1x1" }
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, {
10
+ dialogElement: null,
11
+ escapeHandler: null,
12
+ savedRange: null,
13
+ activeTab: "general",
14
+ formData: {
15
+ src: "",
16
+ selectedSize: "inline",
17
+ width: "100%",
18
+ height: "400px",
19
+ constrainProportions: !0,
20
+ name: "",
21
+ title: "",
22
+ longDescription: "",
23
+ descriptionUrl: "",
24
+ showBorder: !0,
25
+ enableScrollbar: !0
26
+ }
27
+ }), y.get(e));
28
+ function A(e) {
29
+ if (e != null && e.matches(p) || e != null && e.closest(p))
30
+ return !0;
31
+ const t = document.activeElement;
32
+ return t != null && t.closest(p) ? !0 : document.body.matches(p) || document.documentElement.matches(p);
33
+ }
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 = () => ({
216
+ name: "embedIframe",
217
+ init: $,
218
+ toolbar: [
219
+ {
220
+ label: "Embed Content",
221
+ command: "openEmbedIframeDialog",
222
+ icon: '<svg width="24" height="24" focusable="false"><path d="M19 6V5H5v14h2A13 13 0 0 1 19 6Zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4Zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6Zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3Zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 0 0 8 19h3ZM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 0 0-4 4.5h2.2Zm-3.4 0a12 12 0 0 1 2.8-4 12 12 0 0 0-5 4h2.2Z" fill-rule="nonzero"></path></svg>',
223
+ shortcut: "Mod-Shift-e",
224
+ type: "button"
225
+ }
226
+ ],
227
+ commands: {
228
+ openEmbedIframeDialog: (e, t) => (Z(M(t) || void 0), !0)
229
+ },
230
+ keymap: {
231
+ "Mod-Shift-e": "openEmbedIframeDialog"
232
+ }
233
+ });
234
+ function Z(e) {
235
+ if (!e) {
236
+ const a = document.activeElement;
237
+ a && a.closest("[data-editora-editor]") && (e = a.closest("[data-editora-editor]"));
238
+ }
239
+ if (e || (e = document.querySelector("[data-editora-editor]")), !e) {
240
+ console.warn("Editor element not found");
241
+ return;
242
+ }
243
+ const t = d(e), r = I(e);
244
+ t.savedRange = r ? j(r) : null, t.formData = {
245
+ src: "",
246
+ selectedSize: "inline",
247
+ width: "100%",
248
+ height: "400px",
249
+ constrainProportions: !0,
250
+ name: "",
251
+ title: "",
252
+ longDescription: "",
253
+ descriptionUrl: "",
254
+ showBorder: !0,
255
+ enableScrollbar: !0
256
+ }, t.activeTab = "general";
257
+ const o = document.createElement("div");
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 = `
261
+ <div class="rte-dialog-header">
262
+ <h3>Embed Iframe</h3>
263
+ <button class="rte-dialog-close">×</button>
264
+ </div>
265
+ <div class="rte-dialog-body">
266
+ <div class="rte-vertical-tabs">
267
+ <div class="rte-tab-buttons">
268
+ <button class="rte-tab-button active" data-tab="general">General</button>
269
+ <button class="rte-tab-button" data-tab="advanced">Advanced</button>
270
+ </div>
271
+ <div class="rte-tab-content">
272
+ <div class="rte-tab-panel" data-panel="general" style="display: block;">
273
+ <div class="rte-form-group">
274
+ <label class="rte-form-label">Source</label>
275
+ <input type="url" class="rte-form-input" id="iframe-src" placeholder="https://example.com" required />
276
+ </div>
277
+ <div class="rte-form-group">
278
+ <label class="rte-form-label">Size</label>
279
+ <select class="rte-form-select" id="iframe-size">
280
+ ${q.map((a) => `<option value="${a.value}">${a.label}</option>`).join("")}
281
+ </select>
282
+ </div>
283
+ <div class="rte-form-row" id="dimensions-row">
284
+ <div class="rte-form-group">
285
+ <label class="rte-form-label">Width</label>
286
+ <input type="text" class="rte-form-input" id="iframe-width" placeholder="100%" value="100%" />
287
+ </div>
288
+ <div class="rte-form-group">
289
+ <label class="rte-form-label">Height</label>
290
+ <input type="text" class="rte-form-input" id="iframe-height" placeholder="400px" value="400px" />
291
+ </div>
292
+ <div class="rte-form-group constrain-group">
293
+ <button type="button" class="rte-constrain-btn locked" id="constrain-btn" title="Unlock proportions">🔒</button>
294
+ </div>
295
+ </div>
296
+ </div>
297
+ <div class="rte-tab-panel" data-panel="advanced" style="display: none;">
298
+ <div class="rte-form-group">
299
+ <label class="rte-form-label">Name</label>
300
+ <input type="text" class="rte-form-input" id="iframe-name" placeholder="Iframe name" />
301
+ </div>
302
+ <div class="rte-form-group">
303
+ <label class="rte-form-label">Title</label>
304
+ <input type="text" class="rte-form-input" id="iframe-title" placeholder="Iframe title" />
305
+ </div>
306
+ <div class="rte-form-group">
307
+ <label class="rte-form-label">Long Description</label>
308
+ <textarea class="rte-form-textarea" id="iframe-longdesc" placeholder="Detailed description of the iframe content" rows="3"></textarea>
309
+ </div>
310
+ <div class="rte-form-group">
311
+ <label class="rte-form-label">Description URL</label>
312
+ <input type="url" class="rte-form-input" id="iframe-desc-url" placeholder="https://example.com/description" />
313
+ </div>
314
+ <div class="rte-form-group">
315
+ <label class="rte-checkbox-label">
316
+ <input type="checkbox" id="iframe-border" checked />
317
+ Show iframe border
318
+ </label>
319
+ </div>
320
+ <div class="rte-form-group">
321
+ <label class="rte-checkbox-label">
322
+ <input type="checkbox" id="iframe-scrollbar" checked />
323
+ Enable scrollbar
324
+ </label>
325
+ </div>
326
+ </div>
327
+ </div>
328
+ </div>
329
+ </div>
330
+ <div class="rte-dialog-footer">
331
+ <button type="button" class="rte-btn rte-btn-secondary" id="cancel-btn">Cancel</button>
332
+ <button type="submit" class="rte-btn rte-btn-primary" id="save-btn">Save</button>
333
+ </div>
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(() => {
337
+ var a;
338
+ (a = n.querySelector("#iframe-src")) == null || a.focus();
339
+ }, 100);
340
+ }
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);
347
+ });
348
+ });
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));
353
+ }
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";
360
+ });
361
+ }
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");
367
+ }
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`;
375
+ const i = e.querySelector("#iframe-height");
376
+ i && (i.value = o.formData.height);
377
+ }
378
+ }
379
+ }
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`;
387
+ const i = e.querySelector("#iframe-width");
388
+ i && (i.value = o.formData.width);
389
+ }
390
+ }
391
+ }
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");
397
+ }
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) {
402
+ alert("Please enter a source URL");
403
+ return;
404
+ }
405
+ if (!o.startsWith("https://") && !o.startsWith("http://")) {
406
+ alert("Please enter a valid URL starting with https:// or http://");
407
+ return;
408
+ }
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,
414
+ height: m,
415
+ aspectRatio: r.formData.selectedSize,
416
+ name: n || void 0,
417
+ title: a || void 0,
418
+ longDescription: i || void 0,
419
+ descriptionUrl: l || void 0,
420
+ showBorder: u,
421
+ enableScrollbar: s
422
+ }), h(t);
423
+ }
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 }));
441
+ }
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);
445
+ }
446
+ function ee() {
447
+ if (N(), document.getElementById("embed-iframe-dialog-styles")) return;
448
+ const e = document.createElement("style");
449
+ e.id = "embed-iframe-dialog-styles", e.textContent = `
450
+ /* Embed Iframe Dialog Styles */
451
+ .embed-iframe-dialog {
452
+ max-width: 600px;
453
+ width: 100%;
454
+ }
455
+
456
+ .rte-vertical-tabs {
457
+ display: flex;
458
+ gap: 20px;
459
+ min-height: 400px;
460
+ }
461
+
462
+ .rte-tab-buttons {
463
+ display: flex;
464
+ flex-direction: column;
465
+ width: 120px;
466
+ border-right: 1px solid #e1e5e9;
467
+ }
468
+
469
+ .rte-tab-button {
470
+ padding: 12px 16px;
471
+ border: none;
472
+ background: none;
473
+ text-align: left;
474
+ cursor: pointer;
475
+ font-size: 14px;
476
+ font-weight: 500;
477
+ color: #666;
478
+ border-right: 3px solid transparent;
479
+ transition: all 0.2s ease;
480
+ }
481
+
482
+ .rte-tab-button:hover {
483
+ background-color: #f8f9fa;
484
+ color: #333;
485
+ }
486
+
487
+ .rte-tab-button.active {
488
+ background-color: #e3f2fd;
489
+ color: #1976d2;
490
+ border-right-color: #1976d2;
491
+ font-weight: 600;
492
+ }
493
+
494
+ .rte-tab-content {
495
+ flex: 1;
496
+ padding: 0 0 0 20px;
497
+ }
498
+
499
+ .rte-tab-panel {
500
+ padding: 0;
501
+ }
502
+
503
+ .rte-form-group {
504
+ margin-bottom: 16px;
505
+ }
506
+
507
+ .rte-form-label {
508
+ display: block;
509
+ margin-bottom: 6px;
510
+ font-size: 14px;
511
+ font-weight: 500;
512
+ color: #333;
513
+ }
514
+
515
+ .rte-form-textarea,
516
+ .rte-form-input,
517
+ .rte-form-select {
518
+ width: 100%;
519
+ padding: 8px 12px;
520
+ border: 1px solid #ccc;
521
+ border-radius: 4px;
522
+ font-size: 14px;
523
+ transition: border-color 0.2s ease;
524
+ box-sizing: border-box;
525
+ }
526
+
527
+ .rte-form-textarea:focus,
528
+ .rte-form-input:focus,
529
+ .rte-form-select:focus {
530
+ outline: none;
531
+ border-color: #0066cc;
532
+ box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
533
+ }
534
+
535
+ .rte-form-textarea {
536
+ resize: vertical;
537
+ min-height: 80px;
538
+ font-family: inherit;
539
+ }
540
+
541
+ .rte-form-row {
542
+ display: flex;
543
+ gap: 12px;
544
+ align-items: flex-end;
545
+ }
546
+
547
+ .rte-form-row .rte-form-group {
548
+ flex: 1;
549
+ }
550
+
551
+ .rte-form-row .constrain-group {
552
+ flex: 0 0 auto;
553
+ margin-bottom: 0;
554
+ }
555
+
556
+ .rte-constrain-btn {
557
+ padding: 8px 12px;
558
+ border: 1px solid #ddd;
559
+ background: white;
560
+ border-radius: 4px;
561
+ cursor: pointer;
562
+ font-size: 18px;
563
+ transition: all 0.2s ease;
564
+ height: 38px;
565
+ width: 48px;
566
+ display: flex;
567
+ align-items: center;
568
+ justify-content: center;
569
+ }
570
+
571
+ .rte-constrain-btn:hover {
572
+ background-color: #f5f5f5;
573
+ border-color: #1976d2;
574
+ }
575
+
576
+ .rte-constrain-btn.locked {
577
+ background-color: #e3f2fd;
578
+ border-color: #1976d2;
579
+ }
580
+
581
+ .rte-checkbox-label {
582
+ display: flex;
583
+ align-items: center;
584
+ gap: 8px;
585
+ font-size: 14px;
586
+ color: #333;
587
+ cursor: pointer;
588
+ padding: 4px 0;
589
+ }
590
+
591
+ .rte-checkbox-label input[type="checkbox"] {
592
+ width: 18px;
593
+ height: 18px;
594
+ cursor: pointer;
595
+ accent-color: #0066cc;
596
+ }
597
+
598
+ .rte-checkbox-label:hover {
599
+ color: #000;
600
+ }
601
+
602
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-dialog-content {
603
+ background: #1f2937;
604
+ border: 1px solid #4b5563;
605
+ color: #e2e8f0;
606
+ box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
607
+ }
608
+
609
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-dialog-header,
610
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-dialog-footer {
611
+ background: #222d3a;
612
+ border-color: #3b4657;
613
+ }
614
+
615
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-dialog-header h3,
616
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-form-label,
617
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-checkbox-label {
618
+ color: #e2e8f0;
619
+ }
620
+
621
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-tab-buttons {
622
+ border-right-color: #3b4657;
623
+ }
624
+
625
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-tab-button {
626
+ color: #a8b5c8;
627
+ }
628
+
629
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-tab-button:hover {
630
+ background: #334155;
631
+ color: #f8fafc;
632
+ }
633
+
634
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-tab-button.active {
635
+ background: rgba(88, 166, 255, 0.18);
636
+ color: #8cc6ff;
637
+ border-right-color: #58a6ff;
638
+ }
639
+
640
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-form-input,
641
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-form-select,
642
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-form-textarea {
643
+ background: #111827;
644
+ border-color: #4b5563;
645
+ color: #e2e8f0;
646
+ }
647
+
648
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-form-input::placeholder,
649
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-form-textarea::placeholder {
650
+ color: #94a3b8;
651
+ }
652
+
653
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-form-input:focus,
654
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-form-select:focus,
655
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-form-textarea:focus {
656
+ border-color: #58a6ff;
657
+ box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.28);
658
+ }
659
+
660
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-constrain-btn {
661
+ background: #111827;
662
+ border-color: #4b5563;
663
+ color: #e2e8f0;
664
+ }
665
+
666
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-constrain-btn:hover {
667
+ background: #334155;
668
+ border-color: #58a6ff;
669
+ }
670
+
671
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-constrain-btn.locked {
672
+ background: rgba(88, 166, 255, 0.22);
673
+ border-color: #58a6ff;
674
+ color: #d9ecff;
675
+ }
676
+
677
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-btn-secondary {
678
+ background: #334155;
679
+ border-color: #4b5563;
680
+ color: #e2e8f0;
681
+ }
682
+
683
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-btn-secondary:hover {
684
+ background: #475569;
685
+ border-color: #64748b;
686
+ }
687
+
688
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-btn-primary {
689
+ background: #3b82f6;
690
+ color: #fff;
691
+ }
692
+
693
+ .rte-embed-iframe-overlay.rte-theme-dark .rte-btn-primary:hover {
694
+ background: #2563eb;
695
+ }
696
+
697
+ /* Responsive iframe classes */
698
+ .rte-iframe-21x9,
699
+ .rte-iframe-16x9,
700
+ .rte-iframe-4x3,
701
+ .rte-iframe-1x1 {
702
+ position: relative;
703
+ width: 100%;
704
+ padding-bottom: 56.25%;
705
+ height: 0;
706
+ overflow: hidden;
707
+ }
708
+
709
+ .rte-iframe-21x9 {
710
+ padding-bottom: 42.857%;
711
+ }
712
+
713
+ .rte-iframe-16x9 {
714
+ padding-bottom: 56.25%;
715
+ }
716
+
717
+ .rte-iframe-4x3 {
718
+ padding-bottom: 75%;
719
+ }
720
+
721
+ .rte-iframe-1x1 {
722
+ padding-bottom: 100%;
723
+ }
724
+
725
+ .rte-iframe-21x9 iframe,
726
+ .rte-iframe-16x9 iframe,
727
+ .rte-iframe-4x3 iframe,
728
+ .rte-iframe-1x1 iframe {
729
+ position: absolute;
730
+ top: 0;
731
+ left: 0;
732
+ width: 100%;
733
+ height: 100%;
734
+ }
735
+ `, document.head.appendChild(e);
736
+ }
737
+ export {
738
+ te as EmbedIframePlugin
739
+ };
740
+ //# sourceMappingURL=EmbedIframePlugin.native-BF_-LjTq.mjs.map