editcrafter 1.0.2 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -34,7 +34,7 @@ pnpm add editcrafter
34
34
  ### Basic Usage
35
35
 
36
36
  ```tsx
37
- import { SimpleEditor } from 'editcrafter';
37
+ import { EditCrafter } from 'editcrafter';
38
38
  import 'editcrafter/dist/editcrafter.css';
39
39
 
40
40
  function App() {
@@ -43,7 +43,7 @@ function App() {
43
43
  };
44
44
 
45
45
  return (
46
- <SimpleEditor
46
+ <EditCrafter
47
47
  onContentChange={handleContentChange}
48
48
  placeholder="Start writing..."
49
49
  />
@@ -57,14 +57,14 @@ Tailwind v4 changed how CSS is imported. Here's how to integrate EditCrafter:
57
57
 
58
58
  ```tsx
59
59
  // app.tsx or main.tsx
60
- import { SimpleEditor } from 'editcrafter';
60
+ import { EditCrafter } from 'editcrafter';
61
61
  // Import the CSS file
62
62
  import 'editcrafter/dist/editcrafter.css';
63
63
 
64
64
  function App() {
65
65
  return (
66
66
  <div className="container mx-auto p-4">
67
- <SimpleEditor placeholder="Write something amazing..." />
67
+ <EditCrafter placeholder="Write something amazing..." />
68
68
  </div>
69
69
  );
70
70
  }
@@ -86,7 +86,7 @@ const initialContent = `
86
86
  <p>This is a <strong>rich text editor</strong> built with Tiptap.</p>
87
87
  `;
88
88
 
89
- <SimpleEditor
89
+ <EditCrafter
90
90
  initialValue={initialContent}
91
91
  onContentChange={handleContentChange}
92
92
  />
@@ -115,7 +115,7 @@ const uploadImage = async (
115
115
  return data.url; // Return the uploaded image URL
116
116
  };
117
117
 
