@nlxai/touchpoint-ui 1.2.7-alpha.2 → 1.2.7-alpha.3

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/README.md CHANGED
@@ -59,18 +59,29 @@ Main Touchpoint creation properties object
59
59
 
60
60
  #### Properties
61
61
 
62
- ##### config
62
+ ##### config?
63
63
 
64
64
  ```ts
65
- config: Config;
65
+ optional config?: Config;
66
66
  ```
67
67
 
68
- Connection information for the @nlxai/core conversation handler
68
+ Connection information for the @nlxai/core conversation handler.
69
+ Required unless `conversationHandler` is provided.
70
+
71
+ ##### conversationHandler?
72
+
73
+ ```ts
74
+ optional conversationHandler?: ConversationHandler;
75
+ ```
76
+
77
+ A pre-built conversation handler. When provided, Touchpoint will use this
78
+ instead of creating one from `config`. This enables adapters like
79
+ @nlxai/connect-chat-adapter to power the Touchpoint UI.
69
80
 
70
81
  ##### windowSize?
71
82
 
72
83
  ```ts
73
- optional windowSize: "full" | "half";
84
+ optional windowSize?: "full" | "half";
74
85
  ```
75
86
 
76
87
  Optional window size for the chat window, defaults to `half`
@@ -78,7 +89,7 @@ Optional window size for the chat window, defaults to `half`
78
89
  ##### colorMode?
79
90
 
80
91
  ```ts
81
- optional colorMode: "dark" | "light" | "light dark";
92
+ optional colorMode?: "dark" | "light" | "light dark";
82
93
  ```
83
94
 
84
95
  Optional color mode for the chat window, defaults to `dark`. Setting `light dark` enables automatic switching based on system settings.
@@ -86,7 +97,7 @@ Optional color mode for the chat window, defaults to `dark`. Setting `light dark
86
97
  ##### brandIcon?
87
98
 
88
99
  ```ts
89
- optional brandIcon: string;
100
+ optional brandIcon?: string;
90
101
  ```
91
102
 
92
103
  URL of icon used to display the brand in the chat header
@@ -94,7 +105,7 @@ URL of icon used to display the brand in the chat header
94
105
  ##### animate?
95
106
 
96
107
  ```ts
97
- optional animate: boolean;
108
+ optional animate?: boolean;
98
109
  ```
99
110
 
100
111
  Include border animation. Currently only supported in Voice Mini.
@@ -102,7 +113,7 @@ Include border animation. Currently only supported in Voice Mini.
102
113
  ##### launchIcon?
103
114
 
104
115
  ```ts
105
- optional launchIcon:
116
+ optional launchIcon?:
106
117
  | string
107
118
  | boolean
108
119
  |
@@ -123,7 +134,7 @@ When set to `false`, no launch button is shown at all. When not set or set to `t
123
134
  ##### userMessageBubble?
124
135
 
125
136
  ```ts
126
- optional userMessageBubble: boolean;
137
+ optional userMessageBubble?: boolean;
127
138
  ```
128
139
 
129
140
  Specifies whether the user message has bubbles or not
@@ -131,7 +142,7 @@ Specifies whether the user message has bubbles or not
131
142
  ##### agentMessageBubble?
132
143
 
133
144
  ```ts
134
- optional agentMessageBubble: boolean;
145
+ optional agentMessageBubble?: boolean;
135
146
  ```
136
147
 
137
148
  Specifies whether the agent message has bubbles or not
@@ -139,7 +150,7 @@ Specifies whether the agent message has bubbles or not
139
150
  ##### chatMode?
140
151
 
141
152
  ```ts
142
- optional chatMode: boolean;
153
+ optional chatMode?: boolean;
143
154
  ```
144
155
 
145
156
  Enables chat mode, a classic chat experience with inline loaders and the chat history visible at all times.
@@ -147,7 +158,7 @@ Enables chat mode, a classic chat experience with inline loaders and the chat hi
147
158
  ##### theme?
148
159
 
149
160
  ```ts
150
- optional theme: Partial<Theme>;
161
+ optional theme?: Partial<Theme>;
151
162
  ```
152
163
 
153
164
  Optional theme object to override default theme values
@@ -155,15 +166,15 @@ Optional theme object to override default theme values
155
166
  ##### modalityComponents?
156
167
 
157
168
  ```ts
