@editora/plugins 1.0.2 → 1.0.4

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 (105) hide show
  1. package/README.md +30 -5
  2. package/dist/a11y-checker.cjs.js +109 -0
  3. package/dist/a11y-checker.esm.js +509 -0
  4. package/dist/anchor.cjs.js +176 -0
  5. package/dist/anchor.esm.js +400 -0
  6. package/dist/background-color.cjs.js +218 -0
  7. package/dist/background-color.esm.js +482 -0
  8. package/dist/blockquote.cjs.js +1 -0
  9. package/dist/blockquote.esm.js +47 -0
  10. package/dist/bold.cjs.js +1 -0
  11. package/dist/bold.esm.js +44 -0
  12. package/dist/capitalization.cjs.js +1 -0
  13. package/dist/capitalization.esm.js +78 -0
  14. package/dist/checklist.cjs.js +1 -0
  15. package/dist/checklist.esm.js +305 -0
  16. package/dist/clear-formatting.cjs.js +1 -0
  17. package/dist/clear-formatting.esm.js +138 -0
  18. package/dist/code-sample.cjs.js +161 -0
  19. package/dist/code-sample.esm.js +381 -0
  20. package/dist/code.cjs.js +598 -0
  21. package/dist/code.esm.js +2034 -0
  22. package/dist/colorSelectionApply-C0iOfMWb.js +1 -0
  23. package/dist/colorSelectionApply-D8r_gV32.mjs +63 -0
  24. package/dist/comments.cjs.js +354 -0
  25. package/dist/comments.esm.js +692 -0
  26. package/dist/direction.cjs.js +1 -0
  27. package/dist/direction.esm.js +129 -0
  28. package/dist/document-manager.cjs.js +1 -0
  29. package/dist/document-manager.esm.js +6 -0
  30. package/dist/{documentManager-CYC9totK.mjs → documentManager-DRUc1-Cs.mjs} +3 -3
  31. package/dist/{documentManager-BGlu3WRB.js → documentManager-_tQQfQi9.js} +3 -3
  32. package/dist/editorContainerHelpers-C7kdWnS0.mjs +26 -0
  33. package/dist/editorContainerHelpers-CFbfiOJI.js +1 -0
  34. package/dist/embed-iframe.cjs.js +361 -0
  35. package/dist/embed-iframe.esm.js +556 -0
  36. package/dist/emojis.cjs.js +284 -0
  37. package/dist/emojis.esm.js +1080 -0
  38. package/dist/font-family.cjs.js +1 -0
  39. package/dist/font-family.esm.js +152 -0
  40. package/dist/font-size.cjs.js +1 -0
  41. package/dist/font-size.esm.js +278 -0
  42. package/dist/footnote.cjs.js +85 -0
  43. package/dist/footnote.esm.js +397 -0
  44. package/dist/fullscreen.cjs.js +1 -0
  45. package/dist/fullscreen.esm.js +73 -0
  46. package/dist/heading.cjs.js +1 -0
  47. package/dist/heading.esm.js +63 -0
  48. package/dist/history.cjs.js +1 -0
  49. package/dist/history.esm.js +246 -0
  50. package/dist/indent.cjs.js +1 -0
  51. package/dist/indent.esm.js +146 -0
  52. package/dist/index-Bskk414V.mjs +145 -0
  53. package/dist/index-D3pJyAsj.js +1 -0
  54. package/dist/index.cjs.js +1 -1
  55. package/dist/{index.es-B-to-4j4.js → index.es-Cz1qItab.js} +1 -1
  56. package/dist/{index.es-BbXJ7tyO.mjs → index.es-DEcRmSTY.mjs} +1 -1
  57. package/dist/index.esm.js +89 -49
  58. package/dist/italic.cjs.js +1 -0
  59. package/dist/italic.esm.js +40 -0
  60. package/dist/line-height.cjs.js +1 -0
  61. package/dist/line-height.esm.js +145 -0
  62. package/dist/link.cjs.js +138 -0
  63. package/dist/link.esm.js +276 -0
  64. package/dist/list.cjs.js +1 -0
  65. package/dist/list.esm.js +102 -0
  66. package/dist/lite.cjs.js +1 -0
  67. package/dist/lite.esm.js +61 -0
  68. package/dist/math.cjs.js +45 -0
  69. package/dist/math.esm.js +249 -0
  70. package/dist/media-manager.cjs.js +619 -0
  71. package/dist/media-manager.esm.js +994 -0
  72. package/dist/merge-tag.cjs.js +93 -0
  73. package/dist/merge-tag.esm.js +412 -0
  74. package/dist/page-break.cjs.js +72 -0
  75. package/dist/page-break.esm.js +295 -0
  76. package/dist/plugins.css +1 -1
  77. package/dist/preview.cjs.js +230 -0
  78. package/dist/preview.esm.js +321 -0
  79. package/dist/print.cjs.js +254 -0
  80. package/dist/print.esm.js +309 -0
  81. package/dist/purify.es-DHhaBdbu.mjs +470 -0
  82. package/dist/purify.es-T2a3nLiC.js +3 -0
  83. package/dist/shared-config.cjs.js +1 -0
  84. package/dist/shared-config.esm.js +30 -0
  85. package/dist/special-characters.cjs.js +257 -0
  86. package/dist/special-characters.esm.js +772 -0
  87. package/dist/spell-check.cjs.js +512 -0
  88. package/dist/spell-check.esm.js +1013 -0
  89. package/dist/strikethrough.cjs.js +1 -0
  90. package/dist/strikethrough.esm.js +71 -0
  91. package/dist/table.cjs.js +35 -0
  92. package/dist/table.esm.js +477 -0
  93. package/dist/template.cjs.js +356 -0
  94. package/dist/template.esm.js +560 -0
  95. package/dist/text-alignment.cjs.js +1 -0
  96. package/dist/text-alignment.esm.js +105 -0
  97. package/dist/text-color.cjs.js +300 -0
  98. package/dist/text-color.esm.js +507 -0
  99. package/dist/underline.cjs.js +1 -0
  100. package/dist/underline.esm.js +34 -0
  101. package/index.d.ts +62 -0
  102. package/package.json +218 -6
  103. package/LICENSE +0 -21
  104. package/dist/index-BbORIHoM.mjs +0 -11763
  105. package/dist/index-C-OCBS_6.js +0 -3753
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,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=c();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 l(t),t.dispatchEvent(new Event("input",{bubbles:!0})),o!==!1}},keymap:{"Mod-Shift-x":"toggleStrikethrough","Mod-Shift-X":"toggleStrikethrough"}});function c(){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 l(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;
@@ -0,0 +1,71 @@
1
+ const l = () => ({
2
+ name: "strikethrough",
3
+ // Schema definition for strikethrough mark
4
+ marks: {
5
+ strikethrough: {
6
+ parseDOM: [
7
+ { tag: "s" },
8
+ { tag: "strike" },
9
+ { tag: "del" },
10
+ {
11
+ style: "text-decoration",
12
+ getAttrs: (t) => (typeof t == "string" ? t : t.style.textDecoration) === "line-through" && null
13
+ }
14
+ ],
15
+ toDOM: () => ["s", 0]
16
+ }
17
+ },
18
+ // Toolbar button configuration
19
+ toolbar: [
20
+ {
21
+ label: "Strikethrough",
22
+ command: "toggleStrikethrough",
23
+ 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>',
24
+ shortcut: "Mod-Shift-x"
25
+ }
26
+ ],
27
+ // Native command implementations
28
+ commands: {
29
+ /**
30
+ * Toggle strikethrough formatting on current selection
31
+ */
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
+ }
43
+ },
44
+ // Keyboard shortcuts
45
+ keymap: {
46
+ "Mod-Shift-x": "toggleStrikethrough",
47
+ "Mod-Shift-X": "toggleStrikethrough"
48
+ }
49
+ });
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) {
60
+ t.querySelectorAll("strike, del").forEach((e) => {
61
+ const o = document.createElement("s");
62
+ for (const r of Array.from(e.attributes))
63
+ r.name !== "style" && o.setAttribute(r.name, r.value);
64
+ for (; e.firstChild; )
65
+ o.appendChild(e.firstChild);
66
+ e.parentNode?.replaceChild(o, e);
67
+ });
68
+ }
69
+ export {
70
+ l as StrikethroughPlugin
71
+ };
@@ -0,0 +1,35 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("./editorContainerHelpers-CFbfiOJI.js");let h=null,m=null,x=null,I=null,M=null,S=null,V=null;const w='[data-theme="dark"], .dark, .editora-theme-dark';let g=!1,p=null,L=0,k=0,C=!1,A=0,B=0,D=0,N=0;const X=()=>{const e=R.findEditorContainerFromSelection(),t=R.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 r=n.getRangeAt(0),o=document.createElement("table");o.className="rte-table";const l=document.createElement("thead"),a=document.createElement("tr");for(let c=0;c<3;c++){const s=document.createElement("th"),u=document.createElement("p");u.appendChild(document.createElement("br")),s.appendChild(u),a.appendChild(s)}l.appendChild(a);const i=document.createElement("tbody");for(let c=0;c<2;c++){const s=document.createElement("tr");for(let u=0;u<3;u++){const v=document.createElement("td"),T=document.createElement("p");T.appendChild(document.createElement("br")),v.appendChild(T),s.appendChild(v)}i.appendChild(s)}o.appendChild(l),o.appendChild(i),r.deleteContents(),r.insertNode(o);const d=o.querySelector("th p");if(d){const c=document.createRange();c.setStart(d,0),c.collapse(!0),n.removeAllRanges(),n.addRange(c)}t.focus()},P=()=>{const e=f();if(!e)return;const{table:t,rowIndex:n}=e,r=document.createElement("tr"),o=t.rows[0]?.cells.length||0;for(let a=0;a<o;a++){const i=document.createElement("td"),d=document.createElement("p");d.innerHTML="<br>",i.appendChild(d),r.appendChild(i)}const l=t.rows[n];l&&l.parentElement?l.parentElement.insertBefore(r,l):t.appendChild(r),b()},H=()=>{const e=f();if(!e)return;const{table:t,rowIndex:n}=e,r=document.createElement("tr"),o=t.rows[0]?.cells.length||0;for(let l=0;l<o;l++){const a=document.createElement("td"),i=document.createElement("p");i.innerHTML="<br>",a.appendChild(i),r.appendChild(a)}n>=t.rows.length-1?t.appendChild(r):t.insertBefore(r,t.rows[n+1]),b()},_=()=>{const e=f();if(!e)return;const{table:t,colIndex:n}=e;for(let r=0;r<t.rows.length;r++){const o=t.rows[r],l=document.createElement("td"),a=document.createElement("p");a.innerHTML="<br>",l.appendChild(a),n===0?o.insertBefore(l,o.cells[0]):o.insertBefore(l,o.cells[n])}b()},z=()=>{const e=f();if(!e)return;const{table:t,colIndex:n}=e;for(let r=0;r<t.rows.length;r++){const o=t.rows[r],l=document.createElement("td"),a=document.createElement("p");a.innerHTML="<br>",l.appendChild(a),n>=o.cells.length-1?o.appendChild(l):o.insertBefore(l,o.cells[n+1])}b()},O=()=>{const e=f();if(!e||e.rowCount<=1)return;const{table:t,rowIndex:n}=e;t.deleteRow(n),b()},W=()=>{const e=f();if(!e||e.cellCount<=1)return;const{table:t,colIndex:n}=e;for(let r=0;r<t.rows.length;r++){const o=t.rows[r];o.cells[n]&&o.deleteCell(n)}b()},K=()=>{const e=f();if(!e)return;const{table:t,rowIndex:n}=e,r=t.rows[n];if(r.parentElement?.tagName.toLowerCase()==="thead"){const l=t.querySelector("tbody")||t.appendChild(document.createElement("tbody")),a=t.querySelector("thead");a&&(l.insertBefore(r,l.firstChild),a.rows.length===0&&a.remove())}else{let l=t.querySelector("thead");l||(l=document.createElement("thead"),t.insertBefore(l,t.firstChild)),l.appendChild(r)}b()},Y=()=>{const e=f();if(!e)return;const{table:t,colIndex:n}=e;for(let r=0;r<t.rows.length;r++){const o=t.rows[r].cells[n];if(o){const l=o.tagName.toLowerCase()==="th"?"td":"th",a=document.createElement(l);a.innerHTML=o.innerHTML;for(let i=0;i<o.attributes.length;i++){const d=o.attributes[i];a.setAttribute(d.name,d.value)}o.parentNode?.replaceChild(a,o)}}b()},F=()=>{const e=f();if(!e)return;e.table.remove(),document.dispatchEvent(new CustomEvent("tableDeleted"))},U=()=>{const e=window.getSelection();if(!e||e.rangeCount===0)return;const n=e.getRangeAt(0).startContainer;if(!(n.nodeType===Node.TEXT_NODE?n.parentElement?.closest("table"):n.closest("table")))return;let o=null;if(n.nodeType===Node.TEXT_NODE?o=n.parentElement?.closest("td, th"):n.nodeType===Node.ELEMENT_NODE&&(o=n.closest("td, th")),!o)return;const l=o.parentElement;if(!l)return;let a=-1;for(let u=0;u<l.cells.length;u++)if(l.cells[u]===o){a=u;break}if(a===-1||a===l.cells.length-1)return;const i=l.cells[a+1];if(!i)return;const d=parseInt(o.getAttribute("colspan")||"1"),c=parseInt(i.getAttribute("colspan")||"1");o.setAttribute("colspan",String(d+c)),Array.from(i.childNodes).forEach(u=>{o.appendChild(u)}),i.remove(),b()};function f(){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const n=e.getRangeAt(0).startContainer;let r=n.nodeType===Node.TEXT_NODE?n.parentElement?.closest("table"):n.closest("table");if(!r)return null;const o=r;let l=0,a=0;const i=n.nodeType===Node.TEXT_NODE?n.parentElement?.closest("td, th"):n.closest("td, th");if(i){let d=i.parentElement;for(;d&&d!==o.rows[l]&&(l++,!(l>=o.rows.length)););const c=d;if(c){for(let s=0;s<c.cells.length;s++)if(c.cells[s]===i){a=s;break}}}return{table:o,rowIndex:l,colIndex:a,rowCount:o.rows.length,cellCount:o.rows[0]?.cells.length||0}}function b(){if(!h||!m)return;const e=f();if(!e)return;const t=e.rowCount>1,n=e.cellCount>1;q(t,n)}function j(){x=()=>{const e=f();e?G(e.table):E()},I=e=>{const t=e.target,n=t.closest("table"),r=t.closest(".table-toolbar");!n&&!r&&E()},M=()=>{E()},S=()=>{m&&h&&h.style.display!=="none"&&y(m)},V=()=>{m&&h&&h.style.display!=="none"&&y(m)},document.addEventListener("selectionchange",x),document.addEventListener("mousedown",I),document.addEventListener("tableDeleted",M),window.addEventListener("scroll",S,!0),window.addEventListener("resize",V)}function y(e){if(!h)return;const t=e.getBoundingClientRect(),n=h.getBoundingClientRect(),r=n.height||40,o=n.width||280,l=10;let a=t.top-r-l,i=t.left+t.width/2-o/2;a<l&&(a=t.bottom+l),i<l&&(i=l);const d=window.innerWidth;i+o>d-l&&(i=d-o-l);const c=window.innerHeight;a+r>c-l&&(a=c-r-l),h.style.top=a+"px",h.style.left=i+"px"}function G(e){m=e,h||(h=J(),document.body.appendChild(h));const t=!!e.closest(w)||document.body.matches(w)||document.documentElement.matches(w);h.classList.toggle("rte-theme-dark",t),h.style.display="flex",h.style.visibility="hidden",requestAnimationFrame(()=>{y(e),h&&(h.style.visibility="visible")});const n=f();n&&q(n.rowCount>1,n.cellCount>1),Z(e)}function E(){if(h&&(h.style.display="none"),m){m.querySelectorAll(".resize-handle").forEach(n=>n.remove());const t=m.querySelector(".table-resize-handle");t&&t.remove()}m=null}function q(e,t){if(!h)return;const n=h.querySelector('[data-action="deleteRow"]'),r=h.querySelector('[data-action="deleteColumn"]');n&&(n.disabled=!e),r&&(r.disabled=!t)}function J(){const e=document.createElement("div");e.className="table-toolbar",e.style.cssText=`
2
+ position: fixed;
3
+ z-index: 1000;
4
+ display: none;
5
+ `,e.setAttribute("role","toolbar"),e.setAttribute("aria-label","Table editing toolbar");const t=s=>{const u=document.createElement("button");return u.className="toolbar-icon-btn",s.danger&&u.classList.add("toolbar-icon-btn-danger"),s.delete&&u.classList.add("toolbar-icon-btn-delete"),u.innerHTML=s.icon,u.title=s.title,u.setAttribute("aria-label",s.title),u.setAttribute("type","button"),u.setAttribute("data-action",s.action),u.onclick=()=>Q(s.action),u},n=()=>{const s=document.createElement("div");return s.className="toolbar-divider",s},r=(...s)=>{const u=document.createElement("div");return u.className="toolbar-section",s.forEach(v=>u.appendChild(v)),u},o=r(t({icon:te(),title:"Add row above (Ctrl+Shift+R)",action:"addRowAbove"}),t({icon:ne(),title:"Add row below",action:"addRowBelow"}),t({icon:oe(),title:"Delete row",action:"deleteRow",danger:!0})),l=r(t({icon:le(),title:"Add column left",action:"addColumnLeft"}),t({icon:re(),title:"Add column right (Ctrl+Shift+C)",action:"addColumnRight"}),t({icon:ae(),title:"Delete column",action:"deleteColumn",danger:!0})),a=r(t({icon:ie(),title:"Toggle header row",action:"toggleHeaderRow"}),t({icon:se(),title:"Toggle header column",action:"toggleHeaderColumn"})),i=r(t({icon:ce(),title:"Merge cells (horizontally)",action:"mergeCells"})),d=r(t({icon:de(),title:"Delete table",action:"deleteTable",delete:!0}));e.appendChild(o),e.appendChild(n()),e.appendChild(l),e.appendChild(n()),e.appendChild(a),e.appendChild(n()),e.appendChild(i),e.appendChild(n()),e.appendChild(d);const c=s=>{!h||h.style.display==="none"||(s.ctrlKey||s.metaKey)&&s.shiftKey&&(s.key==="r"||s.key==="R"?(s.preventDefault(),H()):(s.key==="c"||s.key==="C")&&(s.preventDefault(),z()))};return window.addEventListener("keydown",c),e}function Q(e){switch(e){case"addRowAbove":P();break;case"addRowBelow":H();break;case"addColumnLeft":_();break;case"addColumnRight":z();break;case"deleteRow":O();break;case"deleteColumn":W();break;case"toggleHeaderRow":K();break;case"toggleHeaderColumn":Y();break;case"deleteTable":F();break;case"mergeCells":U();break}}function Z(e){e.querySelectorAll(".resize-handle").forEach(a=>a.remove());const n=e.querySelector(".table-resize-handle");n&&n.remove();const r=e.querySelector("thead tr, tbody tr:first-child");if(!r)return;const o=r.querySelectorAll("td, th");o.forEach((a,i)=>{if(i===o.length-1)return;const d=document.createElement("div");d.className="resize-handle",d.style.cssText=`
6
+ position: absolute;
7
+ right: -4px;
8
+ top: 0;
9
+ bottom: 0;
10
+ width: 8px;
11
+ background: transparent;
12
+ cursor: col-resize;
13
+ z-index: 10;
14
+ transition: background 0.15s ease;
15
+ `,d.addEventListener("mouseenter",()=>{g||(d.style.background="rgba(0, 102, 204, 0.3)")}),d.addEventListener("mouseleave",()=>{g||(d.style.background="transparent")}),d.addEventListener("mousedown",c=>{c.preventDefault(),c.stopPropagation(),$(c,i)}),a.style.position="relative",a.appendChild(d)});const l=document.createElement("div");l.className="table-resize-handle",l.addEventListener("mousedown",a=>{a.preventDefault(),a.stopPropagation(),ee(a)}),e.appendChild(l)}function $(e,t){if(g=!0,p=t,L=e.clientX,!m)return;const n=m.querySelector("thead tr, tbody tr:first-child");n&&n.cells[t]&&(k=n.cells[t].offsetWidth),document.body.style.cursor="col-resize",document.body.style.userSelect="none";const r=l=>{if(!g||p===null||!m)return;const a=l.clientX-L,i=Math.max(50,k+a);m.querySelectorAll("tr").forEach(c=>{c.cells[p]&&(c.cells[p].style.width=i+"px")})},o=()=>{g=!1,p=null,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",o)}function ee(e){if(!m)return;C=!0,A=e.clientX,B=e.clientY,D=m.offsetWidth,N=m.offsetHeight,document.body.style.cursor="nwse-resize",document.body.style.userSelect="none";const t=r=>{if(!C||!m)return;const o=r.clientX-A,l=r.clientY-B,a=Math.max(200,D+o),i=Math.max(100,N+l);m.style.width=a+"px",m.style.height=i+"px"},n=()=>{C=!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 te(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
16
+ <path d="M2 7h12V5H2v2zm0 4h12V9H2v2zM8 1v3H5v2h3v3h2V6h3V4h-3V1H8z"/>
17
+ </svg>`}function ne(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
18
+ <path d="M2 3h12V1H2v2zm0 4h12V5H2v2zm6 4v3h3v-2h2v-2h-2v-3h-2v3H5v2h3z"/>
19
+ </svg>`}function oe(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
20
+ <path d="M2 5h12v2H2V5zm0 4h12v2H2V9zm4-6v2H4v2h2v2h2V7h2V5H8V3H6z"/>
21
+ </svg>`}function le(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
22
+ <path d="M7 2v12h2V2H7zm4 0v12h2V2h-2zM1 8h3v-3H1v3zm3 2H1v3h3v-3z"/>
23
+ </svg>`}function re(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
24
+ <path d="M2 2v12h2V2H2zm4 0v12h2V2H6zM12 8h3v-3h-3v3zm0 2h3v3h-3v-3z"/>
25
+ </svg>`}function ae(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
26
+ <path d="M5 2v12h2V2H5zm4 0v12h2V2H9zm3 2h3V1h-3v3zm3 2h-3v3h3V6zm0 4h-3v3h3v-3z"/>
27
+ </svg>`}function ie(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
28
+ <path d="M2 2h12v3H2V2zm0 5h12v8H2V7zm2 2v4h2V9H4zm4 0v4h2V9H8zm4 0v4h2V9h-2z"/>
29
+ </svg>`}function se(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
30
+ <path d="M2 2v12h3V2H2zm5 0v12h8V2H7zm2 2h4v2H9V4zm0 4h4v2H9V8zm0 4h4v2H9v-2z"/>
31
+ </svg>`}function de(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
32
+ <path d="M3 1h10v1H3V1zm1 2v11h8V3H4zM6 5h1v6H6V5zm3 0h1v6H9V5z"/>
33
+ </svg>`}function ce(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
34
+ <path d="M2 2h4v3H2V2zm5 0h4v3H7V2zm5 0h2v3h-2V2zm-10 4h4v3H2V6zm5 0h4v3H7V6zm5 0h2v3h-2V6zm-10 4h4v3H2v-3zm5 0h4v3H7v-3zm5 0h2v3h-2v-3z"/>
35
+ </svg>`}if(typeof window<"u"&&!window.__tablePluginInitialized){window.__tablePluginInitialized=!0;const e=()=>{j()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):setTimeout(e,100)}const ue=()=>({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:()=>(X(),!0)},keymap:{"Mod-Shift-r":()=>(H(),!0),"Mod-Shift-c":()=>(z(),!0)}});exports.TablePlugin=ue;
@@ -0,0 +1,477 @@
1
+ import { f as q, g as X } from "./editorContainerHelpers-C7kdWnS0.mjs";
2
+ let h = null, m = null, R = null, x = null, I = null, M = null, S = null;
3
+ const w = '[data-theme="dark"], .dark, .editora-theme-dark';
4
+ let g = !1, b = null, V = 0, L = 0, C = !1, k = 0, A = 0, B = 0, D = 0;
5
+ const _ = () => {
6
+ const e = q(), t = X(e);
7
+ if (!t)
8
+ return alert("Please place your cursor in the editor before inserting a table"), !1;
9
+ const n = window.getSelection();
10
+ if (!n || n.rangeCount === 0) return;
11
+ const r = n.getRangeAt(0), o = document.createElement("table");
12
+ o.className = "rte-table";
13
+ const l = document.createElement("thead"), a = document.createElement("tr");
14
+ for (let c = 0; c < 3; c++) {
15
+ const i = document.createElement("th"), u = document.createElement("p");
16
+ u.appendChild(document.createElement("br")), i.appendChild(u), a.appendChild(i);
17
+ }
18
+ l.appendChild(a);
19
+ const s = document.createElement("tbody");
20
+ for (let c = 0; c < 2; c++) {
21
+ const i = document.createElement("tr");
22
+ for (let u = 0; u < 3; u++) {
23
+ const v = document.createElement("td"), T = document.createElement("p");
24
+ T.appendChild(document.createElement("br")), v.appendChild(T), i.appendChild(v);
25
+ }
26
+ s.appendChild(i);
27
+ }
28
+ o.appendChild(l), o.appendChild(s), r.deleteContents(), r.insertNode(o);
29
+ const d = o.querySelector("th p");
30
+ if (d) {
31
+ const c = document.createRange();
32
+ c.setStart(d, 0), c.collapse(!0), n.removeAllRanges(), n.addRange(c);
33
+ }
34
+ t.focus();
35
+ }, P = () => {
36
+ const e = f();
37
+ if (!e) return;
38
+ const { table: t, rowIndex: n } = e, r = document.createElement("tr"), o = t.rows[0]?.cells.length || 0;
39
+ for (let a = 0; a < o; a++) {
40
+ const s = document.createElement("td"), d = document.createElement("p");
41
+ d.innerHTML = "<br>", s.appendChild(d), r.appendChild(s);
42
+ }
43
+ const l = t.rows[n];
44
+ l && l.parentElement ? l.parentElement.insertBefore(r, l) : t.appendChild(r), p();
45
+ }, H = () => {
46
+ const e = f();
47
+ if (!e) return;
48
+ const { table: t, rowIndex: n } = e, r = document.createElement("tr"), o = t.rows[0]?.cells.length || 0;
49
+ for (let l = 0; l < o; l++) {
50
+ const a = document.createElement("td"), s = document.createElement("p");
51
+ s.innerHTML = "<br>", a.appendChild(s), r.appendChild(a);
52
+ }
53
+ n >= t.rows.length - 1 ? t.appendChild(r) : t.insertBefore(r, t.rows[n + 1]), p();
54
+ }, W = () => {
55
+ const e = f();
56
+ if (!e) return;
57
+ const { table: t, colIndex: n } = e;
58
+ for (let r = 0; r < t.rows.length; r++) {
59
+ const o = t.rows[r], l = document.createElement("td"), a = document.createElement("p");
60
+ a.innerHTML = "<br>", l.appendChild(a), n === 0 ? o.insertBefore(l, o.cells[0]) : o.insertBefore(l, o.cells[n]);
61
+ }
62
+ p();
63
+ }, z = () => {
64
+ const e = f();
65
+ if (!e) return;
66
+ const { table: t, colIndex: n } = e;
67
+ for (let r = 0; r < t.rows.length; r++) {
68
+ const o = t.rows[r], l = document.createElement("td"), a = document.createElement("p");
69
+ a.innerHTML = "<br>", l.appendChild(a), n >= o.cells.length - 1 ? o.appendChild(l) : o.insertBefore(l, o.cells[n + 1]);
70
+ }
71
+ p();
72
+ }, O = () => {
73
+ const e = f();
74
+ if (!e || e.rowCount <= 1) return;
75
+ const { table: t, rowIndex: n } = e;
76
+ t.deleteRow(n), p();
77
+ }, K = () => {
78
+ const e = f();
79
+ if (!e || e.cellCount <= 1) return;
80
+ const { table: t, colIndex: n } = e;
81
+ for (let r = 0; r < t.rows.length; r++) {
82
+ const o = t.rows[r];
83
+ o.cells[n] && o.deleteCell(n);
84
+ }
85
+ p();
86
+ }, Y = () => {
87
+ const e = f();
88
+ if (!e) return;
89
+ const { table: t, rowIndex: n } = e, r = t.rows[n];
90
+ if (r.parentElement?.tagName.toLowerCase() === "thead") {
91
+ const l = t.querySelector("tbody") || t.appendChild(document.createElement("tbody")), a = t.querySelector("thead");
92
+ a && (l.insertBefore(r, l.firstChild), a.rows.length === 0 && a.remove());
93
+ } else {
94
+ let l = t.querySelector("thead");
95
+ l || (l = document.createElement("thead"), t.insertBefore(l, t.firstChild)), l.appendChild(r);
96
+ }
97
+ p();
98
+ }, F = () => {
99
+ const e = f();
100
+ if (!e) return;
101
+ const { table: t, colIndex: n } = e;
102
+ for (let r = 0; r < t.rows.length; r++) {
103
+ const o = t.rows[r].cells[n];
104
+ if (o) {
105
+ const l = o.tagName.toLowerCase() === "th" ? "td" : "th", a = document.createElement(l);
106
+ a.innerHTML = o.innerHTML;
107
+ for (let s = 0; s < o.attributes.length; s++) {
108
+ const d = o.attributes[s];
109
+ a.setAttribute(d.name, d.value);
110
+ }
111
+ o.parentNode?.replaceChild(a, o);
112
+ }
113
+ }
114
+ p();
115
+ }, U = () => {
116
+ const e = f();
117
+ if (!e) return;
118
+ e.table.remove(), document.dispatchEvent(new CustomEvent("tableDeleted"));
119
+ }, j = () => {
120
+ const e = window.getSelection();
121
+ if (!e || e.rangeCount === 0) return;
122
+ const n = e.getRangeAt(0).startContainer;
123
+ if (!(n.nodeType === Node.TEXT_NODE ? n.parentElement?.closest("table") : n.closest("table"))) return;
124
+ let o = null;
125
+ if (n.nodeType === Node.TEXT_NODE ? o = n.parentElement?.closest("td, th") : n.nodeType === Node.ELEMENT_NODE && (o = n.closest("td, th")), !o) return;
126
+ const l = o.parentElement;
127
+ if (!l) return;
128
+ let a = -1;
129
+ for (let u = 0; u < l.cells.length; u++)
130
+ if (l.cells[u] === o) {
131
+ a = u;
132
+ break;
133
+ }
134
+ if (a === -1 || a === l.cells.length - 1) return;
135
+ const s = l.cells[a + 1];
136
+ if (!s) return;
137
+ const d = parseInt(o.getAttribute("colspan") || "1"), c = parseInt(s.getAttribute("colspan") || "1");
138
+ o.setAttribute("colspan", String(d + c)), Array.from(s.childNodes).forEach((u) => {
139
+ o.appendChild(u);
140
+ }), s.remove(), p();
141
+ };
142
+ function f() {
143
+ const e = window.getSelection();
144
+ if (!e || e.rangeCount === 0) return null;
145
+ const n = e.getRangeAt(0).startContainer;
146
+ let r = n.nodeType === Node.TEXT_NODE ? n.parentElement?.closest("table") : n.closest("table");
147
+ if (!r) return null;
148
+ const o = r;
149
+ let l = 0, a = 0;
150
+ const s = n.nodeType === Node.TEXT_NODE ? n.parentElement?.closest("td, th") : n.closest("td, th");
151
+ if (s) {
152
+ let d = s.parentElement;
153
+ for (; d && d !== o.rows[l] && (l++, !(l >= o.rows.length)); )
154
+ ;
155
+ const c = d;
156
+ if (c) {
157
+ for (let i = 0; i < c.cells.length; i++)
158
+ if (c.cells[i] === s) {
159
+ a = i;
160
+ break;
161
+ }
162
+ }
163
+ }
164
+ return {
165
+ table: o,
166
+ rowIndex: l,
167
+ colIndex: a,
168
+ rowCount: o.rows.length,
169
+ cellCount: o.rows[0]?.cells.length || 0
170
+ };
171
+ }
172
+ function p() {
173
+ if (!h || !m) return;
174
+ const e = f();
175
+ if (!e) return;
176
+ const t = e.rowCount > 1, n = e.cellCount > 1;
177
+ N(t, n);
178
+ }
179
+ function G() {
180
+ R = () => {
181
+ const e = f();
182
+ e ? J(e.table) : E();
183
+ }, x = (e) => {
184
+ const t = e.target, n = t.closest("table"), r = t.closest(".table-toolbar");
185
+ !n && !r && E();
186
+ }, I = () => {
187
+ E();
188
+ }, M = () => {
189
+ m && h && h.style.display !== "none" && y(m);
190
+ }, S = () => {
191
+ m && h && h.style.display !== "none" && y(m);
192
+ }, document.addEventListener("selectionchange", R), document.addEventListener("mousedown", x), document.addEventListener("tableDeleted", I), window.addEventListener("scroll", M, !0), window.addEventListener("resize", S);
193
+ }
194
+ function y(e) {
195
+ if (!h) return;
196
+ const t = e.getBoundingClientRect(), n = h.getBoundingClientRect(), r = n.height || 40, o = n.width || 280, l = 10;
197
+ let a = t.top - r - l, s = t.left + t.width / 2 - o / 2;
198
+ a < l && (a = t.bottom + l), s < l && (s = l);
199
+ const d = window.innerWidth;
200
+ s + o > d - l && (s = d - o - l);
201
+ const c = window.innerHeight;
202
+ a + r > c - l && (a = c - r - l), h.style.top = a + "px", h.style.left = s + "px";
203
+ }
204
+ function J(e) {
205
+ m = e, h || (h = Q(), document.body.appendChild(h));
206
+ const t = !!e.closest(w) || document.body.matches(w) || document.documentElement.matches(w);
207
+ h.classList.toggle("rte-theme-dark", t), h.style.display = "flex", h.style.visibility = "hidden", requestAnimationFrame(() => {
208
+ y(e), h && (h.style.visibility = "visible");
209
+ });
210
+ const n = f();
211
+ n && N(n.rowCount > 1, n.cellCount > 1), $(e);
212
+ }
213
+ function E() {
214
+ if (h && (h.style.display = "none"), m) {
215
+ m.querySelectorAll(".resize-handle").forEach((n) => n.remove());
216
+ const t = m.querySelector(".table-resize-handle");
217
+ t && t.remove();
218
+ }
219
+ m = null;
220
+ }
221
+ function N(e, t) {
222
+ if (!h) return;
223
+ const n = h.querySelector('[data-action="deleteRow"]'), r = h.querySelector('[data-action="deleteColumn"]');
224
+ n && (n.disabled = !e), r && (r.disabled = !t);
225
+ }
226
+ function Q() {
227
+ const e = document.createElement("div");
228
+ e.className = "table-toolbar", e.style.cssText = `
229
+ position: fixed;
230
+ z-index: 1000;
231
+ display: none;
232
+ `, e.setAttribute("role", "toolbar"), e.setAttribute("aria-label", "Table editing toolbar");
233
+ const t = (i) => {
234
+ const u = document.createElement("button");
235
+ return u.className = "toolbar-icon-btn", i.danger && u.classList.add("toolbar-icon-btn-danger"), i.delete && u.classList.add("toolbar-icon-btn-delete"), u.innerHTML = i.icon, u.title = i.title, u.setAttribute("aria-label", i.title), u.setAttribute("type", "button"), u.setAttribute("data-action", i.action), u.onclick = () => Z(i.action), u;
236
+ }, n = () => {
237
+ const i = document.createElement("div");
238
+ return i.className = "toolbar-divider", i;
239
+ }, r = (...i) => {
240
+ const u = document.createElement("div");
241
+ return u.className = "toolbar-section", i.forEach((v) => u.appendChild(v)), u;
242
+ }, o = r(
243
+ t({
244
+ icon: ne(),
245
+ title: "Add row above (Ctrl+Shift+R)",
246
+ action: "addRowAbove"
247
+ }),
248
+ t({
249
+ icon: oe(),
250
+ title: "Add row below",
251
+ action: "addRowBelow"
252
+ }),
253
+ t({
254
+ icon: le(),
255
+ title: "Delete row",
256
+ action: "deleteRow",
257
+ danger: !0
258
+ })
259
+ ), l = r(
260
+ t({
261
+ icon: re(),
262
+ title: "Add column left",
263
+ action: "addColumnLeft"
264
+ }),
265
+ t({
266
+ icon: ae(),
267
+ title: "Add column right (Ctrl+Shift+C)",
268
+ action: "addColumnRight"
269
+ }),
270
+ t({
271
+ icon: se(),
272
+ title: "Delete column",
273
+ action: "deleteColumn",
274
+ danger: !0
275
+ })
276
+ ), a = r(
277
+ t({
278
+ icon: ie(),
279
+ title: "Toggle header row",
280
+ action: "toggleHeaderRow"
281
+ }),
282
+ t({
283
+ icon: de(),
284
+ title: "Toggle header column",
285
+ action: "toggleHeaderColumn"
286
+ })
287
+ ), s = r(
288
+ t({
289
+ icon: ue(),
290
+ title: "Merge cells (horizontally)",
291
+ action: "mergeCells"
292
+ })
293
+ ), d = r(
294
+ t({
295
+ icon: ce(),
296
+ title: "Delete table",
297
+ action: "deleteTable",
298
+ delete: !0
299
+ })
300
+ );
301
+ e.appendChild(o), e.appendChild(n()), e.appendChild(l), e.appendChild(n()), e.appendChild(a), e.appendChild(n()), e.appendChild(s), e.appendChild(n()), e.appendChild(d);
302
+ const c = (i) => {
303
+ !h || h.style.display === "none" || (i.ctrlKey || i.metaKey) && i.shiftKey && (i.key === "r" || i.key === "R" ? (i.preventDefault(), H()) : (i.key === "c" || i.key === "C") && (i.preventDefault(), z()));
304
+ };
305
+ return window.addEventListener("keydown", c), e;
306
+ }
307
+ function Z(e) {
308
+ switch (e) {
309
+ case "addRowAbove":
310
+ P();
311
+ break;
312
+ case "addRowBelow":
313
+ H();
314
+ break;
315
+ case "addColumnLeft":
316
+ W();
317
+ break;
318
+ case "addColumnRight":
319
+ z();
320
+ break;
321
+ case "deleteRow":
322
+ O();
323
+ break;
324
+ case "deleteColumn":
325
+ K();
326
+ break;
327
+ case "toggleHeaderRow":
328
+ Y();
329
+ break;
330
+ case "toggleHeaderColumn":
331
+ F();
332
+ break;
333
+ case "deleteTable":
334
+ U();
335
+ break;
336
+ case "mergeCells":
337
+ j();
338
+ break;
339
+ }
340
+ }
341
+ function $(e) {
342
+ e.querySelectorAll(".resize-handle").forEach((a) => a.remove());
343
+ const n = e.querySelector(".table-resize-handle");
344
+ n && n.remove();
345
+ const r = e.querySelector("thead tr, tbody tr:first-child");
346
+ if (!r) return;
347
+ const o = r.querySelectorAll("td, th");
348
+ o.forEach((a, s) => {
349
+ if (s === o.length - 1) return;
350
+ const d = document.createElement("div");
351
+ d.className = "resize-handle", d.style.cssText = `
352
+ position: absolute;
353
+ right: -4px;
354
+ top: 0;
355
+ bottom: 0;
356
+ width: 8px;
357
+ background: transparent;
358
+ cursor: col-resize;
359
+ z-index: 10;
360
+ transition: background 0.15s ease;
361
+ `, d.addEventListener("mouseenter", () => {
362
+ g || (d.style.background = "rgba(0, 102, 204, 0.3)");
363
+ }), d.addEventListener("mouseleave", () => {
364
+ g || (d.style.background = "transparent");
365
+ }), d.addEventListener("mousedown", (c) => {
366
+ c.preventDefault(), c.stopPropagation(), ee(c, s);
367
+ }), a.style.position = "relative", a.appendChild(d);
368
+ });
369
+ const l = document.createElement("div");
370
+ l.className = "table-resize-handle", l.addEventListener("mousedown", (a) => {
371
+ a.preventDefault(), a.stopPropagation(), te(a);
372
+ }), e.appendChild(l);
373
+ }
374
+ function ee(e, t) {
375
+ if (g = !0, b = t, V = e.clientX, !m) return;
376
+ const n = m.querySelector("thead tr, tbody tr:first-child");
377
+ n && n.cells[t] && (L = n.cells[t].offsetWidth), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
378
+ const r = (l) => {
379
+ if (!g || b === null || !m) return;
380
+ const a = l.clientX - V, s = Math.max(50, L + a);
381
+ m.querySelectorAll("tr").forEach((c) => {
382
+ c.cells[b] && (c.cells[b].style.width = s + "px");
383
+ });
384
+ }, o = () => {
385
+ g = !1, b = null, document.body.style.cursor = "", document.body.style.userSelect = "", document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o);
386
+ };
387
+ document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
388
+ }
389
+ function te(e) {
390
+ if (!m) return;
391
+ C = !0, k = e.clientX, A = e.clientY, B = m.offsetWidth, D = m.offsetHeight, document.body.style.cursor = "nwse-resize", document.body.style.userSelect = "none";
392
+ const t = (r) => {
393
+ if (!C || !m) return;
394
+ const o = r.clientX - k, l = r.clientY - A, a = Math.max(200, B + o), s = Math.max(100, D + l);
395
+ m.style.width = a + "px", m.style.height = s + "px";
396
+ }, n = () => {
397
+ C = !1, document.body.style.cursor = "", document.body.style.userSelect = "", document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
398
+ };
399
+ document.addEventListener("mousemove", t), document.addEventListener("mouseup", n);
400
+ }
401
+ function ne() {
402
+ return `<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
403
+ <path d="M2 7h12V5H2v2zm0 4h12V9H2v2zM8 1v3H5v2h3v3h2V6h3V4h-3V1H8z"/>
404
+ </svg>`;
405
+ }
406
+ function oe() {
407
+ return `<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
408
+ <path d="M2 3h12V1H2v2zm0 4h12V5H2v2zm6 4v3h3v-2h2v-2h-2v-3h-2v3H5v2h3z"/>
409
+ </svg>`;
410
+ }
411
+ function le() {
412
+ return `<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
413
+ <path d="M2 5h12v2H2V5zm0 4h12v2H2V9zm4-6v2H4v2h2v2h2V7h2V5H8V3H6z"/>
414
+ </svg>`;
415
+ }
416
+ function re() {
417
+ return `<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
418
+ <path d="M7 2v12h2V2H7zm4 0v12h2V2h-2zM1 8h3v-3H1v3zm3 2H1v3h3v-3z"/>
419
+ </svg>`;
420
+ }
421
+ function ae() {
422
+ return `<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
423
+ <path d="M2 2v12h2V2H2zm4 0v12h2V2H6zM12 8h3v-3h-3v3zm0 2h3v3h-3v-3z"/>
424
+ </svg>`;
425
+ }
426
+ function se() {
427
+ return `<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
428
+ <path d="M5 2v12h2V2H5zm4 0v12h2V2H9zm3 2h3V1h-3v3zm3 2h-3v3h3V6zm0 4h-3v3h3v-3z"/>
429
+ </svg>`;
430
+ }
431
+ function ie() {
432
+ return `<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
433
+ <path d="M2 2h12v3H2V2zm0 5h12v8H2V7zm2 2v4h2V9H4zm4 0v4h2V9H8zm4 0v4h2V9h-2z"/>
434
+ </svg>`;
435
+ }
436
+ function de() {
437
+ return `<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
438
+ <path d="M2 2v12h3V2H2zm5 0v12h8V2H7zm2 2h4v2H9V4zm0 4h4v2H9V8zm0 4h4v2H9v-2z"/>
439
+ </svg>`;
440
+ }
441
+ function ce() {
442
+ return `<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
443
+ <path d="M3 1h10v1H3V1zm1 2v11h8V3H4zM6 5h1v6H6V5zm3 0h1v6H9V5z"/>
444
+ </svg>`;
445
+ }
446
+ function ue() {
447
+ return `<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
448
+ <path d="M2 2h4v3H2V2zm5 0h4v3H7V2zm5 0h2v3h-2V2zm-10 4h4v3H2V6zm5 0h4v3H7V6zm5 0h2v3h-2V6zm-10 4h4v3H2v-3zm5 0h4v3H7v-3zm5 0h2v3h-2v-3z"/>
449
+ </svg>`;
450
+ }
451
+ if (typeof window < "u" && !window.__tablePluginInitialized) {
452
+ window.__tablePluginInitialized = !0;
453
+ const e = () => {
454
+ G();
455
+ };
456
+ document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", e) : setTimeout(e, 100);
457
+ }
458
+ const me = () => ({
459
+ name: "table",
460
+ toolbar: [
461
+ {
462
+ label: "Insert Table",
463
+ command: "insertTable",
464
+ 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>'
465
+ }
466
+ ],
467
+ commands: {
468
+ insertTable: () => (_(), !0)
469
+ },
470
+ keymap: {
471
+ "Mod-Shift-r": () => (H(), !0),
472
+ "Mod-Shift-c": () => (z(), !0)
473
+ }
474
+ });
475
+ export {
476
+ me as TablePlugin
477
+ };