@sawport/react-sdk 1.2.5-beta.4 → 1.2.5-beta.5

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/dist/index.js CHANGED
@@ -104483,7 +104483,7 @@ const EmptySchedule = ({ brandColor = "#1A4C9D" }) => {
104483
104483
  return /* @__PURE__ */ jsxs(Col, { className: `${styles$1.emptyState} mt-4`, children: [
104484
104484
  /* @__PURE__ */ jsx("div", { className: styles$1.schIconCon, children: /* @__PURE__ */ jsx(RefIcon$h, { style: { color: brandColor, fontSize: 18 } }) }),
104485
104485
  /* @__PURE__ */ jsx("p", { className: styles$1.schTitle, children: "No Scheduled Meetings" }),
104486
- /* @__PURE__ */ jsx("p", { className: styles$1.schSubtitle, children: "You have no upcoming virtual meetings yet." })
104486
+ /* @__PURE__ */ jsx("p", { className: styles$1.schSubtitle, children: "You have no upcoming virtual meetings." })
104487
104487
  ] });
104488
104488
  };
104489
104489
  const EmptySchedule$1 = memo(EmptySchedule);
@@ -107075,7 +107075,7 @@ function WidgetOnlineHeader({ company }) {
107075
107075
  /* @__PURE__ */ jsxs("p", { className: "my-1", style: { fontSize: 13 }, children: [
107076
107076
  "Please fill out the form below to start virtual ",
107077
107077
  /* @__PURE__ */ jsx("br", {}),
107078
- " engagement with the next available agent"
107078
+ " engagement with the next available agent."
107079
107079
  ] })
107080
107080
  ]
107081
107081
  }
@@ -119928,7 +119928,6 @@ const CallInviteModal = ({
119928
119928
  onCancel,
119929
119929
  conversationId,
119930
119930
  customerId,
119931
- inviteLink,
119932
119931
  brandColor = "#034ea2",
119933
119932
  initialForm,
119934
119933
  onSuccess,
@@ -119953,20 +119952,23 @@ const CallInviteModal = ({
119953
119952
  const onSend = async () => {
119954
119953
  try {
119955
119954
  setLoading(true);
119956
- await sendConversationInvite({
119955
+ const payload = {
119957
119956
  customer_id: customerId,
119958
119957
  conversation_id: conversationId,
119959
- invite_link: inviteLink || "https://meet.com",
119958
+ invite_link: "https://meet.sawport.com",
119960
119959
  email: form.email,
119961
119960
  name: form.fullName
119962
- });
119961
+ };
119962
+ await sendConversationInvite(payload);
119963
119963
  setLoading(false);
119964
+ y.success("Invitation sent successfully!");
119964
119965
  onSuccess == null ? void 0 : onSuccess({ email: form.email, name: form.fullName });
119965
119966
  setForm({ fullName: "", email: "" });
119966
119967
  onCancel();
119967
119968
  } catch (error) {
119968
119969
  setLoading(false);
119969
119970
  onError == null ? void 0 : onError(error);
119971
+ y.error("Failed to send invitation.");
119970
119972
  }
119971
119973
  };
119972
119974
  return /* @__PURE__ */ jsx(
@@ -120050,11 +120052,23 @@ const CallInviteModal = ({
120050
120052
  }
120051
120053
  ),
120052
120054
  /* @__PURE__ */ jsxs("div", { style: { padding: "20px 32px 28px 32px", textAlign: "left" }, children: [
120053
- /* @__PURE__ */ jsxs("div", { className: "text-sm sm:text-base text-[#222] mb-4 font-medium leading-snug", children: [
120054
- "Invite someone to join this call session",
120055
- /* @__PURE__ */ jsx("br", {}),
120056
- "by sending them an invitation link."
120057
- ] }),
120055
+ /* @__PURE__ */ jsxs(
120056
+ "div",
120057
+ {
120058
+ style: {
120059
+ fontSize: 17,
120060
+ color: "#222",
120061
+ marginBottom: 16,
120062
+ fontWeight: 500,
120063
+ lineHeight: 1.4
120064
+ },
120065
+ children: [
120066
+ "Invite someone to join this call session",
120067
+ /* @__PURE__ */ jsx("br", {}),
120068
+ "by sending them an invitation link."
120069
+ ]
120070
+ }
120071
+ ),
120058
120072
  /* @__PURE__ */ jsx(
120059
120073
  FInput,
120060
120074
  {
@@ -120229,7 +120243,6 @@ const VideoChat = ({
120229
120243
  conversationId,
120230
120244
  inviteLink,
120231
120245
  brandColor,
120232
- error,
120233
120246
  isConnecting = false
120234
120247
  }) => {
120235
120248
  const isMobile2 = useMemo$2(() => detectMobile(), []);
@@ -120317,8 +120330,7 @@ const VideoChat = ({
120317
120330
  localParticipant,
120318
120331
  isMobile: isMobile2
120319
120332
  }
120320
- ) }) }),
120321
- error && /* @__PURE__ */ jsx("div", { className: "text-red-500 text-xs p-2 absolute bottom-2 left-2 bg-white/70 rounded", children: String(error) })
120333
+ ) }) })
120322
120334
  ]
120323
120335
  }
