callix-dialer-widget 1.3.1 → 1.3.2

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.
@@ -53813,16 +53813,32 @@ function AuthenticatedDialer({ username, dialValue, setDialValue, onLogout, vari
53813
53813
  }, []);
53814
53814
  useEffect(() => {
53815
53815
  if (!currentCall || callState !== "callInProgress") {
53816
+ if (callDurationSeconds > 0) {
53817
+ console.log("[FloatingDialer] ⏱️ Timer resetado (chamada não está em progresso)");
53818
+ }
53816
53819
  setCallDurationSeconds(0);
53817
53820
  setNetworkMetric(INITIAL_NETWORK_METRIC);
53818
53821
  setAudioMetric(INITIAL_AUDIO_METRIC);
53819
53822
  return;
53820
53823
  }
53821
- setCallDurationSeconds(Math.floor(currentCall.currentDurationSeconds ?? 0));
53824
+ const initialDuration = Math.floor(currentCall.currentDurationSeconds ?? 0);
53825
+ setCallDurationSeconds(initialDuration);
53826
+ console.log("[FloatingDialer] ⏱️ Timer iniciado:", {
53827
+ initialDuration,
53828
+ currentDurationSeconds: currentCall.currentDurationSeconds,
53829
+ callState
53830
+ });
53822
53831
  const timer = window.setInterval(() => {
53823
- setCallDurationSeconds(Math.floor(currentCall.currentDurationSeconds ?? 0));
53832
+ const duration = Math.floor(currentCall.currentDurationSeconds ?? 0);
53833
+ setCallDurationSeconds(duration);
53834
+ if (duration % 5 === 0 && duration > 0) {
53835
+ console.log("[FloatingDialer] ⏱️ Timer atualizado:", duration, "segundos");
53836
+ }
53824
53837
  }, 1e3);
53825
- return () => window.clearInterval(timer);
53838
+ return () => {
53839
+ console.log("[FloatingDialer] ⏱️ Timer parado");
53840
+ window.clearInterval(timer);
53841
+ };
53826
53842
  }, [currentCall, callState]);