158
- optional modalityComponents: Record<string, CustomModalityComponent<unknown>>;
169
+ optional modalityComponents?: Record<string, CustomModalityComponent<unknown>>;
159
170
  ```
160
171
 
161
172
  Optional [custom modality components](#custommodalitycomponent) to render in Touchpoint
162
173
 
163
- ##### initializeConversation()?
174
+ ##### initializeConversation?
164
175
 
165
176
  ```ts
166
- optional initializeConversation: (handler, context?) => void;
177
+ optional initializeConversation?: (handler, context?) => void;
167
178
  ```
168
179
 
169
180
  Custom conversation init method. Defaults to sending the welcome flow.
@@ -189,7 +200,7 @@ the context object
189
200
  ##### input?
190
201
 
191
202
  ```ts
192
- optional input: "text" | "external" | "voice" | "voiceMini";
203
+ optional input?: "text" | "external" | "voice" | "voiceMini";
193
204
  ```
194
205
 
195
206
  Controls the ways in which the user can communicate with the application. Defaults to `"text"`
@@ -197,7 +208,7 @@ Controls the ways in which the user can communicate with the application. Defaul
197
208
  ##### showVoiceTranscript?
198
209
 
199
210
  ```ts
200
- optional showVoiceTranscript: boolean;
211
+ optional showVoiceTranscript?: boolean;
201
212
  ```
202
213
 
203
214
  Sets whether the transcript is shown in `voice` and `voiceMini` inputs.
@@ -205,7 +216,7 @@ Sets whether the transcript is shown in `voice` and `voiceMini` inputs.
205
216
  ##### initialContext?
206
217
 
207
218
  ```ts
208
- optional initialContext: Context;
219
+ optional initialContext?: Context;
209
220
  ```
210
221
 
211
222
  Context sent with the initial request.
@@ -213,7 +224,7 @@ Context sent with the initial request.
213
224
  ##### bidirectional?
214
225
 
215
226
  ```ts
216
- optional bidirectional: BidirectionalConfig;
227
+ optional bidirectional?: BidirectionalConfig;
217
228
  ```
218
229
 
219
230
  Enables bidirectional mode of voice+. Will automatically set the bidirectional flag in the config.
@@ -221,7 +232,7 @@ Enables bidirectional mode of voice+. Will automatically set the bidirectional f
221
232
  ##### copy?
222
233
 
223
234
  ```ts
224
- optional copy: Partial<Copy>;
235
+ optional copy?: Partial<Copy>;
225
236
  ```
226
237
 
227
238
  Copy
@@ -250,7 +261,7 @@ conversationHandler: ConversationHandler;
250
261
 
251
262
  The conversation handler instance for interacting with the application
252
263
 
253
- ##### teardown()
264
+ ##### teardown
254
265
 
255
266
  ```ts
256
267
  teardown: () => void;
@@ -262,7 +273,7 @@ Method to remove the Touchpoint UI from the DOM
262
273
 
263
274
  `void`
264
275
 
265
- ##### setCustomBidirectionalCommands()
276
+ ##### setCustomBidirectionalCommands
266
277
 
267
278
  ```ts
268
279
  setCustomBidirectionalCommands: (commands) => void;
@@ -857,7 +868,7 @@ Small text component with smaller typography styles applied.
857
868
 
858
869
  ---
859
870
 
860
- ### html()
871
+ ### html
861
872
 
862
873
  ```ts
863
874
  const html: (strings, ...values) => unknown;
@@ -1034,7 +1045,7 @@ Bidirectional context information that is sent to the LLM.
1034
1045
  ##### uri?
1035
1046
 
1036
1047
  ```ts
1037
- optional uri: string;
1048
+ optional uri?: string;
1038
1049
  ```
1039
1050
 
1040
1051
  Identifier for which page you are currently on. This can be used to filter the relevant KB pages.
@@ -1042,7 +1053,7 @@ Identifier for which page you are currently on. This can be used to filter the r
1042
1053
  ##### fields?
1043
1054
 
1044
1055
  ```ts
1045
- optional fields: InteractiveElementInfo[];
1056
+ optional fields?: InteractiveElementInfo[];
1046
1057
  ```
1047
1058
 
1048
1059
  The active form fields that can be filled in.
@@ -1050,7 +1061,7 @@ The active form fields that can be filled in.
1050
1061
  ##### destinations?
1051
1062
 
1052
1063
  ```ts
1053
- optional destinations: string[];
1064
+ optional destinations?: string[];
1054
1065
  ```
1055
1066
 
1056
1067
  Human readable location names that can be navigated to.
