@inkeep/cxkit-react 0.5.11 → 0.5.13
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("@inkeep/cxkit-styled"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("@inkeep/cxkit-styled"),g=require("react"),x=require("./modal.cjs"),B=require("./embedded-search-and-chat.cjs"),j=require("./embedded-search-and-chat.impl.cjs"),I=require("./embedded-chat.cjs");function b(n){const[r,a]=g.useState(!1),{modalSettings:i,label:s,defaultView:o="chat",canToggleView:p=!0,avatar:C,...c}=n,{config:d,...u}=j.useWidgetImpl({...c,defaultView:o}),m={...i,isOpen:r,onOpenChange:h=>{n.forceDefaultView&&!h&&u.setView(o??"chat"),a(!!h)}};return t.jsxs(t.Fragment,{children:[t.jsx(e.Shadow,{wrapperStyles:{display:"contents"},children:t.jsx(e.RootProvider,{config:d,componentType:e.WebWidgetInteractionType.ChatButton,children:t.jsx(l,{label:s,avatar:C,setOpen:a})})}),t.jsx(x.InkeepModal,{...d,componentType:e.WebWidgetInteractionType.ChatButton,modalSettings:m,children:p?t.jsx(B.InkeepEmbeddedSearchAndChatImpl,{...u}):t.jsx(I.InkeepEmbeddedChatImpl,{...c})})]})}function l(n){const{label:r="Ask AI",avatar:a,setOpen:i}=n;return t.jsx(e.ChatButton.Container,{children:t.jsxs(e.ChatButton.ChatButton,{onClick:s=>{s.button!==2&&i(o=>!o)},children:[t.jsx(e.ChatButton.ChatButtonText,{children:r}),t.jsx(e.ChatButton.ChatButtonAvatarContent,{children:t.jsx(e.ChatButton.ChatButtonAvatarImage,{avatar:a})})]})})}exports.ChatButtonImpl=l;exports.InkeepChatButton=b;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
1
|
+
import { InkeepAIChatSettings, InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
2
2
|
import { InkeepEmbeddedSearchAndChatProps } from './embedded-search-and-chat';
|
|
3
3
|
export interface InkeepChatButtonProps extends Omit<InkeepEmbeddedSearchAndChatProps, 'onToggleView'> {
|
|
4
4
|
modalSettings?: Omit<InkeepModalSettings, 'isOpen' | 'onOpenChange'>;
|
|
5
5
|
label?: string;
|
|
6
|
+
avatar?: InkeepAIChatSettings['aiAssistantAvatar'];
|
|
6
7
|
canToggleView?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare function InkeepChatButton(props: InkeepChatButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
interface ChatButtonImplProps {
|
|
10
|
-
label?: string;
|
|
10
|
+
interface ChatButtonImplProps extends Pick<InkeepChatButtonProps, 'label' | 'avatar'> {
|
|
11
11
|
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
12
12
|
}
|
|
13
13
|
export declare function ChatButtonImpl(props: ChatButtonImplProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
1
|
+
import { InkeepAIChatSettings, InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
2
2
|
import { InkeepEmbeddedSearchAndChatProps } from './embedded-search-and-chat';
|
|
3
3
|
export interface InkeepChatButtonProps extends Omit<InkeepEmbeddedSearchAndChatProps, 'onToggleView'> {
|
|
4
4
|
modalSettings?: Omit<InkeepModalSettings, 'isOpen' | 'onOpenChange'>;
|
|
5
5
|
label?: string;
|
|
6
|
+
avatar?: InkeepAIChatSettings['aiAssistantAvatar'];
|
|
6
7
|
canToggleView?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare function InkeepChatButton(props: InkeepChatButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
interface ChatButtonImplProps {
|
|
10
|
-
label?: string;
|
|
10
|
+
interface ChatButtonImplProps extends Pick<InkeepChatButtonProps, 'label' | 'avatar'> {
|
|
11
11
|
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
12
12
|
}
|
|
13
13
|
export declare function ChatButtonImpl(props: ChatButtonImplProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,54 +1,55 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as s, Fragment as
|
|
3
|
-
import { Shadow as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { InkeepModal as
|
|
6
|
-
import { InkeepEmbeddedSearchAndChatImpl as
|
|
7
|
-
import { useWidgetImpl as
|
|
8
|
-
import { InkeepEmbeddedChatImpl as
|
|
9
|
-
function
|
|
10
|
-
const [r, o] =
|
|
11
|
-
modalSettings:
|
|
12
|
-
label:
|
|
13
|
-
defaultView:
|
|
2
|
+
import { jsxs as s, Fragment as g, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { Shadow as I, RootProvider as B, WebWidgetInteractionType as h, ChatButton as e } from "@inkeep/cxkit-styled";
|
|
4
|
+
import { useState as S } from "react";
|
|
5
|
+
import { InkeepModal as b } from "./modal.js";
|
|
6
|
+
import { InkeepEmbeddedSearchAndChatImpl as k } from "./embedded-search-and-chat.js";
|
|
7
|
+
import { useWidgetImpl as w } from "./embedded-search-and-chat.impl.js";
|
|
8
|
+
import { InkeepEmbeddedChatImpl as v } from "./embedded-chat.js";
|
|
9
|
+
function D(n) {
|
|
10
|
+
const [r, o] = S(!1), {
|
|
11
|
+
modalSettings: i,
|
|
12
|
+
label: l,
|
|
13
|
+
defaultView: a = "chat",
|
|
14
14
|
canToggleView: u = !0,
|
|
15
|
+
avatar: f,
|
|
15
16
|
...c
|
|
16
|
-
} = n, { config: m, ...p } =
|
|
17
|
-
...
|
|
17
|
+
} = n, { config: m, ...p } = w({ ...c, defaultView: a }), C = {
|
|
18
|
+
...i,
|
|
18
19
|
isOpen: r,
|
|
19
20
|
onOpenChange: (d) => {
|
|
20
|
-
n.forceDefaultView && !d && p.setView(
|
|
21
|
+
n.forceDefaultView && !d && p.setView(a ?? "chat"), o(!!d);
|
|
21
22
|
}
|
|
22
23
|
};
|
|
23
|
-
return /* @__PURE__ */ s(
|
|
24
|
-
/* @__PURE__ */ t(
|
|
24
|
+
return /* @__PURE__ */ s(g, { children: [
|
|
25
|
+
/* @__PURE__ */ t(I, { wrapperStyles: { display: "contents" }, children: /* @__PURE__ */ t(B, { config: m, componentType: h.ChatButton, children: /* @__PURE__ */ t(y, { label: l, avatar: f, setOpen: o }) }) }),
|
|
25
26
|
/* @__PURE__ */ t(
|
|
26
|
-
|
|
27
|
+
b,
|
|
27
28
|
{
|
|
28
29
|
...m,
|
|
29
30
|
componentType: h.ChatButton,
|
|
30
|
-
modalSettings:
|
|
31
|
-
children: u ? /* @__PURE__ */ t(
|
|
31
|
+
modalSettings: C,
|
|
32
|
+
children: u ? /* @__PURE__ */ t(k, { ...p }) : /* @__PURE__ */ t(v, { ...c })
|
|
32
33
|
}
|
|
33
34
|
)
|
|
34
35
|
] });
|
|
35
36
|
}
|
|
36
37
|
function y(n) {
|
|
37
|
-
const { label: r = "Ask AI",
|
|
38
|
+
const { label: r = "Ask AI", avatar: o, setOpen: i } = n;
|
|
38
39
|
return /* @__PURE__ */ t(e.Container, { children: /* @__PURE__ */ s(
|
|
39
40
|
e.ChatButton,
|
|
40
41
|
{
|
|
41
|
-
onClick: (
|
|
42
|
-
|
|
42
|
+
onClick: (l) => {
|
|
43
|
+
l.button !== 2 && i((a) => !a);
|
|
43
44
|
},
|
|
44
45
|
children: [
|
|
45
46
|
/* @__PURE__ */ t(e.ChatButtonText, { children: r }),
|
|
46
|
-
/* @__PURE__ */ t(e.ChatButtonAvatarContent, { children: /* @__PURE__ */ t(e.ChatButtonAvatarImage, {}) })
|
|
47
|
+
/* @__PURE__ */ t(e.ChatButtonAvatarContent, { children: /* @__PURE__ */ t(e.ChatButtonAvatarImage, { avatar: o }) })
|
|
47
48
|
]
|
|
48
49
|
}
|
|
49
50
|
) });
|
|
50
51
|
}
|
|
51
52
|
export {
|
|
52
53
|
y as ChatButtonImpl,
|
|
53
|
-
|
|
54
|
+
D as InkeepChatButton
|
|
54
55
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/cxkit-react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Inkeep, Inc. Customer License (IICL) v1.1",
|
|
6
6
|
"homepage": "",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@inkeep/cxkit-styled": "0.5.
|
|
23
|
+
"@inkeep/cxkit-styled": "0.5.13"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@biomejs/biome": "1.9.4",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"typescript": "5.7.3",
|
|
44
44
|
"vite": "5.4.11",
|
|
45
45
|
"vite-plugin-dts": "4.4.0",
|
|
46
|
-
"@inkeep/cxkit-color-mode": "0.5.
|
|
47
|
-
"@inkeep/cxkit-types": "0.5.
|
|
46
|
+
"@inkeep/cxkit-color-mode": "0.5.13",
|
|
47
|
+
"@inkeep/cxkit-types": "0.5.13"
|
|
48
48
|
},
|
|
49
49
|
"module": "dist/index.js",
|
|
50
50
|
"types": "dist/index.d.ts",
|