@daneshnaik/rich-text-editor 1.0.0 → 1.0.1
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/rich-text-editor.js
CHANGED
|
@@ -1382,7 +1382,8 @@ const It = ({ isOpen: D, onClose: z, onInsert: Y, onRemove: re, isEditing: he =
|
|
|
1382
1382
|
className: "page-body",
|
|
1383
1383
|
contentEditable: !0,
|
|
1384
1384
|
onInput: Ze,
|
|
1385
|
-
suppressContentEditableWarning: !0
|
|
1385
|
+
suppressContentEditableWarning: !0,
|
|
1386
|
+
"data-placeholder": "Start typing your content here..."
|
|
1386
1387
|
}
|
|
1387
1388
|
)
|
|
1388
1389
|
] }) }),
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
<button type="button" data-action="add-row">Add row below</button>
|
|
15
15
|
<button type="button" data-action="add-col">Add column right</button>
|
|
16
16
|
<button type="button" data-action="delete-table">Delete table</button>
|
|
17
|
-
`,P.style.display="none",l.appendChild(P);const ae=(n,i,c)=>{n?(P.style.display="block",P.style.left=typeof i=="number"?i+"px":"8px",P.style.top=typeof c=="number"?c+"px":"36px"):P.style.display="none"};P.addEventListener("click",n=>{n.stopPropagation();const i=n.target.closest("button[data-action]");if(!i)return;const c=i.getAttribute("data-action");try{const s=M.current||t.rows[0].cells[0];if(!s)return;c==="select-row"&&Et(s,t),c==="select-column"&&At(s,t),c==="select-table"&&Ht(t),c==="merge-right"&&I(s,"right",t),c==="merge-left"&&I(s,"left",t),c==="merge-up"&&I(s,"up",t),c==="merge-down"&&I(s,"down",t),c==="split-vertical"&&We(s,"vertical",t),c==="split-horizontal"&&We(s,"horizontal",t),c==="add-row"&&He(t),c==="add-col"&&Ie(t),c==="delete-table"&&Be(t)}catch{}ae(!1)});const qe=d("Table Menu","⋮",()=>{ae(P.style.display!=="block")});qe.className+=" table-menu-btn",a.appendChild(qe),l.addEventListener("contextmenu",n=>{n.preventDefault(),F.current=null,M.current=n.target.closest("td,th")||M.current;const i=l.getBoundingClientRect();ae(!0,n.clientX-i.left,n.clientY-i.top)}),document.addEventListener("click",n=>{l.contains(n.target)||ae(!1)});let ce=!1,le=null;const Fe=n=>{if(!ce)return;const i=n.clientX-le.x,c=n.clientY-le.y;l.style.transform=`translate(${le.tx+i}px, ${le.ty+c}px)`},Ue=()=>{if(!ce)return;ce=!1,document.removeEventListener("mousemove",Fe),document.removeEventListener("mouseup",Ue);const n=l.style.transform.match(/translate\((-?\d+)px,\s*(-?\d+)px\)/);if(n){const i=parseInt(n[1],10),c=parseInt(n[2],10);l.style.left=l.offsetLeft+i+"px",l.style.top=l.offsetTop+c+"px",l.style.transform="",l.style.position="absolute"}};re.addEventListener("mousedown",n=>{n.preventDefault(),n.stopPropagation(),ce=!0,le={x:n.clientX,y:n.clientY,tx:0,ty:0},document.addEventListener("mousemove",Fe),document.addEventListener("mouseup",Ue)}),t.dataset.enhanced="1"},vt=(t,l,o,r)=>{const a=t.clientX,d=t.clientY,h=o.offsetWidth,C=o.offsetHeight,S=U=>{const A=U.clientX-a,J=U.clientY-d;if(r.includes("e")){const I=Math.max(200,h+A);o.style.width=I+"px"}else if(r.includes("w")){const I=Math.max(200,h-A);o.style.width=I+"px"}if(r.includes("s")){const I=Math.max(100,C+J);o.style.height=I+"px"}else if(r.includes("n")){const I=Math.max(100,C-J);o.style.height=I+"px"}},E=()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",E),document.body.style.cursor=""};document.addEventListener("mousemove",S),document.addEventListener("mouseup",E)},He=t=>{const l=M.current;let o=-1;l&&(o=l.parentElement.rowIndex);const r=t.rows[0]?t.rows[0].cells.length:t.tBodies[0]&&t.tBodies[0].rows[0]?t.tBodies[0].rows[0].cells.length:1,a=t.insertRow(o+1);for(let d=0;d<r;d++){const h=a.insertCell(-1);h.innerHTML=`Cell ${a.rowIndex}-${d+1}`}},Ie=t=>{const l=M.current;let o=-1;l&&(o=Array.prototype.indexOf.call(l.parentElement.children,l));for(let r=0;r<t.rows.length;r++){const a=t.rows[r],d=o+1,h=a.insertCell(d);h.innerHTML=""}},yt=t=>{if(t.rows.length<=1)return;const l=M.current;let o=l?l.parentElement.rowIndex:t.rows.length-1;t.deleteRow(o)},mt=t=>{const l=t.rows[0]?t.rows[0].cells.length:0;if(l<=1)return;const o=M.current;let r=o?Array.prototype.indexOf.call(o.parentElement.children,o):l-1;for(let a=0;a<t.rows.length;a++){const d=t.rows[a];d.cells[r]&&d.deleteCell(r)}},Be=t=>{const l=t.closest(".editable-table-wrap");l?l.remove():t.remove()},bt=()=>{try{const t=u.current;if(!t)return;t.querySelectorAll("table").forEach(o=>Ae(o))}catch{}},Ct=()=>{try{const t=u.current;if(!t)return;t.querySelectorAll("img:not(.editable-image-wrap img)").forEach(o=>{if(!o.closest(".editable-image-wrap")){const r=document.createElement("div");r.className="editable-image-wrap",r.contentEditable="false",o.parentNode.insertBefore(r,o),r.appendChild(o),Me(r)}})}catch{}},xt=()=>{oe(!G)},wt=()=>{const t=u.current?.innerHTML||"",l=new Blob([t],{type:"text/html"}),o=URL.createObjectURL(l),r=document.createElement("a");r.href=o,r.download="document.html",r.click(),URL.revokeObjectURL(o)};v.useEffect(()=>{const t=()=>{const l=u.current?.innerText||"",o=new Blob([l],{type:"text/plain"}),r=URL.createObjectURL(o),a=document.createElement("a");a.href=r,a.download="document.txt",a.click(),URL.revokeObjectURL(r)};try{window._exportAsText=t}catch{}return()=>{try{delete window._exportAsText}catch{}}},[]),v.useEffect(()=>{const t=l=>{try{const o=l.target.closest(".editable-table-wrap"),r=l.target.closest(".editable-image-wrap");!o&&u.current&&u.current.querySelectorAll(".editable-table-wrap.selected").forEach(d=>d.classList.remove("selected")),!r&&u.current&&u.current.querySelectorAll(".editable-image-wrap.selected").forEach(d=>d.classList.remove("selected"))}catch{}};return document.addEventListener("click",t),()=>document.removeEventListener("click",t)},[]);const kt=t=>{const l=t.target.files?.[0];if(l){const o=new FileReader;o.onload=r=>{const a=r.target?.result;u.current&&(u.current.innerHTML=a,j(a),setTimeout(()=>{bt(),Ct()},50))},o.readAsText(l)}},Nt=()=>{V(!0)},St=()=>{const t=u.current?.innerHTML||"";navigator.clipboard.writeText(t).then(()=>{alert("HTML copied to clipboard!")})},Lt=()=>{confirm("Are you sure you want to clear all content?")&&u.current&&(y("selectAll"),y("delete"),j(""))},Tt=()=>{const t=prompt("Enter your code:");if(t){const l=`<pre><code>${t}</code></pre>`;y("insertHTML",l)}},Mt=()=>{y("formatBlock","blockquote")};return e.jsxs("div",{className:`editor-container ${G?"fullscreen":""}`,children:[e.jsx("input",{type:"file",ref:Le,onChange:kt,accept:".html,.txt",style:{display:"none"}}),e.jsx("div",{className:"editor-content",children:e.jsxs("div",{className:`page-card size-${we}`,children:[e.jsxs("div",{className:"editor-toolbar",children:[e.jsxs("div",{className:"toolbar-group",children:[e.jsx("button",{className:"toolbar-btn",onClick:()=>y("undo"),title:"Undo",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M3 7v6h6"}),e.jsx("path",{d:"M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:()=>y("redo"),title:"Redo",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M21 7v6h-6"}),e.jsx("path",{d:"M3 17a9 9 0 019-9 9 9 0 016 2.3l3 2.7"})]})})]}),e.jsx("div",{className:"toolbar-divider"}),e.jsxs("div",{className:"toolbar-group",children:[e.jsxs("select",{className:"toolbar-select",onChange:at,value:Ge,children:[e.jsx("option",{value:"Arial",children:"Arial"}),e.jsx("option",{value:"Helvetica",children:"Helvetica"}),e.jsx("option",{value:"Segoe UI",children:"Segoe UI"}),e.jsx("option",{value:"Roboto",children:"Roboto"}),e.jsx("option",{value:"Open Sans",children:"Open Sans"}),e.jsx("option",{value:"Lato",children:"Lato"}),e.jsx("option",{value:"Montserrat",children:"Montserrat"}),e.jsx("option",{value:"Source Sans Pro",children:"Source Sans Pro"}),e.jsx("option",{value:"Tahoma",children:"Tahoma"}),e.jsx("option",{value:"Verdana",children:"Verdana"}),e.jsx("option",{value:"Trebuchet MS",children:"Trebuchet MS"}),e.jsx("option",{value:"Georgia",children:"Georgia"}),e.jsx("option",{value:"Times New Roman",children:"Times New Roman"}),e.jsx("option",{value:"Palatino Linotype",children:"Palatino Linotype"}),e.jsx("option",{value:"Garamond",children:"Garamond"}),e.jsx("option",{value:"Courier New",children:"Courier New"}),e.jsx("option",{value:"Brush Script MT",children:"Brush Script MT"}),e.jsx("option",{value:"Impact",children:"Impact"}),e.jsx("option",{value:"Comic Sans MS",children:"Comic Sans MS"}),e.jsx("option",{value:"Candara",children:"Candara"}),e.jsx("option",{value:"Cambria",children:"Cambria"}),e.jsx("option",{value:"Calibri",children:"Calibri"}),e.jsx("option",{value:"Merriweather",children:"Merriweather"}),e.jsx("option",{value:"Noto Sans",children:"Noto Sans"}),e.jsx("option",{value:"Palatino",children:"Palatino"}),e.jsx("option",{value:"Bookman",children:"Bookman"}),e.jsx("option",{value:"Lucida Sans",children:"Lucida Sans"}),e.jsx("option",{value:"Righteous",children:"Righteous"}),e.jsx("option",{value:"Poppins",children:"Poppins"})]}),e.jsxs("select",{className:"toolbar-select",onChange:rt,value:Ke,children:[e.jsx("option",{value:"1",children:"Small"}),e.jsx("option",{value:"3",children:"Normal"}),e.jsx("option",{value:"5",children:"Large"}),e.jsx("option",{value:"7",children:"Huge"})]}),e.jsxs("select",{className:"toolbar-select",onChange:t=>{ht(t.target.value),fe(t.target.value)},value:Qe,children:[e.jsx("option",{value:"p",children:"Paragraph"}),e.jsx("option",{value:"h1",children:"Heading 1"}),e.jsx("option",{value:"h2",children:"Heading 2"}),e.jsx("option",{value:"h3",children:"Heading 3"}),e.jsx("option",{value:"h4",children:"Heading 4"})]})]}),e.jsx("div",{className:"toolbar-divider"}),e.jsxs("div",{className:"toolbar-group",children:[e.jsx("button",{className:`toolbar-btn ${O.bold?"active":""}`,onClick:()=>y("bold"),title:"Bold",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("path",{d:"M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"}),e.jsx("path",{d:"M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"})]})}),e.jsx("button",{className:`toolbar-btn ${O.italic?"active":""}`,onClick:()=>y("italic"),title:"Italic",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"19",y1:"4",x2:"10",y2:"4"}),e.jsx("line",{x1:"14",y1:"20",x2:"5",y2:"20"}),e.jsx("line",{x1:"15",y1:"4",x2:"9",y2:"20"})]})}),e.jsx("button",{className:`toolbar-btn ${O.underline?"active":""}`,onClick:()=>y("underline"),title:"Underline",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3"}),e.jsx("line",{x1:"4",y1:"21",x2:"20",y2:"21"})]})}),e.jsx("button",{className:`toolbar-btn ${O.strikeThrough?"active":""}`,onClick:()=>y("strikeThrough"),title:"Strikethrough",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M16 4H9a3 3 0 0 0-2.83 4"}),e.jsx("path",{d:"M14 12a4 4 0 0 1 0 8H6"}),e.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12"})]})})]}),e.jsx("div",{className:"toolbar-divider"}),e.jsxs("div",{className:"toolbar-group",children:[e.jsxs("div",{className:"color-picker-wrapper","data-tooltip":"Text color","aria-label":"Text color picker",children:[e.jsx("input",{type:"color",onChange:ot,className:"color-picker",title:"Text Color",defaultValue:"#111827","aria-label":"Text color"}),e.jsx("span",{className:"color-label",children:"A"}),e.jsx("span",{className:"color-caption",children:"Text color"})]}),e.jsxs("div",{className:"color-picker-wrapper","data-tooltip":"Highlight / background color","aria-label":"Background color picker",children:[e.jsx("input",{type:"color",onChange:nt,className:"color-picker",title:"Background Color",defaultValue:"#ffffff","aria-label":"Background color"}),e.jsx("span",{className:"color-label",children:"◼"}),e.jsx("span",{className:"color-caption",children:"Highlight"})]})]}),e.jsx("div",{className:"toolbar-divider"}),e.jsx("div",{className:"toolbar-group",children:e.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[e.jsx("button",{className:"toolbar-btn",onClick:()=>D(t=>!t),title:"More formatting",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"5",cy:"6",r:"1.2"}),e.jsx("circle",{cx:"5",cy:"12",r:"1.2"}),e.jsx("circle",{cx:"5",cy:"18",r:"1.2"}),e.jsx("line",{x1:"10",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"10",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"10",y1:"18",x2:"21",y2:"18"})]})}),Oe&&e.jsxs("div",{className:"toolbar-dropdown-panel",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"toolbar-dropdown-row",children:[e.jsx("button",{className:`toolbar-btn ${O.justifyLeft?"active":""}`,onClick:()=>{y("justifyLeft"),D(!1)},title:"Align Left",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"17",y1:"10",x2:"3",y2:"10"}),e.jsx("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),e.jsx("line",{x1:"21",y1:"14",x2:"3",y2:"14"})]})}),e.jsx("button",{className:`toolbar-btn ${O.justifyCenter?"active":""}`,onClick:()=>{y("justifyCenter"),D(!1)},title:"Align Center",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"10",x2:"6",y2:"10"}),e.jsx("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),e.jsx("line",{x1:"21",y1:"14",x2:"3",y2:"14"})]})}),e.jsx("button",{className:`toolbar-btn ${O.justifyRight?"active":""}`,onClick:()=>{y("justifyRight"),D(!1)},title:"Align Right",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"21",y1:"10",x2:"7",y2:"10"}),e.jsx("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),e.jsx("line",{x1:"21",y1:"14",x2:"3",y2:"14"})]})})]}),e.jsx("div",{className:"toolbar-dropdown-sep"}),e.jsxs("div",{className:"toolbar-dropdown-row",children:[e.jsx("button",{className:`toolbar-btn ${O.insertUnorderedList?"active":""}`,onClick:()=>{y("insertUnorderedList"),D(!1)},title:"Bullet List",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),e.jsx("circle",{cx:"4",cy:"6",r:"1",fill:"currentColor"})]})}),e.jsx("button",{className:`toolbar-btn ${O.insertOrderedList?"active":""}`,onClick:()=>{y("insertOrderedList"),D(!1)},title:"Numbered List",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"10",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"10",y1:"12",x2:"21",y2:"12"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:()=>{y("indent"),D(!1)},title:"Indent",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("line",{x1:"21",y1:"4",x2:"9",y2:"4"})})}),e.jsx("button",{className:"toolbar-btn",onClick:()=>{y("outdent"),D(!1)},title:"Outdent",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("line",{x1:"21",y1:"4",x2:"9",y2:"4"})})})]})]})]})}),e.jsx("div",{className:"toolbar-divider"}),e.jsxs("div",{className:"toolbar-group",children:[e.jsx("button",{className:"toolbar-btn",onClick:et,title:"Insert Link",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),e.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:ct,title:"Insert Image",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.jsx("polyline",{points:"21 15 16 10 5 21"})]})}),e.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[e.jsx("button",{className:"toolbar-btn",onClick:()=>Q(!R),title:"Insert Table",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),e.jsx("line",{x1:"3",y1:"15",x2:"21",y2:"15"}),e.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"}),e.jsx("line",{x1:"15",y1:"3",x2:"15",y2:"21"})]})}),R&&e.jsxs("div",{className:"table-size-picker show",children:[e.jsx("div",{className:"table-size-grid",style:{gridTemplateColumns:"repeat(10, 18px)"},children:Array.from({length:10},(t,l)=>Array.from({length:10},(o,r)=>e.jsx("div",{className:`table-cell-preview ${l<N.rows&&r<N.cols?"hover":""}`,onMouseEnter:()=>pt(l,r),onClick:()=>ft(l,r)},`${l}-${r}`))).flat()}),e.jsxs("div",{className:"table-size-label",children:[N.rows," × ",N.cols]})]})]}),e.jsx("button",{className:"toolbar-btn",onClick:()=>he(!0),title:"Find and Replace",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("path",{d:"m21 21-4.35-4.35"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:()=>y("insertHorizontalRule"),title:"Horizontal Rule",children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"})})}),e.jsx("button",{className:"toolbar-btn",onClick:Mt,title:"Insert Quote",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z"}),e.jsx("path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:Tt,title:"Code Block",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("polyline",{points:"16 18 22 12 16 6"}),e.jsx("polyline",{points:"8 6 2 12 8 18"})]})})]}),e.jsx("div",{className:"toolbar-divider"}),e.jsxs("div",{className:"toolbar-group",children:[e.jsxs("select",{className:"toolbar-select",value:we,onChange:t=>_e(t.target.value),title:"Page size","aria-label":"Page size",children:[e.jsx("option",{value:"a0",children:"A0"}),e.jsx("option",{value:"a1",children:"A1"}),e.jsx("option",{value:"a2",children:"A2"}),e.jsx("option",{value:"a3",children:"A3"}),e.jsx("option",{value:"a4",children:"A4"}),e.jsx("option",{value:"a5",children:"A5"}),e.jsx("option",{value:"a6",children:"A6"}),e.jsx("option",{value:"b0",children:"B0"}),e.jsx("option",{value:"b1",children:"B1"}),e.jsx("option",{value:"b2",children:"B2"}),e.jsx("option",{value:"b3",children:"B3"}),e.jsx("option",{value:"b4",children:"B4"}),e.jsx("option",{value:"b5",children:"B5"}),e.jsx("option",{value:"letter",children:"Letter"}),e.jsx("option",{value:"legal",children:"Legal"}),e.jsx("option",{value:"ledger",children:"Ledger"}),e.jsx("option",{value:"tabloid",children:"Tabloid"}),e.jsx("option",{value:"executive",children:"Executive"}),e.jsx("option",{value:"statement",children:"Statement"}),e.jsx("option",{value:"folio",children:"Folio"}),e.jsx("option",{value:"c4",children:"C4"}),e.jsx("option",{value:"c5",children:"C5"}),e.jsx("option",{value:"monarch",children:"Monarch"}),e.jsx("option",{value:"dl-envelope",children:"Envelope DL"}),e.jsx("option",{value:"c6-envelope",children:"Envelope C6"}),e.jsx("option",{value:"custom",children:"Custom"})]}),e.jsx("button",{className:"toolbar-btn",onClick:()=>Le.current?.click(),title:"Import",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"7 10 12 15 17 10"}),e.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:wt,title:"Export HTML",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"17 8 12 3 7 8"}),e.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:Nt,title:"View HTML",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("polyline",{points:"16 18 22 12 16 6"}),e.jsx("polyline",{points:"8 6 2 12 8 18"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:Lt,title:"Clear All",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:xt,title:G?"Exit Fullscreen":"Fullscreen",children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:G?e.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}):e.jsx("path",{d:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"})})})]}),e.jsx("div",{className:"toolbar-divider"}),e.jsx("div",{className:"toolbar-group",children:e.jsx("button",{className:"toolbar-btn",onClick:()=>y("removeFormat"),title:"Clear Formatting",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M4 7h16M9 20h6M12 4v16"}),e.jsx("line",{x1:"3",y1:"3",x2:"21",y2:"21",strokeWidth:"1.5"})]})})})]}),e.jsx("div",{ref:u,className:"page-body",contentEditable:!0,onInput:Re,suppressContentEditableWarning:!0})]})}),e.jsxs("div",{className:"status-bar-bottom",children:[e.jsxs("span",{className:"status-item",children:["Characters: ",X.replace(/<[^>]*>/g,"").length]}),e.jsx("span",{className:"status-item",children:"•"}),e.jsxs("span",{className:"status-item",children:["Words: ",X.replace(/<[^>]*>/g,"").trim().split(/\s+/).filter(t=>t).length]})]}),Xe&&e.jsx("div",{className:"modal-overlay",onClick:()=>ne(!1),children:e.jsxs("div",{className:"modal-content",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:"Insert Table"}),e.jsx("button",{className:"modal-close",onClick:()=>ne(!1),children:"×"})]}),e.jsxs("div",{className:"modal-body",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Rows:"}),e.jsx("input",{type:"number",min:"1",max:"20",value:me,onChange:t=>be(parseInt(t.target.value)||1),className:"form-input"})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Columns:"}),e.jsx("input",{type:"number",min:"1",max:"10",value:Ce,onChange:t=>xe(parseInt(t.target.value)||1),className:"form-input"})]})]}),e.jsxs("div",{className:"modal-footer",children:[e.jsx("button",{className:"btn-secondary",onClick:()=>ne(!1),children:"Cancel"}),e.jsx("button",{className:"btn-primary",onClick:Ee,children:"Insert Table"})]})]})}),ie&&e.jsx("div",{className:"modal-overlay",onClick:()=>V(!1),children:e.jsxs("div",{className:"modal-content modal-large",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:"HTML Source Code"}),e.jsx("button",{className:"modal-close",onClick:()=>V(!1),children:"×"})]}),e.jsx("div",{className:"modal-body",children:e.jsx("pre",{className:"html-preview",children:X||""})}),e.jsxs("div",{className:"modal-footer",children:[e.jsx("button",{className:"btn-secondary",onClick:()=>V(!1),children:"Close"}),e.jsx("button",{className:"btn-primary",onClick:St,children:"Copy HTML"})]})]})}),je&&e.jsx("div",{className:"link-modal-overlay",onClick:()=>he(!1),children:e.jsxs("div",{className:"find-replace-modal",onClick:t=>t.stopPropagation(),children:[e.jsx("h3",{children:"Find and Replace"}),e.jsxs("div",{className:"find-replace-group",children:[e.jsx("label",{children:"Find:"}),e.jsx("input",{type:"text",className:"find-replace-input",value:Y,onChange:t=>Ve(t.target.value),placeholder:"Enter text to find...",autoFocus:!0})]}),e.jsxs("div",{className:"find-replace-group",children:[e.jsx("label",{children:"Replace with:"}),e.jsx("input",{type:"text",className:"find-replace-input",value:pe,onChange:t=>De(t.target.value),placeholder:"Enter replacement text..."})]}),ye&&e.jsx("div",{className:"find-replace-status",children:ye}),e.jsxs("div",{className:"find-replace-buttons",children:[e.jsx("button",{className:"find-replace-btn primary",onClick:ue,children:"Find Next"}),e.jsx("button",{className:"find-replace-btn",onClick:ut,children:"Replace"}),e.jsx("button",{className:"find-replace-btn",onClick:gt,children:"Replace All"}),e.jsx("button",{className:"find-replace-btn",onClick:()=>he(!1),children:"Close"})]})]})}),Z&&e.jsx("div",{className:"modal-overlay",onClick:()=>q(!1),children:e.jsxs("div",{className:"modal-content",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:"Insert Image"}),e.jsx("button",{className:"modal-close",onClick:()=>q(!1),children:"×"})]}),e.jsxs("div",{className:"modal-body",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Image URL:"}),e.jsx("input",{type:"text",placeholder:"https://example.com/image.jpg",value:_,onChange:t=>K(t.target.value),className:"form-input"}),e.jsx("button",{className:"btn-primary",onClick:st,style:{marginTop:"10px",width:"100%"},children:"Insert from URL"})]}),e.jsxs("div",{className:"form-group",style:{marginTop:"20px"},children:[e.jsx("label",{children:"Or upload from your device:"}),e.jsx("input",{type:"file",ref:Ze,onChange:it,accept:"image/*",className:"form-input",style:{padding:"8px"}})]})]}),e.jsx("div",{className:"modal-footer",children:e.jsx("button",{className:"btn-secondary",onClick:()=>q(!1),children:"Cancel"})})]})}),e.jsx(ve,{isOpen:ee.open,onClose:()=>te(t=>({...t,open:!1})),onInsert:tt,onRemove:lt,isEditing:!!ee.isEditing,initialUrl:ee.initialUrl,initialText:ee.initialText,existingLinks:ee.existingLinks})]})};z.LinkModal=ve,z.RichTextEditor=ze,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})}));
|
|
17
|
+
`,P.style.display="none",l.appendChild(P);const ae=(n,i,c)=>{n?(P.style.display="block",P.style.left=typeof i=="number"?i+"px":"8px",P.style.top=typeof c=="number"?c+"px":"36px"):P.style.display="none"};P.addEventListener("click",n=>{n.stopPropagation();const i=n.target.closest("button[data-action]");if(!i)return;const c=i.getAttribute("data-action");try{const s=M.current||t.rows[0].cells[0];if(!s)return;c==="select-row"&&Et(s,t),c==="select-column"&&At(s,t),c==="select-table"&&Ht(t),c==="merge-right"&&I(s,"right",t),c==="merge-left"&&I(s,"left",t),c==="merge-up"&&I(s,"up",t),c==="merge-down"&&I(s,"down",t),c==="split-vertical"&&We(s,"vertical",t),c==="split-horizontal"&&We(s,"horizontal",t),c==="add-row"&&He(t),c==="add-col"&&Ie(t),c==="delete-table"&&Be(t)}catch{}ae(!1)});const qe=d("Table Menu","⋮",()=>{ae(P.style.display!=="block")});qe.className+=" table-menu-btn",a.appendChild(qe),l.addEventListener("contextmenu",n=>{n.preventDefault(),F.current=null,M.current=n.target.closest("td,th")||M.current;const i=l.getBoundingClientRect();ae(!0,n.clientX-i.left,n.clientY-i.top)}),document.addEventListener("click",n=>{l.contains(n.target)||ae(!1)});let ce=!1,le=null;const Fe=n=>{if(!ce)return;const i=n.clientX-le.x,c=n.clientY-le.y;l.style.transform=`translate(${le.tx+i}px, ${le.ty+c}px)`},Ue=()=>{if(!ce)return;ce=!1,document.removeEventListener("mousemove",Fe),document.removeEventListener("mouseup",Ue);const n=l.style.transform.match(/translate\((-?\d+)px,\s*(-?\d+)px\)/);if(n){const i=parseInt(n[1],10),c=parseInt(n[2],10);l.style.left=l.offsetLeft+i+"px",l.style.top=l.offsetTop+c+"px",l.style.transform="",l.style.position="absolute"}};re.addEventListener("mousedown",n=>{n.preventDefault(),n.stopPropagation(),ce=!0,le={x:n.clientX,y:n.clientY,tx:0,ty:0},document.addEventListener("mousemove",Fe),document.addEventListener("mouseup",Ue)}),t.dataset.enhanced="1"},vt=(t,l,o,r)=>{const a=t.clientX,d=t.clientY,h=o.offsetWidth,C=o.offsetHeight,S=U=>{const A=U.clientX-a,J=U.clientY-d;if(r.includes("e")){const I=Math.max(200,h+A);o.style.width=I+"px"}else if(r.includes("w")){const I=Math.max(200,h-A);o.style.width=I+"px"}if(r.includes("s")){const I=Math.max(100,C+J);o.style.height=I+"px"}else if(r.includes("n")){const I=Math.max(100,C-J);o.style.height=I+"px"}},E=()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",E),document.body.style.cursor=""};document.addEventListener("mousemove",S),document.addEventListener("mouseup",E)},He=t=>{const l=M.current;let o=-1;l&&(o=l.parentElement.rowIndex);const r=t.rows[0]?t.rows[0].cells.length:t.tBodies[0]&&t.tBodies[0].rows[0]?t.tBodies[0].rows[0].cells.length:1,a=t.insertRow(o+1);for(let d=0;d<r;d++){const h=a.insertCell(-1);h.innerHTML=`Cell ${a.rowIndex}-${d+1}`}},Ie=t=>{const l=M.current;let o=-1;l&&(o=Array.prototype.indexOf.call(l.parentElement.children,l));for(let r=0;r<t.rows.length;r++){const a=t.rows[r],d=o+1,h=a.insertCell(d);h.innerHTML=""}},yt=t=>{if(t.rows.length<=1)return;const l=M.current;let o=l?l.parentElement.rowIndex:t.rows.length-1;t.deleteRow(o)},mt=t=>{const l=t.rows[0]?t.rows[0].cells.length:0;if(l<=1)return;const o=M.current;let r=o?Array.prototype.indexOf.call(o.parentElement.children,o):l-1;for(let a=0;a<t.rows.length;a++){const d=t.rows[a];d.cells[r]&&d.deleteCell(r)}},Be=t=>{const l=t.closest(".editable-table-wrap");l?l.remove():t.remove()},bt=()=>{try{const t=u.current;if(!t)return;t.querySelectorAll("table").forEach(o=>Ae(o))}catch{}},Ct=()=>{try{const t=u.current;if(!t)return;t.querySelectorAll("img:not(.editable-image-wrap img)").forEach(o=>{if(!o.closest(".editable-image-wrap")){const r=document.createElement("div");r.className="editable-image-wrap",r.contentEditable="false",o.parentNode.insertBefore(r,o),r.appendChild(o),Me(r)}})}catch{}},xt=()=>{oe(!G)},wt=()=>{const t=u.current?.innerHTML||"",l=new Blob([t],{type:"text/html"}),o=URL.createObjectURL(l),r=document.createElement("a");r.href=o,r.download="document.html",r.click(),URL.revokeObjectURL(o)};v.useEffect(()=>{const t=()=>{const l=u.current?.innerText||"",o=new Blob([l],{type:"text/plain"}),r=URL.createObjectURL(o),a=document.createElement("a");a.href=r,a.download="document.txt",a.click(),URL.revokeObjectURL(r)};try{window._exportAsText=t}catch{}return()=>{try{delete window._exportAsText}catch{}}},[]),v.useEffect(()=>{const t=l=>{try{const o=l.target.closest(".editable-table-wrap"),r=l.target.closest(".editable-image-wrap");!o&&u.current&&u.current.querySelectorAll(".editable-table-wrap.selected").forEach(d=>d.classList.remove("selected")),!r&&u.current&&u.current.querySelectorAll(".editable-image-wrap.selected").forEach(d=>d.classList.remove("selected"))}catch{}};return document.addEventListener("click",t),()=>document.removeEventListener("click",t)},[]);const kt=t=>{const l=t.target.files?.[0];if(l){const o=new FileReader;o.onload=r=>{const a=r.target?.result;u.current&&(u.current.innerHTML=a,j(a),setTimeout(()=>{bt(),Ct()},50))},o.readAsText(l)}},Nt=()=>{V(!0)},St=()=>{const t=u.current?.innerHTML||"";navigator.clipboard.writeText(t).then(()=>{alert("HTML copied to clipboard!")})},Lt=()=>{confirm("Are you sure you want to clear all content?")&&u.current&&(y("selectAll"),y("delete"),j(""))},Tt=()=>{const t=prompt("Enter your code:");if(t){const l=`<pre><code>${t}</code></pre>`;y("insertHTML",l)}},Mt=()=>{y("formatBlock","blockquote")};return e.jsxs("div",{className:`editor-container ${G?"fullscreen":""}`,children:[e.jsx("input",{type:"file",ref:Le,onChange:kt,accept:".html,.txt",style:{display:"none"}}),e.jsx("div",{className:"editor-content",children:e.jsxs("div",{className:`page-card size-${we}`,children:[e.jsxs("div",{className:"editor-toolbar",children:[e.jsxs("div",{className:"toolbar-group",children:[e.jsx("button",{className:"toolbar-btn",onClick:()=>y("undo"),title:"Undo",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M3 7v6h6"}),e.jsx("path",{d:"M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:()=>y("redo"),title:"Redo",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M21 7v6h-6"}),e.jsx("path",{d:"M3 17a9 9 0 019-9 9 9 0 016 2.3l3 2.7"})]})})]}),e.jsx("div",{className:"toolbar-divider"}),e.jsxs("div",{className:"toolbar-group",children:[e.jsxs("select",{className:"toolbar-select",onChange:at,value:Ge,children:[e.jsx("option",{value:"Arial",children:"Arial"}),e.jsx("option",{value:"Helvetica",children:"Helvetica"}),e.jsx("option",{value:"Segoe UI",children:"Segoe UI"}),e.jsx("option",{value:"Roboto",children:"Roboto"}),e.jsx("option",{value:"Open Sans",children:"Open Sans"}),e.jsx("option",{value:"Lato",children:"Lato"}),e.jsx("option",{value:"Montserrat",children:"Montserrat"}),e.jsx("option",{value:"Source Sans Pro",children:"Source Sans Pro"}),e.jsx("option",{value:"Tahoma",children:"Tahoma"}),e.jsx("option",{value:"Verdana",children:"Verdana"}),e.jsx("option",{value:"Trebuchet MS",children:"Trebuchet MS"}),e.jsx("option",{value:"Georgia",children:"Georgia"}),e.jsx("option",{value:"Times New Roman",children:"Times New Roman"}),e.jsx("option",{value:"Palatino Linotype",children:"Palatino Linotype"}),e.jsx("option",{value:"Garamond",children:"Garamond"}),e.jsx("option",{value:"Courier New",children:"Courier New"}),e.jsx("option",{value:"Brush Script MT",children:"Brush Script MT"}),e.jsx("option",{value:"Impact",children:"Impact"}),e.jsx("option",{value:"Comic Sans MS",children:"Comic Sans MS"}),e.jsx("option",{value:"Candara",children:"Candara"}),e.jsx("option",{value:"Cambria",children:"Cambria"}),e.jsx("option",{value:"Calibri",children:"Calibri"}),e.jsx("option",{value:"Merriweather",children:"Merriweather"}),e.jsx("option",{value:"Noto Sans",children:"Noto Sans"}),e.jsx("option",{value:"Palatino",children:"Palatino"}),e.jsx("option",{value:"Bookman",children:"Bookman"}),e.jsx("option",{value:"Lucida Sans",children:"Lucida Sans"}),e.jsx("option",{value:"Righteous",children:"Righteous"}),e.jsx("option",{value:"Poppins",children:"Poppins"})]}),e.jsxs("select",{className:"toolbar-select",onChange:rt,value:Ke,children:[e.jsx("option",{value:"1",children:"Small"}),e.jsx("option",{value:"3",children:"Normal"}),e.jsx("option",{value:"5",children:"Large"}),e.jsx("option",{value:"7",children:"Huge"})]}),e.jsxs("select",{className:"toolbar-select",onChange:t=>{ht(t.target.value),fe(t.target.value)},value:Qe,children:[e.jsx("option",{value:"p",children:"Paragraph"}),e.jsx("option",{value:"h1",children:"Heading 1"}),e.jsx("option",{value:"h2",children:"Heading 2"}),e.jsx("option",{value:"h3",children:"Heading 3"}),e.jsx("option",{value:"h4",children:"Heading 4"})]})]}),e.jsx("div",{className:"toolbar-divider"}),e.jsxs("div",{className:"toolbar-group",children:[e.jsx("button",{className:`toolbar-btn ${O.bold?"active":""}`,onClick:()=>y("bold"),title:"Bold",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("path",{d:"M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"}),e.jsx("path",{d:"M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"})]})}),e.jsx("button",{className:`toolbar-btn ${O.italic?"active":""}`,onClick:()=>y("italic"),title:"Italic",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"19",y1:"4",x2:"10",y2:"4"}),e.jsx("line",{x1:"14",y1:"20",x2:"5",y2:"20"}),e.jsx("line",{x1:"15",y1:"4",x2:"9",y2:"20"})]})}),e.jsx("button",{className:`toolbar-btn ${O.underline?"active":""}`,onClick:()=>y("underline"),title:"Underline",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3"}),e.jsx("line",{x1:"4",y1:"21",x2:"20",y2:"21"})]})}),e.jsx("button",{className:`toolbar-btn ${O.strikeThrough?"active":""}`,onClick:()=>y("strikeThrough"),title:"Strikethrough",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M16 4H9a3 3 0 0 0-2.83 4"}),e.jsx("path",{d:"M14 12a4 4 0 0 1 0 8H6"}),e.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12"})]})})]}),e.jsx("div",{className:"toolbar-divider"}),e.jsxs("div",{className:"toolbar-group",children:[e.jsxs("div",{className:"color-picker-wrapper","data-tooltip":"Text color","aria-label":"Text color picker",children:[e.jsx("input",{type:"color",onChange:ot,className:"color-picker",title:"Text Color",defaultValue:"#111827","aria-label":"Text color"}),e.jsx("span",{className:"color-label",children:"A"}),e.jsx("span",{className:"color-caption",children:"Text color"})]}),e.jsxs("div",{className:"color-picker-wrapper","data-tooltip":"Highlight / background color","aria-label":"Background color picker",children:[e.jsx("input",{type:"color",onChange:nt,className:"color-picker",title:"Background Color",defaultValue:"#ffffff","aria-label":"Background color"}),e.jsx("span",{className:"color-label",children:"◼"}),e.jsx("span",{className:"color-caption",children:"Highlight"})]})]}),e.jsx("div",{className:"toolbar-divider"}),e.jsx("div",{className:"toolbar-group",children:e.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[e.jsx("button",{className:"toolbar-btn",onClick:()=>D(t=>!t),title:"More formatting",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"5",cy:"6",r:"1.2"}),e.jsx("circle",{cx:"5",cy:"12",r:"1.2"}),e.jsx("circle",{cx:"5",cy:"18",r:"1.2"}),e.jsx("line",{x1:"10",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"10",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"10",y1:"18",x2:"21",y2:"18"})]})}),Oe&&e.jsxs("div",{className:"toolbar-dropdown-panel",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"toolbar-dropdown-row",children:[e.jsx("button",{className:`toolbar-btn ${O.justifyLeft?"active":""}`,onClick:()=>{y("justifyLeft"),D(!1)},title:"Align Left",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"17",y1:"10",x2:"3",y2:"10"}),e.jsx("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),e.jsx("line",{x1:"21",y1:"14",x2:"3",y2:"14"})]})}),e.jsx("button",{className:`toolbar-btn ${O.justifyCenter?"active":""}`,onClick:()=>{y("justifyCenter"),D(!1)},title:"Align Center",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"10",x2:"6",y2:"10"}),e.jsx("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),e.jsx("line",{x1:"21",y1:"14",x2:"3",y2:"14"})]})}),e.jsx("button",{className:`toolbar-btn ${O.justifyRight?"active":""}`,onClick:()=>{y("justifyRight"),D(!1)},title:"Align Right",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"21",y1:"10",x2:"7",y2:"10"}),e.jsx("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),e.jsx("line",{x1:"21",y1:"14",x2:"3",y2:"14"})]})})]}),e.jsx("div",{className:"toolbar-dropdown-sep"}),e.jsxs("div",{className:"toolbar-dropdown-row",children:[e.jsx("button",{className:`toolbar-btn ${O.insertUnorderedList?"active":""}`,onClick:()=>{y("insertUnorderedList"),D(!1)},title:"Bullet List",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),e.jsx("circle",{cx:"4",cy:"6",r:"1",fill:"currentColor"})]})}),e.jsx("button",{className:`toolbar-btn ${O.insertOrderedList?"active":""}`,onClick:()=>{y("insertOrderedList"),D(!1)},title:"Numbered List",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"10",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"10",y1:"12",x2:"21",y2:"12"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:()=>{y("indent"),D(!1)},title:"Indent",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("line",{x1:"21",y1:"4",x2:"9",y2:"4"})})}),e.jsx("button",{className:"toolbar-btn",onClick:()=>{y("outdent"),D(!1)},title:"Outdent",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("line",{x1:"21",y1:"4",x2:"9",y2:"4"})})})]})]})]})}),e.jsx("div",{className:"toolbar-divider"}),e.jsxs("div",{className:"toolbar-group",children:[e.jsx("button",{className:"toolbar-btn",onClick:et,title:"Insert Link",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),e.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:ct,title:"Insert Image",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.jsx("polyline",{points:"21 15 16 10 5 21"})]})}),e.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[e.jsx("button",{className:"toolbar-btn",onClick:()=>Q(!R),title:"Insert Table",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),e.jsx("line",{x1:"3",y1:"15",x2:"21",y2:"15"}),e.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"}),e.jsx("line",{x1:"15",y1:"3",x2:"15",y2:"21"})]})}),R&&e.jsxs("div",{className:"table-size-picker show",children:[e.jsx("div",{className:"table-size-grid",style:{gridTemplateColumns:"repeat(10, 18px)"},children:Array.from({length:10},(t,l)=>Array.from({length:10},(o,r)=>e.jsx("div",{className:`table-cell-preview ${l<N.rows&&r<N.cols?"hover":""}`,onMouseEnter:()=>pt(l,r),onClick:()=>ft(l,r)},`${l}-${r}`))).flat()}),e.jsxs("div",{className:"table-size-label",children:[N.rows," × ",N.cols]})]})]}),e.jsx("button",{className:"toolbar-btn",onClick:()=>he(!0),title:"Find and Replace",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("path",{d:"m21 21-4.35-4.35"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:()=>y("insertHorizontalRule"),title:"Horizontal Rule",children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"})})}),e.jsx("button",{className:"toolbar-btn",onClick:Mt,title:"Insert Quote",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z"}),e.jsx("path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:Tt,title:"Code Block",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("polyline",{points:"16 18 22 12 16 6"}),e.jsx("polyline",{points:"8 6 2 12 8 18"})]})})]}),e.jsx("div",{className:"toolbar-divider"}),e.jsxs("div",{className:"toolbar-group",children:[e.jsxs("select",{className:"toolbar-select",value:we,onChange:t=>_e(t.target.value),title:"Page size","aria-label":"Page size",children:[e.jsx("option",{value:"a0",children:"A0"}),e.jsx("option",{value:"a1",children:"A1"}),e.jsx("option",{value:"a2",children:"A2"}),e.jsx("option",{value:"a3",children:"A3"}),e.jsx("option",{value:"a4",children:"A4"}),e.jsx("option",{value:"a5",children:"A5"}),e.jsx("option",{value:"a6",children:"A6"}),e.jsx("option",{value:"b0",children:"B0"}),e.jsx("option",{value:"b1",children:"B1"}),e.jsx("option",{value:"b2",children:"B2"}),e.jsx("option",{value:"b3",children:"B3"}),e.jsx("option",{value:"b4",children:"B4"}),e.jsx("option",{value:"b5",children:"B5"}),e.jsx("option",{value:"letter",children:"Letter"}),e.jsx("option",{value:"legal",children:"Legal"}),e.jsx("option",{value:"ledger",children:"Ledger"}),e.jsx("option",{value:"tabloid",children:"Tabloid"}),e.jsx("option",{value:"executive",children:"Executive"}),e.jsx("option",{value:"statement",children:"Statement"}),e.jsx("option",{value:"folio",children:"Folio"}),e.jsx("option",{value:"c4",children:"C4"}),e.jsx("option",{value:"c5",children:"C5"}),e.jsx("option",{value:"monarch",children:"Monarch"}),e.jsx("option",{value:"dl-envelope",children:"Envelope DL"}),e.jsx("option",{value:"c6-envelope",children:"Envelope C6"}),e.jsx("option",{value:"custom",children:"Custom"})]}),e.jsx("button",{className:"toolbar-btn",onClick:()=>Le.current?.click(),title:"Import",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"7 10 12 15 17 10"}),e.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:wt,title:"Export HTML",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"17 8 12 3 7 8"}),e.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:Nt,title:"View HTML",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("polyline",{points:"16 18 22 12 16 6"}),e.jsx("polyline",{points:"8 6 2 12 8 18"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:Lt,title:"Clear All",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})}),e.jsx("button",{className:"toolbar-btn",onClick:xt,title:G?"Exit Fullscreen":"Fullscreen",children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:G?e.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}):e.jsx("path",{d:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"})})})]}),e.jsx("div",{className:"toolbar-divider"}),e.jsx("div",{className:"toolbar-group",children:e.jsx("button",{className:"toolbar-btn",onClick:()=>y("removeFormat"),title:"Clear Formatting",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M4 7h16M9 20h6M12 4v16"}),e.jsx("line",{x1:"3",y1:"3",x2:"21",y2:"21",strokeWidth:"1.5"})]})})})]}),e.jsx("div",{ref:u,className:"page-body",contentEditable:!0,onInput:Re,suppressContentEditableWarning:!0,"data-placeholder":"Start typing your content here..."})]})}),e.jsxs("div",{className:"status-bar-bottom",children:[e.jsxs("span",{className:"status-item",children:["Characters: ",X.replace(/<[^>]*>/g,"").length]}),e.jsx("span",{className:"status-item",children:"•"}),e.jsxs("span",{className:"status-item",children:["Words: ",X.replace(/<[^>]*>/g,"").trim().split(/\s+/).filter(t=>t).length]})]}),Xe&&e.jsx("div",{className:"modal-overlay",onClick:()=>ne(!1),children:e.jsxs("div",{className:"modal-content",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:"Insert Table"}),e.jsx("button",{className:"modal-close",onClick:()=>ne(!1),children:"×"})]}),e.jsxs("div",{className:"modal-body",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Rows:"}),e.jsx("input",{type:"number",min:"1",max:"20",value:me,onChange:t=>be(parseInt(t.target.value)||1),className:"form-input"})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Columns:"}),e.jsx("input",{type:"number",min:"1",max:"10",value:Ce,onChange:t=>xe(parseInt(t.target.value)||1),className:"form-input"})]})]}),e.jsxs("div",{className:"modal-footer",children:[e.jsx("button",{className:"btn-secondary",onClick:()=>ne(!1),children:"Cancel"}),e.jsx("button",{className:"btn-primary",onClick:Ee,children:"Insert Table"})]})]})}),ie&&e.jsx("div",{className:"modal-overlay",onClick:()=>V(!1),children:e.jsxs("div",{className:"modal-content modal-large",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:"HTML Source Code"}),e.jsx("button",{className:"modal-close",onClick:()=>V(!1),children:"×"})]}),e.jsx("div",{className:"modal-body",children:e.jsx("pre",{className:"html-preview",children:X||""})}),e.jsxs("div",{className:"modal-footer",children:[e.jsx("button",{className:"btn-secondary",onClick:()=>V(!1),children:"Close"}),e.jsx("button",{className:"btn-primary",onClick:St,children:"Copy HTML"})]})]})}),je&&e.jsx("div",{className:"link-modal-overlay",onClick:()=>he(!1),children:e.jsxs("div",{className:"find-replace-modal",onClick:t=>t.stopPropagation(),children:[e.jsx("h3",{children:"Find and Replace"}),e.jsxs("div",{className:"find-replace-group",children:[e.jsx("label",{children:"Find:"}),e.jsx("input",{type:"text",className:"find-replace-input",value:Y,onChange:t=>Ve(t.target.value),placeholder:"Enter text to find...",autoFocus:!0})]}),e.jsxs("div",{className:"find-replace-group",children:[e.jsx("label",{children:"Replace with:"}),e.jsx("input",{type:"text",className:"find-replace-input",value:pe,onChange:t=>De(t.target.value),placeholder:"Enter replacement text..."})]}),ye&&e.jsx("div",{className:"find-replace-status",children:ye}),e.jsxs("div",{className:"find-replace-buttons",children:[e.jsx("button",{className:"find-replace-btn primary",onClick:ue,children:"Find Next"}),e.jsx("button",{className:"find-replace-btn",onClick:ut,children:"Replace"}),e.jsx("button",{className:"find-replace-btn",onClick:gt,children:"Replace All"}),e.jsx("button",{className:"find-replace-btn",onClick:()=>he(!1),children:"Close"})]})]})}),Z&&e.jsx("div",{className:"modal-overlay",onClick:()=>q(!1),children:e.jsxs("div",{className:"modal-content",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:"Insert Image"}),e.jsx("button",{className:"modal-close",onClick:()=>q(!1),children:"×"})]}),e.jsxs("div",{className:"modal-body",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Image URL:"}),e.jsx("input",{type:"text",placeholder:"https://example.com/image.jpg",value:_,onChange:t=>K(t.target.value),className:"form-input"}),e.jsx("button",{className:"btn-primary",onClick:st,style:{marginTop:"10px",width:"100%"},children:"Insert from URL"})]}),e.jsxs("div",{className:"form-group",style:{marginTop:"20px"},children:[e.jsx("label",{children:"Or upload from your device:"}),e.jsx("input",{type:"file",ref:Ze,onChange:it,accept:"image/*",className:"form-input",style:{padding:"8px"}})]})]}),e.jsx("div",{className:"modal-footer",children:e.jsx("button",{className:"btn-secondary",onClick:()=>q(!1),children:"Cancel"})})]})}),e.jsx(ve,{isOpen:ee.open,onClose:()=>te(t=>({...t,open:!1})),onInsert:tt,onRemove:lt,isEditing:!!ee.isEditing,initialUrl:ee.initialUrl,initialText:ee.initialText,existingLinks:ee.existingLinks})]})};z.LinkModal=ve,z.RichTextEditor=ze,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
*{margin:0;padding:0;box-sizing:border-box}html,body{height:100%;overflow:hidden}:root{--toolbar-height: 64px;--toolbar-row-height: 44px;--toolbar-rows: 2;--toolbar-gap: 8px}.editor-container{width:100%;max-width:100%;margin:0;height:100vh;background:#f8f9fa;border-radius:0;box-shadow:none;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;display:block;transition:all .3s cubic-bezier(.4,0,.2,1);position:relative;padding-top:0;padding-bottom:0}.editor-container.fullscreen{width:100vw;height:100vh;max-width:100%;margin:0;border-radius:0;z-index:9999}.editor-header,.editor-title,.editor-brand,.editor-badge,.editor-actions,.action-btn{display:none}.action-btn svg{display:none}.page-card .page-body{height:auto;overflow:visible;-webkit-overflow-scrolling:touch}.action-btn.active{display:none}.page-card .page-body img{max-width:100%;height:auto}.page-card .page-body:focus{outline:none!important;box-shadow:none!important}.page-card .page-body[contenteditable]{border:none!important;outline:none!important;box-shadow:none!important}.editor-toolbar{display:flex;gap:var(--toolbar-gap);padding:12px 24px;align-items:center;border-bottom:1px solid #e0e0e0;background:#fff;position:sticky;top:0;left:0;right:0;z-index:100;flex-wrap:wrap;flex-shrink:0;box-shadow:0 1px 3px #0000000f;max-height:calc((var(--toolbar-row-height) * var(--toolbar-rows)) + 24px);overflow:visible}.toolbar-group{display:flex;gap:4px;align-items:center;padding:0;position:relative;flex:0 1 auto}.toolbar-group:not(:last-child):after{content:"";width:1px;height:24px;background:#e0e0e0;margin-left:8px}.toolbar-btn{display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:32px;padding:6px;border-radius:4px;background:transparent;color:#5f6368;cursor:pointer;transition:all .15s ease;border:none;position:relative;flex:0 0 auto}.toolbar-btn svg{width:18px;height:18px;stroke-width:2}.toolbar-btn:hover{background:#f1f3f4;color:#202124}.toolbar-btn:active{background:#e8eaed;transform:scale(.95)}.toolbar-btn.active{background:#e8f0fe;color:#1967d2}.toolbar-select{height:32px;padding:6px 28px 6px 12px;border:1px solid #dadce0;border-radius:4px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center;background-size:12px;color:#202124;appearance:none;min-width:88px;font-weight:500;font-size:14px;cursor:pointer;transition:all .15s ease;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;flex:0 1 140px}.toolbar-select:hover{border-color:#5f6368;background-color:#f8f9fa}.toolbar-select:focus{outline:none;border-color:#1967d2;box-shadow:0 0 0 2px #1967d21a}.color-picker-wrapper{width:32px;height:32px;border:1px solid #d1d5db;border-radius:6px;background:#fff;position:relative;overflow:hidden;cursor:pointer;transition:all .15s ease}.color-picker-wrapper:hover{border-color:#9ca3af;box-shadow:0 2px 4px #0000000f}.toolbar-dropdown-panel{position:absolute;top:calc(100% + 4px);left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:6px;box-shadow:0 4px 16px #0000001f;z-index:2000;display:flex;gap:4px;align-items:center;max-width:400px;overflow-x:auto;overflow-y:hidden}.toolbar-dropdown-panel::-webkit-scrollbar{height:6px}.toolbar-dropdown-panel::-webkit-scrollbar-track{background:#f3f4f6;border-radius:3px}.toolbar-dropdown-panel::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}.toolbar-dropdown-panel .toolbar-btn{min-width:32px;width:32px;height:32px;flex-shrink:0;border:1px solid #e5e7eb}.toolbar-dropdown-panel .toolbar-btn:hover{background:#f3f4f6;border-color:#3b82f6}.color-picker-wrapper input[type=color]{position:absolute;left:0;top:0;width:100%;height:100%;border:none;padding:0;cursor:pointer}.color-picker-wrapper .color-label{position:absolute;right:4px;bottom:4px;font-size:9px;color:#6b7280;pointer-events:none;font-weight:600}.color-picker-wrapper:focus-within{box-shadow:0 6px 18px #0000001f,0 0 0 4px #22c55e0f;border-color:var(--accent)}.editor-content{display:flex;justify-content:center;align-items:flex-start;position:absolute;inset:0 0 50px;padding:0 0 24px;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;background:transparent;color:var(--text-color);font-size:17px;line-height:1.8}.page-card{max-width:1200px;width:100%;margin:0 auto 24px;background:var(--card-bg);border-radius:0;box-shadow:0 4px 20px #00000014;padding:0;border:1px solid var(--border);border-top:none;display:flex;flex-direction:column;overflow:visible}.page-card .page-body{background:var(--editor-bg);min-height:1000px;padding:48px 80px;border-radius:0;box-shadow:none;border:none;color:#202124;overflow-wrap:break-word;word-wrap:break-word;overflow:visible;flex:1;font-size:16px;line-height:1.6;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.page-card.size-a4{width:794px;min-height:1123px}.page-card.size-letter{width:816px;min-height:1056px}.page-card.size-a3{width:1122px;min-height:1587px}.page-card.size-custom{width:900px;min-height:1200px}.page-card{display:block;box-sizing:border-box}.page-card .page-body{height:auto;overflow:visible}.page-card .page-body table{width:100%;max-width:100%;table-layout:fixed;border-collapse:collapse}.page-card .page-body *{max-width:100%}.page-card .page-body th,.page-card .page-body td{white-space:normal;word-break:break-word;box-sizing:border-box}@media(max-width:1300px){.page-card.size-a3{width:calc(100% - 48px);height:auto}}@media(max-width:1000px){.page-card.size-a4,.page-card.size-letter,.page-card.size-custom{width:calc(100% - 48px);height:auto;padding:20px}.page-card{padding:16px 20px}.page-card .page-body{padding:14px}}.page-size-select{height:36px;padding:6px 10px;border-radius:8px;border:1px solid var(--border);background:#fff;color:var(--text-color);font-weight:600;margin-right:8px}.page-card .page-body h1{font-size:40px;font-weight:700;line-height:1.2;margin:24px 0 16px;color:#202124;letter-spacing:-.5px}.page-card .page-body h1 .page-card .page-body thead th{background:#0f172a88;color:#fff}.page-card .page-body h2{font-size:32px;font-weight:700;line-height:1.3;margin:20px 0 12px;color:#202124;letter-spacing:-.3px}.page-card .page-body h3{font-size:24px;font-weight:600;line-height:1.4;margin:16px 0 10px;color:#202124}.page-card .page-body h4{font-size:20px;font-weight:600;line-height:1.4;margin:14px 0 8px;color:#202124}.page-card .page-body p{margin:0 0 12px;line-height:1.6;color:#3c4043}.page-card .page-body strong,.page-card .page-body b{font-weight:700;color:#202124}.page-card .page-body em,.page-card .page-body i{font-style:italic}.page-card .page-body ul,.page-card .page-body ol{margin:12px 0;padding-left:28px}.page-card .page-body li{margin:6px 0;line-height:1.6;color:#3c4043}.editor-content:focus{outline:none;background:var(--editor-bg)}.editor-content p{margin:0 0 16px;transition:color .2s ease}.editor-content h3,.editor-content h4,.editor-content h5,.editor-content h6{color:var(--text-color);margin:24px 0 16px;font-weight:700;transition:color .2s ease}.editor-content a{color:var(--accent);text-decoration:underline}.page-card .page-body a{color:#1d4ed8;text-decoration:underline;cursor:pointer}.page-card .page-body a:hover{opacity:.92}.page-card .page-body a[contenteditable=false]{cursor:pointer}.editable-image-wrap{position:relative;display:inline-block;margin:4px;max-width:100%;vertical-align:top;width:fit-content}.editable-image-wrap.selected{outline:3px solid #3b82f6;outline-offset:2px;box-shadow:0 0 0 1px #3b82f633}.editable-image-wrap img{display:block;max-width:100%;height:auto}.image-resize-handle{position:absolute;width:12px;height:12px;background:#3b82f6;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 6px #0003;z-index:20;display:none}.editable-image-wrap.selected .image-resize-handle{display:block}.image-resize-handle.nw{top:-6px;left:-6px;cursor:nw-resize}.image-resize-handle.ne{top:-6px;right:-6px;cursor:ne-resize}.image-resize-handle.sw{bottom:-6px;left:-6px;cursor:sw-resize}.image-resize-handle.se{bottom:-6px;right:-6px;cursor:se-resize}.image-resize-handle:hover{background:#2563eb;transform:scale(1.2)}.image-controls{position:absolute;bottom:-44px;left:50%;transform:translate(-50%);display:none;gap:4px;background:#fff;border:1px solid #cbd5e1;padding:6px 8px;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:100;white-space:nowrap}.editable-image-wrap.selected .image-controls{display:flex}.image-control-btn{min-width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;font-weight:600;font-size:11px;background:#fff;border:1px solid #e5e7eb;border-radius:4px;cursor:pointer;color:#374151;transition:all .15s ease;padding:0 8px}.image-control-btn:hover{background:#3b82f6;color:#fff;border-color:#3b82f6;transform:translateY(-1px);box-shadow:0 2px 6px #0000001a}.image-control-btn svg{width:14px;height:14px}.image-control-divider{width:1px;height:24px;background:#e5e7eb;margin:0 4px}.editor-content img{max-width:100%;height:auto;border-radius:6px;margin:12px 0}.editor-content hr{border:none;border-top:1px solid var(--border);margin:20px 0}.editor-content blockquote{border-left:4px solid var(--border);padding-left:12px;color:var(--muted);font-style:italic}.editor-content code{background:var(--surface-1);color:var(--text-color);padding:3px 6px;border-radius:4px;font-family:Monaco,Menlo,monospace}.editor-content table{border-collapse:collapse;width:100%;margin:16px 0;background:var(--editor-bg);border-radius:0;overflow:visible;box-shadow:none;position:relative}.editor-content table th{background:#f8f9fa;color:var(--text-color);font-weight:700;text-align:left;padding:12px 16px;border:1px solid #cbd5e1;font-size:14px}.editor-content table td{padding:12px 16px;border:1px solid #cbd5e1;color:var(--text-color);background:#fff;font-size:14px}.editor-content table tr:hover td{background:#fefce8}.editable-table-wrap{position:relative;margin:20px 0;display:inline-block;min-width:200px}.editable-table-wrap.selected{outline:3px solid #fbbf24;outline-offset:2px;box-shadow:0 0 0 1px #fbbf2433}.table-resize-handle{position:absolute;width:14px;height:14px;background:#fbbf24;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 6px #0003;cursor:nwse-resize;z-index:20;display:none}.editable-table-wrap.selected .table-resize-handle{display:block}.table-resize-handle.nw{top:-7px;left:-7px;cursor:nw-resize}.table-resize-handle.ne{top:-7px;right:-7px;cursor:ne-resize}.table-resize-handle.sw{bottom:-7px;left:-7px;cursor:sw-resize}.table-resize-handle.se{bottom:-7px;right:-7px;cursor:se-resize}.table-resize-handle:hover{background:#f59e0b;transform:scale(1.2)}.table-controls{position:absolute;top:-48px;left:0;display:none;gap:4px;background:#fff;border:1px solid #cbd5e1;padding:6px;border-radius:6px;box-shadow:0 4px 12px #0000001a;z-index:100}.editable-table-wrap.selected .table-controls{display:flex}.table-control-btn{min-width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;font-weight:600;font-size:11px;background:#fff;border:1px solid #e5e7eb;border-radius:4px;cursor:pointer;color:#374151;transition:all .15s ease}.table-control-btn:hover{background:#fbbf24;color:#fff;border-color:#fbbf24;transform:translateY(-1px);box-shadow:0 2px 6px #0000001a}.editor-content pre{background:#0b0b0b;color:#f7f7f7;padding:16px;border-radius:8px;overflow-x:auto;margin:16px 0}.editor-content pre code{background:none;color:inherit;padding:0;font-family:Monaco,Menlo,monospace}.editor-footer,.status-bar,.status-item{display:none}.status-bar-bottom{position:fixed;bottom:0;left:50%;transform:translate(-50%);background:#fffffff2;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:8px 24px;border-radius:20px 20px 0 0;box-shadow:0 -2px 10px #00000014;display:flex;gap:12px;align-items:center;z-index:1000;font-size:13px;color:#64748b;font-weight:500;border:1px solid #e5e7eb;border-bottom:none}.status-bar-bottom .status-item{display:inline;white-space:nowrap;padding:0;background:none;border:none}.status-item:hover{transform:translateY(-2px);box-shadow:0 4px 8px #0000000f}.editor-content::-webkit-scrollbar,.modal-body::-webkit-scrollbar{width:12px}.editor-content::-webkit-scrollbar-track,.modal-body::-webkit-scrollbar-track{background:#f3f4f6;border-radius:6px}.editor-content::-webkit-scrollbar-thumb,.modal-body::-webkit-scrollbar-thumb{background:#9aa3ad;border-radius:6px;border:2px solid #f3f4f6}.modal-overlay,.link-modal-overlay{position:fixed;inset:0;background:#00000080;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000;animation:rte-fadeIn .18s ease}@keyframes rte-fadeIn{0%{opacity:0}to{opacity:1}}.modal-content{background:var(--card-bg);border-radius:12px;box-shadow:0 25px 50px -12px #00000040;width:90%;max-width:680px;max-height:90vh;overflow:hidden;display:flex;flex-direction:column;animation:rte-slideUp .28s ease}@keyframes rte-slideUp{0%{transform:translateY(12px);opacity:0}to{transform:translateY(0);opacity:1}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:18px 20px;background:var(--header-bg);color:#fff}.modal-header h3{margin:0;font-size:18px;font-weight:600}.modal-close{background:#ffffff0f;border:1px solid rgba(255,255,255,.08);color:#fff;width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;cursor:pointer}.modal-close:hover{background:#ffffff1f;transform:rotate(90deg)}.modal-body{padding:20px;overflow-y:auto;flex:1}.modal-footer{display:flex;justify-content:flex-end;gap:12px;padding:16px 20px;background:var(--surface-1);border-top:1px solid var(--border)}.form-group{margin-bottom:16px}.form-group label{display:block;margin-bottom:8px;font-weight:600;color:var(--muted);font-size:14px}.form-input{width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:8px;font-size:15px;font-family:inherit}.form-input:focus{outline:none;box-shadow:0 0 0 4px #0000000a;border-color:var(--border)}.btn-primary{padding:10px 20px;background:var(--inverse-bg);color:#fff;border:none;border-radius:8px;font-weight:600;cursor:pointer}.btn-primary:hover{transform:translateY(-2px);box-shadow:0 6px 12px #00000014}.btn-secondary{padding:10px 20px;background:var(--editor-bg);color:var(--text-color);border:1px solid var(--border);border-radius:8px;cursor:pointer}.html-preview{background:#0b0b0b;color:#f7f7f7;padding:16px;border-radius:8px;overflow-x:auto;font-size:13px;font-family:Monaco,Menlo,monospace;white-space:pre-wrap;word-break:break-all}.editor-content::selection{background:#11182714;color:var(--text-color)}.table-size-picker{position:absolute;top:calc(100% + 4px);left:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:12px;box-shadow:0 10px 25px #0000001a,0 4px 8px #0000000f;z-index:2000;display:none}.table-size-picker.show{display:block}.table-size-grid{display:grid;gap:2px;cursor:pointer}.table-drag-handle{width:18px;height:18px;border-radius:4px;background:#0000000f;position:absolute;top:8px;left:8px;display:flex;align-items:center;justify-content:center;cursor:grab;z-index:1500}.table-drag-handle:active{cursor:grabbing}.table-context-menu{position:absolute;right:8px;top:36px;background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:8px;box-shadow:0 8px 30px #0000001f;display:flex;flex-direction:column;gap:6px;min-width:160px;z-index:2000}.table-context-menu button{background:transparent;border:none;text-align:left;padding:8px 10px;border-radius:6px;cursor:pointer}.table-context-menu button:hover{background:#f3f4f6}.table-context-menu hr{border:none;height:1px;background:#eef2f7;margin:6px 0}.table-cell-preview{width:18px;height:18px;border:1px solid #d1d5db;background:#fff;transition:all .1s;border-radius:2px}.table-cell-preview.hover{background:#3b82f6;border-color:#2563eb}.table-size-label{text-align:center;margin-top:8px;font-size:12px;color:#6b7280;font-weight:600}.page-card .page-body td.selected-cell,.page-card .page-body th.selected-cell{outline:2px solid rgba(59,130,246,.9);background:#3b82f60f}.find-replace-modal{background:#fff;padding:24px;border-radius:12px;box-shadow:0 20px 50px #00000026;max-width:450px;width:90%}.find-replace-modal h3{margin:0 0 20px;font-size:18px;color:#1e293b;font-weight:700}.find-replace-group{margin-bottom:16px}.find-replace-group label{display:block;margin-bottom:6px;font-size:13px;color:#475569;font-weight:600}.find-replace-input{width:100%;padding:8px 12px;border:1px solid #cbd5e1;border-radius:6px;font-size:14px;transition:all .15s ease}.find-replace-input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.find-replace-buttons{display:flex;gap:8px;margin-top:20px;flex-wrap:wrap}.find-replace-btn{padding:8px 16px;border-radius:6px;font-size:13px;font-weight:600;cursor:pointer;border:1px solid #cbd5e1;background:#fff;color:#374151;transition:all .15s}.find-replace-btn:hover{background:#f8fafc;border-color:#94a3b8}.find-replace-btn.primary{background:#3b82f6;color:#fff;border-color:#3b82f6}.find-replace-btn.primary:hover{background:#2563eb;border-color:#2563eb}.find-replace-status{margin-top:12px;font-size:13px;color:#64748b;min-height:18px;font-weight:500}.editor-content::-moz-selection{background:#11182714;color:var(--text-color)}@keyframes editorFadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideDown{0%{transform:translateY(-20px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes slideUp{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes fadeInLeft{0%{transform:translate(-20px);opacity:0}to{transform:translate(0);opacity:1}}@keyframes fadeInRight{0%{transform:translate(20px);opacity:0}to{transform:translate(0);opacity:1}}@keyframes fadeInUp{0%{transform:translateY(30px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes pulse{0%,to{opacity:.5}50%{opacity:.8}}@media(max-width:1024px){.editor-content{padding:40px 60px}.editor-header,.editor-toolbar,.editor-footer{padding-left:24px;padding-right:24px}}@media(max-width:768px){.editor-container{margin:0}.editor-header{flex-direction:column;gap:12px;align-items:flex-start;padding:16px 20px}.editor-title{font-size:18px}.action-btn span{display:none}.action-btn{padding:8px;min-width:40px}.editor-toolbar{padding:12px 20px;top:auto;position:relative}.toolbar-group{padding:2px}.toolbar-btn{width:38px;height:38px}.toolbar-select{min-width:110px;height:38px;font-size:13px}.color-picker-wrapper{width:38px;height:38px}.editor-content{padding:24px 20px;min-height:400px;font-size:16px}.editor-footer{padding:12px 20px;position:relative}.modal-content{width:95%;max-width:620px}}@media print{.editor-header,.editor-toolbar,.editor-footer{display:none}.editor-container{box-shadow:none;border:none}.editor-content{max-height:none}}
|
|
1
|
+
*{margin:0;padding:0;box-sizing:border-box}:root{--toolbar-height: 64px;--toolbar-row-height: 44px;--toolbar-rows: 2;--toolbar-gap: 8px}.editor-container{width:100%;max-width:100%;margin:0;min-height:600px;height:auto;background:#f8f9fa;border-radius:0;box-shadow:none;overflow:visible;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;display:block;transition:all .3s cubic-bezier(.4,0,.2,1);position:relative;padding-top:0;padding-bottom:0}.editor-container.fullscreen{width:100vw;height:100vh;max-width:100%;margin:0;border-radius:0;z-index:9999}.editor-header,.editor-title,.editor-brand,.editor-badge,.editor-actions,.action-btn{display:none}.action-btn svg{display:none}.page-card .page-body{height:auto;overflow:visible;-webkit-overflow-scrolling:touch}.action-btn.active{display:none}.page-card .page-body img{max-width:100%;height:auto}.page-card .page-body:focus{outline:none!important;box-shadow:none!important}.page-card .page-body[contenteditable]{border:none!important;outline:none!important;box-shadow:none!important}.editor-toolbar{display:flex;gap:var(--toolbar-gap);padding:12px 24px;align-items:center;border-bottom:1px solid #e0e0e0;background:#fff;position:sticky;top:0;left:0;right:0;z-index:100;flex-wrap:wrap;flex-shrink:0;box-shadow:0 1px 3px #0000000f;max-height:calc((var(--toolbar-row-height) * var(--toolbar-rows)) + 24px);overflow:visible}.toolbar-group{display:flex;gap:4px;align-items:center;padding:0;position:relative;flex:0 1 auto}.toolbar-group:not(:last-child):after{content:"";width:1px;height:24px;background:#e0e0e0;margin-left:8px}.toolbar-btn{display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:32px;padding:6px;border-radius:4px;background:transparent;color:#5f6368;cursor:pointer;transition:all .15s ease;border:none;position:relative;flex:0 0 auto}.toolbar-btn svg{width:18px;height:18px;stroke-width:2}.toolbar-btn:hover{background:#f1f3f4;color:#202124}.toolbar-btn:active{background:#e8eaed;transform:scale(.95)}.toolbar-btn.active{background:#e8f0fe;color:#1967d2}.toolbar-select{height:32px;padding:6px 28px 6px 12px;border:1px solid #dadce0;border-radius:4px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center;background-size:12px;color:#202124;appearance:none;min-width:88px;font-weight:500;font-size:14px;cursor:pointer;transition:all .15s ease;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;flex:0 1 140px}.toolbar-select:hover{border-color:#5f6368;background-color:#f8f9fa}.toolbar-select:focus{outline:none;border-color:#1967d2;box-shadow:0 0 0 2px #1967d21a}.color-picker-wrapper{width:32px;height:32px;border:1px solid #d1d5db;border-radius:6px;background:#fff;position:relative;overflow:hidden;cursor:pointer;transition:all .15s ease}.color-picker-wrapper:hover{border-color:#9ca3af;box-shadow:0 2px 4px #0000000f}.toolbar-dropdown-panel{position:absolute;top:calc(100% + 4px);left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:6px;box-shadow:0 4px 16px #0000001f;z-index:2000;display:flex;gap:4px;align-items:center;max-width:400px;overflow-x:auto;overflow-y:hidden}.toolbar-dropdown-panel::-webkit-scrollbar{height:6px}.toolbar-dropdown-panel::-webkit-scrollbar-track{background:#f3f4f6;border-radius:3px}.toolbar-dropdown-panel::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}.toolbar-dropdown-panel .toolbar-btn{min-width:32px;width:32px;height:32px;flex-shrink:0;border:1px solid #e5e7eb}.toolbar-dropdown-panel .toolbar-btn:hover{background:#f3f4f6;border-color:#3b82f6}.color-picker-wrapper input[type=color]{position:absolute;left:0;top:0;width:100%;height:100%;border:none;padding:0;cursor:pointer}.color-picker-wrapper .color-label{position:absolute;right:4px;bottom:4px;font-size:9px;color:#6b7280;pointer-events:none;font-weight:600}.color-picker-wrapper:focus-within{box-shadow:0 6px 18px #0000001f,0 0 0 4px #22c55e0f;border-color:var(--accent)}.editor-content{flex:1;overflow-y:auto;overflow-x:hidden;background:#f8f9fa;padding:24px;display:flex;justify-content:center;align-items:flex-start;width:100%}.page-card{width:794px;margin:0 auto 24px;background:var(--card-bg);border-radius:0;box-shadow:0 4px 20px #00000014;padding:0;border:1px solid var(--border);border-top:none;display:flex;flex-direction:column;overflow:visible}.page-card .page-body{background:var(--editor-bg);min-height:1000px;padding:64px 96px;border-radius:0;box-shadow:none;border:none;color:#202124;overflow-wrap:break-word;word-wrap:break-word;overflow:visible;flex:1;font-size:16px;line-height:1.6;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;outline:none;cursor:text}.page-card.size-a4{width:794px;min-height:1123px}.page-card.size-letter{width:816px;min-height:1056px}.page-card.size-a3{width:1122px;min-height:1587px}.page-card.size-legal{width:816px;min-height:1344px}.page-card.size-custom{width:900px;min-height:1200px}.page-card{display:block;box-sizing:border-box}.page-card .page-body{height:auto;overflow:visible}.page-card .page-body table{width:100%;max-width:100%;table-layout:fixed;border-collapse:collapse}.page-card .page-body *{max-width:100%}.page-card .page-body th,.page-card .page-body td{white-space:normal;word-break:break-word;box-sizing:border-box}@media(max-width:1300px){.page-card.size-a3{width:calc(100% - 48px);height:auto}}@media(max-width:1000px){.page-card.size-a4,.page-card.size-letter,.page-card.size-legal,.page-card.size-custom{width:calc(100% - 48px);height:auto}.page-card .page-body{padding:32px 48px}}@media(max-width:768px){.page-card{width:calc(100% - 24px)!important}.page-card .page-body{padding:24px 32px}}.page-size-select{height:36px;padding:6px 10px;border-radius:8px;border:1px solid var(--border);background:#fff;color:var(--text-color);font-weight:600;margin-right:8px}.page-card .page-body h1{font-size:40px;font-weight:700;line-height:1.2;margin:24px 0 16px;color:#202124;letter-spacing:-.5px}.page-card .page-body h1 .page-card .page-body thead th{background:#0f172a88;color:#fff}.page-card .page-body h2{font-size:32px;font-weight:700;line-height:1.3;margin:20px 0 12px;color:#202124;letter-spacing:-.3px}.page-card .page-body h3{font-size:24px;font-weight:600;line-height:1.4;margin:16px 0 10px;color:#202124}.page-card .page-body h4{font-size:20px;font-weight:600;line-height:1.4;margin:14px 0 8px;color:#202124}.page-card .page-body p{margin:0 0 12px;line-height:1.6;color:#3c4043}.page-card .page-body[data-placeholder]:empty:before{content:attr(data-placeholder);color:#9aa0a6;font-style:italic;pointer-events:none;position:absolute}.page-card .page-body strong,.page-card .page-body b{font-weight:700;color:#202124}.page-card .page-body em,.page-card .page-body i{font-style:italic}.page-card .page-body ul,.page-card .page-body ol{margin:12px 0;padding-left:28px}.page-card .page-body li{margin:6px 0;line-height:1.6;color:#3c4043}.editor-content:focus{outline:none;background:var(--editor-bg)}.editor-content p{margin:0 0 16px;transition:color .2s ease}.editor-content h3,.editor-content h4,.editor-content h5,.editor-content h6{color:var(--text-color);margin:24px 0 16px;font-weight:700;transition:color .2s ease}.editor-content a{color:var(--accent);text-decoration:underline}.page-card .page-body a{color:#1d4ed8;text-decoration:underline;cursor:pointer}.page-card .page-body a:hover{opacity:.92}.page-card .page-body a[contenteditable=false]{cursor:pointer}.editable-image-wrap{position:relative;display:inline-block;margin:4px;max-width:100%;vertical-align:top;width:fit-content}.editable-image-wrap.selected{outline:3px solid #3b82f6;outline-offset:2px;box-shadow:0 0 0 1px #3b82f633}.editable-image-wrap img{display:block;max-width:100%;height:auto}.image-resize-handle{position:absolute;width:12px;height:12px;background:#3b82f6;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 6px #0003;z-index:20;display:none}.editable-image-wrap.selected .image-resize-handle{display:block}.image-resize-handle.nw{top:-6px;left:-6px;cursor:nw-resize}.image-resize-handle.ne{top:-6px;right:-6px;cursor:ne-resize}.image-resize-handle.sw{bottom:-6px;left:-6px;cursor:sw-resize}.image-resize-handle.se{bottom:-6px;right:-6px;cursor:se-resize}.image-resize-handle:hover{background:#2563eb;transform:scale(1.2)}.image-controls{position:absolute;bottom:-44px;left:50%;transform:translate(-50%);display:none;gap:4px;background:#fff;border:1px solid #cbd5e1;padding:6px 8px;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:100;white-space:nowrap}.editable-image-wrap.selected .image-controls{display:flex}.image-control-btn{min-width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;font-weight:600;font-size:11px;background:#fff;border:1px solid #e5e7eb;border-radius:4px;cursor:pointer;color:#374151;transition:all .15s ease;padding:0 8px}.image-control-btn:hover{background:#3b82f6;color:#fff;border-color:#3b82f6;transform:translateY(-1px);box-shadow:0 2px 6px #0000001a}.image-control-btn svg{width:14px;height:14px}.image-control-divider{width:1px;height:24px;background:#e5e7eb;margin:0 4px}.editor-content img{max-width:100%;height:auto;border-radius:6px;margin:12px 0}.editor-content hr{border:none;border-top:1px solid var(--border);margin:20px 0}.editor-content blockquote{border-left:4px solid var(--border);padding-left:12px;color:var(--muted);font-style:italic}.editor-content code{background:var(--surface-1);color:var(--text-color);padding:3px 6px;border-radius:4px;font-family:Monaco,Menlo,monospace}.editor-content table{border-collapse:collapse;width:100%;margin:16px 0;background:var(--editor-bg);border-radius:0;overflow:visible;box-shadow:none;position:relative}.editor-content table th{background:#f8f9fa;color:var(--text-color);font-weight:700;text-align:left;padding:12px 16px;border:1px solid #cbd5e1;font-size:14px}.editor-content table td{padding:12px 16px;border:1px solid #cbd5e1;color:var(--text-color);background:#fff;font-size:14px}.editor-content table tr:hover td{background:#fefce8}.editable-table-wrap{position:relative;margin:20px 0;display:inline-block;min-width:200px}.editable-table-wrap.selected{outline:3px solid #fbbf24;outline-offset:2px;box-shadow:0 0 0 1px #fbbf2433}.table-resize-handle{position:absolute;width:14px;height:14px;background:#fbbf24;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 6px #0003;cursor:nwse-resize;z-index:20;display:none}.editable-table-wrap.selected .table-resize-handle{display:block}.table-resize-handle.nw{top:-7px;left:-7px;cursor:nw-resize}.table-resize-handle.ne{top:-7px;right:-7px;cursor:ne-resize}.table-resize-handle.sw{bottom:-7px;left:-7px;cursor:sw-resize}.table-resize-handle.se{bottom:-7px;right:-7px;cursor:se-resize}.table-resize-handle:hover{background:#f59e0b;transform:scale(1.2)}.table-controls{position:absolute;top:-48px;left:0;display:none;gap:4px;background:#fff;border:1px solid #cbd5e1;padding:6px;border-radius:6px;box-shadow:0 4px 12px #0000001a;z-index:100}.editable-table-wrap.selected .table-controls{display:flex}.table-control-btn{min-width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;font-weight:600;font-size:11px;background:#fff;border:1px solid #e5e7eb;border-radius:4px;cursor:pointer;color:#374151;transition:all .15s ease}.table-control-btn:hover{background:#fbbf24;color:#fff;border-color:#fbbf24;transform:translateY(-1px);box-shadow:0 2px 6px #0000001a}.editor-content pre{background:#0b0b0b;color:#f7f7f7;padding:16px;border-radius:8px;overflow-x:auto;margin:16px 0}.editor-content pre code{background:none;color:inherit;padding:0;font-family:Monaco,Menlo,monospace}.editor-footer,.status-bar,.status-item{display:none}.status-bar-bottom{display:flex;gap:12px;padding:12px 24px;background:#f8f9fa;border-top:1px solid #e0e0e0;font-size:13px;color:#5f6368;justify-content:flex-end;width:100%;box-sizing:border-box;position:relative;bottom:0;left:0;z-index:10}.status-bar-bottom .status-item{display:inline;white-space:nowrap;padding:0;background:none;border:none}.status-item:hover{transform:translateY(-2px);box-shadow:0 4px 8px #0000000f}.editor-content::-webkit-scrollbar,.modal-body::-webkit-scrollbar{width:12px}.editor-content::-webkit-scrollbar-track,.modal-body::-webkit-scrollbar-track{background:#f3f4f6;border-radius:6px}.editor-content::-webkit-scrollbar-thumb,.modal-body::-webkit-scrollbar-thumb{background:#9aa3ad;border-radius:6px;border:2px solid #f3f4f6}.modal-overlay,.link-modal-overlay{position:fixed;inset:0;background:#00000080;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000;animation:rte-fadeIn .18s ease}@keyframes rte-fadeIn{0%{opacity:0}to{opacity:1}}.modal-content{background:var(--card-bg);border-radius:12px;box-shadow:0 25px 50px -12px #00000040;width:90%;max-width:680px;max-height:90vh;overflow:hidden;display:flex;flex-direction:column;animation:rte-slideUp .28s ease}@keyframes rte-slideUp{0%{transform:translateY(12px);opacity:0}to{transform:translateY(0);opacity:1}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:18px 20px;background:var(--header-bg);color:#fff}.modal-header h3{margin:0;font-size:18px;font-weight:600}.modal-close{background:#ffffff0f;border:1px solid rgba(255,255,255,.08);color:#fff;width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;cursor:pointer}.modal-close:hover{background:#ffffff1f;transform:rotate(90deg)}.modal-body{padding:20px;overflow-y:auto;flex:1}.modal-footer{display:flex;justify-content:flex-end;gap:12px;padding:16px 20px;background:var(--surface-1);border-top:1px solid var(--border)}.form-group{margin-bottom:16px}.form-group label{display:block;margin-bottom:8px;font-weight:600;color:var(--muted);font-size:14px}.form-input{width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:8px;font-size:15px;font-family:inherit}.form-input:focus{outline:none;box-shadow:0 0 0 4px #0000000a;border-color:var(--border)}.btn-primary{padding:10px 20px;background:var(--inverse-bg);color:#fff;border:none;border-radius:8px;font-weight:600;cursor:pointer}.btn-primary:hover{transform:translateY(-2px);box-shadow:0 6px 12px #00000014}.btn-secondary{padding:10px 20px;background:var(--editor-bg);color:var(--text-color);border:1px solid var(--border);border-radius:8px;cursor:pointer}.html-preview{background:#0b0b0b;color:#f7f7f7;padding:16px;border-radius:8px;overflow-x:auto;font-size:13px;font-family:Monaco,Menlo,monospace;white-space:pre-wrap;word-break:break-all}.editor-content::selection{background:#11182714;color:var(--text-color)}.table-size-picker{position:absolute;top:calc(100% + 4px);left:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:12px;box-shadow:0 10px 25px #0000001a,0 4px 8px #0000000f;z-index:2000;display:none}.table-size-picker.show{display:block}.table-size-grid{display:grid;gap:2px;cursor:pointer}.table-drag-handle{width:18px;height:18px;border-radius:4px;background:#0000000f;position:absolute;top:8px;left:8px;display:flex;align-items:center;justify-content:center;cursor:grab;z-index:1500}.table-drag-handle:active{cursor:grabbing}.table-context-menu{position:absolute;right:8px;top:36px;background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:8px;box-shadow:0 8px 30px #0000001f;display:flex;flex-direction:column;gap:6px;min-width:160px;z-index:2000}.table-context-menu button{background:transparent;border:none;text-align:left;padding:8px 10px;border-radius:6px;cursor:pointer}.table-context-menu button:hover{background:#f3f4f6}.table-context-menu hr{border:none;height:1px;background:#eef2f7;margin:6px 0}.table-cell-preview{width:18px;height:18px;border:1px solid #d1d5db;background:#fff;transition:all .1s;border-radius:2px}.table-cell-preview.hover{background:#3b82f6;border-color:#2563eb}.table-size-label{text-align:center;margin-top:8px;font-size:12px;color:#6b7280;font-weight:600}.page-card .page-body td.selected-cell,.page-card .page-body th.selected-cell{outline:2px solid rgba(59,130,246,.9);background:#3b82f60f}.find-replace-modal{background:#fff;padding:24px;border-radius:12px;box-shadow:0 20px 50px #00000026;max-width:450px;width:90%}.find-replace-modal h3{margin:0 0 20px;font-size:18px;color:#1e293b;font-weight:700}.find-replace-group{margin-bottom:16px}.find-replace-group label{display:block;margin-bottom:6px;font-size:13px;color:#475569;font-weight:600}.find-replace-input{width:100%;padding:8px 12px;border:1px solid #cbd5e1;border-radius:6px;font-size:14px;transition:all .15s ease}.find-replace-input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.find-replace-buttons{display:flex;gap:8px;margin-top:20px;flex-wrap:wrap}.find-replace-btn{padding:8px 16px;border-radius:6px;font-size:13px;font-weight:600;cursor:pointer;border:1px solid #cbd5e1;background:#fff;color:#374151;transition:all .15s}.find-replace-btn:hover{background:#f8fafc;border-color:#94a3b8}.find-replace-btn.primary{background:#3b82f6;color:#fff;border-color:#3b82f6}.find-replace-btn.primary:hover{background:#2563eb;border-color:#2563eb}.find-replace-status{margin-top:12px;font-size:13px;color:#64748b;min-height:18px;font-weight:500}.editor-content::-moz-selection{background:#11182714;color:var(--text-color)}@keyframes editorFadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideDown{0%{transform:translateY(-20px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes slideUp{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes fadeInLeft{0%{transform:translate(-20px);opacity:0}to{transform:translate(0);opacity:1}}@keyframes fadeInRight{0%{transform:translate(20px);opacity:0}to{transform:translate(0);opacity:1}}@keyframes fadeInUp{0%{transform:translateY(30px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes pulse{0%,to{opacity:.5}50%{opacity:.8}}@media(max-width:1024px){.editor-content{padding:40px 60px}.editor-header,.editor-toolbar,.editor-footer{padding-left:24px;padding-right:24px}}@media(max-width:768px){.editor-container{margin:0}.editor-header{flex-direction:column;gap:12px;align-items:flex-start;padding:16px 20px}.editor-title{font-size:18px}.action-btn span{display:none}.action-btn{padding:8px;min-width:40px}.editor-toolbar{padding:12px 20px;top:auto;position:relative}.toolbar-group{padding:2px}.toolbar-btn{width:38px;height:38px}.toolbar-select{min-width:110px;height:38px;font-size:13px}.color-picker-wrapper{width:38px;height:38px}.editor-content{padding:24px 20px;min-height:400px;font-size:16px}.editor-footer{padding:12px 20px;position:relative}.modal-content{width:95%;max-width:620px}}@media print{.editor-header,.editor-toolbar,.editor-footer{display:none}.editor-container{box-shadow:none;border:none}.editor-content{max-height:none}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daneshnaik/rich-text-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A powerful and feature-rich WYSIWYG rich text editor for React with table editing, image handling, and extensive formatting options",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/rich-text-editor.umd.cjs",
|