@microsoft/omnichannel-chat-widget 0.1.0-main.ae3aa42 → 0.1.0-main.e170704

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.
@@ -49,6 +49,7 @@ exports.BroadcastEvent = BroadcastEvent;
49
49
  BroadcastEvent["RedirectPageRequest"] = "RedirectPageRequest";
50
50
  BroadcastEvent["StartChatSkippingChatButtonRendering"] = "StartChatSkippingChatButtonRendering";
51
51
  BroadcastEvent["StartUnauthenticatedReconnectChat"] = "StartUnauthenticatedReconnectChat";
52
+ BroadcastEvent["SetCustomContext"] = "SetCustomContext";
52
53
  })(BroadcastEvent || (exports.BroadcastEvent = BroadcastEvent = {}));
53
54
 
54
55
  let TelemetryEvent;
@@ -152,6 +153,7 @@ exports.TelemetryEvent = TelemetryEvent;
152
153
  TelemetryEvent["ReconnectChatMinimize"] = "ReconnectChatMinimize";
153
154
  TelemetryEvent["MessageSent"] = "MessageSent";
154
155
  TelemetryEvent["MessageReceived"] = "MessageReceived";
156
+ TelemetryEvent["CustomContextReceived"] = "CustomContextReceived";
155
157
  })(TelemetryEvent || (exports.TelemetryEvent = TelemetryEvent = {}));
156
158
 
