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

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 (110) 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 +4 -6
  10. package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +9 -7
  11. package/lib/cjs/components/chatbutton/common/defaultStyles/defaultChatButtonGeneralStyles.js +1 -1
  12. package/lib/cjs/components/chatbutton/common/defaultStyles/defaultChatButtonSubTitleStyles.js +2 -1
  13. package/lib/cjs/components/chatbutton/common/defaultStyles/defaultChatButtonTitleStyles.js +2 -1
  14. package/lib/cjs/components/common/commandbutton/CommandButton.js +6 -5
  15. package/lib/cjs/components/common/subcomponents/CloseButton.js +4 -4
  16. package/lib/cjs/components/confirmationpane/ConfirmationPane.js +2 -2
  17. package/lib/cjs/components/confirmationpane/common/defaultProps/defaultConfirmationPaneControlProps.js +10 -7
  18. package/lib/cjs/components/footer/Footer.js +10 -17
  19. package/lib/cjs/components/footer/common/defaultProps/customFooterControlProps.js +16 -11
  20. package/lib/cjs/components/footer/common/defaultProps/defaultFooterControlProps.js +21 -15
  21. package/lib/cjs/components/footer/common/defaultStyles/defaultFooterStyleProps.js +1 -1
  22. package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +6 -5
  23. package/lib/cjs/components/footer/subcomponents/DownloadTranscriptButton.js +5 -5
  24. package/lib/cjs/components/footer/subcomponents/EmailTranscriptButton.js +5 -5
  25. package/lib/cjs/components/header/Header.js +5 -3
  26. package/lib/cjs/components/header/common/defaultProps/azureHeaderControlProps.js +8 -6
  27. package/lib/cjs/components/header/common/defaultProps/customHeaderControlProps.js +13 -9
  28. package/lib/cjs/components/header/common/defaultProps/defaultHeaderComponentOverrides.js +3 -1
  29. package/lib/cjs/components/header/common/defaultProps/defaultHeaderControlProps.js +15 -11
  30. package/lib/cjs/components/header/subcomponents/MinimizeButton.js +6 -5
  31. package/lib/cjs/components/inputvalidationpane/common/default/defaultProps/defaultInputValidationPaneControlProps.js +11 -11
  32. package/lib/cjs/components/inputvalidationpane/common/presetTwo/presetTwoProps/presetTwoInputValidationPaneControlProps.js +11 -11
  33. package/lib/cjs/components/loadingpane/LoadingPane.js +1 -1
  34. package/lib/cjs/components/loadingpane/common/defaultProps/defaultLoadingPaneControlProps.js +7 -4
  35. package/lib/cjs/components/loadingpane/common/presetOneProps/presetOneLoadingPaneControlProps.js +1 -1
  36. package/lib/cjs/components/loadingpane/common/presetThreeProps/presetThreeLoadingPaneControlProps.js +1 -1
  37. package/lib/cjs/components/loadingpane/common/presetTwoProps/presetTwoLoadingPaneControlProps.js +1 -1
  38. package/lib/cjs/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +5 -2
  39. package/lib/cjs/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +1 -1
  40. package/lib/cjs/components/outofofficehourspane/common/presetOneProps/presetOneOOOHPaneControlProps.js +1 -1
  41. package/lib/cjs/components/outofofficehourspane/common/presetTwoProps/presetTwoOOOHPaneControlProps.js +1 -1
  42. package/lib/cjs/components/postchatsurveypane/common/defaultProps/defaultPostChatSurveyPaneControlProps.js +5 -2
  43. package/lib/cjs/components/postchatsurveypane/common/presetOneProps/presetOnePostChatSurveyPaneControlProps.js +1 -1
  44. package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +2 -2
  45. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +4 -1
  46. package/lib/cjs/components/prechatsurveypane/common/presetThreeProps/presetThreePreChatSurveyPaneControlProps.js +1 -1
  47. package/lib/cjs/components/prechatsurveypane/common/presetTwoProps/presetTwoPreChatSurveyPaneControlProps.js +1 -1
  48. package/lib/cjs/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +12 -9
  49. package/lib/cjs/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +12 -9
  50. package/lib/cjs/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +12 -9
  51. package/lib/cjs/components/proactivechatpane/common/presetTwo/presetTwoProps/presetTwoProactiveChatPaneControlProps.js +9 -6
  52. package/lib/cjs/components/reconnectchatpane/ReconnectChatPane.js +3 -3
  53. package/lib/cjs/components/reconnectchatpane/common/default/defaultProps/defaultReconnectChatPaneControlProps.js +12 -9
  54. package/lib/cjs/components/reconnectchatpane/common/presetThree/presetThreeProps/presetThreeReconnectChatPaneControlProps.js +11 -8
  55. package/lib/esm/common/Constants.js +9 -2
  56. package/lib/esm/components/callingcontainer/common/defaultProps/defaultCallingContainerControlProps.js +2 -1
  57. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +7 -7
  58. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlProps.js +24 -23
  59. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlPropsRtl.js +19 -18
  60. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +7 -7
  61. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlProps.js +20 -19
  62. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlPropsRtl.js +17 -16
  63. package/lib/esm/components/chatbutton/ChatButton.js +5 -7
  64. package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +7 -7
  65. package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonGeneralStyles.js +1 -1
  66. package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonSubTitleStyles.js +2 -1
  67. package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonTitleStyles.js +2 -1
  68. package/lib/esm/components/common/commandbutton/CommandButton.js +7 -6
  69. package/lib/esm/components/common/subcomponents/CloseButton.js +5 -5
  70. package/lib/esm/components/confirmationpane/ConfirmationPane.js +3 -3
  71. package/lib/esm/components/confirmationpane/common/defaultProps/defaultConfirmationPaneControlProps.js +8 -7
  72. package/lib/esm/components/footer/Footer.js +9 -17
  73. package/lib/esm/components/footer/common/defaultProps/customFooterControlProps.js +15 -11
  74. package/lib/esm/components/footer/common/defaultProps/defaultFooterControlProps.js +19 -15
  75. package/lib/esm/components/footer/common/defaultStyles/defaultFooterStyleProps.js +1 -1
  76. package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +7 -6
  77. package/lib/esm/components/footer/subcomponents/DownloadTranscriptButton.js +6 -6
  78. package/lib/esm/components/footer/subcomponents/EmailTranscriptButton.js +6 -6
  79. package/lib/esm/components/header/Header.js +4 -3
  80. package/lib/esm/components/header/common/defaultProps/azureHeaderControlProps.js +7 -6
  81. package/lib/esm/components/header/common/defaultProps/customHeaderControlProps.js +12 -9
  82. package/lib/esm/components/header/common/defaultProps/defaultHeaderComponentOverrides.js +2 -1
  83. package/lib/esm/components/header/common/defaultProps/defaultHeaderControlProps.js +14 -11
  84. package/lib/esm/components/header/subcomponents/MinimizeButton.js +7 -6
  85. package/lib/esm/components/inputvalidationpane/common/default/defaultProps/defaultInputValidationPaneControlProps.js +12 -12
  86. package/lib/esm/components/inputvalidationpane/common/presetTwo/presetTwoProps/presetTwoInputValidationPaneControlProps.js +12 -12
  87. package/lib/esm/components/loadingpane/LoadingPane.js +1 -1
  88. package/lib/esm/components/loadingpane/common/defaultProps/defaultLoadingPaneControlProps.js +5 -4
  89. package/lib/esm/components/loadingpane/common/presetOneProps/presetOneLoadingPaneControlProps.js +1 -1
  90. package/lib/esm/components/loadingpane/common/presetThreeProps/presetThreeLoadingPaneControlProps.js +1 -1
  91. package/lib/esm/components/loadingpane/common/presetTwoProps/presetTwoLoadingPaneControlProps.js +1 -1
  92. package/lib/esm/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +3 -2
  93. package/lib/esm/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +1 -1
  94. package/lib/esm/components/outofofficehourspane/common/presetOneProps/presetOneOOOHPaneControlProps.js +1 -1
  95. package/lib/esm/components/outofofficehourspane/common/presetTwoProps/presetTwoOOOHPaneControlProps.js +1 -1
  96. package/lib/esm/components/postchatsurveypane/common/defaultProps/defaultPostChatSurveyPaneControlProps.js +3 -2
  97. package/lib/esm/components/postchatsurveypane/common/presetOneProps/presetOnePostChatSurveyPaneControlProps.js +1 -1
  98. package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +3 -3
  99. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +2 -1
  100. package/lib/esm/components/prechatsurveypane/common/presetThreeProps/presetThreePreChatSurveyPaneControlProps.js +1 -1
  101. package/lib/esm/components/prechatsurveypane/common/presetTwoProps/presetTwoPreChatSurveyPaneControlProps.js +1 -1
  102. package/lib/esm/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +10 -9
  103. package/lib/esm/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +10 -9
  104. package/lib/esm/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +10 -9
  105. package/lib/esm/components/proactivechatpane/common/presetTwo/presetTwoProps/presetTwoProactiveChatPaneControlProps.js +7 -6
  106. package/lib/esm/components/reconnectchatpane/ReconnectChatPane.js +4 -4
  107. package/lib/esm/components/reconnectchatpane/common/default/defaultProps/defaultReconnectChatPaneControlProps.js +10 -9
  108. package/lib/esm/components/reconnectchatpane/common/presetThree/presetThreeProps/presetThreeReconnectChatPaneControlProps.js +9 -8
  109. package/lib/types/common/Constants.d.ts +148 -0
  110. package/package.json +1 -1
