@xapp/stentor-chat-widget 1.49.3 → 1.50.0

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.
Files changed (2) hide show
  1. package/lib/WidgetEnv.d.ts +69 -1
  2. package/package.json +2 -2
@@ -1,4 +1,5 @@
1
1
  /*! Copyright (c) 2021, XAPPmedia */
2
+ import { Response } from "stentor-models";
2
3
  import { WidgetTheme } from "./WidgetTheme";
3
4
  export interface CtaConfig {
4
5
  readonly message: string;
@@ -87,20 +88,46 @@ export interface WidgetEnv extends WidgetEnvDeprecated {
87
88
  */
88
89
  readonly theme?: WidgetTheme;
89
90
  /**
90
- *
91
+ * Optional configurable message that appears
91
92
  */
92
93
  readonly cta?: CtaConfig;
94
+ /**
95
+ * Optional, configure the chat button tab index
96
+ */
97
+ readonly chatButton?: WidgetChatButtonConfig;
98
+ /**
99
+ * Optional, custom header configuration including messages for the widget.
100
+ */
93
101
  readonly header?: WidgetHeaderConfig;
102
+ /**
103
+ * Optional, configure aspects of the footer.
104
+ */
94
105
  readonly footer?: WidgetFooterConfig;
106
+ /**
107
+ * Optional menu configuration, add items and configure location of toggle button.
108
+ */
95
109
  readonly menu?: WidgetMenuConfig;
110
+ /**
111
+ * Configure input field
112
+ */
96
113
  readonly input?: WidgetInputConfig;
97
114
  /**
98
115
  * When set, the widget will automatically open when the screen width is wider than what is provided. This is useful if you want to open
99
116
  * on desktop widths automatically but not on mobile.
100
117
  */
101
118
  readonly autoOpenOnWidth?: string;
119
+ /**
120
+ * Configure how the URLs within suggestion chips, markdown and list items are opened. You can choose same window, new window or new tab.
121
+ */
102
122
  readonly urls?: WidgetUrlsConfig;
123
+ /**
124
+ * Configurable error messages.
125
+ */
103
126
  readonly configurableMessages?: WidgetConfigurableMessagesConfig;
127
+ /**
128
+ * Optional set of hooks to register with the widget to receive events.
129
+ */
130
+ readonly hooks?: WidgetHooks;
104
131
  }
105
132
  export interface WidgetConfigurableMessagesConfig {
106
133
  readonly items?: WidgetConfigurableMessageConfig[];
@@ -144,23 +171,44 @@ export interface WidgetHeaderStatusConfig {
144
171
  }
145
172
  export interface WidgetHeaderActionsConfig {
146
173
  readonly refresh?: boolean;
174
+ readonly refreshTabIndex?: string;
147
175
  readonly minimize?: boolean;
176
+ readonly minimizeTabIndex?: string;
148
177
  readonly cancel?: boolean;
178
+ readonly cancelTabIndex?: string;
149
179
  }
150
180
  export interface WidgetFooterConfig {
151
181
  readonly branding?: WidgetBrandingConfig;
182
+ readonly clearButton?: WidgetClearButtonConfig;
152
183
  readonly sendButton?: WidgetSendButtonConfig;
153
184
  }
154
185
  export interface WidgetBrandingConfig {
186
+ /**
187
+ * Enable display of the branding text
188
+ */
155
189
  readonly enabled?: boolean;
156
190
  readonly text?: string;
157
191
  }
158
192
  export declare type WidgetMenuItems = WidgetMenuItemConfig | WidgetMenuItemStaticImage | WidgetMenuItemStaticText;
159
193
  export interface WidgetMenuConfig {
194
+ /**
195
+ * Set the location for the menu button.
196
+ *
197
+ * Defaults to "FOOTER" with a two bar icon.
198
+ *
199
+ * If set to "HEADER_LEFT" then the menu button will display in the header left position with a three bar icon.
200
+ */
201
+ readonly menuButtonLocation?: "HEADER_LEFT" | "FOOTER";
202
+ /**
203
+ * Menu items to be displayed.
204
+ */
160
205
  readonly items: readonly WidgetMenuItems[];
206
+ readonly itemsTabIndex?: string;
207
+ readonly button?: WidgetMenuButtonConfig;
161
208
  }
162
209
  export interface WidgetInputConfig {
163
210
  readonly placeholder?: string;
211
+ readonly tabIndex?: string;
164
212
  }
165
213
  export interface WidgetMenuItemConfig {
166
214
  readonly label: string;
@@ -182,4 +230,24 @@ export interface WidgetTypingStatusConfig {
182
230
  }
183
231
  export interface WidgetSendButtonConfig {
184
232
  readonly icon?: string;
233
+ readonly tabIndex?: string;
234
+ }
235
+ export interface WidgetChatButtonConfig {
236
+ readonly tabIndex?: string;
237
+ }
238
+ export interface WidgetClearButtonConfig {
239
+ readonly tabIndex?: string;
240
+ }
241
+ export interface WidgetMenuButtonConfig {
242
+ readonly tabIndex?: string;
243
+ }
244
+ export interface WidgetHooks {
245
+ /**
246
+ * Optional callback when a response is received.
247
+ *
248
+ * This can be used to parse any part of the message, including additional instructions included in the response.data field.
249
+ *
250
+ * @param response
251
+ */
252
+ onResponse?(response: Response): void;
185
253
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "1.49.3",
7
+ "version": "1.50.0",
8
8
  "description": "Chat Widget channel for stentor",
9
9
  "types": "lib/index",
10
10
  "main": "lib/index",
@@ -38,5 +38,5 @@
38
38
  "build": "tsc -d true -p .",
39
39
  "clean": "rm -rf ./lib/*"
40
40
  },
41
- "gitHead": "0ace81b3e467c3c0994608d739ce2ee8d39dd4a9"
41
+ "gitHead": "9c2936860632f34f43a7149343466e6e22c69138"
42
42
  }