@editora/plugins 1.0.19 → 1.0.21
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/dist/{CodePlugin.native-Bwf25lLX.js → CodePlugin.native-CKJo7IFG.js} +8 -8
- package/dist/{CodePlugin.native-Cpp4u3Jl.mjs → CodePlugin.native-D8gGxB8i.mjs} +59 -60
- package/dist/a11y-checker.cjs.js +1 -1
- package/dist/a11y-checker.esm.js +18 -18
- package/dist/anchor.cjs.js +6 -6
- package/dist/anchor.esm.js +57 -57
- package/dist/blockquote.cjs.js +1 -1
- package/dist/blockquote.esm.js +31 -31
- package/dist/capitalization.cjs.js +1 -1
- package/dist/capitalization.esm.js +25 -25
- package/dist/checklist.cjs.js +1 -1
- package/dist/checklist.esm.js +30 -30
- package/dist/code.cjs.js +1 -1
- package/dist/code.esm.js +1 -1
- package/dist/collaboration.cjs.js +8 -8
- package/dist/collaboration.esm.js +1279 -1169
- package/dist/comments.cjs.js +1 -1
- package/dist/comments.esm.js +1 -1
- package/dist/direction.cjs.js +1 -1
- package/dist/direction.esm.js +26 -26
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +1 -1
- package/dist/{documentManager-yjRBab4v.mjs → documentManager-BL98a7YZ.mjs} +402 -404
- package/dist/{documentManager-BDz6tovy.js → documentManager-r8t7yZEd.js} +9 -9
- package/dist/enterprise.cjs.js +1 -1
- package/dist/enterprise.esm.js +1 -1
- package/dist/font-family.cjs.js +1 -1
- package/dist/font-family.esm.js +26 -26
- package/dist/{index-Bm1eqYHh.mjs → index-B-VitI3v.mjs} +23 -22
- package/dist/{index-CoflqYuK.js → index-D5xugkYA.js} +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/preview.cjs.js +3 -3
- package/dist/preview.esm.js +48 -51
- package/dist/purify.es-B6PsRpEV.js +3 -0
- package/dist/purify.es-DmCsrgBd.mjs +1480 -0
- package/dist/sanitizeHtml-CDoBlNTk.js +1 -0
- package/dist/sanitizeHtml-CtLy8um-.mjs +16 -0
- package/dist/spell-check.cjs.js +2 -2
- package/dist/spell-check.esm.js +19 -19
- package/dist/table.cjs.js +14 -14
- package/dist/table.esm.js +158 -150
- package/dist/template.cjs.js +20 -21
- package/dist/template.esm.js +176 -724
- package/package.json +6 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./purify.es-B6PsRpEV.js");function r(t){return t?e.purify_default.sanitize(t,{USE_PROFILES:{html:!0},FORBID_TAGS:["style","form","input","button","textarea","select","option","base","meta","link"],ADD_ATTR:["target"]}):""}function n(t){return new DOMParser().parseFromString(`<body>${t}</body>`,"text/html").body}exports.parseHtmlInert=n;exports.sanitizeHtml=r;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { p as e } from "./purify.es-DmCsrgBd.mjs";
|
|
2
|
+
function n(t) {
|
|
3
|
+
return t ? e.sanitize(t, {
|
|
4
|
+
USE_PROFILES: { html: !0 },
|
|
5
|
+
// <style> can restyle or exfiltrate through CSS; <form> and friends have no place in document content.
|
|
6
|
+
FORBID_TAGS: ["style", "form", "input", "button", "textarea", "select", "option", "base", "meta", "link"],
|
|
7
|
+
ADD_ATTR: ["target"]
|
|
8
|
+
}) : "";
|
|
9
|
+
}
|
|
10
|
+
function a(t) {
|
|
11
|
+
return new DOMParser().parseFromString(`<body>${t}</body>`, "text/html").body;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
a as p,
|
|
15
|
+
n as s
|
|
16
|
+
};
|
package/dist/spell-check.cjs.js
CHANGED
|
@@ -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 h(){if(l&&document.contains(l))return l;const e=
|
|
469
|
+
`}function h(){if(l&&document.contains(l))return l;const e=J();return e&&(l=e),e}function W(e){if(!e)return;const r=(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest('[contenteditable="true"]');r&&(l=r)}function S(e){if(!e)return null;const t=e.querySelector('[contenteditable="true"]');return t instanceof HTMLElement?t:null}function ee(){if(O)return;const e=t=>{const r=t.target;if(!r)return;const a=r.closest('.editora-toolbar-button[data-command="toggleSpellCheck"], .rte-toolbar-button[data-command="toggleSpellCheck"]');if(!a)return;const i=a.closest("[data-editora-editor]"),s=S(i);s&&(u=s,l=s)};document.addEventListener("pointerdown",e,!0),O=!0}function te(){const e=P();if(e&&document.contains(e))return l=e,u=null,e;if(u&&document.contains(u)){const t=u;return u=null,l=t,t}return J()}function ie(){f+=1,f===1&&d&&d.disconnect()}function ae(){if(f===0||(f-=1,f>0)||!d)return;const e=h();e&&d.observe(e,B)}function L(e){ie();try{return e()}finally{ae()}}const re=()=>{try{const e=localStorage.getItem("rte-custom-dictionary");e&&JSON.parse(e).forEach(r=>z.add(r.toLowerCase()))}catch(e){console.warn("Failed to load custom dictionary:",e)}},se=()=>{try{const e=Array.from(z);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 a=0;a<=t.length;a++)r[a]=[a];for(let a=0;a<=e.length;a++)r[0][a]=a;for(let a=1;a<=t.length;a++)for(let i=1;i<=e.length;i++)t.charAt(a-1)===e.charAt(i-1)?r[a][i]=r[a-1][i-1]:r[a][i]=Math.min(r[a-1][i-1]+1,r[a][i-1]+1,r[a-1][i]+1);return r[t.length][e.length]}function oe(e){const t=e.toLowerCase();return $.has(t)||z.has(t)||q.has(t)}function le(e,t=5){const r=e.toLowerCase(),i=Array.from($).map(s=>({word:s,distance:ne(r,s)}));return i.sort((s,n)=>s.distance-n.distance),i.filter(s=>s.distance<=3).slice(0,t).map(s=>s.word)}function ce(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 de(e){const t=[],r=/([\p{L}\p{M}\p{N}\p{Emoji_Presentation}\u200d'-]+|[\uD800-\uDBFF][\uDC00-\uDFFF])/gu;let a;for(;(a=r.exec(e.data))!==null;){const i=a[0],s=a.index,n=s+i.length;/https?:\/\//.test(i)||/@/.test(i)||/\{\{.*\}\}/.test(i)||/^\d+$/.test(i)||oe(i)||/[a-z][A-Z]/.test(i)||/-/.test(i)||i[0]===i[0].toUpperCase()&&i.length>1||t.push({id:`${i}-${s}`,node:e,startOffset:s,endOffset:n,word:i,suggestions:le(i),ignored:!1})}return t}const J=()=>{const e=P();if(e&&document.contains(e))return l=e,e;const t=window.getSelection();if(t&&t.rangeCount>0){let a=t.getRangeAt(0).startContainer;for(;a&&a!==document.body;){if(a.nodeType===Node.ELEMENT_NODE){const i=a;if(i.getAttribute("contenteditable")==="true")return i}a=a.parentNode}}const r=document.activeElement;if(r){if(r.getAttribute("contenteditable")==="true")return r;const a=r.closest('[contenteditable="true"]');if(a)return a;const i=r.closest("[data-editora-editor]");if(i){const s=i.querySelector('[contenteditable="true"]');if(s)return s}}return document.querySelector('[contenteditable="true"]')};function T(){const e=h();if(!e)return[];const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:i=>!i.textContent?.trim()||i.parentNode&&ce(i.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let a=r.nextNode();for(;a;)t.push(...de(a)),a=r.nextNode();return t}function g(e){const t=h();t&&(e||(e=T()),L(()=>{t.querySelectorAll(".rte-misspelled").forEach(a=>{const i=a.parentNode;if(i){for(;a.firstChild;)i.insertBefore(a.firstChild,a);i.removeChild(a)}}),[...e].sort((a,i)=>i.startOffset-a.startOffset).forEach(a=>{if(q.has(a.word.toLowerCase()))return;const i=a.node.data.length;if(!(a.startOffset<0||a.endOffset>i||a.startOffset>=a.endOffset))try{const s=document.createRange();s.setStart(a.node,a.startOffset),s.setEnd(a.node,a.endOffset);const n=document.createElement("span");n.className="rte-misspelled",n.setAttribute("data-word",a.word),n.setAttribute("data-suggestions",a.suggestions.join(",")),n.setAttribute("title",`Suggestions: ${a.suggestions.join(", ")}`),n.style.borderBottom="2px wavy red",n.style.cursor="pointer",s.surroundContents(n)}catch{}})}),j(e))}function E(){const e=h();e&&L(()=>{e.querySelectorAll(".rte-misspelled").forEach(t=>{const r=t.parentNode;if(r){for(;t.firstChild;)r.insertBefore(t.firstChild,t);r.removeChild(t)}})})}function pe(e,t){L(()=>{const r=document.createRange();r.setStart(e.node,e.startOffset),r.setEnd(e.node,e.endOffset);const a=document.createTextNode(t);r.deleteContents(),r.insertNode(a)})}function U(e){q.add(e.toLowerCase()),E(),g()}function Y(e){z.add(e.toLowerCase()),se(),E(),g()}function ue(e){const t=h();if(!t)return{total:0,misspelled:0,accuracy:100};e||(e=T());const r=e.filter(n=>!q.has(n.word.toLowerCase())).length,s=((t.textContent||"").match(/[\p{L}\p{M}\p{N}]+/gu)||[]).length;return{total:s,misspelled:r,accuracy:s>0?(s-r)/s*100:100}}function me(e,t){const r=document.createTextNode(t);e.replaceWith(r)}function ge(e){e.classList.remove("rte-misspelled"),e.removeAttribute("data-word"),e.removeAttribute("data-suggestions"),e.removeAttribute("title"),e.style.borderBottom="",e.style.cursor=""}function he(e,t,r,a,i){W(i),document.querySelectorAll(".rte-spellcheck-menu").forEach(p=>p.remove());const s=document.createElement("div");if(s.className="rte-spellcheck-menu",a.slice(0,5).forEach(p=>{const w=document.createElement("div");w.className="rte-spellcheck-menu-item",w.textContent=p,w.onclick=()=>{me(i,p),window.setTimeout(()=>{m&&(g(),j())},0),s.remove()},s.appendChild(w)}),a.length>0){const p=document.createElement("div");p.style.cssText="height: 1px; background: #ddd; margin: 4px 0;",s.appendChild(p)}const n=document.createElement("div");n.className="rte-spellcheck-menu-item meta",n.textContent="Ignore Once",n.onclick=()=>{ge(i),s.remove()},s.appendChild(n);const c=document.createElement("div");c.className="rte-spellcheck-menu-item meta",c.textContent="Ignore All",c.onclick=()=>{U(r),s.remove()},s.appendChild(c);const k=document.createElement("div");k.className="rte-spellcheck-menu-item positive",k.textContent="Add to Dictionary",k.onclick=()=>{Y(r),s.remove()},s.appendChild(k),document.body.appendChild(s);const A=s.getBoundingClientRect(),Z=window.innerWidth-A.width-8,G=window.innerHeight-A.height-8;s.style.left=`${Math.max(8,Math.min(e,Z))}px`,s.style.top=`${Math.max(8,Math.min(t,G))}px`;const M=p=>{s.contains(p.target)||(s.remove(),document.removeEventListener("mousedown",M))};setTimeout(()=>document.addEventListener("mousedown",M),0)}function H(){x||(v=e=>{const t=e.target;if(t&&t.classList.contains("rte-misspelled")){e.preventDefault(),W(t);const r=t.getAttribute("data-word"),a=(t.getAttribute("data-suggestions")||"").split(",").filter(i=>i);he(e.clientX,e.clientY,r,a,t)}},document.addEventListener("contextmenu",v),x=!0)}function be(){!x||!v||(document.removeEventListener("contextmenu",v),v=null,x=!1)}function fe(e){return e.closest("[data-editora-editor]")||e.parentElement||e}function _(){const e=h();if(!e)throw new Error("Spell check panel requested without active editor");const t=fe(e);C();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 j(e){if(!o)return;const t=e||T(),r=ue(t);o.innerHTML=`
|
|
470
470
|
<div class="rte-spellcheck-header">
|
|
471
471
|
<div>
|
|
472
472
|
<h3 class="rte-spellcheck-title">Spell Check</h3>
|
|
@@ -509,4 +509,4 @@
|
|
|
509
509
|
</div>
|
|
510
510
|
`).join("")}
|
|
511
511
|
</div>
|
|
512
|
-
`,o.querySelector(".rte-spellcheck-close")?.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),N()}),o.querySelectorAll(".rte-spellcheck-word-header").forEach(i=>{i.addEventListener("click",()=>{const n=i.closest(".rte-spellcheck-item")?.querySelector(".rte-spellcheck-suggestions"),c=i.querySelector(".rte-spellcheck-caret");n&&c&&(n.classList.contains("show")?(n.classList.remove("show"),c.textContent="▶"):(n.classList.add("show"),c.textContent="▼"))})}),o.querySelectorAll(".suggestion-btn").forEach(i=>{i.addEventListener("click",()=>{const s=i.getAttribute("data-suggestion"),n=i.closest(".rte-spellcheck-item"),c=parseInt(n?.getAttribute("data-index")||"0",10);s!==null&&t[c]&&(pe(t[c],s),g())})}),o.querySelectorAll(".ignore-btn").forEach(i=>{i.addEventListener("click",()=>{const s=i.closest(".rte-spellcheck-item")?.getAttribute("data-word");s&&
|
|
512
|
+
`,o.querySelector(".rte-spellcheck-close")?.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),N()}),o.querySelectorAll(".rte-spellcheck-word-header").forEach(i=>{i.addEventListener("click",()=>{const n=i.closest(".rte-spellcheck-item")?.querySelector(".rte-spellcheck-suggestions"),c=i.querySelector(".rte-spellcheck-caret");n&&c&&(n.classList.contains("show")?(n.classList.remove("show"),c.textContent="▶"):(n.classList.add("show"),c.textContent="▼"))})}),o.querySelectorAll(".suggestion-btn").forEach(i=>{i.addEventListener("click",()=>{const s=i.getAttribute("data-suggestion"),n=i.closest(".rte-spellcheck-item"),c=parseInt(n?.getAttribute("data-index")||"0",10);s!==null&&t[c]&&(pe(t[c],s),g())})}),o.querySelectorAll(".ignore-btn").forEach(i=>{i.addEventListener("click",()=>{const s=i.closest(".rte-spellcheck-item")?.getAttribute("data-word");s&&U(s)})}),o.querySelectorAll(".add-btn").forEach(i=>{i.addEventListener("click",()=>{const s=i.closest(".rte-spellcheck-item")?.getAttribute("data-word");s&&Y(s)})})}function I(){const e=h();e&&(d&&d.disconnect(),d=new MutationObserver(t=>{f>0||t.some(r=>r.type==="characterData"||r.type==="childList")&&(b&&clearTimeout(b),b=window.setTimeout(()=>{m&&g()},350))}),d.observe(e,{...B}))}function V(){d&&(d.disconnect(),d=null),b&&(clearTimeout(b),b=null)}function X(){document.querySelectorAll(".rte-spellcheck-menu").forEach(e=>e.remove())}function R(){y||(y=e=>{e.key!=="Escape"||!m||(e.preventDefault(),e.stopPropagation(),N())},document.addEventListener("keydown",y,!0))}function ye(){y&&(document.removeEventListener("keydown",y,!0),y=null)}function N(){return m&&(E(),V(),be(),X(),o&&(o.remove(),o=null),l=null,u=null,m=!1,ye()),!1}function ve(){const e=te();return e?m&&l&&l!==e?(E(),V(),X(),o&&(o.remove(),o=null),l=e,C(),H(),R(),g(),I(),o=_(),j(),!0):m?N():(l=e,m=!0,C(),H(),R(),g(),I(),o&&(o.remove(),o=null),o=_(),j(),!0):!1}const ke=()=>({name:"spellCheck",init:()=>{re(),ee()},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 stroke-width="0"></g><g stroke-linecap="round" stroke-linejoin="round"></g><g> <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)=>(Q(t),ve(),!0)},keymap:{F7:"toggleSpellCheck"}});exports.SpellCheckPlugin=ke;
|
package/dist/spell-check.esm.js
CHANGED
|
@@ -10514,7 +10514,7 @@ function C() {
|
|
|
10514
10514
|
function h() {
|
|
10515
10515
|
if (l && document.contains(l))
|
|
10516
10516
|
return l;
|
|
10517
|
-
const e =
|
|
10517
|
+
const e = J();
|
|
10518
10518
|
return e && (l = e), e;
|
|
10519
10519
|
}
|
|
10520
10520
|
function W(e) {
|
|
@@ -10549,7 +10549,7 @@ function te() {
|
|
|
10549
10549
|
const t = u;
|
|
10550
10550
|
return u = null, l = t, t;
|
|
10551
10551
|
}
|
|
10552
|
-
return
|
|
10552
|
+
return J();
|
|
10553
10553
|
}
|
|
10554
10554
|
function ie() {
|
|
10555
10555
|
f += 1, f === 1 && d && d.disconnect();
|
|
@@ -10628,7 +10628,7 @@ function de(e) {
|
|
|
10628
10628
|
}
|
|
10629
10629
|
return t;
|
|
10630
10630
|
}
|
|
10631
|
-
const
|
|
10631
|
+
const J = () => {
|
|
10632
10632
|
const e = P();
|
|
10633
10633
|
if (e && document.contains(e))
|
|
10634
10634
|
return l = e, e;
|
|
@@ -10718,10 +10718,10 @@ function pe(e, t) {
|
|
|
10718
10718
|
r.deleteContents(), r.insertNode(a);
|
|
10719
10719
|
});
|
|
10720
10720
|
}
|
|
10721
|
-
function
|
|
10721
|
+
function U(e) {
|
|
10722
10722
|
q.add(e.toLowerCase()), E(), g();
|
|
10723
10723
|
}
|
|
10724
|
-
function
|
|
10724
|
+
function Y(e) {
|
|
10725
10725
|
z.add(e.toLowerCase()), se(), E(), g();
|
|
10726
10726
|
}
|
|
10727
10727
|
function ue(e) {
|
|
@@ -10762,14 +10762,14 @@ function he(e, t, r, a, i) {
|
|
|
10762
10762
|
}, s.appendChild(n);
|
|
10763
10763
|
const c = document.createElement("div");
|
|
10764
10764
|
c.className = "rte-spellcheck-menu-item meta", c.textContent = "Ignore All", c.onclick = () => {
|
|
10765
|
-
|
|
10765
|
+
U(r), s.remove();
|
|
10766
10766
|
}, s.appendChild(c);
|
|
10767
10767
|
const k = document.createElement("div");
|
|
10768
10768
|
k.className = "rte-spellcheck-menu-item positive", k.textContent = "Add to Dictionary", k.onclick = () => {
|
|
10769
|
-
|
|
10769
|
+
Y(r), s.remove();
|
|
10770
10770
|
}, s.appendChild(k), document.body.appendChild(s);
|
|
10771
|
-
const A = s.getBoundingClientRect(),
|
|
10772
|
-
s.style.left = `${Math.max(8, Math.min(e,
|
|
10771
|
+
const A = s.getBoundingClientRect(), Z = window.innerWidth - A.width - 8, G = window.innerHeight - A.height - 8;
|
|
10772
|
+
s.style.left = `${Math.max(8, Math.min(e, Z))}px`, s.style.top = `${Math.max(8, Math.min(t, G))}px`;
|
|
10773
10773
|
const M = (p) => {
|
|
10774
10774
|
s.contains(p.target) || (s.remove(), document.removeEventListener("mousedown", M));
|
|
10775
10775
|
};
|
|
@@ -10791,7 +10791,7 @@ function be() {
|
|
|
10791
10791
|
function fe(e) {
|
|
10792
10792
|
return e.closest("[data-editora-editor]") || e.parentElement || e;
|
|
10793
10793
|
}
|
|
10794
|
-
function
|
|
10794
|
+
function I() {
|
|
10795
10795
|
const e = h();
|
|
10796
10796
|
if (!e)
|
|
10797
10797
|
throw new Error("Spell check panel requested without active editor");
|
|
@@ -10861,16 +10861,16 @@ function j(e) {
|
|
|
10861
10861
|
}), o.querySelectorAll(".ignore-btn").forEach((i) => {
|
|
10862
10862
|
i.addEventListener("click", () => {
|
|
10863
10863
|
const s = i.closest(".rte-spellcheck-item")?.getAttribute("data-word");
|
|
10864
|
-
s &&
|
|
10864
|
+
s && U(s);
|
|
10865
10865
|
});
|
|
10866
10866
|
}), o.querySelectorAll(".add-btn").forEach((i) => {
|
|
10867
10867
|
i.addEventListener("click", () => {
|
|
10868
10868
|
const s = i.closest(".rte-spellcheck-item")?.getAttribute("data-word");
|
|
10869
|
-
s &&
|
|
10869
|
+
s && Y(s);
|
|
10870
10870
|
});
|
|
10871
10871
|
});
|
|
10872
10872
|
}
|
|
10873
|
-
function
|
|
10873
|
+
function _() {
|
|
10874
10874
|
const e = h();
|
|
10875
10875
|
e && (d && d.disconnect(), d = new MutationObserver((t) => {
|
|
10876
10876
|
f > 0 || t.some((r) => r.type === "characterData" || r.type === "childList") && (b && clearTimeout(b), b = window.setTimeout(() => {
|
|
@@ -10880,13 +10880,13 @@ function R() {
|
|
|
10880
10880
|
...B
|
|
10881
10881
|
}));
|
|
10882
10882
|
}
|
|
10883
|
-
function
|
|
10883
|
+
function V() {
|
|
10884
10884
|
d && (d.disconnect(), d = null), b && (clearTimeout(b), b = null);
|
|
10885
10885
|
}
|
|
10886
|
-
function
|
|
10886
|
+
function X() {
|
|
10887
10887
|
document.querySelectorAll(".rte-spellcheck-menu").forEach((e) => e.remove());
|
|
10888
10888
|
}
|
|
10889
|
-
function
|
|
10889
|
+
function R() {
|
|
10890
10890
|
y || (y = (e) => {
|
|
10891
10891
|
e.key !== "Escape" || !m || (e.preventDefault(), e.stopPropagation(), N());
|
|
10892
10892
|
}, document.addEventListener("keydown", y, !0));
|
|
@@ -10895,11 +10895,11 @@ function ye() {
|
|
|
10895
10895
|
y && (document.removeEventListener("keydown", y, !0), y = null);
|
|
10896
10896
|
}
|
|
10897
10897
|
function N() {
|
|
10898
|
-
return m && (E(),
|
|
10898
|
+
return m && (E(), V(), be(), X(), o && (o.remove(), o = null), l = null, u = null, m = !1, ye()), !1;
|
|
10899
10899
|
}
|
|
10900
10900
|
function ve() {
|
|
10901
10901
|
const e = te();
|
|
10902
|
-
return e ? m && l && l !== e ? (E(),
|
|
10902
|
+
return e ? m && l && l !== e ? (E(), V(), X(), o && (o.remove(), o = null), l = e, C(), H(), R(), g(), _(), o = I(), j(), !0) : m ? N() : (l = e, m = !0, C(), H(), R(), g(), _(), o && (o.remove(), o = null), o = I(), j(), !0) : !1;
|
|
10903
10903
|
}
|
|
10904
10904
|
const ke = () => ({
|
|
10905
10905
|
name: "spellCheck",
|
|
@@ -10910,7 +10910,7 @@ const ke = () => ({
|
|
|
10910
10910
|
{
|
|
10911
10911
|
label: "Spell Check",
|
|
10912
10912
|
command: "toggleSpellCheck",
|
|
10913
|
-
icon: '<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g
|
|
10913
|
+
icon: '<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g stroke-width="0"></g><g stroke-linecap="round" stroke-linejoin="round"></g><g> <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>',
|
|
10914
10914
|
shortcut: "F7"
|
|
10915
10915
|
}
|
|
10916
10916
|
],
|
package/dist/table.cjs.js
CHANGED
|
@@ -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 A=require("./editorContainerHelpers-CFbfiOJI.js");let u=null,h=null,V=null,B=null,N=null,D=null,q=null;const H='[data-theme="dark"], .dark, .editora-theme-dark';let k=!1,y=null,P=0,O=0,T=!1,_=0,W=0,X=0,K=0;const $=new Set(["DIV","P","BLOCKQUOTE","PRE","H1","H2","H3","H4","H5","H6","LI","TD","TH"]);function F(e,t){let n=e;for(;n&&n!==t;){if(n.nodeType===Node.ELEMENT_NODE&&$.has(n.tagName))return n;n=n.parentNode}return null}function j(e){const t=e.parentElement;if(t&&t.classList.contains("rte-table-wrapper"))return t;const n=document.createElement("div");return n.className="rte-table-wrapper",t?.insertBefore(n,e),n.appendChild(e),n}const ee=()=>{const e=A.findEditorContainerFromSelection(),t=A.getContentElement(e);if(!t)return alert("Please place your cursor in the editor before inserting a table"),!1;const n=window.getSelection();if(!n||n.rangeCount===0)return;const o=n.getRangeAt(0),l=document.createElement("table");l.className="rte-table";const r=document.createElement("thead"),a=document.createElement("tr");for(let m=0;m<3;m++){const g=document.createElement("th"),w=document.createElement("p");w.appendChild(document.createElement("br")),g.appendChild(w),a.appendChild(g)}r.appendChild(a);const i=document.createElement("tbody");for(let m=0;m<2;m++){const g=document.createElement("tr");for(let w=0;w<3;w++){const x=document.createElement("td"),L=document.createElement("p");L.appendChild(document.createElement("br")),x.appendChild(L),g.appendChild(x)}i.appendChild(g)}l.appendChild(r),l.appendChild(i);const b=j(l),d=(m,g,w)=>{if(m!==t)return m;const x=w?g-1:g;return t.childNodes[Math.min(Math.max(x,0),t.childNodes.length-1)]||null},s=d(o.endContainer,o.endOffset,!0),c=d(o.startContainer,o.startOffset,!1),C=s&&F(s,t)||c&&F(c,t);C&&C.parentNode?C.parentNode.insertBefore(b,C.nextSibling):(o.collapse(!1),o.insertNode(b));const S=l.querySelector("th p");if(S){const m=document.createRange();m.setStart(S,0),m.collapse(!0),n.removeAllRanges(),n.addRange(m)}t.focus()},te=()=>{const e=f();if(!e)return;const{table:t,rowIndex:n}=e,o=document.createElement("tr"),l=t.rows[0]?.cells.length||0;for(let a=0;a<l;a++){const i=document.createElement("td"),b=document.createElement("p");b.innerHTML="<br>",i.appendChild(b),o.appendChild(i)}const r=t.rows[n];r&&r.parentElement?r.parentElement.insertBefore(o,r):t.appendChild(o),p()},ne=()=>{const e=f();if(!e)return;const{table:t,rowIndex:n}=e,o=document.createElement("tr"),l=t.rows[0]?.cells.length||0;for(let r=0;r<l;r++){const a=document.createElement("td"),i=document.createElement("p");i.innerHTML="<br>",a.appendChild(i),o.appendChild(a)}if(n>=t.rows.length-1){const r=t.rows[t.rows.length-1];r&&r.parentElement?r.parentElement.appendChild(o):t.appendChild(o)}else{const r=t.rows[n+1];r.parentElement?.insertBefore(o,r)}p()},oe=()=>{const e=f();if(!e)return;const{table:t,colIndex:n}=e;for(let o=0;o<t.rows.length;o++){const l=t.rows[o],r=document.createElement("td"),a=document.createElement("p");a.innerHTML="<br>",r.appendChild(a),n===0?l.insertBefore(r,l.cells[0]):l.insertBefore(r,l.cells[n])}p()},re=()=>{const e=f();if(!e)return;const{table:t,colIndex:n}=e;for(let o=0;o<t.rows.length;o++){const l=t.rows[o],r=document.createElement("td"),a=document.createElement("p");a.innerHTML="<br>",r.appendChild(a),n>=l.cells.length-1?l.appendChild(r):l.insertBefore(r,l.cells[n+1])}p()},le=()=>{const e=f();if(!e||e.rowCount<=1)return;const{table:t,rowIndex:n,colIndex:o}=e;t.deleteRow(n),Q(t,n,o),p()},ae=()=>{const e=f();if(!e||e.cellCount<=1)return;const{table:t,rowIndex:n,colIndex:o}=e;for(let l=0;l<t.rows.length;l++){const r=t.rows[l];r.cells[o]&&r.deleteCell(o)}Q(t,n,o),p()},ie=()=>{const e=f();if(!e)return;const{table:t,rowIndex:n}=e,o=t.rows[n];if(!o)return;const l=o.parentElement?.tagName.toLowerCase()==="thead",r=t.querySelector("thead");if(l){const a=o.parentElement;if(o===a.rows[a.rows.length-1]){const i=t.querySelector("tbody")||t.appendChild(document.createElement("tbody"));i.insertBefore(o,i.firstChild),a.rows.length===0&&a.remove()}else U(o,"td")}else if(!r||o===t.tBodies[0]?.rows[0]){let a=r;a||(a=document.createElement("thead"),t.insertBefore(a,t.firstChild)),a.appendChild(o)}else U(o,"th");p()};function U(e,t){Array.from(e.cells).forEach(n=>{if(n.tagName.toLowerCase()===t)return;const o=document.createElement(t);o.innerHTML=n.innerHTML;for(let l=0;l<n.attributes.length;l++){const r=n.attributes[l];o.setAttribute(r.name,r.value)}n.parentNode?.replaceChild(o,n)})}const de=()=>{const e=f();if(!e)return;const{table:t,colIndex:n}=e;for(let o=0;o<t.rows.length;o++){const l=t.rows[o].cells[n];if(l){const r=l.tagName.toLowerCase()==="th"?"td":"th",a=document.createElement(r);a.innerHTML=l.innerHTML;for(let i=0;i<l.attributes.length;i++){const b=l.attributes[i];a.setAttribute(b.name,b.value)}l.parentNode?.replaceChild(a,l)}}p()},se=()=>{const e=f();if(!e)return;const t=e.table,n=t.parentElement;n&&n.classList.contains("rte-table-wrapper")?n.remove():t.remove(),document.dispatchEvent(new CustomEvent("tableDeleted"))};function v(e,t){if(!e||!(e instanceof Node))return null;const n=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;return n?n.closest(t):null}function Y(e){if(!e)return!1;const t=e.closest("[contenteditable]");return!t||t.getAttribute("contenteditable")==="false"?!1:!t.closest('[data-readonly="true"]')}function ce(){const e=window.getSelection(),t=e&&e.rangeCount>0?e.getRangeAt(0).startContainer:null;return v(t,".rte-content")||(h?h.closest(".rte-content"):null)}function ue(e,t,n){const o=window.execEditorCommand||window.executeEditorCommand;if(typeof o=="function")try{o("recordDomTransaction",e,t,n)}catch{}}function G(e){const t=ce();if(t&&!Y(t))return;const n=t?t.innerHTML:"";if(e(),!t)return;const o=t.innerHTML;o!==n&&(ue(t,n,o),t.dispatchEvent(new Event("input",{bubbles:!0})))}function Q(e,t,n){if(!e.isConnected||e.rows.length===0)return;const o=e.rows[Math.min(t,e.rows.length-1)],l=o.cells[Math.min(n,o.cells.length-1)];if(!l)return;const r=document.createRange(),a=l.querySelector("p, div, li")||l;r.selectNodeContents(a),r.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(r)}const he=()=>{const e=window.getSelection();if(!e||e.rangeCount===0)return;const n=e.getRangeAt(0).startContainer;if(!v(n,"table"))return;const o=v(n,"td, th");if(!o)return;const l=o.parentElement;if(!l)return;let r=-1;for(let d=0;d<l.cells.length;d++)if(l.cells[d]===o){r=d;break}if(r===-1||r===l.cells.length-1)return;const a=l.cells[r+1];if(!a)return;const i=(d,s)=>{const c=parseInt(d.getAttribute(s)||"1",10);return Number.isFinite(c)&&c>0?c:1};if(i(o,"rowspan")!==i(a,"rowspan"))return;o.setAttribute("colspan",String(i(o,"colspan")+i(a,"colspan"))),Array.from(a.childNodes).forEach(d=>{o.appendChild(d)}),a.remove(),p()};function f(){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const n=e.getRangeAt(0).startContainer,o=v(n,"table");if(!o)return null;let l=0,r=0;const a=v(n,"td, th");if(a){const i=a.parentElement;for(;i&&i!==o.rows[l]&&(l++,!(l>=o.rows.length)););const b=i;if(b){for(let d=0;d<b.cells.length;d++)if(b.cells[d]===a){r=d;break}}}return{table:o,rowIndex:l,colIndex:r,rowCount:o.rows.length,cellCount:o.rows[0]?.cells.length||0}}function p(){if(!u||!h)return;const e=f();if(!e)return;const t=e.rowCount>1,n=e.cellCount>1;Z(t,n)}function be(){V=()=>{const e=f();e&&Y(e.table)?me(e.table):z()},B=e=>{const t=v(e.target,"table"),n=v(e.target,".table-toolbar");!t&&!n&&z()},N=()=>{z()},D=()=>{h&&u&&u.style.display!=="none"&&M(h)},q=()=>{h&&u&&u.style.display!=="none"&&M(h)},document.addEventListener("selectionchange",V),document.addEventListener("mousedown",B),document.addEventListener("tableDeleted",N),window.addEventListener("scroll",D,!0),window.addEventListener("resize",q)}function M(e){if(!u)return;const t=e.getBoundingClientRect(),n=u.getBoundingClientRect(),o=n.height||40,l=n.width||280,r=10;let a=t.top-o-r,i=t.left+t.width/2-l/2;a<r&&(a=t.bottom+r),i<r&&(i=r);const b=window.innerWidth;i+l>b-r&&(i=b-l-r);const d=window.innerHeight;a+o>d-r&&(a=d-o-r),u.style.top=a+"px",u.style.left=i+"px"}function me(e){h=e,u||(u=pe(),document.body.appendChild(u));const t=!!e.closest(H)||document.body.matches(H)||document.documentElement.matches(H);u.classList.toggle("rte-theme-dark",t),u.style.display="flex",u.style.visibility="hidden",requestAnimationFrame(()=>{M(e),u&&(u.style.visibility="visible")});const n=f();n&&Z(n.rowCount>1,n.cellCount>1),ge(e)}const I=new Set;function J(){I.forEach(e=>{e.style.position==="relative"&&(e.style.removeProperty("position"),e.getAttribute("style")?.trim()||e.removeAttribute("style"))}),I.clear()}function z(){if(u&&(u.style.display="none"),h){h.querySelectorAll(".resize-handle").forEach(o=>o.remove());const t=h.parentElement,n=t?.classList.contains("rte-table-wrapper")?t.querySelector(".table-resize-handle"):h.querySelector(".table-resize-handle");n&&n.remove()}J(),h=null}function Z(e,t){if(!u)return;const n=u.querySelector('[data-action="deleteRow"]'),o=u.querySelector('[data-action="deleteColumn"]');n&&(n.disabled=!e),o&&(o.disabled=!t)}let R=!1;function fe(){if(R||typeof document>"u")return;if(document.getElementById("rte-table-toolbar-styles")){R=!0;return}R=!0;const e=document.createElement("style");e.id="rte-table-toolbar-styles",e.textContent=`
|
|
2
2
|
.table-toolbar {
|
|
3
3
|
background: white;
|
|
4
4
|
border: 1px solid #d0d0d0;
|
|
@@ -151,11 +151,11 @@
|
|
|
151
151
|
display: none;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
`,document.head.appendChild(e)}function
|
|
154
|
+
`,document.head.appendChild(e)}function pe(){fe();const e=document.createElement("div");e.className="table-toolbar",e.style.cssText=`
|
|
155
155
|
position: fixed;
|
|
156
156
|
z-index: 1000;
|
|
157
157
|
display: none;
|
|
158
|
-
`,e.setAttribute("role","toolbar"),e.setAttribute("aria-label","Table editing toolbar");const t=s=>{const
|
|
158
|
+
`,e.setAttribute("role","toolbar"),e.setAttribute("aria-label","Table editing toolbar");const t=s=>{const c=document.createElement("button");return c.className="toolbar-icon-btn",s.danger&&c.classList.add("toolbar-icon-btn-danger"),s.delete&&c.classList.add("toolbar-icon-btn-delete"),c.innerHTML=s.icon,c.title=s.title,c.setAttribute("aria-label",s.title),c.setAttribute("type","button"),c.setAttribute("data-action",s.action),c.onclick=()=>E(s.action),c},n=()=>{const s=document.createElement("div");return s.className="toolbar-divider",s},o=(...s)=>{const c=document.createElement("div");return c.className="toolbar-section",s.forEach(C=>c.appendChild(C)),c},l=o(t({icon:Ce(),title:"Add row above (Ctrl+Shift+R)",action:"addRowAbove"}),t({icon:ye(),title:"Add row below",action:"addRowBelow"}),t({icon:ke(),title:"Delete row",action:"deleteRow",danger:!0})),r=o(t({icon:Ee(),title:"Add column left",action:"addColumnLeft"}),t({icon:xe(),title:"Add column right (Ctrl+Shift+C)",action:"addColumnRight"}),t({icon:He(),title:"Delete column",action:"deleteColumn",danger:!0})),a=o(t({icon:Te(),title:"Toggle header row",action:"toggleHeaderRow"}),t({icon:ze(),title:"Toggle header column",action:"toggleHeaderColumn"})),i=o(t({icon:Me(),title:"Merge cells (horizontally)",action:"mergeCells"})),b=o(t({icon:Re(),title:"Delete table",action:"deleteTable",delete:!0}));e.appendChild(l),e.appendChild(n()),e.appendChild(r),e.appendChild(n()),e.appendChild(a),e.appendChild(n()),e.appendChild(i),e.appendChild(n()),e.appendChild(b);const d=s=>{!u||u.style.display==="none"||(s.ctrlKey||s.metaKey)&&s.shiftKey&&(s.key==="r"||s.key==="R"?(s.preventDefault(),E("addRowBelow")):(s.key==="c"||s.key==="C")&&(s.preventDefault(),E("addColumnRight")))};return window.addEventListener("keydown",d),e}function E(e){G(()=>{switch(e){case"addRowAbove":te();break;case"addRowBelow":ne();break;case"addColumnLeft":oe();break;case"addColumnRight":re();break;case"deleteRow":le();break;case"deleteColumn":ae();break;case"toggleHeaderRow":ie();break;case"toggleHeaderColumn":de();break;case"deleteTable":se();break;case"mergeCells":he();break}})}function ge(e){const t=j(e);e.querySelectorAll(".resize-handle").forEach(i=>i.remove());const o=t.querySelector(".table-resize-handle");o&&o.remove(),J();const l=e.querySelector("thead tr, tbody tr:first-child");if(!l)return;const r=l.querySelectorAll("td, th");r.forEach((i,b)=>{if(b===r.length-1)return;const d=document.createElement("div");d.className="resize-handle",d.style.cssText=`
|
|
159
159
|
position: absolute;
|
|
160
160
|
right: -4px;
|
|
161
161
|
top: 0;
|
|
@@ -165,24 +165,24 @@
|
|
|
165
165
|
cursor: col-resize;
|
|
166
166
|
z-index: 10;
|
|
167
167
|
transition: background 0.15s ease;
|
|
168
|
-
`,d.addEventListener("mouseenter",()=>{
|
|
168
|
+
`,d.addEventListener("mouseenter",()=>{k||(d.style.background="rgba(0, 102, 204, 0.3)")}),d.addEventListener("mouseleave",()=>{k||(d.style.background="transparent")}),d.addEventListener("mousedown",c=>{c.preventDefault(),c.stopPropagation(),we(c,b)});const s=i;s.style.position||(s.style.position="relative",I.add(s)),i.appendChild(d)});const a=document.createElement("div");a.className="table-resize-handle",a.addEventListener("mousedown",i=>{i.preventDefault(),i.stopPropagation(),ve(i)}),t.appendChild(a)}function we(e,t){if(k=!0,y=t,P=e.clientX,!h)return;const n=h.querySelector("thead tr, tbody tr:first-child");n&&n.cells[t]&&(O=n.cells[t].offsetWidth),document.body.style.cursor="col-resize",document.body.style.userSelect="none";const o=r=>{if(!k||y===null||!h)return;const a=r.clientX-P,i=Math.max(50,O+a);h.querySelectorAll("tr").forEach(d=>{d.cells[y]&&(d.cells[y].style.width=i+"px")})},l=()=>{k=!1,y=null,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",l)}function ve(e){if(!h)return;T=!0,_=e.clientX,W=e.clientY,X=h.offsetWidth,K=h.offsetHeight,document.body.style.cursor="nwse-resize",document.body.style.userSelect="none";const t=o=>{if(!T||!h)return;const l=o.clientX-_,r=o.clientY-W,a=Math.max(200,X+l),i=Math.max(100,K+r);h.style.width=a+"px",h.style.height=i+"px"},n=()=>{T=!1,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",t),document.addEventListener("mouseup",n)}function Ce(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
169
169
|
<path d="M2 7h12V5H2v2zm0 4h12V9H2v2zM8 1v3H5v2h3v3h2V6h3V4h-3V1H8z"/>
|
|
170
|
-
</svg>`}function
|
|
170
|
+
</svg>`}function ye(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
171
171
|
<path d="M2 3h12V1H2v2zm0 4h12V5H2v2zm6 4v3h3v-2h2v-2h-2v-3h-2v3H5v2h3z"/>
|
|
172
|
-
</svg>`}function Ce(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
173
|
-
<path d="M2 5h12v2H2V5zm0 4h12v2H2V9zm4-6v2H4v2h2v2h2V7h2V5H8V3H6z"/>
|
|
174
172
|
</svg>`}function ke(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
173
|
+
<path d="M2 5h12v2H2V5zm0 4h12v2H2V9zm4-6v2H4v2h2v2h2V7h2V5H8V3H6z"/>
|
|
174
|
+
</svg>`}function Ee(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
175
175
|
<path d="M7 2v12h2V2H7zm4 0v12h2V2h-2zM1 8h3v-3H1v3zm3 2H1v3h3v-3z"/>
|
|
176
|
-
</svg>`}function
|
|
176
|
+
</svg>`}function xe(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
177
177
|
<path d="M2 2v12h2V2H2zm4 0v12h2V2H6zM12 8h3v-3h-3v3zm0 2h3v3h-3v-3z"/>
|
|
178
|
-
</svg>`}function
|
|
178
|
+
</svg>`}function He(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
179
179
|
<path d="M5 2v12h2V2H5zm4 0v12h2V2H9zm3 2h3V1h-3v3zm3 2h-3v3h3V6zm0 4h-3v3h3v-3z"/>
|
|
180
|
-
</svg>`}function
|
|
180
|
+
</svg>`}function Te(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
181
181
|
<path d="M2 2h12v3H2V2zm0 5h12v8H2V7zm2 2v4h2V9H4zm4 0v4h2V9H8zm4 0v4h2V9h-2z"/>
|
|
182
|
-
</svg>`}function
|
|
182
|
+
</svg>`}function ze(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
183
183
|
<path d="M2 2v12h3V2H2zm5 0v12h8V2H7zm2 2h4v2H9V4zm0 4h4v2H9V8zm0 4h4v2H9v-2z"/>
|
|
184
|
-
</svg>`}function
|
|
184
|
+
</svg>`}function Re(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
185
185
|
<path d="M3 1h10v1H3V1zm1 2v11h8V3H4zM6 5h1v6H6V5zm3 0h1v6H9V5z"/>
|
|
186
|
-
</svg>`}function
|
|
186
|
+
</svg>`}function Me(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
187
187
|
<path d="M2 2h4v3H2V2zm5 0h4v3H7V2zm5 0h2v3h-2V2zm-10 4h4v3H2V6zm5 0h4v3H7V6zm5 0h2v3h-2V6zm-10 4h4v3H2v-3zm5 0h4v3H7v-3zm5 0h2v3h-2v-3z"/>
|
|
188
|
-
</svg>`}if(typeof window<"u"&&!window.__tablePluginInitialized){window.__tablePluginInitialized=!0;const e=()=>{
|
|
188
|
+
</svg>`}if(typeof window<"u"&&!window.__tablePluginInitialized){window.__tablePluginInitialized=!0;const e=()=>{be()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):setTimeout(e,100)}const Ie=()=>({name:"table",toolbar:[{label:"Insert Table",command:"insertTable",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><rect x="3" y="4" width="18" height="16" rx="2" fill="none" stroke="currentColor" stroke-width="1.8"/><path d="M3 10h18M3 15h18M9 4v16M15 4v16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>'}],commands:{insertTable:()=>(G(()=>{ee()}),!0)},keymap:{"Mod-Shift-r":()=>(E("addRowBelow"),!0),"Mod-Shift-c":()=>(E("addColumnRight"),!0)}});exports.TablePlugin=Ie;
|