@microsoft/omnichannel-chat-components 1.0.1-main.9f52604 → 1.0.2-main.9ceef28

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 (104) hide show
  1. package/lib/cjs/common/Constants.js +16 -3
  2. package/lib/cjs/components/callingcontainer/common/defaultProps/defaultCallingContainerControlProps.js +4 -1
  3. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +6 -6
  4. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlProps.js +26 -23
  5. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlPropsRtl.js +20 -18
  6. package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +6 -6
  7. package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlProps.js +22 -19
  8. package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlPropsRtl.js +18 -16
  9. package/lib/cjs/components/chatbutton/ChatButton.js +2 -2
  10. package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +10 -7
  11. package/lib/cjs/components/common/commandbutton/CommandButton.js +4 -4
  12. package/lib/cjs/components/common/subcomponents/CloseButton.js +4 -4
  13. package/lib/cjs/components/confirmationpane/ConfirmationPane.js +2 -2
  14. package/lib/cjs/components/confirmationpane/common/defaultProps/defaultConfirmationPaneControlProps.js +10 -7
  15. package/lib/cjs/components/footer/Footer.js +10 -17
  16. package/lib/cjs/components/footer/common/defaultProps/customFooterControlProps.js +12 -10
  17. package/lib/cjs/components/footer/common/defaultProps/defaultFooterControlProps.js +18 -15
  18. package/lib/cjs/components/footer/common/defaultStyles/defaultFooterStyleProps.js +1 -1
  19. package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +5 -5
  20. package/lib/cjs/components/footer/subcomponents/DownloadTranscriptButton.js +4 -4
  21. package/lib/cjs/components/footer/subcomponents/EmailTranscriptButton.js +4 -4
  22. package/lib/cjs/components/header/Header.js +5 -3
  23. package/lib/cjs/components/header/common/defaultProps/azureHeaderControlProps.js +8 -6
  24. package/lib/cjs/components/header/common/defaultProps/customHeaderControlProps.js +9 -7
  25. package/lib/cjs/components/header/common/defaultProps/defaultHeaderComponentOverrides.js +3 -1
  26. package/lib/cjs/components/header/common/defaultProps/defaultHeaderControlProps.js +13 -11
  27. package/lib/cjs/components/header/subcomponents/MinimizeButton.js +4 -4
  28. package/lib/cjs/components/inputvalidationpane/common/default/defaultProps/defaultInputValidationPaneControlProps.js +11 -11
  29. package/lib/cjs/components/inputvalidationpane/common/presetTwo/presetTwoProps/presetTwoInputValidationPaneControlProps.js +11 -11
  30. package/lib/cjs/components/loadingpane/LoadingPane.js +1 -1
  31. package/lib/cjs/components/loadingpane/common/defaultProps/defaultLoadingPaneControlProps.js +7 -4
  32. package/lib/cjs/components/loadingpane/common/presetOneProps/presetOneLoadingPaneControlProps.js +1 -1
  33. package/lib/cjs/components/loadingpane/common/presetThreeProps/presetThreeLoadingPaneControlProps.js +1 -1
  34. package/lib/cjs/components/loadingpane/common/presetTwoProps/presetTwoLoadingPaneControlProps.js +1 -1
  35. package/lib/cjs/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +5 -2
  36. package/lib/cjs/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +1 -1
  37. package/lib/cjs/components/outofofficehourspane/common/presetOneProps/presetOneOOOHPaneControlProps.js +1 -1
  38. package/lib/cjs/components/outofofficehourspane/common/presetTwoProps/presetTwoOOOHPaneControlProps.js +1 -1
  39. package/lib/cjs/components/postchatsurveypane/common/defaultProps/defaultPostChatSurveyPaneControlProps.js +5 -2
  40. package/lib/cjs/components/postchatsurveypane/common/presetOneProps/presetOnePostChatSurveyPaneControlProps.js +1 -1
  41. package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +2 -2
  42. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +4 -1
  43. package/lib/cjs/components/prechatsurveypane/common/presetThreeProps/presetThreePreChatSurveyPaneControlProps.js +1 -1
  44. package/lib/cjs/components/prechatsurveypane/common/presetTwoProps/presetTwoPreChatSurveyPaneControlProps.js +1 -1
  45. package/lib/cjs/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +12 -9
  46. package/lib/cjs/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +12 -9
  47. package/lib/cjs/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +12 -9
  48. package/lib/cjs/components/proactivechatpane/common/presetTwo/presetTwoProps/presetTwoProactiveChatPaneControlProps.js +9 -6
  49. package/lib/cjs/components/reconnectchatpane/ReconnectChatPane.js +3 -3
  50. package/lib/cjs/components/reconnectchatpane/common/default/defaultProps/defaultReconnectChatPaneControlProps.js +12 -9
  51. package/lib/cjs/components/reconnectchatpane/common/presetThree/presetThreeProps/presetThreeReconnectChatPaneControlProps.js +11 -8
  52. package/lib/esm/common/Constants.js +9 -2
  53. package/lib/esm/components/callingcontainer/common/defaultProps/defaultCallingContainerControlProps.js +2 -1
  54. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +7 -7
  55. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlProps.js +24 -23
  56. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlPropsRtl.js +19 -18
  57. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +7 -7
  58. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlProps.js +20 -19
  59. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlPropsRtl.js +17 -16
  60. package/lib/esm/components/chatbutton/ChatButton.js +3 -3
  61. package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +8 -7
  62. package/lib/esm/components/common/commandbutton/CommandButton.js +5 -5
  63. package/lib/esm/components/common/subcomponents/CloseButton.js +5 -5
  64. package/lib/esm/components/confirmationpane/ConfirmationPane.js +3 -3
  65. package/lib/esm/components/confirmationpane/common/defaultProps/defaultConfirmationPaneControlProps.js +8 -7
  66. package/lib/esm/components/footer/Footer.js +9 -17
  67. package/lib/esm/components/footer/common/defaultProps/customFooterControlProps.js +11 -10
  68. package/lib/esm/components/footer/common/defaultProps/defaultFooterControlProps.js +16 -15
  69. package/lib/esm/components/footer/common/defaultStyles/defaultFooterStyleProps.js +1 -1
  70. package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +6 -6
  71. package/lib/esm/components/footer/subcomponents/DownloadTranscriptButton.js +5 -5
  72. package/lib/esm/components/footer/subcomponents/EmailTranscriptButton.js +5 -5
  73. package/lib/esm/components/header/Header.js +4 -3
  74. package/lib/esm/components/header/common/defaultProps/azureHeaderControlProps.js +7 -6
  75. package/lib/esm/components/header/common/defaultProps/customHeaderControlProps.js +8 -7
  76. package/lib/esm/components/header/common/defaultProps/defaultHeaderComponentOverrides.js +2 -1
  77. package/lib/esm/components/header/common/defaultProps/defaultHeaderControlProps.js +12 -11
  78. package/lib/esm/components/header/subcomponents/MinimizeButton.js +5 -5
  79. package/lib/esm/components/inputvalidationpane/common/default/defaultProps/defaultInputValidationPaneControlProps.js +12 -12
  80. package/lib/esm/components/inputvalidationpane/common/presetTwo/presetTwoProps/presetTwoInputValidationPaneControlProps.js +12 -12
  81. package/lib/esm/components/loadingpane/LoadingPane.js +1 -1
  82. package/lib/esm/components/loadingpane/common/defaultProps/defaultLoadingPaneControlProps.js +5 -4
  83. package/lib/esm/components/loadingpane/common/presetOneProps/presetOneLoadingPaneControlProps.js +1 -1
  84. package/lib/esm/components/loadingpane/common/presetThreeProps/presetThreeLoadingPaneControlProps.js +1 -1
  85. package/lib/esm/components/loadingpane/common/presetTwoProps/presetTwoLoadingPaneControlProps.js +1 -1
  86. package/lib/esm/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +3 -2
  87. package/lib/esm/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +1 -1
  88. package/lib/esm/components/outofofficehourspane/common/presetOneProps/presetOneOOOHPaneControlProps.js +1 -1
  89. package/lib/esm/components/outofofficehourspane/common/presetTwoProps/presetTwoOOOHPaneControlProps.js +1 -1
  90. package/lib/esm/components/postchatsurveypane/common/defaultProps/defaultPostChatSurveyPaneControlProps.js +3 -2
  91. package/lib/esm/components/postchatsurveypane/common/presetOneProps/presetOnePostChatSurveyPaneControlProps.js +1 -1
  92. package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +3 -3
  93. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +2 -1
  94. package/lib/esm/components/prechatsurveypane/common/presetThreeProps/presetThreePreChatSurveyPaneControlProps.js +1 -1
  95. package/lib/esm/components/prechatsurveypane/common/presetTwoProps/presetTwoPreChatSurveyPaneControlProps.js +1 -1
  96. package/lib/esm/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +10 -9
  97. package/lib/esm/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +10 -9
  98. package/lib/esm/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +10 -9
  99. package/lib/esm/components/proactivechatpane/common/presetTwo/presetTwoProps/presetTwoProactiveChatPaneControlProps.js +7 -6
  100. package/lib/esm/components/reconnectchatpane/ReconnectChatPane.js +4 -4
  101. package/lib/esm/components/reconnectchatpane/common/default/defaultProps/defaultReconnectChatPaneControlProps.js +10 -9
  102. package/lib/esm/components/reconnectchatpane/common/presetThree/presetThreeProps/presetThreeReconnectChatPaneControlProps.js +9 -8
  103. package/lib/types/common/Constants.d.ts +148 -0
  104. package/package.json +1 -1
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  import * as React from "react";
4
4
  import { Label, Stack } from "@fluentui/react";