@@ -1058,7 +1069,7 @@ Human readable location names that can be navigated to.
1058
1069
  ##### actions?
1059
1070
 
1060
1071
  ```ts
1061
- optional actions: object[];
1072
+ optional actions?: object[];
1062
1073
  ```
1063
1074
 
1064
1075
  Custom actions that can be performed.
@@ -1074,7 +1085,7 @@ The name of the command, used to invoke it.
1074
1085
  ###### description?
1075
1086
 
1076
1087
  ```ts
1077
- optional description: string;
1088
+ optional description?: string;
1078
1089
  ```
1079
1090
 
1080
1091
  A short description of the command
@@ -1082,7 +1093,7 @@ A short description of the command
1082
1093
  ###### schema?
1083
1094
 
1084
1095
  ```ts
1085
- optional schema: any;
1096
+ optional schema?: any;
1086
1097
  ```
1087
1098
 
1088
1099
  A schema for validating the command's input. Should follow the JSON Schema specification.
@@ -1110,7 +1121,9 @@ type BidirectionalConfig =
1110
1121
 
1111
1122
  Configuration for bidirectional mode of voice+.
1112
1123
 
1113
- #### Type Declaration
1124
+ #### Union Members
1125
+
1126
+ ##### Type Literal
1114
1127
 
1115
1128
  ```ts
1116
1129
  {
@@ -1122,10 +1135,10 @@ Configuration for bidirectional mode of voice+.
1122
1135
  }
1123
1136
  ```
1124
1137
 
1125
- ##### automaticContext?
1138
+ ###### automaticContext?
1126
1139
 
1127
1140
  ```ts
1128
- optional automaticContext: true;
1141
+ optional automaticContext?: true;
1129
1142
  ```
1130
1143
 
1131
1144
  Attempt to gather and send page context automatically. This will work well on semantically coded pages without too many custom form controls.
@@ -1133,10 +1146,10 @@ This enables a number of automatic features.
1133
1146
 
1134
1147
  Defaults to `true`.
1135
1148
 
1136
- ##### navigation()?
1149
+ ###### navigation?
1137
1150
 
1138
1151
  ```ts
1139
- optional navigation: (action, destination, destinations) => void;
1152
+ optional navigation?: (action, destination, destinations) => void;
1140
1153
  ```
1141
1154
 
1142
1155
  Navigation handler for bidirectional mode.
@@ -1147,15 +1160,15 @@ The default implementation will navigate to those pages using standard `window.l
1147
1160
 
1148
1161
  ###### action
1149
1162
 
1150
- The navigation action to perform.
1163
+ `"page_next"` \| `"page_previous"` \| `"page_custom"` \| `"page_unknown"`
1151
1164
 
1152
- `"page_next"` | `"page_previous"` | `"page_custom"` | `"page_unknown"`
1165
+ The navigation action to perform.
1153
1166
 
1154
1167
  ###### destination
1155
1168
 
1156
- The name of the destination to navigate to if `action` is `"page_custom"`.
1169
+ `string` \| `undefined`
1157
1170
 
1158
- `string` | `undefined`
1171
+ The name of the destination to navigate to if `action` is `"page_custom"`.
1159
1172
 
1160
1173
  ###### destinations
1161
1174
 
@@ -1167,10 +1180,10 @@ A map of destination names to URLs for custom navigation.
1167
1180
 
1168
1181
  `void`
1169
1182
 
1170
- ##### input()?
1183
+ ###### input?
1171
1184
 
1172
1185
  ```ts
1173
- optional input: (fields, pageFields) => void;
1186
+ optional input?: (fields, pageFields) => void;
1174
1187
  ```
1175
1188
 
1176
1189
  A callback for filling out form fields in bidirectional mode.
@@ -1195,10 +1208,10 @@ A map of field IDs to DOM elements for custom form filling.
1195
1208
 
1196
1209
  `void`
1197
1210
 
1198
- ##### ~~custom()?~~
1211
+ ###### ~~custom?~~
1199
1212
 
1200
1213
  ```ts
1201
- optional custom: (action, payload) => void;
1214
+ optional custom?: (action, payload) => void;
1202
1215
  ```
1203
1216
 
1204
1217
  A callback for custom actions in bidirectional mode.
@@ -1225,10 +1238,10 @@ The payload defined for the custom action.
1225
1238
 
1226
1239
  Use [TouchpointInstance.setCustomBidirectionalCommands](#setcustombidirectionalcommands) instead.
1227
1240
 
1228
- ##### customizeAutomaticContext()?
1241
+ ###### customizeAutomaticContext?
1229
1242
 
1230
1243
  ```ts
