callix-dialer-widget 1.4.6 → 1.4.7
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.
|
@@ -56099,7 +56099,18 @@ function DraggableQualificationModal({
|
|
|
56099
56099
|
}
|
|
56100
56100
|
function InlineDialer({ variant = "default", isAuthenticated, ...props }) {
|
|
56101
56101
|
const isMiniMode = variant === "min";
|
|
56102
|
-
|
|
56102
|
+
if (!isAuthenticated || !isMiniMode) {
|
|
56103
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(FloatingDialer, { variant, isAuthenticated, ...props });
|
|
56104
|
+
}
|
|
56105
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(AuthenticatedMiniDialer, { ...props });
|
|
56106
|
+
}
|
|
56107
|
+
function AuthenticatedMiniDialer({
|
|
56108
|
+
username,
|
|
56109
|
+
onLogin,
|
|
56110
|
+
onLogout,
|
|
56111
|
+
isLoadingSession,
|
|
56112
|
+
sessionError
|
|
56113
|
+
}) {
|
|
56103
56114
|
const { skipManualQualification } = useDialerConfig();
|
|
56104
56115
|
const operatorState = clientSdkReactExports.useCallOperatorState();
|
|
56105
56116
|
const currentCall = clientSdkReactExports.useCallOperatorCurrentCall();
|
|
@@ -56121,25 +56132,21 @@ function InlineDialer({ variant = "default", isAuthenticated, ...props }) {
|
|
|
56121
56132
|
const isIncomingCall = (currentCall == null ? void 0 : currentCall.direction) === "incoming";
|
|
56122
56133
|
const isAfterCall = callState === "afterCall";
|
|
56123
56134
|
useEffect(() => {
|
|
56124
|
-
if (!
|
|
56125
|
-
|
|
56126
|
-
setCallDurationSeconds(0);
|
|
56127
|
-
}
|
|
56135
|
+
if (!isInCall) {
|
|
56136
|
+
setCallDurationSeconds(0);
|
|
56128
56137
|
return;
|
|
56129
56138
|
}
|
|
56130
56139
|
const interval = setInterval(() => {
|
|
56131
56140
|
setCallDurationSeconds((prev) => prev + 1);
|
|
56132
56141
|
}, 1e3);
|
|
56133
56142
|
return () => clearInterval(interval);
|
|
56134
|
-
}, [
|
|
56143
|
+
}, [isInCall]);
|
|
56135
56144
|
useEffect(() => {
|
|
56136
|
-
if (!shouldUseMiniMode) return;
|
|
56137
56145
|
if ((isInCall || isConnecting) && isIncomingCall && (currentCallInfo == null ? void 0 : currentCallInfo.type) === "campaign") {
|
|
56138
56146
|
setIsClientInfoModalOpen(true);
|
|
56139
56147
|
}
|
|
56140
|
-
}, [
|
|
56148
|
+
}, [isInCall, isConnecting, isIncomingCall, currentCallInfo]);
|
|
56141
56149
|
useEffect(() => {
|
|
56142
|
-
if (!shouldUseMiniMode) return;
|
|
56143
56150
|
if (isAfterCall) {
|
|
56144
56151
|
const shouldSkipCampaignQualification = (currentCallInfo == null ? void 0 : currentCallInfo.type) === "campaign" && currentCallInfo.info.campaign.skipCallQualification === true;
|
|
56145
56152
|
if (shouldSkipCampaignQualification && finishAfterCall) {
|
|
@@ -56171,13 +56178,12 @@ function InlineDialer({ variant = "default", isAuthenticated, ...props }) {
|
|
|
56171
56178
|
} else {
|
|
56172
56179
|
setIsQualificationModalOpen(false);
|
|
56173
56180
|
}
|
|
56174
|
-
}, [
|
|
56181
|
+
}, [isAfterCall, currentCallInfo, finishAfterCall, successQualifications, discardQualifications, skipManualQualification]);
|
|
56175
56182
|
useEffect(() => {
|
|
56176
|
-
if (!shouldUseMiniMode) return;
|
|
56177
56183
|
if (!isInCall && !isConnecting && !isAfterCall) {
|
|
56178
56184
|
setIsClientInfoModalOpen(false);
|
|
56179
56185
|
}
|
|
56180
|
-
}, [
|
|
56186
|
+
}, [isInCall, isConnecting, isAfterCall]);
|
|
56181
56187
|
const campaignCallInfo = useMemo(() => {
|
|
56182
56188
|
if (!currentCallInfo || currentCallInfo.type !== "campaign") {
|
|
56183
56189
|
return null;
|
|
@@ -56215,9 +56221,6 @@ function InlineDialer({ variant = "default", isAuthenticated, ...props }) {
|
|
|
56215
56221
|
setIsSubmittingAfterCall(false);
|
|
56216
56222
|
}
|
|
56217
56223
|
};
|
|
56218
|
-
if (!shouldUseMiniMode) {
|
|
56219
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(FloatingDialer, { variant, isAuthenticated, ...props });
|
|
56220
|
-
}
|
|
56221
56224
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
56222
56225
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
56223
56226
|
"style",
|
|
@@ -56339,34 +56342,31 @@ function InlineDialer({ variant = "default", isAuthenticated, ...props }) {
|
|
|
56339
56342
|
}
|
|
56340
56343
|
}
|
|
56341
56344
|
),
|
|
56342
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
56343
|
-
|
|
56344
|
-
|
|
56345
|
-
|
|
56346
|
-
|
|
56347
|
-
|
|
56348
|
-
|
|
56349
|
-
|
|
56350
|
-
|
|
56351
|
-
|
|
56352
|
-
|
|
56353
|
-
|
|
56354
|
-
|
|
56355
|
-
|
|
56356
|
-
|
|
56357
|
-
|
|
56358
|
-
|
|
56359
|
-
|
|
56360
|
-
|
|
56361
|
-
|
|
56362
|
-
|
|
56363
|
-
|
|
56364
|
-
|
|
56365
|
-
|
|
56366
|
-
|
|
56367
|
-
}
|
|
56368
|
-
)
|
|
56369
|
-
] })
|
|
56345
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
56346
|
+
DraggableClientInfoModal,
|
|
56347
|
+
{
|
|
56348
|
+
isOpen: isClientInfoModalOpen,
|
|
56349
|
+
campaignCallInfo,
|
|
56350
|
+
callDuration: callDurationSeconds,
|
|
56351
|
+
isCallActive: isInCall || isConnecting,
|
|
56352
|
+
onClose: () => setIsClientInfoModalOpen(false)
|
|
56353
|
+
}
|
|
56354
|
+
),
|
|
56355
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
56356
|
+
DraggableQualificationModal,
|
|
56357
|
+
{
|
|
56358
|
+
isOpen: isQualificationModalOpen,
|
|
56359
|
+
result: afterCallResult,
|
|
56360
|
+
onChangeResult: setAfterCallResult,
|
|
56361
|
+
successQualifications,
|
|
56362
|
+
discardQualifications,
|
|
56363
|
+
selectedQualificationId,
|
|
56364
|
+
onSelectQualification: setSelectedQualificationId,
|
|
56365
|
+
onSubmit: handleFinishAfterCall,
|
|
56366
|
+
isSubmitting: isSubmittingAfterCall,
|
|
56367
|
+
errorMessage: afterCallError
|
|
56368
|
+
}
|
|
56369
|
+
)
|
|
56370
56370
|
] });
|
|
56371
56371
|
}
|
|
56372
56372
|
const DialerConfigContext = createContext(null);
|