@inkeep/agents-ui 0.15.9 → 0.15.11
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/color-mode/index.d.ts +0 -1
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +2 -2
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +1 -0
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +132 -122
- package/dist/primitives/components/embedded-chat/use-stream-processor.cjs +1 -1
- package/dist/primitives/components/embedded-chat/use-stream-processor.js +85 -82
- package/dist/primitives/components/embedded-chat.cjs +3 -3
- package/dist/primitives/components/embedded-chat.js +145 -145
- package/dist/primitives/hooks/use-instant-update.d.ts +0 -1
- package/dist/primitives/providers/base-events-provider.cjs +1 -1
- package/dist/primitives/providers/base-events-provider.js +1 -1
- package/dist/primitives/utils/split-props.d.ts +0 -1
- package/dist/react/chat-button.d.ts +0 -2
- package/dist/styled/components/data-summary-group.cjs +1 -1
- package/dist/styled/components/data-summary-group.js +70 -63
- package/dist/styled/components/message.cjs +1 -1
- package/dist/styled/components/message.js +253 -144
- package/dist/styled/inkeep.css.cjs +67 -0
- package/dist/styled/inkeep.css.js +67 -0
- package/dist/types/config/ai.d.ts +13 -15
- package/dist/types/config/base.d.ts +0 -20
- package/dist/types/config/components.d.ts +6 -0
- package/dist/types/config/search.d.ts +0 -2
- package/dist/types/config/settings/actions.d.ts +68 -2
- package/dist/types/sources.d.ts +1 -9
- package/package.json +1 -1
|
@@ -1708,6 +1708,9 @@ video {
|
|
|
1708
1708
|
.lowercase {
|
|
1709
1709
|
text-transform: lowercase;
|
|
1710
1710
|
}
|
|
1711
|
+
.capitalize {
|
|
1712
|
+
text-transform: capitalize;
|
|
1713
|
+
}
|
|
1711
1714
|
.leading-4 {
|
|
1712
1715
|
line-height: 1rem;
|
|
1713
1716
|
}
|
|
@@ -2175,6 +2178,17 @@ slot {
|
|
|
2175
2178
|
position: absolute;
|
|
2176
2179
|
}
|
|
2177
2180
|
|
|
2181
|
+
.before\\:inset-x-0::before {
|
|
2182
|
+
content: var(--tw-content);
|
|
2183
|
+
left: 0px;
|
|
2184
|
+
right: 0px;
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
.before\\:-top-px::before {
|
|
2188
|
+
content: var(--tw-content);
|
|
2189
|
+
top: -1px;
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2178
2192
|
.before\\:left-0::before {
|
|
2179
2193
|
content: var(--tw-content);
|
|
2180
2194
|
left: 0px;
|
|
@@ -2185,6 +2199,11 @@ slot {
|
|
|
2185
2199
|
top: 0px;
|
|
2186
2200
|
}
|
|
2187
2201
|
|
|
2202
|
+
.before\\:z-10::before {
|
|
2203
|
+
content: var(--tw-content);
|
|
2204
|
+
z-index: 10;
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2188
2207
|
.before\\:z-hide::before {
|
|
2189
2208
|
content: var(--tw-content);
|
|
2190
2209
|
z-index: var(--ikp-z-index-hide);
|
|
@@ -2246,6 +2265,11 @@ slot {
|
|
|
2246
2265
|
background-repeat: no-repeat;
|
|
2247
2266
|
}
|
|
2248
2267
|
|
|
2268
|
+
.before\\:content-\\[\\"\\"\\]::before {
|
|
2269
|
+
--tw-content: "";
|
|
2270
|
+
content: var(--tw-content);
|
|
2271
|
+
}
|
|
2272
|
+
|
|
2249
2273
|
.before\\:\\[background-position\\:0_0\\]::before {
|
|
2250
2274
|
content: var(--tw-content);
|
|
2251
2275
|
background-position: 0 0;
|
|
@@ -2256,6 +2280,11 @@ slot {
|
|
|
2256
2280
|
background-size: cover;
|
|
2257
2281
|
}
|
|
2258
2282
|
|
|
2283
|
+
.after\\:pointer-events-none::after {
|
|
2284
|
+
content: var(--tw-content);
|
|
2285
|
+
pointer-events: none;
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2259
2288
|
.after\\:invisible::after {
|
|
2260
2289
|
content: var(--tw-content);
|
|
2261
2290
|
visibility: hidden;
|
|
@@ -2266,6 +2295,12 @@ slot {
|
|
|
2266
2295
|
position: absolute;
|
|
2267
2296
|
}
|
|
2268
2297
|
|
|
2298
|
+
.after\\:inset-x-0::after {
|
|
2299
|
+
content: var(--tw-content);
|
|
2300
|
+
left: 0px;
|
|
2301
|
+
right: 0px;
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2269
2304
|
.after\\:bottom-0::after {
|
|
2270
2305
|
content: var(--tw-content);
|
|
2271
2306
|
bottom: 0px;
|
|
@@ -2296,6 +2331,11 @@ slot {
|
|
|
2296
2331
|
top: 100%;
|
|
2297
2332
|
}
|
|
2298
2333
|
|
|
2334
|
+
.after\\:z-10::after {
|
|
2335
|
+
content: var(--tw-content);
|
|
2336
|
+
z-index: 10;
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2299
2339
|
.after\\:z-base::after {
|
|
2300
2340
|
content: var(--tw-content);
|
|
2301
2341
|
z-index: var(--ikp-z-index-base);
|
|
@@ -2578,6 +2618,10 @@ slot {
|
|
|
2578
2618
|
max-height: 0px;
|
|
2579
2619
|
}
|
|
2580
2620
|
|
|
2621
|
+
.data-\\[expanded\\=true\\]\\:max-h-48[data-expanded="true"] {
|
|
2622
|
+
max-height: 12rem;
|
|
2623
|
+
}
|
|
2624
|
+
|
|
2581
2625
|
.data-\\[composite\\]\\:w-full[data-composite] {
|
|
2582
2626
|
width: 100%;
|
|
2583
2627
|
}
|
|
@@ -2752,6 +2796,10 @@ slot {
|
|
|
2752
2796
|
justify-content: flex-end;
|
|
2753
2797
|
}
|
|
2754
2798
|
|
|
2799
|
+
.data-\\[expanded\\=true\\]\\:overflow-y-auto[data-expanded="true"] {
|
|
2800
|
+
overflow-y: auto;
|
|
2801
|
+
}
|
|
2802
|
+
|
|
2755
2803
|
.data-\\[role\\=user\\]\\:whitespace-pre-wrap[data-role="user"] {
|
|
2756
2804
|
white-space: pre-wrap;
|
|
2757
2805
|
}
|
|
@@ -2816,6 +2864,10 @@ slot {
|
|
|
2816
2864
|
padding-bottom: 0.5rem;
|
|
2817
2865
|
}
|
|
2818
2866
|
|
|
2867
|
+
.data-\\[expanded\\=true\\]\\:pb-3[data-expanded="true"] {
|
|
2868
|
+
padding-bottom: 0.75rem;
|
|
2869
|
+
}
|
|
2870
|
+
|
|
2819
2871
|
.data-\\[has-content\\]\\:pb-2[data-has-content] {
|
|
2820
2872
|
padding-bottom: 0.5rem;
|
|
2821
2873
|
}
|
|
@@ -2943,6 +2995,11 @@ slot {
|
|
|
2943
2995
|
--start-color: var(--ikp-color-inkeep-expanded-primary-50);
|
|
2944
2996
|
}
|
|
2945
2997
|
|
|
2998
|
+
.data-\\[expanded\\=false\\]\\:before\\:opacity-0[data-expanded="false"]::before {
|
|
2999
|
+
content: var(--tw-content);
|
|
3000
|
+
opacity: 0;
|
|
3001
|
+
}
|
|
3002
|
+
|
|
2946
3003
|
.data-\\[required\\]\\:after\\:absolute[data-required]::after {
|
|
2947
3004
|
content: var(--tw-content);
|
|
2948
3005
|
position: absolute;
|
|
@@ -3005,6 +3062,11 @@ slot {
|
|
|
3005
3062
|
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
|
|
3006
3063
|
}
|
|
3007
3064
|
|
|
3065
|
+
.data-\\[expanded\\=false\\]\\:after\\:opacity-0[data-expanded="false"]::after {
|
|
3066
|
+
content: var(--tw-content);
|
|
3067
|
+
opacity: 0;
|
|
3068
|
+
}
|
|
3069
|
+
|
|
3008
3070
|
.data-\\[required\\]\\:after\\:\\[content\\:\\"\\*\\"\\][data-required]::after {
|
|
3009
3071
|
content: "*";
|
|
3010
3072
|
}
|
|
@@ -3027,6 +3089,11 @@ slot {
|
|
|
3027
3089
|
background-image: conic-gradient(transparent,var(--ikp-color-inkeep-expanded-primary-600),transparent 30%);
|
|
3028
3090
|
}
|
|
3029
3091
|
|
|
3092
|
+
.group[data-expanded="true"] .group-data-\\[expanded\\=true\\]\\:rotate-180 {
|
|
3093
|
+
--tw-rotate: 180deg;
|
|
3094
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
3095
|
+
}
|
|
3096
|
+
|
|
3030
3097
|
.group[data-expanded="true"] .group-data-\\[expanded\\=true\\]\\:rotate-90 {
|
|
3031
3098
|
--tw-rotate: 90deg;
|
|
3032
3099
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
@@ -22,27 +22,27 @@ export interface InkeepAIChatSettings {
|
|
|
22
22
|
/**
|
|
23
23
|
* The placeholder text to display in the chat input field when empty.
|
|
24
24
|
* Use this to provide guidance on what kind of questions users can ask.
|
|
25
|
-
*
|
|
25
|
+
* "Ask me anything about our API documentation..."
|
|
26
26
|
*/
|
|
27
27
|
placeholder?: string;
|
|
28
28
|
/**
|
|
29
29
|
* A welcome message shown at the start of a new chat session.
|
|
30
30
|
* Supports markdown formatting for rich text styling.
|
|
31
31
|
* Use this to introduce the AI assistant's capabilities and set expectations.
|
|
32
|
-
*
|
|
32
|
+
* "👋 Hi! I'm here to help you with technical questions about our API..."
|
|
33
33
|
*/
|
|
34
34
|
introMessage?: string;
|
|
35
35
|
/**
|
|
36
36
|
* The name of the product/service/topic that the chat assistant specializes in.
|
|
37
37
|
* This helps contextualize the chat experience for users.
|
|
38
38
|
* If not provided, defaults to the organization name from base settings.
|
|
39
|
-
*
|
|
39
|
+
* "MongoDB Atlas" or "React Router"
|
|
40
40
|
*/
|
|
41
41
|
chatSubjectName?: string;
|
|
42
42
|
/**
|
|
43
43
|
* The display name for the AI assistant in the chat interface.
|
|
44
44
|
* Choose a name that reflects the assistant's role and your brand.
|
|
45
|
-
*
|
|
45
|
+
* "Atlas Assistant" or "DevBot"
|
|
46
46
|
*/
|
|
47
47
|
aiAssistantName?: string;
|
|
48
48
|
/**
|
|
@@ -51,8 +51,6 @@ export interface InkeepAIChatSettings {
|
|
|
51
51
|
* Supports common image formats (PNG, JPG, SVG).
|
|
52
52
|
*
|
|
53
53
|
* You can pass a string or an object to configure for different color modes.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
54
|
* {
|
|
57
55
|
* light: 'https://example.com/avatar-light.png',
|
|
58
56
|
* dark: 'https://example.com/avatar-dark.png',
|
|
@@ -77,13 +75,13 @@ export interface InkeepAIChatSettings {
|
|
|
77
75
|
/**
|
|
78
76
|
* Custom heading text for the example questions section.
|
|
79
77
|
* Use this to better describe your suggested queries.
|
|
80
|
-
*
|
|
78
|
+
* "Common Questions" or "Try asking about..."
|
|
81
79
|
*/
|
|
82
80
|
exampleQuestionsLabel?: string;
|
|
83
81
|
/**
|
|
84
82
|
* A list of pre-written questions users can click to quickly start a conversation.
|
|
85
83
|
* These should reflect common use cases and help users understand the AI assistant's capabilities.
|
|
86
|
-
*
|
|
84
|
+
* ["How do I reset my password?", "What are the API rate limits?"] or [{ value: "How do I reset my password?", label: "How do I reset my password?" }, { value: "What are the API rate limits?", label: "What are the API rate limits?" }]
|
|
87
85
|
*/
|
|
88
86
|
exampleQuestions?: string[] | {
|
|
89
87
|
value: string;
|
|
@@ -102,7 +100,7 @@ export interface InkeepAIChatSettings {
|
|
|
102
100
|
/**
|
|
103
101
|
* The base URL path used when generating shareable chat links.
|
|
104
102
|
* Should match your application's routing structure.
|
|
105
|
-
*
|
|
103
|
+
* "/shared-chats/" or "/support/conversations/"
|
|
106
104
|
*/
|
|
107
105
|
shareChatUrlBasePath?: string;
|
|
108
106
|
/**
|
|
@@ -186,7 +184,7 @@ export interface AIChatDisclaimerSettings {
|
|
|
186
184
|
/**
|
|
187
185
|
* The main text content of the disclaimer message.
|
|
188
186
|
* Should clearly communicate important information about AI usage or limitations.
|
|
189
|
-
*
|
|
187
|
+
* "AI responses are generated automatically and may require verification."
|
|
190
188
|
*/
|
|
191
189
|
label?: string;
|
|
192
190
|
/**
|
|
@@ -229,27 +227,27 @@ export interface AIChatFunctions {
|
|
|
229
227
|
export interface AIChatToolbarButtonLabels {
|
|
230
228
|
/**
|
|
231
229
|
* Text shown on the button that clears the chat history.
|
|
232
|
-
*
|
|
230
|
+
* "Clear Chat" or "Start Over"
|
|
233
231
|
*/
|
|
234
232
|
clear?: string;
|
|
235
233
|
/**
|
|
236
234
|
* Text shown on the button that generates a shareable chat link.
|
|
237
|
-
*
|
|
235
|
+
* "Share Chat" or "Get Link"
|
|
238
236
|
*/
|
|
239
237
|
share?: string;
|
|
240
238
|
/**
|
|
241
239
|
* Text shown on the button that opens the help options menu.
|
|
242
|
-
*
|
|
240
|
+
* "Get Help" or "Support Options"
|
|
243
241
|
*/
|
|
244
242
|
getHelp?: string;
|
|
245
243
|
/**
|
|
246
244
|
* Text shown on the button that stops the AI from generating a response.
|
|
247
|
-
*
|
|
245
|
+
* "Stop" or "Cancel Response"
|
|
248
246
|
*/
|
|
249
247
|
stop?: string;
|
|
250
248
|
/**
|
|
251
249
|
* Text shown on the button that copies the chat transcript.
|
|
252
|
-
*
|
|
250
|
+
* "Copy Chat" or "Copy Transcript"
|
|
253
251
|
*/
|
|
254
252
|
copyChat?: string;
|
|
255
253
|
}
|
|
@@ -142,8 +142,6 @@ export interface UserTheme extends Partial<IkpTheme> {
|
|
|
142
142
|
/**
|
|
143
143
|
* The syntax highlighter theme configuration for code blocks.
|
|
144
144
|
* Allows setting different themes for light and dark modes.
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
145
|
* ```ts
|
|
148
146
|
* syntaxHighlighter: {
|
|
149
147
|
* lightTheme: themes.github,
|
|
@@ -155,8 +153,6 @@ export interface UserTheme extends Partial<IkpTheme> {
|
|
|
155
153
|
/**
|
|
156
154
|
* The primary colors used to generate the color scheme.
|
|
157
155
|
* These colors will be used to create variations for different UI states.
|
|
158
|
-
*
|
|
159
|
-
* @example
|
|
160
156
|
* ```ts
|
|
161
157
|
* primaryColors: {
|
|
162
158
|
* primary: '#26D6FF',
|
|
@@ -176,8 +172,6 @@ export interface UserTheme extends Partial<IkpTheme> {
|
|
|
176
172
|
* Custom styles to be injected into the widget.
|
|
177
173
|
* Supports both inline styles and external stylesheets/resources.
|
|
178
174
|
* Styles are uniquely identified by their key to prevent duplicates.
|
|
179
|
-
*
|
|
180
|
-
* @example
|
|
181
175
|
* ```ts
|
|
182
176
|
* styles: [
|
|
183
177
|
* // External stylesheet or font
|
|
@@ -213,8 +207,6 @@ export interface Style {
|
|
|
213
207
|
/**
|
|
214
208
|
* A unique identifier for the style.
|
|
215
209
|
* This is used to prevent duplicate styles and allow for style updates.
|
|
216
|
-
*
|
|
217
|
-
* @example
|
|
218
210
|
* key: 'custom-button-styles'
|
|
219
211
|
*/
|
|
220
212
|
key?: string;
|
|
@@ -222,8 +214,6 @@ export interface Style {
|
|
|
222
214
|
* The type of style to apply.
|
|
223
215
|
* - 'link': Adds a <link> tag to load external resources like fonts or stylesheets
|
|
224
216
|
* - 'style': Injects CSS directly into a <style> tag
|
|
225
|
-
*
|
|
226
|
-
* @example
|
|
227
217
|
* type: 'link' // For loading external resources
|
|
228
218
|
* type: 'style' // For inline CSS
|
|
229
219
|
*/
|
|
@@ -252,8 +242,6 @@ export interface ColorModeConfig extends Omit<ColorModeProviderProps, 'children'
|
|
|
252
242
|
*
|
|
253
243
|
* This allows the widget to automatically match its color mode (light/dark) with your application's theme.
|
|
254
244
|
* The widget will observe changes to specified attributes on a target element and update its appearance accordingly.
|
|
255
|
-
*
|
|
256
|
-
* @example
|
|
257
245
|
* ```ts
|
|
258
246
|
* colorMode: {
|
|
259
247
|
* sync: {
|
|
@@ -277,8 +265,6 @@ export interface SyncColorMode {
|
|
|
277
265
|
* This element's attributes will be monitored for changes to determine the color mode.
|
|
278
266
|
*
|
|
279
267
|
* Common use cases include watching the document root or a specific app container.
|
|
280
|
-
*
|
|
281
|
-
* @example
|
|
282
268
|
* ```ts
|
|
283
269
|
* // Watch the document root element
|
|
284
270
|
* target: document.documentElement
|
|
@@ -299,8 +285,6 @@ export interface SyncColorMode {
|
|
|
299
285
|
* - data-theme: Custom theme attribute
|
|
300
286
|
* - color-scheme: Standard CSS color scheme
|
|
301
287
|
* - class: Class-based theming
|
|
302
|
-
*
|
|
303
|
-
* @example
|
|
304
288
|
* ```ts
|
|
305
289
|
* // Watch data-theme attribute
|
|
306
290
|
* attributes: ['data-theme']
|
|
@@ -323,8 +307,6 @@ export interface SyncColorMode {
|
|
|
323
307
|
|
|
324
308
|
* @param attributes - Object containing the current values of monitored attributes
|
|
325
309
|
* @returns True if dark mode is detected, false otherwise
|
|
326
|
-
*
|
|
327
|
-
* @example
|
|
328
310
|
* ```ts
|
|
329
311
|
* // Check data-theme attribute
|
|
330
312
|
* isDarkMode: (attributes) => attributes['data-theme'] === 'dark'
|
|
@@ -344,8 +326,6 @@ export interface SyncColorMode {
|
|
|
344
326
|
*
|
|
345
327
|
|
|
346
328
|
* @param colorMode - The new color mode value ('light' | 'dark')
|
|
347
|
-
*
|
|
348
|
-
* @example
|
|
349
329
|
* ```ts
|
|
350
330
|
* onChange: (colorMode) => {
|
|
351
331
|
* console.log(`Color mode changed to: ${colorMode}`);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ToolUIPart } from 'ai';
|
|
1
2
|
import { Message } from '../message';
|
|
2
3
|
export type ComponentsConfig<A extends Record<string, unknown>> = {
|
|
3
4
|
[K in keyof A]: (props: A[K], target: HTMLElement, context: null) => void | React.ReactNode;
|
|
@@ -7,4 +8,9 @@ export type ComponentsConfig<A extends Record<string, unknown>> = {
|
|
|
7
8
|
renderComponent: (name: string, props: Record<string, unknown>) => React.ReactNode;
|
|
8
9
|
renderMarkdown: (text: string) => React.ReactNode;
|
|
9
10
|
}, target: HTMLElement, context: null): void | React.ReactNode;
|
|
11
|
+
IkpTool?(props: {
|
|
12
|
+
tool: ToolUIPart;
|
|
13
|
+
approve: (approved?: boolean) => Promise<void>;
|
|
14
|
+
renderMarkdown: (text: string) => React.ReactNode;
|
|
15
|
+
}, target: HTMLElement, context: null): void | React.ReactNode;
|
|
10
16
|
};
|
|
@@ -51,8 +51,6 @@ export interface InkeepSearchSettings {
|
|
|
51
51
|
* - Omit 'All' from tabs array to hide the All tab
|
|
52
52
|
* - Empty tabs array will show all results without tab UI
|
|
53
53
|
* - Tabs only appear when they have results, unless isAlwaysVisible is set
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
54
|
* ```ts
|
|
57
55
|
* // Basic tabs
|
|
58
56
|
* tabs: ['Publications', 'GitHub']
|
|
@@ -28,18 +28,84 @@ export interface InvokeMessageCallbackAction {
|
|
|
28
28
|
callback: (args: InvokeMessageCallbackActionArgs) => void;
|
|
29
29
|
shouldCloseModal?: boolean;
|
|
30
30
|
}
|
|
31
|
-
type
|
|
32
|
-
|
|
31
|
+
type Expand<T> = T extends infer O ? {
|
|
32
|
+
[K in keyof O]: O[K];
|
|
33
|
+
} : never;
|
|
34
|
+
type ExpandUnion<T> = T extends any ? Expand<T> : never;
|
|
35
|
+
type ChatAction = ExpandUnion<InvokeCallbackAction | OpenFormAction | OpenUrlAction>;
|
|
36
|
+
type MessageChatAction = ExpandUnion<InvokeMessageCallbackAction | OpenFormAction | OpenUrlAction>;
|
|
33
37
|
export type ChatActionType = ChatAction['type'];
|
|
34
38
|
export interface GetHelpOption {
|
|
35
39
|
icon?: InkeepCustomIcon;
|
|
36
40
|
name: string;
|
|
37
41
|
isPinnedToToolbar?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Action to be performed when the option is clicked.
|
|
44
|
+
*
|
|
45
|
+
* ```ts
|
|
46
|
+
* action: {
|
|
47
|
+
* type: 'open_form',
|
|
48
|
+
* formSettings: {
|
|
49
|
+
* title: 'Open Form',
|
|
50
|
+
* description: 'Open a form',
|
|
51
|
+
* },
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
* ```ts
|
|
55
|
+
* action: {
|
|
56
|
+
* type: 'open_link',
|
|
57
|
+
* url: 'https://example.com',
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
* ```ts
|
|
61
|
+
* action: {
|
|
62
|
+
* type: 'invoke_callback',
|
|
63
|
+
* callback: (args: InvokeCallbackArgs) => {
|
|
64
|
+
* console.log(args)
|
|
65
|
+
* },
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
38
69
|
action: ChatAction;
|
|
39
70
|
}
|
|
40
71
|
export interface CustomMessageAction {
|
|
41
72
|
label?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Icon to be displayed next to the label.
|
|
75
|
+
*
|
|
76
|
+
* ```ts
|
|
77
|
+
* icon: { builtIn: 'FaEnvelope' },
|
|
78
|
+
* icon: { custom: 'https://example.com/icon.svg' },
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
42
81
|
icon?: InkeepCustomIcon;
|
|
82
|
+
/**
|
|
83
|
+
* Action to be performed when the option is clicked.
|
|
84
|
+
*
|
|
85
|
+
* ```ts
|
|
86
|
+
* action: {
|
|
87
|
+
* type: 'open_form',
|
|
88
|
+
* formSettings: {
|
|
89
|
+
* title: 'Open Form',
|
|
90
|
+
* description: 'Open a form',
|
|
91
|
+
* },
|
|
92
|
+
* },
|
|
93
|
+
* ```
|
|
94
|
+
* ```ts
|
|
95
|
+
* action: {
|
|
96
|
+
* type: 'invoke_message_callback',
|
|
97
|
+
* callback: (args: InvokeMessageCallbackActionArgs) => {
|
|
98
|
+
* console.log(args)
|
|
99
|
+
* },
|
|
100
|
+
* }
|
|
101
|
+
* ```
|
|
102
|
+
* ```ts
|
|
103
|
+
* action: {
|
|
104
|
+
* type: 'open_link',
|
|
105
|
+
* url: 'https://example.com',
|
|
106
|
+
* }
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
43
109
|
action: MessageChatAction;
|
|
44
110
|
}
|
|
45
111
|
export type IkpChatAction = GetHelpOption | CustomMessageAction;
|
package/dist/types/sources.d.ts
CHANGED
|
@@ -51,8 +51,6 @@ export interface TransformedSource {
|
|
|
51
51
|
description?: string;
|
|
52
52
|
/**
|
|
53
53
|
* Breadcrumbs for the source.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
54
|
* ```ts
|
|
57
55
|
* breadcrumbs: ['Subpath', 'Page']
|
|
58
56
|
* ```
|
|
@@ -60,14 +58,12 @@ export interface TransformedSource {
|
|
|
60
58
|
breadcrumbs?: string[];
|
|
61
59
|
/**
|
|
62
60
|
* Tabs where this source shows up. (Only for searchResultsItem)
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
61
|
* ```ts
|
|
66
62
|
* tabs: ['Docs']
|
|
67
63
|
* tabs: ['Docs', 'API']
|
|
68
64
|
* ```
|
|
69
65
|
* You can also specify different breadcrumbs for specific tab.
|
|
70
|
-
*
|
|
66
|
+
*
|
|
71
67
|
* ```ts
|
|
72
68
|
* tabs: ['Docs', ['API', { breadcrumbs: ['Guides', 'API'] }]]
|
|
73
69
|
* ```
|
|
@@ -75,8 +71,6 @@ export interface TransformedSource {
|
|
|
75
71
|
tabs?: (SourceTab | string)[];
|
|
76
72
|
/**
|
|
77
73
|
* Icon of the source.
|
|
78
|
-
*
|
|
79
|
-
* @example
|
|
80
74
|
* ```ts
|
|
81
75
|
* icon: { builtIn: 'LuBookOpen' }
|
|
82
76
|
* icon: { custom: 'https://example.com/icon.svg' }
|
|
@@ -89,8 +83,6 @@ export interface TransformedSource {
|
|
|
89
83
|
shouldOpenInNewTab?: boolean;
|
|
90
84
|
/**
|
|
91
85
|
* Search query params to append to the URL.
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
86
|
* If you want to know if the source is from chat or search, you can append the source type to the URL.
|
|
95
87
|
* ```ts
|
|
96
88
|
* appendToUrl: { from: 'chatSourceItem' }
|