@@ -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,30 +24,33 @@ 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,
33
+ hideButtonTitle: true
32
34
  },
33
35
  emailTranscriptButtonProps: {
34
- id: "oc-lcw-footer-emailtranscript-button",
35
- type: "icon",
36
+ id: Ids.EmailTranscriptButtonId,
37
+ type: ButtonTypes.Icon,
36
38
  imageIconProps: {
37
39
  src: TranscriptEmailIconBase64
38
40
  },
39
- ariaLabel: "Email Transcript"
41
+ ariaLabel: AriaLabels.EmailTranscript,
42
+ hideButtonTitle: true
40
43
  },
41
44
  audioNotificationButtonProps: {
42
- id: "oc-lcw-footer-audionotification-button",
43
- ariaLabel: "Turn sound off",
44
- toggleAriaLabel: "Turn sound on",
45
+ id: Ids.AudioNotificationButtonId,
46
+ ariaLabel: AriaLabels.TurnSoundOff,
47
+ toggleAriaLabel: AriaLabels.TurnSoundOn,
45
48
  imageIconProps: {
46
49
  src: AudioNotificationOnIconBase64
47
50
  },
48
51
  imageToggleIconProps: {
49
52
  src: AudioNotificationOffIconBase64
50
- }
53
+ },
54
+ hideButtonTitle: true
51
55
  }
