@makebot.it/react 1.0.2
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/Bubble.d.ts +17 -0
- package/dist/Bubble.d.ts.map +1 -0
- package/dist/Popup.d.ts +15 -0
- package/dist/Popup.d.ts.map +1 -0
- package/dist/Standard.d.ts +18 -0
- package/dist/Standard.d.ts.map +1 -0
- package/dist/chunk-GFIEK2FB.js +1 -0
- package/dist/commands.d.ts +2 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/web.d.ts +2 -0
- package/dist/web.d.ts.map +1 -0
- package/dist/web.js +1901 -0
- package/package.json +31 -0
package/dist/Bubble.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type BubbleProps } from "@makebot.it/js";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
type Props = BubbleProps & {
|
|
4
|
+
inlineStyle?: {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
declare global {
|
|
9
|
+
namespace JSX {
|
|
10
|
+
interface IntrinsicElements {
|
|
11
|
+
"makebot-bubble": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export declare const Bubble: (props: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=Bubble.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bubble.d.ts","sourceRoot":"","sources":["../src/Bubble.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,KAAK,GAAG,WAAW,GAAG;IACzB,WAAW,CAAC,EAAE;QACZ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;CACH,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,gBAAgB,EAAE,KAAK,CAAC,iBAAiB,CACvC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,WAAW,CACZ,CAAC;SACH;KACF;CACF;AAID,eAAO,MAAM,MAAM,GAAI,OAAO,KAAK,mDA0ClC,CAAC"}
|
package/dist/Popup.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PopupProps } from "@makebot.it/js";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
type Props = PopupProps;
|
|
4
|
+
declare global {
|
|
5
|
+
namespace JSX {
|
|
6
|
+
interface IntrinsicElements {
|
|
7
|
+
"makebot-popup": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
|
|
8
|
+
class?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export declare const Popup: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=Popup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../src/Popup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,KAAK,GAAG,UAAU,CAAC;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,eAAe,EAAE,KAAK,CAAC,iBAAiB,CACtC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,WAAW,CACZ,GAAG;gBAAE,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;SACxB;KACF;CACF;AAID,eAAO,MAAM,KAAK,GAAI,OAAO,KAAK,4CAqCjC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BotProps } from "@makebot.it/js";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
type Props = BotProps & {
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
declare global {
|
|
8
|
+
namespace JSX {
|
|
9
|
+
interface IntrinsicElements {
|
|
10
|
+
"makebot-standard": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
|
|
11
|
+
class?: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export declare const Standard: ({ style, className, ...assignableProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=Standard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Standard.d.ts","sourceRoot":"","sources":["../src/Standard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,KAAK,GAAG,QAAQ,GAAG;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,kBAAkB,EAAE,KAAK,CAAC,iBAAiB,CACzC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,WAAW,CACZ,GAAG;gBAAE,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;SACxB;KACF;CACF;AAID,eAAO,MAAM,QAAQ,GAAI,0CAA0C,KAAK,4CAyBvE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=({id:e}={})=>{let s={isFromMakebot:!0,command:"close",id:e};window.postMessage(s)},i=({id:e}={})=>{let s={isFromMakebot:!0,command:"open",id:e};window.postMessage(s)},d=(e,{id:s}={})=>{let a={isFromMakebot:!0,command:"showPreviewMessage",message:e,id:s};window.postMessage(a)},t=({id:e}={})=>{let s={isFromMakebot:!0,command:"toggle",id:e};window.postMessage(s)},m=(e,{id:s}={})=>{let a={isFromMakebot:!0,command:"setInputValue",value:e,id:s};window.postMessage(a)},r=({id:e}={})=>{let s={isFromMakebot:!0,command:"unmount",id:e};window.postMessage(s)},n=(e,{id:s}={})=>{let a={isFromMakebot:!0,command:"setPrefilledVariables",variables:e,id:s};window.postMessage(a)},l=({id:e}={})=>{let s={isFromMakebot:!0,command:"hidePreviewMessage",id:e};window.postMessage(s)},w=(e,{id:s}={})=>{let a={isFromMakebot:!0,command:"sendCommand",text:e,id:s};window.postMessage(a)},p=({id:e}={})=>{let s={isFromMakebot:!0,command:"reload",id:e};window.postMessage(s)},M=(e,{isHidden:s=!1}={})=>s?"0px":e==="large"?"64px":e==="medium"||!e?"48px":typeof e=="string"&&/^\d+px$/.test(e.trim())?e.trim():(console.warn("[Makebot] Tamanho de bot\xE3o inv\xE1lido. Use 'm\xE9dio', 'grande' ou um valor em pixels expl\xEDcita (ex.: '52px')."),"48px");export{o as a,i as b,d as c,t as d,m as e,r as f,n as g,l as h,w as i,p as j,M as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/dist/commands.js
ADDED
|
@@ -0,0 +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-GFIEK2FB.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
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +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-GFIEK2FB.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
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC"}
|