@xapp/stentor-chat-widget 1.46.4 → 1.48.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.
@@ -86,6 +86,9 @@ export interface WidgetEnv extends WidgetEnvDeprecated {
86
86
  * Theme for the widget
87
87
  */
88
88
  readonly theme?: WidgetTheme;
89
+ /**
90
+ *
91
+ */
89
92
  readonly cta?: CtaConfig;
90
93
  readonly header?: WidgetHeaderConfig;
91
94
  readonly footer?: WidgetFooterConfig;
@@ -152,14 +155,23 @@ export interface WidgetBrandingConfig {
152
155
  readonly enabled?: boolean;
153
156
  readonly text?: string;
154
157
  }
158
+ export declare type WidgetMenuItems = WidgetMenuItemConfig | WidgetMenuItemStaticImage | WidgetMenuItemStaticText;
155
159
  export interface WidgetMenuConfig {
156
- readonly items: readonly WidgetMenuItemConfig[];
160
+ readonly items: readonly WidgetMenuItems[];
157
161
  }
158
162
  export interface WidgetInputConfig {
159
163
  readonly placeholder?: string;
160
164
  }
161
165
  export interface WidgetMenuItemConfig {
162
166
  readonly label: string;
167
+ readonly subtitle?: string;
168
+ }
169
+ export interface WidgetMenuItemStaticImage {
170
+ readonly imageUrl: string;
171
+ }
172
+ export interface WidgetMenuItemStaticText {
173
+ readonly title: string;
174
+ readonly body: string;
163
175
  }
164
176
  export interface WidgetHeaderSubtitleConfig {
165
177
  readonly enabled?: boolean;
@@ -45,9 +45,11 @@ export interface WidgetMenuTheme {
45
45
  readonly item?: WidgetMenuItemTheme;
46
46
  }
47
47
  export interface WidgetMenuItemTheme {
48
- readonly text?: WidgetTextTheme;
49
48
  readonly background?: WidgetBackgroundTheme;
49
+ readonly border?: WidgetBorderTheme;
50
50
  readonly height?: string;
51
+ readonly subtitle?: WidgetTextTheme;
52
+ readonly text?: WidgetTextTheme;
51
53
  }
52
54
  export interface WidgetChatButtonTheme {
53
55
  /** Widget margin */
@@ -0,0 +1,4 @@
1
+ import { WidgetMenuItems, WidgetMenuItemConfig, WidgetMenuItemStaticImage, WidgetMenuItemStaticText } from "./WidgetEnv";
2
+ export declare function isStaticImageMenuItem(item: WidgetMenuItems): item is WidgetMenuItemStaticImage;
3
+ export declare function isStaticTextMenuItem(item: WidgetMenuItems): item is WidgetMenuItemStaticText;
4
+ export declare function isStandardMenuItem(item: WidgetMenuItems): item is WidgetMenuItemConfig;
package/lib/guards.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isStandardMenuItem = exports.isStaticTextMenuItem = exports.isStaticImageMenuItem = void 0;
4
+ function isStaticImageMenuItem(item) {
5
+ return !!item && !!item.imageUrl;
6
+ }
7
+ exports.isStaticImageMenuItem = isStaticImageMenuItem;
8
+ function isStaticTextMenuItem(item) {
9
+ return !!item && !!item.body;
10
+ }
11
+ exports.isStaticTextMenuItem = isStaticTextMenuItem;
12
+ function isStandardMenuItem(item) {
13
+ return !!item && !!item.label;
14
+ }
15
+ exports.isStandardMenuItem = isStandardMenuItem;
16
+ //# sourceMappingURL=guards.js.map
@@ -0,0 +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"}
package/lib/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export * from "./Types";
5
5
  export * from "./UserInfo";
6
6
  export * from "./WidgetEnv";
7
7
  export * from "./WidgetTheme";
8
+ export * from "./guards";
package/lib/index.js CHANGED
@@ -21,4 +21,5 @@ __exportStar(require("./Types"), exports);
21
21
  __exportStar(require("./UserInfo"), exports);
22
22
  __exportStar(require("./WidgetEnv"), exports);
23
23
  __exportStar(require("./WidgetTheme"), exports);
24
+ __exportStar(require("./guards"), exports);
24
25
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oCAAoC;AACpC,gDAA8B;AAC9B,8CAA4B;AAC5B,0CAAwB;AACxB,6CAA2B;AAC3B,8CAA4B;AAC5B,gDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oCAAoC;AACpC,gDAA8B;AAC9B,8CAA4B;AAC5B,0CAAwB;AACxB,6CAA2B;AAC3B,8CAA4B;AAC5B,gDAA8B;AAC9B,2CAAyB"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "1.46.4",
7
+ "version": "1.48.0",
8
8
  "description": "Chat Widget channel for stentor",
9
9
  "types": "lib/index",
10
10
  "main": "lib/index",
@@ -15,21 +15,21 @@
15
15
  "node": ">=10.x"
16
16
  },
17
17
  "devDependencies": {
18
- "@types/chai": "4.3.1",
19
- "@types/sinon": "10.0.12",
18
+ "@types/chai": "4.3.3",
19
+ "@types/sinon": "10.0.13",
20
20
  "@types/sinon-chai": "3.2.8",
21
21
  "@xapp/config": "0.2.3",
22
22
  "chai": "4.3.6",
23
23
  "mocha": "9.2.2",
24
24
  "sinon": "13.0.2",
25
25
  "sinon-chai": "3.7.0",
26
- "stentor-models": "1.56.31",
26
+ "stentor-models": "1.56.56",
27
27
  "ts-node": "10.9.1",
28
28
  "typescript": "4.7.4"
29
29
  },
30
30
  "dependencies": {
31
- "stentor-constants": "1.56.31",
32
- "stentor-guards": "1.56.32"
31
+ "stentor-constants": "1.56.56",
32
+ "stentor-guards": "1.56.56"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "stentor-models": "1.x"
@@ -38,5 +38,5 @@
38
38
  "build": "tsc -d true -p .",
39
39
  "clean": "rm -rf ./lib/*"
40
40
  },
41
- "gitHead": "cd47bd41367f87f3a463280aef0073b8ef382380"
41
+ "gitHead": "374fe9cd0832b56b227237acfa7d82be4a47f366"
42
42
  }