118
- <SimpleEditor
118
+ <EditCrafter
119
119
  imageUploaderConfig={{
120
120
  enabledefault: true,
121
121
  defaultUploadHandler: uploadImage,
@@ -128,7 +128,7 @@ const uploadImage = async (
128
128
  For more control over image insertion:
129
129
 
130
130
  ```tsx
131
- import { SimpleEditor } from 'editcrafter';
131
+ import { EditCrafter } from 'editcrafter';
132
132
 
133
133
  const CustomImageButton = ({ addImage }: { addImage: (url: string) => void }) => {
134
134
  const handleClick = async () => {
@@ -140,7 +140,7 @@ const CustomImageButton = ({ addImage }: { addImage: (url: string) => void }) =>
140
140
  return <button onClick={handleClick}>Add Image</button>;
141
141
  };
142
142
 
143
- <SimpleEditor
143
+ <EditCrafter
144
144
  imageUploaderConfig={{
145
145
  enabledefault: false,
146
146
  CustomToolbarButton: CustomImageButton,
@@ -150,7 +150,7 @@ const CustomImageButton = ({ addImage }: { addImage: (url: string) => void }) =>
150
150
 
151
151
  ## Components
152
152
 
153
- ### SimpleEditor
153
+ ### EditCrafter
154
154
 
155
155
  The main editor component.
156
156
 
@@ -45205,6 +45205,6 @@ const $2 = /* @__PURE__ */ Hf(Mz), kz = $2.default || $2, Dz = ({ value: t, clas
45205
45205
  );
45206
45206
  export {
45207
45207
  Dz as CrafterPreview,
45208
- JI as EnhancedImage,
45209
- Lz as SimpleEditor
45208
+ Lz as EditCrafter,
45209
+ JI as EnhancedImage
45210
45210
  };
@@ -212,4 +212,4 @@ If there's a particular need for this, please submit a feature request at https:
212
212
  <p>Experiment with the various features and see how they can help you create rich, engaging content. Happy writing!</p>
213
213
  `});C.useLayoutEffect(()=>{if(!f.current)return;const m=()=>{d(f.current.getBoundingClientRect().height)};m();const v=new ResizeObserver(m);return v.observe(f.current),()=>v.disconnect()},[]);const p=U$({editor:h,overlayHeight:u});return C.useEffect(()=>{if(!(!s&&a!=="main"))return;const m=setTimeout(()=>{c("main")},300);return()=>clearTimeout(m)},[s,a]),C.useEffect(()=>()=>{h?.destroy()},[h]),g.jsx("div",{className:pe("simple-editor-wrapper",n),children:g.jsxs(Nl.Provider,{value:{editor:h},children:[g.jsx(Rb,{ref:f,style:{...s?{bottom:`calc(100% - ${l-p.y}px)`}:{}},children:a==="main"?g.jsx(K$,{onHighlighterClick:()=>c("highlighter"),onLinkClick:()=>c("link"),isMobile:s,imageUploaderConfig:o}):g.jsx(q$,{type:a==="highlighter"?"highlighter":"link",onBack:()=>c("main")})}),g.jsx(J0,{editor:h,role:"presentation",placeholder:i||"Start writing here...",className:pe("simple-editor-content",r)}),g.jsx(i7,{}),g.jsx(BB,{showResizeHandles:!0,cellMenu:m=>g.jsx(Ix,{editor:m.editor,onMouseDown:v=>m.onResizeStart?.("br")(v)})}),g.jsx(jH,{})]})})}var Ps={},hi={},Zc={},Hr={},wo={},Sm={},r5;function o5(){return r5||(r5=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0;var e;(function(r){r.Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"})(e=t.ElementType||(t.ElementType={}));function n(r){return r.type===e.Tag||r.type===e.Script||r.type===e.Style}t.isTag=n,t.Root=e.Root,t.Text=e.Text,t.Directive=e.Directive,t.Comment=e.Comment,t.Script=e.Script,t.Style=e.Style,t.Tag=e.Tag,t.CDATA=e.CDATA,t.Doctype=e.Doctype})(Sm)),Sm}var le={},i5;function s5(){if(i5)return le;i5=1;var t=le&&le.__extends||(function(){var w=function(E,k){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,I){T.__proto__=I}||function(T,I){for(var O in I)Object.prototype.hasOwnProperty.call(I,O)&&(T[O]=I[O])},w(E,k)};return function(E,k){if(typeof k!="function"&&k!==null)throw new TypeError("Class extends value "+String(k)+" is not a constructor or null");w(E,k);function T(){this.constructor=E}E.prototype=k===null?Object.create(k):(T.prototype=k.prototype,new T)}})(),e=le&&le.__assign||function(){return e=Object.assign||function(w){for(var E,k=1,T=arguments.length;k<T;k++){E=arguments[k];for(var I in E)Object.prototype.hasOwnProperty.call(E,I)&&(w[I]=E[I])}return w},e.apply(this,arguments)};Object.defineProperty(le,"__esModule",{value:!0}),le.cloneNode=le.hasChildren=le.isDocument=le.isDirective=le.isComment=le.isText=le.isCDATA=le.isTag=le.Element=le.Document=le.CDATA=le.NodeWithChildren=le.ProcessingInstruction=le.Comment=le.Text=le.DataNode=le.Node=void 0;var n=o5(),r=(function(){function w(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(w.prototype,"parentNode",{get:function(){return this.parent},set:function(E){this.parent=E},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"previousSibling",{get:function(){return this.prev},set:function(E){this.prev=E},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"nextSibling",{get:function(){return this.next},set:function(E){this.next=E},enumerable:!1,configurable:!0}),w.prototype.cloneNode=function(E){return E===void 0&&(E=!1),x(this,E)},w})();le.Node=r;var o=(function(w){t(E,w);function E(k){var T=w.call(this)||this;return T.data=k,T}return Object.defineProperty(E.prototype,"nodeValue",{get:function(){return this.data},set:function(k){this.data=k},enumerable:!1,configurable:!0}),E})(r);le.DataNode=o;var i=(function(w){t(E,w);function E(){var k=w!==null&&w.apply(this,arguments)||this;return k.type=n.ElementType.Text,k}return Object.defineProperty(E.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),E})(o);le.Text=i;var s=(function(w){t(E,w);function E(){var k=w!==null&&w.apply(this,arguments)||this;return k.type=n.ElementType.Comment,k}return Object.defineProperty(E.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),E})(o);le.Comment=s;var l=(function(w){t(E,w);function E(k,T){var I=w.call(this,T)||this;return I.name=k,I.type=n.ElementType.Directive,I}return Object.defineProperty(E.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),E})(o);le.ProcessingInstruction=l;var a=(function(w){t(E,w);function E(k){var T=w.call(this)||this;return T.children=k,T}return Object.defineProperty(E.prototype,"firstChild",{get:function(){var k;return(k=this.children[0])!==null&&k!==void 0?k:null},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"childNodes",{get:function(){return this.children},set:function(k){this.children=k},enumerable:!1,configurable:!0}),E})(r);le.NodeWithChildren=a;var c=(function(w){t(E,w);function E(){var k=w!==null&&w.apply(this,arguments)||this;return k.type=n.ElementType.CDATA,k}return Object.defineProperty(E.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),E})(a);le.CDATA=c;var u=(function(w){t(E,w);function E(){var k=w!==null&&w.apply(this,arguments)||this;return k.type=n.ElementType.Root,k}return Object.defineProperty(E.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),E})(a);le.Document=u;var d=(function(w){t(E,w);function E(k,T,I,O){I===void 0&&(I=[]),O===void 0&&(O=k==="script"?n.ElementType.Script:k==="style"?n.ElementType.Style:n.ElementType.Tag);var A=w.call(this,I)||this;return A.name=k,A.attribs=T,A.type=O,A}return Object.defineProperty(E.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"tagName",{get:function(){return this.name},set:function(k){this.name=k},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"attributes",{get:function(){var k=this;return Object.keys(this.attribs).map(function(T){var I,O;return{name:T,value:k.attribs[T],namespace:(I=k["x-attribsNamespace"])===null||I===void 0?void 0:I[T],prefix:(O=k["x-attribsPrefix"])===null||O===void 0?void 0:O[T]}})},enumerable:!1,configurable:!0}),E})(a);le.Element=d;function f(w){return(0,n.isTag)(w)}le.isTag=f;function h(w){return w.type===n.ElementType.CDATA}le.isCDATA=h;function p(w){return w.type===n.ElementType.Text}le.isText=p;function m(w){return w.type===n.ElementType.Comment}le.isComment=m;function v(w){return w.type===n.ElementType.Directive}le.isDirective=v;function b(w){return w.type===n.ElementType.Root}le.isDocument=b;function y(w){return Object.prototype.hasOwnProperty.call(w,"children")}le.hasChildren=y;function x(w,E){E===void 0&&(E=!1);var k;if(p(w))k=new i(w.data);else if(m(w))k=new s(w.data);else if(f(w)){var T=E?S(w.children):[],I=new d(w.name,e({},w.attribs),T);T.forEach(function(D){return D.parent=I}),w.namespace!=null&&(I.namespace=w.namespace),w["x-attribsNamespace"]&&(I["x-attribsNamespace"]=e({},w["x-attribsNamespace"])),w["x-attribsPrefix"]&&(I["x-attribsPrefix"]=e({},w["x-attribsPrefix"])),k=I}else if(h(w)){var T=E?S(w.children):[],O=new c(T);T.forEach(function(N){return N.parent=O}),k=O}else if(b(w)){var T=E?S(w.children):[],A=new u(T);T.forEach(function(N){return N.parent=A}),w["x-mode"]&&(A["x-mode"]=w["x-mode"]),k=A}else if(v(w)){var _=new l(w.name,w.data);w["x-name"]!=null&&(_["x-name"]=w["x-name"],_["x-publicId"]=w["x-publicId"],_["x-systemId"]=w["x-systemId"]),k=_}else throw new Error("Not implemented yet: ".concat(w.type));return k.startIndex=w.startIndex,k.endIndex=w.endIndex,w.sourceCodeLocation!=null&&(k.sourceCodeLocation=w.sourceCodeLocation),k}le.cloneNode=x;function S(w){for(var E=w.map(function(T){return x(T,!0)}),k=1;k<E.length;k++)E[k].prev=E[k-1],E[k-1].next=E[k];return E}return le}var l5;function a5(){return l5||(l5=1,(function(t){var e=wo&&wo.__createBinding||(Object.create?(function(l,a,c,u){u===void 0&&(u=c);var d=Object.getOwnPropertyDescriptor(a,c);(!d||("get"in d?!a.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(l,u,d)}):(function(l,a,c,u){u===void 0&&(u=c),l[u]=a[c]})),n=wo&&wo.__exportStar||function(l,a){for(var c in l)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&e(a,l,c)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var r=o5(),o=s5();n(s5(),t);var i={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},s=(function(){function l(a,c,u){this.dom=[],this.root=new o.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof c=="function"&&(u=c,c=i),typeof a=="object"&&(c=a,a=void 0),this.callback=a??null,this.options=c??i,this.elementCB=u??null}return l.prototype.onparserinit=function(a){this.parser=a},l.prototype.onreset=function(){this.dom=[],this.root=new o.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},l.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},l.prototype.onerror=function(a){this.handleCallback(a)},l.prototype.onclosetag=function(){this.lastNode=null;var a=this.tagStack.pop();this.options.withEndIndices&&(a.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(a)},l.prototype.onopentag=function(a,c){var u=this.options.xmlMode?r.ElementType.Tag:void 0,d=new o.Element(a,c,void 0,u);this.addNode(d),this.tagStack.push(d)},l.prototype.ontext=function(a){var c=this.lastNode;if(c&&c.type===r.ElementType.Text)c.data+=a,this.options.withEndIndices&&(c.endIndex=this.parser.endIndex);else{var u=new o.Text(a);this.addNode(u),this.lastNode=u}},l.prototype.oncomment=function(a){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=a;return}var c=new o.Comment(a);this.addNode(c),this.lastNode=c},l.prototype.oncommentend=function(){this.lastNode=null},l.prototype.oncdatastart=function(){var a=new o.Text(""),c=new o.CDATA([a]);this.addNode(c),a.parent=c,this.lastNode=a},l.prototype.oncdataend=function(){this.lastNode=null},l.prototype.onprocessinginstruction=function(a,c){var u=new o.ProcessingInstruction(a,c);this.addNode(u)},l.prototype.handleCallback=function(a){if(typeof this.callback=="function")this.callback(a,this.dom);else if(a)throw a},l.prototype.addNode=function(a){var c=this.tagStack[this.tagStack.length-1],u=c.children[c.children.length-1];this.options.withStartIndices&&(a.startIndex=this.parser.startIndex),this.options.withEndIndices&&(a.endIndex=this.parser.endIndex),c.children.push(a),u&&(a.prev=u,u.next=a),a.parent=c,this.lastNode=null},l})();t.DomHandler=s,t.default=s})(wo)),wo}var Em={},c5;function Z$(){return c5||(c5=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CARRIAGE_RETURN_PLACEHOLDER_REGEX=t.CARRIAGE_RETURN_PLACEHOLDER=t.CARRIAGE_RETURN_REGEX=t.CARRIAGE_RETURN=t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES=void 0,t.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES.reduce(function(e,n){return e[n.toLowerCase()]=n,e},{}),t.CARRIAGE_RETURN="\r",t.CARRIAGE_RETURN_REGEX=new RegExp(t.CARRIAGE_RETURN,"g"),t.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now().toString(),"__"),t.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(t.CARRIAGE_RETURN_PLACEHOLDER,"g")})(Em)),Em}var u5;function d5(){if(u5)return Hr;u5=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.formatAttributes=r,Hr.hasOpenTag=i,Hr.escapeSpecialCharacters=s,Hr.revertEscapedCharacters=l,Hr.formatDOM=a;var t=a5(),e=Z$();function n(c){return e.CASE_SENSITIVE_TAG_NAMES_MAP[c]}function r(c){for(var u={},d=0,f=c.length;d<f;d++){var h=c[d];u[h.name]=h.value}return u}function o(c){c=c.toLowerCase();var u=n(c);return u||c}function i(c,u){var d="<"+u,f=c.toLowerCase().indexOf(d);if(f===-1)return!1;var h=c[f+d.length];return h===">"||h===" "||h===" "||h===`
214
214
  `||h==="\r"||h==="/"}function s(c){return c.replace(e.CARRIAGE_RETURN_REGEX,e.CARRIAGE_RETURN_PLACEHOLDER)}function l(c){return c.replace(e.CARRIAGE_RETURN_PLACEHOLDER_REGEX,e.CARRIAGE_RETURN)}function a(c,u,d){var f,h,p,m;u===void 0&&(u=null);for(var v=[],b,y=0,x=c.length;y<x;y++){var S=c[y];switch(S.nodeType){case 1:{var w=o(S.nodeName);b=new t.Element(w,r(S.attributes)),b.children=a(w==="template"?S.content.childNodes:S.childNodes,b);break}case 3:b=new t.Text(l((f=S.nodeValue)!==null&&f!==void 0?f:""));break;case 8:b=new t.Comment((h=S.nodeValue)!==null&&h!==void 0?h:"");break;default:continue}var E=(p=v[y-1])!==null&&p!==void 0?p:null;E&&(E.next=b),b.parent=u,b.prev=E,b.next=null,v.push(b)}return d&&(b=new t.ProcessingInstruction(d.substring(0,d.indexOf(" ")).toLowerCase(),d),b.next=(m=v[0])!==null&&m!==void 0?m:null,b.parent=u,v.unshift(b),v[1]&&(v[1].prev=v[0])),v}return Hr}var f5;function Y$(){if(f5)return Zc;f5=1,Object.defineProperty(Zc,"__esModule",{value:!0}),Zc.default=p;var t=d5(),e="html",n="head",r="body",o=/<([a-zA-Z]+[0-9]?)/,i=function(m,v){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},s=function(m,v){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},l=typeof window=="object"&&window.DOMParser;if(typeof l=="function"){var a=new l,c="text/html";s=function(m,v){return v&&(m="<".concat(v,">").concat(m,"</").concat(v,">")),a.parseFromString(m,c)},i=s}if(typeof document=="object"&&document.implementation){var u=document.implementation.createHTMLDocument();i=function(m,v){if(v){var b=u.documentElement.querySelector(v);return b&&(b.innerHTML=m),u}return u.documentElement.innerHTML=m,u}}var d=typeof document=="object"&&document.createElement("template"),f;d&&d.content&&(f=function(m){return d.innerHTML=m,d.content.childNodes});var h=function(){return document.createDocumentFragment().childNodes};function p(m){var v,b,y,x,S,w;m=(0,t.escapeSpecialCharacters)(m);var E=o.exec(m),k=(v=E?.[1])===null||v===void 0?void 0:v.toLowerCase();switch(k){case e:{var T=s(m);if(!(0,t.hasOpenTag)(m,n)){var I=T.querySelector(n);(b=I?.parentNode)===null||b===void 0||b.removeChild(I)}if(!(0,t.hasOpenTag)(m,r)){var I=T.querySelector(r);(y=I?.parentNode)===null||y===void 0||y.removeChild(I)}return T.querySelectorAll(e)}case n:case r:{var O=i(m).querySelectorAll(k);return(0,t.hasOpenTag)(m,r)&&(0,t.hasOpenTag)(m,n)?(S=(x=O[0].parentNode)===null||x===void 0?void 0:x.childNodes)!==null&&S!==void 0?S:h():O}default:{if(f)return f(m);var I=i(m,r).querySelector(r);return(w=I?.childNodes)!==null&&w!==void 0?w:h()}}}return Zc}var h5;function X$(){if(h5)return hi;h5=1;var t=hi&&hi.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(hi,"__esModule",{value:!0}),hi.default=o;var e=t(Y$()),n=d5(),r=/<(![a-zA-Z\s]+)>/;function o(i){if(typeof i!="string")throw new TypeError("First argument must be a string");if(!i)return[];var s=r.exec(i),l=s?s[1]:void 0;return(0,n.formatDOM)((0,e.default)(i),null,l)}return hi}var Yc={},Yt={},Ls={},p5;function J$(){if(p5)return Ls;p5=1;var t=0;Ls.SAME=t;var e=1;return Ls.CAMELCASE=e,Ls.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1},Ls}var m5;function Q$(){if(m5)return Yt;m5=1;const t=0,e=1,n=2,r=3,o=4,i=5,s=6;function l(w){return c.hasOwnProperty(w)?c[w]:null}function a(w,E,k,T,I,O,A){this.acceptsBooleans=E===n||E===r||E===o,this.attributeName=T,this.attributeNamespace=I,this.mustUseProperty=k,this.propertyName=w,this.type=E,this.sanitizeURL=O,this.removeEmptyString=A}const c={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(w=>{c[w]=new a(w,t,!1,w,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([w,E])=>{c[w]=new a(w,e,!1,E,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(w=>{c[w]=new a(w,n,!1,w.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(w=>{c[w]=new a(w,n,!1,w,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(w=>{c[w]=new a(w,r,!1,w.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(w=>{c[w]=new a(w,r,!0,w,null,!1,!1)}),["capture","download"].forEach(w=>{c[w]=new a(w,o,!1,w,null,!1,!1)}),["cols","rows","size","span"].forEach(w=>{c[w]=new a(w,s,!1,w,null,!1,!1)}),["rowSpan","start"].forEach(w=>{c[w]=new a(w,i,!1,w.toLowerCase(),null,!1,!1)});const d=/[\-\:]([a-z])/g,f=w=>w[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(w=>{const E=w.replace(d,f);c[E]=new a(E,e,!1,w,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(w=>{const E=w.replace(d,f);c[E]=new a(E,e,!1,w,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(w=>{const E=w.replace(d,f);c[E]=new a(E,e,!1,w,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(w=>{c[w]=new a(w,e,!1,w.toLowerCase(),null,!1,!1)});const h="xlinkHref";c[h]=new a("xlinkHref",e,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(w=>{c[w]=new a(w,e,!1,w.toLowerCase(),null,!0,!0)});const{CAMELCASE:p,SAME:m,possibleStandardNames:v}=J$(),y=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",x=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+y+"]*$")),S=Object.keys(v).reduce((w,E)=>{const k=v[E];return k===m?w[E]=E:k===p?w[E.toLowerCase()]=E:w[E]=k,w},{});return Yt.BOOLEAN=r,Yt.BOOLEANISH_STRING=n,Yt.NUMERIC=i,Yt.OVERLOADED_BOOLEAN=o,Yt.POSITIVE_NUMERIC=s,Yt.RESERVED=t,Yt.STRING=e,Yt.getPropertyInfo=l,Yt.isCustomAttribute=x,Yt.possibleStandardNames=S,Yt}var Ds={},pi={},km,g5;function ez(){if(g5)return km;g5=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,a=`
215
- `,c="/",u="*",d="",f="comment",h="declaration";function p(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var y=1,x=1;function S(N){var P=N.match(e);P&&(y+=P.length);var B=N.lastIndexOf(a);x=~B?N.length-B:x+N.length}function w(){var N={line:y,column:x};return function(P){return P.position=new E(N),I(),P}}function E(N){this.start=N,this.end={line:y,column:x},this.source=b.source}E.prototype.content=v;function k(N){var P=new Error(b.source+":"+y+":"+x+": "+N);if(P.reason=N,P.filename=b.source,P.line=y,P.column=x,P.source=v,!b.silent)throw P}function T(N){var P=N.exec(v);if(P){var B=P[0];return S(B),v=v.slice(B.length),P}}function I(){T(n)}function O(N){var P;for(N=N||[];P=A();)P!==!1&&N.push(P);return N}function A(){var N=w();if(!(c!=v.charAt(0)||u!=v.charAt(1))){for(var P=2;d!=v.charAt(P)&&(u!=v.charAt(P)||c!=v.charAt(P+1));)++P;if(P+=2,d===v.charAt(P-1))return k("End of comment missing");var B=v.slice(2,P-2);return x+=2,S(B),v=v.slice(P),x+=2,N({type:f,comment:B})}}function _(){var N=w(),P=T(r);if(P){if(A(),!T(o))return k("property missing ':'");var B=T(i),R=N({type:h,property:m(P[0].replace(t,d)),value:B?m(B[0].replace(t,d)):d});return T(s),R}}function D(){var N=[];O(N);for(var P;P=_();)P!==!1&&(N.push(P),O(N));return N}return I(),D()}function m(v){return v?v.replace(l,d):d}return km=p,km}var v5;function tz(){if(v5)return pi;v5=1;var t=pi&&pi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pi,"__esModule",{value:!0}),pi.default=n;const e=t(ez());function n(r,o){let i=null;if(!r||typeof r!="string")return i;const s=(0,e.default)(r),l=typeof o=="function";return s.forEach(a=>{if(a.type!=="declaration")return;const{property:c,value:u}=a;l?o(c,u,a):u&&(i=i||{},i[c]=u)}),i}return pi}var js={},b5;function nz(){if(b5)return js;b5=1,Object.defineProperty(js,"__esModule",{value:!0}),js.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(c){return!c||n.test(c)||t.test(c)},s=function(c,u){return u.toUpperCase()},l=function(c,u){return"".concat(u,"-")},a=function(c,u){return u===void 0&&(u={}),i(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(o,l):c=c.replace(r,l),c.replace(e,s))};return js.camelCase=a,js}var _s,C5;function rz(){if(C5)return _s;C5=1;var t=_s&&_s.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},e=t(tz()),n=nz();function r(o,i){var s={};return!o||typeof o!="string"||(0,e.default)(o,function(l,a){l&&a&&(s[(0,n.camelCase)(l,i)]=a)}),s}return r.default=r,_s=r,_s}var y5;function w5(){return y5||(y5=1,(function(t){var e=Ds&&Ds.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=void 0,t.isCustomComponent=i,t.setStyleProp=l;var n=C,r=e(rz()),o=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function i(u,d){return u.includes("-")?!o.has(u):!!(d&&typeof d.is=="string")}var s={reactCompat:!0};function l(u,d){if(typeof u=="string"){if(!u.trim()){d.style={};return}try{d.style=(0,r.default)(u,s)}catch{d.style={}}}}t.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var a=function(u){return!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(u.name)};t.canTextBeChildOfNode=a;var c=function(u){return u};t.returnFirstArg=c})(Ds)),Ds}var x5;function S5(){if(x5)return Yc;x5=1,Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.default=i;var t=Q$(),e=w5(),n=["checked","value"],r=["input","select","textarea"],o={reset:!0,submit:!0};function i(l,a){l===void 0&&(l={});var c={},u=!!(l.type&&o[l.type]);for(var d in l){var f=l[d];if((0,t.isCustomAttribute)(d)){c[d]=f;continue}var h=d.toLowerCase(),p=s(h);if(p){var m=(0,t.getPropertyInfo)(p);switch(n.includes(p)&&r.includes(a)&&!u&&(p=s("default"+h)),c[p]=f,m?.type){case t.BOOLEAN:c[p]=!0;break;case t.OVERLOADED_BOOLEAN:f===""&&(c[p]=!0);break}continue}e.PRESERVE_CUSTOM_ATTRIBUTES&&(c[d]=f)}return(0,e.setStyleProp)(l.style,c),c}function s(l){return t.possibleStandardNames[l]}return Yc}var mi={},E5;function oz(){if(E5)return mi;E5=1;var t=mi&&mi.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(mi,"__esModule",{value:!0}),mi.default=i;var e=C,n=t(S5()),r=w5(),o={cloneElement:e.cloneElement,createElement:e.createElement,isValidElement:e.isValidElement};function i(l,a){var c,u,d,f,h;a===void 0&&(a={});for(var p=[],m=typeof a.replace=="function",v=(c=a.transform)!==null&&c!==void 0?c:r.returnFirstArg,b=(u=a.library)!==null&&u!==void 0?u:o,y=b.cloneElement,x=b.createElement,S=b.isValidElement,w=l.length,E=0;E<w;E++){var k=l[E];if(m){var T=(d=a.replace)===null||d===void 0?void 0:d.call(a,k,E);if(S(T)){w>1&&(T=y(T,{key:(f=T.key)!==null&&f!==void 0?f:E})),p.push(v(T,k,E));continue}}if(k.type==="text"){var I=!k.data.trim().length;if(I&&k.parent&&!(0,r.canTextBeChildOfNode)(k.parent)||a.trim&&I)continue;p.push(v(k.data,k,E));continue}var O=k,A={};s(O)?((0,r.setStyleProp)(O.attribs.style,O.attribs),A=O.attribs):O.attribs&&(A=(0,n.default)(O.attribs,O.name));var _=void 0;switch(k.type){case"script":case"style":k.children[0]&&(A.dangerouslySetInnerHTML={__html:k.children[0].data});break;case"tag":k.name==="textarea"&&k.children[0]?A.defaultValue=k.children[0].data:!((h=k.children)===null||h===void 0)&&h.length&&(_=i(k.children,a));break;default:continue}w>1&&(A.key=E),p.push(v(x(k.name,A,_),k,E))}return p.length===1?p[0]:p}function s(l){return r.PRESERVE_CUSTOM_ATTRIBUTES&&l.type==="tag"&&(0,r.isCustomComponent)(l.name,l.attribs)}return mi}var k5;function iz(){return k5||(k5=1,(function(t){var e=Ps&&Ps.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0,t.default=l;var n=e(X$());t.htmlToDOM=n.default;var r=e(S5());t.attributesToProps=r.default;var o=e(oz());t.domToReact=o.default;var i=a5();Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return i.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return i.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return i.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return i.Text}});var s={lowerCaseAttributeNames:!1};function l(a,c){var u;if(typeof a!="string")throw new TypeError("First argument must be a string");return a?(0,o.default)((0,n.default)(a,(u=c?.htmlparser2)!==null&&u!==void 0?u:s),c):[]}})(Ps)),Ps}var sz=iz();const M5=Jc(sz),lz=M5.default||M5,az=({value:t,className:e})=>g.jsx("div",{className:pe("editcrafter flex h-auto min-h-72 w-full flex-col rounded-md border border-input shadow-sm focus-within:border-primary",e),children:lz(t)});pn.CrafterPreview=az,pn.EnhancedImage=Db,pn.SimpleEditor=G$,Object.defineProperty(pn,Symbol.toStringTag,{value:"Module"})}));
215
+ `,c="/",u="*",d="",f="comment",h="declaration";function p(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var y=1,x=1;function S(N){var P=N.match(e);P&&(y+=P.length);var B=N.lastIndexOf(a);x=~B?N.length-B:x+N.length}function w(){var N={line:y,column:x};return function(P){return P.position=new E(N),I(),P}}function E(N){this.start=N,this.end={line:y,column:x},this.source=b.source}E.prototype.content=v;function k(N){var P=new Error(b.source+":"+y+":"+x+": "+N);if(P.reason=N,P.filename=b.source,P.line=y,P.column=x,P.source=v,!b.silent)throw P}function T(N){var P=N.exec(v);if(P){var B=P[0];return S(B),v=v.slice(B.length),P}}function I(){T(n)}function O(N){var P;for(N=N||[];P=A();)P!==!1&&N.push(P);return N}function A(){var N=w();if(!(c!=v.charAt(0)||u!=v.charAt(1))){for(var P=2;d!=v.charAt(P)&&(u!=v.charAt(P)||c!=v.charAt(P+1));)++P;if(P+=2,d===v.charAt(P-1))return k("End of comment missing");var B=v.slice(2,P-2);return x+=2,S(B),v=v.slice(P),x+=2,N({type:f,comment:B})}}function _(){var N=w(),P=T(r);if(P){if(A(),!T(o))return k("property missing ':'");var B=T(i),R=N({type:h,property:m(P[0].replace(t,d)),value:B?m(B[0].replace(t,d)):d});return T(s),R}}function D(){var N=[];O(N);for(var P;P=_();)P!==!1&&(N.push(P),O(N));return N}return I(),D()}function m(v){return v?v.replace(l,d):d}return km=p,km}var v5;function tz(){if(v5)return pi;v5=1;var t=pi&&pi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pi,"__esModule",{value:!0}),pi.default=n;const e=t(ez());function n(r,o){let i=null;if(!r||typeof r!="string")return i;const s=(0,e.default)(r),l=typeof o=="function";return s.forEach(a=>{if(a.type!=="declaration")return;const{property:c,value:u}=a;l?o(c,u,a):u&&(i=i||{},i[c]=u)}),i}return pi}var js={},b5;function nz(){if(b5)return js;b5=1,Object.defineProperty(js,"__esModule",{value:!0}),js.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(c){return!c||n.test(c)||t.test(c)},s=function(c,u){return u.toUpperCase()},l=function(c,u){return"".concat(u,"-")},a=function(c,u){return u===void 0&&(u={}),i(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(o,l):c=c.replace(r,l),c.replace(e,s))};return js.camelCase=a,js}var _s,C5;function rz(){if(C5)return _s;C5=1;var t=_s&&_s.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},e=t(tz()),n=nz();function r(o,i){var s={};return!o||typeof o!="string"||(0,e.default)(o,function(l,a){l&&a&&(s[(0,n.camelCase)(l,i)]=a)}),s}return r.default=r,_s=r,_s}var y5;function w5(){return y5||(y5=1,(function(t){var e=Ds&&Ds.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=void 0,t.isCustomComponent=i,t.setStyleProp=l;var n=C,r=e(rz()),o=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function i(u,d){return u.includes("-")?!o.has(u):!!(d&&typeof d.is=="string")}var s={reactCompat:!0};function l(u,d){if(typeof u=="string"){if(!u.trim()){d.style={};return}try{d.style=(0,r.default)(u,s)}catch{d.style={}}}}t.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var a=function(u){return!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(u.name)};t.canTextBeChildOfNode=a;var c=function(u){return u};t.returnFirstArg=c})(Ds)),Ds}var x5;function S5(){if(x5)return Yc;x5=1,Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.default=i;var t=Q$(),e=w5(),n=["checked","value"],r=["input","select","textarea"],o={reset:!0,submit:!0};function i(l,a){l===void 0&&(l={});var c={},u=!!(l.type&&o[l.type]);for(var d in l){var f=l[d];if((0,t.isCustomAttribute)(d)){c[d]=f;continue}var h=d.toLowerCase(),p=s(h);if(p){var m=(0,t.getPropertyInfo)(p);switch(n.includes(p)&&r.includes(a)&&!u&&(p=s("default"+h)),c[p]=f,m?.type){case t.BOOLEAN:c[p]=!0;break;case t.OVERLOADED_BOOLEAN:f===""&&(c[p]=!0);break}continue}e.PRESERVE_CUSTOM_ATTRIBUTES&&(c[d]=f)}return(0,e.setStyleProp)(l.style,c),c}function s(l){return t.possibleStandardNames[l]}return Yc}var mi={},E5;function oz(){if(E5)return mi;E5=1;var t=mi&&mi.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(mi,"__esModule",{value:!0}),mi.default=i;var e=C,n=t(S5()),r=w5(),o={cloneElement:e.cloneElement,createElement:e.createElement,isValidElement:e.isValidElement};function i(l,a){var c,u,d,f,h;a===void 0&&(a={});for(var p=[],m=typeof a.replace=="function",v=(c=a.transform)!==null&&c!==void 0?c:r.returnFirstArg,b=(u=a.library)!==null&&u!==void 0?u:o,y=b.cloneElement,x=b.createElement,S=b.isValidElement,w=l.length,E=0;E<w;E++){var k=l[E];if(m){var T=(d=a.replace)===null||d===void 0?void 0:d.call(a,k,E);if(S(T)){w>1&&(T=y(T,{key:(f=T.key)!==null&&f!==void 0?f:E})),p.push(v(T,k,E));continue}}if(k.type==="text"){var I=!k.data.trim().length;if(I&&k.parent&&!(0,r.canTextBeChildOfNode)(k.parent)||a.trim&&I)continue;p.push(v(k.data,k,E));continue}var O=k,A={};s(O)?((0,r.setStyleProp)(O.attribs.style,O.attribs),A=O.attribs):O.attribs&&(A=(0,n.default)(O.attribs,O.name));var _=void 0;switch(k.type){case"script":case"style":k.children[0]&&(A.dangerouslySetInnerHTML={__html:k.children[0].data});break;case"tag":k.name==="textarea"&&k.children[0]?A.defaultValue=k.children[0].data:!((h=k.children)===null||h===void 0)&&h.length&&(_=i(k.children,a));break;default:continue}w>1&&(A.key=E),p.push(v(x(k.name,A,_),k,E))}return p.length===1?p[0]:p}function s(l){return r.PRESERVE_CUSTOM_ATTRIBUTES&&l.type==="tag"&&(0,r.isCustomComponent)(l.name,l.attribs)}return mi}var k5;function iz(){return k5||(k5=1,(function(t){var e=Ps&&Ps.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0,t.default=l;var n=e(X$());t.htmlToDOM=n.default;var r=e(S5());t.attributesToProps=r.default;var o=e(oz());t.domToReact=o.default;var i=a5();Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return i.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return i.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return i.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return i.Text}});var s={lowerCaseAttributeNames:!1};function l(a,c){var u;if(typeof a!="string")throw new TypeError("First argument must be a string");return a?(0,o.default)((0,n.default)(a,(u=c?.htmlparser2)!==null&&u!==void 0?u:s),c):[]}})(Ps)),Ps}var sz=iz();const M5=Jc(sz),lz=M5.default||M5,az=({value:t,className:e})=>g.jsx("div",{className:pe("editcrafter flex h-auto min-h-72 w-full flex-col rounded-md border border-input shadow-sm focus-within:border-primary",e),children:lz(t)});pn.CrafterPreview=az,pn.EditCrafter=G$,pn.EnhancedImage=Db,Object.defineProperty(pn,Symbol.toStringTag,{value:"Module"})}));
package/dist/index.d.ts CHANGED
@@ -9,6 +9,8 @@ export declare type CrafterPreviewProps = {
9
9
  className?: string;
10
10
  };
