@editora/plugins 1.0.10 → 1.0.12
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 +1 -1
- package/dist/_commonjsHelpers-BH3jXuIh.js +1 -0
- package/dist/_commonjsHelpers-ByX85dGu.mjs +33 -0
- package/dist/a11y-checker.cjs.js +12 -12
- package/dist/a11y-checker.esm.js +80 -98
- package/dist/anchor.cjs.js +12 -12
- package/dist/anchor.esm.js +115 -128
- package/dist/anchoredPopover-BzqGPOAE.js +1 -0
- package/dist/anchoredPopover-Dts0IrgU.mjs +106 -0
- package/dist/approval-workflow.cjs.js +40 -40
- package/dist/approval-workflow.esm.js +208 -249
- package/dist/background-color.cjs.js +2 -2
- package/dist/background-color.esm.js +55 -68
- package/dist/blockquote.esm.js +1 -2
- package/dist/blocks-library.cjs.js +45 -45
- package/dist/blocks-library.esm.js +178 -245
- package/dist/capitalization.esm.js +1 -2
- package/dist/checklist.cjs.js +1 -1
- package/dist/checklist.esm.js +58 -82
- package/dist/citations.cjs.js +37 -37
- package/dist/citations.esm.js +439 -512
- package/dist/clear-formatting.cjs.js +1 -1
- package/dist/clear-formatting.esm.js +27 -33
- package/dist/code-sample.cjs.js +14 -14
- package/dist/code-sample.esm.js +82 -93
- package/dist/code.cjs.js +119 -42
- package/dist/code.esm.js +2560 -760
- package/dist/comments.cjs.js +6 -6
- package/dist/comments.esm.js +116 -158
- package/dist/conditional-content.cjs.js +90 -90
- package/dist/conditional-content.esm.js +371 -432
- package/dist/content-rules.cjs.js +7 -7
- package/dist/content-rules.esm.js +105 -159
- package/dist/data-binding.cjs.js +46 -46
- package/dist/data-binding.esm.js +328 -368
- package/dist/direction.esm.js +9 -18
- package/dist/doc-schema.cjs.js +29 -29
- package/dist/doc-schema.esm.js +240 -308
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +4 -5
- package/dist/documentManager-CTqRftU8.mjs +8369 -0
- package/dist/documentManager-Jf0RbSks.js +17 -0
- package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +1 -2
- package/dist/embed-iframe.cjs.js +4 -4
- package/dist/embed-iframe.esm.js +73 -81
- package/dist/emojis.cjs.js +8 -8
- package/dist/emojis.esm.js +65 -77
- package/dist/enterprise.cjs.js +1 -1
- package/dist/enterprise.esm.js +54 -56
- package/dist/font-family.cjs.js +1 -1
- package/dist/font-family.esm.js +39 -47
- package/dist/font-size.cjs.js +1 -1
- package/dist/font-size.esm.js +37 -53
- package/dist/footnote.cjs.js +2 -2
- package/dist/footnote.esm.js +76 -117
- package/dist/history.cjs.js +1 -1
- package/dist/history.esm.js +70 -92
- package/dist/html2canvas.esm-B5qzocYs.js +5 -0
- package/dist/{html2canvas.esm-1a1724a1.mjs → html2canvas.esm-BWVIUcAF.mjs} +141 -225
- package/dist/indent.cjs.js +1 -1
- package/dist/indent.esm.js +12 -24
- package/dist/{index-f04538f2.mjs → index-BFsKNTTj.mjs} +70 -71
- 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-CE_A4QSm.js +5 -0
- package/dist/index.es-DQ78mYYo.mjs +6665 -0
- package/dist/index.esm.js +125 -128
- package/dist/italic.cjs.js +1 -1
- package/dist/italic.esm.js +8 -9
- package/dist/jspdf.es.min-BoS80556.js +77 -0
- package/dist/{jspdf.es.min-c36a4fd8.mjs → jspdf.es.min-DQCoX5yh.mjs} +3658 -4682
- package/dist/line-height.cjs.js +1 -1
- package/dist/line-height.esm.js +11 -24
- package/dist/link.cjs.js +5 -5
- package/dist/link.esm.js +24 -30
- package/dist/list.cjs.js +1 -1
- package/dist/list.esm.js +20 -25
- package/dist/lite.cjs.js +1 -1
- package/dist/lite.esm.js +59 -61
- package/dist/math.cjs.js +21 -21
- package/dist/math.esm.js +139 -146
- package/dist/media-manager.cjs.js +31 -31
- package/dist/media-manager.esm.js +285 -300
- package/dist/mentions.cjs.js +9 -9
- package/dist/mentions.esm.js +238 -286
- package/dist/merge-tag.cjs.js +2 -2
- package/dist/merge-tag.esm.js +177 -216
- package/dist/page-break.cjs.js +2 -2
- package/dist/page-break.esm.js +33 -49
- package/dist/pii-redaction.cjs.js +19 -19
- package/dist/pii-redaction.esm.js +393 -463
- package/dist/plugins.css +1 -0
- package/dist/preview.esm.js +5 -10
- package/dist/print.cjs.js +4 -4
- package/dist/print.esm.js +17 -20
- package/dist/{purify.es-35a15df8.mjs → purify.es-DHhaBdbu.mjs} +9 -19
- package/dist/{purify.es-a8d731c6.js → purify.es-T2a3nLiC.js} +1 -1
- package/dist/slash-commands.cjs.js +2 -2
- package/dist/slash-commands.esm.js +39 -75
- package/dist/smart-paste.cjs.js +27 -27
- package/dist/smart-paste.esm.js +280 -336
- package/dist/special-characters.cjs.js +7 -7
- package/dist/special-characters.esm.js +61 -69
- package/dist/spell-check.cjs.js +5 -5
- package/dist/spell-check.esm.js +97 -123
- package/dist/strikethrough.cjs.js +1 -1
- package/dist/strikethrough.esm.js +14 -19
- package/dist/table.cjs.js +4 -4
- package/dist/table.esm.js +191 -225
- package/dist/template.cjs.js +21 -20
- package/dist/template.esm.js +715 -196
- package/dist/text-alignment.cjs.js +1 -1
- package/dist/text-alignment.esm.js +21 -27
- package/dist/text-color.cjs.js +3 -3
- package/dist/text-color.esm.js +70 -87
- package/dist/track-changes.cjs.js +2 -2
- package/dist/track-changes.esm.js +100 -162
- package/dist/translation-workflow.cjs.js +74 -74
- package/dist/translation-workflow.esm.js +602 -678
- package/dist/version-diff.cjs.js +14 -14
- package/dist/version-diff.esm.js +128 -157
- package/package.json +1 -1
- package/dist/_commonjsHelpers-6763f629.js +0 -1
- package/dist/_commonjsHelpers-c5d32002.mjs +0 -30
- package/dist/anchoredPopover-33f1358d.mjs +0 -109
- package/dist/anchoredPopover-8151d535.js +0 -1
- package/dist/documentManager-25b6203c.mjs +0 -9122
- package/dist/documentManager-b69e7054.js +0 -17
- package/dist/html2canvas.esm-09133e29.js +0 -22
- package/dist/index-656d224b.js +0 -231
- package/dist/index-6a8c48bb.js +0 -1
- package/dist/index-d027b7e2.mjs +0 -16859
- package/dist/index.es-730f2d98.mjs +0 -5775
- package/dist/index.es-dd40173b.js +0 -18
- package/dist/jspdf.es.min-90db2c97.js +0 -243
- package/dist/style.css +0 -1
- /package/dist/{editorContainerHelpers-36b8ddf3.js → editorContainerHelpers-CFbfiOJI.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 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;
|
|
@@ -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=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
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(g).map(r=>`
|
|
275
275
|
<button class="special-characters-tab ${e===r?"active":""}" data-category="${r}">
|
|
276
|
-
${
|
|
276
|
+
${g[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 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
293
|
${o}
|
|
294
294
|
</button>
|
|
295
|
-
`).join("")},
|
|
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const g = {
|
|
2
2
|
all: {
|
|
3
3
|
name: "All",
|
|
4
4
|
characters: [
|
|
@@ -389,7 +389,7 @@ const m = {
|
|
|
389
389
|
name: "Arrows",
|
|
390
390
|
characters: ["←", "↑", "→", "↓", "↔", "↕", "↖", "↗", "↘", "↙", "↚", "↛", "↜", "↝", "↞", "↟", "↠", "↡", "↢", "↣", "↤", "↥", "↦", "↧", "↨", "↩", "↪", "↫", "↬", "↭", "↮", "↯", "↰", "↱", "↲", "↳", "↴", "↵", "↶", "↷", "↸", "↹", "↺", "↻", "↼", "↽", "↾", "↿", "⇀", "⇁", "⇂", "⇃", "⇄", "⇅", "⇆", "⇇", "⇈", "⇉", "⇊", "⇋", "⇌", "⇍", "⇎", "⇏", "⇐", "⇑", "⇒", "⇓", "⇔", "⇕", "⇖", "⇗", "⇘", "⇙", "⇚", "⇛", "⇜", "⇝", "⇞", "⇟", "⇠", "⇡", "⇢", "⇣", "⇤", "⇥", "⇦", "⇧", "⇨", "⇩", "⇪", "⇫", "⇬", "⇭", "⇮", "⇯", "⇰", "⇱", "⇲", "⇳", "⇴", "⇵", "⇶", "⇷", "⇸", "⇹", "⇺", "⇻", "⇼", "⇽", "⇾", "⇿"]
|
|
391
391
|
}
|
|
392
|
-
},
|
|
392
|
+
}, x = {
|
|
393
393
|
"€": "euro",
|
|
394
394
|
"£": "pound",
|
|
395
395
|
"¥": "yen",
|
|
@@ -438,24 +438,21 @@ const m = {
|
|
|
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
|
-
|
|
454
|
-
const a = "special-characters-plugin-styles";
|
|
455
|
-
if (document.getElementById(a))
|
|
456
|
-
return;
|
|
441
|
+
let u = !1;
|
|
442
|
+
const C = '[data-theme="dark"], .dark, .editora-theme-dark', k = () => {
|
|
443
|
+
const t = window.getSelection();
|
|
444
|
+
if (!t || t.rangeCount === 0) return null;
|
|
445
|
+
const e = t.anchorNode;
|
|
446
|
+
return (e instanceof HTMLElement ? e : e?.parentElement)?.closest(".rte-content, .editora-content") || null;
|
|
447
|
+
}, E = (t) => {
|
|
448
|
+
const e = t || k();
|
|
449
|
+
return e ? !!e.closest(C) : !1;
|
|
450
|
+
}, z = () => {
|
|
451
|
+
if (typeof document > "u") return;
|
|
452
|
+
const t = "special-characters-plugin-styles";
|
|
453
|
+
if (document.getElementById(t)) return;
|
|
457
454
|
const e = document.createElement("style");
|
|
458
|
-
e.id =
|
|
455
|
+
e.id = t, e.textContent = `
|
|
459
456
|
.special-characters-overlay {
|
|
460
457
|
--rte-sc-overlay-bg: rgba(15, 23, 36, 0.56);
|
|
461
458
|
--rte-sc-dialog-bg: #ffffff;
|
|
@@ -722,21 +719,20 @@ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
|
|
|
722
719
|
}
|
|
723
720
|
}
|
|
724
721
|
`, document.head.appendChild(e);
|
|
725
|
-
}, L = (
|
|
722
|
+
}, L = (t) => {
|
|
726
723
|
const e = window.getSelection();
|
|
727
724
|
if (e && e.rangeCount > 0) {
|
|
728
|
-
const
|
|
729
|
-
|
|
730
|
-
const c = document.createTextNode(
|
|
731
|
-
|
|
725
|
+
const a = e.getRangeAt(0);
|
|
726
|
+
a.deleteContents();
|
|
727
|
+
const c = document.createTextNode(t);
|
|
728
|
+
a.insertNode(c), a.setStartAfter(c), a.setEndAfter(c), e.removeAllRanges(), e.addRange(a);
|
|
732
729
|
}
|
|
733
|
-
}, S = (
|
|
734
|
-
if (typeof window > "u" ||
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
let e = "all", t = "", c = null;
|
|
730
|
+
}, S = (t) => {
|
|
731
|
+
if (typeof window > "u" || u) return;
|
|
732
|
+
u = !0, z();
|
|
733
|
+
let e = "all", a = "", c = null;
|
|
738
734
|
const i = document.createElement("div");
|
|
739
|
-
i.className = "special-characters-overlay",
|
|
735
|
+
i.className = "special-characters-overlay", E(t) && i.classList.add("rte-ui-theme-dark");
|
|
740
736
|
const s = document.createElement("div");
|
|
741
737
|
s.className = "special-characters-dialog", s.setAttribute("role", "dialog"), s.setAttribute("aria-modal", "true"), s.innerHTML = `
|
|
742
738
|
<div class="special-characters-header">
|
|
@@ -745,9 +741,9 @@ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
|
|
|
745
741
|
</div>
|
|
746
742
|
<div class="special-characters-content">
|
|
747
743
|
<div class="special-characters-tabs">
|
|
748
|
-
${Object.keys(
|
|
744
|
+
${Object.keys(g).map((r) => `
|
|
749
745
|
<button class="special-characters-tab ${e === r ? "active" : ""}" data-category="${r}">
|
|
750
|
-
${
|
|
746
|
+
${g[r].name}
|
|
751
747
|
</button>
|
|
752
748
|
`).join("")}
|
|
753
749
|
</div>
|
|
@@ -763,52 +759,48 @@ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
|
|
|
763
759
|
</div>
|
|
764
760
|
</div>
|
|
765
761
|
`;
|
|
766
|
-
const
|
|
767
|
-
if (!
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
l == null || l.querySelectorAll(".special-characters-tab").forEach((r) => {
|
|
762
|
+
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) => {
|
|
763
|
+
if (!a.trim()) return !0;
|
|
764
|
+
const o = a.toLowerCase();
|
|
765
|
+
return r.toLowerCase().includes(o) || (x[r] || "").toLowerCase().includes(o);
|
|
766
|
+
}), v = () => {
|
|
767
|
+
b?.querySelectorAll(".special-characters-tab").forEach((r) => {
|
|
773
768
|
r.classList.toggle("active", r.getAttribute("data-category") === e);
|
|
774
769
|
});
|
|
775
|
-
},
|
|
776
|
-
if (!
|
|
777
|
-
return;
|
|
770
|
+
}, h = () => {
|
|
771
|
+
if (!d) return;
|
|
778
772
|
const r = y();
|
|
779
773
|
if (r.length === 0) {
|
|
780
|
-
|
|
774
|
+
d.innerHTML = `<div class="special-characters-no-results">No characters found for "${a}"</div>`;
|
|
781
775
|
return;
|
|
782
776
|
}
|
|
783
|
-
|
|
784
|
-
<button class="special-characters-item" data-char="${o}" title="${
|
|
777
|
+
d.innerHTML = r.map((o) => `
|
|
778
|
+
<button class="special-characters-item" data-char="${o}" title="${x[o] || o}">
|
|
785
779
|
${o}
|
|
786
780
|
</button>
|
|
787
781
|
`).join("");
|
|
788
|
-
},
|
|
789
|
-
c !== null && (window.clearTimeout(c), c = null), i.parentNode && i.parentNode.removeChild(i),
|
|
790
|
-
},
|
|
791
|
-
r.key === "Escape" && (r.preventDefault(), r.stopPropagation(),
|
|
782
|
+
}, p = () => {
|
|
783
|
+
c !== null && (window.clearTimeout(c), c = null), i.parentNode && i.parentNode.removeChild(i), u = !1, document.removeEventListener("keydown", f, !0);
|
|
784
|
+
}, f = (r) => {
|
|
785
|
+
r.key === "Escape" && (r.preventDefault(), r.stopPropagation(), p());
|
|
792
786
|
};
|
|
793
|
-
|
|
794
|
-
const
|
|
795
|
-
if (!
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
c = null, b();
|
|
787
|
+
w?.addEventListener("click", p), b?.addEventListener("click", (r) => {
|
|
788
|
+
const l = r.target.closest(".special-characters-tab");
|
|
789
|
+
if (!l) return;
|
|
790
|
+
const n = l.getAttribute("data-category");
|
|
791
|
+
!n || e === n || (e = n, v(), h());
|
|
792
|
+
}), m?.addEventListener("input", (r) => {
|
|
793
|
+
a = r.target.value, c !== null && window.clearTimeout(c), c = window.setTimeout(() => {
|
|
794
|
+
c = null, h();
|
|
802
795
|
}, 90);
|
|
803
|
-
}),
|
|
804
|
-
const
|
|
805
|
-
if (!
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
p && (L(p), g());
|
|
796
|
+
}), d?.addEventListener("click", (r) => {
|
|
797
|
+
const l = r.target.closest(".special-characters-item");
|
|
798
|
+
if (!l) return;
|
|
799
|
+
const n = l.getAttribute("data-char");
|
|
800
|
+
n && (L(n), p());
|
|
809
801
|
}), i.addEventListener("click", (r) => {
|
|
810
|
-
r.target === i &&
|
|
811
|
-
}), document.addEventListener("keydown",
|
|
802
|
+
r.target === i && p();
|
|
803
|
+
}), document.addEventListener("keydown", f, !0), v(), h(), i.appendChild(s), document.body.appendChild(i), requestAnimationFrame(() => m?.focus());
|
|
812
804
|
}, q = () => ({
|
|
813
805
|
name: "specialCharacters",
|
|
814
806
|
toolbar: [{
|
|
@@ -817,9 +809,9 @@ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
|
|
|
817
809
|
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>'
|
|
818
810
|
}],
|
|
819
811
|
commands: {
|
|
820
|
-
insertSpecialCharacter: (
|
|
821
|
-
const
|
|
822
|
-
return S(
|
|
812
|
+
insertSpecialCharacter: (t, e) => {
|
|
813
|
+
const a = e?.contentElement instanceof HTMLElement ? e.contentElement : k();
|
|
814
|
+
return S(a), !0;
|
|
823
815
|
}
|
|
824
816
|
},
|
|
825
817
|
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 B={characterData:!0,childList:!0,subtree:!0},H="rte-spellcheck-styles",R="__editoraCommandEditorRoot";function K(e){const t=e?.contentElement||e?.editorElement||null;if(!(t instanceof HTMLElement))return;const r=t.getAttribute("contenteditable")==="true"?t:t.querySelector?.('[contenteditable="true"]');if(r instanceof HTMLElement){s=r,h=r;return}const l=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(l);o&&(s=o,h=o)}function P(){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 l=A(t);if(l)return l;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 r=(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.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 l=r.closest('.editora-toolbar-button[data-command="toggleSpellCheck"], .rte-toolbar-button[data-command="toggleSpellCheck"]');if(!l)return;const o=l.closest("[data-editora-editor]"),n=A(o);n&&(h=n,s=n)};document.addEventListener("pointerdown",e,!0),_=!0}function ee(){const e=P();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,B)}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 l=0;l<=t.length;l++)r[l]=[l];for(let l=0;l<=e.length;l++)r[0][l]=l;for(let l=1;l<=t.length;l++)for(let o=1;o<=e.length;o++)t.charAt(l-1)===e.charAt(o-1)?r[l][o]=r[l-1][o-1]:r[l][o]=Math.min(r[l-1][o-1]+1,r[l][o-1]+1,r[l-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(n=>({word:n,distance:ne(r,n)}));return o.sort((n,c)=>n.distance-c.distance),o.filter(n=>n.distance<=3).slice(0,t).map(n=>n.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 l;for(;(l=r.exec(e.data))!==null;){const o=l[0],n=l.index,c=n+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}-${n}`,node:e,startOffset:n,endOffset:c,word:o,suggestions:ae(o),ignored:!1})}return t}const V=()=>{const e=P();if(e&&document.contains(e))return s=e,e;const t=window.getSelection();if(t&&t.rangeCount>0){let l=t.getRangeAt(0).startContainer;for(;l&&l!==document.body;){if(l.nodeType===Node.ELEMENT_NODE){const o=l;if(o.getAttribute("contenteditable")==="true")return o}l=l.parentNode}}const r=document.activeElement;if(r){if(r.getAttribute("contenteditable")==="true")return r;const l=r.closest('[contenteditable="true"]');if(l)return l;const o=r.closest("[data-editora-editor]");if(o){const n=o.querySelector('[contenteditable="true"]');if(n)return n}}return document.querySelector('[contenteditable="true"]')};function M(){const e=k();if(!e)return[];const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:o=>!o.textContent?.trim()||o.parentNode&&se(o.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let l=r.nextNode();for(;l;)t.push(...ie(l)),l=r.nextNode();return t}function m(e){const t=k();t&&(e||(e=M()),N(()=>{t.querySelectorAll(".rte-misspelled").forEach(r=>{const l=r.parentNode;if(l){for(;r.firstChild;)l.insertBefore(r.firstChild,r);l.removeChild(r)}}),e.forEach(r=>{if(S.has(r.word.toLowerCase()))return;const l=r.node.data.length;if(!(r.startOffset<0||r.endOffset>l||r.startOffset>=r.endOffset))try{const o=document.createRange();o.setStart(r.node,r.startOffset),o.setEnd(r.node,r.endOffset);const n=document.createElement("span");n.className="rte-misspelled",n.setAttribute("data-word",r.word),n.setAttribute("data-suggestions",r.suggestions.join(",")),n.setAttribute("title",`Suggestions: ${r.suggestions.join(", ")}`),n.style.borderBottom="2px wavy red",n.style.cursor="pointer",o.surroundContents(n)}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 l=document.createTextNode(t);r.deleteContents(),r.insertNode(l)})}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,n=((t.textContent||"").match(/[\p{L}\p{M}\p{N}]+/gu)||[]).length;return{total:n,misspelled:r,accuracy:n>0?(n-r)/n*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,l,o){W(o),document.querySelectorAll(".rte-spellcheck-menu").forEach(p=>p.remove());const n=document.createElement("div");if(n.className="rte-spellcheck-menu",l.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),n.remove()},n.appendChild(v)}),l.length>0){const p=document.createElement("div");p.style.cssText="height: 1px; background: #ddd; margin: 4px 0;",n.appendChild(p)}const c=document.createElement("div");c.className="rte-spellcheck-menu-item meta",c.textContent="Ignore Once",c.onclick=()=>{ue(o),n.remove()},n.appendChild(c);const i=document.createElement("div");i.className="rte-spellcheck-menu-item meta",i.textContent="Ignore All",i.onclick=()=>{G(r),n.remove()},n.appendChild(i);const w=document.createElement("div");w.className="rte-spellcheck-menu-item positive",w.textContent="Add to Dictionary",w.onclick=()=>{J(r),n.remove()},n.appendChild(w),document.body.appendChild(n);const D=n.getBoundingClientRect(),X=window.innerWidth-D.width-8,Z=window.innerHeight-D.height-8;n.style.left=`${Math.max(8,Math.min(e,X))}px`,n.style.top=`${Math.max(8,Math.min(t,Z))}px`;const F=p=>{n.contains(p.target)||(n.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"),l=(t.getAttribute("data-suggestions")||"").split(",").filter(o=>o);me(e.clientX,e.clientY,r,l,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,n)=>`
|
|
495
|
+
<div class="rte-spellcheck-item" data-word="${o.word}" data-index="${n}">
|
|
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
|
+
`,a.querySelector(".rte-spellcheck-close")?.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),O()}),a.querySelectorAll(".rte-spellcheck-word-header").forEach(o=>{o.addEventListener("click",()=>{const c=o.closest(".rte-spellcheck-item")?.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 n=o.getAttribute("data-suggestion"),c=o.closest(".rte-spellcheck-item");c?.getAttribute("data-word");const i=parseInt(c?.getAttribute("data-index")||"0");t[i]&&(de(t[i],n),m())})}),a.querySelectorAll(".ignore-btn").forEach(o=>{o.addEventListener("click",()=>{const c=o.closest(".rte-spellcheck-item")?.getAttribute("data-word");G(c)})}),a.querySelectorAll(".add-btn").forEach(o=>{o.addEventListener("click",()=>{const c=o.closest(".rte-spellcheck-item")?.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,{...B}))}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;
|