@super_studio/ecforce-ai-agent-react 1.1.0-canary.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chatbot-frame.d.mts +2 -2
- package/dist/components/chatbot-sheet.d.mts +2 -2
- package/dist/components/chatbot-sheet.d.mts.map +1 -1
- package/dist/components/lottie-ai-icon.mjs +6 -8
- package/dist/components/lottie-ai-icon.mjs.map +1 -1
- package/dist/components/sheet.d.mts +2 -2
- package/dist/components/tooltip.d.mts +2 -2
- package/package.json +1 -1
- package/src/components/lottie-ai-icon.tsx +5 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/chatbot-frame.d.ts
|
|
4
4
|
type ChatbotFrameProps = {
|
|
@@ -37,7 +37,7 @@ declare function ChatbotFrame({
|
|
|
37
37
|
enabled,
|
|
38
38
|
url,
|
|
39
39
|
className
|
|
40
|
-
}: ChatbotFrameProps):
|
|
40
|
+
}: ChatbotFrameProps): react_jsx_runtime1.JSX.Element;
|
|
41
41
|
type SessionData = {
|
|
42
42
|
token: string;
|
|
43
43
|
expiresAt: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChatbotFrameProps } from "./chatbot-frame.mjs";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/components/chatbot-sheet.d.ts
|
|
6
6
|
type ChatbotSheetProps = ChatbotFrameProps & {
|
|
@@ -9,7 +9,7 @@ type ChatbotSheetProps = ChatbotFrameProps & {
|
|
|
9
9
|
declare function ChatbotSheet({
|
|
10
10
|
sheetStyle,
|
|
11
11
|
...props
|
|
12
|
-
}: ChatbotSheetProps):
|
|
12
|
+
}: ChatbotSheetProps): react_jsx_runtime2.JSX.Element;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { ChatbotSheet };
|
|
15
15
|
//# sourceMappingURL=chatbot-sheet.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot-sheet.d.mts","names":[],"sources":["../../src/components/chatbot-sheet.tsx"],"sourcesContent":[],"mappings":";;;;;KAeK,iBAAA,GAAoB;eACV,KAAA,CAAM;;AADhB,iBAIW,YAAA,CAJS;EAAA,UAAA;EAAA,
|
|
1
|
+
{"version":3,"file":"chatbot-sheet.d.mts","names":[],"sources":["../../src/components/chatbot-sheet.tsx"],"sourcesContent":[],"mappings":";;;;;KAeK,iBAAA,GAAoB;eACV,KAAA,CAAM;;AADhB,iBAIW,YAAA,CAJS;EAAA,UAAA;EAAA,GAAA;AACS,CAAb,EAGkC,iBAHrB,CAAA,EAGsC,kBAAA,CAAA,GAAA,CAAA,OAHtC"}
|
|
@@ -4,17 +4,17 @@ import * as React$1 from "react";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/lottie-ai-icon.tsx
|
|
7
|
-
function LottieAiIcon({ src, width = 18, height = 18, loop = true, autoplay = false,
|
|
7
|
+
function LottieAiIcon({ src, width = 18, height = 18, loop = true, autoplay = false, fallback }) {
|
|
8
8
|
const containerRef = React$1.useRef(null);
|
|
9
9
|
const [ready, setReady] = React$1.useState(false);
|
|
10
10
|
React$1.useEffect(() => {
|
|
11
11
|
if (typeof window === "undefined") return;
|
|
12
|
-
if (!document.querySelector("script[data-dotlottie-
|
|
12
|
+
if (!document.querySelector("script[data-dotlottie-wc]")) {
|
|
13
13
|
const scriptEl = document.createElement("script");
|
|
14
14
|
scriptEl.type = "module";
|
|
15
15
|
scriptEl.async = true;
|
|
16
|
-
scriptEl.src = "https://unpkg.com/@dotlottie
|
|
17
|
-
scriptEl.setAttribute("data-dotlottie-
|
|
16
|
+
scriptEl.src = "https://unpkg.com/@lottiefiles/dotlottie-wc@0.9.8/dist/dotlottie-wc.js";
|
|
17
|
+
scriptEl.setAttribute("data-dotlottie-wc", "true");
|
|
18
18
|
scriptEl.onload = () => setReady(true);
|
|
19
19
|
scriptEl.onerror = () => setReady(false);
|
|
20
20
|
document.head.appendChild(scriptEl);
|
|
@@ -24,12 +24,11 @@ function LottieAiIcon({ src, width = 18, height = 18, loop = true, autoplay = fa
|
|
|
24
24
|
if (!ready || !containerRef.current) return;
|
|
25
25
|
const container = containerRef.current;
|
|
26
26
|
container.innerHTML = "";
|
|
27
|
-
const player = document.createElement("dotlottie-
|
|
27
|
+
const player = document.createElement("dotlottie-wc");
|
|
28
28
|
player.setAttribute("src", src);
|
|
29
29
|
player.setAttribute("style", `width:${width}px;height:${height}px`);
|
|
30
30
|
if (loop) player.setAttribute("loop", "");
|
|
31
31
|
if (autoplay) player.setAttribute("autoplay", "");
|
|
32
|
-
if (hover) player.setAttribute("hover", "");
|
|
33
32
|
container.appendChild(player);
|
|
34
33
|
return () => {
|
|
35
34
|
container.innerHTML = "";
|
|
@@ -40,8 +39,7 @@ function LottieAiIcon({ src, width = 18, height = 18, loop = true, autoplay = fa
|
|
|
40
39
|
width,
|
|
41
40
|
height,
|
|
42
41
|
loop,
|
|
43
|
-
autoplay
|
|
44
|
-
hover
|
|
42
|
+
autoplay
|
|
45
43
|
]);
|
|
46
44
|
return /* @__PURE__ */ jsx("div", {
|
|
47
45
|
ref: containerRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lottie-ai-icon.mjs","names":["React"],"sources":["../../src/components/lottie-ai-icon.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\ntype LottieAiIconProps = {\n src: string;\n width?: number;\n height?: number;\n loop?: boolean;\n autoplay?: boolean;\n
|
|
1
|
+
{"version":3,"file":"lottie-ai-icon.mjs","names":["React"],"sources":["../../src/components/lottie-ai-icon.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\ntype LottieAiIconProps = {\n src: string;\n width?: number;\n height?: number;\n loop?: boolean;\n autoplay?: boolean;\n fallback?: React.ReactNode;\n};\n\nexport function LottieAiIcon({\n src,\n width = 18,\n height = 18,\n loop = true,\n autoplay = false,\n fallback,\n}: LottieAiIconProps) {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const [ready, setReady] = React.useState(false);\n\n React.useEffect(() => {\n if (typeof window === \"undefined\") return;\n\n const existing = document.querySelector(\"script[data-dotlottie-wc]\");\n if (!existing) {\n const scriptEl = document.createElement(\"script\");\n scriptEl.type = \"module\";\n scriptEl.async = true;\n scriptEl.src =\n \"https://unpkg.com/@lottiefiles/dotlottie-wc@0.9.8/dist/dotlottie-wc.js\";\n scriptEl.setAttribute(\"data-dotlottie-wc\", \"true\");\n scriptEl.onload = () => setReady(true);\n scriptEl.onerror = () => setReady(false);\n document.head.appendChild(scriptEl);\n } else {\n setReady(true);\n }\n }, []);\n\n React.useEffect(() => {\n if (!ready || !containerRef.current) return;\n const container = containerRef.current;\n container.innerHTML = \"\";\n const player = document.createElement(\"dotlottie-wc\");\n player.setAttribute(\"src\", src);\n player.setAttribute(\"style\", `width:${width}px;height:${height}px`);\n if (loop) player.setAttribute(\"loop\", \"\");\n if (autoplay) player.setAttribute(\"autoplay\", \"\");\n container.appendChild(player);\n return () => {\n container.innerHTML = \"\";\n };\n }, [ready, src, width, height, loop, autoplay]);\n\n return (\n <div ref={containerRef} aria-hidden=\"true\">\n {!ready &&\n (fallback ?? (\n <svg\n width={width}\n height={height}\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n />\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;AAaA,SAAgB,aAAa,EAC3B,KACA,QAAQ,IACR,SAAS,IACT,OAAO,MACP,WAAW,OACX,YACoB;CACpB,MAAM,eAAeA,QAAM,OAAuB,KAAK;CACvD,MAAM,CAAC,OAAO,YAAYA,QAAM,SAAS,MAAM;AAE/C,SAAM,gBAAgB;AACpB,MAAI,OAAO,WAAW,YAAa;AAGnC,MAAI,CADa,SAAS,cAAc,4BAA4B,EACrD;GACb,MAAM,WAAW,SAAS,cAAc,SAAS;AACjD,YAAS,OAAO;AAChB,YAAS,QAAQ;AACjB,YAAS,MACP;AACF,YAAS,aAAa,qBAAqB,OAAO;AAClD,YAAS,eAAe,SAAS,KAAK;AACtC,YAAS,gBAAgB,SAAS,MAAM;AACxC,YAAS,KAAK,YAAY,SAAS;QAEnC,UAAS,KAAK;IAEf,EAAE,CAAC;AAEN,SAAM,gBAAgB;AACpB,MAAI,CAAC,SAAS,CAAC,aAAa,QAAS;EACrC,MAAM,YAAY,aAAa;AAC/B,YAAU,YAAY;EACtB,MAAM,SAAS,SAAS,cAAc,eAAe;AACrD,SAAO,aAAa,OAAO,IAAI;AAC/B,SAAO,aAAa,SAAS,SAAS,MAAM,YAAY,OAAO,IAAI;AACnE,MAAI,KAAM,QAAO,aAAa,QAAQ,GAAG;AACzC,MAAI,SAAU,QAAO,aAAa,YAAY,GAAG;AACjD,YAAU,YAAY,OAAO;AAC7B,eAAa;AACX,aAAU,YAAY;;IAEvB;EAAC;EAAO;EAAK;EAAO;EAAQ;EAAM;EAAS,CAAC;AAE/C,QACE,oBAAC;EAAI,KAAK;EAAc,eAAY;YACjC,CAAC,UACC,sDACC,oBAAC;GACQ;GACC;GACR,SAAQ;GACR,MAAK;IACL;GAEF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
3
3
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
4
4
|
|
|
5
5
|
//#region src/components/sheet.d.ts
|
|
6
6
|
declare function Sheet({
|
|
7
7
|
...props
|
|
8
|
-
}: React$1.ComponentProps<typeof SheetPrimitive.Root>):
|
|
8
|
+
}: React$1.ComponentProps<typeof SheetPrimitive.Root>): react_jsx_runtime3.JSX.Element;
|
|
9
9
|
declare const SheetTrigger: React$1.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
10
10
|
declare const SheetClose: React$1.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
11
11
|
declare const SheetContent: React$1.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/tooltip.d.ts
|
|
4
4
|
type Side = "top" | "right" | "bottom" | "left";
|
|
@@ -32,7 +32,7 @@ declare function Tooltip({
|
|
|
32
32
|
sideOffset,
|
|
33
33
|
arrowClassName,
|
|
34
34
|
keepTooltipOpen
|
|
35
|
-
}: TooltipProps):
|
|
35
|
+
}: TooltipProps): react_jsx_runtime0.JSX.Element;
|
|
36
36
|
//#endregion
|
|
37
37
|
export { Tooltip };
|
|
38
38
|
//# sourceMappingURL=tooltip.d.mts.map
|
package/package.json
CHANGED
|
@@ -8,7 +8,6 @@ type LottieAiIconProps = {
|
|
|
8
8
|
height?: number;
|
|
9
9
|
loop?: boolean;
|
|
10
10
|
autoplay?: boolean;
|
|
11
|
-
hover?: boolean;
|
|
12
11
|
fallback?: React.ReactNode;
|
|
13
12
|
};
|
|
14
13
|
|
|
@@ -18,7 +17,6 @@ export function LottieAiIcon({
|
|
|
18
17
|
height = 18,
|
|
19
18
|
loop = true,
|
|
20
19
|
autoplay = false,
|
|
21
|
-
hover = false,
|
|
22
20
|
fallback,
|
|
23
21
|
}: LottieAiIconProps) {
|
|
24
22
|
const containerRef = React.useRef<HTMLDivElement>(null);
|
|
@@ -27,14 +25,14 @@ export function LottieAiIcon({
|
|
|
27
25
|
React.useEffect(() => {
|
|
28
26
|
if (typeof window === "undefined") return;
|
|
29
27
|
|
|
30
|
-
const existing = document.querySelector("script[data-dotlottie-
|
|
28
|
+
const existing = document.querySelector("script[data-dotlottie-wc]");
|
|
31
29
|
if (!existing) {
|
|
32
30
|
const scriptEl = document.createElement("script");
|
|
33
31
|
scriptEl.type = "module";
|
|
34
32
|
scriptEl.async = true;
|
|
35
33
|
scriptEl.src =
|
|
36
|
-
"https://unpkg.com/@dotlottie
|
|
37
|
-
scriptEl.setAttribute("data-dotlottie-
|
|
34
|
+
"https://unpkg.com/@lottiefiles/dotlottie-wc@0.9.8/dist/dotlottie-wc.js";
|
|
35
|
+
scriptEl.setAttribute("data-dotlottie-wc", "true");
|
|
38
36
|
scriptEl.onload = () => setReady(true);
|
|
39
37
|
scriptEl.onerror = () => setReady(false);
|
|
40
38
|
document.head.appendChild(scriptEl);
|
|
@@ -47,17 +45,16 @@ export function LottieAiIcon({
|
|
|
47
45
|
if (!ready || !containerRef.current) return;
|
|
48
46
|
const container = containerRef.current;
|
|
49
47
|
container.innerHTML = "";
|
|
50
|
-
const player = document.createElement("dotlottie-
|
|
48
|
+
const player = document.createElement("dotlottie-wc");
|
|
51
49
|
player.setAttribute("src", src);
|
|
52
50
|
player.setAttribute("style", `width:${width}px;height:${height}px`);
|
|
53
51
|
if (loop) player.setAttribute("loop", "");
|
|
54
52
|
if (autoplay) player.setAttribute("autoplay", "");
|
|
55
|
-
if (hover) player.setAttribute("hover", "");
|
|
56
53
|
container.appendChild(player);
|
|
57
54
|
return () => {
|
|
58
55
|
container.innerHTML = "";
|
|
59
56
|
};
|
|
60
|
-
}, [ready, src, width, height, loop, autoplay
|
|
57
|
+
}, [ready, src, width, height, loop, autoplay]);
|
|
61
58
|
|
|
62
59
|
return (
|
|
63
60
|
<div ref={containerRef} aria-hidden="true">
|