@inkeep/agents-ui 0.14.24 → 0.14.26
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/react/widget-toggle.d.ts +3 -3
- package/dist/types/config/ai.d.ts +10 -5
- package/dist/types/config/base.d.ts +18 -5
- package/dist/types/config/search.d.ts +2 -0
- package/dist/types/js/index.d.ts +2 -1
- package/dist/types/widget.d.ts +5 -6
- 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.25",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.25",
|
|
9
9
|
componentType: o,
|
|
10
10
|
tags: s
|
|
11
11
|
}),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ModalViewTypes,
|
|
1
|
+
import { ModalViewTypes, WidgetView } from '../types/index.ts';
|
|
2
2
|
export declare function WidgetToggle(props: {
|
|
3
|
-
onToggleView:
|
|
3
|
+
onToggleView: WidgetView['onToggleView'];
|
|
4
4
|
query?: string;
|
|
5
5
|
askAILabel?: string;
|
|
6
6
|
searchLabel?: string;
|
|
7
7
|
view: ModalViewTypes;
|
|
8
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export declare function useToggleView(props: {
|
|
10
|
-
onToggleView?:
|
|
10
|
+
onToggleView?: WidgetView['onToggleView'];
|
|
11
11
|
query?: string;
|
|
12
12
|
}): {
|
|
13
13
|
handleToggle: (view: ModalViewTypes, autoSubmit?: boolean) => void;
|
|
@@ -130,7 +130,9 @@ export interface InkeepAIChatSettings {
|
|
|
130
130
|
disclaimerSettings?: AIChatDisclaimerSettings;
|
|
131
131
|
/**
|
|
132
132
|
* Callback function triggered whenever the user modifies their input message.
|
|
133
|
-
*
|
|
133
|
+
*
|
|
134
|
+
|
|
135
|
+
* @param message - The current content of the input field
|
|
134
136
|
*/
|
|
135
137
|
onInputMessageChange?: (message: string) => void;
|
|
136
138
|
/**
|
|
@@ -189,12 +191,14 @@ export interface AIChatDisclaimerSettings {
|
|
|
189
191
|
export interface AIChatFunctions {
|
|
190
192
|
/**
|
|
191
193
|
* Programmatically sends a message in the chat.
|
|
192
|
-
|
|
194
|
+
|
|
195
|
+
* @param message - Optional message text. If omitted, sends the current input value.
|
|
193
196
|
*/
|
|
194
197
|
submitMessage: (message?: string) => void;
|
|
195
198
|
/**
|
|
196
199
|
* Programmatically updates the text in the chat input field.
|
|
197
|
-
|
|
200
|
+
|
|
201
|
+
* @param message - The new message text to set
|
|
198
202
|
*/
|
|
199
203
|
updateInputMessage: (message: string) => void;
|
|
200
204
|
/**
|
|
@@ -204,8 +208,9 @@ export interface AIChatFunctions {
|
|
|
204
208
|
clearChat: () => void;
|
|
205
209
|
/**
|
|
206
210
|
* Displays a form overlay in the chat interface.
|
|
207
|
-
|
|
208
|
-
* @param
|
|
211
|
+
|
|
212
|
+
* @param formSettings - Configuration object defining the form's fields and behavior
|
|
213
|
+
* @param getHelpOption - Optional getHelpOption that triggered the form (for analytics)
|
|
209
214
|
*/
|
|
210
215
|
openForm: (formSettings: AIChatFormSettings, getHelpOption?: GetHelpOption) => void;
|
|
211
216
|
/**
|
|
@@ -51,12 +51,16 @@ export interface InkeepBaseSettings {
|
|
|
51
51
|
analyticsProperties?: Record<string, unknown>;
|
|
52
52
|
/**
|
|
53
53
|
* Handler for analytics events from the widget.
|
|
54
|
-
|
|
54
|
+
|
|
55
|
+
* @param event - The analytics event object
|
|
56
|
+
* @returns Promise that resolves when the event is logged
|
|
55
57
|
*/
|
|
56
58
|
onEvent?: (event: InkeepCallbackEvent) => Promise<void>;
|
|
57
59
|
/**
|
|
58
60
|
* Handler for feedback events from the widget.
|
|
59
|
-
|
|
61
|
+
|
|
62
|
+
* @param feedback - The feedback object
|
|
63
|
+
* @returns The feedback object
|
|
60
64
|
*/
|
|
61
65
|
onFeedback?: (feedback: InkeepFeedback & {
|
|
62
66
|
properties?: Record<string, unknown>;
|
|
@@ -68,8 +72,13 @@ export interface InkeepBaseSettings {
|
|
|
68
72
|
shouldBypassCaptcha?: boolean;
|
|
69
73
|
/**
|
|
70
74
|
* Function to transform source data before display.
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
71
77
|
* Allows customizing how source information is presented in the widget.
|
|
72
|
-
|
|
78
|
+
|
|
79
|
+
* @param source - The original source data
|
|
80
|
+
* @param type - The type of source data
|
|
81
|
+
* @param opts - The options for the transform source
|
|
73
82
|
* @returns The transformed source data
|
|
74
83
|
*/
|
|
75
84
|
transformSource?: TransformSource;
|
|
@@ -224,7 +233,7 @@ export interface Style {
|
|
|
224
233
|
* For type='link', this should be a valid URL to an external resource.
|
|
225
234
|
* For type='style', this should be valid CSS code.
|
|
226
235
|
*
|
|
227
|
-
*
|
|
236
|
+
* ```ts
|
|
228
237
|
* // For type='link':
|
|
229
238
|
* value: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap'
|
|
230
239
|
*
|
|
@@ -233,6 +242,7 @@ export interface Style {
|
|
|
233
242
|
* background: blue;
|
|
234
243
|
* color: white;
|
|
235
244
|
* }`
|
|
245
|
+
* ```
|
|
236
246
|
*/
|
|
237
247
|
value: string;
|
|
238
248
|
}
|
|
@@ -306,11 +316,13 @@ export interface SyncColorMode {
|
|
|
306
316
|
/**
|
|
307
317
|
* A function that determines if dark mode is active based on the target element's attributes.
|
|
308
318
|
*
|
|
319
|
+
* @remarks
|
|
309
320
|
* The function receives an object containing the current values of all monitored attributes,
|
|
310
321
|
* where the keys are attribute names and values are the attribute values.
|
|
311
322
|
*
|
|
323
|
+
|
|
312
324
|
* @param attributes - Object containing the current values of monitored attributes
|
|
313
|
-
* @returns
|
|
325
|
+
* @returns True if dark mode is detected, false otherwise
|
|
314
326
|
*
|
|
315
327
|
* @example
|
|
316
328
|
* ```ts
|
|
@@ -330,6 +342,7 @@ export interface SyncColorMode {
|
|
|
330
342
|
*
|
|
331
343
|
* This can be used to perform side effects or sync the color mode with other parts of your application.
|
|
332
344
|
*
|
|
345
|
+
|
|
333
346
|
* @param colorMode - The new color mode value ('light' | 'dark')
|
|
334
347
|
*
|
|
335
348
|
* @example
|
|
@@ -21,8 +21,10 @@ export interface InkeepSearchSettings {
|
|
|
21
21
|
* This callback handles the complete search implementation.
|
|
22
22
|
* If not provided, the widget will warn and show no results.
|
|
23
23
|
*
|
|
24
|
+
|
|
24
25
|
* @param query - The search query string
|
|
25
26
|
* @param abortSignal - Signal to abort the search request
|
|
27
|
+
*
|
|
26
28
|
* @returns Promise that resolves with search results
|
|
27
29
|
*/
|
|
28
30
|
onSearch?: (query: string, abortSignal: AbortSignal) => Promise<SourceItem[]>;
|
package/dist/types/js/index.d.ts
CHANGED
|
@@ -28,7 +28,8 @@ export type InkeepJS = Partial<Record<InkeepJSComponent, InkeepComponentInitiali
|
|
|
28
28
|
export interface InkeepComponentInstance {
|
|
29
29
|
/**
|
|
30
30
|
* Updates the component with new props
|
|
31
|
-
|
|
31
|
+
|
|
32
|
+
* @param newProps - The new props to apply to the component
|
|
32
33
|
*/
|
|
33
34
|
update: <T extends object>(newProps: T) => void;
|
|
34
35
|
/**
|
package/dist/types/widget.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
export type UrlQueryParam = Record<string, string>;
|
|
2
2
|
export type ModalViewTypes = 'chat' | 'search';
|
|
3
|
-
export type OnToggleView = (opts: {
|
|
4
|
-
view: ModalViewTypes;
|
|
5
|
-
query?: string;
|
|
6
|
-
autoSubmit?: boolean;
|
|
7
|
-
}) => void;
|
|
8
3
|
export interface WidgetView {
|
|
9
4
|
/**
|
|
10
5
|
* Callback fired when the user toggles between chat and search views.
|
|
@@ -12,7 +7,11 @@ export interface WidgetView {
|
|
|
12
7
|
* The parent component can use this
|
|
13
8
|
* to coordinate showing/hiding the appropriate view.
|
|
14
9
|
*/
|
|
15
|
-
onToggleView?:
|
|
10
|
+
onToggleView?: (opts: {
|
|
11
|
+
view: ModalViewTypes;
|
|
12
|
+
query?: string;
|
|
13
|
+
autoSubmit?: boolean;
|
|
14
|
+
}) => void;
|
|
16
15
|
/**
|
|
17
16
|
* The label for the Ask AI button.
|
|
18
17
|
*/
|