@editora/plugins 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -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 +40 -40
- package/dist/approval-workflow.esm.js +249 -208
- 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 +45 -45
- package/dist/blocks-library.esm.js +245 -178
- 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 +37 -37
- package/dist/citations.esm.js +512 -439
- 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 +90 -90
- package/dist/conditional-content.esm.js +432 -371
- package/dist/content-rules.cjs.js +7 -7
- package/dist/content-rules.esm.js +159 -105
- package/dist/data-binding.cjs.js +46 -46
- package/dist/data-binding.esm.js +368 -328
- package/dist/direction.esm.js +18 -9
- package/dist/doc-schema.cjs.js +29 -29
- package/dist/doc-schema.esm.js +308 -240
- 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 -1
- package/dist/enterprise.esm.js +56 -54
- 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 +128 -125
- 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 +9 -9
- package/dist/mentions.esm.js +286 -238
- 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 +49 -33
- package/dist/pii-redaction.cjs.js +19 -19
- package/dist/pii-redaction.esm.js +463 -393
- package/dist/preview.esm.js +10 -5
- 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 +3 -3
- package/dist/slash-commands.esm.js +212 -176
- package/dist/smart-paste.cjs.js +27 -27
- package/dist/smart-paste.esm.js +336 -280
- 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 +2 -2
- package/dist/track-changes.esm.js +162 -100
- package/dist/translation-workflow.cjs.js +74 -74
- package/dist/translation-workflow.esm.js +678 -602
- package/dist/version-diff.cjs.js +14 -14
- package/dist/version-diff.esm.js +157 -128
- package/package.json +13 -7
- package/LICENSE +0 -21
- 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
|
@@ -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 m={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:["←","↑","→","↓","↔","↕","↖","↗","↘","↙","↚","↛","↜","↝","↞","↟","↠","↡","↢","↣","↤","↥","↦","↧","↨","↩","↪","↫","↬","↭","↮","↯","↰","↱","↲","↳","↴","↵","↶","↷","↸","↹","↺","↻","↼","↽","↾","↿","⇀","⇁","⇂","⇃","⇄","⇅","⇆","⇇","⇈","⇉","⇊","⇋","⇌","⇍","⇎","⇏","⇐","⇑","⇒","⇓","⇔","⇕","⇖","⇗","⇘","⇙","⇚","⇛","⇜","⇝","⇞","⇟","⇠","⇡","⇢","⇣","⇤","⇥","⇦","⇧","⇨","⇩","⇪","⇫","⇬","⇭","⇮","⇯","⇰","⇱","⇲","⇳","⇴","⇵","⇶","⇷","⇸","⇹","⇺","⇻","⇼","⇽","⇾","⇿"]}},k={"€":"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 v=!1;const C='[data-theme="dark"], .dark, .editora-theme-dark',w=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return null;const e=a.anchorNode,t=e instanceof HTMLElement?e:e==null?void 0:e.parentElement;return(t==null?void 0:t.closest(".rte-content, .editora-content"))||null},E=a=>{const e=a||w();return e?!!e.closest(C):!1},z=()=>{if(typeof document>"u")return;const a="special-characters-plugin-styles";if(document.getElementById(a))return;const e=document.createElement("style");e.id=a,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;
|
|
@@ -264,16 +264,16 @@
|
|
|
264
264
|
font-size: 16px;
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
-
`,document.head.appendChild(e)},S=
|
|
267
|
+
`,document.head.appendChild(e)},S=a=>{const e=window.getSelection();if(e&&e.rangeCount>0){const t=e.getRangeAt(0);t.deleteContents();const c=document.createTextNode(a);t.insertNode(c),t.setStartAfter(c),t.setEndAfter(c),e.removeAllRanges(),e.addRange(t)}},L=a=>{if(typeof window>"u"||v)return;v=!0,z();let e="all",t="",c=null;const i=document.createElement("div");i.className="special-characters-overlay",E(a)&&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
268
|
<div class="special-characters-header">
|
|
269
269
|
<h2>Insert Special Characters</h2>
|
|
270
270
|
<button class="special-characters-close">×</button>
|
|
271
271
|
</div>
|
|
272
272
|
<div class="special-characters-content">
|
|
273
273
|
<div class="special-characters-tabs">
|
|
274
|
-
${Object.keys(
|
|
274
|
+
${Object.keys(m).map(r=>`
|
|
275
275
|
<button class="special-characters-tab ${e===r?"active":""}" data-category="${r}">
|
|
276
|
-
${
|
|
276
|
+
${m[r].name}
|
|
277
277
|
</button>
|
|
278
278
|
`).join("")}
|
|
279
279
|
</div>
|
|
@@ -288,8 +288,8 @@
|
|
|
288
288
|
<div class="special-characters-grid"></div>
|
|
289
289
|
</div>
|
|
290
290
|
</div>
|
|
291
|
-
`;const
|
|
292
|
-
<button class="special-characters-item" data-char="${o}" title="${
|
|
291
|
+
`;const l=s.querySelector(".special-characters-tabs"),n=s.querySelector(".special-characters-grid"),d=s.querySelector(".special-characters-search-input"),u=s.querySelector(".special-characters-close"),y=()=>m[e].characters.filter(r=>{if(!t.trim())return!0;const o=t.toLowerCase();return r.toLowerCase().includes(o)||(k[r]||"").toLowerCase().includes(o)}),f=()=>{l==null||l.querySelectorAll(".special-characters-tab").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-category")===e)})},b=()=>{if(!n)return;const r=y();if(r.length===0){n.innerHTML=`<div class="special-characters-no-results">No characters found for "${t}"</div>`;return}n.innerHTML=r.map(o=>`
|
|
292
|
+
<button class="special-characters-item" data-char="${o}" title="${k[o]||o}">
|
|
293
293
|
${o}
|
|
294
294
|
</button>
|
|
295
|
-
`).join("")},
|
|
295
|
+
`).join("")},g=()=>{c!==null&&(window.clearTimeout(c),c=null),i.parentNode&&i.parentNode.removeChild(i),v=!1,document.removeEventListener("keydown",x,!0)},x=r=>{r.key==="Escape"&&(r.preventDefault(),r.stopPropagation(),g())};u==null||u.addEventListener("click",g),l==null||l.addEventListener("click",r=>{const h=r.target.closest(".special-characters-tab");if(!h)return;const p=h.getAttribute("data-category");!p||e===p||(e=p,f(),b())}),d==null||d.addEventListener("input",r=>{t=r.target.value,c!==null&&window.clearTimeout(c),c=window.setTimeout(()=>{c=null,b()},90)}),n==null||n.addEventListener("click",r=>{const h=r.target.closest(".special-characters-item");if(!h)return;const p=h.getAttribute("data-char");p&&(S(p),g())}),i.addEventListener("click",r=>{r.target===i&&g()}),document.addEventListener("keydown",x,!0),f(),b(),i.appendChild(s),document.body.appendChild(i),requestAnimationFrame(()=>d==null?void 0:d.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:(a,e)=>{const t=(e==null?void 0:e.contentElement)instanceof HTMLElement?e.contentElement:w();return L(t),!0}},keymap:{}});exports.SpecialCharactersPlugin=T;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const m = {
|
|
2
2
|
all: {
|
|
3
3
|
name: "All",
|
|
4
4
|
characters: [
|
|
@@ -389,7 +389,7 @@ const g = {
|
|
|
389
389
|
name: "Arrows",
|
|
390
390
|
characters: ["←", "↑", "→", "↓", "↔", "↕", "↖", "↗", "↘", "↙", "↚", "↛", "↜", "↝", "↞", "↟", "↠", "↡", "↢", "↣", "↤", "↥", "↦", "↧", "↨", "↩", "↪", "↫", "↬", "↭", "↮", "↯", "↰", "↱", "↲", "↳", "↴", "↵", "↶", "↷", "↸", "↹", "↺", "↻", "↼", "↽", "↾", "↿", "⇀", "⇁", "⇂", "⇃", "⇄", "⇅", "⇆", "⇇", "⇈", "⇉", "⇊", "⇋", "⇌", "⇍", "⇎", "⇏", "⇐", "⇑", "⇒", "⇓", "⇔", "⇕", "⇖", "⇗", "⇘", "⇙", "⇚", "⇛", "⇜", "⇝", "⇞", "⇟", "⇠", "⇡", "⇢", "⇣", "⇤", "⇥", "⇦", "⇧", "⇨", "⇩", "⇪", "⇫", "⇬", "⇭", "⇮", "⇯", "⇰", "⇱", "⇲", "⇳", "⇴", "⇵", "⇶", "⇷", "⇸", "⇹", "⇺", "⇻", "⇼", "⇽", "⇾", "⇿"]
|
|
391
391
|
}
|
|
392
|
-
},
|
|
392
|
+
}, k = {
|
|
393
393
|
"€": "euro",
|
|
394
394
|
"£": "pound",
|
|
395
395
|
"¥": "yen",
|
|
@@ -438,21 +438,24 @@ const g = {
|
|
|
438
438
|
"↓": "down arrow",
|
|
439
439
|
"↔": "left right arrow"
|
|
440
440
|
};
|
|
441
|
-
let
|
|
442
|
-
const
|
|
443
|
-
const
|
|
444
|
-
if (!
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
441
|
+
let v = !1;
|
|
442
|
+
const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
|
|
443
|
+
const a = window.getSelection();
|
|
444
|
+
if (!a || a.rangeCount === 0)
|
|
445
|
+
return null;
|
|
446
|
+
const e = a.anchorNode, t = e instanceof HTMLElement ? e : e == null ? void 0 : e.parentElement;
|
|
447
|
+
return (t == null ? void 0 : t.closest(".rte-content, .editora-content")) || null;
|
|
448
|
+
}, z = (a) => {
|
|
449
|
+
const e = a || w();
|
|
450
|
+
return e ? !!e.closest(E) : !1;
|
|
451
|
+
}, C = () => {
|
|
452
|
+
if (typeof document > "u")
|
|
453
|
+
return;
|
|
454
|
+
const a = "special-characters-plugin-styles";
|
|
455
|
+
if (document.getElementById(a))
|
|
456
|
+
return;
|
|
454
457
|
const e = document.createElement("style");
|
|
455
|
-
e.id =
|
|
458
|
+
e.id = a, e.textContent = `
|
|
456
459
|
.special-characters-overlay {
|
|
457
460
|
--rte-sc-overlay-bg: rgba(15, 23, 36, 0.56);
|
|
458
461
|
--rte-sc-dialog-bg: #ffffff;
|
|
@@ -719,20 +722,21 @@ const C = '[data-theme="dark"], .dark, .editora-theme-dark', k = () => {
|
|
|
719
722
|
}
|
|
720
723
|
}
|
|
721
724
|
`, document.head.appendChild(e);
|
|
722
|
-
}, L = (
|
|
725
|
+
}, L = (a) => {
|
|
723
726
|
const e = window.getSelection();
|
|
724
727
|
if (e && e.rangeCount > 0) {
|
|
725
|
-
const
|
|
726
|
-
|
|
727
|
-
const c = document.createTextNode(
|
|
728
|
-
|
|
728
|
+
const t = e.getRangeAt(0);
|
|
729
|
+
t.deleteContents();
|
|
730
|
+
const c = document.createTextNode(a);
|
|
731
|
+
t.insertNode(c), t.setStartAfter(c), t.setEndAfter(c), e.removeAllRanges(), e.addRange(t);
|
|
729
732
|
}
|
|
730
|
-
}, S = (
|
|
731
|
-
if (typeof window > "u" ||
|
|
732
|
-
|
|
733
|
-
|
|
733
|
+
}, S = (a) => {
|
|
734
|
+
if (typeof window > "u" || v)
|
|
735
|
+
return;
|
|
736
|
+
v = !0, C();
|
|
737
|
+
let e = "all", t = "", c = null;
|
|
734
738
|
const i = document.createElement("div");
|
|
735
|
-
i.className = "special-characters-overlay",
|
|
739
|
+
i.className = "special-characters-overlay", z(a) && i.classList.add("rte-ui-theme-dark");
|
|
736
740
|
const s = document.createElement("div");
|
|
737
741
|
s.className = "special-characters-dialog", s.setAttribute("role", "dialog"), s.setAttribute("aria-modal", "true"), s.innerHTML = `
|
|
738
742
|
<div class="special-characters-header">
|
|
@@ -741,9 +745,9 @@ const C = '[data-theme="dark"], .dark, .editora-theme-dark', k = () => {
|
|
|
741
745
|
</div>
|
|
742
746
|
<div class="special-characters-content">
|
|
743
747
|
<div class="special-characters-tabs">
|
|
744
|
-
${Object.keys(
|
|
748
|
+
${Object.keys(m).map((r) => `
|
|
745
749
|
<button class="special-characters-tab ${e === r ? "active" : ""}" data-category="${r}">
|
|
746
|
-
${
|
|
750
|
+
${m[r].name}
|
|
747
751
|
</button>
|
|
748
752
|
`).join("")}
|
|
749
753
|
</div>
|
|
@@ -759,48 +763,52 @@ const C = '[data-theme="dark"], .dark, .editora-theme-dark', k = () => {
|
|
|
759
763
|
</div>
|
|
760
764
|
</div>
|
|
761
765
|
`;
|
|
762
|
-
const
|
|
763
|
-
if (!
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
766
|
+
const l = s.querySelector(".special-characters-tabs"), n = s.querySelector(".special-characters-grid"), d = s.querySelector(".special-characters-search-input"), u = s.querySelector(".special-characters-close"), y = () => m[e].characters.filter((r) => {
|
|
767
|
+
if (!t.trim())
|
|
768
|
+
return !0;
|
|
769
|
+
const o = t.toLowerCase();
|
|
770
|
+
return r.toLowerCase().includes(o) || (k[r] || "").toLowerCase().includes(o);
|
|
771
|
+
}), f = () => {
|
|
772
|
+
l == null || l.querySelectorAll(".special-characters-tab").forEach((r) => {
|
|
768
773
|
r.classList.toggle("active", r.getAttribute("data-category") === e);
|
|
769
774
|
});
|
|
770
|
-
},
|
|
771
|
-
if (!
|
|
775
|
+
}, b = () => {
|
|
776
|
+
if (!n)
|
|
777
|
+
return;
|
|
772
778
|
const r = y();
|
|
773
779
|
if (r.length === 0) {
|
|
774
|
-
|
|
780
|
+
n.innerHTML = `<div class="special-characters-no-results">No characters found for "${t}"</div>`;
|
|
775
781
|
return;
|
|
776
782
|
}
|
|
777
|
-
|
|
778
|
-
<button class="special-characters-item" data-char="${o}" title="${
|
|
783
|
+
n.innerHTML = r.map((o) => `
|
|
784
|
+
<button class="special-characters-item" data-char="${o}" title="${k[o] || o}">
|
|
779
785
|
${o}
|
|
780
786
|
</button>
|
|
781
787
|
`).join("");
|
|
782
|
-
},
|
|
783
|
-
c !== null && (window.clearTimeout(c), c = null), i.parentNode && i.parentNode.removeChild(i),
|
|
784
|
-
},
|
|
785
|
-
r.key === "Escape" && (r.preventDefault(), r.stopPropagation(),
|
|
788
|
+
}, g = () => {
|
|
789
|
+
c !== null && (window.clearTimeout(c), c = null), i.parentNode && i.parentNode.removeChild(i), v = !1, document.removeEventListener("keydown", x, !0);
|
|
790
|
+
}, x = (r) => {
|
|
791
|
+
r.key === "Escape" && (r.preventDefault(), r.stopPropagation(), g());
|
|
786
792
|
};
|
|
787
|
-
|
|
788
|
-
const
|
|
789
|
-
if (!
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
793
|
+
u == null || u.addEventListener("click", g), l == null || l.addEventListener("click", (r) => {
|
|
794
|
+
const h = r.target.closest(".special-characters-tab");
|
|
795
|
+
if (!h)
|
|
796
|
+
return;
|
|
797
|
+
const p = h.getAttribute("data-category");
|
|
798
|
+
!p || e === p || (e = p, f(), b());
|
|
799
|
+
}), d == null || d.addEventListener("input", (r) => {
|
|
800
|
+
t = r.target.value, c !== null && window.clearTimeout(c), c = window.setTimeout(() => {
|
|
801
|
+
c = null, b();
|
|
795
802
|
}, 90);
|
|
796
|
-
}),
|
|
797
|
-
const
|
|
798
|
-
if (!
|
|
799
|
-
|
|
800
|
-
|
|
803
|
+
}), n == null || n.addEventListener("click", (r) => {
|
|
804
|
+
const h = r.target.closest(".special-characters-item");
|
|
805
|
+
if (!h)
|
|
806
|
+
return;
|
|
807
|
+
const p = h.getAttribute("data-char");
|
|
808
|
+
p && (L(p), g());
|
|
801
809
|
}), i.addEventListener("click", (r) => {
|
|
802
|
-
r.target === i &&
|
|
803
|
-
}), document.addEventListener("keydown",
|
|
810
|
+
r.target === i && g();
|
|
811
|
+
}), document.addEventListener("keydown", x, !0), f(), b(), i.appendChild(s), document.body.appendChild(i), requestAnimationFrame(() => d == null ? void 0 : d.focus());
|
|
804
812
|
}, q = () => ({
|
|
805
813
|
name: "specialCharacters",
|
|
806
814
|
toolbar: [{
|
|
@@ -809,9 +817,9 @@ const C = '[data-theme="dark"], .dark, .editora-theme-dark', k = () => {
|
|
|
809
817
|
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>'
|
|
810
818
|
}],
|
|
811
819
|
commands: {
|
|
812
|
-
insertSpecialCharacter: (
|
|
813
|
-
const
|
|
814
|
-
return S(
|
|
820
|
+
insertSpecialCharacter: (a, e) => {
|
|
821
|
+
const t = (e == null ? void 0 : e.contentElement) instanceof HTMLElement ? e.contentElement : w();
|
|
822
|
+
return S(t), !0;
|
|
815
823
|
}
|
|
816
824
|
},
|
|
817
825
|
keymap: {}
|
package/dist/spell-check.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=new Set(["the","a","an","and","or","but","in","on","at","to","for","of","with","by","from","is","are","be","was","were","have","has","had","do","does","did","will","would","could","should","may","might","must","can","this","that","these","those","what","which","who","whom","where","when","why","how","all","each","every","both","few","more","most","other","same","such","no","nor","not","only","own","so","than","too","very","just","as","if","because","while","although","though","it","its","their","them","they","you","he","she","we","me","him","her","us","our","i","my","your","his","hers","ours","yours","theirs","editor","document","text","word","paragraph","line","page","content","hello","world","test","example","sample","demo","lorem","ipsum"]),C=new Set,S=new Set;let u=!1,d=null,f=null,a=null,s=null,x=null,y=!1,h=null,_=!1,b=0,g=null;const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=new Set(["the","a","an","and","or","but","in","on","at","to","for","of","with","by","from","is","are","be","was","were","have","has","had","do","does","did","will","would","could","should","may","might","must","can","this","that","these","those","what","which","who","whom","where","when","why","how","all","each","every","both","few","more","most","other","same","such","no","nor","not","only","own","so","than","too","very","just","as","if","because","while","although","though","it","its","their","them","they","you","he","she","we","me","him","her","us","our","i","my","your","his","hers","ours","yours","theirs","editor","document","text","word","paragraph","line","page","content","hello","world","test","example","sample","demo","lorem","ipsum"]),C=new Set,S=new Set;let u=!1,d=null,f=null,a=null,s=null,x=null,y=!1,h=null,_=!1,b=0,g=null;const P={characterData:!0,childList:!0,subtree:!0},H="rte-spellcheck-styles",R="__editoraCommandEditorRoot";function K(e){var l;const t=(e==null?void 0:e.contentElement)||(e==null?void 0:e.editorElement)||null;if(!(t instanceof HTMLElement))return;const r=t.getAttribute("contenteditable")==="true"?t:(l=t.querySelector)==null?void 0:l.call(t,'[contenteditable="true"]');if(r instanceof HTMLElement){s=r,h=r;return}const n=t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?t:null),o=A(n);o&&(s=o,h=o)}function B(){if(typeof window>"u")return null;const e=window[R];if(!(e instanceof HTMLElement))return null;window[R]=null;const t=e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(e.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?e:null);if(t){const n=A(t);if(n)return n;if(t.getAttribute("contenteditable")==="true")return t}if(e.getAttribute("contenteditable")==="true")return e;const r=e.closest('[contenteditable="true"]');return r instanceof HTMLElement?r:null}function T(){let e=document.getElementById(H);e||(e=document.createElement("style"),e.id=H,document.head.appendChild(e)),e.textContent=`
|
|
2
2
|
.rte-spell-check-panel {
|
|
3
3
|
position: absolute;
|
|
4
4
|
top: 12px;
|
|
@@ -466,7 +466,7 @@
|
|
|
466
466
|
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-menu-item.positive {
|
|
467
467
|
color: #93c5fd;
|
|
468
468
|
}
|
|
469
|
-
`}function k(){if(s&&document.contains(s))return s;const e=V();return e&&(s=e),e}function W(e){if(!e)return;const
|
|
469
|
+
`}function k(){if(s&&document.contains(s))return s;const e=V();return e&&(s=e),e}function W(e){if(!e)return;const t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement,r=t==null?void 0:t.closest('[contenteditable="true"]');r&&(s=r)}function A(e){if(!e)return null;const t=e.querySelector('[contenteditable="true"]');return t instanceof HTMLElement?t:null}function Q(){if(_)return;const e=t=>{const r=t.target;if(!r)return;const n=r.closest('.editora-toolbar-button[data-command="toggleSpellCheck"], .rte-toolbar-button[data-command="toggleSpellCheck"]');if(!n)return;const o=n.closest("[data-editora-editor]"),l=A(o);l&&(h=l,s=l)};document.addEventListener("pointerdown",e,!0),_=!0}function ee(){const e=B();if(e&&document.contains(e))return s=e,h=null,e;if(h&&document.contains(h)){const t=h;return h=null,s=t,t}return V()}function te(){b+=1,b===1&&d&&d.disconnect()}function re(){if(b===0||(b-=1,b>0)||!d)return;const e=k();e&&d.observe(e,P)}function N(e){te();try{return e()}finally{re()}}const oe=()=>{try{const e=localStorage.getItem("rte-custom-dictionary");e&&JSON.parse(e).forEach(r=>C.add(r.toLowerCase()))}catch(e){console.warn("Failed to load custom dictionary:",e)}},le=()=>{try{const e=Array.from(C);localStorage.setItem("rte-custom-dictionary",JSON.stringify(e))}catch(e){console.warn("Failed to save custom dictionary:",e)}};function ne(e,t){const r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let o=1;o<=e.length;o++)t.charAt(n-1)===e.charAt(o-1)?r[n][o]=r[n-1][o-1]:r[n][o]=Math.min(r[n-1][o-1]+1,r[n][o-1]+1,r[n-1][o]+1);return r[t.length][e.length]}function ce(e){const t=e.toLowerCase();return j.has(t)||C.has(t)||S.has(t)}function ae(e,t=5){const r=e.toLowerCase(),o=Array.from(j).map(l=>({word:l,distance:ne(r,l)}));return o.sort((l,c)=>l.distance-c.distance),o.filter(l=>l.distance<=3).slice(0,t).map(l=>l.word)}function se(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e;return!!(t.closest('code, pre, [contenteditable="false"], .rte-widget, .rte-template, .rte-comment, .rte-merge-tag')||t.hasAttribute("data-comment-id")||t.hasAttribute("data-template")||t.hasAttribute("data-merge-tag"))}function ie(e){const t=[],r=/([\p{L}\p{M}\p{N}\p{Emoji_Presentation}\u200d'-]+|[\uD800-\uDBFF][\uDC00-\uDFFF])/gu;let n;for(;(n=r.exec(e.data))!==null;){const o=n[0],l=n.index,c=l+o.length;/https?:\/\//.test(o)||/@/.test(o)||/\{\{.*\}\}/.test(o)||/^\d+$/.test(o)||ce(o)||/[a-z][A-Z]/.test(o)||/-/.test(o)||o[0]===o[0].toUpperCase()&&o.length>1||t.push({id:`${o}-${l}`,node:e,startOffset:l,endOffset:c,word:o,suggestions:ae(o),ignored:!1})}return t}const V=()=>{const e=B();if(e&&document.contains(e))return s=e,e;const t=window.getSelection();if(t&&t.rangeCount>0){let n=t.getRangeAt(0).startContainer;for(;n&&n!==document.body;){if(n.nodeType===Node.ELEMENT_NODE){const o=n;if(o.getAttribute("contenteditable")==="true")return o}n=n.parentNode}}const r=document.activeElement;if(r){if(r.getAttribute("contenteditable")==="true")return r;const n=r.closest('[contenteditable="true"]');if(n)return n;const o=r.closest("[data-editora-editor]");if(o){const l=o.querySelector('[contenteditable="true"]');if(l)return l}}return document.querySelector('[contenteditable="true"]')};function M(){const e=k();if(!e)return[];const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:o=>{var l;return!((l=o.textContent)!=null&&l.trim())||o.parentNode&&se(o.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let n=r.nextNode();for(;n;)t.push(...ie(n)),n=r.nextNode();return t}function m(e){const t=k();t&&(e||(e=M()),N(()=>{t.querySelectorAll(".rte-misspelled").forEach(r=>{const n=r.parentNode;if(n){for(;r.firstChild;)n.insertBefore(r.firstChild,r);n.removeChild(r)}}),e.forEach(r=>{if(S.has(r.word.toLowerCase()))return;const n=r.node.data.length;if(!(r.startOffset<0||r.endOffset>n||r.startOffset>=r.endOffset))try{const o=document.createRange();o.setStart(r.node,r.startOffset),o.setEnd(r.node,r.endOffset);const l=document.createElement("span");l.className="rte-misspelled",l.setAttribute("data-word",r.word),l.setAttribute("data-suggestions",r.suggestions.join(",")),l.setAttribute("title",`Suggestions: ${r.suggestions.join(", ")}`),l.style.borderBottom="2px wavy red",l.style.cursor="pointer",o.surroundContents(l)}catch{}})}),E(e))}function L(){const e=k();e&&N(()=>{e.querySelectorAll(".rte-misspelled").forEach(t=>{const r=t.parentNode;if(r){for(;t.firstChild;)r.insertBefore(t.firstChild,t);r.removeChild(t)}})})}function de(e,t){N(()=>{const r=document.createRange();r.setStart(e.node,e.startOffset),r.setEnd(e.node,e.endOffset);const n=document.createTextNode(t);r.deleteContents(),r.insertNode(n)})}function G(e){S.add(e.toLowerCase()),L(),m()}function J(e){C.add(e.toLowerCase()),le(),L(),m()}function pe(e){const t=k();if(!t)return{total:0,misspelled:0,accuracy:100};e||(e=M());const r=e.filter(c=>!S.has(c.word.toLowerCase())).length,l=((t.textContent||"").match(/[\p{L}\p{M}\p{N}]+/gu)||[]).length;return{total:l,misspelled:r,accuracy:l>0?(l-r)/l*100:100}}function he(e,t){const r=document.createTextNode(t);e.replaceWith(r)}function ue(e){e.classList.remove("rte-misspelled"),e.removeAttribute("data-word"),e.removeAttribute("data-suggestions"),e.removeAttribute("title"),e.style.borderBottom="",e.style.cursor=""}function me(e,t,r,n,o){W(o),document.querySelectorAll(".rte-spellcheck-menu").forEach(p=>p.remove());const l=document.createElement("div");if(l.className="rte-spellcheck-menu",n.slice(0,5).forEach(p=>{const v=document.createElement("div");v.className="rte-spellcheck-menu-item",v.textContent=p,v.onclick=()=>{he(o,p),window.setTimeout(()=>{u&&(m(),E())},0),l.remove()},l.appendChild(v)}),n.length>0){const p=document.createElement("div");p.style.cssText="height: 1px; background: #ddd; margin: 4px 0;",l.appendChild(p)}const c=document.createElement("div");c.className="rte-spellcheck-menu-item meta",c.textContent="Ignore Once",c.onclick=()=>{ue(o),l.remove()},l.appendChild(c);const i=document.createElement("div");i.className="rte-spellcheck-menu-item meta",i.textContent="Ignore All",i.onclick=()=>{G(r),l.remove()},l.appendChild(i);const w=document.createElement("div");w.className="rte-spellcheck-menu-item positive",w.textContent="Add to Dictionary",w.onclick=()=>{J(r),l.remove()},l.appendChild(w),document.body.appendChild(l);const D=l.getBoundingClientRect(),X=window.innerWidth-D.width-8,Z=window.innerHeight-D.height-8;l.style.left=`${Math.max(8,Math.min(e,X))}px`,l.style.top=`${Math.max(8,Math.min(t,Z))}px`;const F=p=>{l.contains(p.target)||(l.remove(),document.removeEventListener("mousedown",F))};setTimeout(()=>document.addEventListener("mousedown",F),0)}function I(){y||(x=e=>{const t=e.target;if(t&&t.classList.contains("rte-misspelled")){e.preventDefault(),W(t);const r=t.getAttribute("data-word"),n=(t.getAttribute("data-suggestions")||"").split(",").filter(o=>o);me(e.clientX,e.clientY,r,n,t)}},document.addEventListener("contextmenu",x),y=!0)}function ke(){!y||!x||(document.removeEventListener("contextmenu",x),x=null,y=!1)}function fe(e){return e.closest("[data-editora-editor]")||e.parentElement||e}function q(){const e=k();if(!e)throw new Error("Spell check panel requested without active editor");const t=fe(e);T();const r=document.createElement("div");return r.className="rte-spell-check-panel",window.getComputedStyle(t).position==="static"&&(t.style.position="relative"),t.appendChild(r),r}function E(e){if(!a)return;const t=e||M(),r=pe(t);a.innerHTML=`
|
|
470
470
|
<div class="rte-spellcheck-header">
|
|
471
471
|
<div>
|
|
472
472
|
<h3 class="rte-spellcheck-title">Spell Check</h3>
|
|
@@ -491,8 +491,8 @@
|
|
|
491
491
|
</div>
|
|
492
492
|
|
|
493
493
|
<div class="rte-spellcheck-list">
|
|
494
|
-
${t.length===0?'<div class="rte-spellcheck-empty">No spelling errors found in this editor.</div>':t.map((o,
|
|
495
|
-
<div class="rte-spellcheck-item" data-word="${o.word}" data-index="${
|
|
494
|
+
${t.length===0?'<div class="rte-spellcheck-empty">No spelling errors found in this editor.</div>':t.map((o,l)=>`
|
|
495
|
+
<div class="rte-spellcheck-item" data-word="${o.word}" data-index="${l}">
|
|
496
496
|
<button class="rte-spellcheck-word-header" type="button">
|
|
497
497
|
<span class="rte-spellcheck-word">${o.word}</span>
|
|
498
498
|
<span class="rte-spellcheck-caret">▶</span>
|
|
@@ -509,4 +509,4 @@
|
|
|
509
509
|
</div>
|
|
510
510
|
`).join("")}
|
|
511
511
|
</div>
|
|
512
|
-
|
|
512
|
+
`;const n=a.querySelector(".rte-spellcheck-close");n==null||n.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),O()}),a.querySelectorAll(".rte-spellcheck-word-header").forEach(o=>{o.addEventListener("click",()=>{const l=o.closest(".rte-spellcheck-item"),c=l==null?void 0:l.querySelector(".rte-spellcheck-suggestions"),i=o.querySelector(".rte-spellcheck-caret");c&&i&&(c.classList.contains("show")?(c.classList.remove("show"),i.textContent="▶"):(c.classList.add("show"),i.textContent="▼"))})}),a.querySelectorAll(".suggestion-btn").forEach(o=>{o.addEventListener("click",()=>{const l=o.getAttribute("data-suggestion"),c=o.closest(".rte-spellcheck-item");c==null||c.getAttribute("data-word");const i=parseInt((c==null?void 0:c.getAttribute("data-index"))||"0");t[i]&&(de(t[i],l),m())})}),a.querySelectorAll(".ignore-btn").forEach(o=>{o.addEventListener("click",()=>{const l=o.closest(".rte-spellcheck-item"),c=l==null?void 0:l.getAttribute("data-word");G(c)})}),a.querySelectorAll(".add-btn").forEach(o=>{o.addEventListener("click",()=>{const l=o.closest(".rte-spellcheck-item"),c=l==null?void 0:l.getAttribute("data-word");J(c)})})}function $(){const e=k();e&&(d&&d.disconnect(),d=new MutationObserver(t=>{b>0||t.some(r=>r.type==="characterData"||r.type==="childList")&&(f&&clearTimeout(f),f=window.setTimeout(()=>{u&&m()},350))}),d.observe(e,{...P}))}function U(){d&&(d.disconnect(),d=null),f&&(clearTimeout(f),f=null)}function Y(){document.querySelectorAll(".rte-spellcheck-menu").forEach(e=>e.remove())}function z(){g||(g=e=>{e.key!=="Escape"||!u||(e.preventDefault(),e.stopPropagation(),O())},document.addEventListener("keydown",g,!0))}function be(){g&&(document.removeEventListener("keydown",g,!0),g=null)}function O(){return u&&(L(),U(),ke(),Y(),a&&(a.remove(),a=null),s=null,h=null,u=!1,be()),!1}function ge(){const e=ee();return e?u&&s&&s!==e?(L(),U(),Y(),a&&(a.remove(),a=null),s=e,T(),I(),z(),m(),$(),a=q(),E(),!0):u?O():(s=e,u=!0,T(),I(),z(),m(),$(),a&&(a.remove(),a=null),a=q(),E(),!0):!1}const xe=()=>({name:"spellCheck",init:()=>{oe(),Q()},toolbar:[{label:"Spell Check",command:"toggleSpellCheck",icon:'<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" 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="M3 12.5L3.84375 9.5M3.84375 9.5L5 5.38889C5 5.38889 5.25 4.5 6 4.5C6.75 4.5 7 5.38889 7 5.38889L8.15625 9.5M3.84375 9.5H8.15625M9 12.5L8.15625 9.5M13 16.8333L15.4615 19.5L21 13.5M12 8.5H15C16.1046 8.5 17 7.60457 17 6.5C17 5.39543 16.1046 4.5 15 4.5H12V8.5ZM12 8.5H16C17.1046 8.5 18 9.39543 18 10.5C18 11.6046 17.1046 12.5 16 12.5H12V8.5Z" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',shortcut:"F7"}],commands:{toggleSpellCheck:(e,t)=>(K(t),ge(),!0)},keymap:{F7:"toggleSpellCheck"}});exports.SpellCheckPlugin=xe;
|