53827
53843
  useEffect(() => {
53828
53844
  if (!currentCall || callState !== "callInProgress") {
@@ -54375,88 +54391,90 @@ function AuthenticatedDialer({ username, dialValue, setDialValue, onLogout, vari
54375
54391
  if (callState === "afterCall") {
54376
54392
  const options = afterCallResult === "success" ? successQualifications : discardQualifications;
54377
54393
  const hasOptions = options.length > 0;
54378
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
54394
+ console.log("[FloatingDialer Mini] 🎯 TELA DE QUALIFICAÇÃO:", {
54395
+ callState,
54396
+ afterCallResult,
54397
+ successQualifications: successQualifications.length,
54398
+ discardQualifications: discardQualifications.length,
54399
+ hasOptions,
54400
+ selectedQualificationId
54401
+ });
54402
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
54379
54403
  "div",
54380
54404
  {
54381
54405
  className: ["callix", "mode", "min", tw`flex w-full max-w-full flex-col gap-2 rounded-2xl border border-slate-200 bg-white/95 p-2.5 shadow-sm text-slate-800`].join(" "),
54382
54406
  "data-callix-variant": "min",
54383
- children: [
54384
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`text-center space-y-0.5`, children: [
54385
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[9px] uppercase tracking-wide text-slate-500`, children: "Logado como" }),
54386
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-xs font-semibold text-slate-800`, children: username })
54407
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`space-y-2 rounded-xl border border-slate-200 bg-slate-50 px-2.5 py-2`, children: [
54408
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
54409
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[11px] font-semibold text-slate-700`, children: "Qualifique a chamada" }),
54410
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[9px] text-slate-500`, children: "Esta etapa e obrigatoria." })
54387
54411
  ] }),
54388
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`space-y-2 rounded-xl border border-slate-200 bg-slate-50 px-2.5 py-2`, children: [
54389
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
54390
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[11px] font-semibold text-slate-700`, children: "Qualifique a chamada" }),
54391
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[9px] text-slate-500`, children: "Esta etapa e obrigatoria." })
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 text-[9px] 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 text-[9px] font-semibold transition`,
54409
- children: "Atendimento descartado"
54410
- }
54411
- )
54412
- ] }),
54413
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`space-y-1`, children: [
54414
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[9px] font-medium text-slate-700`, children: "Selecione uma qualificacao" }),
54415
- hasOptions ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: tw`max-h-32 space-y-1 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 text-left transition`,
54423
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[10px] font-semibold text-slate-800 leading-tight`, 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 text-[9px] text-amber-700`, children: "Nenhuma qualificacao disponivel." })
54428
- ] }),
54429
- afterCallError && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[9px] text-red-500`, children: afterCallError }),
54430
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
54412
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`grid grid-cols-2 gap-1.5`, children: [
54413
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
54431
54414
  "button",
54432
54415
  {
54433
54416
  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-1.5 text-[10px] 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
- ]
54417
+ onClick: () => setAfterCallResult("success"),
54418
+ 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 text-[9px] font-semibold transition`,
54419
+ children: "Atendimento concluido"
54420
+ }
54421
+ ),
54422
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
54423
+ "button",
54424
+ {
54425
+ type: "button",
54426
+ onClick: () => setAfterCallResult("failure"),
54427
+ 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 text-[9px] font-semibold transition`,
54428
+ children: "Atendimento descartado"
54441
54429
  }
54442
54430
  )
54443
54431
  ] }),
54432
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: tw`space-y-1`, children: [
54433
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[9px] font-medium text-slate-700`, children: "Selecione uma qualificacao" }),
54434
+ hasOptions ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: tw`max-h-32 space-y-1 overflow-y-auto pr-0.5`, children: options.map((qualification) => {
54435
+ const isSelected = selectedQualificationId === qualification.id;
54436
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
54437
+ "button",
54438
+ {
54439
+ type: "button",
54440
+ onClick: () => setSelectedQualificationId(qualification.id),
54441
+ 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 text-left transition`,
54442
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[10px] font-semibold text-slate-800 leading-tight`, children: qualification.name })
54443
+ },
54444
+ qualification.id
54445
+ );
54446
+ }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: tw`rounded-lg border border-amber-200 bg-amber-50 px-2 py-1 text-[9px] text-amber-700`, children: "Nenhuma qualificacao disponivel." })
54447
+ ] }),
54448
+ afterCallError && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: tw`text-[9px] text-red-500`, children: afterCallError }),
54444
54449
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
54445
54450
  "button",
54446
54451
  {
54447
54452
  type: "button",
54448
- onClick: onLogout,
54449
- className: tw`flex w-full items-center justify-center gap-1 rounded-lg border border-slate-200 bg-white px-3 py-1 text-[10px] font-semibold text-slate-600 transition hover:text-red-500`,
54453
+ onClick: handleFinishAfterCall,
54454
+ disabled: !hasOptions || !selectedQualificationId || isSubmittingAfterCall,
54455
+ className: tw`flex w-full items-center justify-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-[10px] font-bold text-white shadow-md transition disabled:cursor-not-allowed disabled:opacity-60`,
54450
54456
  children: [
54451
- /* @__PURE__ */ jsxRuntimeExports.jsx(FiLogOut, { className: tw`text-[10px]` }),
54452
- "Sair"
54457
+ 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` }),
54458
+ "Finalizar atendimento"
54453
54459
  ]
54454
54460
  }
54455
54461
  )
54456
- ]
54462
+ ] })
54457
54463
  }
54458
54464
  );
54459
54465
  }
54466
+ console.log("[FloatingDialer Mini] 📞 Estado da Chamada:", {
54467
+ isCallActive,
54468
+ callState,
54469
+ statusLabel,
54470
+ isInCall,
54471
+ isConnecting,
54472
+ isRinging,
54473
+ callDurationSeconds,
54474
+ callTarget,
54475
+ statusVisualUsed: isCallActive ? "GREEN (emerald)" : "statusVisual",
54476
+ timerVisible: isCallActive && callDurationSeconds > 0
54477
+ });
54460
54478
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
54461
54479
  "div",
54462
54480
  {