157
159
  class TelemetryConstants {
@@ -194,6 +196,9 @@ class TelemetryConstants {
194
196
  case TelemetryEvent.PreChatSurveyStartChatMethodFailed:
195
197
  case TelemetryEvent.HeaderCloseButtonClicked:
196
198
  case TelemetryEvent.HeaderMinimizeButtonClicked:
199
+ case TelemetryEvent.MessageSent:
200
+ case TelemetryEvent.MessageReceived:
201
+ case TelemetryEvent.CustomContextReceived:
197
202
  return ScenarioType.ACTIONS;
198
203
 
199
204
  case TelemetryEvent.StartChatSDKCall:
@@ -50,7 +50,7 @@ const ChatButtonStateful = props => {
50
50
  dir: state.domainStates.globalDir,
51
51
  titleText: "Let's Chat!",
52
52
  subtitleText: "We're online.",
53
- hideNotificationBubble: !(state.appStates.isMinimized === true && state.appStates.unreadMessageCount > 0) || (buttonProps === null || buttonProps === void 0 ? void 0 : (_buttonProps$controlP = buttonProps.controlProps) === null || _buttonProps$controlP === void 0 ? void 0 : _buttonProps$controlP.hideNotificationBubble) === true,
53
+ hideNotificationBubble: (buttonProps === null || buttonProps === void 0 ? void 0 : (_buttonProps$controlP = buttonProps.controlProps) === null || _buttonProps$controlP === void 0 ? void 0 : _buttonProps$controlP.hideNotificationBubble) === true || state.appStates.isMinimized === false,
54
54
  unreadMessageCount: state.appStates.unreadMessageCount ? state.appStates.unreadMessageCount > _Constants.Constants.maximumUnreadMessageCount ? _Constants.Constants.maximumUnreadMessageCount.toString() + "+" : state.appStates.unreadMessageCount.toString() : "0",
55
55
  onClick: async () => {
56
56
  _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
@@ -201,6 +201,19 @@ const LiveChatWidgetStateful = props => {
201
201
  }
202
202
  }, [state.appStates.skipChatButtonRendering]);
203
203
  (0, _react2.useEffect)(() => {
204
+ // Add the custom context on receiving the SetCustomContext event
205
+ _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.SetCustomContext).subscribe(msg => {
206
+ _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
207
+ Event: _TelemetryConstants.TelemetryEvent.CustomContextReceived,
208
+ Description: "CustomContext received."
209
+ });
210
+
211
+ dispatch({
212
+ type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CUSTOM_CONTEXT,
213
+ payload: msg === null || msg === void 0 ? void 0 : msg.payload
214
+ });
215
+ });
216
+
204
217
  _omnichannelChatComponents.BroadcastService.getMessageByEventName("StartProactiveChat").subscribe(msg => {
205
218
  _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
206
219
  Event: _TelemetryConstants.TelemetryEvent.StartProactiveChatEventReceived,
@@ -17,25 +17,26 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
17
17
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT"] = 6] = "SET_PREVIOUS_FOCUSED_ELEMENT";
18
18
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 7] = "SET_OUTSIDE_OPERATING_HOURS";
19
19
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 8] = "SET_PRE_CHAT_SURVEY_RESPONSE";
20
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 9] = "SET_SHOW_CONFIRMATION";
21
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 10] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
22
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 11] = "SET_PRECHAT_RESPONSE_EMAIL";
23
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 12] = "SET_AUDIO_NOTIFICATION";
24
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 13] = "SET_E2VV_ENABLED";
25
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 14] = "SET_POST_CHAT_CONTEXT";
26
- LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 15] = "SHOW_CALLING_CONTAINER";
27
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 16] = "SET_INCOMING_CALL";
28
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 17] = "DISABLE_VIDEO_CALL";
29
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 18] = "DISABLE_LOCAL_VIDEO";
30
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 19] = "DISABLE_REMOTE_VIDEO";
31
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 20] = "SET_CHAT_TOKEN";
32
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SKIP_CHAT_BUTTON_RENDERING"] = 21] = "SET_SKIP_CHAT_BUTTON_RENDERING";
33
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 22] = "SET_PROACTIVE_CHAT_PARAMS";
34
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 23] = "SET_TELEMETRY_DATA";
35
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 24] = "SET_RECONNECT_ID";
36
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 25] = "SET_UNREAD_MESSAGE_COUNT";
37
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 26] = "SET_FOCUS_CHAT_BUTTON";
38
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 27] = "SET_CONVERSATION_ENDED_BY_AGENT";
39
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 28] = "SET_WIDGET_STATE";
40
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 29] = "SET_LIVE_CHAT_CONTEXT";
20
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 9] = "SET_CUSTOM_CONTEXT";
21
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 10] = "SET_SHOW_CONFIRMATION";
22
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 11] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
23
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 12] = "SET_PRECHAT_RESPONSE_EMAIL";
24
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 13] = "SET_AUDIO_NOTIFICATION";
25
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 14] = "SET_E2VV_ENABLED";
26
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 15] = "SET_POST_CHAT_CONTEXT";
27
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 16] = "SHOW_CALLING_CONTAINER";
28
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 17] = "SET_INCOMING_CALL";
29
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 18] = "DISABLE_VIDEO_CALL";
30
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 19] = "DISABLE_LOCAL_VIDEO";
31
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 20] = "DISABLE_REMOTE_VIDEO";
32
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 21] = "SET_CHAT_TOKEN";
33
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SKIP_CHAT_BUTTON_RENDERING"] = 22] = "SET_SKIP_CHAT_BUTTON_RENDERING";
34
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 23] = "SET_PROACTIVE_CHAT_PARAMS";
35
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 24] = "SET_TELEMETRY_DATA";
36
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 25] = "SET_RECONNECT_ID";
37
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 26] = "SET_UNREAD_MESSAGE_COUNT";
38
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 27] = "SET_FOCUS_CHAT_BUTTON";
39
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 28] = "SET_CONVERSATION_ENDED_BY_AGENT";
40
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 29] = "SET_WIDGET_STATE";
41
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 30] = "SET_LIVE_CHAT_CONTEXT";
41
42
  })(LiveChatWidgetActionType || (exports.LiveChatWidgetActionType = LiveChatWidgetActionType = {}));
@@ -27,7 +27,8 @@ const getLiveChatWidgetContextInitialState = props => {
27
27
  postChatContext: undefined,
28
28
  telemetryInternalData: {},
29
29
  globalDir: "ltr",
30
- liveChatContext: undefined
30
+ liveChatContext: undefined,
31
+ customContext: undefined
31
32
  },
32
33
  appStates: {
33
34
  conversationState: _ConversationState.ConversationState.Closed,
@@ -69,6 +69,13 @@ const createReducer = () => {
69
69
  }
70
70
  };
71
71
 
72
+ case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CUSTOM_CONTEXT:
73
+ return { ...state,
74
+ domainStates: { ...state.domainStates,
75
+ customContext: action.payload
76
+ }
77
+ };
78
+
72
79
  case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT:
