@editora/plugins 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 +27 -0
- package/dist/_commonjsHelpers-6763f629.js +1 -0
- package/dist/_commonjsHelpers-c5d32002.mjs +30 -0
- package/dist/a11y-checker.cjs.js +12 -12
- package/dist/a11y-checker.esm.js +98 -80
- package/dist/anchor.cjs.js +12 -12
- package/dist/anchor.esm.js +128 -115
- package/dist/anchoredPopover-33f1358d.mjs +109 -0
- package/dist/anchoredPopover-8151d535.js +1 -0
- package/dist/approval-workflow.cjs.js +447 -0
- package/dist/approval-workflow.esm.js +1111 -0
- package/dist/background-color.cjs.js +2 -2
- package/dist/background-color.esm.js +68 -55
- package/dist/blockquote.esm.js +2 -1
- package/dist/blocks-library.cjs.js +442 -0
- package/dist/blocks-library.esm.js +1384 -0
- package/dist/capitalization.esm.js +2 -1
- package/dist/checklist.cjs.js +1 -1
- package/dist/checklist.esm.js +82 -58
- package/dist/citations.cjs.js +548 -0
- package/dist/citations.esm.js +1530 -0
- package/dist/clear-formatting.cjs.js +1 -1
- package/dist/clear-formatting.esm.js +33 -27
- package/dist/code-sample.cjs.js +14 -14
- package/dist/code-sample.esm.js +93 -82
- package/dist/code.cjs.js +32 -32
- package/dist/code.esm.js +653 -594
- package/dist/comments.cjs.js +6 -6
- package/dist/comments.esm.js +158 -116
- package/dist/conditional-content.cjs.js +626 -0
- package/dist/conditional-content.esm.js +1421 -0
- package/dist/content-rules.cjs.js +408 -0
- package/dist/content-rules.esm.js +1147 -0
- package/dist/data-binding.cjs.js +321 -0
- package/dist/data-binding.esm.js +953 -0
- package/dist/direction.esm.js +18 -9
- package/dist/doc-schema.cjs.js +398 -0
- package/dist/doc-schema.esm.js +1378 -0
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +5 -4
- package/dist/documentManager-25b6203c.mjs +9122 -0
- package/dist/documentManager-b69e7054.js +17 -0
- package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +2 -1
- package/dist/embed-iframe.cjs.js +4 -4
- package/dist/embed-iframe.esm.js +81 -73
- package/dist/emojis.cjs.js +8 -8
- package/dist/emojis.esm.js +77 -65
- package/dist/enterprise.cjs.js +1 -0
- package/dist/enterprise.esm.js +58 -0
- package/dist/font-family.cjs.js +1 -1
- package/dist/font-family.esm.js +47 -39
- package/dist/font-size.cjs.js +1 -1
- package/dist/font-size.esm.js +53 -37
- package/dist/footnote.cjs.js +2 -2
- package/dist/footnote.esm.js +117 -76
- package/dist/history.cjs.js +1 -1
- package/dist/history.esm.js +92 -70
- package/dist/html2canvas.esm-09133e29.js +22 -0
- package/dist/{html2canvas.esm-BWVIUcAF.mjs → html2canvas.esm-1a1724a1.mjs} +225 -141
- package/dist/indent.cjs.js +1 -1
- package/dist/indent.esm.js +24 -12
- package/dist/index-656d224b.js +231 -0
- package/dist/index-6a8c48bb.js +1 -0
- package/dist/index-d027b7e2.mjs +16859 -0
- package/dist/{index-BFsKNTTj.mjs → index-f04538f2.mjs} +71 -70
- package/dist/index.cjs.js +1 -1
- package/dist/index.es-730f2d98.mjs +5775 -0
- package/dist/index.es-dd40173b.js +18 -0
- package/dist/index.esm.js +124 -93
- package/dist/italic.cjs.js +1 -1
- package/dist/italic.esm.js +9 -8
- package/dist/jspdf.es.min-90db2c97.js +243 -0
- package/dist/{jspdf.es.min-DQCoX5yh.mjs → jspdf.es.min-c36a4fd8.mjs} +4682 -3658
- package/dist/line-height.cjs.js +1 -1
- package/dist/line-height.esm.js +24 -11
- package/dist/link.cjs.js +5 -5
- package/dist/link.esm.js +30 -24
- package/dist/list.cjs.js +1 -1
- package/dist/list.esm.js +25 -20
- package/dist/lite.cjs.js +1 -1
- package/dist/lite.esm.js +61 -59
- package/dist/math.cjs.js +21 -21
- package/dist/math.esm.js +146 -139
- package/dist/media-manager.cjs.js +38 -38
- package/dist/media-manager.esm.js +325 -308
- package/dist/mentions.cjs.js +105 -0
- package/dist/mentions.esm.js +774 -0
- package/dist/merge-tag.cjs.js +2 -2
- package/dist/merge-tag.esm.js +216 -177
- package/dist/page-break.cjs.js +2 -2
- package/dist/page-break.esm.js +67 -51
- package/dist/pii-redaction.cjs.js +436 -0
- package/dist/pii-redaction.esm.js +1447 -0
- package/dist/preview.cjs.js +3 -3
- package/dist/preview.esm.js +37 -32
- package/dist/print.cjs.js +4 -4
- package/dist/print.esm.js +20 -17
- package/dist/{purify.es-DHhaBdbu.mjs → purify.es-35a15df8.mjs} +19 -9
- package/dist/{purify.es-T2a3nLiC.js → purify.es-a8d731c6.js} +1 -1
- package/dist/slash-commands.cjs.js +90 -0
- package/dist/slash-commands.esm.js +788 -0
- package/dist/smart-paste.cjs.js +398 -0
- package/dist/smart-paste.esm.js +1444 -0
- package/dist/special-characters.cjs.js +7 -7
- package/dist/special-characters.esm.js +69 -61
- package/dist/spell-check.cjs.js +5 -5
- package/dist/spell-check.esm.js +123 -97
- package/dist/strikethrough.cjs.js +1 -1
- package/dist/strikethrough.esm.js +19 -14
- package/dist/style.css +1 -0
- package/dist/table.cjs.js +4 -4
- package/dist/table.esm.js +225 -191
- package/dist/template.cjs.js +11 -11
- package/dist/template.esm.js +153 -124
- package/dist/text-alignment.cjs.js +1 -1
- package/dist/text-alignment.esm.js +27 -21
- package/dist/text-color.cjs.js +3 -3
- package/dist/text-color.esm.js +87 -70
- package/dist/track-changes.cjs.js +77 -0
- package/dist/track-changes.esm.js +817 -0
- package/dist/translation-workflow.cjs.js +626 -0
- package/dist/translation-workflow.esm.js +1794 -0
- package/dist/version-diff.cjs.js +362 -0
- package/dist/version-diff.esm.js +797 -0
- package/index.d.ts +798 -0
- package/package.json +114 -9
- package/dist/_commonjsHelpers-BH3jXuIh.js +0 -1
- package/dist/_commonjsHelpers-ByX85dGu.mjs +0 -33
- package/dist/anchoredPopover-BzqGPOAE.js +0 -1
- package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
- package/dist/documentManager-CTqRftU8.mjs +0 -8369
- package/dist/documentManager-Jf0RbSks.js +0 -17
- package/dist/html2canvas.esm-B5qzocYs.js +0 -5
- package/dist/index-CvJk4DKa.js +0 -221
- package/dist/index-D3CycEFU.mjs +0 -16543
- package/dist/index-tqLTHcO6.js +0 -1
- package/dist/index.es-CE_A4QSm.js +0 -5
- package/dist/index.es-DQ78mYYo.mjs +0 -6665
- package/dist/jspdf.es.min-BoS80556.js +0 -77
- package/dist/plugins.css +0 -1
- /package/dist/{editorContainerHelpers-CFbfiOJI.js → editorContainerHelpers-36b8ddf3.js} +0 -0
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 S=[{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"}],u='[data-theme="dark"], .dark, .editora-theme-dark',h=new WeakMap,s=e=>(h.has(e)||h.set(e,{dialogElement:null,escapeHandler:null,activeTab:"general",formData:{src:"",selectedSize:"inline",width:"100%",height:"400px",constrainProportions:!0,name:"",title:"",longDescription:"",descriptionUrl:"",showBorder:!0,enableScrollbar:!0}}),h.get(e));function D(e){if(e!=null&&e.matches(u)||e!=null&&e.closest(u))return!0;const t=document.activeElement;return t!=null&&t.closest(u)?!0:document.body.matches(u)||document.documentElement.matches(u)}const q=()=>({name:"embedIframe",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=>(L(e),!0)},keymap:{"Mod-Shift-e":"openEmbedIframeDialog"}});function L(e){if(!e){const o=document.activeElement;o&&o.closest("[data-editora-editor]")&&(e=o.closest("[data-editora-editor]"))}if(e||(e=document.querySelector("[data-editora-editor]")),!e){console.warn("Editor element not found");return}const t=s(e);t.formData={src:"",selectedSize:"inline",width:"100%",height:"400px",constrainProportions:!0,name:"",title:"",longDescription:"",descriptionUrl:"",showBorder:!0,enableScrollbar:!0},t.activeTab="general";const a=document.createElement("div");a.className="rte-dialog-overlay rte-embed-iframe-overlay",D(e)&&a.classList.add("rte-theme-dark"),a.onclick=()=>p(e);const r=document.createElement("div");r.className="rte-dialog-content embed-iframe-dialog",r.onclick=o=>o.stopPropagation(),r.innerHTML=`
|
|
2
2
|
<div class="rte-dialog-header">
|
|
3
3
|
<h3>Embed Iframe</h3>
|
|
4
4
|
<button class="rte-dialog-close">×</button>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<div class="rte-form-group">
|
|
19
19
|
<label class="rte-form-label">Size</label>
|
|
20
20
|
<select class="rte-form-select" id="iframe-size">
|
|
21
|
-
${
|
|
21
|
+
${S.map(o=>`<option value="${o.value}">${o.label}</option>`).join("")}
|
|
22
22
|
</select>
|
|
23
23
|
</div>
|
|
24
24
|
<div class="rte-form-row" id="dimensions-row">
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
<button type="button" class="rte-btn rte-btn-secondary" id="cancel-btn">Cancel</button>
|
|
73
73
|
<button type="submit" class="rte-btn rte-btn-primary" id="save-btn">Save</button>
|
|
74
74
|
</div>
|
|
75
|
-
`,a.appendChild(r),document.body.appendChild(a),t.dialogElement=a,t.escapeHandler=o=>{o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),
|
|
75
|
+
`,a.appendChild(r),document.body.appendChild(a),t.dialogElement=a,t.escapeHandler=o=>{o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),p(e))},document.addEventListener("keydown",t.escapeHandler,!0),$(r,e),T(),setTimeout(()=>{var o;(o=r.querySelector("#iframe-src"))==null||o.focus()},100)}function $(e,t){var l,i,d,f;s(t),(l=e.querySelector(".rte-dialog-close"))==null||l.addEventListener("click",()=>p(t)),e.querySelectorAll(".rte-tab-button").forEach(n=>{n.addEventListener("click",m=>{const c=m.target.getAttribute("data-tab");c&&C(e,c,t)})});const a=e.querySelector("#iframe-size");a==null||a.addEventListener("change",n=>E(e,n.target.value,t));const r=e.querySelector("#iframe-width"),o=e.querySelector("#iframe-height");r==null||r.addEventListener("input",n=>H(e,n.target.value,t)),o==null||o.addEventListener("input",n=>P(e,n.target.value,t)),(i=e.querySelector("#constrain-btn"))==null||i.addEventListener("click",()=>z(e,t)),(d=e.querySelector("#cancel-btn"))==null||d.addEventListener("click",()=>p(t)),(f=e.querySelector("#save-btn"))==null||f.addEventListener("click",()=>I(e,t))}function C(e,t,a){const r=s(a);r.activeTab=t,e.querySelectorAll(".rte-tab-button").forEach(o=>{o.classList.toggle("active",o.getAttribute("data-tab")===t)}),e.querySelectorAll(".rte-tab-panel").forEach(o=>{o.style.display=o.getAttribute("data-panel")===t?"block":"none"})}function E(e,t,a){const r=s(a);r.formData.selectedSize=t;const o=e.querySelector("#dimensions-row"),l=e.querySelector("#iframe-width"),i=e.querySelector("#iframe-height");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")}function H(e,t,a){const r=s(a);if(r.formData.width=t,r.formData.constrainProportions&&r.formData.selectedSize==="inline"){const o=parseFloat(t);if(!isNaN(o)){const l=o*9/16;r.formData.height=`${l}px`;const i=e.querySelector("#iframe-height");i&&(i.value=r.formData.height)}}}function P(e,t,a){const r=s(a);if(r.formData.height=t,r.formData.constrainProportions&&r.formData.selectedSize==="inline"){const o=parseFloat(t);if(!isNaN(o)){const l=o*16/9;r.formData.width=`${l}px`;const i=e.querySelector("#iframe-width");i&&(i.value=r.formData.width)}}}function z(e,t){const a=s(t);a.formData.constrainProportions=!a.formData.constrainProportions;const r=e.querySelector("#constrain-btn");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")}function I(e,t){var b,g,v,x,y,k,w;const a=s(t),r=(b=e.querySelector("#iframe-src"))==null?void 0:b.value.trim();if(!r){alert("Please enter a source URL");return}if(!r.startsWith("https://")&&!r.startsWith("http://")){alert("Please enter a valid URL starting with https:// or http://");return}const o=(g=e.querySelector("#iframe-name"))==null?void 0:g.value.trim(),l=(v=e.querySelector("#iframe-title"))==null?void 0:v.value.trim(),i=(x=e.querySelector("#iframe-longdesc"))==null?void 0:x.value.trim(),d=(y=e.querySelector("#iframe-desc-url"))==null?void 0:y.value.trim(),f=((k=e.querySelector("#iframe-border"))==null?void 0:k.checked)??!0,n=((w=e.querySelector("#iframe-scrollbar"))==null?void 0:w.checked)??!0;let m=a.formData.width,c=a.formData.height;a.formData.selectedSize!=="inline"&&(m="100%",c="auto"),R(t,{src:r,width:m,height:c,aspectRatio:a.formData.selectedSize,name:o||void 0,title:l||void 0,longDescription:i||void 0,descriptionUrl:d||void 0,showBorder:f,enableScrollbar:n}),p(t)}function R(e,t){const a=e.querySelector('[contenteditable="true"]');a&&(a.focus(),setTimeout(()=>{const r=[`src="${t.src}"`,`width="${t.width}"`,`height="${t.height}"`,"allowfullscreen",`frameborder="${t.showBorder?"1":"0"}"`,`scrolling="${t.enableScrollbar?"auto":"no"}"`];t.name&&r.push(`name="${t.name}"`),t.title&&r.push(`title="${t.title}"`),t.longDescription&&r.push(`longdesc="${t.longDescription}"`);const o=[];t.aspectRatio!=="inline"&&o.push(`rte-iframe-${t.aspectRatio}`);const l=o.length>0?`class="${o.join(" ")}"`:"",i=`data-aspect-ratio="${t.aspectRatio}"`,d=`<iframe ${r.join(" ")} ${l} ${i}></iframe>`;if(!document.execCommand("insertHTML",!1,d)){const n=window.getSelection();if(n&&n.rangeCount>0){const m=n.getRangeAt(0);m.deleteContents();const c=document.createElement("div");c.innerHTML=d;const b=document.createDocumentFragment();for(;c.firstChild;)b.appendChild(c.firstChild);m.insertNode(b)}}},10))}function p(e){const t=s(e);t.escapeHandler&&(document.removeEventListener("keydown",t.escapeHandler,!0),t.escapeHandler=null),t.dialogElement&&(t.dialogElement.remove(),t.dialogElement=null)}function T(){if(document.getElementById("embed-iframe-dialog-styles"))return;const e=document.createElement("style");e.id="embed-iframe-dialog-styles",e.textContent=`
|
|
76
76
|
/* Embed Iframe Dialog Styles */
|
|
77
77
|
.embed-iframe-dialog {
|
|
78
78
|
max-width: 600px;
|
|
@@ -358,4 +358,4 @@
|
|
|
358
358
|
width: 100%;
|
|
359
359
|
height: 100%;
|
|
360
360
|
}
|
|
361
|
-
`,document.head.appendChild(e)}exports.EmbedIframePlugin=
|
|
361
|
+
`,document.head.appendChild(e)}exports.EmbedIframePlugin=q;
|
package/dist/embed-iframe.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const
|
|
1
|
+
const S = [
|
|
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
|
+
], 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
|
escapeHandler: null,
|
|
10
10
|
activeTab: "general",
|
|
@@ -21,11 +21,14 @@ const g = [
|
|
|
21
21
|
showBorder: !0,
|
|
22
22
|
enableScrollbar: !0
|
|
23
23
|
}
|
|
24
|
-
}),
|
|
25
|
-
function
|
|
26
|
-
|
|
24
|
+
}), h.get(e));
|
|
25
|
+
function D(e) {
|
|
26
|
+
if (e != null && e.matches(u) || e != null && e.closest(u))
|
|
27
|
+
return !0;
|
|
28
|
+
const t = document.activeElement;
|
|
29
|
+
return t != null && t.closest(u) ? !0 : document.body.matches(u) || document.documentElement.matches(u);
|
|
27
30
|
}
|
|
28
|
-
const
|
|
31
|
+
const T = () => ({
|
|
29
32
|
name: "embedIframe",
|
|
30
33
|
toolbar: [
|
|
31
34
|
{
|
|
@@ -37,13 +40,13 @@ const I = () => ({
|
|
|
37
40
|
}
|
|
38
41
|
],
|
|
39
42
|
commands: {
|
|
40
|
-
openEmbedIframeDialog: (e) => (
|
|
43
|
+
openEmbedIframeDialog: (e) => (q(e), !0)
|
|
41
44
|
},
|
|
42
45
|
keymap: {
|
|
43
46
|
"Mod-Shift-e": "openEmbedIframeDialog"
|
|
44
47
|
}
|
|
45
48
|
});
|
|
46
|
-
function
|
|
49
|
+
function q(e) {
|
|
47
50
|
if (!e) {
|
|
48
51
|
const o = document.activeElement;
|
|
49
52
|
o && o.closest("[data-editora-editor]") && (e = o.closest("[data-editora-editor]"));
|
|
@@ -52,7 +55,7 @@ function x(e) {
|
|
|
52
55
|
console.warn("Editor element not found");
|
|
53
56
|
return;
|
|
54
57
|
}
|
|
55
|
-
const t =
|
|
58
|
+
const t = s(e);
|
|
56
59
|
t.formData = {
|
|
57
60
|
src: "",
|
|
58
61
|
selectedSize: "inline",
|
|
@@ -67,7 +70,7 @@ function x(e) {
|
|
|
67
70
|
enableScrollbar: !0
|
|
68
71
|
}, t.activeTab = "general";
|
|
69
72
|
const a = document.createElement("div");
|
|
70
|
-
a.className = "rte-dialog-overlay rte-embed-iframe-overlay",
|
|
73
|
+
a.className = "rte-dialog-overlay rte-embed-iframe-overlay", D(e) && a.classList.add("rte-theme-dark"), a.onclick = () => p(e);
|
|
71
74
|
const r = document.createElement("div");
|
|
72
75
|
r.className = "rte-dialog-content embed-iframe-dialog", r.onclick = (o) => o.stopPropagation(), r.innerHTML = `
|
|
73
76
|
<div class="rte-dialog-header">
|
|
@@ -89,7 +92,7 @@ function x(e) {
|
|
|
89
92
|
<div class="rte-form-group">
|
|
90
93
|
<label class="rte-form-label">Size</label>
|
|
91
94
|
<select class="rte-form-select" id="iframe-size">
|
|
92
|
-
${
|
|
95
|
+
${S.map((o) => `<option value="${o.value}">${o.label}</option>`).join("")}
|
|
93
96
|
</select>
|
|
94
97
|
</div>
|
|
95
98
|
<div class="rte-form-row" id="dimensions-row">
|
|
@@ -144,67 +147,72 @@ function x(e) {
|
|
|
144
147
|
<button type="submit" class="rte-btn rte-btn-primary" id="save-btn">Save</button>
|
|
145
148
|
</div>
|
|
146
149
|
`, a.appendChild(r), document.body.appendChild(a), t.dialogElement = a, t.escapeHandler = (o) => {
|
|
147
|
-
o.key === "Escape" && (o.preventDefault(), o.stopPropagation(),
|
|
148
|
-
}, document.addEventListener("keydown", t.escapeHandler, !0),
|
|
149
|
-
|
|
150
|
+
o.key === "Escape" && (o.preventDefault(), o.stopPropagation(), p(e));
|
|
151
|
+
}, document.addEventListener("keydown", t.escapeHandler, !0), L(r, e), R(), setTimeout(() => {
|
|
152
|
+
var o;
|
|
153
|
+
(o = r.querySelector("#iframe-src")) == null || o.focus();
|
|
150
154
|
}, 100);
|
|
151
155
|
}
|
|
152
|
-
function
|
|
153
|
-
l
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
c
|
|
156
|
+
function L(e, t) {
|
|
157
|
+
var l, i, d, f;
|
|
158
|
+
s(t), (l = e.querySelector(".rte-dialog-close")) == null || l.addEventListener("click", () => p(t)), e.querySelectorAll(".rte-tab-button").forEach((n) => {
|
|
159
|
+
n.addEventListener("click", (m) => {
|
|
160
|
+
const c = m.target.getAttribute("data-tab");
|
|
161
|
+
c && $(e, c, t);
|
|
157
162
|
});
|
|
158
|
-
})
|
|
163
|
+
});
|
|
164
|
+
const a = e.querySelector("#iframe-size");
|
|
165
|
+
a == null || a.addEventListener("change", (n) => C(e, n.target.value, t));
|
|
159
166
|
const r = e.querySelector("#iframe-width"), o = e.querySelector("#iframe-height");
|
|
160
|
-
r
|
|
167
|
+
r == null || r.addEventListener("input", (n) => H(e, n.target.value, t)), o == null || o.addEventListener("input", (n) => z(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", () => I(e, t));
|
|
161
168
|
}
|
|
162
|
-
function
|
|
163
|
-
const r =
|
|
169
|
+
function $(e, t, a) {
|
|
170
|
+
const r = s(a);
|
|
164
171
|
r.activeTab = t, e.querySelectorAll(".rte-tab-button").forEach((o) => {
|
|
165
172
|
o.classList.toggle("active", o.getAttribute("data-tab") === t);
|
|
166
173
|
}), e.querySelectorAll(".rte-tab-panel").forEach((o) => {
|
|
167
174
|
o.style.display = o.getAttribute("data-panel") === t ? "block" : "none";
|
|
168
175
|
});
|
|
169
176
|
}
|
|
170
|
-
function
|
|
171
|
-
const r =
|
|
177
|
+
function C(e, t, a) {
|
|
178
|
+
const r = s(a);
|
|
172
179
|
r.formData.selectedSize = t;
|
|
173
|
-
const o = e.querySelector("#dimensions-row"),
|
|
174
|
-
t === "inline" ? (o.style.display = "flex",
|
|
180
|
+
const o = e.querySelector("#dimensions-row"), l = e.querySelector("#iframe-width"), i = e.querySelector("#iframe-height");
|
|
181
|
+
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");
|
|
175
182
|
}
|
|
176
|
-
function
|
|
177
|
-
const r =
|
|
183
|
+
function H(e, t, a) {
|
|
184
|
+
const r = s(a);
|
|
178
185
|
if (r.formData.width = t, r.formData.constrainProportions && r.formData.selectedSize === "inline") {
|
|
179
186
|
const o = parseFloat(t);
|
|
180
187
|
if (!isNaN(o)) {
|
|
181
|
-
const
|
|
182
|
-
r.formData.height = `${
|
|
183
|
-
const
|
|
184
|
-
|
|
188
|
+
const l = o * 9 / 16;
|
|
189
|
+
r.formData.height = `${l}px`;
|
|
190
|
+
const i = e.querySelector("#iframe-height");
|
|
191
|
+
i && (i.value = r.formData.height);
|
|
185
192
|
}
|
|
186
193
|
}
|
|
187
194
|
}
|
|
188
|
-
function
|
|
189
|
-
const r =
|
|
195
|
+
function z(e, t, a) {
|
|
196
|
+
const r = s(a);
|
|
190
197
|
if (r.formData.height = t, r.formData.constrainProportions && r.formData.selectedSize === "inline") {
|
|
191
198
|
const o = parseFloat(t);
|
|
192
199
|
if (!isNaN(o)) {
|
|
193
|
-
const
|
|
194
|
-
r.formData.width = `${
|
|
195
|
-
const
|
|
196
|
-
|
|
200
|
+
const l = o * 16 / 9;
|
|
201
|
+
r.formData.width = `${l}px`;
|
|
202
|
+
const i = e.querySelector("#iframe-width");
|
|
203
|
+
i && (i.value = r.formData.width);
|
|
197
204
|
}
|
|
198
205
|
}
|
|
199
206
|
}
|
|
200
|
-
function
|
|
201
|
-
const a =
|
|
207
|
+
function E(e, t) {
|
|
208
|
+
const a = s(t);
|
|
202
209
|
a.formData.constrainProportions = !a.formData.constrainProportions;
|
|
203
210
|
const r = e.querySelector("#constrain-btn");
|
|
204
211
|
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");
|
|
205
212
|
}
|
|
206
|
-
function
|
|
207
|
-
|
|
213
|
+
function I(e, t) {
|
|
214
|
+
var b, g, v, x, y, k, w;
|
|
215
|
+
const a = s(t), r = (b = e.querySelector("#iframe-src")) == null ? void 0 : b.value.trim();
|
|
208
216
|
if (!r) {
|
|
209
217
|
alert("Please enter a source URL");
|
|
210
218
|
return;
|
|
@@ -213,23 +221,22 @@ function E(e, t) {
|
|
|
213
221
|
alert("Please enter a valid URL starting with https:// or http://");
|
|
214
222
|
return;
|
|
215
223
|
}
|
|
216
|
-
const o = e.querySelector("#iframe-name")
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
let s = a.formData.width, d = a.formData.height;
|
|
220
|
-
a.formData.selectedSize !== "inline" && (s = "100%", d = "auto"), L(t, {
|
|
224
|
+
const o = (g = e.querySelector("#iframe-name")) == null ? void 0 : g.value.trim(), l = (v = e.querySelector("#iframe-title")) == null ? void 0 : v.value.trim(), i = (x = e.querySelector("#iframe-longdesc")) == null ? void 0 : x.value.trim(), d = (y = e.querySelector("#iframe-desc-url")) == null ? void 0 : y.value.trim(), f = ((k = e.querySelector("#iframe-border")) == null ? void 0 : k.checked) ?? !0, n = ((w = e.querySelector("#iframe-scrollbar")) == null ? void 0 : w.checked) ?? !0;
|
|
225
|
+
let m = a.formData.width, c = a.formData.height;
|
|
226
|
+
a.formData.selectedSize !== "inline" && (m = "100%", c = "auto"), P(t, {
|
|
221
227
|
src: r,
|
|
222
|
-
width:
|
|
223
|
-
height:
|
|
228
|
+
width: m,
|
|
229
|
+
height: c,
|
|
224
230
|
aspectRatio: a.formData.selectedSize,
|
|
225
231
|
name: o || void 0,
|
|
226
|
-
title:
|
|
227
|
-
longDescription:
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
232
|
+
title: l || void 0,
|
|
233
|
+
longDescription: i || void 0,
|
|
234
|
+
descriptionUrl: d || void 0,
|
|
235
|
+
showBorder: f,
|
|
236
|
+
enableScrollbar: n
|
|
237
|
+
}), p(t);
|
|
231
238
|
}
|
|
232
|
-
function
|
|
239
|
+
function P(e, t) {
|
|
233
240
|
const a = e.querySelector('[contenteditable="true"]');
|
|
234
241
|
a && (a.focus(), setTimeout(() => {
|
|
235
242
|
const r = [
|
|
@@ -243,28 +250,29 @@ function L(e, t) {
|
|
|
243
250
|
t.name && r.push(`name="${t.name}"`), t.title && r.push(`title="${t.title}"`), t.longDescription && r.push(`longdesc="${t.longDescription}"`);
|
|
244
251
|
const o = [];
|
|
245
252
|
t.aspectRatio !== "inline" && o.push(`rte-iframe-${t.aspectRatio}`);
|
|
246
|
-
const
|
|
247
|
-
if (!document.execCommand("insertHTML", !1,
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
for (;
|
|
256
|
-
|
|
257
|
-
|
|
253
|
+
const l = o.length > 0 ? `class="${o.join(" ")}"` : "", i = `data-aspect-ratio="${t.aspectRatio}"`, d = `<iframe ${r.join(" ")} ${l} ${i}></iframe>`;
|
|
254
|
+
if (!document.execCommand("insertHTML", !1, d)) {
|
|
255
|
+
const n = window.getSelection();
|
|
256
|
+
if (n && n.rangeCount > 0) {
|
|
257
|
+
const m = n.getRangeAt(0);
|
|
258
|
+
m.deleteContents();
|
|
259
|
+
const c = document.createElement("div");
|
|
260
|
+
c.innerHTML = d;
|
|
261
|
+
const b = document.createDocumentFragment();
|
|
262
|
+
for (; c.firstChild; )
|
|
263
|
+
b.appendChild(c.firstChild);
|
|
264
|
+
m.insertNode(b);
|
|
258
265
|
}
|
|
259
266
|
}
|
|
260
267
|
}, 10));
|
|
261
268
|
}
|
|
262
|
-
function
|
|
263
|
-
const t =
|
|
269
|
+
function p(e) {
|
|
270
|
+
const t = s(e);
|
|
264
271
|
t.escapeHandler && (document.removeEventListener("keydown", t.escapeHandler, !0), t.escapeHandler = null), t.dialogElement && (t.dialogElement.remove(), t.dialogElement = null);
|
|
265
272
|
}
|
|
266
|
-
function
|
|
267
|
-
if (document.getElementById("embed-iframe-dialog-styles"))
|
|
273
|
+
function R() {
|
|
274
|
+
if (document.getElementById("embed-iframe-dialog-styles"))
|
|
275
|
+
return;
|
|
268
276
|
const e = document.createElement("style");
|
|
269
277
|
e.id = "embed-iframe-dialog-styles", e.textContent = `
|
|
270
278
|
/* Embed Iframe Dialog Styles */
|
|
@@ -555,5 +563,5 @@ function z() {
|
|
|
555
563
|
`, document.head.appendChild(e);
|
|
556
564
|
}
|
|
557
565
|
export {
|
|
558
|
-
|
|
566
|
+
T as EmbedIframePlugin
|
|
559
567
|
};
|
package/dist/emojis.cjs.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p={all:{name:"All",emojis:["❤️","💔","💙","💚","💛","🖤","🤍","🤎","✔️","❌","☑️","❗","❓","⚠️","💯","➕","➖","✖️","➗","♻️","⚡","🔥","✨","⭐","⭕","🚫","😀","😃","😄","😁","😆","😅","😂","🤣","😊","😇","🙂","🙃","😉","😍","😘","😎","🤓","😐","😑","😬","🙄","😏","😌","🤩","🥳","🤔","😴","😭","😢","😡","🤯","👍","👎","👌","✌️","🤞","🙏","👏","🙌","💪","🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🐔","🐧","🐦","🦆","🦅","🦄","🐝","🦋","🌲","🌳","🌴","🌵","🌸","🌼","🌻","☀️","🌙","⭐","🌈","🌧️","❄️","🌊","🍎","🍌","🍉","🍇","🍓","🍒","🍍","🥭","🍐","🍊","🍋","🍑","🥝","🥑","🍔","🍟","🍕","🌭","🥪","🌮","🌯","🍣","🍜","🍰","🧁","🍩","🍪","🍫","☕","🍵","🥤","🍺","🍷","🍸","🍹","🥂","⚽","🏀","🏈","⚾","🎾","🏐","🏉","🎮","🎯","🎳","🎲","♟️","🏃","🚴","🏊","🏋️","🧘","🎸","🎹","🥁","🎺","🎤","🏆","🥇","🚗","🚕","🚌","🚎","🚓","🚑","🚒","✈️","🚀","🚁","🚤","🛳️","🚢","🏠","🏢","🏬","🏫","🏥","🏰","🗼","🗽","⛩️","🕌","🌍","🌎","🌏","🏖️","🏝️","📱","💻","🖥️","⌨️","🖱️","📷","📸","🎥","📹","📚","📖","📝","📄","📂","🔒","🔑","🗝️","💡","🔦","🕯️","🧰","🛠️","🔧","⚙️","📦","💳","💰","🔋","🔌","🇮🇳","🇺🇸","🇬🇧","🇨🇦","🇦🇺","🇩🇪","🇫🇷","🇪🇸","🇮🇹","🇯🇵","🇰🇷","🇨🇳","🇧🇷","🇲🇽","🇷🇺","🇿🇦","🇳🇿"]},symbols:{name:"Symbols",emojis:["❤️","💔","💙","💚","💛","🖤","🤍","🤎","✔️","❌","☑️","❗","❓","⚠️","💯","➕","➖","✖️","➗","♻️","⚡","🔥","✨","⭐","⭕","🚫","⬆️","⬇️","⬅️","➡️","🔄","🔁","🔀","🔔","🔕","⏰","⌛","⏳"]},people:{name:"People",emojis:["😀","😃","😄","😁","😆","😅","😂","🤣","😊","😇","🙂","🙃","😉","😍","😘","😎","🤓","😐","😑","😬","🙄","😏","😌","🤩","🥳","🤔","😴","😭","😢","😡","🤯","👍","👎","👌","✌️","🤞","🙏","👏","🙌","💪"]},"animals-nature":{name:"Animals & Nature",emojis:["🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🐔","🐧","🐦","🦆","🦅","🦄","🐝","🦋","🌲","🌳","🌴","🌵","🌸","🌼","🌻","☀️","🌙","⭐","🌈","🌧️","❄️","🌊"]},"food-drink":{name:"Food & Drink",emojis:["🍎","🍌","🍉","🍇","🍓","🍒","🍍","🥭","🍐","🍊","🍋","🍑","🥝","🥑","🍔","🍟","🍕","🌭","🥪","🌮","🌯","🍣","🍜","🍰","🧁","🍩","🍪","🍫","☕","🍵","🥤","🍺","🍷","🍸","🍹","🥂"]},activity:{name:"Activity",emojis:["⚽","🏀","🏈","⚾","🎾","🏐","🏉","🎮","🎯","🎳","🎲","♟️","🏃","🚴","🏊","🏋️","🧘","🎸","🎹","🥁","🎺","🎤","🏆","🥇","🥈","🥉"]},"travel-places":{name:"Travel & Places",emojis:["🚗","🚕","🚌","🚎","🚓","🚑","🚒","✈️","🚀","🚁","🚤","🛳️","🚢","🏠","🏢","🏬","🏫","🏥","🏰","🗼","🗽","⛩️","🕌","🌍","🌎","🌏","🏖️","🏝️"]},objects:{name:"Objects",emojis:["📱","💻","🖥️","⌨️","🖱️","📷","📸","🎥","📹","📚","📖","📝","📄","📂","🔒","🔑","🗝️","💡","🔦","🕯️","🧰","🛠️","🔧","⚙️","📦","💳","💰","🔋","🔌"]},flags:{name:"Flags",emojis:["🇮🇳","🇺🇸","🇬🇧","🇨🇦","🇦🇺","🇩🇪","🇫🇷","🇪🇸","🇮🇹","🇯🇵","🇰🇷","🇨🇳","🇧🇷","🇲🇽","🇷🇺","🇿🇦","🇳🇿"]}},
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p={all:{name:"All",emojis:["❤️","💔","💙","💚","💛","🖤","🤍","🤎","✔️","❌","☑️","❗","❓","⚠️","💯","➕","➖","✖️","➗","♻️","⚡","🔥","✨","⭐","⭕","🚫","😀","😃","😄","😁","😆","😅","😂","🤣","😊","😇","🙂","🙃","😉","😍","😘","😎","🤓","😐","😑","😬","🙄","😏","😌","🤩","🥳","🤔","😴","😭","😢","😡","🤯","👍","👎","👌","✌️","🤞","🙏","👏","🙌","💪","🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🐔","🐧","🐦","🦆","🦅","🦄","🐝","🦋","🌲","🌳","🌴","🌵","🌸","🌼","🌻","☀️","🌙","⭐","🌈","🌧️","❄️","🌊","🍎","🍌","🍉","🍇","🍓","🍒","🍍","🥭","🍐","🍊","🍋","🍑","🥝","🥑","🍔","🍟","🍕","🌭","🥪","🌮","🌯","🍣","🍜","🍰","🧁","🍩","🍪","🍫","☕","🍵","🥤","🍺","🍷","🍸","🍹","🥂","⚽","🏀","🏈","⚾","🎾","🏐","🏉","🎮","🎯","🎳","🎲","♟️","🏃","🚴","🏊","🏋️","🧘","🎸","🎹","🥁","🎺","🎤","🏆","🥇","🚗","🚕","🚌","🚎","🚓","🚑","🚒","✈️","🚀","🚁","🚤","🛳️","🚢","🏠","🏢","🏬","🏫","🏥","🏰","🗼","🗽","⛩️","🕌","🌍","🌎","🌏","🏖️","🏝️","📱","💻","🖥️","⌨️","🖱️","📷","📸","🎥","📹","📚","📖","📝","📄","📂","🔒","🔑","🗝️","💡","🔦","🕯️","🧰","🛠️","🔧","⚙️","📦","💳","💰","🔋","🔌","🇮🇳","🇺🇸","🇬🇧","🇨🇦","🇦🇺","🇩🇪","🇫🇷","🇪🇸","🇮🇹","🇯🇵","🇰🇷","🇨🇳","🇧🇷","🇲🇽","🇷🇺","🇿🇦","🇳🇿"]},symbols:{name:"Symbols",emojis:["❤️","💔","💙","💚","💛","🖤","🤍","🤎","✔️","❌","☑️","❗","❓","⚠️","💯","➕","➖","✖️","➗","♻️","⚡","🔥","✨","⭐","⭕","🚫","⬆️","⬇️","⬅️","➡️","🔄","🔁","🔀","🔔","🔕","⏰","⌛","⏳"]},people:{name:"People",emojis:["😀","😃","😄","😁","😆","😅","😂","🤣","😊","😇","🙂","🙃","😉","😍","😘","😎","🤓","😐","😑","😬","🙄","😏","😌","🤩","🥳","🤔","😴","😭","😢","😡","🤯","👍","👎","👌","✌️","🤞","🙏","👏","🙌","💪"]},"animals-nature":{name:"Animals & Nature",emojis:["🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🐔","🐧","🐦","🦆","🦅","🦄","🐝","🦋","🌲","🌳","🌴","🌵","🌸","🌼","🌻","☀️","🌙","⭐","🌈","🌧️","❄️","🌊"]},"food-drink":{name:"Food & Drink",emojis:["🍎","🍌","🍉","🍇","🍓","🍒","🍍","🥭","🍐","🍊","🍋","🍑","🥝","🥑","🍔","🍟","🍕","🌭","🥪","🌮","🌯","🍣","🍜","🍰","🧁","🍩","🍪","🍫","☕","🍵","🥤","🍺","🍷","🍸","🍹","🥂"]},activity:{name:"Activity",emojis:["⚽","🏀","🏈","⚾","🎾","🏐","🏉","🎮","🎯","🎳","🎲","♟️","🏃","🚴","🏊","🏋️","🧘","🎸","🎹","🥁","🎺","🎤","🏆","🥇","🥈","🥉"]},"travel-places":{name:"Travel & Places",emojis:["🚗","🚕","🚌","🚎","🚓","🚑","🚒","✈️","🚀","🚁","🚤","🛳️","🚢","🏠","🏢","🏬","🏫","🏥","🏰","🗼","🗽","⛩️","🕌","🌍","🌎","🌏","🏖️","🏝️"]},objects:{name:"Objects",emojis:["📱","💻","🖥️","⌨️","🖱️","📷","📸","🎥","📹","📚","📖","📝","📄","📂","🔒","🔑","🗝️","💡","🔦","🕯️","🧰","🛠️","🔧","⚙️","📦","💳","💰","🔋","🔌"]},flags:{name:"Flags",emojis:["🇮🇳","🇺🇸","🇬🇧","🇨🇦","🇦🇺","🇩🇪","🇫🇷","🇪🇸","🇮🇹","🇯🇵","🇰🇷","🇨🇳","🇧🇷","🇲🇽","🇷🇺","🇿🇦","🇳🇿"]}},w={"💙":"blue heart","💚":"green heart","💛":"yellow heart","🖤":"black heart","🤍":"white heart","🤎":"brown heart","☑️":"check box with check","🔴":"red circle","🟢":"green circle","🟡":"yellow circle","🔵":"blue circle","⬆️":"up arrow","⬇️":"down arrow","⬅️":"left arrow","➡️":"right arrow","🔄":"counterclockwise arrows","🔁":"repeat button","🔀":"shuffle tracks","🔔":"bell","🔕":"muted bell","⏰":"alarm clock","⏳":"hourglass not done","⌛":"hourglass done","♠️":"spade suit","♥️":"heart suit","♦️":"diamond suit","♣️":"club suit","🚫":"prohibited","⭕":"hollow red circle","❎":"cross mark button","😐":"neutral face","😑":"expressionless face","😬":"grimacing face","🙄":"face with rolling eyes","😏":"smirking face","😌":"relieved face","🤩":"star struck","😜":"winking face with tongue","😝":"squinting face with tongue","🤪":"zany face","😢":"crying face","😥":"sad but relieved face","😓":"downcast face with sweat","😱":"face screaming in fear","😨":"fearful face","🤗":"hugging face","🤭":"face with hand over mouth","🤫":"shushing face","🤥":"lying face","👌":"ok hand","✌️":"victory hand","🤞":"crossed fingers","🙌":"raising hands","💪":"flexed biceps","🐔":"chicken","🐧":"penguin","🐦":"bird","🐤":"baby chick","🦆":"duck","🦅":"eagle","🐺":"wolf","🦄":"unicorn","🐝":"honeybee","🐞":"lady beetle","🦋":"butterfly","🐢":"turtle","🐍":"snake","🦖":"t-rex","🌿":"herb","🍀":"four leaf clover","🍁":"maple leaf","🍂":"fallen leaf","🌊":"water wave","❄️":"snowflake","☁️":"cloud","⛈️":"cloud with lightning and rain","🌪️":"tornado","🍐":"pear","🍊":"tangerine","🍋":"lemon","🍑":"peach","🥝":"kiwi fruit","🥑":"avocado","🍆":"eggplant","🌽":"ear of corn","🥕":"carrot","🥔":"potato","🍞":"bread","🥐":"croissant","🥖":"baguette bread","🧀":"cheese wedge","🍖":"meat on bone","🍗":"poultry leg","🥩":"cut of meat","🍦":"soft ice cream","🍨":"ice cream","🍫":"chocolate bar","🍬":"candy","🥛":"glass of milk","🧃":"beverage box","🍹":"tropical drink","🥂":"clinking glasses","🏓":"ping pong","🥊":"boxing glove","🥋":"martial arts uniform","⛳":"flag in hole","🏹":"bow and arrow","🎿":"skis","⛷️":"skier","🏂":"snowboarder","🎤":"microphone","🎬":"clapper board","🎨":"artist palette","🧩":"puzzle piece","🪀":"yo-yo","🚇":"metro","🚉":"station","🚊":"tram","🚝":"monorail","🛻":"pickup truck","🚐":"minibus","🗺️":"world map","🧭":"compass","⛰️":"mountain","🏔️":"snow capped mountain","🌋":"volcano","🏜️":"desert","🏕️":"camping","🏙️":"cityscape","🌆":"city at dusk","🌃":"night with stars","📦":"package","📫":"closed mailbox with raised flag","📬":"open mailbox with raised flag","📭":"open mailbox with lowered flag","🧾":"receipt","💳":"credit card","💰":"money bag","🪙":"coin","🔋":"battery","🔌":"electric plug","🧯":"fire extinguisher","🪜":"ladder","🪞":"mirror","🧹":"broom","🧸":"teddy bear"};let g=null,c="all",u="",n=null,l=null,d=null;const y='[data-theme="dark"], .dark, .editora-theme-dark',E=()=>({name:"emojis",toolbar:[{label:"Insert Emoji",command:"openEmojiDialog",icon:'<svg width="24" height="24" focusable="false"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 14.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13Z" fill-rule="nonzero"></path></svg>',shortcut:"Mod-Shift-j",type:"button"}],commands:{openEmojiDialog:(r,t)=>{const e=(t==null?void 0:t.contentElement)||b();return e?(z(e),!0):!1},insertEmoji:(r,t)=>{if(!r)return!1;const e=(t==null?void 0:t.contentElement)||b();if(!e)return!1;try{return k(r,e),!0}catch{return!1}}},keymap:{"Mod-Shift-j":"openEmojiDialog"}});function z(r){m(),c="all",u="";const t=window.getSelection();l=null,t&&t.rangeCount>0&&r.contains(t.anchorNode)&&(l=t.getRangeAt(0).cloneRange());const e=document.createElement("div");e.className="emojis-overlay",L(r)&&e.classList.add("rte-ui-theme-dark"),e.onclick=m;const o=document.createElement("div");o.className="emojis-dialog",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.onclick=i=>i.stopPropagation();const a=Object.keys(p);o.innerHTML=`
|
|
2
2
|
<div class="rte-dialog-header emojis-header">
|
|
3
3
|
<h3>Insert Emojis</h3>
|
|
4
4
|
<button class="rte-dialog-close emojis-close">×</button>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="rte-dialog-body emojis-content">
|
|
7
7
|
<div class="emojis-tabs">
|
|
8
|
-
${
|
|
9
|
-
<button class="emojis-tab ${
|
|
10
|
-
${p[
|
|
8
|
+
${a.map(i=>`
|
|
9
|
+
<button class="emojis-tab ${i===c?"active":""}" data-category="${i}">
|
|
10
|
+
${p[i].name}
|
|
11
11
|
</button>
|
|
12
12
|
`).join("")}
|
|
13
13
|
</div>
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
/>
|
|
26
26
|
</div>
|
|
27
27
|
<div class="emojis-grid" id="emojis-grid">
|
|
28
|
-
${
|
|
28
|
+
${x(c,u)}
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
31
|
</div>
|
|
32
|
-
`,e.appendChild(o),document.body.appendChild(e),g=e,d=
|
|
32
|
+
`,e.appendChild(o),document.body.appendChild(e),g=e,d=i=>{i.key==="Escape"&&(i.preventDefault(),i.stopPropagation(),m())},document.addEventListener("keydown",d,!0),S(o,r),C(),requestAnimationFrame(()=>{var i;(i=o.querySelector("#emoji-search-input"))==null||i.focus()})}function S(r,t){var a;(a=r.querySelector(".emojis-close"))==null||a.addEventListener("click",m),r.querySelectorAll(".emojis-tab").forEach(i=>{i.addEventListener("click",f=>{const s=f.target.getAttribute("data-category");s&&A(r,s)})});const e=r.querySelector("#emoji-search-input");e==null||e.addEventListener("input",i=>{u=i.target.value,n!==null&&window.clearTimeout(n),n=window.setTimeout(()=>{n=null,v(r)},90)});const o=r.querySelector("#emojis-grid");o==null||o.addEventListener("click",i=>{var j;const s=i.target.closest(".emojis-item");if(!s)return;const h=s.getAttribute("data-emoji")||((j=s.textContent)==null?void 0:j.trim())||"";h&&(k(h,t),m())})}function A(r,t){c=t,r.querySelectorAll(".emojis-tab").forEach(e=>{e.classList.toggle("active",e.getAttribute("data-category")===t)}),v(r)}function v(r){const t=r.querySelector("#emojis-grid");t&&(t.innerHTML=x(c,u))}function x(r,t){let e=p[r].emojis;return t.trim()&&(e=e.filter(o=>o.toLowerCase().includes(t.toLowerCase())?!0:(w[o]||"").toLowerCase().includes(t.toLowerCase()))),e.length===0&&t.trim()?`<div class="emojis-no-results">No emojis found for "${t}"</div>`:e.map((o,a)=>`
|
|
33
33
|
<button
|
|
34
34
|
class="emojis-item"
|
|
35
35
|
title="Insert ${o}"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
>
|
|
38
38
|
${o}
|
|
39
39
|
</button>
|
|
40
|
-
`).join("")}function m(){d&&(document.removeEventListener("keydown",d,!0),d=null),n!==null&&(window.clearTimeout(n),n=null),g&&(g.remove(),g=null)}function
|
|
40
|
+
`).join("")}function m(){d&&(document.removeEventListener("keydown",d,!0),d=null),n!==null&&(window.clearTimeout(n),n=null),g&&(g.remove(),g=null)}function k(r,t){t.focus();let e=window.getSelection();if(l&&(e==null||e.removeAllRanges(),e==null||e.addRange(l),l=null),e=window.getSelection(),e&&e.rangeCount>0){const o=e.getRangeAt(0);o.deleteContents();const a=document.createTextNode(r);o.insertNode(a),o.setStartAfter(a),o.setEndAfter(a),e.removeAllRanges(),e.addRange(o)}}function b(){const r=window.getSelection();if(r&&r.rangeCount>0){const e=r.anchorNode,o=e instanceof HTMLElement?e:e==null?void 0:e.parentElement,a=o==null?void 0:o.closest(".editora-content, .rte-content");if(a)return a}const t=document.activeElement;return t&&(t.classList.contains("editora-content")||t.classList.contains("rte-content"))?t:document.querySelector(".editora-content, .rte-content")}function L(r){const t=r||b();return t?!!t.closest(y):!1}function C(){if(document.getElementById("emojis-dialog-styles"))return;const r=document.createElement("style");r.id="emojis-dialog-styles",r.textContent=`
|
|
41
41
|
.emojis-overlay {
|
|
42
42
|
--rte-emoji-overlay-bg: rgba(15, 23, 36, 0.56);
|
|
43
43
|
--rte-emoji-dialog-bg: #ffffff;
|
|
@@ -306,4 +306,4 @@
|
|
|
306
306
|
font-size: 16px;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
`,document.head.appendChild(
|
|
309
|
+
`,document.head.appendChild(r)}exports.EmojisPlugin=E;
|