@xapp/stentor-chat-widget 1.50.0 → 1.52.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/UserInfo.d.ts CHANGED
@@ -1,5 +1,25 @@
1
+ export interface ChatUserInfo extends UserInfo {
2
+ /**
3
+ * Users name
4
+ */
5
+ readonly display_name?: string;
6
+ /**
7
+ * The token that is received after a login
8
+ */
9
+ token?: string;
10
+ /**
11
+ * If the user is typing or not
12
+ */
13
+ typing?: boolean;
14
+ }
1
15
  export interface UserInfo {
16
+ /**
17
+ * URL to the user's avatar.
18
+ */
2
19
  readonly avatarPath?: string;
3
20
  readonly nick: string;
21
+ /**
22
+ * Display name
23
+ */
4
24
  readonly displayName?: string;
5
25
  }
@@ -1,6 +1,7 @@
1
1
  /*! Copyright (c) 2021, XAPPmedia */
2
2
  import { Response } from "stentor-models";
3
3
  import { WidgetTheme } from "./WidgetTheme";
4
+ import { ChatUserInfo } from "./UserInfo";
4
5
  export interface CtaConfig {
5
6
  readonly message: string;
6
7
  readonly timeout: number;
@@ -54,6 +55,11 @@ export interface WidgetEnv extends WidgetEnvDeprecated {
54
55
  * The avatar URL
55
56
  */
56
57
  readonly avatarUrl?: string;
58
+ /**
59
+ * Optional default agent information.
60
+ * @beta
61
+ */
62
+ readonly agent?: ChatUserInfo;
57
63
  /**
58
64
  * Optional ID that will be used for the user. If not prevent
59
65
  */
@@ -187,9 +193,12 @@ export interface WidgetBrandingConfig {
187
193
  * Enable display of the branding text
188
194
  */
189
195
  readonly enabled?: boolean;
196
+ /**
197
+ * Configurable text for the branding
198
+ */
190
199
  readonly text?: string;
191
200
  }
192
- export declare type WidgetMenuItems = WidgetMenuItemConfig | WidgetMenuItemStaticImage | WidgetMenuItemStaticText;
201
+ export declare type WidgetMenuItems = WidgetMenuItemConfig | WidgetMenuItemStaticImage | WidgetMenuItemStaticText | WidgetMenuItemOpenURL;
193
202
  export interface WidgetMenuConfig {
194
203
  /**
195
204
  * Set the location for the menu button.
@@ -203,7 +212,13 @@ export interface WidgetMenuConfig {
203
212
  * Menu items to be displayed.
204
213
  */
205
214
  readonly items: readonly WidgetMenuItems[];
215
+ /**
216
+ * Tab index for menu items.
217
+ */
206
218
  readonly itemsTabIndex?: string;
219
+ /**
220
+ * Menu button configuration
221
+ */
207
222
  readonly button?: WidgetMenuButtonConfig;
208
223
  }
209
224
  export interface WidgetInputConfig {
@@ -221,6 +236,20 @@ export interface WidgetMenuItemStaticText {
221
236
  readonly title: string;
222
237
  readonly body: string;
223
238
  }
239
+ export interface WidgetMenuItemOpenURL {
240
+ /**
241
+ * URL to be opened
242
+ */
243
+ readonly url: string;
244
+ /**
245
+ * Display label for the URL
246
+ */
247
+ readonly text: string;
248
+ /**
249
+ * How the URL opens, defaults to defined behavior on URL opening config.
250
+ */
251
+ readonly behavior?: WidgetUrlBehavior;
252
+ }
224
253
  export interface WidgetHeaderSubtitleConfig {
225
254
  readonly enabled?: boolean;
226
255
  readonly text?: string;
package/lib/guards.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { WidgetMenuItems, WidgetMenuItemConfig, WidgetMenuItemStaticImage, WidgetMenuItemStaticText } from "./WidgetEnv";
1
+ import { WidgetMenuItems, WidgetMenuItemConfig, WidgetMenuItemStaticImage, WidgetMenuItemStaticText, WidgetMenuItemOpenURL } from "./WidgetEnv";
2
2
  export declare function isStaticImageMenuItem(item: WidgetMenuItems): item is WidgetMenuItemStaticImage;
3
3
  export declare function isStaticTextMenuItem(item: WidgetMenuItems): item is WidgetMenuItemStaticText;
4
4
  export declare function isStandardMenuItem(item: WidgetMenuItems): item is WidgetMenuItemConfig;
5
+ export declare function isOpenURLMenuItem(item: WidgetMenuItems): item is WidgetMenuItemOpenURL;
package/lib/guards.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isStandardMenuItem = exports.isStaticTextMenuItem = exports.isStaticImageMenuItem = void 0;
3
+ exports.isOpenURLMenuItem = exports.isStandardMenuItem = exports.isStaticTextMenuItem = exports.isStaticImageMenuItem = void 0;
4
4
  function isStaticImageMenuItem(item) {
5
5
  return !!item && !!item.imageUrl;
6
6
  }
@@ -13,4 +13,8 @@ function isStandardMenuItem(item) {
13
13
  return !!item && !!item.label;
14
14
  }
15
15
  exports.isStandardMenuItem = isStandardMenuItem;
16
+ function isOpenURLMenuItem(item) {
17
+ return !!item && !!item.url;
18
+ }
19
+ exports.isOpenURLMenuItem = isOpenURLMenuItem;
16
20
  //# sourceMappingURL=guards.js.map
package/lib/guards.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"guards.js","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":";;;AAEA,SAAgB,qBAAqB,CAAC,IAAqB;IACvD,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAE,IAAkC,CAAC,QAAQ,CAAC;AACpE,CAAC;AAFD,sDAEC;AAED,SAAgB,oBAAoB,CAAC,IAAqB;IACtD,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAE,IAAiC,CAAC,IAAI,CAAC;AAC/D,CAAC;AAFD,oDAEC;AAED,SAAgB,kBAAkB,CAAC,IAAqB;IACpD,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAE,IAA6B,CAAC,KAAK,CAAC;AAC5D,CAAC;AAFD,gDAEC"}
1
+ {"version":3,"file":"guards.js","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":";;;AAEA,SAAgB,qBAAqB,CAAC,IAAqB;IACvD,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAE,IAAkC,CAAC,QAAQ,CAAC;AACpE,CAAC;AAFD,sDAEC;AAED,SAAgB,oBAAoB,CAAC,IAAqB;IACtD,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAE,IAAiC,CAAC,IAAI,CAAC;AAC/D,CAAC;AAFD,oDAEC;AAED,SAAgB,kBAAkB,CAAC,IAAqB;IACpD,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAE,IAA6B,CAAC,KAAK,CAAC;AAC5D,CAAC;AAFD,gDAEC;AAED,SAAgB,iBAAiB,CAAC,IAAqB;IACnD,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAE,IAA8B,CAAC,GAAG,CAAC;AAC3D,CAAC;AAFD,8CAEC"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "1.50.0",
7
+ "version": "1.52.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": "9c2936860632f34f43a7149343466e6e22c69138"
41
+ "gitHead": "17f4054da7560f3054cf84b9f3e7f2dc5c491acf"
42
42
  }