@makebot.it/react 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.
- package/dist/commands.js +1 -1
- package/dist/index.d.ts +0 -0
- package/dist/index.js +1 -1
- package/dist/web.d.ts +0 -0
- package/dist/web.js +62 -1251
- package/package.json +2 -2
- /package/dist/{chunk-GFIEK2FB.js → chunk-UYDUWQU3.js} +0 -0
package/dist/commands.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c}from"./chunk-
|
|
1
|
+
import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c}from"./chunk-UYDUWQU3.js";export{o as close,x as hidePreviewMessage,r as open,b as reload,c as resolveButtonSize,a as sendCommand,m as setInputValue,t as setPrefilledVariables,e as showPreviewMessage,f as toggle,p as unmount};
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as R,b as k,c as h,d as S,e as g,f as B,g as z,h as v,i as x,j as w,k as i}from"./chunk-
|
|
1
|
+
import{a as R,b as k,c as h,d as S,e as g,f as B,g as z,h as v,i as x,j as w,k as i}from"./chunk-UYDUWQU3.js";import{useEffect as m,useRef as b}from"react";import{jsx as d}from"react/jsx-runtime";var f=({style:e,className:t,...r})=>{let n=b(null);return m(()=>{let o=!1;return(async()=>{if(await import("./web.js"),await customElements.whenDefined("makebot-standard"),!n.current||o)return;let{makebot:l,...p}=r;Object.assign(n.current,p,{makebot:l})})().catch(l=>{console.error("Failed to initialize makebot-standard",l)}),()=>{o=!0}},[r]),d("makebot-standard",{ref:n,style:e,class:t})};import{useCallback as E,useEffect as c,useRef as u}from"react";import{jsx as y}from"react/jsx-runtime";var P=e=>{let t=u(null),r=u(null),n=E(a=>{let l=document.createElement("makebot-popup");if(r.current=l,o(r.current,a),!t.current){console.warn("N\xE3o foi poss\xEDvel anexar o popup ao cont\xEAiner porque containerRef.current \xE9 nulo");return}t.current?.append(r.current)},[]);c(()=>{r.current||n(e),o(r.current,e)},[n,e]),c(()=>(import("./web.js"),()=>{r.current?.remove(),r.current=null}),[]);let o=(a,l)=>{Object.assign(a,l)};return y("div",{ref:t})};import{useEffect as s,useMemo as T,useRef as M}from"react";import{jsx as L}from"react/jsx-runtime";var H=e=>{let t=M(null);s(()=>{import("./web.js")},[]),s(()=>{if(e.theme?.position==="static"&&!t.current)return;t.current||(t.current=document.createElement("makebot-bubble"),document.body.prepend(t.current));let{makebot:n,...o}=e;Object.assign(t.current,o,{makebot:n})},[e]),s(()=>()=>{e.theme?.position!=="static"&&(t.current?.remove(),t.current=null)},[e.theme?.position]);let r=T(()=>i(e.theme?.button?.size),[e.theme?.button?.size]);return e.theme?.position==="static"?L("makebot-bubble",{ref:t,style:{display:"inline-flex",width:r,height:r}}):null};export{H as Bubble,P as Popup,f as Standard,R as close,v as hidePreviewMessage,k as open,w as reload,i as resolveButtonSize,x as sendCommand,g as setInputValue,z as setPrefilledVariables,h as showPreviewMessage,S as toggle,B as unmount};
|
package/dist/web.d.ts
CHANGED
|
File without changes
|