11
11
 
12
+ export declare function EditCrafter({ initialValue, onContentChange, wrapperClassName, contentClassName, imageUploaderConfig, placeholder, }: EditCrafterProps): JSX.Element;
13
+
12
14
  export declare type EditCrafterProps = {
13
15
  initialValue?: string;
14
16
  onContentChange?: (value: string) => void;
@@ -58,8 +60,6 @@ export declare type ImageUploaderType = {
58
60
  defaultUploadHandler?: undefined;
59
61
  };
60
62
 
61
- export declare function SimpleEditor({ initialValue, onContentChange, wrapperClassName, contentClassName, imageUploaderConfig, placeholder, }: EditCrafterProps): JSX.Element;
62
-
63
63
  export { }
64
64
 
65
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "editcrafter",
3
- "version": "1.0.2",
3
+ "version": "1.0.6",
4
4
  "type": "module",
5
5
  "main": "./dist/editcrafter.umd.js",
6
6
  "module": "./dist/editcrafter.es.js",
@@ -19,8 +19,42 @@
19
19
  "dev": "vite",
20
20
  "build": "tsc -b && vite build",
21
21
  "lint": "eslint .",
22
+ "prepare": "pnpm build",
22
23
  "preview": "vite preview"
23
24
  },
25
+ "keywords": [
26
+ "react",
27
+ "editor",
28
+ "rich-text",
29
+ "wysiwyg",
30
+ "tiptap",
31
+ "text-editor",
32
+ "markdown",
33
+ "react-editor",
34
+ "typescript",
35
+ "code-block",
36
+ "image-upload",
37
+ "file-handler",
38
+ "react-ui",
39
+ "custom-editor",
40
+ "drag-and-drop",
41
+ "placeholder",
42
+ "tailwindcss",
43
+ "text-styling",
44
+ "collaborative",
45
+ "markdown-editor",
46
+ "react-components"
47
+ ],
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/Md-Anamul-Haque/editcrafter.git"
51
+ },
52
+ "author": "md-anamul-haque",
53
+ "license": "ISC",
54
+ "bugs": {
55
+ "url": "https://github.com/Md-Anamul-Haque/editcrafter/issues"
56
+ },
57
+ "homepage": "https://github.com/Md-Anamul-Haque/editcrafter#readme",
24
58
  "dependencies": {
25
59
  "@floating-ui/react": "^0.27.17",
26
60
  "@radix-ui/react-dropdown-menu": "^2.1.16",
@@ -42,7 +76,6 @@
42
76
  "@tiptap/pm": "^3.19.0",
43
77
  "@tiptap/react": "^3.19.0",
44
78
  "@tiptap/starter-kit": "^3.19.0",
45
- "editcrafter": "^1.0.1",
46
79
  "html-react-parser": "^5.2.17",
47
80
  "lodash.throttle": "^4.1.1",
48
81
  "react": "^19.2.0",