callix-dialer-widget 1.2.6 → 1.3.0
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.
|
@@ -54136,7 +54136,7 @@ function AuthenticatedDialer({ username, dialValue, setDialValue, onLogout, vari
|
|
|
54136
54136
|
}
|
|
54137
54137
|
}, [goOffBreak]);
|
|
54138
54138
|
useEffect(() => {
|
|
54139
|
-
if (!isDialerFocused) {
|
|
54139
|
+
if (!isMiniMode && !isDialerFocused) {
|
|
54140
54140
|
return;
|
|
54141
54141
|
}
|
|
54142
54142
|
const handleKeyDown = (event2) => {
|
|
@@ -54190,7 +54190,7 @@ function AuthenticatedDialer({ username, dialValue, setDialValue, onLogout, vari
|
|
|
54190
54190
|
return () => {
|
|
54191
54191
|
window.removeEventListener("keydown", handleKeyDown);
|
|
54192
54192
|
};
|
|
54193
|
-
}, [isDialerFocused, handleBackspace, handleClear, handleDial, handleCall, isIdle]);
|
|
54193
|
+
}, [isMiniMode, isDialerFocused, handleBackspace, handleClear, handleDial, handleCall, isIdle]);
|
|
54194
54194
|
const handleHangup = useCallback(async () => {
|
|
54195
54195
|
try {
|
|
54196
54196
|
await hangup();
|
|
@@ -54372,6 +54372,91 @@ function AuthenticatedDialer({ username, dialValue, setDialValue, onLogout, vari
|
|
|
54372
54372
|
callState,
|
|
54373
54373
|
operatorState: operatorState == null ? void 0 : operatorState.state
|
|
54374
54374
|
});
|
|
54375
|
+
if (callState === "afterCall") {
|
|
54376
|
+
const options = afterCallResult === "success" ? successQualifications : discardQualifications;
|
|
54377
|
+
const hasOptions = options.length > 0;
|
|
54378
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
54379
|
+
"div",
|
|
54380
|
+
{
|
|
54381
|
+
className: ["callix", "mode", "min", tw`flex w-full max-w-full flex-col gap-3 rounded-2xl border border-slate-200 bg-white/95 p-3 shadow-sm text-slate-800`].join(" "),
|
|
54382
|
+
"data-callix-variant": "min",
|
|
54383
|
+
children: [
|
|
54384
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`text-center space-y-1`, children: [
|
|
54385
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[10px] uppercase tracking-wide text-slate-500`, children: "Logado como" }),
|
|
54386
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-sm font-semibold text-slate-800`, children: username })
|
|
54387
|
+
] }),
|
|
54388
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`space-y-3 rounded-xl border border-slate-200 bg-slate-50 px-3 py-3`, children: [
|
|
54389
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
54390
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-xs font-semibold text-slate-700`, children: "Qualifique a chamada" }),
|
|
54391
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[10px] text-slate-500`, children: "Esta etapa e obrigatoria para registrar o desfecho do atendimento." })
|
|
54392
|
+
] }),
|
|
54393
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`grid grid-cols-2 gap-1.5`, children: [
|
|
54394
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
54395
|
+
"button",
|
|
54396
|
+
{
|
|
54397
|
+
type: "button",
|
|
54398
|
+
onClick: () => setAfterCallResult("success"),
|
|
54399
|
+
className: tw`${afterCallResult === "success" ? "bg-emerald-500 text-white shadow-md" : "bg-white text-slate-600"} rounded-lg border border-slate-200 px-2 py-1.5 text-[10px] font-semibold transition`,
|
|
54400
|
+
children: "Atendimento concluido"
|
|
54401
|
+
}
|
|
54402
|
+
),
|
|
54403
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
54404
|
+
"button",
|
|
54405
|
+
{
|
|
54406
|
+
type: "button",
|
|
54407
|
+
onClick: () => setAfterCallResult("failure"),
|
|
54408
|
+
className: tw`${afterCallResult === "failure" ? "bg-rose-500 text-white shadow-md" : "bg-white text-slate-600"} rounded-lg border border-slate-200 px-2 py-1.5 text-[10px] font-semibold transition`,
|
|
54409
|
+
children: "Atendimento descartado"
|
|
54410
|
+
}
|
|
54411
|
+
)
|
|
54412
|
+
] }),
|
|
54413
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`space-y-1.5`, children: [
|
|
54414
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[10px] font-medium text-slate-700`, children: "Selecione uma qualificacao" }),
|
|
54415
|
+
hasOptions ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: tw`max-h-40 space-y-1.5 overflow-y-auto pr-0.5`, children: options.map((qualification) => {
|
|
54416
|
+
const isSelected = selectedQualificationId === qualification.id;
|
|
54417
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
54418
|
+
"button",
|
|
54419
|
+
{
|
|
54420
|
+
type: "button",
|
|
54421
|
+
onClick: () => setSelectedQualificationId(qualification.id),
|
|
54422
|
+
className: tw`${isSelected ? "ring-1 ring-primary bg-primary/10 border-primary" : "border-slate-200 bg-white"} w-full rounded-lg border px-2 py-1.5 text-left transition`,
|
|
54423
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[11px] font-semibold text-slate-800`, children: qualification.name })
|
|
54424
|
+
},
|
|
54425
|
+
qualification.id
|
|
54426
|
+
);
|
|
54427
|
+
}) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: tw`rounded-lg border border-amber-200 bg-amber-50 px-2 py-1.5 text-[10px] text-amber-700`, children: "Nenhuma qualificacao disponivel." })
|
|
54428
|
+
] }),
|
|
54429
|
+
afterCallError && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[10px] text-red-500`, children: afterCallError }),
|
|
54430
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
54431
|
+
"button",
|
|
54432
|
+
{
|
|
54433
|
+
type: "button",
|
|
54434
|
+
onClick: handleFinishAfterCall,
|
|
54435
|
+
disabled: !hasOptions || !selectedQualificationId || isSubmittingAfterCall,
|
|
54436
|
+
className: tw`flex w-full items-center justify-center gap-1.5 rounded-lg bg-primary px-3 py-2 text-[11px] font-bold text-white shadow-md transition disabled:cursor-not-allowed disabled:opacity-60`,
|
|
54437
|
+
children: [
|
|
54438
|
+
isSubmittingAfterCall && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: tw`inline-flex h-3 w-3 animate-spin rounded-full border-2 border-white/40 border-t-white` }),
|
|
54439
|
+
"Finalizar atendimento"
|
|
54440
|
+
]
|
|
54441
|
+
}
|
|
54442
|
+
)
|
|
54443
|
+
] }),
|
|
54444
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
54445
|
+
"button",
|
|
54446
|
+
{
|
|
54447
|
+
type: "button",
|
|
54448
|
+
onClick: onLogout,
|
|
54449
|
+
className: tw`flex w-full items-center justify-center gap-1.5 rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-[11px] font-semibold text-slate-600 transition hover:text-red-500`,
|
|
54450
|
+
children: [
|
|
54451
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FiLogOut, { className: tw`text-xs` }),
|
|
54452
|
+
"Sair"
|
|
54453
|
+
]
|
|
54454
|
+
}
|
|
54455
|
+
)
|
|
54456
|
+
]
|
|
54457
|
+
}
|
|
54458
|
+
);
|
|
54459
|
+
}
|
|
54375
54460
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
54376
54461
|
"div",
|
|
54377
54462
|
{
|
|
@@ -54407,10 +54492,20 @@ function AuthenticatedDialer({ username, dialValue, setDialValue, onLogout, vari
|
|
|
54407
54492
|
}
|
|
54408
54493
|
)
|
|
54409
54494
|
] }),
|
|
54410
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
54495
|
+
isCallActive ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: tw`rounded-xl border border-emerald-200 bg-gradient-to-br from-emerald-50 to-white px-3 py-2`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`flex items-center gap-2`, children: [
|
|
54496
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: tw`flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-emerald-500 ${callDurationSeconds > 0 ? "animate-pulse" : ""}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FiPhoneCall, { className: tw`text-xs text-white` }) }),
|
|
54497
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`flex min-w-0 flex-1 flex-col gap-0.5`, children: [
|
|
54498
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: tw`truncate font-mono text-sm font-bold text-slate-800`, children: (callTarget == null ? void 0 : callTarget.replace(/^\+55/, "")) || "Conectando..." }),
|
|
54499
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: tw`text-[9px] font-medium uppercase tracking-wider text-emerald-600`, children: statusLabel })
|
|
54500
|
+
] }),
|
|
54501
|
+
callDurationSeconds > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`flex shrink-0 items-center gap-1 rounded-lg bg-emerald-500 px-2 py-1`, children: [
|
|
54502
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FiClock, { className: tw`text-[10px] text-white` }),
|
|
54503
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: tw`tabular-nums text-xs font-bold text-white`, children: formatDuration(callDurationSeconds) })
|
|
54504
|
+
] })
|
|
54505
|
+
] }) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`space-y-1 rounded-xl border border-slate-200 bg-slate-50 px-3 py-2`, children: [
|
|
54411
54506
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: tw`text-[10px] font-semibold uppercase tracking-wide text-slate-500`, children: "Numero" }),
|
|
54412
54507
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`flex items-center gap-2`, children: [
|
|
54413
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: tw`flex-1 truncate text-
|
|
54508
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: tw`flex-1 truncate text-sm font-semibold text-slate-800`, children: dialDisplayText || /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: tw`text-slate-400 text-xs font-normal`, children: "Digite um numero" }) }),
|
|
54414
54509
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
54415
54510
|
"button",
|
|
54416
54511
|
{
|
|
@@ -55202,6 +55297,15 @@ function InlineDialer({ variant = "default", ...props }) {
|
|
|
55202
55297
|
box-sizing: border-box !important;
|
|
55203
55298
|
}
|
|
55204
55299
|
|
|
55300
|
+
/* Visor de número - fonte menor para caber todos os dígitos */
|
|
55301
|
+
.callix.mode.min [class*="truncate"] {
|
|
55302
|
+
font-size: 0.875rem !important; /* text-sm */
|
|
55303
|
+
line-height: 1.25rem !important;
|
|
55304
|
+
overflow: hidden !important;
|
|
55305
|
+
text-overflow: ellipsis !important;
|
|
55306
|
+
white-space: nowrap !important;
|
|
55307
|
+
}
|
|
55308
|
+
|
|
55205
55309
|
/* Botões do modo mini */
|
|
55206
55310
|
.callix.mode.min button {
|
|
55207
55311
|
cursor: pointer !important;
|