@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
@@ -1,6 +1,6 @@
1
1
  import { DefaultButton, PrimaryButton } from "@fluentui/react/lib/Button";
2
2
  import { Label, Stack, TextField } from "@fluentui/react";
3
- import React, { useEffect, useState } from "react";
3
+ import React, { useCallback, useEffect, useState } from "react";
4
4
  import { BroadcastService } from "../../services/BroadcastService";
5
5
  import { KeyCodes } from "../../common/Constants";
6
6
  import { decodeComponentString } from "../../common/decodeComponentString";
@@ -26,23 +26,28 @@ function InputValidationPane(props) {
26
26
  const [isInitialRendering, setIsInitialRendering] = useState(true);
27
27
  const [isInvalidInput, setIsInvalidInput] = useState(false);
28
28
  const [isSendButtonEnabled, setIsSendButtonEnabled] = useState(false);
29
-
30
- const isValidInput = () => {
29
+ const isValidInput = useCallback(() => {
31
30
  var _props$controlProps2, _props$controlProps3;
32
31
 
33
- 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;
34
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
+ if (!((_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.checkInput)) {
33
+ return true;
34
+ }
35
+
36
+ if (!inputValue) {
37
+ return false;
38
+ }
35
39
 
40
+ return (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.checkInput(inputValue);
41
+ }, [inputValue]); // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
42
 
37
- const handleInputChange = e => {
43
+ const handleInputChange = useCallback(e => {
38
44
  var _props$controlProps4, _props$controlProps5;
39
45
 
40
46
  setInputValue(e.target.value);
41
47
  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);
42
48
  setIsInvalidInput(false);
43
- };
44
-
45
- const send = (controlId, suffix) => {
49
+ }, []);
50
+ const send = useCallback((controlId, suffix) => {
46
51
  var _props$controlProps6;
47
52
 
48
53
  if ((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.onSend) {
@@ -59,20 +64,17 @@ function InputValidationPane(props) {
59
64
  setIsInvalidInput(true);
60
65
  }
61
66
  }
62
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
+ }, [inputValue]); // eslint-disable-next-line @typescript-eslint/no-explicit-any
63
68
 
64
-
65
- const handleInputKeyDown = e => {
69
+ const handleInputKeyUp = useCallback(e => {
66
70
  if (e.code === KeyCodes.ENTER) {
67
- send(elementId + "-textField", "KeyDown");
71
+ send(elementId + "-textField", "KeyUp");
68
72
  }
69
- };
70
-
71
- const handleSendClick = () => {
73
+ }, [inputValue]);
74
+ const handleSendClick = useCallback(() => {
72
75
  send(elementId + "-sendbutton", "Click");
73
- };
74
-
75
- const cancel = (controlId, suffix) => {
76
+ }, [inputValue]);
77
+ const cancel = useCallback((controlId, suffix) => {
76
78
  var _props$controlProps8;
77
79
 
78
80
  if ((_props$controlProps8 = props.controlProps) !== null && _props$controlProps8 !== void 0 && _props$controlProps8.onCancel) {
@@ -88,19 +90,16 @@ function InputValidationPane(props) {
88
90
  BroadcastService.postMessage(customEvent);
89
91
  (_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.onCancel();
90
92
  }
91
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
92
-
93
+ }, []); // eslint-disable-next-line @typescript-eslint/no-explicit-any
93
94
 
94
- const handleEscKeyDown = e => {
95
+ const handleEscKeyDown = useCallback(e => {
95
96
  if (e.code === KeyCodes.ESCAPE) {
96
97
  cancel(elementId, "KeyDown");
97
98
  }
98
- };
99
-
100
- const handleCancelClick = () => {
99
+ }, []);
100
+ const handleCancelClick = useCallback(() => {
101
101
  cancel(elementId + "-cancelbutton", "Click");
102
- };
103
-
102
+ }, []);
104
103
  useEffect(() => {
105
104
  var _props$controlProps11, _props$controlProps12, _props$controlProps13;
106
105
 
@@ -127,7 +126,8 @@ function InputValidationPane(props) {
127
126
  const redBorderStyles = {
128
127
  borderColor: ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.inputWithErrorMessageBorderColor) ?? defaultInputValidationPaneControlProps.inputWithErrorMessageBorderColor,
129
128
  borderRadius: "1px",
130
- borderStyle: "solid"
129
+ borderStyle: "solid",
130
+ borderWidth: "1px"
131
131
  };
132
132
  const inputStyles = {
133
133
  root: Object.assign({}, defaultInputValidationPaneInputStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.inputStyleProps),
@@ -211,7 +211,7 @@ function InputValidationPane(props) {
211
211
  ariaLabel: ((_props$controlProps24 = props.controlProps) === null || _props$controlProps24 === void 0 ? void 0 : _props$controlProps24.inputAriaLabel) || defaultInputValidationPaneControlProps.inputAriaLabel,
212
212
  borderless: isInvalidInput,
213
213
  onChange: handleInputChange,
214
- onKeyDown: handleInputKeyDown
214
+ onKeyUp: handleInputKeyUp
215
215
  })), isInvalidInput && (decodeComponentString((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.invalidInputErrorMessage) || /*#__PURE__*/React.createElement(Stack, {
216
216
  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,
217
217
  styles: invalidInputErrorMessageStyles,
@@ -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");
@@ -10,5 +10,6 @@ export const defaultInputValidationPaneCancelButtonStyles = {
10
10
  fontWeight: "500",
11
11
  lineHeight: "19px",
12
12
  textOverflow: "ellipsis",
13
- whiteSpace: "nowrap"
13
+ whiteSpace: "nowrap",
14
+ width: "80px"
14
15
  };
@@ -7,9 +7,9 @@ export const defaultInputValidationPaneGeneralStyles = {
7
7
  borderTopWidth: "1px",
8
8
  bottom: "0",
9
9
  left: "0",
10
- minHeight: "180px",
11
10
  padding: "10px",
12
11
  position: "absolute",
13
12
  width: "100%",
13
+ maxHeight: "100%",
14
14
  zIndex: "9999"
15
15
  };
@@ -2,7 +2,7 @@ export const defaultInputValidationPaneInvalidInputErrorMessageStyles = {
2
2
  color: "#a4262c",
3
3
  fontFamily: "'Segoe UI', Arial, sans-serif",
4
4
  fontSize: "12px",
5
- height: "16px,",
5
+ height: "16px",
6
6
  lineHeight: "16px",
7
7
  marginTop: "4px"
8
8
  };
@@ -6,5 +6,6 @@ export const defaultInputValidationPaneSendButtonStyles = {
6
6
  fontWeight: "500",
7
7
  lineHeight: "19px",
8
8
  textOverflow: "ellipsis",
9
- whiteSpace: "nowrap"
9
+ whiteSpace: "nowrap",
10
+ width: "80px"
10
11
  };
@@ -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
  };
@@ -33,13 +33,14 @@ function LoadingPane(props) {
33
33
  const spinnerTextStyles = {
34
34
  root: Object.assign({}, defaultLoadingPaneSpinnerTextStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.spinnerTextStyleProps)
35
35
  };
36
+ const showInSmallWindow = props.windowHeight ? props.windowHeight > 375 : true;
36
37
  return /*#__PURE__*/React.createElement(React.Fragment, null, !((_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.hideLoadingPane) && /*#__PURE__*/React.createElement(Stack, {
37
38
  id: elementId,
38
39
  tabIndex: -1,
39
40
  styles: containerStyles,
40
41
  role: (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.role,
41
42
  dir: ((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.dir) ?? defaultLoadingPaneControlProps.dir
42
- }, !((_props$controlProps5 = props.controlProps) !== null && _props$controlProps5 !== void 0 && _props$controlProps5.hideIcon) && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.icon) || /*#__PURE__*/React.createElement(Icon, {
43
+ }, !((_props$controlProps5 = props.controlProps) !== null && _props$controlProps5 !== void 0 && _props$controlProps5.hideIcon) && showInSmallWindow && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.icon) || /*#__PURE__*/React.createElement(Icon, {
43
44
  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,
44
45
  styles: iconStyles,
45
46
  imageProps: iconImageProps,
@@ -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,11 +1,12 @@
1
1
  export const defaultLoadingPaneIconStyles = {
2
2
  borderRadius: "50%",
3
3
  backgroundColor: "#F1F1F1",
4
- boxShadow: "0px 0px 0.5px 7px #3F75AB",
4
+ boxShadow: "0px 0px 0.5px 7px rgba(196, 196, 196, 0.15)",
5
5
  width: "86px",
6
6
  height: "86px",
7
7
  margin: "0px 0px 20px 0px",
8
8
  display: "flex",
9
9
  order: 1,
10
- alignSelf: "auto"
10
+ alignSelf: "auto",
11
+ overflow: "visible"
11
12
  };
@@ -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,12 +1,13 @@
1
- import { Label, Stack } from "@fluentui/react";
1
+ import { Stack, Text } from "@fluentui/react";
2
2
  import React from "react";
3
3
  import { decodeComponentString } from "../../common/decodeComponentString";
4
4
  import { defaultOOOHPaneControlProps } from "./common/defaultProps/defaultOOOHPaneControlProps";
5
5
  import { defaultOOOHPaneGeneralStyles } from "./common/defaultProps/defaultStyles/defaultOOOHPaneGeneralStyles";
6
6
  import { defaultOOOHPaneTitleStyles } from "./common/defaultProps/defaultStyles/defaultOOOHPaneTitleStyles";
7
+ import { replaceURLWithAnchor } from "../../common/utils";
7
8
 
8
9
  function OOOHPane(props) {
9
- var _props$controlProps, _props$styleProps, _props$styleProps2, _props$controlProps2, _props$controlProps3, _props$styleProps3, _props$styleProps3$cl, _props$controlProps4, _props$controlProps5, _props$componentOverr, _props$styleProps4, _props$styleProps4$cl, _props$controlProps6;
10
+ var _props$controlProps, _props$styleProps, _props$styleProps2, _props$controlProps2, _props$controlProps3, _props$controlProps4, _props$controlProps5, _props$styleProps3, _props$styleProps3$cl, _props$controlProps6, _props$controlProps7, _props$componentOverr, _props$styleProps4, _props$styleProps4$cl;
10
11
 
11
12
  const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? defaultOOOHPaneControlProps.id;
12
13
  const containerStyles = {
@@ -15,19 +16,24 @@ function OOOHPane(props) {
15
16
  const titleStyles = {
16
17
  root: Object.assign({}, defaultOOOHPaneTitleStyles, (_props$styleProps2 = props.styleProps) === null || _props$styleProps2 === void 0 ? void 0 : _props$styleProps2.titleStyleProps)
17
18
  };
18
- return /*#__PURE__*/React.createElement(React.Fragment, null, !((_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.hideOOOHPane) && /*#__PURE__*/React.createElement(Stack, {
19
+ const displayText = replaceURLWithAnchor(((_props$controlProps2 = props.controlProps) === null || _props$controlProps2 === void 0 ? void 0 : _props$controlProps2.titleText) ?? defaultOOOHPaneControlProps.titleText, ((_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.openLinkInNewTab) ?? defaultOOOHPaneControlProps.openLinkInNewTab) ?? "";
20
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !((_props$controlProps4 = props.controlProps) !== null && _props$controlProps4 !== void 0 && _props$controlProps4.hideOOOHPane) && /*#__PURE__*/React.createElement(Stack, {
19
21
  id: elementId,
20
22
  tabIndex: -1,
21
23
  styles: containerStyles,
22
- role: (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.role,
24
+ role: ((_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.role) ?? defaultOOOHPaneControlProps.role,
23
25
  className: (_props$styleProps3 = props.styleProps) === null || _props$styleProps3 === void 0 ? void 0 : (_props$styleProps3$cl = _props$styleProps3.classNames) === null || _props$styleProps3$cl === void 0 ? void 0 : _props$styleProps3$cl.containerClassName,
24
- dir: ((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.dir) ?? defaultOOOHPaneControlProps.dir
25
- }, !((_props$controlProps5 = props.controlProps) !== null && _props$controlProps5 !== void 0 && _props$controlProps5.hideTitle) && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/React.createElement(Label, {
26
+ dir: ((_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.dir) ?? defaultOOOHPaneControlProps.dir
27
+ }, !((_props$controlProps7 = props.controlProps) !== null && _props$controlProps7 !== void 0 && _props$controlProps7.hideTitle) && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/React.createElement(Text, {
26
28
  className: (_props$styleProps4 = props.styleProps) === null || _props$styleProps4 === void 0 ? void 0 : (_props$styleProps4$cl = _props$styleProps4.classNames) === null || _props$styleProps4$cl === void 0 ? void 0 : _props$styleProps4$cl.titleClassName,
27
29
  styles: titleStyles,
28
30
  tabIndex: -1,
29
31
  id: elementId + "-title"
30
- }, ((_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.titleText) ?? defaultOOOHPaneControlProps.titleText))));
32
+ }, /*#__PURE__*/React.createElement("div", {
33
+ dangerouslySetInnerHTML: {
34
+ __html: displayText
35
+ }
36
+ })))));
31
37
  }
32
38
 
33
39
  export default OOOHPane;
@@ -1,7 +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
- titleText: "Thanks for contacting us. You have reached us outside of our operating hours. An agent will respond when we open."
7
+ role: "alert",
8
+ titleText: Texts.OOOHPaneTitleText,
9
+ openLinkInNewTab: false
7
10
  };
@@ -0,0 +1,6 @@
1
+ import { defaultOOOHPaneControlProps } from "../defaultProps/defaultOOOHPaneControlProps";
2
+ export const presetFourOOOHPaneControlProps = { ...defaultOOOHPaneControlProps,
3
+ id: "lcw-out-of-office-hours-pane-preset1",
4
+ titleText: "We are out of office. Please contact us here https://www.microsoft.com for further assisstance",
5
+ openLinkInNewTab: true
6
+ };
@@ -0,0 +1,6 @@
1
+ import { defaultOOOHPaneStyles } from "../defaultProps/defaultStyles/defaultOOOHPaneStyles";
2
+ import { presetFourOOOHPaneControlProps } from "./presetFourOOOHPaneControlProps";
3
+ export const presetFourOOOHPaneProps = {
4
+ controlProps: presetFourOOOHPaneControlProps,
5
+ styleProps: defaultOOOHPaneStyles
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
  };
@@ -15,7 +15,8 @@ function PostChatSurveyPane(props) {
15
15
  const iframeStyles = {
16
16
  height: "100vh",
17
17
  width: "100%",
18
- display: "block"
18
+ display: "block",
19
+ maxHeight: "100%"
19
20
  };
20
21
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Stack, {
21
22
  id: elementId,
@@ -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
  };
@@ -1,4 +1,4 @@
1
1
  import { defaultPostChatSurveyPaneControlProps } from "../defaultProps/defaultPostChatSurveyPaneControlProps";
2
2
  export const presetOnePostChatSurveyPaneControlProps = { ...defaultPostChatSurveyPaneControlProps,
3
- id: "oc-lcw-postchatsurveypane-preset1"
3
+ id: "lcw-postchat-survey-pane-preset1"
4
4
  };
@@ -3,16 +3,16 @@ import { Stack } from "@fluentui/react";
3
3
  import React, { useCallback } from "react";
4
4
  import { addNoreferrerNoopenerTag, broadcastError, getInputValuesFromAdaptiveCard } from "../../common/utils";
5
5
  import { BroadcastService } from "../../services/BroadcastService";
6
- import { ElementType } from "../../common/Constants";
6
+ import { ElementType, EventNames } from "../../common/Constants";
7
7
  import { defaultPreChatSurveyPaneACContainerStyles } from "./common/defaultProps/defaultStyles/defaultPreChatSurveyPaneACContainerStyles";
8
8
  import { defaultPreChatSurveyPaneControlProps } from "./common/defaultProps/defaultPreChatSurveyPaneControlProps";
9
9
  import { defaultPreChatSurveyPaneGeneralStyles } from "./common/defaultProps/defaultStyles/defaultPreChatSurveyPaneGeneralStyles";
10
10
  import { defaultPreChatSurveyPaneStyles } from "./common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles";
11
11
 
12
12
  function PreChatSurveyPane(props) {
13
- var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps3$cu, _defaultPreChatSurvey, _props$styleProps4, _props$styleProps4$cu, _defaultPreChatSurvey2, _props$styleProps5, _props$styleProps5$cu, _defaultPreChatSurvey3, _props$controlProps6, _props$controlProps7, _props$controlProps8;
13
+ var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps3$cu, _props$styleProps4, _props$styleProps4$cu, _props$styleProps5, _props$styleProps5$cu, _props$styleProps6, _props$styleProps6$cu, _props$styleProps7, _props$styleProps7$cu, _props$styleProps8, _props$styleProps8$cu, _props$styleProps9, _props$styleProps9$cu, _defaultPreChatSurvey, _props$styleProps10, _props$styleProps10$c, _props$styleProps11, _props$styleProps11$c, _defaultPreChatSurvey2, _props$styleProps12, _props$styleProps12$c, _props$styleProps13, _props$styleProps13$c, _defaultPreChatSurvey3, _props$styleProps14, _props$styleProps14$c, _defaultPreChatSurvey4, _props$styleProps15, _props$styleProps15$c, _defaultPreChatSurvey5, _props$styleProps16, _props$styleProps16$c, _defaultPreChatSurvey6, _props$styleProps17, _props$styleProps17$c, _defaultPreChatSurvey7, _props$styleProps18, _props$styleProps18$c, _defaultPreChatSurvey8, _props$controlProps6, _props$controlProps7, _props$controlProps8;
14
14
 
15
- const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? "lcw-components-prechatsurvey-pane";
15
+ const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? defaultPreChatSurveyPaneControlProps.id;
16
16
  let adpativeCardPayload;
17
17
  let adaptiveCardHostConfig;
18
18
  const containerStyles = {
@@ -53,13 +53,14 @@ function PreChatSurveyPane(props) {
53
53
  const customEvent = {
54
54
  elementType: ElementType.PreChatSurveySubmitButton,
55
55
  elementId: elementId,
56
- eventName: "OnClick"
56
+ eventName: EventNames.OnClick
57
57
  };
58
58
  BroadcastService.postMessage(customEvent);
59
59
  (_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.onSubmit(values);
60
60
  }
61
61
  }, []); //Adaptive Card Initilializations
62
62
 
63
+ AdaptiveCards.GlobalSettings.setTabIndexAtCardRoot = false;
63
64
  const adaptiveCard = new AdaptiveCards.AdaptiveCard();
64
65
  adaptiveCard.hostConfig = new AdaptiveCards.HostConfig(adaptiveCardHostConfig);
65
66
  adaptiveCard.parse(adpativeCardPayload);
@@ -68,18 +69,30 @@ function PreChatSurveyPane(props) {
68
69
  const renderedCard = adaptiveCard.render();
69
70
  addNoreferrerNoopenerTag(renderedCard);
70
71
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
72
+ .ac-textBlock {
73
+ font-size: ${(_props$styleProps3 = props.styleProps) === null || _props$styleProps3 === void 0 ? void 0 : (_props$styleProps3$cu = _props$styleProps3.customTextStyleProps) === null || _props$styleProps3$cu === void 0 ? void 0 : _props$styleProps3$cu.fontSize} !important;
74
+ height: ${(_props$styleProps4 = props.styleProps) === null || _props$styleProps4 === void 0 ? void 0 : (_props$styleProps4$cu = _props$styleProps4.customTextStyleProps) === null || _props$styleProps4$cu === void 0 ? void 0 : _props$styleProps4$cu.height};
75
+ padding-top: ${(_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : (_props$styleProps5$cu = _props$styleProps5.customTextStyleProps) === null || _props$styleProps5$cu === void 0 ? void 0 : _props$styleProps5$cu.paddingTop};
76
+ }
77
+ .ac-textRun {
78
+ font-size: ${(_props$styleProps6 = props.styleProps) === null || _props$styleProps6 === void 0 ? void 0 : (_props$styleProps6$cu = _props$styleProps6.customTextStyleProps) === null || _props$styleProps6$cu === void 0 ? void 0 : _props$styleProps6$cu.fontSize} !important;
79
+ padding-top: ${(_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : (_props$styleProps7$cu = _props$styleProps7.customTextStyleProps) === null || _props$styleProps7$cu === void 0 ? void 0 : _props$styleProps7$cu.paddingTop};
80
+ }
71
81
  .ac-input {
72
82
  margin-bottom: 6px;
73
83
  }
74
84
  .ac-input.ac-textInput {
75
- height: 20px;
85
+ font-size: ${(_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : (_props$styleProps8$cu = _props$styleProps8.customTextInputStyleProps) === null || _props$styleProps8$cu === void 0 ? void 0 : _props$styleProps8$cu.fontSize};
86
+ height: ${((_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : (_props$styleProps9$cu = _props$styleProps9.customTextInputStyleProps) === null || _props$styleProps9$cu === void 0 ? void 0 : _props$styleProps9$cu.height) ?? ((_defaultPreChatSurvey = defaultPreChatSurveyPaneStyles.customTextInputStyleProps) === null || _defaultPreChatSurvey === void 0 ? void 0 : _defaultPreChatSurvey.height)};
76
87
  padding: 8px;
77
88
  }
78
89
  .ac-input.ac-textInput.ac-multiline {
79
- height: 52px;
90
+ font-size: ${(_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : (_props$styleProps10$c = _props$styleProps10.customMultilineTextInputStyleProps) === null || _props$styleProps10$c === void 0 ? void 0 : _props$styleProps10$c.fontSize};
91
+ height: ${((_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : (_props$styleProps11$c = _props$styleProps11.customMultilineTextInputStyleProps) === null || _props$styleProps11$c === void 0 ? void 0 : _props$styleProps11$c.height) ?? ((_defaultPreChatSurvey2 = defaultPreChatSurveyPaneStyles.customMultilineTextInputStyleProps) === null || _defaultPreChatSurvey2 === void 0 ? void 0 : _defaultPreChatSurvey2.height)};
80
92
  resize: none;
81
93
  }
82
94
  .ac-input.ac-multichoiceInput {
95
+ font-size: ${(_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : (_props$styleProps12$c = _props$styleProps12.customMultichoiceInputStyleProps) === null || _props$styleProps12$c === void 0 ? void 0 : _props$styleProps12$c.fontSize};
83
96
  padding: 3px;
84
97
  padding-top: 7px;
85
98
  padding-bottom: 7px;
@@ -87,18 +100,19 @@ function PreChatSurveyPane(props) {
87
100
  .ac-pushButton {
88
101
  border: 1px solid #00000000;
89
102
  margin: 2px;
90
- height: 48px;
103
+ height: ${((_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : (_props$styleProps13$c = _props$styleProps13.customButtonStyleProps) === null || _props$styleProps13$c === void 0 ? void 0 : _props$styleProps13$c.height) ?? ((_defaultPreChatSurvey3 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey3 === void 0 ? void 0 : _defaultPreChatSurvey3.height)};
104
+ width: ${((_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 ? void 0 : (_props$styleProps14$c = _props$styleProps14.customButtonStyleProps) === null || _props$styleProps14$c === void 0 ? void 0 : _props$styleProps14$c.width) ?? ((_defaultPreChatSurvey4 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey4 === void 0 ? void 0 : _defaultPreChatSurvey4.width)};
91
105
  border-radius: 5px;
92
106
  cursor: pointer;
93
107
  font-weight: bold;
94
- font-size: 15px;
95
- font-family: ${((_props$styleProps3 = props.styleProps) === null || _props$styleProps3 === void 0 ? void 0 : (_props$styleProps3$cu = _props$styleProps3.customButtonStyleProps) === null || _props$styleProps3$cu === void 0 ? void 0 : _props$styleProps3$cu.fontFamily) ?? ((_defaultPreChatSurvey = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey === void 0 ? void 0 : _defaultPreChatSurvey.fontFamily)};
96
- color: ${((_props$styleProps4 = props.styleProps) === null || _props$styleProps4 === void 0 ? void 0 : (_props$styleProps4$cu = _props$styleProps4.customButtonStyleProps) === null || _props$styleProps4$cu === void 0 ? void 0 : _props$styleProps4$cu.color) ?? ((_defaultPreChatSurvey2 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey2 === void 0 ? void 0 : _defaultPreChatSurvey2.color)};
97
- background-color: ${((_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : (_props$styleProps5$cu = _props$styleProps5.customButtonStyleProps) === null || _props$styleProps5$cu === void 0 ? void 0 : _props$styleProps5$cu.backgroundColor) ?? ((_defaultPreChatSurvey3 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey3 === void 0 ? void 0 : _defaultPreChatSurvey3.backgroundColor)};
108
+ font-size: ${((_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 ? void 0 : (_props$styleProps15$c = _props$styleProps15.customButtonStyleProps) === null || _props$styleProps15$c === void 0 ? void 0 : _props$styleProps15$c.fontSize) ?? ((_defaultPreChatSurvey5 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey5 === void 0 ? void 0 : _defaultPreChatSurvey5.fontSize)};
109
+ font-family: ${((_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 ? void 0 : (_props$styleProps16$c = _props$styleProps16.customButtonStyleProps) === null || _props$styleProps16$c === void 0 ? void 0 : _props$styleProps16$c.fontFamily) ?? ((_defaultPreChatSurvey6 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey6 === void 0 ? void 0 : _defaultPreChatSurvey6.fontFamily)};
110
+ color: ${((_props$styleProps17 = props.styleProps) === null || _props$styleProps17 === void 0 ? void 0 : (_props$styleProps17$c = _props$styleProps17.customButtonStyleProps) === null || _props$styleProps17$c === void 0 ? void 0 : _props$styleProps17$c.color) ?? ((_defaultPreChatSurvey7 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey7 === void 0 ? void 0 : _defaultPreChatSurvey7.color)};
111
+ background-color: ${((_props$styleProps18 = props.styleProps) === null || _props$styleProps18 === void 0 ? void 0 : (_props$styleProps18$c = _props$styleProps18.customButtonStyleProps) === null || _props$styleProps18$c === void 0 ? void 0 : _props$styleProps18$c.backgroundColor) ?? ((_defaultPreChatSurvey8 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey8 === void 0 ? void 0 : _defaultPreChatSurvey8.backgroundColor)};
98
112
  }`), !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hidePreChatSurveyPane) && /*#__PURE__*/React.createElement(Stack, {
99
113
  id: elementId,
100
114
  tabIndex: -1,
101
- role: (_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.role,
115
+ role: ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.role) ?? defaultPreChatSurveyPaneControlProps.role,
102
116
  dir: ((_props$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.dir) ?? defaultPreChatSurveyPaneControlProps.dir,
103
117
  styles: containerStyles
104
118
  }, /*#__PURE__*/React.createElement(Stack, {
@@ -1,6 +1,8 @@
1
+ import { Ids } from "../../../../common/Constants";
1
2
  export const defaultPreChatSurveyPaneControlProps = {
2
- id: "oc-lcw-prechatsurveypane-default",
3
+ id: Ids.DefaultPreChatSurveyPaneId,
3
4
  dir: "auto",
5
+ role: "alert",
4
6
  hidePreChatSurveyPane: false,
5
7
  adaptiveCardHostConfig: "{\"fontFamily\":\"Segoe UI, Helvetica Neue, sans-serif\",\"containerStyles\":{\"default\":{\"foregroundColors\":{\"default\":{\"default\":\"#000000\"}},\"backgroundColor\":\"#FFFFFF\"}},\"actions\":{\"actionsOrientation\":\"Vertical\",\"actionAlignment\":\"stretch\"}}",
6
8
  payload: "{\"$schema\":\"http://adaptivecards.io/schemas/adaptive-card.json\",\"type\":\"AdaptiveCard\",\"version\":\"1.1\",\"body\":[{\"type\":\"TextBlock\",\"weight\":\"bolder\",\"text\":\"Please answer below questions.\"},{\"type\":\"Input.Text\",\"id\":\"1e5e4e7a-8f0b-ec11-b6e6-000d3a305d38\",\"label\":\"name pls?\",\"maxLength\":100,\"isRequired\":true,\"errorMessage\":\"Name is required\"},{\"type\":\"Input.Text\",\"id\":\"7f8f5d6d-995e-ec11-8f8f-000d3a31376e\",\"label\":\"multi\\nmulti\\nmulti\",\"style\":\"text\",\"isMultiline\":true,\"maxLength\":250},{\"type\":\"Input.ChoiceSet\",\"id\":\"e4bdf7cb-995e-ec11-8f8f-000d3a31376e\",\"label\":\"options\",\"isMultiSelect\":false,\"value\":\"1\",\"style\":\"compact\",\"choices\":[{\"title\":\"one\",\"value\":\"1\"},{\"title\":\"two\",\"value\":\"2\"},{\"title\":\"three\",\"value\":\"3\"}]},{\"type\":\"Input.Toggle\",\"id\":\"b26011d2-995e-ec11-8f8f-000d3a31376e\",\"title\":\"consent\",\"valueOn\":\"True\",\"valueOff\":\"False\",\"value\":\"false\"},{\"type\":\"TextBlock\",\"isSubtle\":true,\"text\":\"Fields marked with * are mandatory.\",\"wrap\":true}],\"actions\":[{\"type\":\"Action.Submit\",\"title\":\"Submit\",\"data\":{\"Type\":\"InputSubmit\"}}]}",
@@ -1,5 +1,8 @@
1
1
  export const defaultPreChatSurveyPaneButtonStyles = {
2
2
  backgroundColor: "rgb(49, 95, 162)",
3
3
  color: "#FFFFFF",
4
- fontFamily: "Segoe UI, Arial, sans-serif"
4
+ fontFamily: "Segoe UI, Arial, sans-serif",
5
+ fontSize: "15px",
6
+ height: "48px",
7
+ width: "auto"
5
8
  };
@@ -0,0 +1,3 @@
1
+ export const defaultPreChatSurveyPaneMultilineTextInputStyles = {
2
+ height: "52px"
3
+ };
@@ -1,8 +1,12 @@
1
1
  import { defaultPreChatSurveyPaneACContainerStyles } from "./defaultPreChatSurveyPaneACContainerStyles";
2
2
  import { defaultPreChatSurveyPaneButtonStyles } from "./defaultPreChatSurveyPaneButtonStyles";
3
3
  import { defaultPreChatSurveyPaneGeneralStyles } from "./defaultPreChatSurveyPaneGeneralStyles";
4
+ import { defaultPreChatSurveyPaneMultilineTextInputStyles } from "./defaultPreChatSurveyPaneMultilineTextInputStyles";
5
+ import { defaultPreChatSurveyPaneTextInputStyles } from "./defaultPreChatSurveyPaneTextInputStyles";
4
6
  export const defaultPreChatSurveyPaneStyles = {
5
7
  generalStyleProps: defaultPreChatSurveyPaneGeneralStyles,
6
8
  customButtonStyleProps: defaultPreChatSurveyPaneButtonStyles,
7
- adaptiveCardContainerStyleProps: defaultPreChatSurveyPaneACContainerStyles
9
+ adaptiveCardContainerStyleProps: defaultPreChatSurveyPaneACContainerStyles,
10
+ customTextInputStyleProps: defaultPreChatSurveyPaneTextInputStyles,
11
+ customMultilineTextInputStyleProps: defaultPreChatSurveyPaneMultilineTextInputStyles
8
12
  };
@@ -0,0 +1,3 @@
1
+ export const defaultPreChatSurveyPaneTextInputStyles = {
2
+ height: "20px"
3
+ };