@microsoft/omnichannel-chat-components 0.1.0-main.fc27009 → 1.0.1-main.57b83f8

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 (169) hide show
  1. package/lib/cjs/common/Constants.js +26 -8
  2. package/lib/cjs/common/utils.js +21 -2
  3. package/lib/cjs/components/callingcontainer/common/defaultProps/defaultCallingContainerControlProps.js +4 -1
  4. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +7 -7
  5. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlProps.js +26 -23
  6. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlPropsRtl.js +20 -18
  7. package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +21 -8
  8. package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlProps.js +22 -19
  9. package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlPropsRtl.js +18 -16
  10. package/lib/cjs/components/chatbutton/ChatButton.js +28 -24
  11. package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +11 -5
  12. package/lib/cjs/components/chatbutton/common/defaultStyles/defaultChatButtonSubTitleStyles.js +3 -1
  13. package/lib/cjs/components/chatbutton/common/defaultStyles/defaultChatButtonTitleStyles.js +1 -0
  14. package/lib/cjs/components/common/commandbutton/CommandButton.js +37 -12
  15. package/lib/cjs/components/{header → common}/subcomponents/CloseButton.js +8 -7
  16. package/lib/cjs/components/confirmationpane/ConfirmationPane.js +9 -2
  17. package/lib/cjs/components/confirmationpane/common/defaultProps/defaultConfirmationPaneControlProps.js +10 -7
  18. package/lib/cjs/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneButtonGroupStyles.js +5 -1
  19. package/lib/cjs/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneGeneralStyles.js +7 -4
  20. package/lib/cjs/components/footer/Footer.js +7 -5
  21. package/lib/cjs/components/footer/common/defaultProps/customFooterControlProps.js +12 -10
  22. package/lib/cjs/components/footer/common/defaultProps/defaultFooterControlProps.js +18 -14
  23. package/lib/cjs/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
  24. package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +31 -14
  25. package/lib/cjs/components/footer/subcomponents/DownloadTranscriptButton.js +4 -4
  26. package/lib/cjs/components/footer/subcomponents/EmailTranscriptButton.js +4 -4
  27. package/lib/cjs/components/header/Header.js +7 -5
  28. package/lib/cjs/components/header/common/defaultProps/azureHeaderControlProps.js +8 -6
  29. package/lib/cjs/components/header/common/defaultProps/customHeaderControlProps.js +9 -7
  30. package/lib/cjs/components/header/common/defaultProps/defaultHeaderComponentOverrides.js +3 -1
  31. package/lib/cjs/components/header/common/defaultProps/defaultHeaderControlProps.js +13 -11
  32. package/lib/cjs/components/header/subcomponents/MinimizeButton.js +4 -4
  33. package/lib/cjs/components/inputvalidationpane/InputValidationPane.js +28 -28
  34. package/lib/cjs/components/inputvalidationpane/common/default/defaultProps/defaultInputValidationPaneControlProps.js +11 -11
  35. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
  36. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneGeneralStyles.js +1 -1
  37. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
  38. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
  39. package/lib/cjs/components/inputvalidationpane/common/presetTwo/presetTwoProps/presetTwoInputValidationPaneControlProps.js +11 -11
  40. package/lib/cjs/components/loadingpane/LoadingPane.js +3 -2
  41. package/lib/cjs/components/loadingpane/common/defaultProps/defaultLoadingPaneControlProps.js +7 -4
  42. package/lib/cjs/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +3 -2
  43. package/lib/cjs/components/loadingpane/common/presetOneProps/presetOneLoadingPaneControlProps.js +1 -1
  44. package/lib/cjs/components/loadingpane/common/presetThreeProps/presetThreeLoadingPaneControlProps.js +1 -1
  45. package/lib/cjs/components/loadingpane/common/presetTwoProps/presetTwoLoadingPaneControlProps.js +1 -1
  46. package/lib/cjs/components/outofofficehourspane/OOOHPane.js +13 -6
  47. package/lib/cjs/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +7 -2
  48. package/lib/cjs/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +15 -0
  49. package/lib/cjs/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.js +16 -0
  50. package/lib/cjs/components/outofofficehourspane/common/presetOneProps/presetOneOOOHPaneControlProps.js +1 -1
  51. package/lib/cjs/components/outofofficehourspane/common/presetTwoProps/presetTwoOOOHPaneControlProps.js +1 -1
  52. package/lib/cjs/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
  53. package/lib/cjs/components/postchatsurveypane/common/defaultProps/defaultPostChatSurveyPaneControlProps.js +5 -2
  54. package/lib/cjs/components/postchatsurveypane/common/presetOneProps/presetOnePostChatSurveyPaneControlProps.js +1 -1
  55. package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +25 -11
  56. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +5 -1
  57. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +4 -1
  58. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +10 -0
  59. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles.js +7 -1
  60. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +10 -0
  61. package/lib/cjs/components/prechatsurveypane/common/presetThreeProps/presetThreePreChatSurveyPaneControlProps.js +1 -1
  62. package/lib/cjs/components/prechatsurveypane/common/presetTwoProps/presetTwoPreChatSurveyPaneControlProps.js +1 -1
  63. package/lib/cjs/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
  64. package/lib/cjs/components/proactivechatpane/ProactiveChatPane.js +36 -35
  65. package/lib/cjs/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +15 -8
  66. package/lib/cjs/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -13
  67. package/lib/cjs/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +15 -8
  68. package/lib/cjs/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +15 -8
  69. package/lib/cjs/components/proactivechatpane/common/presetTwo/presetTwoProps/presetTwoProactiveChatPaneControlProps.js +9 -6
  70. package/lib/cjs/components/reconnectchatpane/ReconnectChatPane.js +3 -3
  71. package/lib/cjs/components/reconnectchatpane/common/default/defaultProps/defaultReconnectChatPaneControlProps.js +12 -9
  72. package/lib/cjs/components/reconnectchatpane/common/presetThree/presetThreeProps/presetThreeReconnectChatPaneControlProps.js +11 -8
  73. package/lib/cjs/index.js +6 -0
  74. package/lib/cjs/services/BroadcastService.js +36 -8
  75. package/lib/esm/common/Constants.js +18 -6
  76. package/lib/esm/common/utils.js +16 -0
  77. package/lib/esm/components/callingcontainer/common/defaultProps/defaultCallingContainerControlProps.js +2 -1
  78. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +8 -8
  79. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlProps.js +24 -23
  80. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlPropsRtl.js +19 -18
  81. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +22 -9
  82. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlProps.js +20 -19
  83. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlPropsRtl.js +17 -16
  84. package/lib/esm/components/chatbutton/ChatButton.js +28 -24
  85. package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +9 -5
  86. package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonSubTitleStyles.js +3 -1
  87. package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonTitleStyles.js +1 -0
  88. package/lib/esm/components/common/commandbutton/CommandButton.js +38 -13
  89. package/lib/esm/components/{header → common}/subcomponents/CloseButton.js +9 -8
  90. package/lib/esm/components/confirmationpane/ConfirmationPane.js +10 -3
  91. package/lib/esm/components/confirmationpane/common/defaultProps/defaultConfirmationPaneControlProps.js +8 -7
  92. package/lib/esm/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneButtonGroupStyles.js +5 -1
  93. package/lib/esm/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneGeneralStyles.js +7 -4
  94. package/lib/esm/components/footer/Footer.js +6 -5
  95. package/lib/esm/components/footer/common/defaultProps/customFooterControlProps.js +11 -10
  96. package/lib/esm/components/footer/common/defaultProps/defaultFooterControlProps.js +16 -14
  97. package/lib/esm/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
  98. package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +32 -15
  99. package/lib/esm/components/footer/subcomponents/DownloadTranscriptButton.js +5 -5
  100. package/lib/esm/components/footer/subcomponents/EmailTranscriptButton.js +5 -5
  101. package/lib/esm/components/header/Header.js +6 -5
  102. package/lib/esm/components/header/common/defaultProps/azureHeaderControlProps.js +7 -6
  103. package/lib/esm/components/header/common/defaultProps/customHeaderControlProps.js +8 -7
  104. package/lib/esm/components/header/common/defaultProps/defaultHeaderComponentOverrides.js +2 -1
  105. package/lib/esm/components/header/common/defaultProps/defaultHeaderControlProps.js +12 -11
  106. package/lib/esm/components/header/subcomponents/MinimizeButton.js +5 -5
  107. package/lib/esm/components/inputvalidationpane/InputValidationPane.js +29 -29
  108. package/lib/esm/components/inputvalidationpane/common/default/defaultProps/defaultInputValidationPaneControlProps.js +12 -12
  109. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
  110. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneGeneralStyles.js +1 -1
  111. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
  112. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
  113. package/lib/esm/components/inputvalidationpane/common/presetTwo/presetTwoProps/presetTwoInputValidationPaneControlProps.js +12 -12
  114. package/lib/esm/components/loadingpane/LoadingPane.js +3 -2
  115. package/lib/esm/components/loadingpane/common/defaultProps/defaultLoadingPaneControlProps.js +5 -4
  116. package/lib/esm/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +3 -2
  117. package/lib/esm/components/loadingpane/common/presetOneProps/presetOneLoadingPaneControlProps.js +1 -1
  118. package/lib/esm/components/loadingpane/common/presetThreeProps/presetThreeLoadingPaneControlProps.js +1 -1
  119. package/lib/esm/components/loadingpane/common/presetTwoProps/presetTwoLoadingPaneControlProps.js +1 -1
  120. package/lib/esm/components/outofofficehourspane/OOOHPane.js +13 -7
  121. package/lib/esm/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +5 -2
  122. package/lib/esm/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +6 -0
  123. package/lib/esm/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.js +6 -0
  124. package/lib/esm/components/outofofficehourspane/common/presetOneProps/presetOneOOOHPaneControlProps.js +1 -1
  125. package/lib/esm/components/outofofficehourspane/common/presetTwoProps/presetTwoOOOHPaneControlProps.js +1 -1
  126. package/lib/esm/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
  127. package/lib/esm/components/postchatsurveypane/common/defaultProps/defaultPostChatSurveyPaneControlProps.js +3 -2
  128. package/lib/esm/components/postchatsurveypane/common/presetOneProps/presetOnePostChatSurveyPaneControlProps.js +1 -1
  129. package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +26 -12
  130. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +3 -1
  131. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +4 -1
  132. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +3 -0
  133. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles.js +5 -1
  134. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +3 -0
  135. package/lib/esm/components/prechatsurveypane/common/presetThreeProps/presetThreePreChatSurveyPaneControlProps.js +1 -1
  136. package/lib/esm/components/prechatsurveypane/common/presetTwoProps/presetTwoPreChatSurveyPaneControlProps.js +1 -1
  137. package/lib/esm/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
  138. package/lib/esm/components/proactivechatpane/ProactiveChatPane.js +33 -34
  139. package/lib/esm/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +13 -8
  140. package/lib/esm/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -11
  141. package/lib/esm/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +13 -8
  142. package/lib/esm/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +13 -8
  143. package/lib/esm/components/proactivechatpane/common/presetTwo/presetTwoProps/presetTwoProactiveChatPaneControlProps.js +7 -6
  144. package/lib/esm/components/reconnectchatpane/ReconnectChatPane.js +4 -4
  145. package/lib/esm/components/reconnectchatpane/common/default/defaultProps/defaultReconnectChatPaneControlProps.js +10 -9
  146. package/lib/esm/components/reconnectchatpane/common/presetThree/presetThreeProps/presetThreeReconnectChatPaneControlProps.js +9 -8
  147. package/lib/esm/index.js +1 -0
  148. package/lib/esm/services/BroadcastService.js +34 -8
  149. package/lib/types/common/Constants.d.ts +151 -2
  150. package/lib/types/common/utils.d.ts +1 -0
  151. package/lib/types/components/chatbutton/interfaces/IChatButtonControlProps.d.ts +3 -0
  152. package/lib/types/components/common/interfaces/ICommandButtonControlProps.d.ts +1 -0
  153. package/lib/types/components/common/interfaces/ICommandButtonProps.d.ts +1 -0
  154. package/lib/types/components/{header → common}/subcomponents/CloseButton.d.ts +1 -1
  155. package/lib/types/components/confirmationpane/interfaces/IConfirmationPaneControlProps.d.ts +0 -1
  156. package/lib/types/components/inputvalidationpane/interfaces/IInputValidationPaneControlProps.d.ts +0 -1
  157. package/lib/types/components/loadingpane/interfaces/ILoadingPaneProps.d.ts +2 -0
  158. package/lib/types/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.d.ts +2 -0
  159. package/lib/types/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.d.ts +2 -0
  160. package/lib/types/components/outofofficehourspane/interfaces/IOOOHPaneControlProps.d.ts +1 -0
  161. package/lib/types/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.d.ts +2 -0
  162. package/lib/types/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.d.ts +2 -0
  163. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneButtonStyles.d.ts +3 -0
  164. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.d.ts +5 -0
  165. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneStyleProps.d.ts +5 -0
  166. package/lib/types/components/proactivechatpane/interfaces/IProactiveChatPaneControlProps.d.ts +2 -1
  167. package/lib/types/index.d.ts +1 -0
  168. package/lib/types/services/BroadcastService.d.ts +1 -0
  169. package/package.json +2 -2
