@inkeep/agents-ui 0.14.24 → 0.14.25

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 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.20",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;
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.24",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.20",
8
+ widgetLibraryVersion: "0.14.24",
9
9
  componentType: o,
10
10
  tags: s
11
11
  }),
@@ -1,13 +1,13 @@
1
- import { ModalViewTypes, OnToggleView } from '../types/index.ts';
1
+ import { ModalViewTypes, WidgetView } from '../types/index.ts';
2
2
  export declare function WidgetToggle(props: {
3
- onToggleView: 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?: 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
- * @param message The current content of the input field
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
- * @param message Optional message text. If omitted, sends the current input value.
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
- * @param message The new message text to set
200
+
201
+ * `param:` message The new message text to set
198
202
  */
199
203
  updateInputMessage: (message: string) => void;
200
204
  /**
@@ -204,8 +208,10 @@ export interface AIChatFunctions {
204
208
  clearChat: () => void;
205
209
  /**
206
210
  * Displays a form overlay in the chat interface.
207
- * @param formSettings Configuration object defining the form's fields and behavior
208
- * @param getHelpOption Optional getHelpOption that triggered the form (for analytics)
211
+
212
+ * `param:` formSettings Configuration object defining the form's fields and behavior
213
+
214
+ * `param:` getHelpOption Optional getHelpOption that triggered the form (for analytics)
209
215
  */
210
216
  openForm: (formSettings: AIChatFormSettings, getHelpOption?: GetHelpOption) => void;
211
217
  /**
@@ -51,12 +51,14 @@ export interface InkeepBaseSettings {
51
51
  analyticsProperties?: Record<string, unknown>;
52
52
  /**
53
53
  * Handler for analytics events from the widget.
54
- * @param event The analytics event object
54
+
55
+ * `param:` event The analytics event object
55
56
  */
56
57
  onEvent?: (event: InkeepCallbackEvent) => Promise<void>;
57
58
  /**
58
59
  * Handler for feedback events from the widget.
59
- * @param feedback The feedback object
60
+
61
+ * `param:` feedback The feedback object
60
62
  */
61
63
  onFeedback?: (feedback: InkeepFeedback & {
62
64
  properties?: Record<string, unknown>;
@@ -69,8 +71,10 @@ export interface InkeepBaseSettings {
69
71
  /**
70
72
  * Function to transform source data before display.
71
73
  * Allows customizing how source information is presented in the widget.
72
- * @param source The original source data
73
- * @returns The transformed source data
74
+
75
+ * `param:` source The original source data
76
+ *
77
+ * `returns:` The transformed source data
74
78
  */
75
79
  transformSource?: TransformSource;
76
80
  /**
@@ -224,7 +228,7 @@ export interface Style {
224
228
  * For type='link', this should be a valid URL to an external resource.
225
229
  * For type='style', this should be valid CSS code.
226
230
  *
227
- * @example
231
+ * ```ts
228
232
  * // For type='link':
229
233
  * value: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap'
230
234
  *
@@ -233,6 +237,7 @@ export interface Style {
233
237
  * background: blue;
234
238
  * color: white;
235
239
  * }`
240
+ * ```
236
241
  */
237
242
  value: string;
238
243
  }
@@ -309,8 +314,10 @@ export interface SyncColorMode {
309
314
  * The function receives an object containing the current values of all monitored attributes,
310
315
  * where the keys are attribute names and values are the attribute values.
311
316
  *
312
- * @param attributes - Object containing the current values of monitored attributes
313
- * @returns boolean - True if dark mode is detected, false otherwise
317
+
318
+ * `param:` attributes - Object containing the current values of monitored attributes
319
+ *
320
+ * `returns:` boolean - True if dark mode is detected, false otherwise
314
321
  *
315
322
  * @example
316
323
  * ```ts
@@ -330,7 +337,8 @@ export interface SyncColorMode {
330
337
  *
331
338
  * This can be used to perform side effects or sync the color mode with other parts of your application.
332
339
  *
333
- * @param colorMode - The new color mode value ('light' | 'dark')
340
+
341
+ * `param:` colorMode - The new color mode value ('light' | 'dark')
334
342
  *
335
343
  * @example
336
344
  * ```ts
@@ -21,9 +21,12 @@ 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
- * @param query - The search query string
25
- * @param abortSignal - Signal to abort the search request
26
- * @returns Promise that resolves with search results
24
+
25
+ * `param:` query - The search query string
26
+
27
+ * `param:` abortSignal - Signal to abort the search request
28
+ *
29
+ * `returns:` Promise that resolves with search results
27
30
  */
28
31
  onSearch?: (query: string, abortSignal: AbortSignal) => Promise<SourceItem[]>;
29
32
  /**
@@ -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
- * @param newProps The new props to apply to the component
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
  /**
@@ -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?: 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
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-ui",
3
- "version": "0.14.24",
3
+ "version": "0.14.25",
4
4
  "description": "",
5
5
  "homepage": "",
6
6
  "repository": {