52
56
  };
@@ -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,26 @@ 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,
30
+ hideButtonTitle: true
29
31
  },
30
32
  emailTranscriptButtonProps: {
31
- id: "oc-lcw-footer-emailtranscript-button",
32
- type: "icon",
33
- iconName: "Mail",
34
- ariaLabel: "Email Transcript"
33
+ id: Ids.EmailTranscriptButtonId,
34
+ type: ButtonTypes.Icon,
35
+ iconName: IconNames.Mail,
36
+ ariaLabel: AriaLabels.EmailTranscript,
37
+ hideButtonTitle: true
35
38
  },
36
39
  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"
40
+ id: Ids.AudioNotificationButtonId,
41
+ type: ButtonTypes.Icon,
42
+ ariaLabel: AriaLabels.TurnSoundOff,
43
+ toggleAriaLabel: AriaLabels.TurnSoundOn,
44
+ iconName: IconNames.Volume3,
45
+ toggleIconName: IconNames.Volume0,
46
+ hideButtonTitle: true
43
47
  }
44
48
  };
@@ -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,8 @@ 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: undefined,
76
+ ariaLabel: muted ? props.toggleAriaLabel ?? AriaLabels.TurnSoundOn : props.ariaLabel ?? AriaLabels.TurnSoundOff
76
77
  });
77
78
  }
78
79
 
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { ElementType } from "../../../common/Constants";
2
+ import { AriaLabels, ElementType, EventNames, IconNames } from "../../../common/Constants";
3
3
  import CommandButton from "../../common/commandbutton/CommandButton";
4
4
 
5
5
  function DownloadTranscriptButton(props) {
@@ -9,21 +9,21 @@ 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",
18
17
  styles: props.styles,
19
18
  hoverStyles: props.hoverStyles,
20
19
  focusStyles: props.focusStyles,
21
- iconName: props.iconName ?? "Download",
20
+ iconName: props.iconName ?? IconNames.Download,
22
21
  imageIconProps: props.imageIconProps,
23
22
  onClick: props.onClick,
24
- ariaLabel: props.ariaLabel ?? "Download chat transcript",
23
+ ariaLabel: props.ariaLabel ?? AriaLabels.DownloadChatTranscript,
25
24
  className: props.className,
26
- customEvent: customEvent
25
+ customEvent: customEvent,
26
+ hideButtonTitle: props.hideButtonTitle
27
27
  });