120324
120336
  );
@@ -120479,6 +120491,7 @@ const IncomingVideoCallModal = memo(
120479
120491
  rejectCall,
120480
120492
  callerName = "Caller",
120481
120493
  callerImage,
120494
+ callerTitle = "Agent",
120482
120495
  brandColor = "#ffffff"
120483
120496
  }) => {
120484
120497
  return /* @__PURE__ */ jsx(
@@ -120520,10 +120533,11 @@ const IncomingVideoCallModal = memo(
120520
120533
  "h3",
120521
120534
  {
120522
120535
  className: "text-center mt-4",
120523
- style: { fontSize: 20, fontWeight: 700, color: "#1F2937", letterSpacing: -0.3 },
120536
+ style: { fontSize: 20, fontWeight: 500, color: "#1F2937", letterSpacing: -0.3 },
120524
120537
  children: callerName
120525
120538
  }
120526
- )
120539
+ ),
120540
+ /* @__PURE__ */ jsx("p", { className: "text-black text-center", style: { fontSize: 13 }, children: callerTitle || "Agent" })
120527
120541
  ] }),
120528
120542
  /* @__PURE__ */ jsxs("div", { style: incomingModalStyles.buttonContainer, children: [
120529
120543
  /* @__PURE__ */ jsx(
@@ -120835,7 +120849,8 @@ const VideoCall = ({ userId, conversation_id, brandColor }) => {
120835
120849
  const fullName = `${firstName} ${lastName}`.trim();
120836
120850
  return {
120837
120851
  name: fullName || "Agent",
120838
- image: agent.profile_picture || agent.image
120852
+ image: agent.profile_picture || agent.image,
120853
+ title: agent.title || "Agent"
120839
120854
  };
120840
120855
  }
120841
120856
  }
@@ -120843,7 +120858,8 @@ const VideoCall = ({ userId, conversation_id, brandColor }) => {
120843
120858
  if (agentParticipant) {
120844
120859
  return {
120845
120860
  name: agentParticipant.displayName || "Agent",
120846
- image: void 0
120861
+ image: void 0,
120862
+ title: void 0
120847
120863
  };
120848
120864
  }
120849
120865
  return null;
@@ -120919,7 +120935,8 @@ const VideoCall = ({ userId, conversation_id, brandColor }) => {
120919
120935
  }
120920
120936
  const callerInfo = {
120921
120937
  name: (agentInfo == null ? void 0 : agentInfo.name) || "Agent",
120922
- image: agentInfo == null ? void 0 : agentInfo.image
120938
+ image: agentInfo == null ? void 0 : agentInfo.image,
120939
+ title: (agentInfo == null ? void 0 : agentInfo.title) || "Agent"
120923
120940
  };
120924
120941
  setIsIncomingCall(true);
120925
120942
  setIncomingCallerInfo(callerInfo);
@@ -121089,7 +121106,8 @@ const VideoCall = ({ userId, conversation_id, brandColor }) => {
121089
121106
  try {
121090
121107
  await startScreenShare();
121091
121108
  } catch (error2) {
121092
- console.error("Failed to start screen share:", error2);
121109
+ const message = error2 instanceof Error ? error2.message : String(error2);
121110
+ y.error(`Failed to start screen share: ${message}`, { autoClose: 3e3 });
121093
121111
  }
121094
121112
  },
121095
121113
  stopScreenSharing: async () => {
@@ -121100,7 +121118,8 @@ const VideoCall = ({ userId, conversation_id, brandColor }) => {
121100
121118
  try {
121101
121119
  await stopScreenShare();
121102
121120
  } catch (error2) {
121103
- console.error("Failed to stop screen share:", error2);
121121
+ const message = error2 instanceof Error ? error2.message : String(error2);
121122
+ y.error(`Failed to stop screen share: ${message}`, { autoClose: 3e3 });
121104
121123
  }
121105
121124
  },
121106
121125
  screenShared: (transformedLocalParticipant == null ? void 0 : transformedLocalParticipant.screenShared) || false,
@@ -121126,6 +121145,7 @@ const VideoCall = ({ userId, conversation_id, brandColor }) => {
121126
121145
  },
121127
121146
  callerName: (incomingCallerInfo == null ? void 0 : incomingCallerInfo.name) || (agentInfo == null ? void 0 : agentInfo.name),
121128
121147
  callerImage: (incomingCallerInfo == null ? void 0 : incomingCallerInfo.image) || (agentInfo == null ? void 0 : agentInfo.image),
121148
+ callerTitle: (incomingCallerInfo == null ? void 0 : incomingCallerInfo.title) || (agentInfo == null ? void 0 : agentInfo.title),
121129
121149
  brandColor
121130
121150
  }
121131
121151
  )