@@ -22,28 +22,45 @@ function AudioNotificationButton(props) {
22
22
  disabled
23
23
  } = props;
24
24
  const [muted, setMuted] = (0, _react2.useState)(props.isAudioMuted);
25
+ let iconStyles = {};
26
+
27
+ if (props.type === _Constants.ButtonTypes.Icon) {
28
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ iconStyles = { ...(props === null || props === void 0 ? void 0 : props.styles).icon
30
+ };
31
+ }
32
+
25
33
  const iconButtonStyles = {
26
- root: props === null || props === void 0 ? void 0 : props.styles,
27
- rootHovered: props === null || props === void 0 ? void 0 : props.hoverStyles,
28
- rootFocused: props === null || props === void 0 ? void 0 : props.focusStyles,
29
- rootPressed: props === null || props === void 0 ? void 0 : props.hoverStyles
34
+ icon: iconStyles,
35
+ root: {
36
+ selectors: {
37
+ ":hover .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
+ ...(props === null || props === void 0 ? void 0 : props.hoverStyles).icon
39
+ },
40
+ ":active .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
+ ...(props === null || props === void 0 ? void 0 : props.hoverStyles).icon
42
+ },
43
+ ":focus .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
44
+ ...(props === null || props === void 0 ? void 0 : props.focusStyles).icon
45
+ }
46
+ },
47
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
+ ...(props === null || props === void 0 ? void 0 : props.styles)
49
+ },
50
+ rootHovered: props.hoverStyles,
51
+ rootFocused: props.focusStyles,
52
+ rootPressed: props.hoverStyles
30
53
  }; //imageIconProps > iconName