1231
- optional customizeAutomaticContext: (arg) => object;
1244
+ optional customizeAutomaticContext?: (arg) => object;
1232
1245
  ```
1233
1246
 
1234
1247
  A callback for customizing the automatic context gathering.
@@ -1267,6 +1280,10 @@ state: PageState;
1267
1280
 
1268
1281
  The current state of the page - this is stuff not sent to the LLM, but needed to connect the results back to actions to take on the page.
1269
1282
 
1283
+ ---
1284
+
1285
+ ##### Type Literal
1286
+
1270
1287
  ```ts
1271
1288
  {
1272
1289
  automaticContext: false;
@@ -1276,7 +1293,7 @@ The current state of the page - this is stuff not sent to the LLM, but needed to
1276
1293
  }
1277
1294
  ```
1278
1295
 
1279
- ##### automaticContext
1296
+ ###### automaticContext
1280
1297
 
1281
1298
  ```ts
1282
1299
  automaticContext: false;
@@ -1284,10 +1301,10 @@ automaticContext: false;
1284
1301
 
1285
1302
  Disable gathering page context automatically.
1286
1303
 
1287
- ##### navigation()?
1304
+ ###### navigation?
1288
1305
 
1289
1306
  ```ts
1290
- optional navigation: (action, destination?) => void;
1307
+ optional navigation?: (action, destination?) => void;
1291
1308
  ```
1292
1309
 
1293
1310
  Navigation handler for bidirectional mode. Without automatic context there is no default implementation.
@@ -1296,9 +1313,9 @@ Navigation handler for bidirectional mode. Without automatic context there is no
1296
1313
 
1297
1314
  ###### action
1298
1315
 
1299
- The navigation action to perform.
1316
+ `"page_next"` \| `"page_previous"` \| `"page_custom"` \| `"page_unknown"`
1300
1317
 
1301
- `"page_next"` | `"page_previous"` | `"page_custom"` | `"page_unknown"`
1318
+ The navigation action to perform.
1302
1319
 
1303
1320
  ###### destination?
1304
1321
 
@@ -1310,10 +1327,10 @@ The name of the destination to navigate to if `action` is `"page_custom"`.
1310
1327
 
1311
1328
  `void`
1312
1329
 
1313
- ##### input()?
1330
+ ###### input?
1314
1331
 
1315
1332
  ```ts
1316
- optional input: (fields) => void;
1333
+ optional input?: (fields) => void;
1317
1334
  ```
1318
1335
 
1319
1336
  A callback for filling out form fields in bidirectional mode. Without automatic context there is no default implementation.
@@ -1330,10 +1347,10 @@ An array of field objects with `id` and `value` properties.
1330
1347
 
1331
1348
  `void`
1332
1349
 
1333
- ##### custom()?
1350
+ ###### custom?
1334
1351
 
1335
1352
  ```ts
1336
- optional custom: (action, payload) => void;
1353
+ optional custom?: (action, payload) => void;
1337
1354
  ```
1338
1355
 
1339
1356
  A callback for custom actions in bidirectional mode.
@@ -1376,7 +1393,7 @@ The name of the command, used to invoke it. Should be unique and descriptive in
1376
1393
  ##### description?
1377
1394
 
1378
1395
  ```ts
1379
- optional description: string;
1396
+ optional description?: string;
1380
1397
  ```
1381
1398
 
1382
1399
  A short description of the command, used to help the LLM understand its purpose.
@@ -1387,7 +1404,7 @@ from the application side.
1387
1404
  ##### schema?
1388
1405
 
1389
1406
  ```ts
1390
- optional schema: any;
1407
+ optional schema?: any;
1391
1408
  ```
1392
1409
 
1393
1410
  A JSON Schema that defines the structure of the command's input.
@@ -1401,12 +1418,12 @@ Should follow the JSONSchema specification.
1401
1418
  ##### input?
1402
1419
 
1403
1420
  ```ts
1404
- optional input: any;
1421
+ optional input?: any;
1405
1422
  ```
1406
1423
 
1407
1424
  Any additional input data that the LLM should have.
1408
1425
 
1409
- ##### handler()
1426
+ ##### handler
1410
1427
 
1411
1428
  ```ts
1412
1429
  handler: (value) => void;