@editora/plugins 1.0.11 → 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.
- package/README.md +1 -1
- package/dist/approval-workflow.cjs.js +14 -14
- package/dist/approval-workflow.esm.js +265 -262
- package/dist/blockquote.cjs.js +1 -1
- package/dist/blockquote.esm.js +177 -15
- package/dist/blocks-library.cjs.js +6 -6
- package/dist/blocks-library.esm.js +95 -92
- package/dist/bold.cjs.js +1 -1
- package/dist/bold.esm.js +10 -6
- package/dist/capitalization.cjs.js +1 -1
- package/dist/capitalization.esm.js +124 -44
- package/dist/checklist.cjs.js +1 -1
- package/dist/checklist.esm.js +251 -191
- package/dist/citations.cjs.js +4 -4
- package/dist/citations.esm.js +131 -128
- package/dist/clear-formatting.cjs.js +1 -1
- package/dist/clear-formatting.esm.js +68 -36
- package/dist/code.cjs.js +121 -44
- package/dist/code.esm.js +2694 -889
- package/dist/content-rules.cjs.js +5 -5
- package/dist/content-rules.esm.js +104 -101
- package/dist/data-binding.cjs.js +3 -3
- package/dist/data-binding.esm.js +51 -48
- package/dist/direction.cjs.js +1 -1
- package/dist/direction.esm.js +97 -74
- package/dist/doc-schema.cjs.js +4 -4
- package/dist/doc-schema.esm.js +104 -101
- package/dist/embed-iframe.cjs.js +21 -4
- package/dist/embed-iframe.esm.js +279 -116
- package/dist/heading.cjs.js +1 -1
- package/dist/heading.esm.js +239 -56
- package/dist/history.cjs.js +1 -1
- package/dist/history.esm.js +74 -89
- package/dist/inlineFormatting-DOYOJdnD.js +1 -0
- package/dist/inlineFormatting-DuVTGXYG.mjs +95 -0
- package/dist/italic.cjs.js +1 -1
- package/dist/italic.esm.js +12 -8
- package/dist/math.cjs.js +27 -21
- package/dist/math.esm.js +218 -146
- package/dist/merge-tag.cjs.js +8 -2
- package/dist/merge-tag.esm.js +130 -111
- package/dist/pii-redaction.cjs.js +6 -6
- package/dist/pii-redaction.esm.js +169 -166
- package/dist/smart-paste.cjs.js +5 -5
- package/dist/smart-paste.esm.js +120 -117
- package/dist/special-characters.cjs.js +6 -10
- package/dist/special-characters.esm.js +97 -75
- package/dist/strikethrough.cjs.js +1 -1
- package/dist/strikethrough.esm.js +11 -25
- package/dist/translation-workflow.cjs.js +7 -7
- package/dist/translation-workflow.esm.js +103 -100
- package/dist/underline.cjs.js +1 -1
- package/dist/underline.esm.js +7 -3
- package/package.json +3 -3
|
@@ -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 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)},
|
|
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(
|
|
275
|
-
<button class="special-characters-tab ${
|
|
276
|
-
${
|
|
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
|
|
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
|
|
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
|
-
},
|
|
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
|
|
442
|
-
const
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
const
|
|
449
|
-
return
|
|
450
|
-
},
|
|
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
|
|
453
|
-
if (document.getElementById(
|
|
470
|
+
const r = "special-characters-plugin-styles";
|
|
471
|
+
if (document.getElementById(r)) return;
|
|
454
472
|
const e = document.createElement("style");
|
|
455
|
-
e.id =
|
|
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
|
-
},
|
|
723
|
-
const
|
|
724
|
-
if (
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
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",
|
|
736
|
-
const
|
|
737
|
-
|
|
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(
|
|
745
|
-
<button class="special-characters-tab ${
|
|
746
|
-
${
|
|
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
|
|
763
|
-
if (!
|
|
764
|
-
const
|
|
765
|
-
return
|
|
766
|
-
}),
|
|
767
|
-
|
|
768
|
-
|
|
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
|
-
},
|
|
771
|
-
if (!
|
|
772
|
-
const
|
|
773
|
-
if (
|
|
774
|
-
|
|
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
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
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
|
-
|
|
788
|
-
const
|
|
789
|
-
if (!
|
|
790
|
-
const
|
|
791
|
-
!
|
|
792
|
-
}),
|
|
793
|
-
|
|
794
|
-
|
|
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
|
-
}),
|
|
797
|
-
const
|
|
798
|
-
if (!
|
|
799
|
-
const
|
|
800
|
-
|
|
801
|
-
}), i.addEventListener("click", (
|
|
802
|
-
|
|
803
|
-
}), document.addEventListener("keydown",
|
|
804
|
-
},
|
|
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: (
|
|
813
|
-
const a = e?.contentElement instanceof HTMLElement ? e.contentElement :
|
|
814
|
-
return
|
|
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
|
-
|
|
842
|
+
j as SpecialCharactersPlugin
|
|
821
843
|
};
|
|
@@ -1 +1 @@
|
|
|
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 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
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
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
|
|
63
|
-
|
|
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
|
-
|
|
56
|
+
n as StrikethroughPlugin
|
|
71
57
|
};
|