31
54
 
32
55
  const volume0Icon = props.imageToggleIconProps ? {
33
56
  imageProps: props === null || props === void 0 ? void 0 : props.imageToggleIconProps
34
57
  } : {
35
- iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? "Volume0",
36
- styles: {
37
- root: props.styles
38
- }
58
+ iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? _Constants.IconNames.Volume0
39
59
  };
40
60
  const volume3Icon = props.imageIconProps ? {
41
61
  imageProps: props === null || props === void 0 ? void 0 : props.imageIconProps
42
62
  } : {
43
- iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? "Volume3",
44
- styles: {
45
- root: props.styles
46
- }
63
+ iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? _Constants.IconNames.Volume3
47
64
  };
48
65
  const handleOnClick = (0, _react2.useCallback)(() => {
49
66
  setMuted(!muted);
@@ -52,7 +69,7 @@ function AudioNotificationButton(props) {
52
69
  const customEvent = {
53
70
  elementType: _Constants.ElementType.FooterSoundNotificationButton,
54
71
  elementId: props === null || props === void 0 ? void 0 : props.id,
55
- eventName: "OnClick"
72
+ eventName: _Constants.EventNames.OnClick
56
73
  };
57
74
 
58
75
  _BroadcastService.BroadcastService.postMessage(customEvent);
@@ -71,7 +88,7 @@ function AudioNotificationButton(props) {
71
88
  disabled: disabled,
72
89
  styles: iconButtonStyles,
73
90
  className: props.className,
74
- title: muted ? props.toggleAriaLabel ?? "Turn sound on" : props.ariaLabel ?? "Turn sound off"
91
+ title: muted ? props.toggleAriaLabel ?? _Constants.AriaLabels.TurnSoundOn : props.ariaLabel ?? _Constants.AriaLabels.TurnSoundOff
75
92
  });
76
93
  }
77
94
 
@@ -20,19 +20,19 @@ function DownloadTranscriptButton(props) {
20
20
  const customEvent = {
21
21
  elementType: _Constants.ElementType.FooterDownloadTranscriptButton,
22
22
  elementId: props === null || props === void 0 ? void 0 : props.id,
23
- eventName: "OnClick"
23
+ eventName: _Constants.EventNames.OnClick
24
24
  };
25
25
  return /*#__PURE__*/_react.default.createElement(_CommandButton.default, {
26
26
  id: props === null || props === void 0 ? void 0 : props.id,
27
27
  type: type,
28
- text: props.text ?? "Download chat transcript",
28
+ text: props.text ?? _Constants.Texts.DownloadChatTranscriptText,
29
29
  styles: props.styles,
30
30
  hoverStyles: props.hoverStyles,
31
31
  focusStyles: props.focusStyles,
32
- iconName: props.iconName ?? "Download",
32
+ iconName: props.iconName ?? _Constants.IconNames.Download,
33
33
  imageIconProps: props.imageIconProps,
34
34
  onClick: props.onClick,
35
- ariaLabel: props.ariaLabel ?? "Download chat transcript",
35
+ ariaLabel: props.ariaLabel ?? _Constants.AriaLabels.DownloadChatTranscript,
36
36
  className: props.className,
37
37
  customEvent: customEvent
38
38
  });
@@ -20,19 +20,19 @@ function EmailTranscriptButton(props) {
20
20
  const customEvent = {
21
21
  elementType: _Constants.ElementType.FooterEmailTranscriptButton,
22
22
  elementId: props === null || props === void 0 ? void 0 : props.id,
23
- eventName: "OnClick"
23
+ eventName: _Constants.EventNames.OnClick
24
24
  };
25
25
  return /*#__PURE__*/_react.default.createElement(_CommandButton.default, {
26
26
  id: props === null || props === void 0 ? void 0 : props.id,
27
27
  type: type,
28
- text: props.text ?? "Email Transcript",
28
+ text: props.text ?? _Constants.Texts.EmailTranscriptText,
29
29
  styles: props.styles,
30
30
  hoverStyles: props.hoverStyles,
31
31
  focusStyles: props.focusStyles,
32
- iconName: props.iconName ?? "Mail",
32
+ iconName: props.iconName ?? _Constants.IconNames.Mail,
33
33
  imageIconProps: props.imageIconProps,
34
34
  onClick: props.onClick,
35
- ariaLabel: props.ariaLabel ?? "Email Transcript",
35
+ ariaLabel: props.ariaLabel ?? _Constants.AriaLabels.EmailTranscript,
36
36
  className: props.className,
37
37
  customEvent: customEvent
38
38
  });
@@ -9,7 +9,7 @@ var React = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _react2 = require("@fluentui/react");
11
11
 
12
- var _CloseButton = _interopRequireDefault(require("./subcomponents/CloseButton"));
12
+ var _CloseButton = _interopRequireDefault(require("../common/subcomponents/CloseButton"));
13
13
 
14
14
  var _MinimizeButton = _interopRequireDefault(require("./subcomponents/MinimizeButton"));
15
15
 
@@ -19,13 +19,15 @@ var _defaultHeaderProps = require("./common/defaultProps/defaultHeaderProps");
19
19
 
20
20
  var _utils = require("../../common/utils");
21
21
 
22
+ var _Constants = require("../../common/Constants");
23
+
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
25
 
24
26
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
27
 
26
28
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
29
 
28
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
30
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
29
31
 
30
32
  (0, _react2.initializeIcons)();
31
33
 
@@ -63,7 +65,7 @@ function Header(props) {
63
65
  role: "region"
64
66
  }, /*#__PURE__*/React.createElement(_react2.Stack, {
65
67
  horizontal: true,
66
- id: "headerLeftGroup",
68
+ id: _Constants.Ids.HeaderLeftGroupId,
67
69
  verticalAlign: "center"
68
70
  }, /*#__PURE__*/React.createElement(_react2.Stack, {
69
71
  horizontal: true,
@@ -80,7 +82,7 @@ function Header(props) {
80
82
  styles: titleStyles
81
83
  }, titleProps === null || titleProps === void 0 ? void 0 : titleProps.text)))), /*#__PURE__*/React.createElement(_react2.Stack, {
82
84
  horizontal: true,
83
- id: "headerMiddleGroup"
85
+ id: _Constants.Ids.HeaderMiddleGroupId
84
86
  }, /*#__PURE__*/React.createElement(_react2.Stack, {
85
87
  horizontal: true,
86
88
  verticalAlign: "start"
@@ -88,7 +90,7 @@ function Header(props) {
88
90
  align: "start"
89
91
  }, (0, _utils.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(_react2.Stack, {
90
92
  horizontal: true,
91
- id: "headerRightGroup",
93
+ id: _Constants.Ids.HeaderRightGroupId,
92
94
  verticalAlign: "start"
93
95
  }, /*#__PURE__*/React.createElement(_react2.Stack, {
94
96
  horizontal: true,
@@ -7,8 +7,10 @@ exports.azureHeaderControlProps = void 0;
7
7
 
8
8
  var _Icons = require("../../../../assets/Icons");
9
9
 
10
+ var _Constants = require("../../../../common/Constants");
11
+
10
12
  const azureHeaderControlProps = {
11
- id: "oc-lcw-header",
13
+ id: _Constants.Ids.DefaultHeaderId,
12
14
  hideIcon: false,
13
15
  hideTitle: true,
14
16
  hideCloseButton: false,
@@ -30,20 +32,20 @@ const azureHeaderControlProps = {
30
32
  },
31
33
  minimizeButtonProps: {
32
34
  id: "oc-lcw-header-minimizebutton",
33
- type: "icon"
35
+ type: _Constants.ButtonTypes.Icon
34
36
  },
35
37
  closeButtonProps: {
36
38
  id: "oc-lcw-header-closebutton",
37
- type: "text",
39
+ type: _Constants.ButtonTypes.Text,
38
40
  text: "End Chat"
39
41
  },
40
42
  headerIconProps: {
41
- id: "oc-lcw-header-icon",
43
+ id: _Constants.Ids.HeaderIconId,
42
44
  src: _Icons.LegacyChatIconBase64,
43
- alt: "Chat Icon"
45
+ alt: _Constants.Texts.HeaderIcon
44
46
  },
45
47
  headerTitleProps: {
46
- id: "oc-lcw-header-title",
48
+ id: _Constants.Ids.HeaderTitleId,
47
49
  text: "Azure Chat Support"
48
50
  }
49
51
  };
@@ -7,8 +7,10 @@ exports.customHeaderControlProps = void 0;
7
7
 
8
8
  var _Icons = require("../../../../assets/Icons");
9
9
 
10
+ var _Constants = require("../../../../common/Constants");
11
+
10
12
  const customHeaderControlProps = {
11
- id: "oc-lcw-header",
13
+ id: _Constants.Ids.DefaultHeaderId,
12
14
  hideIcon: false,
13
15
  hideTitle: false,
14
16
  hideCloseButton: false,
@@ -30,7 +32,7 @@ const customHeaderControlProps = {
30
32
  },
31
33
  minimizeButtonProps: {
32
34
  id: "oc-lcw-header-minimizebutton",
33
- type: "icon",
35
+ type: _Constants.ButtonTypes.Icon,
34
36
  imageIconProps: {
35
37
  src: _Icons.MinimizeChatButtonIconBase64,
36
38
  styles: {
@@ -43,7 +45,7 @@ const customHeaderControlProps = {
43
45
  },
44
46
  closeButtonProps: {
45
47
  id: "oc-lcw-header-closebutton",
46
- type: "icon",
48
+ type: _Constants.ButtonTypes.Icon,
47
49
  imageIconProps: {
48
50
  src: _Icons.CloseChatButtonIconBase64,
49
51
  styles: {
@@ -55,13 +57,13 @@ const customHeaderControlProps = {
55
57
  }
56
58
  },
57
59
  headerIconProps: {
58
- id: "oc-lcw-header-icon",
60
+ id: _Constants.Ids.HeaderIconId,
59
61
  src: _Icons.LegacyChatIconBase64,
60
- alt: "Chat Icon"
62
+ alt: _Constants.Texts.HeaderIcon
61
63
  },
62
64
  headerTitleProps: {
63
- id: "oc-lcw-header-title",
64
- text: "Let's Chat"
65
+ id: _Constants.Ids.HeaderTitleId,
66
+ text: _Constants.Texts.HeaderTitle
65
67
  }
66
68
  };
67
69
  exports.customHeaderControlProps = customHeaderControlProps;
@@ -13,6 +13,8 @@ var _Icon = require("@fluentui/react/lib/Icon");
13
13
 
14
14
  var _styleUtilities = require("@fluentui/style-utilities");
15
15
 
16
+ var _Constants = require("../../../../common/Constants");
17
+
16
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
19
 
18
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -38,7 +40,7 @@ const defaultHeaderComponentOverrides = {
38
40
  }),
39
41
  headerTitle: /*#__PURE__*/React.createElement(_react2.Label, {
40
42
  styles: labelClass,
41
- id: "oc-lcw-header-title"
43
+ id: _Constants.Ids.HeaderTitleId
42
44
  }, "Hi, there!")
43
45
  };
44
46
  exports.defaultHeaderComponentOverrides = defaultHeaderComponentOverrides;
@@ -7,8 +7,10 @@ exports.defaultHeaderControlProps = void 0;
7
7
 
8
8
  var _Icons = require("../../../../assets/Icons");
9
9
 
10
+ var _Constants = require("../../../../common/Constants");
11
+
10
12
  const defaultHeaderControlProps = {
11
- id: "oc-lcw-header",
13
+ id: _Constants.Ids.DefaultHeaderId,
12
14
  hideIcon: false,
13
15
  hideTitle: false,
14
16
  hideCloseButton: false,
@@ -29,23 +31,23 @@ const defaultHeaderControlProps = {
29
31
  children: []
30
32
  },
31
33
  minimizeButtonProps: {
32
- id: "oc-lcw-header-minimize-button",
33
- type: "icon",
34
- iconName: "ChromeMinimize"
34
+ id: _Constants.Ids.MinimizeButtonId,
35
+ type: _Constants.ButtonTypes.Icon,
36
+ iconName: _Constants.IconNames.ChromeMinimize
35
37
  },
36
38
  closeButtonProps: {
37
- id: "oc-lcw-header-close-button",
38
- type: "icon",
39
- iconName: "ChromeClose"
39
+ id: _Constants.Ids.CloseButtonId,
40
+ type: _Constants.ButtonTypes.Icon,
41
+ iconName: _Constants.IconNames.ChromeClose
40
42
  },
41
43
  headerIconProps: {
42
- id: "oc-lcw-header-icon",
44
+ id: _Constants.Ids.HeaderIconId,
43
45
  src: _Icons.ModernChatIconBase64,
44
- alt: "Chat Icon"
46
+ alt: _Constants.Texts.HeaderIcon
45
47
  },
46
48
  headerTitleProps: {
47
- id: "oc-lcw-header-title",
48
- text: "Let's Chat"
49
+ id: _Constants.Ids.HeaderTitleId,
50
+ text: _Constants.Texts.HeaderTitle
49
51
  }
50
52
  };
51
53
  exports.defaultHeaderControlProps = defaultHeaderControlProps;
@@ -20,19 +20,19 @@ function MinimizeButton(props) {
20
20
  const customEvent = {
21
21
  elementType: _Constants.ElementType.HeaderMinimizeButton,
22
22
  elementId: props === null || props === void 0 ? void 0 : props.id,
23
- eventName: "OnClick"
23
+ eventName: _Constants.EventNames.OnClick
24
24
  };
25
25
  return /*#__PURE__*/_react.default.createElement(_CommandButton.default, {
26
26
  id: props === null || props === void 0 ? void 0 : props.id,
27
27
  type: type,
28
- text: props.text ?? "Minimize",
28
+ text: props.text ?? _Constants.Texts.MinimizeText,
29
29
  styles: props.styles,
30
30
  hoverStyles: props.hoverStyles,
31
31
  focusStyles: props.focusStyles,
32
- iconName: props.iconName ?? "ChromeMinimize",
32
+ iconName: props.iconName ?? _Constants.IconNames.ChromeMinimize,
33
33
  imageIconProps: props.imageIconProps,
34
34
  onClick: props.onClick,
35
- ariaLabel: props.ariaLabel ?? "Minimize",
35
+ ariaLabel: props.ariaLabel ?? _Constants.AriaLabels.Minimize,
36
36
  className: props.className,
37
37
  customEvent: customEvent
38
38
  });
@@ -55,23 +55,28 @@ function InputValidationPane(props) {
55
55
  const [isInitialRendering, setIsInitialRendering] = (0, _react2.useState)(true);
56
56
  const [isInvalidInput, setIsInvalidInput] = (0, _react2.useState)(false);
57
57
  const [isSendButtonEnabled, setIsSendButtonEnabled] = (0, _react2.useState)(false);
58
-
59
- const isValidInput = () => {
58
+ const isValidInput = (0, _react2.useCallback)(() => {
60
59
  var _props$controlProps2, _props$controlProps3;
61
60
 
62
- return (_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.checkInput ? inputValue && ((_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.checkInput(inputValue)) : true;
63
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
61
+ if (!((_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.checkInput)) {
62
+ return true;
63
+ }
64
+
65
+ if (!inputValue) {
66
+ return false;
67
+ }
64
68
 
69
+ return (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.checkInput(inputValue);
70
+ }, [inputValue]); // eslint-disable-next-line @typescript-eslint/no-explicit-any
65
71
 
66
- const handleInputChange = e => {
72
+ const handleInputChange = (0, _react2.useCallback)(e => {
67
73
  var _props$controlProps4, _props$controlProps5;
68
74
 
69
75
  setInputValue(e.target.value);
70
76
  e.target.value ? setIsSendButtonEnabled(((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.enableSendButton) || e.target.value !== "") : setIsSendButtonEnabled(((_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.enableSendButton) ?? false);
71
77
  setIsInvalidInput(false);
72
- };
73
-
74
- const send = (controlId, suffix) => {
78
+ }, []);
79
+ const send = (0, _react2.useCallback)((controlId, suffix) => {
75
80
  var _props$controlProps6;
76
81
 
77
82
  if ((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.onSend) {
@@ -90,20 +95,17 @@ function InputValidationPane(props) {
90
95
  setIsInvalidInput(true);
91
96
  }
92
97
  }
93
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
98
+ }, [inputValue]); // eslint-disable-next-line @typescript-eslint/no-explicit-any
94
99
 
95
-
96
- const handleInputKeyDown = e => {
100
+ const handleInputKeyUp = (0, _react2.useCallback)(e => {
97
101
  if (e.code === _Constants.KeyCodes.ENTER) {
98
- send(elementId + "-textField", "KeyDown");
102
+ send(elementId + "-textField", "KeyUp");
99
103
  }
100
- };
101
-
102
- const handleSendClick = () => {
104
+ }, [inputValue]);
105
+ const handleSendClick = (0, _react2.useCallback)(() => {
103
106
  send(elementId + "-sendbutton", "Click");
104
- };
105
-
106
- const cancel = (controlId, suffix) => {
107
+ }, [inputValue]);
108
+ const cancel = (0, _react2.useCallback)((controlId, suffix) => {
107
109
  var _props$controlProps8;
108
110
 
109
111
  if ((_props$controlProps8 = props.controlProps) !== null && _props$controlProps8 !== void 0 && _props$controlProps8.onCancel) {
@@ -121,19 +123,16 @@ function InputValidationPane(props) {
121
123
 
122
124
  (_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.onCancel();
123
125
  }
124
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
125
-
126
+ }, []); // eslint-disable-next-line @typescript-eslint/no-explicit-any
126
127
 
127
- const handleEscKeyDown = e => {
128
+ const handleEscKeyDown = (0, _react2.useCallback)(e => {
128
129
  if (e.code === _Constants.KeyCodes.ESCAPE) {
129
130
  cancel(elementId, "KeyDown");
130
131
  }
131
- };
132
-
133
- const handleCancelClick = () => {
132
+ }, []);
133
+ const handleCancelClick = (0, _react2.useCallback)(() => {
134
134
  cancel(elementId + "-cancelbutton", "Click");
135
- };
136
-
135
+ }, []);
137
136
  (0, _react2.useEffect)(() => {
138
137
  var _props$controlProps11, _props$controlProps12, _props$controlProps13;
139
138
 
@@ -160,7 +159,8 @@ function InputValidationPane(props) {
160
159
  const redBorderStyles = {
161
160
  borderColor: ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.inputWithErrorMessageBorderColor) ?? _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.inputWithErrorMessageBorderColor,
162
161
  borderRadius: "1px",
163
- borderStyle: "solid"
162
+ borderStyle: "solid",
163
+ borderWidth: "1px"
164
164
  };
165
165
  const inputStyles = {
166
166
  root: Object.assign({}, _defaultInputValidationPaneInputStyles.defaultInputValidationPaneInputStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.inputStyleProps),
@@ -244,7 +244,7 @@ function InputValidationPane(props) {
244
244
  ariaLabel: ((_props$controlProps24 = props.controlProps) === null || _props$controlProps24 === void 0 ? void 0 : _props$controlProps24.inputAriaLabel) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.inputAriaLabel,
245
245
  borderless: isInvalidInput,
246
246
  onChange: handleInputChange,
247
- onKeyDown: handleInputKeyDown
247
+ onKeyUp: handleInputKeyUp
248
248
  })), isInvalidInput && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.invalidInputErrorMessage) || /*#__PURE__*/_react2.default.createElement(_react.Stack, {
249
249
  className: (_props$styleProps22 = props.styleProps) === null || _props$styleProps22 === void 0 ? void 0 : (_props$styleProps22$c = _props$styleProps22.classNames) === null || _props$styleProps22$c === void 0 ? void 0 : _props$styleProps22$c.invalidInputErrorMessageClassName,
250
250
  styles: invalidInputErrorMessageStyles,
@@ -8,28 +8,28 @@ exports.defaultInputValidationPaneControlProps = void 0;
8
8
  var _Constants = require("../../../../../common/Constants");
9
9
 
10
10
  const defaultInputValidationPaneControlProps = {
11
- id: "oclcw-emailTranscriptDialogContainer",
11
+ id: _Constants.Ids.DefaultInputValidationPaneId,
12
12
  dir: "ltr",
13
13
  hideInputValidationPane: false,
14
- inputValidationPaneAriaLabel: "Email Chat Transcript Pane",
14
+ inputValidationPaneAriaLabel: _Constants.AriaLabels.EmailChatTranscriptPane,
15
15
  hideTitle: false,
16
- titleText: "Email this chat transcript",
16
+ titleText: _Constants.Texts.InputValidationPaneTitleText,
17
17
  hideSubtitle: false,
18
- subtitleText: "This will be sent after your chat ends.",
19
- inputId: "oclcw-emailTranscriptDialogTextField",
18
+ subtitleText: _Constants.Texts.InputValidationPaneSubtitleText,
19
+ inputId: _Constants.Ids.DefaultInputValidationPaneInputId,
20
20
  inputInitialText: "",
21
21
  hideInput: false,
22
- inputAriaLabel: "Email this chat transcript. This will be sent after your chat ends. Email address text area",
22
+ inputAriaLabel: _Constants.AriaLabels.InputValidationPaneInput,
23
23
  inputWithErrorMessageBorderColor: "rgb(164, 38, 44)",
24
- invalidInputErrorMessageText: "Enter a valid email address.",
24
+ invalidInputErrorMessageText: _Constants.Texts.InvalidInputErrorMessageText,
25
25
  isButtonGroupHorizontal: true,
26
26
  hideSendButton: false,
27
27
  enableSendButton: false,
28
- sendButtonText: "Send",
29
- sendButtonAriaLabel: "Send",
28
+ sendButtonText: _Constants.Texts.SendButtonText,
29
+ sendButtonAriaLabel: _Constants.AriaLabels.Send,
30
30
  hideCancelButton: false,
31
- cancelButtonText: "Cancel",
32
- cancelButtonAriaLabel: "Cancel",
31
+ cancelButtonText: _Constants.Texts.CancelButtonText,
32
+ cancelButtonAriaLabel: _Constants.AriaLabels.Cancel,
33
33
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
34
34
  onSend: function (input) {
35
35
  console.log("on send");
@@ -16,6 +16,7 @@ const defaultInputValidationPaneCancelButtonStyles = {
16
16
  fontWeight: "500",
17
17
  lineHeight: "19px",
18
18
  textOverflow: "ellipsis",
19
- whiteSpace: "nowrap"
19
+ whiteSpace: "nowrap",
20
+ width: "80px"
20
21
  };
21
22
  exports.defaultInputValidationPaneCancelButtonStyles = defaultInputValidationPaneCancelButtonStyles;
@@ -13,10 +13,10 @@ const defaultInputValidationPaneGeneralStyles = {
13
13
  borderTopWidth: "1px",
14
14
  bottom: "0",
15
15
  left: "0",
16
- minHeight: "180px",
17
16
  padding: "10px",
18
17
  position: "absolute",
19
18
  width: "100%",
19
+ maxHeight: "100%",
20
20
  zIndex: "9999"
21
21
  };
22
22
  exports.defaultInputValidationPaneGeneralStyles = defaultInputValidationPaneGeneralStyles;
@@ -8,7 +8,7 @@ const defaultInputValidationPaneInvalidInputErrorMessageStyles = {
8
8
  color: "#a4262c",
9
9
  fontFamily: "'Segoe UI', Arial, sans-serif",
10
10
  fontSize: "12px",
11
- height: "16px,",
11
+ height: "16px",
12
12
  lineHeight: "16px",
13
13
  marginTop: "4px"
14
14
  };
@@ -12,6 +12,7 @@ const defaultInputValidationPaneSendButtonStyles = {
12
12
  fontWeight: "500",
13
13
  lineHeight: "19px",
14
14
  textOverflow: "ellipsis",
15
- whiteSpace: "nowrap"
15
+ whiteSpace: "nowrap",
16
+ width: "80px"
16
17
  };
17
18
  exports.defaultInputValidationPaneSendButtonStyles = defaultInputValidationPaneSendButtonStyles;
@@ -8,27 +8,27 @@ exports.presetTwoInputValidationPaneControlProps = void 0;
8
8
  var _Constants = require("../../../../../common/Constants");
9
9
 
10
10
  const presetTwoInputValidationPaneControlProps = {
11
- id: "oclcw-emailTranscriptDialogContainer",
11
+ id: _Constants.Ids.DefaultInputValidationPaneId,
12
12
  dir: "ltr",
13
13
  hideInputValidationPane: false,
14
- inputValidationPaneAriaLabel: "Email Chat Transcript Pane",
14
+ inputValidationPaneAriaLabel: _Constants.AriaLabels.EmailChatTranscriptPane,
15
15
  hideTitle: false,
16
- titleText: "Email this chat transcript",
16
+ titleText: _Constants.Texts.InputValidationPaneTitleText,
17
17
  hideSubtitle: false,
18
- subtitleText: "This will be sent after your chat ends.",
19
- inputId: "oclcw-emailTranscriptDialogTextField",
18
+ subtitleText: _Constants.Texts.InputValidationPaneSubtitleText,
19
+ inputId: _Constants.Ids.DefaultInputValidationPaneInputId,
20
20
  hideInput: false,
21
- inputAriaLabel: "Email this chat transcript. This will be sent after your chat ends. Email address text area",
21
+ inputAriaLabel: _Constants.AriaLabels.InputValidationPaneInput,
22
22
  inputWithErrorMessageBorderColor: "rgb(164, 38, 44)",
23
- invalidInputErrorMessageText: "Enter a valid email address.",
23
+ invalidInputErrorMessageText: _Constants.Texts.InvalidInputErrorMessageText,
24
24
  isButtonGroupHorizontal: false,
25
25
  hideSendButton: false,
26
26
  enableSendButton: true,
27
- sendButtonText: "Send",
28
- sendButtonAriaLabel: "Send",
27
+ sendButtonText: _Constants.Texts.SendButtonText,
28
+ sendButtonAriaLabel: _Constants.AriaLabels.Send,
29
29
  hideCancelButton: false,
30
- cancelButtonText: "Cancel",
31
- cancelButtonAriaLabel: "Cancel",
30
+ cancelButtonText: _Constants.Texts.CancelButtonText,
31
+ cancelButtonAriaLabel: _Constants.AriaLabels.Cancel,
32
32
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
33
33
  onSend: function (input) {
34
34
  console.log("on send");
@@ -32,7 +32,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
32
32
  function LoadingPane(props) {
33
33
  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;
34
34
 
35
- const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? "lcw-components-loading-pane";
35
+ const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? _defaultLoadingPaneControlProps.defaultLoadingPaneControlProps.id;
36
36
  const containerStyles = {
37
37
  root: Object.assign({}, _defaultLoadingPaneGeneralStyles.defaultLoadingPaneGeneralStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps)
38
38
  };
@@ -52,13 +52,14 @@ function LoadingPane(props) {
52
52
  const spinnerTextStyles = {
53
53
  root: Object.assign({}, _defaultLoadingPaneSpinnerTextStyles.defaultLoadingPaneSpinnerTextStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.spinnerTextStyleProps)
54
54
  };
55
+ const showInSmallWindow = props.windowHeight ? props.windowHeight > 375 : true;
55
56
  return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, !((_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.hideLoadingPane) && /*#__PURE__*/_react2.default.createElement(_react.Stack, {
56
57
  id: elementId,
57
58
  tabIndex: -1,
58
59
  styles: containerStyles,
59
60
  role: (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.role,
60
61
  dir: ((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.dir) ?? _defaultLoadingPaneControlProps.defaultLoadingPaneControlProps.dir
61
- }, !((_props$controlProps5 = props.controlProps) !== null && _props$controlProps5 !== void 0 && _props$controlProps5.hideIcon) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.icon) || /*#__PURE__*/_react2.default.createElement(_react.Icon, {
62
+ }, !((_props$controlProps5 = props.controlProps) !== null && _props$controlProps5 !== void 0 && _props$controlProps5.hideIcon) && showInSmallWindow && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.icon) || /*#__PURE__*/_react2.default.createElement(_react.Icon, {
62
63
  className: (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : (_props$styleProps8$cl = _props$styleProps8.classNames) === null || _props$styleProps8$cl === void 0 ? void 0 : _props$styleProps8$cl.iconClassName,
63
64
  styles: iconStyles,
64
65
  imageProps: iconImageProps,
@@ -4,17 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.defaultLoadingPaneControlProps = void 0;
7
+
8
+ var _Constants = require("../../../../common/Constants");
9
+
7
10
  const defaultLoadingPaneControlProps = {
8
- id: "oc-lcw-loadingpane",
11
+ id: _Constants.Ids.DefaultLoadingPaneId,
9
12
  dir: "auto",
10
13
  hideLoadingPane: false,
11
14
  hideIcon: false,
12
15
  hideTitle: false,
13
- titleText: "Welcome to",
16
+ titleText: _Constants.Texts.LoadingPaneTitleText,
14
17
  hideSubtitle: false,
15
- subtitleText: "live chat support ...",
18
+ subtitleText: _Constants.Texts.LoadingPaneSubtitleText,
16
19
  hideSpinner: false,
17
20
  hideSpinnerText: false,
18
- spinnerText: "Loading ..."
21
+ spinnerText: _Constants.Texts.LoadingPaneSpinnerText
19
22
  };
20
23
  exports.defaultLoadingPaneControlProps = defaultLoadingPaneControlProps;