@editora/plugins 1.0.12 → 1.0.13

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.
Files changed (51) hide show
  1. package/dist/approval-workflow.cjs.js +14 -14
  2. package/dist/approval-workflow.esm.js +265 -262
  3. package/dist/blockquote.cjs.js +1 -1
  4. package/dist/blockquote.esm.js +177 -15
  5. package/dist/blocks-library.cjs.js +6 -6
  6. package/dist/blocks-library.esm.js +95 -92
  7. package/dist/bold.cjs.js +1 -1
  8. package/dist/bold.esm.js +10 -6
  9. package/dist/capitalization.cjs.js +1 -1
  10. package/dist/capitalization.esm.js +124 -44
  11. package/dist/checklist.cjs.js +1 -1
  12. package/dist/checklist.esm.js +251 -191
  13. package/dist/citations.cjs.js +4 -4
  14. package/dist/citations.esm.js +131 -128
  15. package/dist/clear-formatting.cjs.js +1 -1
  16. package/dist/clear-formatting.esm.js +68 -36
  17. package/dist/content-rules.cjs.js +5 -5
  18. package/dist/content-rules.esm.js +104 -101
  19. package/dist/data-binding.cjs.js +3 -3
  20. package/dist/data-binding.esm.js +51 -48
  21. package/dist/direction.cjs.js +1 -1
  22. package/dist/direction.esm.js +97 -74
  23. package/dist/doc-schema.cjs.js +4 -4
  24. package/dist/doc-schema.esm.js +104 -101
  25. package/dist/embed-iframe.cjs.js +21 -4
  26. package/dist/embed-iframe.esm.js +279 -116
  27. package/dist/heading.cjs.js +1 -1
  28. package/dist/heading.esm.js +239 -56
  29. package/dist/history.cjs.js +1 -1
  30. package/dist/history.esm.js +74 -89
  31. package/dist/inlineFormatting-DOYOJdnD.js +1 -0
  32. package/dist/inlineFormatting-DuVTGXYG.mjs +95 -0
  33. package/dist/italic.cjs.js +1 -1
  34. package/dist/italic.esm.js +12 -8
  35. package/dist/math.cjs.js +27 -21
  36. package/dist/math.esm.js +218 -146
  37. package/dist/merge-tag.cjs.js +8 -2
  38. package/dist/merge-tag.esm.js +130 -111
  39. package/dist/pii-redaction.cjs.js +6 -6
  40. package/dist/pii-redaction.esm.js +169 -166
  41. package/dist/smart-paste.cjs.js +5 -5
  42. package/dist/smart-paste.esm.js +120 -117
  43. package/dist/special-characters.cjs.js +6 -10
  44. package/dist/special-characters.esm.js +97 -75
  45. package/dist/strikethrough.cjs.js +1 -1
  46. package/dist/strikethrough.esm.js +11 -25
  47. package/dist/translation-workflow.cjs.js +7 -7
  48. package/dist/translation-workflow.esm.js +103 -100
  49. package/dist/underline.cjs.js +1 -1
  50. package/dist/underline.esm.js +7 -3
  51. package/package.json +3 -3
