@xapp/stentor-chat-widget 1.49.5 → 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.
- package/lib/WidgetEnv.d.ts +56 -1
- package/package.json +2 -2
package/lib/WidgetEnv.d.ts
CHANGED
|
@@ -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,21 +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
|
+
*/
|
|
93
97
|
readonly chatButton?: WidgetChatButtonConfig;
|
|
98
|
+
/**
|
|
99
|
+
* Optional, custom header configuration including messages for the widget.
|
|
100
|
+
*/
|
|
94
101
|
readonly header?: WidgetHeaderConfig;
|
|
102
|
+
/**
|
|
103
|
+
* Optional, configure aspects of the footer.
|
|
104
|
+
*/
|
|
95
105
|
readonly footer?: WidgetFooterConfig;
|
|
106
|
+
/**
|
|
107
|
+
* Optional menu configuration, add items and configure location of toggle button.
|
|
108
|
+
*/
|
|
96
109
|
readonly menu?: WidgetMenuConfig;
|
|
110
|
+
/**
|
|
111
|
+
* Configure input field
|
|
112
|
+
*/
|
|
97
113
|
readonly input?: WidgetInputConfig;
|
|
98
114
|
/**
|
|
99
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
|
|
100
116
|
* on desktop widths automatically but not on mobile.
|
|
101
117
|
*/
|
|
102
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
|
+
*/
|
|
103
122
|
readonly urls?: WidgetUrlsConfig;
|
|
123
|
+
/**
|
|
124
|
+
* Configurable error messages.
|
|
125
|
+
*/
|
|
104
126
|
readonly configurableMessages?: WidgetConfigurableMessagesConfig;
|
|
127
|
+
/**
|
|
128
|
+
* Optional set of hooks to register with the widget to receive events.
|
|
129
|
+
*/
|
|
130
|
+
readonly hooks?: WidgetHooks;
|
|
105
131
|
}
|
|
106
132
|
export interface WidgetConfigurableMessagesConfig {
|
|
107
133
|
readonly items?: WidgetConfigurableMessageConfig[];
|
|
@@ -157,12 +183,28 @@ export interface WidgetFooterConfig {
|
|
|
157
183
|
readonly sendButton?: WidgetSendButtonConfig;
|
|
158
184
|
}
|
|
159
185
|
export interface WidgetBrandingConfig {
|
|
186
|
+
/**
|
|
187
|
+
* Enable display of the branding text
|
|
188
|
+
*/
|
|
160
189
|
readonly enabled?: boolean;
|
|
161
190
|
readonly text?: string;
|
|
162
191
|
}
|
|
163
192
|
export declare type WidgetMenuItems = WidgetMenuItemConfig | WidgetMenuItemStaticImage | WidgetMenuItemStaticText;
|
|
164
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
|
+
*/
|
|
165
205
|
readonly items: readonly WidgetMenuItems[];
|
|
206
|
+
readonly itemsTabIndex?: string;
|
|
207
|
+
readonly button?: WidgetMenuButtonConfig;
|
|
166
208
|
}
|
|
167
209
|
export interface WidgetInputConfig {
|
|
168
210
|
readonly placeholder?: string;
|
|
@@ -196,3 +238,16 @@ export interface WidgetChatButtonConfig {
|
|
|
196
238
|
export interface WidgetClearButtonConfig {
|
|
197
239
|
readonly tabIndex?: string;
|
|
198
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;
|
|
253
|
+
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.
|
|
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": "
|
|
41
|
+
"gitHead": "9c2936860632f34f43a7149343466e6e22c69138"
|
|
42
42
|
}
|