73
80
  return { ...state,
74
81
  appStates: { ...state.appStates,
@@ -38,6 +38,7 @@ export let BroadcastEvent; // Events being logged
38
38
  BroadcastEvent["RedirectPageRequest"] = "RedirectPageRequest";
39
39
  BroadcastEvent["StartChatSkippingChatButtonRendering"] = "StartChatSkippingChatButtonRendering";
40
40
  BroadcastEvent["StartUnauthenticatedReconnectChat"] = "StartUnauthenticatedReconnectChat";
41
+ BroadcastEvent["SetCustomContext"] = "SetCustomContext";
41
42
  })(BroadcastEvent || (BroadcastEvent = {}));
42
43
 
43
44
  export let TelemetryEvent;
@@ -140,6 +141,7 @@ export let TelemetryEvent;
140
141
  TelemetryEvent["ReconnectChatMinimize"] = "ReconnectChatMinimize";
141
142
  TelemetryEvent["MessageSent"] = "MessageSent";
142
143
  TelemetryEvent["MessageReceived"] = "MessageReceived";
144
+ TelemetryEvent["CustomContextReceived"] = "CustomContextReceived";
143
145
  })(TelemetryEvent || (TelemetryEvent = {}));
144
146
 
145
147
  export class TelemetryConstants {
@@ -182,6 +184,9 @@ export class TelemetryConstants {
182
184
  case TelemetryEvent.PreChatSurveyStartChatMethodFailed:
183
185
  case TelemetryEvent.HeaderCloseButtonClicked:
184
186
  case TelemetryEvent.HeaderMinimizeButtonClicked:
187
+ case TelemetryEvent.MessageSent:
188
+ case TelemetryEvent.MessageReceived:
189
+ case TelemetryEvent.CustomContextReceived:
185
190
  return ScenarioType.ACTIONS;
186
191
 
187
192
  case TelemetryEvent.StartChatSDKCall:
@@ -26,7 +26,7 @@ export const ChatButtonStateful = props => {
26
26
  dir: state.domainStates.globalDir,
27
27
  titleText: "Let's Chat!",
28
28
  subtitleText: "We're online.",
29
- hideNotificationBubble: !(state.appStates.isMinimized === true && state.appStates.unreadMessageCount > 0) || (buttonProps === null || buttonProps === void 0 ? void 0 : (_buttonProps$controlP = buttonProps.controlProps) === null || _buttonProps$controlP === void 0 ? void 0 : _buttonProps$controlP.hideNotificationBubble) === true,
29
+ hideNotificationBubble: (buttonProps === null || buttonProps === void 0 ? void 0 : (_buttonProps$controlP = buttonProps.controlProps) === null || _buttonProps$controlP === void 0 ? void 0 : _buttonProps$controlP.hideNotificationBubble) === true || state.appStates.isMinimized === false,
30
30
  unreadMessageCount: state.appStates.unreadMessageCount ? state.appStates.unreadMessageCount > Constants.maximumUnreadMessageCount ? Constants.maximumUnreadMessageCount.toString() + "+" : state.appStates.unreadMessageCount.toString() : "0",
31
31
  onClick: async () => {
32
32
  TelemetryHelper.logActionEvent(LogLevel.INFO, {
@@ -145,6 +145,17 @@ export const LiveChatWidgetStateful = props => {
145
145
  }
146
146
  }, [state.appStates.skipChatButtonRendering]);
147
147
  useEffect(() => {
148
+ // Add the custom context on receiving the SetCustomContext event
149
+ BroadcastService.getMessageByEventName(BroadcastEvent.SetCustomContext).subscribe(msg => {
150
+ TelemetryHelper.logActionEvent(LogLevel.INFO, {
151
+ Event: TelemetryEvent.CustomContextReceived,
152
+ Description: "CustomContext received."
153
+ });
154
+ dispatch({
155
+ type: LiveChatWidgetActionType.SET_CUSTOM_CONTEXT,
156
+ payload: msg === null || msg === void 0 ? void 0 : msg.payload
157
+ });
158
+ });
148
159
  BroadcastService.getMessageByEventName("StartProactiveChat").subscribe(msg => {
149
160
  TelemetryHelper.logActionEvent(LogLevel.INFO, {
150
161
  Event: TelemetryEvent.StartProactiveChatEventReceived,
@@ -10,25 +10,26 @@ export let LiveChatWidgetActionType;
10
10
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT"] = 6] = "SET_PREVIOUS_FOCUSED_ELEMENT";
11
11
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 7] = "SET_OUTSIDE_OPERATING_HOURS";
12
12
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 8] = "SET_PRE_CHAT_SURVEY_RESPONSE";
13
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 9] = "SET_SHOW_CONFIRMATION";
14
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 10] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
15
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 11] = "SET_PRECHAT_RESPONSE_EMAIL";
16
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 12] = "SET_AUDIO_NOTIFICATION";
17
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 13] = "SET_E2VV_ENABLED";
18
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 14] = "SET_POST_CHAT_CONTEXT";
19
- LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 15] = "SHOW_CALLING_CONTAINER";
20
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 16] = "SET_INCOMING_CALL";
21
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 17] = "DISABLE_VIDEO_CALL";
22
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 18] = "DISABLE_LOCAL_VIDEO";
23
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 19] = "DISABLE_REMOTE_VIDEO";
24
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 20] = "SET_CHAT_TOKEN";
25
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SKIP_CHAT_BUTTON_RENDERING"] = 21] = "SET_SKIP_CHAT_BUTTON_RENDERING";
26
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 22] = "SET_PROACTIVE_CHAT_PARAMS";
27
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 23] = "SET_TELEMETRY_DATA";
28
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 24] = "SET_RECONNECT_ID";
29
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 25] = "SET_UNREAD_MESSAGE_COUNT";
30
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 26] = "SET_FOCUS_CHAT_BUTTON";
31
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 27] = "SET_CONVERSATION_ENDED_BY_AGENT";
32
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 28] = "SET_WIDGET_STATE";
33
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 29] = "SET_LIVE_CHAT_CONTEXT";
13
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 9] = "SET_CUSTOM_CONTEXT";
14
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 10] = "SET_SHOW_CONFIRMATION";
15
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 11] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
16
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 12] = "SET_PRECHAT_RESPONSE_EMAIL";
17
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 13] = "SET_AUDIO_NOTIFICATION";
18
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 14] = "SET_E2VV_ENABLED";
19
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 15] = "SET_POST_CHAT_CONTEXT";
20
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 16] = "SHOW_CALLING_CONTAINER";
21
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 17] = "SET_INCOMING_CALL";
22
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 18] = "DISABLE_VIDEO_CALL";
23
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 19] = "DISABLE_LOCAL_VIDEO";
24
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 20] = "DISABLE_REMOTE_VIDEO";
25
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 21] = "SET_CHAT_TOKEN";
26
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SKIP_CHAT_BUTTON_RENDERING"] = 22] = "SET_SKIP_CHAT_BUTTON_RENDERING";
27
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 23] = "SET_PROACTIVE_CHAT_PARAMS";
28
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 24] = "SET_TELEMETRY_DATA";
29
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 25] = "SET_RECONNECT_ID";
30
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 26] = "SET_UNREAD_MESSAGE_COUNT";
31
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 27] = "SET_FOCUS_CHAT_BUTTON";
32
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 28] = "SET_CONVERSATION_ENDED_BY_AGENT";
33
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 29] = "SET_WIDGET_STATE";
34
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 30] = "SET_LIVE_CHAT_CONTEXT";
34
35
  })(LiveChatWidgetActionType || (LiveChatWidgetActionType = {}));