5
5
  import CommandButton from "../../../common/commandbutton/CommandButton";
6
- import { ElementType, KeyCodes } from "../../../../common/Constants";
6
+ import { ElementType, EventNames, Ids, KeyCodes } from "../../../../common/Constants";
7
7
  import { decodeComponentString } from "../../../../common/decodeComponentString";
8
8
  import { defaultIncomingCallProps } from "./common/defaultProps/defaultIncomingCallProps";
9
9
  import { processCustomComponents } from "../../../../common/utils";
@@ -45,7 +45,7 @@ function IncomingCall(props) {
45
45
  const declineCustomEvent = {
46
46
  elementType: ElementType.IncomingCallDeclineCallButton,
47
47
  elementId: declineCallButtonId,
48
- eventName: "incomingCallEnded"
48
+ eventName: EventNames.IncomingCallEnded
49
49
  };
50
50
  const handleDeclineCallClick = useCallback(() => {
51
51
  var _props$controlProps12;
@@ -59,7 +59,7 @@ function IncomingCall(props) {
59
59
  const videoCustomEvent = {
60
60
  elementType: ElementType.IncomingCallVideoCallButton,
61
61
  elementId: videoCallButtonId,
62
- eventName: "OnClick"
62
+ eventName: EventNames.OnClick
63
63
  };
64
64
  const handleVideoCallClick = useCallback(() => {
65
65
  var _props$controlProps14;
@@ -73,7 +73,7 @@ function IncomingCall(props) {
73
73
  const audioCustomEvent = {
74
74
  elementType: ElementType.IncomingCallAudioCallButton,
75
75
  elementId: audioCallButtonId,
76
- eventName: "OnClick"
76
+ eventName: EventNames.OnClick
77
77
  };
78
78
  const handleAudioCallClick = useCallback(() => {
79
79
  var _props$controlProps16;
@@ -135,7 +135,7 @@ function IncomingCall(props) {
135
135
  "aria-label": incomingCallTitleProps === null || incomingCallTitleProps === void 0 ? void 0 : incomingCallTitleProps.text
136
136
  }, /*#__PURE__*/React.createElement(Stack, {
137
137
  horizontal: true,
138
- id: "incomingCallLeftGroup",
138
+ id: Ids.IncomingCallLeftGroupId,
139
139
  verticalAlign: "center",
140
140
  tokens: leftGroupStackTokens
141
141
  }, !((_props$controlProps19 = props.controlProps) !== null && _props$controlProps19 !== void 0 && _props$controlProps19.hideIncomingCallTitle) && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.incomingCallTitle) || /*#__PURE__*/React.createElement(Label, _extends({}, incomingCallTitleProps, {
@@ -144,12 +144,12 @@ function IncomingCall(props) {
144
144
  styles: incomingCallTitleStyles
145
145
  }), incomingCallTitleProps === null || incomingCallTitleProps === void 0 ? void 0 : incomingCallTitleProps.text)), processCustomComponents((_props$controlProps20 = props.controlProps) === null || _props$controlProps20 === void 0 ? void 0 : (_props$controlProps21 = _props$controlProps20.leftGroup) === null || _props$controlProps21 === void 0 ? void 0 : _props$controlProps21.children)), /*#__PURE__*/React.createElement(Stack, {
146
146
  horizontal: true,
147
- id: "incomingCallMiddleGroup",
147
+ id: Ids.IncomingCallMiddleGroupId,
148
148
  verticalAlign: "center",
149
149
  tokens: middleGroupStackTokens
150
150
  }, processCustomComponents((_props$controlProps22 = props.controlProps) === null || _props$controlProps22 === void 0 ? void 0 : (_props$controlProps23 = _props$controlProps22.middleGroup) === null || _props$controlProps23 === void 0 ? void 0 : _props$controlProps23.children)), /*#__PURE__*/React.createElement(Stack, {
151
151
  horizontal: true,
152
- id: "incomingCallRightGroup",
152
+ id: Ids.IncomingCallRightGroupId,
153
153
  verticalAlign: "center",
154
154
  tokens: rightGroupStackTokens
155
155
  }, processCustomComponents((_props$controlProps24 = props.controlProps) === null || _props$controlProps24 === void 0 ? void 0 : (_props$controlProps25 = _props$controlProps24.rightGroup) === null || _props$controlProps25 === void 0 ? void 0 : _props$controlProps25.children), !((_props$controlProps26 = props.controlProps) !== null && _props$controlProps26 !== void 0 && _props$controlProps26.hideDeclineCall) && /*#__PURE__*/React.createElement(CommandButton, _extends({}, declineCallButtonProps, {
@@ -1,19 +1,20 @@
1
+ import { AriaLabels, IconNames, ButtonTypes, Ids, Texts } from "../../../../../../common/Constants";
1
2
  export const defaultIncomingCallControlProps = {
2
- id: "oc-lcw-incomingcall",
3
+ id: Ids.DefaultIncomingCallId,
3
4
  dir: "ltr",
4
- ariaLabel: "Incoming call area",
5
+ ariaLabel: AriaLabels.IncomingCallArea,
5
6
  hideAudioCall: false,
6
7
  hideVideoCall: false,
7
8
  hideDeclineCall: false,
8
9
  hideIncomingCallTitle: false,
9
10
  onDeclineCallClick: function () {
10
- console.log("download transcript clicked");
11
+ console.log("decline call clicked");
11
12
  },
12
13
  onAudioCallClick: function () {
13
- console.log("email transcript clicked");
14
+ console.log("audio call clicked");
14
15
  },
15
16
  onVideoCallClick: function () {
16
- console.log("audio notification clicked");
17
+ console.log("video call clicked");
17
18
  },
18
19
  middleGroup: {
19
20
  gap: 5,
@@ -28,28 +29,28 @@ export const defaultIncomingCallControlProps = {
28
29
  children: []
29
30
  },
30
31
  declineCallButtonProps: {
31
- id: "callRejectButton",
32
- type: "icon",
33
- ariaLabel: "Reject call",
34
- iconName: "DeclineCall",
32
+ id: Ids.DeclineCallButtonId,
33
+ type: ButtonTypes.Icon,
34
+ ariaLabel: AriaLabels.RejectCall,
35
+ iconName: IconNames.DeclineCall,
35
36
  iconSize: 20
36
37
  },
37
38
  audioCallButtonProps: {
38
- id: "callAcceptButton",
39
- type: "icon",
40
- ariaLabel: "Accept voice call",
41
- iconName: "IncomingCall",
39
+ id: Ids.AudioCallButtonId,
40
+ type: ButtonTypes.Icon,
41
+ ariaLabel: AriaLabels.AcceptVoiceCall,
42
+ iconName: IconNames.IncomingCall,
42
43
  iconSize: 20
43
44
  },
44
45
  videoCallButtonProps: {
45
- id: "videoCallAcceptButton",
46
- type: "icon",
47
- ariaLabel: "Accept video Call",
48
- iconName: "Video",
46
+ id: Ids.VideoCallButtonId,
47
+ type: ButtonTypes.Icon,
48
+ ariaLabel: AriaLabels.AcceptVideoCall,
49
+ iconName: IconNames.Video,
49
50
  iconSize: 20
50
51
  },
51
52
  incomingCallTitle: {
52
- id: "incomingCallMessage",
53
- text: "Incoming Call"
53
+ id: Ids.IncomingCallTitleId,
54
+ text: Texts.IncomingCallTitle
54
55
  }
55
56
  };
@@ -1,19 +1,20 @@
1
1
  import { CallAcceptButtonBase64, CallRejectButtonBase64, VideoCallAcceptButtonIconBase64 } from "../../../../../../assets/Icons";
2
+ import { AriaLabels, ButtonTypes, Ids, Texts } from "../../../../../../common/Constants";
2
3
  export const defaultIncomingCallControlPropsRtl = {
3
- id: "incomingCallPopup",
4
- ariaLabel: "Incoming call area",
4
+ id: Ids.DefaultIncomingCallPopupId,
5
+ ariaLabel: AriaLabels.IncomingCallArea,
5
6
  hideAudioCall: false,
6
7
  hideVideoCall: false,
7
8
  hideDeclineCall: false,
8
9
  hideIncomingCallTitle: false,
9
10
  onDeclineCallClick: function () {
10
- console.log("download transcript clicked");
11
+ console.log("decline call clicked");
11
12
  },
12
13
  onAudioCallClick: function () {
13
- console.log("email transcript clicked");
14
+ console.log("audio call clicked");
14
15
  },
15
16
  onVideoCallClick: function () {
16
- console.log("audio notification clicked");
17
+ console.log("video call clicked");
17
18
  },
18
19
  middleGroup: {
19
20
  gap: 5,
@@ -29,9 +30,9 @@ export const defaultIncomingCallControlPropsRtl = {
29
30
  },
30
31
  dir: "rtl",
31
32
  declineCallButtonProps: {
32
- id: "callRejectButton",
33
- type: "icon",
34
- ariaLabel: "Decline Call",
33
+ id: Ids.DeclineCallButtonId,
34
+ type: ButtonTypes.Icon,
35
+ ariaLabel: AriaLabels.DeclineCall,
35
36
  imageIconProps: {
36
37
  src: CallRejectButtonBase64,
37
38
  styles: {
@@ -44,9 +45,9 @@ export const defaultIncomingCallControlPropsRtl = {
44
45
  iconSize: 20
45
46
  },
46
47
  audioCallButtonProps: {
47
- id: "callAcceptButton",
48
- type: "icon",
49
- ariaLabel: "Audio Call",
48
+ id: Ids.AudioCallButtonId,
49
+ type: ButtonTypes.Icon,
50
+ ariaLabel: AriaLabels.AudioCall,
50
51
  imageIconProps: {
51
52
  src: CallAcceptButtonBase64,
52
53
  styles: {
@@ -59,9 +60,9 @@ export const defaultIncomingCallControlPropsRtl = {
59
60
  iconSize: 20
60
61
  },
61
62
  videoCallButtonProps: {
62
- id: "videoCallAcceptButton",
63
- type: "icon",
64
- ariaLabel: "Video Call",
63
+ id: Ids.VideoCallButtonId,
64
+ type: ButtonTypes.Icon,
65
+ ariaLabel: AriaLabels.VideoCall,
65
66
  imageIconProps: {
66
67
  src: VideoCallAcceptButtonIconBase64,
67
68
  styles: {
@@ -74,7 +75,7 @@ export const defaultIncomingCallControlPropsRtl = {
74
75
  iconSize: 20
75
76
  },
76
77
  incomingCallTitle: {
77
- id: "incomingCallMessage",
78
- text: "Incoming Call"
78
+ id: Ids.IncomingCallTitleId,
79
+ text: Texts.IncomingCallTitle
79
80
  }
80
81
  };
@@ -1,7 +1,7 @@
1
1
  import { Icon, Label, Stack } from "@fluentui/react";
2
2
  import React, { useCallback } from "react";
3
3
  import { BroadcastService } from "../../services/BroadcastService";
4
- import { ElementType, HiddenTextStyles, KeyCodes } from "../../common/Constants";
4
+ import { ElementType, EventNames, HiddenTextStyles, Ids, KeyCodes } from "../../common/Constants";
5
5
  import { decodeComponentString } from "../../common/decodeComponentString";
6
6
  import { defaultChatButtonControlProps } from "./common/defaultProps/defaultChatButtonControlProps";
7
7
  import { defaultChatButtonGeneralStyles } from "./common/defaultStyles/defaultChatButtonGeneralStyles";
@@ -89,7 +89,7 @@ function TextContainer(props, parentId) {
89
89
  function ChatButton(props) {
90
90
  var _props$controlProps12, _props$controlProps13, _props$controlProps14, _props$controlProps15, _props$controlProps16, _props$controlProps17, _props$controlProps18, _props$controlProps19, _props$styleProps11;
91
91
 
92
- const elementId = ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.id) ?? "lcw-components-chat-button";
92
+ const elementId = ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.id) ?? Ids.DefaultChatButtonId;
93
93
  const defaultAriaLabel = ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.ariaLabel) ?? defaultChatButtonControlProps.ariaLabel;
94
94
  const defaultRole = ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.role) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.role);
95
95
  const containersDir = ((_props$controlProps15 = props.controlProps) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.dir) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.dir);
@@ -107,7 +107,7 @@ function ChatButton(props) {
107
107
  const customEvent = {
108
108
  elementType: ElementType.ChatButton,
109
109
  elementId: elementId,
110
- eventName: "OnClick"
110
+ eventName: EventNames.OnClick
111
111
  };
112
112
  BroadcastService.postMessage(customEvent);
113
113
  props.controlProps.onClick();
@@ -1,11 +1,12 @@
1
+ import { AriaLabels, Ids, Texts } from "../../../../common/Constants";
1
2
  export const defaultChatButtonControlProps = {
2
- id: "lcw-components-chat-button",
3
+ id: Ids.DefaultChatButtonId,
3
4
  dir: "ltr",
4
5
  role: "button",
5
- ariaLabel: "Let's chat We are online",
6
+ ariaLabel: AriaLabels.LetsChatWeAreOnline,
6
7
  unreadMessageCount: "0",
7
- titleText: "Let's Chat!",
8
- subtitleText: "We're online.",
8
+ titleText: Texts.ChatButtonTitle,
9
+ subtitleText: Texts.ChatButtonSubtitle,
9
10
  onClick: function () {
10
11
  console.log("initiate chat");
11
12
  },
@@ -15,7 +16,7 @@ export const defaultChatButtonControlProps = {
15
16
  hideChatSubtitle: false,
16
17
  hideChatTitle: false,
17
18
  hideNotificationBubble: true,
18
- unreadMessageString: "new messages",
19
- largeUnreadMessageString: "99+",
20
- ariaLabelUnreadMessageString: "you have new messages"
19
+ unreadMessageString: Texts.ChatButtonUnreadMessageString,
20
+ largeUnreadMessageString: Texts.ChatButtonLargeUnreadMessageString,
21
+ ariaLabelUnreadMessageString: AriaLabels.UnreadMessageString
21
22
  };
@@ -1,7 +1,7 @@
1
1
  import { DefaultButton, IconButton } from "@fluentui/react";
2
2
  import React, { useCallback } from "react";
3
3
  import { BroadcastService } from "../../../services/BroadcastService";
4
- import { ElementType } from "../../../common/Constants";
4
+ import { ElementType, EventNames, ButtonTypes } from "../../../common/Constants";
5
5
 
6
6
  function CommandButton(props) {
7
7
  var _props$hoverStyles, _props$hoverStyles2, _props$focusStyles;
@@ -14,7 +14,7 @@ function CommandButton(props) {
14
14
  };
15
15
  let iconStyles = {};
16
16
 
17
- if (props.type === "icon") {
17
+ if (props.type === ButtonTypes.Icon) {
18
18
  var _props$styles;
19
19
 
20
20
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -47,7 +47,7 @@ function CommandButton(props) {
47
47
  const handleOnClick = useCallback(() => {
48
48
  if (props !== null && props !== void 0 && props.onClick) {
49
49
  const customEvent = props.customEvent ?? {
50
- eventName: "onClick",
50
+ eventName: EventNames.OnClick,
51
51
  elementType: ElementType.Custom,
52
52
  elementId: props === null || props === void 0 ? void 0 : props.id
53
53
  };
@@ -55,7 +55,7 @@ function CommandButton(props) {
55
55
  props === null || props === void 0 ? void 0 : props.onClick();
56
56
  }
57
57
  }, []);
58
- return /*#__PURE__*/React.createElement(React.Fragment, null, props.type === "text" && /*#__PURE__*/React.createElement(DefaultButton, {
58
+ return /*#__PURE__*/React.createElement(React.Fragment, null, props.type === ButtonTypes.Text && /*#__PURE__*/React.createElement(DefaultButton, {
59
59
  id: props.id,
60
60
  text: props.text,
61
61
  ariaLabel: props.ariaLabel,
@@ -63,7 +63,7 @@ function CommandButton(props) {
63
63
  disabled: props.disabled,
64
64
  className: props.className,
65
65
  styles: buttonStyles
66
- }), props.type === "icon" && /*#__PURE__*/React.createElement(IconButton, {
66
+ }), props.type === ButtonTypes.Icon && /*#__PURE__*/React.createElement(IconButton, {
67
67
  id: props.id,
68
68
  iconProps: iconProp,
69
69
  title: props.hideButtonTitle ? undefined : props.ariaLabel,
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { ElementType } from "../../../common/Constants";
2
+ import { AriaLabels, ElementType, EventNames, IconNames, Texts } from "../../../common/Constants";
3
3
  import CommandButton from "../commandbutton/CommandButton";
4
4
 
5
5
  function CloseButton(props) {
@@ -9,19 +9,19 @@ function CloseButton(props) {
9
9
  const customEvent = {
10
10
  elementType: ElementType.CloseButton,
11
11
  elementId: props === null || props === void 0 ? void 0 : props.id,
12
- eventName: "OnClick"
12
+ eventName: EventNames.OnClick
13
13
  };
14
14
  return /*#__PURE__*/React.createElement(CommandButton, {
15
15
  id: props === null || props === void 0 ? void 0 : props.id,
16
16
  type: type,
17
- text: props.text ?? "Close",
17
+ text: props.text ?? Texts.CloseButtonText,
18
18
  styles: props.styles,
19
19
  hoverStyles: props.hoverStyles,
20
20
  focusStyles: props.focusStyles,
21
- iconName: props.iconName ?? "ChromeClose",
21
+ iconName: props.iconName ?? IconNames.ChromeClose,
22
22
  imageIconProps: props.imageIconProps,
23
23
  onClick: props.onClick,
24
- ariaLabel: props.ariaLabel ?? "Close",
24
+ ariaLabel: props.ariaLabel ?? AriaLabels.Close,
25
25
  className: props.className,
26
26
  customEvent: customEvent,
27
27
  hideButtonTitle: props.hideButtonTitle
@@ -2,7 +2,7 @@ import { DefaultButton, PrimaryButton } from "@fluentui/react/lib/Button";
2
2
  import { Label, Stack } from "@fluentui/react";
3
3
  import React, { useCallback } from "react";
4
4
  import { BroadcastService } from "../../services/BroadcastService";
5
- import { ElementType, KeyCodes } from "../../common/Constants";
5
+ import { ElementType, EventNames, KeyCodes } from "../../common/Constants";
6
6
  import { decodeComponentString } from "../../common/decodeComponentString";
7
7
  import { defaultConfirmationPaneButtonGroupStyles } from "./common/defaultStyles/defaultConfirmationPaneButtonGroupStyles";
8
8
  import { defaultConfirmationPaneCancelButtonHoveredStyles } from "./common/defaultStyles/defaultConfirmationPaneCancelButtonHoveredStyles";
@@ -29,7 +29,7 @@ function ConfirmationPane(props) {
29
29
  const customEvent = {
30
30
  elementType: ElementType.ConfirmationPaneConfirmButton,
31
31
  elementId: elementId + "-confirmbutton",
32
- eventName: "OnClick"
32
+ eventName: EventNames.OnClick
33
33
  };
34
34
  BroadcastService.postMessage(customEvent);
35
35
  (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.onConfirm();
@@ -44,7 +44,7 @@ function ConfirmationPane(props) {
44
44
  const customEvent = {
45
45
  elementType: ElementType.ConfirmationPaneCancelButton,
46
46
  elementId: elementId + "-cancelbutton",
47
- eventName: "OnClick"
47
+ eventName: EventNames.OnClick
48
48
  };
49
49
  BroadcastService.postMessage(customEvent);
50
50
  (_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.onCancel();
@@ -1,17 +1,18 @@
1
+ import { AriaLabels, Ids, Texts } from "../../../../common/Constants";
1
2
  export const defaultConfirmationPaneControlProps = {
2
- id: "lcw-components-confirmation-pane",
3
+ id: Ids.DefaultConfirmationPaneId,
3
4
  dir: "ltr",
4
5
  hideConfirmationPane: false,
5
6
  hideTitle: false,
6
- titleText: "Close chat",
7
+ titleText: Texts.ConfirmationPaneTitle,
7
8
  hideSubtitle: false,
8
- subtitleText: "Do you really want to close this chat?",
9
+ subtitleText: Texts.ConfirmationPaneSubtitle,
9
10
  hideConfirmButton: false,
10
- confirmButtonText: "Close",
11
- confirmButtonAriaLabel: "Close Chat",
11
+ confirmButtonText: Texts.ConfirmButtonText,
12
+ confirmButtonAriaLabel: AriaLabels.ConfirmationPaneConfirm,
12
13
  hideCancelButton: false,
13
- cancelButtonText: "Cancel",
14
- cancelButtonAriaLabel: "Cancel. Return to Chat",
14
+ cancelButtonText: Texts.CancelButtonText,
15
+ cancelButtonAriaLabel: AriaLabels.ConfirmationPaneCancel,
15
16
  onConfirm: function () {
16
17
  console.log("on confirm");
17
18
  },
@@ -8,6 +8,7 @@ import EmailTranscriptButton from "./subcomponents/EmailTranscriptButton";
8
8
  import { decodeComponentString } from "../../common/decodeComponentString";
9
9
  import { defaultFooterProps } from "./common/defaultProps/defaultFooterProps";
10
10
  import { processCustomComponents } from "../../common/utils";
11
+ import { Ids } from "../../common/Constants";
11
12
  initializeIcons();
12
13
 
13
14
  function Footer(props) {
@@ -32,15 +33,13 @@ function Footer(props) {
32
33
  horizontal: true,
33
34
  className: props.className,
34
35
  horizontalAlign: "space-between",
36
+ verticalAlign: "center",
35
37
  styles: stackStyles,
36
38
  dir: ((_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.dir) ?? "ltr",
37
39
  role: "region"
38
40
  }, /*#__PURE__*/React.createElement(Stack, {
39
41
  horizontal: true,
40
- id: "footerLeftGroup",
41
- verticalAlign: "center"
42
- }, /*#__PURE__*/React.createElement(Stack, {
43
- horizontal: true,
42
+ id: Ids.FooterLeftGroupId,
44
43
  verticalAlign: "center"
45
44
  }, !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hideDownloadTranscriptButton) && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.DownloadTranscriptButton) || /*#__PURE__*/React.createElement(DownloadTranscriptButton, _extends({}, downloadTranscriptButtonProps, {
46
45
  onClick: (_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.onDownloadTranscriptClick,
@@ -52,27 +51,20 @@ function Footer(props) {
52
51
  styles: emailTranscriptButtonStyles,
53
52
  hoverStyles: emailTranscriptButtonHoverStyles,
54
53
  focusStyles: footerItemFocusStyles
55
- }))), processCustomComponents((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : (_props$controlProps11 = _props$controlProps10.leftGroup) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.children))), /*#__PURE__*/React.createElement(Stack, {
56
- horizontal: true,
57
- id: "footerMiddleGroup"
58
- }, /*#__PURE__*/React.createElement(Stack, {
59
- horizontal: true,
60
- verticalAlign: "start"
61
- }, /*#__PURE__*/React.createElement(Stack.Item, {
62
- align: "start"
63
- }, processCustomComponents((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : (_props$controlProps13 = _props$controlProps12.middleGroup) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.children)))), /*#__PURE__*/React.createElement(Stack, {
54
+ }))), processCustomComponents((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : (_props$controlProps11 = _props$controlProps10.leftGroup) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.children)), /*#__PURE__*/React.createElement(Stack, {
64
55
  horizontal: true,
65
- id: "footerRightGroup",
66
- verticalAlign: "start"
67
- }, /*#__PURE__*/React.createElement(Stack, {
56
+ id: Ids.FooterMiddleGroupId,
57
+ verticalAlign: "center"
58
+ }, processCustomComponents((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : (_props$controlProps13 = _props$controlProps12.middleGroup) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.children)), /*#__PURE__*/React.createElement(Stack, {
68
59
  horizontal: true,
60
+ id: Ids.FooterRightGroupId,
69
61
  verticalAlign: "center"
70
62
  }, processCustomComponents((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : (_props$controlProps15 = _props$controlProps14.rightGroup) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.children), !((_props$controlProps16 = props.controlProps) !== null && _props$controlProps16 !== void 0 && _props$controlProps16.hideAudioNotificationButton) && (decodeComponentString((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.AudioNotificationButton) || /*#__PURE__*/React.createElement(AudioNotificationButton, _extends({}, audioNotificationButtonProps, {
71
63
  onClick: (_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.onAudioNotificationClick,
72
64
  styles: audioNotificationButtonStyles,
73
65
  hoverStyles: audioNotificationButtonHoverStyles,
74
66
  focusStyles: footerItemFocusStyles
75
- }))))));
67
+ })))));
76
68
  }
77
69
 
78
70
  export default Footer;
@@ -1,6 +1,7 @@
1
1
  import { AudioNotificationOffIconBase64, AudioNotificationOnIconBase64, TranscriptDownloadIconBase64, TranscriptEmailIconBase64 } from "../../../../assets/Icons";
2
+ import { AriaLabels, ButtonTypes, Ids } from "../../../../common/Constants";
2
3
  export const customFooterControlProps = {
3
- id: "oc-lcw-footer",
4
+ id: Ids.CustomFooterId,
4
5
  hideDownloadTranscriptButton: false,
5
6
  hideEmailTranscriptButton: false,
6
7
  hideAudioNotificationButton: false,
@@ -23,25 +24,25 @@ export const customFooterControlProps = {
23
24
  children: []
24
25
  },
25
26
  downloadTranscriptButtonProps: {
26
- id: "oc-lcw-footer-downloadtranscript-button",
27
- type: "icon",
27
+ id: Ids.DownloadTranscriptButtonId,
28
+ type: ButtonTypes.Icon,
28
29
  imageIconProps: {
29
30
  src: TranscriptDownloadIconBase64
30
31
  },
31
- ariaLabel: "Download chat transcript"
32
+ ariaLabel: AriaLabels.DownloadChatTranscript
32
33
  },
33
34
  emailTranscriptButtonProps: {
34
- id: "oc-lcw-footer-emailtranscript-button",
35
- type: "icon",
35
+ id: Ids.EmailTranscriptButtonId,
36
+ type: ButtonTypes.Icon,
36
37
  imageIconProps: {
37
38
  src: TranscriptEmailIconBase64
38
39
  },
39
- ariaLabel: "Email Transcript"
40
+ ariaLabel: AriaLabels.EmailTranscript
40
41
  },
41
42
  audioNotificationButtonProps: {
42
- id: "oc-lcw-footer-audionotification-button",
43
- ariaLabel: "Turn sound off",
44
- toggleAriaLabel: "Turn sound on",
43
+ id: Ids.AudioNotificationButtonId,
44
+ ariaLabel: AriaLabels.TurnSoundOff,
45
+ toggleAriaLabel: AriaLabels.TurnSoundOn,
45
46
  imageIconProps: {
46
47
  src: AudioNotificationOnIconBase64
47
48
  },
@@ -1,5 +1,6 @@
1
+ import { AriaLabels, ButtonTypes, IconNames, Ids } from "../../../../common/Constants";
1
2
  export const defaultFooterControlProps = {
2
- id: "lcw-components-footer",
3
+ id: Ids.DefaultFooterId,
3
4
  hideDownloadTranscriptButton: false,
4
5
  hideEmailTranscriptButton: false,
5
6
  hideAudioNotificationButton: false,
@@ -22,23 +23,23 @@ export const defaultFooterControlProps = {
22
23
  children: []
23
24
  },
24
25
  downloadTranscriptButtonProps: {
25
- id: "oc-lcw-footer-downloadtranscript-button",
26
- type: "icon",
27
- iconName: "Download",
28
- ariaLabel: "Download chat transcript"
26
+ id: Ids.DownloadTranscriptButtonId,
27
+ type: ButtonTypes.Icon,
28
+ iconName: IconNames.Download,
29
+ ariaLabel: AriaLabels.DownloadChatTranscript
29
30
  },
30
31
  emailTranscriptButtonProps: {
31
- id: "oc-lcw-footer-emailtranscript-button",
32
- type: "icon",
33
- iconName: "Mail",
34
- ariaLabel: "Email Transcript"
32
+ id: Ids.EmailTranscriptButtonId,
33
+ type: ButtonTypes.Icon,
34
+ iconName: IconNames.Mail,
35
+ ariaLabel: AriaLabels.EmailTranscript
35
36
  },
36
37
  audioNotificationButtonProps: {
37
- id: "oc-lcw-footer-audionotification-button",
38
- type: "icon",
39
- ariaLabel: "Turn sound off",
40
- toggleAriaLabel: "Turn sound on",
41
- iconName: "Volume3",
42
- toggleIconName: "Volume0"
38
+ id: Ids.AudioNotificationButtonId,
39
+ type: ButtonTypes.Icon,
40
+ ariaLabel: AriaLabels.TurnSoundOff,
41
+ toggleAriaLabel: AriaLabels.TurnSoundOn,
42
+ iconName: IconNames.Volume3,
43
+ toggleIconName: IconNames.Volume0
43
44
  }
44
45
  };
@@ -5,7 +5,7 @@ export const defaultFooterStyleProps = {
5
5
  minHeight: "25px",
6
6
  width: "100%",
7
7
  minWidth: "250px",
8
- padding: "0 10px 5px 10px"
8
+ padding: "5px"
9
9
  },
10
10
  downloadTranscriptButtonStyleProps: {
11
11
  icon: {
@@ -1,7 +1,7 @@
1
1
  import { IconButton } from "@fluentui/react";
2
2
  import React, { useCallback, useEffect, useState } from "react";
3
3
  import { BroadcastService } from "../../../services/BroadcastService";
4
- import { ElementType } from "../../../common/Constants";
4
+ import { AriaLabels, ButtonTypes, ElementType, EventNames, IconNames } from "../../../common/Constants";
5
5
 
6
6
  function AudioNotificationButton(props) {
7
7
  const {
@@ -10,7 +10,7 @@ function AudioNotificationButton(props) {
10
10
  const [muted, setMuted] = useState(props.isAudioMuted);
11
11
  let iconStyles = {};
12
12
 
13
- if (props.type === "icon") {
13
+ if (props.type === ButtonTypes.Icon) {
14
14
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
15
  iconStyles = { ...(props === null || props === void 0 ? void 0 : props.styles).icon
16
16
  };
@@ -41,12 +41,12 @@ function AudioNotificationButton(props) {
41
41
  const volume0Icon = props.imageToggleIconProps ? {
42
42
  imageProps: props === null || props === void 0 ? void 0 : props.imageToggleIconProps
43
43
  } : {
44
- iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? "Volume0"
44
+ iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? IconNames.Volume0
45
45
  };
46
46
  const volume3Icon = props.imageIconProps ? {
47
47
  imageProps: props === null || props === void 0 ? void 0 : props.imageIconProps
48
48
  } : {
49
- iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? "Volume3"
49
+ iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? IconNames.Volume3
50
50
  };
51
51
  const handleOnClick = useCallback(() => {
52
52
  setMuted(!muted);
@@ -55,7 +55,7 @@ function AudioNotificationButton(props) {
55
55
  const customEvent = {
56
56
  elementType: ElementType.FooterSoundNotificationButton,
57
57
  elementId: props === null || props === void 0 ? void 0 : props.id,
58
- eventName: "OnClick"
58
+ eventName: EventNames.OnClick
59
59
  };
60
60
  BroadcastService.postMessage(customEvent);
61
61
  props === null || props === void 0 ? void 0 : props.onClick();
@@ -72,7 +72,7 @@ function AudioNotificationButton(props) {
72
72
  disabled: disabled,
73
73
  styles: iconButtonStyles,
74
74
  className: props.className,
75
- title: muted ? props.toggleAriaLabel ?? "Turn sound on" : props.ariaLabel ?? "Turn sound off"
75
+ title: muted ? props.toggleAriaLabel ?? AriaLabels.TurnSoundOn : props.ariaLabel ?? AriaLabels.TurnSoundOff
76
76
  });
77
77
  }
78
78
 
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { ElementType } from "../../../common/Constants";
2
+ import { AriaLabels, ElementType, EventNames, IconNames, Texts } from "../../../common/Constants";
3
3
  import CommandButton from "../../common/commandbutton/CommandButton";
4
4
 
5
5
  function DownloadTranscriptButton(props) {
@@ -9,19 +9,19 @@ function DownloadTranscriptButton(props) {
9
9
  const customEvent = {
10
10
  elementType: ElementType.FooterDownloadTranscriptButton,
11
11
  elementId: props === null || props === void 0 ? void 0 : props.id,
12
- eventName: "OnClick"
12
+ eventName: EventNames.OnClick
13
13
  };
14
14
  return /*#__PURE__*/React.createElement(CommandButton, {
15
15
  id: props === null || props === void 0 ? void 0 : props.id,
16
16
  type: type,
17
- text: props.text ?? "Download chat transcript",
17
+ text: props.text ?? Texts.DownloadChatTranscriptText,
18
18
  styles: props.styles,
19
19
  hoverStyles: props.hoverStyles,
20
20
  focusStyles: props.focusStyles,
21
- iconName: props.iconName ?? "Download",
21
+ iconName: props.iconName ?? IconNames.Download,
22
22
  imageIconProps: props.imageIconProps,
23
23
  onClick: props.onClick,
24
- ariaLabel: props.ariaLabel ?? "Download chat transcript",
24
+ ariaLabel: props.ariaLabel ?? AriaLabels.DownloadChatTranscript,
25
25
  className: props.className,
26
26
  customEvent: customEvent
27
27
  });