@@ -1,4 +1,4 @@
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=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f={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:["←","↑","→","↓","↔","↕","↖","↗","↘","↙","↚","↛","↜","↝","↞","↟","↠","↡","↢","↣","↤","↥","↦","↧","↨","↩","↪","↫","↬","↭","↮","↯","↰","↱","↲","↳","↴","↵","↶","↷","↸","↹","↺","↻","↼","↽","↾","↿","⇀","⇁","⇂","⇃","⇄","⇅","⇆","⇇","⇈","⇉","⇊","⇋","⇌","⇍","⇎","⇏","⇐","⇑","⇒","⇓","⇔","⇕","⇖","⇗","⇘","⇙","⇚","⇛","⇜","⇝","⇞","⇟","⇠","⇡","⇢","⇣","⇤","⇥","⇦","⇧","⇨","⇩","⇪","⇫","⇬","⇭","⇮","⇯","⇰","⇱","⇲","⇳","⇴","⇵","⇶","⇷","⇸","⇹","⇺","⇻","⇼","⇽","⇾","⇿"]}},y={"€":"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 S='[data-theme="dark"], .dark, .editora-theme-dark',z=r=>r?r.nodeType===Node.ELEMENT_NODE?r:r.parentElement:null,b=()=>{const r=window.getSelection();return!r||r.rangeCount===0?null:z(r.getRangeAt(0).startContainer)?.closest('.rte-content, .editora-content, [contenteditable="true"]')||null},T=r=>{const e=window.getSelection();if(!e||e.rangeCount===0)return null;const a=e.getRangeAt(0);return!r.contains(a.startContainer)||!r.contains(a.endContainer)?null:a.cloneRange()},A=r=>{const e=document.createRange();return e.selectNodeContents(r),e.collapse(!1),e},L=(r,e,a)=>{if(e!==a){if(typeof window.execEditorCommand=="function"){window.execEditorCommand("recordDomTransaction",r,e,a);return}if(typeof window.executeEditorCommand=="function")try{window.executeEditorCommand("recordDomTransaction",{editor:r,beforeHTML:e,afterHTML:a})}catch{}}},q=r=>{const e=r||b();return e?!!e.closest(S):!1},N=()=>{if(typeof document>"u")return;const r="special-characters-plugin-styles";if(document.getElementById(r))return;const e=document.createElement("style");e.id=r,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=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=`
267
+ `,document.head.appendChild(e)},D=(r,e,a)=>{const c=e||b();if(!c)return;const l=a&&c.contains(a.commonAncestorContainer)?a:A(c),d=c.innerHTML;l.deleteContents();const i=document.createTextNode(r);l.insertNode(i),l.setStartAfter(i),l.setEndAfter(i);const o=window.getSelection();o&&(o.removeAllRanges(),o.addRange(l));const h=c.innerHTML;L(c,d,h),c.dispatchEvent(new window.Event("input",{bubbles:!0})),c.focus()},R=r=>{if(typeof window>"u"||v)return;v=!0,N();const e=r||b(),a=e?T(e):null;let c="all",l="",d=null;const i=document.createElement("div");i.className="special-characters-overlay",q(r)&&i.classList.add("rte-ui-theme-dark");const o=document.createElement("div");o.className="special-characters-dialog",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.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(g).map(r=>`
275
- <button class="special-characters-tab ${e===r?"active":""}" data-category="${r}">
276
- ${g[r].name}
274
+ ${Object.keys(f).map(t=>`
275
+ <button class="special-characters-tab ${c===t?"active":""}" data-category="${t}">
276
+ ${f[t].name}
277
277
  </button>
278
278
  `).join("")}
279
279
  </div>
@@ -288,8 +288,4 @@
288
288
  <div class="special-characters-grid"></div>
289
289
  </div>
290
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;
291
+ `;const h=o.querySelector(".special-characters-tabs"),u=o.querySelector(".special-characters-grid"),x=o.querySelector(".special-characters-search-input"),E=o.querySelector(".special-characters-close"),C=()=>f[c].characters.filter(t=>{if(!l.trim())return!0;const s=l.toLowerCase();return t.toLowerCase().includes(s)||(y[t]||"").toLowerCase().includes(s)}),w=()=>{h?.querySelectorAll(".special-characters-tab").forEach(t=>{t.classList.toggle("active",t.getAttribute("data-category")===c)})},m=()=>{if(!u)return;const t=C();if(u.textContent="",t.length===0){const s=document.createElement("div");s.className="special-characters-no-results",s.textContent=`No characters found for "${l}"`,u.appendChild(s);return}t.forEach(s=>{const n=document.createElement("button");n.type="button",n.className="special-characters-item",n.dataset.char=s,n.title=y[s]||s,n.textContent=s,u.appendChild(n)})},g=()=>{d!==null&&(window.clearTimeout(d),d=null),i.parentNode&&i.parentNode.removeChild(i),v=!1,document.removeEventListener("keydown",k,!0)},k=t=>{t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),g())};E?.addEventListener("click",g),h?.addEventListener("click",t=>{const n=t.target.closest(".special-characters-tab");if(!n)return;const p=n.getAttribute("data-category");!p||c===p||(c=p,w(),m())}),x?.addEventListener("input",t=>{l=t.target.value,d!==null&&window.clearTimeout(d),d=window.setTimeout(()=>{d=null,m()},90)}),u?.addEventListener("click",t=>{const n=t.target.closest(".special-characters-item");if(!n)return;const p=n.dataset.char;p&&(D(p,e,a),g())}),i.addEventListener("click",t=>{t.target===i&&g()}),document.addEventListener("keydown",k,!0),w(),m(),i.appendChild(o),document.body.appendChild(i),requestAnimationFrame(()=>x?.focus())},j=()=>({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:(r,e)=>{const a=e?.contentElement instanceof HTMLElement?e.contentElement:b();return R(a),!0}},keymap:{}});exports.SpecialCharactersPlugin=j;
@@ -1,4 +1,4 @@
1
- const g = {
1
+ const f = {
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
- }, x = {
392
+ }, y = {
393
393
  "€": "euro",
394
394
  "£": "pound",
395
395
  "¥": "yen",
@@ -438,21 +438,39 @@ const g = {
438
438
  "↓": "down arrow",
439
439
  "↔": "left right arrow"
440
440
  };
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 = () => {
441
+ let v = !1;
442
+ const z = '[data-theme="dark"], .dark, .editora-theme-dark', S = (r) => r ? r.nodeType === Node.ELEMENT_NODE ? r : r.parentElement : null, b = () => {
443
+ const r = window.getSelection();
444
+ return !r || r.rangeCount === 0 ? null : S(r.getRangeAt(0).startContainer)?.closest('.rte-content, .editora-content, [contenteditable="true"]') || null;
445
+ }, A = (r) => {
446
+ const e = window.getSelection();
447
+ if (!e || e.rangeCount === 0) return null;
448
+ const a = e.getRangeAt(0);
449
+ return !r.contains(a.startContainer) || !r.contains(a.endContainer) ? null : a.cloneRange();
450
+ }, L = (r) => {
451
+ const e = document.createRange();
452
+ return e.selectNodeContents(r), e.collapse(!1), e;
453
+ }, T = (r, e, a) => {
454
+ if (e !== a) {
455
+ if (typeof window.execEditorCommand == "function") {
456
+ window.execEditorCommand("recordDomTransaction", r, e, a);
457
+ return;
458
+ }
459
+ if (typeof window.executeEditorCommand == "function")
460
+ try {
461
+ window.executeEditorCommand("recordDomTransaction", { editor: r, beforeHTML: e, afterHTML: a });
462
+ } catch {
463
+ }
464
+ }
465
+ }, q = (r) => {
466
+ const e = r || b();
467
+ return e ? !!e.closest(z) : !1;
468
+ }, N = () => {
451
469
  if (typeof document > "u") return;
452
- const t = "special-characters-plugin-styles";
453
- if (document.getElementById(t)) return;
470
+ const r = "special-characters-plugin-styles";
471
+ if (document.getElementById(r)) return;
454
472
  const e = document.createElement("style");
455
- e.id = t, e.textContent = `
473
+ e.id = r, e.textContent = `
456
474
  .special-characters-overlay {
457
475
  --rte-sc-overlay-bg: rgba(15, 23, 36, 0.56);
458
476
  --rte-sc-dialog-bg: #ffffff;
@@ -719,31 +737,35 @@ const C = '[data-theme="dark"], .dark, .editora-theme-dark', k = () => {
719
737
  }
720
738
  }
721
739
  `, document.head.appendChild(e);
722
- }, L = (t) => {
723
- const e = window.getSelection();
724
- if (e && e.rangeCount > 0) {
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);
729
- }
730
- }, S = (t) => {
731
- if (typeof window > "u" || u) return;
732
- u = !0, z();
733
- let e = "all", a = "", c = null;
740
+ }, D = (r, e, a) => {
741
+ const c = e || b();
742
+ if (!c) return;
743
+ const l = a && c.contains(a.commonAncestorContainer) ? a : L(c), d = c.innerHTML;
744
+ l.deleteContents();
745
+ const i = document.createTextNode(r);
746
+ l.insertNode(i), l.setStartAfter(i), l.setEndAfter(i);
747
+ const o = window.getSelection();
748
+ o && (o.removeAllRanges(), o.addRange(l));
749
+ const h = c.innerHTML;
750
+ T(c, d, h), c.dispatchEvent(new window.Event("input", { bubbles: !0 })), c.focus();
751
+ }, R = (r) => {
752
+ if (typeof window > "u" || v) return;
753
+ v = !0, N();
754
+ const e = r || b(), a = e ? A(e) : null;
755
+ let c = "all", l = "", d = null;
734
756
  const i = document.createElement("div");
735
- i.className = "special-characters-overlay", E(t) && i.classList.add("rte-ui-theme-dark");
736
- const s = document.createElement("div");
737
- s.className = "special-characters-dialog", s.setAttribute("role", "dialog"), s.setAttribute("aria-modal", "true"), s.innerHTML = `
757
+ i.className = "special-characters-overlay", q(r) && i.classList.add("rte-ui-theme-dark");
758
+ const o = document.createElement("div");
759
+ o.className = "special-characters-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.innerHTML = `
738
760
  <div class="special-characters-header">
739
761
  <h2>Insert Special Characters</h2>
740
762
  <button class="special-characters-close">×</button>
741
763
  </div>
742
764
  <div class="special-characters-content">
743
765
  <div class="special-characters-tabs">
744
- ${Object.keys(g).map((r) => `
745
- <button class="special-characters-tab ${e === r ? "active" : ""}" data-category="${r}">
746
- ${g[r].name}
766
+ ${Object.keys(f).map((t) => `
767
+ <button class="special-characters-tab ${c === t ? "active" : ""}" data-category="${t}">
768
+ ${f[t].name}
747
769
  </button>
748
770
  `).join("")}
749
771
  </div>
@@ -759,49 +781,49 @@ const C = '[data-theme="dark"], .dark, .editora-theme-dark', k = () => {
759
781
  </div>
760
782
  </div>
761
783
  `;
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) => {
768
- r.classList.toggle("active", r.getAttribute("data-category") === e);
784
+ const h = o.querySelector(".special-characters-tabs"), u = o.querySelector(".special-characters-grid"), x = o.querySelector(".special-characters-search-input"), E = o.querySelector(".special-characters-close"), C = () => f[c].characters.filter((t) => {
785
+ if (!l.trim()) return !0;
786
+ const s = l.toLowerCase();
787
+ return t.toLowerCase().includes(s) || (y[t] || "").toLowerCase().includes(s);
788
+ }), w = () => {
789
+ h?.querySelectorAll(".special-characters-tab").forEach((t) => {
790
+ t.classList.toggle("active", t.getAttribute("data-category") === c);
769
791
  });
770
- }, h = () => {
771
- if (!d) return;
772
- const r = y();
773
- if (r.length === 0) {
774
- d.innerHTML = `<div class="special-characters-no-results">No characters found for "${a}"</div>`;
792
+ }, m = () => {
793
+ if (!u) return;
794
+ const t = C();
795
+ if (u.textContent = "", t.length === 0) {
796
+ const s = document.createElement("div");
797
+ s.className = "special-characters-no-results", s.textContent = `No characters found for "${l}"`, u.appendChild(s);
775
798
  return;
776
799
  }
777
- d.innerHTML = r.map((o) => `
778
- <button class="special-characters-item" data-char="${o}" title="${x[o] || o}">
779
- ${o}
780
- </button>
781
- `).join("");
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());
800
+ t.forEach((s) => {
801
+ const n = document.createElement("button");
802
+ n.type = "button", n.className = "special-characters-item", n.dataset.char = s, n.title = y[s] || s, n.textContent = s, u.appendChild(n);
803
+ });
804
+ }, g = () => {
805
+ d !== null && (window.clearTimeout(d), d = null), i.parentNode && i.parentNode.removeChild(i), v = !1, document.removeEventListener("keydown", k, !0);
806
+ }, k = (t) => {
807
+ t.key === "Escape" && (t.preventDefault(), t.stopPropagation(), g());
786
808
  };
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();
809
+ E?.addEventListener("click", g), h?.addEventListener("click", (t) => {
810
+ const n = t.target.closest(".special-characters-tab");
811
+ if (!n) return;
812
+ const p = n.getAttribute("data-category");
813
+ !p || c === p || (c = p, w(), m());
814
+ }), x?.addEventListener("input", (t) => {
815
+ l = t.target.value, d !== null && window.clearTimeout(d), d = window.setTimeout(() => {
816
+ d = null, m();
795
817
  }, 90);
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());
801
- }), i.addEventListener("click", (r) => {
802
- r.target === i && p();
803
- }), document.addEventListener("keydown", f, !0), v(), h(), i.appendChild(s), document.body.appendChild(i), requestAnimationFrame(() => m?.focus());
804
- }, q = () => ({
818
+ }), u?.addEventListener("click", (t) => {
819
+ const n = t.target.closest(".special-characters-item");
820
+ if (!n) return;
821
+ const p = n.dataset.char;
822
+ p && (D(p, e, a), g());
823
+ }), i.addEventListener("click", (t) => {
824
+ t.target === i && g();
825
+ }), document.addEventListener("keydown", k, !0), w(), m(), i.appendChild(o), document.body.appendChild(i), requestAnimationFrame(() => x?.focus());
826
+ }, j = () => ({
805
827
  name: "specialCharacters",
806
828
  toolbar: [{
807
829
  label: "Special Characters",
@@ -809,13 +831,13 @@ const C = '[data-theme="dark"], .dark, .editora-theme-dark', k = () => {
809
831
  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
832
  }],
811
833
  commands: {
812
- insertSpecialCharacter: (t, e) => {
813
- const a = e?.contentElement instanceof HTMLElement ? e.contentElement : k();
814
- return S(a), !0;
834
+ insertSpecialCharacter: (r, e) => {
835
+ const a = e?.contentElement instanceof HTMLElement ? e.contentElement : b();
836
+ return R(a), !0;
815
837
  }
816
838
  },
817
839
  keymap: {}
818
840
  });
819
841
  export {
820
- q as SpecialCharactersPlugin
842
+ j as SpecialCharactersPlugin
821
843
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=()=>({name:"strikethrough",marks:{strikethrough:{parseDOM:[{tag:"s"},{tag:"strike"},{tag:"del"},{style:"text-decoration",getAttrs:t=>(typeof t=="string"?t:t.style.textDecoration)==="line-through"&&null}],toDOM:()=>["s",0]}},toolbar:[{label:"Strikethrough",command:"toggleStrikethrough",icon:'<svg width="24" height="24" focusable="false"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 0 1 7 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1Z"></path><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z" fill-rule="nonzero"></path></g></svg>',shortcut:"Mod-Shift-x"}],commands:{toggleStrikethrough:()=>{const t=l();if(!t)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const e=n.getRangeAt(0);if(!t.contains(e.commonAncestorContainer))return!1;t.focus({preventScroll:!0});const o=document.execCommand("strikeThrough",!1);return c(t),t.dispatchEvent(new Event("input",{bubbles:!0})),o!==!1}},keymap:{"Mod-Shift-x":"toggleStrikethrough","Mod-Shift-X":"toggleStrikethrough"}});function l(){const t=window.getSelection();if(t&&t.rangeCount>0){const e=t.getRangeAt(0).startContainer,r=(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest('[contenteditable="true"], .rte-content, .editora-content');if(r)return r}const n=document.activeElement;return n?n.getAttribute("contenteditable")==="true"?n:n.closest('[contenteditable="true"], .rte-content, .editora-content'):null}function c(t){t.querySelectorAll("strike, del").forEach(e=>{const o=document.createElement("s");for(const r of Array.from(e.attributes))r.name!=="style"&&o.setAttribute(r.name,r.value);for(;e.firstChild;)o.appendChild(e.firstChild);e.parentNode?.replaceChild(o,e)})}exports.StrikethroughPlugin=i;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./inlineFormatting-DOYOJdnD.js"),n=()=>({name:"strikethrough",marks:{strikethrough:{parseDOM:[{tag:"s"},{tag:"strike"},{tag:"del"},{style:"text-decoration",getAttrs:t=>(typeof t=="string"?t:t.style.textDecoration)==="line-through"&&null}],toDOM:()=>["s",0]}},toolbar:[{label:"Strikethrough",command:"toggleStrikethrough",icon:'<svg width="24" height="24" focusable="false"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 0 1 7 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1Z"></path><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z" fill-rule="nonzero"></path></g></svg>',shortcut:"Mod-Shift-x"}],commands:{toggleStrikethrough:(t,r)=>l.applyInlineFormatting({command:"strikeThrough",context:r,normalize:a})},keymap:{"Mod-Shift-x":"toggleStrikethrough","Mod-Shift-X":"toggleStrikethrough"}});function a(t){t.querySelectorAll("strike, del").forEach(e=>{const o=document.createElement("s");for(const i of Array.from(e.attributes))i.name!=="style"&&o.setAttribute(i.name,i.value);for(;e.firstChild;)o.appendChild(e.firstChild);e.parentNode?.replaceChild(o,e)})}exports.StrikethroughPlugin=n;
@@ -1,4 +1,5 @@
1
- const l = () => ({
1
+ import { a } from "./inlineFormatting-DuVTGXYG.mjs";
2
+ const n = () => ({
2
3
  name: "strikethrough",
3
4
  // Schema definition for strikethrough mark
4
5
  marks: {
@@ -29,17 +30,11 @@ const l = () => ({
29
30
  /**
30
31
  * Toggle strikethrough formatting on current selection
31
32
  */
32
- toggleStrikethrough: () => {
33
- const t = i();
34
- if (!t) return !1;
35
- const n = window.getSelection();
36
- if (!n || n.rangeCount === 0) return !1;
37
- const e = n.getRangeAt(0);
38
- if (!t.contains(e.commonAncestorContainer)) return !1;
39
- t.focus({ preventScroll: !0 });
40
- const o = document.execCommand("strikeThrough", !1);
41
- return c(t), t.dispatchEvent(new Event("input", { bubbles: !0 })), o !== !1;
42
- }
33
+ toggleStrikethrough: (t, r) => a({
34
+ command: "strikeThrough",
35
+ context: r,
36
+ normalize: h
37
+ })
43
38
  },
44
39
  // Keyboard shortcuts
45
40
  keymap: {
@@ -47,25 +42,16 @@ const l = () => ({
47
42
  "Mod-Shift-X": "toggleStrikethrough"
48
43
  }
49
44
  });
50
- function i() {
51
- const t = window.getSelection();
52
- if (t && t.rangeCount > 0) {
53
- const e = t.getRangeAt(0).startContainer, r = (e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement)?.closest('[contenteditable="true"], .rte-content, .editora-content');
54
- if (r) return r;
55
- }
56
- const n = document.activeElement;
57
- return n ? n.getAttribute("contenteditable") === "true" ? n : n.closest('[contenteditable="true"], .rte-content, .editora-content') : null;
58
- }
59
- function c(t) {
45
+ function h(t) {
60
46
  t.querySelectorAll("strike, del").forEach((e) => {
61
47
  const o = document.createElement("s");
62
- for (const r of Array.from(e.attributes))
63
- r.name !== "style" && o.setAttribute(r.name, r.value);
48
+ for (const i of Array.from(e.attributes))
49
+ i.name !== "style" && o.setAttribute(i.name, i.value);
64
50
  for (; e.firstChild; )
65
51
  o.appendChild(e.firstChild);
66
52
  e.parentNode?.replaceChild(o, e);
67
53
  });
68
54
  }
69
55
  export {
70
- l as StrikethroughPlugin
56
+ n as StrikethroughPlugin
71
57
  };