@microsoft/omnichannel-chat-components 1.1.19 → 1.2.0-main.5692126
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.
- package/lib/cjs/common/Constants.js +8 -11
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +10 -3
- package/lib/cjs/components/callingcontainer/subcomponents/Timer/Timer.js +10 -1
- package/lib/cjs/components/chatbutton/ChatButton.blankAnnouncements.a11y.spec.js +158 -0
- package/lib/cjs/components/chatbutton/ChatButton.browseMode.a11y.spec.js +227 -0
- package/lib/cjs/components/chatbutton/ChatButton.browseMode.unfixed.a11y.spec.js +112 -0
- package/lib/cjs/components/chatbutton/ChatButton.js +52 -16
- package/lib/cjs/components/common/subcomponents/CloseButton.js +1 -3
- package/lib/cjs/components/confirmationpane/ConfirmationPane.js +10 -8
- package/lib/cjs/components/confirmationpane/common/defaultProps/defaultConfirmationPaneControlProps.js +1 -0
- package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +11 -4
- package/lib/cjs/components/footer/subcomponents/DownloadTranscriptButton.js +1 -3
- package/lib/cjs/components/footer/subcomponents/EmailTranscriptButton.js +1 -3
- package/lib/cjs/components/header/Header.js +16 -4
- package/lib/cjs/components/header/common/defaultStyles/defaultHeaderStyleProps.js +23 -0
- package/lib/cjs/components/header/subcomponents/MinimizeButton.js +1 -3
- package/lib/cjs/components/inputvalidationpane/InputValidationPane.js +34 -14
- package/lib/cjs/components/inputvalidationpane/common/default/defaultProps/defaultInputValidationPaneControlProps.js +1 -0
- package/lib/cjs/components/notificationpane/subcomponents/CloseChatButton.js +1 -3
- package/lib/cjs/components/notificationpane/subcomponents/DismissButton.js +1 -3
- package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +94 -17
- package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultichoiceInputStyles.js +1 -0
- package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +1 -0
- package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +1 -0
- package/lib/cjs/package.json +1 -0
- package/lib/cjs/services/EventQueue.js +4 -7
- package/lib/esm/common/Constants.js +1 -1
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +10 -3
- package/lib/esm/components/callingcontainer/subcomponents/Timer/Timer.js +10 -1
- package/lib/esm/components/chatbutton/ChatButton.blankAnnouncements.a11y.spec.js +155 -0
- package/lib/esm/components/chatbutton/ChatButton.browseMode.a11y.spec.js +224 -0
- package/lib/esm/components/chatbutton/ChatButton.browseMode.unfixed.a11y.spec.js +108 -0
- package/lib/esm/components/chatbutton/ChatButton.js +53 -16
- package/lib/esm/components/common/subcomponents/CloseButton.js +1 -3
- package/lib/esm/components/confirmationpane/ConfirmationPane.js +10 -8
- package/lib/esm/components/confirmationpane/common/defaultProps/defaultConfirmationPaneControlProps.js +1 -0
- package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +11 -4
- package/lib/esm/components/footer/subcomponents/DownloadTranscriptButton.js +1 -3
- package/lib/esm/components/footer/subcomponents/EmailTranscriptButton.js +1 -3
- package/lib/esm/components/header/Header.js +16 -4
- package/lib/esm/components/header/common/defaultStyles/defaultHeaderStyleProps.js +23 -0
- package/lib/esm/components/header/subcomponents/MinimizeButton.js +1 -3
- package/lib/esm/components/inputvalidationpane/InputValidationPane.js +34 -14
- package/lib/esm/components/inputvalidationpane/common/default/defaultProps/defaultInputValidationPaneControlProps.js +1 -0
- package/lib/esm/components/notificationpane/subcomponents/CloseChatButton.js +1 -3
- package/lib/esm/components/notificationpane/subcomponents/DismissButton.js +1 -3
- package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +94 -16
- package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultichoiceInputStyles.js +1 -0
- package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +1 -0
- package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +1 -0
- package/lib/types/common/Constants.d.ts +2 -0
- package/lib/types/components/chatbutton/ChatButton.blankAnnouncements.a11y.spec.d.ts +1 -0
- package/lib/types/components/chatbutton/ChatButton.browseMode.a11y.spec.d.ts +1 -0
- package/lib/types/components/chatbutton/ChatButton.browseMode.unfixed.a11y.spec.d.ts +1 -0
- package/lib/types/components/confirmationpane/interfaces/IConfirmationPaneControlProps.d.ts +1 -0
- package/lib/types/components/header/interfaces/IHeaderStyleProps.d.ts +12 -0
- package/lib/types/components/inputvalidationpane/interfaces/IInputValidationPaneControlProps.d.ts +1 -0
- package/package.json +39 -31
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var AdaptiveCards = _interopRequireWildcard(require("adaptivecards"));
|
|
7
|
+
var AdaptiveCards = _interopRequireWildcard(require("adaptivecards/dist/adaptivecards.js"));
|
|
8
8
|
var _Constants = require("../../common/Constants");
|
|
9
9
|
var _react = require("@fluentui/react");
|
|
10
10
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
@@ -15,9 +15,58 @@ var _defaultPreChatSurveyPaneControlProps = require("./common/defaultProps/defau
|
|
|
15
15
|
var _defaultPreChatSurveyPaneGeneralStyles = require("./common/defaultProps/defaultStyles/defaultPreChatSurveyPaneGeneralStyles");
|
|
16
16
|
var _defaultPreChatSurveyPaneStyles = require("./common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles");
|
|
17
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
18
|
+
// Detect iOS (iPhone/iPad/iPod) including iPadOS 13+ which reports as Mac with touch support.
|
|
19
|
+
// Used to scope iOS-only Safari workarounds; must not match other platforms.
|
|
20
|
+
const isIOSDevice = () => {
|
|
21
|
+
if (typeof navigator === "undefined") {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
const ua = navigator.userAgent || "";
|
|
25
|
+
if (/iPad|iPhone|iPod/.test(ua)) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
return ua.includes("Mac") && typeof document !== "undefined" && "ontouchend" in document;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// iOS-only: AdaptiveCards' ChoiceSetInput value getter treats `selectedIndex > 0` as "user selected"
|
|
32
|
+
// and returns undefined for index 0 (assuming it is always the injected placeholder).
|
|
33
|
+
// On iOS we remove the placeholder to avoid a blank picker row, which shifts the first real
|
|
34
|
+
// option to index 0 — so the original getter wrongly reports undefined and required-field
|
|
35
|
+
// validation fails. Patch the prototype once to accept index >= 0.
|
|
36
|
+
let iosChoiceSetValuePatched = false;
|
|
37
|
+
const patchIOSChoiceSetValueGetter = () => {
|
|
38
|
+
if (iosChoiceSetValuePatched) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
|
+
const ChoiceSetInput = AdaptiveCards.ChoiceSetInput;
|
|
43
|
+
if (!ChoiceSetInput || !ChoiceSetInput.prototype) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const descriptor = Object.getOwnPropertyDescriptor(ChoiceSetInput.prototype, "value");
|
|
47
|
+
if (!descriptor || !descriptor.get) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
Object.defineProperty(ChoiceSetInput.prototype, "value", {
|
|
51
|
+
configurable: true,
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
+
get: function () {
|
|
54
|
+
var _descriptor$get;
|
|
55
|
+
if (!this.isMultiSelect && this._selectElement) {
|
|
56
|
+
return this._selectElement.selectedIndex >= 0 ? this._selectElement.value : undefined;
|
|
57
|
+
}
|
|
58
|
+
return (_descriptor$get = descriptor.get) === null || _descriptor$get === void 0 ? void 0 : _descriptor$get.call(this);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
iosChoiceSetValuePatched = true;
|
|
62
|
+
};
|
|
18
63
|
function PreChatSurveyPane(props) {
|
|
19
|
-
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps0,
|
|
64
|
+
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _defaultPreChatSurvey, _props$styleProps0, _defaultPreChatSurvey2, _props$styleProps1, _defaultPreChatSurvey3, _props$styleProps10, _defaultPreChatSurvey4, _props$styleProps11, _defaultPreChatSurvey5, _props$styleProps12, _defaultPreChatSurvey6, _props$styleProps13, _defaultPreChatSurvey7, _props$styleProps14, _defaultPreChatSurvey8, _props$styleProps15, _defaultPreChatSurvey9, _props$styleProps16, _defaultPreChatSurvey0, _props$styleProps17, _defaultPreChatSurvey1, _props$styleProps18, _defaultPreChatSurvey10, _props$styleProps19, _defaultPreChatSurvey11, _props$styleProps20, _defaultPreChatSurvey12, _props$styleProps21, _defaultPreChatSurvey13, _props$controlProps6, _props$controlProps7, _props$controlProps8;
|
|
20
65
|
const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? _defaultPreChatSurveyPaneControlProps.defaultPreChatSurveyPaneControlProps.id;
|
|
66
|
+
const isIOS = isIOSDevice();
|
|
67
|
+
if (isIOS) {
|
|
68
|
+
patchIOSChoiceSetValueGetter();
|
|
69
|
+
}
|
|
21
70
|
let adpativeCardPayload;
|
|
22
71
|
let adaptiveCardHostConfig;
|
|
23
72
|
const containerStyles = {
|
|
@@ -71,6 +120,31 @@ function PreChatSurveyPane(props) {
|
|
|
71
120
|
// Render the card
|
|
72
121
|
const renderedCard = adaptiveCard.render();
|
|
73
122
|
(0, _utils.addNoreferrerNoopenerTag)(renderedCard);
|
|
123
|
+
|
|
124
|
+
// Fix iOS Safari blank space in <select> dropdowns. iOS-only; other platforms render correctly.
|
|
125
|
+
// The placeholder option that AdaptiveCards injects renders as a blank row in the iOS
|
|
126
|
+
// native picker (CSS display/hidden are ignored on <option>). Removing it from the DOM
|
|
127
|
+
// is the only reliable workaround. After removal, we select the first remaining option
|
|
128
|
+
// and notify AdaptiveCards so required-field validation reads the visible value.
|
|
129
|
+
const applyIOSPrechatFix = container => {
|
|
130
|
+
const selectElements = container.querySelectorAll("select.ac-choiceSetInput-compact");
|
|
131
|
+
selectElements.forEach(select => {
|
|
132
|
+
const firstOption = select.options[0];
|
|
133
|
+
if (firstOption && firstOption.disabled && firstOption.hidden && firstOption.value === "") {
|
|
134
|
+
firstOption.remove();
|
|
135
|
+
if (select.options.length > 0) {
|
|
136
|
+
select.selectedIndex = 0;
|
|
137
|
+
select.value = select.options[0].value;
|
|
138
|
+
select.dispatchEvent(new Event("input", {
|
|
139
|
+
bubbles: true
|
|
140
|
+
}));
|
|
141
|
+
select.dispatchEvent(new Event("change", {
|
|
142
|
+
bubbles: true
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
};
|
|
74
148
|
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement("style", null, `
|
|
75
149
|
.ac-textBlock {
|
|
76
150
|
font-size: ${(_props$styleProps3 = props.styleProps) === null || _props$styleProps3 === void 0 || (_props$styleProps3 = _props$styleProps3.customTextStyleProps) === null || _props$styleProps3 === void 0 ? void 0 : _props$styleProps3.fontSize} !important;
|
|
@@ -88,39 +162,39 @@ function PreChatSurveyPane(props) {
|
|
|
88
162
|
margin-bottom: 6px;
|
|
89
163
|
}
|
|
90
164
|
.ac-input.ac-textInput {
|
|
91
|
-
font-size: ${(_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 || (_props$styleProps9 = _props$styleProps9.customTextInputStyleProps) === null || _props$styleProps9 === void 0 ? void 0 : _props$styleProps9.fontSize};
|
|
92
|
-
font-family: ${((_props$styleProps0 = props.styleProps) === null || _props$styleProps0 === void 0 || (_props$styleProps0 = _props$styleProps0.customTextInputStyleProps) === null || _props$styleProps0 === void 0 ? void 0 : _props$styleProps0.fontFamily) ?? ((
|
|
93
|
-
height: ${((_props$styleProps1 = props.styleProps) === null || _props$styleProps1 === void 0 || (_props$styleProps1 = _props$styleProps1.customTextInputStyleProps) === null || _props$styleProps1 === void 0 ? void 0 : _props$styleProps1.height) ?? ((
|
|
165
|
+
font-size: ${((_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 || (_props$styleProps9 = _props$styleProps9.customTextInputStyleProps) === null || _props$styleProps9 === void 0 ? void 0 : _props$styleProps9.fontSize) ?? ((_defaultPreChatSurvey = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customTextInputStyleProps) === null || _defaultPreChatSurvey === void 0 ? void 0 : _defaultPreChatSurvey.fontSize)};
|
|
166
|
+
font-family: ${((_props$styleProps0 = props.styleProps) === null || _props$styleProps0 === void 0 || (_props$styleProps0 = _props$styleProps0.customTextInputStyleProps) === null || _props$styleProps0 === void 0 ? void 0 : _props$styleProps0.fontFamily) ?? ((_defaultPreChatSurvey2 = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customTextInputStyleProps) === null || _defaultPreChatSurvey2 === void 0 ? void 0 : _defaultPreChatSurvey2.fontFamily)};
|
|
167
|
+
height: ${((_props$styleProps1 = props.styleProps) === null || _props$styleProps1 === void 0 || (_props$styleProps1 = _props$styleProps1.customTextInputStyleProps) === null || _props$styleProps1 === void 0 ? void 0 : _props$styleProps1.height) ?? ((_defaultPreChatSurvey3 = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customTextInputStyleProps) === null || _defaultPreChatSurvey3 === void 0 ? void 0 : _defaultPreChatSurvey3.height)};
|
|
94
168
|
padding: 8px;
|
|
95
169
|
}
|
|
96
170
|
.ac-input.ac-textInput.ac-multiline {
|
|
97
|
-
font-size: ${(_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 || (_props$styleProps10 = _props$styleProps10.customMultilineTextInputStyleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.fontSize};
|
|
98
|
-
font-family: ${((_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 || (_props$styleProps11 = _props$styleProps11.customMultilineTextInputStyleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.fontFamily) ?? ((
|
|
99
|
-
height: ${((_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 || (_props$styleProps12 = _props$styleProps12.customMultilineTextInputStyleProps) === null || _props$styleProps12 === void 0 ? void 0 : _props$styleProps12.height) ?? ((
|
|
171
|
+
font-size: ${((_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 || (_props$styleProps10 = _props$styleProps10.customMultilineTextInputStyleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.fontSize) ?? ((_defaultPreChatSurvey4 = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customMultilineTextInputStyleProps) === null || _defaultPreChatSurvey4 === void 0 ? void 0 : _defaultPreChatSurvey4.fontSize)};
|
|
172
|
+
font-family: ${((_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 || (_props$styleProps11 = _props$styleProps11.customMultilineTextInputStyleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.fontFamily) ?? ((_defaultPreChatSurvey5 = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customMultilineTextInputStyleProps) === null || _defaultPreChatSurvey5 === void 0 ? void 0 : _defaultPreChatSurvey5.fontFamily)};
|
|
173
|
+
height: ${((_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 || (_props$styleProps12 = _props$styleProps12.customMultilineTextInputStyleProps) === null || _props$styleProps12 === void 0 ? void 0 : _props$styleProps12.height) ?? ((_defaultPreChatSurvey6 = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customMultilineTextInputStyleProps) === null || _defaultPreChatSurvey6 === void 0 ? void 0 : _defaultPreChatSurvey6.height)};
|
|
100
174
|
resize: none;
|
|
101
175
|
}
|
|
102
176
|
.ac-input.ac-multichoiceInput {
|
|
103
|
-
font-size: ${(_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 || (_props$styleProps13 = _props$styleProps13.customMultichoiceInputStyleProps) === null || _props$styleProps13 === void 0 ? void 0 : _props$styleProps13.fontSize};
|
|
104
|
-
font-family: ${((_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 || (_props$styleProps14 = _props$styleProps14.customMultichoiceInputStyleProps) === null || _props$styleProps14 === void 0 ? void 0 : _props$styleProps14.fontFamily) ?? ((
|
|
177
|
+
font-size: ${((_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 || (_props$styleProps13 = _props$styleProps13.customMultichoiceInputStyleProps) === null || _props$styleProps13 === void 0 ? void 0 : _props$styleProps13.fontSize) ?? ((_defaultPreChatSurvey7 = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customMultichoiceInputStyleProps) === null || _defaultPreChatSurvey7 === void 0 ? void 0 : _defaultPreChatSurvey7.fontSize)};
|
|
178
|
+
font-family: ${((_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 || (_props$styleProps14 = _props$styleProps14.customMultichoiceInputStyleProps) === null || _props$styleProps14 === void 0 ? void 0 : _props$styleProps14.fontFamily) ?? ((_defaultPreChatSurvey8 = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customMultichoiceInputStyleProps) === null || _defaultPreChatSurvey8 === void 0 ? void 0 : _defaultPreChatSurvey8.fontFamily)};
|
|
105
179
|
padding: 3px;
|
|
106
180
|
padding-top: 7px;
|
|
107
181
|
padding-bottom: 7px;
|
|
108
182
|
}
|
|
109
183
|
.ac-input.ac-toggleInput {
|
|
110
|
-
align-items: ${((_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 || (_props$styleProps15 = _props$styleProps15.customToggleInputStyleProps) === null || _props$styleProps15 === void 0 ? void 0 : _props$styleProps15.alignItems) ?? ((
|
|
184
|
+
align-items: ${((_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 || (_props$styleProps15 = _props$styleProps15.customToggleInputStyleProps) === null || _props$styleProps15 === void 0 ? void 0 : _props$styleProps15.alignItems) ?? ((_defaultPreChatSurvey9 = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customToggleInputStyleProps) === null || _defaultPreChatSurvey9 === void 0 ? void 0 : _defaultPreChatSurvey9.alignItems)} !important;
|
|
111
185
|
}
|
|
112
186
|
.ac-pushButton {
|
|
113
187
|
border: 1px solid #00000000;
|
|
114
188
|
margin: 2px;
|
|
115
|
-
height: ${((_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 || (_props$styleProps16 = _props$styleProps16.customButtonStyleProps) === null || _props$styleProps16 === void 0 ? void 0 : _props$styleProps16.height) ?? ((
|
|
116
|
-
width: ${((_props$styleProps17 = props.styleProps) === null || _props$styleProps17 === void 0 || (_props$styleProps17 = _props$styleProps17.customButtonStyleProps) === null || _props$styleProps17 === void 0 ? void 0 : _props$styleProps17.width) ?? ((
|
|
189
|
+
height: ${((_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 || (_props$styleProps16 = _props$styleProps16.customButtonStyleProps) === null || _props$styleProps16 === void 0 ? void 0 : _props$styleProps16.height) ?? ((_defaultPreChatSurvey0 = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey0 === void 0 ? void 0 : _defaultPreChatSurvey0.height)};
|
|
190
|
+
width: ${((_props$styleProps17 = props.styleProps) === null || _props$styleProps17 === void 0 || (_props$styleProps17 = _props$styleProps17.customButtonStyleProps) === null || _props$styleProps17 === void 0 ? void 0 : _props$styleProps17.width) ?? ((_defaultPreChatSurvey1 = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey1 === void 0 ? void 0 : _defaultPreChatSurvey1.width)};
|
|
117
191
|
border-radius: 5px;
|
|
118
192
|
cursor: pointer;
|
|
119
193
|
font-weight: bold;
|
|
120
|
-
font-size: ${((_props$styleProps18 = props.styleProps) === null || _props$styleProps18 === void 0 || (_props$styleProps18 = _props$styleProps18.customButtonStyleProps) === null || _props$styleProps18 === void 0 ? void 0 : _props$styleProps18.fontSize) ?? ((
|
|
121
|
-
font-family: ${((_props$styleProps19 = props.styleProps) === null || _props$styleProps19 === void 0 || (_props$styleProps19 = _props$styleProps19.customButtonStyleProps) === null || _props$styleProps19 === void 0 ? void 0 : _props$styleProps19.fontFamily) ?? ((
|
|
122
|
-
color: ${((_props$styleProps20 = props.styleProps) === null || _props$styleProps20 === void 0 || (_props$styleProps20 = _props$styleProps20.customButtonStyleProps) === null || _props$styleProps20 === void 0 ? void 0 : _props$styleProps20.color) ?? ((
|
|
123
|
-
background-color: ${((_props$styleProps21 = props.styleProps) === null || _props$styleProps21 === void 0 || (_props$styleProps21 = _props$styleProps21.customButtonStyleProps) === null || _props$styleProps21 === void 0 ? void 0 : _props$styleProps21.backgroundColor) ?? ((
|
|
194
|
+
font-size: ${((_props$styleProps18 = props.styleProps) === null || _props$styleProps18 === void 0 || (_props$styleProps18 = _props$styleProps18.customButtonStyleProps) === null || _props$styleProps18 === void 0 ? void 0 : _props$styleProps18.fontSize) ?? ((_defaultPreChatSurvey10 = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey10 === void 0 ? void 0 : _defaultPreChatSurvey10.fontSize)};
|
|
195
|
+
font-family: ${((_props$styleProps19 = props.styleProps) === null || _props$styleProps19 === void 0 || (_props$styleProps19 = _props$styleProps19.customButtonStyleProps) === null || _props$styleProps19 === void 0 ? void 0 : _props$styleProps19.fontFamily) ?? ((_defaultPreChatSurvey11 = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey11 === void 0 ? void 0 : _defaultPreChatSurvey11.fontFamily)};
|
|
196
|
+
color: ${((_props$styleProps20 = props.styleProps) === null || _props$styleProps20 === void 0 || (_props$styleProps20 = _props$styleProps20.customButtonStyleProps) === null || _props$styleProps20 === void 0 ? void 0 : _props$styleProps20.color) ?? ((_defaultPreChatSurvey12 = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey12 === void 0 ? void 0 : _defaultPreChatSurvey12.color)};
|
|
197
|
+
background-color: ${((_props$styleProps21 = props.styleProps) === null || _props$styleProps21 === void 0 || (_props$styleProps21 = _props$styleProps21.customButtonStyleProps) === null || _props$styleProps21 === void 0 ? void 0 : _props$styleProps21.backgroundColor) ?? ((_defaultPreChatSurvey13 = _defaultPreChatSurveyPaneStyles.defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey13 === void 0 ? void 0 : _defaultPreChatSurvey13.backgroundColor)};
|
|
124
198
|
}`), !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hidePreChatSurveyPane) && /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
125
199
|
id: elementId,
|
|
126
200
|
tabIndex: -1,
|
|
@@ -135,6 +209,9 @@ function PreChatSurveyPane(props) {
|
|
|
135
209
|
// Returns React element
|
|
136
210
|
renderedCard && n && n.appendChild(renderedCard);
|
|
137
211
|
n && n.childElementCount > 1 && n.lastChild && n.removeChild(n.lastChild); // Removes duplicates fix
|
|
212
|
+
if (isIOS && n) {
|
|
213
|
+
applyIOSPrechatFix(n);
|
|
214
|
+
}
|
|
138
215
|
}
|
|
139
216
|
}))));
|
|
140
217
|
}
|
|
@@ -5,5 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.defaultPreChatSurveyPaneMultichoiceInputStyles = void 0;
|
|
7
7
|
const defaultPreChatSurveyPaneMultichoiceInputStyles = exports.defaultPreChatSurveyPaneMultichoiceInputStyles = {
|
|
8
|
+
fontSize: "16px",
|
|
8
9
|
fontFamily: "Segoe UI, Helvetica Neue, sans-serif"
|
|
9
10
|
};
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.defaultPreChatSurveyPaneMultilineTextInputStyles = void 0;
|
|
7
7
|
const defaultPreChatSurveyPaneMultilineTextInputStyles = exports.defaultPreChatSurveyPaneMultilineTextInputStyles = {
|
|
8
|
+
fontSize: "16px",
|
|
8
9
|
height: "52px",
|
|
9
10
|
fontFamily: "Segoe UI, Helvetica Neue, sans-serif"
|
|
10
11
|
};
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.defaultPreChatSurveyPaneTextInputStyles = void 0;
|
|
7
7
|
const defaultPreChatSurveyPaneTextInputStyles = exports.defaultPreChatSurveyPaneTextInputStyles = {
|
|
8
|
+
fontSize: "16px",
|
|
8
9
|
height: "20px",
|
|
9
10
|
fontFamily: "Segoe UI, Helvetica Neue, sans-serif"
|
|
10
11
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -4,15 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
9
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
7
|
class EventQueue {
|
|
11
8
|
constructor(newMessage) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
this.queueing = false;
|
|
10
|
+
this.channelEventQueue = void 0;
|
|
11
|
+
this.queueingId = void 0;
|
|
12
|
+
this.newMessage = void 0;
|
|
16
13
|
this.channelEventQueue = new Map();
|
|
17
14
|
this.newMessage = newMessage;
|
|
18
15
|
}
|
|
@@ -44,6 +44,6 @@ export let ElementType = /*#__PURE__*/function (ElementType) {
|
|
|
44
44
|
export const Ids = (_Class3 = class Ids {}, _defineProperty(_Class3, "DefaultCallingContainerId", "lcw-calling-container"), _defineProperty(_Class3, "DefaultCurrentCallId", "lcw-current-call-container"), _defineProperty(_Class3, "CurrentCallActionGroupId", "lcw-current-call-action-icons"), _defineProperty(_Class3, "CurrentCallFooterId", "lcw-current-call-footer"), _defineProperty(_Class3, "RemoteVideoTileId", "lcw-remote-video"), _defineProperty(_Class3, "SelfVideoTileId", "lcw-self-video"), _defineProperty(_Class3, "VideoTileGroupId", "lcw-current-call-body"), _defineProperty(_Class3, "EndCallButtonId", "lcw-call-reject-button"), _defineProperty(_Class3, "MicButtonId", "lcw-toggle-audio"), _defineProperty(_Class3, "VideoButtonId", "lcw-toggle-video"), _defineProperty(_Class3, "CallTimerId", "lcw-current-call-timer"), _defineProperty(_Class3, "CurrentCallLeftGroupId", "lcw-current-call-left-group"), _defineProperty(_Class3, "CurrentCallMiddleGroupId", "lcw-current-call-middle-group"), _defineProperty(_Class3, "CurrentCallRightGroupId", "lcw-current-call-right-group"), _defineProperty(_Class3, "DefaultIncomingCallId", "lcw-incoming-call"), _defineProperty(_Class3, "DeclineCallButtonId", "lcw-call-reject-button"), _defineProperty(_Class3, "AudioCallButtonId", "lcw-call-accept-button"), _defineProperty(_Class3, "VideoCallButtonId", "lcw-video-call-accept-button"), _defineProperty(_Class3, "IncomingCallTitleId", "lcw-incoming-call-message"), _defineProperty(_Class3, "DefaultIncomingCallPopupId", "lcw-incoming-call-popup"), _defineProperty(_Class3, "IncomingCallLeftGroupId", "lcw-incoming-call-left-group"), _defineProperty(_Class3, "IncomingCallMiddleGroupId", "lcw-incoming-call-middle-group"), _defineProperty(_Class3, "IncomingCallRightGroupId", "lcw-incoming-call-right-group"), _defineProperty(_Class3, "DefaultChatButtonId", "lcw-components-chat-button"), _defineProperty(_Class3, "DefaultConfirmationPaneId", "lcw-components-confirmation-pane"), _defineProperty(_Class3, "CustomFooterId", "lcw-footer"), _defineProperty(_Class3, "DownloadTranscriptButtonId", "lcw-footer-download-transcript-button"), _defineProperty(_Class3, "EmailTranscriptButtonId", "lcw-footer-email-transcript-button"), _defineProperty(_Class3, "AudioNotificationButtonId", "lcw-footer-audio-notification-button"), _defineProperty(_Class3, "DefaultFooterId", "lcw-components-footer"), _defineProperty(_Class3, "FooterLeftGroupId", "lcw-footer-left-group"), _defineProperty(_Class3, "FooterMiddleGroupId", "lcw-footer-middle-group"), _defineProperty(_Class3, "FooterRightGroupId", "lcw-footer-right-group"), _defineProperty(_Class3, "DefaultHeaderId", "lcw-header"), _defineProperty(_Class3, "MinimizeButtonId", "lcw-header-minimize-button"), _defineProperty(_Class3, "CloseButtonId", "lcw-header-close-button"), _defineProperty(_Class3, "HeaderIconId", "lcw-header-icon"), _defineProperty(_Class3, "HeaderTitleId", "lcw-header-title"), _defineProperty(_Class3, "HeaderLeftGroupId", "lcw-header-left-group"), _defineProperty(_Class3, "HeaderMiddleGroupId", "lcw-header-middle-group"), _defineProperty(_Class3, "HeaderRightGroupId", "lcw-header-right-group"), _defineProperty(_Class3, "DefaultInputValidationPaneId", "lcw-email-transcript-dialog-container"), _defineProperty(_Class3, "DefaultInputValidationPaneInputId", "lcw-email-transcript-dialog-text-field"), _defineProperty(_Class3, "DefaultLoadingPaneId", "lcw-loading-pane"), _defineProperty(_Class3, "DefaultNotificationPaneId", "lcw-notification-pane"), _defineProperty(_Class3, "DefaultOOOHPaneId", "lcw-out-of-office-hours-pane"), _defineProperty(_Class3, "DefaultPostChatSurveyPaneId", "lcw-postchat-survey-pane"), _defineProperty(_Class3, "DefaultPreChatSurveyPaneId", "lcw-prechat-survey-pane-default"), _defineProperty(_Class3, "DefaultProactiveChatPaneId", "lcw-proactive-chat"), _defineProperty(_Class3, "DefaultReconnectChatPaneId", "lcw-reconnect-chat-pane"), _Class3);
|
|
45
45
|
export const ButtonTypes = (_Class4 = class ButtonTypes {}, _defineProperty(_Class4, "Icon", "icon"), _defineProperty(_Class4, "Text", "text"), _Class4);
|
|
46
46
|
export const IconNames = (_Class5 = class IconNames {}, _defineProperty(_Class5, "DeclineCall", "DeclineCall"), _defineProperty(_Class5, "Microphone", "Microphone"), _defineProperty(_Class5, "MicOff2", "MicOff2"), _defineProperty(_Class5, "Video", "Video"), _defineProperty(_Class5, "VideoOff", "VideoOff"), _defineProperty(_Class5, "IncomingCall", "IncomingCall"), _defineProperty(_Class5, "ChromeClose", "ChromeClose"), _defineProperty(_Class5, "Download", "Download"), _defineProperty(_Class5, "Mail", "Mail"), _defineProperty(_Class5, "Volume3", "Volume3"), _defineProperty(_Class5, "Volume0", "Volume0"), _defineProperty(_Class5, "ChromeMinimize", "ChromeMinimize"), _Class5);
|
|
47
|
-
export const AriaLabels = (_Class6 = class AriaLabels {}, _defineProperty(_Class6, "EndCall", "End Call"), _defineProperty(_Class6, "MicMute", "Mute"), _defineProperty(_Class6, "MicUnmute", "Unmute"), _defineProperty(_Class6, "VideoTurnCameraOn", "Turn camera on"), _defineProperty(_Class6, "VideoTurnCameraOff", "Turn camera off"), _defineProperty(_Class6, "IncomingCallArea", "Incoming call area"), _defineProperty(_Class6, "RejectCall", "Reject call"), _defineProperty(_Class6, "AcceptVoiceCall", "Accept voice call"), _defineProperty(_Class6, "AcceptVideoCall", "Accept video Call"), _defineProperty(_Class6, "DeclineCall", "Decline Call"), _defineProperty(_Class6, "AudioCall", "Audio Call"), _defineProperty(_Class6, "VideoCall", "Video Call"), _defineProperty(_Class6, "LetsChatWeAreOnline", "Let's chat we are online"), _defineProperty(_Class6, "UnreadMessageString", "you have new messages"), _defineProperty(_Class6, "Close", "Close"), _defineProperty(_Class6, "ConfirmationPaneConfirm", "Close Chat"), _defineProperty(_Class6, "ConfirmationPaneCancel", "Cancel. Return to Chat"), _defineProperty(_Class6, "DownloadChatTranscript", "Download chat transcript"), _defineProperty(_Class6, "EmailTranscript", "Email Transcript"), _defineProperty(_Class6, "TurnSoundOff", "Turn sound off"), _defineProperty(_Class6, "TurnSoundOn", "Turn sound on"), _defineProperty(_Class6, "Minimize", "Minimize"), _defineProperty(_Class6, "EmailChatTranscriptPane", "Email Chat Transcript Pane"), _defineProperty(_Class6, "InputValidationPaneInput", "Please provide e-mail address to send transcript. The transcript will be sent after the chat ends. Email address text area"), _defineProperty(_Class6, "Save", "Save"), _defineProperty(_Class6, "Cancel", "Cancel"), _defineProperty(_Class6, "ProactiveChatPane", "Proactive Chat Pane"), _defineProperty(_Class6, "ChatNow", "Chat Now"), _defineProperty(_Class6, "ReconnectChatPane", "Reconnect Chat Pane"), _defineProperty(_Class6, "ReconnectChatPaneIcon", "Reconnect Chat Pane Icon"), _defineProperty(_Class6, "ContinueConversation", "Continue conversation"), _defineProperty(_Class6, "StartNewConversation", "Start new conversation"), _Class6);
|
|
47
|
+
export const AriaLabels = (_Class6 = class AriaLabels {}, _defineProperty(_Class6, "EndCall", "End Call"), _defineProperty(_Class6, "MicMute", "Mute"), _defineProperty(_Class6, "MicUnmute", "Unmute"), _defineProperty(_Class6, "VideoTurnCameraOn", "Turn camera on"), _defineProperty(_Class6, "VideoTurnCameraOff", "Turn camera off"), _defineProperty(_Class6, "IncomingCallArea", "Incoming call area"), _defineProperty(_Class6, "RejectCall", "Reject call"), _defineProperty(_Class6, "AcceptVoiceCall", "Accept voice call"), _defineProperty(_Class6, "AcceptVideoCall", "Accept video Call"), _defineProperty(_Class6, "DeclineCall", "Decline Call"), _defineProperty(_Class6, "AudioCall", "Audio Call"), _defineProperty(_Class6, "VideoCall", "Video Call"), _defineProperty(_Class6, "LetsChatWeAreOnline", "Let's chat we are online"), _defineProperty(_Class6, "UnreadMessageString", "you have new messages"), _defineProperty(_Class6, "Close", "Close"), _defineProperty(_Class6, "ConfirmationPaneConfirm", "Close Chat"), _defineProperty(_Class6, "ConfirmationPaneCancel", "Cancel. Return to Chat"), _defineProperty(_Class6, "DownloadChatTranscript", "Download chat transcript"), _defineProperty(_Class6, "EmailTranscript", "Email Transcript"), _defineProperty(_Class6, "TurnSoundOff", "Turn sound off"), _defineProperty(_Class6, "TurnSoundOn", "Turn sound on"), _defineProperty(_Class6, "Minimize", "Minimize"), _defineProperty(_Class6, "EmailChatTranscriptPane", "Email Chat Transcript Pane"), _defineProperty(_Class6, "InputValidationPaneInput", "Please provide e-mail address to send transcript. The transcript will be sent after the chat ends. Email address text area"), _defineProperty(_Class6, "Save", "Save"), _defineProperty(_Class6, "Cancel", "Cancel"), _defineProperty(_Class6, "ProactiveChatPane", "Proactive Chat Pane"), _defineProperty(_Class6, "ChatNow", "Chat Now"), _defineProperty(_Class6, "ReconnectChatPane", "Reconnect Chat Pane"), _defineProperty(_Class6, "ReconnectChatPaneIcon", "Reconnect Chat Pane Icon"), _defineProperty(_Class6, "ContinueConversation", "Continue conversation"), _defineProperty(_Class6, "StartNewConversation", "Start new conversation"), _defineProperty(_Class6, "InputValidationPaneButtonGroup", "Actions"), _defineProperty(_Class6, "ConfirmationPaneButtonGroup", "Actions"), _Class6);
|
|
48
48
|
export const EventNames = (_Class7 = class EventNames {}, _defineProperty(_Class7, "OnClick", "OnClick"), _defineProperty(_Class7, "OnEscapeKeyDown", "OnEscapeKeyDown"), _defineProperty(_Class7, "IncomingCallEnded", "IncomingCallEnded"), _Class7);
|
|
49
49
|
export const Texts = (_Class8 = class Texts {}, _defineProperty(_Class8, "IncomingCallTitle", "Incoming Call"), _defineProperty(_Class8, "ChatButtonTitle", "Let's Chat!"), _defineProperty(_Class8, "ChatButtonSubtitle", "We're online."), _defineProperty(_Class8, "ChatButtonUnreadMessageString", "new messages"), _defineProperty(_Class8, "ChatButtonLargeUnreadMessageString", "99+"), _defineProperty(_Class8, "CloseButtonText", "Close"), _defineProperty(_Class8, "ConfirmationPaneTitle", "Close chat"), _defineProperty(_Class8, "ConfirmationPaneSubtitle", "Do you really want to close this chat?"), _defineProperty(_Class8, "ConfirmButtonText", "Close"), _defineProperty(_Class8, "EmailPlaceHolderText", "johnsmith@outlook.com"), _defineProperty(_Class8, "CancelButtonText", "Cancel"), _defineProperty(_Class8, "DownloadChatTranscriptText", "Download chat transcript"), _defineProperty(_Class8, "EmailTranscriptText", "Email Transcript"), _defineProperty(_Class8, "HeaderIcon", "Chat Icon"), _defineProperty(_Class8, "HeaderTitle", "Let's Chat"), _defineProperty(_Class8, "MinimizeText", "Minimize"), _defineProperty(_Class8, "InputValidationPaneTitleText", "Please provide e-mail address to send transcript."), _defineProperty(_Class8, "InputValidationPaneSubtitleText", "The transcript will be sent after the chat ends."), _defineProperty(_Class8, "InvalidInputErrorMessageText", "Enter a valid email address."), _defineProperty(_Class8, "SendButtonText", "Send"), _defineProperty(_Class8, "SaveButtonText", "Save"), _defineProperty(_Class8, "LoadingPaneTitleText", "Welcome to"), _defineProperty(_Class8, "LoadingPaneSubtitleText", "live chat support ..."), _defineProperty(_Class8, "LoadingPaneSpinnerText", "Loading ..."), _defineProperty(_Class8, "OOOHPaneTitleText", "Thanks for contacting us. You have reached us outside of our operating hours. An agent will respond when we open."), _defineProperty(_Class8, "PostChatSurveyPaneTitleText", "Post chat survey pane"), _defineProperty(_Class8, "ProactiveChatPaneTitleText", "Welcome to"), _defineProperty(_Class8, "ProactiveChatPaneSubtitleText", "Live chat support!"), _defineProperty(_Class8, "ProactiveChatPaneBodyTitleText", "Hi! Have any questions? I am here to help."), _defineProperty(_Class8, "ProactiveChatPaneStartButtonText", "Chat Now"), _defineProperty(_Class8, "ReconnectChatPaneTitleText", "Previous session detected"), _defineProperty(_Class8, "ReconnectChatPaneSubtitleText", "We have detected a previous chat session. Would you like to continue with your previous session?"), _defineProperty(_Class8, "ReconnectChatPaneContinueChatButtonText", "Continue conversation"), _defineProperty(_Class8, "ReconnectChatPaneStartNewChatButtonText", "Start new conversation"), _Class8);
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
2
8
|
import * as React from "react";
|
|
3
9
|
import { IconButton, Stack } from "@fluentui/react";
|
|
4
10
|
import { BroadcastService } from "../../../../services/BroadcastService";
|
|
@@ -95,9 +101,10 @@ function CurrentCall(props) {
|
|
|
95
101
|
}
|
|
96
102
|
}
|
|
97
103
|
};
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
104
|
+
const _useBoolean = useBoolean(false),
|
|
105
|
+
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
|
106
|
+
micState = _useBoolean2[0],
|
|
107
|
+
setMicState = _useBoolean2[1].toggle;
|
|
101
108
|
const endCallButtonProps = Object.assign({}, (_defaultCurrentCallPr31 = defaultCurrentCallProps.controlProps) === null || _defaultCurrentCallPr31 === void 0 ? void 0 : _defaultCurrentCallPr31.endCallButtonProps, (_props$controlProps35 = props.controlProps) === null || _props$controlProps35 === void 0 ? void 0 : _props$controlProps35.endCallButtonProps);
|
|
102
109
|
const callTimerProps = Object.assign({}, (_defaultCurrentCallPr32 = defaultCurrentCallProps.controlProps) === null || _defaultCurrentCallPr32 === void 0 ? void 0 : _defaultCurrentCallPr32.callTimerProps, (_props$controlProps36 = props.controlProps) === null || _props$controlProps36 === void 0 ? void 0 : _props$controlProps36.callTimerProps);
|
|
103
110
|
const endCallButtonStyles = Object.assign({}, (_defaultCurrentCallPr33 = defaultCurrentCallProps.styleProps) === null || _defaultCurrentCallPr33 === void 0 ? void 0 : _defaultCurrentCallPr33.endCallButtonStyleProps, (_props$styleProps2 = props.styleProps) === null || _props$styleProps2 === void 0 ? void 0 : _props$styleProps2.endCallButtonStyleProps);
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
1
7
|
import { Label } from "@fluentui/react";
|
|
2
8
|
import React, { useEffect, useState } from "react";
|
|
3
9
|
import { getHours, getMinutes, getSeconds } from "../../../../common/utils";
|
|
4
10
|
function Timer(props) {
|
|
5
|
-
const
|
|
11
|
+
const _useState = useState(0),
|
|
12
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
13
|
+
time = _useState2[0],
|
|
14
|
+
setTime = _useState2[1];
|
|
6
15
|
const running = true;
|
|
7
16
|
const timerStyles = {
|
|
8
17
|
root: props.timerStyles
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import "@testing-library/jest-dom/extend-expect";
|
|
3
|
+
import { cleanup, render } from "@testing-library/react";
|
|
4
|
+
import { BroadcastServiceInitialize } from "../../services/BroadcastService";
|
|
5
|
+
import ChatButton from "./ChatButton";
|
|
6
|
+
import LoadingPane from "../loadingpane/LoadingPane";
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { defaultChatButtonProps } from "./common/defaultProps/defaultChatButtonProps";
|
|
9
|
+
import { defaultLoadingPaneProps } from "../loadingpane/common/defaultProps/defaultLoadingPaneProps";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Repro / catcher for internal tracking — screen reader announces hidden / irrelevant
|
|
13
|
+
* text such as "blank" while navigating the chat surface. NVDA / JAWS announce
|
|
14
|
+
* "blank" when they encounter:
|
|
15
|
+
* - an element with an announceable role (button, link, textbox, listitem,
|
|
16
|
+
* progressbar, etc.) that has an empty accessible name (no aria-label, no
|
|
17
|
+
* aria-labelledby, no associated <label>, and no own text content), OR
|
|
18
|
+
* - a live region (`aria-live="polite"` / `aria-live="assertive"`) that is
|
|
19
|
+
* mounted with empty text content (each tick announces "blank").
|
|
20
|
+
*
|
|
21
|
+
* This catcher walks several rendered LCW surfaces and asserts neither pattern
|
|
22
|
+
* is present. Deterministic DOM contract — no SR needed.
|
|
23
|
+
*
|
|
24
|
+
* Surfaces covered today:
|
|
25
|
+
* - ChatButton (default props) — regression guard; passes today.
|
|
26
|
+
* - ChatButton with notification bubble forced visible at unreadCount=0 —
|
|
27
|
+
* regression guard for the empty-live-region path; passes today.
|
|
28
|
+
* - LoadingPane (default props) — regression guard; passes today.
|
|
29
|
+
*
|
|
30
|
+
* Scope note: the original bug surfaces inside WebChat-rendered chat session
|
|
31
|
+
* content (message bubbles, attachments, agent-supplied HTML), which is not
|
|
32
|
+
* reachable from chat-components unit tests. The Playwright catcher
|
|
33
|
+
* `automation_tests/e2e/areas/accessibility/blankAnnouncements.spec.ts` on
|
|
34
|
+
* `chore/a11y-tooling-foundation` walks the full a11y tree of a built
|
|
35
|
+
* `dist/out.js` and is the right vehicle for enumerating per-offender fixes.
|
|
36
|
+
* Promote additional surfaces here as they are wired into the catcher harness.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
beforeAll(() => {
|
|
40
|
+
BroadcastServiceInitialize("testChannel");
|
|
41
|
+
});
|
|
42
|
+
afterEach(() => {
|
|
43
|
+
cleanup();
|
|
44
|
+
});
|
|
45
|
+
const ANNOUNCEABLE_ROLES = new Set(["button", "link", "textbox", "combobox", "listbox", "listitem", "menu", "menuitem", "checkbox", "radio", "switch", "tab", "treeitem", "option", "searchbox", "progressbar", "alert", "status"]);
|
|
46
|
+
const ANNOUNCEABLE_TAGS = new Set(["button", "a", "input", "select", "textarea"]);
|
|
47
|
+
const isInsideAriaHidden = el => {
|
|
48
|
+
let cursor = el;
|
|
49
|
+
while (cursor) {
|
|
50
|
+
if (cursor.getAttribute("aria-hidden") === "true") return true;
|
|
51
|
+
cursor = cursor.parentElement;
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
};
|
|
55
|
+
const accessibleNameOf = el => {
|
|
56
|
+
const ariaLabel = (el.getAttribute("aria-label") || "").trim();
|
|
57
|
+
if (ariaLabel) return ariaLabel;
|
|
58
|
+
const labelledBy = (el.getAttribute("aria-labelledby") || "").trim();
|
|
59
|
+
if (labelledBy) {
|
|
60
|
+
const referenced = labelledBy.split(/\s+/).map(id => {
|
|
61
|
+
var _document$getElementB;
|
|
62
|
+
return ((_document$getElementB = document.getElementById(id)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.textContent) || "";
|
|
63
|
+
}).join(" ").trim();
|
|
64
|
+
if (referenced) return referenced;
|
|
65
|
+
}
|
|
66
|
+
if (el.tagName.toLowerCase() === "input") {
|
|
67
|
+
const id = el.id;
|
|
68
|
+
if (id) {
|
|
69
|
+
var _label$textContent;
|
|
70
|
+
const label = document.querySelector(`label[for="${CSS.escape(id)}"]`);
|
|
71
|
+
const labelText = label === null || label === void 0 || (_label$textContent = label.textContent) === null || _label$textContent === void 0 ? void 0 : _label$textContent.trim();
|
|
72
|
+
if (labelText) return labelText;
|
|
73
|
+
}
|
|
74
|
+
const placeholder = (el.getAttribute("placeholder") || "").trim();
|
|
75
|
+
if (placeholder) return placeholder;
|
|
76
|
+
}
|
|
77
|
+
if (el.tagName.toLowerCase() === "a") {
|
|
78
|
+
const title = (el.getAttribute("title") || "").trim();
|
|
79
|
+
if (title) return title;
|
|
80
|
+
}
|
|
81
|
+
return (el.textContent || "").trim();
|
|
82
|
+
};
|
|
83
|
+
const isAnnounceable = el => {
|
|
84
|
+
if (isInsideAriaHidden(el)) return false;
|
|
85
|
+
const role = (el.getAttribute("role") || "").toLowerCase();
|
|
86
|
+
if (role === "presentation" || role === "none") return false;
|
|
87
|
+
if (role && ANNOUNCEABLE_ROLES.has(role)) return true;
|
|
88
|
+
if (ANNOUNCEABLE_TAGS.has(el.tagName.toLowerCase())) {
|
|
89
|
+
// <input type="hidden"> is not announceable.
|
|
90
|
+
if (el.tagName.toLowerCase() === "input" && (el.getAttribute("type") || "").toLowerCase() === "hidden") {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
return false;
|
|
96
|
+
};
|
|
97
|
+
const findEmptyAnnounceable = root => {
|
|
98
|
+
return Array.from(root.querySelectorAll("*")).filter(el => isAnnounceable(el) && accessibleNameOf(el) === "");
|
|
99
|
+
};
|
|
100
|
+
const findEmptyLiveRegions = root => {
|
|
101
|
+
return Array.from(root.querySelectorAll("[aria-live]")).filter(el => {
|
|
102
|
+
if (isInsideAriaHidden(el)) return false;
|
|
103
|
+
const live = (el.getAttribute("aria-live") || "").toLowerCase();
|
|
104
|
+
if (live !== "polite" && live !== "assertive") return false;
|
|
105
|
+
return (el.textContent || "").trim() === "";
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
const summarize = offenders => offenders.map(el => ({
|
|
109
|
+
tag: el.tagName.toLowerCase(),
|
|
110
|
+
id: el.id,
|
|
111
|
+
role: el.getAttribute("role"),
|
|
112
|
+
ariaLabel: el.getAttribute("aria-label"),
|
|
113
|
+
ariaLabelledBy: el.getAttribute("aria-labelledby"),
|
|
114
|
+
classes: el.className
|
|
115
|
+
}));
|
|
116
|
+
describe("ChatButton — 'blank' / empty-name announcements (internal tracking regression guard)", () => {
|
|
117
|
+
it("no announceable role/tag in the chat-button subtree may have an empty accessible name", () => {
|
|
118
|
+
const _render = render(/*#__PURE__*/React.createElement(ChatButton, defaultChatButtonProps)),
|
|
119
|
+
container = _render.container;
|
|
120
|
+
const button = container.firstElementChild;
|
|
121
|
+
expect(button).not.toBeNull();
|
|
122
|
+
expect(summarize(findEmptyAnnounceable(button))).toEqual([]);
|
|
123
|
+
});
|
|
124
|
+
it("no live region (aria-live=polite/assertive) in the chat-button subtree may be mounted with empty text", () => {
|
|
125
|
+
const props = {
|
|
126
|
+
...defaultChatButtonProps,
|
|
127
|
+
controlProps: {
|
|
128
|
+
...defaultChatButtonProps.controlProps,
|
|
129
|
+
unreadMessageCount: "0",
|
|
130
|
+
hideNotificationBubble: false
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const _render2 = render(/*#__PURE__*/React.createElement(ChatButton, props)),
|
|
134
|
+
container = _render2.container;
|
|
135
|
+
const button = container.firstElementChild;
|
|
136
|
+
expect(button).not.toBeNull();
|
|
137
|
+
expect(summarize(findEmptyLiveRegions(button))).toEqual([]);
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
describe("LoadingPane — 'blank' / empty-name announcements (internal tracking regression guard)", () => {
|
|
141
|
+
it("no announceable role/tag in the loading-pane subtree may have an empty accessible name", () => {
|
|
142
|
+
const _render3 = render(/*#__PURE__*/React.createElement(LoadingPane, defaultLoadingPaneProps)),
|
|
143
|
+
container = _render3.container;
|
|
144
|
+
const pane = container.firstElementChild;
|
|
145
|
+
expect(pane).not.toBeNull();
|
|
146
|
+
expect(summarize(findEmptyAnnounceable(pane))).toEqual([]);
|
|
147
|
+
});
|
|
148
|
+
it("no live region (aria-live=polite/assertive) in the loading-pane subtree may be mounted with empty text", () => {
|
|
149
|
+
const _render4 = render(/*#__PURE__*/React.createElement(LoadingPane, defaultLoadingPaneProps)),
|
|
150
|
+
container = _render4.container;
|
|
151
|
+
const pane = container.firstElementChild;
|
|
152
|
+
expect(pane).not.toBeNull();
|
|
153
|
+
expect(summarize(findEmptyLiveRegions(pane))).toEqual([]);
|
|
154
|
+
});
|
|
155
|
+
});
|