28
28
  }
29
29
 
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { ElementType } from "../../../common/Constants";
2
+ import { AriaLabels, ElementType, EventNames, IconNames } from "../../../common/Constants";
3
3
  import CommandButton from "../../common/commandbutton/CommandButton";
4
4
 
5
5
  function EmailTranscriptButton(props) {
@@ -9,21 +9,21 @@ function EmailTranscriptButton(props) {
9
9
  const customEvent = {
10
10
  elementType: ElementType.FooterEmailTranscriptButton,
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 ?? "Email Transcript",
18
17
  styles: props.styles,
19
18
  hoverStyles: props.hoverStyles,
20
19
  focusStyles: props.focusStyles,
21
- iconName: props.iconName ?? "Mail",
20
+ iconName: props.iconName ?? IconNames.Mail,
22
21
  imageIconProps: props.imageIconProps,
23
22
  onClick: props.onClick,
24
- ariaLabel: props.ariaLabel ?? "Email Transcript",
23
+ ariaLabel: props.ariaLabel ?? AriaLabels.EmailTranscript,
25
24
  className: props.className,
26
- customEvent: customEvent
25
+ customEvent: customEvent,
26
+ hideButtonTitle: props.hideButtonTitle
27
27
  });
28
28
  }
29
29
 
@@ -7,6 +7,7 @@ import MinimizeButton from "./subcomponents/MinimizeButton";
7
7
  import { decodeComponentString } from "../../common/decodeComponentString";
8
8
  import { defaultHeaderProps } from "./common/defaultProps/defaultHeaderProps";
9
9
  import { processCustomComponents } from "../../common/utils";
10
+ import { Ids } from "../../common/Constants";
10
11
  initializeIcons();
11
12
 