@@ -18,7 +18,8 @@ export const getLiveChatWidgetContextInitialState = props => {
18
18
  postChatContext: undefined,
19
19
  telemetryInternalData: {},
20
20
  globalDir: "ltr",
21
- liveChatContext: undefined
21
+ liveChatContext: undefined,
22
+ customContext: undefined
22
23
  },
23
24
  appStates: {
24
25
  conversationState: ConversationState.Closed,
@@ -61,6 +61,13 @@ export const createReducer = () => {
61
61
  }
62
62
  };
63
63
 
64
+ case LiveChatWidgetActionType.SET_CUSTOM_CONTEXT:
65
+ return { ...state,
66
+ domainStates: { ...state.domainStates,
67
+ customContext: action.payload
68
+ }
69
+ };
70
+
64
71
  case LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT:
65
72
  return { ...state,
66
73
  appStates: { ...state.appStates,
@@ -30,7 +30,8 @@ export declare enum BroadcastEvent {
30
30
  NewMessageReceived = "NewMessageReceived",
31
31
  RedirectPageRequest = "RedirectPageRequest",
32
32
  StartChatSkippingChatButtonRendering = "StartChatSkippingChatButtonRendering",
33
- StartUnauthenticatedReconnectChat = "StartUnauthenticatedReconnectChat"
33
+ StartUnauthenticatedReconnectChat = "StartUnauthenticatedReconnectChat",
34
+ SetCustomContext = "SetCustomContext"
34
35
  }
35
36
  export declare enum TelemetryEvent {
36
37
  CallAdded = "CallAdded",
@@ -129,7 +130,8 @@ export declare enum TelemetryEvent {
129
130
  ReconnectChatStartNewConversation = "ReconnectChatStartNewConversation",
130
131
  ReconnectChatMinimize = "ReconnectChatMinimize",
131
132
  MessageSent = "MessageSent",
132
- MessageReceived = "MessageReceived"
133
+ MessageReceived = "MessageReceived",
134
+ CustomContextReceived = "CustomContextReceived"
133
135
  }
134
136
  export interface TelemetryInput {
135
137
  scenarioType: ScenarioType;
@@ -15,6 +15,7 @@ export interface ILiveChatWidgetContext {
15
15
  telemetryInternalData: IInternalTelemetryData;
16
16
  globalDir: "rtl" | "ltr";
17
17
  liveChatContext: any;
18
+ customContext: any;
18
19
  };
19
20
  appStates: {
20
21
  conversationState: ConversationState;
@@ -8,25 +8,26 @@ export declare enum LiveChatWidgetActionType {
8
8
  SET_PREVIOUS_FOCUSED_ELEMENT = 6,
9
9
  SET_OUTSIDE_OPERATING_HOURS = 7,
10
10
  SET_PRE_CHAT_SURVEY_RESPONSE = 8,
11
- SET_SHOW_CONFIRMATION = 9,
12
- SET_SHOW_EMAIL_TRANSCRIPT_PANE = 10,
13
- SET_PRECHAT_RESPONSE_EMAIL = 11,
14
- SET_AUDIO_NOTIFICATION = 12,
15
- SET_E2VV_ENABLED = 13,
16
- SET_POST_CHAT_CONTEXT = 14,
17
- SHOW_CALLING_CONTAINER = 15,
18
- SET_INCOMING_CALL = 16,
19
- DISABLE_VIDEO_CALL = 17,
20
- DISABLE_LOCAL_VIDEO = 18,
21
- DISABLE_REMOTE_VIDEO = 19,
22
- SET_CHAT_TOKEN = 20,
23
- SET_SKIP_CHAT_BUTTON_RENDERING = 21,
24
- SET_PROACTIVE_CHAT_PARAMS = 22,
25
- SET_TELEMETRY_DATA = 23,
26
- SET_RECONNECT_ID = 24,
27
- SET_UNREAD_MESSAGE_COUNT = 25,
28
- SET_FOCUS_CHAT_BUTTON = 26,
29
- SET_CONVERSATION_ENDED_BY_AGENT = 27,
30
- SET_WIDGET_STATE = 28,
31
- SET_LIVE_CHAT_CONTEXT = 29
11
+ SET_CUSTOM_CONTEXT = 9,
12
+ SET_SHOW_CONFIRMATION = 10,
13
+ SET_SHOW_EMAIL_TRANSCRIPT_PANE = 11,
14
+ SET_PRECHAT_RESPONSE_EMAIL = 12,
15
+ SET_AUDIO_NOTIFICATION = 13,
16
+ SET_E2VV_ENABLED = 14,
17
+ SET_POST_CHAT_CONTEXT = 15,
18
+ SHOW_CALLING_CONTAINER = 16,
19
+ SET_INCOMING_CALL = 17,
20
+ DISABLE_VIDEO_CALL = 18,
21
+ DISABLE_LOCAL_VIDEO = 19,
22
+ DISABLE_REMOTE_VIDEO = 20,
23
+ SET_CHAT_TOKEN = 21,
24
+ SET_SKIP_CHAT_BUTTON_RENDERING = 22,
25
+ SET_PROACTIVE_CHAT_PARAMS = 23,
26
+ SET_TELEMETRY_DATA = 24,
27
+ SET_RECONNECT_ID = 25,
28
+ SET_UNREAD_MESSAGE_COUNT = 26,
29
+ SET_FOCUS_CHAT_BUTTON = 27,
30
+ SET_CONVERSATION_ENDED_BY_AGENT = 28,
31
+ SET_WIDGET_STATE = 29,
32
+ SET_LIVE_CHAT_CONTEXT = 30
32
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "0.1.0-main.ae3aa42",
3
+ "version": "0.1.0-main.e170704",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",