@editora/plugins 1.0.16 → 1.0.18
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-Bwf25lLX.js +460 -0
- package/dist/CodePlugin.native-Cpp4u3Jl.mjs +648 -0
- package/dist/a11y-checker.cjs.js +16 -16
- package/dist/a11y-checker.esm.js +79 -75
- package/dist/anchor.cjs.js +9 -9
- package/dist/anchor.esm.js +61 -60
- package/dist/anchoredPopover-Bg-ey7Yo.js +1 -0
- package/dist/anchoredPopover-D_JbjvdA.mjs +111 -0
- package/dist/approval-workflow.cjs.js +5 -5
- package/dist/approval-workflow.esm.js +105 -104
- package/dist/background-color.cjs.js +1 -1
- package/dist/background-color.esm.js +1 -1
- package/dist/blocks-library.cjs.js +6 -6
- package/dist/blocks-library.esm.js +226 -202
- package/dist/capitalization.cjs.js +1 -1
- package/dist/capitalization.esm.js +9 -4
- package/dist/checklist.cjs.js +1 -1
- package/dist/checklist.esm.js +154 -116
- package/dist/citations.cjs.js +43 -18
- package/dist/citations.esm.js +465 -446
- package/dist/clear-formatting.cjs.js +1 -1
- package/dist/clear-formatting.esm.js +21 -20
- package/dist/code-sample.cjs.js +85 -66
- package/dist/code-sample.esm.js +301 -190
- package/dist/code.cjs.js +1 -669
- package/dist/code.esm.js +2 -4560
- package/dist/collaboration.cjs.js +68 -0
- package/dist/collaboration.esm.js +7428 -0
- package/dist/comments.cjs.js +11 -11
- package/dist/comments.esm.js +284 -237
- package/dist/conditional-content.cjs.js +67 -60
- package/dist/conditional-content.esm.js +270 -220
- package/dist/data-binding.cjs.js +3 -3
- package/dist/data-binding.esm.js +28 -27
- package/dist/dialogHelpers-5d5BuOCW.mjs +39 -0
- package/dist/dialogHelpers-zU6zpMIA.js +12 -0
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +1 -1
- package/dist/{documentManager-Jf0RbSks.js → documentManager-BDz6tovy.js} +2 -2
- package/dist/{documentManager-CTqRftU8.mjs → documentManager-yjRBab4v.mjs} +3 -3
- package/dist/embed-iframe.cjs.js +37 -17
- package/dist/embed-iframe.esm.js +188 -143
- package/dist/emojis.cjs.js +13 -10
- package/dist/emojis.esm.js +288 -76
- package/dist/enterprise.cjs.js +1 -1
- package/dist/enterprise.esm.js +9 -7
- package/dist/escapeHtml-D2Zh82pD.js +1 -0
- package/dist/escapeHtml-DyksyvcZ.mjs +6 -0
- package/dist/font-family.cjs.js +1 -1
- package/dist/font-family.esm.js +48 -41
- package/dist/font-size.cjs.js +1 -1
- package/dist/font-size.esm.js +67 -60
- package/dist/format-painter.cjs.js +1 -1
- package/dist/format-painter.esm.js +2 -1
- package/dist/history.cjs.js +1 -1
- package/dist/history.esm.js +40 -36
- package/dist/historyHelpers-BEKwNOtA.mjs +14 -0
- package/dist/historyHelpers-Cu8Pk7m1.js +1 -0
- package/dist/index-Bm1eqYHh.mjs +194 -0
- package/dist/index-CoflqYuK.js +30 -0
- package/dist/index-CxhJLMPS.js +221 -0
- package/dist/{index-D3CycEFU.mjs → index-Di1ZqIDs.mjs} +6420 -6232
- package/dist/index.cjs.js +1 -1
- package/dist/{index.es-DQ78mYYo.mjs → index.es-B7pVaNEV.mjs} +1558 -1542
- package/dist/{index.es-CE_A4QSm.js → index.es-I9N4o4Iq.js} +5 -5
- package/dist/index.esm.js +17 -15
- package/dist/{jspdf.es.min-BoS80556.js → jspdf.es.min-B5Idu0Wl.js} +2 -2
- package/dist/{jspdf.es.min-DQCoX5yh.mjs → jspdf.es.min-BCzHIwvz.mjs} +3 -2
- package/dist/link.cjs.js +17 -13
- package/dist/link.esm.js +138 -69
- package/dist/list.cjs.js +1 -1
- package/dist/list.esm.js +66 -33
- package/dist/math.cjs.js +22 -22
- package/dist/math.esm.js +221 -126
- package/dist/media-manager.cjs.js +12 -12
- package/dist/media-manager.esm.js +55 -50
- package/dist/mentions.cjs.js +2 -2
- package/dist/mentions.esm.js +17 -12
- package/dist/merge-tag.cjs.js +2 -2
- package/dist/merge-tag.esm.js +43 -42
- package/dist/plugins.css +1 -1
- package/dist/preview.cjs.js +3 -3
- package/dist/preview.esm.js +30 -27
- package/dist/{purify.es-T2a3nLiC.js → purify.es-DWpzYfqy.js} +1 -1
- package/dist/{purify.es-DHhaBdbu.mjs → purify.es-Dewe88eZ.mjs} +2 -2
- package/dist/slash-commands.cjs.js +13 -7
- package/dist/slash-commands.esm.js +90 -79
- package/dist/smart-paste.cjs.js +5 -5
- package/dist/smart-paste.esm.js +85 -81
- package/dist/special-characters.cjs.js +6 -3
- package/dist/special-characters.esm.js +72 -25
- package/dist/spell-check.cjs.js +8 -8
- package/dist/spell-check.esm.js +10189 -295
- package/dist/table.cjs.js +166 -13
- package/dist/table.esm.js +543 -266
- package/dist/template.cjs.js +11 -11
- package/dist/template.esm.js +290 -264
- package/dist/text-color.cjs.js +1 -1
- package/dist/text-color.esm.js +1 -1
- package/dist/translation-workflow.cjs.js +4 -4
- package/dist/translation-workflow.esm.js +33 -31
- package/dist/version-diff.cjs.js +6 -6
- package/dist/version-diff.esm.js +40 -40
- package/package.json +10 -4
- package/dist/anchoredPopover-BzqGPOAE.js +0 -1
- package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
- package/dist/index-BFsKNTTj.mjs +0 -145
- package/dist/index-CvJk4DKa.js +0 -221
- package/dist/index-tqLTHcO6.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as nc, a as sc, b as oc } from "./index-
|
|
1
|
+
import { g as nc, a as sc, b as oc } from "./index-Bm1eqYHh.mjs";
|
|
2
2
|
var wr = { exports: {} };
|
|
3
3
|
var fs;
|
|
4
4
|
function ic() {
|
|
@@ -7953,10 +7953,10 @@ Actual: ` + T.attribValue);
|
|
|
7953
7953
|
var Nt = ic();
|
|
7954
7954
|
let yr = null, br = null, xr = null;
|
|
7955
7955
|
async function ac() {
|
|
7956
|
-
return yr || (yr = import("./index-
|
|
7956
|
+
return yr || (yr = import("./index-Di1ZqIDs.mjs").then((bt) => bt.i)), yr;
|
|
7957
7957
|
}
|
|
7958
7958
|
async function cc() {
|
|
7959
|
-
return br || (br = import("./jspdf.es.min-
|
|
7959
|
+
return br || (br = import("./jspdf.es.min-BCzHIwvz.mjs").then((bt) => bt.j)), br;
|
|
7960
7960
|
}
|
|
7961
7961
|
async function uc() {
|
|
7962
7962
|
return xr || (xr = import("./html2canvas.esm-BWVIUcAF.mjs")), xr;
|
package/dist/embed-iframe.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const z=require("./dialogHelpers-zU6zpMIA.js"),j=[{label:"Inline Value",value:"inline"},{label:"Responsive - 21x9",value:"21x9"},{label:"Responsive - 16x9",value:"16x9"},{label:"Responsive - 4x3",value:"4x3"},{label:"Responsive - 1x1",value:"1x1"}],h='[data-theme="dark"], .dark, .editora-theme-dark';let c=null;const E=new WeakMap,s=e=>(E.has(e)||E.set(e,{dialogElement:null,escapeHandler:null,savedRange:null,activeTab:"general",formData:{src:"",selectedSize:"inline",width:"100%",height:"400px",constrainProportions:!0,name:"",title:"",longDescription:"",descriptionUrl:"",showBorder:!0,enableScrollbar:!0}}),E.get(e));function P(e){return e?.matches(h)||e?.closest(h)||document.activeElement?.closest(h)?!0:document.body.matches(h)||document.documentElement.matches(h)}function L(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function U(e){const t=e?.editorElement;if(t instanceof HTMLElement)return t;const r=e?.contentElement;if(r instanceof HTMLElement){const i=r.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor");return i instanceof HTMLElement?i:r}const o=window.__editoraCommandEditorRoot;if(o instanceof HTMLElement)return o;const n=window.getSelection();if(n&&n.rangeCount>0){const l=L(n.getRangeAt(0).startContainer)?.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor");if(l instanceof HTMLElement)return l}const a=document.activeElement;if(a instanceof HTMLElement){const i=a.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor");if(i instanceof HTMLElement)return i}return document.querySelector("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")}function I(e){return e.getAttribute("contenteditable")==="true"?e:e.querySelector('.rte-content, .editora-content, [contenteditable="true"]')}function v(e){return L(e)?.closest('.rte-content, .editora-content, [contenteditable="true"]')}function O(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const r=t.getRangeAt(0);return!e.contains(r.startContainer)||!e.contains(r.endContainer)?null:r.cloneRange()}function T(e,t,r){if(t!==r){if(typeof window.execEditorCommand=="function"){window.execEditorCommand("recordDomTransaction",e,t,r);return}if(typeof window.executeEditorCommand=="function")try{window.executeEditorCommand("recordDomTransaction",{editor:e,beforeHTML:t,afterHTML:r})}catch{}}}function _(e,t){let r=t;for(;r&&r.parentNode&&r.parentNode!==e;)r=r.parentNode;return r&&r.parentNode===e?r:null}function C(e,t){return e.tagName!=="P"?!1:Array.from(e.childNodes).every(r=>r===t?!0:r.nodeType===Node.ELEMENT_NODE?r.tagName==="BR":r.nodeType===Node.TEXT_NODE&&!r.textContent?.trim())}function $(e){if(!(e instanceof Element))return null;const t=e.closest("iframe");if(t instanceof HTMLIFrameElement){const a=v(t);if(!a)return null;const i=t.parentElement;return i&&i.parentElement===a&&C(i,t)?i:t}const r=e.closest("p");if(!(r instanceof HTMLElement))return null;const o=v(r);if(!o||r.parentElement!==o)return null;const n=Array.from(r.children).find(a=>a instanceof HTMLIFrameElement);return n&&C(r,n)?r:null}function m(){c&&(c.classList.remove("rte-selected-embed-object"),c.querySelector("iframe")?.removeAttribute("data-rte-selected-object"),c instanceof HTMLIFrameElement&&c.removeAttribute("data-rte-selected-object"),c=null)}function B(e){if(c===e)return;m(),c=e,e.classList.add("rte-selected-embed-object"),(e instanceof HTMLIFrameElement?e:e.querySelector("iframe"))?.setAttribute("data-rte-selected-object","true");const r=window.getSelection();if(!r)return;const o=document.createRange();o.selectNode(e),r.removeAllRanges(),r.addRange(o)}function F(e,t){const r=window.getSelection();if(!r)return;const o=document.createRange();t&&t.parentNode===e?o.setStartBefore(t):(o.selectNodeContents(e),o.collapse(!1)),o.collapse(!0),r.removeAllRanges(),r.addRange(o)}function V(e){if(e.childNodes.length>0)return;const t=document.createElement("p");t.appendChild(document.createElement("br")),e.appendChild(t)}function Z(){if(!c||!c.isConnected)return m(),!1;const e=c,t=v(e);if(!t)return m(),!1;const r=t.innerHTML,o=e.nextSibling;e.remove(),V(t),m(),F(t,o);const n=t.innerHTML;return T(t,r,n),t.dispatchEvent(new window.Event("input",{bubbles:!0})),r!==n}function A(){if(document.getElementById("embed-iframe-object-selection-styles"))return;const e=document.createElement("style");e.id="embed-iframe-object-selection-styles",e.textContent=`
|
|
2
2
|
.rte-selected-embed-object {
|
|
3
3
|
outline: 2px solid #2563eb;
|
|
4
4
|
outline-offset: 3px;
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
iframe.rte-selected-embed-object {
|
|
16
16
|
box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.28);
|
|
17
17
|
}
|
|
18
|
-
`,document.head.appendChild(e)}function
|
|
18
|
+
`,document.head.appendChild(e)}function W(){typeof window>"u"||window.__embedIframeObjectSelectionInitialized||(window.__embedIframeObjectSelectionInitialized=!0,A(),document.addEventListener("pointerdown",e=>{const t=$(e.target);if(!t){e.target?.closest?.(".rte-embed-iframe-overlay")||m();return}e.preventDefault(),v(t)?.focus(),B(t)},!0),document.addEventListener("keydown",e=>{if(c){if(e.key==="Escape"){m();return}e.key!=="Backspace"&&e.key!=="Delete"||(e.preventDefault(),e.stopPropagation(),Z())}},!0))}function G(e){try{const t=new URL(e),r=t.hostname.replace(/^www\./,"");if(r==="youtu.be"){const o=t.pathname.split("/").filter(Boolean)[0];if(o)return`https://www.youtube.com/embed/${encodeURIComponent(o)}`}if(r==="youtube.com"||r==="m.youtube.com"){const o=t.searchParams.get("v");if(o)return`https://www.youtube.com/embed/${encodeURIComponent(o)}`;const n=t.pathname.match(/^\/embed\/([^/]+)/);if(n?.[1])return`https://www.youtube.com/embed/${encodeURIComponent(n[1])}`}if(r==="vimeo.com"){const o=t.pathname.split("/").filter(Boolean)[0];if(o&&/^\d+$/.test(o))return`https://player.vimeo.com/video/${o}`}return e}catch{return e}}function R(e){if(/\s/.test(e))return!1;try{const t=new URL(e);return(t.protocol==="https:"||t.protocol==="http:")&&t.hostname.length>0}catch{return!1}}const K=()=>({name:"embedIframe",init:W,toolbar:[{label:"Embed Content",command:"openEmbedIframeDialog",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>',shortcut:"Mod-Shift-e",type:"button"}],commands:{openEmbedIframeDialog:(e,t)=>(X(U(t)||void 0),!0)},keymap:{"Mod-Shift-e":"openEmbedIframeDialog"}});function X(e){if(document.querySelectorAll(".rte-embed-iframe-overlay").forEach(a=>a.remove()),!e){const a=document.activeElement;a&&a.closest("[data-editora-editor]")&&(e=a.closest("[data-editora-editor]"))}if(e||(e=document.querySelector("[data-editora-editor]")),!e){console.warn("Editor element not found");return}const t=s(e),r=I(e);t.savedRange=r?O(r):null,t.formData={src:"",selectedSize:"inline",width:"100%",height:"400px",constrainProportions:!0,name:"",title:"",longDescription:"",descriptionUrl:"",showBorder:!0,enableScrollbar:!0},t.activeTab="general";const o=document.createElement("div");z.initDialogOverlay(o),o.className="rte-dialog-overlay rte-embed-iframe-overlay",P(e)&&o.classList.add("rte-theme-dark"),o.onclick=()=>g(e);const n=document.createElement("div");n.className="rte-dialog-content embed-iframe-dialog",n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.setAttribute("aria-labelledby","embed-iframe-dialog-title"),n.onclick=a=>a.stopPropagation(),n.innerHTML=`
|
|
19
19
|
<div class="rte-dialog-header">
|
|
20
|
-
<h3>Embed Iframe</h3>
|
|
21
|
-
<button class="rte-dialog-close">×</button>
|
|
20
|
+
<h3 id="embed-iframe-dialog-title">Embed Iframe</h3>
|
|
21
|
+
<button type="button" class="rte-dialog-close" aria-label="Close">×</button>
|
|
22
22
|
</div>
|
|
23
23
|
<div class="rte-dialog-body">
|
|
24
24
|
<div class="rte-vertical-tabs">
|
|
@@ -29,22 +29,23 @@
|
|
|
29
29
|
<div class="rte-tab-content">
|
|
30
30
|
<div class="rte-tab-panel" data-panel="general" style="display: block;">
|
|
31
31
|
<div class="rte-form-group">
|
|
32
|
-
<label class="rte-form-label">Source</label>
|
|
33
|
-
<input type="url" class="rte-form-input" id="iframe-src" placeholder="https://example.com" required />
|
|
32
|
+
<label class="rte-form-label" for="iframe-src">Source</label>
|
|
33
|
+
<input type="url" class="rte-form-input" id="iframe-src" placeholder="https://example.com" required aria-describedby="iframe-src-error" />
|
|
34
|
+
<div class="rte-form-error" id="iframe-src-error" role="alert" hidden></div>
|
|
34
35
|
</div>
|
|
35
36
|
<div class="rte-form-group">
|
|
36
|
-
<label class="rte-form-label">Size</label>
|
|
37
|
+
<label class="rte-form-label" for="iframe-size">Size</label>
|
|
37
38
|
<select class="rte-form-select" id="iframe-size">
|
|
38
|
-
${
|
|
39
|
+
${j.map(a=>`<option value="${a.value}">${a.label}</option>`).join("")}
|
|
39
40
|
</select>
|
|
40
41
|
</div>
|
|
41
42
|
<div class="rte-form-row" id="dimensions-row">
|
|
42
43
|
<div class="rte-form-group">
|
|
43
|
-
<label class="rte-form-label">Width</label>
|
|
44
|
+
<label class="rte-form-label" for="iframe-width">Width</label>
|
|
44
45
|
<input type="text" class="rte-form-input" id="iframe-width" placeholder="100%" value="100%" />
|
|
45
46
|
</div>
|
|
46
47
|
<div class="rte-form-group">
|
|
47
|
-
<label class="rte-form-label">Height</label>
|
|
48
|
+
<label class="rte-form-label" for="iframe-height">Height</label>
|
|
48
49
|
<input type="text" class="rte-form-input" id="iframe-height" placeholder="400px" value="400px" />
|
|
49
50
|
</div>
|
|
50
51
|
<div class="rte-form-group constrain-group">
|
|
@@ -54,20 +55,21 @@
|
|
|
54
55
|
</div>
|
|
55
56
|
<div class="rte-tab-panel" data-panel="advanced" style="display: none;">
|
|
56
57
|
<div class="rte-form-group">
|
|
57
|
-
<label class="rte-form-label">Name</label>
|
|
58
|
+
<label class="rte-form-label" for="iframe-name">Name</label>
|
|
58
59
|
<input type="text" class="rte-form-input" id="iframe-name" placeholder="Iframe name" />
|
|
59
60
|
</div>
|
|
60
61
|
<div class="rte-form-group">
|
|
61
|
-
<label class="rte-form-label">Title</label>
|
|
62
|
+
<label class="rte-form-label" for="iframe-title">Title</label>
|
|
62
63
|
<input type="text" class="rte-form-input" id="iframe-title" placeholder="Iframe title" />
|
|
63
64
|
</div>
|
|
64
65
|
<div class="rte-form-group">
|
|
65
|
-
<label class="rte-form-label">Long Description</label>
|
|
66
|
+
<label class="rte-form-label" for="iframe-longdesc">Long Description</label>
|
|
66
67
|
<textarea class="rte-form-textarea" id="iframe-longdesc" placeholder="Detailed description of the iframe content" rows="3"></textarea>
|
|
67
68
|
</div>
|
|
68
69
|
<div class="rte-form-group">
|
|
69
|
-
<label class="rte-form-label">Description URL</label>
|
|
70
|
-
<input type="url" class="rte-form-input" id="iframe-desc-url" placeholder="https://example.com/description" />
|
|
70
|
+
<label class="rte-form-label" for="iframe-desc-url">Description URL</label>
|
|
71
|
+
<input type="url" class="rte-form-input" id="iframe-desc-url" placeholder="https://example.com/description" aria-describedby="iframe-desc-url-error" />
|
|
72
|
+
<div class="rte-form-error" id="iframe-desc-url-error" role="alert" hidden></div>
|
|
71
73
|
</div>
|
|
72
74
|
<div class="rte-form-group">
|
|
73
75
|
<label class="rte-checkbox-label">
|
|
@@ -89,7 +91,7 @@
|
|
|
89
91
|
<button type="button" class="rte-btn rte-btn-secondary" id="cancel-btn">Cancel</button>
|
|
90
92
|
<button type="submit" class="rte-btn rte-btn-primary" id="save-btn">Save</button>
|
|
91
93
|
</div>
|
|
92
|
-
`,o.appendChild(
|
|
94
|
+
`,o.appendChild(n),document.body.appendChild(o),t.dialogElement=o,t.escapeHandler=a=>{a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),g(e))},document.addEventListener("keydown",t.escapeHandler,!0),J(n,e),ae(),setTimeout(()=>{n.querySelector("#iframe-src")?.focus()},100)}function J(e,t){e.querySelector(".rte-dialog-close")?.addEventListener("click",()=>g(t)),e.querySelectorAll(".rte-tab-button").forEach(a=>{a.addEventListener("click",i=>{const l=i.target.getAttribute("data-tab");l&&q(e,l,t)})}),e.querySelector("#iframe-size")?.addEventListener("change",a=>Q(e,a.target.value,t));const o=e.querySelector("#iframe-width"),n=e.querySelector("#iframe-height");o?.addEventListener("input",a=>Y(e,a.target.value,t)),n?.addEventListener("input",a=>ee(e,a.target.value,t)),e.querySelector("#constrain-btn")?.addEventListener("click",()=>te(e,t)),e.querySelector("#cancel-btn")?.addEventListener("click",()=>g(t)),e.querySelector("#save-btn")?.addEventListener("click",()=>re(e,t))}function q(e,t,r){const o=s(r);o.activeTab=t,e.querySelectorAll(".rte-tab-button").forEach(n=>{n.classList.toggle("active",n.getAttribute("data-tab")===t)}),e.querySelectorAll(".rte-tab-panel").forEach(n=>{n.style.display=n.getAttribute("data-panel")===t?"block":"none"})}function Q(e,t,r){const o=s(r);o.formData.selectedSize=t;const n=e.querySelector("#dimensions-row"),a=e.querySelector("#iframe-width"),i=e.querySelector("#iframe-height");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")}function Y(e,t,r){const o=s(r);if(o.formData.width=t,o.formData.constrainProportions&&o.formData.selectedSize==="inline"){const n=parseFloat(t);if(!isNaN(n)){const a=n*9/16;o.formData.height=`${a}px`;const i=e.querySelector("#iframe-height");i&&(i.value=o.formData.height)}}}function ee(e,t,r){const o=s(r);if(o.formData.height=t,o.formData.constrainProportions&&o.formData.selectedSize==="inline"){const n=parseFloat(t);if(!isNaN(n)){const a=n*16/9;o.formData.width=`${a}px`;const i=e.querySelector("#iframe-width");i&&(i.value=o.formData.width)}}}function te(e,t){const r=s(t);r.formData.constrainProportions=!r.formData.constrainProportions;const o=e.querySelector("#constrain-btn");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")}function re(e,t){const r=s(t),o=e.querySelector("#iframe-src"),n=e.querySelector("#iframe-desc-url");let a=o?.value.trim()||"";a&&!/^[a-z][a-z0-9+.-]*:/i.test(a)&&/^[^\s/]+\.[^\s/]+/.test(a)&&(a=`https://${a}`,o&&(o.value=a));const i=(b,w,p,M)=>{q(e,M,t);const k=e.querySelector(`#${w}`);k&&(k.textContent=p,k.hidden=!1),b&&(b.setAttribute("aria-invalid","true"),b.focus())},l=(b,w)=>{const p=e.querySelector(`#${w}`);p&&(p.textContent="",p.hidden=!0),b?.removeAttribute("aria-invalid")};if(l(o,"iframe-src-error"),l(n,"iframe-desc-url-error"),!a){i(o,"iframe-src-error","Please enter a source URL.","general");return}if(!R(a)){i(o,"iframe-src-error","Enter a valid URL starting with https:// or http://.","general");return}const d=n?.value.trim()||"";if(d&&!R(d)){i(n,"iframe-desc-url-error","Enter a valid URL starting with https:// or http://.","advanced");return}const y=e.querySelector("#iframe-name")?.value.trim(),f=e.querySelector("#iframe-title")?.value.trim(),u=e.querySelector("#iframe-longdesc")?.value.trim(),x=d,H=e.querySelector("#iframe-border")?.checked??!0,N=e.querySelector("#iframe-scrollbar")?.checked??!0;let S=r.formData.width,D=r.formData.height;r.formData.selectedSize!=="inline"&&(S="100%",D="auto"),oe(t,{src:a,width:S,height:D,aspectRatio:r.formData.selectedSize,name:y||void 0,title:f||void 0,longDescription:u||void 0,descriptionUrl:x||void 0,showBorder:H,enableScrollbar:N}),g(t)}function oe(e,t){const r=s(e),o=I(e);if(!o)return;const n=o.innerHTML,a=document.createElement("iframe");a.src=G(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),a.setAttribute("data-editora-embed","true"),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);const i=document.createElement("p");i.appendChild(a),i.appendChild(document.createElement("br"));const l=r.savedRange&&o.contains(r.savedRange.commonAncestorContainer)?r.savedRange:document.createRange();(!r.savedRange||!o.contains(r.savedRange.commonAncestorContainer))&&(l.selectNodeContents(o),l.collapse(!1));const d=_(o,l.startContainer),y=d?d.nextSibling:null;o.insertBefore(i,y);const f=document.createRange();f.setStartAfter(i),f.collapse(!0);const u=window.getSelection();u&&(u.removeAllRanges(),u.addRange(f)),r.savedRange=null;const x=o.innerHTML;T(o,n,x),o.dispatchEvent(new CustomEvent("input",{bubbles:!0,detail:{allowedTags:["iframe"]}}))}function g(e){const t=s(e);t.savedRange=null,t.escapeHandler&&(document.removeEventListener("keydown",t.escapeHandler,!0),t.escapeHandler=null),t.dialogElement&&(t.dialogElement.remove(),t.dialogElement=null)}function ae(){if(A(),document.getElementById("embed-iframe-dialog-styles"))return;const e=document.createElement("style");e.id="embed-iframe-dialog-styles",e.textContent=`
|
|
93
95
|
/* Embed Iframe Dialog Styles */
|
|
94
96
|
.embed-iframe-dialog {
|
|
95
97
|
max-width: 600px;
|
|
@@ -156,6 +158,24 @@
|
|
|
156
158
|
}
|
|
157
159
|
|
|
158
160
|
.rte-form-textarea,
|
|
161
|
+
.rte-form-error {
|
|
162
|
+
margin-top: 4px;
|
|
163
|
+
font-size: 12px;
|
|
164
|
+
color: #c62828;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.rte-form-error[hidden] {
|
|
168
|
+
display: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.rte-form-input[aria-invalid="true"] {
|
|
172
|
+
border-color: #c62828;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.rte-embed-iframe-overlay.rte-theme-dark .rte-form-error {
|
|
176
|
+
color: #ff8a80;
|
|
177
|
+
}
|
|
178
|
+
|
|
159
179
|
.rte-form-input,
|
|
160
180
|
.rte-form-select {
|
|
161
181
|
width: 100%;
|
|
@@ -375,4 +395,4 @@
|
|
|
375
395
|
width: 100%;
|
|
376
396
|
height: 100%;
|
|
377
397
|
}
|
|
378
|
-
`,document.head.appendChild(e)}exports.EmbedIframePlugin=
|
|
398
|
+
`,document.head.appendChild(e)}exports.EmbedIframePlugin=K;
|