scrible 1.0.0

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.
@@ -0,0 +1,7 @@
1
+ (function(p,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("slate"),require("slate-react"),require("slate-history"),require("escape-html")):typeof define=="function"&&define.amd?define(["exports","react","slate","slate-react","slate-history","escape-html"],g):(p=typeof globalThis<"u"?globalThis:p||self,g(p.Scrible={},p.React,p.Slate,p.SlateReact,p.SlateHistory,p.escapeHtml))})(this,(function(p,g,l,T,ze,H){"use strict";var D={exports:{}},_={};var te;function Me(){if(te)return _;te=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(s,o,c){var i=null;if(c!==void 0&&(i=""+c),o.key!==void 0&&(i=""+o.key),"key"in o){c={};for(var u in o)u!=="key"&&(c[u]=o[u])}else c=o;return o=c.ref,{$$typeof:e,type:s,key:i,ref:o!==void 0?o:null,props:c}}return _.Fragment=t,_.jsx=r,_.jsxs=r,_}var L={};var re;function Re(){return re||(re=1,process.env.NODE_ENV!=="production"&&(function(){function e(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===Ct?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case N:return"Fragment";case M:return"Profiler";case C:return"StrictMode";case wt:return"Suspense";case jt:return"SuspenseList";case yt:return"Activity"}if(typeof a=="object")switch(typeof a.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),a.$$typeof){case z:return"Portal";case xt:return a.displayName||"Context";case G:return(a._context.displayName||"Context")+".Consumer";case kt:var f=a.render;return a=a.displayName,a||(a=f.displayName||f.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case Et:return f=a.displayName||null,f!==null?f:e(a.type)||"Memo";case K:f=a._payload,a=a._init;try{return e(a(f))}catch{}}return null}function t(a){return""+a}function r(a){try{t(a);var f=!1}catch{f=!0}if(f){f=console;var x=f.error,w=typeof Symbol=="function"&&Symbol.toStringTag&&a[Symbol.toStringTag]||a.constructor.name||"Object";return x.call(f,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",w),t(a)}}function s(a){if(a===N)return"<>";if(typeof a=="object"&&a!==null&&a.$$typeof===K)return"<...>";try{var f=e(a);return f?"<"+f+">":"<...>"}catch{return"<...>"}}function o(){var a=Q.A;return a===null?null:a.getOwner()}function c(){return Error("react-stack-top-frame")}function i(a){if(je.call(a,"key")){var f=Object.getOwnPropertyDescriptor(a,"key").get;if(f&&f.isReactWarning)return!1}return a.key!==void 0}function u(a,f){function x(){Ee||(Ee=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",f))}x.isReactWarning=!0,Object.defineProperty(a,"key",{get:x,configurable:!0})}function h(){var a=e(this.type);return ye[a]||(ye[a]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),a=this.props.ref,a!==void 0?a:null}function v(a,f,x,w,Y,q){var j=x.ref;return a={$$typeof:y,type:a,key:f,props:x,_owner:w},(j!==void 0?j:null)!==null?Object.defineProperty(a,"ref",{enumerable:!1,get:h}):Object.defineProperty(a,"ref",{enumerable:!1,value:null}),a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(a,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(a,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.defineProperty(a,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a}function k(a,f,x,w,Y,q){var j=f.children;if(j!==void 0)if(w)if(Tt(j)){for(w=0;w<j.length;w++)m(j[w]);Object.freeze&&Object.freeze(j)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(j);if(je.call(f,"key")){j=e(a);var A=Object.keys(f).filter(function(Nt){return Nt!=="key"});w=0<A.length?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}",Ne[j+w]||(A=0<A.length?"{"+A.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
+ let props = %s;
3
+ <%s {...props} />
4
+ React keys must be passed directly to JSX without using spread:
5
+ let props = %s;
6
+ <%s key={someKey} {...props} />`,w,j,A,j),Ne[j+w]=!0)}if(j=null,x!==void 0&&(r(x),j=""+x),i(f)&&(r(f.key),j=""+f.key),"key"in f){x={};for(var ee in f)ee!=="key"&&(x[ee]=f[ee])}else x=f;return j&&u(x,typeof a=="function"?a.displayName||a.name||"Unknown":a),v(a,j,x,o(),Y,q)}function m(a){d(a)?a._store&&(a._store.validated=1):typeof a=="object"&&a!==null&&a.$$typeof===K&&(a._payload.status==="fulfilled"?d(a._payload.value)&&a._payload.value._store&&(a._payload.value._store.validated=1):a._store&&(a._store.validated=1))}function d(a){return typeof a=="object"&&a!==null&&a.$$typeof===y}var b=g,y=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),xt=Symbol.for("react.context"),kt=Symbol.for("react.forward_ref"),wt=Symbol.for("react.suspense"),jt=Symbol.for("react.suspense_list"),Et=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),yt=Symbol.for("react.activity"),Ct=Symbol.for("react.client.reference"),Q=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,je=Object.prototype.hasOwnProperty,Tt=Array.isArray,Z=console.createTask?console.createTask:function(){return null};b={react_stack_bottom_frame:function(a){return a()}};var Ee,ye={},Ce=b.react_stack_bottom_frame.bind(b,c)(),Te=Z(s(c)),Ne={};L.Fragment=N,L.jsx=function(a,f,x){var w=1e4>Q.recentlyCreatedOwnerStacks++;return k(a,f,x,!1,w?Error("react-stack-top-frame"):Ce,w?Z(s(a)):Te)},L.jsxs=function(a,f,x){var w=1e4>Q.recentlyCreatedOwnerStacks++;return k(a,f,x,!0,w?Error("react-stack-top-frame"):Ce,w?Z(s(a)):Te)}})()),L}var ne;function Se(){return ne||(ne=1,process.env.NODE_ENV==="production"?D.exports=Me():D.exports=Re()),D.exports}var n=Se();const R=(e,t)=>{const r=S(e,t);if(t.startsWith("font-size-")){l.Editor.removeMark(e,"font-size-small"),l.Editor.removeMark(e,"font-size-normal"),l.Editor.removeMark(e,"font-size-large"),l.Editor.removeMark(e,"font-size-extra-large"),r||l.Editor.addMark(e,t,!0);return}r?l.Editor.removeMark(e,t):l.Editor.addMark(e,t,!0)},S=(e,t)=>{const r=l.Editor.marks(e);return r?r[t]===!0:!1},O=(e,t)=>{t?l.Editor.addMark(e,"color",t):l.Editor.removeMark(e,"color")},se=e=>l.Editor.marks(e)?.color||null,B=(e,t)=>{t?l.Editor.addMark(e,"backgroundColor",t):l.Editor.removeMark(e,"backgroundColor")},oe=e=>l.Editor.marks(e)?.backgroundColor||null,V=(e,t)=>{const r=F(e,t),s=ae.includes(t);l.Transforms.unwrapNodes(e,{match:c=>!l.Editor.isEditor(c)&&l.Element.isElement(c)&&ae.includes(c.type),split:!0});let o;if(r?o={type:"paragraph"}:s?o={type:"list-item"}:o={type:t},l.Transforms.setNodes(e,o),!r&&s){const c={type:t,children:[]};l.Transforms.wrapNodes(e,c)}},I=(e,t)=>{l.Transforms.setNodes(e,{align:t},{match:r=>l.Element.isElement(r)&&l.Editor.isBlock(e,r),split:!0})},F=(e,t,r="type")=>{const{selection:s}=e;if(!s)return!1;const[o]=Array.from(l.Editor.nodes(e,{at:l.Editor.unhangRange(e,s),match:c=>!l.Editor.isEditor(c)&&l.Element.isElement(c)&&c[r]===t}));return!!o},ae=["numbered-list","bulleted-list"],$=(e,t,r="")=>{const o={type:"image",url:t,alt:r,width:"auto",height:"auto",children:[{text:""}]};l.Transforms.insertNodes(e,o),l.Transforms.insertNodes(e,{type:"paragraph",children:[{text:""}]})},le=e=>{if(!e||!Ae(e))return!1;const t=new URL(e).pathname.split(".").pop();return["jpg","jpeg","png","gif","webp","svg"].includes(t.toLowerCase())},Ae=e=>{try{return new URL(e),!0}catch{return!1}},ie=(e,t)=>{e.selection&&ce(e,t)},ce=(e,t)=>{de(e)&&ue(e);const{selection:r}=e,s=r&&l.Range.isCollapsed(r),o={type:"link",url:t,children:s?[{text:t}]:[]};s?l.Transforms.insertNodes(e,o):(l.Transforms.wrapNodes(e,o,{split:!0}),l.Transforms.collapse(e,{edge:"end"}))},ue=e=>{l.Transforms.unwrapNodes(e,{match:t=>!l.Editor.isEditor(t)&&l.Element.isElement(t)&&t.type==="link"})},de=e=>{const[t]=l.Editor.nodes(e,{match:r=>!l.Editor.isEditor(r)&&l.Element.isElement(r)&&r.type==="link"});return!!t},X=(e,t=3,r=3)=>{const s=_e(t,r);l.Transforms.insertNodes(e,s);const c=[...l.Editor.path(e,e.selection.anchor),0,0,0];l.Transforms.select(e,c)},_e=(e,t)=>{const r=(o=!1)=>({type:"table-cell",header:o,children:[{type:"paragraph",children:[{text:""}]}]}),s=(o=!1)=>({type:"table-row",children:Array.from({length:t},()=>r(o))});return{type:"table",children:[s(!0),...Array.from({length:e-1},()=>s(!1))]}},Le=e=>{const[t]=l.Editor.nodes(e,{match:r=>r.type==="table"});if(t){const[,r]=t,[s]=l.Editor.nodes(e,{match:o=>o.type==="table-row"});if(s){const[o]=s,c={type:"table-row",children:o.children.map(()=>({type:"table-cell",children:[{type:"paragraph",children:[{text:""}]}]}))},i=[...r,t[0].children.length];l.Transforms.insertNodes(e,c,{at:i})}}},Ie=e=>{const[t]=l.Editor.nodes(e,{match:r=>r.type==="table"});if(t){const[r,s]=t;r.children.forEach((o,c)=>{const i={type:"table-cell",children:[{type:"paragraph",children:[{text:""}]}]},u=[...s,c,o.children.length];l.Transforms.insertNodes(e,i,{at:u})})}},Pe=e=>{const[t]=l.Editor.nodes(e,{match:r=>r.type==="table-row"});t&&l.Transforms.removeNodes(e,{match:r=>r.type==="table-row"})},He=e=>{const[t]=l.Editor.nodes(e,{match:r=>r.type==="table-cell"});if(t){const[,r]=t,s=r[r.length-1],[o]=l.Editor.nodes(e,{match:c=>c.type==="table"});if(o){const[c,i]=o;for(let u=c.children.length-1;u>=0;u--){const h=[...i,u,s];l.Transforms.removeNodes(e,{at:h})}}}},De=e=>{const[t]=l.Editor.nodes(e,{match:r=>l.Element.isElement(r)&&l.Editor.isBlock(e,r)});return t?t[0].type:"paragraph"},Oe=e=>{const t=l.Editor.marks(e);return t?.["font-size-small"]?"small":t?.["font-size-large"]?"large":t?.["font-size-extra-large"]?"extra-large":"normal"},U=e=>{const[t]=l.Editor.nodes(e,{match:r=>l.Element.isElement(r)&&l.Editor.isBlock(e,r)});return t&&t[0].align?t[0].align:"left"},Be=e=>{l.Transforms.delete(e,{at:{anchor:l.Editor.start(e,[]),focus:l.Editor.end(e,[])}}),l.Transforms.select(e,l.Editor.start(e,[]))},E=({active:e,children:t,onMouseDown:r,title:s,className:o="",...c})=>n.jsx("button",{className:`toolbar-button ${e?"active":""} ${o}`,onMouseDown:i=>{i.preventDefault(),r&&r()},title:s,...c,children:t}),he=({value:e,onChange:t,children:r,title:s,...o})=>n.jsx("select",{className:"toolbar-select",value:e,onChange:c=>t(c.target.value),title:s,...o,children:r}),Ve=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"})}),Fe=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"})}),Ue=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"})}),We=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"})}),Ye=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z"})}),$e=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"})}),Xe=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"})}),Je=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"})}),Ge=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"})}),Ke=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V7H3v2zm0-6v2h18V3H3z"})}),Qe=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"})}),Ze=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"})}),qe=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5v11zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2zM3 19c0 1.1.9 2 2 2h3V10H3v9z"})}),et=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})}),tt=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"})}),rt=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M16.56 8.94L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12zM5.21 10L10 5.21 14.79 10H5.21zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5z"})}),fe=({editor:e,type:t="text"})=>{const[r,s]=g.useState(!1),[o,c]=g.useState(""),i=t==="text",u=i?se(e):oe(e),h=["#000000","#374151","#6b7280","#9ca3af","#d1d5db","#ffffff","#ef4444","#f97316","#f59e0b","#eab308","#84cc16","#22c55e","#10b981","#14b8a6","#06b6d4","#0ea5e9","#3b82f6","#6366f1","#8b5cf6","#a855f7","#d946ef","#ec4899","#f43f5e","#fb7185"],v=g.useCallback(d=>{i?O(e,d):B(e,d),s(!1)},[e,i]),k=g.useCallback(d=>{const b=d.target.value;c(b),i?O(e,b):B(e,b)},[e,i]),m=g.useCallback(()=>{i?O(e,null):B(e,null),s(!1)},[e,i]);return g.useEffect(()=>{if(!r)return;const d=b=>{b.target.closest(".color-picker-dropdown")||s(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[r]),n.jsxs("div",{className:"color-picker-dropdown",children:[n.jsxs("button",{className:"toolbar-button color-picker-button",onMouseDown:d=>{d.preventDefault(),s(!r)},title:i?"Text Color":"Background Color",style:{position:"relative"},children:[i?n.jsx(tt,{}):n.jsx(rt,{}),u&&n.jsx("div",{className:"color-indicator",style:{backgroundColor:u,position:"absolute",bottom:"4px",left:"50%",transform:"translateX(-50%)",width:"20px",height:"3px",borderRadius:"2px"}})]}),r&&n.jsxs("div",{className:"color-picker-panel",children:[n.jsx("div",{className:"color-picker-presets",children:h.map(d=>n.jsx("button",{className:`color-swatch ${u===d?"active":""}`,style:{backgroundColor:d},onClick:b=>{b.stopPropagation(),v(d)},title:d},d))}),n.jsx("div",{className:"color-picker-custom",children:n.jsxs("label",{className:"color-picker-label",children:["Custom Color:",n.jsx("input",{type:"color",value:o||u||"#000000",onChange:k,className:"color-picker-input"})]})}),u&&n.jsx("button",{className:"color-picker-remove",onClick:d=>{d.stopPropagation(),m()},children:"Remove Color"})]})]})},nt=({editor:e})=>{const[t,r]=g.useState(!1),[s,o]=g.useState({row:0,col:0}),c=g.useCallback((i,u)=>{X(e,i+1,u+1),r(!1),o({row:0,col:0})},[e]);return g.useEffect(()=>{if(!t)return;const i=u=>{u.target.closest(".table-dropdown")||r(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[t]),n.jsxs("div",{className:"table-dropdown",children:[n.jsx("button",{className:"toolbar-button",onMouseDown:i=>{i.preventDefault(),r(!t)},title:"Insert Table",children:n.jsx(qe,{})}),t&&n.jsxs("div",{className:"table-size-selector",children:[n.jsx("div",{className:"table-grid",children:Array.from({length:6},(i,u)=>Array.from({length:6},(h,v)=>n.jsx("div",{className:`table-cell-selector ${u<=s.row&&v<=s.col?"active":""}`,onMouseEnter:()=>o({row:u,col:v}),onClick:k=>{k.stopPropagation(),c(u,v)}},`${u}-${v}`)))}),n.jsxs("div",{className:"table-size-label",children:[s.row+1," × ",s.col+1]})]})]})},st=({features:e=["bold","italic","underline","strikethrough","headings","lists","alignment","fontSize","textColor","backgroundColor","link","image","table","clear"]})=>{const t=T.useSlate(),r=g.useRef(),s=i=>e.includes(i),o=i=>{const u=i.target.files[0];if(u&&u.type.startsWith("image/")){const h=new FileReader;h.onload=v=>{$(t,v.target.result)},h.readAsDataURL(u)}i.target.value=""},c=()=>{const i=window.prompt("Enter the URL:");i&&ie(t,i)};return n.jsxs("div",{className:"toolbar",children:[(s("bold")||s("italic")||s("underline")||s("strikethrough"))&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"toolbar-group",children:[s("bold")&&n.jsx(E,{active:S(t,"bold"),onMouseDown:()=>R(t,"bold"),title:"Bold (Ctrl+B)",children:n.jsx(Ve,{})}),s("italic")&&n.jsx(E,{active:S(t,"italic"),onMouseDown:()=>R(t,"italic"),title:"Italic (Ctrl+I)",children:n.jsx(Fe,{})}),s("underline")&&n.jsx(E,{active:S(t,"underline"),onMouseDown:()=>R(t,"underline"),title:"Underline (Ctrl+U)",children:n.jsx(Ue,{})}),s("strikethrough")&&n.jsx(E,{active:S(t,"strikethrough"),onMouseDown:()=>R(t,"strikethrough"),title:"Strikethrough",children:n.jsx(We,{})})]}),n.jsx("div",{className:"toolbar-separator"})]}),s("headings")&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"toolbar-group",children:n.jsxs(he,{value:De(t),onChange:i=>V(t,i),children:[n.jsx("option",{value:"paragraph",children:"Paragraph"}),n.jsx("option",{value:"heading-one",children:"Heading 1"}),n.jsx("option",{value:"heading-two",children:"Heading 2"}),n.jsx("option",{value:"heading-three",children:"Heading 3"}),n.jsx("option",{value:"blockquote",children:"Quote"})]})}),n.jsx("div",{className:"toolbar-separator"})]}),s("lists")&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"toolbar-group",children:[n.jsx(E,{active:F(t,"bulleted-list"),onMouseDown:()=>V(t,"bulleted-list"),title:"Bulleted List",children:n.jsx(Ye,{})}),n.jsx(E,{active:F(t,"numbered-list"),onMouseDown:()=>V(t,"numbered-list"),title:"Numbered List",children:n.jsx($e,{})})]}),n.jsx("div",{className:"toolbar-separator"})]}),s("alignment")&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"toolbar-group",children:[n.jsx(E,{active:U(t)==="left",onMouseDown:()=>I(t,"left"),title:"Align Left",children:n.jsx(Xe,{})}),n.jsx(E,{active:U(t)==="center",onMouseDown:()=>I(t,"center"),title:"Align Center",children:n.jsx(Je,{})}),n.jsx(E,{active:U(t)==="right",onMouseDown:()=>I(t,"right"),title:"Align Right",children:n.jsx(Ge,{})}),n.jsx(E,{active:U(t)==="justify",onMouseDown:()=>I(t,"justify"),title:"Justify",children:n.jsx(Ke,{})})]}),n.jsx("div",{className:"toolbar-separator"})]}),s("fontSize")&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"toolbar-group",children:n.jsxs(he,{value:Oe(t),onChange:i=>R(t,`font-size-${i}`),title:"Font Size",children:[n.jsx("option",{value:"small",children:"Small"}),n.jsx("option",{value:"normal",children:"Normal"}),n.jsx("option",{value:"large",children:"Large"}),n.jsx("option",{value:"extra-large",children:"Extra Large"})]})}),n.jsx("div",{className:"toolbar-separator"})]}),(s("textColor")||s("backgroundColor"))&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"toolbar-group",children:[s("textColor")&&n.jsx(fe,{editor:t,type:"text"}),s("backgroundColor")&&n.jsx(fe,{editor:t,type:"background"})]}),n.jsx("div",{className:"toolbar-separator"})]}),(s("link")||s("image")||s("table"))&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"toolbar-group",children:[s("link")&&n.jsx(E,{onMouseDown:c,title:"Insert Link",children:n.jsx(Qe,{})}),s("image")&&n.jsx(E,{onMouseDown:()=>r.current?.click(),title:"Insert Image",children:n.jsx(Ze,{})}),s("table")&&n.jsx(nt,{editor:t})]}),n.jsx("div",{className:"toolbar-separator"})]}),s("clear")&&n.jsx("div",{className:"toolbar-group",children:n.jsx(E,{onMouseDown:()=>Be(t),title:"Clear All Content",className:"clear-button",children:n.jsx(et,{})})}),n.jsx("input",{ref:r,type:"file",accept:"image/*",onChange:o,style:{display:"none"}})]})},ot=({attributes:e,children:t,element:r,editor:s})=>{const o=T.useSelected(),c=T.useFocused(),[i,u]=g.useState(!1),h=g.useRef(),v=g.useCallback(d=>{d.preventDefault(),d.stopPropagation(),u(!0);const b=d.clientX,y=h.current.offsetWidth;h.current.naturalHeight/h.current.naturalWidth;const z=C=>{const M=C.clientX-b,G=Math.max(100,Math.min(1200,y+M));h.current.style.width=`${G}px`,h.current.style.height="auto"},N=()=>{u(!1);const C=h.current.offsetWidth;try{const M=T.ReactEditor.findPath(s,r);l.Transforms.setNodes(s,{width:C,height:"auto"},{at:M})}catch(M){console.warn("Could not update image dimensions:",M)}document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",N)};document.addEventListener("mousemove",z),document.addEventListener("mouseup",N)},[s,r]),k=g.useCallback(d=>{d.preventDefault(),d.stopPropagation();try{const b=T.ReactEditor.findPath(s,r);l.Transforms.removeNodes(s,{at:b})}catch(b){console.warn("Could not delete image:",b)}},[s,r]),m=r.width||300;return n.jsxs("div",{...e,children:[t,n.jsx("div",{contentEditable:!1,className:`image-container ${o&&c?"selected":""}`,style:{display:"block",position:"relative",margin:"16px 0",textAlign:"center"},children:n.jsxs("div",{style:{display:"inline-block",position:"relative"},children:[n.jsx("img",{ref:h,src:r.url,alt:r.alt||"",className:"resizable-image",style:{width:`${m}px`,height:"auto",maxWidth:"100%",display:"block",borderRadius:"4px",boxShadow:o&&c?"0 0 0 3px #3b82f6":"0 1px 3px rgba(0, 0, 0, 0.1)",transition:i?"none":"box-shadow 0.15s ease",userSelect:"none"},draggable:!1}),o&&c&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"resize-handle",onMouseDown:v,style:{position:"absolute",bottom:"-6px",right:"-6px",width:"16px",height:"16px",background:"#3b82f6",border:"2px solid white",cursor:"nwse-resize",borderRadius:"50%",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.3)",zIndex:10}}),n.jsx("button",{className:"delete-button",onMouseDown:k,title:"Delete image",type:"button",style:{position:"absolute",top:"-10px",right:"-10px",width:"24px",height:"24px",background:"#ef4444",color:"white",border:"none",borderRadius:"50%",cursor:"pointer",fontSize:"18px",fontWeight:"bold",lineHeight:"1",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.3)",zIndex:11,padding:0},children:"×"})]})]})})]})},at=({attributes:e,children:t,element:r})=>{const s={textAlign:r.align};switch(r.type){case"heading-one":return n.jsx("h1",{...e,style:s,className:"heading-one",children:t});case"heading-two":return n.jsx("h2",{...e,style:s,className:"heading-two",children:t});case"heading-three":return n.jsx("h3",{...e,style:s,className:"heading-three",children:t});case"blockquote":return n.jsx("blockquote",{...e,style:s,className:"blockquote",children:t});case"bulleted-list":return n.jsx("ul",{...e,style:s,className:"bulleted-list",children:t});case"numbered-list":return n.jsx("ol",{...e,style:s,className:"numbered-list",children:t});case"list-item":return n.jsx("li",{...e,className:"list-item",children:t});case"link":return n.jsx("a",{...e,href:r.url,className:"link",children:t});case"image":return n.jsx(ot,{attributes:e,children:t,element:r,editor:T.useSlate()});case"table":return n.jsx("div",{...e,className:"table-container",children:n.jsx("table",{className:"simple-table",children:n.jsx("tbody",{children:t})})});case"table-row":return n.jsx("tr",{...e,className:"table-row",children:t});case"table-cell":return n.jsx("td",{...e,className:`table-cell ${r.header?"table-header-cell":""}`,children:t});default:return n.jsx("p",{...e,style:s,className:"paragraph",children:t})}},lt=({attributes:e,children:t,leaf:r})=>{let s="",o={};return r.bold&&(s+=" bold"),r.italic&&(s+=" italic"),r.underline&&(s+=" underline"),r.strikethrough&&(s+=" strikethrough"),r["font-size-small"]&&(s+=" font-size-small"),r["font-size-large"]&&(s+=" font-size-large"),r["font-size-extra-large"]&&(s+=" font-size-extra-large"),r.color&&(o.color=r.color),r.backgroundColor&&(o.backgroundColor=r.backgroundColor),n.jsx("span",{...e,className:s.trim(),style:o,children:t})},it=({target:e,search:t,onClose:r})=>{const s=T.useSlate(),o=g.useRef(),[c,i]=g.useState(0),h=[{title:"Heading 1",description:"Big section heading",icon:"H1",command:()=>v(s,"heading-one")},{title:"Heading 2",description:"Medium section heading",icon:"H2",command:()=>v(s,"heading-two")},{title:"Heading 3",description:"Small section heading",icon:"H3",command:()=>v(s,"heading-three")},{title:"Bulleted List",description:"Create a simple bulleted list",icon:"•",command:()=>v(s,"bulleted-list")},{title:"Numbered List",description:"Create a list with numbering",icon:"1.",command:()=>v(s,"numbered-list")},{title:"Quote",description:"Capture a quote",icon:'"',command:()=>v(s,"blockquote")},{title:"Table",description:"Insert a table",icon:"⊞",command:()=>{k(s,e),X(s,3,3),r()}},{title:"Image",description:"Upload or embed an image",icon:"🖼",command:()=>{k(s,e);const m=document.createElement("input");m.type="file",m.accept="image/*",m.onchange=d=>{const b=d.target.files[0];if(b){const y=new FileReader;y.onload=z=>{$(s,z.target.result)},y.readAsDataURL(b)}},m.click(),r()}}].filter(m=>m.title.toLowerCase().includes(t.toLowerCase())||m.description.toLowerCase().includes(t.toLowerCase())),v=(m,d)=>{k(m,e);const b={type:d};d==="bulleted-list"||d==="numbered-list"?(l.Transforms.setNodes(m,{type:"list-item"}),l.Transforms.wrapNodes(m,{type:d,children:[]})):l.Transforms.setNodes(m,b),r()},k=(m,d)=>{l.Transforms.select(m,d),l.Transforms.delete(m)};return g.useEffect(()=>{i(0)},[t]),g.useEffect(()=>{const m=d=>{d.key==="ArrowDown"?(d.preventDefault(),i(b=>b<h.length-1?b+1:0)):d.key==="ArrowUp"?(d.preventDefault(),i(b=>b>0?b-1:h.length-1)):d.key==="Enter"?(d.preventDefault(),h[c]&&h[c].command()):d.key==="Escape"&&(d.preventDefault(),r())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[c,h,r]),h.length===0?null:n.jsx("div",{ref:o,className:"slash-menu",children:h.map((m,d)=>n.jsxs("div",{className:`slash-menu-item ${d===c?"selected":""}`,onClick:m.command,children:[n.jsx("div",{className:"slash-menu-icon",children:m.icon}),n.jsxs("div",{className:"slash-menu-content",children:[n.jsx("div",{className:"slash-menu-title",children:m.title}),n.jsx("div",{className:"slash-menu-description",children:m.description})]})]},m.title))})},ct=e=>{const{insertData:t,isVoid:r}=e;return e.isVoid=s=>s.type==="image"?!0:r(s),e.insertData=s=>{const o=s.getData("text/plain"),{files:c}=s;if(c&&c.length>0)for(const i of c){const u=new FileReader,[h]=i.type.split("/");h==="image"&&(u.addEventListener("load",()=>{const v=u.result;me(e,v)}),u.readAsDataURL(i))}else le(o)?me(e,o):t(s)},e},me=(e,t)=>{const s={type:"image",url:t,children:[{text:""}]};l.Transforms.insertNodes(e,s)},ut=e=>{const{deleteBackward:t,deleteForward:r,insertBreak:s}=e;return e.deleteBackward=(...o)=>{const{selection:c}=e;if(c&&l.Range.isCollapsed(c)){const[i]=l.Editor.nodes(e,{match:u=>u.type==="table-cell"});if(i){const[,u]=i,h=l.Editor.start(e,u);if(l.Point.equals(c.anchor,h))return}}t(...o)},e.deleteForward=(...o)=>{const{selection:c}=e;if(c&&l.Range.isCollapsed(c)){const[i]=l.Editor.nodes(e,{match:u=>u.type==="table-cell"});if(i){const[,u]=i,h=l.Editor.end(e,u);if(l.Point.equals(c.anchor,h))return}}r(...o)},e.insertBreak=(...o)=>{const{selection:c}=e;if(c){const[i]=l.Editor.nodes(e,{match:u=>u.type==="table"});if(i)return}s(...o)},e},dt=e=>{const{insertData:t,insertText:r,isInline:s}=e;return e.isInline=o=>o.type==="link"?!0:s(o),e.insertText=o=>{o&&pe(o)?ge(e,o):r(o)},e.insertData=o=>{const c=o.getData("text/plain");c&&pe(c)?ge(e,c):t(o)},e},pe=e=>{try{return new URL(e),!0}catch{return!1}},ge=(e,t)=>{ft(e)&&ht(e);const{selection:r}=e,s=r&&l.Range.isCollapsed(r),o={type:"link",url:t,children:s?[{text:t}]:[]};s?l.Transforms.insertNodes(e,o):(l.Transforms.wrapNodes(e,o,{split:!0}),l.Transforms.collapse(e,{edge:"end"}))},ht=e=>{l.Transforms.unwrapNodes(e,{match:t=>t.type==="link"})},ft=e=>{const[t]=l.Editor.nodes(e,{match:r=>r.type==="link"});return!!t},be=e=>e.map(t=>ve(t)).join(""),ve=e=>{if(l.Text.isText(e)){let r=H(e.text);return e.bold&&(r=`<strong>${r}</strong>`),e.italic&&(r=`<em>${r}</em>`),e.underline&&(r=`<u>${r}</u>`),e.strikethrough&&(r=`<s>${r}</s>`),e["font-size-small"]?r=`<span style="font-size: 12px;">${r}</span>`:e["font-size-large"]?r=`<span style="font-size: 16px;">${r}</span>`:e["font-size-extra-large"]&&(r=`<span style="font-size: 18px;">${r}</span>`),e.color&&(r=`<span style="color: ${e.color};">${r}</span>`),e.backgroundColor&&(r=`<span style="background-color: ${e.backgroundColor};">${r}</span>`),r}const t=e.children.map(r=>ve(r)).join("");switch(e.type){case"paragraph":return`<p${P(e)}>${t}</p>`;case"heading-one":return`<h1${P(e)}>${t}</h1>`;case"heading-two":return`<h2${P(e)}>${t}</h2>`;case"heading-three":return`<h3${P(e)}>${t}</h3>`;case"blockquote":return`<blockquote${P(e)}>${t}</blockquote>`;case"bulleted-list":return`<ul>${t}</ul>`;case"numbered-list":return`<ol>${t}</ol>`;case"list-item":return`<li>${t}</li>`;case"link":return`<a href="${H(e.url)}">${t}</a>`;case"image":const r=e.width?`width: ${e.width}px; `:"";return`<img src="${H(e.url)}" alt="${H(e.alt||"")}" style="${r}max-width: 100%; height: auto;" />`;case"table":return`<table border="1" style="border-collapse: collapse; width: 100%;">${t}</table>`;case"table-row":return`<tr>${t}</tr>`;case"table-cell":const s=e.header?"th":"td";return`<${s} style="border: 1px solid #ccc; padding: 8px;">${t}</${s}>`;default:return t}},P=e=>e.align?` style="text-align: ${e.align};"`:"",xe=e=>{const t=new DOMParser().parseFromString(e,"text/html");return ke(t.body.childNodes)},ke=e=>{const t=[];for(const r of e){const s=mt(r);s&&(Array.isArray(s)?t.push(...s):t.push(s))}return t.length>0?t:[{type:"paragraph",children:[{text:""}]}]},mt=e=>{if(e.nodeType===Node.TEXT_NODE)return{text:e.textContent};if(e.nodeType!==Node.ELEMENT_NODE)return null;const t=ke(e.childNodes),r={children:t},s=e.getAttribute("style");if(s&&s.includes("text-align:")){const o=s.match(/text-align:\s*([^;]+)/);o&&(r.align=o[1].trim())}switch(e.nodeName.toLowerCase()){case"p":return{...r,type:"paragraph"};case"h1":return{...r,type:"heading-one"};case"h2":return{...r,type:"heading-two"};case"h3":return{...r,type:"heading-three"};case"blockquote":return{...r,type:"blockquote"};case"ul":return{...r,type:"bulleted-list"};case"ol":return{...r,type:"numbered-list"};case"li":return{...r,type:"list-item"};case"a":return{...r,type:"link",url:e.getAttribute("href")};case"img":const o=e.getAttribute("style");let c=300;if(o&&o.includes("width:")){const i=o.match(/width:\s*(\d+)px/);i&&(c=parseInt(i[1]))}return{type:"image",url:e.getAttribute("src"),alt:e.getAttribute("alt")||"",width:c,children:[{text:""}]};case"table":return{...r,type:"table"};case"tr":return{...r,type:"table-row"};case"td":return{...r,type:"table-cell"};case"th":return{...r,type:"table-cell",header:!0};case"strong":case"b":return W(t,"bold");case"em":case"i":return W(t,"italic");case"u":return W(t,"underline");case"s":case"strike":return W(t,"strikethrough");case"span":return pt(e,t);case"br":return{text:`
7
+ `};case"div":return t.length>0?{...r,type:"paragraph"}:null;default:return t}},W=(e,t)=>e.map(r=>r.text!==void 0?{...r,[t]:!0}:r),pt=(e,t)=>{const r=e.getAttribute("style");let s={};if(r){r.includes("font-size: 12px")?s["font-size-small"]=!0:r.includes("font-size: 16px")?s["font-size-large"]=!0:r.includes("font-size: 18px")&&(s["font-size-extra-large"]=!0);const o=r.match(/color:\s*([^;]+)/);o&&(s.color=o[1].trim());const c=r.match(/background-color:\s*([^;]+)/);c&&(s.backgroundColor=c[1].trim())}return Object.keys(s).length>0?t.map(o=>o.text!==void 0?{...o,...s}:o):t},gt=(e,t,r)=>{const[s,o]=g.useState(()=>t?typeof t=="string"?xe(t):t:e||[{type:"paragraph",children:[{text:""}]}]);return{editorValue:s,handleChange:(i,u)=>{if(o(i),u&&u(i),r){const h=i.length===1&&i[0].type==="paragraph"&&i[0].children.length===1&&i[0].children[0].text==="",v=h?"":be(i);r(v,h?[]:i)}}}},bt=e=>{const[t,r]=g.useState(null),s=g.useCallback(c=>{const{selection:i}=e;if(i&&l.Range.isCollapsed(i)){const[u]=l.Range.edges(i),h=l.Editor.before(e,u,{unit:"word"}),v=h&&l.Editor.before(e,h),k=v&&l.Editor.range(e,v,u),m=k&&l.Editor.string(e,k),d=m&&m.match(/\/(\w*)$/),b=l.Editor.after(e,u),y=l.Editor.range(e,u,b),N=l.Editor.string(e,y).match(/^(\s|$)/);r(d&&N?{target:k,search:d[1]}:null)}else r(null)},[e]),o=g.useCallback(()=>{r(null)},[]);return{slashMenu:t,handleSlashMenu:s,closeSlashMenu:o}},J=(e,t)=>{const r=l.Editor.marks(e);(r?r[t]===!0:!1)?l.Editor.removeMark(e,t):l.Editor.addMark(e,t,!0)},vt=e=>g.useCallback(t=>{if(t.ctrlKey)switch(t.key){case"b":{t.preventDefault(),J(e,"bold");break}case"i":{t.preventDefault(),J(e,"italic");break}case"u":{t.preventDefault(),J(e,"underline");break}case"z":{t.shiftKey?(t.preventDefault(),e.redo()):(t.preventDefault(),e.undo());break}}},[e]),we=({value:e,onChange:t,placeholder:r="Enter some text...",readOnly:s=!1,className:o="",initialValue:c=null,features:i=["bold","italic","underline","fontSize"]})=>{const u=g.useMemo(()=>dt(ut(ct(ze.withHistory(T.withReact(l.createEditor()))))),[]),{editorValue:h,handleChange:v}=gt(e,c,t),{slashMenu:k,handleSlashMenu:m,closeSlashMenu:d}=bt(u),b=vt(u),y=g.useCallback(C=>n.jsx(at,{...C}),[]),z=g.useCallback(C=>n.jsx(lt,{...C}),[]),N=g.useCallback(C=>{v(C,m)},[v,m]);return n.jsx("div",{className:`scrible-editor ${o}`,children:n.jsxs(T.Slate,{editor:u,initialValue:h,onChange:N,children:[!s&&n.jsx(st,{features:i}),n.jsxs("div",{className:"editor-container",children:[n.jsx(T.Editable,{renderElement:y,renderLeaf:z,placeholder:r,onKeyDown:b,readOnly:s,className:"editor-content"}),k&&n.jsx(it,{target:k.target,search:k.search,onClose:d})]})]})})};p.ScribleEditor=we,p.default=we,p.deleteTableColumn=He,p.deleteTableRow=Pe,p.deserialize=xe,p.getBackgroundColor=oe,p.getTextColor=se,p.insertImage=$,p.insertLink=ie,p.insertTable=X,p.insertTableColumn=Ie,p.insertTableRow=Le,p.isBlockActive=F,p.isImageUrl=le,p.isLinkActive=de,p.isMarkActive=S,p.serialize=be,p.setBackgroundColor=B,p.setTextColor=O,p.toggleAlignment=I,p.toggleBlock=V,p.toggleMark=R,p.unwrapLink=ue,p.wrapLink=ce,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "scrible",
3
+ "private": false,
4
+ "version": "1.0.0",
5
+ "description": "Scrible - A powerful, customizable rich text editor built with Slate.js that outputs clean HTML",
6
+ "type": "module",
7
+ "main": "./dist/scrible.umd.js",
8
+ "module": "./dist/scrible.es.js",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/scrible.es.js",
12
+ "require": "./dist/scrible.cjs.js"
13
+ },
14
+ "./dist/scrible.css": "./dist/scrible.css"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "LICENSE"
20
+ ],
21
+ "sideEffects": [
22
+ "*.css"
23
+ ],
24
+ "keywords": [
25
+ "scrible",
26
+ "react",
27
+ "slate",
28
+ "editor",
29
+ "rich-text",
30
+ "notion",
31
+ "text-editor",
32
+ "customizable",
33
+ "markdown",
34
+ "quill",
35
+ "input",
36
+ "html",
37
+ "table",
38
+ "image"
39
+ ],
40
+ "author": "Ayush Singhal",
41
+ "license": "MIT",
42
+ "scripts": {
43
+ "dev": "vite",
44
+ "build": "vite build",
45
+ "build:lib": "vite build --mode lib",
46
+ "lint": "eslint .",
47
+ "preview": "vite preview"
48
+ },
49
+ "dependencies": {
50
+ "escape-html": "^1.0.3"
51
+ },
52
+ "peerDependencies": {
53
+ "react": ">=16.8.0",
54
+ "react-dom": ">=16.8.0",
55
+ "slate": "^0.103.0",
56
+ "slate-react": "^0.110.1",
57
+ "slate-history": "^0.109.0"
58
+ },
59
+ "devDependencies": {
60
+ "react": "^19.2.0",
61
+ "react-dom": "^19.2.0",
62
+ "slate": "^0.103.0",
63
+ "slate-history": "^0.109.0",
64
+ "slate-react": "^0.110.3",
65
+ "@eslint/js": "^9.39.1",
66
+ "@types/react": "^19.2.5",
67
+ "@types/react-dom": "^19.2.3",
68
+ "@vitejs/plugin-react": "^5.1.1",
69
+ "eslint": "^9.39.1",
70
+ "eslint-plugin-react-hooks": "^7.0.1",
71
+ "eslint-plugin-react-refresh": "^0.4.24",
72
+ "globals": "^16.5.0",
73
+ "vite": "^7.2.4"
74
+ }
75
+ }