@editora/plugins 1.0.7 → 1.0.8
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 +50 -4
- package/dist/_commonjsHelpers-BH3jXuIh.js +1 -0
- package/dist/_commonjsHelpers-ByX85dGu.mjs +33 -0
- package/dist/anchor.cjs.js +11 -11
- package/dist/anchor.esm.js +130 -107
- package/dist/anchoredPopover-BzqGPOAE.js +1 -0
- package/dist/anchoredPopover-Dts0IrgU.mjs +106 -0
- package/dist/background-color.cjs.js +3 -3
- package/dist/background-color.esm.js +116 -119
- package/dist/code.cjs.js +82 -102
- package/dist/code.esm.js +1172 -662
- package/dist/comments.cjs.js +10 -10
- package/dist/comments.esm.js +195 -177
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +1 -1
- package/dist/documentManager-CTqRftU8.mjs +8369 -0
- package/dist/documentManager-Jf0RbSks.js +17 -0
- package/dist/embed-iframe.cjs.js +2 -2
- package/dist/embed-iframe.esm.js +8 -5
- package/dist/emojis.cjs.js +64 -39
- package/dist/emojis.esm.js +133 -104
- package/dist/html2canvas.esm-B5qzocYs.js +5 -0
- package/dist/html2canvas.esm-BWVIUcAF.mjs +4802 -0
- package/dist/{index-Bskk414V.mjs → index-BFsKNTTj.mjs} +50 -50
- package/dist/index-CvJk4DKa.js +221 -0
- package/dist/index-D3CycEFU.mjs +16543 -0
- package/dist/index-tqLTHcO6.js +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/{index.es-Cz1qItab.js → index.es-CE_A4QSm.js} +5 -5
- package/dist/{index.es-DEcRmSTY.mjs → index.es-DQ78mYYo.mjs} +4 -3
- package/dist/index.esm.js +87 -79
- package/dist/jspdf.es.min-BoS80556.js +77 -0
- package/dist/jspdf.es.min-DQCoX5yh.mjs +7889 -0
- package/dist/link.cjs.js +6 -6
- package/dist/link.esm.js +41 -39
- package/dist/math.cjs.js +21 -21
- package/dist/math.esm.js +151 -112
- package/dist/media-manager.cjs.js +15 -15
- package/dist/media-manager.esm.js +227 -206
- package/dist/merge-tag.cjs.js +44 -12
- package/dist/merge-tag.esm.js +368 -241
- package/dist/page-break.cjs.js +2 -2
- package/dist/page-break.esm.js +77 -69
- package/dist/special-characters.cjs.js +83 -45
- package/dist/special-characters.esm.js +149 -100
- package/dist/spell-check.cjs.js +9 -9
- package/dist/spell-check.esm.js +235 -216
- package/dist/template.cjs.js +14 -14
- package/dist/template.esm.js +157 -131
- package/dist/text-color.cjs.js +9 -9
- package/dist/text-color.esm.js +131 -115
- package/index.d.ts +51 -1
- package/package.json +3 -3
- package/dist/colorSelectionApply-C0iOfMWb.js +0 -1
- package/dist/colorSelectionApply-D8r_gV32.mjs +0 -63
- package/dist/documentManager-DRUc1-Cs.mjs +0 -37581
- package/dist/documentManager-_tQQfQi9.js +0 -317
- package/dist/index-D3pJyAsj.js +0 -1
package/dist/page-break.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d='.rte-page-break[data-type="page-break"]',g=".rte-content, .editora-content";let p=null,m=!1;const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d='.rte-page-break[data-type="page-break"]',g=".rte-content, .editora-content";let p=null,m=!1;const h=(e,n)=>{if(n===e.innerHTML)return;const t=window.execEditorCommand||window.executeEditorCommand;if(typeof t=="function")try{t("recordDomTransaction",e,n,e.innerHTML)}catch{}},x=new Set(["DIV","P","BLOCKQUOTE","PRE","H1","H2","H3","H4","H5","H6","LI","TD","TH"]),w=()=>{p||typeof document>"u"||(p=document.createElement("style"),p.textContent=`
|
|
2
2
|
.rte-page-break {
|
|
3
3
|
display: block;
|
|
4
4
|
position: relative;
|
|
@@ -69,4 +69,4 @@
|
|
|
69
69
|
display: none;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
`,document.head.appendChild(p))},N=()=>{const e=window.getSelection();if(!e||e.rangeCount===0)return null;const n=e.getRangeAt(0);return(n.startContainer.nodeType===Node.ELEMENT_NODE?n.startContainer:n.startContainer.parentElement)?.closest(g)||null},v=()=>{const e=N();if(e)return e;const t=document.activeElement?.closest(g);return t||document.querySelector(g)},C=(e,n)=>{let t=e;for(;t&&t!==n;){if(t.nodeType===Node.ELEMENT_NODE){const r=t;if(
|
|
72
|
+
`,document.head.appendChild(p))},N=()=>{const e=window.getSelection();if(!e||e.rangeCount===0)return null;const n=e.getRangeAt(0);return(n.startContainer.nodeType===Node.ELEMENT_NODE?n.startContainer:n.startContainer.parentElement)?.closest(g)||null},v=()=>{const e=N();if(e)return e;const t=document.activeElement?.closest(g);return t||document.querySelector(g)},C=(e,n)=>{let t=e;for(;t&&t!==n;){if(t.nodeType===Node.ELEMENT_NODE){const r=t;if(x.has(r.tagName))return r}t=t.parentNode}return null},S=()=>{const e=document.createElement("div");return e.className="rte-page-break",e.setAttribute("data-page-break","true"),e.setAttribute("data-type","page-break"),e.setAttribute("contenteditable","false"),e.setAttribute("tabindex","0"),e.setAttribute("role","separator"),e.setAttribute("aria-label","Page break"),e},T=e=>{let n=e.nextElementSibling;for(;n&&n.matches(d);){const r=n;n=n.nextElementSibling,r.remove()}let t=e.previousElementSibling;for(;t&&t.matches(d);){const r=t;t=t.previousElementSibling,r.remove()}},k=e=>{const n=e.nextElementSibling;if(n&&!n.matches(d))return n;const t=document.createElement("p");return t.innerHTML="<br>",e.parentNode?.insertBefore(t,e.nextSibling),t},u=e=>{const n=window.getSelection();if(!n)return;const t=document.createRange();e.nodeType,Node.TEXT_NODE,t.setStart(e,0),t.collapse(!0),n.removeAllRanges(),n.addRange(t)},b=e=>{const n=window.getSelection();if(!n)return;const t=document.createRange();if(e.nodeType===Node.TEXT_NODE){const r=e;t.setStart(r,r.data.length)}else t.selectNodeContents(e),t.collapse(!1);n.removeAllRanges(),n.addRange(t)},f=(e,n)=>{let t=e;for(;t;){if(!(t instanceof HTMLElement&&t.matches(d)))return t;t=n==="previous"?t.previousSibling:t.nextSibling}return null},L=e=>{const n=window.getSelection();if(!n||!e.parentNode)return;const t=e.parentNode,r=Array.from(t.childNodes).indexOf(e);if(r<0)return;const o=document.createRange();o.setStart(t,r),o.setEnd(t,r+1),n.removeAllRanges(),n.addRange(o),e.focus({preventScroll:!0})},A=e=>{if(e.collapsed||e.startContainer!==e.endContainer||e.endOffset!==e.startOffset+1||!(e.startContainer instanceof Element||e.startContainer instanceof DocumentFragment))return null;const n=e.startContainer.childNodes[e.startOffset];return n instanceof HTMLElement&&n.matches(d)?n:null},R=(e,n,t)=>{if(!e.collapsed)return null;const{startContainer:r,startOffset:o}=e,a=i=>i instanceof HTMLElement&&i.matches(d)?i:null,c=i=>{if(r.nodeType===Node.ELEMENT_NODE){const l=r;if(i==="previous"){if(o>0)return l.childNodes[o-1]||null}else if(o<l.childNodes.length)return l.childNodes[o]||null}if(r.nodeType===Node.TEXT_NODE&&(i==="previous"&&o<r.data.length||i==="next"&&o>0))return null;let s=r;for(;s&&s!==n;){const l=i==="previous"?s.previousSibling:s.nextSibling;if(l)return l;s=s.parentNode}return null};if(r.nodeType===Node.ELEMENT_NODE){const i=r;return t==="Backspace"&&o>0?a(i.childNodes[o-1]||null):t==="Delete"?a(i.childNodes[o]||null):null}if(r.nodeType===Node.TEXT_NODE){const i=r;if(t==="Backspace"&&o===0){const s=a(i.previousSibling);return s||a(c("previous"))}if(t==="Delete"&&o===i.data.length){const s=a(i.nextSibling);return s||a(c("next"))}}return a(c(t==="Backspace"?"previous":"next"))},E=(e,n)=>{const t=e.closest(g),r=t?.innerHTML??"",o=e.previousSibling,a=e.nextSibling;e.remove();const c=f(o,"previous"),i=f(a,"next");if(n==="Backspace"){if(c)b(c);else if(i)u(i);else if(t){const s=document.createElement("p");s.innerHTML="<br>",t.appendChild(s),u(s)}}else if(i)u(i);else if(c)b(c);else if(t){const s=document.createElement("p");s.innerHTML="<br>",t.appendChild(s),u(s)}return t&&(h(t,r),t.dispatchEvent(new Event("input",{bubbles:!0}))),!0},y=()=>{const e=v();if(!e)return!1;const n=e.innerHTML,t=window.getSelection();if(!t)return!1;let r;t.rangeCount>0&&e.contains(t.getRangeAt(0).commonAncestorContainer)?r=t.getRangeAt(0):(r=document.createRange(),r.selectNodeContents(e),r.collapse(!1),t.removeAllRanges(),t.addRange(r));const o=C(r.endContainer,e)||C(r.startContainer,e),a=S();o&&o.parentNode?o.parentNode.insertBefore(a,o.nextSibling):e.appendChild(a),T(a);const c=k(a);return u(c),h(e,n),e.dispatchEvent(new Event("input",{bubbles:!0})),!0},B=()=>{m||typeof document>"u"||(m=!0,document.addEventListener("click",e=>{const t=e.target?.closest(d);t&&(e.preventDefault(),e.stopPropagation(),L(t))}),document.addEventListener("keydown",e=>{const n=e.key;if(!["Backspace","Delete","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(n))return;const t=window.getSelection();if(!t||t.rangeCount===0)return;const r=t.getRangeAt(0),o=v();if(!o||!o.contains(r.commonAncestorContainer))return;const a=A(r);if(a){if(n==="Backspace"||n==="Delete"){e.preventDefault(),e.stopPropagation(),E(a,n);return}if(n==="ArrowRight"||n==="ArrowDown"){e.preventDefault();const c=f(a.nextSibling,"next")||k(a);u(c);return}if(n==="ArrowLeft"||n==="ArrowUp"){e.preventDefault();const c=f(a.previousSibling,"previous");c?b(c):u(o);return}}if(n==="Backspace"||n==="Delete"){const c=R(r,o,n);if(!c)return;e.preventDefault(),e.stopPropagation(),E(c,n)}}))},P=()=>(w(),B(),{name:"pageBreak",toolbar:[{label:"Page Break",command:"insertPageBreak",icon:'<svg fill="#000000" width="24px" height="24px" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><path d="M1,6 L3,6 C3.55228475,6 4,6.44771525 4,7 C4,7.55228475 3.55228475,8 3,8 L1,8 C0.44771525,8 0,7.55228475 0,7 C0,6.44771525 0.44771525,6 1,6 Z M11,6 L13,6 C13.5522847,6 14,6.44771525 14,7 C14,7.55228475 13.5522847,8 13,8 L11,8 C10.4477153,8 10,7.55228475 10,7 C10,6.44771525 10.4477153,6 11,6 Z M6,6 L8,6 C8.55228475,6 9,6.44771525 9,7 C9,7.55228475 8.55228475,8 8,8 L6,8 C5.44771525,8 5,7.55228475 5,7 C5,6.44771525 5.44771525,6 6,6 Z M0,1 C0,0.44771525 0.44771525,-2.26485497e-13 1,-2.26485497e-13 C1.55228475,-2.26485497e-13 2,0.44771525 2,1 L2,3.0142458 L12,3.0142458 L12,1 C12,0.44771525 12.4477153,-2.26485497e-13 13,-2.26485497e-13 C13.5522847,-2.26485497e-13 14,0.44771525 14,1 L14,3.0142458 C14,4.1188153 13.1045695,5.0142458 12,5.0142458 L2,5.0142458 C0.8954305,5.0142458 0,4.1188153 0,3.0142458 L0,1 Z M0,13.0142458 L0,11 C0,9.8954305 0.8954305,9 2,9 L12,9 C13.1045695,9 14,9.8954305 14,11 L14,13.0142458 C14,13.5665305 13.5522847,14.0142458 13,14.0142458 C12.4477153,14.0142458 12,13.5665305 12,13.0142458 L12,11 L2,11 L2,13.0142458 C2,13.5665305 1.55228475,14.0142458 1,14.0142458 C0.44771525,14.0142458 0,13.5665305 0,13.0142458 Z"></path></g></svg>',shortcut:"Mod-Enter"}],commands:{insertPageBreak:y},keymap:{"Mod-Enter":"insertPageBreak"}});exports.PageBreakPlugin=P;
|
package/dist/page-break.esm.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
const u = '.rte-page-break[data-type="page-break"]', g = ".rte-content, .editora-content";
|
|
2
2
|
let p = null, m = !1;
|
|
3
|
-
const
|
|
3
|
+
const h = (e, n) => {
|
|
4
|
+
if (n === e.innerHTML) return;
|
|
5
|
+
const t = window.execEditorCommand || window.executeEditorCommand;
|
|
6
|
+
if (typeof t == "function")
|
|
7
|
+
try {
|
|
8
|
+
t("recordDomTransaction", e, n, e.innerHTML);
|
|
9
|
+
} catch {
|
|
10
|
+
}
|
|
11
|
+
}, x = /* @__PURE__ */ new Set([
|
|
4
12
|
"DIV",
|
|
5
13
|
"P",
|
|
6
14
|
"BLOCKQUOTE",
|
|
@@ -14,7 +22,7 @@ const v = /* @__PURE__ */ new Set([
|
|
|
14
22
|
"LI",
|
|
15
23
|
"TD",
|
|
16
24
|
"TH"
|
|
17
|
-
]),
|
|
25
|
+
]), w = () => {
|
|
18
26
|
p || typeof document > "u" || (p = document.createElement("style"), p.textContent = `
|
|
19
27
|
.rte-page-break {
|
|
20
28
|
display: block;
|
|
@@ -92,7 +100,7 @@ const v = /* @__PURE__ */ new Set([
|
|
|
92
100
|
if (!e || e.rangeCount === 0) return null;
|
|
93
101
|
const n = e.getRangeAt(0);
|
|
94
102
|
return (n.startContainer.nodeType === Node.ELEMENT_NODE ? n.startContainer : n.startContainer.parentElement)?.closest(g) || null;
|
|
95
|
-
},
|
|
103
|
+
}, k = () => {
|
|
96
104
|
const e = N();
|
|
97
105
|
if (e) return e;
|
|
98
106
|
const t = document.activeElement?.closest(g);
|
|
@@ -102,13 +110,13 @@ const v = /* @__PURE__ */ new Set([
|
|
|
102
110
|
for (; t && t !== n; ) {
|
|
103
111
|
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
104
112
|
const r = t;
|
|
105
|
-
if (
|
|
113
|
+
if (x.has(r.tagName))
|
|
106
114
|
return r;
|
|
107
115
|
}
|
|
108
116
|
t = t.parentNode;
|
|
109
117
|
}
|
|
110
118
|
return null;
|
|
111
|
-
},
|
|
119
|
+
}, T = () => {
|
|
112
120
|
const e = document.createElement("div");
|
|
113
121
|
return e.className = "rte-page-break", e.setAttribute("data-page-break", "true"), e.setAttribute("data-type", "page-break"), e.setAttribute("contenteditable", "false"), e.setAttribute("tabindex", "0"), e.setAttribute("role", "separator"), e.setAttribute("aria-label", "Page break"), e;
|
|
114
122
|
}, S = (e) => {
|
|
@@ -122,7 +130,7 @@ const v = /* @__PURE__ */ new Set([
|
|
|
122
130
|
const r = t;
|
|
123
131
|
t = t.previousElementSibling, r.remove();
|
|
124
132
|
}
|
|
125
|
-
},
|
|
133
|
+
}, v = (e) => {
|
|
126
134
|
const n = e.nextElementSibling;
|
|
127
135
|
if (n && !n.matches(u))
|
|
128
136
|
return n;
|
|
@@ -151,129 +159,129 @@ const v = /* @__PURE__ */ new Set([
|
|
|
151
159
|
t = n === "previous" ? t.previousSibling : t.nextSibling;
|
|
152
160
|
}
|
|
153
161
|
return null;
|
|
154
|
-
},
|
|
162
|
+
}, L = (e) => {
|
|
155
163
|
const n = window.getSelection();
|
|
156
164
|
if (!n || !e.parentNode) return;
|
|
157
165
|
const t = e.parentNode, r = Array.from(t.childNodes).indexOf(e);
|
|
158
166
|
if (r < 0) return;
|
|
159
167
|
const o = document.createRange();
|
|
160
168
|
o.setStart(t, r), o.setEnd(t, r + 1), n.removeAllRanges(), n.addRange(o), e.focus({ preventScroll: !0 });
|
|
161
|
-
},
|
|
169
|
+
}, A = (e) => {
|
|
162
170
|
if (e.collapsed || e.startContainer !== e.endContainer || e.endOffset !== e.startOffset + 1 || !(e.startContainer instanceof Element || e.startContainer instanceof DocumentFragment)) return null;
|
|
163
171
|
const n = e.startContainer.childNodes[e.startOffset];
|
|
164
172
|
return n instanceof HTMLElement && n.matches(u) ? n : null;
|
|
165
|
-
},
|
|
173
|
+
}, R = (e, n, t) => {
|
|
166
174
|
if (!e.collapsed) return null;
|
|
167
|
-
const { startContainer: r, startOffset: o } = e,
|
|
175
|
+
const { startContainer: r, startOffset: o } = e, a = (i) => i instanceof HTMLElement && i.matches(u) ? i : null, c = (i) => {
|
|
168
176
|
if (r.nodeType === Node.ELEMENT_NODE) {
|
|
169
|
-
const
|
|
170
|
-
if (
|
|
177
|
+
const l = r;
|
|
178
|
+
if (i === "previous") {
|
|
171
179
|
if (o > 0)
|
|
172
|
-
return
|
|
173
|
-
} else if (o <
|
|
174
|
-
return
|
|
180
|
+
return l.childNodes[o - 1] || null;
|
|
181
|
+
} else if (o < l.childNodes.length)
|
|
182
|
+
return l.childNodes[o] || null;
|
|
175
183
|
}
|
|
176
|
-
if (r.nodeType === Node.TEXT_NODE && (
|
|
184
|
+
if (r.nodeType === Node.TEXT_NODE && (i === "previous" && o < r.data.length || i === "next" && o > 0))
|
|
177
185
|
return null;
|
|
178
|
-
let
|
|
179
|
-
for (;
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
182
|
-
|
|
186
|
+
let s = r;
|
|
187
|
+
for (; s && s !== n; ) {
|
|
188
|
+
const l = i === "previous" ? s.previousSibling : s.nextSibling;
|
|
189
|
+
if (l) return l;
|
|
190
|
+
s = s.parentNode;
|
|
183
191
|
}
|
|
184
192
|
return null;
|
|
185
193
|
};
|
|
186
194
|
if (r.nodeType === Node.ELEMENT_NODE) {
|
|
187
|
-
const
|
|
188
|
-
return t === "Backspace" && o > 0 ? i
|
|
195
|
+
const i = r;
|
|
196
|
+
return t === "Backspace" && o > 0 ? a(i.childNodes[o - 1] || null) : t === "Delete" ? a(i.childNodes[o] || null) : null;
|
|
189
197
|
}
|
|
190
198
|
if (r.nodeType === Node.TEXT_NODE) {
|
|
191
|
-
const
|
|
199
|
+
const i = r;
|
|
192
200
|
if (t === "Backspace" && o === 0) {
|
|
193
|
-
const
|
|
194
|
-
return
|
|
201
|
+
const s = a(i.previousSibling);
|
|
202
|
+
return s || a(c("previous"));
|
|
195
203
|
}
|
|
196
|
-
if (t === "Delete" && o ===
|
|
197
|
-
const
|
|
198
|
-
return
|
|
204
|
+
if (t === "Delete" && o === i.data.length) {
|
|
205
|
+
const s = a(i.nextSibling);
|
|
206
|
+
return s || a(c("next"));
|
|
199
207
|
}
|
|
200
208
|
}
|
|
201
|
-
return
|
|
209
|
+
return a(c(t === "Backspace" ? "previous" : "next"));
|
|
202
210
|
}, E = (e, n) => {
|
|
203
|
-
const t = e.closest(g), r = e.previousSibling,
|
|
211
|
+
const t = e.closest(g), r = t?.innerHTML ?? "", o = e.previousSibling, a = e.nextSibling;
|
|
204
212
|
e.remove();
|
|
205
|
-
const
|
|
213
|
+
const c = f(o, "previous"), i = f(a, "next");
|
|
206
214
|
if (n === "Backspace") {
|
|
207
|
-
if (
|
|
208
|
-
b(
|
|
209
|
-
else if (
|
|
210
|
-
d(
|
|
215
|
+
if (c)
|
|
216
|
+
b(c);
|
|
217
|
+
else if (i)
|
|
218
|
+
d(i);
|
|
211
219
|
else if (t) {
|
|
212
|
-
const
|
|
213
|
-
|
|
220
|
+
const s = document.createElement("p");
|
|
221
|
+
s.innerHTML = "<br>", t.appendChild(s), d(s);
|
|
214
222
|
}
|
|
215
|
-
} else if (
|
|
216
|
-
d(
|
|
217
|
-
else if (
|
|
218
|
-
b(
|
|
223
|
+
} else if (i)
|
|
224
|
+
d(i);
|
|
225
|
+
else if (c)
|
|
226
|
+
b(c);
|
|
219
227
|
else if (t) {
|
|
220
|
-
const
|
|
221
|
-
|
|
228
|
+
const s = document.createElement("p");
|
|
229
|
+
s.innerHTML = "<br>", t.appendChild(s), d(s);
|
|
222
230
|
}
|
|
223
|
-
return t && t.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
|
|
224
|
-
},
|
|
225
|
-
const e =
|
|
231
|
+
return t && (h(t, r), t.dispatchEvent(new Event("input", { bubbles: !0 }))), !0;
|
|
232
|
+
}, y = () => {
|
|
233
|
+
const e = k();
|
|
226
234
|
if (!e) return !1;
|
|
227
|
-
const n = window.getSelection();
|
|
228
|
-
if (!
|
|
229
|
-
let
|
|
230
|
-
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
const
|
|
234
|
-
return d(
|
|
235
|
+
const n = e.innerHTML, t = window.getSelection();
|
|
236
|
+
if (!t) return !1;
|
|
237
|
+
let r;
|
|
238
|
+
t.rangeCount > 0 && e.contains(t.getRangeAt(0).commonAncestorContainer) ? r = t.getRangeAt(0) : (r = document.createRange(), r.selectNodeContents(e), r.collapse(!1), t.removeAllRanges(), t.addRange(r));
|
|
239
|
+
const o = C(r.endContainer, e) || C(r.startContainer, e), a = T();
|
|
240
|
+
o && o.parentNode ? o.parentNode.insertBefore(a, o.nextSibling) : e.appendChild(a), S(a);
|
|
241
|
+
const c = v(a);
|
|
242
|
+
return d(c), h(e, n), e.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
|
|
235
243
|
}, B = () => {
|
|
236
244
|
m || typeof document > "u" || (m = !0, document.addEventListener("click", (e) => {
|
|
237
245
|
const t = e.target?.closest(u);
|
|
238
|
-
t && (e.preventDefault(), e.stopPropagation(),
|
|
246
|
+
t && (e.preventDefault(), e.stopPropagation(), L(t));
|
|
239
247
|
}), document.addEventListener("keydown", (e) => {
|
|
240
248
|
const n = e.key;
|
|
241
249
|
if (!["Backspace", "Delete", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n))
|
|
242
250
|
return;
|
|
243
251
|
const t = window.getSelection();
|
|
244
252
|
if (!t || t.rangeCount === 0) return;
|
|
245
|
-
const r = t.getRangeAt(0), o =
|
|
253
|
+
const r = t.getRangeAt(0), o = k();
|
|
246
254
|
if (!o || !o.contains(r.commonAncestorContainer)) return;
|
|
247
|
-
const
|
|
248
|
-
if (
|
|
255
|
+
const a = A(r);
|
|
256
|
+
if (a) {
|
|
249
257
|
if (n === "Backspace" || n === "Delete") {
|
|
250
|
-
e.preventDefault(), e.stopPropagation(), E(
|
|
258
|
+
e.preventDefault(), e.stopPropagation(), E(a, n);
|
|
251
259
|
return;
|
|
252
260
|
}
|
|
253
261
|
if (n === "ArrowRight" || n === "ArrowDown") {
|
|
254
262
|
e.preventDefault();
|
|
255
|
-
const
|
|
256
|
-
d(
|
|
263
|
+
const c = f(a.nextSibling, "next") || v(a);
|
|
264
|
+
d(c);
|
|
257
265
|
return;
|
|
258
266
|
}
|
|
259
267
|
if (n === "ArrowLeft" || n === "ArrowUp") {
|
|
260
268
|
e.preventDefault();
|
|
261
|
-
const
|
|
262
|
-
|
|
269
|
+
const c = f(a.previousSibling, "previous");
|
|
270
|
+
c ? b(c) : d(o);
|
|
263
271
|
return;
|
|
264
272
|
}
|
|
265
273
|
}
|
|
266
274
|
if (n === "Backspace" || n === "Delete") {
|
|
267
|
-
const
|
|
275
|
+
const c = R(
|
|
268
276
|
r,
|
|
269
277
|
o,
|
|
270
278
|
n
|
|
271
279
|
);
|
|
272
|
-
if (!
|
|
273
|
-
e.preventDefault(), e.stopPropagation(), E(
|
|
280
|
+
if (!c) return;
|
|
281
|
+
e.preventDefault(), e.stopPropagation(), E(c, n);
|
|
274
282
|
}
|
|
275
283
|
}));
|
|
276
|
-
}, D = () => (
|
|
284
|
+
}, D = () => (w(), B(), {
|
|
277
285
|
name: "pageBreak",
|
|
278
286
|
toolbar: [
|
|
279
287
|
{
|
|
@@ -284,7 +292,7 @@ const v = /* @__PURE__ */ new Set([
|
|
|
284
292
|
}
|
|
285
293
|
],
|
|
286
294
|
commands: {
|
|
287
|
-
insertPageBreak:
|
|
295
|
+
insertPageBreak: y
|
|
288
296
|
},
|
|
289
297
|
keymap: {
|
|
290
298
|
"Mod-Enter": "insertPageBreak"
|
|
@@ -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 g={all:{name:"All",characters:["€","£","¥","¢","₹","₽","₩","₿","₺","₴","₦","₨","₪","₫","₭","₮","₯","₰","₱","₲","₳","₴","₵","₶","₷","₹","₺","₼","₽","₾","₿",'"',"'","«","»","„","‟","‹","›","‚","‛","〝","〞","〟","‟","„","©","®","™","°","§","¶","†","‡","•","‣","⁃","‰","‱","′","″","‴","‵","‶","‷","※","‼","‽","‾","‿","⁀","⁁","⁂","⁃","⁇","⁈","⁉","+","-","×","÷","=","≠","≈","≡","≤","≥","<",">","±","∓","∴","∵","∶","∷","∸","∹","∺","∻","∼","∽","∾","∿","≀","≁","≂","≃","≄","≅","≆","≇","≈","≉","≊","≋","≌","≍","≎","≏","≐","≑","≒","≓","≔","≕","≖","≗","≘","≙","≚","≛","≜","≝","≞","≟","≠","≡","≢","≣","≤","≥","≦","≧","≨","≩","≪","≫","≬","≭","≮","≯","≰","≱","≲","≳","≴","≵","≶","≷","≸","≹","≺","≻","≼","≽","≾","≿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ","¡","¿","‽","‼","⁇","⁈","⁉","※","‾","‿","⁀","⁁","⁂","⁃","←","↑","→","↓","↔","↕","↖","↗","↘","↙","↚","↛","↜","↝","↞","↟","↠","↡","↢","↣","↤","↥","↦","↧","↨","↩","↪","↫","↬","↭","↮","↯","↰","↱","↲","↳","↴","↵","↶","↷","↸","↹","↺","↻","↼","↽","↾","↿","⇀","⇁","⇂","⇃","⇄","⇅","⇆","⇇","⇈","⇉","⇊","⇋","⇌","⇍","⇎","⇏","⇐","⇑","⇒","⇓","⇔","⇕","⇖","⇗","⇘","⇙","⇚","⇛","⇜","⇝","⇞","⇟","⇠","⇡","⇢","⇣","⇤","⇥","⇦","⇧","⇨","⇩","⇪","⇫","⇬","⇭","⇮","⇯","⇰","⇱","⇲","⇳","⇴","⇵","⇶","⇷","⇸","⇹","⇺","⇻","⇼","⇽","⇾","⇿"]},currency:{name:"Currency",characters:["€","£","¥","¢","₹","₽","₩","₿","₺","₴","₦","₨","₪","₫","₭","₮","₯","₰","₱","₲","₳","₵","₶","₷","₼","₾","₿"]},text:{name:"Text",characters:["©","®","™","°","§","¶","†","‡","•","‣","⁃","‰","‱","′","″","‴","‵","‶","‷","※","‼","‽","‾","‿","⁀","⁁","⁂"]},quotation:{name:"Quotation",characters:['"',"'","«","»","„","‟","‹","›","‚","‛","〝","〞","〟"]},mathematical:{name:"Mathematical",characters:["+","-","×","÷","=","≠","≈","≡","≤","≥","<",">","±","∓","∴","∵","∶","∷","∸","∹","∺","∻","∼","∽","∾","∿","≀","≁","≂","≃","≄","≅","≆","≇","≉","≊","≋","≌","≍","≎","≏","≐","≑","≒","≓","≔","≕","≖","≗","≘","≙","≚","≛","≜","≝","≞","≟","≢","≣","≦","≧","≨","≩","≪","≫","≬","≭","≮","≯","≰","≱","≲","≳","≴","≵","≶","≷","≸","≹","≺","≻","≼","≽","≾","≿"]},"extended-latin":{name:"Extended Latin",characters:["À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ"]},symbols:{name:"Symbols",characters:["¡","¿","‽","‼","⁇","⁈","⁉","※","‾","‿","⁀","⁁","⁂","⁃"]},arrows:{name:"Arrows",characters:["←","↑","→","↓","↔","↕","↖","↗","↘","↙","↚","↛","↜","↝","↞","↟","↠","↡","↢","↣","↤","↥","↦","↧","↨","↩","↪","↫","↬","↭","↮","↯","↰","↱","↲","↳","↴","↵","↶","↷","↸","↹","↺","↻","↼","↽","↾","↿","⇀","⇁","⇂","⇃","⇄","⇅","⇆","⇇","⇈","⇉","⇊","⇋","⇌","⇍","⇎","⇏","⇐","⇑","⇒","⇓","⇔","⇕","⇖","⇗","⇘","⇙","⇚","⇛","⇜","⇝","⇞","⇟","⇠","⇡","⇢","⇣","⇤","⇥","⇦","⇧","⇨","⇩","⇪","⇫","⇬","⇭","⇮","⇯","⇰","⇱","⇲","⇳","⇴","⇵","⇶","⇷","⇸","⇹","⇺","⇻","⇼","⇽","⇾","⇿"]}},x={"€":"euro","£":"pound","¥":"yen","¢":"cent","₹":"rupee","₽":"ruble","₩":"won","₿":"bitcoin",'"':"quote","'":"apostrophe","«":"left angle quote","»":"right angle quote","„":"low quote","©":"copyright","®":"registered","™":"trademark","°":"degree","§":"section","¶":"paragraph","†":"dagger","‡":"double dagger","•":"bullet","‰":"per mille","′":"prime","″":"double prime","+":"plus","-":"minus","×":"multiplication","÷":"division","=":"equals","≠":"not equal","≈":"approximately","≡":"identical","≤":"less or equal","≥":"greater or equal","±":"plus minus",À:"a grave",Á:"a acute",Â:"a circumflex",Ã:"a tilde",Ä:"a diaeresis",Ç:"c cedilla","←":"left arrow","↑":"up arrow","→":"right arrow","↓":"down arrow","↔":"left right arrow"};let u=!1;const C='[data-theme="dark"], .dark, .editora-theme-dark',k=()=>{const t=window.getSelection();if(!t||t.rangeCount===0)return null;const e=t.anchorNode;return(e instanceof HTMLElement?e:e?.parentElement)?.closest(".rte-content, .editora-content")||null},E=t=>{const e=t||k();return e?!!e.closest(C):!1},z=()=>{if(typeof document>"u")return;const t="special-characters-plugin-styles";if(document.getElementById(t))return;const e=document.createElement("style");e.id=t,e.textContent=`
|
|
2
2
|
.special-characters-overlay {
|
|
3
3
|
--rte-sc-overlay-bg: rgba(15, 23, 36, 0.56);
|
|
4
4
|
--rte-sc-dialog-bg: #ffffff;
|
|
@@ -10,6 +10,26 @@
|
|
|
10
10
|
--rte-sc-accent: #1f75fe;
|
|
11
11
|
--rte-sc-accent-strong: #165fd6;
|
|
12
12
|
--rte-sc-ring: rgba(31, 117, 254, 0.18);
|
|
13
|
+
--rte-picker-dialog-width: min(640px, 96vw);
|
|
14
|
+
--rte-picker-dialog-max-height: min(560px, 86vh);
|
|
15
|
+
--rte-picker-dialog-radius: 12px;
|
|
16
|
+
--rte-picker-search-wrap-padding: 12px;
|
|
17
|
+
--rte-picker-search-height: 38px;
|
|
18
|
+
--rte-picker-search-font-size: 13px;
|
|
19
|
+
--rte-picker-search-radius: 8px;
|
|
20
|
+
--rte-picker-tabs-width: 156px;
|
|
21
|
+
--rte-picker-tab-padding-y: 10px;
|
|
22
|
+
--rte-picker-tab-padding-x: 12px;
|
|
23
|
+
--rte-picker-tab-font-size: 13px;
|
|
24
|
+
--rte-picker-grid-padding: 12px;
|
|
25
|
+
--rte-picker-grid-gap: 6px;
|
|
26
|
+
--rte-picker-cell-size: 34px;
|
|
27
|
+
--rte-picker-cell-font-size: 17px;
|
|
28
|
+
--rte-picker-cell-radius: 7px;
|
|
29
|
+
--rte-picker-mobile-tab-min-width: 82px;
|
|
30
|
+
--rte-picker-mobile-cell-size: 32px;
|
|
31
|
+
--rte-picker-mobile-grid-gap: 5px;
|
|
32
|
+
--rte-picker-mobile-dialog-max-height: 88vh;
|
|
13
33
|
position: fixed;
|
|
14
34
|
top: 0;
|
|
15
35
|
left: 0;
|
|
@@ -42,11 +62,10 @@
|
|
|
42
62
|
background: var(--rte-sc-dialog-bg);
|
|
43
63
|
color: var(--rte-sc-dialog-text);
|
|
44
64
|
border: 1px solid var(--rte-sc-border);
|
|
45
|
-
border-radius:
|
|
65
|
+
border-radius: var(--rte-picker-dialog-radius);
|
|
46
66
|
box-shadow: 0 24px 48px rgba(10, 15, 24, 0.28);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
max-height: 80vh;
|
|
67
|
+
width: var(--rte-picker-dialog-width);
|
|
68
|
+
max-height: var(--rte-picker-dialog-max-height);
|
|
50
69
|
display: flex;
|
|
51
70
|
flex-direction: column;
|
|
52
71
|
overflow: hidden;
|
|
@@ -100,18 +119,20 @@
|
|
|
100
119
|
display: flex;
|
|
101
120
|
flex-direction: column;
|
|
102
121
|
overflow: hidden;
|
|
122
|
+
min-width: 0;
|
|
103
123
|
}
|
|
104
124
|
|
|
105
125
|
.special-characters-search {
|
|
106
|
-
padding:
|
|
126
|
+
padding: var(--rte-picker-search-wrap-padding) var(--rte-picker-search-wrap-padding) 0 var(--rte-picker-search-wrap-padding);
|
|
107
127
|
}
|
|
108
128
|
|
|
109
129
|
.special-characters-search-input {
|
|
110
130
|
width: 100%;
|
|
111
|
-
|
|
131
|
+
height: var(--rte-picker-search-height);
|
|
132
|
+
padding: 8px 12px;
|
|
112
133
|
border: 1px solid var(--rte-sc-border);
|
|
113
|
-
border-radius:
|
|
114
|
-
font-size:
|
|
134
|
+
border-radius: var(--rte-picker-search-radius);
|
|
135
|
+
font-size: var(--rte-picker-search-font-size);
|
|
115
136
|
color: var(--rte-sc-dialog-text);
|
|
116
137
|
background-color: var(--rte-sc-subtle-bg);
|
|
117
138
|
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
@@ -131,21 +152,23 @@
|
|
|
131
152
|
.special-characters-tabs {
|
|
132
153
|
display: flex;
|
|
133
154
|
flex-direction: column;
|
|
134
|
-
width:
|
|
155
|
+
width: var(--rte-picker-tabs-width);
|
|
135
156
|
border-right: 1px solid var(--rte-sc-border);
|
|
136
157
|
background-color: var(--rte-sc-subtle-bg);
|
|
158
|
+
overflow-y: auto;
|
|
137
159
|
}
|
|
138
160
|
|
|
139
161
|
.special-characters-tab {
|
|
140
|
-
padding:
|
|
162
|
+
padding: var(--rte-picker-tab-padding-y) var(--rte-picker-tab-padding-x);
|
|
141
163
|
border: none;
|
|
142
164
|
background: none;
|
|
143
165
|
text-align: left;
|
|
144
166
|
cursor: pointer;
|
|
145
|
-
font-size:
|
|
167
|
+
font-size: var(--rte-picker-tab-font-size);
|
|
146
168
|
color: var(--rte-sc-muted-text);
|
|
147
169
|
border-bottom: 1px solid var(--rte-sc-border);
|
|
148
170
|
transition: all 0.2s ease;
|
|
171
|
+
line-height: 1.25;
|
|
149
172
|
}
|
|
150
173
|
|
|
151
174
|
.special-characters-tab:hover {
|
|
@@ -160,24 +183,25 @@
|
|
|
160
183
|
}
|
|
161
184
|
|
|
162
185
|
.special-characters-grid {
|
|
163
|
-
padding:
|
|
186
|
+
padding: var(--rte-picker-grid-padding);
|
|
164
187
|
overflow-y: auto;
|
|
165
188
|
display: grid;
|
|
166
|
-
grid-template-columns: repeat(auto-fill, minmax(
|
|
167
|
-
gap:
|
|
189
|
+
grid-template-columns: repeat(auto-fill, minmax(var(--rte-picker-cell-size), 1fr));
|
|
190
|
+
gap: var(--rte-picker-grid-gap);
|
|
191
|
+
contain: content;
|
|
168
192
|
}
|
|
169
193
|
|
|
170
194
|
.special-characters-item {
|
|
171
|
-
width:
|
|
172
|
-
height:
|
|
195
|
+
width: var(--rte-picker-cell-size);
|
|
196
|
+
height: var(--rte-picker-cell-size);
|
|
173
197
|
display: flex;
|
|
174
198
|
align-items: center;
|
|
175
199
|
justify-content: center;
|
|
176
200
|
border: 1px solid var(--rte-sc-border);
|
|
177
201
|
background: var(--rte-sc-subtle-bg);
|
|
178
|
-
border-radius:
|
|
202
|
+
border-radius: var(--rte-picker-cell-radius);
|
|
179
203
|
cursor: pointer;
|
|
180
|
-
font-size:
|
|
204
|
+
font-size: var(--rte-picker-cell-font-size);
|
|
181
205
|
transition: all 0.2s ease;
|
|
182
206
|
color: var(--rte-sc-dialog-text);
|
|
183
207
|
}
|
|
@@ -206,8 +230,8 @@
|
|
|
206
230
|
|
|
207
231
|
@media (max-width: 768px) {
|
|
208
232
|
.special-characters-dialog {
|
|
209
|
-
width:
|
|
210
|
-
max-height:
|
|
233
|
+
width: 96%;
|
|
234
|
+
max-height: var(--rte-picker-mobile-dialog-max-height);
|
|
211
235
|
}
|
|
212
236
|
|
|
213
237
|
.special-characters-content {
|
|
@@ -226,32 +250,46 @@
|
|
|
226
250
|
border-bottom: none;
|
|
227
251
|
border-right: 1px solid var(--rte-sc-border);
|
|
228
252
|
white-space: nowrap;
|
|
253
|
+
min-width: var(--rte-picker-mobile-tab-min-width);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.special-characters-grid {
|
|
257
|
+
grid-template-columns: repeat(auto-fill, minmax(var(--rte-picker-mobile-cell-size), 1fr));
|
|
258
|
+
gap: var(--rte-picker-mobile-grid-gap);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.special-characters-item {
|
|
262
|
+
width: var(--rte-picker-mobile-cell-size);
|
|
263
|
+
height: var(--rte-picker-mobile-cell-size);
|
|
264
|
+
font-size: 16px;
|
|
229
265
|
}
|
|
230
266
|
}
|
|
231
|
-
`,document.head.appendChild(e)},
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
267
|
+
`,document.head.appendChild(e)},S=t=>{const e=window.getSelection();if(e&&e.rangeCount>0){const a=e.getRangeAt(0);a.deleteContents();const c=document.createTextNode(t);a.insertNode(c),a.setStartAfter(c),a.setEndAfter(c),e.removeAllRanges(),e.addRange(a)}},L=t=>{if(typeof window>"u"||u)return;u=!0,z();let e="all",a="",c=null;const i=document.createElement("div");i.className="special-characters-overlay",E(t)&&i.classList.add("rte-ui-theme-dark");const s=document.createElement("div");s.className="special-characters-dialog",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.innerHTML=`
|
|
268
|
+
<div class="special-characters-header">
|
|
269
|
+
<h2>Insert Special Characters</h2>
|
|
270
|
+
<button class="special-characters-close">×</button>
|
|
271
|
+
</div>
|
|
272
|
+
<div class="special-characters-content">
|
|
273
|
+
<div class="special-characters-tabs">
|
|
274
|
+
${Object.keys(g).map(r=>`
|
|
275
|
+
<button class="special-characters-tab ${e===r?"active":""}" data-category="${r}">
|
|
276
|
+
${g[r].name}
|
|
277
|
+
</button>
|
|
278
|
+
`).join("")}
|
|
235
279
|
</div>
|
|
236
|
-
<div class="special-characters-content">
|
|
237
|
-
<div class="special-characters-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
</div>
|
|
244
|
-
<div class="special-characters-main-content">
|
|
245
|
-
<div class="special-characters-search">
|
|
246
|
-
<input type="text" placeholder="Search characters..." value="${r}" class="special-characters-search-input">
|
|
247
|
-
</div>
|
|
248
|
-
<div class="special-characters-grid">
|
|
249
|
-
${s.length>0?s.map(t=>`
|
|
250
|
-
<button class="special-characters-item" data-char="${t}" title="${g[t]||t}">
|
|
251
|
-
${t}
|
|
252
|
-
</button>
|
|
253
|
-
`).join(""):`<div class="special-characters-no-results">No characters found for "${r}"</div>`}
|
|
254
|
-
</div>
|
|
280
|
+
<div class="special-characters-main-content">
|
|
281
|
+
<div class="special-characters-search">
|
|
282
|
+
<input
|
|
283
|
+
type="text"
|
|
284
|
+
placeholder="Search characters..."
|
|
285
|
+
class="special-characters-search-input"
|
|
286
|
+
>
|
|
255
287
|
</div>
|
|
288
|
+
<div class="special-characters-grid"></div>
|
|
256
289
|
</div>
|
|
257
|
-
|
|
290
|
+
</div>
|
|
291
|
+
`;const b=s.querySelector(".special-characters-tabs"),d=s.querySelector(".special-characters-grid"),m=s.querySelector(".special-characters-search-input"),w=s.querySelector(".special-characters-close"),y=()=>g[e].characters.filter(r=>{if(!a.trim())return!0;const o=a.toLowerCase();return r.toLowerCase().includes(o)||(x[r]||"").toLowerCase().includes(o)}),v=()=>{b?.querySelectorAll(".special-characters-tab").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-category")===e)})},h=()=>{if(!d)return;const r=y();if(r.length===0){d.innerHTML=`<div class="special-characters-no-results">No characters found for "${a}"</div>`;return}d.innerHTML=r.map(o=>`
|
|
292
|
+
<button class="special-characters-item" data-char="${o}" title="${x[o]||o}">
|
|
293
|
+
${o}
|
|
294
|
+
</button>
|
|
295
|
+
`).join("")},p=()=>{c!==null&&(window.clearTimeout(c),c=null),i.parentNode&&i.parentNode.removeChild(i),u=!1,document.removeEventListener("keydown",f,!0)},f=r=>{r.key==="Escape"&&(r.preventDefault(),r.stopPropagation(),p())};w?.addEventListener("click",p),b?.addEventListener("click",r=>{const l=r.target.closest(".special-characters-tab");if(!l)return;const n=l.getAttribute("data-category");!n||e===n||(e=n,v(),h())}),m?.addEventListener("input",r=>{a=r.target.value,c!==null&&window.clearTimeout(c),c=window.setTimeout(()=>{c=null,h()},90)}),d?.addEventListener("click",r=>{const l=r.target.closest(".special-characters-item");if(!l)return;const n=l.getAttribute("data-char");n&&(S(n),p())}),i.addEventListener("click",r=>{r.target===i&&p()}),document.addEventListener("keydown",f,!0),v(),h(),i.appendChild(s),document.body.appendChild(i),requestAnimationFrame(()=>m?.focus())},T=()=>({name:"specialCharacters",toolbar:[{label:"Special Characters",command:"insertSpecialCharacter",icon:'<svg width="24" height="24" focusable="false"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5Z" fill-rule="evenodd"></path></svg>'}],commands:{insertSpecialCharacter:(t,e)=>{const a=e?.contentElement instanceof HTMLElement?e.contentElement:k();return L(a),!0}},keymap:{}});exports.SpecialCharactersPlugin=T;
|