@inkeep/agents-ui 0.14.27 → 0.14.28
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/primitives/providers/base-events-provider.cjs +1 -1
- package/dist/primitives/providers/base-events-provider.js +1 -1
- package/dist/primitives/providers/config-provider.cjs +1 -1
- package/dist/primitives/providers/config-provider.d.ts +0 -1
- package/dist/primitives/providers/config-provider.js +12 -13
- package/dist/react/chat-button.d.ts +22 -0
- package/dist/react/modal.chat.d.ts +3 -0
- package/dist/types/config/settings/form.d.ts +0 -53
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),t=require("react"),l=require("./config-provider.cjs"),a=t.createContext(void 0),p=({children:e})=>{const{baseSettings:s,componentType:n}=l.useInkeepConfig(),{tags:o,analyticsProperties:r}=s,i=t.useMemo(()=>({widgetLibraryVersion:"0.14.
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),t=require("react"),l=require("./config-provider.cjs"),a=t.createContext(void 0),p=({children:e})=>{const{baseSettings:s,componentType:n}=l.useInkeepConfig(),{tags:o,analyticsProperties:r}=s,i=t.useMemo(()=>({widgetLibraryVersion:"0.14.27",componentType:n,tags:o}),[n,o]),u={logEvent:t.useCallback(async c=>{const v={...i,...c.properties,...r},d={eventName:c.eventName,properties:v};return s.onEvent?.(d)},[s,i,r])};return E.jsx(a.Provider,{value:u,children:e})},g=()=>{const e=t.useContext(a);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=p;exports.useBaseEvents=g;
|
|
@@ -5,7 +5,7 @@ import { useInkeepConfig as g } from "./config-provider.js";
|
|
|
5
5
|
const a = d(void 0), P = ({ children: e }) => {
|
|
6
6
|
const { baseSettings: t, componentType: o } = g(), { tags: s, analyticsProperties: n } = t, r = u(
|
|
7
7
|
() => ({
|
|
8
|
-
widgetLibraryVersion: "0.14.
|
|
8
|
+
widgetLibraryVersion: "0.14.27",
|
|
9
9
|
componentType: o,
|
|
10
10
|
tags: s
|
|
11
11
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),f=require("merge-anything"),n=require("react"),t=require("../utils/default-settings.cjs"),m=require("../atoms/shadow/context.cjs"),s={ChatButton:"ChatButton",CustomTrigger:"CustomTrigger",SearchBar:"SearchBar",EmbeddedChat:"EmbeddedChat",EmbeddedSearch:"EmbeddedSearch",EmbeddedSearchAndChat:"EmbeddedSearchAndChat",SidebarChat:"SidebarChat"},a={prefix:"ikp",aiChatSettings:t.defaultInkeepAIChatSettings,baseSettings:t.defaultInkeepBaseSettings,searchSettings:t.defaultInkeepSearchSettings,componentType:s.EmbeddedChat},d=n.createContext(a),p=({children:e,value:r})=>{const c=m.useShadow(),u=(o,i,C)=>["baseSettings","searchSettings","aiChatSettings"].includes(C)&&!i?o:i,g={baseSettings:c??{}},h=n.useMemo(()=>f.mergeAndCompare(u,a,g,r??{}),[r]);return S.jsx(d.Provider,{value:h,children:e})},b=()=>{const e=n.useContext(d);if(!e)throw new Error("useInkeepConfig must be used within a ConfigProvider");return e};exports.InkeepConfigProvider=p;exports.WebWidgetInteractionType=s;exports.useInkeepConfig=b;
|
|
@@ -8,7 +8,6 @@ export declare const WebWidgetInteractionType: {
|
|
|
8
8
|
readonly EmbeddedChat: "EmbeddedChat";
|
|
9
9
|
readonly EmbeddedSearch: "EmbeddedSearch";
|
|
10
10
|
readonly EmbeddedSearchAndChat: "EmbeddedSearchAndChat";
|
|
11
|
-
readonly IntelligentForm: "IntelligentForm";
|
|
12
11
|
readonly SidebarChat: "SidebarChat";
|
|
13
12
|
};
|
|
14
13
|
export interface WidgetConfig extends InkeepConfig {
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { mergeAndCompare as
|
|
4
|
-
import { useMemo as
|
|
2
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import { mergeAndCompare as C } from "merge-anything";
|
|
4
|
+
import { useMemo as g, createContext as u, useContext as f } from "react";
|
|
5
5
|
import { defaultInkeepSearchSettings as p, defaultInkeepBaseSettings as S, defaultInkeepAIChatSettings as b } from "../utils/default-settings.js";
|
|
6
6
|
import { useShadow as I } from "../atoms/shadow/context.js";
|
|
7
|
-
const
|
|
7
|
+
const k = {
|
|
8
8
|
ChatButton: "ChatButton",
|
|
9
9
|
CustomTrigger: "CustomTrigger",
|
|
10
10
|
SearchBar: "SearchBar",
|
|
11
11
|
EmbeddedChat: "EmbeddedChat",
|
|
12
12
|
EmbeddedSearch: "EmbeddedSearch",
|
|
13
13
|
EmbeddedSearchAndChat: "EmbeddedSearchAndChat",
|
|
14
|
-
IntelligentForm: "IntelligentForm",
|
|
15
14
|
SidebarChat: "SidebarChat"
|
|
16
15
|
}, o = {
|
|
17
16
|
prefix: "ikp",
|
|
@@ -19,20 +18,20 @@ const l = {
|
|
|
19
18
|
aiChatSettings: b,
|
|
20
19
|
baseSettings: S,
|
|
21
20
|
searchSettings: p,
|
|
22
|
-
componentType:
|
|
23
|
-
},
|
|
24
|
-
const
|
|
25
|
-
baseSettings:
|
|
26
|
-
}, c =
|
|
27
|
-
return /* @__PURE__ */
|
|
21
|
+
componentType: k.EmbeddedChat
|
|
22
|
+
}, a = u(o), A = ({ children: e, value: t }) => {
|
|
23
|
+
const i = I(), s = (n, r, h) => ["baseSettings", "searchSettings", "aiChatSettings"].includes(h) && !r ? n : r, d = {
|
|
24
|
+
baseSettings: i ?? {}
|
|
25
|
+
}, c = g(() => C(s, o, d, t ?? {}), [t]);
|
|
26
|
+
return /* @__PURE__ */ m(a.Provider, { value: c, children: e });
|
|
28
27
|
}, T = () => {
|
|
29
|
-
const e = f(
|
|
28
|
+
const e = f(a);
|
|
30
29
|
if (!e)
|
|
31
30
|
throw new Error("useInkeepConfig must be used within a ConfigProvider");
|
|
32
31
|
return e;
|
|
33
32
|
};
|
|
34
33
|
export {
|
|
35
34
|
A as InkeepConfigProvider,
|
|
36
|
-
|
|
35
|
+
k as WebWidgetInteractionType,
|
|
37
36
|
T as useInkeepConfig
|
|
38
37
|
};
|
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
import { InkeepAIChatSettings, InkeepModalSettings } from '../types/index.ts';
|
|
2
2
|
import { InkeepEmbeddedSearchAndChatProps } from './embedded-search-and-chat';
|
|
3
3
|
export interface InkeepChatButtonProps extends Omit<InkeepEmbeddedSearchAndChatProps, 'onToggleView'> {
|
|
4
|
+
/**
|
|
5
|
+
* Modal settings for the chat button.
|
|
6
|
+
*/
|
|
4
7
|
modalSettings?: InkeepModalSettings;
|
|
8
|
+
/**
|
|
9
|
+
* Label for the chat button.
|
|
10
|
+
*/
|
|
5
11
|
label?: string;
|
|
12
|
+
/**
|
|
13
|
+
* URL to the AI assistant's avatar image.
|
|
14
|
+
* Should be a square image, recommended size 40x40px.
|
|
15
|
+
* Supports common image formats (PNG, JPG, SVG).
|
|
16
|
+
*
|
|
17
|
+
* You can pass a string or an object to configure for different color modes.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* {
|
|
21
|
+
* light: 'https://example.com/avatar-light.png',
|
|
22
|
+
* dark: 'https://example.com/avatar-dark.png',
|
|
23
|
+
* }
|
|
24
|
+
*/
|
|
6
25
|
avatar?: InkeepAIChatSettings['aiAssistantAvatar'];
|
|
26
|
+
/**
|
|
27
|
+
* Whether to show the toggle view button.
|
|
28
|
+
*/
|
|
7
29
|
canToggleView?: boolean;
|
|
8
30
|
}
|
|
9
31
|
export declare function InkeepChatButton(props: InkeepChatButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { InkeepModalSettings } from '../types/index.ts';
|
|
2
2
|
import { InkeepEmbeddedChatProps } from './embedded-chat';
|
|
3
3
|
export interface InkeepModalChatProps extends Omit<InkeepEmbeddedChatProps, 'onToggleView'> {
|
|
4
|
+
/**
|
|
5
|
+
* Modal settings for the chat modal.
|
|
6
|
+
*/
|
|
4
7
|
modalSettings?: InkeepModalSettings;
|
|
5
8
|
}
|
|
6
9
|
export declare function InkeepModalChat(props: InkeepModalChatProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -72,57 +72,4 @@ export interface IncludeChatSessionField extends BaseFormField {
|
|
|
72
72
|
inputType?: 'checkbox';
|
|
73
73
|
defaultValue?: boolean;
|
|
74
74
|
}
|
|
75
|
-
export type IntelligentFormField = Exclude<FormField, IncludeChatSessionField> & {
|
|
76
|
-
/**
|
|
77
|
-
* Controls whether to prefill the field with the AI's response
|
|
78
|
-
*/
|
|
79
|
-
shouldPrefillWithAI?: boolean;
|
|
80
|
-
};
|
|
81
|
-
export interface IntelligentFormSuccessView {
|
|
82
|
-
heading: string;
|
|
83
|
-
message: string;
|
|
84
|
-
icon?: InkeepCustomIcon;
|
|
85
|
-
}
|
|
86
|
-
export interface IntelligentFormButtons {
|
|
87
|
-
/** Callback function called when form is submitted */
|
|
88
|
-
submit: {
|
|
89
|
-
label?: string;
|
|
90
|
-
onSubmit: SubmitCallback;
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
export interface IntelligentFormSettings {
|
|
94
|
-
/**
|
|
95
|
-
* Primary form section that is always shown
|
|
96
|
-
*/
|
|
97
|
-
primary: {
|
|
98
|
-
/** Array of form fields to display */
|
|
99
|
-
fields: IntelligentFormField[];
|
|
100
|
-
/** Optional description text shown above the fields */
|
|
101
|
-
description?: string;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* Secondary form section that can be conditionally shown
|
|
105
|
-
*/
|
|
106
|
-
secondary: {
|
|
107
|
-
/** Array of form fields to display */
|
|
108
|
-
fields: IntelligentFormField[];
|
|
109
|
-
/**
|
|
110
|
-
* Optional description text shown above the fields.
|
|
111
|
-
* Can be either a simple string or an object with different messages
|
|
112
|
-
* based on AI confidence level
|
|
113
|
-
*/
|
|
114
|
-
description?: string | {
|
|
115
|
-
/** Default message shown when AI confidence is low/medium */
|
|
116
|
-
default: string;
|
|
117
|
-
/** Message shown when AI has high confidence */
|
|
118
|
-
confident: string;
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
/** Configuration for the success view shown after form submission */
|
|
122
|
-
successView: IntelligentFormSuccessView;
|
|
123
|
-
/** Configuration for the buttons shown in the form */
|
|
124
|
-
buttons: IntelligentFormButtons;
|
|
125
|
-
/** Optional name of the assistant shown in the form */
|
|
126
|
-
aiAssistantName?: string;
|
|
127
|
-
}
|
|
128
75
|
export {};
|