12
13
  function Header(props) {
@@ -43,7 +44,7 @@ function Header(props) {
43
44
  role: "region"
44
45
  }, /*#__PURE__*/React.createElement(Stack, {
45
46
  horizontal: true,
46
- id: "headerLeftGroup",
47
+ id: Ids.HeaderLeftGroupId,
47
48
  verticalAlign: "center"
48
49
  }, /*#__PURE__*/React.createElement(Stack, {
49
50
  horizontal: true,
@@ -60,7 +61,7 @@ function Header(props) {
60
61
  styles: titleStyles
61
62
  }, titleProps === null || titleProps === void 0 ? void 0 : titleProps.text)))), /*#__PURE__*/React.createElement(Stack, {
62
63
  horizontal: true,
63
- id: "headerMiddleGroup"
64
+ id: Ids.HeaderMiddleGroupId
64
65
  }, /*#__PURE__*/React.createElement(Stack, {
65
66
  horizontal: true,
66
67
  verticalAlign: "start"
@@ -68,7 +69,7 @@ function Header(props) {
68
69
  align: "start"
69
70
  }, processCustomComponents((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : (_props$controlProps11 = _props$controlProps10.middleGroup) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.children)))), /*#__PURE__*/React.createElement(Stack, {
70
71
  horizontal: true,
71
- id: "headerRightGroup",
72
+ id: Ids.HeaderRightGroupId,
72
73
  verticalAlign: "start"
73
74
  }, /*#__PURE__*/React.createElement(Stack, {
74
75
  horizontal: true,
@@ -1,6 +1,7 @@
1
1
  import { LegacyChatIconBase64 } from "../../../../assets/Icons";
2
+ import { ButtonTypes, Ids, Texts } from "../../../../common/Constants";
2
3
  export const azureHeaderControlProps = {
3
- id: "oc-lcw-header",
4
+ id: Ids.DefaultHeaderId,
4
5
  hideIcon: false,
5
6
  hideTitle: true,
6
7
  hideCloseButton: false,
@@ -22,20 +23,20 @@ export const azureHeaderControlProps = {
22
23
  },
23
24
  minimizeButtonProps: {
24
25
  id: "oc-lcw-header-minimizebutton",
25
- type: "icon"
26
+ type: ButtonTypes.Icon
26
27
  },
27
28
  closeButtonProps: {
28
29
  id: "oc-lcw-header-closebutton",
29
- type: "text",
30
+ type: ButtonTypes.Text,
30
31
  text: "End Chat"
31
32
  },
32
33
  headerIconProps: {
33
- id: "oc-lcw-header-icon",
34
+ id: Ids.HeaderIconId,
34
35
  src: LegacyChatIconBase64,
35
- alt: "Chat Icon"
36
+ alt: Texts.HeaderIcon
36
37
  },
37
38
  headerTitleProps: {
38
- id: "oc-lcw-header-title",
39
+ id: Ids.HeaderTitleId,
39
40
  text: "Azure Chat Support"
40
41
  }
41
42
  };
@@ -1,6 +1,7 @@
1
1
  import { CloseChatButtonIconBase64, LegacyChatIconBase64, MinimizeChatButtonIconBase64 } from "../../../../assets/Icons";
2
+ import { ButtonTypes, Ids, Texts } from "../../../../common/Constants";
2
3
  export const customHeaderControlProps = {
3
- id: "oc-lcw-header",
4
+ id: Ids.DefaultHeaderId,
4
5
  hideIcon: false,
5
6
  hideTitle: false,
6
7
  hideCloseButton: false,
@@ -22,7 +23,7 @@ export const customHeaderControlProps = {
22
23
  },
23
24
  minimizeButtonProps: {
24
25
  id: "oc-lcw-header-minimizebutton",
25
- type: "icon",
26
+ type: ButtonTypes.Icon,
26
27
  imageIconProps: {
27
28
  src: MinimizeChatButtonIconBase64,
28
29
  styles: {
@@ -31,11 +32,12 @@ export const customHeaderControlProps = {
31
32
  width: "16px"
32
33
  }
33
34
  }
34
- }
35
+ },
36
+ hideButtonTitle: true
35
37
  },
36
38
  closeButtonProps: {
37
39
  id: "oc-lcw-header-closebutton",
38
- type: "icon",
40
+ type: ButtonTypes.Icon,
39
41
  imageIconProps: {
40
42
  src: CloseChatButtonIconBase64,
41
43
  styles: {
@@ -44,15 +46,16 @@ export const customHeaderControlProps = {
44
46
  width: "16px"
45
47
  }
46
48
  }
47
- }
49
+ },
50
+ hideButtonTitle: true
48
51
  },
49
52
  headerIconProps: {
50
- id: "oc-lcw-header-icon",
53
+ id: Ids.HeaderIconId,
51
54
  src: LegacyChatIconBase64,
52
- alt: "Chat Icon"
55
+ alt: Texts.HeaderIcon
53
56
  },
54
57
  headerTitleProps: {
55
- id: "oc-lcw-header-title",
56
- text: "Let's Chat"
58
+ id: Ids.HeaderTitleId,
59
+ text: Texts.HeaderTitle
57
60
  }
58
61
  };
@@ -2,6 +2,7 @@ import * as React from "react";
2
2
  import { Label } from "@fluentui/react";
3
3
  import { FontIcon } from "@fluentui/react/lib/Icon";
4
4
  import { mergeStyles } from "@fluentui/style-utilities";
5
+ import { Ids } from "../../../../common/Constants";
5
6
  const iconClass = mergeStyles({
6
7
  fontSize: 40,
7
8
  height: 40,
@@ -23,6 +24,6 @@ export const defaultHeaderComponentOverrides = {
23
24
  }),
24
25
  headerTitle: /*#__PURE__*/React.createElement(Label, {
25
26
  styles: labelClass,
26
- id: "oc-lcw-header-title"
27
+ id: Ids.HeaderTitleId
27
28
  }, "Hi, there!")
28
29
  };
@@ -1,6 +1,7 @@
1
1
  import { ModernChatIconBase64 } from "../../../../assets/Icons";
2
+ import { ButtonTypes, IconNames, Ids, Texts } from "../../../../common/Constants";
2
3
  export const defaultHeaderControlProps = {
3
- id: "oc-lcw-header",
4
+ id: Ids.DefaultHeaderId,
4
5
  hideIcon: false,
5
6
  hideTitle: false,
6
7
  hideCloseButton: false,
@@ -21,22 +22,24 @@ export const defaultHeaderControlProps = {
21
22
  children: []
22
23
  },
23
24
  minimizeButtonProps: {
24
- id: "oc-lcw-header-minimize-button",
25
- type: "icon",
26
- iconName: "ChromeMinimize"
25
+ id: Ids.MinimizeButtonId,
26
+ type: ButtonTypes.Icon,
27
+ iconName: IconNames.ChromeMinimize,
28
+ hideButtonTitle: true
27
29
  },
28
30
  closeButtonProps: {
29
- id: "oc-lcw-header-close-button",
30
- type: "icon",
31
- iconName: "ChromeClose"
31
+ id: Ids.CloseButtonId,
32
+ type: ButtonTypes.Icon,
33
+ iconName: IconNames.ChromeClose,
34
+ hideButtonTitle: true
32
35
  },
33
36
  headerIconProps: {
34
- id: "oc-lcw-header-icon",
37
+ id: Ids.HeaderIconId,
35
38
  src: ModernChatIconBase64,
36
- alt: "Chat Icon"
39
+ alt: Texts.HeaderIcon
37
40
  },
38
41
  headerTitleProps: {
39
- id: "oc-lcw-header-title",
40
- text: "Let's Chat"
42
+ id: Ids.HeaderTitleId,
43
+ text: Texts.HeaderTitle
41
44
  }
42
45
  };
@@ -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 MinimizeButton(props) {
@@ -9,21 +9,22 @@ function MinimizeButton(props) {
9
9
  const customEvent = {
10
10
  elementType: ElementType.HeaderMinimizeButton,
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 ?? "Minimize",
17
+ text: props.text ?? Texts.MinimizeText,
18
18
  styles: props.styles,
19
19
  hoverStyles: props.hoverStyles,
20
20
  focusStyles: props.focusStyles,
21
- iconName: props.iconName ?? "ChromeMinimize",
21
+ iconName: props.iconName ?? IconNames.ChromeMinimize,
22
22
  imageIconProps: props.imageIconProps,
23
23
  onClick: props.onClick,
24
- ariaLabel: props.ariaLabel ?? "Minimize",
24
+ ariaLabel: props.ariaLabel ?? AriaLabels.Minimize,
25
25
  className: props.className,
26
- customEvent: customEvent
26
+ customEvent: customEvent,
27
+ hideButtonTitle: props.hideButtonTitle
27
28
  });
28
29
  }
29
30
 
@@ -1,27 +1,27 @@
1
- import { Regex } from "../../../../../common/Constants";
1
+ import { AriaLabels, Ids, Regex, Texts } from "../../../../../common/Constants";
2
2
  export const defaultInputValidationPaneControlProps = {
3
- id: "oclcw-emailTranscriptDialogContainer",
3
+ id: Ids.DefaultInputValidationPaneId,
4
4
  dir: "ltr",
5
5
  hideInputValidationPane: false,
6
- inputValidationPaneAriaLabel: "Email Chat Transcript Pane",
6
+ inputValidationPaneAriaLabel: AriaLabels.EmailChatTranscriptPane,
7
7
  hideTitle: false,
8
- titleText: "Email this chat transcript",
8
+ titleText: Texts.InputValidationPaneTitleText,
9
9
  hideSubtitle: false,
10
- subtitleText: "This will be sent after your chat ends.",
11
- inputId: "oclcw-emailTranscriptDialogTextField",
10
+ subtitleText: Texts.InputValidationPaneSubtitleText,
11
+ inputId: Ids.DefaultInputValidationPaneInputId,
12
12
  inputInitialText: "",
13
13
  hideInput: false,
14
- inputAriaLabel: "Email this chat transcript. This will be sent after your chat ends. Email address text area",
14
+ inputAriaLabel: AriaLabels.InputValidationPaneInput,
15
15
  inputWithErrorMessageBorderColor: "rgb(164, 38, 44)",
16
- invalidInputErrorMessageText: "Enter a valid email address.",
16
+ invalidInputErrorMessageText: Texts.InvalidInputErrorMessageText,
17
17
  isButtonGroupHorizontal: true,
18
18
  hideSendButton: false,
19
19
  enableSendButton: false,
20
- sendButtonText: "Send",
21
- sendButtonAriaLabel: "Send",
20
+ sendButtonText: Texts.SendButtonText,
21
+ sendButtonAriaLabel: AriaLabels.Send,
22
22
  hideCancelButton: false,
23
- cancelButtonText: "Cancel",
24
- cancelButtonAriaLabel: "Cancel",
23
+ cancelButtonText: Texts.CancelButtonText,
24
+ cancelButtonAriaLabel: AriaLabels.Cancel,
25
25
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
26
26
  onSend: function (input) {
27
27
  console.log("on send");
@@ -1,26 +1,26 @@
1
- import { Regex } from "../../../../../common/Constants";
1
+ import { AriaLabels, Ids, Regex, Texts } from "../../../../../common/Constants";
2
2
  export const presetTwoInputValidationPaneControlProps = {
3
- id: "oclcw-emailTranscriptDialogContainer",
3
+ id: Ids.DefaultInputValidationPaneId,
4
4
  dir: "ltr",
5
5
  hideInputValidationPane: false,
6
- inputValidationPaneAriaLabel: "Email Chat Transcript Pane",
6
+ inputValidationPaneAriaLabel: AriaLabels.EmailChatTranscriptPane,
7
7
  hideTitle: false,
8
- titleText: "Email this chat transcript",
8
+ titleText: Texts.InputValidationPaneTitleText,
9
9
  hideSubtitle: false,
10
- subtitleText: "This will be sent after your chat ends.",
11
- inputId: "oclcw-emailTranscriptDialogTextField",
10
+ subtitleText: Texts.InputValidationPaneSubtitleText,
11
+ inputId: Ids.DefaultInputValidationPaneInputId,
12
12
  hideInput: false,
13
- inputAriaLabel: "Email this chat transcript. This will be sent after your chat ends. Email address text area",
13
+ inputAriaLabel: AriaLabels.InputValidationPaneInput,
14
14
  inputWithErrorMessageBorderColor: "rgb(164, 38, 44)",
15
- invalidInputErrorMessageText: "Enter a valid email address.",
15
+ invalidInputErrorMessageText: Texts.InvalidInputErrorMessageText,
16
16
  isButtonGroupHorizontal: false,
17
17
  hideSendButton: false,
18
18
  enableSendButton: true,
19
- sendButtonText: "Send",
20
- sendButtonAriaLabel: "Send",
19
+ sendButtonText: Texts.SendButtonText,
20
+ sendButtonAriaLabel: AriaLabels.Send,
21
21
  hideCancelButton: false,
22
- cancelButtonText: "Cancel",
23
- cancelButtonAriaLabel: "Cancel",
22
+ cancelButtonText: Texts.CancelButtonText,
23
+ cancelButtonAriaLabel: AriaLabels.Cancel,
24
24
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
25
25
  onSend: function (input) {
26
26
  console.log("on send");
@@ -13,7 +13,7 @@ import { defaultLoadingPaneTitleStyles } from "./common/defaultProps/defaultStyl
13
13
  function LoadingPane(props) {
14
14
  var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$controlProps2, _props$controlProps3, _props$controlProps4, _props$controlProps5, _props$componentOverr, _props$styleProps8, _props$styleProps8$cl, _props$controlProps6, _props$componentOverr2, _props$styleProps9, _props$styleProps9$cl, _props$controlProps7, _props$controlProps8, _props$componentOverr3, _props$styleProps10, _props$styleProps10$c, _props$controlProps9, _props$controlProps10, _props$componentOverr4, _props$styleProps11, _props$styleProps11$c, _props$controlProps11, _props$controlProps12, _props$componentOverr5, _props$styleProps12, _props$styleProps12$c, _props$controlProps13;
15
15
 
16
- const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? "lcw-components-loading-pane";
16
+ const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? defaultLoadingPaneControlProps.id;
17
17
  const containerStyles = {
18
18
  root: Object.assign({}, defaultLoadingPaneGeneralStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps)
19
19
  };
@@ -1,13 +1,14 @@
1
+ import { Ids, Texts } from "../../../../common/Constants";
1
2
  export const defaultLoadingPaneControlProps = {
2
- id: "oc-lcw-loadingpane",
3
+ id: Ids.DefaultLoadingPaneId,
3
4
  dir: "auto",
4
5
  hideLoadingPane: false,
5
6
  hideIcon: false,
6
7
  hideTitle: false,
7
- titleText: "Welcome to",
8
+ titleText: Texts.LoadingPaneTitleText,
8
9
  hideSubtitle: false,
9
- subtitleText: "live chat support ...",
10
+ subtitleText: Texts.LoadingPaneSubtitleText,
10
11
  hideSpinner: false,
11
12
  hideSpinnerText: false,
12
- spinnerText: "Loading ..."
13
+ spinnerText: Texts.LoadingPaneSpinnerText
13
14
  };
@@ -1,5 +1,5 @@
1
1
  import { defaultLoadingPaneControlProps } from "../defaultProps/defaultLoadingPaneControlProps";
2
2
  export const presetOneLoadingPaneControlProps = { ...defaultLoadingPaneControlProps,
3
- id: "oc-lcw-loadingpane-preset1",
3
+ id: "lcw-loading-pane-preset1",
4
4
  dir: "rtl"
5
5
  };
@@ -1,7 +1,7 @@
1
1
  import { SpinnerSize } from "@fluentui/react";
2
2
  import { defaultLoadingPaneControlProps } from "../defaultProps/defaultLoadingPaneControlProps";
3
3
  export const presetThreeLoadingPaneControlProps = { ...defaultLoadingPaneControlProps,
4
- id: "oc-lcw-loadingpane-preset3",
4
+ id: "lcw-loading-pane-preset3",
5
5
  titleText: "Please Wait ...",
6
6
  subtitleText: "Loading Content",
7
7
  spinnerText: "Processing ...",
@@ -1,7 +1,7 @@
1
1
  import { SpinnerSize } from "@fluentui/react";
2
2
  import { defaultLoadingPaneControlProps } from "../defaultProps/defaultLoadingPaneControlProps";
3
3
  export const presetTwoLoadingPaneControlProps = { ...defaultLoadingPaneControlProps,
4
- id: "oc-lcw-loadingpane-preset2",
4
+ id: "lcw-loading-pane-preset2",
5
5
  hideIcon: true,
6
6
  hideTitle: true,
7
7
  hideSubtitle: true,
@@ -1,9 +1,10 @@
1
+ import { Ids, Texts } from "../../../../common/Constants";
1
2
  export const defaultOOOHPaneControlProps = {
2
- id: "oc-lcw-outofofficehours-pane",
3
+ id: Ids.DefaultOOOHPaneId,
3
4
  dir: "auto",
4
5
  hideOOOHPane: false,
5
6
  hideTitle: false,
6
7
  role: "alert",
7
- titleText: "Thanks for contacting us. You have reached us outside of our operating hours. An agent will respond when we open.",
8
+ titleText: Texts.OOOHPaneTitleText,
8
9
  openLinkInNewTab: false
9
10
  };
@@ -1,6 +1,6 @@
1
1
  import { defaultOOOHPaneControlProps } from "../defaultProps/defaultOOOHPaneControlProps";
2
2
  export const presetFourOOOHPaneControlProps = { ...defaultOOOHPaneControlProps,
3
- id: "oc-lcw-outofofficehourspane-preset1",
3
+ id: "lcw-out-of-office-hours-pane-preset1",
4
4
  titleText: "We are out of office. Please contact us here https://www.microsoft.com for further assisstance",
5
5
  openLinkInNewTab: true
6
6
  };
@@ -1,5 +1,5 @@
1
1
  import { defaultOOOHPaneControlProps } from "../defaultProps/defaultOOOHPaneControlProps";
2
2
  export const presetOneOOOHPaneControlProps = { ...defaultOOOHPaneControlProps,
3
- id: "oc-lcw-outofofficehourspane-preset1",
3
+ id: "lcw-out-of-office-hours-pane-preset1",
4
4
  dir: "rtl"
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { defaultOOOHPaneControlProps } from "../defaultProps/defaultOOOHPaneControlProps";
2
2
  export const presetTwoOOOHPaneControlProps = { ...defaultOOOHPaneControlProps,
3
- id: "oc-lcw-outofofficehourspane-preset2",
3
+ id: "lcw-out-of-office-hours-pane-preset2",
4
4
  titleText: "Sorry but we are not operating during these hours!!"
5
5
  };
@@ -1,5 +1,6 @@
1
+ import { Ids, Texts } from "../../../../common/Constants";
1
2
  export const defaultPostChatSurveyPaneControlProps = {
2
- id: "oc-lcw-postchatsurvey-pane",
3
- title: "Post chat survey pane",
3
+ id: Ids.DefaultPostChatSurveyPaneId,
4
+ title: Texts.PostChatSurveyPaneTitleText,
4
5
  surveyURL: ""
5
6
  };