@ryzeup/richtexteditor 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +22 -0
  2. package/package.json +3 -3
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react");var ie={exports:{}},ee={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var xe;function De(){if(xe)return ee;xe=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function u(c,h,v){var L=null;if(v!==void 0&&(L=""+v),h.key!==void 0&&(L=""+h.key),"key"in h){v={};for(var R in h)R!=="key"&&(v[R]=h[R])}else v=h;return h=v.ref,{$$typeof:t,type:c,key:L,ref:h!==void 0?h:null,props:v}}return ee.Fragment=s,ee.jsx=u,ee.jsxs=u,ee}var te={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var we;function He(){return we||(we=1,process.env.NODE_ENV!=="production"&&(function(){function t(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===re?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case k:return"Fragment";case H:return"Profiler";case Y:return"StrictMode";case W:return"Suspense";case fe:return"SuspenseList";case me:return"Activity"}if(typeof n=="object")switch(typeof n.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case B:return"Portal";case O:return n.displayName||"Context";case m:return(n._context.displayName||"Context")+".Consumer";case q:var p=n.render;return n=n.displayName,n||(n=p.displayName||p.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case ne:return p=n.displayName||null,p!==null?p:t(n.type)||"Memo";case G:p=n._payload,n=n._init;try{return t(n(p))}catch{}}return null}function s(n){return""+n}function u(n){try{s(n);var p=!1}catch{p=!0}if(p){p=console;var C=p.error,_=typeof Symbol=="function"&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object";return C.call(p,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",_),s(n)}}function c(n){if(n===k)return"<>";if(typeof n=="object"&&n!==null&&n.$$typeof===G)return"<...>";try{var p=t(n);return p?"<"+p+">":"<...>"}catch{return"<...>"}}function h(){var n=z.A;return n===null?null:n.getOwner()}function v(){return Error("react-stack-top-frame")}function L(n){if(N.call(n,"key")){var p=Object.getOwnPropertyDescriptor(n,"key").get;if(p&&p.isReactWarning)return!1}return n.key!==void 0}function R(n,p){function C(){ae||(ae=!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)",p))}C.isReactWarning=!0,Object.defineProperty(n,"key",{get:C,configurable:!0})}function x(){var n=t(this.type);return Z[n]||(Z[n]=!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.")),n=this.props.ref,n!==void 0?n:null}function F(n,p,C,_,X,K){var S=C.ref;return n={$$typeof:U,type:n,key:p,props:C,_owner:_},(S!==void 0?S:null)!==null?Object.defineProperty(n,"ref",{enumerable:!1,get:x}):Object.defineProperty(n,"ref",{enumerable:!1,value:null}),n._store={},Object.defineProperty(n._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(n,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(n,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(n,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.freeze&&(Object.freeze(n.props),Object.freeze(n)),n}function P(n,p,C,_,X,K){var S=p.children;if(S!==void 0)if(_)if(oe(S)){for(_=0;_<S.length;_++)T(S[_]);Object.freeze&&Object.freeze(S)}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 T(S);if(N.call(p,"key")){S=t(n);var V=Object.keys(p).filter(function(he){return he!=="key"});_=0<V.length?"{key: someKey, "+V.join(": ..., ")+": ...}":"{key: someKey}",J[S+_]||(V=0<V.length?"{"+V.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ let props = %s;
19
+ <%s {...props} />
20
+ React keys must be passed directly to JSX without using spread:
21
+ let props = %s;
22
+ <%s key={someKey} {...props} />`,_,S,V,S),J[S+_]=!0)}if(S=null,C!==void 0&&(u(C),S=""+C),L(p)&&(u(p.key),S=""+p.key),"key"in p){C={};for(var Q in p)Q!=="key"&&(C[Q]=p[Q])}else C=p;return S&&R(C,typeof n=="function"?n.displayName||n.name||"Unknown":n),F(n,S,C,h(),X,K)}function T(n){D(n)?n._store&&(n._store.validated=1):typeof n=="object"&&n!==null&&n.$$typeof===G&&(n._payload.status==="fulfilled"?D(n._payload.value)&&n._payload.value._store&&(n._payload.value._store.validated=1):n._store&&(n._store.validated=1))}function D(n){return typeof n=="object"&&n!==null&&n.$$typeof===U}var E=w,U=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),O=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),fe=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),me=Symbol.for("react.activity"),re=Symbol.for("react.client.reference"),z=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,oe=Array.isArray,$=console.createTask?console.createTask:function(){return null};E={react_stack_bottom_frame:function(n){return n()}};var ae,Z={},le=E.react_stack_bottom_frame.bind(E,v)(),se=$(c(v)),J={};te.Fragment=k,te.jsx=function(n,p,C){var _=1e4>z.recentlyCreatedOwnerStacks++;return P(n,p,C,!1,_?Error("react-stack-top-frame"):le,_?$(c(n)):se)},te.jsxs=function(n,p,C){var _=1e4>z.recentlyCreatedOwnerStacks++;return P(n,p,C,!0,_?Error("react-stack-top-frame"):le,_?$(c(n)):se)}})()),te}var be;function Fe(){return be||(be=1,process.env.NODE_ENV==="production"?ie.exports=De():ie.exports=He()),ie.exports}var a=Fe(),Ce={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ye=w.createContext&&w.createContext(Ce),Ie=["attr","size","title"];function Be(t,s){if(t==null)return{};var u=$e(t,s),c,h;if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(t);for(h=0;h<v.length;h++)c=v[h],!(s.indexOf(c)>=0)&&Object.prototype.propertyIsEnumerable.call(t,c)&&(u[c]=t[c])}return u}function $e(t,s){if(t==null)return{};var u={};for(var c in t)if(Object.prototype.hasOwnProperty.call(t,c)){if(s.indexOf(c)>=0)continue;u[c]=t[c]}return u}function ue(){return ue=Object.assign?Object.assign.bind():function(t){for(var s=1;s<arguments.length;s++){var u=arguments[s];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(t[c]=u[c])}return t},ue.apply(this,arguments)}function Re(t,s){var u=Object.keys(t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);s&&(c=c.filter(function(h){return Object.getOwnPropertyDescriptor(t,h).enumerable})),u.push.apply(u,c)}return u}function de(t){for(var s=1;s<arguments.length;s++){var u=arguments[s]!=null?arguments[s]:{};s%2?Re(Object(u),!0).forEach(function(c){Ve(t,c,u[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(u)):Re(Object(u)).forEach(function(c){Object.defineProperty(t,c,Object.getOwnPropertyDescriptor(u,c))})}return t}function Ve(t,s,u){return s=Ye(s),s in t?Object.defineProperty(t,s,{value:u,enumerable:!0,configurable:!0,writable:!0}):t[s]=u,t}function Ye(t){var s=Ue(t,"string");return typeof s=="symbol"?s:s+""}function Ue(t,s){if(typeof t!="object"||!t)return t;var u=t[Symbol.toPrimitive];if(u!==void 0){var c=u.call(t,s);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(t)}function je(t){return t&&t.map((s,u)=>w.createElement(s.tag,de({key:u},s.attr),je(s.child)))}function M(t){return s=>w.createElement(qe,ue({attr:de({},t.attr)},s),je(t.child))}function qe(t){var s=u=>{var{attr:c,size:h,title:v}=t,L=Be(t,Ie),R=h||u.size||"1em",x;return u.className&&(x=u.className),t.className&&(x=(x?x+" ":"")+t.className),w.createElement("svg",ue({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},u.attr,c,L,{className:x,style:de(de({color:t.color||u.color},u.style),t.style),height:R,width:R,xmlns:"http://www.w3.org/2000/svg"}),v&&w.createElement("title",null,v),t.children)};return ye!==void 0?w.createElement(ye.Consumer,null,u=>s(u)):s(Ce)}function We(t){return M({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z"},child:[]}]})(t)}function Xe(t){return M({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"},child:[]}]})(t)}function Ge(t){return M({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"},child:[]}]})(t)}function Ze(t){return M({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"},child:[]}]})(t)}function Je(t){return M({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M12.83 352h262.34A12.82 12.82 0 0 0 288 339.17v-38.34A12.82 12.82 0 0 0 275.17 288H12.83A12.82 12.82 0 0 0 0 300.83v38.34A12.82 12.82 0 0 0 12.83 352zm0-256h262.34A12.82 12.82 0 0 0 288 83.17V44.83A12.82 12.82 0 0 0 275.17 32H12.83A12.82 12.82 0 0 0 0 44.83v38.34A12.82 12.82 0 0 0 12.83 96zM432 160H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0 256H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"},child:[]}]})(t)}function Ke(t){return M({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M333.49 238a122 122 0 0 0 27-65.21C367.87 96.49 308 32 233.42 32H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h31.87v288H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h209.32c70.8 0 134.14-51.75 141-122.4 4.74-48.45-16.39-92.06-50.83-119.6zM145.66 112h87.76a48 48 0 0 1 0 96h-87.76zm87.76 288h-87.76V288h87.76a56 56 0 0 1 0 112z"},child:[]}]})(t)}function Qe(t){return M({attr:{viewBox:"0 0 544 512"},child:[{tag:"path",attr:{d:"M0 479.98L99.92 512l35.45-35.45-67.04-67.04L0 479.98zm124.61-240.01a36.592 36.592 0 0 0-10.79 38.1l13.05 42.83-50.93 50.94 96.23 96.23 50.86-50.86 42.74 13.08c13.73 4.2 28.65-.01 38.15-10.78l35.55-41.64-173.34-173.34-41.52 35.44zm403.31-160.7l-63.2-63.2c-20.49-20.49-53.38-21.52-75.12-2.35L190.55 183.68l169.77 169.78L530.27 154.4c19.18-21.74 18.15-54.63-2.35-75.13z"},child:[]}]})(t)}function et(t){return M({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M320 48v32a16 16 0 0 1-16 16h-62.76l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16H16a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h62.76l80-320H112a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z"},child:[]}]})(t)}function tt(t){return M({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"},child:[]}]})(t)}function nt(t){return M({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"},child:[]}]})(t)}function rt(t){return M({attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z"},child:[]}]})(t)}function ot(t){return M({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64v-96h160v96zm0-160H64v-96h160v96zm224 160H288v-96h160v96zm0-160H288v-96h160v96z"},child:[]}]})(t)}function at(t){return M({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 64h32v160c0 88.22 71.78 160 160 160s160-71.78 160-160V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H272a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h32v160a80 80 0 0 1-160 0V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm400 384H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"},child:[]}]})(t)}function lt(t){return M({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M2 20h20v4H2v-4zm3.49-3h2.42l1.27-3.58h5.65L16.09 17h2.42L13.25 3h-2.5L5.49 17zm4.42-5.61 2.03-5.79h.12l2.03 5.79H9.91z"},child:[]}]})(t)}function st(t){return M({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M20 8V5H6.39l3 3h1.83l-.55 1.28 2.09 2.1L14.21 8zM3.41 4.86 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21l1.41-1.41z"},child:[]}]})(t)}const it=["😀","😁","😂","đŸ¤Ŗ","😃","😄","😅","😉","😊","😍","😘","😜","😎","đŸ˜ĸ","😭","😡","🤔","🙄","😇","đŸĨ°","🤩","🤗","😴","😋","đŸ˜Ŧ","🤤","đŸ˜ļ‍đŸŒĢī¸","😷","🤕","🤑","🤠","😈","đŸ‘ģ","💀","🤖","đŸļ","🐱","đŸŧ","🐸","đŸĻ„","🐷","đŸĩ","🐰","đŸ¯","đŸĻ","🐮","🌞","🌙","⭐","🌈","đŸ”Ĩ","💧","â„ī¸","⚡","â˜€ī¸","🌸","🌹","🍎","🍕","🍩","🍔","🍟","🍇","🍉","🍓","🍒","đŸĨ­","đŸĨ‘","🎉","🎂","🎁","🎈","đŸŽļ","đŸŽĩ","🏆","âšŊ","🏀","🏸","🏏","đŸ•šī¸","👋","🤚","đŸ–ī¸","✋","🖖","👍","👎","👌","🤌","🤏","✊","👊","🤛","🤜","â˜ī¸","👆","👇","👈","👉","🤟","🤘","🤙","🙌","👏","🙏","âœī¸","💅","🤲","👏","đŸĢļ","👐"],Se=({exec:t,saveSelection:s,handleFileChange:u,handleFontSizeChange:c,handleFontFamilyChange:h,insertEmoji:v,handleLink:L,removeFormatting:R,visibleActions:x,className:F,style:P})=>{const T=w.useRef(null),D=w.useRef(null),E=w.useRef(null),[U,B]=w.useState(!1);w.useEffect(()=>{const m=O=>{!O.target.closest(".rte-emoji-popup")&&!O.target.closest("button[title='Emoji']")&&B(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const k=m=>{m.preventDefault();const O=m.currentTarget.dataset.command;if(O)switch(O){case"bold":case"italic":case"underline":case"insertUnorderedList":case"insertOrderedList":case"removeFormat":t(O);break;case"insertImage":{T.current?.click();break}default:console.warn("Unknown command:",O)}},Y=m=>{t("foreColor",m.target.value)},H=m=>{t("backColor",m.target.value)};return a.jsxs("div",{className:`rte-toolbar ${F||""}`,style:P,children:[x.bold&&a.jsx("button",{"data-command":"bold",title:"Bold",onMouseDown:k,children:a.jsx(Ke,{})}),x.italic&&a.jsx("button",{"data-command":"italic",title:"Italic",onMouseDown:k,children:a.jsx(et,{})}),x.underline&&a.jsx("button",{"data-command":"underline",title:"Underline",onMouseDown:k,children:a.jsx(at,{})}),x.unorderedList&&a.jsx("button",{"data-command":"insertUnorderedList",onMouseDown:k,title:"UnorderedList",children:a.jsx(nt,{})}),x.orderedList&&a.jsx("button",{"data-command":"insertOrderedList",title:"OrderedList",onMouseDown:k,children:a.jsx(Ze,{})}),x.link&&a.jsx("button",{"data-command":"createLink",title:"Link",onClick:L,children:a.jsx(tt,{})}),x.removeFormat&&a.jsx("button",{"data-command":"Remove format",title:"removeFormat",onMouseDown:m=>{m.preventDefault(),s(),R()},children:a.jsx(st,{})}),x.image&&a.jsx("button",{"data-command":"insertImage",title:"Image",onMouseDown:k,children:a.jsx(Ge,{})}),a.jsx("input",{type:"file",accept:"image/*",ref:T,style:{display:"none"},onChange:u}),x.emoji&&a.jsxs("div",{style:{position:"relative"},children:[a.jsx("button",{title:"Emoji",onMouseDown:m=>{m.preventDefault(),s(),B(O=>!O)},children:a.jsx(rt,{})}),U&&a.jsx("div",{className:"rte-emoji-popup",children:it.map(m=>a.jsx("span",{style:{fontSize:"20px",cursor:"pointer",textAlign:"center"},onMouseDown:O=>{O.preventDefault(),v(m),B(!1)},children:m},m))})]}),x.color&&a.jsxs("div",{style:{position:"relative"},children:[a.jsx("button",{title:"Text Color",onMouseDown:m=>{m.preventDefault(),s(),D.current?.click()},style:{display:"flex",alignItems:"center",justifyContent:"center",color:D.current?.value||"#000",fontSize:"18px"},children:a.jsx(lt,{})}),a.jsx("input",{ref:D,type:"color",defaultValue:"#000000",onChange:m=>{Y(m),(m.target.parentElement?.querySelector("button")).style.color=m.target.value},style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"}})]}),x.highlight&&a.jsxs("div",{style:{position:"relative"},children:[a.jsx("button",{title:"Highlight",onMouseDown:m=>{m.preventDefault(),s(),E.current?.click()},style:{display:"flex",alignItems:"center",justifyContent:"center",color:E.current?.value||"#000",fontSize:"18px"},children:a.jsx(Qe,{})}),a.jsx("input",{ref:E,type:"color",onChange:m=>{H(m),(m.target.parentElement?.querySelector("button")).style.color=m.target.value},defaultValue:"#000000",style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"}})]}),x.align&&a.jsxs(a.Fragment,{children:[a.jsx("button",{title:"Align Left",onMouseDown:m=>m.preventDefault(),onClick:()=>t("justifyLeft"),children:a.jsx(Je,{})}),a.jsx("button",{title:"Align Center",onMouseDown:m=>m.preventDefault(),onClick:()=>t("justifyCenter"),children:a.jsx(We,{})}),a.jsx("button",{title:"Align Right",onMouseDown:m=>m.preventDefault(),onClick:()=>t("justifyRight"),children:a.jsx(Xe,{})})]}),x.table&&a.jsx("button",{title:"Insert Table",onMouseDown:m=>m.preventDefault(),onClick:()=>t("insertTable"),children:a.jsx(ot,{})}),x.fontFamily&&a.jsxs("select",{className:"rte-dropdown",defaultValue:"",onMouseDown:()=>s(),onChange:h,children:[a.jsx("option",{value:"",disabled:!0,children:"Font Family"}),a.jsx("option",{value:"Arial",children:"Arial"}),a.jsx("option",{value:"Georgia",children:"Georgia"}),a.jsx("option",{value:"Times New Roman",children:"Times New Roman"}),a.jsx("option",{value:"Courier New",children:"Courier New"}),a.jsx("option",{value:"Verdana",children:"Verdana"})]}),x.fontSize&&a.jsxs("select",{className:"rte-dropdown",defaultValue:"",onMouseDown:()=>s(),onChange:c,children:[a.jsx("option",{value:"",disabled:!0,children:"Font Size"}),a.jsx("option",{value:"2",children:"Small "}),a.jsx("option",{value:"3",children:"Normal"}),a.jsx("option",{value:"4",children:"Medium"}),a.jsx("option",{value:"5",children:"Large"})]})]})},ct=({show:t,position:s,filtered:u,insertMention:c,onClose:h,query:v})=>{const L=w.useRef(null);return w.useEffect(()=>{const R=x=>{L.current&&!L.current.contains(x.target)&&h()};return t&&document.addEventListener("mousedown",R),()=>{document.removeEventListener("mousedown",R)}},[t,h]),t?a.jsx("ul",{ref:L,className:"rte-popup",style:{top:s.y,left:s.x},children:u.length>0?u.map(({key:R,value:x})=>{const F=R.toLowerCase(),P=v.toLowerCase(),T=F.indexOf(P);let D=R;if(T!==-1&&v.length>0){const E=T+v.length;D=R.substring(0,T)+`<span class="rte-highlight">${R.substring(T,E)}</span>`+R.substring(E)}return a.jsx("li",{onMouseDown:E=>{E.preventDefault(),c({key:R,value:x})},style:{padding:"6px 12px",cursor:"pointer",fontSize:"14px"},dangerouslySetInnerHTML:{__html:D},onMouseEnter:E=>E.currentTarget.style.background="#f0f0f0",onMouseLeave:E=>E.currentTarget.style.background="#fff"},x)}):a.jsx("li",{style:{padding:"6px 12px",color:"#999"},children:"No matches"})}):null};function Ee(t){return M({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Circle_Minus"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M15,11.5h0a.5.5,0,0,1,0,1H9a.5.5,0,0,1,0-1Z"},child:[]},{tag:"path",attr:{d:"M12,21.934A9.933,9.933,0,1,1,21.932,12,9.945,9.945,0,0,1,12,21.934ZM12,3.068A8.933,8.933,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.068Z"},child:[]}]}]}]})(t)}function ce(t){return M({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Circle_Plus"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M15,12.5H12.5V15a.5.5,0,0,1-1,0V12.5H9a.5.5,0,0,1,0-1h2.5V9a.5.5,0,0,1,1,0v2.5H15A.5.5,0,0,1,15,12.5Z"},child:[]},{tag:"path",attr:{d:"M12,21.932A9.934,9.934,0,1,1,21.932,12,9.944,9.944,0,0,1,12,21.932ZM12,3.065A8.934,8.934,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.065Z"},child:[]}]}]}]})(t)}const ut=({visible:t,x:s,y:u,onAction:c,onClose:h})=>{if(!t)return null;const v={top:u,left:s};return a.jsxs("div",{style:v,className:"rte-table-menu",onMouseLeave:h,children:[a.jsxs("button",{onClick:()=>c("insertRowAbove"),children:[a.jsx(ce,{})," Insert row above"]}),a.jsxs("button",{onClick:()=>c("insertRowBelow"),children:[a.jsx(ce,{})," Insert row below"]}),a.jsxs("button",{onClick:()=>c("insertColLeft"),children:[a.jsx(ce,{})," Insert col left"]}),a.jsxs("button",{onClick:()=>c("insertColRight"),children:[a.jsx(ce,{})," Insert col right"]}),a.jsxs("button",{onClick:()=>c("deleteRow"),children:[a.jsx(Ee,{})," Delete row"]}),a.jsxs("button",{onClick:()=>c("deleteCol"),children:[a.jsx(Ee,{})," Delete column"]})]})},Le=({html:t,className:s,style:u})=>{const c=h=>{const v=h.target;if(v.tagName==="A"){h.preventDefault();const L=v.href;L&&window.open(L,"_blank","noopener,noreferrer")}};return a.jsx("div",{className:`rte-preview ${s||""}`,style:u,onClick:c,dangerouslySetInnerHTML:{__html:t}})},dt=({visible:t,linkData:s,onClose:u,onInsert:c})=>{const[h,v]=w.useState(""),[L,R]=w.useState(""),[x,F]=w.useState(""),[P,T]=w.useState("_self");if(w.useEffect(()=>{t?(v(s.url||""),R(s.text||""),F(s.title||""),T(s.target||"_self")):(v(""),R(""),F(""),T("_self"))},[t,s]),!t)return null;const D=()=>{c({url:h,text:L,title:x,target:P})};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"rte-link-modal-overlay",onClick:u}),a.jsxs("div",{className:"rte-link-modal",children:[a.jsx("h4",{className:"rte-link-modal__title",children:h?"Edit Link":"Insert Link"}),a.jsx("input",{type:"text",className:"rte-link-modal__input",placeholder:"URL",value:h,onChange:E=>v(E.target.value)}),a.jsx("input",{type:"text",className:"rte-link-modal__input",placeholder:"Text to Display",value:L,onChange:E=>R(E.target.value)}),a.jsx("input",{type:"text",className:"rte-link-modal__input",placeholder:"Title",value:x,onChange:E=>F(E.target.value)}),a.jsxs("select",{className:"rte-link-modal__select",value:P,onChange:E=>T(E.target.value),children:[a.jsx("option",{value:"_self",children:"Same tab"}),a.jsx("option",{value:"_blank",children:"New tab"})]}),a.jsxs("div",{className:"rte-link-modal__actions",children:[a.jsx("button",{className:"rte-link-modal__btn",onClick:u,children:"Cancel"}),a.jsx("button",{className:"rte-link-modal__btn rte-link-modal__btn--ok",onClick:D,children:"OK"})]})]})]})},ft=({atSuggestions:t=[],showOutput:s=!1,showPreview:u=!1,toolbarConfig:c={link:!1,image:!1,emoji:!1,table:!1,color:!1,fontFamily:!1,fontSize:!1,highlight:!1},classNames:h={},styles:v={},handleGetHtml:L=()=>{}})=>{const R=w.useRef(null),[x,F]=w.useState("<p>Always bet on Prime!</p>"),[P,T]=w.useState(!1),[D,E]=w.useState({x:0,y:0}),[U,B]=w.useState([]),k=w.useRef(null),Y=w.useRef(null),[H,m]=w.useState({visible:!1,x:0,y:0}),[O,q]=w.useState(!1),W=w.useRef(null),[fe,ne]=w.useState({url:"",text:"",title:"",target:"_self"}),G={bold:!0,italic:!0,underline:!0,removeFormat:!0,unorderedList:!0,orderedList:!0,align:!0,link:c.link??!1,image:c.image??!1,emoji:c.emoji??!1,table:c.table??!1,color:c.color??!1,fontFamily:c.fontFamily??!1,fontSize:c.fontSize??!1,highlight:c.fontSize??!1},[me,re]=w.useState(""),z=()=>R.current,N=()=>{F(z()?.innerHTML??"");const e=ve();L?.(e)},oe=()=>{const e=window.getSelection();e?.rangeCount&&(k.current=e.getRangeAt(0))},$=()=>{const e=window.getSelection();e&&k.current&&(e.removeAllRanges(),e.addRange(k.current))},ae=(e,o)=>{const r=window.getSelection();r&&r.rangeCount>0&&(k.current=r.getRangeAt(0)),$(),document.execCommand(e,!1,o),N()};w.useEffect(()=>{const e=z();e&&!e.innerHTML&&(e.innerHTML=x),N()},[]),w.useEffect(()=>()=>{document.removeEventListener("mousemove",null),document.removeEventListener("mouseup",null)},[]);const Z=e=>{for(;e&&e.nodeName!=="LI";)e=e.parentNode;return e},le=e=>{let o=0,r=e.parentElement;for(;r;)(r.tagName==="UL"||r.tagName==="OL")&&o++,r=r.parentElement;return o},se=e=>{const o=e.querySelector("li"),r=o?le(o):1;if(e.querySelector("[data-hidden-array-start]"))return;const l=`{{#arrayData${r>1?r:""}}}`,g=`{{/arrayData${r>1?r:""}}}`,i=document.createElement("span");i.textContent=l,i.style.display="none",i.setAttribute("data-hidden-array-start","true"),e.insertBefore(i,e.firstChild);const f=document.createElement("span");f.textContent=g,f.style.display="none",f.setAttribute("data-hidden-array-end","true"),e.appendChild(f)},J=e=>{const o=window.getSelection();if(!o?.rangeCount)return;const r=o.getRangeAt(0),l=Z(r.startContainer);let g,i;if(l){let d=l.querySelector(e);d||(d=document.createElement(e),d.style.margin="0",d.style.paddingLeft="20px",l.appendChild(d)),i=d,g=document.createElement("li"),g.textContent="​",i.appendChild(g)}else{if(document.execCommand(e==="ul"?"insertUnorderedList":"insertOrderedList"),i=z()?.querySelector(`${e}:last-child`),!i)return;g=i.querySelector("li:last-child")}se(i);const f=document.createRange();f.setStart(g,0),f.collapse(!0),o.removeAllRanges(),o.addRange(f),z()?.focus(),N()},n=(e,o)=>{e==="insertOrderedList"?J("ol"):e==="insertUnorderedList"?J("ul"):ae(e,o),e==="insertTable"&&he()},p=e=>{const o=document.createElement("span");o.textContent="​",e.insertNode(o),e.setStartAfter(o),e.collapse(!0);const r=o.getBoundingClientRect();o.remove(),E({x:r.left,y:r.bottom+window.scrollY}),B(t||[]),T(!0),Y.current=e.cloneRange()},C=()=>{const e=window.getSelection();if(!e||e.rangeCount===0)return null;const o=e.anchorNode;let r=e.anchorOffset;if(!o)return null;let l=o;for(l.nodeType!==Node.TEXT_NODE&&(l.childNodes&&l.childNodes[r]?l=l.childNodes[r]:l=o.previousSibling);l;){if(l.nodeType===Node.TEXT_NODE){const g=l.textContent||"",i=l===o?r:g.length,f=g.lastIndexOf("@",i-1);if(f!==-1){const d=document.createRange();return d.setStart(l,f),d.setEnd(l,i),d}}l=l.previousSibling}return null},_=e=>{const o=window.getSelection();if(!o)return;const r=C();r?(o.removeAllRanges(),o.addRange(r)):Y.current&&(o.removeAllRanges(),o.addRange(Y.current));const l=document.createElement("span");l.textContent=`{{${e.key}}}`,l.style.color="#007bff",l.style.display="inline",l.contentEditable="false",l.setAttribute("data-mention",e.value||e.key||"");try{const g=o.rangeCount?o.getRangeAt(0):null;if(g)g.deleteContents(),g.insertNode(l);else{const d=document.createRange(),b=z();d.selectNodeContents(b),d.collapse(!1),d.insertNode(l)}const i=document.createTextNode(" ");l.after(i);const f=document.createRange();f.setStartAfter(i),f.collapse(!0),o.removeAllRanges(),o.addRange(f)}catch(g){console.error("insertMention error:",g)}T(!1),z()?.focus(),N()},X=e=>{const o=e.key.toLowerCase();if((e.ctrlKey||e.metaKey)&&["b","i","u"].includes(o)&&(e.preventDefault(),n(o==="b"?"bold":o==="i"?"italic":o==="u"?"underline":"")),e.shiftKey&&e.key==="2"&&e.preventDefault(),e.key==="Enter"){const r=window.getSelection(),l=r?.anchorNode?Z(r.anchorNode):null;if(!l)return;if(l.textContent?.replace(/\u200B/g,"").trim()===""){e.preventDefault();const i=l.parentElement,f=i?.closest("li");if(f){i?.removeChild(l);const d=document.createElement("p");d.innerHTML="<br />",f.parentElement?.insertBefore(d,f.nextSibling);const b=document.createRange();b.setStart(d,0),b.collapse(!0),r?.removeAllRanges(),r?.addRange(b)}else{const d=l.closest("ul, ol");if(d){const b=document.createElement("p");b.innerHTML="<br />",d.parentElement?.insertBefore(b,d.nextSibling),d.removeChild(l);const j=document.createRange();j.setStart(b,0),j.collapse(!0),r?.removeAllRanges(),r?.addRange(j)}}N()}}},K=e=>{if(e.data==="@"){const r=window.getSelection();if(!r?.rangeCount)return;setTimeout(()=>{p(r.getRangeAt(0)),re(""),B(t),T(!0)},0);return}if(P){setTimeout(()=>S(),0);return}},S=()=>{if(N(),!P)return;const e=window.getSelection();if(!e||!e.anchorNode)return;const r=(e.anchorNode.textContent||"").match(/@([a-zA-Z0-9_]*)$/);if(!r){T(!1);return}const l=r[1].toLowerCase();re(l);const g=t.filter(i=>i.key.toLowerCase().includes(l));B(g)},V=e=>{const o=e.target.files?.[0];if(!o)return;const r=new FileReader;r.onload=l=>{const g=l.target?.result;$();const i=window.getSelection();let f=i&&i.rangeCount?i.getRangeAt(0):null;const d=document.createElement("img");d.src=g,d.alt=o.name||"image",d.className="rte-inserted-image",d.contentEditable="true";const b=z();if(!f||!b){b?.appendChild(d);const A=document.createTextNode(" ");b?.appendChild(A);const I=document.createRange();I.setStartAfter(A),I.collapse(!0),i?.removeAllRanges(),i?.addRange(I),b?.focus(),N(),e.target.value="";return}f.deleteContents(),f.insertNode(d);const j=document.createTextNode(" ");d.after(j);const y=document.createRange();y.setStartAfter(j),y.collapse(!0),i.removeAllRanges(),i.addRange(y),b.focus(),N(),e.target.value=""},r.readAsDataURL(o)},Q=e=>{$();const o=window.getSelection();if(!o?.rangeCount)return;const r=o.getRangeAt(0),l=document.createTextNode(e);r.insertNode(l),r.setStartAfter(l),r.collapse(!0),o.removeAllRanges(),o.addRange(r),z()?.focus(),N()},he=()=>{$();const e=document.createElement("table");e.style.borderCollapse="collapse",e.style.width="100%",e.style.border="1px solid #ccc",e.style.margin="8px 0",e.style.position="relative";const o=document.createElement("thead"),r=document.createElement("tbody"),l=document.createElement("tr"),g=document.createElement("tr");for(let d=0;d<2;d++){const b=document.createElement("th");b.textContent=`Header ${d+1}`,b.style.border="1px solid #999",b.style.padding="8px",b.style.position="relative";const j=document.createElement("td");j.textContent=`Row 1 Col ${d+1}`,j.style.border="1px solid #999",j.style.padding="8px",j.style.position="relative",pe(b),pe(j),l.appendChild(b),g.appendChild(j)}o.appendChild(l),r.appendChild(g),e.appendChild(o),e.appendChild(r),Me(e),_e(e);const i=window.getSelection();if(!i?.rangeCount)return;i.getRangeAt(0).insertNode(e),N()},_e=e=>{const o=document.createElement("div");Object.assign(o.style,{position:"absolute",width:"14px",height:"14px",right:"0",bottom:"0",background:"rgba(0,0,0,0.25)",cursor:"nwse-resize",zIndex:"20",borderRadius:"2px"});let r=0,l=0,g=0,i=0;o.addEventListener("mousedown",f=>{f.preventDefault(),r=f.clientX,l=f.clientY;const d=e.getBoundingClientRect();g=d.width,i=d.height;const b=y=>{const A=Math.max(100,g+(y.clientX-r)),I=Math.max(60,i+(y.clientY-l));e.style.width=`${A}px`,e.style.height=`${I}px`,N()},j=()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",j),N()};document.addEventListener("mousemove",b),document.addEventListener("mouseup",j)}),e.appendChild(o)},pe=e=>{const o=document.createElement("div"),r=document.createElement("div");Object.assign(o.style,{position:"absolute",right:"0",top:"0",width:"6px",height:"100%",cursor:"col-resize",background:"rgba(0,0,0,0.15)",zIndex:"10"}),Object.assign(r.style,{position:"absolute",bottom:"0",left:"0",width:"100%",height:"6px",cursor:"row-resize",background:"rgba(0,0,0,0.15)",zIndex:"10"}),Te(e,o,r),e.appendChild(o),e.appendChild(r)},Te=(e,o,r)=>{let l=0,g=0,i=0,f=0;o.addEventListener("mousedown",y=>{y.preventDefault(),l=y.clientX,i=e.offsetWidth,document.addEventListener("mousemove",d),document.addEventListener("mouseup",j)}),r.addEventListener("mousedown",y=>{y.preventDefault(),g=y.clientY,f=e.offsetHeight,document.addEventListener("mousemove",b),document.addEventListener("mouseup",j)});const d=y=>{const A=i+(y.clientX-l);e.style.width=`${Math.max(30,A)}px`},b=y=>{const A=f+(y.clientY-g);e.style.height=`${Math.max(20,A)}px`},j=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",j)}},ke=e=>{const r=e.target.closest("td, th");r&&(e.preventDefault(),document.querySelectorAll(".rte-cell-highlight").forEach(l=>l.classList.remove("rte-cell-highlight")),r.classList.add("rte-cell-highlight"),m({visible:!0,x:e.clientX,y:e.clientY,cell:r}))},ge=()=>{document.querySelectorAll(".rte-cell-highlight").forEach(e=>e.classList.remove("rte-cell-highlight"))},Ne=e=>{if(!H.cell)return;const o=H.cell.closest("table"),r=H.cell.cellIndex,l=H.cell.parentElement.rowIndex,g=i=>{const f=i.tagName.toLowerCase(),d=document.createElement(f);return d.textContent=i.textContent||"",d.style.cssText=i.style.cssText,pe(d),d};switch(e){case"insertRowAbove":{const i=o.rows[l],f=o.insertRow(l);Array.from(i.cells).forEach(d=>{f.appendChild(g(d))});break}case"insertRowBelow":{const i=o.rows[l],f=o.insertRow(l+1);Array.from(i.cells).forEach(d=>{f.appendChild(g(d))});break}case"insertColLeft":{Array.from(o.rows).forEach(i=>{const f=i.cells[r];i.insertBefore(g(f),f)});break}case"insertColRight":{Array.from(o.rows).forEach(i=>{const f=i.cells[r];i.insertBefore(g(f),f.nextSibling)});break}case"deleteRow":o.rows.length>1&&o.deleteRow(l);break;case"deleteCol":Array.from(o.rows).forEach(i=>{i.cells[r]&&i.deleteCell(r)});break}N(),m({...H,visible:!1}),ge()},Me=e=>{const o=e.querySelector("tbody");if(!o||o.querySelector("[data-hidden-table-start]"))return;const r=document.createElement("span");r.textContent="{{#tableData}}",r.style.display="none",r.setAttribute("data-hidden-table-start","true"),o.insertBefore(r,o.firstChild);const l=document.createElement("span");l.textContent="{{/tableData}}",l.style.display="none",l.setAttribute("data-hidden-table-end","true"),o.appendChild(l)},ve=()=>{const e=z();if(!e)return x;const o=e.cloneNode(!0);return o.querySelectorAll(".rte-cell-highlight").forEach(r=>{r.classList.remove("rte-cell-highlight")}),o.querySelectorAll("div").forEach(r=>{(r.style.cursor==="col-resize"||r.style.cursor==="row-resize"||r.style.cursor==="nwse-resize")&&r.remove()}),o.innerHTML},Ae=()=>{oe(),W.current=k.current,ne({url:"",text:"",title:"",target:"_self"}),q(!0)},Oe=e=>{const o=window.getSelection();if(!o||!W.current)return;o.removeAllRanges(),o.addRange(W.current);let r=e.url.trim();/^https?:\/\//i.test(r)||(r="https://"+r);const l=document.createElement("a");l.href=r,l.style.cursor="pointer",l.style.outline="none",l.textContent=e.text||r,l.title=e.title,l.target=e.target,l.contentEditable="true";const g=o.getRangeAt(0);g.deleteContents(),g.insertNode(l);const i=document.createTextNode(" ");l.after(i);const f=document.createRange();f.setStartAfter(i),f.collapse(!0),o.removeAllRanges(),o.addRange(f),q(!1),N()},ze=e=>{const o=e.target;if(o.tagName==="A"){const r=o;if(e.ctrlKey||e.metaKey){window.open(r.href,"_blank","noopener,noreferrer");return}e.preventDefault();const l=document.createRange();l.selectNode(r),W.current=l,ne({url:r.href,text:r.textContent||r.href,title:r.title,target:r.target}),q(!0)}},Pe=()=>{const e=z();if(!e)return;const o=window.getSelection();if((!o||o.rangeCount===0)&&k.current){const y=window.getSelection();y?.removeAllRanges(),y?.addRange(k.current)}const r=window.getSelection();if(!r||r.rangeCount===0)return;const l=r.getRangeAt(0);$(),document.execCommand("removeFormat",!1);const g=l.cloneContents(),i=document.createElement("div");i.appendChild(g);const f=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),d=[];for(;f.nextNode();){const y=f.currentNode,A=y.tagName.toUpperCase(),I=y.getAttribute&&y.getAttribute("data-mention")!==null;A!=="A"&&!I&&d.push(y)}for(let y=d.length-1;y>=0;y--){const A=d[y],I=A.parentNode;if(I){for(;A.firstChild;)I.insertBefore(A.firstChild,A);I.removeChild(A)}}i.querySelectorAll("[style]").forEach(y=>y.removeAttribute("style")),l.deleteContents();const b=document.createDocumentFragment();for(;i.firstChild;)b.appendChild(i.firstChild);l.insertNode(b);const j=document.createRange();j.setStartAfter(l.endContainer.nodeType===Node.TEXT_NODE?l.endContainer:l.startContainer),j.collapse(!0),r.removeAllRanges(),r.addRange(j),e.normalize(),N()};return a.jsxs("div",{className:`rte-wrapper ${h?.wrapper||""}`,style:v.wrapper,children:[a.jsxs("div",{style:{flex:1},children:[a.jsx(Se,{exec:n,saveSelection:oe,handleFileChange:V,handleFontSizeChange:e=>n("fontSize",e.target.value),handleFontFamilyChange:e=>n("fontName",e.target.value),insertEmoji:Q,handleLink:Ae,removeFormatting:Pe,visibleActions:G,className:h.toolbar,style:v.toolbar}),a.jsx("div",{ref:R,className:`rte-editor ${h?.editor||""}`,style:v.editor,contentEditable:!0,suppressContentEditableWarning:!0,onInput:S,onKeyDown:X,onBeforeInput:K,onContextMenu:ke,onClick:ze}),a.jsx(ct,{show:P,position:D,filtered:U,insertMention:_,onClose:()=>T(!1),query:me}),s&&a.jsxs("div",{className:`rte-output ${h?.output||""}`,style:v.output,children:[a.jsx("h4",{children:"Output HTML:"}),a.jsx("p",{children:x})]}),a.jsx(ut,{visible:H.visible,x:H.x,y:H.y,onAction:Ne,onClose:()=>{m({...H,visible:!1}),ge()}}),a.jsx(dt,{visible:O,linkData:fe,onClose:()=>q(!1),onInsert:Oe})]}),u?a.jsx(Le,{className:h.preview,style:v.preview,html:ve()}):null]})};exports.RichTextEditor=ft;exports.RtePreview=Le;exports.RteToolbar=Se;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryzeup/richtexteditor",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A React Rich Text Editor component",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -33,8 +33,8 @@
33
33
  "prepare": "npm run build"
34
34
  },
35
35
  "peerDependencies": {
36
- "react": "^18.0.0 || ^19.0.0",
37
- "react-dom": "^18.0.0 || ^19.0.0"
36
+ "react": ">=16.13.1",
37
+ "react-dom": ">=16.13.1"
38
38
  },
39
39
  "dependencies": {
40
40
  "react-icons": "^5.5.0"