@sawport/react-sdk 0.1.0-alpha.62 → 0.1.0-alpha.64
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 +56 -37
- package/dist/index.umd.js +12 -12
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27056,20 +27056,20 @@ const viewCalendar = (id2, params) => api("/calendars/" + id2, params);
|
|
|
27056
27056
|
const updateCalendar = (id2, params) => api("/calendars/" + id2, params, "put");
|
|
27057
27057
|
const schedule = (params) => api("/calendars", params, "post");
|
|
27058
27058
|
const getSlots = (params) => api("/calendars/slots", params);
|
|
27059
|
-
const input = "
|
|
27060
|
-
const offline_input = "
|
|
27061
|
-
const scheduleBtn = "
|
|
27062
|
-
const schTitle = "
|
|
27063
|
-
const schAvatar = "
|
|
27064
|
-
const schIconCon = "
|
|
27065
|
-
const schedules = "
|
|
27066
|
-
const reason = "
|
|
27067
|
-
const schTime = "
|
|
27068
|
-
const schActionBtn = "
|
|
27069
|
-
const schActionBtnJoin = "
|
|
27070
|
-
const schActionBtnPending = "
|
|
27071
|
-
const picker = "
|
|
27072
|
-
const inputError = "
|
|
27059
|
+
const input = "_input_u3x0g_1";
|
|
27060
|
+
const offline_input = "_offline_input_u3x0g_6";
|
|
27061
|
+
const scheduleBtn = "_scheduleBtn_u3x0g_11";
|
|
27062
|
+
const schTitle = "_schTitle_u3x0g_16";
|
|
27063
|
+
const schAvatar = "_schAvatar_u3x0g_21";
|
|
27064
|
+
const schIconCon = "_schIconCon_u3x0g_27";
|
|
27065
|
+
const schedules = "_schedules_u3x0g_34";
|
|
27066
|
+
const reason = "_reason_u3x0g_38";
|
|
27067
|
+
const schTime = "_schTime_u3x0g_43";
|
|
27068
|
+
const schActionBtn = "_schActionBtn_u3x0g_47";
|
|
27069
|
+
const schActionBtnJoin = "_schActionBtnJoin_u3x0g_47";
|
|
27070
|
+
const schActionBtnPending = "_schActionBtnPending_u3x0g_47";
|
|
27071
|
+
const picker = "_picker_u3x0g_62";
|
|
27072
|
+
const inputError = "_inputError_u3x0g_67";
|
|
27073
27073
|
const styles$2 = {
|
|
27074
27074
|
input,
|
|
27075
27075
|
offline_input,
|
|
@@ -67102,13 +67102,15 @@ const styles$1 = {
|
|
|
67102
67102
|
}
|
|
67103
67103
|
};
|
|
67104
67104
|
const Schedule = ({
|
|
67105
|
+
status,
|
|
67105
67106
|
actionist,
|
|
67106
67107
|
reason: reason2,
|
|
67107
67108
|
scheduledAt,
|
|
67108
67109
|
conversation,
|
|
67109
67110
|
join: join2,
|
|
67110
67111
|
reschedule,
|
|
67111
|
-
id: id2
|
|
67112
|
+
id: id2,
|
|
67113
|
+
cancelCall
|
|
67112
67114
|
}) => {
|
|
67113
67115
|
const onJoin = () => join2({
|
|
67114
67116
|
conversation
|
|
@@ -67116,6 +67118,9 @@ const Schedule = ({
|
|
|
67116
67118
|
const onReschedule = () => reschedule({
|
|
67117
67119
|
id: id2
|
|
67118
67120
|
});
|
|
67121
|
+
const onCallCancel = () => cancelCall({
|
|
67122
|
+
id: id2
|
|
67123
|
+
});
|
|
67119
67124
|
return /* @__PURE__ */ jsxs(Col$1, {
|
|
67120
67125
|
className: "my-3 border-bottom pb-3",
|
|
67121
67126
|
children: [/* @__PURE__ */ jsxs(Row$1, {
|
|
@@ -67161,7 +67166,11 @@ const Schedule = ({
|
|
|
67161
67166
|
})]
|
|
67162
67167
|
}), /* @__PURE__ */ jsxs(Row$1, {
|
|
67163
67168
|
className: "w-100 ml-4 pl-2",
|
|
67164
|
-
children: [/* @__PURE__ */ jsx(Button$1, {
|
|
67169
|
+
children: [status === "accepted" ? /* @__PURE__ */ jsx(Button$1, {
|
|
67170
|
+
onClick: onCallCancel,
|
|
67171
|
+
className: styles$2.schActionBtnPending + " border-0 rounded-pill mt-2",
|
|
67172
|
+
children: "Cancel"
|
|
67173
|
+
}) : /* @__PURE__ */ jsx(Button$1, {
|
|
67165
67174
|
onClick: onReschedule,
|
|
67166
67175
|
className: styles$2.schActionBtn + " border-0 rounded-pill mt-2",
|
|
67167
67176
|
children: "Reschedule"
|
|
@@ -67770,7 +67779,8 @@ const Schedules = react.exports.memo(function({
|
|
|
67770
67779
|
state: {
|
|
67771
67780
|
data: {
|
|
67772
67781
|
data: schedules2 = []
|
|
67773
|
-
} = {}
|
|
67782
|
+
} = {},
|
|
67783
|
+
isLoading
|
|
67774
67784
|
}
|
|
67775
67785
|
} = useRequest({
|
|
67776
67786
|
asyncRequest: calendars,
|
|
@@ -67828,6 +67838,17 @@ const Schedules = react.exports.memo(function({
|
|
|
67828
67838
|
calendar: calendar2
|
|
67829
67839
|
});
|
|
67830
67840
|
}, []);
|
|
67841
|
+
const cancelCall = react.exports.useCallback(async ({
|
|
67842
|
+
id: id2
|
|
67843
|
+
}) => {
|
|
67844
|
+
await updateCalendar(id2, {
|
|
67845
|
+
status: "cancelled"
|
|
67846
|
+
});
|
|
67847
|
+
setParentState({
|
|
67848
|
+
companyClosed: true,
|
|
67849
|
+
isScheduling: false
|
|
67850
|
+
});
|
|
67851
|
+
}, []);
|
|
67831
67852
|
return /* @__PURE__ */ jsxs(Col$1, {
|
|
67832
67853
|
className: "",
|
|
67833
67854
|
align: "middle",
|
|
@@ -67836,11 +67857,12 @@ const Schedules = react.exports.memo(function({
|
|
|
67836
67857
|
children: "Scheduled Appointments"
|
|
67837
67858
|
}), /* @__PURE__ */ jsx("div", {
|
|
67838
67859
|
className: `${styles$2.schedules} scroller`,
|
|
67839
|
-
children: (schedules2 == null ? void 0 : schedules2.length) ? schedules2.map((sch,
|
|
67860
|
+
children: isLoading ? /* @__PURE__ */ jsx(SpinFC$1, {}) : (schedules2 == null ? void 0 : schedules2.length) ? schedules2.map((sch, index2) => /* @__PURE__ */ react.exports.createElement(Schedule$1, {
|
|
67840
67861
|
...sch,
|
|
67841
67862
|
join: join2,
|
|
67863
|
+
cancelCall,
|
|
67842
67864
|
reschedule,
|
|
67843
|
-
key:
|
|
67865
|
+
key: index2
|
|
67844
67866
|
})) : /* @__PURE__ */ jsx(EmptySchedule$1, {})
|
|
67845
67867
|
}), /* @__PURE__ */ jsx(Button$1, {
|
|
67846
67868
|
type: "primary",
|
|
@@ -72047,14 +72069,12 @@ function ChatWidgetScreen({
|
|
|
72047
72069
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
72048
72070
|
id: "widget-chat-send",
|
|
72049
72071
|
className: "widget-chat-display-container",
|
|
72050
|
-
children: [/* @__PURE__ */
|
|
72072
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
72051
72073
|
className: "chat-receive-container mb-4 d-flex align-items-center",
|
|
72052
|
-
children:
|
|
72074
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
72053
72075
|
className: `widget-chat-receive mb-0`,
|
|
72054
72076
|
children: welcome_message
|
|
72055
|
-
})
|
|
72056
|
-
children: hooks().calendar()
|
|
72057
|
-
})]
|
|
72077
|
+
})
|
|
72058
72078
|
}), /* @__PURE__ */ jsx(Messages, {
|
|
72059
72079
|
chatMessages: messages2,
|
|
72060
72080
|
dataRef,
|
|
@@ -72518,8 +72538,8 @@ function WidgetOfflineHeader({
|
|
|
72518
72538
|
}), /* @__PURE__ */ jsx(SubTitle, {
|
|
72519
72539
|
from_day: company == null ? void 0 : company.from_day.substring(0, 3),
|
|
72520
72540
|
to_day: company == null ? void 0 : company.to_day.substring(0, 3),
|
|
72521
|
-
from_time: hooks(company == null ? void 0 : company.from_time, "hh:mm").format("hh:mm A"),
|
|
72522
|
-
to_time: hooks(company == null ? void 0 : company.to_time, "hh:mm").format("hh:mm A")
|
|
72541
|
+
from_time: hooks.tz(company == null ? void 0 : company.from_time, "hh:mm", company.timezone).local().format("hh:mm A"),
|
|
72542
|
+
to_time: hooks.tz(company == null ? void 0 : company.to_time, "hh:mm", company.timezone).local().format("hh:mm A")
|
|
72523
72543
|
})]
|
|
72524
72544
|
});
|
|
72525
72545
|
}
|
|
@@ -73076,6 +73096,7 @@ function useVideoCalling({ userId, conversation_id }) {
|
|
|
73076
73096
|
}, [ref]);
|
|
73077
73097
|
const callCleanup = react.exports.useCallback(
|
|
73078
73098
|
(setUp) => {
|
|
73099
|
+
var _a, _b;
|
|
73079
73100
|
if (ref.current.localStream) {
|
|
73080
73101
|
const { peerConnection } = ref.current;
|
|
73081
73102
|
if (document.pictureInPictureElement) {
|
|
@@ -73087,7 +73108,8 @@ function useVideoCalling({ userId, conversation_id }) {
|
|
|
73087
73108
|
peerConnection.onaddstream = null;
|
|
73088
73109
|
localVideoRef.current && (localVideoRef.current.srcObject = null);
|
|
73089
73110
|
remoteVideoRef.current && (remoteVideoRef.current.srcObject = null);
|
|
73090
|
-
ref.current.localStream.getTracks().forEach((track) => track.stop());
|
|
73111
|
+
(_a = ref.current.localStream) == null ? void 0 : _a.getTracks().forEach((track) => track.stop());
|
|
73112
|
+
(_b = ref.current.screenStream) == null ? void 0 : _b.getVideoTracks().forEach((track) => track.stop());
|
|
73091
73113
|
if (setUp) {
|
|
73092
73114
|
ref.current.peerConnection = new RTCPeerConnection(peerConnectionConfig);
|
|
73093
73115
|
}
|
|
@@ -73266,14 +73288,14 @@ function useVideoCalling({ userId, conversation_id }) {
|
|
|
73266
73288
|
};
|
|
73267
73289
|
const reject = () => {
|
|
73268
73290
|
ref.current.isInit = false;
|
|
73269
|
-
clearCalls({ callUserId: void 0 });
|
|
73270
73291
|
callCleanup(true);
|
|
73292
|
+
clearCalls({ callUserId: void 0 });
|
|
73271
73293
|
toast.error("Call Rejected");
|
|
73272
73294
|
};
|
|
73273
73295
|
const ended = () => {
|
|
73274
73296
|
ref.current.isInit = false;
|
|
73275
|
-
clearCalls({ callUserId: void 0 });
|
|
73276
73297
|
callCleanup(true);
|
|
73298
|
+
clearCalls({ callUserId: void 0 });
|
|
73277
73299
|
};
|
|
73278
73300
|
const onExpectScreenShare = (data2) => ref.current.expectScreenShare = data2.value;
|
|
73279
73301
|
const candidate = ({ candidate: candidate2 }) => {
|
|
@@ -73349,8 +73371,8 @@ function useVideoCalling({ userId, conversation_id }) {
|
|
|
73349
73371
|
if (stateRef.current.isCalling || stateRef.current.isOutgoing) {
|
|
73350
73372
|
const data2 = ref.current.data;
|
|
73351
73373
|
ref.current.isInit = false;
|
|
73352
|
-
clearCalls({ callUserId: void 0 });
|
|
73353
73374
|
callCleanup(true);
|
|
73375
|
+
clearCalls({ callUserId: void 0 });
|
|
73354
73376
|
socket2.emit("end-call", {
|
|
73355
73377
|
to: (data2 == null ? void 0 : data2.from) || stateRef.current.callUserId,
|
|
73356
73378
|
from: data2 == null ? void 0 : data2.to,
|
|
@@ -73929,16 +73951,13 @@ const WidgetInitOnlineHeader = ({
|
|
|
73929
73951
|
alt: "Banner",
|
|
73930
73952
|
className: "banner-image"
|
|
73931
73953
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
73932
|
-
className: "
|
|
73954
|
+
className: "ml-2 d-flex align-items-center",
|
|
73933
73955
|
children: [company.logo && /* @__PURE__ */ jsx("img", {
|
|
73934
73956
|
src: company == null ? void 0 : company.logo,
|
|
73935
73957
|
alt: "logo",
|
|
73936
73958
|
style: {
|
|
73937
73959
|
width: "50px",
|
|
73938
|
-
height: "50px"
|
|
73939
|
-
position: "absolute",
|
|
73940
|
-
left: "10px",
|
|
73941
|
-
top: "20px"
|
|
73960
|
+
height: "50px"
|
|
73942
73961
|
}
|
|
73943
73962
|
}), /* @__PURE__ */ jsx("p", {
|
|
73944
73963
|
className: "ml-3 p my-3",
|
|
@@ -74044,8 +74063,8 @@ function UnwrapWidget({
|
|
|
74044
74063
|
const cDay = now2.day();
|
|
74045
74064
|
const startDay = days[company == null ? void 0 : company.from_day];
|
|
74046
74065
|
const endDay = days[company == null ? void 0 : company.to_day];
|
|
74047
|
-
const time2 = hooks(company == null ? void 0 : company.from_time, "hh:mm:ss");
|
|
74048
|
-
const endtime = hooks(company == null ? void 0 : company.to_time, "hh:mm:ss");
|
|
74066
|
+
const time2 = hooks.tz(company == null ? void 0 : company.from_time, "hh:mm:ss", company == null ? void 0 : company.timezone).local();
|
|
74067
|
+
const endtime = hooks.tz(company == null ? void 0 : company.to_time, "hh:mm:ss", company == null ? void 0 : company.timezone).local();
|
|
74049
74068
|
return !(cDay >= startDay && cDay <= endDay && now2.isAfter(time2) && now2.isBefore(endtime));
|
|
74050
74069
|
}
|
|
74051
74070
|
}, [isLoadingCompany, company == null ? void 0 : company.name, company == null ? void 0 : company.timezone]);
|